Automatic date update in version.in
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
e1663197
CC
12015-03-09 Cary Coutant <ccoutant@google.com>
2
3 PR gold/14675
4 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
5 return enum indicating whether .eh_frame section is empty, optimizable,
6 unrecognized, or an end marker. Adjust explicit instantiations.
7 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
8 (Eh_frame::add_ehframe_input_section): Change return type.
9 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
10 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
11 to the .eh_frame output section until we see the end marker.
12 (Layout::finalize_eh_frame_section): New.
13 * layout.h: (Layout::finalize_eh_frame_section): New.
14
beb8418f
L
152015-03-05 H.J. Lu <hongjiu.lu@intel.com>
16
17 * output.cc (Relobj::initialize_input_to_output_map<size>):
18 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
19
48c73428
CC
202015-03-04 Cary Coutant <ccoutant@google.com>
21
22 * parameters.cc (Parameters::set_target_once): Call
23 Target::select_as_default_target just once from here...
24 (set_parameters_target): ...instead of from here.
25
262015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
dbe40a88
RÁE
27
28 * ehframe.cc (Cie::set_output_offset): Pass in and use a
29 Output_section_data instead of a Merge_map.
30 (Eh_frame::Eh_frame): Don't initialize merge_map_.
31 (Eh_frame::read_cie): Use add_merge_mapping instead of
32 Merge_map::add_mapping.
33 (Eh_frame::read_fde): Ditto.
34 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
35 (Eh_frame::do_output_offset): Use merge_output_offset istead of
36 merge_map_->get_output_offset.
37 (Eh_frame::do_is_merge_section_for): Delete.
38 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
39 instead of a Merge_map.
40 (Cie::set_output_offset): Pass in a Output_section_data instead of a
41 Merge_map.
42 (Eh_frame::do_is_merge_section_for): Delete.
43 (Eh_frame::merge_map_): Delete.
44 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
45 and use a Output_section_data instead of a Merge_map.
46 (Object_merge_map::add_mapping): Ditto.
47 (Object_merge_map::get_output_offset): Remove the merge_map argument.
48 (Object_merge_map::is_merge_section_for): Pass in and use a
49 Output_section_data instead of a Merge_map.
50 (Merge_map): Delete.
51 (Output_merge_base::do_output_offset): Use merge_output_offset instead
52 of merge_map_.get_output_offset.
53 (Output_merge_base::do_is_merge_section_for): Delete.
54 (Output_merge_data::do_add_input_section): Use
55 object->add_merge_mapping instead of add_mapping.
56 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
57 * merge.h (Merge_map): Delete forward declaration.
58 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
59 instead of a Merge_map.
60 (Object_merge_map::get_output_offset): Remove the merge_map argument.
61 (Object_merge_map::is_merge_section_for): Pass in and use a
62 Output_section_data instead of a Merge_map.
63 (Input_merge_map::Object_merge_map::merge_map): Replace with
64 output_data.
65 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
66 Output_section_data instead of a Merge_map.
67 (Merge_map): Delete.
68 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
69 (Output_merge_base::do_is_merge_section_for): Delete.
70 (Output_merge_base::add_mapping): Delete.
71 (Output_merge_base::merge_map_): Delete.
72 * object.cc (Relobj::initialize_input_to_output_map): New.
73 (Relobj::initialize_input_to_output_map): New.
74 (Relobj::merge_output_offset): New.
75 (Relobj::is_merge_section_for): New.
76 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
77 bits.
78 * object.h (Relobj::merge_map): Delete.
79 (initialize_input_to_output_map): New.
80 (set_merge_map): Delete.
81 (add_merge_mapping): New.
82 (merge_output_offset): New.
83 (is_merge_section_for): New.
84 * output.cc (Output_section::Input_section::is_merge_section_for):
85 Use object->is_merge_section_for.
86 * output.h (Output_section_data::is_merge_section_for): Delete.
87 (Output_section_data::do_is_merge_section_for): Delete.
88 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
89 Use object->initialize_input_to_output_map.
90 (Merged_symbol_value<size>::value_from_output_section): Use
91 object->merge_output_offset.
92
48c73428 932015-03-02 Peter Collingbourne <pcc@google.com>
2c7b626c
CC
94 Cary Coutant <ccoutant@google.com>
95
96 * output.cc (Output_section::add_merge_input_section): Do not
97 attempt to merge sections with an entsize of 0.
98
48c73428 992015-03-02 Khem Raj <raj.khem@gmail.com>
5b07cd84
CC
100
101 * attributes.h (class Output_attributes_section_data ): Add
102 do_print_to_mapfile function.
103
ec86f434
AM
1042015-02-24 Alan Modra <amodra@gmail.com>
105
106 PR 18010
107 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
108 complain if value is not a multiple of four.
109 (Target_powerpc::Relocate::relocate): Correct handling of
110 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
111
be66981e
L
1122015-02-21 H.J. Lu <hongjiu.lu@intel.com>
113
114 * configure.ac (default_size): Set to 32 for x32.
115 * configure: Regenerated.
116
e3ee8ed4
AM
1172015-02-18 Alan Modra <amodra@gmail.com>
118
119 PR 17954
120 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
121 visibility.
122
3a935c6c
RÁE
1232015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
124
125 * gc.h (Garbage_collection::add_reference): Don't use find.
126
e0a1e121
RÁE
1272015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
128
129 * object.cc (write_local_symbols): avoid std::vector copy.
130
45a4fb1a
RÁE
1312015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
132
133 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
134
2d9afefe
MW
1352015-02-09 Mark Wielaard <mjw@redhat.com>
136
137 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
138 DW_LANG_Fortran03 and DW_LANG_Fortran08.
139
e9c1bdad
CC
1402015-02-16 Cary Coutant <ccoutant@google.com>
141
142 PR gold/13577
143 PR gold/16992
144 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
145 DF_SYMBOLIC if --dynamic-list option is used.
146 * options.cc (General_options::finalize): --dynamic-list is not
147 mutually exclusive with -Bsymbolic.
148 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
149 listed in --dynamic-list.
150 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
151 -Bsymbolic-functions.
152 * testsuite/Makefile.in: Regenerate.
153
0ed4b0bf
CC
1542015-02-16 Cary Coutant <ccoutant@google.com>
155
156 PR gold/17971
157 * incremental.cc: Remove redundant include of "output.h".
158
1a920511
JY
1592015-02-12 Jing Yu <jingyu@google.com>
160
161 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
162 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
163 New relocation.
164 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
165 TLSLE_MOVW_* relocations.
166 (Target_aarch64::Scan::global): Likewise.
167 (Target_aarch64::Relocate::relocate): Likewise.
168 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
169 for new TLSLE_MOVW_* relocations.
170
07f107f3
WN
1712015-02-11 Will Newton <will.newton@linaro.org>
172
173 PR gold/13321
174 * arm.cc (Target_arm::make_plt_section): Create an ARM
175 state mapping symbol at the start of the PLT.
176
e051a5b5
L
1772015-02-09 H.J. Lu <hongjiu.lu@intel.com>
178
179 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
180 Replace two_file_shared_2.so with two_file_shared_1.so.
181 * testsuite/Makefile.in: Regenerated.
182
dddcc5b9
AM
1832015-02-09 Alan Modra <amodra@gmail.com>
184
185 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
186 plugin_test_thin.a and defsym_test.
187 * testsuite/Makefile.in: Regenerate.
188
b39b8b9d
RÁE
1892015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
190
191 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
192 body.
193
b66d1c52
CC
1942015-02-04 Peter Collingbourne <pcc@google.com>
195
196 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
197 forwarding symbols when computing symbol resolution info for plugins.
198 * plugin.h (Plugin_manager::symtab): New method.
199 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
200
23081de0
CC
2012015-02-03 Cary Coutant <ccoutant@google.com>
202 Peter Collingbourne <pcc@google.com>
203
204 PR gold/15660
205 * archive.cc (Thin_archive_object_unlocker): New class.
206 (Archive::include_member): Unlock external members of thin archives.
207 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
208 (plugin_test_2): Likewise.
209 (plugin_test_3): Likewise.
210 (plugin_test_4): Likewise.
211 (plugin_test_5): Likewise.
212 (plugin_test_6): Likewise.
213 (plugin_test_7): Likewise.
214 (plugin_test_8): Likewise.
215 (plugin_test_9): Likewise.
216 (plugin_test_10): Likewise.
217 (plugin_test_11): New test case.
218 * testsuite/Makefile.in: Regenerate.
219 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
220 file to decide whether to claim file.
221 (all_symbols_read_hook): Likewise.
222 * testsuite/plugin_test_1.sh: Adjust expected output.
223 * testsuite/plugin_test_2.sh: Likewise.
224 * testsuite/plugin_test_3.sh: Likewise.
225 * testsuite/plugin_test_6.sh: Likewise.
226 * testsuite/plugin_test_tls.sh: Likewise.
227 * testsuite/plugin_test_11.sh: New testcase.
228
2292015-02-03 Cary Coutant <ccoutant@google.com>
230
231 * descriptors.cc (Descriptors::open): Set artificially-low limit for
232 file descriptors when debugging enabled. Add debug output.
233 (Descriptors::release): Add debug output.
234 (Descriptors::close_some_descriptor): Likewise.
235 (Descriptors::close_all): Likewise.
236 * fileread.cc (File_read::lock): Likewise.
237 (File_read::unlock): Likewise.
238
24dd5808
CC
2392015-02-02 Cary Coutant <ccoutant@google.com>
240
241 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
242 executable output file.
243
fa89cc82
HS
2442015-01-22 Han Shen <shenhan@google.com>
245
246 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
247 (Target_arm::do_plt_address_for_global): New method.
248 (Target_arm::do_plt_address_for_local): New method.
249 (Target_arm::rel_irelative_section): New method.
250 (Target_arm::make_data_plt): Add more parameters for plt ctor.
251 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
252 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
253 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
254 (Target_arm::Scan::check_non_pic): Add ifunc support.
255 (Target_arm::Scan::local): Add ifunc support.
256 (Target_arm::Scan::global): Add ifunc support.
257 (Target_arm::make_plt_section): New method.
258 (Target_arm::make_plt_entry): Change to call to make_plt_section.
259 (Target_arm::make_local_ifunc_plt_entry): New method.
260 (Target_arm::got_irelative_): New member.
261 (Target_arm::rel_irelative_): New member.
262 (Target_arm::got_section): Add creation for got_irelative_.
263 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
264 (Target_arm::Relocate::relocate): Properly set local ifunc address.
265 (Target_arm::do_dynsym_value): Properly set global ifunc address.
266 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
267 (Output_data_plt_arm::IRelative_data): New type.
268 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
269 (Output_data_plt_arm::add_entry): Add more parameters.
270 (Output_data_plt_arm::add_relocation): New method.
271 (Output_data_plt_arm::add_local_ifunc_entry): New method.
272 (Output_data_plt_arm::rel_irelative): New method.
273 (Output_data_plt_arm::entry_count): Modified.
274 (Output_data_plt_arm::address_for_global): New method.
275 (Output_data_plt_arm::address_for_local): New method.
23081de0 276gold/
fa89cc82
HS
277 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
278 (Output_data_plt_arm::insert_irelative_data): New method.
279 (Output_data_plt_arm::irelative_rel_): New member.
280 (Output_data_plt_arm::got_): New member.
281 (Output_data_plt_arm::got_irelative_): New member.
282 (Output_data_plt_arm::irelative_count_): New member.
283 (Output_data_plt_arm::IRelative_data_vec): New typedef.
284 (Output_data_plt_arm::irelative_data_vec_): New member.
285 (Output_data_plt_arm::do_write): Write out irelative entries.
286 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
287 more parameters to ctor.
288 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
289 more parameters to ctor.
290 * output.h (Output_data_reloc::add_local_relative): New method.
291 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
292
0f81d3f0
AM
2932015-01-29 Alan Modra <amodra@gmail.com>
294
295 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
296 and GOT_TLSGD to LE optimization.
297
65d92137
CC
2982015-01-28 Cary Coutant <ccoutant@google.com>
299
300 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
301 for undef TLS symbols.
302 (Target_x86_64::Relocate::relocate_tls): Likewise.
303 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
304
5485698a
CC
3052015-01-25 Cary Coutant <ccoutant@google.com>
306
307 * output.cc (Output_segment::set_section_addresses): Fix calculation
308 of size of relro segment.
309
b01a4b04
AM
3102015-01-22 Alan Modra <amodra@gmail.com>
311
312 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
313 condition for need of ifunc plt entry.
314 (Target_powerpc::Scan::global <got relocs>): Likewise.
315
3d0064a9
CC
3162015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
317
318 * mips.cc (reloc_high): Add r_sym.
319 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
320 reloc_high constructor.
321 (Mips_relocate_functions::relgot16_local): Likewise.
322 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
323 r_type to decide whether LO16 matches HI16.
324 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
325 rello16 and relgot16_local.
326
a5cd8f05
CC
3272015-01-09 Cary Coutant <ccoutant@google.com>
328
329 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
330 unless alignment is larger than page size.
331
4fc1b9d4
L
3322015-01-06 H.J. Lu <hongjiu.lu@intel.com>
333 Cary Coutant <ccoutant@google.com>
334
335 PR gold/17729
336 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
337 (DEFAULT_TARGET_X32): Set for x32.
338 * x86_64.cc (cmp_insn_32): New.
339 (lea_r10_insn_32): Likewise.
340 (lea_r11_insn_32): Likewise.
341 (cmp_insn_64): Likewise.
342 (lea_r10_insn_64): Likewise.
343 (lea_r11_insn_64): Likewise.
344 (Target_x86_64<size>::do_calls_non_split): Handle x32.
345 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
346 (check_DATA): Add split_x32 files.
347 (split_x32_[1234n].o): New targets.
348 (split_x32_[124]): New targets.
349 (split_x32_[1234r].stdout): New targets.
350 * testsuite/split_x32.sh: New file.
351 * testsuite/split_x32_1.s: Likewise.
352 * testsuite/split_x32_2.s: Likewise.
353 * testsuite/split_x32_3.s: Likewise.
354 * testsuite/split_x32_4.s: Likewise.
355 * testsuite/split_x32_n.s: Likewise.
356 * configure: Regenerated.
357 * testsuite/Makefile.in: Likewise.
358
e749cab8
L
3592015-01-06 H.J. Lu <hongjiu.lu@intel.com>
360
361 PR gold/17809
362 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
363 x32.
364
af759df0
AM
3652015-01-02 Alan Modra <amodra@gmail.com>
366
367 * version.cc (print_version): Just print current year.
368 * dwp.cc (print_version): Likewise.
369
b90efa5b
AM
3702015-01-01 Alan Modra <amodra@gmail.com>
371
372 Update year range in copyright notice of all files.
373
f12d1e8a
AM
3742014-12-25 Alan Modra <amodra@gmail.com>
375
376 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
377 new enums.
378 (Target_arm::merge_object_attributes, ): Likewise.
379
5c294fee
TG
3802014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
381
382 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
383 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
384 AEABI_VFP_args_vfp to check that.
385 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
386 value and replace hardcoded values by enum values.
387
e30880c2
CC
3882014-12-22 Cary Coutant <ccoutant@google.com>
389
390 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
391
bd040da1
L
3922014-12-20 H.J. Lu <hongjiu.lu@intel.com>
393
394 PR gold/14608
395 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
396 to "return i * i * 3;".
397
e02a4046
CC
3982014-12-16 Cary Coutant <ccoutant@google.com>
399
400 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
401 (Mapfile::print_output_data): Use current_data_size() to avoid
402 assert for sections requiring postprocessing; if address is not valid,
403 print 0.
404 (Mapfile::print_output_section): Use current_data_size(); print note
405 that addresses and sizes are before compression.
406
add6016b
L
4072014-12-14 H.J. Lu <hongjiu.lu@intel.com>
408
409 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
410 Cast current_group_size to unsigned long when reporting error.
411
0bf32ea9
JY
4122014-12-10 Jing Yu <jingyu@google.com>
413
414 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
415 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
416 Update error message.
417 (Target_aarch64::do_relax): Use absolute value of option
418 stub_group_size. Replace local variable with class member
419 stub_group_size_.
420
cbcb23fa
AM
4212014-12-04 Alan Modra <amodra@gmail.com>
422
423 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
424 addend of PLTREL24 reloc when not generating a plt stub. Make
425 max_branch_offset an "Address".
fbad6518 426 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
427 (Target_powerpc::Relocate::relocate): Likewise.
428
1611bc4a
AM
4292014-12-04 Alan Modra <amodra@gmail.com>
430
431 PR 17670
432 * symtab.cc (Symbol::set_undefined): Remove assertion.
433 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
434 on symbols defined in discarded sections, instead return false.
435 Rearrange params, update all callers.
436 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
437 branches to syms in discarded sections.
438 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
439 undefined and flag as discarded.
440 (Target_powerpc::Relocate::relocate): Localize variable.
441
4759c34e
L
4422014-12-03 H.J. Lu <hongjiu.lu@intel.com>
443
444 PR gold/17675
445 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
446 * testsuite/Makefile.in: Regenerated.
447
1f98a074
AM
4482014-12-03 Alan Modra <amodra@gmail.com>
449
450 PR 17566
451 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
452 when adding dynamic relocations against section symbols.
453
fb257835
DI
4542014-12-01 Dimitry Ivanov <dimitry@google.com>
455
456 * layout.cc (Layout::finish_dynamic_section): When '-z global'
457 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
458 * options.h (General_options): New -z option (global).
459
d8e60314
CC
4602014-12-01 Cary Coutant <ccoutant@google.com>
461
462 PR gold/17578
463 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
464 is given.
465 (Layout::create_executable_stack_info): Warn when -z noexecstack is
466 given but some inputs require executable stack.
467
982bbd97
CC
4682014-11-26 Cary Coutant <ccoutant@google.com>
469
470 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
471 .debug_str_offsets; strip .debug_gnu_pubnames and
472 .debug_gnu_pubtypes.
473 (lines_only_debug_sections): Strip all four new sections.
474
bb779192
HS
4752014-11-26 Jing Yu <jingyu@google.com>
476
477 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
478 register to be x0 when to relax TLSDESC_LD64_LO12.
479
a3e60ddb
AM
4802014-11-26 Alan Modra <amodra@gmail.com>
481
482 * powerpc.cc (struct Stub_table_owner): New.
483 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
484 unsigned int vector. Update all references.
485 (powerpc_relobj::set_stub_table): Take an unsigned int param
486 rather than a Stub_table. Update callers.
487 (Powerpc_relobj::clear_stub_table): New function.
488 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
489 stub_group_size_ vars.
490 (Target_powerpc::new_stub_table): Delete.
491 (max_branch_delta): New function, extracted from..
492 (Target_powerpc::Relocate::relocate): ..here..
493 (Target_powerpc::Branch_info::make_stub): ..and here. Return
494 status on whether stub created successfully.
495 (Stub_control::Stub_control): Add "no_size_errors" param. Move
496 default sizing to..
497 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
498 reduce on relax failure.
499 (Target_powerpc::group_sections): Add "no_size_errors" param.
500 Use stub_group_size_. Set up group info in a temp vector,
501 before building Stub_table vector. Account for input sections
502 possibly already converted to relaxed sections.
503 (Stub_table::init): Delete. Merge into..
504 (Stub_table::Stub_table): ..here.
505 (Stub_table::can_reach_stub): New function.
506 (Stub_table::add_plt_call_entry): Add "from" parameter and
507 return true iff stub could be reached.
508 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
509 param too.
510 (Stub_table::clear_stubs): Add "all" param.
511
a20605cf
AM
5122014-11-26 Alan Modra <amodra@gmail.com>
513
514 * powerpc.cc (Stub_control::set_output_and_owner): New function.
515 (Target_powerpc::group_sections): Use it.
516
43b64deb
CC
5172014-11-25 Cary Coutant <ccoutant@google.com>
518
519 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
520 (Binary_to_elf::write_symbol): Add st_size parameter.
521 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
522
c924eb67
CC
5232014-11-25 Cary Coutant <ccoutant@google.com>
524
525 PR gold/17639
526 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
527 (Sized_relobj_file::do_layout): Handle deferred sections properly
528 during GC pass 1. Don't add reloc sections to deferred list twice.
529 * object.h (Sized_relobj_file::is_deferred_layout): New function.
530 (Sized_relobj_file::is_deferred_layout_): New data member.
531
9d585188
L
5322014-11-21 H.J. Lu <hongjiu.lu@intel.com>
533
534 PR gold/17619
535 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
536 Check PC-relative offset overflow in PLT entry.
537
3ffaac20
AM
5382014-11-21 Alan Modra <amodra@gmail.com>
539
540 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
541 for undefined weaks.
542
0cfb0717
AM
5432014-11-20 Alan Modra <amodra@gmail.com>
544
545 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
546 from --stub-group-size parameter divided by 1024.
547 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
548 template parameter. Update all uses.
549 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
550 has_stub_value. Set for long branches. Don't report overflow for
551 branch to undefined weak symbols. Print info message on
552 overflowing branch to stub.
553
f9dffbf0
AM
5542014-11-20 Alan Modra <amodra@gmail.com>
555
556 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
557
e88ba8d5
L
5582014-11-13 H.J. Lu <hongjiu.lu@intel.com>
559
560 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
561 entry for R_X86_64_GOTPLT64.
562 (Target_x86_64<size>::Relocate::relocate): Update comments for
563 R_X86_64_GOTPLT64.
564
d37ffe25
ED
5652014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
566
567 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
568 * plugin.h: add lock definition
569
9726c3c1
HS
5702014-10-29 Han Shen <shenhan@google.com>
571 Jing Yu <jingyu@google.com>
572
573 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
574 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
575 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
576 Symbol::TLS_REF.
577 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
578 method.
579 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
580 (Target_aarch64::tls_ld_to_le): New method.
581 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
582 for 64bit targets.
583 (Output_data_plt_aarch64::irelative_rel_): New data member.
584 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
585 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
586 (Output_data_plt_aarch64::add_relocation): New method.
587 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
588 offset. Add got_irelative size to got size.
589 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
590 type string with the new typename.
591 (AArch64_relocate_functions::update_adr): Replace parameter x with
592 immed.
593 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
594 (AArch64_relocate_functions::reloc_common): New method.
595 (AArch64_relocate_funcsions::rela_general): Extract common part out
596 into reloc_common method.
597 (AArch64_relocate_functions::rela_general): Likewise.
598 (AArch64_relocate_functions::pcrela_general): Likewise.
599 (AArch64_relocate_functions::adr): New method.
600 (AArch64_relocate_functions::adrp): Calculate immed before calling
601 update_adr.
602 (AArch64_relocate_functions::adrp): Likewise.
603 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
604 comparing x to 0. Calculate immed from ~x when x < 0.
605 (Target_aarch64::optimize_tls_reloc): Add new cases for
606 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
607 TLSLD_MOVW_DTPREL_G0_NC.
608 (Target_aarch64::possible_function_pointer_reloc): Implement this
609 method.
610 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
611 comment.
612 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
613 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
614 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
615 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
616 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
617 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
618 (Target_aarch64::make_plt_entry): Call add_entry with two more
619 parameters.
620 (Target_aarch64::make_local_ifunc_plt_entry): New method.
621 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
622 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
623 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
624 (Target_aarch64::Relocate::relocate_tls): Add cases for
625 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
626 TLSLD_MOVW_DTPREL_G0_NC.
627 * testsuite/icf_safe_so_test.cc: Correct test comment.
628 * testsuite/icf_safe_test.sh: Add AArch64 arch.
629
80272b8c
AM
6302014-10-22 Alan Modra <amodra@gmail.com>
631
632 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
633 thread_starter.
634
998a69f4
AS
6352014-10-18 Andreas Schwab <schwab@linux-m68k.org>
636
637 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
638
aed56ec5
CC
6392014-10-17 Cary Coutant <ccoutant@google.com>
640
641 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
642 Add "typename" keyword.
643
bb779192 6442014-10-15 Han Shen <shenhan@google.com>
83a01957
HS
645 Jing Yu <jingyu@google.com>
646
647 Patch for gold aarch64 backend to support relaxation.
648 * aarch64-reloc.def: Change format.
649 * aarch64.cc (class Reloc_stub): New class.
650 (class Stub_table): New class.
651 (class AArch64_relobj): New class.
652 (class AArch64_input_section): New class.
653 (class AArch64_output_section): New class.
654 (Target_aarch64::new_stub_table): New method.
655 (Target_aarch64::new_aarch64_input_section): New method.
656 (Target_aarch64::find_aarch64_input_section): New method.
657 (Target_aarch64::scan_section_for_stubs): New method.
658 (Target_aarch64::scan_reloc_section_for_stubs): New method.
659 (Target_aarch64::relocate_stub): New method.
660 (Target_aarch64::current_target): New method.
661 (Target_aarch64::do_make_elf_object): New method.
662 (Target_aarch64::do_may_relax): New method.
663 (Target_aarch64::do_relax): New method.
664 (Target_aarch64::group_sections): New method.
665 (Target_aarch64::scan_reloc_for_stub): New method.
666 (Target_aarch64::do_make_output_section): New method.
667 (Target_aarch64::stub_tables_): New data member.
668 (Target_aarch64::aarch64_input_section_map_): New data member.
669 (AArch64_relocate_functions::maybe_apply_stub): New method.
670
db4c9594
CC
6712014-09-30 Cary Coutant <ccoutant@google.com>
672
673 PR gold/17432
674 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
675
cd6da036
KC
6762014-09-30 Kito Cheng <kito@0xlab.org>
677
678 PR gold/13597
679 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
680 hash table before sysv-style hash table.
681
5f772412
ST
6822014-09-29 Sriraman Tallam <tmsriram@google.com>
683
684 * options.h (--pic-executable): Add negative to alias to -no-pie.
685
5efeedf6
CC
6862014-09-26 Cary Coutant <ccoutant@google.com>
687
688 PR gold/16773
689 * object.cc (Sized_relobj_file): Compute value of section symbols
690 for TLS sections the same as TLS symbols.
691
1707f183
CC
6922014-09-25 Cary Coutant <ccoutant@google.com>
693
694 PR gold/17432
695 * resolve.cc (Symbol_table::resolve): Override common placeholder
696 symbols, but adjust sizes.
697 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
698 symbols to common lists.
699
00cac886
AM
7002014-09-24 Alan Modra <amodra@gmail.com>
701
702 * po/POTFILES.in: Regenerate.
703
635aa30e
CC
7042014-09-23 Taiju Tsuiki <tzik@google.com>
705 Cary Coutant <ccoutant@google.com>
706
71b9b91b 707 PR gold/14860
635aa30e
CC
708 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
709 on input_sections_blocker.
710 * layout.cc (Write_sections_task::locks): Unblock
711 input_sections_blocker_.
712 * layout.h (Write_sections_task::Write_sections_task): Add
713 input_sections_blocker.
714 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
715 to DEPENDENCIES.
716 * testsuite/Makefile.in: Regenerate.
717
c0c71592
RÁE
7182014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
719
720 * testsuite/Makefile.am (plugin_test_10): New test.
721 * testsuite/Makefile.in: Regenerate
722 * testsuite/plugin_common_test_2.c (c1): Align to 8.
723 * testsuite/plugin_test_10.sh: New file.
724
6168c2a1
RÁE
7252014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
726
727 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
728 * resolve.cc (Symbol_table::resolve): Don't override common symbols
729 during the replacement phase.
730
3a531937
JY
7312014-09-17 Han Shen <shenhan@google.com>
732 Jing Yu <jingyu@google.com>
733
734 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
735 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
736 * aarch64.cc (Target_aarch64): Add data members
737 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
738 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
739 constructor.
740 (Target_aarch64::do_reloc_symbol_index): New method.
741 (Target_aarch64::do_reloc_addend): New method.
742 (Target_aarch64::add_tlsdesc_info): New method.
743 (Target_aarch64::do_dynsym_value): New method.
744 (Target_aarch64::do_make_data_plt): Add new parameters: got,
745 got_irelative. Pass them to Output_data_plt_aarch64_standard.
746 (Target_aarch64::make_data_plt): Add new parameters: got,
747 got_irelative. Pass them to do_make_data_plt.
748 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
749 (Target_aarch64::Relocate:tls_gd_to_le): New method.
750 (Target_aarch64::Relocate:tls_ie_to_le): New method.
751 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
752 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
753 (Target_aarch64::got_tlsdesc_section): New method.
754 (Target_aarch64::make_local_ifunc_plt_entry): New method.
755 (Target_aarch64::define_tls_base_symbol): New method.
756 (Target_aarch64::reserve_tlsdesc_entries): New method.
757 (Target_aarch64::got_mod_index_entry): New method.
758 (Target_aarch64::rela_tlsdesc_section): New method.
759 (Target_aarch64::rela_irelative_section): New method.
760 (Target_aarch64::Tlsdesc_info): New struct.
761 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
762 relocations and tlsdesc relocations.
763 (Target_aarch64::optimize_tls_reloc): Implement method.
764 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
765 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
766 in constructor.
767 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
768 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
769 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
770 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
771 (Output_data_plt_aarch64::rela_tlsdesc): New method.
772 (Output_data_plt_aarch64::rela_irelative): New method.
773 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
774 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
775 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
776 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
777 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
778 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
779 (Output_data_plt_aarch64_standard): New member variables:
780 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
781 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
782 New parameter: got, got_irelative.
783 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
784 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
785 (Output_data_plt_aarch64::do_write): Replace got_address with
786 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
787 (AArch64_relocate_functions::update_movnz): New method.
788 (AArch64_relocate_functions): Correct format.
789 (AArch64_relocate_functions::movnz): New method.
790 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
791 before the switch. Add new cases to switch.
00cac886 792 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
793 tlsgd tlsdesc cases.
794 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
795 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
796 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
797 Call reloc_name_in_error_message to print unsupported reloc.
798 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
799 make_data_plt.
800 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
801 relocs. Fill in some more dynamic tags.
802 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
803 Skip call tls_get_addr when tlsgd is relaxed.
804 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
805 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
806 tlsdesc->ie relaxation.
807
62661c93
SS
8082014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
809
810 * mips.cc (Target_mips_nacl): New class.
811 (Target_selector_mips_nacl): New class.
812 (target_selector_mips32): Rename from target_selector_mips32be and use
813 Target_selector_mips_nacl instead of Target_selector_mips.
814 (target_selector_mips32el): Rename from target_selector_mips32 and use
815 Target_selector_mips_nacl instead of Target_selector_mips.
816 (target_selector_mips64): Rename from target_selector_mips64be and use
817 Target_selector_mips_nacl instead of Target_selector_mips.
818 (target_selector_mips64el): Rename from target_selector_mips64 and use
819 Target_selector_mips_nacl instead of Target_selector_mips.
820 (Target_mips::mips_info): Add const attribute.
821
54674d38
CC
8222014-09-02 Cary Coutant <ccoutant@google.com>
823
824 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
825 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
826 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
827 (Sized_incr_dynobj::do_section_name): Likewise.
828 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
829 (Sized_incr_dynobj::do_section_name): Likewise.
830 * object.h (Object::section_name): Likewise.
831 (Object::do_section_name): Likewise.
832 (Sized_relobj_file::do_section_name): Likewise.
833 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
834 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
835
9860cbcf
CC
8362014-09-02 Cary Coutant <ccoutant@google.com>
837
838 PR gold/17005
839 * ehframe.cc (Fde::write): Add output_offset parameter.
840 (Cie::write): Likewise.
841 (Eh_frame::set_final_data_size): Account for offset within output
842 section.
843 (Eh_frame::do_sized_write): Likewise.
844 * ehframe.h (Fde::write): Add output_offset parameter.
845 (Cie::write): Likewise.
846 * output.cc (Output_section::Input_section_sort_entry): Remove
847 section_has_name_; add output_section_name parameter. Use
848 output section name for non-input sections.
849 (Output_section::Input_section_sort_entry::section_has_name): Remove.
850 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
851 (Output_section::Input_section_sort_compare): Remove logic for
852 sections without names.
853 (Output_section::Input_section_sort_init_fini_compare): Likewise.
854 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
855 Likewise.
856 (Output_section::Input_section_sort_section_name_compare): Likewise.
857
8e33481e
HS
8582014-08-29 Han Shen <shenhan@google.com>
859 Jing Yu <jingyu@google.com>
860
861 * aarch64-reloc-property.cc
862 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
863 reference reloc property in the table.
864 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
865 3 other entries.
866 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
867 2 new overloaded methods.
868 (Output_data_got_aarch64::do_write): Add code to write out
869 static relocs.
870 (class Output_data_got_aarch64::Static_reloc): New class to wrap
871 static relocs.
872 (Output_data_got_aarch64::static_relocs): New vector to
873 hold static relocs.
874 (Target_aarch64::TCB_SIZE): New const static memeber.
875 (Target_aarch64::tcb_size): New method.
876 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
877 (Target_aarch64::Relocate::relocate_tls): New method.
878 (Target_aarch64::Scan::local): Add code handling new reloc types.
879 (Target_aarch64::Scan::global): Add code handling new reloc types.
880
81233653
ST
8812014-08-13 Sriraman Tallam <tmsriram@google.com>
882
883 * options.h (-no-pie): Add option.
884
9363c7c3
JY
8852014-08-08 Jing Yu <jingyu@google.com>
886 Han Shen <shenhan@google.com>
887
888 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
889 (DEFFILES): add aarch64-reloc.def.
890 (TARGETSOURCES): Add aarch64-reloc-property.cc.
891 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
892 * Makefile.in: Regenerate.
893 * aarch64-reloc-property.cc: New file.
894 * aarch64-reloc-property.h: New file.
895 * aarch64-reloc.def: New file.
896 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
897 with tab to make the format consistent.
898 (Output_data_got_aarch64::symbol_table_): New method.
899 (Target_aarch64::do_plt_address_for_global): New method.
900 (Target_aarch64::do_plt_address_for_local): New method.
901 (Target_aarch64::do_select_as_default_target): New method.
902 (Target_aarch64::do_make_data_plt): New method.
903 (Target_aarch64::make_data_plt): New method.
904 (Output_data_plt_aarch64::has_irelative_section): New method.
905 (Output_data_plt_aarch64::address_for_global): New method.
906 (Output_data_plt_aarch64::address_for_local): New method.
907 (Output_data_plt_aarch64::irelative_rel_): New parameter.
908 (Output_data_plt_aarch64::add_entry): Implement contents.
909 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
910 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
911 the got_pov entry to plt0.
912 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
913 Implement contents.
914 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
915 (AArch64_howto): New struct.
916 (aarch64_howto[]): New static const array.
917 (AArch64_relocate_functions): New class.
918 (Target_aarch64::Scan::get_reference_flags): Remove method.
919 (Target_aarch64::Scan::local): Implement to support a few relocations.
920 (Target_aarch64::Scan::global): Implement to support a few relocations.
921 (Target_aarch64::make_plt_section): Implement contents.
922 (Target_aarch64::make_plt_entry): Implement contents.
923 (Target_aarch64::do_finalize_sections): Implement contents.
924 (Target_aarch64::Relocate::relocate): Implement a few relocations.
925 (Target_aarch64::relocate_section): Implement contents.
926
ad9fe6c1
AM
9272014-08-06 Alan Modra <amodra@gmail.com>
928
929 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
930
7cd4e5b7
AM
9312014-08-06 Alan Modra <amodra@gmail.com>
932
933 PR 13227
934 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
935
5ad9b0a7
ST
9362014-07-21 Sriraman Tallam <tmsriram@google.com>
937
938 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 939 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 940
e051745c
CC
9412014-07-08 Cary Coutant <ccoutant@google.com>
942
943 * expression.cc (struct Expression::Expression_eval_info): Add
944 new fields type_pointer, vis_pointer, and nonvis_pointer.
945 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
946 nonvis_pointer parameters. Adjust all calls.
947 (Symbol_expression::value): Update type, visibility, and nonvis bits
948 in caller.
949 * script.cc (Symbol_assignment::sized_finalize): Update type,
950 visibility, and remaining st_other bits for new symbol.
951 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
952 vis_pointer, and nonvis_pointer parameters.
953 * symtab.h (Symbol::set_type): New method.
954
955 * testsuite/Makefile.am (defsym_test): New test.
956 * testsuite/Makefile.in: Regenerate.
957 * testsuite/defsym_test.c: New file.
958 * testsuite/defsym_test.sh: New file.
959
f35c4853
CC
9602014-07-08 Cary Coutant <ccoutant@google.com>
961
962 PR gold/15639
963 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
964 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
965 (Sized_dynobj::base_read_symbols): ...new method.
966 * object.h (Sized_relobj_file::base_read_symbols): New method.
967 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
968 (Sized_relobj_file::base_read_symbols): ...new method.
969 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
970 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
971 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
972
2900af2d
AM
9732014-07-04 Alan Modra <amodra@gmail.com>
974
975 * po/POTFILES.in: Regenerate.
976
053a4d68
JY
9772014-07-02 Jing Yu <jingyu@google.com>
978
979 * aarch64.cc: New file
980 * Makefile.am (TARGETSOURCES): Add aarch64.cc
981 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
982 * Makefile.in: Regenerate.
983 * configure.tgt: Add entries for aarch64*.
984 * configure.ac: Likewise.
985 * configure: Likewise.
986
7b549045
AM
9872014-06-27 Alan Modra <amodra@gmail.com>
988
989 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
990
cb818dbf
CC
9912014-06-24 Cary Coutant <ccoutant@google.com>
992
993 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
994 sections.
995 (Dwo_file::sized_read_unit_index): Likewise.
996
9810d34d
SS
9972014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
998
999 * mips.cc: New file.
1000 * Makefile.am (TARGETSOURCES): Add mips.cc
1001 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
1002 * configure.tgt: Add entries for mips*.
1003 * configure.ac: Likewise.
1004 * Makefile.in: Regenerate.
1005 * configure: Likewise.
1006
9baa787b
CC
10072014-06-09 Cary Coutant <ccoutant@google.com>
1008
1009 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
1010 unit_length is within section bounds.
1011
8f89af0a
CC
10122014-06-09 Cary Coutant <ccoutant@google.com>
1013
1014 PR gold/16980
1015 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
1016 map.
1017
a47622ac
AM
10182014-06-07 Alan Modra <amodra@gmail.com>
1019
1020 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
1021
4320c691
CC
10222014-06-06 Cary Coutant <ccoutant@google.com>
1023
1024 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
1025 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
1026 (Dwarf_pubnames_table::read_header): Likewise.
1027 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
1028 .debug_gnu_pubtypes.
1029
270c9937
JB
10302014-06-05 Joel Brobecker <brobecker@adacore.com>
1031
1032 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
1033 * Makefile.in, configure: Regenerate.
1034
397998fc
AM
10352014-06-03 Alan Modra <amodra@gmail.com>
1036
1037 * powerpc.cc (addis_12_2): Define.
1038 (Stub_table::do_write): Support fusion on ELFv2 stubs.
1039
61f5c66f
AM
10402014-06-03 Alan Modra <amodra@gmail.com>
1041
1042 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
1043 st_other output.
1044
f6971787
AM
10452014-06-02 Alan Modra <amodra@gmail.com>
1046
1047 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
1048 Only ignore relocs on ELFv1.
1049 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
1050
f6fb8322
CC
10512014-05-30 Cary Coutant <ccoutant@google.com>
1052
1053 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
1054 * testsuite/Makefile.in: Regenerate.
1055 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
1056
c23dd342
L
10572014-05-27 H.J. Lu <hongjiu.lu@intel.com>
1058
1059 PR gold/16945
1060 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
1061 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
1062
5fe7ffdc
AM
10632014-05-15 Alan Modra <amodra@gmail.com>
1064
1065 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
1066 Compare FDE contents with DW_CFA_nop rather than 0.
1067
a82bef93
ST
10682014-05-13 Sriraman Tallam <tmsriram@google.com>
1069
1070 * symtab.h (may_need_copy_reloc): Remove check for position independent
1071 code.
1072 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
1073 position independence before pc absolute may_need_copy_reloc call.
1074 Add check for executable output befor pc relative may_need_copy_reloc
1075 call.
1076 * i386.cc: Ditto.
1077 * arm.cc: Ditto.
1078 * sparc.cc: Ditto.
1079 * tilegx.cc: Ditto.
1080 * powerpc.cc: Add check for no position independence before
1081 may_need_copy_reloc calls.
1082 * testsuite/pie_copyrelocs_test.cc: New file.
1083 * testsuite/pie_copyrelocs_shared_test.cc: New file.
1084 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 1085 * Makefile.in: Regenerate.
a82bef93 1086
53c66605
ML
10872014-05-08 Martin Liška <mliska@suse.cz>
1088
1089 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
1090
57b2284c
CC
10912014-05-06 Cary Coutant <ccoutant@google.com>
1092
1093 PR gold/16900
1094 * i386.cc (Output_data_got_plt_i386): New class.
1095 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
1096 parameter. Change all callers.
1097 (Output_data_plt_i386::layout_): Remove.
1098 (Output_data_plt_i386::got_plt_): Change type.
1099 (Target_i386::got_plt_): Change type. Change all references.
1100 (Target_i386::got_section): Create instance of new class.
1101 (Output_data_got_plt_i386::do_write): New function.
1102 * x86_64.cc (Output_data_got_plt_x86_64): New class.
1103 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
1104 parameter. Change all callers.
1105 (Output_data_plt_x86_64::layout_): Remove.
1106 (Output_data_plt_x86_64::got_plt_): Change type.
1107 (Target_x86_64::got_plt_): Change type. Change all references.
1108 (Target_x86_64::got_section): Create instance of new class.
1109 (Output_data_got_plt_x86_64::do_write): New function.
1110 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
1111 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
1112 class.
1113
6b97515d 11142014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 1115
6b97515d
CC
1116 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
1117 if we have pubnames/pubtypes.
1118
d1bddd3c
CC
11192014-05-02 Cary Coutant <ccoutant@google.com>
1120
5fe7ffdc
AM
1121 * defstd.cc (in_segment): Define __ehdr_start here...
1122 * layout.cc (Layout::finalize): ...Instead of here. Set the
1123 output segment when known.
1124 * resolve.cc (Symbol::override_base_with_special): Remember
1125 the original binding.
1126 * symtab.cc (Symbol::set_output_segment): New function.
1127 (Symbol::set_undefined): New function.
1128 * symtab.h (Symbol::is_weak_undefined): Check original undef
1129 binding.
1130 (Symbol::is_strong_undefined): New function.
1131 (Symbol::set_output_segment): New function.
1132 (Symbol::set_undefined): New function.
1133 * target-reloc.h (is_strong_undefined): Remove.
1134 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
1135 Check for hidden undefs.
1136 (relocate_section): Call Symbol::is_strong_undefined.
1137
1138 * testsuite/Makefile.am (ehdr_start_test_1)
1139 (ehdr_start_test_2, ehdr_start_test_3)
1140 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
1141 * testsuite/Makefile.in: Regenerate.
1142 * testsuite/ehdr_start_def.cc: New source file.
1143 * testsuite/ehdr_start_test.cc: New source file.
1144 * testsuite/ehdr_start_test.t: New linker script.
1145 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 1146
7849f6d8
CC
11472014-04-23 Cary Coutant <ccoutant@google.com>
1148
bf2cc635 1149 PR gold/16870
7849f6d8
CC
1150 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
1151
99fd8cff
CC
11522014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1153
1154 * layout.cc (Layout::include_section): Allow a target to decide
1155 whether to include a section.
1156 * target.h (Target::should_include_section): New function.
1157 (Target::do_should_include_section): New function.
1158
91f43acd
CC
11592014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1160
1161 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
1162 inline into ...
1163 (Copy_relocs::emit): ... here.
1164 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
1165 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
1166 (Copy_reloc_entry::entries_): Change from private to protected.
1167
c4eb27e1
ST
11682014-04-02 Sriraman Tallam <tmsriram@google.com>
1169
1170 * icf.cc (get_section_contents): Replace copies of reloc
1171 vectors with const references.
1172
ae447ddd
CC
11732014-04-02 Cary Coutant <ccoutant@google.com>
1174
1175 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
1176 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
1177 * configure: Regenerate.
1178 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
1179 -fno-use-linker-plugin.
1180 (LINK1, CXXLINK1): Add it to the link command.
1181 * testsuite/Makefile.in: Regenerate.
1182
fa47fa92
AM
11832014-03-12 Alan Modra <amodra@gmail.com>
1184
1185 * Makefile.in: Regenerate.
1186
9b12c500
CC
11872014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1188
1189 * symtab.h (Symbol::set_nonvis): New function.
1190
beacaa96
CC
11912014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1192
1193 * symtab.cc (Sized_symbol<32>::init_output_data):
1194 Instantiate the template.
1195 (Sized_symbol<64>::init_output_data): Likewise.
1196
800d9823
CC
11972014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1198
1199 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
1200 adjust dynamic symbol value.
1201 * target.h (Target::adjust_dyn_symbol): New function.
1202 (Target::do_adjust_dyn_symbol): New function.
1203
918fc1f8 12042014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 1205
918fc1f8
CC
1206 * output.cc (Output_data_dynamic::Dynamic_entry::write):
1207 Get the value of DYNAMIC_CUSTOM dynamic entry.
1208 * output.h (Output_data_dynamic::add_custom): New function.
1209 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
1210 dynamic entry.
1211 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
1212 * target.h (Target::dynamic_tag_custom_value): New function.
1213 (Target::do_dynamic_tag_custom_value): New function.
1214
98ff9231
CC
12152014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1216
1217 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
1218 dynsym indexes.
1219 * target.h (Target::has_custom_set_dynsym_indexes): New function.
1220 (Target::do_has_custom_set_dynsym_indexes): New function.
1221 (Target::set_dynsym_indexes): New function.
1222 (Target::do_set_dynsym_indexes): New function.
1223
b80eed39
AM
12242014-03-07 Alan Modra <amodra@gmail.com>
1225
1226 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
1227 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
1228 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
1229 (Powerpc_relocate_functions::has_overflow_bitfield,
1230 overflowed): Use the above.
1231 (Target_powerpc::Relocate::relocate): Correct overflow checking
1232 for a number of relocations. Modify overflow test for 16-bit
1233 fields in instructions to signed/unsigned according to whether
1234 the field takes a signed or unsigned value.
1235
4b95cf5c
AM
12362014-03-05 Alan Modra <amodra@gmail.com>
1237
1238 Update copyright years.
1239
45965137
AM
12402014-03-05 Alan Modra <amodra@gmail.com>
1241
1242 * powerpc.cc (Target_powerpc::Scan::local, global): Support
1243 R_PPC64_ADDR64_LOCAL.
1244 (Target_powerpc::Relocate::relocate): Likewise.
1245
2c80b753
AM
12462014-03-03 Alan Modra <amodra@gmail.com>
1247
1248 * dwp.cc (print_version): Update copyright year to current.
1249
c1c69e83
AM
12502014-02-10 Alan Modra <amodra@gmail.com>
1251
1252 * po/gold.pot: Regenerate.
1253
dd0c4e70
CC
12542014-02-06 Cary Coutant <ccoutant@google.com>
1255
1256 Fix problem where -u is ignored when a weak undef is seen.
1257
1258 * archive.cc (Library_base::should_include_member): Reorder
1259 code to check for -u option if a weak undef has already been seen.
1260 * testsuite/Makefile.am (weak_undef_test_2): New test case.
1261 * testsuite/Makefile.in: Regenerate.
1262 * testsuite/weak_undef_file3.cc: New file.
1263 * testsuite/weak_undef_file4.cc: New file.
1264 * testsuite/weak_undef_test_2.cc: New file.
1265
1a221d3d
CC
12662014-02-05 Cary Coutant <ccoutant@google.com>
1267
1268 Fix issues with gold undefined symbol diagnostics.
1269
1270 PR binutils/15435
1271 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
1272 check to here.
1273 * target-reloc.h (is_strong_undefined): New function.
1274 (relocate_section): Move undef vtable symbol check from here.
1275 Check for is_strong_undefined.
1276
e889f0a4 12772014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 1278
e889f0a4
CC
1279 Fix problems with the --dynamic-list option.
1280
1281 PR gold/13577
1282 * options.cc (General_options::parse_dynamic_list):
1283 Set have_dynamic_list_.
1284 (General_options::General_options): Initialize have_dynamic_list_.
1285 (General_options::finalize): Turn off -Bsymbolic and
1286 -Bsymbolic-functions if --dynamic-list provided.
1287 * options.h (General_options::have_dynamic_list): New function.
1288 (General_options::have_dynamic_list_): New data member.
1289 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
1290 correctly.
5fe7ffdc 1291
e889f0a4
CC
1292 PR gold/16530
1293 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
1294 in --dynamic-list, mark it.
5fe7ffdc 1295
e889f0a4
CC
1296 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
1297 (dynamic_list_2): New test case.
1298 * testsuite/Makefile.in: Regenerate.
1299 * testsuite/dynamic_list_2.cc: New file.
1300 * testsuite/dynamic_list_2.t: New file.
1301 * testsuite/dynamic_list_lib1.cc: New file.
1302 * testsuite/dynamic_list_lib2.cc: New file.
1303 * testsuite/gc_dynamic_list_test.c: New file.
1304 * testsuite/gc_dynamic_list_test.sh: New file.
1305 * testsuite/gc_dynamic_list_test.t: New file.
1306
ec673e64
CC
13072014-01-28 Cary Coutant <ccoutant@google.com>
1308
1309 Add .gdb_index version 7 support.
1310
1311 * gold/dwarf_reader.cc: include <utility> (for make_pair).
1312 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
1313 debug sections.
1314 (Dwarf_ranges_table::read_ranges_table): Likewise.
1315 (Dwarf_pubnames_table::read_section): Check for GNU-style
1316 sections, and for compressed debug sections.
1317 (Dwarf_pubnames_table::read_header): Compute end address of table.
1318 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
1319 for end of list by offset, not by offset == 0.
1320 (Dwarf_info_reader::do_read_string_table): Check for compressed
1321 debug sections.
1322 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1323 Initialize new data members.
1324 (Dwarf_pubnames_table::next_name): return flag_byte.
1325 (Dwarf_pubnames_table::end_of_table_): New data member.
1326 (Dwarf_pubnames_table::is_gnu_style_): New data member.
1327 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
1328 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
1329 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
1330 read skeleton type unit DIEs.
1331 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
1332 (Gdb_index::do_write): Write flag_byte.
1333 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
1334 (Gdb_index::Cu_vector): Store flags along with cu indexes.
1335 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
1336 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
1337
221fd5d5
L
13382014-01-08 H.J. Lu <hongjiu.lu@intel.com>
1339
1340 * version.cc (print_version): Update copyright year to 2014.
1341
6c09fb0b
ILT
13422013-12-19 Dimitry Andric <dimitry@andric.com>
1343
1344 * stringpool.cc (Stringpool_template::reserve): Add
1345 HAVE_UNORDERED_MAP case.
1346 * stringpool.cc (Stringpool_template::print_stats): Likewise.
1347
8356f2d0
CC
13482013-12-18 Cary Coutant <ccoutant@google.com>
1349
1350 * configure.ac: Check for <unordered_set> and <unordered_map>.
1351 * config.in: Regenerate.
1352 * configure: Regenerate.
1353 * system.h: Use <unordered_set> and <unordered_map> if available.
1354
f2c7d7ee
RM
13552013-12-10 Roland McGrath <mcgrathr@google.com>
1356
1357 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
1358 with $(INSTALL_PROGRAM_ENV).
1359 * Makefile.in: Regenerate.
1360
6632e8cc
CC
13612013-11-22 Cary Coutant <ccoutant@google.com>
1362
1363 * configure.ac: Add check for which library is needed for
1364 dlopen.
1365 * configure: Regenerate.
1366
0c075858
CC
13672013-11-22 Cary Coutant <ccoutant@google.com>
1368
1369 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
1370 assembler.
1371 * testsuite/Makefile.in: Regenerate.
1372
f49fe902
L
13732013-11-17 H.J. Lu <hongjiu.lu@intel.com>
1374
1375 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
1376 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
1377 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
1378 (Target_x86_64<size>::Scan::local): Likewise.
1379 (Target_x86_64<size>::Scan::global): Likewise.
1380 (Target_x86_64<size>::Relocate::relocate): Likewise.
1381 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
1382 Likewise.
1383 (Target_x86_64<size>::Scan::check_non_pic(): Handle
1384 R_X86_64_PC32_BND.
1385
1386 * testsuite/Makefile.am (check_PROGRAMS): Add
1387 exception_x86_64_bnd_test.
1388 (exception_x86_64_bnd_test_SOURCES): New macro.
1389 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
1390 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
1391 (exception_x86_64_bnd_test_LDADD): Likewise.
1392 (exception_x86_64_bnd_1.o): New rule.
1393 (exception_x86_64_bnd_2.o): Likewise.
1394 * testsuite/Makefile.in: Regenerated.
1395
9055360d
AM
13962013-11-15 Alan Modra <amodra@gmail.com>
1397
1398 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
1399 accessor.
1400 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
1401 Only call ppc64_local_entry_offset for 64-bit. Restrict
1402 symval_for_branch lookup to ELFv1.
1403 (Stub_table::add_plt_call_entry): Use unsigned int off.
1404 (Output_data_glink::Address, invalid_address): New.
1405 (Output_data_glink::add_eh_frame): Move out of line. Add
1406 support for ELFv2.
1407 (Output_data_glink::add_global_entry, find_global_entry,
1408 global_entry_address): New functions.
1409 (Output_data_glink::global_entry_stubs_, end_branch_table_,
1410 ge_size): New variables.
1411 (Output_data_glink::set_final_data_size): Add global entry
1412 stub sizing.
1413 (Output_data_glink::do_write): Write global entry stubs.
1414 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
1415 parameter. Return true for ELFv2. Adjust callers.
1416 (Target_powerpc::Scan::local, global): Restrict opd lookup to
1417 ELFv1. Similarly for ifunc and dynamic relocation processing
1418 specific to ELFv1. Recognize that symbols are defined on
1419 their plt entries for ELFv2.
1420 (Target_powerpc::symval_for_branch): Assert if called for
1421 ELFv2 or ppc32.
1422 (Target_powerpc::Relocate::relocate): Use global entry plt
1423 stub for symbol value if such exists on ELFv2.
1424 (Target_powerpc::Relocate::relocate): Don't call
1425 symval_for_branch when ELFv2. Do adjust for local entry
1426 offset when ELFv2.
1427 (Target_powerpc::do_dynsym_value): Set symbols to global entry
1428 plt stub for ELFv2.
1429 (Target_powerpc::do_plt_address_for_global): Similarly.
1430
cafdd569
CC
14312013-11-14 Cary Coutant <ccoutant@google.com>
1432
1433 Revert patch -- this did not fix the problem, and there is
1434 no race there.
1435
1436 2013-11-14 Cary Coutant <ccoutant@google.com>
1437
1438 PR gold/14860
1439 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1440 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1441 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1442 updating fde_offsets_.
1443 (Eh_frame_hdr::lock_): New data member.
1444
94e49e16
CC
14452013-11-14 Cary Coutant <ccoutant@google.com>
1446
1447 * dwp.cc (Dwo_file_entry): New type.
1448 (File_list): Use Dwo_file_entry.
1449 (Dwo_file::verify): New function.
1450 (Dwo_file::verify_dwo_list): New function.
1451 (Dwo_file::sized_verify_dwo_list): New function.
1452 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
1453 list.
1454 (Dwp_options): New enum type.
1455 (dwp_options): Add --verify-only.
1456 (usage): Likewise.
1457 (main): Likewise.
1458 * dwp.h (gold_info): Add declaration.
1459
7cdd7d57
CC
14602013-11-14 Cary Coutant <ccoutant@google.com>
1461
1462 PR gold/14860
1463 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1464 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1465 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1466 updating fde_offsets_.
1467 (Eh_frame_hdr::lock_): New data member.
1468
1d946cb3
CC
14692013-11-06 Cary Coutant <ccoutant@google.com>
1470
1471 PR gold/15758
1472 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
1473 before reloc sections.
1474
4f65b40e
AM
14752013-11-04 Alan Modra <amodra@gmail.com>
1476
1477 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
1478 (Symbol::needs_dynamic_reloc): Test new flag.
1479 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
1480 (Target_powerpc::Scan::get_reference_flags): Add target param.
1481 Return FUNC_DESC_ABI for 64-bit ELFv1.
1482 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
1483 call.
1484 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
1485 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
1486
908794a9
CC
14872013-10-31 Cary Coutant <ccoutant@google.com>
1488
1489 Restore support for dwp v2 DWARF package file format.
1490
1491 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1492 tu_length parameter. Adjust all callers.
1493 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1494 * dwp.cc: Include dwarf.h.
1495 (Section_bounds): New struct type.
1496 (Unit_set): New struct type.
1497 (Dwo_file::Dwo_file): Initialize new data member.
1498 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1499 Combine and rename to...
1500 (Dwo_file::read_unit_index): ...this.
1501 (Dwo_file::sized_read_compunit_index)
1502 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1503 (Dwo_file::sized_read_unit_index): ...this.
1504 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1505 parameters; add section_id parameter.
1506 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1507 (Dwo_file::add_unit_set): ...this.
1508 (Dwo_file::shndx_map_): Remove.
1509 (Dwo_file::sect_offsets_): New data member.
1510 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1511 (Dwp_output_file::add_section): Rename to...
1512 (Dwp_output_file::add_contribution): ...this.
1513 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1514 (Dwp_output_file::add_tu_set): Likewise.
1515 (Dwp_output_file::Contribution): New type.
1516 (Dwp_output_file::Section::contributions): New data member.
1517 (Dwp_output_file::Cu_or_tu_set): Remove.
1518 (Dwp_output_file::Section::Section): New ctor.
1519 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1520 (Dwp_output_file::Dwp_index::Section_table): New type.
1521 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1522 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1523 parameter.
1524 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1525 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1526 (Dwp_output_file::Dwp_index::section_table): New member function.
1527 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1528 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1529 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1530 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1531 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1532 (Dwp_output_file::Dwp_index::section_table_): New data member.
1533 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1534 (Dwp_output_file::add_output_section): New member function.
1535 (Dwp_output_file::write_new_section): New member function.
1536 (Dwp_output_file::write_contributions): New member function.
1537 (Dwp_output_file::section_id_map_): New data member.
1538 (class Dwo_id_info_reader): Remove.
1539 (class Unit_reader): New class.
1540 (get_dwarf_section_name): New function.
1541 (Dwo_file::read_executable): Adjust initializations of class data.
1542 (Dwo_file::read): Add support for v2 package file format.
1543 (Dwo_file::read_unit_index): Likewise.
1544 (Dwo_file::sized_read_unit_index): Likewise.
1545 (Dwo_file::copy_section): Likewise.
1546 (Dwo_file::add_unit_set): Likewise.
1547 (Dwp_output_file::add_output_section): Likewise.
1548 (Dwp_output_file::add_contribution): Likewise.
1549 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1550 for empty slot.
1551 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1552 file format.
1553 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1554 slot.
1555 (Dwp_output_file::initialize): Remove unused function.
1556 (Dwp_output_file::finalize): Add support for v2 package file format.
1557 (Dwp_output_file::write_index): Likewise.
1558 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1559 function prototype.
1560
2500c017
CC
15612013-10-31 Cary Coutant <ccoutant@google.com>
1562
1563 * configure.ac: Fix check for -fmerge-constants.
1564 * configure.ac: Regenerate.
1565
dd0845d7
RM
15662013-10-30 Roland McGrath <mcgrathr@google.com>
1567
1568 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
1569 Correct 9-byte nop sequence to match what the assembler generates.
1570
b4f7960d
AM
15712013-10-30 Alan Modra <amodra@gmail.com>
1572
1573 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
1574 ppc64_local_entry_offset, ppc64_local_entry_offset,
1575 do_read_symbols): New functions.
1576 (Powerpc_relobj::e_flags_, st_other_): New vars.
1577 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
1578 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
1579 (Powerpc_relobj::e_flags_): New var.
1580 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
1581 and adjust for ELFv2.
1582 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
1583 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
1584 (Powerpc_dynobj::do_find_special_sections): Likewise.
1585 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
1586 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
1587 to ELFv2 local entry.
1588 (Target_powerpc::do_relax): No thread safe barriers needed for
1589 ELFv2.
1590 (Output_data_plt_powerpc::initial_plt_entry_size_,
1591 plt_entry_size): Delete. Replace all uses with
1592 first_plt_entry_offset() and plt_entry_size().
1593 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
1594 reserved_size parm. Update callers.
1595 (Output_data_plt_powerpc::entry_count): Update.
1596 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
1597 and use Target_powerpc::first_plt_entry_offset().
1598 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
1599 rename to plt_entry_size.
1600 (Output_data_plt_powerpc::add_ifunc_entry,
1601 add_local_ifunc_entry): Adjust reloc for ELFv2.
1602 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
1603 (glink_eh_frame_fde_64v2): New.
1604 (Stub_table::plt_call_size): Support ELFv2 sizing.
1605 (Output_data_glink::add_eh_frame): Use the new FDE.
1606 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
1607 (Stub_table::do_write): Write ELFv2 stubs and glink.
1608 (Target_powerpc::Relocate::relocate): Replaces nop after call
1609 with ld 2,24(1) and adjust local offset destination for ELFv2.
1610
f9c6b907
AM
16112013-10-30 Alan Modra <amodra@gmail.com>
1612
1613 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
1614 (Target_powerpc::Scan::global, local): Likewise.
1615 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
1616 on all ppc64 @h and @ha relocs.
1617
e84fe78f
AM
16182013-10-14 Alan Modra <amodra@gmail.com>
1619
1620 * output.h (Output_data_got::add_constant): Tidy.
1621 (Output_data_got::add_constant_pair): New function.
1622 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
1623 methods used so as to first call reserve_ent().
1624
679e4abf
RM
16252013-10-11 Roland McGrath <mcgrathr@google.com>
1626
44dcb735
RM
1627 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
1628 add_got_entry and add_got_entry_pair.
1629
13323c49
RM
1630 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
1631 (HAVE_PUBNAMES): Likewise.
1632 * configure: Regenerate.
1633
1496b446
RM
1634 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
1635 * testsuite/Makefile.in: Regenerate.
1636
cc84c10b
RM
1637 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
1638 Remove const from declaration.
1639 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
1640 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
1641 * output.h (Output_file_header): Remove const from member target_
1642 and corresponding constructor argument.
1643 * output.cc (Output_file_header::Output_file_header): Update prototype.
1644 (Output_file_header::do_sized_write): Use this->target_ in place
1645 of parameters()->target().
1646
52f66a2c
RM
1647 * testsuite/undef_symbol.cc (Foo::get_a): New method.
1648
2b64b551
RM
1649 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
1650 * configure: Regenerate.
1651 * Makefile.in: Regenerate.
1652 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
1653 * testsuite/merge_string_literals_2.c: Likewise.
1654 * testsuite/Makefile.am
1655 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
1656 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
1657 literal -fmerge-constants.
1658 * testsuite/Makefile.in: Regenerate.
1659
43819297
RM
1660 * i386.cc (Target_i386): Remove unused member dynbss_.
1661 * arm.cc (Target_arm): Likewise.
1662 * powerpc.cc (Target_powerpc): Likewise.
1663 * sparc.cc (Target_sparc): Likewise.
1664 * tilegx.cc (Target_tilegx): Likewise.
1665 * x86_64.cc (Target_x86_64): Likewise.
1666 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
1667 type_signature_, type_offset_.
1668 * plugin.h (Plugin_hook): Remove unused member layout_.
1669 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
1670 mapfile_.
1671 (Read_member): Remove unused members input_objects_, symtab_,
1672 mapfile_, layout_.
1673 (Check_library): Remove unused member symtab_.
1674 * archive.h (Lib_group): Remove unused member lib_.
1675 * archive.cc (Lib_group::Lib_group): Update initializer.
1676 * incremental.h (Incremental_binary): Remove unused member target_.
1677 (Incremental_script_entry): Removed unused member script_.
1678 * layout.h (Write_symbols_task): Remove unused member input_objects_.
1679 * icf.h (Icf): Remove unused member num_tracked_relocs.
1680
39d9ead7
RM
1681 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
1682 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
1683 its only use.
1684 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
1685
679e4abf
RM
1686 * archive.h: Use struct rather than class for forward declaration
1687 of Read_symbols_data.
1688
54de2ea6
CC
16892013-10-07 Cary Coutant <ccoutant@google.com>
1690
1691 PR gold/16010
1692 * testsuite/Makefile.am (icf_test): Fix dependencies.
1693 (icf_safe_test): Likewise.
1694 (icf_safe_so_test): Likewise.
1695 (large_symbol_alignment): Add empty _LDADD rule.
1696 * testsuite/Makefile.in: Regenerate.
1697
b14016f0
L
16982013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
1699
1700 PR gold/15927
1701 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
1702 relocation for R_X86_64_32 on x32.
1703
eb426534
RM
17042013-08-27 Roland McGrath <mcgrathr@google.com>
1705
1706 * output.cc (Output_segment::set_section_addresses): Take new
1707 Target* argument. If target->isolate_execinstr() and the segment
1708 is executable and starts at a target->abi_pagesize() boundary,
1709 pad its end out to a target->abi_pagesize() boundary with code fill.
1710 * output.h (Output_segment::set_section_addresses): Update decl.
1711 * layout.h (Layout::check_output_data_for_reset_values): Take new
1712 argument RELAX_OUTPUTS.
1713 (Layout): New member relax_output_list_.
1714 (Layout::add_relax_output): New method.
1715 * layout.cc (Layout::Layout): Update constructor.
1716 (Layout::reset_relax_output): New method.
1717 (Layout::clean_up_after_relaxation): Call it.
1718 (Layout::prepare_for_relaxation): Update caller.
1719 (Layout::set_segment_offsets): Update callers of set_section_addresses.
1720 Call reset_relax_output before re-processing segments for
1721 isolate_execinstr case.
1722 (Layout::write_data): Handle relax_output_list_.
1723 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
1724 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
1725
9aff4b7a
NC
17262013-08-23 Yuri Chornoivan <yurchor@ukr.net>
1727
1728 PR binutils/15834
1729 * object.h: Fix typos.
1730
93f8221c
RM
17312013-08-16 Roland McGrath <mcgrathr@google.com>
1732
1733 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
1734 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
1735
e44c3715
CC
17362013-08-07 Cary Coutant <ccoutant@google.com>
1737
1738 Revert support for v2 DWP files:
1739
1740 2013-03-01 Cary Coutant <ccoutant@google.com>
1741
1742 Add dwp support for v2 DWARF package file format.
1743 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1744 tu_length parameter. Adjust all callers.
1745 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1746 * dwp.cc: Include dwarf.h.
1747 (Section_bounds): New struct type.
1748 (Unit_set): New struct type.
1749 (Dwo_file::Dwo_file): Initialize new data member.
1750 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1751 Combine and rename to...
1752 (Dwo_file::read_unit_index): ...this.
1753 (Dwo_file::sized_read_compunit_index)
1754 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1755 (Dwo_file::sized_read_unit_index): ...this.
1756 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1757 parameters; add section_id parameter.
1758 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1759 (Dwo_file::add_unit_set): ...this.
1760 (Dwo_file::shndx_map_): Remove.
1761 (Dwo_file::sect_offsets_): New data member.
1762 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1763 (Dwp_output_file::add_section): Rename to...
1764 (Dwp_output_file::add_contribution): ...this.
1765 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1766 (Dwp_output_file::add_tu_set): Likewise.
1767 (Dwp_output_file::Contribution): New type.
1768 (Dwp_output_file::Section::contributions): New data member.
1769 (Dwp_output_file::Cu_or_tu_set): Remove.
1770 (Dwp_output_file::Section::Section): New ctor.
1771 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1772 (Dwp_output_file::Dwp_index::Section_table): New type.
1773 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1774 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1775 parameter.
1776 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1777 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1778 (Dwp_output_file::Dwp_index::section_table): New member function.
1779 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1780 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1781 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1782 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1783 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1784 (Dwp_output_file::Dwp_index::section_table_): New data member.
1785 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1786 (Dwp_output_file::add_output_section): New member function.
1787 (Dwp_output_file::write_new_section): New member function.
1788 (Dwp_output_file::write_contributions): New member function.
1789 (Dwp_output_file::section_id_map_): New data member.
1790 (class Dwo_id_info_reader): Remove.
1791 (class Unit_reader): New class.
1792 (get_dwarf_section_name): New function.
1793 (Dwo_file::read_executable): Adjust initializations of class data.
1794 (Dwo_file::read): Add support for v2 package file format.
1795 (Dwo_file::read_unit_index): Likewise.
1796 (Dwo_file::sized_read_unit_index): Likewise.
1797 (Dwo_file::copy_section): Likewise.
1798 (Dwo_file::add_unit_set): Likewise.
1799 (Dwp_output_file::add_output_section): Likewise.
1800 (Dwp_output_file::add_contribution): Likewise.
1801 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1802 for empty slot.
1803 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1804 file format.
1805 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1806 slot.
1807 (Dwp_output_file::initialize): Remove unused function.
1808 (Dwp_output_file::finalize): Add support for v2 package file format.
1809 (Dwp_output_file::write_index): Likewise.
1810 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1811 function prototype.
1812
c6905c28
CC
18132013-07-31 Cary Coutant <ccoutant@google.com>
1814
1815 * object.cc (Sized_relobj::do_output_section_address): New function.
1816 (Sized_relobj): Instantiate explicitly.
1817 * object.h (Object::output_section_address): New function.
1818 (Object::do_output_section_address): New function.
1819 (Sized_relobj::do_output_section_address): New function.
1820 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
1821
18222013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 1823 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
1824
1825 * parameters.cc (Parameters::entry): Return target-specific entry
1826 symbol name.
1827 * target.h (Target::entry_symbol_name): New function.
1828 (Target_info::entry_symbol_name): New data member.
1829
1830 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
1831 * i386.cc (Target_i386::i386_info): Likewise.
1832 (Target_i386_nacl::i386_nacl_info): Likewise.
1833 * sparc.cc (Target_sparc::sparc_info): Likewise.
1834 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
1835 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
1836 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
1837 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1838
234d4ab8
SA
18392013-07-22 Sterling Augustine <saugustine@google.com>
1840
1841 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
1842 Convert parameter shndx to local variable. Add parameters symtab
1843 and symtab_size. Scan over section names. Find relocation
1844 section corresponding to current section. Create and initialize
1845 reloc_mapper_ and reloc_type_.
1846 (Dwarf_pubnames_table::read_header): Add assertion. Change
1847 unit_length to off_t. Initialize member unit_length_. Fill in field
1848 cu_offset_.
1849 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1850 Initialize new fields unit_length_ and cu_offset_.
1851 (Dwarf_pubnames_table::read_section): Update prototype.
1852 (Dwarf_pubnames_table::cu_offset): New member function.
1853 (Dwarf_pubnames_table::subsection_size): Likewise.
1854 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
1855 New fields.
1856 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
1857 member functions public.
1858 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
1859 Update comment. Rework logic. Move repeated parts to...
1860 (Gdb_index_info_reader::read_pubtable): ...here. New function.
1861 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
1862 pubtypes_table_, and stmt_list_offset.
1863 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1864 Gdb_index::find_pubtype_offset,
1865 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
1866 (Gdb_index::pubnames_read): Update prototype and rework logic.
1867 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
1868 Forward declare.
1869 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1870 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
1871 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
1872 Gdb_index::map_pubtable_to_dies):
1873 Declare functions.
1874 (Gdb_index::pubnames_read): Update declaration.
1875 (Gdb_index::Pubname_offset_map): New type.
1876 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
1877 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
1878 Gdb_index::stmt_list_offset): Declare.
1879 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
1880 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
1881 Gdb_index::pubtypes_offset_): Remove.
1882
a3ed37d8
RM
18832013-07-19 Roland McGrath <mcgrathr@google.com>
1884
1885 * options.h (General_options): Add -Trodata-segment option.
1886 * parameters.cc (Parameters::check_rodata_segment): New function.
1887 (Parameters::set_target_once): Call it.
1888 * parameters.h (Parameters): Declare it (private member function).
1889 * layout.cc (load_seg_unusable_for_headers): New function, broken
1890 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
1891 then validate rodata segment rather than text segment.
1892 (relaxation_loop_body): Call that.
1893 (is_text_segment): New function. Don't admit a non-executable
1894 segment if TARGET->isolate_execinstr().
1895 (set_segment_offsets): Call it. Honor -Trodata-segment option.
1896
eb5b4ded
CC
18972013-07-15 Shawn Landden <shawnlandden@gmail.com>
1898
1899 PR gold/15070
1900 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
1901 * nacl.h (Sniff_file::View::View): Request aligned view.
1902
4d5effb9
CC
19032013-07-11 Cary Coutant <ccoutant@google.com>
1904
1905 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
1906 correct BRLT entry size.
1907
ba8ca3e7
AM
19082013-07-03 Alan Modra <amodra@gmail.com>
1909
1910 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
1911 comment.
1912
267257d2
CC
19132013-07-01 Cary Coutant <ccoutant@google.com>
1914
1915 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
1916 reloc_type_.
1917 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
1918 (Dwarf_ranges_table::lookup_reloc): New function.
1919 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
1920 reloc_type_.
1921 (Dwarf_ranges_table::lookup_reloc): New function.
1922 (Dwarf_ranges_table::reloc_type_): New data member.
1923
06f30c9d
CC
19242013-06-27 Jing Yu <jingyu@google.com>
1925
1926 PR gold/15662
1927 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
1928 function.
1929 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
1930 (Target_powerpc::do_relax): Call the above.
1931
a2d7bf59
AM
19322013-06-27 Cary Coutant <ccoutant@google.com>
1933
1934 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1935 on garbage collected .opd section.
1936
19372013-06-27 Alan Modra <amodra@gmail.com>
1938
1939 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
1940 is non-zero.
1941 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
1942 (Target_powerpc::do_function_location): Likewise for loc->shndx.
1943
32364e50
CC
19442013-06-14 Cary Coutant <ccoutant@google.com>
1945
1946 * resolve.cc (Symbol::override_base): Don't override st_type
1947 from plugin placeholder symbols.
1948 (Symbol_table::resolve): Likewise.
1949 (Symbol_table::should_override): Don't complain about TLS mismatch
1950 if the TO symbol is a plugin placeholder.
1951 * testsuite/Makefile.am (plugin_test_tls): New test.
1952 * testsuite/Makefile.in: Regenerate.
1953 * testsuite/plugin_test_tls.sh: New test script.
1954 * testsuite/two_file_test_2_tls.cc: New test source.
1955 * testsuite/two_file_test_tls.cc: New test source.
1956
7fb47cc9
CC
19572013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
1958
1959 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
1960 the maximum segment alignment is larger than the page size.
1961 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
1962 correctly aligns the symbols with large alignemnt.
1963 * testsuite/Makefile.in: Regenerate.
1964 * testsuite/large_symbol_alignment.cc: New file.
1965
6934001a
CC
19662013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
1967 Sriraman Tallam <tmsriram@google.com>
1968
1969 * options.h (sort_section): New option.
1970 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
1971 Rename from Input_section_sort_section_name_special_ordering_compare.
1972 (Input_section_sort_section_name_compare): New struct.
1973 * output.cc (Output_section::Input_section_sort_section_name_compare::
1974 operator()): New function.
1975 (Output_section::sort_attached_input_sections): Use new sort function
1976 for .text if --sort-section=name is specified.
1977 * layout.cc (Layout::make_output_section):
1978 Add sorting by name when --sort-section=name is specified.
1979 * testsuite/Makefile.am (text_section_grouping): Test option
1980 --sort-section=name.
1981 * testsuite/Makefile.in: Regenerate.
1982 * testsuite/section_sorting_name.cc: New file.
1983 * testsuite/section_sorting_name.sh: New file.
1984
93acabad
CC
19852013-05-21 Cary Coutant <ccoutant@google.com>
1986
1987 * symtab.h (Symbol::is_cxx_vtable): New function.
1988 * target-reloc.h (relocate_section): Check for vtable symbol.
1989 * testsuite/Makefile.am (missing_key_func.sh): New test case.
1990 * testsuite/Makefile.in: Regenerate.
1991 * testsuite/missing_key_func.cc: New test source.
1992 * testsuite/missing_key_func.sh: New test script.
1993
60e8b3fc
CC
19942013-05-21 Cary Coutant <ccoutant@google.com>
1995
2b64b551
RM
1996 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
1997 type of enclosing symbol.
1998 (Relocate_info::location): Check symbol type when describing symbol.
1999 * object.h (Symbol_location_info): Remove unused line_number;
2000 add enclosing_symbol_type.
2001 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 2002
9df9de2c
CC
20032013-05-13 Cary Coutant <ccoutant@google.com>
2004
2b64b551
RM
2005 * configure.ac: Export DEFAULT_TARGET.
2006 * configure: Regenerate.
2007 * Makefile.in: Regenerate.
2008 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
2009 * testsuite/Makefile.in: Regenerate.
2010 * testsuite/debug_msg.sh: Delete duplicate tests.
2011 Don't check undef_int error message match for powerpc where the
2012 source file and line number aren't available.
9df9de2c 2013
bbc5ae17
RM
20142013-05-10 Roland McGrath <mcgrathr@google.com>
2015
2016 * options.h (General_options): Add --rosegment-gap option.
2017 * options.cc (finalize): --rosegment-gap implies --rosegment.
2018 * layout.cc (set_segment_offsets): Let user option override
2019 target->rosegment_gap().
2020
0c6e6c39
RM
20212013-05-10 Roland McGrath <mcgrathr@google.com>
2022
2023 * options.h (General_options): Remove leading space from help
2024 messages for -nostdlib and --rosegment.
2025
cde7cb01
MR
20262013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
2027
2028 PR ld/15365
2029 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
2030
f31ae5b8
AM
20312013-05-03 Alan Modra <amodra@gmail.com>
2032
2033 * merge.cc (Output_merge_string::do_add_input_section): Correct
2034 scan for number of strings. Rename vars to avoid shadowing.
2035 Include missing terminator in input_size_.
2036
d3a7cd45
L
20372013-05-01 H.J. Lu <hongjiu.lu@intel.com>
2038
2039 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
2040 Restore empty string handling.
2041
6ad3daba
CC
20422013-05-01 Cary Coutant <ccoutant@google.com>
2043
2044 * stringpool.cc (Stringpool_template::new_key_offset): Fix
2045 uninitialized warning.
2046
e31908b6
CC
20472013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
2048
2049 * output.cc (Output_section::add_merge_input_section): Allow
2050 to merge sections if the alignment is more than character size.
2051 * merge.h (Output_merge_string::Output_merge_string): Remove
2052 assert.
2053 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
2054 only not-null strings. Check the alignment of strings.
2055 * stringpool.h
2056 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
2057 alignment as the argument.
2058 (Stringpool_template<Stringpool_char>::addralign_): New class member.
2059 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
2060 Align non-zero length strings according to the addralign_.
2061 (Stringpool_template<Stringpool_char>::set_string_offsets):
2062 Updating offsets according to the given alignment.
2063 * testsuite/Makefile.am (text_section_grouping): Test if string
2064 literals are getting merged.
2065 * testsuite/Makefile.in: Regenerate.
2066 * testsuite/merge_string_literals_1.c: New file.
2067 * testsuite/merge_string_literals_2.c: Ditto.
2068 * testsuite/merge_string_literals.sh: Ditto.
2069
0e804863
ILT
20702013-04-26 Ian Lance Taylor <iant@google.com>
2071
2072 * target-reloc.h (relocate_section): If the reloc offset is out of
2073 range, pass VIEW as NULL to relocate.relocate.
2074 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
2075 * i386.cc (Target_i386::Relocate::relocate): Likewise.
2076 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
2077 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
2078 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
2079 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
2080
e7c5ea40
CC
20812013-04-26 Geoff Pike <gpike@chromium.org>
2082
2083 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
2084 * layout.cc (Hash_task): New class.
2085 (Layout::queue_build_id_tasks): New function.
2086 (Layout::write_build_id): Handle single-thread portion of build ID
2087 computation. (In some cases, all of it is single-threaded.) Replace
2088 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
2089 functionality in fewer lines of code.
2090 * layout.h (Layout::queue_build_id_tasks): New function declaration.
2091 * options.h (General_options): make "--build-id" default to tree
2092 rather than sha1. Add two new options related to --build-id=tree:
2093 --build-id-chunk-size-for-treehash and
2094 --build-id-min-file-size-for-treehash.
2095 * Makefile.am: add testing of --build-id=tree and related new options
2096 (these tests will be invoked by "make check").
2097 * Makefile.in: Regenerate.
2098
49926cd0
AM
20992013-04-25 Alan Modra <amodra@gmail.com>
2100
2101 * configure.tgt: Add powerpcle and powerpc64le.
2102
a4034750
AM
21032013-04-22 Alan Modra <amodra@gmail.com>
2104
2105 PR gold/15355
2106 * layout.cc (Layout::segment_precedes): Allow more than one
2107 segment with the same type and flags.
2108
e79c84aa
CC
21092013-04-15 Cary Coutant <ccoutant@google.com>
2110
2111 * layout.cc (Layout::set_relocatable_section_offsets): Don't
2112 allocate space in file for BSS sections.
2113
2199fbe7
CC
21142013-04-15 Cary Coutant <ccoutant@google.com>
2115
2116 * script-sections.cc (Orphan_output_section): Reset address
2117 to zero after each orphaned section for relocatable links.
2118
502e8a84
CC
21192013-04-15 Cary Coutant <ccoutant@google.com>
2120
a4034750
AM
2121 * symtab.cc (Symbol_table::sized_write_globals): Subtract
2122 section starting address for relocatable link.
2123 * testsuite/Makefile.am (script_test_11): New test.
2124 * testsuite/Makefile.in: Regenerate.
2125 * testsuite/script_test_11.c: New source file.
2126 * testsuite/script_test_11.t: New linker script.
502e8a84 2127
0cfdc767
AM
21282013-04-13 Alan Modra <amodra@gmail.com>
2129
2130 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
2131 owner when sections are not adjacent and exceed group size.
2132 (Target_powerpc::group_sections): Handle corner case.
2133 (Target_powerpc::Branch_info::make_stub): Handle case where
2134 stub table doesn't exist due to branches in non-exec sections.
2135 (Target_powerpc::Relocate::relocate): Likewise.
2136
6830ee24
AM
21372013-04-11 Alan Modra <amodra@gmail.com>
2138
2139 PR gold/15354
2140 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
2141 .branch_lt to match bfd ld. Adjust comments throughout file.
2142
54a3d865
ILT
21432013-04-04 Ian Lance Taylor <iant@google.com>
2144
2145 GCC PR c++/56840
2146 * object.cc (do_layout_deferred_sections): Handle .eh_frame
2147 sections before checking whether they are included in the link.
2148
9993ba11
ST
21492013-03-29 Sriraman Tallam <tmsriram@google.com>
2150
2151 * archive.cc (Archive::get_elf_object_for_member): Create the elf
2152 object before calling the plugin claim_file handler. Pass the elf
2153 object of the archive to the plugin. Delete the elf object if the
2154 plugin claims the file.
2155
ebacd51e
AM
21562013-03-21 Alan Modra <amodra@gmail.com>
2157
2158 * layout.cc (Layout::set_segment_offsets): Accept writable .text
2159 segment when omagic.
2160
117be58f
AM
21612013-03-21 Alan Modra <amodra@gmail.com>
2162
2163 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
2164 comparison warning.
2165 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
2166 uninitialized" warning.
2167
32e2b61d
AM
21682013-03-20 Alan Modra <amodra@gmail.com>
2169
2170 * symtab.h (Symbol::clear_version): New function.
2171 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
2172 is_needed by weak references. Clear version for symbols defined
2173 in as-needed objects that are not needed.
2174
b3ccdeb5
AM
21752013-03-15 Alan Modra <amodra@gmail.com>
2176
2177 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
2178 static and public. Add report_err param. Return false for data refs.
2179 (Target_powerpc::rela_dyn_section): New overloaded function.
2180 (Target_powerpc::plt_, iplt_): Elucidate.
2181 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
2182 (Output_data_plt_powerpc::do_write): Don't write .iplt.
2183 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
2184 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
2185 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
2186 push_branch and make_plt_entry for ifunc syms when
2187 reloc_needs_plt_for_ifunc.
2188 (Target_powerpc::Relocate::relocate): Don't use plt entry value
2189 for ifunc unless reloc_needs_plt_for_ifunc.
2190
ad3d8a2f
AM
21912013-03-15 Alan Modra <amodra@gmail.com>
2192
2193 * gc.h (gc_process_relocs): Don't look through function descriptors.
2194 * icf.cc (get_section_contents): Do so here instead.
2195
4d9aa155
AM
21962013-03-13 Alan Modra <amodra@gmail.com>
2197
2198 * powerpc.cc (is_branch_reloc): Forward declare.
2199 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
2200 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
2201 false for 64-bit, true for 32-bit non-branch relocs.
2202 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
2203 * testsuite/Makefile.am (icf_test): Use linker map file instead of
2204 nm output.
2205 (icf_safe_test): Generate linker map file as well as nm output.
2206 (icf_safe_so_test): Likewise.
2207 * testsuite/Makefile.in: Regenerate.
2208 * testsuite/icf_test.sh: Parse linker map file to determine
2209 section folding.
2210 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
2211 * testsuite/icf_safe_so_test.sh: Likewise.
2212 (X86_32_or_ARM_specific_safe_fold): Merge into..
2213 (arch_specific_safe_fold): ..this.
2214 (X86_64_specific_safe_fold): Delete unused function.
2215
57420c20
AM
22162013-03-12 Alan Modra <amodra@gmail.com>
2217
2218 * gc.h (gc_process_relocs): Look through function descriptors
2219 to determine shndx, symvalue and addend used by ICF. Tidy
2220 variable duplication.
2221
dc3714f3
AM
22222013-03-11 Alan Modra <amodra@gmail.com>
2223
2224 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
2225 * layout.cc (Layout_task_runner::run): ..to here.
2226 * symtab.h (struct Symbol_location): Extract from..
2227 (class Symbol_table): ..here.
2228 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
2229 * target.h (class Target): Add function_location and
2230 do_function_location functions.
2231 (class Sized_target): Add do_function_location.
2232 * object.h (class Sized_relobj_file): Move find_shdr..
2233 (class Object): ..to here.
2234 * object.cc: Likewise. Update to suit. Instantiate.
2235 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
2236 * powerpc.cc (class Powerpc_dynobj): New.
2237 (Target_powerpc::do_function_location): New function.
2238 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
2239 (Powerpc_dynobj::do_read_symbols): New function.
2240 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
2241
956b03bb
ILT
22422013-03-08 Ian Lance Taylor <iant@google.com>
2243
2244 * options.cc (General_options::string_to_object_format): Accept
2245 "default".
2246
4bead2d5
AM
22472013-03-08 Alan Modra <amodra@gmail.com>
2248
2249 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
2250 pointer to Post_fde.
2251 (struct Post_fde): Move definition to here..
2252 * ehframe.cc (struct Post_fde): ..from here.
2253 (Cie::write): Don't alloc Post_fde.
2254 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
2255
02e60bf7
AM
22562013-03-07 Alan Modra <amodra@gmail.com>
2257
2258 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
2259 relocation referencing .LC0.
2260 * testsuite/discard_locals_test.sh: Remove FIXMEs.
2261
8343f03a
AM
22622013-03-07 Alan Modra <amodra@gmail.com>
2263
2264 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
2265 always_inline. Add assembly for powerpc to avoid GOT.
2266
3366d57c
AM
22672013-03-07 Alan Modra <amodra@gmail.com>
2268
2269 * testsuite/script_test_10.sh: Don't test .bss section
2270 header number.
2271
6c77229c
AM
22722013-03-06 Alan Modra <amodra@gmail.com>
2273
2274 * powerpc.cc (class Powerpc_relobj): Move some member functions.
2275 (Target_powerpc::symval_for_branch): Add symtab param. Update
2276 all callers. Handle folded sections.
2277 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
2278 to Powerpc_relobj.
2279 (Global_symbol_visitor_opd::operator()): Likewise.
2280
a39e4af6
AM
22812013-03-04 Alan Modra <amodra@gmail.com>
2282
2283 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
2284 * testsuite/Makefile.in: Regenerate.
2285
d5834edb
CC
22862013-03-01 Cary Coutant <ccoutant@google.com>
2287
2288 Add dwp support for v2 DWARF package file format.
2289 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2290 tu_length parameter. Adjust all callers.
2291 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2292 * dwp.cc: Include dwarf.h.
2293 (Section_bounds): New struct type.
2294 (Unit_set): New struct type.
2295 (Dwo_file::Dwo_file): Initialize new data member.
2296 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2297 Combine and rename to...
2298 (Dwo_file::read_unit_index): ...this.
2299 (Dwo_file::sized_read_compunit_index)
2300 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2301 (Dwo_file::sized_read_unit_index): ...this.
2302 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2303 parameters; add section_id parameter.
2304 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2305 (Dwo_file::add_unit_set): ...this.
2306 (Dwo_file::shndx_map_): Remove.
2307 (Dwo_file::sect_offsets_): New data member.
2308 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2309 (Dwp_output_file::add_section): Rename to...
2310 (Dwp_output_file::add_contribution): ...this.
2311 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2312 (Dwp_output_file::add_tu_set): Likewise.
2313 (Dwp_output_file::Contribution): New type.
2314 (Dwp_output_file::Section::contributions): New data member.
2315 (Dwp_output_file::Cu_or_tu_set): Remove.
2316 (Dwp_output_file::Section::Section): New ctor.
2317 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2318 (Dwp_output_file::Dwp_index::Section_table): New type.
2319 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2320 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2321 parameter.
2322 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2323 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2324 (Dwp_output_file::Dwp_index::section_table): New member function.
2325 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2326 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2327 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2328 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2329 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2330 (Dwp_output_file::Dwp_index::section_table_): New data member.
2331 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2332 (Dwp_output_file::add_output_section): New member function.
2333 (Dwp_output_file::write_new_section): New member function.
2334 (Dwp_output_file::write_contributions): New member function.
2335 (Dwp_output_file::section_id_map_): New data member.
2336 (class Dwo_id_info_reader): Remove.
2337 (class Unit_reader): New class.
2338 (get_dwarf_section_name): New function.
2339 (Dwo_file::read_executable): Adjust initializations of class data.
2340 (Dwo_file::read): Add support for v2 package file format.
2341 (Dwo_file::read_unit_index): Likewise.
2342 (Dwo_file::sized_read_unit_index): Likewise.
2343 (Dwo_file::copy_section): Likewise.
2344 (Dwo_file::add_unit_set): Likewise.
2345 (Dwp_output_file::add_output_section): Likewise.
2346 (Dwp_output_file::add_contribution): Likewise.
2347 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2348 for empty slot.
2349 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2350 file format.
2351 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2352 slot.
2353 (Dwp_output_file::initialize): Remove unused function.
2354 (Dwp_output_file::finalize): Add support for v2 package file format.
2355 (Dwp_output_file::write_index): Likewise.
2356 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2357 function prototype.
2358
a68a081d
CC
23592013-03-01 Cary Coutant <ccoutant@google.com>
2360
2361 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
2362 function into class definition in header file.
2363 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
2364 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
2365 New function.
2366 (Dwarf_info_reader::check_buffer): Move here from .cc file.
2367
9d5781f8
AM
23682013-02-28 Alan Modra <amodra@gmail.com>
2369
2370 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
2371 * target.cc (Target::do_plt_fde_location): New function.
2372 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
2373 accessor function, and constructor param.
2374 (struct Post_fde, Post_fdes): Declare.
2375 (Cie::write): Add post_fdes param.
2376 * ehframe.cc (Fde::write): Use plt_fde_location.
2377 (struct Post_fde): Define.
2378 (Cie::write): Stash FDEs added post merge mapping.
2379 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
2380 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
2381 (Eh_frame::do_sized_write): Arrange to write post map FDES after
2382 other FDEs.
2383 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
2384 (Target_powerpc::has_glink): New function.
2385 (Target_powerpc::do_relax): Add eh_frame info for stubs.
2386 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
2387 glink_eh_frame_fde_32, default_fde): New data.
2388 (Stub_table::eh_frame_added_): New var.
2389 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
2390 Make const.
2391 (Stub_table::add_eh_frame): New function.
2392 (Output_data_glink::add_eh_frame): New function.
2393 (Target_powerpc::make_glink_section): Call add_eh_frame.
2394
214383dd
ILT
23952013-02-15 Ian Lance Taylor <iant@google.com>
2396
2397 * options.h (DEFINE_uint64_alias): Define.
2398 (class General_options): Add -Ttext-segment as an alias for
2399 -Ttext.
2400
91c2b899
AM
24012013-02-15 Alan Modra <amodra@gmail.com>
2402
2403 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
2404 (Stub_table::do_write): ..here, two places.
2405 (Stub_table::plt_call_size): Use it here too.
2406
20e2a8aa
ILT
24072013-02-11 Ian Lance Taylor <iant@google.com>
2408
2409 * descriptors.cc (Descriptors::close_all): New function.
2410 * descriptors.h (class Descriptors): Declare close_all.
2411 (close_all_descriptors): New inline function.
2412 * plugin.cc: Include "descriptors.h".
2413 (Plugin_manager::cleanup): Call close_all_descriptors.
2414
8952bc69
AM
24152013-02-06 Alan Modra <amodra@gmail.com>
2416
2417 * README: Update coding style link.
2418
29bd8b6b
CC
24192013-01-28 Cary Coutant <ccoutant@google.com>
2420
a4034750
AM
2421 * dwp.cc (File_list): New typedef.
2422 (Dwo_name_info_reader): New class.
2423 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
2424 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
2425 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
2426 (Dwo_file::read_executable): New function.
2427 (Dwo_file::read): Move common setup code to ...
2428 (Dwo_file::make_object): ... here.
2429 (dwp_options): Add --exec/-e.
2430 (usage): Likewise.
2431 (main): Likewise.
29bd8b6b 2432
c6ac678d
ST
24332013-01-24 Sriraman Tallam <tmsriram@google.com>
2434
2435 * layout.cc (Layout::layout): Check for option text_reorder.
2436 (Layout::make_output_section): Ditto.
2437 * options.h (text_reorder): New option.
2438 * output.cc (Input_section_sort_compare): Remove special ordering
2439 of section names.
2440 (Output_section::
2441 Input_section_sort_section_name_special_ordering_compare::
2442 operator()): New function.
2443 (Output_section::sort_attached_input_sections): Use new sort function
2444 for .text.
2445 * output.h (Input_section_sort_section_name_special_ordering_compare):
2446 New struct.
2447 * testsuite/Makefile.am (text_section_grouping): Test option
2448 --no-text-reorder
2449 * testsuite/Makefile.in: Regenerate.
2450 * testsuite/text_section_grouping.sh: Check order of functions without
2451 default text reordering.
2452
50701cc1
MF
24532013-01-18 Mike Frysinger <vapier@gentoo.org>
2454
2455 * options.h (General_options): Change default to true for new_dtags.
2456
b1b00fcc
MF
24572013-01-18 Mike Frysinger <vapier@gentoo.org>
2458
2459 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
2460 when enable_new_dtags is false. Only add DT_RUNPATH when
2461 enable_new_dtags is true.
2462
ec5b8187
AM
24632013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
2464
2465 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
2466 used in declaration and definition consistent.
2467 (Target_powerpc::symval_for_branch): Ditto.
2468
a880d4c4
ST
24692013-01-16 Sriraman Tallam <tmsriram@google.com>
2470
2471 * testsuite/plugin_final_layout.cc: Fix comment.
2472
7c381248
ST
24732013-01-16 Sriraman Tallam <tmsriram@google.com>
2474
2475 * layout.cc (Layout::layout): Do not do default sorting for
2476 text sections when section ordering is specified.
2477 (make_output_section): Ditto.
2478 * testsuite/plugin_final_layout.cc: Name the function sections
2479 to catch reordering issues.
2480
e2458743
AM
24812013-01-15 Alan Modra <amodra@gmail.com>
2482
2483 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
2484 plt-thread-safe.
2485
431ed302
AM
24862013-01-15 Alan Modra <amodra@gmail.com>
2487
2488 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
2489 * testsuite/Makefile.in: Regenerate.
2490
0ec6429b
AM
24912013-01-14 Alan Modra <amodra@gmail.com>
2492
2493 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
2494 * testsuite/Makefile.in: Regenerate.
2495
0bf402d5
ILT
24962013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
2497
36af3926 2498 PR bfd/14430
0bf402d5
ILT
2499 Fix mingw gold build with plugins enabled
2500 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
2501 * configure.ac: Export DLOPEN_LIBS and add headers check.
2502 * plugin.cc: Handle non-dlfcn case.
2503 * Makefile.in: Regenerate.
2504 * config.in: Regenerate.
2505 * configure: Regenerate.
2506 * testsuite/Makefile.in: Regenerate.
2507
9e9143bc
ST
25082013-01-09 Sriraman Tallam <tmsriram@google.com>
2509
2510 * output.h (sort_attached_input_sections): Change to be public.
2511 * script-sections.cc
2512 (Output_section_definition::set_section_addresses): Sort
2513 attached input sections according to section order before linker
2514 script assigns section addresses.
2515 (Orphan_output_section::set_section_addresses): Sort
2516 attached input sections according to section order before linker
2517 script assigns section addresses.
2518 * Makefile.am (final_layout.sh): Use a simple linker script to
2519 check if section ordering still works.
2520 * Makefile.in: Regenerate.
2521
679af368
ILT
25222013-01-09 Ben Cheng <bccheng@google.com>
2523
2524 * arm.cc (Target_arm::attributes_accept_div): New function.
2525 (Target_arm::attributes_forbid_div): New function.
2526 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
2527 attribute using the same new functions as what bfd/elf32_arm.c
2528 does.
2529
3136a00e
CC
25302013-01-07 Cary Coutant <ccoutant@google.com>
2531
2532 PR gold/14993
2533 * output.cc (Output_section::add_input_section): For incremental
2534 updates, don't track input sections that are allocated from patch
2535 space.
2536
f2a6224b
L
25372013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2538 Ian Lance Taylor <iant@google.com>
2539
2540 PR gold/14897
2541 * configure.ac (--enable-ld): Removed.
2542 (install_as_default): Set to yes only for --enable-gold=default
2543 or --disable-ld.
2544 * configure: Regenerated.
2545
4f46f626
L
25462013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2547
2548 * options.h (General_options): Add -fuse-ld= for GCC linker
2549 option compatibility.
2550
26e4ef59
CC
25512013-01-04 Cary Coutant <ccoutant@google.com>
2552
2553 * configure.ac: Fix typo restoring CXXFLAGS.
2554 * configure: Regenerate.
2555
3d587466
CC
25562013-01-04 Cary Coutant <ccoutant@google.com>
2557
4f46f626
L
2558 * testsuite/Makefile.am (CXXLINK_S): New macro.
2559 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
2560 * testsuite/Makefile.in: Regenerate.
3d587466 2561
44db6695
L
25622013-01-02 H.J. Lu <hongjiu.lu@intel.com>
2563
2564 * version.cc (print_version): Update copyright year to 2013.
2565
edcac0c1
ILT
25662012-12-20 Ian Lance Taylor <iant@google.com>
2567
2568 * layout.cc (Layout::special_ordering_of_input_section): New
2569 function.
2570 (Layout::layout): If input section requires special ordering, must
2571 sort input sections.
2572 (Layout::make_output_section): May sort .text input sections.
2573 (Layout::is_section_name_prefix_grouped): Remove.
2574 * layout.h (class Layout): Declare
2575 special_ordering_of_input_section. Don't declare
2576 is_section_name_prefix_grouped.
2577 * output.cc (Output_section::add_input_section): Revert last
2578 change.
2579 (Output_section::Input_section_sort::match_file_name): Don't crash
2580 if called on output section data.
2581 (Output_section::Input_section_sort_compare): Sort based on
2582 special ordering.
2583 (Output_section::Input_section_sort_section_order_index_compare):
2584 Revert last patch.
2585 (Output_section::sort_attached_input_sections): Likewise.
2586
28f2a4ac
ST
25872012-12-18 Sriraman Tallam <tmsriram@google.com>
2588
edcac0c1 2589 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
2590 * layout.h (Layout::is_section_name_prefix_grouped): New function.
2591 * output.cc (Output_section::add_input_section): Check if section
2592 name contains special prefix. Keep input sections to sort such
2593 sections.
2594 (Output_section::Input_section_sort_section_order_index_compare
2595 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
2596 (Output_section::sort_attached_input_sections): Add condition to
2597 Input_section_entry constructor call.
28f2a4ac
ST
2598 * testsuite/Makefile.am (text_section_grouping): New test.
2599 * testsuite/Makefile.in: Regenerate.
2600 * testsuite/text_section_grouping.cc: New file.
2601 * testsuite/text_section_grouping.sh: New file.
2602
5bf135a7
NC
26032012-12-17 Nick Clifton <nickc@redhat.com>
2604
2605 * Makefile.am: Add copyright notice.
2606 * NEWS: Likewise.
2607 * README: Likewise.
2608 * configure.ac: Likewise.
2609 * ftruncate.c: Likewise.
2610 * Makefile.in: Regenerate.
2611
59965708
CC
26122012-12-14 Cary Coutant <ccoutant@google.com>
2613
a4034750
AM
2614 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
2615 --no-as-needed flag.
2616 (exception_separate_shared_12_test): Likewise.
2617 (incremental_copy_test): Likewise.
2618 * testsuite/Makefile.in: Regenerate.
59965708 2619
2a77e2ab
CC
26202012-12-14 Cary Coutant <ccoutant@google.com>
2621
2622 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
2623 (Dwp_output_file::Dwp_index::enter_set): Add assert.
2624
e3deeb9c
AM
26252012-12-12 Alan Modra <amodra@gmail.com>
2626
2627 * powerpc.cc (class Track_tls): New.
2628 (class Relocate, class Scan): Inherit Track_tls.
2629 (Target_powerpc::Scan::local, global): Track tls optimization
2630 and avoid creating plt entry for __tls_get_addr if all uses
2631 are optimized away.
2632 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
2633
d8f5a274
AM
26342012-12-12 Alan Modra <amodra@gmail.com>
2635
2636 * options.h (General_options): Add --toc-sort/--no-toc-sort.
2637 Replace no_toc_optimize with toc_optimize.
2638 * output.h (Output_section::input_sections): Provide non-const variant.
2639 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
2640 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
2641 accessors.
2642 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
2643 (class Sort_toc_sections): New.
2644 (Target_powerpc::do_finalize_sections): Sort toc sections.
2645 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
2646
4c8a1de1
RM
26472012-12-10 Roland McGrath <mcgrathr@google.com>
2648
2649 * testsuite/binary_unittest.cc (read_all): New function.
2650 (Sized_binary_test): Use it instead of ::read.
2651 * fileread.cc (do_read): Don't assume pread always reads the whole
2652 amount in a single call.
2653
edc27beb
AM
26542012-12-10 Alan Modra <amodra@gmail.com>
2655
2656 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
2657 Set EM_PPC64 or EM_PPC here.
2658 (Target_selector_powerpc::do_recognize): Delete.
2659
906b9150
AM
26602012-12-10 Alan Modra <amodra@gmail.com>
2661
2662 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
2663 stub_table_.
2664 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
2665
418c15ae
RM
26662012-12-07 Roland McGrath <mcgrathr@google.com>
2667
2668 * testsuite/binary_unittest.cc (Sized_binary_test):
2669 Use open_descriptor rather than ::open.
2670
decdd3bc
AM
26712012-12-07 Alan Modra <amodra@gmail.com>
2672
2673 * powerpc.cc (Stub_table::do_write): Delete redundant Address
2674 typedef and invalid_address constant.
2675 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
2676 instantiate constants.
2677
db399005
ILT
26782012-12-06 Roland McGrath <mcgrathr@google.com>
2679
2680 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
2681 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
2682 * aclocal.m4: Regenerate.
2683 * configure: Regenerate.
2684 * Makefile.in: Regenerate.
2685 * testsuite/Makefile.in: Regenerate.
2686
aba6bc71
AM
26872012-12-07 Alan Modra <amodra@gmail.com>
2688
2689 * options.h (General_options): Add no_toc_optimize.
2690 * powerpc.cc (ok_lo_toc_insn): New function.
2691 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
2692
9e69ed50
AM
26932012-12-06 Alan Modra <amodra@gmail.com>
2694
2695 * options.h (General_options): Add plt_align, plt_static_chain,
2696 plt_thread_safe. Update stub_group_size help text.
2697 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
2698 for new plt_thread_safe_ var.
2699 (use_plt_offset): Correct comments.
2700 (Target_powerpc::do_relax): Look for thread creation symbols to
2701 determine default plt_thread_safe value. Clear plt call stubs
2702 as well as branch stubs each iteration.
2703 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
2704 insn constants.
2705 (l, hi, ha, write_insn): Move earlier.
2706 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
2707 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
2708 plt stubs too.
2709 (Stub_table::update_size): Adjust.
2710 (Stub_table::prev_size, set_prev_size): Delete.
2711 (Stub_table::stub_align): Let --plt-align affect result.
2712 (Stub_table::plt_call_size): Calculate sizes for various stubs.
2713 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
2714 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
2715 (Stub_table::do_write): Support more stub variants.
2716
f43ba157
AM
27172012-12-04 Alan Modra <amodra@gmail.com>
2718
2719 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
2720 (Target_powerpc::do_define_standard_symbols): New function.
2721
34171bc5
AM
27222012-12-03 Alan Modra <amodra@gmail.com>
2723
2724 * output.h: Formatting, whitespace.
2725
dc9589e9 27262012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
2727
2728 * layout.h (Layout::get_executable_sections): Declare.
2729 * layout.cc (Layout::get_executable_sections): New function.
2730 * arm.cc (Target_arm::group_sections): Use it.
2731 (Arm_output_section::group_sections): Delete now redundant test.
2732 * output.cc (Output_reloc::Output_reloc): Add is_relative.
2733 param to handle relative relocs.
2734 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
2735 (Output_data_reloc::add_absolute): Adjust.
2736 (Output_data_reloc::add_relative): New function.
2737 (Output_data::reset_data_size): New function.
2738 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
2739 (Output_section::set_addralign): New function.
2740 (Output_section::checkpoint_set_addralign): New function.
2741 (Output_section::clear_section_offsets_need_adjustment): New function.
2742 (Output_section::input_sections): Make public.
2743 * powerpc.cc (class Output_data_brlt_powerpc): New.
2744 (class Stub_table, class Stub_control): New.
2745 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
2746 stub_table_, set_stub_table, stub_table): New vectors and accessor
2747 functions.
2748 (Target_powerpc::do_may_relax, do_relax, push_branch,
2749 new_stub_table, stub_tables, brlt_section, group_sections,
2750 add_branch_lookup_table, find_branch_lookup_table,
2751 write_branch_lookup_table, make_brlt_section): New functions.
2752 (Target_powerpc::struct Sort_sections, class Branch_info): New.
2753 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
2754 branch_info_): New vars.
2755 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
2756 make call stubs here.
2757 (Output_data_glink): Remove all call stub handling from this class.
2758 (Target_powerpc::Scan::local, global): Save interesting branch
2759 relocs and relocs for ifunc. Adjust calls to plt entry functions.
2760 (Target_powerpc::do_finalize_sections): Only make reg save/restore
2761 functions on final link.
2762 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
2763 Handle long branch destinations too.
2764 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
2765 do_plt_address_for_local): Adjust lookup of plt call stubs.
2766
627b30b7
AM
27672012-11-30 Alan Modra <amodra@gmail.com>
2768
2769 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
2770 relocs against protected symbols when building 32-bit shared libs.
2771
40b469d7
AM
27722012-11-30 Alan Modra <amodra@gmail.com>
2773
2774 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
2775 param. Call got_section() to make .got. Update all callers
2776 and their callers and so on.
2777
bb66a627
AM
27782012-11-30 Alan Modra <amodra@gmail.com>
2779
2780 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
2781 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
2782 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
2783 value if it already exists.
2784
d2cf1c6c
L
27852012-11-19 H.J. Lu <hongjiu.lu@intel.com>
2786
2787 PR gold/14858
2788 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
2789
edccdf7c
RM
27902012-11-14 Roland McGrath <mcgrathr@google.com>
2791
2792 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
2793 than bfc instruction for data sandboxing.
2794
6febeb74
AM
27952012-11-08 Alan Modra <amodra@gmail.com>
2796
2797 * po/POTFILES.in: Regenerate.
2798
0a6f1bf2
AM
27992012-11-05 Alan Modra <amodra@gmail.com>
2800
2801 * configure.ac: Apply 2012-09-10 change to config.in here.
2802 * configure: Regenerate.
2803
26a4e9cb
AM
28042012-11-05 Alan Modra <amodra@gmail.com>
2805
2806 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
2807 (struct Opd_ent): Use "Address" rather than "Offset".
2808 (Output_data_got_powerpc::got_base_offset): Return Valtype.
2809 (Target_powerpc::got_section): Make public.
2810 (Target_powerpc::scan_relocs): Move code setting symbols..
2811 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
2812 Create _SDA_BASE_ only when referenced.
2813
cc928013
RM
28142012-11-02 Roland McGrath <mcgrathr@google.com>
2815
2816 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
2817 from last change.
2818
50ed5eb1
RM
28192012-11-01 Roland McGrath <mcgrathr@google.com>
2820
62fe925a
RM
2821 * target.h (Sized_target::relocate_relocs): Use Elf_Off
2822 for offset_in_output_section parameter.
2823 (Sized_target::relocate_special_relocatable): Likewise.
2824 * arm.cc (Target_arm::relocate_relocs): Likewise.
2825 (Target_arm::relocate_special_relocatable): Likewise.
2826 * i386.cc (Target_i386::relocate_relocs): Likewise.
2827 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
2828 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
2829 * target-reloc.h (relocate_relocs): Likewise.
2830 * testsuite/testfile.cc (Target_test): Likewise.
2831 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
2832 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
2833
2834 * system.h: Move inclusion of <clocale> to after <libintl.h> in
2835 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
2836
2837 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
2838 parameter, which is unused in the [!F_SETFD] case.
2839
50ed5eb1
RM
2840 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
2841 SYMNDX to off_t before comparing it to this->data_size().
2842 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
2843 * incremental.cc (Output_section_incremental_inputs::do_write):
2844 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
2845
2cadc0bf
RM
2846 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
2847
3bfcb652
NC
28482012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
2849
2850 * gold.cc (Target_arm::do_adjust_elf_header): Add the
2851 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
2852 in EABI_VER5.
2853
c1a8d56e
CC
28542012-10-29 Cary Coutant <ccoutant@google.com>
2855
2856 * dwp.cc (usage): Add file and exit status parameters;
2857 add --help and --version options.
2858 (print_version): New function.
2859 (main): Add --help and --version options.
2860
b2490a7b
L
28612012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2862
2863 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
2864 final_layout_sequence.txt.
2865 * testsuite/Makefile.in: Regenerated.
2866
aa543512
L
28672012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2868
2869 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
2870 COMPILE generated by automake.
2871 (LINK1): Likewise.
2872 (CXXCOMPILE1): Likewise.
2873 (CXXLINK1): Likewise.
2874 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
2875 (LINK): Likewise.
2876 (CXXCOMPILE): Likewise.
2877 (CXXLINK): Likewise.
2878 * testsuite/Makefile.in: Regenerated.
2879
d361fafb
L
28802012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2881
2882 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
2883 on bad fwrite return.
2884
598c7410
L
28852012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2886
2887 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
2888 on val.
2889
35c813e2
CC
28902012-10-23 Cary Coutant <ccoutant@google.com>
2891
2892 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
2893 * testsuite/Makefile.in: Regenerate.
2894 * testsuite/dwp_test.h: New source file.
2895 * testsuite/dwp_test_1.cc: New source file.
2896 * testsuite/dwp_test_1.s: New source file.
2897 * testsuite/dwp_test_1.sh: New source file.
2898 * testsuite/dwp_test_1b.cc: New source file.
2899 * testsuite/dwp_test_1b.s: New source file.
2900 * testsuite/dwp_test_2.cc: New source file.
2901 * testsuite/dwp_test_2.s: New source file.
2902 * testsuite/dwp_test_2.sh: New source file.
2903 * testsuite/dwp_test_main.cc: New source file.
2904 * testsuite/dwp_test_main.s: New source file.
2905
77429909
CC
29062012-10-23 Cary Coutant <ccoutant@google.com>
2907
2908 * dwp.h: New header file.
2909 * dwp.cc: New source file.
2910 * gold.h: Move shared declarations to system.h.
2911 * system.h: New header file.
2912 * Makefile.am: Add dwp.
2913 * Makefile.in: Regenerate.
2914
ed5d6712
CC
29152012-10-23 Cary Coutant <ccoutant@google.com>
2916
2917 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
2918 Dwarf_info_reader::read_from_pointer.
2919 (Dwarf_pubnames_table::read_header): Likewise.
2920 (Dwarf_pubnames_table::next_name): Likewise.
2921 (Dwarf_die::read_attributes): Likewise.
2922 (Dwarf_die::skip_attributes): Likewise.
2923 (Dwarf_info_reader::read_from_pointer): New function template.
2924 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
2925 (Dwarf_pubnames_table): Likewise.
2926 (Dwarf_info_reader::read_from_pointer): New function template.
2927 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
2928 Dwarf_pubnames_table ctor.
2929
8787852d
CC
29302012-10-23 Cary Coutant <ccoutant@google.com>
2931
2932 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
2933 abbrev_shndx.
2934 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
2935 abbrev_shndx_.
2936 (Dwarf_info_reader::set_abbrev_shndx): New method.
2937 (Dwarf_info_reader::abbrev_shndx_): New data member.
2938
9fc236f3
CC
29392012-10-23 Cary Coutant <ccoutant@google.com>
2940
2941 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
2942 from object, not parameters.
2943 (Dwarf_info_reader::parse): Likewise.
2944 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
2945 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
2946 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
2947 methods.
2948
effe8365
CC
29492012-10-23 Cary Coutant <ccoutant@google.com>
2950
2951 * fileread.cc (Input_file::Input_file): New constructor.
2952 * fileread.h (class Input_file): Add new constructor.
2953
1698990d
AM
29542012-10-18 Alan Modra <amodra@gmail.com>
2955
2956 PR gold/14727
2957 * object.cc (Relobj::is_section_name_included): Also match
2958 .sdata personality section.
2959
168a4726
AM
29602012-10-18 Alan Modra <amodra@gmail.com>
2961
2962 * target-reloc.h (class Default_comdat_behavior): New, package up..
2963 (get_comdat_behaviour): ..this.
2964 (relocate_section): Add Relocate_comdat_behavior template arg,
2965 adjust code to suit.
2966 * arm.cc (Target_arm::relocate_section): Adjust to suit.
2967 (Target_arm::scan_reloc_section): Likewise.
2968 * i386.cc (Target_i386::relocate_section): Likewise.
2969 * sparc.cc (Target_sparc::relocate_section): Likewise.
2970 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
2971 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
2972 * powerpc.cc (class Relocate_comdat_behavior): New.
2973 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
2974 gold::relocate_section with new template arg.
2975
acc276d8
AM
29762012-10-18 Alan Modra <amodra@gmail.com>
2977
2978 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
2979 dynamic relocs for GOT_TPREL got entries, without symbol if
2980 resolving locally.
2981 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
2982 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
2983 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
2984
e10f9870
AM
29852012-10-17 Alan Modra <amodra@gmail.com>
2986
2987 PR gold/14726
2988 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
2989
ae034989
ST
29902012-10-16 Sriraman Tallam <tmsriram@google.com>
2991
2992 * layout.cc (Layout::include_section): Keep sections marked
2993 SHF_EXCLUDE when doing relocatable links.
2994
f3a0ed29
AM
29952012-10-16 Alan Modra <amodra@gmail.com>
2996
2997 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
2998 (Target_powerpc::do_finalize_sections): Call it.
2999 (Output_data_save_res): New class and supporting functions.
3000 (Target_powerpc::symval_for_branch): Only look up .opd entry for
3001 normal symbols defined in object files.
3002
c6de8ed4
AM
30032012-10-12 Alan Modra <amodra@gmail.com>
3004
3005 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
3006 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
3007 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
3008 section if scan_opd_relocs not yet called.
3009 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
3010
03e25981
AM
30112012-10-12 Alan Modra <amodra@gmail.com>
3012
3013 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3014 add_local_ifunc_entry): Revert last change.
3015 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
3016
c9824451
AM
30172012-10-05 Alan Modra <amodra@gmail.com>
3018
3019 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
3020 do_plt_address_for_global): New functions.
3021 (Output_data_got_powerpc::do_write): Don't segfault when linking
3022 statically.
3023 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3024 add_local_ifunc_entry): Return true on adding entry..
3025 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
3026 glink->add_entry call. Remove unused symtab param. Adjust calls.
3027 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
3028 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
3029 set up symbols here.
3030 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
3031 syms here. Do so even when no .iplt. Don't segfault when linking
3032 statically.
3033 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
3034 new variants without reloc param.
3035 (Glink_sym_ent::Glink_sym_ent): Likewise.
3036 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
3037 reloc when refs will resolve to plt call stub.
3038 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
3039 R_PPC_PLTREL24 to resolve locally.
3040 (Target_powerpc::Scan::global): Correct ifunc handling.
3041 (Target_powerpc::Relocate::relocate): Correct local sym glink
3042 lookup. Don't destroy "value" when we have a plt call stub,
3043 and when checking plt call validity.
3044 (Target_powerpc::do_dynsym_value): Simplify.
3045
19fec8c1
AM
30462012-10-05 Alan Modra <amodra@gmail.com>
3047
3048 * i386.cc (Output_data_plt_i386::address_for_global,
3049 address_for_local): Add plt offset to returned value. Adjust uses.
3050 * sparc.cc (Output_data_plt_sparc::address_for_global,
3051 address_for_local): Likewise.
3052 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
3053 address_for_local): Likewise.
3054 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
3055 address_for_local): Likewise.
3056 * target.h (Target::plt_address_for_global, plt_address_for_local):
3057 Update comment.
3058 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
3059 (Output_data_got::Got_entry::write): Nor here.
3060 * output.h: Comment fix.
3061
e867b647
WL
30622012-10-02 Jiong Wang <jiwang@tilera.com>
3063
3064 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
3065 global_offset_table_ value for larget got.
3066 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
3067
e5d5f5ed
AM
30682012-09-29 Alan Modra <amodra@gmail.com>
3069
3070 * powerpc.cc (Target_powerpc::iplt_): New output section.
3071 (Target_powerpc::iplt_section, make_iplt_section,
3072 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
3073 (Target_powerpc::make_plt_entry): Handle ifunc syms.
3074 Target_powerpc::plt_entry_count): Count iplt entries too.
3075 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
3076 reloc section in constructor. New params.
3077 (Target_powerpc::make_plt_section): Create reloc section here instead.
3078 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
3079 functions.
3080 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
3081 (Output_data_glink::add_entry, find_entry): New functions to
3082 deal with local syms.
3083 (Glink_sym_ent): Add support for local syms.
3084 (Output_data_glink::do_write): Handle ifunc plt entries.
3085 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3086 (Target_powerpc::Scan::local, global): Handle ifunc syms.
3087 (Target_powerpc::Relocate::relocate): Likewise.
3088 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
3089
ec4dbad3
AM
30902012-09-25 Alan Modra <amodra@gmail.com>
3091
3092 * object.h (Sized_relobj_file::adjust_local_symbol,
3093 do_adjust_local_symbol): New functions.
3094 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
3095 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
3096 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
3097 and irregular opd entry spacing.
3098 (Powerpc_relobj::do_read_relocs): Add opd size checks.
3099 (Global_symbol_visitor_opd): New functor.
3100 (Target_powerpc::do_finalize_sections): Omit global symbols defined
3101 on deleted opd entries.
3102
5c0b3823
WL
31032012-09-15 Jiong Wang <jiwang@tilera.com>
3104
3105 * tilegx.cc: New file.
3106 * Makefile.am (TARGETSOURCES): Add tilegx.cc
3107 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
3108 * configure.tgt: Add entries for tilegx*.
3109 * configure.ac: Likewise.
3110 * Makefile.in: Rebuild.
3111 * configure: Likewise.
3112 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
3113 tilegx.
3114
bfdfa4cd
AM
31152012-09-13 Alan Modra <amodra@gmail.com>
3116
3117 * target-reloc.h (scan_relocs): Call scan.local for relocs
3118 against symbols in discarded sections. Pass is_discarded
3119 param.
3120 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
3121 Add is_discarded param.
3122 * powerpc (Target_powerpc::Scan::local): Likewise. Use
3123 is_discarded to flag opd entry as discarded. Don't emit dyn
3124 relocs on such entries.
3125 (Target_powerpc::Scan::global): Similarly detect and handle
3126 such opd entries.
3127 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
3128 opd_ent_. Update all uses.
3129 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
3130 (Target_powerpc::relocate_section): Zero out discarded opd
3131 entry relocs.
3132
d77a0555
ILT
31332012-09-12 Ian Lance Taylor <iant@google.com>
3134
3135 PR gold/14570
3136 * output.cc: Rename Output_data_got template parameter from size
3137 to got_size for all functions. Compile all variants of
3138 Output_data_got.
3139 (Output_data_got::Got_entry::write): Correct use of size for
3140 symbol value. Use local_is_tls rather than casting to
3141 Sized_relobj_file.
3142 * object.h (class Object): Add local_is_tls and do_local_is_tls.
3143 (class Sized_relobj_file): Add do_local_is_tls.
3144 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
3145
815a1205
AM
31462012-09-11 Alan Modra <amodra@gmail.com>
3147
3148 PR gold/14566
3149 * layout.cc (Layout::set_segment_offsets): When using
3150 common-page-size alignment, ensure we are on a new max-page-size
3151 page.
3152 * output.cc (Output_segment::set_section_addresses): Use
3153 abi_pagesize, not common_pagesize for relro boundary.
3154 (Output_segment::set_offset): Likewise.
3155
bd73a62d
AM
31562012-09-11 Alan Modra <amodra@gmail.com>
3157
3158 * output.h (Output_data_got::add_global_tls, add_local_tls,
3159 add_local_tls_pair): New functions.
3160 (Output_data_got::add_local_pair_with_rel): Remove second
3161 reloc param. Expand comment.
3162 (Output_data_got::Got_entry): Rename use_plt_offset_ to
3163 use_plt_or_tls_offset_, similarly for constructor param.
3164 (Output_data_got::Got_entry::write): Add got_index param.
3165 * output.cc (Output_data_got::add_global_tls, add_local_tls,
3166 add_local_tls_pair): New functions.
3167 (Output_data_got::Got_entry::write): Handle tls symbols
3168 with use_plt_or_tls_offset_ set specially.
3169 (Output_data_got::add_local_pair_with_rel): Only one reloc.
3170 (Output_data_got::do_write): Replace iterator with index, pass
3171 index to entry write function.
3172 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
3173 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
3174 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
3175 call.
3176 * i386.cc (Target_i386::Scan::local): Likewise.
3177 * sparc.cc (Target_sparc::Scan::local): Likewise.
3178 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
3179 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
3180 do_tls_offset_for_global): New functions.
3181 (Target_powerpc::Scan::local): Correct TLS relocations and got
3182 entry values.
3183 (Target_powerpc::Scan::global): Don't emit unnecessary
3184 dynamic relocations on TLS GOT entries.
3185
00716ab1
AM
31862012-09-10 Matthias Klose <doko@ubuntu.com>
3187
3188 * config.in: Disable sanity check for kfreebsd.
3189
c891b3f9
SA
31902012-09-10 Sterling Augustine <saugustine@google.com>
3191
3192 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
3193 (Gdb_index::pubtypes_read): New parameter.
3194 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
3195 to calls.
3196 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
3197 pubtypes_object_.
3198
e81fea4d
AM
31992012-09-09 Alan Modra <amodra@gmail.com>
3200
3201 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
3202 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
3203 * gc.h (gc_process_relocs): Call target gc_add_reference.
3204 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
3205 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
3206 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
3207 unnecessary cast.
3208 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
3209 to cater for when we don't need code offset. Update use.
3210 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
3211 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
3212 set_opd_valid): New functions.
3213 (Target_powerpc::do_gc_add_reference): New function.
3214 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
3215 stashed refs.
3216 (Target_powerpc::do_gc_mark_symbol): New function.
3217
d2d60eef
CC
32182012-09-06 Cary Coutant <ccoutant@google.com>
3219
3220 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
3221 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
3222 (Dwarf_die::skip_attributes): Likewise.
3223 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
3224 * testsuite/gdb_index_test.cc (inline_func_1): New function.
3225 (main): Call it.
3226 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
3227
32ed4573
L
32282012-09-05 H.J. Lu <hongjiu.lu@intel.com>
3229
3230 * testsuite/script_test_3.t: Add .got.plt output section
3231 statement.
3232 * testsuite/script_test_4.t: Likewise.
3233
f4baf0d4
AM
32342012-09-05 Alan Modra <amodra@gmail.com>
3235
3236 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
3237 update all uses and lose "enum" when using type.
3238
864a1b56
AM
32392012-09-05 Alan Modra <amodra@gmail.com>
3240
3241 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
3242 * configure: Regenerate.
3243 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
3244 (plugin_final_layout.stdout): Likewise.
3245 (memory_test): Set page sizes to 0x1000.
3246 * testsuite/Makefile.in: Regenerate.
3247 * testsuite/discard_locals_test.sh: Add FIXME comment.
3248 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
3249 * testsuite/pr14265.t: Add .got output section statement.
3250 * testsuite/script_test_2.t: Likewise.
3251 * testsuite/script_test_3.t: Likewise.
3252 * testsuite/script_test_4.t: Likewise.
3253 * testsuite/script_test_5.t: Likewise.
3254 * testsuite/script_test_6.t: Likewise.
3255 * testsuite/script_test_7.t: Likewise.
3256 * testsuite/script_test_9.t: Likewise.
3257
3ea0a085
AM
32582012-09-05 Alan Modra <amodra@gmail.com>
3259
3260 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
3261 (Powerpc_relocate_functions::Status): New typedef.
3262 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3263 (Target_powerpc::Scan::local): Handle REL64.
3264 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
3265 for REL32 and REL64.
3266 (Target_powerpc::symval_for_branch): New function, extracted from..
3267 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
3268 checks. Report overflow errors.
3269
7404fe1b
AM
32702012-09-05 Alan Modra <amodra@gmail.com>
3271
3272 * object.h (Sized_relobj_file::emit_relocs): Delete.
3273 (Sized_relobj_file::emit_relocs_reltype): Delete.
3274 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
3275 relocate_relocs for --emit-relocs.
3276 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
3277 * output.h: Update comment.
3278 (Output_segment::first_section): New function.
3279 (Output_segment::first_section_load_address): Use first_section.
3280 * output.cc (Output_segment::first_section): New function extracted..
3281 (Output_segment::first_section_load_address): ..from here. Delete.
3282 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
3283 * target.h (Sized_target::relocate_for_relocatable): Likewise.
3284 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
3285 adjust call to target.h function.
3286 * i386.cc (Target_i386): Likewise.
3287 * sparc.cc (Target_sparc): Likewise.
3288 * x86_64.cc (Target_x86_64): Likewise.
3289 * powerpc.cc (Target_powerpc): Likewise.
3290 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
3291 first tls section has section symbol for optimised local dynamic
3292 output relocs.
3293 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
3294 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
3295 optimised tls code.
3296 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
3297 Rename to relocate_relocs. Update error message.
3298
957564c9
AS
32992012-09-04 Andreas Schwab <schwab@linux-m68k.org>
3300
3301 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
3302 --just-symbols.
3303
dd93cd0a
AM
33042012-08-31 Alan Modra <amodra@gmail.com>
3305
3306 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
3307 (Powerpc_relobj::toc_base_offset): New stub function.
3308 (Target_powerpc): Add tp_offset, dtp_offset. Rename
3309 got_mod_index_offset to tlsld_got_offset. Update all refs.
3310 (Target_powerpc::Relocate::enum skip_tls): New.
3311 (Target_powerpc::call_tls_get_addr_): New var.
3312 (Target_powerpc::is_branch_reloc): Move to file scope.
3313 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
3314 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
3315 New functions.
3316 (Target_powerpc::enum Got_type): Delete old values, add new ones.
3317 (powerpc_info): Correct common_pagesize for ppc64.
3318 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
3319 (Powerpc_relocate_functions): Add overflow check enums and functions.
3320 Add non-shift version of rela, rela_ua. Delete all rel public
3321 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
3322 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
3323 addr16_ha3, addr14 functions.
3324 (Output_data_got_powerpc::add_constant_pair): New function.
3325 (Output_data_got_powerpc::got_base_offset): Likewise.
3326 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
3327 (instruction constants): Sort, add some more.
3328 (Output_data_glink::do_write): Add and use Address typedef. Use
3329 object->toc_base_offset() stub for 64-bit.
3330 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
3331 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3332 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
3333 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
3334 Always treat .opd relocs as against locally defined symbol.
3335 Correct condition for RELATIVE relocs.
3336 (Target_powerpc::do_finalize_sections): Test for NULL sections.
3337 (Target_powerpc::Relocate::relocate): Use plt call stub as value
3338 for 32-bit syms with a plt entry. Correct ppc64 toc base
3339 calculations. Handle TLS relocs, and more. Add overflow
3340 checking and adjust for Powerpc_relocate_functions changes.
3341 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
3342 Reinstate --emit-relocs code with FIXME.
3343
a1373b60
AM
33442012-08-30 Alan Modra <amodra@gmail.com>
3345
3346 * layout.cc (Layout::set_segment_offsets): Set p_align to
3347 abi_pagesize, not common_pagesize.
3348 (Layout::relaxation_loop_body): Similarly use abi_pagesize
3349 to determine whether file header can go in segment.
3350
703d02da
AM
33512012-08-30 Alan Modra <amodra@gmail.com>
3352
3353 * output.h (Output_reloc::Output_reloc <output section>): Add
3354 is_relative param. Adjust calls.
3355 (Output_reloc::add_output_section_relative): New functions.
3356 * output.cc (Output_reloc::Output_reloc <output section>): Handle
3357 is_relative.
3358 (Output_reloc::symbol_value): Handle SECTION_CODE.
3359
16164a6b
ST
33602012-08-24 Sriraman Tallam <tmsriram@google.com>
3361
3362 * gold.cc (queue_middle_tasks): Call layout again when unique
3363 segments for sections is desired.
3364 * layout.cc (Layout::Layout): Initialize new members.
3365 (Layout::get_output_section_flags): New function.
3366 (Layout::choose_output_section): Call get_output_section_flags.
3367 (Layout::layout): Make output section for mapping to a unique segment.
3368 (Layout::insert_section_segment_map): New function.
3369 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 3370 output sections marked so.
16164a6b
ST
3371 (Layout::segment_precedes): Check for unique segments when sorting.
3372 * layout.h (Layout::Unique_segment_info): New struct.
3373 (Layout::Section_segment_map): New typedef.
3374 (Layout::insert_section_segment_map): New function.
3375 (Layout::get_output_section_flags): New function.
3376 (Layout::is_unique_segment_for_sections_specified): New function.
3377 (Layout::set_unique_segment_for_sections_specified): New function.
3378 (Layout::unique_segment_for_sections_specified_): New member.
3379 (Layout::section_segment_map_): New member.
3380 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
3381 Rename is_gc_pass_one to is_pass_one.
3382 Rename is_gc_pass_two to is_pass_two.
3383 Rename is_gc_or_icf to is_two_pass.
3384 Check for which pass based on whether symbols data is present.
3385 Make it two pass when unique segments for sections is desired.
3386 * output.cc (Output_section::Output_section): Initialize new
3387 members.
3388 * output.h (Output_section::is_unique_segment): New function.
3389 (Output_section::set_is_unique_segment): New function.
3390 (Output_section::is_unique_segment_): New member.
3391 (Output_section::extra_segment_flags): New function.
3392 (Output_section::set_extra_segment_flags): New function.
3393 (Output_section::extra_segment_flags_): New member.
3394 (Output_section::segment_alignment): New function.
3395 (Output_section::set_segment_alignment): New function.
3396 (Output_section::segment_alignment_): New member.
3397 (Output_segment::Output_segment): Initialize is_unique_segment_.
3398 (Output_segment::is_unique_segment): New function.
3399 (Output_segment::set_is_unique_segment): New function.
3400 (Output_segment::is_unique_segment_): New member.
3401 * plugin.cc (allow_unique_segment_for_sections): New function.
3402 (unique_segment_for_sections): New function.
3403 (Plugin::load): Add new functions to transfer vector.
3404 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
3405 * Makefile.in: Regenerate.
3406 * testsuite/plugin_final_layout.sh: Check if unique segment
3407 functionality works.
3408 * testsuite/plugin_section_order.c (onload): Check if new interfaces
3409 are available.
3410 (allow_unique_segment_for_sections): New global.
3411 (unique_segment_for_sections): New global.
3412 (claim_file_hook): Call allow_unique_segment_for_sections.
3413 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 3414
1e2bee4f
CC
34152012-08-22 Cary Coutant <ccoutant@google.com>
3416
3417 * layout.cc (Layout::include_section): Don't assert on GROUP
3418 sections with --emit-relocs.
3419
1d5dfe78
CC
34202012-08-21 Cary Coutant <ccoutant@google.com>
3421
3422 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
3423 if --export-dynamic-symbol names an undef symbol.
3424
c9269dff
AM
34252012-08-18 Alan Modra <amodra@gmail.com>
3426
3427 * powerpc.cc: Formatting and white space.
3428 (Powerpc_relobj): Rename got2_section_ to special_.
3429 Add opd_ent_shndx_ and opd_ent_off_ vectors.
3430 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
3431 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
3432 (Target_powerpc): Add Address typedef and invalid_address. Use
3433 throughout.
3434 (Target_powerpc::is_branch_reloc): New function.
3435 (Powerpc_relocate_functions): Add Address typedef, use throughout.
3436 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
3437 for dst_mask, value and addend.
3438 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
3439 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
3440 (Output_data_glink::do_write): Correct toc base. Don't try to use
3441 uint16_t for 24-bit offset. Use get_output_section_offset and
3442 check return.
3443 (Target_powerpc::Scan::local): Handle more relocs.
3444 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
3445 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
3446 Plug in toc restoring insn after plt calls. Translate branches
3447 to function descriptor symbols to corresponding entry point.
3448 (Target_powerpc::relocate_for_relocatable): Check return from
3449 get_output_section_offset.
3450 * symtab.h: Comment typo.
3451
b1759dce
ILT
34522012-08-14 Ian Lance Taylor <iant@google.com>
3453
3454 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
3455 unsupported_relocal_local to call unsupported_reloc_global.
3456
b9b2ae8b
NC
34572012-08-14 Nick Clifton <nickc@redhat.com>
3458
3459 PR ld/14265
3460 * script-sections.cc (Sections_element::output_section_name): Add
3461 keep return parameter.
3462 (Output_section_element::match_name): Add keep return parameter.
3463 Return the value of the keep_ member.
3464 * script-sections.h (class Output_section): Update
3465 output_section_name prototype.
3466 * layout.cc (Layout::keep_input_section): New public member
3467 function.
3468 (Layout::choose_output_section): Pass keep parameter to
3469 output_section_name.
3470 * layout.h (class Layout): Add keep_input_section.
3471 * object.cc (Sized_relobj_file::do_layout): Check for kept input
3472 sections.
3473 * testsuite/Makefile.am: Add a test.
3474 * testsuite/Makefile.in: Regenerate.
3475 * testsuite/pr14265.c: Source file for the test.
3476 * testsuite/pr14265.t: Linker script for the test.
3477 * testsuite/pr14265.sh: Shell script for the test.
3478
921b5322
AM
34792012-08-14 Alan Modra <amodra@gmail.com>
3480
3481 * target.h (Target::output_section_name): New function.
3482 (Target::do_output_section_name): New function.
3483 * layout.cc (Layout::choose_output_section): Call the above.
3484 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
3485
6ce78956
AM
34862012-08-14 Alan Modra <amodra@gmail.com>
3487
3488 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
3489 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
3490 for replace_constant call.
3491 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
3492 (Output_data_glink::do_print_to_mapfile): New function.
3493 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
3494 (Target_powerpc::Relocate::relocate): Likewise.
3495
d1a8cabd
AM
34962012-08-14 Alan Modra <amodra@gmail.com>
3497
3498 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
3499 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
3500 (Output_data_glink::add_entry,find_entry): Remove shndx param.
3501 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
3502 all references to shndx_. Handle special case for R_PPC_PLTREL24
3503 here.
3504 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
3505 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
3506 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
3507 here.
3508 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
3509 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
3510
d83ce4e3
AM
35112012-08-12 Alan Modra <amodra@gmail.com>
3512
3513 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
3514 (glink insn constants): Use uint32_t.
3515 (Output_data_glink::add_entry): Use insert, not [] operator.
3516
cf43a2fe
AM
35172012-08-11 Alan Modra <amodra@gmail.com>
3518
3519 * object.h (Sized_relobj_file::find_shdr): New function.
3520 (Sized_relobj_file::find_special_sections): New function.
3521 * object.cc (Sized_relobj_file::find_shdr): New function.
3522 (Sized_relobj_file::find_eh_frame): Use find_shdr.
3523 (Sized_relobj_file::find_special_sections): New function, split out..
3524 (Sized_relobj_file::do_read_symbols): ..from here.
3525 * output.h (Output_data_got::replace_constant): New function.
3526 (Output_data_got::num_entries): New function.
3527 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
3528 (Output_data_got::got_offset): Protected rather than private.
3529 (Output_data_got::replace_got_entry): New function.
3530 * output.cc (Output_data_got::replace_got_entry): New function.
3531 * powerpc.cc (class Powerpc_relobj): New.
3532 (class Powerpc_relocate_functions): Delete all psymval variants or
3533 convert to value,addend type. Delete pcrela, pcrela_unaligned.
3534 Implement _ha functions using corresponding _hi function.
3535 (Powerpc_relobj::find_special_sections): New function.
3536 (Target_powerpc::do_make_elf_object): New function.
3537 (class Output_data_got_powerpc): New.
3538 (class Output_data_glink): New.
3539 (class Powerpc_scan_relocatable_reloc): New.
3540 Many more changes througout file.
3541
3c892704
NC
35422012-08-09 Nick Clifton <nickc@redhat.com>
3543
3544 * po/vi.po: Updated Vietnamese translation.
3545
82435b3b
ILT
35462012-08-07 Ian Lance Taylor <iant@google.com>
3547
3548 * layout.cc (Layout::add_target_dynamic_tags): If
3549 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
3550 plt_rel.
3551
a6dc81d2
NC
35522012-07-30 Nick Clifton <nickc@redhat.com>
3553
3554 * po/gold.pot: Updated template.
3555 * po/es.po: Updated Spanish translation.
3556
f1415016
CC
35572012-07-18 Cary Coutant <ccoutant@google.com>
3558
3559 PR gold/14344
3560 * configure.ac: Add check for -gpubnames support.
3561 * configure: Regenerate.
3562 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
3563 support; force -gno-pubnames.
3564 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
3565 support.
3566 (gdb_index_test_4): New test.
3567 * testsuite/Makefile.in: Regenerate.
3568 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
3569 * testsuite/gdb_index_test_2.sh: Likewise.
3570 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
3571 * testsuite/gdb_index_test_4.sh: New script.
3572 * testsuite/gdb_index_test_comm.sh: New script with common code;
3573 don't look for space after colon.
3574
b7fd7c37
ST
35752012-07-16 Sriraman Tallam <tmsriram@google.com>
3576
3577 * gold.cc (queue_middle_tasks): Update function order only after
3578 deferred objects due to plugins are processed.
3579
1f3212db
ILT
35802012-07-11 Ian Lance Taylor <iant@google.com>
3581
3582 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
3583 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
3584 (Target_arm::scan_reloc_for_stub): Likewise.
3585 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
3586 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
3587 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
3588 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
3589 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
3590
81c82a68
ILT
35912012-07-10 Dodji Seketeli <dodji@redhat.com>
3592 Ian Lance Taylor <iant@google.com>
3593
3594 PR gold/14309
3595 * configure.ac: Test whether std::tr1::hash<off_t> works.
3596 * gold.h: Add a specialization for std::tr1::hash<off_t> if
3597 needed.
3598 * output.h (class Output_fill): Add virtual destructor.
3599 * configure, config.in: Rebuild.
3600
eabc84f4
RM
36012012-06-22 Roland McGrath <mcgrathr@google.com>
3602
3603 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
3604
370e30b6
RÁE
36052012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
3606
3607 * plugin.cc (Plugin::load): Handle position independent executables.
3608
fb1b895d
CC
36092012-06-06 Cary Coutant <ccoutant@google.com>
3610
3611 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
3612 add .debug_macro.
3613 (lines_only_debug_sections): Likewise.
3614 (gdb_fast_lookup_sections): New static array.
3615 (is_gdb_debug_section): Rename formal parameter.
3616 (is_lines_only_debug_section): Likewise.
3617 (is_gdb_fast_lookup_section): New function.
3618 (Layout::include_section): Check for ".zdebug_" prefix; pass
3619 section name suffix to is_gdb_debug_section, et al.; check for
3620 fast-lookup sections when building .gdb_index.
3621 * options.h (--strip-debug-gdb): Update GDB version number.
3622
7c0640fa
CC
36232012-06-06 Cary Coutant <ccoutant@google.com>
3624
3625 * configure.ac: Add check for fallocate.
3626 * configure: Regenerate.
3627 * config.in: Regenerate.
3628
3629 * options.h (class General_options): Add --mmap-output-file and
3630 --posix-fallocate options.
3631 * output.cc: (posix_fallocate): Remove; replace with...
3632 (gold_fallocate): New function.
3633 (Output_file::map_no_anonymous): Call gold_fallocate.
3634 (Output_file::map): Check --mmap-output-file option.
3635
2a49eb69
DK
36362012-06-05 Jing Yu <jingyu@google.com>
3637
3638 * gold.h (textdomain): Add do {} to empty while(0).
3639 (bindtextdomain): Likewise.
3640
fad072ac
CC
36412012-06-04 Cary Coutant <ccoutant@google.com>
3642
3643 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
3644 has_dynsym_index.
3645
8cc69fb6
ST
36462012-05-25 Sriraman Tallam <tmsriram@google.com>
3647
3648 * symtab.cc (Symbol_table::define_special_symbol):
3649 Initialize *poldsym to prevent uninitialized variable errors.
3650
1be75daa
CC
36512012-05-23 Cary Coutant <ccoutant@google.com>
3652
3653 * layout.cc (Layout::section_name_mapping): Add rules to handle
3654 exact match on .data.rel.ro.local or .data.rel.ro.
3655 (Layout::output_section_name): Check for exact matches.
3656
9b689de0
CC
36572012-05-23 Cary Coutant <ccoutant@google.com>
3658
3659 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
3660 more carefully.
3661
b24fdbf5
CC
36622012-05-22 Cary Coutant <ccoutant@google.com>
3663
3664 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
3665 object before exporting symbol.
3666
e550e1a2
L
36672012-05-21 H.J. Lu <hongjiu.lu@intel.com>
3668
3669 * testsuite/tls_test.cc: Include "config.h" first.
3670 * testsuite/tls_test_c.c: Likewise.
3671
df7b86aa
NC
36722012-05-17 Daniel Richard G. <skunk@iskunk.org>
3673 Nick Clifton <nickc@redhat.com>
3674
3675 PR 14072
3676 * configure.in: Add check that sysdep.h has been included before
3677 any system header files.
3678 * configure: Regenerate.
3679 * config.in: Regenerate.
3680
1007b503
CC
36812012-05-14 Cary Coutant <ccoutant@google.com>
3682
3683 * layout.cc (Layout::make_output_section): Mark .tdata section
3684 as RELRO.
3685 * testsuite/relro_test.cc: Add a TLS variable.
3686
fd885f3a
L
36872012-05-10 H.J. Lu <hongjiu.lu@intel.com>
3688
3689 PR gold/14091
3690 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
3691 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
3692 R_X86_64_64.
3693
80f5885c
CC
36942012-05-08 Cary Coutant <ccoutant@google.com>
3695
3696 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
3697 (lines_only_debug_sections): Likewise.
3698
2e702c99
RM
36992012-05-02 Roland McGrath <mcgrathr@google.com>
3700
3701 * nacl.cc: New file.
3702 * nacl.h: New file.
3703 * Makefile.am (CCFILES, HFILES): Add them.
3704 * Makefile.in: Regenerate.
3705 * i386.cc (Output_data_plt_i386_nacl): New class.
3706 (Output_data_plt_i386_nacl_exec): New class.
3707 (Output_data_plt_i386_nacl_dyn): New class.
3708 (Target_i386_nacl): New class.
3709 (Target_selector_i386_nacl): New class.
3710 (target_selector_i386): Use it instead of Target_selector_i386.
3711 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
3712 (Target_x86_64_nacl): New class.
3713 (Target_selector_x86_64_nacl): New class.
3714 (target_selector_x86_64, target_selector_x32): Use it instead of
3715 Target_selector_x86_64.
3716 * arm.cc (Output_data_plt_arm_nacl): New class.
3717 (Target_arm_nacl): New class.
3718 (Target_selector_arm_nacl): New class.
3719 (target_selector_arm, target_selector_armbe): Use it instead of
3720 Target_selector_arm.
3721
3722 * target-select.cc (select_target): Take new Input_file* and off_t
3723 arguments, pass them on to recognize method of selector.
3724 * object.cc (make_elf_sized_object): Update caller.
3725 * parameters.cc (parameters_force_valid_target): Likewise.
3726 * incremental.cc (make_sized_incremental_binary): Likewise.
3727 * target-select.h: Update decl.
3728 (Target_selector::recognize): Take new Input_file* argument,
3729 pass it on to do_recognize.
3730 (Target_selector::do_recognize): Take new Input_file* argument.
3731 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
3732 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
3733 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
3734 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
3735
3736 * target.h (Target::Target_info): New members isolate_execinstr
3737 and rosegment_gap.
3738 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
3739 * arm.cc (Target_arm::arm_info): Update initializer.
3740 * i386.cc (Target_i386::i386_info): Likewise.
3741 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
3742 * sparc.cc (Target_sparc::sparc_info): Likewise.
3743 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
3744 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3745 * layout.cc (Layout::attach_allocated_section_to_segment):
3746 Take new const Target* argument. If target->isolate_execinstr(), act
3747 like --rosegment.
3748 (Layout::find_first_load_seg): Take new const Target* argument;
3749 if target->isolate_execinstr(), reject PF_X segments.
3750 (Layout::relaxation_loop_body): Update caller.
3751 (Layout::set_segment_offsets): If target->isolate_execinstr(),
3752 reset file offset to zero when we hit LOAD_SEG, and then do a second
3753 loop over the segments before LOAD_SEG to reassign offsets after
3754 addresses have been determined. Handle target->rosegment_gap().
3755 (Layout::attach_section_to_segment): Take new const Target* argument;
3756 pass it to attach_allocated_section_to_segment.
3757 (Layout::make_output_section): Update caller.
3758 (Layout::attach_sections_to_segments): Take new const Target* argument;
3759 pass it to attach_section_to_segment.
3760 * gold.cc (queue_middle_tasks): Update caller.
3761 * layout.h (Layout): Update method decls with new arguments.
3762
3763 * arm.cc (Target_arm::Target_arm): Take optional argument for the
3764 Target_info pointer to use.
3765 (Target_arm::do_make_data_plt): New virtual method.
3766 (Target_arm::make_data_plt): New method that calls it.
3767 (Target_arm::make_plt_entry): Use it.
3768 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
3769 for the section alignment.
3770 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
3771 method.
3772 (Output_data_plt_arm::first_plt_entry_offset): Call it.
3773 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
3774 method.
3775 (Output_data_plt_arm::get_plt_entry_size): Call it.
3776 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
3777 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
3778 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
3779 method.
3780 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
3781 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
3782 method instead of sizeof(plt_entry).
3783 (Output_data_plt_arm::add_entry): Likewise.
3784 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
3785 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
3786 than static method.
3787 (Target_arm::plt_entry_size): Likewise.
3788 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
3789 Move to ...
3790 (Output_data_plt_arm_standard): ... here, new class.
3791 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
3792 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
3793 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
3794
3795 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3796 Take additional argument for the PLT entry size.
3797 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
3798 Use get_plt_entry_size method rather than plt_entry_size variable.
3799 (Output_data_plt_x86_64::reserve_slot): Likewise.
3800 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
3801 (Output_data_plt_x86_64::add_entry): Likewise.
3802 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
3803 (Output_data_plt_x86_64::address_for_global): Likewise.
3804 (Output_data_plt_x86_64::address_for_local): Likewise.
3805 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3806 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
3807 Make method non-static.
3808 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
3809 method.
3810 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
3811 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
3812 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
3813 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
3814 virtual method.
3815 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
3816 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
3817 virtual method.
3818 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
3819 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
3820 virtual method.
3821 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
3822 (Output_data_plt_x86_64::plt_entry_size)
3823 (Output_data_plt_x86_64::first_plt_entry)
3824 (Output_data_plt_x86_64::plt_entry)
3825 (Output_data_plt_x86_64::tlsdesc_plt_entry)
3826 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
3827 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
3828 (Output_data_plt_x86_64_standard): ... here, new class.
3829 (Target_x86_64::Target_x86_64): Take optional argument for the
3830 Target_info pointer to use.
3831 (Target_x86_64::do_make_data_plt): New virtual method.
3832 (Target_x86_64::make_data_plt): New method to call it.
3833 (Target_x86_64::init_got_plt_for_update): Use that.
3834 Call this->plt_->add_eh_frame method here.
3835 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
3836 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
3837 rather than static method.
3838 (Target_x86_64::plt_entry_size): Likewise.
3839 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
3840 rather than plt_entry_size variable. Move guts of PLT filling to...
3841 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
3842 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
3843 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
3844
3845 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
3846 additional argument for the section alignment.
3847 Don't do add_eh_frame_for_plt here.
3848 (Output_data_plt_i386::first_plt_entry_offset): Make the method
3849 non-static. Use get_plt_entry_size method rather than plt_entry_size
3850 variable.
3851 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
3852 method.
3853 (Output_data_plt_i386::get_plt_entry_size): Call it.
3854 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
3855 (Output_data_plt_i386::add_eh_frame): New method to call it.
3856 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
3857 method.
3858 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
3859 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
3860 method.
3861 (Output_data_plt_i386::fill_plt_entry): New method to call it.
3862 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
3863 method instead of plt_entry_size.
3864 (Output_data_plt_i386::plt_entry_size)
3865 (Output_data_plt_i386::plt_eh_frame_fde_size)
3866 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
3867 (Output_data_plt_i386_standard): ... here, new class.
3868 (Output_data_plt_i386_exec): New class.
3869 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
3870 (Output_data_plt_i386_exec::first_plt_entry): ... here.
3871 (Output_data_plt_i386::exec_plt_entry): Move to ...
3872 (Output_data_plt_i386_exec::plt_entry): ... here.
3873 (Output_data_plt_i386_dyn): New class.
3874 (Output_data_plt_i386::first_plt_entry): Move to ...
3875 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
3876 (Output_data_plt_i386::dyn_plt_entry): Move to ...
3877 (Output_data_plt_i386_dyn::plt_entry): ... here.
3878 (Target_i386::Target_i386): Take optional argument for the Target_info
3879 pointer to use.
3880 (Target_i386::do_make_data_plt): New virtual method.
3881 (Target_i386::make_data_plt): New method to call it.
3882 (Target_i386::make_plt_section): Use that.
3883 Call this->plt_->add_eh_frame method here.
3884 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
3885 rather than plt_entry_size variable.
3886 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
3887 (Output_data_plt_i386::address_for_local): Likewise.
3888 (Output_data_plt_i386::do_write): Likewise.
3889 Move guts of PLT filling to...
3890 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
3891 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
3892 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
3893 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
3894
b9b9f2ee
CC
38952012-05-01 Cary Coutant <ccoutant@google.com>
3896
3897 * dwarf_reader.cc (Dwarf_die::read_attributes)
3898 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
3899 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
3900 * reduced_debug_output.cc
3901 (Output_reduced_debug_info_section::get_die_end): Remove
3902 DW_FORM_GNU_ref_index. Add default case.
3903
57923f48
MW
39042012-04-26 Mark Wielaard <mjw@redhat.com>
3905
3906 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
3907 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
3908 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
3909 DW_AT_high_pc as offset from DW_AT_low_pc.
3910
3911 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
3912 * testsuite/Makefile.in: Regenerate.
3913 * testsuite/gdb_index_test_3.c: New test source file.
3914 * testsuite/gdb_index_test_3.sh: New test source file.
3915
2c54b4f4
ILT
39162012-04-25 Ian Lance Taylor <iant@google.com>
3917
3918 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
3919 pointer.
3920 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
3921 as a class, not a struct.
3922 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
3923 (Target_arm::apply_cortex_a8_workaround): Likewise.
3924 * gc.h: Declare Reloc_types as a struct, not a class.
3925 * object.h: Declare Symbols_data as a struct.
3926 * reloc.h: Declare Read_relocs_data as a struct.
3927 * target.h: Declare Relocate_info as a struct.
3928
a5a5f7a3
DM
39292012-04-24 David S. Miller <davem@davemloft.net>
3930
3931 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
3932 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
3933 and R_SPARC_WPLT30.
3934
f038d496
CC
39352012-04-24 Cary Coutant <ccoutant@google.com>
3936
3937 * incremental-dump.cc (find_input_containing_global): Replace
3938 magic number with symbolic constant.
3939 (dump_incremental_inputs): Update version number.
3940 * incremental.cc (Output_section_incremental_inputs): Update version
3941 number; import symbolic constants from Incremental_inputs_reader.
3942 (Incremental_inputs::create_data_sections): Align relocations
3943 section correctly for 64-bit targets.
3944 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
3945 constants; add padding.
3946 (Output_section_incremental_inputs::write_header): Add assert for
3947 header_size.
3948 (Output_section_incremental_inputs::write_input_files): Add assert
3949 for input_entry_size.
3950 (Output_section_incremental_inputs::write_info_blocks): Add padding;
3951 add assert for object_info_size, input_section_entry_size,
3952 global_sym_entry_size.
3953 * incremental.h (Incremental_inputs_reader): Add symbolic constants
3954 for data structure sizes; use them.
3955 (Incremental_input_entry_reader): Import symbolic constants from
3956 Incremental_inputs_reader; use them.
3957
a4d85145
DM
39582012-04-23 David S. Miller <davem@davemloft.net>
3959
3960 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
3961 and elf_flags_set_.
3962 (Target_sparc::Target_sparc): Initialize new fields.
3963 (Target_sparc::do_make_elf_object): New function.
3964 (Target_sparc::do_adjust_elf_header): New function.
3965
1d509098
CC
39662012-04-23 Cary Coutant <ccoutant@google.com>
3967
3968 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
3969 CU range table of gdb index.
3970
7ebeff7f
DM
39712012-04-20 David S. Miller <davem@davemloft.net>
3972
3973 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
3974 instead of false.
3975
13cf9988
DM
39762012-04-16 David S. Miller <davem@davemloft.net>
3977
2a1079e8
DM
3978 * sparc.cc (Target_sparc::got_address): New function.
3979 (Sparc_relocate_functions::gdop_hix22): New function.
3980 (Sparc_relocate_functions::gdop_lox10): New function.
3981 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
3982 relocs.
3983 (Target_sparc::Scan::local): Likewise if the global symbol is not
3984 preemptible and is not IFUNC.
3985 (Target_sparc::Relocate::relocate): Perform GOTDATA code
3986 transformations for local and non-preemptible non-IFUNC global
3987 symbols.
3988
0bc964fc
DM
3989 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
3990 writing out 64-bit part of ranges.
3991
661d7a80
DM
3992 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
3993 -fpic and -fpie respectively.
3994 * Makefile.in: Regenerate.
3995
8c2bf391
DM
3996 * sparc.cc (class Target_sparc): Add rela_ifunc_.
3997 (Target_sparc::Target_sparc): Initialize new field.
3998 (Target_sparc::do_plt_section_for_global): New function.
3999 (Target_sparc::do_plt_section_for_local): New function.
4000 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
4001 (Target_sparc::make_plt_section): New function, broken out of
4002 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
4003 (Target_sparc::make_plt_entry): Call make_plt_section.
4004 (Target_sparc::make_local_ifunc_plt_entry): New function.
4005 (Target_sparc::rela_ifunc_section): New function.
4006 (Target_sparc::plt_section): Remove const.
4007 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
4008 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
4009 and ifunc_count_ fields.
4010 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
4011 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
4012 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
4013 (Output_data_plt_sparc::rela_ifunc): New function.
4014 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
4015 (Output_data_plt_sparc::has_ifunc_section): New function.
4016 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
4017 (Output_data_plt_sparc::address_for_global): New function.
4018 (Output_data_plt_sparc::address_for_local): New function.
4019 (Output_data_plt_sparc::plt_index_to_offset): New function.
4020 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
4021 and entry_count.
4022 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
4023 entry_count.
4024 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
4025 R_SPARC_JMP_IREL to switch.
4026 (Target_sparc::Scan::check_non_pic): Likewise.
4027 (Target_sparc::Scan::local): Handle IFUNC symbols.
4028 (Target_sparc::Scan::local): Likewise.
4029 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
4030 and plt_address_for_local.
4031 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
4032 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
4033
13cf9988
DM
4034 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
4035 (class Output_data_reloc): Adjust calls to Output_reloc_type.
4036 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
4037 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
4038 global relocs too.
4039 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
4040 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
4041 calls.
4042 * sparc.cc (Target_sparc::Scan::global): Likewise.
4043 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4044
31821be0
CC
40452012-04-16 Cary Coutant <ccoutant@google.com>
4046
4047 * archive.cc (Library_base::should_include_member): Check for
4048 --export-dynamic-symbol.
4049 * options.h (class General_options): Add --export-dynamic-symbol.
4050 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
4051 --export-dynamic-symbol.
4052 (Symbol_table::gc_mark_undef_symbols): Likewise.
4053 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
4054
2615994e
DM
40552012-04-12 David S. Miller <davem@davemloft.net>
4056
4057 * sparc.cc (Reloc::wdisp10): New relocation method.
4058 (Reloc::h34): Likewise.
4059 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
4060 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
4061 R_SPARC_WDISP10.
4062 (Target_sparc::Scan::local): Likewise.
4063 (Target_sparc::Scan::global): Likewise.
4064 (Target_sparc::Relocate::relocate): Likewise.
4065
6782735d
CC
40662012-04-09 Cary Coutant <ccoutant@google.com>
4067
4068 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
4069 low_pc == 0.
4070
8c7a0b00
ILT
40712012-04-06 Ian Lance Taylor <iant@google.com>
4072
4073 * timer.cc: #include <unistd.h>.
4074
58797674
RM
40752012-04-06 Roland McGrath <mcgrathr@google.com>
4076
4077 * configure.in (AC_CHECK_HEADERS): Add locale.h.
4078 * config.in: Regenerate.
4079 * configure: Regenerate.
4080
44350750
NC
40812012-04-05 Nick Clifton <nickc@redhat.com>
4082
4083 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
4084 (AM_LC_MESSAGES): Add.
4085 * aclocal.m4: Regenerate.
4086 * config.in: Regenerate.
4087 * configure: Regenerate.
4088
c1027032
CC
40892012-03-21 Cary Coutant <ccoutant@google.com>
4090
4091 * Makefile.am: Add gdb-index.cc, gdb-index.h.
4092 * Makefile.in: Regenerate.
4093 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
4094 (Sized_elf_reloc_mapper::symbol_section): New function.
4095 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
4096 (make_elf_reloc_mapper): New function.
4097 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
4098 (Dwarf_abbrev_table::do_read_abbrevs): New function.
4099 (Dwarf_abbrev_table::do_get_abbrev): New function.
4100 (Dwarf_ranges_table::read_ranges_table): New function.
4101 (Dwarf_ranges_table::read_range_list): New function.
4102 (Dwarf_pubnames_table::read_section): New function.
4103 (Dwarf_pubnames_table::read_header): New function.
4104 (Dwarf_pubnames_table::next_name): New function.
4105 (Dwarf_die::Dwarf_die): New function.
4106 (Dwarf_die::read_attributes): New function.
4107 (Dwarf_die::skip_attributes): New function.
4108 (Dwarf_die::set_name): New function.
4109 (Dwarf_die::set_linkage_name): New function.
4110 (Dwarf_die::attribute): New function.
4111 (Dwarf_die::string_attribute): New function.
4112 (Dwarf_die::int_attribute): New function.
4113 (Dwarf_die::uint_attribute): New function.
4114 (Dwarf_die::ref_attribute): New function.
4115 (Dwarf_die::child_offset): New function.
4116 (Dwarf_die::sibling_offset): New function.
4117 (Dwarf_info_reader::check_buffer): New function.
4118 (Dwarf_info_reader::parse): New function.
4119 (Dwarf_info_reader::do_parse): New function.
4120 (Dwarf_info_reader::do_read_string_table): New function.
4121 (Dwarf_info_reader::lookup_reloc): New function.
4122 (Dwarf_info_reader::get_string): New function.
4123 (Dwarf_info_reader::visit_compilation_unit): New function.
4124 (Dwarf_info_reader::visit_type_unit): New function.
4125 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
4126 Sized_elf_reloc_mapper.
4127 (Sized_dwarf_line_info::symbol_section): Remove function.
4128 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
4129 (Sized_dwarf_line_info::read_line_mappings): Remove object
4130 parameter, adjust callers.
4131 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
4132 * dwarf_reader.h: Include <sys/types.h>.
4133 (class Track_relocs): Remove forward declaration.
4134 (class Elf_reloc_mapper): New class.
4135 (class Sized_elf_reloc_mapper): New class.
4136 (class Dwarf_abbrev_table): New class.
4137 (class Dwarf_range_list): New class.
4138 (class Dwarf_ranges_table): New class.
4139 (class Dwarf_pubnames_table): New class.
4140 (class Dwarf_die): New class.
4141 (class Dwarf_info_reader): New class.
4142 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
4143 (Sized_dwarf_line_info::symbol_section): Remove member function.
4144 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
4145 base class.
4146 * gdb-index.cc: New source file.
4147 * gdb-index.h: New source file.
4148 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
4149 and .debug_types sections, call Layout::add_to_gdb_index.
4150 (Sized_relobj_incr::do_section_name): Implement.
4151 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
4152 return type; Implement.
4153 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
4154 return type.
4155 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
4156 parameter list and return type.
4157 (Sized_incr_dynobj::do_section_contents): Likewise.
4158 * layout.cc: Include gdb-index.h.
4159 (Layout::Layout): Initialize gdb_index_data_.
4160 (Layout::init_fixed_output_section): Check for .gdb_index section.
4161 (Layout::add_to_gdb_index): New function. Instantiate.
4162 * layout.h: Add forward declaration for class Gdb_index.
4163 (Layout::add_to_gdb_index): New member function.
4164 (Layout::gdb_index_data_): New data member.
4165 * main.cc: Include gdb-index.h.
4166 (main): Print statistics for gdb index.
4167 * object.cc (Object::section_contents): Move code into
4168 do_section_contents.
4169 (need_decompressed_section): Check for sections needed when building
4170 gdb index.
4171 (build_compressed_section_map): Likewise.
4172 (Sized_relobj_file::do_read_symbols): Need local symbols when building
4173 gdb index.
4174 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
4175 sections; call Layout::add_to_gdb_index.
4176 (Sized_relobj_file::do_decompressed_section_contents): Call
4177 do_section_contents directly.
4178 * object.h (Object::do_section_contents): Adjust parameter list and
4179 return type.
4180 (Object::do_decompressed_section_contents): Call do_section_contents
4181 directly.
4182 (Sized_relobj_file::do_section_contents): Adjust parameter list and
4183 return type.
4184 * options.h (class General_options): Add --gdb-index option.
4185 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
4186 list and return type.
4187 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
4188 * reloc.h (Track_relocs::checkpoint): New function.
4189 (Track_relocs::reset): New function.
4190
4191 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
4192 New test cases.
4193 * testsuite/Makefile.in: Regenerate.
4194 * testsuite/gdb_index_test.cc: New test source file.
4195 * testsuite/gdb_index_test_1.sh: New test source file.
4196 * testsuite/gdb_index_test_2.sh: New test source file.
4197
647f1574
DK
41982012-03-19 Doug Kwan <dougkwan@google.com>
4199
4200 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 4201 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
4202 __exidx_start and __exidx_end. Make symbol table parameter
4203 anonymous as it is not used.
4204 * gold.cc (queue_middle_tasks): Call target hook to define any
4205 target-specific symbols.
4206 * target.h (Target::define_standard_symbols): New method.
4207 (Target::do_define_standard_symbols): Same.
4208 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
4209 * testsuite/Makefile.in: Regenerate.
4210 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
4211 and __exidx_end.
4212 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
4213 relocations are generated for __exidx_start and __exidx_end.
4214
7c6109da
DK
42152012-03-16 Doug Kwan <dougkwan@google.com>
4216
4217 * testsuite/Makefile.am: Disable test initpri3b.
4218 * testsuite/Makefile.in: Regenerate.
4219
7b8957f8
DK
42202012-03-15 Doug Kwan <dougkwan@google.com>
4221
4222 * arm.cc (Target_arm::got_section): Make .got section read-only
4223 if -z now is given.
4224
14dc9ef7
ILT
42252012-03-15 Ian Lance Taylor <iant@google.com>
4226
4227 PR gold/13850
4228 * layout.cc (Layout::make_output_section): Correctly mark
4229 SHT_INIT_ARRAY, et. al., as relro.
4230
fa40b62a
DK
42312012-03-14 Doug Kwan <dougkwan@google.com>
4232
4233 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
4234 dynamic relocations for protected symbols in shared objects.
4235
fd325007
ILT
42362012-03-13 Ian Lance Taylor <iant@google.com>
4237
4238 * resolve.cc (Symbol_table::resolve): When merging common symbols,
4239 keep the larger alignment.
4240
e8dd54e1
CC
42412012-03-12 Cary Coutant <ccoutant@google.com>
4242
4243 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
4244 handling of DW_LNE_define_file.
4245
feb5f3b0
CC
42462012-03-12 Cary Coutant <ccoutant@google.com>
4247
4248 * reduced_debug_output.cc
4249 (Output_reduced_debug_info_section::get_die_end): Add new FORM
4250 codes to switch.
4251
a1fb4256
CC
42522012-02-29 Cary Coutant <ccoutant@google.com>
4253
4254 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
4255
5dd8762a
CC
42562012-02-29 Cary Coutant <ccoutant@google.com>
4257
4258 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4259 Call Object::decompressed_section_contents.
4260 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
4261 New dtor.
4262 (Sized_dwarf_line_info::buffer_start_): New data member.
4263 * merge.cc (Output_merge_data::do_add_input_section): Call
4264 Object::decompressed_section_contents.
4265 (Output_merge_string::do_add_input_section): Likewise.
4266 * object.cc (need_decompressed_section): New function.
4267 (build_compressed_section_map): Decompress sections needed later.
4268 (Sized_relobj_file::do_decompressed_section_contents): New function.
4269 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4270 * object.h (Object::decompressed_section_contents): New function.
4271 (Object::discard_decompressed_sections): New function.
4272 (Object::do_decompressed_section_contents): New function.
4273 (Object::do_discard_decompressed_sections): New function.
4274 (Compressed_section_info): New type.
4275 (Compressed_section_map): Include decompressed section contents.
4276 (Sized_relobj_file::do_decompressed_section_contents): New function.
4277 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4278
7b5de7ee
CC
42792012-02-16 Cary Coutant <ccoutant@google.com>
4280
4281 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
4282 * testsuite/Makefile.in: Regenerate.
4283
f9fa4a63
CC
42842012-02-14 Cary Coutant <ccoutant@google.com>
4285
4286 * options.cc (General_options::finalize): Disallow -pie and -static.
4287
2c175ebc
DK
42882012-02-03 Doug Kwan <dougkwan@google.com>
4289
4290 * arm.cc (Arm_relocate_functions::abs8,
4291 Arm_relocate_functions::abs16): Use
4292 Bits::has_signed_unsigned_overflow32.
4293 (Arm_relocate_functions::thm_abs8): Correct range of
4294 overflow check.
4295 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
4296 in assertions.
4297
90cff06f
DK
42982012-02-02 Doug Kwan <dougkwan@google.com>
4299
4300 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
4301 position independent outputs, not just shared objects.
4302
63887f3d
L
43032012-01-30 H.J. Lu <hongjiu.lu@intel.com>
4304
4305 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
4306 * configure: Regenerated.
4307
bef2b434
ILT
43082012-01-27 Ian Lance Taylor <iant@google.com>
4309
4310 * reloc.h (Bits): New class with static functions, copied from
4311 namespace utils in arm.cc.
4312 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
4313 instead.
4314
c335b55d
L
43152012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4316
4317 * incremental.cc (write_info_blocks): Correct relocation offset.
4318
41194d9f
L
43192012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4320
4321 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
4322 (Relocate::tls_gd_to_le): Likewise.
4323
1bae613c
L
43242012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4325
4326 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
4327
24482ca0
L
43282012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4329
4330 * configure.ac: Check if -mcmodel=medium works.
4331 * configure: Regenerated.
4332
c2c7840a
CC
43332012-01-24 Cary Coutant <ccoutant@google.com>
4334
4335 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
4336 definition and ...
4337 (read_unsigned_LEB_128_x): ... this new function.
4338 (read_signed_LEB_128): Replaced with inline definition and ...
4339 (read_signed_LEB_128_x): ... this new function.
4340 * int_encoding.h (read_unsigned_LEB_128_x): New function.
4341 (read_unsigned_LEB_128): Add inline definition.
4342 (read_signed_LEB_128_x): New function.
4343 (read_signed_LEB_128): Add inline definition.
4344 * testsuite/Makefile.am (leb128_unittest): New unit test.
4345 * testsuite/Makefile.in: Regenerate.
4346 * testsuite/leb128_unittest.cc: New unit test.
4347
833de760 43482012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
4349
4350 PR gold/13617
4351 * i386.cc (Target_i386::do_code_fill): When using a jmp
4352 instruction, pad with nop instructions.
4353 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4354
618d6666
L
43552012-01-22 H.J. Lu <hongjiu.lu@intel.com>
4356
4357 * x86_64.cc (gc_process_relocs): Add typename on types used in
4358 template.
4359 (scan_relocs): Likewise.
4360 (relocate_section): Likewise.
4361 (apply_relocation): Likewise.
4362
3660ff06
L
43632012-01-10 H.J. Lu <hongjiu.lu@intel.com>
4364
4365 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
4366 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
4367 under x32.
4368
fc51264f
L
43692012-01-09 H.J. Lu <hongjiu.lu@intel.com>
4370
4371 * x86_64.cc: Initial support for x32.
4372
dd74ae06
CC
43732012-01-03 Cary Coutant <ccoutant@google.com>
4374
4375 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
4376 Use abstract base class for GOT.
4377 * gold/output.h (class Output_data_got_base): New abstract base class.
4378 (class Output_data_got): Derive from new base class, adjust ctors.
4379 (Output_data_got::reserve_slot): Make virtual; rename to
4380 do_reserve_slot; Adjust callers.
4381 * gold/target.h (Sized_target::init_got_plt_for_update): Return
4382 pointer to abstract base class.
4383 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
4384
83896202
ILT
43852011-12-18 Ian Lance Taylor <iant@google.com>
4386
4387 * object.h (Relobj::local_symbol_value): New function.
4388 (Relobj::local_plt_offset): New function.
4389 (Relobj::local_has_got_offset): New function.
4390 (Relobj::local_got_offset): New function.
4391 (Relobj::set_local_got_offset): New function.
4392 (Relobj::do_local_symbol_value): New pure virtual function.
4393 (Relobj::do_local_plt_offset): Likewise.
4394 (Relobj::do_local_has_got_offset): Likewise.
4395 (Relobj::do_local_got_offset): Likewise.
4396 (Relobj::do_set_local_got_offset): Likewise.
4397 (Sized_relobj::do_local_has_got_offset): Rename from
4398 local_has_got_offset.
4399 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
4400 (Sized_relobj::do_set_local_got_offset): Rename from
4401 set_local_got_offset.
4402 (Sized_relobj_file::do_local_plt_offset): Rename from
4403 local_plt_offset.
4404 (Sized_relobj_file::do_local_symbol_value): New function.
4405 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
4406 local_plt_offset.
4407 * output.cc (Output_data_got::Got_entry::write): Change object to
4408 Relobj. Use local_symbol_value.
4409 (Output_data_got::add_global_with_rel): Change rel_dyn to
4410 Output_data_reloc_generic*. Use add_global_generic.
4411 (Output_data_got::add_global_with_rela): Remove. Change all
4412 callers to use add_global_with_rel.
4413 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
4414 Output_data_reloc_generic*. Use add_global_generic.
4415 (Output_data_got::add_global_pair_with_rela): Remove. Change all
4416 callers to use add_global_pair_with_rel.
4417 (Output_data_got::add_local): Change object to Relobj*.
4418 (Output_data_got::add_local_plt): Likewise.
4419 (Output_data_got::add_local_with_rel): Change object to Relobj*,
4420 change rel_dyn to Output_data_reloc_generic*. Use
4421 add_local_generic.
4422 (Output_data_got::add_local_with_rela): Remove. Change all
4423 callers to use all_local_with_rel.
4424 (Output_data_got::add_local_pair_with_rel): Change object to
4425 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
4426 add_output_section_generic.
4427 (Output_data_got::add_local_pair_with_rela): Remove. Change all
4428 callers to use add_local_pair_with_rel.
4429 (Output_data_got::reserve_local): Change object to Relobj*.
4430 * output.h: (class Output_data_reloc_generic): Add pure virtual
4431 declarations for add_global_generic, add_local_generic,
4432 add_output_section_generic.
4433 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
4434 functions for Output_data_reloc_generic. Update declarations for
4435 changes listed in output.cc.
4436 (class Output_data_got): Change template parameter to got_size.
4437 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
4438 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
4439 function.
4440 (Sized_relobj_incr::do_local_plt_offset): New function.
4441 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
4442 add_global_generic.
4443
76677ad0
CC
44442011-12-17 Cary Coutant <ccoutant@google.com>
4445
4446 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
4447 * resolve.cc (Symbol_table::resolve): Likewise.
4448 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
4449 arrays.
4450 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4451
8b8dd8d5
ILT
44522011-12-16 Ian Lance Taylor <iant@google.com>
4453
4454 * output.h (Output_data_reloc_generic::add): Only call
4455 add_dynamic_reloc if this is a dynamic reloc section.
4456
d55525b9
L
44572011-12-15 H.J. Lu <hongjiu.lu@intel.com>
4458
4459 PR gold/13505
4460 * target-reloc.h (apply_relocation): Replace <64, false> with
4461 <size, big_endian>.
4462
ff81c7c1
NC
44632011-11-25 Nick Clifton <nickc@redhat.com>
4464
4465 * po/it.po: New Italian translation.
4466
628f39be
SA
44672011-11-17 Sterling Augustine <saugustine@google.com>
4468
4469 * script.cc (script_include_directive): Implement.
4470 (read_script_file): New local variables name and search_path. Update
4471 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
4472 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
4473 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
4474
98ef3ea4
SA
44752011-11-11 Sterling Augustine <saugustine@google.com>
4476
4477 * yyscript.y (section_cmd): Add support for INCLUDE directive.
4478 (file_or_sections_cmd): Likewise.
4479
f4a8b6d7
DK
44802011-11-11 Doug Kwan <dougkwan@google.com>
4481
4482 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
4483 if --just-symbols is given.
4484
29ab395d
DK
44852011-11-10 Doug Kwan <dougkwan@google.com>
4486
4487 PR gold/13362
4488 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
4489 when processing data relocs.
4490 * reloc.h (Relocate_functions::rel_unaligned): New method.
4491 (Relocate_functions::pcrel_unaligned): Ditto.
4492 (Relocate_functions::rel32_unaligned): Ditto.
4493 (Relocate_functions::pcrel32_unaligned): Ditto.
4494
2c339f71
DK
44952011-11-09 Doug Kwan <dougkwan@google.com>
4496
4497 PR gold/13362
4498 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
4499 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
4500 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
4501 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4502 (Relocate_functions::rel_unaligned): New.
4503 (Relocate_functions::rel32_unaligned): New.
4504 * target-reloc.h (relocate_for_relocatable): Add code to handle
4505 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4506 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
4507 arm_unaligned_reloc_r): New targets.
4508 * testsuite/Makefile.in: Regenerate.
4509 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
4510 linking.
4511
3f3cddf1
ILT
45122011-11-02 Ian Lance Taylor <iant@google.com>
4513
4514 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
4515 NATIVE_LINKER.
4516 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
4517 * options.cc (General_options::finalize): Use library search path
4518 from configure script if specified. If not native and no sysroot,
4519 only search TOOLLIBDIR.
4520 * options.h (Search_directory::Search_directory): Change name to
4521 const std::string&.
4522 (General_options::add_to_library_path_with_sysroot): Change arg to
4523 const std::string&.
4524 * configure, Makefile.in, config.in: Rebuild.
4525
a8e2273b
ILT
45262011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4527
4528 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
4529 we are working around the ARM1176 Erratum.
4530 * options.h (General_options::fix_arm1176): Add option.
4531 * testsuite/Makefile.am: Add testcases, and keep current ones
4532 working.
4533 * testsuite/Makefile.in: Regenerate.
4534 * testsuite/arm_fix_1176.s: New file.
4535 * testsuite/arm_fix_1176.sh: Likewise.
4536
cd6eab1c
ILT
45372011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4538
4539 * arm.cc (Target_arm::Target_arm): Remove initialisation of
4540 may_use_blx_.
4541 (Target_arm::may_use_blx): Remove method.
4542 (Target_arm::set_may_use_blx): Likewise.
4543 (Target_arm::may_use_v4t_interworking): New method.
4544 (Target_arm::may_use_v5t_interworking): Likewise.
4545 (Target_arm::may_use_blx_): Remove member variable.
4546 (Arm_relocate_functions::arm_branch_common): Check for v5T
4547 interworking.
4548 (Arm_relocate_functions::thumb_branch_common): Likewise.
4549 (Reloc_stub::stub_type_for_reloc): Likewise.
4550 (Target_arm::do_finalize_sections): Correct interworking checks.
4551 * testsuite/Makefile.am: Add new tests.
4552 * testsuite/Makefile.in: Regenerate.
4553 * testsuite/arm_farcall_arm_arm.s: New test.
4554 * testsuite/arm_farcall_arm_arm.sh: Likewise.
4555 * testsuite/arm_farcall_arm_thumb.s: Likewise.
4556 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
4557 * testsuite/arm_farcall_thumb_arm.s: Likewise.
4558 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
4559 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
4560 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
4561
286adcf4
CC
45622011-10-31 Cary Coutant <ccoutant@google.com>
4563
4564 PR gold/13023
4565 * expression.cc (Expression::eval_with_dot): Add
4566 is_section_dot_assignment parameter.
4567 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
4568 absolute and assigning to dot within a section.
4569 * script-sections.cc
4570 (Output_section_element_assignment::set_section_addresses): Pass
4571 dot_section to set_if_absolute.
4572 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
4573 as is_section_dot_assignment flag to eval_with_dot.
4574 (Output_section_element_dot_assignment::set_section_addresses):
4575 Likewise.
4576 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
4577 parameter. Also set value if relative to dot_section; set the
4578 symbol's output_section.
4579 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
4580 parameter. Adjust all callers.
4581 (Expression::eval_maybe_dot): Likewise.
4582 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
4583 Adjust all callers.
4584 * testsuite/script_test_2.t: Test assignment of an absolute value
4585 to dot within an output section element.
4586
9634ed06
CC
45872011-10-31 Cary Coutant <ccoutant@google.com>
4588
4589 * options.h (class General_options): Add --[no-]gnu-unique options.
4590 * symtab.cc (Symbol_table::sized_write_globals): Convert
4591 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
4592
de4101c7
CC
45932011-10-31 Cary Coutant <ccoutant@google.com>
4594
4595 PR gold/13359
4596 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
4597 unnecessary assertion.
4598 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
4599
7257cc92
ST
46002011-10-31 Sriraman Tallam <tmsriram@google.com>
4601
4602 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4603 gc_mark_symbol.
4604 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4605 gc_mark_symbol.
4606 Change to just keep the section associated with symbol.
4607 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
4608 they are externally visible and --export-dynamic is turned on.
4609 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
4610
bfc34b3f
ILT
46112011-10-19 Ian Lance Taylor <iant@google.com>
4612
4613 PR gold/13163
4614 * script-sections.cc
4615 (Output_section_element_dot_assignment::needs_output_section): New
4616 function.
4617
ea0d8c47
ILT
46182011-10-19 Ian Lance Taylor <iant@google.com>
4619
4620 PR gold/13204
4621 * layout.cc (Layout::segment_precedes): Don't assert failure if a
4622 --section-start option was seen.
4623 * options.h (General_options::any_section_start): New function.
4624
abd242a9
DM
46252011-10-18 David S. Miller <davem@davemloft.net>
4626
4627 PR binutils/13301
4628 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
4629 member to track relocation locations that have moved during TLS
4630 reloc optimizations.
4631 (Target_sparc::Relocate::Relocate): Initialize to NULL.
4632 (Target_sparc::Relocate::relocate): Adjust view down by 4
4633 bytes if it matches reloc_adjust_addr_.
4634 (Target_sparc::Relocate::relocate_tls): Always move the
4635 __tls_get_addr call delay slot instruction forward 4 bytes when
4636 performing relaxation.
4637
bab9090f
CC
46382011-10-18 Cary Coutant <ccoutant@google.com>
4639
4640 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
4641 (Output_file::map_no_anonymous): Check for non-zero
4642 return code from posix_fallocate.
4643
f7c5b166
CC
46442011-10-17 Cary Coutant <ccoutant@google.com>
4645
4646 PR gold/13245
4647 * plugin.cc (is_visible_from_outside): Check for symbols
4648 referenced from dynamic objects.
4649 * resolve.cc (Symbol_table::resolve): Don't count references
4650 from dynamic objects as references from real ELF files.
4651 * testsuite/plugin_test_2.sh: Adjust expected result.
4652
b490c0bb
CC
46532011-10-17 Cary Coutant <ccoutant@google.com>
4654
4655 * gold.cc: Include timer.h.
4656 (queue_middle_tasks): Stamp time.
4657 (queue_final_tasks): Likewise.
4658 * main.cc (main): Store timer in parameters. Print timers
4659 for each pass.
4660 * parameters.cc (Parameters::Parameters): Initialize timer_.
4661 (Parameters::set_timer): New function.
4662 (set_parameters_timer): New function.
4663 * parameters.h (Parameters::set_timer): New function.
4664 (Parameters::timer): New function.
4665 (Parameters::timer_): New data member.
4666 (set_parameters_timer): New function.
4667 * timer.cc (Timer::stamp): New function.
4668 (Timer::get_pass_time): New function.
4669 * timer.h (Timer::stamp): New function.
4670 (Timer::get_pass_time): New function.
4671 (Timer::pass_times_): New data member.
4672
f475cf7b
CC
46732011-10-17 Cary Coutant <ccoutant@google.com>
4674
4675 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
4676 task for members of lib groups.
4677
cdd7e244
CC
46782011-10-17 Cary Coutant <ccoutant@google.com>
4679
4680 PR gold/13288
4f95c8b4 4681 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
4682 (File_read::make_view): Move bounds check (replace with assert)...
4683 (File_read::find_or_make_view): ... to here.
4684
dfb45471
CC
46852011-10-12 Cary Coutant <ccoutant@google.com>
4686
4f95c8b4 4687 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
4688 ::read returns less than requested size.
4689
53bbcc1b
CC
46902011-10-10 Cary Coutant <ccoutant@google.com>
4691
4f95c8b4 4692 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
4693 Initialize defined_count_.
4694 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
4695 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
4696 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
4697 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
4698 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 4699 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
4700 member.
4701 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 4702 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
4703 Return zeroes instead of internal error.
4704
397b129b
CC
47052011-10-10 Cary Coutant <ccoutant@google.com>
4706
4707 PR gold/13249
4f95c8b4 4708 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 4709 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 4710 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
4711 (Output_reloc::type_): Adjust size of bit field.
4712 (Output_reloc::use_plt_offset_): New bit field.
4713 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
4714 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
4715 flag. Adjust all callers.
4f95c8b4 4716 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
4717 creating RELATIVE relocations.
4718
d5698657
NC
47192011-10-10 Nick Clifton <nickc@redhat.com>
4720
4721 * po/es.po: Updated Spanish translation.
4722 * po/fi.po: Updated Finnish translation.
4723
6a59a5c2
DN
47242011-10-03 Diego Novillo <dnovillo@google.com>
4725
4726 * options.cc (parse_uint): Fix dereference of RETVAL.
4727
f0558624
ST
47282011-09-29 Sriraman Tallam <tmsriram@google.com>
4729
4730 * layout.h (section_order_map_): New member.
4731 (get_section_order_map): New member function.
4732 * output.cc (Output_section::add_input_section): Check for patterns
4733 only when --section-ordering-file is specified.
4734 * gold.cc (queue_middle_tasks): Delay updating order of sections till
4735 output_sections have been formed.
4736 * layout.cc (Layout_Layout): Initialize section_order_map_.
4737 * plugin.cc (update_section_order): Store order in order_map. Do not
4738 update the order.
4739 * testsuite/Makefile.am: Add test case for plugin_final_layout.
4740 * testsuite/Makefile.in: Regenerate.
4741 * testsuite/plugin_section_order.c: New file.
4742 * testsuite/plugin_final_layout.cc: New file.
4743 * testsuite/plugin_final_layout.sh: New file.
4744
a7dac153
CC
47452011-09-29 Cary Coutant <ccoutant@google.com>
4746
4f95c8b4 4747 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 4748 Check for NULL.
4f95c8b4 4749 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
4750 symbols during incremental update.
4751 (Symbol_table::add_from_dynobj): Likewise.
4752
eebd87a5
ILT
47532011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4754 Ian Lance Taylor <iant@google.com>
4755
4756 * symtab.cc (Symbol_table::define_special_symbol): Always
4757 canonicalize version string.
4758
403a3331
CC
47592011-09-26 Cary Coutant <ccoutant@google.com>
4760
4f95c8b4
CC
4761 * gold.cc (queue_initial_tasks): Move option checks ...
4762 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
4763 some options; make others fatal.
4764
235061c2
CC
47652011-09-26 Cary Coutant <ccoutant@google.com>
4766
4767 gcc PR lto/47247
4768 * plugin.cc (get_symbols_v2): New function.
4769 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
4770 (is_referenced_from_outside): New function.
4771 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
4772 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
4773 (get_symbols): Pass version parameter.
4774 (get_symbols_v2): New function.
4775 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
4776 parameter.
4777 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
4778 (onload): Add LDPT_GET_SYMBOLS_V2.
4779 (all_symbols_read_hook): Use get_symbols_v2; check for
4780 LDPR_PREVAILING_DEF_IRONLY_EXP.
4781 * testsuite/plugin_test_3.sh: Update expected results.
4782
dc87f620
ILT
47832011-09-23 Simon Baldwin <simonb@google.com>
4784
4785 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
4786 configuration options.
4787 * configure: Regenerate.
4788 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
4789 * Makefile.in: Regenerate.
4790 * testsuite/Makefile.in: Regenerate.
4791
a8279f82
ST
47922011-09-19 Sriraman Tallam <tmsriram@google.com>
4793
4794 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
4795
0c9350c8
CC
47962011-09-19 Cary Coutant <ccoutant@google.com>
4797
4798 * incremental.cc (can_incremental_update): Fix typo in comment.
4799 * incremental.h (can_incremental_update): Likewise.
4800
aa06ae28
CC
48012011-09-18 Cary Coutant <ccoutant@google.com>
4802
4803 * incremental.cc (can_incremental_update): New function.
4804 * incremental.h (can_incremental_update): New function.
4805 * layout.cc (Layout::init_fixed_output_section): Call it.
4806 (Layout::make_output_section): Don't allow patch space in .eh_frame.
4807 * object.cc (Sized_relobj_file::do_layout): Call
4808 can_incremental_update.
4809
ebb300b2
CC
48102011-09-13 Cary Coutant <ccoutant@google.com>
4811
4812 * configure.ac: Check for glibc support for gnu_indirect_function
4813 support with static linking, setting automake conditional
4814 IFUNC_STATIC.
4815 * Makefile.in: Regenerate.
4816 * configure: Regenerate.
4817
4818 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
4819 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
4820 for IFUNC_STATIC.
4821 * testsuite/Makefile.in: Regenerate.
4822
1206d0d5
CC
48232011-09-13 Cary Coutant <ccoutant@google.com>
4824
4825 * incremental.cc (Sized_relobj_incr::do_layout): Call
4826 report_comdat_group for kept comdat sections.
4827 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
4828 * testsuite/Makefile.in: Regenerate.
4829 * testsuite/incr_comdat_test_1.cc: New source file.
4830 * testsuite/incr_comdat_test_2_v1.cc: New source file.
4831 * testsuite/incr_comdat_test_2_v2.cc: New source file.
4832 * testsuite/incr_comdat_test_2_v3.cc: New source file.
4833
40b29874
ILT
48342011-09-13 Ian Lance Taylor <iant@google.com>
4835
4836 * object.cc (Sized_relobj_file::do_layout): Remove unused local
4837 variable external_symbols_offset.
4838
1b045aac
ILT
48392011-09-12 Ian Lance Taylor <iant@google.com>
4840
4841 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
4842 triggered if object has no symbols.
4843
24c6c55a
DM
48442011-09-09 David S. Miller <davem@davemloft.net>
4845
4846 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
4847 (Output_fill_debug_line::do_write): Likewise.
4848
66570254
CC
48492011-08-29 Cary Coutant <ccoutant@google.com>
4850
4851 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
4852 casts to match formatting specs.
4853 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
4854
8ea8cd50
CC
48552011-08-26 Cary Coutant <ccoutant@google.com>
4856
4857 * layout.cc (Free_list::allocate): Provide guarantee of minimum
4858 remaining hole size when allocating.
4859 (Layout::make_output_section): Set fill methods for debug sections.
4860 * layout.h (Free_list::Free_list_node): Move from private to
4861 public.
4862 (Free_list::set_min_hole_size): New function.
4863 (Free_list::begin, Free_list::end): New functions.
4864 (Free_list::min_hole_): New data member.
4865 * output.cc: Include dwarf.h.
4866 (Output_fill_debug_info::do_minimum_hole_size): New function.
4867 (Output_fill_debug_info::do_write): New function.
4868 (Output_fill_debug_line::do_minimum_hole_size): New function.
4869 (Output_fill_debug_line::do_write): New function.
4870 (Output_section::Output_section): Initialize new data member.
4871 (Output_section::set_final_data_size): Ensure patch space is larger
4872 than minimum hole size.
4873 (Output_section::do_write): Fill holes in debug sections.
4874 * output.h (Output_fill): New class.
4875 (Output_fill_debug_info): New class.
4876 (Output_fill_debug_line): New class.
4877 (Output_section::set_free_space_fill): New function.
4878 (Output_section::free_space_fill_): New data member.
4879 * testsuite/Makefile.am (incremental_test_3): Add
4880 --incremental-patch option.
4881 (incremental_test_4): Likewise.
4882 (incremental_test_5): Likewise.
4883 (incremental_test_6): Likewise.
4884 (incremental_copy_test): Likewise.
4885 (incremental_common_test_1): Likewise.
4886 * testsuite/Makefile.in: Regenerate.
4887
7cf80422
NC
48882011-08-26 Nick Clifton <nickc@redhat.com>
4889
4890 * po/es.po: Updated Spanish translation.
4891
c3f7b0e5
CC
48922011-08-01 Cary Coutant <ccoutant@google.com>
4893
4894 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
4895 * gold/testsuite/Makefile.in: Regenerate.
4896 * gold/testsuite/justsyms_exec.c: New source file.
4897 * gold/testsuite/justsyms_lib.c: New source file.
4898
9590bf25
CC
48992011-08-01 Cary Coutant <ccoutant@google.com>
4900
4901 * layout.cc (Layout::set_segment_offsets): Don't realign text
4902 segment if -Ttext was specified.
4903 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
4904 file type.
4905 * object.h (Sized_relobj_file::e_type): New function.
4906 (Sized_relobj_file::e_type_): New data member.
4907 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
4908 base address for ET_EXEC files.
4909 * target.cc (Target::do_make_elf_object_implementation): Allow
4910 ET_EXEC files with --just-symbols option.
4911
dcd8d12e
CC
49122011-07-28 Cary Coutant <ccoutant@google.com>
4913
4914 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
4915 Add thread_number parameter.
4916 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
4917 * workqueue-threads.cc
4918 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
4919 current thread if its thread number is greater than desired thread
4920 count.
4921 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
4922 Add thread_number parameter.
4923 (Workqueue::should_cancel_thread): Likewise.
4924 (Workqueue::find_runnable_or_wait): Pass thread_number to
4925 should_cancel_thread.
4926 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
4927 parameter.
4928
804eb480
ST
49292011-07-22 Sriraman Tallam <tmsriram@google.com>
4930
4931 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
4932 only after checking if it cannot be forced local.
4933 * symtab.h (is_externally_visible): Check if the symbol is not forced
4934 local.
4935
f1ddb600
ILT
49362011-07-15 Ian Lance Taylor <iant@google.com>
4937
4938 * options.h (class General_options): Add --print-output-format.
4939 Move -EL next to -EB, for better --help output.
4940 * target-select.cc: Include <cstdio>, "options.h", and
4941 "parameters.h".
4942 (Target_selector::do_target_bfd_name): New function.
4943 (print_output_format): New function.
4944 * target-select.h (class Target_selector): Update declarations.
4945 (Target_selector::target_bfd_name): New function.
4946 (print_output_format): Declare.
4947 * main.cc: Include "target-select.h".
4948 (main): Handle --print-output-format.
4949 * gold.cc: Include "target-select.h".
4950 (queue_initial_tasks): Handle --print-output-format when there are
4951 no input files.
4952 * parameters.cc (parameters_force_valid_target): Give a better
4953 error message if -EB/-EL does not match target.
4954 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
4955 function.
4956
7d172687
ILT
49572011-07-15 Ian Lance Taylor <iant@google.com>
4958
4959 * i386.cc (class Output_data_plt_i386): Add layout_ field.
4960 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
4961 (Output_data_plt_i386::do_write): Write address of .dynamic
4962 section to first entry in .got.plt section.
4963 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
4964 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4965 Initialize layout_.
4966 (Output_data_plt_x86_64::do_write): Write address of .dynamic
4967 section to first entry in .got.plt section.
4968 * layout.h (Layout::dynamic_section): New function.
4969
e9552f7e
ST
49702011-07-13 Sriraman Tallam <tmsriram@google.com>
4971
4972 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
4973 to claim_file call.
4974 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
4975 input_section_position_, and input_section_glob_.
4976 (read_layout_from_file): Call function section_ordering_specified.
4977 * layout.h (is_section_ordering_specified): New function.
4978 (section_ordering_specified): New function.
4979 (section_ordering_specified_): New boolean member.
4980 * main.cc(main): Call load_plugins after layout object is defined.
4981 * output.cc (Output_section::add_input_section): Use
4982 function section_ordering_specified to check if section ordering is
4983 needed.
4984 * output.cc (Output_section::add_relaxed_input_section): Use
4985 function section_ordering_specified to check if section ordering is
4986 needed.
4987 (Output_section::update_section_layout): New function.
4988 (Output_section::sort_attached_input_sections): Check if input section
4989 must be reordered.
4990 * output.h (Output_section::update_section_layout): New function.
4991 * plugin.cc (get_section_count): New function.
4992 (get_section_type): New function.
4993 (get_section_name): New function.
4994 (get_section_contents): New function.
4995 (update_section_order): New function.
58797674 4996 (allow_section_ordering): New function.
e9552f7e
ST
4997 (Plugin::load): Add the new interfaces to the transfer vector.
4998 (Plugin_manager::load_plugins): New parameter.
4999 (Plugin_manager::all_symbols_read): New parameter.
5000 (Plugin_manager::claim_file): New parameter. Save the elf object for
5001 unclaimed objects.
5002 (Plugin_manager::get_elf_object): New function.
5003 (Plugin_manager::get_view): Change to directly use the bool to check
5004 if get_view is called from claim_file_hook.
5005 * plugin.h (input_objects): New function
5006 (Plugin__manager::load_plugins): New parameter.
5007 (Plugin_manager::claim_file): New parameter.
5008 (Plugin_manager::get_elf_object): New function.
5009 (Plugin_manager::in_claim_file_handler): New function.
5010 (Plugin_manager::in_claim_file_handler_): New member.
5011 (layout): New function.
5012 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
5013 handler with an extra parameter. Make the elf object before calling
5014 claim_file handler.
5015 * testsuite/plugin_test.c (get_section_count): New function pointer.
5016 (get_section_type): New function pointer.
5017 (get_section_name): New function pointer.
5018 (get_section_contents): New function pointer.
5019 (update_section_order): New function pointer.
5020 (allow_section_ordering): New function pointer.
5021 (onload): Check if the new interfaces exist.
5022
9446efde
ILT
50232011-07-13 Ian Lance Taylor <iant@google.com>
5024
5025 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
5026 relro section.
5027 * x86_64.cc (Target_x86_64::got_section): Likewise.
5028 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
5029 (relro_now_test_SOURCES): New variable.
5030 (relro_now_test_DEPENDENCIES): New variable.
5031 (relro_now_test_LDFLAGS): New variable.
5032 (relro_now_test_LDADD): New variable.
5033 (relro_now_test.so): New target.
5034 * testsuite/Makefile.in: Rebuild.
5035
07aa62f2
ILT
50362011-07-12 Ian Lance Taylor <iant@google.com>
5037
5038 PR gold/12980
5039 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
5040 GLOB_DAT relocation rather than a RELATIVE relocation for a
5041 protected symbol when creating a shared library.
5042 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5043 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
5044 * testsuite/protected_main_1.cc (main): Test that protected
5045 function has same address.
5046
e2153196
ILT
50472011-07-11 Ian Lance Taylor <iant@google.com>
5048
5049 PR gold/12979
5050 * options.h (class General_options): Add -Bgroup.
5051 * options.cc (General_options::finalize): If -Bgroup is set,
5052 default to --unresolved-symbols=report-all.
5053 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
5054 * target-reloc.h (issue_undefined_symbol_error): Handle
5055 --unresolved-symbols=report-all.
5056
6daf5215
ILT
50572011-07-08 Ian Lance Taylor <iant@google.com>
5058
5059 PR gold/11985
5060 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
5061 if linker script discards key sections.
5062 (Layout::create_dynamic_symtab): Likewise.
5063 (Layout::assign_local_dynsym_offsets): Likewise.
5064 (Layout::sized_create_version_sections): Likewise.
5065 (Layout::create_interp): Likewise.
5066 (Layout::finish_dynamic_section): Likewise.
5067 (Layout::set_dynamic_symbol_size): Likewise.
5068
beabb2c6
ILT
50692011-07-08 Ian Lance Taylor <iant@google.com>
5070
5071 PR gold/12386
5072 * options.h (class General_options): Add --unresolved-symbols.
5073 * target-reloc.h (issue_undefined_symbol_error): Check
5074 --unresolved-symbols. Add comments.
5075
9c16daf1
ILT
50762011-07-08 Ian Lance Taylor <iant@google.com>
5077
5078 * testsuite/odr_violation2.cc (Ordering::operator()): Make
5079 expression more complex.
5080
191f1a2d
ILT
50812011-07-08 Ian Lance Taylor <iant@google.com>
5082
5083 PR gold/11317
5084 * target-reloc.h (issue_undefined_symbol_error): New inline
5085 function, broken out of relocate_section.
5086 (relocate_section): Call issue_undefined_symbol_error.
5087 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5088 there is no TLS segment if we are about to issue an undefined
5089 symbol error.
5090 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5091
62855347
ILT
50922011-07-08 Ian Lance Taylor <iant@google.com>
5093
5094 PR gold/12279
5095 * resolve.cc (Symbol_table::should_override): Add fromtype
5096 parameter. Change all callers. Give error when linking together
5097 TLS and non-TLS symbol.
5098 (Symbol_table::should_override_with_special): Add fromtype
5099 parameter. Change all callers.
5100 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5101 there is no TLS segment if we have reported some errors.
5102 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5103
67181c72
ILT
51042011-07-08 Ian Lance Taylor <iant@google.com>
5105
5106 PR gold/12372
5107 * target.h (Target::plt_address_for_global): New function.
5108 (Target::plt_address_for_local): New function.
5109 (Target::plt_section_for_global): Remove.
5110 (Target::plt_section_for_local): Remove.
5111 (Target::do_plt_address_for_global): New virtual function.
5112 (Target::do_plt_address_for_local): New virtual function.
5113 (Target::do_plt_section_for_global): Remove.
5114 (Target::do_plt_section_for_local): Remove.
5115 (Target::register_global_plt_entry): Add Symbol_table and Layout
5116 parameters.
5117 * output.cc (Output_data_got::Got_entry::write): Use
5118 plt_address_for_global and plt_address_for_local.
5119 * layout.cc (Layout::add_target_dynamic_tags): Use size and
5120 address of output section.
5121 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
5122 got_irelative_, and irelative_count_ fields. Update
5123 declarations.
5124 (Output_data_plt_i386::has_irelative_section): New function.
5125 (Output_data_plt_i386::entry_count): Add irelative_count_.
5126 (Output_data_plt_i386::set_final_data_size): Likewise.
5127 (class Target_i386): Add got_irelative_ and rel_irelative_
5128 fields. Update declarations.
5129 (Target_i386::Target_i386): Initialize new fields.
5130 (Target_i386::do_plt_address_for_global): New function replacing
5131 do_plt_section_for_global.
5132 (Target_i386::do_plt_address_for_local): New function replacing
5133 do_plt_section_for_local.
5134 (Target_i386::got_section): Create got_irelative_.
5135 (Target_i386::rel_irelative_section): New function.
5136 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
5137 fields. Don't define __rel_iplt_{start,end}.
5138 (Output_data_plt_i386::add_entry): Add symtab and layout
5139 parameters. Change all callers. Use different PLT and GOT for
5140 IFUNC symbols.
5141 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
5142 layout parameters. Change all callers. Use different PLT and
5143 GOT.
5144 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
5145 (Output_data_plt_i386::rel_irelative): New function.
5146 (Output_data_plt_i386::address_for_global): New function.
5147 (Output_data_plt_i386::address_for_local): New function.
5148 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
5149 IRELATIVE GOT when changing IFUNC GOT entries.
5150 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
5151 reloc.
5152 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
5153 if we didn't create an IRELATIVE GOT.
5154 (Target_i386::Relocate::relocate): Use plt_address_for_global and
5155 plt_address_for_local.
5156 (Target_i386::do_dynsym_value): Use plt_address_for_global.
5157 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
5158 got_irelative_, and irelative_count_ fields. Update
5159 declarations.
5160 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5161 Initialize new fields. Remove symtab parameter. Change all
5162 callers.
5163 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
5164 irelative_count_.
5165 (Output_data_plt_x86_64::has_irelative_section): New function.
5166 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
5167 (class Target_x86_64): Add got_irelative_ and rel_irelative_
5168 fields. Update declarations.
5169 (Target_x86_64::Target_x86_64): Initialize new fields.
5170 (Target_x86_64::do_plt_address_for_global): New function replacing
5171 do_plt_section_for_global.
5172 (Target_x86_64::do_plt_address_for_local): New function replacing
5173 do_plt_section_for_local.
5174 (Target_x86_64::got_section): Create got_irelative_.
5175 (Target_x86_64::rela_irelative_section): New function.
5176 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
5177 all callers. Don't create __rel_iplt_{start,end}.
5178 (Output_data_plt_x86_64::add_entry): Add symtab and layout
5179 parameters. Change all callers. Use different PLT and GOT for
5180 IFUNC symbols.
5181 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
5182 layout parameters. Change all callers. Use different PLT and
5183 GOT.
5184 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
5185 parameters. Change all callers. Use different PLT and GOT for
5186 IFUNC symbols.
5187 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
5188 (Output_data_plt_x86_64::rela_irelative): New function.
5189 (Output_data_plt_x86_64::address_for_global): New function.
5190 (Output_data_plt_x86_64::address_for_local): New function.
5191 (Output_data_plt_x86_64::set_final_data_size): Likewise.
5192 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
5193 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
5194 (Target_x86_64::register_global_plt_entry): Add symtab and layout
5195 parameters.
5196 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
5197 reloc.
5198 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
5199 symbols if we didn't create an IRELATIVE GOT.
5200 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
5201 plt_address_for_local.
5202 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
5203 * testsuite/ifuncvar1.c: New test file.
5204 * testsuite/ifuncvar2.c: New test file.
5205 * testsuite/ifuncvar3.c: New test file.
5206 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
5207 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
5208 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
5209 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
5210 * testsuite/Makefile.in: Rebuild.
5211
33c15b45
CC
52122011-07-07 Cary Coutant <ccoutant@google.com>
5213
5214 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
5215 (two_file_test_1_ndebug.o): Likewise.
5216 (two_file_test_1b_ndebug.o): Likewise.
5217 (two_file_test_2_ndebug.o): Likewise.
5218 (two_file_test_main_ndebug.o): Likewise.
5219 (incremental_test_2): Link with no-debug versions.
5220
f48b5fb7
CC
52212011-07-06 Cary Coutant <ccoutant@google.com>
5222
5223 * gold/incremental.cc
5224 (Output_section_incremental_inputs::write_info_blocks): Check for
5225 hidden and internal symbols.
5226
221597a5
CC
52272011-07-06 Cary Coutant <ccoutant@google.com>
5228
5229 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
5230 Check disposition for startup file.
5231 (Incremental_inputs::report_command_line): Ignore
5232 --incremental-startup-unchanged option.
5233 * options.cc (General_options::parse_incremental_startup_unchanged):
5234 New function.
5235 (General_options::General_options): Initialize new data member.
5236 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
5237 (General_options): Add --incremental-startup-unchanged option.
5238 (General_options::incremental_startup_disposition): New function.
5239 (General_options::incremental_startup_disposition_): New data member.
5240
e24719f6
CC
52412011-07-06 Cary Coutant <ccoutant@google.com>
5242
5243 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
5244 input file index to Script_info ctor.
5245 (Sized_incremental_binary::do_file_has_changed): Find the
5246 command-line argument for files named in scripts.
5247 * incremental.h (Script_info::Script_info): New ctor
5248 with input file index.
5249 (Script_info::input_file_index): New function.
5250 (Script_info::input_file_index_): New data member.
5251 (Incremental_binary::get_library): Add const.
5252 (Incremental_binary::get_script_info): Add const.
5253 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
5254 * testsuite/Makefile.am (incremental_test_5): New test case.
5255 (incremental_test_6): New test case.
5256 * testsuite/Makefile.in: Regenerate.
5257
8f7c81e8
CC
52582011-07-06 Cary Coutant <ccoutant@google.com>
5259
5260 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
5261 debug output when command lines differ.
5262
9fbd3822
CC
52632011-07-06 Cary Coutant <ccoutant@google.com>
5264
5265 * incremental.cc (Incremental_inputs::report_command_line): Ignore
5266 --incremental-patch option.
5267 * layout.cc (Free_list::allocate): Extend allocation beyond original
5268 end if enabled.
5269 (Layout::make_output_section): Mark sections that should get
5270 patch space.
5271 * options.cc (parse_percent): New function.
5272 * options.h (parse_percent): New function.
5273 (DEFINE_percent): New macro.
5274 (General_options): Add --incremental-patch option.
5275 * output.cc (Output_section::Output_section): Initialize new data
5276 members.
5277 (Output_section::add_input_section): Print section name when out
5278 of patch space.
5279 (Output_section::add_output_section_data): Likewise.
5280 (Output_section::set_final_data_size): Add patch space when
5281 doing --incremental-full.
5282 (Output_section::do_reset_address_and_file_offset): Remove patch
5283 space.
5284 (Output_segment::set_section_list_addresses): Print debug output
5285 only if --incremental-update.
5286 * output.h (Output_section::set_is_patch_space_allowed): New function.
5287 (Output_section::is_patch_space_allowed_): New data member.
5288 (Output_section::patch_space_): New data member.
5289 * parameters.cc (Parameters::incremental_full): New function.
5290 * parameters.h (Parameters::incremental_full): New function
5291 * testsuite/Makefile.am (incremental_test_2): Add test for
5292 --incremental-patch option.
5293 * testsuite/Makefile.in: Regenerate.
5294 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
5295 (t18): Remove function body.
5296
f6cccc2c
DK
52972011-07-05 Doug Kwan <dougkwan@google.com>
5298
5299 PR gold/12771
5300 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
5301 Arm_Address type for relocation result.
5302 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
5303 overflow check.
5304 (Arm_relocate_functions::abs32): Use unaligned access.
5305 (Arm_relocate_functions::rel32): Ditto.
5306 (Arm_relocate_functions::prel31): Ditto.
5307 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
5308 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
5309 static data relocations.
5310 * testsuite/Makefile.in: Regnerate.
5311 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
5312
28a13fec
ILT
53132011-07-05 Ian Lance Taylor <iant@google.com>
5314
5315 PR gold/12392
5316 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
5317 symbols if necessary.
5318 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5319
24d47b34
ILT
53202011-07-05 Ian Lance Taylor <iant@google.com>
5321
5322 PR gold/12952
5323 * resolve.cc (Symbol::override_base_with_special): Simply override
5324 version with special symbol version, ignoring previous version.
5325
41f9cbbe
ILT
53262011-07-05 Ian Lance Taylor <iant@google.com>
5327
5328 * object.cc (Sized_relobj_file::include_section_group): Add
5329 information to comment about signature location.
5330
886288f1
ILT
53312011-07-02 Ian Lance Taylor <iant@google.com>
5332
5333 PR gold/12957
5334 * options.h (class General_options): Add -f and -F.
5335 * options.cc (General_options::finalize): Fatal error if -f/-F
5336 are used without -shared.
5337 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
5338
ae3a6d4f
ILT
53392011-07-02 Ian Lance Taylor <iant@google.com>
5340
5341 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
5342
21131061
ILT
53432011-07-01 Ian Lance Taylor <iant@google.com>
5344
5345 PR gold/12525
5346 PR gold/12952
5347 * resolve.cc (Symbol::override_base_with_special): Don't override
5348 the version if the overriding symbol has a different name.
5349 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
5350 all callers. If we give an error about an undefined version,
5351 define the base version if necessary.
5352 * dynobj.h (class Versions): Update declaration.
5353 * testsuite/weak_alias_test_5.cc: New file.
5354 * testsuite/weak_alias_test.script: New file.
5355 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
5356 and versioned_alias have the right value, and call t2.
5357 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
5358 weak_alias_test_5.so.
5359 (weak_alias_test_LDADD): Likewise.
5360 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
5361 * testsuite/Makefile.in: Rebuild.
5362
611062c0
ILT
53632011-07-01 Ian Lance Taylor <iant@google.com>
5364
5365 PR gold/12525
5366 * options.h (class General_options): Support -z notext.
5367 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
5368 -Wl,-z,notext.
5369 (two_file_shared_nonpic.so): Likewise.
5370 (two_file_shared_mixed.so): Likewise.
5371 (two_file_shared_mixed_1.so): Likewise.
5372 (weak_undef_lib_nonpic.so): Likewise.
5373 (alt/weak_undef_lib_nonpic.so): Likewise.
5374 (tls_test_shared_nonpic.so): Likewise.
5375 * testsuite/Makefile.in: Rebuild.
5376
328c7c2f
ILT
53772011-07-01 Ian Lance Taylor <iant@google.com>
5378
5379 PR gold/12525
5380 * configure.ac: Test whether static linking works, setting
5381 the automake conditional HAVE_STATIC.
5382 * testsuite/Makefile.am: Disable tests using -static if
5383 HAVE_STATIC is not true.
5384 * configure, testsuite/Makefile.in: Rebuild.
5385
02d7cd44
ILT
53862011-07-01 Ian Lance Taylor <iant@google.com>
5387
5388 PR gold/12525
5389 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
5390 Assert if we see DW_EH_PE_indirect.
5391 * target.h (Target::ehframe_datarel_base): New function.
5392 (Target::do_ehframe_datarel_base): New target function.
5393 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
5394 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
5395 function.
5396
07a60597
ILT
53972011-07-01 Ian Lance Taylor <iant@google.com>
5398
5399 PR gold/12571
5400 * options.h (class General_options): Add
5401 --ld-generated-unwind-info.
5402 * ehframe.cc (Fde::write): Add address parameter. Change all
5403 callers. If associated with PLT, fill in address and size.
5404 (Cie::set_output_offset): Only add merge mapping if there is an
5405 object.
5406 (Cie::write): Add address parameter. Change all callers.
5407 (Eh_frame::add_ehframe_for_plt): New function.
5408 * ehframe.h (class Fde): Update declarations. Move shndx_ and
5409 input_offset_ fields into union u_, with new plt field.
5410 (Fde::Fde): Adjust for new union field.
5411 (Fde::Fde) [Output_data version]: New constructor.
5412 (Fde::add_mapping): Only add merge mapping if there is an object.
5413 (class Cie): Update declarations.
5414 (class Eh_frame): Declare add_ehframe_for_plt.
5415 * layout.cc (Layout::layout_eh_frame): Break out code into
5416 make_eh_frame_section, and call it.
5417 (Layout::make_eh_frame_section): New function.
5418 (Layout::add_eh_frame_for_plt): New function.
5419 * layout.h (class Layout): Update declarations.
5420 * merge.cc (Merge_map::add_mapping): Add assertion.
5421 * i386.cc: Include "dwarf.h".
5422 (class Output_data_plt_i386): Make first_plt_entry,
5423 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
5424 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5425 and plt_eh_frame_fde.
5426 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
5427 boundary. Call add_eh_frame_for_plt if appropriate.
5428 * x86_64.cc: Include "dwarf.h".
5429 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
5430 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
5431 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5432 and plt_eh_frame_fde.
5433 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
5434 appropriate.
5435
14788a3f
ILT
54362011-06-29 Ian Lance Taylor <iant@google.com>
5437
5438 PR gold/12629
5439 * object.cc (Sized_relobj_file::layout_section): Change shdr
5440 parameter to be const.
5441 (Sized_relobj_file::layout_eh_frame_section): New function, broken
5442 out of do_layout.
5443 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
5444 appropriate. Call layout_eh_frame_section.
5445 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
5446 sections.
5447 * object.h (class Sized_relobj_file): Update declarations.
5448
6c21fce1
ILT
54492011-06-29 Ian Lance Taylor <iant@google.com>
5450
37e41b03 5451 PR gold/12652
6c21fce1
ILT
5452 * script.cc (Token::integer_value): Accept trailing M/m/K/k
5453 modifier.
5454 (Lex::gather_token): Accept trailing M/m/K/k for integers.
5455
4d5e4e62
ILT
54562011-06-29 Ian Lance Taylor <iant@google.com>
5457
5458 PR gold/12675
5459 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
5460 SHT_X86_64_UNWIND.
5461 * layout.cc (Layout::layout_eh_frame): Likewise.
5462
886f533a
ILT
54632011-06-29 Ian Lance Taylor <iant@google.com>
5464
5465 PR gold/12695
5466 * layout.cc (Layout::symtab_section_shndx): New function.
5467 * layout.h (class Layout): Declare symtab_section_shndx.
5468 * output.cc (Output_section::write_header): Call it.
5469
f3ae1b28
ILT
54702011-06-29 Ian Lance Taylor <iant@google.com>
5471
5472 PR gold/12818
5473 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
5474 symbols which are not used in a relocation.
5475
aecf301f
ILT
54762011-06-28 Ian Lance Taylor <iant@google.com>
5477
5478 PR gold/12898
5479 * layout.cc (Layout::segment_precedes): Don't crash if a linker
5480 script create indistinguishable segments.
5481 (Layout::set_segment_offsets): Use stable_sort when sorting
5482 segments. Pass this to Compare_segments constructor.
5483 * layout.h (class Layout): Make segment_precedes non-static.
5484 (class Compare_segments): Change from struct to class. Add
5485 layout_ field. Add constructor.
5486 * script-sections.cc
5487 (Script_sections::attach_sections_using_phdrs_clause): Rename
5488 local orphan to is_orphan. Don't report failure to put empty
5489 section in segment. On attachment failure, report name of
5490 section, and attach to first PT_LOAD segment.
5491
03ef7571
ILT
54922011-06-28 Ian Lance Taylor <iant@google.com>
5493
5494 PR gold/12934
5495 * target-select.cc (Target_selector::Target_selector): Add
5496 emulation parameter. Change all callers.
5497 (select_target_by_bfd_name): Rename from select_target_by_name.
5498 Change all callers.
5499 (select_target_by_emulation): New function.
5500 (supported_emulation_names): New function.
5501 * target-select.h (class Target_selector): Add emulation_ field.
5502 Update declarations.
5503 (Target_selector::recognize_by_bfd_name): Rename from
5504 recognize_by_name. Change all callers.
5505 (Target_selector::supported_bfd_names): Rename from
5506 supported_names. Change all callers.
5507 (Target_selector::recognize_by_emulation): New function.
5508 (Target_selector::supported_emulations): New function.
5509 (Target_selector::emulation): New function.
5510 (Target_selector::do_recognize_by_bfd_name): Rename from
5511 do_recognize_by_name. Change all callers.
5512 (Target_selector::do_supported_bfd_names): Rename from
5513 do_supported_names. Change all callers.
5514 (Target_selector::do_recognize_by_emulation): New function.
5515 (Target_selector::do_supported_emulations): New function.
5516 (select_target_by_bfd_name): Change name in declaration.
5517 (select_target_by_emulation): Declare.
5518 (supported_emulation_names): Declare.
5519 * parameters.cc (parameters_force_valid_target): Try to find
5520 target based on emulation from -m option.
5521 * options.h (class General_options): Change doc string for -m.
5522 * options.cc (help): Print emulations.
5523 (General_options::parse_V): Likewise.
5524 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
5525 Add emulation parameter. Change all callers.
5526
200b2bb9
ILT
55272011-06-28 Ian Lance Taylor <iant@google.com>
5528
5529 * target.h (class Target): Add osabi_ field.
5530 (Target::osabi): New function.
5531 (Target::set_osabi): New function.
5532 (Target::Target): Initialize osabi_.
5533 (Target::do_adjust_elf_header): Make pure virtual.
5534 (Sized_target::do_adjust_elf_header): Declare.
5535 * target.cc (Sized_target::do_adjust_elf_header): New function.
5536 (class Sized_target): Instantiate all versions.
5537 * freebsd.h (class Target_freebsd): Remove.
5538 (Target_selector_freebsd::do_recognize): Call set_osabi on
5539 Target.
5540 (Target_selector_freebsd::do_recognize_by_name): Likewise.
5541 (Target_selector_freebsd::set_osabi): Remove.
5542 * i386.cc (class Target_i386): Inherit from Sized_target rather
5543 than Target_freebsd.
5544 * x86_64.cc (class Target_x86_64): Likewise.
5545
b3ce541e
ILT
55462011-06-28 Ian Lance Taylor <iant@google.com>
5547
5548 * target.h (Target::can_check_for_function_pointers): Rewrite.
5549 Make non-virtual.
5550 (Target::can_icf_inline_merge_sections): Likewise.
5551 (Target::section_may_have_icf_unsafe_poineters): Likewise.
5552 (Target::Target_info): Add can_icf_inline_merge_sections field.
5553 (Target::do_can_check_for_function_pointers): New virtual
5554 function.
5555 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
5556 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
5557 from can_check_for_function_pointers, move in file.
5558 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
5559 section_may_have_icf_unsafe_poineters, move in file.
5560 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
5561 * i386.cc (Target_i386::do_can_check_for_function_pointers):
5562 Rename from can_check_for_function_pointers, move in file.
5563 (Target_i386::can_icf_inline_merge_sections): Remove.
5564 (Target_i386::i386_info): Initialize
5565 can_icf_inline_merge_sections.
5566 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
5567 Initialize can_icf_inline_merge_sections.
5568 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
5569 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
5570 Rename from can_check_for_function_pointers, move in file.
5571 (Target_x86_64::can_icf_inline_merge_sections): Remove.
5572 (Target_x86_64::x86_64_info): Initialize
5573 can_icf_inline_merge_sections.
5574 * testsuite/testfile.cc (Target_test::test_target_info):
5575 Likewise.
5576 * icf.cc (get_section_contents): Correct formatting.
5577
6d1c4efb
ILT
55782011-06-27 Ian Lance Taylor <iant@google.com>
5579
5580 * symtab.cc (Symbol::versioned_name): New function.
5581 (Symbol_table::add_to_final_symtab): Use versioned_name when
5582 appropriate.
5583 (Symbol_table::sized_write_symbol): Likewise.
5584 * symtab.h (class Symbol): Declare versioned_name.
5585 * stringpool.h (class Stringpool_template): Add variant of add
5586 which takes a std::basic_string.
5587 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
5588 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
5589 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
5590 (ver_test_12.o): New target.
5591 * testsuite/Makefile.in: Rebuild.
5592
57eb9b50
DK
55932011-06-27 Doug Kwan <dougkwan@google.com>
5594
5595 * arm.cc (Arm_relocate_functions::thm_jump8,
5596 Arm_relocate_functions::thm_jump11): Use a wider signed
5597 type to compute offset.
5598 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
5599 arm_thm_jump8.
5600 * testsuite/Makefile.in: Regenerate.
5601 * testsuite/arm_branch_in_range.sh: Check test results of
5602 arm_thm_jump11 and arm_thm_jump8.
5603 * testsuite/arm_thm_jump11.s: New test source file.
5604 * testsuite/arm_thm_jump11.t: New linker script.
5605 * testsuite/arm_thm_jump8.s: New test source file.
5606 * testsuite/arm_thm_jump8.t: New linker script.
5607
487b39df
ILT
56082011-06-24 Ian Lance Taylor <iant@google.com>
5609
5610 * layout.cc: Include "object.h".
5611 (ctors_sections_in_init_array): New static variable.
5612 (Layout::is_ctors_in_init_array): New function.
5613 (Layout::layout): Add entry to ctors_sections_in_init_array if
5614 appropriate.
5615 * layout.h (class Layout): Declare is_ctors_in_init_array.
5616 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
5617 is_ctors_reverse_view is set.
5618 (Sized_relobj_file::write_sections): Add layout parameter. Change
5619 all callers. Set is_ctors_reverse_view field of View_size.
5620 (Sized_relobj_file::reverse_words): New function.
5621 * object.h (Sized_relobj_file::View_size): Add
5622 is_ctors_reverse_view field.
5623 (class Sized_relobj_file): Update declarations.
5624 * testsuite/initpri3.c: New test.
5625 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
5626 initpri3b.
5627 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
5628 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
5629 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
5630 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
5631 * testsuite/Makefile.in: Rebuild.
5632
472076e4
CC
56332011-06-24 Cary Coutant <ccoutant@google.com>
5634
5635 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
5636 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
5637 (debug_msg_cdebug.err): New targets.
5638 * testsuite/Makefile.in: Regenerate.
5639 * testsuite/debug_msg.sh: Check output of link with compressed debug.
5640 Fix checks for link with shared library.
5641
a60af0db
DK
56422011-06-24 Doug Kwan <dougkwan@google.com>
5643
5644 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
5645 skip empty text sections.
5646 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
5647
5393d741
ILT
56482011-06-22 Ian Lance Taylor <iant@google.com>
5649
5650 PR gold/12910
5651 * options.h (class General_options): Add --ctors-in-init-array.
5652 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
5653 friends as SHT_PROGBITS for merging sections.
5654 (Layout::layout): Remove special handling of .init_array and
5655 friends. Don't sort if doing relocatable link. Sort for .ctors
5656 and .dtors if ctors_in_init_array.
5657 (Layout::make_output_section): Force correct section types for
5658 .init_array and friends. Don't sort if doing relocatable link,
5659 Don't sort .ctors and .dtors if ctors_in_init_array.
5660 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
5661 (Layout::output_section_name): Add relobj parameter. Change all
5662 callers. Handle .ctors. and .dtors. in code rather than table.
5663 Handle .ctors and .dtors if ctors_in_init_array.
5664 (Layout::match_file_name): New function, moved from output.cc.
5665 * layout.h (class Layout): Update declarations.
5666 * output.cc: Include "layout.h".
5667 (Input_section_sort_entry::get_priority): New function.
5668 (Input_section_sort_entry::match_file_name): Just call
5669 Layout::match_file_name.
5670 (Output_section::Input_section_sort_init_fini_compare::operator()):
5671 Handle .ctors and .dtors. Sort by explicit priority rather than
5672 by name.
5673 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
5674 * testsuite/initpri2.c: New test.
5675 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
5676 (check_PROGRAMS): Add initpri2.
5677 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
5678 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
5679 * configure, testsuite/Makefile.in: Rebuild.
5680
e1f74f98
ILT
56812011-06-19 Ian Lance Taylor <iant@google.com>
5682
5683 PR gold/12880
5684 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
5685 .interp section to a PT_INTERP segment even if we have seen a
5686 --dynamic-linker option. Don't do it if we have seen a PHDRS
5687 clause in a linker script.
5688 (Layout::finalize): Don't create a .interp section if we've
5689 already create a PT_INTERP segment.
5690 (Layout::create_interp): Always call choose_output_section (revert
5691 patch of 2011-06-17). Don't create PT_INTERP segment.
5692 * script-sections.cc
5693 (Script_sections::create_note_and_tls_segments): Add a .interp
5694 section to a PT_INTERP segment even if we have seen a
5695 --dynamic-linker option.
5696
766f91bb
ILT
56972011-06-18 Ian Lance Taylor <iant@google.com>
5698
5699 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
5700 merely because a non-PT_LOAD segment has a dynamic reloc.
5701
0d212c3a
ILT
57022011-06-18 Ian Lance Taylor <iant@google.com>
5703
5704 * layout.cc (Layout::finish_dynamic_section): Don't create
5705 DT_FLAGS entry if not needed.
5706
911a5072
ILT
57072011-06-18 Ian Lance Taylor <iant@google.com>
5708
5709 PR gold/12745
5710 * layout.cc (Layout::layout_eh_frame): Correct handling of
5711 writable .eh_frame section.
5712
534b4e5f
ILT
57132011-06-17 Ian Lance Taylor <iant@google.com>
5714
5715 PR gold/12893
5716 * resolve.cc (Symbol_table::resolve): Don't give an error if a
5717 symbol is redefined with the exact same object and value.
5718
10b4f102
ILT
57192011-06-17 Ian Lance Taylor <iant@google.com>
5720
5721 PR gold/12880
5722 * layout.h (class Layout): Add interp_segment_ field.
5723 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
5724 (Layout::attach_allocated_section_to_segment): If making shared
5725 library, put .interp section in PT_INTERP segment.
5726 (Layout::finalize): Also call create_interp if -dynamic-linker
5727 option was used.
5728 (Layout::create_interp): Assert that there is no PT_INTERP
5729 segment. If not using a SECTIONS clause, use make_output_section.
5730 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
5731 * script-sections.cc
5732 (Script_sections::create_note_and_tls_segments): If making shared
5733 library, put .interp section in PT_INTERP segment.
5734
a29b0dad
ILT
57352011-06-17 Ian Lance Taylor <iant@google.com>
5736
e588ea8d
ILT
5737 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
5738 when making a shared library.
5739
57402011-06-17 Ian Lance Taylor <iant@google.com>
5741
5742 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
5743 parameter. Change all callers. Don't issue warning about PC32
5744 against locally defined symbol.
a29b0dad 5745
9d3b0698
ILT
57462011-06-16 Ian Lance Taylor <iant@google.com>
5747
5748 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
5749 occurs in same object.
5750
85b0f90c
AM
57512011-06-14 Alan Modra <amodra@gmail.com>
5752
5753 * po/POTFILES.in: Regenerate.
5754
a94907d9
ILT
57552011-06-09 Ian Lance Taylor <iant@google.com>
5756
5757 * script-sections.cc
5758 (Orphan_output_section::set_section_addresses): For a relocatable
5759 link set address to 0.
5760
4fb3a1c3
CC
57612011-06-09 Cary Coutant <ccoutant@google.com>
5762
5763 PR gold/12804
5764 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
5765 used with --compress-debug-sections.
5766 * gold/object.cc (Sized_relobj_file::do_layout): Report
5767 uncompressed size of compressed input sections.
5768
61220854
CC
57692011-06-08 Cary Coutant <ccoutant@google.com>
5770
5771 PR gold/12804
5772 * testsuite/two_file_test_2_v1.cc: Change initialization of
5773 v2 to keep it in .data.
5774
e6455dfb
CC
57752011-06-07 Cary Coutant <ccoutant@google.com>
5776
5777 * common.cc (Symbol_table::do_allocate_commons_list): Call
5778 gold_fallback.
5779 * errors.cc (Errors::fatal): Adjust call to gold_exit.
5780 (Errors::fallback): New function.
5781 (gold_fallback): New function.
5782 * errors.h (Errors::fallback): New function.
5783 * gold.cc (gold_exit): Change status parameter to enum; adjust
5784 all callers.
5785 (queue_initial_tasks): Call gold_fallback.
5786 * gold.h: Include cstdlib.
5787 (Exit_status): New enum type.
5788 (gold_exit): Change status parameter to enum.
5789 (gold_fallback): New function.
5790 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
5791 (Layout::create_symtab_sections): Likewise.
5792 (Layout::create_shdrs): Likewise.
5793 * main.cc (main): Adjust call to gold_exit.
5794 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
5795 (Output_data_got::add_got_entry_pair): Likewise.
5796 (Output_section::add_input_section): Likewise.
5797 (Output_section::add_output_section_data): Likewise.
5798 (Output_segment::set_section_list_addresses): Likewise.
5799 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
5800
fb0e076f
CC
58012011-06-07 Cary Coutant <ccoutant@google.com>
5802
5803 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
5804 for incremental links.
5805 * output.cc (Output_segment::set_section_list_addresses): Remove
5806 FIXME and test for TLS or BSS.
5807
a5ee4d5d
CC
58082011-06-07 Cary Coutant <ccoutant@google.com>
5809
5810 * testsuite/Makefile.am: Add incremental_copy_test,
5811 incremental_common_test_1.
5812 * testsuite/Makefile.in: Regenerate.
5813 * testsuite/common_test_1_v1.c: New source file.
5814 * testsuite/common_test_1_v2.c: New source file.
5815 * testsuite/copy_test_v1.cc: New source file.
5816
5146f448
CC
58172011-06-07 Cary Coutant <ccoutant@google.com>
5818
5819 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
5820 update, allocate common from bss section's free list.
5821 * incremental-dump.cc (dump_incremental_inputs): Print flag for
5822 linker-defined symbols.
5823 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
5824 Skip GOT and PLT entries that are no longer referenced.
5825 (Output_section_incremental_inputs::write_info_blocks): Mark
5826 linker-defined symbols.
5827 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
5828 * output.cc (Output_section::allocate): New function.
5829 * output.h (Output_section::allocate): New function.
5830 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
5831 linker-defined symbols.
5832 (Symbol::override_base_with_special): Copy is_predefined_ flag.
5833 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
5834 (Symbol::init_base_output_data): Likewise.
5835 (Symbol::init_base_output_segment): Likewise.
5836 (Symbol::init_base_constant): Likewise.
5837 (Sized_symbol::init_output_data): Likewise.
5838 (Sized_symbol::init_output_segment): Likewise.
5839 (Sized_symbol::init_constant): Likewise.
5840 (Symbol_table::do_define_in_output_data): Likewise.
5841 (Symbol_table::do_define_in_output_segment): Likewise.
5842 (Symbol_table::do_define_as_constant): Likewise.
5843 * symtab.h (Symbol::is_predefined): New function.
5844 (Symbol::init_base_output_data): Add is_predefined parameter.
5845 (Symbol::init_base_output_segment): Likewise.
5846 (Symbol::init_base_constant): Likewise.
5847 (Symbol::is_predefined_): New data member.
5848 (Sized_symbol::init_output_data): Add is_predefined parameter.
5849 (Sized_symbol::init_output_segment): Likewise.
5850 (Sized_symbol::init_constant): Likewise.
5851 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
5852
26d3c67d
CC
58532011-06-07 Cary Coutant <ccoutant@google.com>
5854
5855 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
5856 instead of emit_copy_reloc.
5857 (Copy_relocs::emit_copy_reloc): Refactor.
5858 (Copy_relocs::make_copy_reloc): New function.
5859 (Copy_relocs::add_copy_reloc): Remove.
5860 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
5861 section.
5862 (Copy_relocs::make_copy_reloc): New function.
5863 (Copy_relocs::add_copy_reloc): Remove.
5864 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
5865 unchanged input files.
5866 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
5867 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
5868 Reserve BSS space for COPY relocations.
5869 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5870 (Output_section_incremental_inputs::write_info_blocks): Record
5871 whether a symbol is copied from a shared object.
5872 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
5873 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
5874 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
5875 (Incremental_input_entry_reader::get_output_symbol_index): Add
5876 is_copy parameter.
5877 (Incremental_binary::emit_copy_relocs): New function.
5878 (Incremental_binary::do_emit_copy_relocs): New function.
5879 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5880 new data member.
5881 (Sized_incremental_binary::add_copy_reloc): New function.
5882 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5883 (Sized_incremental_binary::Copy_reloc): New struct.
5884 (Sized_incremental_binary::Copy_relocs): New typedef.
5885 (Sized_incremental_binary::copy_relocs_): New data member.
5886 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
5887 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
5888 * target.h (Sized_target::emit_copy_reloc): New function.
5889 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
5890
7cdb37d9
CC
58912011-06-02 Cary Coutant <ccoutant@google.com>
5892
5893 PR gold/12163
5894 * gold/archive.cc (Archive::Archive): Initialize new data member.
5895 (Archive::include_all_members): Return if archive has already been
5896 included.
5897 * gold/archive.h (Archive::include_all_members_): New data member.
5898
cc643b88
NC
58992011-06-02 Nick Clifton <nickc@redhat.com>
5900
5901 * dynobj.h: Fix spelling mistake in comment.
5902 * output.cc: Likewise.
5903
f62a3ca7 59042011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 5905 Asier Llano
f62a3ca7
DK
5906
5907 PR gold/12826
cc643b88 5908 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
5909 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
5910 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
5911 redundant arm_exidx_test.so.
5912 * testsuite/Makefile.in: Regenerate.
5913 (check_SCRIPTS): Add pr12826.sh
5914 (check_DATA): Add pr12826.stdout
5915 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
5916 * testsuite/pr12826.sh: New file.
5917 * testsuite/pr12826_1.s: Ditto.
5918 * testsuite/pr12826_1.s: Ditto.
5919
8dbe1edc
ILT
59202011-05-30 Ian Lance Taylor <iant@google.com>
5921
5922 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
5923 sections.
5924
c49875be
ILT
59252011-05-29 Ian Lance Taylor <iant@google.com>
5926
5927 PR gold/12804
5928 * testsuite/Makefile.am: Use different file name for two_file_test
5929 temporary file for each incremental test.
5930 * testsuite/Makefile.in: Rebuild.
5931
69d53f7a
ILT
59322011-05-29 Ian Lance Taylor <iant@google.com>
5933
5934 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
5935 binary input file is empty.
5936
41d0ab5f
ILT
59372011-05-27 Ian Lance Taylor <iant@google.com>
5938
5939 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
5940 (ver_test_9.so): Likewise.
5941 * testsuite/Makefile.in: Rebuild.
5942
89d8a36b
CC
59432011-05-26 Cary Coutant <ccoutant@google.com>
5944
5945 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
5946 * incremental.cc (Incremental_inputs::report_input_section): Fix
5947 comment, indentation.
5948 (Incremental_inputs::report_comdat_group): New function.
5949 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5950 of data for incremental input file entry.
5951 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
5952 group count, COMDAT group signatures.
5953 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
5954 an unchanged input file.
5955 * incremental.h (Incremental_object_entry::Incremental_object_entry):
5956 Initialize new data member.
5957 (Incremental_object_entry::add_comdat_group): New function.
5958 (Incremental_object_entry::get_comdat_group_count): New function.
5959 (Incremental_object_entry::get_comdat_signature_key): New function.
5960 (Incremental_object_entry::groups_): New data member.
5961 (Incremental_inputs::report_comdat_group): New function.
5962 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
5963 data for incremental input file entry.
5964 (Incremental_input_entry_reader::get_comdat_group_count): New function.
5965 (Incremental_input_entry_reader::get_input_section): Adjust size of
5966 data for incremental input file entry.
5967 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
5968 (Incremental_input_entry_reader::get_comdat_group_signature): New
5969 function.
5970 * object.cc (Sized_relobj::include_section_group): Report kept
5971 COMDAT groups for incremental links.
5972
1706a06f
ILT
59732011-05-24 David Meyer <pdox@google.com>
5974
5975 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
5976 with name parameter. Add found_name parameter.
5977 * fileread.cc (Input_file::find_file): Adjust code accordingly.
5978 * dirsearch.h (class Dirsearch): Update declaration.
5979
a10ae760
ILT
59802011-05-24 Ian Lance Taylor <iant@google.com>
5981
5982 * archive.cc (Library_base::should_include_member): Pull in object
5983 from archive if it defines the entry symbol.
5984 * parameters.cc (Parameters::entry): New function.
5985 * parameters.h (class Parameters): Declare entry.
5986 * output.h (class Output_file_header): Remove entry_ field.
5987 * output.cc (Output_file_header::Output_file_header): Remove entry
5988 parameter. Change all callers.
5989 (Output_file_header::entry): Use parameters->entry.
5990 * gold.cc (queue_middle_tasks): Likewise.
5991 * plugin.cc (Plugin_hook::run): Likewise.
5992
aa92d6ed
CC
59932011-05-24 Cary Coutant <ccoutant@google.com>
5994
5995 * gold.cc (queue_initial_tasks): Pass incremental base filename
5996 to Output_file::open_base_file; don't print error message.
5997 * incremental-dump.cc (main): Adjust call to
5998 Output_file::open_for_modification.
5999 * incremental-dump.cc (main): Likewise.
6000 * incremental.cc (Incremental_inputs::report_command_line):
6001 Ignore --incremental-base option when comparing command lines.
6002 Ignore parameter when given as separate argument.
6003 * options.h (class General_options): Add --incremental-base.
6004 * output.cc (Output_file::Output_file):
6005 (Output_file::open_base_file): Add base_name and writable parameters;
6006 read base file into new file; print error message here.
6007 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6008 callers.
6009 * output.h (Output_file::open_for_modification): Rename to...
6010 (Output_file::open_base_file): ...this; add base_name and
6011 writable parameters; adjust all callers.
6012 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6013 callers.
6014 * testsuite/Makefile.am (incremental_test_4): Test
6015 --incremental-base.
6016 * testsuite/Makefile.in: Regenerate.
6017
2eedd706
CC
60182011-05-24 Cary Coutant <ccoutant@google.com>
6019
6020 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
6021 incremental_test_4.
6022 * testsuite/Makefile.in: Regenerate.
6023 * testsuite/two_file_test_1_v1.cc: New test source file.
6024 * testsuite/two_file_test_1b_v1.cc: New test source file.
6025 * testsuite/two_file_test_2_v1.cc: New test source file.
6026
0f1c85a6
CC
60272011-05-24 Cary Coutant <ccoutant@google.com>
6028
6029 * dynobj.h (Dynobj::do_dynobj): New function.
6030 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
6031 flag and soname for shared objects.
6032 * incremental.cc (Incremental_inputs::report_object): Make
6033 either Incremental_object_entry or Incremental_dynobj_entry; add
6034 soname to string table.
6035 (Incremental_inputs::report_input_section): Add assertion.
6036 (Output_section_incremental_inputs::set_final_data_size): Adjust
6037 type of input file entry for shared libraries; adjust size of
6038 shared library info entry.
6039 (Output_section_incremental_inputs::write_input_files): Write
6040 as_needed flag for shared libraries.
6041 (Output_section_incremental_inputs::write_info_blocks): Adjust type
6042 of input file entry for shared libraries; write soname.
6043 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
6044 soname from incremental info.
6045 * incremental.h (enum Incremental_input_flags): Add
6046 INCREMENTAL_INPUT_AS_NEEDED.
6047 (Incremental_input_entry::Incremental_input_entry): Initialize new
6048 data member.
6049 (Incremental_input_entry::set_as_needed): New function.
6050 (Incremental_input_entry::as_needed): New function.
6051 (Incremental_input_entry::do_dynobj_entry): New function.
6052 (Incremental_input_entry::as_needed_): New data member.
6053 (Incremental_object_entry::Incremental_object_entry): Don't check
6054 for shared library.
6055 (Incremental_object_entry::do_type): Likewise.
6056 (class Incremental_dynobj_entry): New class.
6057 (Incremental_input_entry_reader::as_needed): New function.
6058 (Incremental_input_entry_reader::get_soname): New function.
6059 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
6060 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
6061 size of shared library info entry.
58797674 6062 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
6063 incremental link when adding DT_NEEDED entries.
6064 * object.h (Object::Object): Initialize new data member.
6065 (Object::dynobj): New function.
6066 (Object::set_as_needed): New function.
6067 (Object::as_needed): New function.
6068 (Object::do_dynobj): New function.
6069 (Object::as_needed_): New data member.
6070
6fa2a40b
CC
60712011-05-24 Cary Coutant <ccoutant@google.com>
6072
6073 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
6074 info; adjust display of GOT entries.
6075 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6076 vector of input objects; remove file_status_.
6077 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
6078 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
6079 got_plt reader; call target hooks to reserve GOT entries.
6080 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6081 of input file info header and GOT info entry.
6082 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
6083 relocation info.
6084 (Got_plt_view_info::got_descriptor): Remove.
6085 (Got_plt_view_info::sym_index): New data member.
6086 (Got_plt_view_info::input_index): New data member.
6087 (Local_got_offset_visitor::visit): Write input file index.
6088 (Global_got_offset_visitor::visit): Write 0 for input file index.
6089 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
6090 with sym_index and input_index.
6091 (Output_section_incremental_inputs::write_got_plt): Adjust size of
6092 incremental info GOT entry; replace got_descriptor with input_index.
6093 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
6094 map from input file index to object.
6095 (Sized_relobj_incr::do_layout): Replace direct data member reference
6096 with accessor function.
6097 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
6098 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
6099 Adjust size of input file info header.
6100 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
6101 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
6102 (Incremental_input_entry_reader::get_input_section): Adjust size of
6103 input file info header.
6104 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
6105 of incremental info GOT entry.
6106 (Incremental_got_plt_reader::get_got_desc): Remove.
6107 (Incremental_got_plt_reader::get_got_symndx): New function.
6108 (Incremental_got_plt_reader::get_got_input_index): New function.
6109 (Sized_incremental_binary::Sized_incremental_binary): Remove
6110 file_status_; add input_objects_.
6111 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
6112 (Sized_incremental_binary::set_file_is_unchanged): Remove.
6113 (Sized_incremental_binary::file_is_unchanged): Remove.
6114 (Sized_incremental_binary::set_input_object): New function.
6115 (Sized_incremental_binary::input_object): New function.
6116 (Sized_incremental_binary::file_status_): Remove.
6117 (Sized_incremental_binary::input_objects_): New data member.
6118 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
6119 references.
6120 (Sized_relobj_incr::invalid_address): Move to base class.
6121 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
6122 class.
6123 (Sized_relobj_incr::do_output_section_offset): Likewise.
6124 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
6125 (Sized_relobj_incr::section_offsets_): Likewise.
6126 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
6127 function.
6128 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
6129 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
6130 with accessor function.
6131 (Sized_relobj_file::do_layout): Likewise.
6132 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
6133 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
6134 (Sized_relobj_file::compute_final_local_value): Replace refs to
6135 section_offsets_ with accessor function.
6136 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
6137 * object.h (Relobj::Relobj): Initialize new data members.
6138 (Relobj::add_dyn_reloc): New function.
6139 (Relobj::first_dyn_reloc): New function.
6140 (Relobj::dyn_reloc_count): New function.
6141 (Relobj::first_dyn_reloc_): New data member.
6142 (Relobj::dyn_reloc_count_): New data member.
6143 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
6144 references.
6145 (Sized_relobj::Address): New typedef.
6146 (Sized_relobj::invalid_address): Move here from child class.
6147 (Sized_relobj::Sized_relobj): Initialize new data members.
6148 (Sized_relobj::sized_relobj): New function.
6149 (Sized_relobj::is_output_section_offset_invalid): Move here from
6150 child class.
6151 (Sized_relobj::get_output_section_offset): Likewise.
6152 (Sized_relobj::local_has_got_offset): Likewise.
6153 (Sized_relobj::local_got_offset): Likewise.
6154 (Sized_relobj::set_local_got_offset): Likewise.
6155 (Sized_relobj::do_for_all_local_got_entries): Likewise.
6156 (Sized_relobj::clear_got_offsets): New function.
6157 (Sized_relobj::section_offsets): Move here from child class.
6158 (Sized_relobj::do_output_section_offset): Likewise.
6159 (Sized_relobj::do_set_section_offset): Likewise.
6160 (Sized_relobj::Local_got_offsets): Likewise.
6161 (Sized_relobj::local_got_offsets_): Likewise.
6162 (Sized_relobj::section_offsets_): Likewise.
6163 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
6164 references.
6165 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
6166 class.
6167 (Sized_relobj_file::sized_relobj): New function
6168 (Sized_relobj_file::local_has_got_offset): Move to base class.
6169 (Sized_relobj_file::local_got_offset): Likewise.
6170 (Sized_relobj_file::set_local_got_offset): Likewise.
6171 (Sized_relobj_file::get_output_section_offset): Likewise.
6172 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
6173 (Sized_relobj_file::do_output_section_offset): Likewise.
6174 (Sized_relobj_file::do_set_section_offset): Likewise.
6175 (Sized_relobj_file::Local_got_offsets): Likewise.
6176 (Sized_relobj_file::local_got_offsets_): Likewise.
6177 (Sized_relobj_file::section_offsets_): Likewise.
6178 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
6179 (all constructors).
6180 (set_needs_dynsym_index): Convert relobj to derived class pointer.
6181 (Output_reloc::get_symbol_index): Likewise.
6182 (Output_reloc::local_section_offset): Likewise.
6183 (Output_reloc::get_address): Likewise.
6184 (Output_reloc::symbol_value): Likewise.
6185 (Output_data_got::reserve_slot): Move to class definition.
6186 (Output_data_got::reserve_local): New function.
6187 (Output_data_got::reserve_slot_for_global): Remove.
6188 (Output_data_got::reserve_global): New function.
6189 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
6190 (all constructors, two instantiations).
6191 (Output_reloc::get_relobj): New function (two instantiations).
6192 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
6193 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
6194 (Output_data_reloc::add_global): Adjust type of relobj.
6195 (Output_data_reloc::add_global_relative): Likewise.
6196 (Output_data_reloc::add_symbolless_global_addend): Likewise.
6197 (Output_data_reloc::add_local): Likewise.
6198 (Output_data_reloc::add_local_relative): Likewise.
6199 (Output_data_reloc::add_symbolless_local_addend): Likewise.
6200 (Output_data_reloc::add_local_section): Likewise.
6201 (Output_data_reloc::add_output_section): Likewise.
6202 (Output_data_reloc::add_absolute): Likewise.
6203 (Output_data_reloc::add_target_specific): Likewise.
6204 (Output_data_got::reserve_slot): Move definition here.
6205 (Output_data_got::reserve_local): New function.
6206 (Output_data_got::reserve_global): New function.
6207 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
6208 section_offsets_ with accessor function.
6209 (Sized_relobj_file::write_sections): Likewise.
6210 (Sized_relobj_file::do_relocate_sections): Likewise.
6211 * target.h (Sized_target::reserve_local_got_entry): New function.
6212 (Sized_target::reserve_global_got_entry): New function.
6213 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
6214 (Target_x86_64::reserve_global_got_entry): New function.
6215 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
6216
4829d394
CC
62172011-05-23 Cary Coutant <ccoutant@google.com>
6218
6219 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
6220 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
6221 bit when checking got_type.
6222 * incremental.cc (Sized_incremental_binary::setup_readers):
6223 Store symbol table and string table locations; initialize bit vector
6224 of file status flags.
6225 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
6226 unchanged files.
6227 (Sized_incremental_binary::do_process_got_plt): New function.
6228 (Sized_incremental_binary::get_symtab_view): Use stored locations.
6229 (Output_section_incremental_inputs::set_final_data_size): Record
6230 file index for each input file.
6231 (Output_section_incremental_inputs::write_got_plt): Store file index
6232 instead of input entry offset for each GOT entry.
6233 * incremental.h
6234 (Incremental_input_entry::Incremental_input_entry): Initialize new
6235 data member.
6236 (Incremental_input_entry::set_offset): Store file index.
6237 (Incremental_input_entry::get_file_index): New function.
6238 (Incremental_input_entry::file_index_): New data member.
6239 (Incremental_binary::process_got_plt): New function.
6240 (Incremental_binary::do_process_got_plt): New function.
6241 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6242 data members.
6243 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
6244 (Sized_incremental_binary::set_file_is_unchanged): New function.
6245 (Sized_incremental_binary::file_is_unchanged): New function.
6246 (Sized_incremental_binary::do_process_got_plt): New function.
6247 (Sized_incremental_binary::file_status_): New data member.
6248 (Sized_incremental_binary::main_symtab_loc_): New data member.
6249 (Sized_incremental_binary::main_strtab_loc_): New data member.
6250 * output.cc (Output_data_got::Got_entry::write): Add case
6251 RESERVED_CODE.
6252 (Output_data_got::add_global): Call add_got_entry.
6253 (Output_data_got::add_global_plt): Likewise.
6254 (Output_data_got::add_global_with_rel): Likewise.
6255 (Output_data_got::add_global_with_rela): Likewise.
6256 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
6257 (Output_data_got::add_global_pair_with_rela): Likewise.
6258 (Output_data_got::add_local): Call add_got_entry.
6259 (Output_data_got::add_local_plt): Likewise.
6260 (Output_data_got::add_local_with_rel): Likewise.
6261 (Output_data_got::add_local_with_rela): Likewise.
6262 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
6263 (Output_data_got::add_local_pair_with_rela): Likewise.
6264 (Output_data_got::reserve_slot): New function.
6265 (Output_data_got::reserve_slot_for_global): New function.
6266 (Output_data_got::add_got_entry): New function.
6267 (Output_data_got::add_got_entry_pair): New function.
6268 (Output_section::add_output_section_data): Edit FIXME.
6269 * output.h
6270 (Output_section_data_build::Output_section_data_build): New
6271 constructor with size parameter.
6272 (Output_data_space::Output_data_space): Likewise.
6273 (Output_data_got::Output_data_got): Initialize new data member; new
6274 constructor with size parameter.
6275 (Output_data_got::add_constant): Call add_got_entry.
6276 (Output_data_got::reserve_slot): New function.
6277 (Output_data_got::reserve_slot_for_global): New function.
6278 (class Output_data_got::Got_entry): Add RESERVED_CODE.
6279 (Output_data_got::add_got_entry): New function.
6280 (Output_data_got::add_got_entry_pair): New function.
6281 (Output_data_got::free_list_): New data member.
6282 * target.h (Sized_target::init_got_plt_for_update): New function.
6283 (Sized_target::register_global_plt_entry): New function.
6284 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
6285 Initialize new data member; call init; add constructor with PLT count.
6286 (Output_data_plt_x86_64::init): New function.
6287 (Output_data_plt_x86_64::add_relocation): New function.
6288 (Output_data_plt_x86_64::reserve_slot): New function.
6289 (Output_data_plt_x86_64::free_list_): New data member.
6290 (Target_x86_64::init_got_plt_for_update): New function.
6291 (Target_x86_64::register_global_plt_entry): New function.
6292 (Output_data_plt_x86_64::add_entry): Allocate from free list for
6293 incremental updates.
6294 (Output_data_plt_x86_64::add_relocation): New function.
6295 * testsuite/object_unittest.cc (Object_test): Set default options.
6296
ec69d6da
ILT
62972011-05-16 Ian Lance Taylor <iant@google.com>
6298
6299 * options.h (class General_options): Make -i a synonym for -r.
6300
732e31de
ILT
63012011-05-16 Ian Lance Taylor <iant@google.com>
6302
6303 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
6304
403676b5
CC
63052011-05-10 Cary Coutant <ccoutant@google.com>
6306
6307 * object.cc (Sized_relobj::do_count_local_symbols): Check for
6308 strip_all (-s).
6309
5b7b7d6e
ILT
63102011-05-06 Ian Lance Taylor <iant@google.com>
6311
6312 * layout.cc (Layout::layout): If the output section flags change,
6313 update the ordering.
6314
f0f9babf
CC
63152011-04-25 Cary Coutant <ccoutant@google.com>
6316
6317 * incremental-dump.cc (dump_incremental_inputs): Print local
6318 symbol info for each input file.
6319 * incremental.cc
6320 (Output_section_incremental_inputs::set_final_data_size): Add local
6321 symbol info to input file entries in incremental info.
6322 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6323 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
6324 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
6325 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
6326 implementation.
6327 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
6328 (Sized_incr_relobj::do_relocate): Write the local symbols.
6329 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
6330 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
6331 Adjust size of input file header.
6332 (Incremental_inputs_reader::get_local_symbol_offset): New function.
6333 (Incremental_inputs_reader::get_local_symbol_count): New function.
6334 (Incremental_inputs_reader::get_input_section): Adjust size of input
6335 file header.
6336 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
6337 (Sized_incr_relobj::This): New typedef.
6338 (Sized_incr_relobj::sym_size): New const data member.
6339 (Sized_incr_relobj::Local_symbol): New struct.
6340 (Sized_incr_relobj::do_output_local_symbol_count): New function.
6341 (Sized_incr_relobj::do_local_symbol_offset): New function.
6342 (Sized_incr_relobj::local_symbol_count_): New data member.
6343 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
6344 (Sized_incr_relobj::local_symbol_index_): New data member.
6345 (Sized_incr_relobj::local_symbol_offset_): New data member.
6346 (Sized_incr_relobj::local_dynsym_offset_): New data member.
6347 (Sized_incr_relobj::local_symbols_): New data member.
6348 * object.h (Relobj::output_local_symbol_count): New function.
6349 (Relobj::local_symbol_offset): New function.
6350 (Relobj::do_output_local_symbol_count): New function.
6351 (Relobj::do_local_symbol_offset): New function.
6352 (Sized_relobj::do_output_local_symbol_count): New function.
6353 (Sized_relobj::do_local_symbol_offset): New function.
6354
d0a9ace3
ILT
63552011-04-22 Vladimir Simonov <sv@sw.ru>
6356
6357 * descriptors.cc (set_close_on_exec): New function.
6358 (Descriptors::open): Use set_close_on_exec.
6359 * output.cc (S_ISLNK): Define if not defined.
6360
94a3fc8b
CC
63612011-04-22 Cary Coutant <ccoutant@google.com>
6362
6363 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6364 global symbol map.
6365 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6366 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
6367 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
6368 relocations.
6369 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
6370 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
6371 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
6372 * incremental.h
6373 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
6374 function.
6375 (Incremental_binary::apply_incremental_relocs): New function.
6376 (Incremental_binary::do_apply_incremental_relocs): New function.
6377 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6378 data member.
6379 (Sized_incremental_binary::add_global_symbol): New function.
6380 (Sized_incremental_binary::global_symbol): New function.
6381 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6382 (Sized_incremental_binary::symbol_map_): New data member.
6383 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
6384 * target.h (Sized_target::apply_relocation): New function.
6385 * target-reloc.h (apply_relocation): New function.
6386 * x86_64.cc (Target_x86_64::apply_relocation): New function.
6387
c87e4302
DK
63882011-04-22 Doug Kwan <dougkwan@google.com>
6389
6390 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
6391 flag of a SHT_ARM_EXIDX section.
2e702c99 6392 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
6393 * testsuite/Makefile.in: Regenerate.
6394 * testsuite/arm_exidx_test.s: New file.
6395 * testsuite/arm_exidx_test.sh: Same.
6396
e7782cf6
CC
63972011-04-20 Cary Coutant <ccoutant@google.com>
6398
6399 PR gold/12689
6400 * archive.h (Incremental_archive_entry::Archive_member):
6401 Initialize arg_serial_ (second constructor).
6402
308ecdc7
ILT
64032011-04-17 Ian Lance Taylor <iant@google.com>
6404
6405 * object.cc (Relocate_info::location): Simplify location string.
6406 * errors.cc (Errors::error_at_location): Don't print program
6407 name.
6408 (Errors::warning_at_location): Likewise.
6409 (Errors::undefined_symbol): Likewise.
6410 * testsuite/debug_msg.sh: Update accordingly.
6411
bec5b579
CC
64122011-04-14 Cary Coutant <ccoutant@google.com>
6413
6414 * gold/layout.cc (Layout::symtab_section_offset): New function.
6415 * gold/layout.h (Layout::symtab_section_offset): New function.
6416 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
6417
88597d34
ILT
64182011-04-12 Ian Lance Taylor <iant@google.com>
6419
6420 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
6421 with MREMAP_MAYMOVE.
6422 * output.h (class Output_file): Add map_is_allocated_ field.
6423 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
6424 not available, provide stubs. If mremap is not available, #define
6425 it to gold_mremap.
6426 (MREMAP_MAYMOVE): Define if not defined.
6427 (Output_file::Output_file): Initialize map_is_allocated_.
6428 (Output_file::resize): Check map_is_allocated_.
6429 (Output_file::map_anonymous): If mmap fails, use malloc.
6430 (Output_file::unmap): Don't do anything for an anonymous map.
6431 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
6432 is not available, provide stubs.
6433 (File_read::View::~View): Use free rather than delete[].
6434 (File_read::make_view): Use malloc rather than new[]. If mmap
6435 fails, use malloc.
6436 (File_read::find_or_make_view): Use malloc rather than new[].
6437 * gold.h: Remove HAVE_REMAP code.
6438 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
6439 exists. Rename mremap to gold_mremap. If mmap is not available
6440 don't do anything.
6441 * configure, config.in: Rebuild.
6442
11e361bc
ILT
64432011-04-11 Ian Lance Taylor <iant@google.com>
6444
6445 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
6446 initialize local variable v.
6447
cdc29364
CC
64482011-04-11 Cary Coutant <ccoutant@google.com>
6449
6450 * archive.cc (Archive::include_member): Adjust call to
6451 report_object.
6452 (Add_archive_symbols::run): Track argument serial numbers.
6453 (Lib_group::include_member): Likewise.
6454 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
6455 * archive.h (Incremental_archive_entry::Archive_member):
6456 Initialize arg_serial_.
6457 (Archive_member::arg_serial_): New data member.
6458 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
6459 (Sized_dynobj::do_add_symbols): Track symbols when doing an
6460 incremental link.
6461 (Sized_dynobj::do_for_all_local_got_entries): New function.
6462 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
6463 function.
6464 * fileread.cc (get_mtime): New function.
6465 * fileread.h (get_mtime): New function.
6466 * gold.cc (queue_initial_tasks): Check for incremental update.
6467 (process_incremental_input): New function.
6468 (queue_middle_tasks): Don't force valid target for incremental
6469 update.
6470 * incremental-dump.cc (find_input_containing_global): Adjust
6471 size of symbol info entry.
6472 (dump_incremental_inputs): Dump argument serial number and
6473 in_system_directory flag; bias shndx by 1; print symbol names
6474 when dumping per-file symbol lists; use new symbol info readers.
6475 * incremental.cc
6476 (Output_section_incremental_inputs:update_data_size): New function.
6477 (Sized_incremental_binary::setup_readers): Setup input readers
6478 for each input file; build maps for files added from libraries
6479 and scripts.
6480 (Sized_incremental_binary::check_input_args): New function.
6481 (Sized_incremental_binary::do_check_inputs): Build map of argument
6482 serial numbers to input arguments.
6483 (Sized_incremental_binary::do_file_has_changed): Rename
6484 do_file_is_unchanged to this; compare file modification times.
6485 (Sized_incremental_binary::do_init_layout): New function.
6486 (Sized_incremental_binary::do_reserve_layout): New function.
6487 (Sized_incremental_binary::do_get_input_reader): Remove.
6488 (Sized_incremental_binary::get_symtab_view): New function.
6489 (Incremental_checker::can_incrementally_link_output_file): Remove.
6490 (Incremental_inputs::report_command_line): Exclude --debug options.
6491 (Incremental_inputs::report_archive_begin): Add parameter; track
6492 argument serial numbers; don't put input file entry for archive
6493 before archive members.
6494 (Incremental_inputs::report_archive_end): Put input file entry
6495 for archive after archive members.
6496 (Incremental_inputs::report_object): Add parameter; track argument
6497 serial numbers and in_system_directory flag.
6498 (Incremental_inputs::report_script): Add parameter; track argument
6499 serial numbers.
6500 (Output_section_incremental_inputs::set_final_data_size): Adjust
6501 size of symbol info entry; check for forwarding symbols.
6502 (Output_section_incremental_inputs::write_input_files): Write
6503 in_system_directory flag and argument serial number.
6504 (Output_section_incremental_inputs::write_info_blocks): Map section
6505 indices between incremental info and original input file; store
6506 input section index for each symbol.
6507 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
6508 change operator() to visit().
6509 (class Global_got_offset_visitor): Likewise.
6510 (class Global_symbol_visitor_got_plt):
6511 (Output_section_incremental_inputs::write_got_plt): Use new visitor
6512 classes.
6513 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
6514 (Sized_incr_relobj::do_read_symbols): New function.
6515 (Sized_incr_relobj::do_layout): New function.
6516 (Sized_incr_relobj::do_layout_deferred_sections): New function.
6517 (Sized_incr_relobj::do_add_symbols): New function.
6518 (Sized_incr_relobj::do_should_include_member): New function.
6519 (Sized_incr_relobj::do_for_all_global_symbols): New function.
6520 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
6521 (Sized_incr_relobj::do_section_size): New function.
6522 (Sized_incr_relobj::do_section_name): New function.
6523 (Sized_incr_relobj::do_section_contents): New function.
6524 (Sized_incr_relobj::do_section_flags): New function.
6525 (Sized_incr_relobj::do_section_entsize): New function.
6526 (Sized_incr_relobj::do_section_address): New function.
6527 (Sized_incr_relobj::do_section_type): New function.
6528 (Sized_incr_relobj::do_section_link): New function.
6529 (Sized_incr_relobj::do_section_info): New function.
6530 (Sized_incr_relobj::do_section_addralign): New function.
6531 (Sized_incr_relobj::do_initialize_xindex): New function.
6532 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
6533 (Sized_incr_relobj::do_read_relocs): New function.
6534 (Sized_incr_relobj::do_gc_process_relocs): New function.
6535 (Sized_incr_relobj::do_scan_relocs): New function.
6536 (Sized_incr_relobj::do_count_local_symbols): New function.
6537 (Sized_incr_relobj::do_finalize_local_symbols): New function.
6538 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
6539 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
6540 (Sized_incr_relobj::do_relocate): New function.
6541 (Sized_incr_relobj::do_set_section_offset): New function.
6542 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
6543 (Sized_incr_dynobj::do_read_symbols): New function.
6544 (Sized_incr_dynobj::do_layout): New function.
6545 (Sized_incr_dynobj::do_add_symbols): New function.
6546 (Sized_incr_dynobj::do_should_include_member): New function.
6547 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
6548 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
6549 (Sized_incr_dynobj::do_section_size): New function.
6550 (Sized_incr_dynobj::do_section_name): New function.
6551 (Sized_incr_dynobj::do_section_contents): New function.
6552 (Sized_incr_dynobj::do_section_flags): New function.
6553 (Sized_incr_dynobj::do_section_entsize): New function.
6554 (Sized_incr_dynobj::do_section_address): New function.
6555 (Sized_incr_dynobj::do_section_type): New function.
6556 (Sized_incr_dynobj::do_section_link): New function.
6557 (Sized_incr_dynobj::do_section_info): New function.
6558 (Sized_incr_dynobj::do_section_addralign): New function.
6559 (Sized_incr_dynobj::do_initialize_xindex): New function.
6560 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
6561 (make_sized_incremental_object): New function.
6562 (Incremental_library::copy_unused_symbols): New function.
6563 (Incremental_library::do_for_all_unused_symbols): New function.
6564 * incremental.h (enum Incremental_input_flags): New type.
6565 (class Incremental_checker): Remove.
6566 (Incremental_input_entry::Incremental_input_entry): Add argument
6567 serial number.
6568 (Incremental_input_entry::arg_serial): New function.
6569 (Incremental_input_entry::set_is_in_system_directory): New function.
6570 (Incremental_input_entry::is_in_system_directory): New function.
6571 (Incremental_input_entry::arg_serial_): New data member.
6572 (Incremental_input_entry::is_in_system_directory_): New data member.
6573 (class Script_info): Move here from script.h.
6574 (Script_info::Script_info): Add filename parameter.
6575 (Script_info::filename): New function.
6576 (Script_info::filename_): New data member.
6577 (Incremental_script_entry::Incremental_script_entry): Add argument
6578 serial number.
6579 (Incremental_object_entry::Incremental_object_entry): Likewise.
6580 (Incremental_object_entry::add_input_section): Build list of input
6581 sections with map to original shndx.
6582 (Incremental_object_entry::get_input_section_index): New function.
6583 (Incremental_object_entry::shndx_): New data member.
6584 (Incremental_object_entry::name_key_): Rename; adjust all refs.
6585 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
6586 (Incremental_archive_entry::Incremental_archive_entry): Add argument
6587 serial number.
6588 (Incremental_inputs::report_archive_begin): Likewise.
6589 (Incremental_inputs::report_object): Likewise.
6590 (Incremental_inputs::report_script): Likewise.
6591 (class Incremental_global_symbol_reader): New class.
6592 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
6593 and store flags and input file type.
6594 (Incremental_input_entry_reader::arg_serial): New function.
6595 (Incremental_input_entry_reader::type): Extract type from flags.
6596 (Incremental_input_entry_reader::is_in_system_directory): New function.
6597 (Incremental_input_entry_reader::get_input_section_count): Call
6598 accessor function for type.
6599 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
6600 function for type; adjust size of global symbol entry.
6601 (Incremental_input_entry_reader::get_global_symbol_count): Call
6602 accessor function for type.
6603 (Incremental_input_entry_reader::get_object_count): Likewise.
6604 (Incremental_input_entry_reader::get_object_offset): Likewise.
6605 (Incremental_input_entry_reader::get_member_count): Likewise.
6606 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
6607 (Incremental_input_entry_reader::get_member_offset): Likewise.
6608 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
6609 (Incremental_input_entry_reader::Global_symbol_info): Remove.
6610 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
6611 (Incremental_input_entry_reader::get_global_symbol_reader): New
6612 function.
6613 (Incremental_input_entry_reader::get_output_symbol_index): New
6614 function.
6615 (Incremental_input_entry_reader::type_): Remove.
6616 (Incremental_input_entry_reader::flags_): New data member.
6617 (Incremental_inputs_reader::input_file_offset): New function.
6618 (Incremental_inputs_reader::input_file_index): New function.
6619 (Incremental_inputs_reader::input_file): Call input_file_offset.
6620 (Incremental_inputs_reader::input_file_at_offset): New function.
6621 (Incremental_relocs_reader::get_r_type): Reformat.
6622 (Incremental_relocs_reader::get_r_shndx): Reformat.
6623 (Incremental_relocs_reader::get_r_offset): Reformat.
6624 (Incremental_relocs_reader::data): New function.
6625 (Incremental_binary::Incremental_binary): Initialize new data members.
6626 (Incremental_binary::check_inputs): Add cmdline parameter.
6627 (Incremental_binary::file_is_unchanged): Remove.
6628 (Input_reader::arg_serial): New function.
6629 (Input_reader::get_unused_symbol_count): New function.
6630 (Input_reader::get_unused_symbol): New function.
6631 (Input_reader::do_arg_serial): New function.
6632 (Input_reader::do_get_unused_symbol_count): New function.
6633 (Input_reader::do_get_unused_symbol): New function.
6634 (Incremental_binary::input_file_count): New function.
6635 (Incremental_binary::get_input_reader): Change signature to use
6636 index instead of filename.
6637 (Incremental_binary::file_has_changed): New function.
6638 (Incremental_binary::get_input_argument): New function.
6639 (Incremental_binary::get_library): New function.
6640 (Incremental_binary::get_script_info): New function.
6641 (Incremental_binary::init_layout): New function.
6642 (Incremental_binary::reserve_layout): New function.
6643 (Incremental_binary::output_file): New function.
6644 (Incremental_binary::do_check_inputs): New function.
6645 (Incremental_binary::do_file_is_unchanged): Remove.
6646 (Incremental_binary::do_file_has_changed): New function.
6647 (Incremental_binary::do_init_layout): New function.
6648 (Incremental_binary::do_reserve_layout): New function.
6649 (Incremental_binary::do_input_file_count): New function.
6650 (Incremental_binary::do_get_input_reader): Change signature.
6651 (Incremental_binary::input_args_map_): New data member.
6652 (Incremental_binary::library_map_): New data member.
6653 (Incremental_binary::script_map_): New data member.
6654 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6655 new data members.
6656 (Sized_incremental_binary::output_section): New function.
6657 (Sized_incremental_binary::inputs_reader): Add const.
6658 (Sized_incremental_binary::symtab_reader): Add const.
6659 (Sized_incremental_binary::relocs_reader): Add const.
6660 (Sized_incremental_binary::got_plt_reader): Add const.
6661 (Sized_incremental_binary::get_symtab_view): New function.
6662 (Sized_incremental_binary::Inputs_reader): New typedef.
6663 (Sized_incremental_binary::Input_entry_reader): New typedef.
6664 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
6665 (Sized_incremental_binary::do_file_is_unchanged): Remove.
6666 (Sized_incremental_binary::do_file_has_changed): New function.
6667 (Sized_incremental_binary::do_init_layout): New function.
6668 (Sized_incremental_binary::do_reserve_layout): New function.
6669 (Sized_input_reader::Inputs_reader): Remove.
6670 (Sized_input_reader::Input_entry_reader): Remove.
6671 (Sized_input_reader::do_arg_serial): New function.
6672 (Sized_input_reader::do_get_unused_symbol_count): New function.
6673 (Sized_input_reader::do_get_unused_symbol): New function.
6674 (Sized_incremental_binary::do_input_file_count): New function.
6675 (Sized_incremental_binary::do_get_input_reader): Change signature;
6676 use index instead of filename.
6677 (Sized_incremental_binary::section_map_): New data member.
6678 (Sized_incremental_binary::input_entry_readers_): New data member.
6679 (class Sized_incr_relobj): New class.
6680 (class Sized_incr_dynobj): New class.
6681 (make_sized_incremental_object): New function.
6682 (class Incremental_library): New class.
6683 * layout.cc (Free_list::num_lists): New static data member.
6684 (Free_list::num_nodes): New static data member.
6685 (Free_list::num_removes): New static data member.
6686 (Free_list::num_remove_visits): New static data member.
6687 (Free_list::num_allocates): New static data member.
6688 (Free_list::num_allocate_visits): New static data member.
6689 (Free_list::init): New function.
6690 (Free_list::remove): New function.
6691 (Free_list::allocate): New function.
6692 (Free_list::dump): New function.
6693 (Free_list::print_stats): New function.
6694 (Layout_task_runner::run): Resize output file for incremental updates.
6695 (Layout::Layout): Initialize new data members.
6696 (Layout::set_incremental_base): New function.
6697 (Layout::init_fixed_output_section): New function.
6698 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
6699 incremental updates.
6700 (Layout::create_gold_note): Do not create gold note section for
6701 incremental updates.
6702 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
6703 for incremental updates.
6704 (Layout::set_section_offsets): For incremental updates, allocate space
6705 from free list.
6706 (Layout::create_symtab_sections): Layout with offsets relative to
6707 start of section; for incremental updates, allocate space from free
6708 list.
6709 (Layout::create_shdrs): For incremental updates, allocate space from
6710 free list.
6711 (Layout::finish_dynamic_section): For incremental updates, do not
6712 check --as-needed (fixed in subsequent patch).
6713 * layout.h (class Free_list): New class.
6714 (Layout::set_incremental_base): New function.
6715 (Layout::incremental_base): New function.
6716 (Layout::init_fixed_output_section): New function.
6717 (Layout::allocate): New function.
6718 (Layout::incremental_base_): New data member.
6719 (Layout::free_list_): New data member.
6720 * main.cc (main): Print Free_list statistics.
6721 * object.cc (Relobj::finalize_incremental_relocs): Add
6722 clear_counts parameter; clear counts only when clear_counts is set.
6723 (Sized_relobj::Sized_relobj): Initialize new base class.
6724 (Sized_relobj::do_layout): Don't report special sections.
6725 (Sized_relobj::do_for_all_local_got_entries): New function.
6726 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
6727 symtab_off to all symbol table offsets.
6728 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
6729 * object.h (class Got_offset_list): Move to top of file.
6730 (Object::Object): Allow case where input_file == NULL.
6731 (Object::~Object): Likewise.
6732 (Object::input_file): Assert that input_file != NULL.
6733 (Object::lock): Allow case where input_file == NULL.
6734 (Object::unlock): Likewise.
6735 (Object::is_locked): Likewise.
6736 (Object::token): Likewise.
6737 (Object::release): Likewise.
6738 (Object::is_incremental): New function.
6739 (Object::get_mtime): New function.
6740 (Object::for_all_local_got_entries): New function.
6741 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
6742 (Object::set_is_in_system_directory): New function.
6743 (Object::is_in_system_directory): New function.
6744 (Object::do_is_incremental): New function.
6745 (Object::do_get_mtime): New function.
6746 (Object::do_for_all_local_got_entries): New function.
6747 (Object::is_in_system_directory_): New data member.
6748 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
6749 (class Sized_relobj_base): New class.
6750 (class Sized_relobj): Derive from Sized_relobj_base.
6751 (class Sized_relobj::Symbols): Redeclare from base class.
6752 (class Sized_relobj::local_got_offset_list): Remove.
6753 (class Sized_relobj::Output_sections): Redeclare from base class.
6754 (class Sized_relobj::do_for_all_local_got_entries): New function.
6755 (class Sized_relobj::write_local_symbols): Add offset parameter.
6756 (class Sized_relobj::local_symbol_offset_): Update comment.
6757 (class Sized_relobj::local_dynsym_offset_): Update comment.
6758 * options.cc (Input_arguments::add_file): Remove const.
6759 * options.h (Input_file_argument::Input_file_argument):
6760 Initialize arg_serial_ (all constructors).
6761 (Input_file_argument::set_arg_serial): New function.
6762 (Input_file_argument::arg_serial): New function.
6763 (Input_file_argument::arg_serial_): New data member.
6764 (Input_arguments::Input_arguments): Initialize file_count_.
6765 (Input_arguments::add_file): Remove const.
6766 (Input_arguments::number_of_input_files): New function.
6767 (Input_arguments::file_count_): New data member.
6768 (Command_line::number_of_input_files): Call
6769 Input_arguments::number_of_input_files.
6770 * output.cc (Output_segment_headers::Output_segment_headers):
6771 Set current size.
6772 (Output_section::Input_section::current_data_size): New function.
6773 (Output_section::Output_section): Initialize new data members.
6774 (Output_section::add_input_section): Don't do merge sections for
6775 an incremental link; allocate space from free list for an
6776 incremental update.
6777 (Output_section::add_output_section_data): Allocate space from
6778 free list for an incremental update.
6779 (Output_section::update_data_size): New function.
6780 (Output_section::set_fixed_layout): New function.
6781 (Output_section::reserve): New function.
6782 (Output_segment::set_section_addresses): Remove const.
6783 (Output_segment::set_section_list_addresses): Remove const; allocate
6784 space from free list for an incremental update.
6785 (Output_segment::set_offset): Adjust size of RELRO segment for an
6786 incremental update.
6787 * output.h (Output_data::current_data_size): Move here from
6788 child classes.
6789 (Output_data::pre_finalize_data_size): New function.
6790 (Output_data::update_data_size): New function.
6791 (Output_section_headers::update_data_size): new function.
6792 (Output_section_data_build::current_data_size): Move to Output_data.
6793 (Output_data_strtab::update_data_size): New function.
6794 (Output_section::current_data_size): Move to Output_data.
6795 (Output_section::set_fixed_layout): New function.
6796 (Output_section::has_fixed_layout): New function.
6797 (Output_section::reserve): New function.
6798 (Output_section::update_data_size): New function.
6799 (Output_section::has_fixed_layout_): New data member.
6800 (Output_section::free_list_): New data member.
6801 (Output_segment::set_section_addresses): Remove const.
6802 (Output_segment::set_section_list_addresses): Remove const.
6803 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
6804 New function.
6805 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
6806 New function.
6807 * readsyms.cc (Read_symbols::do_read_symbols): Add library
6808 parameter when calling Add_symbols constructor; store argument
6809 serial number for members of a lib group.
6810 (Add_symbols::locks): Allow case where token == NULL.
6811 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
6812 (Read_member::~Read_member): New function.
6813 (Read_member::is_runnable): New function.
6814 (Read_member::locks): New function.
6815 (Read_member::run): New function.
6816 (Check_script::~Check_script): New function.
6817 (Check_script::is_runnable): New function.
6818 (Check_script::locks): New function.
6819 (Check_script::run): New function.
6820 (Check_library::~Check_library): New function.
6821 (Check_library::is_runnable): New function.
6822 (Check_library::locks): New function.
6823 (Check_library::run): New function.
6824 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
6825 (Add_symbols::library_): New data member.
6826 (class Read_member): New class.
6827 (class Check_script): New class.
6828 (class Check_library): New class.
6829 * reloc.cc (Read_relocs::is_runnable): Allow case where
6830 token == NULL.
6831 (Read_relocs::locks): Likewise.
6832 (Scan_relocs::locks): Likewise.
6833 (Relocate_task::locks): Likewise.
6834 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
6835 to clear counters.
6836 (Sized_relobj::incremental_relocs_scan): Fix comment.
6837 (Sized_relobj::do_relocate): Pass output file offset to
6838 write_local_symbols.
6839 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
6840 from class declaration.
6841 * script.cc (read_input_script): Allocate Script_info; pass
6842 argument serial number to report_script.
6843 * script.h (class Script_info): Move to incremental.h.
6844 * symtab.cc (Symbol_table::add_from_incrobj): New function.
6845 * symtab.h (Symbol_table::add_from_incrobj): New function.
6846 (Symbol_table::set_file_offset): New function.
6847
b961d0d7
CC
68482011-04-05 Cary Coutant <ccoutant@google.com>
6849
6850 * incremental-dump.cc (dump_incremental_inputs): Change signature
6851 to take a Sized_incremental_binary; change caller. Use readers
6852 in Sized_incremental_binary.
6853 * incremental.cc
6854 (Sized_incremental_binary::find_incremental_inputs_sections):
6855 Rename do_find_incremental_inputs_sections to this.
6856 (Sized_incremental_binary::setup_readers): New function.
6857 (Sized_incremental_binary::do_check_inputs): Check
6858 has_incremental_info_ flag; move setup code to setup_readers;
6859 use input readers.
6860 (Sized_incremental_binary::do_file_is_unchanged): New function.
6861 (Sized_incremental_binary::do_get_input_reader): New function.
6862 * incremental.h (class Incremental_binary): Move to end of file.
6863 (Incremental_binary::file_is_unchanged): New function.
6864 (Incremental_binary::do_file_is_unchanged): New function.
6865 (Incremental_binary::Input_reader): New class.
6866 (Incremental_binary::get_input_reader): New function.
6867 (class Sized_incremental_binary): Move to end of file.
6868 (Sized_incremental_binary::Sized_incremental_binary): Setup the
6869 input section reader classes.
6870 (Sized_incremental_binary::has_incremental_info): New function.
6871 (Sized_incremental_binary::inputs_reader): New function.
6872 (Sized_incremental_binary::symtab_reader): New function.
6873 (Sized_incremental_binary::relocs_reader): New function.
6874 (Sized_incremental_binary::got_plt_reader): New function.
6875 (Sized_incremental_binary::do_file_is_unchanged): New function.
6876 (Sized_incremental_binary::Sized_input_reader): New class.
6877 (Sized_incremental_binary::get_input_reader): New function.
6878 (Sized_incremental_binary::find_incremental_inputs_sections):
6879 Rename do_find_incremental_inputs_sections to this.
6880 (Sized_incremental_binary::setup_readers): New function.
6881 (Sized_incremental_binary::has_incremental_info_): New data member.
6882 (Sized_incremental_binary::inputs_reader_): New data member.
6883 (Sized_incremental_binary::symtab_reader_): New data member.
6884 (Sized_incremental_binary::relocs_reader_): New data member.
6885 (Sized_incremental_binary::got_plt_reader_): New data member.
6886 (Sized_incremental_binary::current_input_file_): New data member.
6887
a869183f
PP
68882011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
6889
6890 PR gold/12640
6891 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
6892 violation.
6893
68942011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
6895
6896 * archive.cc (Archive::include_member): Adjust call to report_object.
6897 (Add_archive_symbols::run): Add script_info to call to
6898 report_archive_begin.
6899 (Lib_group::include_member): Adjust call to report_object.
6900 (Add_lib_group_symbols::run): Adjust call to report_object.
6901 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
6902 blocks. Add object count for script input files.
6903 * incremental.cc (Incremental_inputs::report_archive_begin): Add
6904 script_info parameter; change all callers.
6905 (Incremental_inputs::report_object): Add script_info parameter;
6906 change all callers.
6907 (Incremental_inputs::report_script): Store backpointer to
6908 incremental info entry.
6909 (Output_section_incremental_inputs::set_final_data_size): Record
6910 additional information for scripts.
6911 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6912 * incremental.h (Incremental_script_entry::add_object): New function.
6913 (Incremental_script_entry::get_object_count): New function.
6914 (Incremental_script_entry::get_object): New function.
6915 (Incremental_script_entry::objects_): New data member; adjust
6916 constructor.
6917 (Incremental_inputs::report_archive_begin): Add script_info parameter.
6918 (Incremental_inputs::report_object): Add script_info parameter.
6919 (Incremental_inputs_reader::get_object_count): New function.
6920 (Incremental_inputs_reader::get_object_offset): New function.
6921 * options.cc (Input_arguments::add_file): Return reference to
6922 new input argument.
6923 * options.h (Input_argument::set_script_info): New function.
6924 (Input_argument::script_info): New function.
6925 (Input_argument::script_info_): New data member; adjust all
6926 constructors.
6927 (Input_file_group::add_file): Return reference to new input argument.
6928 (Input_file_lib::add_file): Likewise.
6929 (Input_arguments::add_file): Likewise.
6930 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
6931 * script.cc (Parser_closure::Parser_closure): Add script_info
6932 parameter; adjust all callers.
6933 (Parser_closure::script_info): New function.
6934 (Parser_closure::script_info_): New data member.
6935 (read_input_script): Report scripts earlier to incremental info.
6936 (script_add_file): Set script_info in Input_argument.
6937 (script_add_library): Likewise.
6938 * script.h (Script_options::Script_info): Rewrite class.
6939
a869183f 69402011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
6941
6942 * archive.cc (Library_base::should_include_member): Move
6943 method here from class Archive.
6944 (Archive::Archive): Initialize base class.
6945 (Archive::should_include_member): Move to base class.
6946 (Archive::do_for_all_unused_symbols): New function.
6947 (Add_archive_symbols::run): Remove redundant access to
6948 incremental_inputs.
6949 (Lib_group::Lib_group): Initialize base class.
6950 (Lib_group::do_filename): New function.
6951 (Lib_group::include_member): Pass pointer to Lib_group to
6952 report_object.
6953 (Lib_group::do_for_all_unused_symbols): New function.
6954 (Add_lib_group_symbols::run): Report archive information for
6955 incremental links.
6956 * archive.h (class Library_base): New base class.
6957 (class Archive): Derive from Library_base.
6958 (Archive::filename): Move to base class.
6959 (Archive::set_incremental_info): Likewise.
6960 (Archive::incremental_info): Likewise.
6961 (Archive::Should_include): Likewise.
6962 (Archive::should_include_member): Likewise.
6963 (Archive::Armap_entry): Remove.
6964 (Archive::Unused_symbol_iterator): Remove.
6965 (Archive::unused_symbols_begin): Remove.
6966 (Archive::unused_symbols_end): Remove.
6967 (Archive::do_filename): New function.
6968 (Archive::do_get_mtime): New function.
6969 (Archive::do_for_all_unused_symbols): New function.
6970 (Archive::task_): Move to base class.
6971 (Archive::incremental_info_): Likewise.
6972 (class Lib_group): Derive from Library_base.
6973 (Lib_group::do_filename): New function.
6974 (Lib_group::do_get_mtime): New function.
6975 (Lib_group::do_for_all_unused_symbols): New function.
6976 (Lib_group::task_): Move to base class.
6977 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
6978 function.
6979 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
6980 function.
6981 * incremental.cc (Incremental_inputs::report_archive_begin):
6982 Use Library_base; call library's get_mtime; add incremental inputs
6983 entry before members.
6984 (class Unused_symbol_visitor): New class.
6985 (Incremental_inputs::report_archive_end): Use Library_base; use
6986 visitor class to record unused symbols; don't add incremental inputs
6987 entry after members.
6988 (Incremental_inputs::report_object): Use Library_base.
6989 * incremental.h
6990 (Incremental_archive_entry::Incremental_archive_entry): Remove
6991 unused Archive parameter.
6992 (Incremental_inputs::report_archive_begin): Use Library_base.
6993 (Incremental_inputs::report_archive_end): Likewise.
6994 (Incremental_inputs::report_object): Likewise.
6995 * object.cc (Sized_relobj::do_for_all_global_symbols): New
6996 function.
6997 * object.h (Object::for_all_global_symbols): New function.
6998 (Object::do_for_all_global_symbols): New function.
6999 (Sized_relobj::do_for_all_global_symbols): New function.
7000 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
7001 function.
7002 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
7003 function.
7004
61ab3e40
ILT
70052011-03-27 Ian Lance Taylor <iant@google.com>
7006
7007 * archive.cc (Archive::interpret_header): Return -1 if something
7008 goes wrong. Change callers accordingly.
7009
30e1f9e6
CC
70102011-03-25 Cary Coutant <ccoutant@google.com>
7011
7012 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
7013 * testsuite/Makefile.in: Regenerate.
7014
9370ce59 70152011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
7016
7017 * plugin.cc (get_view): New.
7018 (Plugin::load): Pass get_view to the plugin.
7019 (Plugin_manager::get_view): New.
7020
9312bb0a
ILT
70212011-03-21 Ian Lance Taylor <iant@google.com>
7022
7023 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 7024 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 7025
7e12ba9e
ST
70262011-03-21 Sriraman Tallam <tmsriram@google.com>
7027
7028 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
7029 Change == to -eq.
7030 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
7031 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
7032 Change == to -eq.
7033 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
7034 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
7035
fd7a005d
ILT
70362011-03-14 Ian Lance Taylor <iant@google.com>
7037
7038 * script-sections.cc (Sort_output_sections::script_compare):
7039 Rename from is_before, change return type.
7040 (Sort_output_sections::operator()): Adjust accordingly.
7041
ed16fd1b
ILT
70422011-03-11 Jeffrey Yasskin <jyasskin@google.com>
7043
7044 PR gold/12572
7045 * testsuite/odr_violation2.cc: Add comment to make all error line
7046 numbers double digits.
7047 * testsuite/debug_msg.sh: Adjust expected errors.
7048
71ff8986
ILT
70492011-03-09 Jeffrey Yasskin <jyasskin@google.com>
7050
7051 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
7052 but mark earlier ones as non-canonical
7053 (offset_to_iterator): Update search target and example
7054 (do_addr2line): Return extra lines in a vector*
7055 (format_file_lineno): Extract from do_addr2line
7056 (one_addr2line): Add vector* out-param
7057 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
7058 when a lineno entry appeared last for its instruction
7059 (Dwarf_line_info): Add vector* out-param
7060 * object.cc (Relocate_info): Pass NULL for the vector* out-param
7061 * symtab.cc (Odr_violation_compare): Include the lineno in the
7062 comparison again.
7063 (linenos_from_loc): New. Combine the canonical line for an
7064 address with its other lines.
7065 (True_if_intersect): New. Helper functor to make
7066 std::set_intersection a query.
7067 (detect_odr_violations): Compare sets of lines instead of just
7068 one line for each function. This became less deterministic, but
7069 has fewer false positives.
7070 * symtab.h: Declarations.
7071 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
7072 mix an optimized and non-optimized object in the same binary
7073 (odr_violation2.so): Same.
7074 * testsuite/Makefile.in: Regenerate from Makefile.am.
7075 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
7076 * testsuite/debug_msg.sh: Update line numbers and add
7077 assertions.
7078 * testsuite/odr_violation1.cc: Use OdrDerived, in a
7079 non-optimized context.
7080 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
7081 isn't inlined, and use OdrDerived in an optimized context.
7082 * testsuite/odr_header1.h: Defines OdrDerived, where
7083 optimization will change the
7084 first-instruction-in-the-destructor's file and line number.
7085 * testsuite/odr_header2.h: Defines OdrBase.
7086
a19fefdc
ILT
70872011-03-09 Ian Lance Taylor <iant@google.com>
7088
7089 * fileread.cc (File_read::clear_views): Don't delete the whole
7090 file view.
7091
ecb351e9
ILT
70922011-03-08 Ian Lance Taylor <iant@google.com>
7093
7094 PR gold/12525
7095 * fileread.cc: #include <climits>.
7096 (GOLD_IOV_MAX): Define.
7097 (File_read::read_multiple): Limit number of entries by iov_max.
7098 * fileread.h (class File_read): Always set max_readv_entries to
7099 128.
7100
b821d13c
ILT
71012011-03-07 Ian Lance Taylor <iant@google.com>
7102
7103 PR gold/12525
7104 * options.h (class General_options): Add -dy and -dn.
7105
89243142
CC
71062011-03-02 Cary Coutant <ccoutant@google.com>
7107
7108 * testsuite/script_test_9.t: Add TLS segment.
7109
d0773f31
ILT
71102011-03-02 Simon Baldwin <simonb@google.com>
7111
7112 * configure.ac: Add check for gnu_indirect_function support in
7113 the toolchain building binutils.
7114 * configure: Rebuild.
7115
9370ce59 71162011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
7117
7118 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
7119 plugin only symbols.
7120 (Symbol_table::sized_finalize_symbol) Mark symbol only present
7121 in plugin files as not needed in the symbol table.
7122
4cf7a849
ST
71232011-02-11 Sriraman Tallam <tmsriram@google.com>
7124
7125 * output.cc (Output_section::add_input_section): Delay fill
7126 generation for section ordering.
7127
b578bd7d
ILT
71282011-02-09 Ian Lance Taylor <iant@google.com>
7129
7130 PR gold/12316
7131 * object.h (class Sized_relobj): Remove clear_local_symbols.
7132 * reloc.cc (Sized_relobj::do_relocate): Don't call
7133 clear_local_symbols.
7134
9370ce59 71352011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
7136
7137 * plugin.cc (is_visible_from_outside): Return true for symbols
7138 in the -u option.
7139
55382fb7
ILT
71402011-02-04 Jeffrey Yasskin <jyasskin@google.com>
7141
7142 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
7143 filename.
7144
4e271fff
ST
71452011-02-02 Sriraman Tallam <tmsriram@google.com>
7146
7147 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 7148 to std::string.
4e271fff 7149 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 7150 section_name to be std::string.
4e271fff
ST
7151 (is_function_ctor_or_dtor): Change type of parameter to std::string.
7152
d433c3ac
ILT
71532011-01-25 Ian Lance Taylor <iant@google.com>
7154
7155 * script.cc (script_add_extern): Rewrite to use
7156 add_symbol_reference.
7157
880473a6
DK
71582011-01-25 Doug Kwan <dougkwan@google.com>
7159
d433c3ac 7160 * icf.cc (get_section_contents): Always lock section's object.
880473a6 7161
f30f86fa
ILT
71622011-01-24 Ian Lance Taylor <iant@google.com>
7163
7164 * options.h (class General_options): Accept
7165 --no-detect-odr-violations.
7166
8e51a0b9
ILT
71672011-01-24 Ian Lance Taylor <iant@google.com>
7168
7169 * version.cc (version_string): Bump to 1.11.
7170
0f3b89d8
ILT
71712011-01-24 Ian Lance Taylor <iant@google.com>
7172
7173 * plugin.cc (class Plugin_rescan): Define new class.
7174 (Plugin_manager::claim_file): Set any_claimed_.
7175 (Plugin_manager::save_archive): New function.
7176 (Plugin_manager::save_input_group): New function.
7177 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
7178 necessary.
7179 (Plugin_manager::new_undefined_symbol): New function.
7180 (Plugin_manager::rescan): New function.
7181 (Plugin_manager::rescannable_defines): New function.
7182 (Plugin_manager::add_input_file): Set any_added_.
7183 * plugin.h (class Plugin_manager): define new fields rescannable_,
7184 undefined_symbols_, any_claimed_, and any_added_. Declare
7185 Plugin_rescan as friend. Declare new functions.
7186 (Plugin_manager::Rescannable): Define type.
7187 (Plugin_manager::Rescannable_list): Define type.
7188 (Plugin_manager::Undefined_symbol_list): Define type.
7189 (Plugin_manager::Plugin_manager): Initialize new fields.
7190 * archive.cc (Archive::defines_symbol): New function.
7191 (Add_archive_symbols::run): Pass archive to plugins if any.
7192 * archive.h (class Archive): Declare defines_symbol.
7193 * readsyms.cc (Input_group::~Input_group): New function.
7194 (Finish_group::run): Pass input_group to plugins if any.
7195 * readsyms.h (class Input_group): Declare destructor.
7196 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
7197 any.
7198
3bb951e5
ILT
71992011-01-10 Ian Lance Taylor <iant@google.com>
7200
7201 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
7202 section as relro.
7203 (Layout::set_segment_offsets): Reset increase_relro before calling
7204 set_section_addresses a second time.
7205
0aa45fac
CC
72062011-01-04 Cary Coutant <ccoutant@google.com>
7207
7208 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
7209 sections before NOBITS sections.
7210
0db46eb4
L
72112011-01-01 H.J. Lu <hongjiu.lu@intel.com>
7212
7213 * version.cc (print_version): Update copyright to 2011.
7214
829c9745
CC
72152010-12-23 Cary Coutant <ccoutant@google.com>
7216
7217 * output.h (Output_data_reloc::add_output_section): Pass OD instead
7218 of OS to this->add. Add OD parameter to second form of the function.
7219
7500420b
ILT
72202010-12-20 Ian Lance Taylor <iant@google.com>
7221
7222 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
7223 second of two consecutive entries with same offset.
7224
f8e9a930
RW
72252010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7226
7227 * testsuite/Makefile.am (ifuncmain2static_LDADD)
7228 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
7229 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
7230 to avoid unneeded links against $(LDADD).
7231 * testsuite/Makefile.in: Regenerate.
7232
2fbb4320
ILT
72332010-12-15 Ian Lance Taylor <iant@google.com>
7234
7235 PR gold/12324
7236 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
7237 for R_X86_64_32 and R_X86_64_PC32.
7238 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
7239 ver_matching_def_pic.o.
7240 (ver_matching_def_pic.o): New target.
7241
fedb228d
RW
72422010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7243
7244 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
7245 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
7246 Move definition before File_read::View member definitions.
7247 (File_read::View::~View): Initialize and hold lock before
7248 updating current_mapped_bytes.
7249
9b547ce6
RW
72502010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7251
7252 * dwarf_reader.cc: Remove outdated comment.
7253 * gold-threads.cc: Fix typo in error message.
7254 * archive.cc: Fix typos in comments.
7255 * archive.h: Likewise.
7256 * arm-reloc-property.cc: Likewise.
7257 * arm-reloc-property.h: Likewise.
7258 * arm-reloc.def: Likewise.
7259 * arm.cc: Likewise.
7260 * attributes.h: Likewise.
7261 * cref.cc: Likewise.
7262 * ehframe.cc: Likewise.
7263 * fileread.h: Likewise.
7264 * gold.h: Likewise.
7265 * i386.cc: Likewise.
7266 * icf.cc: Likewise.
7267 * incremental.h: Likewise.
7268 * int_encoding.cc: Likewise.
7269 * layout.h: Likewise.
7270 * main.cc: Likewise.
7271 * merge.h: Likewise.
7272 * object.cc: Likewise.
7273 * object.h: Likewise.
7274 * options.cc: Likewise.
7275 * readsyms.cc: Likewise.
7276 * reduced_debug_output.cc: Likewise.
7277 * reloc.cc: Likewise.
7278 * script-sections.cc: Likewise.
7279 * sparc.cc: Likewise.
7280 * symtab.h: Likewise.
7281 * target-reloc.h: Likewise.
7282 * target.cc: Likewise.
7283 * target.h: Likewise.
7284 * timer.cc: Likewise.
7285 * timer.h: Likewise.
7286 * x86_64.cc: Likewise.
7287
83e17bd5
CC
72882010-12-09 Cary Coutant <ccoutant@google.com>
7289
7290 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
7291 stack.
7292 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
7293 parameter; change all callers.
7294 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
7295 * options.h (warn_execstack): New option.
7296
017257f8
DK
72972010-12-07 Doug Kwan <dougkwan@google.com>
7298
7299 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
7300 like function call relocations.
7301
c20cbc06
ILT
73022010-12-07 Ian Lance Taylor <iant@google.com>
7303
7304 * archive.cc (Archive::get_elf_object_for_member): Permit
7305 punconfigured to be NULL.
7306 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
7307 (Archive::include_member): Pass NULL to get_elf_object_for_member
7308 if we searched for the archive and this is the first included
7309 object.
7310
4dbfafcc
ILT
73112010-12-01 Ian Lance Taylor <iant@google.com>
7312
7313 * dwarf_reader.h (class Sized_dwarf_line_info): Add
7314 track_relocs_type_ field.
7315 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7316 Set track_relocs_type_.
7317 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
7318 contents when using RELA relocs.
7319 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
7320 reloc_map_.
7321 * reloc.cc (Track_relocs::next_addend): New function.
7322 * reloc.h (class Track_relocs): Declare next_addend.
7323
e5e19edd
ILT
73242010-12-01 Ian Lance Taylor <iant@google.com>
7325
7326 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
7327 virtual destructor.
7328
9a5ce24c
ILT
73292010-12-01 Ian Lance Taylor <iant@google.com>
7330
7331 * README: Update compilers known to work and fail.
7332
c7791212
NC
73332010-11-23 Matthias Klose <doko@ubuntu.com>
7334
7335 * configure.in: For --enable-gold, handle value `default' instead of
7336 `both*'. Always install ld as ld.bfd, install as ld if gold is
7337 not the default.
7338 * configure: Regenerate.
7339
0ad220c9
DK
73402010-11-18 Doug Kwan <dougkwan@google.com>
7341
7342 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
7343 and right_alignment to be zero. Store result alignment only if it is
7344 greater than existing alignment.
7345
ab8056e0
CC
73462010-11-16 Cary Coutant <ccoutant@google.com>
7347
7348 PR gold/12220
7349 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7350 Check for ".zdebug_line".
7351
fd064a5b
CC
73522010-11-16 Doug Kwan <dougkwan@google.com>
7353 Cary Coutant <ccoutant@google.com>
7354
7355 * output.h (Output_segment::set_section_addresses): Pass increase_relro
7356 by reference; adjust all callers.
7357 * output.cc (Output_segment::set_section_addresses): Adjust references
7358 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
7359 list is empty.
7360 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
7361 end at page boundary.
7362
6fc6ea19
CC
73632010-11-16 Cary Coutant <ccoutant@google.com>
7364
7365 PR gold/12220
7366 * layout.cc (Layout::choose_output_section): Transform names of
7367 compressed sections even when using a script with a SECTIONS clause.
7368 (Layout::output_section_name): Remove code to transform
7369 compressed debug section names.
7370 * output.cc (Output_section::add_input_section): Use uncompressed
7371 section size when tracking input sections.
7372
95a2c8d6
RS
73732010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
7374
7375 * symtab.h (Symbol::NON_PIC_REF): Remove.
7376 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
7377 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
7378 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
7379 (Symbol::use_plt_offset): Take a flags argument and pass it
7380 directly to needs_dynamic_reloc. Restrict check for undefined
7381 weak symbols to function calls.
7382 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
7383 (Target_arm::Scan::global): Use it.
7384 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
7385 (Target_arm::Relocate::relocate): Likewise.
7386 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
7387 parameter with an r_type parameter. Use get_reference_flags
7388 to get the flags.
7389 (Target_arm::Relocate::relocate): Update accordingly.
7390 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
7391 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
7392 (Target_i386::Scan::global): Likewise.
7393 (Target_i386::Relocate::relocate): Likewise.
7394 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
7395 parameter with an r_type parameter. Use get_reference_flags
7396 to get the flags.
7397 (Target_i386::Relocate::relocate): Update accordingly.
7398 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
7399 (Target_powerpc::Scan::global): Use it.
7400 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
7401 (Target_powerpc::Relocate::relocate): Likewise.
7402 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
7403 (Target_sparc::Scan::global): Use it.
7404 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
7405 (Target_sparc::Relocate::relocate): Likewise.
7406 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
7407 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
7408 (Target_x86_64::Scan::global): Likewise.
7409 (Target_x86_64::Relocate::relocate): Likewise.
7410
f625ae50
DK
74112010-11-08 Doug Kwan <dougkwan@google.com>
7412 Cary Coutant <ccoutant@google.com>
7413
7414 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
7415 (Arm_exidx_merge_section::section_contents_): New data member.
7416 (Arm_input_section::Arm_input_section): Initialize original_contents_.
7417 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 7418 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
7419 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
7420 in parameters instead of calling Object::section_contents without
7421 locking.
7422 (Arm_output_section::group_section): New parameter TASK. Pass it
7423 to callees that need locking objects.
7424 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
7425 to lock EXIDX input sections. Fix a formatting issue. Call
7426 Arm_exidx_merged_section::build_contents to create merged section
7427 contents.
7428 (Arm_output_section::create_stub_group): New parameter TASK. Use it
7429 to lock object of stub table owner.
7430 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
7431 TEXT_SIZE to initialize data member TEXT_SIZE_.
7432 (Arm_exidx_input_section::addralign): Fix typo in comment.
7433 (Arm_exidx_input_section::text_size): New method.
7434 (Target_arm::do_relax): New parameter TASK. Pass it to callees
7435 that require locking objects. Lock objects before scanning for stubs
7436 and updating local symbols.
7437 (Arm_input_section<big_endian>::init): Copy contents of original
7438 input section.
2e702c99 7439 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
7440 original input section instead of calling Object::section_contents
7441 without locking.
7442 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
7443 size without calling Object::section_size().
7444 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
7445 for size. Allocate a buffer for merged EXIDX entries.
7446 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 7447 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
7448 building code to Arm_exidx_merged_section::build_contetns. Write
7449 out contetns in buffer instead of building it on the fly.
7450 (Arm_relobj::make_exidx_input_section): Also pass text section size
7451 to Arm_exidx_input_section constructor.
7452 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
7453 (Arm_dynobj::do_read_symbols): Fix memory leak.
7454 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
7455 * target.h: (class Task): Add forward declaration.
7456 (Target::relax): Add new parameter TASK and pass it to
7457 Target::do_relax().
7458 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
7459
5f9bcf58
CC
74602010-11-05 Cary Coutant <ccoutant@google.com>
7461
7462 PR gold/10708
7463 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
7464 object when reading from the file.
7465 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
7466 second layout pass.
7467 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
7468 when reading section contents.
7469 (get_section_contents): Likewise.
7470 (icf::find_identical_sections): Likewise.
7471 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
7472 object when reading from the file.
7473 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
7474 the object when doing deferred section layout.
7475
e597fa08
NC
74762010-11-03 Nick Clifton <nickc@redhat.com>
7477
7478 PR gold/12001
7479 * script.h (class Symbol_assignment: name): New member. Returns
7480 the name of the symbol.
7481 * scrfipt.cc (Script_options::is_pending_assignment): New member.
7482 Returns true if the given symbol name is on the list of
7483 assignments wating to be processed.
7484 * archive.cc (should_incldue_member): If the symbol is undefined,
7485 check to see if it is on the list of symbols pending assignment.
7486
3f9a3278
ILT
74872010-11-03 Ryan Mansfield <rmansfield@qnx.com>
7488
7489 * script-sections.cc (Script_sections::find_memory_region): Check
7490 for a NULL output section pointer.
7491
d06fb4d1
DK
74922010-10-29 Doug Kwan <dougkwan@google.com>
7493
7494 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
7495 Output_section::add_relaxed_input_section.
7496 * output.cc (Output_section::add_relaxed_input_section): Add new
7497 arguments LAYOUT and NAME. Set section order index.
7498 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7499 Copy section order index.
7500 * output.h (Output_section::add_relaxed_input_section): Add new
7501 arguments LAYOUT and NAME.
7502
90e24de5
ILT
75032010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7504
7505 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 7506 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
7507 * testsuite/Makefile.in: Regenerate.
7508
c9484ea5
DK
75092010-10-20 Doug Kwan <dougkwan@google.com>
7510
7511 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
7512 without SHF_LINK_ORDER flags.
7513 * layout.cc (Layout::choose_output_section): Do not filter
7514 SHF_LINK_ORDER flag in a relocatable link.
7515
5bc2f5be
CC
75162010-10-17 Cary Coutant <ccoutant@google.com>
7517
7518 * output.h (Output_segment::set_section_addresses): Change function
7519 signature. Update all callers.
7520 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
7521 sections.
7522 (Output_segment::set_section_addresses): Align after last TLS
7523 section. Add padding before last relro section instead of after.
7524
0c91cf04
DK
75252010-10-17 Doug Kwan <dougkwan@google.com>
7526
7527 * gold/arm.cc (Target_arm::got_section): Use correct order and set
7528 GOT output section to be writable.
7529
8c21d9d3
CC
75302010-10-14 Cary Coutant <ccoutant@google.com>
7531
7532 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
7533 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
7534 * gold.cc (queue_initial_tasks): Check parameters for incremental link
7535 mode.
7536 * incremental.cc (report_command_line): Ignore all forms of
7537 --incremental.
7538 * layout.cc (Layout::Layout): Check parameters for incremental link
7539 mode.
7540 * options.cc (General_options::parse_incremental): New function.
7541 (General_options::parse_no_incremental): New function.
7542 (General_options::parse_incremental_full): New function.
7543 (General_options::parse_incremental_update): New function.
7544 (General_options::incremental_mode_): New data member.
7545 (General_options::finalize): Check incremental_mode_.
7546 * options.h (General_options): Update help text for --incremental.
7547 Add --no-incremental, --incremental-full, --incremental-update.
7548 (General_options::Incremental_mode): New enum type.
7549 (General_options::incremental_mode): New function.
7550 (General_options::incremental_mode_): New data member.
7551 * parameters.cc (Parameters::incremental_mode_): New data member.
7552 (Parameters::set_options): Set incremental_mode_.
7553 (Parameters::set_incremental_full): New function.
7554 (Parameters::incremental): New function.
7555 (Parameters::incremental_update): New function.
7556 (set_parameters_incremental_full): New function.
7557 * parameters.h (Parameters::set_incremental_full): New function.
7558 (Parameters::incremental): New function.
7559 (Parameters::incremental_update): New function.
7560 (Parameters::incremental_mode_): New data member.
7561 (set_parameters_incremental_full): New function.
7562 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
7563 incremental link mode.
7564 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
7565 (Sized_relobj::do_relocate_sections): Likewise.
7566 * testsuite/Makefile.am (incremental_test): Use --incremental-full
7567 option.
7568 * testsuite/Makefile.in: Regenerate.
7569 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 7570
bb32aa18 75712010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
7572
7573 * script-sections.h (class Script_sections): Make
7574 Sections_elements typedef public.
7575 * script-sections.cc (class Sort_output_sections): Add elements_
7576 field. Add constructor which sets it; change all callers.
7577 (Sort_output_sections::is_before): New function.
7578 (Sort_output_sections::operator()): Call is_before.
7579 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
7580 conditional.
7581 * testsuite/script_test_10.sh: New test. Test script section
7582 order.
7583 * testsuite/script_test_10.t: Likewise.
7584 * testsuite/script_test_10.s: Likewise.
7585 * testsuite/Makefile.am: Wrap the cross linker tests and the
7586 common tests into NATIVE_OR_CROSS_LINKER.
7587 (check_SCRIPTS): Add script_test_10.sh.
7588 (check_DATA): Add script_test_10.stdout.
7589 (script_test_10.o, script_test_10): New targets.
7590 (script_test_10.stdout): New target.
7591 * configure, testsuite/Makefile.in: Regenerate.
7592
3cef7179
ILT
75932010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7594
7595 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
7596 error for the deprecated relocations.
7597 (Target_arm::Scan::global): Likewise.
7598 (Target_arm::Relocate::relocate): Likewise.
7599
7411e9a8
RS
76002010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
7601
7602 * fileread.cc (Input_file::find_file): Initialize *found_name
7603 and *namep when using the fallback search for case 4.
7604
6a9da32a
CC
76052010-10-11 Cary Coutant <ccoutant@google.com>
7606
7607 * options.h (class General_options): Redefine -z lazy as an alias for
7608 the negation of -z now.
7609
ac897c20
ILT
76102010-10-11 Ian Lance Taylor <iant@google.com>
7611
7612 * resolve.cc (symbol_to_bits): Report the value of the unsupported
7613 binding.
7614
ea5cae92
NC
76152010-10-06 Nick Clifton <nickc@redhat.com>
7616
7617 * script-sections.cc(class Memory_region): Remove
7618 current_lma_offset_ field. Rename current_vma_offset_ to
7619 current_offset_. Add last_section_ field.
7620 (Memory_region::get_current_vma_address): Rename to
7621 get_current_address.
7622 (Memory_region::get_current_lma_address): Delete.
7623 (Memory_region::increment_vma_offset): Rename to
7624 increment_offset.
7625 (Memory_region::increment_lma_offset): Delete.
7626 (Memory_region::attributes_compatible): New method. Returns
7627 true if the provided section is compatible with the region.
7628 (Memory_region::get_last_section): New method. Returns the last
7629 section to use the region.
7630 (Memory_region::set_last_section): New method. Stores the last
7631 section to use the region.
7632 (Script_sections::block_in_region): New method. Returns true if
7633 a block of memory is contained within a region.
7634 (Script_sections::find_memory_region): New method. Locates a
7635 memory region to be used to set a VMA or LMA address.
7636 (Output_section_definition::set_section_addresses): Add code to
7637 check for addresses set by memory regions.
7638 (Output_segment::set_section_addresses): Remove memory region
7639 walking code.
7640 (Script_sections::create_segment): Add a warning if a header
7641 segment is created outside of any region.
7642 * script-sections.h (class Script_sections): Add prototypes for
7643 find_memory_region and block_in_region methods.
7644 * testsuite/memory_test.s: Use .long instead of .word.
7645 * testsuite/memory_test.t: Add some more output sections.
7646 * testsuite/memory_test.sh: Update expected output.
7647
a9bfd952
DK
76482010-10-02 Doug Kwan <dougkwan@google.com>
7649
7650 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
7651 defintion to symtab.h
7652 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
7653 declaration to defintion.
7654
bacff3ab
NC
76552010-10-01 Nick Clifton <nickc@redhat.com>
7656
7657 * expression.cc (eval): Replace dummy argument with NULL.
7658 (eval_maybe_dot): Check for a NULL result section pointer.
7659 (Symbol_expression::value): Likewise.
7660 (Dot_expression::value): Likewise.
7661 (BINARY_EXPRESSION): Likewise.
7662 (Max_expression::value): Likewise.
7663 (Min_expression::value): Likewise.
7664 (Absolute_expression::value): Likewise.
7665 (Addr_expression::value_from_output_section): Likewise.
7666 (Loaddddr_expression::value_from_output_section): Likewise.
7667 (Segment_start_expression::value): Likewise.
7668 * script-sections.cc
7669 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
7670 argument with NULL.
7671 (Sections_elememt_dot_assignment::set_section_addresses):
7672 Likewise.
7673 (Output_data_expression::do_write_to_buffer): Likewise.
7674 (Output_section_definition::finalize_symbols): Likewise.
7675 (Output_section_definition::set_section_addresses): Likewise.
7676
f81bc8b5
DK
76772010-09-30 Doug Kwan <dougkwan@google.com>
7678
7679 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
7680
c95e9f27
ST
76812010-09-28 Sriraman Tallam <tmsriram@google.com>
7682
7683 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 7684 function.
c95e9f27
ST
7685 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
7686 virtual function.
7687 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
7688 virtual function.
7689 * icf.cc (get_section_contents): Inline merge sections only when
7690 target allows it.
7691
3cac54d2
RW
76922010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7693
7694 * configure: Regenerate.
7695
2904037a
ILT
76962010-09-17 Ian Lance Taylor <iant@google.com>
7697
7698 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
7699 * testsuite/Makefile.am (memory_test.o): New target.
7700 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
7701 memory_test.t.
7702 * testsuite/Makefile.in: Rebuild.
2904037a 7703
bca7fb63
DK
77042010-09-17 Doug Kwan <dougkwan@google.com>
7705
7706 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
7707 defintion if relocation uses GOT entries of the symbol.
7708 * testsuite/icf_safe_test.sh: Fix test.
7709 * testsuite/icf_safe_so_test.sh: Fix test.
7710
4ef28648
CC
77112010-09-16 Cary Coutant <ccoutant@google.com>
7712
7713 * script_sections.cc (class Memory_region): Remove "NULL" from
7714 vector initializations.
7715
793990de
CC
77162010-09-15 Cary Coutant <ccoutant@google.com>
7717
7718 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
7719 Resolve forwarding symbols.
7720
81e015e2
DK
77212010-09-15 Doug Kwan <dougkwan@google.com>
7722
7723 * gold/testsuite/script_test_3.t: Add ARM special sections.
7724 * gold/testsuite/script_test_4.t: Same.
7725 * gold/testsuite/script_test_5.t: Same.
7726 * gold/testsuite/script_test_6.t: Same.
7727 * gold/testsuite/script_test_7.t: Same.
7728 * gold/testsuite/script_test_7.t: Same.
7729 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
7730
36171d64
CC
77312010-09-14 Cary Coutant <ccoutant@google.com>
7732
7733 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
7734 (Target_x86_64::Relocate::relocate_tls): Replace check for
7735 saw_tls_block_reloc_ with test for executable section.
7736
d89051bd
CC
77372010-09-12 Cary Coutant <ccoutant@google.com>
7738
7739 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
7740 position-independent executables to shared libraries need dynamic
7741 relocations.
7742 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
7743 position-independent executables.
7744 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
7745 * testsuite/Makefile.in: Regenerate.
7746
fca41f0f
NC
77472010-09-10 Nick Clifton <nickc@redhat.com>
7748
7749 PR gold/11997
7750 * testsuite/memory_test.t: Discard any sections that are not
7751 needed.
7752
6695e4b3
L
77532010-09-09 H.J. Lu <hongjiu.lu@intel.com>
7754
7755 PR gold/11996
7756 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
7757 "This::" to work around a bug in gcc 4.2.
7758
7759 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
7760
0f72bf6f
RÁE
77612010-09-09 Rafael Espindola <espindola@google.com>
7762
7763 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
7764 sections with different PF_X flags in the same segment.
7765 (Layout::find_first_load_seg): Search all segments to find the first
7766 one.
7767 * options.h (rosegment): New.
7768
77692010-09-08 Rafael Espindola <espindola@google.com>
a6577478 7770
05a79166 7771 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 7772
aa98ff75
DK
77732010-09-08 Doug Kwan <dougkwan@google.com>
7774
7775 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
7776 (Arm_relobj::do_relocate_sections): Add new parameter for output
7777 file to match the parent.
7778 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
7779 of local symbols instead of input values. Update code to track
7780 changes in gold::relocate_section.
7781 * object.cc (Sized_relobj::compute_final_local_value): New methods.
7782 (Sized_relobj::compute_final_local_value_internal): New methods.
7783 (Sized_relobj::do_finalize_local_symbols): Move code from loop
7784 body into private version of Sized_relobj::compute_final_local_value.
7785 Call the inline method.
7786 * object.h (Symbol_value::Symbol_value): Define destructor. Free
7787 merged symbol value if there is one.
7788 (Symbol_value::has_output_value): New method defintiion.
7789 (Sized_relobj::Compute_final_local_value_status): New enum type.
7790 (Sized_relobj::compute_final_local_value): New methods.
7791 (Sized_relobj::compute_final_local_value_internal): New methods.
7792 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
7793 and arm_cortex_a8.sh.
7794 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
7795 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
7796 New tests.
7797 * Makefile.in: Regenerate.
7798 * testsuite/arm_bl_out_of_range.s: Update test.
7799 * testsuite/thumb_bl_out_of_range.s: Ditto.
7800 * testsuite/thumb_blx_out_of_range.s: Ditto.
7801 * testsuite/arm_branch_out_of_range.sh: New file.
7802 * testsuite/arm_cortex_a8.sh: Ditto.
7803 * testsuite/arm_cortex_a8_b.s: Ditto.
7804 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
7805 * testsuite/arm_cortex_a8_b_local.s: Ditto.
7806 * testsuite/arm_cortex_a8_bl.s: Ditto.
7807 * testsuite/arm_cortex_a8_blx.s: Ditto.
7808 * testsuite/arm_cortex_a8_local.s: Ditto.
7809 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
7810 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
7811
05a79166
L
78122010-09-08 Rafael Espindola <espindola@google.com>
7813
7814 * Makefile.am (memory_test.stdout): Run readelf with -W.
7815 * Makefile.in: Regenerate.
7816 * testsuite/memory_test.sh: Make the regexps accept both 32 and
7817 64 bit output.
7818
33dbc701
RÁE
78192010-09-08 Rafael Espindola <espindola@google.com>
7820
7821 * script-sections.cc (Script_sections::add_memory_region): Convert
7822 field precision to int.
7823 * script.cc (script_set_section_region, script_set_section_region):
7824 Convert field precision to int.
7825
731ca54a
RÁE
78262010-09-08 Rafael Espindola <espindola@google.com>
7827
7828 * arm.cc (do_finalize_sections): Create the __exidx_start and
7829 __exdix_end symbols even when the section is missing.
7830
7f8cd844
NC
78312010-09-08 Nick Clifton <nickc@redhat.com>
7832
7833 * README: Remove claim that MEMORY is not supported.
7834 * expression.cc (script_exp_function_origin)
7835 (script_exp_function_length): Move from here to ...
7836 * script.cc: ... here.
7837 (script_set_section_region, script_add_memory)
7838 (script_parse_memory_attr, script_include_directive): New
7839 functions.
7840 * script-sections.cc
7841 (class Memory_region): New class.
7842 (class Output_section_definition): Add set_memory_region,
7843 set_section_vma, set_section_lma and get_section_name methods.
7844 (class Script_Sections): Add add_memory_region,
7845 find_memory_region, find_memory_region_origin,
7846 find_memory_region_length and set_memory_region methods.
7847 Have set_section_addresses method walk the list of set memory
7848 regions.
7849 Extend the print methos to display memory regions.
7850 * script-sections.h: Add prototypes for new methods.
7851 Add enum for MEMORY region attributes.
7852 * yyscript.y: Add support for parsing MEMORY regions.
7853 * script-c.h: Add prototypes for new functions.
7854 * testsuite/Makefile.am: Add test of MEMORY region functionality.
7855 * testsuite/Makefile.in: Regenerate.
7856 * testsuite/memory_test.sh: New script.
7857 * testsuite/memory_test.s: New assembler source file.
7858 * testsuite/memory_test.t: New linker script.
7859
a4649286
DK
78602010-08-27 Doug Kwan <dougkwan@google.com>
7861
7862 * gold/resolve.cc (Symbol_table::should_override): Let a weak
7863 reference override an existing dynamic weak reference.
7864 * testsuite/Makefile.am: Add new test dyn_weak_ref.
7865 * testsuite/Makefile.in: Regenerate.
7866 * testsuite/dyn_weak_ref.sh: New file.
7867 * testsuite/dyn_weak_ref_1.c: Ditto.
7868 * testsuite/dyn_weak_ref_2.c: Ditto.
7869
b56648ad
ILT
78702010-08-27 Ian Lance Taylor <iant@google.com>
7871
7872 * incremental.h (class Incremental_input_entry): Add virtual
7873 destructor.
7874
809313cb
ILT
78752010-08-27 Ian Lance Taylor <iant@google.com>
7876
7877 * testsuite/start_lib_test_3.c: Mark t3 as used.
7878
11e32464
NC
78792010-08-27 Nick Clifton <nickc@redhat.com>
7880
7881 * options.cc (version_script): Fix small typo in previous
7882 whitespace tidyup.
7883
ca09d69a
NC
78842010-08-25 Nick Clifton <nickc@redhat.com>
7885
7886 * archive.cc: Formatting fixes: Remove whitespace between
7887 typename and following asterisk. Remove whitespace between
7888 function name and opening parenthesis.
7889 * archive.h: Likewise.
7890 * arm.cc: Likewise.
7891 * attributes.cc: Likewise.
7892 * attributes.h: Likewise.
7893 * common.cc: Likewise.
7894 * copy-relocs.cc: Likewise.
7895 * dirsearch.h: Likewise.
7896 * dynobj.cc: Likewise.
7897 * ehframe.cc: Likewise.
7898 * ehframe.h: Likewise.
7899 * expression.cc: Likewise.
7900 * fileread.cc: Likewise.
7901 * fileread.h: Likewise.
7902 * gc.h: Likewise.
7903 * gold-threads.cc: Likewise.
7904 * gold.cc: Likewise.
7905 * i386.cc: Likewise.
7906 * icf.h: Likewise.
7907 * incremental-dump.cc: Likewise.
7908 * incremental.cc: Likewise.
7909 * layout.cc: Likewise.
7910 * layout.h: Likewise.
7911 * main.cc: Likewise.
7912 * merge.cc: Likewise.
7913 * merge.h: Likewise.
7914 * object.cc: Likewise.
7915 * object.h: Likewise.
7916 * options.cc: Likewise.
7917 * options.h: Likewise.
7918 * output.cc: Likewise.
7919 * output.h: Likewise.
7920 * plugin.cc: Likewise.
7921 * plugin.h: Likewise.
7922 * powerpc.cc: Likewise.
7923 * reloc.cc: Likewise.
7924 * script-c.h: Likewise.
7925 * script-sections.cc: Likewise.
7926 * script.cc: Likewise.
7927 * stringpool.cc: Likewise.
7928 * symtab.cc: Likewise.
7929 * symtab.h: Likewise.
7930 * target.cc: Likewise.
7931 * timer.cc: Likewise.
7932 * timer.h: Likewise.
7933 * version.cc: Likewise.
7934 * x86_64.cc: Likewise.
7935
b8fa8750
NC
79362010-08-24 Nick Clifton <nickc@redhat.com>
7937
7938 PR 11899
7939 * layout.cc (segment_precedes): Sort segments by their physical
7940 addresses, if they have been set.
7941
9919d93b
CC
79422010-08-23 Cary Coutant <ccoutant@google.com>
7943
7944 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
7945 symbols data.
7946 (Lib_group::include_member): Unlock object after deleting its
7947 symbols data.
7948 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
7949 the bug fixed here.
7950
97b4be1c
CC
79512010-08-19 Neil Vachharajani <nvachhar@google.com>
7952 Cary Coutant <ccoutant@google.com>
7953
7954 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
7955 constructor, and set_blocker.
7956 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
7957 readsyms_blocker_.
7958 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
7959 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
7960 * testsuite/Makefile.am (start_lib_test): New test case.
7961 * testsuite/Makefile.in: Regenerate.
7962 * testsuite/start_lib_test_main.c: New file.
7963 * testsuite/start_lib_test_1.c: New file.
7964 * testsuite/start_lib_test_2.c: New file.
7965 * testsuite/start_lib_test_3.c: New file.
7966
dd0b1884
ILT
79672010-08-19 Ian Lance Taylor <iant@google.com>
7968
7969 * Makefile.in: Rebuild with automake 1.11.1.
7970 * aclocal.m4: Likewise.
7971 * testsuite/Makefile.in: Likewise.
7972
7223e9ca
ILT
79732010-08-19 Ian Lance Taylor <iant@google.com>
7974
7975 PR 10893
7976 * i386.cc (class Output_data_plt_i386): Update declarations.
7977 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
7978 local_ifuncs_ fields.
7979 (Target_i386::do_plt_section_for_global): New function.
7980 (Target_i386::do_plt_section_for_local): New function.
7981 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
7982 parameter; change all callers. Initialize global_ifuncs_ and
7983 local_ifuncs_. If doing a static link define __rel_iplt_start and
7984 __rel_iplt_end.
7985 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
7986 (Output_data_plt_i386::add_local_ifunc_entry): New function.
7987 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
7988 symbols.
7989 (Target_i386::make_plt_section): New function, broken out of
7990 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
7991 (Target_i386::make_plt_entry): Call make_plt_section.
7992 (Target_i386::make_local_ifunc_plt_entry): New function.
7993 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
7994 (Target_i386::Scan::local): Handle IFUNC symbols. Add
7995 R_386_IRELATIVE to switch.
7996 (Target_i386::Scan::global): Likewise.
7997 (Target_i386::Relocate::relocate): Likewise.
7998 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
7999 switch.
8000 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
8001 (Target_x86_64::do_plt_section_for_global): New function.
8002 (Target_x86_64::do_plt_section_for_local): New function.
8003 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
8004 parameter; change all callers. If doing a static link define
8005 __rela_iplt_start and __rela_iplt_end.
8006 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
8007 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
8008 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
8009 to point to .plt.
8010 (Target_x86_64::make_local_ifunc_plt_entry): New function.
8011 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
8012 switch.
8013 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
8014 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
8015 R_X86_64_IRELATIVE to switch.
8016 (Target_x86_64::Scan::global): Likewise.
8017 (Target_x86_64::Relocate::relocate): Likewise.
8018 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
8019 switch.
8020 * target.h (class Target): Add plt_section_for_global and
8021 plt_section_for_local functions. Add do_plt_section_for_global
8022 and do_plt_section_for_local virtual functions.
8023 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
8024 clarifying comments.
8025 (Symbol::use_plt_offset): Handle IFUNC symbol.
8026 * object.cc (Sized_relobj::Sized_relobj): Initialize
8027 local_plt_offsets_.
8028 (Sized_relobj::local_has_plt_offset): New function.
8029 (Sized_relobj::local_plt_offset): New function.
8030 (Sized_relobj::set_local_plt_offset): New function.
8031 (Sized_relobj::do_count): Handle IFUNC symbol.
8032 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
8033 a bit away from input_shndx_ field. Add set_is_func_symbol and
8034 is_ifunc_symbol functions.
8035 (class Sized_relobj): Update declarations. Remove Tls_got_entry
8036 and Local_tls_got_offsets. Define Local_plt_offsets. Add
8037 local_plt_offsets_ field.
8038 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
8039 * output.h (class Output_section_data): Add non-const
8040 output_section function.
8041 (class Output_data_got): Update declarations.
8042 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
8043 Add use_plt_offset parameter to global and local constructors.
8044 Change all callers. Change local_sym_index_ field to 31 bits.
8045 Change GSYM_CODE and CONSTANT_CODE accordingly.
8046 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
8047 doing a static link don't set sh_link field.
8048 (Output_data_got::Got_entry::write): Use PLT offset if
8049 appropriate.
8050 (Output_data_got::add_global_plt): New function.
8051 (Output_data_got::add_local_plt): New function.
8052 * target-reloc.h (relocate_section): Handle IFUNC symbol.
8053 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
8054 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
8055 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
8056 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
8057 IFUNC conditional.
8058 * testsuite/ifunc-sel.h: New file.
8059 * testsuite/ifuncmain1.c: New file.
8060 * testsuite/ifuncmain1vis.c: New file.
8061 * testsuite/ifuncmod1.c: New file.
8062 * testsuite/ifuncdep2.c: New file.
8063 * testsuite/ifuncmain2.c: New file.
8064 * testsuite/ifuncmain3.c: New file.
8065 * testsuite/ifuncmod3.c: New file.
8066 * testsuite/ifuncmain4.c: New file.
8067 * testsuite/ifuncmain5.c: New file.
8068 * testsuite/ifuncmod5.c: New file.
8069 * testsuite/ifuncmain6pie.c: New file.
8070 * testsuite/ifuncmod6.c: New file.
8071 * testsuite/ifuncmain7.c: New file.
8072 * configure, testsuite/Makefile.in: Rebuild.
8073
56f75c03
ILT
80742010-08-18 Ian Lance Taylor <iant@google.com>
8075
8076 * incremental.cc
8077 (Output_section_incremental_inputs::write_input_files): Add cast
8078 to avoid signed/unsigned comparison warning.
8079 (Output_section_incremental_inputs::write_info_blocks): Likewise.
8080
55455f89
CC
80812010-08-12 Cary Coutant <ccoutant@google.com>
8082
8083 * common.cc (Sort_commons::operator()): Remove unnecessary code.
8084
e2054bcb
ILT
80852010-08-13 Ian Lance Taylor <iant@google.com>
8086
8087 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
8088
74f67560
DK
80892010-08-12 Cary Coutant <ccoutant@google.com>
8090 Doug Kwan <dougkwan@google.com>
8091
8092 * resolve.cc (Symbol_table::should_override): When a weak dynamic
8093 defintion overrides non-weak undef, remember that the original undef
8094 is not weak.
8095 * symtab.cc (Symbol_table::sized_write_global): For undef without
8096 an original weak binding, set binding to global in output.
8097 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
8098 * testsuite/Makefile.in: Regenerate.
8099 * testsuite/strong_ref_weak_def.sh: New file.
8100 * testsuite/strong_ref_weak_def_1.c: Ditto.
8101 * testsuite/strong_ref_weak_def_2.c: Ditto.
8102
d1238d12
CC
81032010-08-12 Cary Coutant <ccoutant@google.com>
8104
8105 * testsuite/incremental_test.sh: Rewrite.
8106 * testsuite/incremental_test_1.c: Rewrite.
8107 * testsuite/incremental_test_2.c: Rewrite.
8108
0e70b911
CC
81092010-08-12 Cary Coutant <ccoutant@google.com>
8110
8111 * arm.cc (Target_arm::got_size): Add const.
8112 (Target_arm::got_entry_count): New function.
8113 (Target_arm::plt_entry_count): New function.
8114 (Target_arm::first_plt_entry_offset): New function.
8115 (Target_arm::plt_entry_size): New function.
8116 (Output_data_plt_arm::entry_count): New function.
8117 (Output_data_plt_arm::first_plt_entry_offset): New function.
8118 (Output_data_plt_arm::get_plt_entry_size): New function.
8119 * i386.cc (Target_i386::got_size): Add const.
8120 (Target_i386::got_entry_count): New function.
8121 (Target_i386::plt_entry_count): New function.
8122 (Target_i386::first_plt_entry_offset): New function.
8123 (Target_i386::plt_entry_size): New function.
8124 (Output_data_plt_i386::entry_count): New function.
8125 (Output_data_plt_i386::first_plt_entry_offset): New function.
8126 (Output_data_plt_i386::get_plt_entry_size): New function.
8127 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
8128 find_incremental_inputs_sections. Dump incremental_got_plt section.
8129 * incremental.cc: Include target.h.
8130 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
8131 parameter. Adjust all callers. Find incremental_got_plt section.
8132 (Incremental_inputs::create_data_sections): Create incremental_got_plt
8133 section.
8134 (Output_section_incremental_inputs::set_final_data_size): Calculate
8135 size of incremental_got_plt section.
8136 (Output_section_incremental_inputs::do_write): Write the
8137 incremental_got_plt section.
8138 (Got_plt_view_info): New struct.
8139 (Local_got_offset_visitor): New class.
8140 (Global_got_offset_visitor): New class.
8141 (Global_symbol_visitor_got_plt): New class.
8142 (Output_section_incremental_inputs::write_got_plt): New function.
8143 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
8144 Add parameter. Adjust all callers.
8145 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8146 (Incremental_inputs::got_plt_section): New function.
8147 (Incremental_inputs::got_plt_section_): New data member.
8148 (Incremental_got_plt_reader): New class.
8149 * layout.cc (Layout::create_incremental_info_sections): Add the
8150 incremental_got_plt section.
8151 * object.h (Got_offset_list::get_list): New function.
8152 (Got offset_list::for_all_got_offsets): New function.
8153 (Sized_relobj::local_got_offset_list): New function.
8154 * powerpc.cc (Target_powerpc::got_size): Add const.
8155 (Target_powerpc::got_entry_count): New function.
8156 (Target_powerpc::plt_entry_count): New function.
8157 (Target_powerpc::first_plt_entry_offset): New function.
8158 (Target_powerpc::plt_entry_size): New function.
8159 (Output_data_plt_powerpc::entry_count): New function.
8160 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
8161 (Output_data_plt_powerpc::get_plt_entry_size): New function.
8162 * sparc.cc (Target_sparc::got_size): Add const.
8163 (Target_sparc::got_entry_count): New function.
8164 (Target_sparc::plt_entry_count): New function.
8165 (Target_sparc::first_plt_entry_offset): New function.
8166 (Target_sparc::plt_entry_size): New function.
8167 (Output_data_plt_sparc::entry_count): New function.
8168 (Output_data_plt_sparc::first_plt_entry_offset): New function.
8169 (Output_data_plt_sparc::get_plt_entry_size): New function.
8170 * symtab.h (Symbol::got_offset_list): New function.
8171 (Symbol_table::for_all_symbols): New function.
8172 * target.h (Sized_target::got_entry_count): New function.
8173 (Sized_target::plt_entry_count): New function.
8174 (Sized_target::plt_entry_size): New function.
8175 * x86_64.cc (Target_x86_64::got_size): Add const.
8176 (Target_x86_64::got_entry_count): New function.
8177 (Target_x86_64::plt_entry_count): New function.
8178 (Target_x86_64::first_plt_entry_offset): New function.
8179 (Target_x86_64::plt_entry_size): New function.
8180 (Output_data_plt_x86_64::entry_count): New function.
8181 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
8182 (Output_data_plt_x86_64::get_plt_entry_size): New function.
8183
09ec0418
CC
81842010-08-12 Cary Coutant <ccoutant@google.com>
8185
8186 * archive.cc: Include incremental.h.
8187 (Archive::Archive): Initialize incremental_info_.
8188 (Archive::include_member): Record archive members in incremental info.
8189 (Add_archive_symbols::run): Record begin and end of an archive in
8190 incremental info.
8191 (Lib_group::include_member): Record objects in incremental info.
8192 * archive.h (Incremental_archive_entry): Forward declaration.
8193 (Archive::set_incremental_info): New member function.
8194 (Archive::incremental_info): New member function.
8195 (Archive::Unused_symbol_iterator): New class.
8196 (Archive::unused_symbols_begin): New member function.
8197 (Archive::unused_symbols_end): New member function.
8198 (Archive::incremental_info_): New data member.
8199 * incremental-dump.cc (find_input_containing_global): New function.
8200 (dump_incremental_inputs): Dump new incremental info sections.
8201 * incremental.cc: Include symtab.h.
8202 (Output_section_incremental_inputs): New class.
8203 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
8204 new incremental info sections.
8205 (Sized_incremental_binary::do_check_inputs): Likewise.
8206 (Incremental_inputs::report_archive): Remove.
8207 (Incremental_inputs::report_archive_begin): New function.
8208 (Incremental_inputs::report_archive_end): New function.
8209 (Incremental_inputs::report_object): New function.
8210 (Incremental_inputs::finalize_inputs): Remove.
8211 (Incremental_inputs::report_input_section): New function.
8212 (Incremental_inputs::report_script): Rewrite.
8213 (Incremental_inputs::finalize): Do nothing but finalize string table.
8214 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8215 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8216 (Incremental_inputs::create_data_sections): New function.
8217 (Incremental_inputs::relocs_entsize): New function.
8218 (Output_section_incremental_inputs::set_final_data_size): New function.
8219 (Output_section_incremental_inputs::do_write): New function.
8220 (Output_section_incremental_inputs::write_header): New function.
8221 (Output_section_incremental_inputs::write_input_files): New function.
8222 (Output_section_incremental_inputs::write_info_blocks): New function.
8223 (Output_section_incremental_inputs::write_symtab): New function.
8224 * incremental.h (Incremental_script_entry): Forward declaration.
8225 (Incremental_object_entry): Forward declaration.
8226 (Incremental_archive_entry): Forward declaration.
8227 (Incremental_inputs): Forward declaration.
8228 (Incremental_inputs_header_data): Remove.
8229 (Incremental_inputs_header): Remove.
8230 (Incremental_inputs_header_write): Remove.
8231 (Incremental_inputs_entry_data): Remove.
8232 (Incremental_inputs_entry): Remove.
8233 (Incremental_inputs_entry_write): Remove.
8234 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
8235 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
8236 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8237 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
8238 Likewise.
8239 (Incremental_input_entry): New class.
8240 (Incremental_script_entry): New class.
8241 (Incremental_object_entry): New class.
8242 (Incremental_archive_entry): New class.
8243 (Incremental_inputs::Incremental_inputs): Initialize new data members.
8244 (Incremental_inputs::report_inputs): Remove.
8245 (Incremental_inputs::report_archive): Remove.
8246 (Incremental_inputs::report_archive_begin): New function.
8247 (Incremental_inputs::report_archive_end): New function.
8248 (Incremental_inputs::report_object): Change prototype.
8249 (Incremental_inputs::report_input_section): New function.
8250 (Incremental_inputs::report_script): Change prototype.
8251 (Incremental_inputs::get_reloc_count): New function.
8252 (Incremental_inputs::set_reloc_count): New function.
8253 (Incremental_inputs::create_data_sections): New function.
8254 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8255 (Incremental_inputs::inputs_section): New function.
8256 (Incremental_inputs::symtab_section): New function.
8257 (Incremental_inputs::relocs_section): New function.
8258 (Incremental_inputs::get_stringpool): Add const.
8259 (Incremental_inputs::command_line): Add const.
8260 (Incremental_inputs::inputs): Remove.
8261 (Incremental_inputs::command_line_key): New function.
8262 (Incremental_inputs::input_file_count): New function.
8263 (Incremental_inputs::input_files): New function.
8264 (Incremental_inputs::relocs_entsize): New function.
8265 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8266 (Incremental_inputs::finalize_inputs): Remove.
8267 (Incremental_inputs::Input_info): Remove.
8268 (Incremental_inputs::lock_): Remove.
8269 (Incremental_inputs::inputs_): Change type.
8270 (Incremental_inputs::inputs_map_): Remove.
8271 (Incremental_inputs::current_object_entry_): New data member.
8272 (Incremental_inputs::inputs_section_): New data member.
8273 (Incremental_inputs::symtab_section_): New data member.
8274 (Incremental_inputs::relocs_section_): New data member.
8275 (Incremental_inputs::reloc_count_): New data member.
8276 (Incremental_inputs_reader): New class.
8277 (Incremental_symtab_reader): New class.
8278 (Incremental_relocs_reader): New class.
8279 * layout.cc (Layout::finalize): Move finalization of incremental info
8280 and creation of incremental info sections to follow finalization of
8281 symbol table. Set offsets for postprocessing sections.
8282 (Layout::create_incremental_info_sections): Call
8283 Incremental_inputs::create_data_sections. Add incremental symtab
8284 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
8285 sections to layout after input sections.
8286 * layout.h (struct Timespec): Forward declaration.
8287 (Layout::incremental_inputs): Add const.
8288 (Layout::create_incremental_info_sections): Add parameter.
8289 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
8290 * object.cc: Include incremental.h.
8291 (Relobj::finalize_incremental_relocs): New function.
8292 (Sized_relobj::do_layout): Record input sections in incremental info.
8293 * object.h (Object::output_section): New function.
8294 (Object::output_section_offset): Moved from Relobj.
8295 (Object::get_incremental_reloc_base): New function.
8296 (Object::get_incremental_reloc_count): New function.
8297 (Object::do_output_section): New function.
8298 (Object::do_output_section_offset): Moved from Relobj.
8299 (Object::do_get_incremental_reloc_base): New function.
8300 (Object::do_get_incremental_reloc_count): New function.
8301 (Object::Object): Initialize new data members.
8302 (Relobj::output_section): Renamed do_output_section and moved to
8303 protected.
8304 (Relobj::output_section_offset): Moved to Object.
8305 (Relobj::do_get_incremental_reloc_base): New function.
8306 (Relobj::do_get_incremental_reloc_count): New function.
8307 (Relobj::allocate_incremental_reloc_counts): New function.
8308 (Relobj::count_incremental_reloc): New function.
8309 (Relobj::finalize_incremental_relocs): New function.
8310 (Relobj::next_incremental_reloc_index): New function.
8311 (Relobj::reloc_counts_): New data member.
8312 (Relobj::reloc_bases_): New data member.
8313 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
8314 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
8315 (Sized_relobj::incremental_relocs_scan): New function.
8316 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8317 (Sized_relobj::incremental_relocs_write): New function.
8318 (Sized_relobj::incremental_relocs_write_reltype): New function.
8319 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
8320 incremental link.
8321 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
8322 archives and object files elsewhere.
8323 (Add_symbols::run): Report object files here.
8324 (Finish_group::run): Report end of archive at end of group.
8325 * reloc.cc: Include layout.h, incremental.h.
8326 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
8327 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
8328 (Sized_relobj::incremental_relocs_scan): New function.
8329 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8330 (Sized_relobj::do_relocate_sections): Write incremental relocations.
8331 (Sized_relobj::incremental_relocs_write): New function.
8332 (Sized_relobj::incremental_relocs_write_reltype): New function.
8333 * script.cc (read_input_script): Rewrite test for incremental link.
8334 Change call to Incremental_inputs::report_script.
8335 * symtab.h (Symbol_table::first_global_index): New function.
8336 (Symbol_table::output_count): New function.
8337
ce0d1972
DK
83382010-08-12 Doug Kwan <dougkwan@google.com>
8339
8340 * arm.cc (Target_arm::merge_object_attributes): Check command line
8341 options --no-wchar-size-warning and --no-enum-size-warning.
8342 * options.h (General_options): Add ld-compatible options
8343 --no-enum-size-warning and --no-wchar-size-warning.
8344
6e5710ce
ILT
83452010-08-04 Ian Lance Taylor <iant@google.com>
8346
8347 * x86_64.cc (Target_x86_64::Scan::local): Use
8348 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
8349 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
8350 (Target_x86_64::Scan::global): Likewise.
8351 (Target_x86_64::Relocate::relocate): Likewise.
8352 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
8353 Likewise.
8354
fef830db
CC
83552010-08-03 Cary Coutant <ccoutant@google.com>
8356
8357 * merge.cc (Output_merge_string::do_add_input_section): Count strings
8358 to reserve space in merged_strings vector. Keep total input size
8359 for stats.
8360 (Output_merge_string::do_print_merge_stats): Print total input size.
8361 * merge.h (Output_merge_string): Add input_size_ field.
8362 * stringpool.cc (Stringpool_template::string_length): Move
8363 implementations out of Stringpool_template class and place in
8364 stringpool.h.
8365 * stringpool.h (string_length): Move out of Stringpool_template.
8366
1e3811b0
ILT
83672010-08-03 Ian Lance Taylor <iant@google.com>
8368
8369 PR 11712
8370 * layout.cc (relaxation_loop_body): If address of load segment is
8371 set, adjust address to include headers if possible.
8372
7af0c620
ILT
83732010-08-03 Ian Lance Taylor <iant@google.com>
8374
8375 * version.cc (version_string): Bump to 1.10.
8376
22f0da72
ILT
83772010-08-03 Ian Lance Taylor <iant@google.com>
8378
8379 PR 11805
8380 * layout.h (enum Output_section_order): Define.
8381 (class Layout): Update declarations.
8382 * layout.cc (Layout::get_output_section): Add order parameter.
8383 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
8384 is_first_non_relro parameters. Change all callers.
8385 (Layout::choose_output_section): Likewise.
8386 (Layout::add_output_section_data): Likewise.
8387 (Layout::make_output_section): Likewise. Set order.
8388 (Layout::default_section_order): New function.
8389 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
8390 * output.cc (Output_section::Output_section): Initialize order_.
8391 Don't initialize deleted fields.
8392 (Output_segment::Output_segment): Don't initialize deleted
8393 fields.
8394 (Output_segment::add_output_section_to_load): New function
8395 replacing add_output_section. Change all callers to call this or
8396 add_output_section_to_nonload.
8397 (Output_segment::add_output_section_to_nonload): New function.
8398 (Output_segment::remove_output_section): Rewrite.
8399 (Output_segment::add_initial_output_data): Likewise.
8400 (Output_segment::has_any_data_sections): Likewise.
8401 (Output_segment::is_first_section_relro): Likewise.
8402 (Output_segment::maximum_alignment): Likewise.
8403 (Output_segment::has_dynamic_reloc): New function replacing
8404 dynamic_reloc_count. Change all callers.
8405 (Output_segment::has_dynamic_reloc_list): New function replacing
8406 dynamic_reloc_count_list. Change all callers.
8407 (Output_segment::set_section_addresses): Rewrite.
8408 (Output_segment::set_offset): Rewrite.
8409 (Output_segment::find_first_and_last_list): Remove.
8410 (Output_segment::set_tls_offsets): Rewrite.
8411 (Output_segment::first_section_load_address): Likewise.
8412 (Output_segment::output_section_count): Likewise.
8413 (Output_segment::section_with_lowest_load_address): Likewise.
8414 (Output_segment::write_section_headers): Likewise.
8415 (Output_segment::print_sections_to_map): Likewise.
8416 * output.h (class Output_data): Remove dynamic_reloc_count_
8417 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
8418 (Output_data::add_dynamic_reloc): Rewrite.
8419 (Output_data::has_dynamic_reloc): New function.
8420 (Output_data::dynamic_reloc_count): Remove.
8421 (class Output_section): Add order_ field. Remvoe is_relro_local_,
8422 is_last_relro_, is_first_non_relro_, is_interp_,
8423 is_dynamic_linker_section_ fields. Add order and set_order
8424 functions. Remove is_relro_local, set_is_relro_local,
8425 is_last_relro, set_is_last_relro, is_first_non_relro,
8426 set_is_first_non_relro functions, is_interp, set_is_interp,
8427 is_dynamic_linker_section, and set_is_dynamic_linker_section
8428 functions.
8429 (class Output_segment): Change Output_data_list from std::list to
8430 std:;vector. Add output_lists_ field. Remove output_data_ and
8431 output_bss_ fields. Update declarations.
8432
3ff2ccb0
ILT
84332010-08-02 Ian Lance Taylor <iant@google.com>
8434
8435 * arm.cc (Target_arm::gc_process_relocs): Use typename.
8436 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
8437 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
8438
88a4108b
ILT
84392010-08-02 Ian Lance Taylor <iant@google.com>
8440
8441 PR 11855
8442 * script.cc (Script_options::Script_options): Initialize
8443 symbol_definitions_ and symbol_references_.
8444 (Script_options::add_symbol_assignment): Update
8445 symbol_definitions_ and symbol_references_.
8446 (Script_options::add_symbol_reference): New function.
8447 (script_symbol): New function.
8448 * script.h (class Script_options): Add symbol_definitions_ and
8449 symbol_references_ fields.
8450 (Script_options::referenced_const_iterator): New type.
8451 (Script_options::referenced_begin): New function.
8452 (Script_options::referenced_end): New function.
8453 (Script_options::is_referenced): New function.
8454 (Script_options::any_unreferenced): New function.
8455 * script-c.h (script_symbol): Declare.
8456 * yyscript.y (exp): Call script_symbol.
8457 * symtab.cc: Include "script.h".
8458 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
8459 Change all callers. Check symbols referenced by scripts.
8460 (Symbol_table::add_undefined_symbols_from_command_line): Add
8461 layout parameter. Change all callers.
8462 (Symbol_table::do_add_undefined_symbols_from_command_line):
8463 Likewise. Break out loop body. Check symbols referenced by
8464 scripts.
8465 (Symbol_table::add_undefined_symbol_from_command_line): New
8466 function broken out of
8467 do_add_undefined_symbols_from_command_line.
8468 * symtab.h (class Symbol_table): Update declarations.
8469 * archive.cc: Include "layout.h".
8470 (Archive::should_include_member): Add layout parameter. Change
8471 all callers. Check for symbol mentioned in expression.
8472 * archive.h (class Archive): Update declaration.
8473 * object.cc (Sized_relobj::do_should_include_member): Add layout
8474 parameter.
8475 * object.h (Object::should_include_member): Add layout parameter.
8476 Change all callers.
8477 (Object::do_should_include_member): Add layout parameter.
8478 (class Sized_relobj): Update declaration.
8479 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
8480 parameter.
8481 * dynobj.h (class Sized_dynobj): Update declaration.
8482 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
8483 layout parameter.
8484 * plugin.h (class Sized_pluginobj): Update declaration.
8485
5f1ab67a
ILT
84862010-08-02 Ian Lance Taylor <iant@google.com>
8487
8488 PR 11866
8489 * output.cc (Output_segment::set_offset): Search for the first and
8490 last sections rather than assuming that the list is in order.
8491 (Output_segment::find_first_and_last_list): New function.
8492 * output.h (class Output_segment): Update declarations.
8493 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
8494 (relro_strip_test_SOURCES): New variable.
8495 (relro_strip_test_DEPENDENCIES): New variable.
8496 (relro_strip_test_LDFLAGS): New variable.
8497 (relro_strip_test_LDADD): New variable.
8498 (relro_strip_test.so): New target.
8499
a8df5856
ILT
85002010-08-02 Ian Lance Taylor <iant@google.com>
8501
8502 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
8503 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
8504 (Target_i386::got_tlsdesc_section): New function.
8505 (Target_i386::got_section): Create space for GOT entries for
8506 TLSDESC relocations.
8507 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
8508 R_386_TLS_GOTDESC.
8509 (Target_i386::Scan::global): Likewise.
8510 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
8511 using TLSDESC GOT.
8512 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
8513 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
8514 (Target_x86_64::got_tlsdesc_section): New function.
8515 (Target_x86_64::got_section): Create space for GOT entries for
8516 TLSDESC relocations.
8517 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
8518 R_386_TLS_GOTDESC.
8519 (Target_x86_64::Scan::global): Likewise.
8520 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
8521 using TLSDESC GOT.
8522
0c10a0a6
ILT
85232010-08-02 Ian Lance Taylor <iant@google.com>
8524
8525 * testsuite/final_layout.sh: Use dc to convert from hex to
8526 decimal.
8527
41cbeecc
ST
85282010-07-29 Sriraman Tallam <tmsriram@google.com>
8529
8530 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
8531 paramter to the call to gold::gc_process_relocs.
8532 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
8533 paramter to the call to gold::gc_process_relocs.
8534 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
8535 parameter to the call to gold::gc_process_relocs.
8536 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
8537 template parameter to the call to gold::gc_process_relocs.
8538 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
8539 paramter to the call to gold::gc_process_relocs.
8540 * gc.h (get_embedded_addend_size): New function.
8541 (gc_process_relocs): Save the size of the reloc for use by ICF.
8542 * icf.cc (get_section_contents): Get the addend from the text section
8543 for SHT_REL relocation sections.
8544 * icf.h (Icf::Reloc_addend_size_info): New typedef.
8545 (Icf::Reloc_info): Add new member reloc_addend_size_info.
8546 * int_encoding.h (read_from_pointer): New overloaded function.
8547 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
8548 * testsuite/icf_sht_rel_addend_test.sh: New file.
8549 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
8550 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
8551
6ea55b82
RW
85522010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8553
8554 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
8555 * Makefile.in: Regenerate.
8556 * testsuite/Makefile.in: Regenerate.
8557
9691462b
ILT
85582010-07-27 Jeffrey Yasskin <jyasskin@google.com>
8559
8560 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
8561 * gold/testsuite/debug_msg.cc: Likewise.
8562 * gold/testsuite/odr_violation1.cc
8563 * gold/testsuite/odr_violation2.cc
8564
76897331
CC
85652010-07-21 Cary Coutant <ccoutant@google.com>
8566
8567 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
8568 string, and length fields.
8569 (Output_merge_string::Merged_strings_list): New type.
8570 (Output_merge_string::Merged_strings_lists): New typedef.
8571 (Output_merge_string): Replace merged_strings_ with
8572 merged_strings_lists_.
8573 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
8574 Merged_strings_list per input object and section. Don't store pointer
8575 to the string. Don't store length with each merged string entry.
8576 (Output_merge_string::finalize_merged_data): Loop over list of merged
8577 strings lists. Recompute length of each merged string.
8578
78384e8f
CC
85792010-07-15 Cary Coutant <ccoutant@google.com>
8580
8581 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
8582 here.
8583
783659f9
ILT
85842010-07-14 Ian Lance Taylor <iant@google.com>
8585
8586 * descriptors.cc (Descriptors::open): Report correct name in error
8587 message.
8588
131687b4
DK
85892010-07-13 Doug Kwan <dougkwan@google.com>
8590
8591 * arm.cc (Arm_input_section::Arm_input_section): For a
8592 SHT_ARM_EXIDX section, always keeps the input sections.
8593 (Arm_input_section::set_exidx_section_link): New method.
8594 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
8595 has_errors_ to false.
8596 (Arm_exidx_input_section::has_errors,
8597 Arm_exidx_input_section::set_has_errors): New methods.
8598 (Arm_exidx_input_section::has_errors_): New data member.
8599 (Arm_relobj::get_exidx_shndx_list): New method.
8600 (Arm_output_section::append_text_sections_to_list): Do not skip
8601 section without SHF_EXECINSTR.
8602 (Arm_output_section::fix_exidx_coverage): Skip input sections with
8603 errors.
2e702c99 8604 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
8605 section header. Make error messages more verbose. Check for
8606 a non-executable section linked to an EXIDX section.
8607 (Arm_relobj::do_read_symbols): Remove error checking, which has been
8608 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
8609 check that there is no deferred EXIDX section if we exit early.
8610 Instead of not making an EXIDX section in case of an error, make one
8611 and set the has_errors flag of it.
8612 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
8613 in a relocatable link.
8614 (Target_arm::do_relax): Look for the EXIDX output section instead of
8615 assuming that it is called .ARM.exidx.
2e702c99 8616 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
8617 section list. Do not check for SHF_EXECINSTR section flags but
8618 skip any input section with errors.
8619 * output.cc (Output_section::Output_section): Initialize
8620 always_keeps_input_sections_ to false.
8621 (Output_section::add_input_section): Check for
8622 always_keeps_input_sections_.
8623 * output.h (Output_section::always_keeps_input_sections,
8624 Output_section::set_always_keeps_input_sections): New methods.
8625 (Output_section::always_keeps_input_sections): New data member.
8626
69517287
RÁE
86272010-07-13 Rafael Espindola <espindola@google.com>
8628
8629 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
8630 * fileread.h (Input_file): Add try_extra_search_path and find_file.
8631
82742395
ILT
86322010-07-13 Philip Herron <herron.philip@googlemail.com>
8633 Ian Lance Taylor <iant@google.com>
8634
8635 * output.h (Output_section_lookup_maps::add_merge_section):
8636 Correct check of whether value was inserted.
8637 (Output_section_lookup_maps::add_merge_input_section): Likewise.
8638 (Output_section_lookup_maps::add_relaxed_input_section):
8639 Likewise.
8640 * arm.cc (Target_arm::got_section): Remove used local os.
8641 * i386.cc (Target_i386::got_section): Likewise.
8642 * x86_64.cc (Target_x86_64::got_section): Likewise.
8643 * sparc.cc (Target_sparc::got_section): Likewise.
8644 (Target_sparc::relocate): Remove unused local have_got_offset.
8645 * powerpc.cc (Target_powerpc::relocate): Likewise.
8646
f2d707b5
ILT
86472010-07-13 Ian Lance Taylor <iant@google.com>
8648
241531d6
ILT
8649 * compressed_output.cc (zlib_decompress): Fix signature in
8650 !HAVE_ZLIB_H case.
8651
f2d707b5
ILT
8652 * archive.cc (Archive::include_member): Unlock an external member
8653 of a thin archive. Don't bother to delete an object we know is
8654 NULL.
8655
a2e47362
CC
86562010-07-12 Cary Coutant <ccoutant@google.com>
8657
8658 * compressed_output.cc (zlib_decompress): New function.
8659 (get_uncompressed_size): New function.
8660 (decompress_input_section): New function.
8661 * compressed_output.h (get_uncompressed_size): New function.
8662 (decompress_input_section): New function.
8663 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
8664 Handle compressed debug sections.
8665 * layout.cc (is_compressed_debug_section): New function.
8666 (Layout::output_section_name): Map compressed section names to
8667 canonical names.
8668 * layout.h (is_compressed_debug_section): New function.
8669 (is_debug_info_section): Recognize compressed debug sections.
8670 * merge.cc: Include compressed_output.h.
8671 (Output_merge_data::do_add_input_section): Handle compressed
8672 debug sections.
8673 (Output_merge_string::do_add_input_section): Handle compressed
8674 debug sections.
8675 * object.cc: Include compressed_output.h.
8676 (Sized_relobj::Sized_relobj): Initialize new data members.
8677 (build_compressed_section_map): New function.
8678 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
8679 * object.h (Object::section_is_compressed): New method.
8680 (Object::do_section_is_compressed): New method.
8681 (Sized_relobj::Compressed_section_map): New type.
8682 (Sized_relobj::do_section_is_compressed): New method.
8683 (Sized_relobj::compressed_sections_): New data member.
8684 * output.cc (Output_section::add_input_section): Handle compressed
8685 debug sections.
8686 * reloc.cc: Include compressed_output.h.
8687 (Sized_relobj::write_sections): Handle compressed debug sections.
8688
ce279a62
CC
86892010-07-08 Cary Coutant <ccoutant@google.com>
8690
8691 * resolve.cc (Symbol_table::resolve): Remember whether undef was
8692 weak when resolving to a dynamic def.
8693 (Symbol_table::should_override): Add adjust_dyndef flag; set it
8694 for weak undef/dynamic def cases. Adjust callers.
8695 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
8696 undef_binding_weak_.
8697 (Symbol_table::sized_write_globals): Adjust symbol binding.
8698 (Symbol_table::sized_write_symbol): Add binding parameter.
8699 * symtab.h (Symbol::set_undef_binding): New method.
8700 (Symbol::is_undef_binding_weak): New method.
8701 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
8702 (Symbol_table::should_override): Add new parameter.
8703 (Symbol_table::sized_write_symbol): Add new parameter.
8704
8705 * testsuite/weak_undef_file1.cc: Add new test case.
8706 * testsuite/weak_undef_file2.cc: Fix header comment.
8707 * testsuite/weak_undef_test.cc: Add new test case.
8708
b2286c10
DK
87092010-06-29 Doug Kwan <dougkwan@google.com>
8710
8711 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
8712 Initialize USE_SYMBOL_.
8713 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
8714 definition.
8715 (Arm_reloc_property::uses_symbol_): New data member declaration.
8716 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
8717 uses symbol value and symbol is undefined but not weakly undefined.
8718
4802450a
RÁE
87192010-06-28 Rafael Espindola <espindola@google.com>
8720
8721 * plugin.cc (Plugin::load): Use dlerror.
8722
e5ca47ba
ILT
87232010-06-26 Jeffrey Yaskin <jyasskin@google.com>
8724
8725 * symtab.cc (detect_odr_violations): When reporting an ODR
8726 violation, report an object where the symbol is defined.
8727
8a75a161
DK
87282010-06-25 Doug Kwan <dougkwan@google.com>
8729
8730 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
8731 (Target_arm::section_may_have_icf_unsafe_pointers): New method
8732 definition.
8733 (Target_arm::Scan::local_reloc_may_be_function_pointer,
8734 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
8735 target hook to detect function points.
8736 (Target_arm::Scan::possible_function_pointer_reloc): New method.
8737 * icf.h (Icf::check_section_for_function_pointers): Change type of
8738 parameter SECTION_NAME to const reference to std::string. Use
8739 target hook to determine if section may have unsafe pointers.
8740 * target.h (Target::section_may_have_icf_unsafe_pointers): New
8741 method definition.
8742
42218b9f
RÁE
87432010-06-21 Rafael Espindola <espindola@google.com>
8744
8745 * fileread.cc (Input_file::find_fie): New
8746 (Input_file::open): Use Input_file::find_fie.
8747 * fileread.h (Input_file::find_fie): New
8748 * plugin.cc (set_extra_library_path): New.
8749 (Plugin::load): Add set_extra_library_path to the transfer vector.
8750 (Plugin_manager::set_extra_library_path): New.
8751 (Plugin_manager::add_input_file): Use the extra search path if set.
8752 (set_extra_library_path(): New.
8753 * plugin.h (Plugin_manager): Add set_extra_library_path and
8754 extra_search_path_.
8755
a0506cca
CC
87562010-06-19 Cary Coutant <ccoutant@google.com>
8757
8758 * layout.cc (gdb_sections): Add .debug_types.
8759 (lines_only_debug_sections): Likewise.
8760
6508b958
RÁE
87612010-06-18 Rafael Espindola <espindola@google.com>
8762
8763 * plugin.cc (add_input_file,add_input_library)
8764 (Plugin_manager::add_input_file): Make filename arguments const.
8765 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
8766 const.
8767
3e235302
DK
87682010-06-16 Doug Kwan <dougkwan@google.com>
8769
8770 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
8771 .ARM.attributes section if we have not merged any input
8772 attributes sections.
8773
106e8a6c
DK
87742010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8775
8776 * arm.cc: Allow combining objects with no EABI version
8777 information.
8778
91ff43fe
RÁE
87792010-06-15 Rafael Espindola <espindola@google.com>
8780
8781 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
8782
68ed838c
ILT
87832010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8784
8785 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
8786 (struct iovec): Correct !HAVE_READV definition.
8787
f3a2388f
CC
87882010-06-10 Cary Coutant <ccoutant@google.com>
8789
8790 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
8791 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
8792 reloc sections.
8793 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
8794
8795 PR 11683
8796 * symtab.h (Symbol::is_placeholder): New member function.
8797 * target-reloc.h (relocate_section): Check for placeholder symbols.
8798
8799 * testsuite/Makefile.am (plugin_test_8): New test.
8800 (plugin_test_9): New test.
8801 * testsuite/Makefile.in: Regenerate.
8802
e1df38aa
NC
88032010-06-09 Nick Clifton <nickc@redhat.com>
8804
8805 * yyscript.y (input_list_element): Allow strings prefixed with
8806 the '-' character. Treat these as libraries.
8807 * script.cc (script_add_library): New function. Adds a library
8808 specified by "-l<name>" found in an input script.
8809 * script-c.h: Add prototype for script_add_library.
8810
25bbe950
DK
88112010-06-07 Doug Kwan <dougkwan@google.com>
8812
8813 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
8814 Restrict stub-group size to be within long conditional branch
8815 range when working around cortex-A8 erratum.
8816
0f32ea4c
ILT
88172010-06-07 Damien Diederen <dd@crosstwine.com>
8818
8819 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
8820 #ifdef typo.
8821
8fe2a369
ST
88222010-06-03 Sriraman Tallam <tmsriram@google.com>
8823
8824 PR gold/11658
8825 * output.cc
8826 (Output_section::Input_section_sort_entry::compare_section_ordering):
8827 Change to return non-zero correctly.
8828 (Output_section::Input_section_sort_section_order_index_compare
8829 ::operator()): Change to fix ambiguity in comparisons.
8830
6e9ba2ca
ST
88312010-06-01 Sriraman Tallam <tmsriram@google.com>
8832
8833 * gold.h (is_wildcard_string): New function.
8834 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
8835 (Layout::layout_eh_frame): Ditto.
8836 (Layout::find_section_order_index): New method.
8837 (Layout::read_layout_from_file): New method.
8838 * layout.h (Layout::find_section_order_index): New method.
8839 (Layout::read_layout_from_file): New method.
8840 (Layout::input_section_position_): New private member.
8841 (Layout::input_section_glob_): New private member.
8842 * main.cc (main): Call read_layout_from_file here.
8843 * options.h (--section-ordering-file): New option.
8844 * output.cc (Output_section::input_section_order_specified_): New
8845 member.
8846 (Output_section::Output_section): Initialize new member.
8847 (Output_section::add_input_section): Add new parameter.
8848 Keep input sections when --section-ordering-file is used.
8849 (Output_section::set_final_data_size): Sort input sections when
8850 section ordering file is specified.
8851 (Output_section::Input_section_sort_entry): Add new parameter.
8852 Check sorting type.
8853 (Output_section::Input_section_sort_entry::compare_section_ordering):
8854 New method.
8855 (Output_section::Input_section_sort_compare::operator()): Change to
8856 consider section_order_index.
8857 (Output_section::Input_section_sort_init_fini_compare::operator()):
8858 Change to consider section_order_index.
8859 (Output_section::Input_section_sort_section_order_index_compare
8860 ::operator()): New method.
8861 (Output_section::sort_attached_input_sections): Change to sort
8862 according to section order when specified.
e1df38aa
NC
8863 (Output_section::add_input_section<32, true>): Add new parameter.
8864 (Output_section::add_input_section<64, true>): Add new parameter.
8865 (Output_section::add_input_section<32, false>): Add new parameter.
8866 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
8867 * output.h (Output_section::add_input_section): Add new parameter.
8868 (Output_section::input_section_order_specified): New
8869 method.
8870 (Output_section::set_input_section_order_specified): New method.
8871 (Input_section::Input_section): Initialize section_order_index_.
8872 (Input_section::section_order_index): New method.
8873 (Input_section::set_section_order_index): New method.
8874 (Input_section::section_order_index_): New member.
8875 (Input_section::Input_section_sort_section_order_index_compare): New
8876 struct.
8877 (Output_section::input_section_order_specified_): New member.
8878 * script-sections.cc (is_wildcard_string): Delete and move modified
8879 method to gold.h.
8880 (Output_section_element_input::Output_section_element_input): Modify
8881 call to is_wildcard_string.
8882 (Output_section_element_input::Input_section_pattern
8883 ::Input_section_pattern): Ditto.
8884 (Output_section_element_input::Output_section_element_input): Ditto.
8885 * testsuite/Makefile.am (final_layout): New test case.
8886 * testsuite/Makefile.in: Regenerate.
8887 * testsuite/final_layout.cc: New file.
8888 * testsuite/final_layout.sh: New file.
8889
3537c84b
RÁE
88902010-06-01 Rafael Espindola <espindola@google.com>
8891
8892 * plugin.cc (Plugin::load): Pass the output name to the plugin.
8893
105b6afd
RÁE
88942010-06-01 Rafael Espindola <espindola@google.com>
8895
8896 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
8897 visibility of symbols.
8898
29e11421
DK
88992010-05-27 Doug Kwan <dougkwan@google.com>
8900
8901 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
8902 from start of output section instead of address for a local symbol
8903 in a merged or relaxed section when doing a relocatable link.
8904
5e0f337e
RÁE
89052010-05-26 Rafael Espindola <espindola@google.com>
8906
703d02da 8907 PR 11604
5e0f337e
RÁE
8908 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
8909 adding sections the garbage collector removed.
8910 * gold/testsuite/Makefile.am: Add test.
8911 * gold/testsuite/Makefile.in: Regenerate.
8912 * gold/testsuite/plugin_test_7.sh: New.
8913 * gold/testsuite/plugin_test_7_1.c: New.
8914 * gold/testsuite/plugin_test_7_2.c: New.
8915
f4187277
RÁE
89162010-05-26 Rafael Espindola <espindola@google.com>
8917
8918 * script-sections.cc (Output_section_definition::set_section_addresses):
8919 Check for --section-start.
8920
5c388529
DK
89212010-05-26 Doug Kwan <dougkwan@google.com>
8922
8923 * arm.cc (Arm_scan_relocatable_relocs): New class.
8924 (Target_arm::relocate_special_relocatable): New method.
8925 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
8926 (Arm_relocate_functions::thumb_branch_common): Same.
8927 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
8928 instead of Default_scan_relocatable_relocs.
8929 * target-reloc.h (relocate_for_relocatable): Let target handle
8930 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
8931 * target.h (Sized_target::relocate_special_relocatable): New method.
8932
bca1c3ae
ILT
89332010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8934
8935 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
8936
0439c796
DK
89372010-05-23 Doug Kwan <dougkwan@google.com>
8938
8939 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
8940 instead of a cast.
8941 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
8942 with a direct branch, not a conditional branch, to a stub.
8943 * merge.cc (Output_merge_base::record_input_section): New method
8944 defintion.
8945 (Output_merge_data::do_add_input_section): Record input section if
8946 keeps-input-sections flag is set.
8947 (Output_merge_string::do_add_input_section): Ditto.
8948 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
8949 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
8950 INPUT_SECTIONS_.
8951 (Output_merge_base::keeps_input_sections,
8952 Output_merge_base::set_keeps_input_sections,
8953 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
8954 method definitions.
8955 (Output_merge_base::Input_sections): New type declaration.
8956 (Output_merge_base::input_sections_begin,
8957 Output_merge_base::input_sections_end,
8958 Output_merge_base::do_set_keeps_input_sections): New method definitions.
8959 (Output_merge_base::bool keeps_input_sections_,
8960 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
8961 Output_merge_base::input_sections_): New data members.
8962 (Output_merge_data::do_set_keeps_input_sections): New method
8963 defintion.
8964 (Output_merge_string::do_set_keeps_input_sections): Ditto.
8965 * output.cc (Output_section::Input_section::relobj): Move method
8966 defintion from class declaration to here and handle merge sections.
8967 (Output_section::Input_section::shndx): Ditto.
8968 (Output_section::Output_section): Remove initializations of removed
8969 data members and initialize new data member LOOKUP_MAPS_.
8970 (Output_section::add_input_section): Set keeps-input-sections flag
8971 for a newly created merge output section as appropriate. Adjust code
8972 to use Output_section_lookup_maps class.
8973 (Output_section::add_relaxed_input_section): Adjst code for lookup
8974 maps code refactoring.
2e702c99 8975 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
8976 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
8977 class. If adding input section to a newly created merge output
8978 section fails, remove the new merge section.
8979 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 8980 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 8981 (Output_section::find_merge_section): Ditto.
0439c796 8982 (Output_section::build_lookup_maps): New method defintion.
2e702c99 8983 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
8984 Output_section_lookup_maps class.
8985 (Output_section::get_input_sections): Export merge sections. Adjust
8986 code to use Output_section_lookup_maps class.
8987 (Output_section:::add_script_input_section): Adjust code to use
8988 Output_section_lookup_maps class. Update lookup maps for merge
8989 sections also.
8990 (Output_section::discard_states): Use Output_section_lookup_maps.
8991 (Output_section::restore_states): Same.
8992 * output.h (Merge_section_properties): Move class defintion out of
8993 Output_section.
8994 (Output_section_lookup_maps): New class.
8995 (Output_section::Input_section::is_merge_section): New method
8996 defintion.
8997 (Output_section::Input_section::relobj): Move defintion out of class
8998 defintion. Declare method only.
8999 (Output_section::Input_section::shndx): Ditto.
9000 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 9001 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
9002 (Output_section::Merge_section_by_properties_map,
9003 Output_section::Output_section_data_by_input_section_map,
9004 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
9005 Remove types.
2e702c99 9006 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
9007 KEEPS_INPUT_SECTIONS.
9008 (Output_section::build_lookup_maps): New method declaration.
9009 (Output_section::merge_section_map_,
9010 Output_section::merge_section_by_properties_map_,
9011 Output_section::relaxed_input_section_map_,
9012 Output_section::is_relaxed_input_section_map_valid_): Remove data
9013 members.
9014 (Output_section::lookup_maps_): New data member.
9015
76295588
L
90162010-05-21 Doug Kwan <dougkwan@google.com>
9017
9018 PR gold/11619
9019 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
9020 avoid a compilation error.
9021
d103a984
RÁE
90222010-05-19 Rafael Espindola <espindola@google.com>
9023
9024 * script-sections.cc (Output_section_definition::allocate_to_segment):
9025 Update the phdrs_list even when the output section is NULL.
9026 * testsuite/Makefile.am: Add test.
9027 * testsuite/Makefile.in: Regenerate.
9028 * testsuite/script_test_9.cc: New.
9029 * testsuite/script_test_9.sh: New.
9030 * testsuite/script_test_9.t: New.
9031
6625d24e
DK
90322010-05-19 Doug Kwan <dougkwan@google.com>
9033
9034 * arm.cc (Arm_input_section::original_size): New method.
9035 (Arm_input_section::do_addralign): Add a cast.
9036 (Arm_input_section::do_output_offset): Remove static cast.
9037 (Arm_input_section::original_addralign,
9038 Arm_input_section::original_size_): Change type to uint32_t.
9039 (Arm_input_section::init): Add safe casts for section alignment
9040 and size.
9041 (Arm_input_section::set_final_data_size): Do not set address and
9042 offset of stub table.
9043 (Arm_output_section::fix_exidx_coverage): Change use of of
9044 Output_section::Simple_input_section to that of
9045 Output_section::Input_section.
9046 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
9047 except for the first pass.
9048 * output.cc (Output_section::get_input_sections): Change type of
9049 input_sections to std::list<Input_section>.
9050 (Output_section::add_script_input_section): Rename from
9051 Output_section::add_simple_input_section. Change type of SIS
9052 parameter from Simple_input_section to Input_section.
9053 * output.h (Output_section::Simple_input_section): Remove class.
9054 (Output_section::Input_section): Change class visibility to public.
9055 (Output_section::Input_section::addralign): Use stored alignments
9056 for special input sections if set.
9057 (Output_section::Input_section::set_addralign): New method.
9058 (Output_section::get_input_sections): Change parameter type from
9059 list of Simple_input_section to list of Input_section.
9060 (Output_section::add_script_input_section): Rename from
9061 Output_section::add_simple_input_section. Change first parameter's
9062 type from Simple_input_section to Input_section and remove the
9063 second and third parameters.
9064 * script-sections.cc (Input_section::Input_section_list): Change
9065 type to list of Output_section::Input_section/
9066 (Input_section_info::Input_section_info): Change parameter type of
9067 INPUT_SECTION to Output_section::Input_section.
9068 (Input_section_info::input_section): Change return type.
9069 (Input_section_info::input_section_): Change type to
9070 Output_section::Input_section.
9071 (Output_section_element_input::set_section_addresses): Adjust code
9072 to use Output_section::Input_section instead of
9073 Output_section::Simple_input_section. Adjust code for renaming
9074 of Output_section::add_simple_input_section.
9075 (Orphan_output_section::set_section_addresses): Ditto.
9076
e1e82ea4
RW
90772010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9078
9079 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
9080 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
9081
91e75c8a
RÁE
90822010-05-18 Rafael Espindola <espindola@google.com>
9083
9084 * options.cc (General_options::finalize): Handle -nostdlib.
9085 * options.h (nostdlib): New option.
9086 * script.cc (script_add_search_dir): Handle -nostdlib.
9087
da59ad79
DK
90882010-05-12 Doug Kwan <dougkwan@google.com>
9089
9090 * arm.cc (Target_arm::do_finalize_sections): Create an empty
9091 attributes section only if there no attributes section after merging.
9092 (Target_arm::merge_object_attributes): Move value of
e1df38aa 9093 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
9094 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
9095 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
9096 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
9097 and arm_attr_merge_7.stdout.
9098 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
9099 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
9100 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
9101 arm_attr_merge_7b.o): New rules.
9102 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
9103 arm_attr_merge_7
9104 * testsuite/Makefile.in: Regenerate.
9105 * testsuite/arm_attr_merge.sh: New file.
9106 * testsuite/arm_attr_merge_[67][ab].s: Same.
9107
3e01a7fd
NC
91082010-05-05 Nick Clifton <nickc@redhat.com>
9109
9110 * po/es.po: Updated Spanish translation.
9111
7ad2014a
L
91122010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9113
9114 * Makefile.am (install-exec-local): Properly install gold as
9115 default cross linker.
9116 * Makefile.in: Regenerated.
9117
4fda8867
NC
91182010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9119 Nick Clifton <nickc@redhat.com>
9120
9121 * configure.ac (install_as_default): Define and set to false
9122 unless --enable-gold or --enable-gold=both/gold has been
9123 specified.
9124 * configure: Regenerate.
9125
9126 * Makefile.am (install-exec-local): Install the executable as
9127 'ld.gold'. If install_as_default is true then also install it as
9128 'ld'.
9129 * Makefile.in: Regenerated.
9130
bd288ea2
ILT
91312010-04-24 Ian Lance Taylor <iant@google.com>
9132
9133 * layout.cc (Layout::layout_reloc): In relocatable link don't
9134 combine reloc sections for grouped sections.
9135
ef38fd8a
ST
91362010-04-23 Sriraman Tallam <tmsriram@google.com>
9137
9138 * gc.h (gc_process_relocs): Pass information on relocs pointing to
9139 sections that are not ordinary to icf.
9140 * icf.cc (get_section_contents): Handle relocation pointing to section
9141 with no object or shndx information.
9142 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
9143 * testsuite/Makefile.in: Regenerate.
9144 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
9145 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
9146
f6973bdc
ILT
91472010-04-22 Ian Lance Taylor <iant@google.com>
9148
9149 * expression.cc (Expression::Expression_eval_info): Add
9150 result_alignment_pointer field.
9151 (Expression::eval_with_dot): Add result_alignment_pointer
9152 parameter. Change all callers.
9153 (Expression::eval_maybe_dot): Likewise.
9154 (class Binary_expression): Add alignment_pointer parameter to
9155 left_value and right_value. Change all callers.
9156 (BINARY_EXPRESSION): Set result alignment.
9157 (class Trinary_expression): Add alignment_pointer parameter to
9158 arg2_value and arg3_value. Change all callers.
9159 (Trinary_cond::value): Set result alignment.
9160 (Max_expression::value, Min_expression::value): Likewise.
9161 (Align_expression::value): Likewise.
9162 * script-sections.cc (class Sections_element): Add dot_alignment
9163 parameter to set_section_addresses virtual function. Update
9164 instantiations.
9165 (class Output_section_element): Likewise.
9166 (Script_sections::create_segments): Add dot_alignment parameter.
9167 Change all callers.
9168 (Script_sections::create_segments_from_phdrs_clause): Likewise.
9169 (Script_sections::set_phdrs_clause_addresses): Likewise.
9170 * script-sections.h: Update declarations.
9171 * script.h: Update declarations.
9172 * output.h (Output_segment::set_minimum_p_align): Don't decrease
9173 min_p_align.
9174 * testsuite/script_test_3.t: Set large alignment.
9175 * testsuite/script_test_3.sh: Make sure that at least one LOAD
9176 segment has expected alignment.
9177
9c9c98a5
NC
91782010-04-22 Nick Clifton <nickc@redhat.com>
9179
9180 * po/gold.pot: Updated by the Translation project.
9181 * po/vi.po: Updated Vietnamese translation.
9182
2253bfba
L
91832010-04-22 H.J. Lu <hongjiu.lu@intel.com>
9184
9185 * testsuite/Makefile.am (check_PROGRAMS): Add
9186 icf_virtual_function_folding_test.
9187 * testsuite/Makefile.in: Regenerated.
9188
85fdf906
AH
91892010-04-15 Andrew Haley <aph@redhat.com>
9190
9191 * options.h (merge_exidx_entries): New option.
9192 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
9193 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
9194 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
9195 (Target_arm::merge_exidx_entries): New function.
9196 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
9197 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
9198 to Arm_exidx_fixup constructor.
9199 Add new arg, merge_exidx_entries.
9200 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
9201 Arm_output_section::fix_exidx_coverage.
9202
ce97fa81
ST
92032010-04-18 Sriraman Tallam <tmsriram@google.com>
9204
9205 * icf.cc (get_section_contents): Check for preemptible functions.
9206 Ignore addend when appropriate.
9207 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
9208 section folded.
9209 (add_from_relobj): Check for section folded.
9210 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
9211 * symtab.h (should_add_dynsym_entry): Add new parameter.
9212 * target-reloc.h (scan_relocs): Check for section folded.
9213 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
9214 Check reloc types for function pointers in shared objects.
9215 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
9216 case.
9217 (icf_preemptible_functions_test): New test case.
9218 (icf_string_merge_test): New test case.
9219 * testsuite.Makefile.in: Regenerate.
9220 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
9221 bar_glob. Refactor code.
9222 * testsuite/icf_preemptible_functions_test.cc: New file.
9223 * testsuite/icf_preemptible_functions_test.sh: New file.
9224 * testsuite/icf_string_merge_test.cc: New file.
9225 * testsuite/icf_string_merge_test.sh: New file.
9226 * testsuite/icf_virtual_function_folding_test.cc: New file.
9227 * testsuite/icf_virtual_function_folding_test.sh: New file.
9228
04ceb17c
DK
92292010-04-14 Doug Kwan <dougkwan@google.com>
9230
9231 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
9232 for local symbol recounting if we remove a section due to ICF.
9233 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
9234 there are no regular objects in input.
9235
153e7da4
DK
92362010-04-13 Doug Kwan <dougkwan@google.com>
9237
9238 * arm.cc (Arm_input_section::set_final_data_size): Compute
9239 accurate final data size instead of using current data size.
9240
4dbd9faf
DK
92412010-04-09 Doug Kwan <dougkwan@google.com>
9242
9243 * layout.cc (Layout::choose_output_section): Handle script section
9244 types.
9245 (Layout::make_output_section_for_script): Add section type parameter.
9246 Handle script section types.
9247 * layout.h (Layout::make_output_section_for_script): Add section
9248 type parameter.
9249 * output.cc (Output_section::Output_section): Initialize data member
9250 is_noload_.
9251 (Output_section::do_reset_address_and_file_offset): Do not set address
9252 to 0 if section is a NOLOAD section.
9253 * output.h (Output_section::is_noload): New method.
9254 (Output_section::set_is_noload): Ditto.
9255 (Output_section::is_noload_): New data member.
9256 * script-c.h (Script_section_type): New enum type.
9257 (struct Parser_output_section_header): Add new file section_type.
9258 * script-sections.cc (Sections_element::output_section_name): Add
9259 parameter for returning script section type.
9260 (Output_section_definition::output_section_name): Ditto.
9261 (Output_section_definition::section_type)P; New method.
9262 (Output_section_definiton::script_section_type_name): Ditto.
9263 (Output_section_definition::script_section_type_): New data member.
9264 (Output_section_definition::Output_section_definition): Initialize
9265 data member Output_section_definition::script_section_type_.
9266 (Output_section_definition::create_sections): Pass script section type
9267 to Layout::make_output_section_for_script.
9268 (Output_section_definition::output_section_name): Return script
9269 section type to caller.
9270 (Output_section_definition::set_section_address): Do not advance
9271 dot value and load address if section type is NOLOAD. Set address
9272 of NOLOAD sections regardless of section flags.
9273 (Output_section_definition::print): Print section type if it is
9274 not SCRIPT_SECTION_TYPE_NONE.
9275 (Output_section_definition::section_type): New method.
9276 (Output_section_definition::script_section_type_name): Ditto.
9277 (Script_sections::output_section_name): Add new parameter
9278 PSECTION_TYPE for returning script section type. Pass it to
9279 section elements. Handle discard sections.
9280 (Sort_output_sections::operator()): Handle NOLOAD sections.
9281 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 9282 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
9283 returning script section type.
9284 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
9285 INFO and NOLOAD.
9286 * yyscript.y (union): Add new field SECTION_TYPE.
9287 (COPY, DSECT, INFO, NOLOAD): New tokens.
9288 (opt_address_and_section_type): Change type to output_section_header.
9289 (section_type): New non-terminal
9290 (section_header): Handle section type.
2253bfba 9291 (opt_address_and_section_type): Return section type value.
4dbd9faf 9292
721ea635
L
92932010-04-09 H.J. Lu <hongjiu.lu@intel.com>
9294
9295 * testsuite/plugin_common_test_1.c (foo): Add prototype.
9296 * testsuite/plugin_common_test_2.c (foo): Likewise.
9297
6bf924b0
DK
92982010-04-08 Doug Kwan <dougkwan@google.com>
9299
9300 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
9301 Output_merge_data.
9302 * output.cc (Output_section::add_merge_input_section): Simplify
9303 code and return status of Output_merge_base::add_input_section.
e1df38aa 9304 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
9305 returns true.
9306
24af6f92
DK
93072010-04-07 Doug Kwan <dougkwan@google.com>
9308
9309 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
9310 if section is marked as containing instructions but has no mapping
9311 symbols.
9312 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
9313 correct section index.
9314 (Arm_relobj::find_linked_text_section): Ditto.
9315
00698fc5
CC
93162010-04-07 Cary Coutant <ccoutant@google.com>
9317
9318 * archive.cc (include_member): Destroy Read_symbols_data object before
9319 releasing file.
9320 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
9321 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
9322 (Read_symbols_data::~Read_symbols_data) New destructor.
9323 (Section_relocs::Section_relocs) New constructor.
9324 (Section_relocs::~Section_relocs) New destructor.
9325 (Read_relocs_data::Read_relocs_data) New constructor.
9326 (Read_relocs_data::~Read_relocs_data) New destructor.
9327 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
9328 pointers to NULL after deleting.
9329
7296d933
DK
93302010-04-07 Doug Kwan <dougkwan@google.com>
9331
9332 * arm.cc: Replace "endianity" with "endianness" in comments.
9333 (Arm_exidx_cantunwind): Ditto.
9334 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
9335 (Arm_relobj::merge_flags_and_attributes): New method.
9336 (Arm_relobj::merge_flags_and_attributes_): New data member.
9337 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
9338 (Arm_relobj::scan_sections_for_stubs): Ditto.
9339 (Arm_relobj::do_read_symbols): Check to see if we really want to
9340 merge processor-specific flags and attributes. Exit early if
9341 an object is empty except for section names and the undefined symbol.
9342 (Target_arm::do_finalize_sections): Move check for ELF format to
9343 Arm_relobj::do_read_symbols. Merge processor specific flags and
9344 attributes from a regular object only when we have determined that
9345 it is aapropriate. Do not create an .ARM.attributes section in
9346 output if there is no regular input object.
9347 (Target_arm::merge_processor_specific_flags): Check
9348 --warn-mismatch before printing any error.
9349 (Target_arm::merge_object_attributes): Ditto.
9350 * gold.cc (queue_middle_tasks): Handle the case in which there is
9351 no regular object in input.
9352 * options.cc (General_options::parse_EB): New method.
9353 (General_options::parse_EL): Same.
9354 (General_options::General_options): Initialize endianness_.
9355 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
9356 New options.
9357 (General_options::Endianness): New enum.
9358 (General_options::endianness): New method.
9359 (General_options::endianness_): New data member.
9360 * parameters.cc (Parameters::set_options): Check target endianness.
9361 (Parameters::set_target_once): Ditto.
9362 (Parameters::check_target_endianness): New method.
9363 (parameters_force_valid_target): If either -EL or -EB is specified,
9364 use it to define endianness of default target.
9365 * parameters.h (Parameters::check_target_endianness): New method
9366 declaration.
9367 * target.h (class Target): Change "endianity" to "endianness"
9368 in comments.
9369
efc8d4f2
RW
93702010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9371
9372 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
9373 * configure: Regenerate.
9374 * Makefile.in: Regenerate.
9375 * testsuite/Makefile.in: Regenerate.
9376
be234d88
CC
93772010-04-06 Cary Coutant <ccoutant@google.com>
9378
9379 gcc PR lto/42757
9380 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
9381 prevailing definitions of common symbols.
9382 * testsuite/plugin_test_6.sh: New test case.
9383 * testsuite/plugin_common_test_1.c: New test case.
9384 * testsuite/plugin_common_test_2.c: New test case.
9385 * testsuite/Makefile.am (plugin_test_6): New test case.
9386 * testsuite/Makefile.in: Regenerate.
9387
bd32c6bd
NC
93882010-04-06 Nick Clifton <nickc@redhat.com>
9389
9390 * po/vi.po: New Vietnamese translation.
9391
323c532f
DK
93922010-03-30 Doug Kwan <dougkwan@google.com>
9393
9394 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
9395
4fcd97eb
DK
93962010-03-25 Doug Kwan <dougkwan@google.com>
9397
9398 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
9399 to avoid a conversion warning on a 32-bit host.
9400
4ebf39db
ILT
94012010-03-24 Ian Lance Taylor <iant@google.com>
9402
9403 * testsuite/script_test_3.t: Add a TLS segment.
9404 * testsuite/Makefile.am (check_PROGRAMS): Add
9405 tls_phdrs_script_test.
9406 (tls_phdrs_script_test_SOURCES): Define.
9407 (tls_phdrs_script_test_DEPENDENCIES): Define.
9408 (tls_phdrs_script_test_LDFLAGS): Define.
9409 (tls_phdrs_script_test_LDADD): Define.
9410 * testsuite/Makefile.in: Rebuild.
9411
4a599bdd
CC
94122010-03-23 Cary Coutant <ccoutant@google.com>
9413
9414 * fileread.cc (find_or_make_view): Fix comment.
9415
6c93b22c
ILT
94162010-03-23 Ian Lance Taylor <iant@google.com>
9417
9418 * script-sections.cc (class Orphan_section_placement): Define
9419 PLACE_TLS and PLACE_TLS_BSS.
9420 (Orphan_section_placement::Orphan_section_placement): Initialize
9421 new places.
9422 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
9423 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
9424 (tls_script_test_SOURCES): Define.
9425 (tls_script_test_DEPENDENCIES): Define.
9426 (tls_script_test_LDFLAGS): Define.
9427 (tls_script_test_LDADD): Define.
9428 * testsuite/Makefile.in: Rebuild.
9429
a2c7281b
DK
94302010-03-22 Doug Kwan <dougkwan@google.com>
9431
9432 * arm.cc (Arm_relocate_functions::abs8,
9433 Arm_relocate_functions::abs16): Use correct check for overflow
9434 specified in the ARM ELF specs.
9435 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
9436 target of a BLX instruction specially.
9437 (Reloc_stub::stub_type_for_reloc): Ditto.
9438 (Relocate::relocate): Use symbolic names instead of numeric relocation
9439 codes to report error.
9440 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
9441 workaround.
9442 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
9443 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
9444 thumb2_blx_out_of_range.stdout
9445 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
9446 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
9447 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
9448 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
9449 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
9450 thumb2_blx_in_range, thumb2_blx_in_range.o,
9451 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
9452 thumb2_blx_out_of_range.o): New rules.
2e702c99 9453 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
9454 thumb2_blx_in_range and thumb2_blx_out_of_range.
9455 * testsuite/Makefile.in: Regenerate.
9456 * arm_branch_in_range.sh: Add tests for THUMB BLX.
9457 * testsuite/thumb_blx_in_range.s: New file.
9458 * testsuite/thumb_blx_out_of_range.s: New file.
9459
b0193076
RÁE
94602010-03-22 Rafael Espindola <espindola@google.com>
9461
9462 * archive.cc (Should_include): Move to archive.h.
9463 (should_include_member): Make it a member of Archive.
9464 (Lib_group): New.
9465 (Add_lib_group_symbols): New.
9466 * archive.h: Include options.h.
9467 (Archive_member): Moved from Archive.
9468 (Should_include): Moved from archive.cc.
9469 (Lib_group): New.
9470 (Add_lib_group_symbols): New.
9471 * dynobj.cc (do_should_include_member): New.
9472 * dynobj.h (do_should_include_member): New.
9473 * gold.cc (queue_initial_tasks): Update call to queue.
9474 * main.cc (main): Print lib group stats.
9475 * object.cc (do_should_include_member): New.
9476 * object.h: Include archive.h.
9477 (Object::should_include_member): New.
9478 (Object::do_should_include_member): New.
9479 (Sized_relobj::do_should_include_member): New.
9480 * options.cc (General_options::parse_start_lib): New.
9481 (General_options::parse_end_lib): New.
9482 (Input_arguments::add_file): Handle lib groups.
9483 (Input_arguments::start_group): Check we are not in a lib.
9484 (Input_arguments::start_lib): New.
9485 (Input_arguments::end_lib): New.
9486 * options.h (General_options): Add start_lib and end_lib.
9487 (Input_argument::lib_): New.
9488 (Input_argument::lib): New.
9489 (Input_argument::is_lib): New.
9490 (Input_file_lib): New.
9491 (Input_arguments::in_lib_): New.
9492 (Input_arguments::in_lib): New.
9493 (Input_arguments::start_lib): New.
9494 (Input_arguments::end_lib_): New.
9495 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
9496 in unused members as preempted.
9497 (Sized_pluginobj::do_should_include_member): New.
9498 * plugin.h (Sized_pluginobj::do_should_include_member): New.
9499 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
9500 return the blocker.
9501 (Read_symbols::do_whole_lib_group): New.
9502 (Read_symbols::do_lib_group): New.
9503 (Read_symbols::do_read_symbols): Handle lib groups.
9504 (Read_symbols::get_name): Handle lib groups.
9505 * readsyms.h (Read_symbols): Add an archive member pointer.
9506 (Read_symbols::do_whole_lib_group): New.
9507 (Read_symbols::do_lib_group): New.
9508 (Read_symbols::member_): New.
9509 * script.cc (read_input_script): Update call to queue_soon.
9510
d099120c
DK
95112010-03-19 Doug Kwan <dougkwan@google.com>
9512
9513 * arm.cc (Stub_table::Stub_table): Initialize new data members
9514 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9515 (Stub_table::add_reloc_stub): Assign stub offset and update
9516 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9517 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
9518 New data members.
2e702c99 9519 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
9520 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
9521 instead of going over all reloc stubs.
2e702c99 9522 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
9523 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9524 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 9525 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
9526 Stringpool_template::offset_.
9527 * stringpool.h (Stringpool_template::set_no_zero_null): Set
9528 Stringpool_template::offset_ to zero.
9529
1aa37384
DK
95302010-03-15 Doug Kwan <dougkwan@google.com>
9531
9532 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9533 offset_.
9534 (Stringpool_template::new_key_offset): New method.
9535 (Stringpool_template::add_string): Assign offsets when adding new
9536 strings.
9537 (Stringpool_template::set_string_offsets): Do not set string offsets
9538 when not optimizing.
9539 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
9540 member size_.
2e702c99
RM
9541 (Chunked_vector::clear): Clear size_.
9542 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
9543 (Chunked_vector::size): Return size_.
9544 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 9545 (Chunked_vector::size_): New data member.
1aa37384
DK
9546 (Stringpool_template::set_no_zero_null): Assert string set is empty.
9547 (Stringpool_template::new_key_offset): New method declaration.
9548 (Stringpool_template::offset_): New data member.
9549
b672b057
RÁE
95502010-03-15 Rafael Espindola <espindola@google.com>
9551
9552 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
9553 Add_symbols' constructor.
9554 * readsyms.h (Add_symbols): Remove the input_group member.
9555
b6848d3c
ILT
95562010-03-10 Ian Lance Taylor <iant@google.com>
9557
9558 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
9559 target to ask whether a reference to a symbol requires a stack
9560 split.
9561 * target.h (Target::is_call_to_non_split): New function.
9562 (Target::do_is_call_to_non_split): Declare virtual function.
9563 * target.cc: Include "symtab.h".
9564 (Target::do_is_call_to_non_split): New function.
9565 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
9566
a2a5469e
CC
95672010-03-10 Cary Coutant <ccoutant@google.com>
9568
9569 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
9570 (File_read::open[1]): Remove initial mapping of whole_file_view_.
9571 (File_read::open[2]): Add whole_file_view_ to list of views.
9572 (File_read::make_view): Remove test of whole_file_view_.
9573 (File_read::find_or_make_view): Create whole_file_view_ if
9574 necessary.
9575 (File_read::clear_views): Replace bool parameter with enum;
9576 adjust all callers. Don't delete views with permanent data;
9577 do delete cached views and views from archives if
9578 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
9579 if clearing the corresponding view.
9580 * fileread.h (File_read::Clear_views_mode): New enum.
9581 (File_read::View::is_permanent_view): New method.
9582 (File_read::clear_views): Replace bool parameter
9583 with enum; adjust all callers.
9584 * options.h (General_options): Change keep_files_mapped option;
9585 add map_whole_files.
9586 * readsyms.cc (Add_symbols::run): Delete sd_ object before
9587 releasing the file.
9588 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
9589 the file.
9590
8861f32b
DM
95912010-03-10 David S. Miller <davem@davemloft.net>
9592
9593 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
9594
d62d0f5f
ST
95952010-03-09 Sriraman Tallam <tmsriram@google.com>
9596
9597 * icf.cc (get_section_contents): Add '@' marker after processing the
9598 merge reloc.
9599
9177756d
DK
96002010-03-08 Doug Kwan <dougkwan@google.com>
9601
9602 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
9603 due to a conversion warning.
9604 (Arm_relobj::update_output_local_symbol_count): Check for local
9605 symbol with unset output index.
9606
9e9e071b
ILT
96072010-03-05 Ian Lance Taylor <iant@google.com>
9608
9609 * options.h (class General_options): Add --spare-dynamic-tags.
9610 * output.cc (Output_data_dynamic::set_final_data_size): Implement
9611 --spare-dynamic-tags.
9612
a81ee015
ILT
96132010-03-05 Ian Lance Taylor <iant@google.com>
9614
9615 * incremental.cc: Include "libiberty.h".
9616
44ec90b9
RO
96172010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
9618
9619 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
9620 function, is_info_ member.
9621 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
9622 (Versions::Versions): Update caller.
9623 (Versions::define_base_version): Likewise.
9624 (Versions::add_def): Likewise.
9625
0897ed3b
ST
96262010-03-03 Sriraman Tallam <tmsriram@google.com>
9627
9628 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
9629 (Scan::possible_function_pointer_reloc): New function.
9630 (Scan::local_reloc_may_be_function_pointer): Change to call
9631 possible_function_pointer_reloc.
9632 (Scan::global_reloc_may_be_function_pointer): Ditto.
9633 * icf.h (Icf::check_section_for_function_pointers): Change to reject
9634 relocations in ".data.rel.ro._ZTV" section.
9635 * testsuite/icf_safe_so_test.sh: Change to pass i386.
9636 * testsuite/icf_safe_so_test.cc: Ditto.
9637 * testsuite/icf_safe_test.cc: Ditto.
9638 * testsuite/icf_safe_test.sh: Ditto.
9639
d3bbad62
ILT
96402010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9641 Ian Lance Taylor <iant@google.com>
9642
9643 * target-reloc.h (relocate_section): Check the symbol table index
9644 for -1U before setting the local symbol index.
9645 (scan_relocatable_relocs): If copying the relocation, record that
9646 the local symbol is required.
9647 * object.h (Symbol_value::is_output_symtab_index_set): New
9648 function.
9649 (Symbol_value::may_be_discarded_from_output_symtab): New
9650 function.
9651 (Symbol_value::has_output_symtab_entry): New function.
9652 (Symbol_value::needs_output_symtab_entry): Remove.
9653 (Symbol_value::output_symtab_index): Make sure the symbol index is
9654 set.
9655 (Symbol_value::set_output_symtab_index): Make sure the symbol
9656 index is not set. Make sure the new index is valid.
9657 (Symbol_value::set_must_have_output_symtab_entry): New function.
9658 (Symbol_value::has_output_dynsym_entry): New function.
9659 (Symbol_value::set_output_dynsym_index): Make sure the new index
9660 is valid.
9661 (Sized_relobj::set_must_have_output_symtab_entry): New function.
9662 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
9663 local symbol if permitted.
9664 (Sized_relobj::do_finalize_local_symbols): Call
9665 is_output_symtab_index_set rather than needs_output_symtab_entry.
9666 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
9667 rather than needs_output_symtab_entry. Call
9668 has_output_dynsym_entry rather than needs_output_dynsym_entry.
9669 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
9670 is_output_symtab_index_set rather than needs_output_symtab_entry.
9671 * testsuite/discard_locals_relocatable_test.c: New file.
9672 * testsuite/discard_locals_test.sh: Test -r.
9673 * testsuite/Makefile.am (check_DATA): Add
9674 discard_locals_relocatable_test1.syms,
9675 discard_local_relocatable_test2.syms.
9676 (MOSTLYCLEANFILES): Likewise. Also add
9677 discard_locals_relocatable_test1.lout and
9678 discard_locals_relocatable_test2.out.
9679 (discard_locals_relocatable_test1.syms): New target.
9680 (discard_locals_relocatable_test.o): New target.
9681 (discard_locals_relocatable_test1.out): New target.
9682 (discard_locals_relocatable_test2.syms): New target.
9683 (discard_locals_relocatable_test2.out): New target.
9684 (various): Add missing ../ld-new dependencies.
9685 * testsuite/Makefile.in: Rebuild.
9686
7e8ccf26
NC
96872010-03-03 Nick Clifton <nickc@redhat.com>
9688
9689 * po/fi.po: New Finnish translation.
9690
2a0ff005
DK
96912010-03-01 Doug Kwan <dougkwan@google.com>
9692
9693 * layout.cc (Layout::Layout): Force section types of .init_array*,
9694 .preinit_array* and .fini_array* sections.
9695 * output.cc (Output_section::Input_section_sort_entry::has_priority):
9696 Fix check of return value of std::string::find.().
9697 (Output_section::Input_section_sort_compare::operator()): Remove
9698 comment about .init_array.
9699 (Output_section::Input_section_sort_init_fini_compare::operator()):
9700 New method.
9701 (Output_section::sort_attached_input_sections): Handle .init_array
9702 and .fini_array specially.
9703 * output.h (Output_section::Inut_section_sort_compare): Update
9704 comment.
9705 (Output_section::Input_section_sort_init_fini_compare): New struct.
9706
c3e4ae29
DK
97072010-02-26 Doug Kwan <dougkwan@google.com>
9708
9709 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
9710 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
9711 * testsuite/debug_msg.sh: Avoid matching source line number for
9712 use of global variable undef_int.
9713
2fd9ae7a
DK
97142010-02-26 Doug Kwan <dougkwan@google.com>
9715
9716 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
9717 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
9718 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
9719 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
9720 * options.cc (General_options::General_options): Initialize member
9721 fix_v4bx_.
9722 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
9723 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
9724 and rm_no_fix_v4bx.stdout
9725 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
9726 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
9727 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
9728 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
9729 and arm_no_fix_v4bx.
9730 * Makefile.in: Regenerate.
9731 * testsuite/arm_fix_v4bx.s: New file.
9732 * testsuite/arm_fix_v4bx.sh: Ditto.
9733
67ec7d0b
DK
97342010-02-24 Doug Kwan <dougkwan@google.com>
9735
9736 * arm.cc (Target_arm::got_section): Make the .got section the first
9737 non RELRO section in the data segment.
9738 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
9739 suffixes of section names.
9740
10165461
DK
97412010-02-24 Doug Kwan <dougkwan@google.com>
9742
9743 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
9744 flags and attributes merging if an input file is a binary file.
9745 * fileread.cc (Input_file::open): Record format of original file.
9746 * fileread.h (Input_file::Format): New enum type.
2e702c99 9747 (Input_file::Input_file): Initialize data member format_.
10165461
DK
9748 (Input_file::format): New method definition.
9749 (Input_file::format_):: New data member.
9750
4a54abbb
DK
97512010-02-24 Doug Kwan <dougkwan@google.com>
9752
9753 * arm.cc (Arm_output_data_got): New class.
9754 (ARM_TCB_SIZE): New constant
9755 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
9756 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
9757 If user uses a script with a SECTIONS clause, issue only a warning
9758 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 9759 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
9760 garbage collection.
9761 (Target_arm::got_mode_index_entry): Handle static linking.
9762 (Target_arm::Scan::local): Ditto.
9763 (Target_arm::Scan::global): Ditto.
9764 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
9765 all incorrectly implemented relocations.
e1df38aa 9766 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
9767 Arm_output_section::fix_exidx_coverage.
9768 * layout.cc (Layout::section_name_mapping): Remove trailing dots
9769 from ".ARM.exidx." and ".ARM.extab.".
9770
ca419a6f
ILT
97712010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9772
9773 * arm.cc (Target_arm::do_finalize_sections): Create attribute
9774 section if it does not already exist.
9775 * attributes.cc (Attributes_section_data::Attributes_section_data):
9776 Don't crash if size is zero.
9777
135b9c78
ILT
97782010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9779 Ian Lance Taylor <iant@google.com>
9780
9781 * gold.cc (queue_middle_tasks): If no input files were opened,
9782 exit.
9783 * workqueue.h (Task_function::Task_function): Assert that there is
9784 a blocker.
9785
bb0bfe4f
DK
97862010-02-22 Doug Kwan <dougkwan@google.com>
9787
9788 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
9789 * icf.cc (get_section_contents): Cast snprintf arguments to long long
9790 types to avoid warnings due to different uint64_t implementations
9791 on different hosts.
9792
2a2b6d42
DK
97932010-02-21 Doug Kwan <dougkwan@google.com>
9794
9795 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
9796 handling of the maximum backward branch offset.
2e702c99 9797 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
9798 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
9799 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 9800 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
9801 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
9802 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
9803 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
9804 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
9805 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
9806 thumb_bl_out_of_range thumb_bl_out_of_range.o,
9807 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
9808 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
9809 thumb2_bl_out_of_range.o): New rules.
9810 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
9811 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
9812 thumb2_bl_out_of_range
9813 * testsuite/Makefile.in: Regenerate.
9814 * testsuite/arm_bl_in_range.s: New file.
9815 * testsuite/arm_bl_out_of_range.s: Ditto.
9816 * testsuite/arm_branch_in_range.sh: Ditto.
9817 * testsuite/arm_branch_range.t: Ditto.
9818 * testsuite/thumb2_branch_range.t: Ditto.
9819 * testsuite/thumb_bl_in_range.s: Ditto.
9820 * testsuite/thumb_bl_out_of_range.s: Ditto.
9821 * testsuite/thumb_branch_range.t: Ditto.
9822
b487ad64
ST
98232010-02-20 Sriraman Tallam <tmsriram@google.com>
9824
9825 * gc.h (gc_process_relocs): Change vectors to point to the new list.
9826 Add reloc offset information.
9827 * icf.cc (get_section_contents): Change iterators to point to the new
9828 vectors. Add reloc offset information to the contents.
9829 * icf.h (Icf::Sections_reachable_info): New typedef.
9830 (Icf::Sections_reachable_list): New typedef.
9831 (Icf::Offset_info): New typedef.
9832 (Icf::Reloc_info): New struct typedef.
9833 (Icf::Reloc_info_list): New typedef.
9834 (Icf::symbol_reloc_list): Delete method.
9835 (Icf::addend_reloc_list): Delete method.
9836 (Icf::section_reloc_list): Delete method.
9837 (Icf::reloc_info_list): New method.
9838 (Icf::reloc_info_list_): New member.
9839
f96accdf
DK
98402010-02-19 Doug Kwan <dougkwan@google.com>
9841
9842 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
9843 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
9844 * arm.cc (Arm_relocation_functions): New forward declaration.
9845 (Target_arm::Target_arm): Initialize new data members
9846 got_mod_index_offset_ and tls_base_symbol_defined_.
9847 (Target_arm::Relocate::relocate_tls): New method.
9848 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
9849 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
9850 New methods.
2e702c99 9851 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
9852 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
9853 (Target_arm::got_mod_index_offset_,
9854 Target_arm::tls_base_symbol_defined_): New data members.
9855 (Target_arm::Scan::local, Target::Scan::global,
9856 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
9857 relocations.
9858
c8761b9a
DK
98592010-02-18 Doug Kwan <dougkwan@google.com>
9860
9861 * arm.cc (Arm_relobj::find_linked_text_section): New method.
9862 (Arm_relobj::make_exidx_input_section): Pass section index of linked
9863 text section as a parameter becuase some broken tools may not set
9864 the link in section header.
9865 (Target_arm::has_got_section): New method.
9866 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
9867 without any mapping symbol as data only. Remove warning.
9868 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
9869 link in its section header, try to discover the link by inspecting the
9870 REL31 relocation at the beginning of the section.
9871 (Target_arm::Scan::check_non_pic): Report name of offending relocation
9872 in error message.
9873 (Target_arm::Scan::global): Treat any reference to the symbol
9874 _GLOBAL_OFFSET_TABLE_ as a GOT access.
9875
21bb3914
ST
98762010-02-12 Sriraman Tallam <tmsriram@google.com>
9877
9878 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
9879 (Scan::global_reloc_may_be_function_pointer): New function.
9880 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9881 (Scan::global_reloc_may_be_function_pointer): New function.
9882 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9883 (Scan::global_reloc_may_be_function_pointer): New function.
9884 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
9885 (Scan::global_reloc_may_be_function_pointer): New function.
9886 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
9887 (Scan::global_reloc_may_be_function_pointer): New function.
9888 (Scan::possible_function_pointer_reloc): New function.
9889 (Target_x86_64::can_check_for_function_pointers): New function.
9890 * gc.h (gc_process_relocs): Scan relocation types to determine if
9891 function pointers were taken for targets that support it.
9892 * icf.cc (Icf::find_identical_sections): Include functions for
9893 folding in safe ICF whose pointer is not taken.
9894 * icf.h (Secn_fptr_taken_set): New typedef.
9895 (fptr_section_id_): New member.
9896 (section_has_function_pointers): New function.
9897 (set_section_has_function_pointers): New function.
9898 (check_section_for_function_pointers): New function.
9899 * options.h: Fix comment for safe ICF option.
9900 * target.h (can_check_for_function_pointers): New function.
9901 * testsuite/Makefile.am: Add icf_safe_so_test test case.
9902 Modify icf_safe_test for X86-64.
9903 * testsuite/Makefile.in: Regenerate.
9904 * testsuite/icf_safe_so_test.cc: New file.
9905 * testsuite/icf_safe_so_test.sh: New file.
9906 * testsuite/icf_safe_test.cc (kept_func_3): New function.
9907 (main): Change to take pointer to function kept_func_3.
9908 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
9909 folding is done correctly for X86-64.
9910
0da6fa6c
DM
99112010-02-12 David S. Miller <davem@davemloft.net>
9912
9913 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
9914 is_symbolless parameter.
9915 (Output_reloc<SHT_REL>::is_symbolless): New.
9916 (Output_reloc<SHT_REL>::is_symbolless_): New.
9917 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
9918 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
9919 (Output_reloc<SHT_RELA>::is_symbolless): New.
9920 (Output_data_reloc::add_global): Handle is_symbolless.
9921 (Output_data_reloc::add_global_relative): Likewise.
9922 (Output_data_reloc::add_local): Likewise.
9923 (Output_data_reloc::add_local_relative): Likewise.
9924 (Output_data_reloc::add_symbolless_global_addend): New.
9925 (Output_data_reloc::add_symbolless_local_addend): New.
9926 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
9927 is_symbolless.
9928 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
9929 instead of ->is_relative_
9930 (Output_reloc::write): Likewise.
9931 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
9932 (Output_reloc::write_rel): Simplify.
9933
9934 * sparc.cc (Target_sparc::Scan::local): Use
9935 ->add_symbolless_local_addend as needed.
9936 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
9937 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
9938 based upon relocation offset.
9939
e4782e83
DK
99402010-02-11 Doug Kwan <dougkwan@google.com>
9941
9942 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
9943 (Target_arm::Scan::global): Ditto. Also remove a comment before the
9944 beginning of function.
9945 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
9946 and MOVT_ABS relocations. Those are non issued in scanning. Fix
9947 parameter is_32bit in calls to should_apply_static_reloc.
9948 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
9949 (check_DATA): Add arm_abs_global.stdout.
9950 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
9951 arm_abs_global.stdout): New rules.
9952 (MOSTLLYCLEANFILES): Add arm_abs_global
9953 * Makefile.in: Regenerate.
9954 * testsuite/arm_abs_global.s: New file.
9955 * testsuite/arm_abs_global.sh: Ditto.
9956 * testsuite/arm_abs_lib.s: Ditto.
9957
93ceb764
ILT
99582010-02-11 Ian Lance Taylor <iant@google.com>
9959
9960 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
9961 Read_relocs task.
9962 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
9963 Allocate_commons_task first.
9964 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
9965 task, rather than symtab_lock_.
9966 (Gc_process_relocs::~Gc_process_relocs): New function.
9967 (Gc_process_relocs::is_runnable): Check this_blocker_.
9968 (Gc_process_relocs::locks): Use next_blocker_ rather than
9969 blocker_.
9970 (Scan_relocs::~Scan_relocs): New function.
9971 (Scan_relocs::is_runnable): Check this_blocker_ rather than
9972 symtab_lock_.
9973 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
9974 next_blocker_.
9975 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
9976 fields. Add this_blocker_ and next_blocker_ fields. Adjust
9977 constructor accordingly.
9978 (class Gc_process_relocs): Likewise.
9979 (class Scan_relocs): Likewise.
9980 * common.h (class Allocate_commons_task): Remove symtab_lock_
9981 field, and corresponding constructor parameter.
9982 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
9983 symtab_lock_.
9984 (Allocate_commons_task::locks): Likewise.
9985
114dfbe1
ILT
99862010-02-11 Ian Lance Taylor <iant@google.com>
9987
9988 * gold-threads.h (class Once): Define.
9989 (class Initialize_lock): Rewrite as child of Once.
9990 * gold-threads.cc (class Once_initialize): Define.
9991 (once_pointer_control): New static variable.
9992 (once_pointer, once_arg): New static variables.
9993 (c_run_once): New static function.
9994 (Once::Once, Once::run_once, Once::internal_run): New functions.
9995 (class Initialize_lock_once): Remove.
9996 (initialize_lock_control): Remove.
9997 (initialize_lock_pointer): Remove.
9998 (initialize_lock_once): Remove.
9999 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
10000 (Initialize_lock::initialize): Rewrite.
10001 (Initialize_lock::do_run_once): New function.
10002 * archive.cc (Archive::interpret_header): Only clear name if it is
10003 not already empty.
10004 * fileread.cc: Include "gold-threads.h"
10005 (file_counts_lock): New static variable.
10006 (file_counts_initialize_lock): Likewise.
10007 (File_read::release): Only increment counts when using --stats.
10008 Use a lock around the increment.
10009 * parameters.cc (class Set_parameters_target_once): Define.
10010 (set_parameters_target_once): New static variable.
10011 (Parameters::Parameters): Move here from parameters.h.
10012 (Parameters::set_target): Rewrite.
10013 (Parameters::set_target_once): New function.
10014 (Parameters::clear_target): Move here and rewrite.
10015 * parameters.h (class Parameters): Update declarations. Add
10016 set_parameters_target_once_ field.
10017 (Parameters::Parameters): Move to parameters.cc.
10018 (Parameters::clear_target): Likewise.
10019 * readsyms.cc (Read_symbols::do_group): Create a Start_group
10020 task.
10021 (Start_group::~Start_group): New function.
10022 (Start_group::is_runnable): New function.
10023 (Start_group::locks, Start_group::run): New functions.
10024 (Finish_group::run): Change saw_undefined to size_t.
10025 * readsyms.h (class Start_group): Define.
10026 (class Finish_group): Change saw_undefined_ field to size_t.
10027 (Finish_group::Finish_group): Remove saw_undefined and
10028 this_blocker parameters. Change all callers.
10029 (Finish_group::set_saw_undefined): New function.
10030 (Finish_group::set_blocker): New function.
10031 * symtab.h (class Symbol_table): Change saw_undefined to return
10032 size_t. Change saw_undefined_ field to size_t.
10033 * target-select.cc (Set_target_once::do_run_once): New function.
10034 (Target_selector::Target_selector): Initialize set_target_once_
10035 field. Don't initialize lock_ and initialize_lock_ fields.
10036 (Target_selector::instantiate_target): Rewrite.
10037 (Target_selector::set_target): New function.
10038 * target-select.h (class Set_target_once): Define.
10039 (class Target_selector): Update declarations. Make
10040 Set_target_once a friend. Remove lock_ and initialize_lock_
10041 fields. Add set_target_once_ field.
10042
fa17a3f4
ILT
100432010-02-10 Ian Lance Taylor <iant@google.com>
10044
10045 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
10046 queueing any tasks.
10047 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
10048 (queue_middle_tasks): Add all blockers before queueing any tasks.
10049 (queue_final_tasks): Likewise.
10050 * token.h (Task_token::add_blockers): New function.
10051 * object.h (Input_objects::number_of_relobjs): New function.
10052
c7177d31
ILT
100532010-02-10 Ian Lance Taylor <iant@google.com>
10054
5de0e392
ILT
10055 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
10056 shared, not if not position independent.
10057 * x86_64.cc (Relocate::relocate_tls): Likewise.
10058 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
10059 (tls_pie_pic_test): New target.
10060 * testsuite/Makefile.in: Rebuild.
10061
c7177d31
ILT
10062 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
10063 (tls_test_main_pie.o, tls_test_pie.o): New targets.
10064 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
10065 * testsuite/Makefile.in: Rebuild.
10066
684b268a
DM
100672010-02-09 David S. Miller <davem@davemloft.net>
10068
10069 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
10070 R_SPARC_RELATIVE using ->add_local_relative().
10071 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
10072
612a8d3d
DM
10073 * output.h (Output_data_dynamic::add_section_size): New method
10074 that takes two Output_data objects.
10075 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
10076 entry param. Handle it in initializers.
10077 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
10078 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
10079 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
10080 arg.
10081 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
10082 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
10083 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
10084 for dynrel_includes_plt.
10085 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10086 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10087 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
10088 before .rela.plt
10089 (Target_sparc::do_finalize_sections): Update to pass true for
10090 dynrel_includes_plt.
10091 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
10092 output before .rela.plt
10093 (Target_powerpc::do_finalize_sections): Update to pass true for
10094 dynrel_includes_plt when 32-bit.
10095
cb1be87e
DK
100962010-02-08 Doug Kwan <dougkwan@google.com>
10097
10098 * arm.cc (Arm_relobj::simple_input_section_output_address): New
10099 method.
10100 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
10101 Arm_relobj::scan_section_for_cortex_a8_stubs,
10102 Arm_relobj::do_relocation_section): Instead of calling
10103 Output_section::output_address, use faster
10104 Arm_relobj::simple_input_section_output_address.
10105
705b5121
DM
101062010-02-08 David S. Miller <davem@davemloft.net>
10107
10108 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
10109 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
10110 relocation helper function.
10111
024c4466
DM
10112 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
10113 just like R_SPARC_GOT{10,13,22}.
10114 (Target_sparc::Scan::local): Likewise.
10115 (Target_sparc::Relocate:relocate): Likewise.
10116
9109c078
ILT
101172010-02-06 Ian Lance Taylor <iant@google.com>
10118
10119 * configure.ac: Rewrite targetobjs duplicate removal code to use
10120 only shell constructs.
10121 * configure: Rebuild.
10122
cf846138
DK
101232010-02-05 Doug Kwan <dougkwan@google.com>
10124
10125 PR 11247
10126 * arm.cc (Arm_relobj::section_is_scannable): New method.
10127 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
10128 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
10129
6cfaf60b
DK
101302010-02-04 Doug Kwan <dougkwan@google.com>
10131
10132 PR 11247
10133 * arm-reloc-property.cc (cstdio): Include.
10134 * configure.ac (targetobjs): Remove duplicates.
10135 * configure: Regenerate.
10136 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
10137 big and little endian version for a given address size.
10138
5c57f1be
DK
101392010-02-03 Doug Kwan <dougkwan@google.com>
10140
10141 * arm-reloc-property.cc
10142 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10143 definition.
10144 * arm-reloc-property.h
10145 (Arm_reloc_property_table::get_implemented_static_reloc_property):
10146 New method definition.
10147 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10148 declaration.
10149 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
10150 overflow to N.
10151 (GOT_PREL): Change implemented to Y.
10152 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
10153 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
10154 (Arm_relocate_functions::movw_abs_nc): Remove method.
10155 (Arm_relocate_functions::movt_abs): Ditto.
10156 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
10157 (Arm_relocate_functions::thm_movt_abs): Ditto.
10158 (Arm_relocate_functions::movw_rel_nc): Ditto.
10159 (Arm_relocate_functions::movw_rel): Ditto.
10160 (Arm_relocate_functions::movt_rel): Ditto.
10161 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
10162 (Arm_relocate_functions:thm_movw_rel): Ditto.
10163 (Arm_relocate_functions:thm_movt_rel): Ditto.
10164 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
10165 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
10166 New method definitions.
10167 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
10168 (Arm_relocation_functions::arm_grp_ldr): Ditto.
10169 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
10170 (Arm_relocation_functions::arm_grp_ldc): Ditto.
10171 (Target_arm::Relocate::relocate): Check for non-static or
10172 unimplemented relocation code and exit early. Change calls to
10173 Target_arm::reloc_uses_thumb_bit and
10174 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
10175 instead. Refactor code to handle similar relocations to increase
10176 code sharing. Remove check for unsupported relocation code in switch
10177 statement.
10178 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
10179 relocation property table to find out size. Change error message to
10180 print out the name of a relocation code instead of the numeric value.
10181 (Target_arm::scan_reloc_for_stub): Use relocation property table
10182 instead of calling Target_arm::reloc_uses_thumb_bit().
10183
218c5831
DK
101842010-02-02 Doug Kwan <dougkwan@google.com>
10185
10186 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
10187 types of relaxed input section.
10188
0d31c79d
DK
101892010-02-02 Doug Kwan <dougkwan@google.com>
10190
10191 * Makefile.am (HFILES): Add arm-reloc-property.h.
10192 (DEFFILES): New.
2e702c99
RM
10193 (TARGETSOURCES): Add arm-reloc-property.cc
10194 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
10195 (libgold_a_SOURCES): $(DEFFILES)
10196 * Makefile.in: Regenerate.
10197 * arm-reloc-property.cc: New file.
10198 * arm-reloc-property.h: New file.
10199 * arm-reloc.def: New file.
10200 * arm.cc: Update comments.
10201 (arm-reloc-property.h): New included header.
10202 (arm_reloc_property_table): New global variable.
10203 (Target_arm::do_select_as_default_target): New method definition.
10204 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
10205 arm-reloc-property to targ_extra_obj.
10206 * parameters.cc (set_parameters_target): Call
10207 Target::select_as_default_target().
10208 * target.h (Target::select_as_default_target): New method definition.
10209 (Target::do_select_as_default_target): Same.
10210
546c7457
DK
102112010-02-01 Doug Kwan <dougkwan@google.com>
10212
10213 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
10214 first_output_text_section_.
10215 (Arm_exidx_fixup::first_output_text_section): New method definition.
10216 (Arm_exidx_fixup::first_output_text_section_): New data member.
10217 (Arm_exidx_fixup::process_exidx_section): Record the first text
10218 output section seen.
10219 (Arm_output_section::fix_exidx_coverage): Set correct linked section
10220 and entsize in output section header.
10221
11b861d5
DK
102222010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10223
10224 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
10225 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
10226 (Arm_relocate_functions::thm_alu11): New Method.
10227 (Arm_relocate_functions::thm_pc8): New Method.
10228 (Arm_relocate_functions::thm_pc12): New Method.
10229 (Target_arm::Scan::local): Handle the relocations.
10230 (Target_arm::Scan::global): Likewise.
10231 (Target_arm::Relocate::relocate): Likewise.
10232 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10233
c9a2c125
DK
102342010-01-29 Doug Kwan <dougkwan@google.com>
10235
10236 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
10237 of relocation types as ld.
10238
1521477a
DK
102392010-01-29 Doug Kwan <dougkwan@google.com>
10240
10241 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
10242 to public.
10243 (Arm_relocate_functions::thumb_branch_common): Ditto.
10244 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
10245 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
10246 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
10247 Arm_relocate_functions::jump24): Remove.
10248 (Target_arm::Relocate::relocate): Adjust code to call
10249 Arm_relocation_functions::arm_branch_common and
10250 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 10251 wrappers. Merge switch-cases together to reduce source code size.
1521477a 10252
e7eca48c
DK
102532010-01-29 Doug Kwan <dougkwan@google.com>
10254
10255 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
10256 output_local_symbol_count_needs_update_.
10257 (Arm_relobj::output_local_symbol_count_needs_update,
10258 Arm_relobj::set_output_local_symbol_count_needs_update,
10259 Arm_relobj::update_output_local_symbol_count): New methods.
10260 (Arm_relobj::output_local_symbol_count_needs_update_): New data
10261 member.
10262 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
10263 of pointed function as in a R_ARM_PREL31 relocation.
10264 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
10265 for output local symbol count updating.
10266 (Target_arm::do_relax): Update output local symbol counts in objects
10267 if necessary.
10268 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
10269
02961d7e
ILT
102702010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10271
10272 * arm.cc: Added support for the ARM relocations:
10273 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
10274 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
10275 (Arm_relocate_functions::movw_rel_nc): Renamed (was
10276 movw_prel_nc).
10277 (Arm_relocate_functions::movw_rel): New method.
10278 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
10279 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
10280 thm_movw_prel_nc).
10281 (Arm_relocate_functions::thm_movw_rel): New method.
10282 (Arm_relocate_functions::thm_movt_rel): Renamed (was
10283 thm_movt_prel).
10284 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
10285 relocations.
10286 (Target_arm::Scan::global): Likewise.
10287 (Target_arm::Relocate::relocate): Likewise.
10288 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10289 Likewise.
10290
b10d2873
ILT
102912010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10292
10293 * arm.cc: Added support for ARM group relocations.
10294 (Target_arm::reloc_needs_sym_origin): New method.
10295 (Arm_relocate_functions::calc_grp_kn): New method.
10296 (Arm_relocate_functions::calc_grp_residual): New method.
10297 (Arm_relocate_functions::calc_grp_gn): New method.
10298 (Arm_relocate_functions::arm_grp_alu): New Method.
10299 (Arm_relocate_functions::arm_grp_ldr): New Method.
10300 (Arm_relocate_functions::arm_grp_ldrs): New Method.
10301 (Arm_relocate_functions::arm_grp_ldc): New Method.
10302 (Target_arm::Scan::local): Handle the ARM group relocations.
10303 (Target_arm::Scan::global): Likewise.
10304 (Target_arm::Relocate::relocate): Likewise.
10305 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10306 Likewise.
10307
2b328d4e
DK
103082010-01-26 Doug Kwan <dougkwan@google.com>
10309
10310 * arm.cc (set): Include.
10311 (class Arm_exidx_fixup): Change type of last_input_section_ to const
10312 pointer type.
2e702c99 10313 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
10314 (Arm_output_section::append_text_sections_to_list): New method.
10315 (Arm_output_section::fix_exidx_coverage): Ditto.
10316 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 10317 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
10318 Relobj::set_section_offset() instead of
10319 Sized_relobj::invalidate_section_offset().
2e702c99 10320 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
10321 parameter for section headers. Ignore relocation sections for
10322 unallocated sections and EXIDX sections.
10323 (Target_arm::fix_exidx_coverage): New method.
10324 (Target_arm::output_section_address_less_than): New type.
10325 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
10326 linked text section instead of the EXIDX section.
10327 (Arm_output_section::create_stub_group): Add an assertion to check
10328 that this is not an EXIDX output section.
10329 (Arm_output_section::append_text_sections_to_list): New method.
10330 (Arm_output_section::fix_exidx_coverage): Ditto.
10331 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 10332 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
10333 (Target_arm::do_relax): Fix EXIDX output section coverage in the
10334 first pass.
10335 (Target_arm::fix_exidx_coverage): New method.
10336 * object.h (Relobj::set_output_section): New method.
10337 (Sized_relobj::invalidate_section_offset): Remove method.
10338 (Sized_relobj::do_invalidate_section_offset): Remove method.
10339 (Sized_relobj::do_set_section_offset): Handle offset value -1.
10340
c7f3c371
DK
103412010-01-25 Doug Kwan <dougkwan@google.com>
10342
10343 * arm.cc (Arm_exidx_merged_section::do_output_offset):
10344 Fix warning due to signed and unsigned comparison on a 32-bit host.
10345
8923b24c
DK
103462010-01-22 Doug Kwan <dougkwan@google.com>
10347
10348 * arm.cc (Target_arm::do_relax): Record an output section for section
10349 offset adjustment it contains any stub table that has changed.
10350 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
10351 offsets in an output section if necessary.
10352 * output.cc (Output_section::Output_section): Initialize
10353 section_offsets_need_adjustments_.
10354 (Output_section::add_input_section_for_script): Renamed to
10355 Output_section::add_simple_input_section.
10356 (Output_section::save_states): Add a comment.
10357 (Output_section::discard_states): New method defintion.
10358 (Output_section::adjust_section_offsets): Same.
10359 * output.h (Output_section::add_input_section_for_script): Renamed to
10360 Output_section::add_simple_input_section.
10361 (Output_section::discard_states): New method declaration.
10362 (Output_section::adjust_section_offsets): Same.
10363 (Output_section::section_offsets_need_adjustment,
10364 Output_section::set_section_offsets_need_adjustment): New method
10365 definitions.
10366 (Output_section::section_offsets_need_adjustment_): New data member.
10367 * script-sections.cc
10368 (Output_section_element_input::set_section_address): Adjust code for
10369 renaming of Output_section::add_input_section_for_script.
10370 (Orphan_output_section::set_section_address): Same.
10371
9b2fd367
DK
103722010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10373
10374 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
10375 Fix_v4bx enum values .
10376 * gold/options.h (General_options): New option definitions.
10377 (General_options::fix_v4bx): New method.
10378 (General_options::Fix_v4bx): New enum.
10379 * gold/options.cc (General_options::parse_fix_v4bx): New method.
10380 (General_options::parse_fix_v4bx_interworking): New method.
10381
80d0d023
DK
103822010-01-22 Doug Kwan <dougkwan@google.com>
10383
10384 * arm.cc (Arm_exidx_fixup): New class.
10385
af2cdeae
DK
103862010-01-21 Doug Kwan <dougkwan@google.com>
10387
10388 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
10389 classes.
10390 (Arm_exidx_section_offset_map): New type.
10391
993d07c1
DK
103922010-01-21 Doug Kwan <dougkwan@google.com>
10393
10394 * arm.cc (Arm_exidx_input_section): New class.
10395 (Arm_relobj::exidx_input_section_by_link,
10396 Arm_relobj::exidx_input_section_by_shndx,
10397 Arm_relobj::make_exidx_input_section): New methods.
10398 (read_arm_attributes_section): Remove.
10399 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
10400 information about them.
10401 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
10402 to here.
10403
5ac169d4
DK
104042010-01-20 Doug Kwan <dougkwan@google.com>
10405
10406 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
10407 Input_section_specifier to Section_id.
10408 (Target_arm::new_arm_input_section: Adjust code for change of key
10409 type.
10410 (Target_arm::find_arm_input_section): Ditto.
10411 * gc.h (object.h): Include for Section_id nand Section_id_hash.
10412 (Section_id): Remove.
10413 (Garbage_collection::Section_id_hash): Remove.
10414 * icf.h (object.h): Include for Section_id nand Section_id_hash.
10415 (Section_id): Remove.
10416 (Icf::Section_id_hash): Remove.
10417 * object.h (Section_id, Const_section_id, Section_id_hash,
10418 Const_section_id_hash): New type definitions.
10419 * output.cc (Output_section::add_relaxed_input_section): Change to
10420 use Const_section_id instead of Input_section_specifier as key type.
10421 (Output_section::add_merge_input_section): Ditto.
10422 (Output_section::build_relaxation_map): Change to use Section_id
10423 instead of Input_section_specifier as key type.
2e702c99 10424 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
10425 Ditto.
10426 (Output_section::convert_input_sections_to_relaxed_sections): Change
10427 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 10428 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
10429 (Output_section::find_relaxed_input_section): Ditto.
10430 * output.h (Input_section_specifier): Remove class.
10431 (Output_section::Output_section_data_by_input_section_map): Change
10432 key type to Const_section_id.
10433 (Output_section::Output_relaxed_input_section_by_input_section_map):
10434 Ditto.
10435 (Output_section::Relaxation_map): Change key type to Section_id.
10436
a2162063
ILT
104372010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10438
10439 * gold/arm.cc: Added support for R_ARM_V4BX relocation
10440 (class Arm_v4bx_stub): New class.
10441 (DEF_STUBS): Updated definition to support v4_veneer_bx.
10442 (Stub_factory::make_arm_v4bx_stub): New method.
10443 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
10444 (Stub_table::empty): Handle v4bx stubs.
10445 (Stub_table::add_arm_v4bx_stub): New method.
10446 (Stub_table::find_arm_v4bx_stub): New method.
10447 (Arm_relocate_functions::v4bx): New method.
10448 (Target_arm::fix_v4bx): New method.
10449 (Target_arm::Target_arm): Handle R_ARM_V4BX.
10450 (Stub_table::relocate_stubs): Likewise.
10451 (Stub_table::do_write): Likewise.
10452 (Stub_table::update_data_size_and_addralign): Likewise.
10453 (Stub_table::finalize_stubs): Likewise.
10454 (Target_arm::Scan::local): Likewise.
10455 (Target_arm::Scan::global): Likewise.
10456 (Target_arm::do_finalize_sections): Likewise.
10457 (Target_arm::Relocate::relocate): Likewise.
10458 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10459 Likewise.
10460 (Target_arm::scan_reloc_for_stub): Likewise.
10461 (Target_arm::scan_reloc_section_for_stubs): Likewise.
10462
5696ab0b
ILT
104632010-01-19 Ian Lance Taylor <iant@google.com>
10464
10465 * output.cc (Output_section_headers::do_sized_write): Write large
10466 segment count to sh_info field.
10467 (Output_file_header::do_sized_write): For large segment count,
10468 write PN_XNUM to e_phnum field.
10469
800d0f56
ILT
104702010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10471
10472 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
10473 (Arm_relocate_functions::thm_jump8): New function.
10474 (Arm_relocate_functions::thm_jump11): New function.
10475 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
10476 R_ARM_THM_JUMP11.
10477 (Target_arm::Scan::global): Likewise.
10478 (Target_arm::Relocate::relocate): Likewise.
10479 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10480 Likewise.
10481
41263c05
DK
104822010-01-14 Doug Kwan <dougkwan@google.com>
10483
10484 * arm.cc (map, utility): Include headers.
10485 (Target_arm::apply_cortex_a8_workaround): New method.
10486 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
10487 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
10488 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
10489 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
10490 the --[no-]fix-cortex-a8 command line options.
10491 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
10492 (Target_arm::relocate_stub): Use addend in instruction template.
10493 * options.h (DEFINE_bool): Set the user-set flag.
10494 (General_options): Add --[no-]-fix-cortex options.
10495 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 10496 : Update fast look-up map after conversion.
41263c05 10497
459e9b03
ST
104982010-01-14 Sriraman Tallam <tmsriram@google.com>
10499
10500 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
10501 in the first pass of do_layout.
10502
b521dfe4
DK
105032010-01-13 Doug Kwan <dougkwan@google.com>
10504
10505 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10506 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
10507 apparent compiler problem of not folding static constant integral
10508 data members of elfcpp::Elf_sizes<32>.
10509
44272192
DK
105102010-01-13 Doug Kwan <dougkwan@google.com>
10511
10512 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10513 Arm_relobj::section_needs_cortex_a8_stub_scanning,
10514 Arm_relobj::scan_section_for_cortex_a8_erratum,
10515 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
10516 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
10517 sections to scan for relocation stubs into a new method
10518 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
10519 relocation and Cortex-A8 stub scanning.
10520 (Target_arm::do_relax): Force stubs to be after stubbed sections
10521 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 10522 the beginning of a new relaxation pass. Update a comment.
44272192
DK
10523 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
10524
44b71ece
ILT
105252010-01-12 Ian Lance Taylor <iant@google.com>
10526
10527 * target-reloc.h (visibility_error): New inline function.
10528 (relocate_section): Call visibility_error.
10529 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
10530 (MOSTLYCLEANFILES): Likewise.
10531 (protected_4_pic.o, protected_3.err): New targets.
10532 * testsuite/protected_4.cc: New file.
10533
a120bc7f
DK
105342010-01-12 Doug Kwan <dougkwan@google.com>
10535
10536 * arm.cc (Cortex_a8_reloc): New class.
10537 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
10538 and cortex_a8_relocs_info_.
10539 (Target_arm::fix_cortex_a8): New method definition.
10540 (Target_arm::Cortex_a8_relocs_info): New type.
10541 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
10542 New data member declarations.
10543 (Target_arm::scan_reloc_for_stub): Record information about
10544 relocations for THUMB branches that might be exempted from the
10545 Cortex-A8 workaround.
10546 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
10547 at the beginning of a relaxation pass.
10548
20138696
DK
105492010-01-12 Doug Kwan <dougkwan@google.com>
10550
10551 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
10552 (Arm_relobj::Mapping_symbol_position,
10553 Arm_reloj::Mapping_symbol_position_less,
10554 Arm_relobj::Mapping_symbols_info): New types.
10555 (Target_arm::is_mapping_symbol_name): New method definition.
10556 (Arm_relobj::do_count_local_symbols): Save information about mapping
10557 symbols.
10558
089d69dc
DK
105592010-01-11 Doug Kwan <dougkwan@google.com>
10560
10561 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
10562 Arm_relocate_functions::thumb32_branch_upper,
10563 Arm_relocate_functions::thumb32_branch_lower,
10564 Arm_relocate_functions::thumb32_cond_branch_offset,
10565 Arm_relocate_functions::thumb32_cond_branch_upper,
10566 Arm_relocate_functions::thumb32_cond_branch_lower,
10567 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
10568 branch offset encoding.
10569 (Arm_relocate_functions::thumb_branch_common): Use new branch
10570 offset encoding methods to avoid code duplication.
10571 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
10572 (Stub_addend_reader::operator()): Use new branch encoding method
10573 to avoid code duplication.
10574
99e5bff2
DK
105752010-01-11 Doug Kwan <dougkwan@google.com>
10576
10577 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
10578 (Target_arm::do_finalize_sections): Define special EXIDX section
10579 symbols only if referenced.
10580 * gc.h (Garbage_collection::add_reference): New method.
10581 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
10582 code duplication.
10583
98e090bd
ILT
105842010-01-11 Ian Lance Taylor <iant@google.com>
10585
d0a91bd8
ILT
10586 * script.cc (Version_script_info::build_expression_list_lookup):
10587 Change complaing about duplicate wildcard match from error to
10588 warning.
10589
98e090bd
ILT
10590 * script.cc (class Lazy_demangler): Recreate--revert part of patch
10591 of 2009-12-30.
10592 (Version_script_info::Version_script_info): Initialize globs_,
10593 default_version_, default_is_global_, and exact_. Don't
10594 initialize globals_ or locals_.
10595 (Version_script_info::build_lookup_tables): Build local symbols
10596 first.
10597 (Version_script_info::unquote): New function.
10598 (Version_script_info::add_exact_match): New function.
10599 (Version_script_info::build_expression_list_lookup): Remove lookup
10600 parameter. Add is_global parameter. Change all callers. Handle
10601 wildcard pattern specially. Unquote pattern. Call
10602 add_exact_match.
10603 (Version_script_info::get_name_to_match): New function.
10604 (Version_script_info::get_symbol_version): New function.
10605 (Version_script_info::get_symbol_version_helper): Remove.
10606 (Version_script_info::check_unmatched_names): Call unquote.
10607 * script.h (class Version_script_info): Change get_symbol_version
10608 to be non-inline and add is_global parameter; change all callers.
10609 Rewrite symbol_is_local. Update declarations. Define struct
10610 Version_tree_match, Exact, Globs. Don't define struct Lookup.
10611 Remove globals_ and locals_ members. Add exact_, globs_,
10612 default_version_, is_global_.
10613 (Version_script_info::Glob): Remove pattern, add expression and
10614 is_global. Update constructor. Change all callers.
10615 * dynobj.cc (Versions::finalize): Mark the version symbol as the
10616 default version.
10617 (Versions::symbol_section_contents): If a symbol is undefined, or
10618 defined in a dynamic object, set the version index to
10619 VER_NDX_LOCAL.
10620 * symtab.cc (Symbol_table::add_from_relobj): Don't call
10621 symbol_is_local.
10622 (Symbol_table::add_from_pluginobj): Likewise.
10623 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
10624
d56962d3
DK
106252010-01-11 Doug Kwan <dougkwan@google.com>
10626
10627 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
10628 (incremental_dump_LDADD): Add linking option for libintl.
10629 * Makefile.in: Regenerate.
10630
94e6ee91
L
106312010-01-11 H.J. Lu <hongjiu.lu@intel.com>
10632
10633 PR gold/11144
10634 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
10635 instead of -Ds.
10636 * testsuite/Makefile.in: Regenerated.
10637
e96c574b
DK
106382010-01-10 Doug Kwan <dougkwan@google.com>
10639
10640 * options.h (DEFINE_var): Use parentheses around argument varname__
10641 in macro body to avoid any unintended subsequent substitutions.
10642
7198066b
ILT
106432010-01-10 Ian Lance Taylor <iant@google.com>
10644
ba4d53bf
ILT
10645 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
10646 candidates before doing symbol resolution.
10647
7198066b
ILT
10648 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
10649 ODR candidates if only one is weak.
10650
a2beed37
ILT
106512010-01-08 Ian Lance Taylor <iant@google.com>
10652
10653 * script.cc (Version_script_info::build_expression_list_lookup):
10654 Don't warn about ambiguous version, just record the ambiguity.
10655 (Version_script_info::get_symbol_version_helper): Give error if
10656 version is ambiguous.
10657
2fb7225c
DK
106582010-01-08 Doug Kwan <dougkwan@google.com>
10659
10660 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
10661 prev_data_size_ and prev_addralign_. Remove initializer for
10662 deleted data member has_been_changed_.
10663 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
10664 to determine if the table is empty.
10665 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
10666 Remove.
10667 (Stub_table::add_reloc_stub): Define method in class definition
10668 instead of just declaring it there.
10669 (Stub_table::add_cortex_a8_stub): New method definition.
10670 (Stub_table::update_data_size_and_addralign): Ditto.
10671 (Stub_table::finalize_stubs): Ditto.
10672 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
10673 (Stub_table::do_addralign_): Return address alignment in the
10674 (Stub_table::do_reset_address_and_file_offset): Define method in
10675 class definition instead of declaring it there. Set current data
10676 size to be the data size of the previous pass.
10677 (Stub_table::set_final_data_size): Use current data size as the
10678 final data size.
10679 (Stub_table::relocate_stub): Change parameter type of stub from
10680 Reloc_stub pointer to Stub pointer.
10681 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
10682 (Stub_table::Cortex_a8_stub_list): New typedef.
10683 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
10684 Stub_table::prev_addralign_): New data member.
10685 (Arm_relobj::Arm_relobj): Initialize data member
10686 section_has_cortex_a8_workaround_.
10687 (Arm_relobj::section_has_cortex_a8_workaround,
10688 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
10689 definitions.
10690 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
10691 declarations.
10692 (Target_arm::relocate_stub): Change parameter type of stub from
10693 Reloc_stub pointer to Stub pointer.
10694 (Insn_template::size, Insn_template::alignment): Handle
10695 THUMB16_SPECIAL_TYPE.
10696 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
10697 Stub_table::update_data_size_and_addralign,
10698 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
10699 definitions.
10700 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
10701 (Stub_table::do_write): Ditto.
10702 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 10703
880cd20d
ILT
107042010-01-08 Ian Lance Taylor <iant@google.com>
10705
10706 PR 11108
10707 * symtab.h (class Symbol): Remove fields is_target_special_ and
10708 has_plt_offset_. Add field is_defined_in_discarded_section_.
10709 (Symbol::is_defined_in_discarded_section): New function.
10710 (Symbol::set_is_defined_in_discarded_section): New function.
10711 (Symbol::has_plt_offset): Rewrite.
10712 (Symbol::set_plt_offset): Verify that new offset is not -1U.
10713 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
10714 Don't initialize is_target_special_ or has_plt_offset_.
10715 Initialize is_defined_in_discarded_section_.
10716 (Symbol_table::add_from_relobj): If appropriate, set
10717 is_defined_in_discarded_section.
10718 * resolve.cc (Symbol::override_base_with_special): Don't test
10719 is_target_special_. Change has_plt_offset_ to has_plt_offset().
10720 * target-reloc.h (relocate_section): Do special handling for
10721 symbols defined in discarded sections for global symbols as well
10722 as local symbols.
10723
2703e3eb
ILT
107242010-01-08 Ian Lance Taylor <iant@google.com>
10725
10726 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
10727 the SHT_SYMTAB case.
10728
339d40a3
ILT
107292010-01-08 Ian Lance Taylor <iant@google.com>
10730
10731 * object.cc (Sized_relobj::do_layout): Don't get confused if
10732 layout_eh_frame returns NULL.
10733
abecea76
ILT
107342010-01-08 Ian Lance Taylor <iant@google.com>
10735
10736 PR 11084
10737 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
10738 dynamic symbol table, use the normal symbol table.
10739 (Sized_dynobj::do_read_symbols): Remove assertion about type of
10740 symbol table.
10741
6b7dd3f3
ILT
107422010-01-08 Ian Lance Taylor <iant@google.com>
10743
10744 PR 11072
10745 * layout.cc (Layout::include_section): Remove .gnu_debuglink
10746 sections.
10747
36c50e63
L
107482010-01-08 H.J. Lu <hongjiu.lu@intel.com>
10749
10750 * version.cc (print_version): Change to "Copyright 2010".
10751
e291e7b9
ILT
107522010-01-08 Ian Lance Taylor <iant@google.com>
10753
10754 PR 10287
10755 PR 11063
10756 * i386.cc (class Target_i386): Change return type of plt_section
10757 to be non-const.
10758 (class Output_data_plt_i386): Add tls_desc_rel_ field.
10759 (Output_data_plt_i386::Output_data_plt_i386): Initialize
10760 tls_desc_rel_ field.
10761 (Output_data_plt_i386::rel_tls_desc): New function.
10762 (Target_i386::rel_tls_desc_section): New function.
10763 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
10764 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
10765 R_386_TLS_DESC reloc in rel_tls_desc_section.
10766 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
10767 Define struct Tlsdesc_info.
10768 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
10769 (Target_x86_64::do_reloc_symbol_index): New function.
10770 (Target_x86_64::add_tlsdesc_info): New function.
10771 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
10772 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
10773 tlsdesc_rel_ field.
10774 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
10775 all callers.
10776 (Output_data_plt_x86_64::rela_tlsdesc): New function.
10777 (Target_x86_64::rela_tlsdesc_section): New function.
10778 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
10779 handling.
10780 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
10781 (Target_x86_64::do_reloc_addend): New function.
10782 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
10783 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
10784 declarations. Define TARGET_CODE. Add arg field to u1_ union.
10785 (Output_reloc::type): New function.
10786 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
10787 (Output_reloc::is_target_specific): New function.
10788 (Output_reloc::target_arg): New function.
10789 (class Output_reloc) [SHT_RELA]: Add four new constructors for
10790 absolute relocs and target specific relocs.
10791 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
10792 add_target_specific.
10793 (class Output_data_reloc) [SHT_RELA]: Likewise.
10794 * output.cc (Output_reloc::Output_reloc): Add four new versions
10795 for absolute relocs and target specific relocs.
10796 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
10797 (Output_reloc::get_symbol_index): Likewise.
10798 (Output_reloc::local_section_offset): Check that local_sym_index_
10799 is not TARGET_CODE or 0.
10800 (Output_reloc::symbol_value): Likewise.
10801 (Output_reloc::write) [SHT_RELA]: Call target for target specific
10802 reloc.
10803 * target.h (class Target): Add reloc_symbol_index and reloc_addend
10804 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
10805 functions.
10806 * layout.cc (add_target_dynamic_tags): Use output section for
10807 DT_PLTRELSZ and DT_JMPREL.
10808
3a44184e
ILT
108092010-01-07 Ian Lance Taylor <iant@google.com>
10810
10811 PR 11061
10812 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
10813 function.
10814 (class Output_data_reloc_generic): Define.
10815 (class Output_data_reloc_base): Change base class to
10816 Output_data_reloc_generic. Change add() method to call
10817 bump_relative_reloc_count for a relative reloc. Remove
10818 sort_relocs_ field.
10819 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
10820 to sort_relocs().
10821 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
10822 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
10823 appropriate.
10824 * layout.h (class Layout): Update declaration.
10825
ea715a34
ILT
108262010-01-07 Ian Lance Taylor <iant@google.com>
10827
10828 * output.h (class Output_data): Add const version of
10829 output_section and do_output_section.
10830 (class Output_section_data): Add const version of
10831 do_output_section.
10832 (class Output_section): Likewise.
10833 * layout.cc (Layout::add_target_dynamic_tags): New function.
10834 * layout.h (class Layout): Update declarations.
10835 * arm.cc (Target_arm::do_finalize_sections): Use
10836 add_target_dynamic_tags.
10837 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10838 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10839 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10840 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10841
659948a4
ILT
108422010-01-07 Ian Lance Taylor <iant@google.com>
10843
10844 PR 11042
10845 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
10846 object as needed.
10847
9d3b86f6
ILT
108482010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
10849 Ian Lance Taylor <iant@google.com>
10850
10851 PR 11019
10852 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
10853 Xindex::read_symtab_xindex.
10854
bb0d3eb0
DK
108552010-01-07 Doug Kwan <dougkwan@google.com>
10856
10857 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
10858 (Insn_template::thumb16_bcond_insn): New method declaration.
10859 (Insn_template): Fix spelling.
10860 (Stub::thumb16_special): New method declaration.
10861 (Stub::do_write): Define virtual method which was previously pure
10862 virtual.
10863 (Stub::do_thumb16_special): New method declaration.
10864 (Stub::do_fixed_endian_write): New template member.
10865 (Reloc_stub::do_write): Remove.
10866 (Reloc_stub::do_fixed_endian_write): Remove.
10867 (Cortex_a8_stub): New class definition.
10868 (Stub_factory::make_cortex_a8_stub): New method definition.
10869 (Stub_factory::Stub_factory): Add missing static storage class
10870 qualifier for elf32_arm_stub_a8_veneer_blx.
10871
ffeef7df
ILT
108722010-01-07 Ian Lance Taylor <iant@google.com>
10873
dc3f80fe
ILT
10874 PR 10980
10875 * options.h (class General_options): Add --warn-unresolved-symbols
10876 and --error-unresolved-symbols.
10877 * errors.cc (Errors::undefined_symbol): Implement
10878 --warn-unresolved-symbols.
10879
ffeef7df
ILT
10880 * options.h (class General_options): Add -z text and -z textoff.
10881 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
10882
f1ec9ded
ST
108832010-01-06 Sriraman Tallam <tmsriram@google.com>
10884
10885 * gc.h (Garbage_collection::Cident_section_map): New typedef.
10886 (Garbage_collection::cident_sections): New function.
10887 (Garbage_collection::add_cident_section): New function.
10888 (Garbage_collection::cident_sections_): New member.
10889 (gc_process_relocs): Add references to sections whose names are C
10890 identifiers.
10891 * gold.h (cident_section_start_prefix): New constant.
10892 (cident_section_stop_prefix): New constant.
10893 (is_cident): New function.
10894 * layout.cc (Layout::define_section_symbols): Replace string constants
10895 with the newly defined constants.
10896 * object.cc (Sized_relobj::do_layout): Track sections whose names are
10897 C identifiers.
10898 * testsuite/Makefile.am: Add gc_orphan_section_test.
10899 * testsuite/Makefile.in: Regenerate.
10900 * testsuite/gc_orphan_section_test.cc: New file.
10901 * testsuite/gc_orphan_section_test.sh: New file.
10902
6eda8c29
ILT
109032010-01-06 Ian Lance Taylor <iant@google.com>
10904
b9674e17
ILT
10905 PR 10980
10906 * options.h (class General_options): Add --warn-shared-textrel.
10907 * layout.cc (Layout::finish_dynamic_section): Implement
10908 --warn-shared-textrel.
10909
6eda8c29
ILT
10910 PR 10980
10911 * options.h (class General_options): Add --warn-multiple-gp.
10912
32dcd44e
ILT
109132010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10914
10915 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
10916 $(THREADSLIB) and $(LIBDL).
10917 * Makefile.in: Rebuild.
10918
a192ba05
ILT
109192010-01-06 Ian Lance Taylor <iant@google.com>
10920
10921 PR 10980
10922 * options.cc (General_options::parse_section_start): New function.
10923 (General_options::section_start): New function.
10924 (General_options::General_options): Initialize all members.
10925 * options.h: Include <map>
10926 (class General_options): Add --section-start. Add section_starts_
10927 member.
10928 * layout.cc (Layout::attach_allocated_section_to_segment): If
10929 --section-start was used, set the address of the segment. Remove
10930 local sort_sections.
10931 (Layout::relaxation_loop_body): If the address of the load segment
10932 has been set by --section-start, don't use it.
10933 * output.h (Output_segment::update_flags_for_output_section): New
10934 function.
10935 * output.cc (Output_segment::add_output_section): Call
10936 update_flags_for_output_section.
10937
dde3f402
ILT
109382010-01-05 Ian Lance Taylor <iant@google.com>
10939
62dfdd4d
ILT
10940 PR 10980
10941 * options.h (class General_options): Add --undefined-version.
10942 * script.cc (struct Version_expression): Add was_matched_by_symbol
10943 field.
10944 (Version_script_info::matched_symbol): New function.
10945 (Version_script_info::get_symbol_version_helper): Call
10946 matched_symbol.
10947 (Version_script_info::check_unmatched_names): New function.
10948 * script.h (class Version_script_info): Update declarations.
10949 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
10950
9c4ae156
ILT
10951 * options.h (class General_options): Use DEFINE_bool_alias for
10952 allow_multiple_definition.
10953 * resolve.cc (Symbol_table::should_override): Don't test
10954 allow_multiple_definition.
10955
dde3f402
ILT
10956 PR 10980
10957 * options.h (class General_options): Add --cref.
10958 * main.cc (main): Print cref table if --cref. Don't close mapfile
10959 until after printing cref table.
10960 * cref.cc: Include "symtab.h".
10961 (class Cref_inputs): Define Cref_table_compare and Cref_table.
10962 (Cref_table_compare::operator()): New function.
10963 (Cref_inputs::gather_cref): New function.
10964 (filecol): New static const.
10965 (Cref_inputs::print_cref): New function.
10966 (Cref::print_cref): New function.
10967 * cref.h: Include <cstdio>.
10968 (class Cref): Update declarations.
10969 * mapfile.h (Mapfile::file): New function.
10970 * object.h (class Object): Define Symbols. Declare virtual
10971 do_get_global_symbols.
10972 (Object::get_global_symbols): New function.
10973 * object.cc (Input_objects::add_object): Pass object to cref_ if
10974 --cref.
10975 (Input_objects::archive_start): Likewise.
10976 (Input_objects::archive_stop): Likewise.
10977 (Input_objects::print_cref): New function.
10978 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
10979 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
10980 --cref.
10981 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
10982 function.
10983 * plugin.h (class Sized_pluginobj): Update declarations.
10984
8781f709
ILT
109852010-01-05 Ian Lance Taylor <iant@google.com>
10986
10987 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
10988 to is_default_version. Rename insdef to insdefault.
10989 (Symbol_table::add_from_relobj): Rename def to is_default_version
10990 and local to is_forced_local.
10991 (Symbol_table::add_from_pluginobj): Likewise.
10992 (Symbol_table::add_from_dynobj): Likewise.
10993 (Symbol_table::define_special_symbol): Rename insdef to
10994 insdefault.
10995
fe35d28d
ILT
109962010-01-04 Ian Lance Taylor <iant@google.com>
10997
30bc8c46
ILT
10998 PR 10980
10999 * options.h (class General_options): Add
11000 --allow-multiple-definition and -z muldefs.
11001 * resolve.cc (Symbol_table::should_override): Don't warn about a
11002 multiple symbol definition if --allow-multiple-definition or -z
11003 muldefs.
11004
7eaea549
ILT
11005 PR 10980
11006 * options.h (class General_options): Add --add-needed and
11007 --copy-dt-needed-entries. Tweak --as-needed help entry.
11008 * object.cc (Input_objects::check_dynamic_dependencies): Give an
11009 error if --copy-dt-needed-entries aka --add-needed is used and
11010 would cause a change in behaviour.
11011
fe35d28d
ILT
11012 PR 10980
11013 * options.h (class General_options): Add -G as a short version of
11014 --shared. Add no-op options -assert, -g, and -i.
11015
55a2bb35
ST
110162010-01-04 Sriraman Tallam <tmsriram@google.com>
11017
11018 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
11019 check for .text or .gnu.linkonce.t sections.
11020 * icf.cc (Icf::find_identical_sections): Ditto.
11021 Change the detection for mangled function name within the section
11022 name.
11023 * icf.h (is_section_foldable_candidate): New function.
11024
719328e1
ILT
110252009-12-30 Ian Lance Taylor <iant@google.com>
11026
11027 PR 10980
11028 * options.h (class General_options): Permit two dashes with
11029 --retain-symbols-file.
11030
d7bb5745
ILT
110312009-12-30 Ian Lance Taylor <iant@google.com>
11032
403a15dd
ILT
11033 PR 10979
11034 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
11035 don't put the file header and segment headers in the text
11036 segment.
11037
eda294df
ILT
11038 PR 10979
11039 * common.cc (Sort_commons::operator()): Stabilize sort when both
11040 entries are NULL.
11041 (Symbol_table::do_allocate_commons_list): When allocating common
11042 symbols, skip a symbol which is no longer common.
11043 * symtab.h (Symbol::is_common): Test whether the symbol comes from
11044 an object before checking its type.
11045 * testsuite/common_test_2.c: New file.
11046 * testsuite/common_test_3.c: New file.
11047 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
11048 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
11049 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
11050 (common_test_2_pic.o, common_test_2.so): New targets.
11051 (common_test_3_pic.o, common_test_3.so): New targets.
11052 * testsuite/Makefile.in: Rebuild.
11053
d7bb5745
ILT
11054 PR 10979
11055 * script.cc (read_input_script): If we see a new SECTIONS clause,
11056 and we have added an input section, give an error.
11057 * layout.h (class Layout): Add have_added_input_section function.
11058 Add have_added_input_section_ field.
11059 * layout.cc (Layout::Layout): Initialize
11060 have_added_input_section_.
11061 (Layout::layout): Set have_added_input_section_.
11062 (Layout::layout_eh_frame): Likewise.
11063
fc59c572
ILT
110642009-12-30 Ian Lance Taylor <iant@google.com>
11065
11066 PR 10931
11067 * options.h (class General_options): Add --sort-common option.
11068 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
11069 * common.cc (Sort_common): Add sort_order parameter to
11070 constructor. Add sort_order_ field.
11071 (Sort_commons::operator): Check sort_order_.
11072 (Symbol_table::allocate_commons): Determine the sort order.
11073 (Symbol_table::do_allocate_commons): Add sort_order parameter.
11074 Change all callers.
11075 (Symbol_table::do_allocate_commons_list): Likewise.
11076
1c74fab0
ILT
110772009-12-30 Ian Lance Taylor <iant@google.com>
11078
11079 PR 10916
11080 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
11081 symbols from this object, don't change the visibility of an
11082 undefined symbol.
11083 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
11084
6affe781
ILT
110852009-12-30 Ian Lance Taylor <iant@google.com>
11086
11087 PR 10861
11088 * script.h (class Version_script_info): Define Language enum.
11089 Update declarations. Define Glob, Exact, and Lookup types. Add
11090 new fields globals_, locals_, and is_finalized_.
11091 * script.cc: Various formatting fixes.
11092 (class Parser_closure): Change language_stack_ from a vector of
11093 std::string to one of Version_script_info::Language. Adjust all
11094 uses accordingly.
11095 (class Lazy_demangler): Remove.
11096 (struct Version_expression): Change language from std::string to
11097 Version_script_info::Language.
11098 (Version_script_info::Version_script_info): New function.
11099 (Version_script_info::~Version_script_info): Don't call clear.
11100 (Version_script_info::finalize): New function.
11101 (Version_script_info::build_lookup_tables): New function.
11102 (Version_script_info::build_expression_list_lookup): New
11103 function.
11104 (Version_script_info::get_symbol_version_helper): Rewrite to use
11105 lookup tables.
11106 (Version_script_info::print_expression_list): Adjust to use
11107 Version_script_info::Language.
11108 (script_push_lex_into_version_mode): Check that the version script
11109 has not been finalized.
11110 (version_script_push_lang): Change language string to
11111 Version_script_info::Language.
11112 * options.cc (Command_line::version_script): New function.
11113 * options.h (class General_options): Add finalize_dynamic_list
11114 function. Change version_script from declaration to definition.
11115 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
11116 * testsuite/version_script.map: Remove duplicate def of foo.
11117 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
11118 version_script.map.
11119 * testsuite/Makefile.in: Rebuild.
11120
818bf354
ILT
111212009-12-30 Ian Lance Taylor <iant@google.com>
11122
11123 PR 10843
11124 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
11125 if the input symbol index is 0, make the output symbol index 0.
11126
ebcc8304
ILT
111272009-12-30 Ian Lance Taylor <iant@google.com>
11128
11129 PR 10670
11130 * options.h (class General_options): Add -x/--discard-all.
11131 * object.cc (Sized_relobj::do_count_local_symbols): Handle
11132 --discard-all. If the local symbol needs a dynamic entry, check
11133 that before handling --discard-locals.
11134
176fe33f
ILT
111352009-12-30 Ian Lance Taylor <iant@google.com>
11136
bb321bb1
ILT
11137 PR 10450
11138 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
11139 flags to PF_R.
11140 (Output_segment::add_output_section): Don't change the flags if
11141 the type is PT_TLS.
11142
176fe33f
ILT
11143 PR 10450
11144 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
11145 GNU hash table if they need a dynamic value. Otherwise, don't add
11146 them if they are defined in a dynamic object or are forced local.
11147
e8cd95c7
ILT
111482009-12-29 Ian Lance Taylor <iant@google.com>
11149
1b81fb71
ILT
11150 PR 10450
11151 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
11152 .gnu.hash table for a 32-bit target.
11153
8d6d383d
ILT
11154 PR 10450
11155 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
11156 regular and a dynamic object only needs a dynamic symbol table
11157 entry if it is externally visible.
11158
e785ec03
ILT
11159 PR 10450
11160 * i386.cc (class Target_i386): Initialize global_offset_table_ in
11161 constructor. Add global_offset_table_ field.
11162 (Target_i386::got_section): Set global_offset_table_.
11163 (Target_i386::do_finalize_sections): Set global_offset_table_
11164 size.
11165 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
11166 in constructor. Add global_offset_table_ field.
11167 (Target_x86_64::got_section): Set global_offset_table_.
11168 (Target_x86_64::do_finalize_sections): Set global_offset_table_
11169 size.
11170
1a2dff53
ILT
11171 * layout.cc (Layout::Layout): Initialize increase_relro_.
11172 (Layout::get_output_section): Add is_relro, is_last_relro, and
11173 is_first_non_relro parameters. Change all callers.
11174 (Layout::choose_output_section): Likewise.
11175 (Layout::add_output_section_data): Likewise.
11176 (Layout::make_output_section): Likewise.
11177 (Layout::set_segment_offsets): Clear increase_relro when using a
11178 linker script.
11179 * layout.h (class Layout): Add increase_relro method. Add
11180 increase_relro_ field. Update declarations.
11181 * output.cc (Output_section::Output_section): Initialize
11182 is_last_relro_ and is_first_non_relro_.
11183 (Output_segment::add_output_section): Group relro sections is
11184 do_sort is true. Handle is_last_relro and is_first_non_relro.
11185 (Output_segment::maximum_alignment): Remove relro handling.
11186 (Output_segment::set_section_addresses): Add increase_relro
11187 parameter. Change all callers. Add initial alignment to align
11188 relro sections on separate page. Remove old relro handling.
11189 (Output_segment::set_section_list_addresses): Remove in_relro
11190 parameter. Change all callers.
11191 (Output_segment::set_offset): Add increase parameter. Change all
11192 callers. Remove old relro handling.
11193 * output.h (class Output_section): Add new methods: is_last_relro,
11194 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
11195 Add is_last_relro_ and is_first_non_relro_ fields.
11196 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
11197 Create separate .got.plt section. Call increase_relro.
11198 * x86_64.cc (Target_x86_64::got_section): Likewise.
11199 * testsuite/relro_script_test.t: Add .got.plt.
11200
f0ba79e2
ILT
11201 PR 10450
11202 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
11203 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
11204 (Layout::finalize): Call set_dynamic_symbol_size.
11205 (Layout::set_dynamic_symbol_size): New function.
11206 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
11207 set_dynamic_symbol_size.
11208
e8cd95c7
ILT
11209 PR 10450
11210 * output.h (class Output_section): Add is_entsize_zero_ field.
11211 * output.cc (Output_section::Output_section): Initialize
11212 is_entsize_zero_.
11213 (Output_section::set_entsize): If two different entsizes are
11214 requested, force it to zero.
11215 (Output_section::add_input_section): Set flags for .debug_str
11216 before updating section flags. Set entsize.
11217 (Output_section::update_flags_for_input_section): Set SHF_MERGE
11218 and SHF_STRING if all input sections have those flags.
11219
3e1b9a8a
RÁE
112202009-12-29 Rafael Espindola <espindola@google.com>
11221
11222 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
11223 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
11224 reporting.
3e1b9a8a 11225
3dcad376
ST
112262009-12-29 Sriraman Tallam <tmsriram@google.com>
11227
11228 * options.cc (General_options::parse_version): Allow -v to exit
11229 without an error if there is nothing to link.
11230
084e2665
ILT
112312009-12-29 Ian Lance Taylor <iant@google.com>
11232
11233 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
11234 using a version of gcc before 4.1.
11235 * configure: Rebuild.
11236
250acde3
CD
112372009-12-28 Chris Demetriou <cgd@google.com>
11238
11239 * attributes.cc (Output_attributes_section_data::do_write): Use
11240 std::vector::front rather than std::vector::data.
11241
99fff23b
ILT
112422009-12-28 Ian Lance Taylor <iant@google.com>
11243
11244 * symtab.h (class Symbol_table): Add enum Defined.
11245 * resolve.cc (Symbol_table::should_override): Add defined
11246 parameter. Change all callers. Test whether object is NULL
11247 before calling a method on it.
11248 (Symbol_table::report_resolve_problem): Add defined parameter.
11249 Change all callers.
11250 (Symbol_table::should_override_with_special): Likewise.
11251 * symtab.cc (Symbol_table::define_in_output_data): Add defined
11252 parameter. Change all callers.
11253 (Symbol_table::do_define_in_output_data): Likewise.
11254 (Symbol_table::define_in_output_segment): Likewise.
11255 (Symbol_table::do_define_in_output_segment): Likewise.
11256 (Symbol_table::define_as_constant): Likewise.
11257 (Symbol_table::do_define_as_constant): Likewise.
11258 * script.h (class Symbol_assignment): Add is_defsym parameter to
11259 constructor; change all callers.
11260 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
11261 parameter. Change all callers. Add is_defsym_ field.
11262 (class Parser_closure): Add parsing_defsym parameter to
11263 constructor; change all callers. Add parsing_defsym accessor
11264 function. Add parsing_defsym_ field.
11265
556bd683
ILT
112662009-12-28 Ian Lance Taylor <iant@google.com>
11267
11268 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 11269 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 11270
1782c879
ILT
112712009-12-23 Ian Lance Taylor <iant@google.com>
11272
11273 * i386.cc (Target_i386::do_calls_non_split): Recognize
11274 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
11275 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
11276 -fsplit-stack prologue when using %r11.
1782c879 11277
329ca2b1
ST
112782009-12-21 Sriraman Tallam <tmsriram@google.com>
11279
11280 * options.cc (General_options::parse_version): Make -v continue and do
11281 the link like GNU ld does.
11282
d675ff46
RÁE
112832009-12-17 Rafael Avila de Espindola <espindola@google.com>
11284
11285 * Makefile.am (CCFILES): Add timer.cc.
11286 (HFILES): Add timer.h.
11287 * configure.ac: Check for sysconf and times.
11288 * main.cc: include timer.h.
11289 (main): Use Timer instead of get_run_time.
11290 * timer.cc: New.
11291 * timer.h: New.
11292 * workqueue.cc: include timer.h.
11293 (Workqueue::find_and_run_task):
11294 Report user, sys and wall time.
11295 * Makefile.in: Regenerate.
11296 * config.in: Regenerate.
11297 * configure: Regenerate.
11298
d6344fb5
DK
112992009-12-16 Doug Kwan <dougkwan@google.com>
11300
11301 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
11302 sections.
11303 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
11304 relaxed input sections.
11305 * output.cc (Output_section::find_relaxed_input_section): Change
11306 return type to Output_relaxed_input_section pointer. Adjust code
11307 for new type of relaxed_input_section_map_.
11308 * output.h (Output_section::find_relaxed_input_section): Change
11309 return type to Output_relaxed_input_section pointer.
11310 (Output_section::Output_relaxed_input_section_by_input_section_map):
11311 New type.
11312 (Output_section::relaxed_input_section_map_): Change type to
11313 Output_section::Output_relaxed_input_section_by_input_section_map.
11314 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
11315 input section.
11316
0e0d5469
ILT
113172009-12-15 Ian Lance Taylor <iant@google.com>
11318
11319 * layout.cc (Layout::create_shstrtab): Only write out after input
11320 sections if we are compressing debug sections.
11321
0649a889
ILT
113222009-12-15 Ian Lance Taylor <iant@google.com>
11323
11324 * archive.cc (Archive::add_symbols): Only look up a symbol without
11325 a version if there is, in fact, a version.
11326
2ea97941
ILT
113272009-12-14 Ian Lance Taylor <iant@google.com>
11328
11329 Revert -Wshadow changes, all changes from:
11330 2009-12-11 Doug Kwan <dougkwan@google.com>
11331 2009-12-11 Nick Clifton <nickc@redhat.com>
11332 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
11333
b0eec2cc
DK
113342009-12-11 Doug Kwan <dougkwan@google.com>
11335
11336 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
11337 due to -Wshadow.
11338 * attributes.cc (Object_attribute::size): Ditto.
11339 (Attributes_section_data::size): Ditto.
11340 (Attributes_section_data::Attributes_section_data): Ditto.
11341 (Output_attributes_section_data::do_write): Ditto.
11342 * attributes.h (Object_attribute::set_type): Ditto.
11343 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
11344
91d6fa6a
NC
113452009-12-11 Nick Clifton <nickc@redhat.com>
11346
11347 * archive.cc: Fix shadowed variable warnings.
11348 * arm.cc: Likewise.
11349 * compressed_output.cc: Likewise.
11350 * compressed_output.h: Likewise.
11351 * configure: Likewise.
11352 * dwarf_reader.cc: Likewise.
11353 * dynobj.cc: Likewise.
11354 * dynobj.h: Likewise.
11355 * ehframe.cc: Likewise.
11356 * ehframe.h: Likewise.
11357 * errors.cc: Likewise.
11358 * expression.cc: Likewise.
11359 * fileread.cc: Likewise.
11360 * fileread.h: Likewise.
11361 * freebsd.h: Likewise.
11362 * i386.cc: Likewise.
11363 * icf.cc: Likewise.
11364 * incremental.h: Likewise.
11365 * layout.cc: Likewise.
11366 * layout.h: Likewise.
11367 * mapfile.cc: Likewise.
11368 * merge.cc: Likewise.
11369 * merge.h: Likewise.
11370 * object.cc: Likewise.
11371 * object.h: Likewise.
11372 * options.h: Likewise.
11373 * output.cc: Likewise.
11374 * output.h: Likewise.
11375 * parameters.cc: Likewise.
11376 * plugin.cc: Likewise.
11377 * powerpc.cc: Likewise.
11378 * reduced_debug_output.cc: Likewise.
11379 * reduced_debug_output.h: Likewise.
11380 * reloc.cc: Likewise.
11381 * reloc.h: Likewise.
11382 * resolve.cc: Likewise.
11383 * script-sections.cc: Likewise.
11384 * script.cc: Likewise.
11385 * script.h: Likewise.
11386 * sparc.cc: Likewise.
11387 * symtab.cc: Likewise.
11388 * symtab.h: Likewise.
11389 * target-select.cc: Likewise.
11390 * target-select.h: Likewise.
11391 * token.h: Likewise.
11392 * workqueue.cc: Likewise.
11393 * workqueue.h: Likewise.
11394 * x86_64.cc: Likewise.
11395
a0351a69
DK
113962009-12-10 Doug Kwan <dougkwan@google.com>
11397
11398 * arm.cc (attributes.h): New include.
11399 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
11400 (Arm_relobj::~Arm_relobj): Delete object pointed by
11401 attributes_section_data_.
11402 (Arm_relobj::attributes_section_data): New method definition.
11403 (Arm_relobj::attributes_section_data_): New data member declaration.
11404 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
11405 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
11406 attributes_section_data_.
11407 (Arm_dynobj::attributes_section_data): New method definition.
11408 (Arm_dynobj::attributes_section_data_): New data member declaration.
11409 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
11410 initialization value of may_use_blx_ to false.
2e702c99 11411 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
11412 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
11413 object attributes to compute results instead of hard-coding.
11414 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
11415 Target_arm::get_secondary_compatible_arch,
11416 Target_arm::set_secondary_compatible_arch
11417 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11418 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
11419 New method declarations.
11420 (Target_arm::get_aeabi_object_attribute): New method definition.
11421 (Target_arm::attributes_section_data_): New data member declaration.
11422 (read_arm_attributes_section): New template definition.
11423 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
11424 (Arm_dynobj::do_read_symbols): Ditto.
11425 (Target_arm::do_finalize_sections): Merge attributes sections from
11426 input. Check for BLX use after attributes section merging.
11427 Fix __exidx_start and __exidx_end visibility. Create an
11428 .ARM.attributes section if necessary.
11429 (Target_arm::get_secondary_compatible_arch,
11430 Target_arm::set_secondary_compatible_arch,
11431 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11432 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 11433 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
11434 New method definitions.
11435
b59befec
ILT
114362009-12-09 Ian Lance Taylor <iant@google.com>
11437
11438 * plugin.cc (Plugin::load): Don't cast from void* to a function
11439 pointer.
11440
1276bc89
ILT
114412009-12-09 Ian Lance Taylor <iant@google.com>
11442
11443 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
11444 information fields.
11445
2f2de248
L
114462009-12-09 H.J. Lu <hongjiu.lu@intel.com>
11447
11448 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
11449 Replace two_file_shared_1.so with two_file_shared_2.so.
11450 * testsuite/Makefile.in: Regenerated.
11451
4f787271
DK
114522009-12-08 Doug Kwan <dougkwan@google.com>
11453
11454 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
11455 (HFILES): Add attributes.h and int_encoding.h.
11456 * Makefile.in: Regenerate.
11457 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
11458 function definitions to int_encoding.cc
11459 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
11460 prototypes to int_encoding.h
11461 * reduced_debug_output.cc (int_encoding.h): New include.
11462 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
11463 function definitions to int_encoding.cc
11464 (insert_into_vector, read_from_pointer): Move template definitions to
11465 int_encoding.h
11466 * attributes.cc: New file.
11467 * attributes.h: New file.
11468 * int_encoding.cc: New file.
11469 * int_encoding.h: New file.
11470
20b52f1a
RÁE
114712009-12-07 Rafael Avila de Espindola <espindola@google.com>
11472
11473 PR gold/11055
11474 * incremental-dump.cc (dump_incremental_inputs): New.
11475 (main): Use dump_incremental_inputs.
11476
53d7974c
L
114772009-12-07 H.J. Lu <hongjiu.lu@intel.com>
11478
11479 PR gold/10893
11480 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
11481 checking elfcpp::STT_FUNC.
11482 (Target_i386::Relocate::relocate): Likewise.
11483 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
11484
11485 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
11486 symbols from shared libraries into normal FUNC symbols.
11487
11488 * symtab.h (Symbol): Add is_func and use it.
11489
05a352e6
DK
114902009-12-05 Doug Kwan <dougkwan@google.com>
11491
11492 * arm.cc (Target_arm::arm_info): Initialize new fields
11493 attributes_section and attributes_vendor.
11494 * i386.cc (Target_i386::i386_info): Same.
11495 * object.cc (Sized_relobj::do_layout): Skip attribute section.
11496 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
11497 fields attributes_section and attributes_vendor.
53d7974c 11498 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
11499 * target.h (Target::attributes_section, Target::attributes_vendor,
11500 Target::is_attributes_section, Target::attribute_arg_type,
11501 Target::attributes_order): New method definitions.
11502 (Target::Target_info::attributes_section,
11503 Target::Target_info::attributes_vendor): New fields.
11504 (Target::do_attribute_arg_type, Target::do_attributes_order): New
11505 virtual method definitions.
11506 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
11507 attributes_section and attributes_vendor.
11508 * testsuite/testfile.cc (Target_test::test_target_info): Same.
11509
f4e5969c
DK
115102009-12-05 Doug Kwan <dougkwan@google.com>
11511
11512 * arm.cc: Update comments about interworking and stub generation.
11513 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
11514 considered as non-PIC.
11515 (Arm_relocate_functions::base_abs): Fix formatting.
11516 (Arm_relocate_functions::got_prel): Fix comment. Change interface
11517 of function to use GOT entry address instead of offset.
11518 (Target_arm::Scan::global): Issue an error if a symbol would need a
11519 PLT does not get one because it is untyped. Remove code to create
11520 dynamic symbols for relative branches.
11521 (Target_arm::Relocate::relocate: Use 0 instead of false since function
11522 takes unsigned integer instead of boolean.
11523
1abce4a6
L
115242009-12-05 H.J. Lu <hongjiu.lu@intel.com>
11525
11526 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
11527 (two_file_test_LDADD): Likewise.
11528 (common_test_1_LDADD): Likewise.
11529 (exception_test_LDADD) Likewise.
11530 (weak_test_LDADD): Likewise.
11531 (many_sections_test_LDADD): Likewise.
11532 (initpri1_LDADD): Likewise.
11533 (script_test_1_LDADD): Likewise.
11534 (script_test_2_LDADD): Likewise.
11535 (justsyms_LDADD): Likewise.
11536 (binary_test_LDADD): Likewise.
11537 (large_LDADD): Likewise.
11538 * testsuite/Makefile.in: Regenerated.
11539
adcf2816 115402009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 11541
adcf2816
L
11542 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
11543 (Symbol_table::override_with_special): Likewise.
11544 (Symbol_table::add_from_object): Likewise.
11545
28e67f5d
RÁE
115462009-12-04 Rafael Avila de Espindola <espindola@google.com>
11547
11548 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11549 Don't set the data_offset twice.
11550
ae10a101
RÁE
115512009-12-04 Rafael Avila de Espindola <espindola@google.com>
11552
11553 * testsuite/Makefile.in: Regenerate.
11554
f59f41f3
DK
115552009-12-03 Doug Kwan <dougkwan@google.com>
11556
11557 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
11558 (Target_arm::do_finalize_sections): Add parameter for symbol table
11559 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
11560 * i386.cc (Target_i386::do_finalize_sections): Add an additional
11561 parameter for symbol table pointer.
11562 * layout.cc (Layout::finalize): Call Target::finalize_sections with
11563 an additional parameter for a pointer to symbol table.
11564 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
11565 parameter for a symbol table pointer.
11566 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
11567 * target.h (Target::finalize_sections, Target::do_finalize_sections):
11568 Ditto.
11569 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
11570 parameter for a symbol table pointer.
11571
ca55d848
RÁE
115722009-12-03 Rafael Avila de Espindola <espindola@google.com>
11573
11574 * incremental.cc (Incremental_inputs_header)
11575 (Incremental_inputs_header_write, Incremental_inputs_entry)
11576 (Incremental_inputs_entry_write): Move ...
11577 * incremental.h (Incremental_inputs_header)
11578 (Incremental_inputs_header_write, Incremental_inputs_entry)
11579 (Incremental_inputs_entry_write): here.
11580
3aec4f9c
RÁE
115812009-12-02 Rafael Avila de Espindola <espindola@google.com>
11582
11583 * incremental.cc (make_sized_incremental_binary): Set the target.
11584 Error if it is incompatible.
11585 * output.h (Output_file): Add filename method.
11586
9c0ae74d
RÁE
115872009-12-02 Rafael Avila de Espindola <espindola@google.com>
11588
11589 * incremental.cc (Incremental_inputs_entry): Remove unused argument
11590 from the get_* methods.
11591
a45500ae
RÁE
115922009-12-02 Rafael Avila de Espindola <espindola@google.com>
11593
11594 * incremental-dump.cc (main): Check that the offeset of a script is 0.
11595 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11596 Write 0 for the data_offset of scripts.
11597
325e6408
RÁE
115982009-12-02 Rafael Avila de Espindola <espindola@google.com>
11599
11600 * testsuite/Makefile.am: Add the incremental_test.sh test.
11601 * testsuite/incremental_test.sh: New.
11602 * testsuite/incremental_test_1.c: New.
11603 * testsuite/incremental_test_2.c: New.
11604
954c3e2e
RÁE
116052009-12-01 Rafael Avila de Espindola <espindola@google.com>
11606
703d02da 11607 * incremental-dump.cc (main): Fix typos.
954c3e2e 11608
f8086623
RÁE
116092009-11-27 Rafael Avila de Espindola <espindola@google.com>
11610
11611 PR gold/11025
11612 * incremental-dump.cc (main): Use llu to print 64 bit values.
11613
3b0dd6ac
L
116142009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
11615 H.J. Lu <hongjiu.lu@intel.com>
11616
11617 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
11618 $(LIBDL).
11619 (incremental_dump_LDADD): Likewise.
11620 * Makefile.in: Regenerated.
11621
a6d1ef57 116222009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 11623
a6d1ef57
DK
11624 Revert:
11625
11626 2009-11-25 Doug Kwan <dougkwan@google.com>
11627
11628 * arm.cc (Target_arm::Target_arm): Move method definition
11629 outside of class definition. Add code to handle
11630 --target1-rel, --target1-abs and --target2= options.
11631 (Target_arm::get_reloc_reloc_type): Change method to be
11632 non-static and const.
11633 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
11634 New data member declaration.
11635 (Target_arm::Scan::local, Target_arm::Scan::global,
11636 Target_arm::Relocate::relocate,
11637 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11638 Adjust call to Target_arm::get_real_reloc_type.
11639 (Target_arm::get_real_reloc_type): Use command line options
11640 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11641 * options.h (--target1-rel, --target1-abs, --target2): New
11642 ARM-only options.
11643
50aeb7d4
DK
116442009-11-25 Doug Kwan <dougkwan@google.com>
11645
11646 * arm.cc (Target_arm::Target_arm): Move method definition outside of
11647 class definition. Add code to handle --target1-rel, --target1-abs
11648 and --target2= options.
11649 (Target_arm::get_reloc_reloc_type): Change method to be non-static
11650 and const.
11651 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
11652 member declaration.
11653 (Target_arm::Scan::local, Target_arm::Scan::global,
11654 Target_arm::Relocate::relocate,
11655 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
11656 call to Target_arm::get_real_reloc_type.
11657 (Target_arm::get_real_reloc_type): Use command line options to
11658 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11659 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
11660 options.
11661
51938283
DK
116622009-11-25 Doug Kwan <dougkwan@google.com>
11663
11664 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
11665 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
11666 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
11667 formatting.
11668 (Arm_relocate_functions::thm_call): Replace body with a call to
11669 Arm_relocate_functions::thumb_branch_common.
11670 (Arm_relocate_functions::thm_jump24,
11671 Arm_relocate_functions::thm_xpc22): New method definitions.
11672 (Arm_relocate_functions::thumb_branch_common): New method definition.
11673 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
11674 operator.
11675 (Target_arm::Relocate::relocate): Adjust call to thm_call.
11676 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
11677
e2b8f3c4
RÁE
116782009-11-24 Rafael Avila de Espindola <espindola@google.com>
11679
11680 * Makefile.am: Build incremental-dump
11681 * Makefile.in: Regenerate.
11682 * incremental-dump.cc: New.
11683 * incremental.cc (Incremental_inputs_header_data,
11684 Incremental_inputs_entry_data): Move to incremental.h
11685 * incremental.h: (Incremental_inputs_header_data,
11686 Incremental_inputs_entry_data): Move from incremental.cc
11687
bcba9aec
RÁE
116882009-11-24 Rafael Avila de Espindola <espindola@google.com>
11689
11690 * incremental.cc (Incremental_inputs_header,
11691 Incremental_inputs_header_write, Incremental_inputs_entry,
11692 Incremental_inputs_entry_write): Add a typedef with the data type.
11693
7c3afe08
RÁE
116942009-11-24 Rafael Avila de Espindola <espindola@google.com>
11695
11696 * incremental.cc (Incremental_inputs_header,
11697 Incremental_inputs_header_write, Incremental_inputs_entry,
11698 Incremental_inputs_entry_write): Update comment about which
11699 type has the filed descriptions.
11700
d204b6e9
DK
117012009-11-15 Doug Kwan <dougkwan@google.com>
11702
11703 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
11704 (Arm_relocate_functions::arm_branch_common): Change method defintion
11705 in class definition to a method declaration and update list of formal
11706 parameters.
11707 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
11708 Arm_relocation_functions::jump24): Adjust call to
11709 Arm_relocate_functions::arm_branch_common. Update list of formal
11710 parameters.
11711 (Arm_relocate_functions::xpc25): New method definition.
11712 (Arm_relocate_functions::arm_branch_common): Move method defintion
11713 out from class definition. Use stubs for mode-switching and extending
11714 branch ranges.
11715 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
11716 specially. Change code to enable use of stubs in ARM branches.
11717
43d12afe
DK
117182009-11-10 Doug Kwan <dougkwan@google.com>
11719
11720 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
11721 in method declaration.
11722 (Target_arm::relocate_stub): New method declaration.
11723 (Target_arm::default_target): Change to return a pointer instead of
11724 a const reference.
11725 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
11726 Target_arm::default_target.
11727 (Arm_Relobj::do_relocate_sections): Remove options paramater in
11728 method definition.
11729 (Target_arm::relocate_section): Adjust view.
11730 (Target_arm::relocate_stub): New method definition.
11731
ac33a407
DK
117322009-11-10 Doug Kwan <dougkwan@google.com>
11733
11734 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
11735 a format warning.
11736 * incremental.cc (open_incremental_binary): Initialized local
11737 variables to avoid warnings.
11738 * object.cc (make_elf_object): Ditto.
11739 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
11740 a format warning.
e1df38aa 11741
88ee28e9
L
11742009-11-09 H.J. Lu <hongjiu.lu@intel.com>
11743
11744 PR gold/10930
11745 * testsuite/plugin_test.c: Include "config.h".
11746
2daedcd6
DK
117472009-11-09 Doug Kwan <dougkwan@google.com>
11748
11749 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
11750 (arm_symbol_value): Remove.
11751 (Arm_relocate_functions::arm_branch_common,
11752 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
11753 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
11754 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
11755 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
11756 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
11757 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
11758 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
11759 Arm_relocate_functions::thm_mobw_abs_nc,
11760 Arm_relocate_functions::thm_mov_abs,
11761 Arm_relocate_functions::movw_prel_nc,
11762 Arm_relocate_functions::thm_movt_abs,
11763 Arm_relocate_functions::movt_prel,
11764 Arm_relocate_functions::thm_movw_prel_nc,
11765 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
11766 (Target_arm::Relocate::relocate): Only decompose address into two
11767 parts if relocation type uses the thumb-bit and pass the actual
11768 bit instead of a flag indicating that the thumb-bit is used. Adjust
11769 calls to methods in Arm_relocate_functions for this change.
11770
1276bc89 117712009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
11772
11773 PR 10925
11774 * reloc.cc: Instantiate
11775 Sized_relobj::initialize_input_to_output_maps and
11776 Sized_relobj:free_input_to_output_maps.
11777
e53ad1b5
ILT
117782009-11-06 Ian Lance Taylor <iant@google.com>
11779
11780 PR 10876
11781 * defstd.cc (in_segment): Set only_if_ref true for "end".
11782
eb44217c
DK
117832009-11-06 Doug Kwan <dougkwan@google.com>
11784
11785 * arm.cc (class Reloc_stub): Correct a comment.
11786 (Target_arm::Target_arm): Initialize arm_input_section_map_.
11787 (Target_arm::scan_section_for_stubs): New method declaration.
11788 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
11789 Change methods from private to protected.
11790 (Target_arm::do_may_relax): New method definition.
11791 (Target_arm::do_relax, Target_arm::group_sections,
11792 Target_arm::scan_reloc_for_stub,
11793 Target_arm::scan_reloc_section_for_stubs): New method declarations.
11794 (Target_arm::arm_input_section_map_): New data member declaration.
11795 (Target_arm::scan_reloc_for_stub,
11796 Target_arm::scan_reloc_section_for_stubs,
11797 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
11798 Target_arm::do_relax): New method definitions.
11799
5d329b7d
ILT
118002009-11-06 Mikolaj Zalewski <mikolaj@google.com>
11801
11802 * configure.ac: Check for (struct stat)::st_mtim
11803 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
11804 * config.in: Regenerate.
11805 * configure: Regenerate.
11806
96a0d71b
ILT
118072009-11-05 Ian Lance Taylor <iant@google.com>
11808
11809 PR 10910
11810 * output.cc (Output_segment::add_output_section): Add missing
11811 return statement.
11812
594c8e5e
ILT
118132009-11-04 Ian Lance Taylor <iant@google.com>
11814
11815 PR 10880
11816 * object.h (class Object): Add is_needed and set_is_needed
11817 methods. Add is_needed_ field. Make bool fields into bitfields.
11818 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
11819 defined in a dynamic object and referenced by a regular object,
11820 set is_needed for the dynamic object.
11821 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
11822 if the file is marked with as_needed and it is not needed.
11823
22b127cc
ILT
118242009-11-04 Ian Lance Taylor <iant@google.com>
11825
11826 PR 10887
11827 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
11828 tags if data is discarded by linker script.
11829 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11830 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11831 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11832 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11833
f5c870d2
ILT
118342009-11-04 Ian Lance Taylor <iant@google.com>
11835
11836 * layout.cc (Layout::get_output_section): Add is_interp and
11837 is_dynamic_linker_section parameters. Change all callers.
11838 (Layout::choose_output_section): Likewise.
11839 (Layout::make_output_section): Likewise.
11840 (Layout::add_output_section_data): Add is_dynamic_linker_section
11841 parameter. Change all callers.
11842 * layout.h (class Layout): Update declarations.
11843 * output.h (class Output_section): Add is_interp, set_is_interp,
11844 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
11845 Add is_interp_, is_dynamic_linker_section_ fields. Change
11846 generate_code_fills_at_write_ to a bitfield.
11847 * output.cc (Output_section::Output_sections): Initialize new
11848 fields.
11849 (Output_segment::add_output_section): Add do_sort parameter.
11850 Change all callers.
11851
1ae4d23b
ILT
118522009-11-03 Ian Lance Taylor <iant@google.com>
11853
11854 PR 10860
11855 * options.h (class General_options): Add --warn-common.
11856 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
11857 merging two common symbols.
11858 (Symbol_table::should_override): Handle --warn-common when merging
11859 a common symbol with a defined symbol. Use report_resolve_problem
11860 for multiple definitions.
11861 (Symbol_table::report_resolve_problem): New function.
11862 * symtab.h (class Symbol_table): Declare report_resolve_problem.
11863
55da9579
DK
118642009-11-03 Doug Kwan <dougkwan@google.com>
11865
11866 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
11867 stub_factory_.
11868 (Target_arm::stub_factory): New method definition.
11869 (Target_arm::new_arm_input_section,
11870 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
11871 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 11872 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
11873 New type definitions.
11874 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
11875 member declarations.
11876 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
11877 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
11878 New method definitions.
11879
37a9ac43
ILT
118802009-11-03 Ian Lance Taylor <iant@google.com>
11881
11882 * options.h (class General_options): Add --warn_constructors.
11883
b3d6a3d4
ILT
118842009-11-03 Ian Lance Taylor <iant@google.com>
11885
11886 PR 10893
11887 * defstd.cc (in_section): Add entries for __rel_iplt_start,
11888 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
11889
934b01dd
ILT
118902009-11-03 Ian Lance Taylor <iant@google.com>
11891
11892 PR 10895
11893 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
11894 --msgid-bugs-address.
11895 (install-pdf): New target.
11896 (install-data_yes): Look up one directory to find mkinstalldirs.
11897
03c1939b
L
118982009-11-03 H.J. Lu <hongjiu.lu@intel.com>
11899
11900 * po/Make-in (.po.gmo): Don't generate .gmo files in source
11901 tree.
11902
ebd95253
DK
119032009-10-30 Doug Kwan <dougkwan@google.com>
11904
11905 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
11906
e9bbb538
DK
119072009-10-30 Doug Kwan <dougkwan@google.com>
11908
11909 * arm.cc (Stub_addend_reader): New struct template definition
11910 and partial specializations.
11911 (Stub_addend_reader::operator()): New method definition for a
11912 partially specialized template.
11913
d5b40221
DK
119142009-10-30 Doug Kwan <dougkwan@google.com>
11915
11916 * arm.cc (Arm_relobj::processor_specific_flags): New method
11917 definition.
11918 (Arm_relobj::do_read_symbols): New method declaration.
11919 (Arm_relobj::processor_specific_flags_): New data member declaration.
11920 (Arm_dynobj): New class definition.
11921 (Target_arm::do_finalize_sections): Add input_objects parameter.
11922 (Target_arm::do_adjust_elf_header): New method declaration.
11923 (Target_arm::are_eabi_versions_compatible,
11924 (Target_arm::merge_processor_specific_flags): New method declaration.
11925 (Target_arm::do_make_elf_object): New overloaded method definitions
11926 and declaration.
11927 (Arm_relobj::do_read_symbols): New method definition.
11928 (Arm_dynobj::do_read_symbols): Ditto.
11929 (Target_arm::do_finalize_sections): Add input_objects parameters.
11930 Merge processor-specific flags from all input objects.
11931 (Target_arm::are_eabi_versions_compatible,
11932 Target_arm::merge_processor_specific_flags,
11933 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
11934 New method definitions.
11935 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
11936 Input_objects pointer type parameter.
11937 * layout.cc (Layout::finalize): Pass input objects to target's.
11938 finalize_sections function.
11939 * output.cc (Output_file_header::do_sized_write): Set ELF file
11940 header's processor-specific flags.
11941 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
11942 Input_objects pointer type parameter.
11943 * sparc.cc (Target_sparc::do_finalize_sections): Same.
11944 * target.h (Input_objects): New forward class declaration.
11945 (Target::processor_specific_flags,
11946 Target::are_processor_specific_flags_sect): New method definitions.
11947 (Target::finalize_sections): Add input_objects parameter.
11948 (Target::Target): Initialize processor_specific_flags_ and
11949 are_processor_specific_flags_set_.
11950 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
11951 parameter.
11952 (Target::set_processor_specific_flags): New method definition.
11953 (Target::processor_specific_flags_,
11954 Target::are_processor_specific_flags_set_): New data member
11955 declarations.
11956 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
11957 Input_objects pointer type parameter.
11958
ebabffbd
DK
119592009-10-30 Doug Kwan <dougkwan@google.com>
11960
11961 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
11962
ad0f2072
ILT
119632009-10-28 Ian Lance Taylor <iant@google.com>
11964
11965 * object.h (class Relobj): Drop options parameter from
11966 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
11967 do_scan_relocs, do_relocate. Change all callers.
11968 (class Sized_relobj): Drop options parameters from
11969 do_gc_process_relocs, do_scan_relocs, do_relocate,
11970 do_relocate_sections, relocate_sections, emit_relocs_scan,
11971 emit_relocs_scan_reltype. Change all callers.
11972 (struct Relocate_info): Remove options field and all references to
11973 it.
11974 * reloc.h (class Read_relocs): Remove options constructor
11975 parameter and options_ field. Change all callers.
11976 (class Gc_process_relocs, class Scan_relocs): Likewise.
11977 (class Relocate_task): Likewise.
11978 * target-reloc.h (scan_relocs): Remove options parameter. Change
11979 all callers.
11980 (scan_relocatable_relocs): Likewise.
11981 * target.h (class Sized_target): Remove options parameter from
11982 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
11983 all callers.
11984 * gc.h (gc_process_relocs): Remove options parameter. Change all
11985 callers.
11986 * arm.cc: Update functions to remove options parameters.
11987 * i386.cc: Likewise.
11988 * powerpc.cc: Likewise.
11989 * sparc.cc: Likewise.
11990 * x86_64.cc: Likewise.
11991 * testsuite/testfile.cc: Likewise.
11992
8ffa3667
DK
119932009-10-28 Doug Kwan <dougkwan@google.com>
11994
11995 * arm.cc (Arm_relobj): New class definition.
e1df38aa 11996 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
11997 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
11998 New method definitions.
11999
40f36857
CC
120002009-10-28 Cary Coutant <ccoutant@google.com>
12001
12002 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
12003 (Plugin::cleanup_done_): New member.
12004 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
12005 (Plugin_manager::cleanup_done_): Remove.
12006 (Plugin_manager::add_input_file): Edit error message.
12007 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
12008 (Plugin_manager::cleanup): Remove use of cleanup_done_.
12009
2c849493
ILT
120102009-10-27 Mikolaj Zalewski <mikolajz@google.com>
12011
12012 * fileread.cc: (File_read::View::~View): Use the new
12013 data_ownership_ filed.
12014 (File_read::~File_read): Dispose the new whole_file_view_.
12015 (File_read::open): Mmap the whole file if needed.
12016 (File_read::open): Use whole_file_view_ instead of contents_.
12017 (File_read::find_view): Use whole_file_view_ if applicable.
12018 (File_read::do_read): Use whole_file_view_ instead of contents_.
12019 (File_read::make_view): Use whole_file_view_ instead of contents_,
12020 update File_read::View::View call.
12021 (File_read::find_or_make_view): Update File_read::View::View
12022 call.
12023 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
12024 remove contents_
12025 (File_read::View::Data_ownership): New enum.
12026 (File_read::View::View): Replace bool mapped_ with Data_ownership
12027 argument.
12028 (File_read::View::mapped_): Remove (replaced by data_ownership_).
12029 (File_read::View::data_ownership_): New field.
12030 (File_read::contents_): Remove (replaced by whole_file_view_).
12031 (File_read::whole_file_view_): New field.
12032 * options.h (class General_options): Add --keep-files-mapped.
12033
24998053
CC
120342009-10-27 Cary Coutant <ccoutant@google.com>
12035
12036 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
12037 * testsuite/Makefile.am (plugin_test_5): New test case.
12038 * testsuite/Makefile.in: Regenerate.
12039
72adc4fa
DK
120402009-10-25 Doug Kwan <dougkwan@google.com>
12041
12042 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
12043 from private to protected to allow access by child class.
12044 (Sized_relobj::do_relocate_sections): New method declaration.
12045 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 12046 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
12047 Sized_relobj::relocate_sections. Instantiate template explicitly
12048 for different target sizes and endianity.
12049
07f508a2
DK
120502009-10-24 Doug Kwan <dougkwan@google.com>
12051
12052 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
12053 (Arm_input_section::as_arm_input_section): New method.
12054 (Arm_output_section): New class definition.
12055 (Arm_output_section::create_stub_group,
12056 Arm_output_section::group_sections): New method definitions.
12057
10ad9fe5
DK
120582009-10-22 Doug Kwan <dougkwan@google.com>
12059
12060 * arm.cc (Arm_input_section): New class definition.
12061 (Arm_input_section::init, Arm_input_section:do_write,
12062 Arm_input_section::set_final_data_size,
12063 Arm_input_section::do_reset_address_and_file_offset): New method
12064 definitions.
12065
56ee5e00
DK
120662009-10-21 Doug Kwan <dougkwan@google.com>
12067
12068 * arm.cc (Stub_table, Arm_input_section): New forward class
12069 declarations.
12070 (Stub_table): New class defintion.
12071 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
12072 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
12073 New method definition.
12074
b569affa
DK
120752009-10-21 Doug Kwan <dougkwan@google.com>
12076
12077 * arm.cc: Update copyright comments.
12078 (Target_arm): New forward class template declaration.
12079 (Arm_address): New type.
12080 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
12081 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
12082 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
12083 constants.
12084 (Insn_template): Same.
12085 (DEF_STUBS): New macro.
12086 (Stub_type): New enum type.
12087 (Stub_template): New class definition.
12088 (Stub): Same.
12089 (Reloc_stub): Same.
12090 (Stub_factory): Same.
12091 (Target_arm::Target_arm): Initialize may_use_blx_ and
12092 should_force_pic_veneer_.
12093 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
12094 Target_arm::should_force_pic_veneer,
12095 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
12096 Target_arm::using_thumb_only, Target_arm:;default_target): New
12097 method defintions.
12098 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
12099 New data member declarations.
12100 (Insn_template::size, Insn_template::alignment): New method defintions.
12101 (Stub_template::Stub_template): New method definition.
12102 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
12103 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
12104 (Stub_factory::Stub_factory): New method definition.
12105 * gold.h (string_hash): New template.
12106 * output.h (Input_section_specifier::hash_value): Use
12107 gold::string_hash.
12108 (Input_section_specifier::string_hash): Remove.
12109 * stringpool.cc (Stringpool_template::string_hash): Use
12110 gold::string_hash.
12111
6c172549
DK
121122009-10-20 Doug Kwan <dougkwan@google.com>
12113
12114 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
12115 symbols of relaxed input sections.
12116 * output.h (Output_section::find_relaxed_input_section): Make
12117 method public.
12118
c5617f2f
DK
121192009-10-16 Doug Kwan <dougkwan@google.com>
12120
12121 * dynobj.cc (Versions::Versions): Initialize version_script_.
12122 Only insert base version symbol definition for a shared object
12123 if version script defines any version versions.
12124 (Versions::define_base_version): New method definition.
12125 (Versions::add_def): Check that base version is not needed.
12126 (Versions::add_need): Define base version lazily.
12127 * dynobj.h (Versions::define_base_version): New method declaration.
12128 (Versions::needs_base_version_): New data member declaration.
12129 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
12130 (check_DATA): Add no_version_test.stdout.
12131 (libno_version_test.so, no_version_test.o no_version_test.stdout):
12132 New make rules.
12133 * testsuite/Makefile.in: Regenerate.
12134 * testsuite/no_version_test.c: New file.
12135 * testsuite/no_version_test.sh: Ditto.
12136
3c12dcdb
DK
121372009-10-16 Doug Kwan <dougkwan@google.com>
12138
12139 * expression.cc (class Segment_start_expression): New class definition.
12140 (Segment_start_expression::value): New method definition.
12141 (script_exp_function_segment_start): Return a new
12142 Segment_start_expression.
12143 * gold/script-c.h (script_saw_segment_start_expression): New function
12144 prototype.
12145 * script-sections.cc (Script_sections::Script_sections): Initialize
12146 SAW_SEGMENT_START_EXPRESSION_ to false.
12147 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
12148 and -Tbbs options to specify section addresses if given in
12149 command line and no SEGMENT_START expression is seen in a script.
12150 * script-sections.h (Script_sections::saw_segment_start_expression,
12151 Script_sections::set_saw_segment_start_expression): New method
12152 definition.
12153 (Script_sections::saw_segment_start_expression_): New data member
12154 declaration.
12155 * script.cc (script_saw_segment_start_expression): New function.
12156 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
12157 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
12158 script_test_7.sh and script_test_8.sh.
12159 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
12160 script_test_8.stdout.
12161 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
12162 (script_test_6, script_test_6.stdout, script_test_7,
12163 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
12164 * Makefile.in: Regenerate.
12165 * testsuite/script_test_6.sh: New file.
12166 * testsuite/script_test_6.t: Same.
12167 * testsuite/script_test_7.sh: Same.
12168 * testsuite/script_test_7.t: Same.
12169 * testsuite/script_test_8.sh: Same.
12170
64b1ae37
DK
121712009-10-16 Doug Kwan <dougkwan@google.com>
12172
12173 * output.cc (Output_segment::set_section_list_address): Cast
12174 expressions to unsigned long long type to avoid format warnings.
12175
661be1e2
ILT
121762009-10-15 Ian Lance Taylor <iant@google.com>
12177
12edd763 12178 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 12179 dot assignment to script_sections_.
12edd763
ILT
12180 * script-sections.cc (Script_sections::add_dot_assignment):
12181 Initialize if necessary.
12182
68b6574b
ILT
12183 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
12184 program headers with no load segment if there is a linker script.
12185
661be1e2
ILT
12186 * layout.cc (Layout::set_segment_offsets): Align the file offset
12187 to the segment aligment for -N or -n with no load segment.
12188 * output.cc (Output_segment::add_output_section): Don't crash if
12189 the first section is a TLS section.
12190 (Output_segment::set_section_list_addresses): Print an error
12191 message if the address moves backward in a linker script.
12192 * script-sections.cc
12193 (Output_section_element_input::set_section_addresses): Don't
12194 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
12195 (Orphan_output_section::set_section_addresses): Likewise.
12196
f15f61a7
DK
121972009-10-15 Doug Kwan <dougkwan@google.com>
12198
12199 * layout.cc (Layout::finish_dynamic_section): Generate tags
12200 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
12201 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
12202 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
12203
82bb573a
ILT
122042009-10-14 Ian Lance Taylor <iant@google.com>
12205
12206 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
12207 fields.
12208 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
12209 data_shdr fields of relinfo.
12210 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
12211 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
12212 R_386_TLS_LDO_32, adjust based on section flags.
12213 (Target_i386::Relocate::fix_up_ldo): Remove.
12214
374ad285
ILT
122152009-10-13 Ian Lance Taylor <iant@google.com>
12216
12217 Add support for -pie.
12218 * options.h (class General_options): Add -pie and
12219 --pic-executable.
12220 (General_options::output_is_position_independent): Test -pie.
12221 (General_options::output_is_executable): Return true if not shared
12222 and not relocatable.
12223 (General_options::output_is_pie): Remove.
12224 * options.cc (General_options::finalize): Reject incompatible uses
12225 of -pie.
12226 * gold.cc (queue_middle_tasks): A -pie link is not static.
12227 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
12228 * symtab.cc (Symbol::final_value_is_known): Return false if
12229 output_is_position_independent.
12230 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
12231 output_is_position_independent.
12232 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
12233 output_is_position_independent.
12234 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
12235 output_is_position_independent.
12236 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
12237 two_file_pie_test.
12238 (basic_pie_test.o, basic_pie_test): New targets.
12239 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
12240 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
12241 (two_file_pie_test): New target.
12242 * testsuite/Makefile.in: Rebuild.
12243 * README: Remove note saying that -pie is not supported.
12244
c6585162
ILT
122452009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
12246
12247 * options.h (class General_options): Add -init and -fini.
12248 * layout.cc (Layout::finish_dynamic_section): Emit
12249 given init and fini functions.
12250
032ce4e9
ST
122512009-10-13 Sriraman Tallam <tmsriram@google.com>
12252
12253 * gc.h (gc_process_relocs): Check if icf is enabled using new
12254 function.
12255 * gold.cc (queue_initial_tasks): Likewise.
12256 (queue_middle_tasks): Likewise.
12257 * object.cc (do_layout): Likewise.
12258 * symtab.cc (is_section_folded): Likewise.
12259 * main.cc (main): Likewise.
12260 * reloc.cc (Read_relocs::run): Likewise.
12261 (Sized_relobj::do_scan_relocs): Likewise.
12262 * icf.cc (is_function_ctor_or_dtor): New function.
12263 (Icf::find_identical_sections): Check if function is ctor or dtor when
12264 safe icf is chosen.
12265 * options.h (General_options::icf): Change option to be an enum.
12266 (Icf_status): New enum.
12267 (icf_enabled): New method.
12268 (icf_safe_folding): New method.
12269 (set_icf_status): New method.
12270 (icf_status_): New variable.
12271 * (options.cc) (General_options::finalize): Set icf_status_.
12272 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
12273 icf_test and icf_keep_unique_test to use the --icf enum flag.
12274 * testsuite/icf_safe_test.sh: New file.
e1df38aa 12275 * testsuite/icf_safe_test.cc: New file.
032ce4e9 12276
f345227a
ST
122772009-10-12 Sriraman Tallam <tmsriram@google.com>
12278
12279 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
12280 includes to gc.h and icf.h.
12281 * arm.cc: Include gc.h.
12282 * gold.cc: Likewise.
12283 * i386.cc: Likewise.
12284 * powerpc.cc: Likewise.
12285 * sparc.cc: Likewise.
12286 * x86_64.cc: Likewise.
12287 * gc.h: Include icf.h.
12288
1c7814ed
ILT
122892009-10-11 Ian Lance Taylor <iant@google.com>
12290
12291 * plugin.cc: Include "gold.h" before other header files.
12292
ae3b5189
CD
122932009-10-10 Chris Demetriou <cgd@google.com>
12294
12295 * options.h (Input_file_argument::Input_file_type): New enum.
12296 (Input_file_argument::is_lib_): Replace with...
12297 (Input_file_argument::type_): New member.
12298 (Input_file_argument::Input_file_argument): Take Input_file_type
12299 'type' rather than boolean 'is_lib' as second argument.
12300 (Input_file_argument::is_lib): Use type_.
12301 (Input_file_argument::is_searched_file): New function.
12302 (Input_file_argument::may_need_search): Handle is_searched_file.
12303 * options.cc (General_options::parse_library): Support -l:filename.
12304 (General_options::parse_just_symbols): Update for Input_file_argument
12305 changes.
12306 (Command_line::process): Likewise.
12307 * archive.cc (Archive::get_file_and_offset): Likewise.
12308 * plugin.cc (Plugin_manager::release_input_file): Likewise.
12309 * script.cc (read_script_file, script_add_file): Likewise.
12310 * fileread.cc (Input_file::Input_file): Likewise.
12311 (Input_file::will_search_for): Handle is_searched_file.
12312 (Input_file::open): Likewise.
12313 * readsyms.cc (Read_symbols::get_name): Likewise.
12314 * testsuite/Makefile.am (searched_file_test): New test.
12315 * testsuite/Makefile.in: Regenerate.
12316 * testsuite/searched_file_test.cc: New file.
12317 * testsuite/searched_file_test_lib.cc: New file.
12318
f3048a1d
ILT
123192009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12320 Ian Lance Taylor <iant@google.com>
12321
12322 * descriptor.cc: Include <cstdio> and "binary-io.h".
12323 (Descriptors::open): Open the files in binary mode always.
12324 * script.cc (Lex::get_token): Treat \r as whitespace.
12325
d4780e57
ILT
123262009-10-09 Ian Lance Taylor <iant@google.com>
12327
12328 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
12329
d9a893b8
ILT
123302009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12331 Ian Lance Taylor <iant@google.com>
12332
12333 * configure.ac: Check for readv function also.
12334 * fileread.cc (readv): Define if not HAVE_READV.
12335 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
12336 does not exist.
12337 * config.in: Regenerate.
12338 * configure: Regenerate.
12339
c0a62865
DK
123402009-10-09 Doug Kwan <dougkwan@google.com>
12341
12342 * layout.cc (Layout::make_output_section): Call target hook to make
12343 ordinary output section.
12344 (Layout::finalize): Adjust parameter list of call the
12345 Target::may_relax().
12346 * layout.h (class Layout::section_list): New method.
12347 * merge.h (Output_merge_base::entsize): Change visibility to public.
12348 (Output_merge_base::is_string, Output_merge_base::do_is_string):
12349 New methods.
12350 (Output_merge_string::do_is_string): New method.
12351 * object.cc (Sized_relobj::do_setup): renamed from
12352 Sized_relobj::set_up.
12353 * object.h (Sized_relobj::adjust_shndx,
12354 Sized_relobj::initializ_input_to_output_maps,
12355 Sized_relobj::free_input_to_output_maps): Change visibilities to
12356 protected.
12357 (Sized_relobj::setup): Virtualize.
12358 (Sized_relobj::do_setup): New method declaration.
12359 (Sized_relobj::invalidate_section_offset,
12360 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
12361 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
12362 * options.cc (parse_int): New function.
12363 * options.h (parse_int): New declaration.
12364 (DEFINE_int): New macro.
12365 (stub_group_size): New option.
12366 * output.cc (Output_section::Output_section): Initialize memebers
12367 merge_section_map_, merge_section_by_properties_map_,
12368 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
12369 (Output_section::add_input_section): Handled deferred code-fill
12370 generation and remove an old comment.
12371 (Output_section::add_relaxed_input_section): New method definition.
12372 (Output_section::add_merge_input_section): Use merge section by
12373 properties map to speed to search. Update merge section maps
12374 as appropriate.
12375 (Output_section::build_relaxation_map): New method definition.
12376 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
12377 Same.
12378 (Output_section::relax_input_section): Renamed to
12379 Output_section::convert_input_sections_to_relaxed_sections and change
12380 interface to take a vector of pointers to relaxed sections.
12381 (Output_section::find_merge_section,
12382 Output_section::find_relaxed_input_section): New method definitions.
12383 (Output_section::is_input_address_mapped,
12384 Output_section::output_offset, Output_section::output_address):
12385 Use output section data maps to speed up searching.
12386 (Output_section::find_starting_output_address): Add comments.
12387 (Output_section::do_write,
12388 Output_section::write_to_postprocessing_buffer): Do code-fill
12389 generation as appropriate.
12390 (Output_section::get_input_sections): Invalidate relaxed input section
12391 map.
12392 (Output_section::restore_states): Adjust type of checkpoint .
12393 Invalidate relaxed input section map.
12394 * output.h (Output_merge_base): New class declaration.
12395 (Input_section_specifier): New class defintion.
12396 (class Output_relaxed_input_section) Change base class to
12397 Output_section_data_build.
12398 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
12399 base class initializer.
12400 (Output_section::add_relaxed_input_section): New method declaration.
12401 (Output_section::Input_section): Change visibility to protected.
2e702c99 12402 (Output_section::Input_section::relobj,
c0a62865
DK
12403 Output_section::Input_section::shndx): Handle relaxed input sections.
12404 Output_section::input_sections) Change visibility to protected. Also
12405 define overload to return a non-const pointer.
12406 (Output_section::Merge_section_properties): New class defintion.
12407 (Output_section::Merge_section_by_properties_map,
12408 Output_section::Output_section_data_by_input_section_map,
12409 Output_section::Relaxation_map): New types.
12410 (Output_section::relax_input_section): Rename method to
12411 Output_section::convert_input_sections_to_relaxed_sections and change
12412 interface to take a vector of relaxed section pointers.
12413 (Output_section::find_merge_section,
12414 Output_section::find_relaxed_input_section,
12415 Output_section::build_relaxation_map,
12416 Output_section::convert_input_sections_in_list_to_relaxed_sections):
12417 New method declarations.
12418 (Output_section::merge_section_map_
12419 Output_section::merge_section_by_properties_map_,
12420 Output_section::relaxed_input_section_map_,
12421 Output_section::is_relaxed_input_section_map_valid_,
12422 Output_section::generate_code_fills_at_write_): New data members.
12423 * script-sections.cc
12424 (Output_section_element_input::set_section_addresses): Call
12425 current_data_size and addralign methods of relaxed input sections.
12426 (Orphan_output_section::set_section_addresses): Call current_data_size
12427 and addralign methods of relaxed input sections.
12428 * symtab.cc (Symbol_table::compute_final_value): Extract template
12429 from the body of Symbol_table::sized_finalize_symbol.
12430 (Symbol_table::sized_finalized_symbol): Call
12431 Symbol_table::compute_final_value.
12432 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
12433 (Symbol_table::compute_final_value): New templated method declaration.
12434 * target.cc (Target::do_make_output_section): New method defintion.
12435 * target.h (Target::make_output_section): New method declaration.
12436 (Target::relax): Add more parameters for input objects, symbol table
12437 and layout. Adjust call to do_relax.
12438 (Target::do_make_output_section): New method declaration.
12439 (Target::do_relax): Add parameters for input objects, symbol table
12440 and layout.
12441
d446d6c4
ILT
124422009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12443
12444 * pread.c: Include stdio.h.
12445
bc06c745
ILT
124462009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12447
12448 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
12449 defined.
12450
75aea3d0
ILT
124512009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12452
12453 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
12454 Change read_shndx type to unsigned int.
12455 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12456 int.
12457 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12458 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
12459 Change read_shndx type to unsigned int.
12460 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12461 int.
12462 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12463 * layout.cc (Layout::create_symtab_sections): Cast the result of
12464 local_symcount * symsize to off_t in the gold_assert.
12465
be8fcb75
ILT
124662009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12467
12468 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
12469 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
12470 R_ARM_BASE_ABS.
12471 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
12472 (Arm_relocate_functions::thm_abs5): New function.
12473 (Arm_relocate_functions::abs12): New function.
12474 (Arm_relocate_functions::abs16): New function.
12475 (Arm_relocate_functions::base_abs): New function.
12476 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
12477 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
12478 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
12479 R_ARM_BASE_ABS.
12480 (Scan::global): Likewise.
12481 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
12482 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
12483 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
12484 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
12485 R_ARM_BASE_ABS.
12486
c2a122b6
ILT
124872009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12488
12489 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
12490 (Arm_relocate_functions::movt_prel): New function.
12491 (Arm_relocate_functions::thm_movw_prel_nc): New function.
12492 (Arm_relocate_functions::thm_movt_prel): New function.
12493 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
12494 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
12495 (Scan::global, Relocate::relocate): Likewise.
12496 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12497
c4aa1e2d
ILT
124982009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12499
12500 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
12501 Incremental_checker.
12502 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
12503 unsigned int.
12504 (class Incremental_inputs_header): New class.
12505 (Incremental_inputs_header_writer): Edit comment.
12506 (Incremental_inputs_entry): New class.
12507 (Incremental_inputs_entry_writer): Edit comment.
12508 (Sized_incremental_binary::do_find_incremental_inputs_section):
12509 Add *strtab_shndx parameter, fill it.
12510 (Sized_incremental_binary::do_check_inputs): New method.
12511 (Incremental_checker::can_incrementally_link_output_file): Use
12512 Sized_incremental_binary::check_inputs.
12513 (Incremental_inputs::report_command_line): Save command line in
12514 command_line_.
12515 * incremental.h:
12516 (Incremental_binary::find_incremental_inputs_section): New
12517 method.
12518 (Incremental_binary::do_find_incremental_inputs_section): Add
12519 strtab_shndx parameter.
12520 (Incremental_binary::do_check_inputs): New pure virtual method.
12521 (Sized_incremental_binary::do_check_inputs): Declare.
12522 (Incremental_checker::Incremental_checker): Add incremental_inputs
12523 parameter, use it to initialize incremental_inputs_.
12524 (Incremental_checker::incremental_inputs_): New field.
12525 (Incremental_checker::command_line): New method.
12526 (Incremental_checker::inputs): New method.
12527 (Incremental_checker::command_line_): New field.
12528
c549a694
ILT
125292009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12530
12531 * incremental.cc: Include <cstdarg> and "target-select.h".
12532 (vexplain_no_incremental): New function.
12533 (explain_no_incremental): New function.
12534 (Incremental_binary::error): New method.
12535 (Sized_incremental_binary::do_find_incremental_inputs_section): New
12536 method.
12537 (make_sized_incremental_binary): New function.
12538 (open_incremental_binary): New function.
12539 (can_incrementally_link_file): Add checks if output is ELF and has
12540 inputs section.
12541 * incremental.h: Include "elfcpp_file.h" and "output.h".
12542 (Incremental_binary): New class.
12543 (Sized_incremental_binary): New class.
12544 (open_incremental_binary): Declare.
12545 * object.cc (is_elf_object): Use
12546 elfcpp::Elf_recognizer::is_elf_file.
12547 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
12548 * output.h (Output_file::filesize): New method.
12549
fd3c5f0b
ILT
125502009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12551
12552 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
12553 New function.
12554 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
12555 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
12556 function.
12557 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
12558 function.
12559 (Arm_relocate_functions::movw_abs_nc): New function.
12560 (Arm_relocate_functions::movt_abs): New function.
12561 (Arm_relocate_functions::thm_movw_abs_nc): New function.
12562 (Arm_relocate_functions::thm_movt_abs): New function.
12563 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
12564 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
12565 (Scan::global): Likewise.
12566 (Relocate::relocate): Likewise.
12567 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12568
7f5309a5
ILT
125692009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12570
12571 * arm.cc (Arm_relocate_functions::got_prel) New function.
12572 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
12573 (Relocate::relocate): Likewise.
12574 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12575
364c7fa5
ILT
125762009-10-06 Ian Lance Taylor <iant@google.com>
12577
12578 * options.h (class General_options): Define
12579 split_stack_adjust_size parameter.
12580 * object.h (class Object): Add uses_split_stack_ and
12581 has_no_split_stack_ fields. Add uses_split_stack and
12582 has_no_split_stack accessor functions. Declare
12583 handle_split_stack_section.
12584 (class Reloc_symbol_changes): Define.
12585 (class Sized_relobj): Define Function_offsets. Declare
12586 split_stack_adjust, split_stack_adjust_reltype, and
12587 find_functions.
12588 * object.cc (Object::handle_split_stack_section): New function.
12589 (Sized_relobj::do_layout): Call handle_split_stack_section.
12590 * dynobj.cc (Sized_dynobj::do_layout): Call
12591 handle_split_stack_section.
12592 * reloc.cc (Sized_relobj::relocate_sections): Call
12593 split_stack_adjust for executable sections in split_stack
12594 objects. Pass reloc_map to relocate_section.
12595 (Sized_relobj::split_stack_adjust): New function.
12596 (Sized_relobj::split_stack_adjust_reltype): New function.
12597 (Sized_relobj::find_functions): New function.
12598 * target-reloc.h: Include "object.h".
12599 (relocate_section): Add reloc_symbol_changes parameter. Change
12600 all callers.
12601 * target.h (class Target): Add calls_non_split method. Declare
12602 do_calls_non_split virtual method. Declare match_view and
12603 set_view_to_nop.
12604 * target.cc: Include "elfcpp.h".
12605 (Target::do_calls_non_split): New function.
12606 (Target::match_view): New function.
12607 (Target::set_view_to_nop): New function.
12608 * gold.cc (queue_middle_tasks): Give an error if mixing
12609 split-stack and non-split-stack objects with -r.
12610 * i386.cc (Target_i386::relocate_section): Add
12611 reloc_symbol_changes parameter.
12612 (Target_i386::do_calls_non_split): New function.
12613 * x86_64.cc (Target_x86_64::relocate_section): Add
12614 reloc_symbol_changes parameter.
12615 (Target_x86_64::do_calls_non_split): New function.
12616 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
12617 parameter.
12618 * powerpc.cc (Target_powerpc::relocate_section): Add
12619 reloc_symbol_changes parameter.
12620 * sparc.cc (Target_sparc::relocate_section): Add
12621 reloc_symbol_changes parameter.
12622 * configure.ac: Call AM_CONDITIONAL for the default target.
12623 * configure: Rebuild.
12624 * testsuite/Makefile.am (TEST_AS): New variable.
12625 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
12626 (check_DATA): Add split_i386 and split_x86_64 files.
12627 (SPLIT_DEFSYMS): Define.
12628 (split_i386_[1234n].o): New targets.
12629 (split_i386_[124]): New targets.
12630 (split_i386_[1234r].stdout): New targets.
12631 (split_x86_64_[1234n].o): New targets.
12632 (split_x86_64_[124]): New targets.
12633 (split_x86_64_[1234r].stdout): New targets.
12634 (MOSTLYCLEANFILES): Add new executables.
12635 * testsuite/split_i386.sh: New file.
12636 * testsuite/split_x86_64.sh: New file.
12637 * testsuite/split_i386_1.s: New file.
12638 * testsuite/split_i386_2.s: New file.
12639 * testsuite/split_i386_3.s: New file.
12640 * testsuite/split_i386_4.s: New file.
12641 * testsuite/split_i386_n.s: New file.
12642 * testsuite/split_x86_64_1.s: New file.
12643 * testsuite/split_x86_64_2.s: New file.
12644 * testsuite/split_x86_64_3.s: New file.
12645 * testsuite/split_x86_64_4.s: New file.
12646 * testsuite/split_x86_64_n.s: New file.
12647 * testsuite/testfile.cc (Target_test): Update relocation_section
12648 function.
12649 * testsuite/Makefile.in: Rebuild.
12650
e8a9fcda
ILT
126512009-10-06 Ian Lance Taylor <iant@google.com>
12652
12653 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
12654 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
12655 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
12656 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
12657 the address on ldo_addrs_.
12658 (Target_i386::Relocate::fix_up_ldo): New function.
12659
e99daf92
ILT
126602009-10-06 Rafael Espindola <espindola@google.com>
12661
12662 * plugin.cc (add_input_library): New.
12663 (Plugin::load): Add add_input_library to tv.
12664 (Plugin_manager::add_input_file): Add the is_lib argument.
12665 (add_input_file): Update call to Plugin_manager::add_input_file.
12666 (add_input_library): New.
12667 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
12668
966d4097
DK
126692009-09-30 Doug Kwan <dougkwan@google.com>
12670
12671 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
12672 symbol and call Symbol::may_need_copy_reloc to determine if
12673 a copy reloc is needed.
12674 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
12675 nocopyreloc is given in command line.
12676 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
12677 given in command line.
12678 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
12679 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
12680 of the removed Target_i386::may_need_copy_reloc.
12681 * options.h (copyreloc): New option with default value false.
12682 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12683 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
12684 instead of the removed Target_powerpc::may_need_copy_reloc.
12685 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12686 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
12687 instead of the removed Target_sparc::may_need_copy_reloc.
12688 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
12689 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
12690 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
12691 instead of the removed Target_x86_64::may_need_copy_reloc.
12692
029ba973
ILT
126932009-09-30 Ian Lance Taylor <iant@google.com>
12694
12695 * object.h (class Object): Remove target_ field, and target,
12696 sized_target, and set_target methods.
12697 (Object::sized_target): Remove.
12698 (class Sized_relobj): Update declarations. Remove sized_target.
12699 * object.cc (Sized_relobj::setup): Remove target parameter.
12700 Change all callers.
12701 (Input_objects::add_object): Don't do anything with the target.
12702 (make_elf_sized_object): Add punconfigured parameter. Change all
12703 callers. Set or test parameter target.
12704 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
12705 Change all callers.
12706 * parameters.cc (Parameters::set_target): Change parameter type to
12707 be non-const.
12708 (Parameters::default_target): Remove.
12709 (set_parameters_target): Change parameter type to be non-const.
12710 (parameters_force_valid_target): New function.
12711 (parameters_clear_target): New function.
12712 * parameters.h (class Parameters): Update declarations. Remove
12713 default_target method. Add sized_target and clear_target
12714 methods. Change target_ to be non-const.
12715 (set_parameters_target): Update declaration.
12716 (parameters_force_valid_target): Declare.
12717 (parameters_clear_target): Declare.
12718 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
12719 as NULL if we aren't searching.
12720 (Add_symbols::run): Don't check for compatible target.
12721 * fileread.cc (Input_file::open_binary): Call
12722 parameters_force_valid_target.
12723 * gold.cc (queue_middle_tasks): Likewise.
12724 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
12725 set_target on object.
12726 * dynobj.h (class Sized_dynobj): Update declarations.
12727 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
12728 make_elf_object returns NULL.
12729 (Archive::include_member): Don't check whether object target is
12730 compatible.
12731 * output.cc (Output_section::add_input_section): Get target from
12732 parameters.
12733 (Output_section::relax_input_section): Likewise.
12734 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
12735 parameters.
12736 (Sized_relobj::do_scan_relocs): Likewise.
12737 (Sized_relobj::relocate_sections): Likewise.
12738 * resolve.cc (Symbol_table::resolve): Likewise.
12739 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
12740 parameter. Change all callers.
12741 (Symbol_table::add_from_object): Get target from parameters.
12742 (Symbol_table::add_from_relobj): Don't check object target.
12743 (Symbol_table::add_from_dynobj): Likewise.
12744 (Symbol_table::define_special_symbol): Get target from
12745 parameters.
12746 * symtab.h (class Symbol_table): Update declaration.
12747 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
12748 parameter. Change all callers. Clear parameter target.
12749 (Binary_test): Test target here.
12750 * testsuite/object_unittest.cc (gold_testsuite): Remove
12751 target_test_pointer parameter. Change all callers.
12752 (Object_test): Test target here.
12753
a6a22b83
ILT
127542009-09-26 Ian Lance Taylor <iant@google.com>
12755
12756 * testsuite/initpri1.c: Don't try to use constructor priorities if
12757 compiling with gcc before 4.3.
12758
6a8f49fe
ILT
127592009-09-22 Mikolaj Zalewski <mikolajz@google.com>
12760
12761 * testsuite/retain_symbols_file_test.sh (check_present): Change
12762 output file name to retain_symbols_file_test.stdout.
12763 (check_absent): Likewise.
12764
8c604651
CS
127652009-09-18 Craig Silverstein <csilvers@google.com>
12766
12767 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
12768 * options.cc: Include <cerrno> and <fstream>.
12769 (General_options::finalize): Parse -retain-symbols-file tag.
12770 * options.h: New flag.
12771 (General_options): New method should_retain_symbol, new
12772 variable symbols_to_retain.
12773 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
12774 should_retain_symbol map.
12775 * testsuite/Makefile.am (retain_symbols_file_test): New test.
12776 * testsuite/Makefile.in: Regenerate.
12777 * testsuite/retain_symbols_file_test.sh: New file.
12778
ca58b19f
NC
127792009-09-18 Nick Clifton <nickc@redhat.com>
12780
12781 * po/es.po: Updated Spanish translation.
12782
20e6d0d6
DK
127832009-09-17 Doug Kwan <dougkwan@google.com>
12784
12785 * debug.h (DEBUG_RELAXATION): New constant.
12786 (DEBUG_ALL): Add DEBUG_RELAXATION.
12787 (debug_string_to_enum): Add relaxation debug option.
12788 * layout.cc
12789 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
12790 Layout::Relaxation_debug_check::read_sections,
12791 Layout::Relaxation_debug_check::read_sections): New method definitions.
12792 (Layout::Layout): Initialize data members
12793 record_output_section_data_from_scrips_,
12794 script_output_section_data_list_ and relaxation_debug_check_.
12795 (Layout::save_segments, Layout::restore_segments,
12796 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12797 Layout::relaxation_loop_body): New method definitions.
12798 (Layout::finalize): Support relaxation. Move section layout code to
12799 Layout::relaxation_loop_body.
12800 (Layout::set_asection_address_from_script): Move code for orphan
12801 section placement out.
12802 (Layout::place_orphan_sections_in_script): New method definition.
12803 * layout.h (Output_segment_headers, Output_file_header):
12804 New forward class declarations.
12805 (Layout::~Layout): Define.
12806 (Layout::new_output_section_data_from_script): New method definition.
12807 (Layout::place_orphan_sections_in_script): New method declaration.
12808 (Layout::Segment_states): New type declaration.
12809 (Layout::save_segments, Layout::restore_segments,
12810 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12811 Layout::relaxation_loop_body): New method declarations.
12812 (Layout::Output_section_data_list): New type declaration.
12813 (Layout::Relaxation_debug_check): New class definition.
12814 (Layout::record_output_section_data_from_script_,
12815 Layout::script_output_section_data_list_, Layout::segment_states_,
12816 Layout::relaxation_debug_check_): New data members.
12817 * output.cc: (Output_section_headers::do_size): New method definition.
12818 (Output_section_headers::Output_section_headers): Move size
12819 computation to Output_section_headers::do_size.
12820 (Output_segment_headers::do_size): New method definition.
e1df38aa 12821 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
12822 Output_file_header::do_size and call it.
12823 (Output_file_header::do_size): New method definition.
12824 (Output_data_group::Output_data_group): Adjust call to
12825 Output_section_data.
12826 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
12827 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 12828 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
12829 RELAXED_INPUT_SECTION_CODE.
12830 (Output_section::Output_section): Initialize data member checkpoint_.
12831 (Output_section::~Output_section): Delete checkpoint object pointed
12832 by checkpoint_.
12833 (Output_section::add_input_section): Always add an Input_section if
12834 relaxing.
12835 (Output_section::add_merge_input_section): Add assert.
12836 (Output_section::relax_input_section): New method definition.
12837 (Output_section::set_final_data_size): Set load address to zero for
12838 an unallocated section.
12839 (Output_section::do_address_and_file_offset_have_reset_values):
12840 New method definition.
12841 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
12842 Handle relaxed input section.
12843 (Output_section::sort_attached_input_sections): Checkpoint input
12844 section list lazily.
12845 (Output_section::get_input_sections): Change type of input_sections to
12846 list of Simple_input_section pointers. Checkpoint input section list
12847 lazily. Also handle relaxed input sections.
12848 (Output_section::add_input_section_for_script): Take a reference to
12849 a Simple_input_section object instead of Relobj pointer and section
12850 index as parameter. Handle relaxed input sections.
12851 (Output_section::save_states, Output_section::restore_states): New
12852 method definitions.
12853 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
12854 (Output_data::is_data_size_fixed): New method definition.
12855 (Output_data::reset_addresss_and_file_offset): Do not reset data size
12856 if it is fixed.
12857 (Output_data::address_and_file_offset_have_reset_values): New method
12858 definition.
12859 (Output_data::do_address_and_file_offset_have_reset_values): New method
12860 definition.
12861 (Output_data::set_data_size): Check that data size is not fixed.
12862 (Output_data::fix_data_size): New method definition.
12863 (Output_data::is_data_size_fixed_): New data member.
12864 (Output_section_headers::set_final_data_size): New method definition.
12865 (Output_section_headers::do_size): New method declaration.
12866 (Output_segment_headers::set_final_data_size): New method definition.
12867 (Output_segment_headers::do_size): New method declaration.
12868 (Output_file_header::set_final_data_size)::New method definition.
12869 (Output_file_header::do_size)::New method declaration.
12870 (Output_section_data::Output_section_data): Add new parameter
12871 is_data_size_fixed and use it to fix data size.
12872 (Output_data_const::Output_data_const): Adjust call to base class
12873 constructor and fix data size.
12874 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
12875 base class constructor and fix data size.
12876 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
12877 base class constructor and fix data size.
12878 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
12879 class constructor and fix data size.
12880 (Output_data_group::set_final_data_size): New method definition.
12881 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
12882 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
12883 class constructor and fix data size.
12884 (Output_relaxed_input_section): New class definition.
12885 (Output_section::Simple_input_section): New class definition.
12886 (Output_section::get_input_sections): Adjust parameter list.
12887 (Output_section::add_input_section_for_script): Same.
12888 (Output_section::save_states, Output_section::restore_states,
12889 Output_section::do_address_and_file_offset_have_reset_values,
12890 (Output_section::Input_section::Input_section): Handle
12891 RELAXED_INPUT_SECTION_CODE. Add new overload for
12892 Output_relaxed_input_section.
12893 (Output_section::Input_section::is_input_section,
12894 Output_section::Input_section::set_output_section): Handle relaxed
12895 input section.
12896 (Output_section::Input_section::is_relaxed_input_section,
12897 Output_section::Input_section::output_section_data,
12898 Output_section::Input_section::relaxed_input_section): New method
12899 definitions.
12900 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
12901 value.
12902 (Output_section::Input_section::u1_): Update comments.
12903 (Output_section::Input_section::u2_): Add new union member poris.
12904 (Output_section::Checkpoint_output_section): New classs definition.
12905 (Output_section::relax_input_section): New method declaration.
12906 (Output_section::checkpoint_): New data member.
12907 (Output_segment): Update comments.
12908 (Output_segment::Output_segment): Un-privatize copy constructor.
12909 (Output_segment::operator=): Un-privatize.
12910 * script-sections.cc (Output_section_element::Input_section_list):
12911 Change element type to Output_section::Simple_input_section.
12912 (Output_section_element_dot_assignment::set_section_addresses):
12913 Register output section data for relaxation clean up.
12914 (Output_data_exression::Output_data_expression): Adjust call to base
12915 constructor to fix data size.
12916 (Output_section_element_data::set_section_addresses): Register
12917 Output_data_expression object for relaxation clean up.
12918 (struct Input_section_info): Replace Relobj pointer and section index
12919 pair with Output_section::Simple_input_section and Convert struct to a
12920 class.
12921 (Input_section_sorter::operator()): Adjust access to
e1df38aa 12922 Input_section_info data member to use accessors.
20e6d0d6
DK
12923 (Output_section_element_input::set_section_addresses): Use layout
12924 parameter. Adjust code to use Output_section::Simple_input_section
12925 and Input_secction_info classes. Register filler for relaxation
12926 clean up.
12927 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
12928 and section index pair with Output_section::Simple_input_section
12929 class. Adjust code accordingly.
12930 (Phdrs_element::release_segment): New method definition.
12931 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
12932 segment list.
12933 (Script_sections::release_segments): New method definition.
12934 * gold/script-sections.h (Script_sections::release_segments): New
12935 method declaration.
12936 * gold/target.h (Target::may_relax, Target::relax,
12937 Target::do_may_relax, Target::do_relax): New method definitions.
12938
5e445df6
ILT
129392009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12940
12941 * arm.cc (has_signed_unsigned_overflow): New function.
12942 (Arm_relocate_functions::abs8): New function.
12943 (Target_arm::Scan::local): Handle R_ARM_ABS8.
12944 (Target_arm::Scan::global): Likewise.
12945 (Target_arm::relocate::relocate): Likewise.
12946 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12947 Likewise.
12948
8c604651 129492009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
12950
12951 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
12952 * testsuite/Makefile.in: Regenerate.
12953
1e9cc1c2
NC
129542009-09-11 Nick Clifton <nickc@redhat.com>
12955
12956 * po/gold.pot: Updated by the Translation project.
12957
6a89f575
CC
129582009-09-08 Cary Coutant <ccoutant@google.com>
12959
12960 * output.cc (Output_file::open): Add execute permission to empty file.
12961 * testsuite/Makefile.am (permission_test): New test.
12962 * testsuite/Makefile.in: Regenerate.
12963
fdcac5af
ILT
129642009-09-02 Ian Lance Taylor <iant@google.com>
12965
12966 * output.cc (Output_file::resize): Call map_no_anonymous rather
12967 than map.
12968
44453f85
ILT
129692009-09-01 Mikolaj Zalewski <mikolajz@google.com>
12970
12971 * gold.cc: Include "incremental.h".
12972 (queue_initial_tasks): Call Incremental_checker methods.
12973 * incremental.cc: Include "output.h".
12974 (Incremental_checker::can_incrementally_link_output_file): New
12975 method.
12976 * incremental.h (Incremental_checker): New class.
12977
12978 * output.cc (Output_file::open_for_modification): New method.
12979 (Output_file::map_anonymous): Changed return type to bool. Record
12980 map in base_ field.
12981 (Output_file::map_no_anonymous): New method, broken out of map.
12982 (Output_file::map): Use map_no_anonymous and map_anonymous.
12983 * output.h (class Output_file): Update declarations.
12984
293c1386
CC
129852009-08-24 Cary Coutant <ccoutant@google.com>
12986
12987 * options.h (Command_line::Pre_options): New class.
12988 (Command_line::pre_options): New member.
12989 * options.cc (gold::options::ready_to_register): New variable.
12990 (One_option::register_option): Do nothing if not registering options.
12991 Assert if same short option registered twice.
12992 (General_options::General_options): Turn off option registration when
12993 done constructing.
12994 (Command_line::Pre_options::Pre_options): New constructor.
12995
f773f3d2
CC
129962009-08-24 Cary Coutant <ccoutant@google.com>
12997
06a73cfe
CC
12998 * options.h (General_options::no_keep_memory): Remove incorrect
12999 short option.
f773f3d2 13000
a15af8e2
RW
130012009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13002
13003 * Makefile.am (am__skiplex, am__skipyacc): New.
13004 * Makefile.in: Regenerate.
13005
c462b41b
RW
130062009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13007
14ec8efd
RW
13008 * Makefile.am (AM_CPPFLAGS): Renamed from ...
13009 (INCLUDES): ... this.
13010 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
13011 (AM_CPPFLAGS): Renamed from ...
13012 (INCLUDE): ... this.
13013 * Makefile.in, testsuite/Makefile.in: Regenerate.
13014
81ecdfbb
RW
13015 * Makefile.in: Regenerate.
13016 * aclocal.m4: Likewise.
13017 * config.in: Likewise.
13018 * configure: Likewise.
13019 * testsuite/Makefile.in: Likewise.
13020
c462b41b
RW
13021 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13022 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13023 * Makefile.in: Regenerate.
13024 * testsuite/Makefile.in: Regenerate.
13025
2da73f13
CC
130262009-08-19 Cary Coutant <ccoutant@google.com>
13027
13028 * resolve.cc (Symbol_table::resolve): Don't complain about defined
13029 symbols in shared libraries overridden by hidden or internal symbols
13030 in the main program.
13031
2db70501
CD
130322009-08-19 Chris Demetriou <cgd@google.com>
13033
13034 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
13035 checking source file names in error messages.
13036
f733487b
DK
130372009-08-18 Doug Kwan <dougkwan@google.com>
13038
13039 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
13040 an elcpp::Ehdr as parameter. Adjust call to set_target.
13041 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
13042 an elfcpp::Ehdr as parameter.
13043 * object.cc (Object::set_target): Remove the version that looks up
13044 a target and sets it.
13045 (Sized_relobj::setup): Take a Target object instead of
13046 an elfcpp::Ehdr as parameter. Adjust call to set_target.
13047 (make_elf_sized_object): Find target and ask target to
13048 make an ELF object.
13049 * object.h: (Object::set_target): Remove the version that looks up
13050 a target and sets it.
13051 (Sized_relobj::setup): Take a Target object instead of
13052 an elfcpp:Ehdr as parameter.
13053 * target.cc: Include dynobj.h.
13054 (Target::do_make_elf_object_implementation): New.
2e702c99 13055 (Target::do_make_elf_object): New.
f733487b
DK
13056 * target.h (Target::make_elf_object): New template declaration.
13057 (Target::do_make_elf_object): New method declarations.
13058 (Target::do_make_elf_object_implementation): New template declaration.
13059
cc70f101
ILT
130602009-08-14 Ian Lance Taylor <iant@google.com>
13061
13062 * gold.h (FUNCTION_NAME): Define.
13063 (gold_unreachable): Use FUNCTION_NAME.
13064
ef5e0cb1
ST
130652009-08-12 Sriraman Tallam <tmsriram@google.com>
13066
13067 * icf.cc (Icf::find_identical_sections): Issue a warning when a
13068 symbol in the --keep-unique list is not found.
13069
48c187ce
ST
130702009-08-12 Sriraman Tallam <tmsriram@google.com>
13071
13072 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
13073 been maked as --keep-unique.
13074 (Icf::unfold_section): New function.
13075 * icf.h (Icf::unfold_section): New function.
13076 * options.h (General_options::keep_unique): New option.
13077 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
13078 * testsuite/Makefile.in: Regenerate.
13079 * testsuite/icf_keep_unique_test.sh: New file.
13080 * testsuite/icf_keep_unique_test.cc: New file.
13081
645afe0c
CC
130822009-08-12 Cary Coutant <ccoutant@google.com>
13083
13084 PR 10471
13085 * resolve.cc (Symbol_table::resolve): Check for references from
13086 dynamic objects to hidden and internal symbols.
13087 * testsuite/Makefile.am (hidden_test.sh): New test.
13088 * testsuite/Makefile.in: Regenerate.
13089 * testsuite/hidden_test.sh: New script.
13090 * testsuite/hidden_test_1.c: New test source.
13091 * testsuite/hidden_test_main.c: New test source.
13092
11af873f
DK
130932009-08-11 Doug Kwan <dougkwan@google.com>
13094
13095 * arm.cc: Update comments.
13096 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
13097 segment to locate the .ARM.exidx section if present.
13098
b9f7d72d
DK
130992009-08-09 Doug Kwan <dougkwan@google.com>
13100
13101 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
13102 patch.
13103
ddd3c53c
ST
131042009-08-07 Sriraman Tallam <tmsriram@google.com>
13105 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
13106 compiler warnings.
13107
27721062
ST
131082009-08-06 Sriraman Tallam <tmsriram@google.com>
13109
13110 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
13111 valid tls_segment only for non-debug-section relocations.
13112 * testsuite/Makefile.am: Add gc_tls_test.
13113 * testsuite/Makefile.in: Regenerate.
13114 * testsuite/gc_tls_test.cc: New file.
13115 * testsuite/gc_tls_test.sh: New file.
13116
ef15dade 131172009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 13118
ef15dade
ST
13119 * icf.cc: New file.
13120 * icf.h: New file.
13121 * Makefile.am (CCFILES): Add icf.cc.
13122 (HFILES): Add icf.h
13123 * Makefile.in: Regenerate.
13124 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
13125 * gc.h (gc_process_relocs): Populate lists used by icf to contain
13126 section, symbol and addend information for the relocs.
13127 * gold.cc (queue_middle_tasks): Call identical code folding.
13128 * gold.h: Add defines for multimap.
13129 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
13130 to the call of finalize_local_symbols.
13131 * main.cc (main): Create object of class Icf.
13132 * object.cc (Sized_relobj::do_layout): Allow this function to be
13133 called twice during icf.
13134 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
13135 to sections marked as identical by icf.
13136 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
13137 when available.
13138 (Sized_relobj::do_section_entsize): New function.
13139 * object.h (Object::section_entsize): New function.
13140 (Object::do_section_entsize): New pure virtual function.
13141 (Relobj::finalize_local_symbols): Add new parameter.
13142 (Relobj::do_section_entsize): New function.
13143 * options.h (General_options::icf): New option.
13144 (General_options::icf_iterations): New option.
13145 (General_options::print_icf_sections): New option.
13146 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
13147 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
13148 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
13149 icf.
13150 * symtab.cc (Symbol_table::is_section_folded): New function.
13151 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
13152 to sections marked as identical by icf.
13153 * symtab.h (Symbol_table::set_icf): New function.
13154 (Symbol_table::icf): New function.
13155 (Symbol_table::is_section_folded): New function.
13156 (Symbol_table::icf_): New data member.
13157 * target-reloc.h (relocate_section): Ignore sections folded by icf.
13158 * testsuite/Makefile.am: Add commands to build icf_test.
13159 * testsuite/Makefile.in: Regenerate.
13160 * testsuite/icf_test.sh: New file.
13161 * testsuite/icf_test.cc: New file.
13162
c3b65ac4
CD
131632009-07-24 Chris Demetriou <cgd@google.com>
13164
13165 * layout.cc (is_compressible_debug_section): Fix incorrect
13166 comment about compressed section names.
13167
1caf2c51
ILT
131682009-07-20 Ian Lance Taylor <ian@airs.com>
13169
13170 PR 10419
13171 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
13172
1ef4d87f
ILT
131732009-07-16 Ian Lance Taylor <iant@google.com>
13174
13175 PR 10400
13176 * layout.h: #include <map>.
13177 (class Kept_section): Change from struct to class. Add accessors
13178 and setters. Add section size to Comdat_group mapping. Change
13179 Comdat_group to std::map. Add is_comdat_ field. Add
13180 linkonce_size field in union.
13181 (class Layout): Update declaration of find_or_add_kept_section.
13182 Don't declare find_kept_object.
13183 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
13184 parameter. Add object, shndx, is_comdat, and is_group_name
13185 parameters. Change all callers. Adjust for new Kept_section.
13186 (Layout::find_kept_object): Remove.
13187 * object.cc (Sized_relobj::include_section_group): Update use of
13188 Kept_section. Rename secnum to shndx. Only record
13189 Kept_comdat_section if sections are the same size.
13190 (Sized_relobj::include_linkonce_section): Update use of
13191 Kept_section. Only record Kept_comdat_section if sections are the
13192 same size. Set size of linkonce section.
13193 (Sized_relobj::map_to_kept_section): Update call to
13194 get_kept_comdat_section.
13195 * object.h (class Sized_relobj): Rename fields in
13196 Kept_comdat_section to drop trailing underscores; change object
13197 field to Relobj*. Change Kept_comdat_section_table to store
13198 struct rather than pointer.
13199 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
13200 Add kept_object and kept_shndx parameters. Change all callers.
13201 (Sized_relobj::get_kept_comdat_section): Change return type to
13202 bool. Add kept_object and kept_shndx parameters. Change all
13203 callers.
13204 * plugin.cc (Pluginobj::include_comdat_group): Update call to
13205 Layout::find_or_add_kept_section.
13206
37c3b7b0
ILT
132072009-07-09 Ian Lance Taylor <iant@google.com>
13208
13209 * merge.cc (Object_merge_map::initialize_input_to_output_map):
13210 Reserve space in the hash table.
13211
98fa85cb
ILT
132122009-07-06 Mikolaj Zalewski <mikolajz@google.com>
13213
13214 * fileread.cc (File_read::get_mtime): New method.
13215 * fileread.h (Timespec): New structure.
13216 (File_read::get_mtime): New method.
13217 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
13218 Renamed from timestamp_nsec.
13219 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
13220 Elf_Xword.
e1df38aa 13221 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 13222 timestamp_nsec.
e1df38aa 13223 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
13224 (Incremental_inputs::report_obejct): Save mtime; style fix.
13225 (Incremental_inputs::report_script): Save mtime; style fix.
13226 (Incremental_inputs::finalize_inputs): Style fix.
13227 (Incremental_inputs::finalize): Style fix.
13228 (Incremental_inputs::create_input_section_data): Store inputs
13229 mtime.
13230 * incremental.h (Incremental_inputs::report_script): Add mtime
13231 argument.
13232 (Incremental_inputs::Input_info::Input_info): Intialize only one
13233 union member.
13234 (Incremental_inputs::Input_info::archive): Move to nameless
13235 union.
13236 (Incremental_inputs::Input_info::obejct): Move to nameless union.
13237 (Incremental_inputs::Input_info::script): Move to nameless union.
13238 (Incremental_inputs::mtime): New field.
13239 * script.cc (read_input_script): Pass file mtime to
13240 Incremental_input.
13241 * script.h (Script_info::inputs): Style fix.
13242
c9d70757
ILT
132432009-07-01 Ian Lance Taylor <ian@airs.com>
13244
13245 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
13246 instead of 32.
13247
9c547ec3
ILT
132482009-06-24 Ian Lance Taylor <iant@google.com>
13249
13250 PR 10156
13251 * layout.cc (Layout::choose_output_section): If we find an
13252 existing section, update the flags.
13253 (Layout::create_notes): New function, broken out of
13254 Layout::finalize.
13255 (Layout::finalize): Don't create note sections.
13256 (Layout::create_note): Don't crash if linker script discards
13257 section.
13258 (Layout::create_gold_note): Likewise.
13259 (Layout::create_build_id): Likewise. Don't set
13260 after_input_sections on the section.
13261 (Layout::create_executable_stack_info): Remove target parameter.
13262 Change caller.
13263 * layout.h (class Layout): Declare create_notes. Update
13264 declaration of create_executable_stack_info.
13265 * gold.cc (queue_middle_tasks): Call create_notes.
13266 * output.cc (Output_section::update_flags_for_input_section): Move
13267 here from output.h. If SHF_ALLOC flag is newly set, mark address
13268 invalid.
13269 * output.h (Output_data::mark_address_invalid): New function.
13270 (class Output_section): Only declare, not define,
13271 update_flags_for_input_section. Remove set_flags.
13272
55458500
ILT
132732009-06-24 Ian Lance Taylor <iant@google.com>
13274
13275 * script-sections.cc (Output_section_definition::
13276 set_section_addresses): Rename shadowing local load_address to
13277 laddr.
13278
1307d6cd
ILT
132792009-06-24 Ian Lance Taylor <iant@google.com>
13280
13281 PR 10244
13282 * reloc.cc (relocate_sections): Skip empty relocation sections.
13283
ec3f783e
ILT
132842009-06-23 Ian Lance Taylor <iant@google.com>
13285
13286 PR 10156
13287 * layout.cc (Layout::create_note): Use choose_output_section
13288 rather than make_output_section.
13289
459c9f1c
ILT
132902009-06-23 Ian Lance Taylor <iant@google.com>
13291
13292 PR 10237
13293 * options.cc (General_options::parse_V): Set printed_version_.
13294 (General_options::General_options): Initialize printed_version_.
13295 * options.h (class General_options): Add printed_version_ field.
13296 * gold.cc (queue_initial_tasks): If there are no input files,
13297 don't give a fatal error if we printed the version information.
13298 (queue_middle_tasks): If using -r with a shared object, give a
13299 fatal error rather than an ordinary error.
13300
1518dc8f
ILT
133012009-06-23 Ian Lance Taylor <iant@google.com>
13302
13303 PR 10219
13304 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
13305 (Layout::make_output_section): Set have_stabstr_section_ if we see
13306 a .stab*str section.
13307 (Layout::finalize): Call link_stabs_sections.
13308 (Layout::link_stabs_sections): New file.
13309 * layout.h (class Layout): Add have_stabstr_section_ field.
13310 Declare link_stabs_sections.
13311
3d857b98
DK
133122009-06-23 Doug Kwan <dougkwan@google.com>
13313
13314 * Makefile.am (libgold_a_LIBADD): New.
13315 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 13316 * Makefile.in: Regenerate.
3d857b98
DK
13317 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
13318 * configure: Regenerate.
13319 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
13320 * fileread.cc: Include sys/state.h
13321 * gold.h: Declare memmem and strndup if found missing.
13322 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
13323
0639a6f6
ILT
133242009-06-23 Ian Lance Taylor <iant@google.com>
13325
13326 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
13327 * configure: Rebuild.
13328
8d63875c
ILT
133292009-06-23 Ian Lance Taylor <iant@google.com>
13330
13331 PR 10147
13332 * object.cc (Object::section_contents): Don't try to get a view if
13333 the section has length zero.
13334 (Object::handle_gnu_warning_section): If the section is empty, use
13335 the name of the section as the warning.
13336
f7c8a183
ILT
133372009-06-23 Ian Lance Taylor <iant@google.com>
13338
13339 PR 10133
13340 * stringpool.h (class Stringpool_template): Add optimize_ field.
13341 (Stringpool_template::set_optimize): New function.
13342 * stringpool.cc (Stringpool_template::Stringpool_template):
13343 Initialize optimize_ field.
13344 (Stringpool_template::set_string_offsets): Test local optimize
13345 fild rather than parameter.
13346 * layout.cc (Layout::Layout): Call set_optimize on the section
13347 name stringpool.
13348
e6a307ba
ILT
133492009-06-22 Ian Lance Taylor <iant@google.com>
13350
13351 PR 10030
13352 * yyscript.y: Parse TARGET.
13353 * script.cc (script_set_target): New function.
13354 * script-c.h (script_set_target): Declare.
13355 * options.cc (General_options::string_to_object_format): Rename
13356 from string_to_object_format in anonymous namespace. Change
13357 callers.
13358 * options.h (class General_options): Declare
13359 string_to_object_format.
13360
3ee173de
ILT
133612009-06-22 Ian Lance Taylor <iant@google.com>
13362
13363 * script-sections.cc (Script_sections::create_segments): Don't put
13364 program headers in a PT_LOAD segment if -n or -N.
13365
133662009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
13367
13368 PR 10141
13369 * options.h (class General_options): Add -z lazy and -z now. Sort
13370 -z options into alphabetical order.
13371 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
13372
cd6739a1 133732009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
13374
13375 * layout.cc (Layout::make_output_section): Call
13376 Target::new_output_section.
13377 (Layout::attach_allocated_section_to_segment): Put large section
13378 sections in a separate load segment with the large segment flag
13379 set.
13380 (Layout::segment_precedes): Sort large data segments after other
13381 load segments.
13382 (align_file_offset): New static function.
13383 (Layout::set_segment_offsets): Use align_file_offset.
13384 * output.h (class Output_section): Add is_small_section_ and
13385 is_large_section_ fields.
13386 (Output_section::is_small_section): New function.
13387 (Output_section::set_is_small_section): New function.
13388 (Output_section::is_large_section): New function.
13389 (Output_section::set_is_large_section): New function.
13390 (Output_section::is_large_data_section): New function.
13391 (class Output_segment): Add is_large_data_segment_ field.
13392 (Output_segment::is_large_data_segment): New function.
13393 (Output_segment::set_is_large_data_segment): New function.
13394 * output.cc (Output_section::Output_section): Initialize new
13395 fields.
13396 (Output_segment::Output_segment): Likewise.
13397 (Output_segment::add_output_section): Add assertion that large
13398 data sections always go in large data segments. Force small data
13399 sections to the end of the list of data sections. Force small BSS
13400 sections to the start of the list of BSS sections. For large BSS
13401 sections to the end of the list of BSS sections.
13402 * symtab.h (class Symbol): Declare is_common_shndx.
13403 (Symbol::is_defined): Check Symbol::is_common_shndx.
13404 (Symbol::is_common): Likewise.
13405 (class Symbol_table): Define enum Commons_section_type. Update
13406 declarations. Add small_commons_ and large_commons_ fields.
13407 * symtab.cc (Symbol::is_common_shndx): New function.
13408 (Symbol_table::Symbol_table): Initialize new fields.
13409 (Symbol_table::add_from_object): Put small and large common
13410 symbols in the right list.
13411 (Symbol_table::sized_finalized_symbol): Check
13412 Symbol::is_common_shndx.
13413 (Symbol_table::sized_write_globals): Likewise.
13414 * common.cc (Symbol_table::do_allocate_commons): Allocate new
13415 common symbol lists. Don't call do_allocate_commons_list if the
13416 list is empty.
13417 (Symbol_table::do_allocate_commons_list): Remove is_tls
13418 parameter. Add comons_section_type parameter. Change all
13419 callers. Handle small and large common symbols.
13420 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
13421 Symbol::is_common_shndx.
13422 * resolve.cc (symbol_to_bits): Likewise.
13423 * target.h (Target::small_common_shndx): New function.
13424 (Target::small_common_section_flags): New function.
13425 (Target::large_common_shndx): New function.
13426 (Target::large_common_section_flags): New function.
13427 (Target::new_output_section): New function.
13428 (Target::Target_info): Add small_common_shndx, large_common_shndx,
13429 small_common_section_flags, and large_common_section_flags
13430 fields.
13431 (Target::do_new_output_section): New virtual function.
13432 * arm.cc (Target_arm::arm_info): Initialize new fields.
13433 * i386.cc (Target_i386::i386_info): Likewise.
13434 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
13435 Likewise.
13436 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
13437 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13438 (Target_x86_64::do_new_output_section): New function.
13439 * configure.ac: Define conditional MCMODEL_MEDIUM.
13440 * testsuite/Makefile.am (check_PROGRAMS): Add large.
13441 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
13442 (large_LDFLAGS): Define.
13443 * testsuite/large.c: New file.
13444 * testsuite/testfile.cc (Target_test::test_target_info):
13445 Initialize new fields.
13446 * configure, testsuite/Makefile.in: Rebuild.
13447
bb04269c
DK
134482009-06-05 Doug Kwan <dougkwan@google.com>
13449
13450 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 13451 * Makefile.in: Regenerate.
bb04269c
DK
13452 * i386.cc (class Target_i386): Define new virtual method to
13453 override do_is_local_label_name in parent.
13454 * object.cc (Sized_relobj::do_count_local_symbols): Discard
13455 local symbols if --discard-locals or -X is given.
13456 * options.h (class General_options): Declare new options
13457 '--discard-locals' and '-X' for discarding locals.
13458 * target.h (class Target): Define new methods is_local_label_name.
13459 Declare new virtual method do_is_local_label_name.
13460 * target.cc: New file.
13461 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
13462 (check_SCRIPTS): Add discard_locals_test.sh.
13463 (check_DATA): Add discard_local_tests.syms.
13464 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
13465 (discard_local_tests.syms, discard_locals_test.o): New make rules.
13466 * testsuite/Makefile.in: Regenerate.
13467 * testsuite/discard_locals_test.c: New file.
13468 * testsuite/discard_locals_test.sh: Same.
13469
805bb01c
DK
134702009-06-05 Doug Kwan <dougkwan@google.com>
13471
13472 * object.cc (Sized_relobj::Sized_relobj): Initialize
13473 discarded_eh_frame_shndx_ to -1U.
13474 (Sized_relobj::do_layout): Record index of a discard .eh_frame
13475 section.
13476 (Sized_relobj::do_count_local_symbols): Skip local symbols in
13477 a discarded .eh_frame section.
13478 (Sized_relobj::do_finalize_local_symbols): Ditto.
13479 * object.h (class Sized_relobj): Declare new member
13480 discarded_eh_frame_shndx_.
13481 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
13482 (local_labels_test.o, local_labels_test): New rules.
13483 * testsuite/Makefile.in: Regenerate.
13484
1dcd334d
DK
134852009-06-04 Doug Kwan <dougkwan@google.com>
13486
13487 * layout.cc (Layout::section_name_mapping): Add mapping for
13488 special ARM sections.
13489
96d49306
DK
134902009-06-03 Doug Kwan <dougkwan@google.com>
13491
13492 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
13493 (utils::has_overflow): Same.
13494
dff16297
ILT
134952009-06-03 Ian Lance Taylor <iant@google.com>
13496
13497 * layout.cc (Layout::section_name_mapping): New array, replacing
13498 Layout::linkonce_mapping.
13499 (Layout::section_name_mapping_count): New variable, replacing
13500 Layout::linkonce_mapping_count.
13501 (Layout::linkonce_output_name): Remove.
13502 (Layout::output_section_name): Rewrite.
13503 * layout.h (class Layout): Rename Linkonce_mapping to
13504 Section_name_mapping, linkonce_mapping to section_name_mapping,
13505 linkonce_mapping_count to section_name_mapping_count. Don't
13506 declare linkonce_output_name.
13507
c121c671
DK
135082009-06-03 Doug Kwan <dougkwan@google.com>
13509
13510 * gold/arm.cc (namespace utils): New.
13511 (Target_arm::reloc_is_non_pic): Define new method.
13512 (class Arm_relocate_functions): New.
13513 (Target_arm::Relocate::relocate): Handle relocation types used by
13514 Android.
13515
07800fab
ILT
135162009-06-03 Ian Lance Taylor <iant@google.com>
13517
13518 * arm.cc (Target_arm::scan::global): Use || instead of |.
13519
c121c671
DK
135202009-06-02 Doug Kwan <dougkwan@google.com>
13521
13522 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
13523 issued_non_pic_error_.
13524 (class Target_arm::Scan): Declare new method check_non_pic.
13525 Define new method symbol_needs_plt_entry.
13526 Declare new data member issued_non_pic_error_.
13527 (class Target_arm::Relocate): Declare new method
13528 should_apply_static_reloc.
13529 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
13530 (Target_arm::Scan::check_non_pic): Define new method.
13531 (Target_arm::Scan::local): Handle a small subset of reloc types used
13532 by Android.
13533 (Target_arm::Scan::local): Same.
13534 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
13535
b19b0c6d
ILT
135362009-05-31 Mikolaj Zalewski <mikolajz@google.com>
13537
13538 * incremental.cc (Incremental_inputs::report_command_line): Filter
13539 out --incremental-* options.
13540
94cdfcff
DK
135412009-05-29 Doug Kwan <dougkwan@google.com>
13542
13543 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
13544 template class.
13545 (class Target_arm): Update comment.
13546 (Target_arm::Target_arm): Initialize new data members GOT_,
13547 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
13548 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
13549 and Target_arm::rel_dyn_section.
13550 Declare new_enum Target_arm::Got_type.
13551 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
13552 and DYNBSS_.
13553 Update commments for member do_dynsym_value.
13554 (Target_arm::got_size, Target_arm::plt_section,
13555 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
13556 new methods inside class defintion.
13557 (Target_arm::got_section): Define new method.
13558 (Target_arm::rel_dyn_section): Same.
13559 (Output_data_plt_arm): New template class.
13560 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
13561 (Output_data_plt_arm:do_adjust_output_section): Define new method.
13562 (Output_data_plt_arm::add_entry): Same.
13563 (Output_data_plt_arm::first_plt_entry): Define new
13564 static data member for PLT instruction template.
13565 (Output_data_plt_arm::plt_entry): Same.
13566 (Output_data_plt_arm::do_write): Define new method.
13567 (Target_arm::make_plt_entry): Same.
13568 (Target_arm::do_finalize_sections): Same.
13569 (Target_arm::do_dynsym_value): Same.
13570
4a657b0d
DK
135712009-05-28 Doug Kwan <dougkwan@google.com>
13572
13573 * Makefile.am (TARGETSOURCES): Add arm.cc.
13574 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
13575 * Makefile.in: Regenerate.
13576 * arm.cc: New file.
13577 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
13578
e7ae8c36
DK
135792009-05-26 Doug Kwan <dougkwan@google.com>
13580
13581 * options.cc (General_options::parse_exclude_libs). Fix a comment.
13582 (General_options::check_excluded_libs): Strip off directories in
13583 archive name before matching like GNU ld does.
13584 * testsuite/Makefile.am (MOSTLYCLEANFILES,
13585 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
13586 (exclude_libs_test_LDFLAGS): Add linker option
13587 -Wl,--exclude-libs,libexclude_libs_test_3
13588 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
13589 an explicit archive without using -l.
13590 (alt/libexclude_libs_test_3.a): New make rule.
13591 * testsuite/Makefile.in: Regenerate.
13592 * testsuite/exclude_libs_test.c : Declare lib3_default().
13593 (main): Call it.
13594 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
13595 * exclude_libs_test_3.c: New file.
13596
f12e7348
NC
135972009-05-26 Nick Clifton <nickc@redhat.com>
13598
13599 * po/id.po: New Indonesian translation.
13600 * po/gold.pot: Updated template file.
13601
4daadc0d
ST
136022009-05-22 Sriraman Tallam <tmsriram@google.com>
13603
e1df38aa 13604 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
13605 gc_comdat_test files. Add -Wl,--gc-sections to build
13606 gc_comdat_test.
13607 * testsuite/Makefile.in: Regenerate.
13608 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
13609
531813ad
ST
136102009-05-21 Sriraman Tallam <tmsriram@google.com>
13611
13612 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
13613 kept comdat section was garbage collected.
13614 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
13615 * testsuite/Makefile.in: Regenerate.
13616 * testsuite/gc_comdat_test.sh: New file.
13617 * testsuite/gc_comdat_test_1.cc: New file.
13618 * testsuite/gc_comdat_test_2.cc: New file.
13619
65514900
CC
136202009-05-19 Doug Kwan <dougkwan@google.com>
13621
13622 * archive.cc (Archive::Archive): Move constructor from archive.h
13623 to here. Initialize no_export_.
13624 (Archive::get_elf_object_for_member): Set no_export flag of object.
13625 * archive.h (Archive::Archive): Move constructor body to
13626 archive.cc.
13627 (Archive::no_export): New method.
13628 (Archive::no_export_): New field.
13629 * object.h (Object::Object): Initialize no_export_ to false.
13630 (Object::no_export, Object::set_no_export): New methods.
13631 (Object::no_export_): New field.
13632 * options.cc (General_options::parse_exclude_libs): New method.
13633 (General_options::check_excluded_libs) Same.
13634 * options.h (exclude_libs): New option.
13635 (General_options::check_excluded_libs): New method declaration.
13636 (General_options::excluded_libs_): New field.
13637 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
13638 default or protected visibility if an object has no-export flag set.
13639 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
13640 (check_SCRIPTS): Add exclude_libs_test.sh.
13641 (check_DATA): Add exclude_libs_test.syms.
13642 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
13643 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
13644 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
13645 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
13646 (exclude_libs_test.syms, libexclude_libs_test_1.a,
13647 libexclude_libs_test_2.a): New rules.
13648 * testsuite/Makefile.in: Regenerate.
13649 * testsuite/exclude_libs_test.c: New file.
13650 * testsuite/exclude_libs_test.sh: Ditto.
13651 * testsuite/exclude_libs_test_1.c: Ditto.
13652 * testsuite/exclude_libs_test_2.c: Ditto.
13653
1b77ea50
ILT
136542009-05-15 Ian Lance Taylor <iant@google.com>
13655
13656 * configure.ac: Check for declarations for cases where libiberty.h
13657 checks HAVE_DECL_xxx.
13658 * configure, config.in: Rebuild.
13659
072fe7ce
ILT
136602009-05-15 Mikolaj Zalewski <mikolajz@google.com>
13661
13662 * gold.h (Incremental_argument_list): Remove (invalid) forward
13663 declaration.
13664 * incremental.cc (Incremental_inputs::report_achive): New method.
13665 (Incremental_inputs::report_object): New method.
13666 (Incremental_inputs::report_script): New method.
13667 (Incremental_inputs::finalize_inputs): New method.
13668 (Incremental_inputs::finalize): Call finalize_inputs().
13669 (Incremental_inputs::sized_create_incremental_inputs_section_data):
13670 Create inputs entries.
13671 * incremental.h (Incremental_input_type): New enum.
13672 (Incremental_inputs::Incremental_input): Initialize new fields.
13673 (Incremental_inputs::report_inputs): New method.
13674 (Incremental_inputs::report_achive): New method.
13675 (Incremental_inputs::report_object): New method.
13676 (Incremental_inputs::report_script): New method.
13677 (Incremental_inputs::finalize_inputs): New method.
13678 (Incremental_inputs::Input_info): New struct.
13679 (Incremental_inputs::Input_info_map): New typedef.
13680 (Incremental_inputs::lock_): New field.
13681 (Incremental_inputs::Inputs_): New field.
13682 (Incremental_inputs::Inputs_map): New field.
13683 * main.cc (main): Call Incremental_input::report_inputs.
13684 * options.h (Input_argument_list): Typedef moved from
13685 Input_arguments.
13686 (Input_file_group::Files): Remove, use ::Input_argument_list.
13687 (Input_file_group::Input_argument_list): Remove, use
13688 ::Input_argument_list.
13689 * plugin.cc (Plugin_manager::add_input_file): Add error in
13690 incremental build.
13691 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
13692 functions.
13693 * script.cc (read_input_script): Call
13694 Incremental_input::report_script.
13695 * script.h (Script_info): New class.
13696
b0481b0b
ILT
136972009-04-27 Ian Lance Taylor <iant@google.com>
13698
13699 * x86_64.cc (do_adjust_output_section): Set entsize to
13700 plt_entry_size.
13701
b22a5a41 137022009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
13703
13704 * output.cc (Output_file::close): After short writes, continue
13705 writing from the correct offset in the buffer being written.
13706
40fde488
CD
137072009-04-23 Chris Demetriou <cgd@google.com>
13708
13709 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
13710 * configure: Regenerate.
13711 * config.in: Regenerate.
13712 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
13713 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
13714
3ce2c28e
ILT
137152009-04-21 Mikolaj Zalewski <mikolajz@google.com>
13716
13717 * incremental.cc (Incremental_inputs_header_data): Renamed from
13718 Incremental_input_header_data.
13719 (Incremental_inputs_header_data::data_size): New field.
13720 (Incremental_inputs_header_data::put_input_file_count): Renamed
13721 from input_file_count.
13722 (Incremental_inputs_header_data::put_command_line_offset): Renamed
13723 from command_line_offset.
13724 (Incremental_inputs_header_data::put_reserved): Renamed from
13725 put_reserved.
13726 (Incremental_inputs_entry_data): Renamed from
13727 Incremental_input_entry_data.
13728 (Incremental_inputs_entry_data::data_size): New field.
13729 (Incremental_inputs::report_command_line): New method.
13730 (Incremental_inputs::finalize): New method.
13731 (Incremental_inputs::create_incremental_inputs_data): New method.
13732 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
13733 * incremental.h: New file.
13734 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 13735 (Layout::finalize): Create incremental inputs section in
3ce2c28e 13736 incremental builds.
703d02da 13737 (Layout::create_incremental_info_sections): New method.
3ce2c28e 13738 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
13739 (Layout::create_incremental_info_sections): New method.
13740 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
13741 * main.cc (main): Notify Incremental_input of the command line.
13742
e55bde5e
ILT
137432009-04-01 Ian Lance Taylor <iant@google.com>
13744 Mikolaj Zalewski <mikolajz@google.com>
13745
13746 * gold.h (reserve_unordered_map): Define, three versions, one for
13747 each version of Unordered_map.
13748 * layout.cc (Layout::Layout): Remove options parameter. Add
13749 number_of_input_files parameter. Don't initialize options_.
13750 Initialize number_of_input_files_ and resized_signatures_. Move
13751 sections_are_attached_.
13752 (Layout::layout_group): Reserve space for group_signatures_.
13753 (Layout::find_or_add_kept_section): Change name parameter to be a
13754 reference. Resize signatures_ map when it gets large enough.
13755 (Layout::layout_eh_frame): Use parameters->options() instead of
13756 this->options_.
13757 (Layout::make_output_section): Likewise.
13758 (Layout::attach_allocated_section_to_segment): Likewise.
13759 (Layout::finalize, Layout::create_executable_stack): Likewise.
13760 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
13761 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
13762 * layout.h (class Layout): Update declarations. Remove options_
13763 field. Add number_of_input_files_ and resized_signatures_
13764 fields. Move sections_are_attached_ field.
13765 * main.cc (main): Pass number of input files to Layout
13766 constructor. Don't pass options.
13767
154b857c
ILT
137682009-03-30 Ian Lance Taylor <iant@google.com>
13769
13770 * ffsll.c (ffsll): Correct implementation.
13771
2f35ab9b
ILT
137722009-03-27 Ian Lance Taylor <iant@google.com>
13773
fd03461a
ILT
13774 * ffsll.c: New file.
13775 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
13776 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
13777 * ftruncate.c (ftruncate): Declare before definition.
13778 * mremap.c (mremap): Likewise.
13779 * pread.c (pread): Likewise.
13780 * configure, Makefile.in, config.in: Rebuild.
13781
2f35ab9b
ILT
13782 * mremap.c: New file.
13783 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
13784 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
13785 (mremap): Declare if HAVE_MREMAP is not defined.
13786 * configure, Makefile.in, config.in: Rebuild.
13787
33aea2fd
CC
137882009-03-27 Cary Coutant <ccoutant@google.com>
13789
13790 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
13791 position independent.
13792 * sparc.cc (Target_sparc::check_non_pic): Likewise.
13793 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
13794
6d479619
CC
137952009-03-24 Cary Coutant <ccoutant@google.com>
13796
13797 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
13798 an executable.
13799 (needs_dynamic_reloc): Likewise.
13800
afc06bb8
ILT
138012009-03-24 Ian Lance Taylor <iant@google.com>
13802
13803 * yyscript.y (file_cmd): Recognize EXTERN.
13804 (extern_name_list, extern_name_list_body): New nonterminals.
13805 * script.cc (script_add_extern): Define.
13806 * script-c.h (script_add_extern): Declare.
13807
f6060a4d
ILT
138082009-03-24 Rafael Avila de Espindola <espindola@google.com>
13809
13810 * object.cc (is_elf_object): Define.
13811 * object.h (is_elf_object): Declare.
13812 * archive.cc (Archive::get_elf_object_for_member): Call
13813 is_elf_object.
33aea2fd 13814 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 13815
26736d8e
ILT
138162009-03-24 Elliott Hughes <enh@google.com>
13817
13818 * output.cc (Output_file::map_anonymous): Define.
13819 (Output_file::map): Use map_anonymous. If the regular mmap fails,
13820 try an anonymous one. Report the size if the mmap fails.
13821 * output.h (class Output_file): Declare map_anonymous.
13822
22fd9730
ILT
138232009-03-24 Ian Lance Taylor <iant@google.com>
13824
13825 * target-select.cc (instantiate_target): Don't acquire the lock if
13826 the instantiated_target_ field has already been set.
13827
cb010894
ILT
138282009-03-23 Ian Lance Taylor <iant@google.com>
13829
7f055c20
ILT
13830 * gold-threads.h (class Initialize_lock): Define.
13831 * gold-threads.cc (class Initialize_lock_once): Define.
13832 (initialize_lock_control): New static variable.
13833 (initialize_lock_pointer): New static variable.
13834 (initialize_lock_once): New static function.
13835 (Initialize_lock::Initialize_lock): Define.
13836 (Initialize_lock::initialize): Define.
13837 * target-select.h: Include "gold-threads.h".
13838 (class Target_selector): Add lock_ and initialize_lock_ fields.
13839 Don't define instantiate_target, just declare it.
13840 * target-select.cc (Target_selector::Target_selector): Initialize
13841 new fields.
13842 (Target_selector::instantiate_target): Define.
13843 * descriptors.h: Include "gold-threads.h".
13844 (class Descriptors): Add initialize_lock_ field.
13845 * descriptors.cc (Descriptors::Descriptors): Initialize new
13846 field.
13847 (Descriptors::open): Use initialize_lock_ field
13848 * errors.h (class Errors): Add initialize_lock_ field.
13849 * errors.cc (Errors::Errors): Initialize new field.
13850 (Errors::initialize_lock): Use initialize_lock_ field.
13851 * powerpc.cc (class Target_selector_powerpc): Remove
13852 instantiated_target_ field. In do_recognize call
13853 instantiate_target rather than do_instantiate_target. In
13854 do_instantiate_target just allocate a new target.
13855 * sparc.cc (class Target_selector_sparc): Likewise.
13856
36959681
ILT
13857 * freebsd.h: New file.
13858 * i386.cc: Include "freebsd.h".
13859 (Target_i386): Derive from Target_freebsd rather than
13860 Sized_target.
13861 (Target_selector_i386): Derive from Target_selector_freebsd rather
13862 than Target_selector.
13863 * x86_64.cc: Include "freebsd.h".
13864 (Target_x86_64): Derive from Target_freebsd rather than
13865 Sized_target.
13866 (Target_selector_x86_64): Derive from Target_selector_freebsd
13867 rather than Target_selector.
13868 * target.h (class Target): Add adjust_elf_header and
13869 do_adjust_elf_header.
13870 * output.cc (Output_file_header:: do_sized_write): Call target
13871 adjust_elf_header routine.
13872 * configure.tgt: Set targ_osabi.
13873 * configure.ac: Define GOLD_DEFAULT_OSABI.
13874 * parameters.cc (Parameters::default_target): Pass
13875 GOLD_DEFAULT_OSABI to select_target.
13876 * target-select.h (class Target_selector): Make instantiate_target
13877 protected rather than private.
13878 * Makefile.am (HFILES): Add freebsd.h.
13879 * configure, Makefile.in, config.in: Rebuild.
13880
cb010894
ILT
13881 * merge.cc (do_add_input_section): Correct pend value. Change
13882 message about last entry not being null terminated from error to
13883 warning.
13884
0e879927
ILT
138852009-03-20 Mikolaj Zalewski <mikolajz@google.com>
13886
13887 * incremental.cc: New file.
13888 * Makefile.am (CCFILES): Add incremental.cc.
13889 * Makefile.in: Rebuild.
13890
41105937
PP
138912009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
13892
13893 * layout.cc (Layout::output_section_name): Preserve names
13894 of '.note.' sections.
e1df38aa 13895
60439920
ILT
138962009-03-19 Ian Lance Taylor <iant@google.com>
13897
13898 * descriptors.cc (Descriptors::open): Check that the options are
13899 valid before using them.
13900
0d371ad3
ILT
139012009-03-18 Ian Lance Taylor <iant@google.com>
13902
13903 * script-sections.h: Include <list>.
13904 (class Script_sections): Change Sections_elements from std::vector
13905 to std::list. Typedef public Elements_iterator. Add
13906 orphan_section_placement_, data_segment_align_start_, and
13907 saw_data_segment_align_ fields. Remove data_segment_align_index_
13908 field.
13909 * script-sections.cc (class Orphan_section_placement): New class.
13910 (class Sections_element): Add virtual functions is_relro and
13911 orphan_section_init. Remove virtual function place_orphan_here.
13912 (class Output_section_definition): Add is_relro and
13913 orphan_section_init. Remove place_orphan_here.
13914 (class Orphan_output_section): Likewise.
13915 (Script_sections::Script_sections): Update for field changes.
13916 (Script_sections::data_segment_align): Set saw_data_segment_align_
13917 and data_segment_align_start_, not data_segment_align_index.
13918 (Script_sections::data_segment_relro_end): Check
13919 saw_data_segment_align_. Use data_segment_align_start_ rather
13920 than data_segment_align_index_.
13921 (Script_sections::place_orphan): Rewrite to use
13922 Orphan_section_placement.
13923
9201d894
ILT
139242009-03-17 Ian Lance Taylor <iant@google.com>
13925
9c5b8369
ILT
13926 * archive.cc (Archive::add_symbols): Check for a version attached
13927 to the symbol name in the archive map.
13928 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
13929 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
13930 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
13931 (ver_test_11.a): New target.
13932 * testsuite/Makefile.in: Rebuild.
13933
9201d894
ILT
13934 * configure.ac: Check for chsize and posix_fallocate. Replace
13935 ftruncate.
13936 * ftruncate.c: New file, from gnulib.
13937 * output.cc (posix_fallocate): Define dummy version if not
13938 HAVE_POSIX_FALLOCATE.
13939 (Output_file::map): Call posix_fallocate rather than lseek and
13940 write.
13941 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
13942 * configure, Makefile.in, config.in: Rebuild.
13943
ef4ab7a8 139442009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 13945
ef4ab7a8
PP
13946 * layout.h (Layout::create_note): Add section_name parameter.
13947 * layout.cc (Layout::create_note): Likewise.
13948 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 13949
8c500701
ILT
139502009-03-17 Ian Lance Taylor <iant@google.com>
13951
e85b18e1
ILT
13952 * descriptors.cc: Include "options.h".
13953 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
13954 (Descriptors::open): Always use O_CLOEXEC when opening a new
13955 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
13956 then set FD_CLOEXEC.
13957
9efe6174
ILT
13958 * sparc.cc (class Target_sparc): Add has_got_section.
13959 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
13960 make sure we have a GOT section.
13961
13962 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
13963 (Target_sparc::Scan::local): Likewise.
13964 (Target_sparc::Scan::global): Likewise.
13965 (Target_sparc::Relocate::relocate): Likewise.
13966 (Target_sparc::Relocate::relocate_tls): Likewise.
13967
8c500701
ILT
13968 * symtab.cc (Symbol_table::define_default_version): New function,
13969 broken out of add_from_object.
13970 (Symbol_table::add_from_object): Call define_default_version.
13971 (Symbol_table::define_special_symbol): Add resolve_oldsym
13972 parameter. Change all callers. If the version for a symbol comes
13973 from a version script, resolve it with the symbol with the same
13974 name with no version. Also add the symbol without a version if
13975 appropriate.
13976 (do_define_in_output_data): If resolving with oldsym, don't delete
13977 sym.
13978 (do_define_in_output_segment): Likewise.
13979 (do_define_as_constant): Likewise.
13980 * symtab.h (class Symbol_table): Update declarations.
13981
f1ed28fb
ILT
139822009-03-13 Ian Lance Taylor <iant@google.com>
13983
15f8229b
ILT
13984 * readsyms.cc (Read_symbols::incompatible_warning): New function.
13985 (Read_symbols::requeue): New function.
13986 (Read_symbols::do_read_symbols): If make_elf_object fails because
13987 the target type is not configured, and the file was searched for,
13988 issue a warning and retry with the next directory.
13989 (Add_symbols::run): If the file has an incompatible format, and
13990 it was searched for, requeue the Read_symbols task. On error,
13991 release the object.
13992 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
13993 dirindex parameter to constructor. Change all callers. Declare
13994 incompatible_warning and requeue.
13995 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
13996 input_argument_ and input_group_ fields. Add them to
13997 constructor. Change all callers.
13998 (class Read_script): Add dirindex_ field. Add it to constructor.
13999 Change all callers.
14000 * archive.cc (Archive::setup): Remove input_objects parameter.
14001 Change all callers.
14002 (Archive::get_file_and_offset): Likewise.
14003 (Archive::read_all_symbols): Likewise.
14004 (Archive::read_symbols): Likewise.
14005 (Archive::get_elf_object_for_member): Remove input_objects
14006 parameter. Add punconfigured parameter. Change all callers.
14007 (Archive::add_symbols): Change return type to bool. Check return
14008 value of include_member.
14009 (Archive::include_all_members): Likewise.
14010 (Archive::include_member): Change return type to bool. Return
14011 false if first included object has incompatible target. Set
14012 included_member_ field.
14013 (Add_archive_symbols::run): If add_symbols returns false, requeue
14014 Read_symbols task.
14015 * archive.h (class Archive): Add included_member_ field.
14016 Initialize it in constructor. Add input_file and searched_for
14017 methods. Update declarations.
14018 (class Add_archive_symbols): Add dirpath_, dirindex_, and
14019 input_argument_ fields. Add them to constructor. Change all
14020 callers.
14021 * script.cc: Include "target-select.h".
14022 (class Parser_closure): Add skip_on_incompatible_target_ and
14023 found_incompatible_target_ fields. Add
14024 skip_on_incompatible_target parameter to constructor. Change all
14025 callers. Add methods skip_on_incompatible_target,
14026 clear_skip_on_incompatible_target, found_incompatible_target, and
14027 set_found_incompatible_target.
14028 (read_input_script): Add dirindex parameter. Change all callers.
14029 If parser finds an incompatible target, requeue Read_symbols
14030 task.
14031 (script_set_symbol): Clear skip_on_incompatible_target in
14032 closure.
14033 (script_add_assertion, script_parse_option): Likewise.
14034 (script_start_sections, script_add_phdr): Likewise.
14035 (script_check_output_format): New function.
14036 * script.h (read_input_script): Update declaration.
14037 * script-c.h (script_check_output_format): Declare.
14038 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
14039 (ignore_cmd): Remove OUTPUT_FORMAT.
14040 * fileread.cc (Input_file::Input_file): Add explicit this.
14041 (Input_file::will_search_for): New function.
14042 (Input_file::open): Add pindex parameter. Change all callers.
14043 * fileread.h (class Input_file): Add input_file_argument method.
14044 Declare will_search_for. Update declarations.
14045 * object.cc (make_elf_object): Add punconfigured parameter.
14046 Change all callers.
14047 * object.h (class Object): Make input_file public. Add
14048 searched_for method.
14049 (make_elf_object): Update declaration.
14050 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
14051 restart search.
14052 * dirsearch.h (class Dirsearch): Update declaration.
14053 * options.h (class General_options): Add --warn-search-mismatch.
14054 * parameters.cc (Parameters::is_compatible_target): New function.
14055 * parameters.h (class Parameters): Declare is_compatible_target.
14056 * workqueue.cc (Workqueue::add_blocker): New function.
14057 * workqueue.h (class Workqueue): Declare add_blocker.
14058
f1ed28fb
ILT
14059 * fileread.cc (Input_file::open): Remove options parameter.
14060 Change all callers.
14061 (Input_file::open_binary): Likewise.
14062 * script.cc (read_input_script): Likewise.
14063 * readsyms.h (class Read_symbols): Remove options_ field. Remove
14064 options parameter from constructor. Change all callers.
14065 (class Read_script): Likewise.
14066 * fileread.h (class Input_file): Update declarations.
14067 * script.h (read_input_script): Update declaration.
14068
34dd024a
NC
140692009-03-10 Nick Clifton <nickc@redhat.com>
14070
14071 * po/es.po: New Spanish translation.
14072
6d71b17c
CC
140732009-03-06 Cary Coutant <ccoutant@google.com>
14074
14075 * options.cc (parse_short_option): Keep dash_z from registering itself.
14076
031cdbed
ILT
140772009-03-03 Ian Lance Taylor <iant@google.com>
14078
14079 PR 9918
14080 * target-reloc.h (relocate_section): Pass output_section to
14081 relocate.
14082 * i386.cc (Target_i386::should_apply_static_reloc): Add
14083 output_section parameter. Change all callers.
14084 (Target_i386::Relocate::relocate): Add output_section parameter.
14085 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14086 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
14087 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
14088 * testsuite/two_file_shared.sh: New script.
14089 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
14090 (check_DATA): Add two_file_shared.dbg.
14091 (two_file_shared.dbg): New target.
14092 * testsuite/Makefile.in: Rebuild.
14093
15d5fa16
ILT
140942009-03-01 Ian Lance Taylor <iant@google.com>
14095
14096 * configure.ac: Check for byteswap.h.
14097 * configure: Rebuild.
14098 * config.in: Rebuild.
14099
8a4c0b0d
ILT
141002009-03-01 Mikolaj Zalewski <mikolajz@google.com>
14101
14102 * layout.cc (Layout::find_or_add_kept_section): New function.
14103 (Layout::add_comdat): Removed.
14104 * layout.h (struct Kept_section): Move out of class Layout.
14105 Remove trailing underscores from field names. Add group_sections
14106 field. Rename group_ field to is_group. Change all uses.
14107 (class Layout): Declare find_or_add_kept_section, not add_comdat.
14108 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
14109 comdat_groups_ field.
14110 (Sized_relobj::include_section_group): Use
14111 find_or_add_kept_section and Kept_section::group_sections.
14112 (Sized_relobj::include_linkonce_section): Likewise.
14113 * object.cc (class Sized_relobj): Don't define Comdat_group or
14114 Comdat_group_table. Remove find_comdat_group and
14115 add_comdat_group. Remove comdat_groups_ field.
14116 * plugin.cc (include_comdat_group): Use
14117 Layout::find_or_add_kept_section.
14118
b4ecf66b
ILT
141192009-02-28 Ian Lance Taylor <iant@google.com>
14120
14359ca0
ILT
14121 * README: --gc-sections and map files are now supported. Document
14122 some build requirements.
14123
b4ecf66b
ILT
14124 PR 6992
14125 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
14126 relocatable link set the value of the section symbol to zero.
14127 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
14128 relocatable link don't include the section address in the local
14129 symbol value.
14130
0602e05a
ILT
141312009-02-27 Ian Lance Taylor <iant@google.com>
14132
fd9d194f
ILT
14133 PR 6811
14134 * options.h (class Search_directory): Add is_system_directory.
14135 (class General_options): Declare is_in_system_directory.
14136 * options.cc (get_relative_sysroot): Make static.
14137 (get_default_sysroot): Make static.
14138 (General_optoins::is_in_system_directory): New function.
14139 * fileread.cc (Input_file::is_in_system_directory): New function.
14140 * fileread.h (class Input_file): Declare is_in_system_directory.
14141 * object.h (class Object): Add is_in_system_directory.
14142 (class Input_objects): Remove system_library_directory_ field.
14143 * object.cc (Input_objects::add_object): Don't set
14144 system_library_directory_.
14145 (input_objects::found_in_system_library_directory): Remove.
14146 * symtab.cc (Symbol_table::write_globals): Remove input_objects
14147 parameter. Change all callers.
14148 (Symbol_table::sized_write_globals): Likewise.
14149 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
14150 Call Object::is_in_system_directory.
14151 * symtab.h (class Symbol_table): Update declarations.
14152
61edd21f
ILT
14153 PR 5990
14154 * descriptors.h (Open_descriptor): Add is_on_stack field.
14155 * descriptors.cc (Descriptors::open): If the descriptor is on the
14156 top of the stack, remove it. Initialize is_on_stack field.
14157 (Descriptors::release): Only add pod to stack if it is not on the
14158 stack already.
14159 (Descriptors::close_some_descriptor): Clear stack_next and
14160 is_on_stack fields.
14161
e29e076a
ILT
14162 PR 7091
14163 * output.cc (Output_section::find_starting_output_address): Rename
14164 from starting_output_address; add PADDR parameter; change return
14165 type.
14166 * output.h (class Output_section): Declare
14167 find_starting_output_address instead of starting_output_address.
14168 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
14169 section symbol for which we can't find a merge section.
14170
0602e05a
ILT
14171 PR 9836
14172 * symtab.cc (Symbol_table::add_from_object): If the visibility is
14173 hidden or internal, force the symbol to be local.
14174 * resolve.cc (Symbol::override_visibility): Define.
14175 (Symbol::override_base): Use override_visibility.
14176 (Symbol_table::resolve): Likewise.
14177 (Symbol::override_base_with_special): Likewise.
14178 (Symbol_table::override_with_special): If the visibility is hidden
14179 or internal, force the symbol to be local.
14180 * symtab.h (class Symbol): Add set_visibility and
14181 override_visibility.
14182 * testsuite/ver_test_1.sh: New file.
14183 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
14184 (check_DATA): Add ver_test_1.syms.
14185 (ver_test_1.syms): New target.
14186 * testsuite/Makefile.in: Rebuild.
14187
401a9a73
CC
141882009-02-25 Cary Coutant <ccoutant@google.com>
14189
14190 * layout.cc (Layout::choose_output_section): Don't rename sections
14191 when using a linker script that has a SECTIONS clause.
14192 * Makefile.in: Regenerate.
14193
14194 * testsuite/Makefile.am (script_test_5.sh): New test case.
14195 * testsuite/Makefile.in: Regenerate.
14196 * testsuite/script_test_5.cc: New file.
14197 * testsuite/script_test_5.sh: New file.
14198 * testsuite/script_test_5.t: New file.
14199
f488e4b0
CC
142002009-02-13 Rafael Avila de Espindola <espindola@google.com>
14201
14202 * archive.cc (Archive::include_member): Update calls to add_symbols.
14203 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
14204 the Layout argument.
14205 * dynobj.h (do_add_symbols): Add the Layout argument.
14206 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
14207 Layout argument.
14208 * object.h (Object::add_symbols): Add the Layout argument.
14209 (Object::do_add_symbols): Add the Layout argument.
14210 (Sized_relobj::do_add_symbols): Add the Layout argument.
14211 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
14212 Unify the two versions.
14213 (Add_plugin_symbols): Remove.
14214 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
14215 (Sized_pluginobj::do_add_symbols): Unify the two versions.
14216 (Add_plugin_symbols): Remove.
14217 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
14218 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
14219 (Add_symbols::run): Make it work with Pulginobj.
14220
89dd1680
ILT
142212009-02-06 Ian Lance Taylor <iant@google.com>
14222
14223 * object.cc (Sized_relobj::do_layout): Make info message start
14224 with lower case letter.
14225
266d0a74
ILT
142262009-02-06 Mikolaj Zalewski <mikolajz@google.com>
14227
602b464e
ILT
14228 * binary.cc: Fix file comment.
14229
266d0a74
ILT
14230 * options.h (enum Incremental_disposition): Define.
14231 (class General_options): Add new options: --incremental,
14232 --incremental_changed, --incremental_unchanged,
14233 --incremental_unknown. Add incremental_disposition_ and
14234 implicit_incremental_ fields.
14235 (General_options::incremental_disposition): New function.
14236 (class Position_dependent_options): Add incremental_disposition
14237 option.
14238 (Position_dependent_options::copy_from_options): Set incremental
14239 dispositions.
14240 * options.cc (General_options::parse_incremental_changed): New
14241 function.
2e702c99
RM
14242 (General_options::parse_incremental_unchanged): New function.
14243 (General_options::parse_incremental_unknown): New function.
14244 (General_options::General_options): Initialize new fields
266d0a74 14245 incremental_disposition_ and implicit_incremental_.
2e702c99 14246 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
14247 without --incremental.
14248
f073bbf7
CD
142492009-02-06 Chris Demetriou <cgd@google.com>
14250
14251 * gold.h (gold_undefined_symbol): Change to take only a Symbol
14252 pointer and to report location as the file name associated with
14253 the symbol.
14254 (gold_undefined_symbol_at_location): New function to replace the
14255 old gold_undefined_symbol functionality.
14256 * target-reloc.h (relocate_section): Update to use
14257 gold_undefined_symbol_at_location.
14258 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14259 Call gold_undefined_symbol function rather than gold_error.
14260 * errors.h (Errors::undefined_symbol): Take location as a
14261 string, rather than calculating it from a relocation.
14262 * errors.cc (Errors::fatal): Print "fatal error:" before the
14263 formatted message.
14264 (Errors::error, Errors::error_at_location): Print "error: "
14265 before the formatted message.
14266 (Errors::undefined_symbol): Take location as a string, rather
14267 than calculating it from a relocation.
14268 (gold_undefined_symbol_at_location): New function akin to
14269 old gold_undefined_symbol, calculates location from relocation.
14270 (gold_undefined_symbol): Change to take only a Symbol pointer
14271 and to report location as the file name associated with the symbol.
14272 * testsuite/debug_msg.sh: Update for changed error messages.
14273 * testsuite/undef_symbol.sh: Likewise.
14274
8e94a90c
ILT
142752009-02-04 Duncan Sands <baldrick@free.fr>
14276
14277 PR 9812
14278 * reduced_debug_output.h
14279 (Output_reduced_debug_abbrev_section::failed): Use format for
14280 gold_warning.
14281 (Output_reduced_debug_info_section::faild): Likewise.
14282
88a0e15b
ILT
142832009-01-31 Mikolaj Zalewski <mikolajz@google.com>
14284
14285 * script.cc (Lazy_demangler): New class.
2e702c99 14286 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
14287 symbol only once.
14288
5efc7cd2
CC
142892009-01-29 Cary Coutant <ccoutant@google.com>
14290
14291 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
14292 to __tls_get_addr.
14293 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14294
e0ebcf42
ILT
142952009-01-28 Ian Lance Taylor <iant@google.com>
14296
5efc7cd2 14297 * version.cc (version_string): Bump to 1.9.
75fe7426 14298
e0ebcf42
ILT
14299 * gold.h: Include <cstring> and <stdint.h>.
14300 * version.cc: Include <cstdio>.
14301 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
14302 warning.
14303 * reduced_debug_output.cc (insert_into_vector): Rename from
14304 Insert_into_vector; change all callers. Use Swap_unaligned to
14305 avoid aliasing issue; remove union since it is unnecessary.
14306
8e2813be 143072009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
14308
14309 * Makefile.am (CCFILES): Add gc.cc.
14310 (HFILES): Add gc.h.
14311 * Makefile.in: Regenerate.
14312 * gold.cc (Gc_runner): New class.
14313 (queue_initial_tasks): Call garbage collection related tasks
14314 when corresponding options are invoked.
14315 (queue_middle_gc_tasks): New function.
14316 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
14317 processed early before laying out sections during garbage collection.
14318 * gold.h (queue_middle_gc_tasks): New function.
14319 (is_prefix_of): Move from "layout.cc".
14320 * i386.cc (Target_i386::gc_process_relocs): New function.
14321 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
14322 * main.cc (main): Create object of class "Garbage_collection".
14323 * object.cc (Relobj::copy_symbols_data): New function.
14324 (Relobj::is_section_name_included): New function.
e1df38aa
NC
14325 (Sized_relobj::do_layout): Allow this function to be called twice
14326 during garbage collection and defer layout of section during the
6d03d481
ST
14327 first call.
14328 * object.h (Relobj::get_symbols_data): New function.
14329 (Relobj::is_section_name_included): New function.
14330 (Relobj::copy_symbols_data): New function.
14331 (Relobj::set_symbols_data): New function.
14332 (Relobj::get_relocs_data): New function.
14333 (Relobj::set_relocs_data): New function.
14334 (Relobj::is_output_section_offset_invalid): New pure virtual function.
14335 (Relobj::gc_process_relocs): New function.
14336 (Relobj::do_gc_process_relocs): New pure virtual function.
14337 (Relobj::sd_): New data member.
14338 (Sized_relobj::is_output_section_offset_invalid): New function.
14339 (Sized_relobj::do_gc_process_relocs): New function.
14340 * options.h (General_options::gc_sections): Modify to not be a no-op.
14341 (General_options::print_gc_sections): New option.
14342 * plugin.cc (Plugin_finish::run): Remove function call to
14343 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
14344 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
14345 * reloc.cc (Read_relocs::run): Add task to process relocs and
14346 determine unreferenced sections when doing garbage collection.
14347 (Gc_process_relocs): New class.
14348 (Sized_relobj::do_gc_process_relocs): New function.
14349 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
14350 sections that are garbage collected.
14351 * reloc.h (Gc_process_relocs): New class.
14352 * sparc.cc (Target_sparc::gc_process_relocs): New function.
14353 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
14354 symbols whose corresponding sections are garbage collected.
14355 (Symbol_table::Symbol_table): Add new parameter for the garbage
14356 collection object.
14357 (Symbol_table::gc_mark_undef_symbols): New function.
14358 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14359 (Symbol_table::gc_mark_dyn_syms): New function.
14360 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
14361 as garbage.
14362 (Symbol_table::add_from_object): Likewise.
14363 (Symbol_table::add_from_relobj): When building shared objects, do not
14364 treat externally visible symbols as garbage.
14365 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
14366 table information for static and relocatable links.
14367 * symtab.h (Symbol_table::set_gc): New function.
14368 (Symbol_table::gc): New function.
14369 (Symbol_table::gc_mark_undef_symbols): New function.
14370 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14371 (Symbol_table::gc_mark_dyn_syms): New function.
14372 (Symbol_table::gc_): New data member.
e1df38aa 14373 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
14374 function.
14375 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
14376 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
14377
3b293544
CF
143782009-01-20 Chris Faylor <me.sourceware@sourceware.org>
14379
14380 * options.h (General_options::gc_sections): Define as a no-op for now.
14381 (General_options::no_keep_memory): Ditto.
14382 (General_options::Bshareable): Define.
14383 * options.cc (General_options::finalize): Honor -Bshareable.
14384
83d22aa8
AS
143852009-01-20 Andreas Schwab <schwab@suse.de>
14386
14387 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
14388 read the value in the contents, since we don't use it. Use the
14389 template endianness when writing.
14390 (Relocate::relocate): Use it for R_PPC_REL16_HA.
14391
cd536b21
AS
143922009-01-19 Andreas Schwab <schwab@suse.de>
14393
14394 * configure.tgt (powerpc64-*): Fix targ_obj.
14395
99e9a495
ILT
143962009-01-15 Ian Lance Taylor <iant@google.com>
14397
14398 * object.cc (Sized_relobj::write_local_symbols): Don't write out
14399 local symbols when stripping all symbols.
14400
bbbfea06
CC
144012009-01-14 Cary Coutant <ccoutant@google.com>
14402
99e9a495 14403 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 14404
0f7c0701
CC
144052009-01-14 Cary Coutant <ccoutant@google.com>
14406
14407 * archive.cc (Archive::get_elf_object_for_member): Remove call
14408 to File_read::claim_for_plugin.
14409 * descriptors.cc (Descriptors::open): Remove reference to
14410 is_claimed.
14411 (Descriptors::claim_for_plugin): Remove.
14412 * descriptors.h (Descriptors::claim_for_plugin): Remove.
14413 (Descriptors::is_claimed): Remove.
14414 (claim_descriptor_for_plugin): Remove.
14415 * fileread.cc (File_read::claim_for_plugin): Remove.
14416 * fileread.h (File_read::claim_for_plugin): Remove.
14417 (File_read::descriptor): Reopen descriptor if necessary.
14418 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
14419 (Plugin_manager::all_symbols_read): Add task parameter. Change
14420 all callers.
14421 (Plugin_manager::get_input_file): New function.
14422 (Plugin_manager::release_input_file): New function.
14423 (Pluginobj::Pluginobj): Add filesize parameter and initialize
14424 corresponding data member.
14425 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
14426 and pass to base constructor. Change all callers.
14427 (get_input_file, release_input_file): New functions.
14428 (make_sized_plugin_object): Add filesize parameter. Change all callers.
14429 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
14430 (Plugin_manager::all_symbols_read): Add task parameter.
14431 (Plugin_manager::get_input_file): New function.
14432 (Plugin_manager::release_input_file): New function.
14433 (Plugin_manager::task_): New data member.
14434 (Pluginobj::Pluginobj): Add filesize parameter.
14435 (Pluginobj::filename): New function.
14436 (Pluginobj::descriptor): New function.
14437 (Pluginobj::filesize): New function.
14438 (Pluginobj::filesize_): New data member.
14439 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
14440 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
14441 File_read::claim_for_plugin; use Object::unlock to unlock the file.
14442
14443 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
14444 with archive libraries.
14445 * testsuite/Makefile.in: Regenerate.
14446 * testsuite/plugin_test.c (struct sym_info): New type.
14447 (get_input_file, release_input_file): New static variables.
14448 (onload): Capture new transfer vector entries.
14449 (claim_file_hook): Stop reading at end of file according to filesize.
14450 Factor out parsing of readelf output into separate function.
14451 (all_symbols_read_hook): Exercise get_input_file and release_input_file
14452 APIs and get the source file name from the symbol table. Convert
14453 source file name to corresponding object file name. Print info
14454 message when adding new input files.
14455 (parse_readelf_line): New function.
14456 * testsuite/plugin_test_1.sh: Add checks for new info messages.
14457 * testsuite/plugin_test_2.sh: Likewise.
14458 * testsuite/plugin_test_3.sh: Likewise.
14459 * testsuite/plugin_test_4.sh: New test case.
14460
62a6d109
ILT
144612009-01-07 Ian Lance Taylor <iant@google.com>
14462
14463 * version.cc (version_string): Bump to 1.8.
14464
483620e8
CC
144652008-12-23 Cary Coutant <ccoutant@google.com>
14466
14467 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
14468 * plugin.cc (Plugin_manager::finish): Rename as
14469 layout_deferred_objects. Move cleanup to separate function.
14470 (Plugin_manager::cleanup): New function.
14471 (Plugin_finish::run): Call layout_deferred_objects and cleanup
14472 separately.
14473 * plugin.h (Plugin_manager::finish): Rename as
14474 layout_deferred_objects.
14475 (Plugin_manager::cleanup): New function.
14476 (Plugin_manager::cleanup_done): New field.
14477
d66a9eb3
CC
144782008-12-23 Cary Coutant <ccoutant@google.com>
14479
14480 * plugin.cc (is_visible_from_outside): New function.
14481 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
14482 so we don't return "IR only" status for exported symbols or -r links.
14483
14484 * testsuite/Makefile.am (plugin_test_3): New test case.
14485 * testsuite/Makefile.in: Regenerate.
14486 * testsuite/plugin_test_3.sh: New file.
14487
5995b570
CC
144882008-12-22 Cary Coutant <ccoutant@google.com>
14489
14490 * object.cc (Sized_relobj::layout_section): New function.
14491 (Sized_relobj::do_layout): Defer layout of input sections until after
14492 plugin has provided replacement files.
14493 (Sized_relobj::do_layout_deferred_sections): New function.
14494 * object.h (Relobj::set_section_offset): Remove virtual keyword.
14495 (Relobj::layout_deferred_sections): New function.
14496 (Relobj::do_layout_deferred_sections): New function.
14497 (Sized_relobj::do_layout_deferred_sections): New function.
14498 (Sized_relobj::layout_section): New function.
14499 (Sized_relobj::Deferred_layout): New structure.
14500 (Sized_relobj::deferred_layout_): New field.
14501 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
14502 Change all callers. Layout deferred sections.
14503 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
14504 references.
14505 (Plugin_hook::run): Move code from do_plugin_hook inline.
14506 (Plugin_hook::do_plugin_hook): Remove.
14507 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
14508 (Plugin_manager::finish): Renamed, was cleanup.
14509 (Plugin_manager::should_defer_layout): New function.
14510 (Plugin_manager::add_deferred_layout_object): New function.
14511 (Plugin_manager::Deferred_layout_list): New type.
14512 (Plugin_manager::deferred_layout_objects_): New field.
14513 (Plugin_hook::do_plugin_hook): Remove.
14514
ee769c88
ILT
145152008-12-17 Ian Lance Taylor <iant@google.com>
14516
14517 * options.h (class General_options): Add --no case for
14518 --export-dynamic.
14519
abc8dcba
CC
145202008-12-16 Cary Coutant <ccoutant@google.com>
14521
14522 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
14523 vector.
14524 (Plugin_manager::claim_file): Create plugin object even if
14525 plugin did not call the add_symbols callback.
14526 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
14527 asking for more symbols than were added.
14528 * testsuite/Makefile.am (plugin_test_1): Add test case with
14529 no global symbols.
14530 (empty.syms): New target.
14531 * testsuite/Makefile.in: Regenerate.
14532 * testsuite/plugin_test.c (claim_file_hook): Add new debug
14533 message. Don't call add_symbols if no globals.
14534 (all_symbols_read_hook): Don't provide replacement for empty
14535 claimed file.
14536
b0074644
ILT
145372008-12-12 Ian Lance Taylor <iant@google.com>
14538
68943102
ILT
14539 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
14540 r_type == 0 for a local symbol with r_sym == 0.
14541 (scan_relocatable_relocs): Pass r_sym to
14542 local_non_section_strategy.
14543 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
14544 r_sym parameter.
14545
b0074644
ILT
14546 * configure.ac: Update test for TLS descriptors: they are
14547 supported as of glibc 2.9.
14548 * configure: Rebuild.
14549
c2508178
ILT
145502008-12-11 Ian Lance Taylor <iant@google.com>
14551
14552 PR 7091
14553 * target-reloc.h (Default_scan_relocatable_relocs): For each
14554 function, map r_type == 0 to RELOC_DISCARD.
14555
2756a258
CC
145562008-12-10 Cary Coutant <ccoutant@google.com>
14557
14558 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
14559 object to override a kept COMDAT group from a plugin object.
14560
bb6f53d3
ILT
145612008-12-09 Ian Lance Taylor <iant@google.com>
14562
fbc558e1
ILT
14563 PR 7088
14564 * yyscript.y (file_cmd): Handle INPUT.
14565
bb6f53d3
ILT
14566 * testsuite/initpri1.c: Change all declarations to be full
14567 prototypes by adding void, to avoid compiler warnings.
14568
4674ecfc
CC
145692008-12-05 Rafael Avila de Espindola <espindola@google.com>
14570
14571 * options.cc (General_options::parse_plugin_opt): New.
14572 (General_options::add_plugin): The argument now is just the filename.
14573 (General_options::add_plugin_option): New.
14574 * options.h (plugin_opt): New.
14575 (add_plugin): Change argument name.
14576 (add_plugin_option): New.
14577 * plugin.cc (Plugin::load): Don't parse the plugin option.
14578 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
14579 (Plugin::add_option): New.
14580 (Plugin::args_): Change type.
14581 (Plugin::filename_): New.
14582 (Plugin_manager::add_plugin_option): New.
14583 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
14584 * testsuite/Makefile.in: Regenerate.
14585
fd06b4aa
CC
145862008-12-05 Cary Coutant <ccoutant@google.com>
14587
14588 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
14589 Handle --strip-lto-sections option.
14590 * options.h (strip_lto_sections): New option.
14591
6c52134c
CC
145922008-12-01 Cary Coutant <ccoutant@google.com>
14593
14594 * plugin.cc (ld_plugin_message): Change format parameter to const.
14595 Fix mismatch between new[] and delete.
14596
a45248e0
CC
145972008-11-14 Cary Coutant <ccoutant@google.com>
14598
14599 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
14600 instead of -1U.
14601
c82fbeee
CS
146022008-11-05 Craig Silverstein <csilvers@google.com>
14603
14604 * options.cc (General_options::parse_dynamic_list): New function.
14605 * options.h (General_options): New flags dynamic_list,
14606 dynamic_list_data, dynamic_list_cpp_new, and
14607 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
14608 (General_options::in_dynamic_list): New function.
14609 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
14610 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
14611 (Lex::can_continue_name): Likewise.
14612 (yylex): Likewise.
14613 (read_script_file): New parameter script_options.
14614 (read_dynamic_list): New function.
14615 (Script_options::define_dynamic_list): New function.
14616 (dynamic_list_keyword_parsecodes): New variable.
14617 (dynamic_list_keywords): New variable.
14618 * script.h (Script_options::define_dynamic_list): New function
14619 prototype.
14620 (read_dynamic_list): New function prototype.
14621 * symtab.cc (strprefix): New macro.
14622 (Symbol::should_add_dynsym_entry): Support dynamic_list,
14623 dynamic_list_data, dynamic_list_cpp_new, and
14624 dynamic_list_cpp_typeinfo.
14625 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
14626 (dynamic_list_expr): New rule.
14627 (dynamic_list_nodes): Likewise.
14628 (dynamic_list_node): Likewise.
14629 * testsuite/Makefile.am (dynamic_list): New test.
14630 * testsuite/Makefile.in: Regenerated.
14631 * testsuite/dynamic_list.t: New file.
14632 * testsuite/dynamic_list.sh: New file.
14633
e0bb29a5
CS
146342008-11-05 Craig Silverstein <csilvers@google.com>
14635
14636 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
14637 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
14638 (t11_last): Likewise.
14639 * testsuite/ver_test_6.c (main): Likewise.
14640
4e1e25e0
CC
146412008-10-07 Cary Coutant <ccoutant@google.com>
14642
14643 * options.c (General_options::finalize): Add check for -static and
14644 -shared.
14645 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
14646 is not empty.
14647
92f03fcb
CC
146482008-10-02 Cary Coutant <ccoutant@google.com>
14649
14650 * plugin.cc (make_sized_plugin_object): Fix conditional
14651 compilation to work when not all targets are enabled.
14652
fbd8a257
CC
146532008-09-29 Cary Coutant <ccoutant@google.com>
14654
14655 * archive.cc (Archive::get_file_and_offset): Use filename instead
14656 of name to get library path.
14657 (Archive::include_member): Unlock external member of a thin archive.
14658
14659 * testsuite/Makefile.am (TEST_AR): New variable.
14660 (thin_archive_test_1): New test.
14661 (thin_archive_test_2): New test.
81636b3f
CC
14662 * testsuite/Makefile.in: Regenerate.
14663 * testsuite/thin_archive_main.cc: New file.
14664 * testsuite/thin_archive_test_1.cc: New file.
14665 * testsuite/thin_archive_test_2.cc: New file.
14666 * testsuite/thin_archive_test_3.cc: New file.
14667 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 14668
eff45813
CC
146692008-09-29 Cary Coutant <ccoutant@google.com>
14670
14671 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
14672 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
14673 instead of -1U.
14674 (Sized_relobj::do_finalize_local_symbols): Likewise.
14675 (Sized_relobj::map_to_kept_section): Likewise.
14676 * object.h (Sized_relobj::invalid_address): New constant.
14677 (Sized_relobj::do_output_section_offset): Check for invalid_address
14678 and return -1ULL.
14679 * output.cc (Output_reloc::local_section_offset): Use constant
14680 invalid_address instead of -1U.
14681 (Output_reloc::get_address): Likewise.
14682 (Output_section::output_address): Change -1U to -1ULL.
14683 * output.h (Output_reloc::invalid_address): New constant.
14684 * reloc.cc (Sized_relobj::write_sections): Use constant
14685 invalid_address instead of -1U.
14686 (Sized_relobj::relocate_sections): Likewise.
14687 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
14688 values for merge sections.
14689 * target-reloc.h (relocate_for_relocatable): Use constant
14690 invalid_address instead of -1U.
14691
89fc3421
CC
146922008-09-19 Cary Coutant <ccoutant@google.com>
14693
14694 Add plugin functionality for link-time optimization (LTO).
14695 * configure.ac (plugins): Add --enable-plugins option.
14696 * configure: Regenerate.
14697 * config.in: Regenerate.
14698 * Makefile.am (LIBDL): New variable.
14699 (CCFILES): Add plugin.cc.
14700 (HFILES): Add plugin.h.
14701 (ldadd_var): Add LIBDL.
14702 * Makefile.in: Regenerate.
14703
14704 * archive.cc: Include "plugin.h".
14705 (Archive::setup): Don't preread archive symbols when using a plugin.
14706 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
14707 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
14708 files.
14709 (Archive::include_member): Add symbols from plugin objects.
14710 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
14711 * descriptors.cc (Descriptors::open): Check for file descriptors
14712 abandoned by plugins.
14713 (Descriptors::claim_for_plugin): New function.
14714 * descriptors.h (Descriptors::claim_for_plugin): New function.
14715 (Open_descriptor::is_claimed): New field.
14716 (claim_descriptor_for_plugin): New function.
14717 * fileread.cc (File_read::claim_for_plugin): New function.
14718 * fileread.h (File_read::claim_for_plugin): New function.
14719 (File_read::descriptor): New function.
14720 * gold.cc: Include "plugin.h".
14721 (queue_initial_tasks): Add task to call plugin hooks for generating
14722 new object files.
14723 * main.cc: Include "plugin.h".
14724 (main): Load plugin libraries.
14725 * object.h (Pluginobj): Declare.
14726 (Object::pluginobj): New function.
14727 (Object::do_pluginobj): New function.
14728 (Object::set_target): New function.
14729 * options.cc: Include "plugin.h".
14730 (General_options::parse_plugin): New function.
14731 (General_options::General_options): Initialize plugins_ field.
14732 (General_options::add_plugin): New function.
14733 * options.h (Plugin_manager): Declare.
14734 (General_options): Add --plugin option.
14735 (General_options::has_plugins): New function.
14736 (General_options::plugins): New function.
14737 (General_options::add_plugin): New function.
14738 (General_options::plugins_): New field.
14739 * plugin.cc: New file.
14740 * plugin.h: New file.
14741 * readsyms.cc: Include "plugin.h".
14742 (Read_symbols::do_read_symbols): Check for archive before checking
14743 for ELF file. Call plugin hooks to claim files.
14744 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
14745 from a real object file; force override when processing replacement
14746 files.
14747 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
14748 (Symbol::init_base_object): Likewise.
14749 (Symbol::init_base_output_data): Likewise.
14750 (Symbol::init_base_output_segment): Likewise.
14751 (Symbol::init_base_constant): Likewise.
14752 (Symbol::init_base_undefined): Likewise.
14753 (Symbol::output_section): Assert that object is not a plugin.
14754 (Symbol_table::add_from_pluginobj): New function.
14755 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
14756 undefined.
14757 (Symbol_table::sized_write_globals): Likewise.
14758 (Symbol_table::add_from_pluginobj): Instantiate template.
14759 * symtab.h (Sized_pluginobj): Declare.
14760 (Symbol::in_real_elf): New function.
14761 (Symbol::set_in_real_elf): New function.
14762 (Symbol::in_real_elf_): New field.
14763 (Symbol_table::add_from_pluginobj): New function.
14764
14765 * testsuite/Makefile.am (AM_CFLAGS): New variable.
14766 (LIBDL): New variable.
14767 (LDADD): Add LIBDL.
14768 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
14769 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
14770 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
14771 (MOSTLYCLEANFILES): Likewise.
14772 * testsuite/Makefile.in: Regenerate.
14773 * testsuite/plugin_test.c: New file.
14774 * testsuite/plugin_test_1.sh: New file.
14775 * testsuite/plugin_test_2.sh: New file.
14776
de31bda5
ILT
147772008-09-16 Ian Lance Taylor <iant@google.com>
14778
9c2d0ef9
ILT
14779 * target-reloc.h (relocate_section): Check whether a symbol is
14780 defined by the ABI before reporting an undefined symbol error.
14781 * target.h (Target::is_defined_by_abi): Make parameter const.
14782 (Target::do_is_defined_by_abi): Likewise.
14783 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
14784 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
14785 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
14786 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
14787 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
14788 * testsuite/Makefile.in: Rebuild.
14789
de31bda5
ILT
14790 * fileread.cc (make_view): Add casts to avoid warning.
14791
9fa33bee
AO
147922008-09-16 Alexandre Oliva <aoliva@redhat.com>
14793
14794 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
14795 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14796
183fd0e3
AO
147972008-09-16 Alexandre Oliva <aoliva@redhat.com>
14798
14799 * options.h (General_options::output_is_executable): New.
14800 (General_options::output_is_pie): New.
14801 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
14802 for shared libraries.
14803 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14804
7be8330a
CD
148052008-09-11 Chris Demetriou <cgd@google.com>
14806
14807 * options.h (origin): New -z option.
14808 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
14809 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
14810 in DT_FLAGS_1.
14811
a9caad02
CC
148122008-09-05 Cary Coutant <ccoutant@google.com>
14813
14814 * fileread.cc (File_read::make_view): Add check for attempt to map
14815 beyond end of file.
14816
ae6dce4d
CC
148172008-09-05 Cary Coutant <ccoutant@google.com>
14818
14819 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
14820 explicit instantiations.
14821
d7ab2a47
KVH
148222008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
14823
14824 PR gold/6858
14825 * options.cc (General_options::finalize): Allow undefined symbols
14826 in shlibs if linking -shared.
14827
14828 PR gold/6859
14829 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
14830 symbols as not needing a dynsym entry.
14831
1e52a9c1
CS
148322008-08-20 Craig Silverstein <csilvers@google.com>
14833
14834 * fileread.cc (File_read::open): Do not lock the file unless it
14835 was successfully opened.
14836
d85c80a3
CC
148372008-08-14 Cary Coutant <ccoutant@google.com>
14838
14839 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
14840 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
14841 * testsuite/tls_test.cc (struct int128): 128-bit struct
14842 for testing TLS relocs with non-zero addend.
14843 (v12): New TLS variable.
14844 (t12): New test.
14845 (t_last): Add check for v12.
14846 * testsuite/tls_test.h (t12): New function.
14847 * testsuite/tls_test_main.cc (thread_routine): Call new test.
14848
2d924fd9
ILT
148492008-08-13 Ian Lance Taylor <iant@google.com>
14850
14851 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
14852 set tls_segment_ or relro_segment_.
14853 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
14854 when appropriate.
14855 * output.h (Output_section::clear_is_relro): New function.
14856 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
14857 sections specially even when output_data_ is empty.
14858 (Output_segment::maximum_alignment): When first section is relro,
14859 only force alignment for PT_LOAD segments.
14860 * script.cc (script_data_segment_align): New function.
14861 (script_data_segment_relro_end): New function.
14862 * script-c.h (script_data_segment_align): Declare.
14863 (script_data_segment_relro_end): Declare.
14864 * script-sections.h (class Script_sections): Declare
14865 data_segment_align and data_segment_relro_end. Add fields
14866 segment_align_index_ and saw_relro_end_.
14867 * script-sections.cc (class Sections_element): Add set_is_relro
14868 virtual function. Add new bool* parameter to place_orphan_here.
14869 Add get_output_section virtual function.
14870 (class Output_section_definition): Add set_is_relro. Add new
14871 bool* parameter to place_orphan_here. Add get_output_section.
14872 Add is_relro_ field.
14873 (Output_section_definition::Output_section_definition): Initialize
14874 evaluated_address_, evaluated_load_address, evaluated_addralign_,
14875 and is_relro_ fields.
14876 (Output_section_definition::place_orphan_here): Add is_relro
14877 parameter.
14878 (Output_section_definition::set_section_addresses): Set relro for
14879 output section.
14880 (Output_section_definition::alternate_constraint): Likewise.
14881 (class Orphan_output_section): Add new bool* parameter to
14882 place_orphan_here. Add get_output_section.
14883 (Orphan_output_section::place_orphan_here): Add is_relro
14884 parameter.
14885 (Script_sections::Script_sections): Initialize
14886 data_segment_align_index_ and saw_relro_end_.
14887 (Script_sections::data_segment_align): New function.
14888 (Script_sections::data_segment_relro_end): New function.
14889 (Script_sections::place_orphan): Set or clear is_relro.
14890 (Script_sections::set_section_addresses): Force alignment of first
14891 TLS section.
14892 * yyscript.y (exp): Call script_data_segment_align and
14893 script_data_segment_relro_end.
14894 * testsuite/relro_script_test.t: New file.
14895 * testsuite/relro_test.cc (using_script): Declare.
14896 (t1, t2): Test using_script.
14897 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
14898 (relro_script_test_SOURCES): Define.
14899 (relro_script_test_DEPENDENCIES): Define.
14900 (relro_script_test_LDFLAGS): Define.
14901 (relro_script_test_LDADD): Define.
14902 (relro_script_test.so): New target.
14903 * testsuite/Makefile.in: Rebuild.
14904
f827c9a9
CC
149052008-08-06 Cary Coutant <ccoutant@google.com>
14906
14907 * archive.cc (Archive::total_archives, Archive::total_members)
14908 (Archive::total_members_loaded): New variables.
14909 (Archive::setup): Add parameter. Add option to preread
14910 archive symbols.
14911 (Archive::read_armap): Add counter.
14912 (Archive::get_file_and_offset): New function.
14913 (Archive::get_elf_object_for_member): New function.
14914 (Archive::read_all_symbols): New function.
14915 (Archive::read_symbols): New function.
14916 (Archive::add_symbols): Add counters.
14917 (Archive::include_all_members): Use armap to find members if it's
14918 already built.
14919 (Archive::include_member): Skip reading symbols if already read.
14920 Factored code into Archive::get_file_and_offset and
14921 Archive::get_elf_object_for_member. Changed call to
14922 Mapfile::report_include_archive_member.
14923 (Archive::print_stats): New function.
14924 * archive.h: Declare Object and Read_symbols_data classes.
14925 (Archive::Archive): Add initializers for new members.
14926 (Archive::setup): Add parameter.
14927 (Archive::print_stats): New function.
14928 (Archive::total_archives, Archive::total_members)
14929 (Archive::total_members_loaded): New variables.
14930 (Archive::get_file_and_offset): New function.
14931 (Archive::get_elf_object_for_member): New function.
14932 (Archive::read_all_symbols): New function.
14933 (Archive::read_symbols): New function.
14934 (Archive::Archive_member): New class.
14935 (Archive::members_): New member.
14936 (Archive::num_members_): New member.
14937 * main.cc: Include archive.h.
14938 (main): Call Archive::print_stats.
14939 * mapfile.cc (Mapfile::report_include_archive_member): Delete
14940 archive parameter; member_name is now the fully-decorated name.
14941 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
14942 * options.h: (General_options): Add --preread-archive-symbols option.
14943 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
14944 Archive::setup.
14945
de4c45bd
ILT
149462008-08-04 Ian Lance Taylor <iant@google.com>
14947
14948 * symtab.h (Symbol::use_plt_offset): New function.
14949 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
14950 * powerpc.cc (Relocate::relocate): Likewise.
14951 * sparc.cc (Relocate::relocate): Likewise.
14952 * x86_64.cc (Relocate::relocate): Likewise.
14953 * testsuite/weak_plt.sh: New test.
14954 * testsuite/weak_plt_main.cc: New test.
14955 * testsuite/weak_plt_shared.cc: New test.
14956 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
14957 (check_PROGRAMS): Add weak_plt.
14958 (check_DATA): Add weak_plt_shared.so.
14959 (weak_plt_main_pic.o, weak_plt): New targets.
14960 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
14961 * testsuite/Makefile.in: Rebuild.
14962
14963 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
14964 gcctestdir/ld.
14965 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
14966 * testsuite/Makefile.in: Rebuild.
14967
323ee3f4
AM
149682008-08-04 Alan Modra <amodra@bigpond.net.au>
14969
14970 * Makefile.am (POTFILES.in): Set LC_ALL=C.
14971 * Makefile.in: Regenerate.
14972 * po/POTFILES.in: Regenerate.
14973
7c07ecec
ILT
149742008-07-29 Ian Lance Taylor <iant@google.com>
14975
14976 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
14977 symbols before other symbols.
14978 * testsuite/script_test_2.cc (test_addr): Declare.
14979 (test_addr_alias): Declare.
14980 (main): Check that test_addr and test_addr_alias have the right
cd536b21 14981 values.
7c07ecec
ILT
14982 * testsuite/script_test_2.t: Define test_addr_alias and
14983 test_addr.
14984
5778530e
ILT
149852008-07-24 Ian Lance Taylor <iant@google.com>
14986
2a00e4fb
ILT
14987 PR 5990
14988 * descriptors.cc: New file.
14989 * descriptors.h: New file.
14990 * gold-threads.h (class Hold_optional_lock): New class.
14991 * fileread.cc: Include "descriptors.h".
14992 (File_read::~File_read): Release descriptor rather than closing
14993 it.
14994 (File_read::open) [file]: Call open_descriptor rather than open.
14995 Set is_descriptor_opened_.
14996 (File_read::open) [memory]: Assert that descriptor is not open.
14997 (File_read::reopen_descriptor): New function.
14998 (File_read::release): Release descriptor.
14999 (File_read::do_read): Make non-const. Reopen descriptor.
15000 (File_read::read): Make non-const.
15001 (File_read::make_view): Reopen descriptor.
15002 (File_read::do_readv): Likewise.
15003 * fileread.h (class File_read): Add is_descriptor_opened_ field.
15004 Update declarations.
15005 * layout.cc: Include "descriptors.h".
15006 (Layout::create_build_id): Use open_descriptor rather than open.
15007 * output.cc: Include "descriptors.h".
15008 (Output_file::open): Use open_descriptor rather than open.
15009 * archive.cc (Archive::const_iterator): Change Archive to be
15010 non-const.
15011 (Archive::begin, Archive::end): Make non-const.
15012 (Archive::count_members): Likewise.
15013 * archive.h (class Archive): Update declarations.
15014 * object.h (Object::read): Make non-const.
15015 * Makefile.am (CCFILES): Add descriptors.cc.
15016 (HFILES): Add descriptors.h.
15017 * Makefile.in: Rebuild.
15018
801647d1
ILT
15019 PR 6716
15020 * gold.h: Always include <clocale>. Add Solaris workarounds
15021 following code in binutils/sysdep.h.
15022
5edd166e
ILT
15023 PR 6048
15024 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
15025 this->eh_frame_hdr_ is NULL before using it.
15026
c89ad728
ILT
15027 * dynobj.cc (Versions::Versions): Update comment.
15028
aa86f06b
ILT
15029 * dynobj.cc (Versions::Versions): If there is an soname, use it as
15030 the base version name.
15031
5778530e
ILT
15032 * stringpool.cc (Stringpool_template::add_with_length): Set key to
15033 array size plus one.
15034 (Stringpool_template::set_string_offsets): Subtract one from key
15035 before using it as an array index.
15036 (Stringpool_template::get_offset_with_length): Likewise.
15037 (Stringpool_template::write_to_buffer): Likewise.
15038 * stringpool.h (Stringpool_template::get_offset_from_key):
15039 Likewise.
15040
057ead22
ILT
150412008-07-23 Ian Lance Taylor <iant@google.com>
15042
7f649c59
ILT
15043 PR 6658
15044 * object.h (Merged_symbol_value::value): Do our best to handle a
15045 negative addend.
15046
057ead22
ILT
15047 PR 6647
15048 * script.cc (Version_script_info::get_versions): Don't add empty
15049 version tag to return value.
15050 (Version_script_info::get_symbol_version_helper): Change return
15051 type to bool. Add pversion parameter. Change all callers.
15052 (script_register_vers_node): Don't require a non-NULL tag.
15053 * script.h (class Version_script_info): Update declarations.
15054 (Version_script_info::get_symbol_version): Change return type to
15055 bool. Add version parameter. Change all callers.
15056 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
15057 handling. Handle an empty version from a version script.
15058 (Symbol_table::define_special_symbol): Likewise.
15059 * testsuite/ver_test_10.script: New file.
15060 * testsuite/ver_test_10.sh: New file.
15061 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
15062 (check_DATA): Add ver_test_10.syms.
15063 (ver_test_10.syms, ver_test_10.so): New target.
15064 * testsuite/Makefile.in: Rebuild.
15065
58e54ac2
CD
150662008-07-23 Simon Baldwin <simonb@google.com>
15067
15068 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
15069 to zero for undefined symbols from dynamic libraries.
15070
95d14cd3
ILT
150712008-07-23 Ian Lance Taylor <iant@google.com>
15072
15073 * symtab.cc (Symbol_table::resolve): Remove version parameter.
15074 Change all callers.
15075 * symtab.h (class Symbol_table): Update declaration.
15076 * testsuite/ver_test_9.cc: New file.
15077 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
15078 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
15079 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
15080 (ver_test_9.so, ver_test_9.o): New targets.
15081 * testsuite/Makefile.in: Rebuild.
15082
92de84a6
ILT
150832008-07-22 Ian Lance Taylor <iant@google.com>
15084
34810851
ILT
15085 * options.h (class General_options): Define --check-sections.
15086 * layout.cc (Layout::set_segment_offsets): Handle
15087 --check-sections.
15088
af6156ef
ILT
15089 * options.h (class General_options): Define -n/--nmagic and
15090 -N/--omagic.
15091 * options.cc (General_options::finalize): For -n/--nmagic or
15092 -N/--omagic, set -static.
15093 * layout.cc (Layout::attach_allocated_section_to_segment): If
15094 -N/--omagic, don't put read-only and read-write sections in
15095 different segments.
15096 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
15097 finding a read-only segment.
15098 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
15099 don't set the minimum segment alignment to the common page size,
15100 and don't set the file offset to the address modulo the page size.
15101 * script-sections.cc (Script_sections::create_segments): If
15102 -n/--omagic, don't put read-only and read-write sections in
15103 different segments.
15104
92de84a6
ILT
15105 * cref.cc: New file.
15106 * cref.h: New file.
15107 * options.h (class General_options): Add --print-symbol-counts.
15108 * main.cc (main): Issue defined symbol report if requested.
15109 * archive.cc (Archive::interpret_header): Make into a const member
15110 function.
15111 (Archive::add_symbols): Call Input_objects::archive_start and
15112 archive_stop.
15113 (Archive::const_iterator): Define new class.
15114 (Archive::begin, Archive::end): New functions.
15115 (Archive::include_all_members): Rewrite to use iterator.
15116 (Archive::count_members): New function.
15117 * archive.h (class Archive): Update declarations.
15118 (Archive::filename): New function.
15119 * object.cc: Include "cref.h".
15120 (Sized_relobj::Sized_relobj): Initialize defined_count_.
15121 (Sized_relobj::do_get_global_symbol_counts): New function.
15122 (Input_objects::add_object): Add object to cross-referencer.
15123 (Input_objects::archive_start): New function.
15124 (Input_objects::archive_stop): New function.
15125 (Input_objects::print_symbol_counts): New function.
15126 * object.h: Declare Cref and Archive.
15127 (Object::get_global_symbol_counts): New function.
15128 (Object::do_get_global_symbol_counts): New pure virtual function.
15129 (class Sized_relobj): Add defined_count_ field. Update
15130 declarations.
15131 (class Input_objects): Add cref_ field. Update constructor.
15132 Update declarations.
15133 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
15134 defined_count_.
15135 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
15136 symbol counts.
15137 (Sized_dynobj::do_get_global_symbol_counts): New function.
15138 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
15139 defined_count_. Update declarations. Define Symbols typedef.
15140 * symtab.cc (Symbol_table::add_from_relobj): Add defined
15141 parameter. Change all callers.
15142 (Symbol_table::add_from_dynobj): Add sympointers and defined
15143 parameters. Change all callers.
15144 * symtab.h (class Symbol_table): Update declarations.
15145 * Makefile.am (CCFILES): Add cref.cc.
15146 (HFILES): Add cref.h.
15147 * Makefile.in: Rebuild.
15148
3f7c5e1d
CD
151492008-07-22 Simon Baldwin <simonb@google.com>
15150
15151 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
15152 to zero when writing undefined symbols.
15153
e0b64032
ILT
151542008-07-22 Ian Lance Taylor <iant@google.com>
15155
15156 * output.cc (Output_section::add_input_section): Don't try to
15157 merge empty merge sections.
15158
096b02cf
CS
151592008-07-21 Craig Silverstein <csilvers@google.com>
15160
15161 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15162 Include symbol version in error message.
cd536b21 15163
1d1f116d
CD
151642008-07-20 Chris Demetriou <cgd@google.com>
15165
cd536b21 15166 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
15167 (RANDOM_SEED_CFLAGS): New substituted variable.
15168 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
15169 * configure: Rebuild.
15170 * Makefile.in: Likewise.
15171 * testsuite/Makefile.in: Likewise.
15172
a18f591e
ILT
151732008-07-18 Ian Lance Taylor <iant@google.com>
15174
15175 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
15176 where we see NAME/NULL and NAME/VERSION as separate symbols.
15177 * testsuite/ver_test_main.cc (main): Call t4.
15178 (t4, t4_2a): Define.
15179 * testsuite/ver_test_2.cc (t4_2): Define.
15180 * testsuite/ver_test_2.script: Put t4_2a in VER2.
15181 * testsuite/ver_test_4.cc (t4_2a): Define.
15182 * testsuite/ver_test_4.script: Put t4_2a in VER2.
15183 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
15184
c6e3f6ed
ILT
151852008-07-17 Ian Lance Taylor <iant@google.com>
15186
15187 * dynobj.cc (Versions::add_def): If we give an error about a
15188 missing version, go ahead and create the version anyhow.
15189
ef9beddf
ILT
151902008-07-10 Ian Lance Taylor <iant@google.com>
15191
15192 Handle output sections with more than 0x7fffffff bytes.
15193 * object.h (class Relobj): Change map_to_output_ to
15194 output_sections_, and just keep a section pointer. Change all
15195 uses. Move comdat group support to Sized_relobj.
15196 (Relobj::is_section_specially_mapped): Remove.
15197 (Relobj::output_section): Remove poff parameter. Change all
15198 callers.
15199 (Relobj::output_section_offset): New function.
15200 (Relobj::set_section_offset): Rewrite.
15201 (Relobj::map_to_output): Remove.
15202 (Relobj::output_sections): New function.
15203 (Relobj::do_output_section_offset): New pure virtual function.
15204 (Relobj::do_set_section_offset): Likewise.
15205 (class Sized_relobj): Add section_offsets_ field. Add comdat
15206 group support from Relobj. Update declarations.
15207 (Sized_relobj::get_output_section_offset): New function.
15208 (Sized_relobj::do_output_section_offset): New function.
15209 (Sized_relobj::do_set_section_offset): New function.
15210 * object.cc (Relobj::output_section_address): Remove.
15211 (Sized_relobj::Sized_relobj): Initialize new fields.
15212 (Sized_relobj::include_section_group): Cast find_kept_object to
15213 Sized_relobj.
15214 (Sized_relobj::include_linkonce_section): Likewise.
15215 (Sized_relobj::do_layout): Use separate arrays for output section
15216 and output offset.
15217 (Sized_relobj::do_count_local_symbols): Change map_to_output to
15218 output_sections.
15219 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
15220 output_sections and section_offsets.
15221 (Sized_relobj::write_local_symbols): Likewise.
15222 (map_to_kept_section): Compute output address directly.
15223 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
15224 output_sections and section_offsets.
15225 (Sized_relobj::write_sections): Likewise.
15226 (Sized_relobj::relocate_sections): Likewise.
15227 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
15228 * output.h (class Output_reloc): Update declarations. Change
15229 u2_.relobj to Sized_relobj*.
15230 (class Output_data_reloc): Change add functions to use
15231 Sized_relobj*.
15232 * output.cc (Output_reloc::Output_reloc): Change relobj to
15233 Sized_relobj*.
15234 (Output_reloc::local_section_offset): Change return type to
15235 Elf_Addr. Use get_output_section_offset.
15236 (Output_reloc::get_address): Likewise.
15237 (Output_section::is_input_address_mapped): Don't call
15238 is_section_specially_mapped.
15239 (Output_section::output_offset): Likewise.
15240 (Output_section::output_address): Likewise.
15241 (Output_section::starting_output_address): Likewise.
15242 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
15243 parameter to Sized_relobj*.
15244 (Copy_relocs::need_copy_reloc): Likewise.
15245 (Copy_relocs::save): Likewise.
15246 * copy-relocs.h (class Copy_relocs): Update declarations.
15247 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
15248 Sized_relobj*. Change relobj_ field to Sized_relobj*.
15249 * target-reloc.h (relocate_for_relocatable): Change
15250 offset_in_output_section type to Elf_Addr. Change code that uses
15251 it as well.
15252 * layout.cc (Layout::layout): Always set *off.
15253 * mapfile.cc (Mapfile::print_input_section): Use
15254 output_section_offset.
15255 * i386.cc (Target_i386::copy_reloc): Change object parameter to
15256 Sized_relobj*.
15257 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
15258 * sparc.cc (Target_sparc::copy_reloc): Likewise.
15259 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
15260
5cb66f97
ILT
152612008-07-03 Ian Lance Taylor <iant@google.com>
15262
15263 * layout.cc (Layout::include_section): Do not discard unrecognized
15264 SHT_STRTAB sections.
15265
afe47622
CS
152662008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
15267
15268 * script.cc (Lex::can_continue_name): Make '?' allowable in
15269 version-script names.
15270 * testsuite/version_script.map: Change glob pattern to use '?'
15271
5adf9721
ILT
152722008-06-30 Manish Singh <yosh@gimp.org>
15273
15274 PR 6585
15275 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
15276 Correct typo.
15277
e6fde208
ILT
152782008-06-30 Ian Lance Taylor <iant@google.com>
15279
15280 PR 6660
15281 PR 6682
15282 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
15283 versions]: Don't try to read the value in the contents, since we
15284 don't use it. Use the template endianness when writing.
15285
3f2e6a2d
CC
152862008-06-25 Cary Coutant <ccoutant@google.com>
15287
15288 * fileread.cc (File_read::make_view): Assert on zero-length view.
15289 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
15290 symbol table when there are no symbols to read.
15291
c43d3a48
CS
152922008-06-23 Craig Silverstein <csilvers@google.com>
15293
15294 * version.cc (version_string): Bump to 1.7
15295
5f494ea0
CS
152962008-06-18 Craig Silverstein <csilvers@google.com>
15297
15298 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
15299 constant 0xFFFF to type Valtype.
15300 (Powerpc_relocate_functions::rel16_ha): Likewise.
15301
c42e122e
ILT
153022008-06-17 Ian Lance Taylor <iant@google.com>
15303
f34787f8
ILT
15304 * output.h (Output_section::Input_section): Initialize p2align_ to
15305 zero for Output_section_data constructors.
15306 (Output_section::Input_section::addralign): If not an input
15307 section, return the alignment of the Output_section_data.
15308 * testsuite/copy_test.cc: New file.
15309 * testsuite/copy_test_1.cc: New file.
15310 * testsuite/copy_test_2.cc: New file.
15311 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
15312 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
15313 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
15314 (copy_test_1_pic.o, copy_test_1.so): New targets.
15315 (copy_test_2_pic.o, copy_test_2.so): New targets.
15316 * testsuite/Makefile.in: Rebuild.
15317
c42e122e
ILT
15318 * script-sections.cc (Script_sections::place_orphan): Initialize
15319 local variable exact.
15320
ce3ac18a
DE
153212008-06-13 David Edelsohn <edelsohn@gnu.org>
15322
15323 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
15324
42cacb20
DE
153252008-06-12 David Edelsohn <edelsohn@gnu.org>
15326 David S. Miller <davem@davemloft.net>
15327
15328 * powerpc.cc: New file.
15329 * Makefile.am (TARGETSOURCES): Add powerpc.cc
15330 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
15331 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
15332 * Makefile.in: Rebuild.
15333
7b308235
ILT
153342008-06-09 Ian Lance Taylor <iant@google.com>
15335
15336 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
15337 <exception>.
15338 (throwing, orig_terminate): New static variables.
15339 (terminate_handler): New static function.
15340 (t2): Set terminate handler.
15341
f0b886e3
ILT
153422008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
15343
15344 PR 6584
cd536b21 15345 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
15346 alignment.
15347
3e90f135
CC
153482008-05-30 Cary Coutant <ccoutant@google.com>
15349
15350 * archive.cc (Archive::include_all_members) Correct to step
15351 over symbol table and extended name table in thin archives.
15352
e09ad04a
ILT
153532008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
15354
15355 PR 6407
15356 * target-reloc.h (relocate_for_relocatable): Fix new_offset
15357 calculation.
15358
62b01cb5
ILT
153592008-05-28 Caleb Howe <cshowe@google.com>
15360
15361 * reduced_debug_output.cc: New file.
15362 * reduced_debug_output.h: New file.
92de84a6 15363 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
15364 * options.cc (General_options::finalize): Add strip_debug_non_line
15365 to the strip heirarchy.
15366 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
15367 fields.
15368 * layout.cc: Include "reduced_debug_output.h".
15369 (Layout::Layout): Initialize new fields.
15370 (line_only_debug_sections): New static array.
15371 (is_lines_only_debug_sections): New static inline function.
15372 (Layout::include_section): Handle --strip-debug-non-line.
15373 (Layout::make_output_section): If --strip-debug-non-line, build
15374 new output sections for .debug_abbrev and .debug_info.
15375 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
15376 gold. Warn about possible overflow.
15377 (read_signed_LEB_128): Likewise.
15378 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
15379 (read_signed_LEB_128): Declare.
15380 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
15381 (HFILES): Add reduced_debug_output.h.
15382 * Makefile.in: Rebuild.
15383
7d9e3d98
ILT
153842008-05-21 Ian Lance Taylor <iant@google.com>
15385
15386 * mapfile.cc: New file.
15387 * mapfile.h: New file.
15388 * options.h (class General_options): Add -M/--print-map and -Map.
15389 * options.cc (General_options::finalize): Make -M equivalent to
15390 -Map -.
15391 * main.cc: Include <cstdio> and "mapfile.h".
15392 (main): Open mapfile if requested.
15393 * gold.cc (class Middle_runner): Add mapfile_ field. Update
15394 constructor. Change caller.
15395 (queue_initial_tasks): Add mapfile parameter. Change caller.
15396 (queue_middle_tasks): Likewise.
15397 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
15398 declarations.
15399 * archive.cc: Include "mapfile.h".
15400 (Archive::add_symbols): Add mapfile parameter. Change all
15401 callers. Pass mapfile, symbol, and reason to include_member.
15402 (Archive::include_all_members): Add mapfile parameter. Change all
15403 callers.
15404 (Archive::include_member): Add mapfile, sym, and why parameters.
15405 Change all callers. Report inclusion to map file.
15406 * archive.h: Include "fileread.h".
15407 (class Archive): Update declarations.
15408 (Archive::file): New const method.
15409 (class Add_archive_symbols): Add mapfile_ field. Update
15410 constructor. Change all callers.
15411 * readsyms.h (class Read_symbols): Likewise.
15412 (class Finish_group): Likewise.
15413 (class Read_script): Likewise.
15414 * common.cc: Include "mapfile.h".
15415 (Symbol_table::allocate_commons): Add mapfile parameter. Change
15416 all callers.
15417 (Symbol_table::do_allocate_commons): Likewise.
15418 (Symbol_table::do_allocate_commons_list): Likewise. Report common
15419 symbol allocation to mapfile.
15420 * common.h (class Allocate_commons_task): Add mapfile_ field.
15421 Update constructor. Change all callers.
15422 * symtab.h (class Symbol_table): Update declarations.
15423 * layout.cc: Include "mapfile.h".
15424 (Layout_task_runner::run): Print information to mapfile.
15425 (Layout::create_gold_note): Change Output_data_fixed_space to
15426 Output_data_zero_fill.
15427 (Layout::create_build_id): Likewise.
15428 (Layout::print_to_mapfile): New function.
15429 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
15430 constructor. Change caller.
15431 (class Layout): Declare print_to_mapfile.
15432 * output.cc (Output_section::Input_section::print_to_mapfile): New
15433 function.
15434 (Output_section::add_input_section): If producing a map, always
15435 add to input_sections_ list.
15436 (Output_section::do_print_to_mapfile): New function.
15437 (Output_segment::print_sections_to_mapfile): New function.
15438 (Output_segment::print_section_list_to_mapfile): New function.
15439 * output.h: Include "mapfile.h".
15440 (Output_data::print_to_mapfile): New function.
15441 (Output_data::do_print_to_mapfile): New virtual function.
15442 (Output_segment_headers::do_print_to_mapfile): New function.
15443 (Output_file_header::do_print_to_mapfile): New function.
15444 (Output_data_const::do_print_to_mapfile): New function.
15445 (class Output_data_const_buffer): Add map_name_ field. Update
15446 constructor. Change all callers. Add do_print_to_mapfile
15447 function.
15448 (class Output_data_fixed_space): Likewise.
15449 (class Output_data_space): Likewise.
15450 (class Output_data_zero_fill): New class.
15451 (Output_data_strtab::do_print_to_mapfile): New function.
15452 (Output_data_reloc_base::do_print_to_mapfile): New function.
15453 (Output_relocatable_relocs::do_print_to_mapfile): New function.
15454 (Output_data_group::do_print_to_mapfile): New function.
15455 (Output_data_got::do_print_to_mapfile): New function.
15456 (Output_data_dynamic::do_print_to_mapfile): New function.
15457 (Output_symtab_xindex::do_print_to_mapfile): New function.
15458 (class Output_section): Declare do_print_to_mapflie. Declare
15459 print_to_mapfile in Input_section.
15460 (class Output_segment): Declare new functions.
15461 * object.h (Sized_relobj::symbol_count): New function.
15462 * script-sections.cc
15463 (Output_section_element_dot_assignment::set_section_addresses):
15464 Change Output_data_fixed_space to Output_data_zero_fill.
15465 (Output_data_expression::do_print_to_mapfile): New function.
15466 * script.cc (read_input_script): Add mapfile parameter. Change
15467 all callers.
15468 * script.h (read_input_script): Update declaration.
15469 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
15470 (Eh_frame::do_print_to_mapfile): New function.
15471 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
15472 (Output_merge_string::do_print_to_mapfile): New function.
15473 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
15474 function.
15475 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
15476 function.
15477 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
15478 function.
15479 * Makefile.am (CCFILES): Add mapfile.cc.
15480 (HFILES): Add mapfile.h.
15481 * Makefile.in: Rebuild.
15482
9f1d377b
ILT
154832008-05-19 Ian Lance Taylor <iant@google.com>
15484
15485 * options.h (class General_options): Add -z relro.
15486 * layout.cc (Layout::Layout): Initialize relro_segment_.
15487 (Layout::add_output_section_data): Return the output section.
15488 (Layout::make_output_section): Rcognize relro sections and mark
15489 them appropriately.
15490 (Layout::attach_allocated_section_to_segment): Put relro sections
15491 in a PT_GNU_RELRO segment.
15492 (Layout::create_initial_dynamic_sections): Mark the .dynamic
15493 section as relro.
15494 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
15495 PT_TLS segments.
15496 (Layout::linkonce_mapping): Map d.rel.ro.local to
15497 .data.rel.ro.local.
15498 (Layout::output_section_name): Us .data.rel.ro.local for any
15499 section which begins with that.
15500 * layout.h (class Layout): Update add_output_section_data
15501 declaration. Add relro_segment_ field.
15502 * output.cc (Output_section::Output_section): Initialize is_relro_
15503 and is_relro_local_ fields.
15504 (Output_segment::add_output_section): Group relro sections.
15505 (Output_segment::is_first_section_relro): New function.
15506 (Output_segment::maximum_alignment): If there is a relro section,
15507 align the segment to the common page size.
15508 (Output_segment::set_section_addresses): Track whether we are
15509 looking at relro sections. If the last section is a relro
15510 section, align to the common page size.
15511 (Output_segment::set_section_list_addresses): Add in_relro
15512 parameter. Change all callers. Align to the page size when
15513 moving from relro to non-relro section.
15514 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
15515 segment.
15516 * output.h (class Output_section): Add is_relro_ and
15517 is_relro_local_ fields.
15518 (Output_section::is_relro): New function.
15519 (Output_section::set_is_relro): New function.
15520 (Output_section::is_relro_local): New function.
15521 (Output_section::set_is_relro_local): New function.
15522 (class Output_segment): Update declarations.
15523 * i386.cc (Target_i386::got_section): Mark .got section as relro.
15524 * sparc.cc (Target_sparc::got_section): Likewise.
15525 * x86_64.cc (Target_x86_64::got_section): Likewise.
15526 * testsuite/relro_test_main.cc: New file.
15527 * testsuite/relro_test.cc: New file.
15528 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
15529 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
15530 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
15531 (relro_test.so, relro_test_pic.o): New targets.
15532 * testsuite/Makefile.in: Rebuild.
15533
a984ee1d
ILT
155342008-05-16 Ian Lance Taylor <iant@google.com>
15535
01676dcd
ILT
15536 * output.cc (Output_segment::add_output_section): Remove front
15537 parameter.
15538 * output.h (class Output_segment): Remove
15539 add_initial_output_section and overloaded add_output_section.
15540 Update declaration of remaining add_output_section.
15541 * layout.cc (Layout::create_interp): Call add_output_section
15542 rather than add_initial_output_section.
15543 (Layout::finish_dynamic_section): Likewise.
15544
497897f9
ILT
15545 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
15546 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
15547 know the dynamic type.
15548 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
15549 field. Initialize it in constructor.
15550 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
15551 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
15552 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
15553 reloc.
15554
a984ee1d
ILT
15555 * output.cc (Output_reloc::get_address): Change return type to
15556 Elf_Addr.
15557 * output.h (class Output_reloc): Update get_address declaration.
15558 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
15559 for section addresses.
15560
55ba0940
ILT
155612008-05-09 Ian Lance Taylor <iant@google.com>
15562
15563 PR 6493
15564 * gold.cc (gold_nomem): Use return value of write.
15565
75517b77
ILT
155662008-05-08 Ian Lance Taylor <iant@google.com>
15567
15568 * symtab.c (Symbol::init_base_output_data): Add version
15569 parameter. Change all callers.
15570 (Symbol::init_base_output_segment): Likewise.
15571 (Symbol::init_base_constant): Likewise.
15572 (Symbol::init_base_undefined): Likewise.
15573 (Sized_symbol::init_output_data): Likewise.
15574 (Sized_symbol::init_output_segment): Likewise.
15575 (Sized_symbol::init_constant): Likewise.
15576 (Sized_symbol::init_undefined): Likewise.
15577 (Symbol_table::do_define_in_output_data): If the new symbol has a
15578 version, mark it as the default.
15579 (Symbol_table::do_define_in_output_segment): Likewise.
15580 (Symbol_table::do_define_as_constant): Likewise.
15581 * symtab.h (class Symbol): Update declarations.
15582 (class Sized_symbol): Likewise.
15583 * resolve.cc (Symbol::override_version): New function.
c42e122e 15584 (Symbol::override_base): Call override_version.
75517b77
ILT
15585 (Symbol::override_base_with_special): Likewise.
15586 * testsuite/ver_script_8.script: New file.
15587 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
15588 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
15589 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
15590 (ver_test_8_1.so, ver_test_8_2.so): New targets.
15591
f1f70eae
ILT
155922008-05-06 Ian Lance Taylor <iant@google.com>
15593
f3e9c5c5
ILT
15594 PR 6049
15595 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
15596 functions.
15597 (class General_options): Remove existing --undefined, and add
15598 --no-undefined instead. Add new --undefined as synonym for -u.
15599 * archive.cc (Archive::add_symbols): Check whether symbol was
15600 named with -u.
15601 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
15602 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
15603 all uses. Add IS_UNDEFINED. Update declarations to split
15604 different versions of init_base. Declare init_base_undefined.
15605 (Symbol::is_defined): Handle IS_UNDEFINED.
15606 (Symbol::is_undefined): Likewise.
15607 (Symbol::is_weak_undefined): Call is_undefined.
15608 (Symbol::is_absolute): Handle IS_CONSTANT.
15609 (class Sized_symbol): Update declarations to split different
15610 versions of init. Declare init_undefined.
15611 (class Symbol_table): Declare new functions.
15612 * symtab.cc (Symbol::init_base_object): Rename from init_base.
15613 Change all callers.
15614 (Symbol::init_base_output_data): Likewise.
15615 (Symbol::init_base_output_segment): Likewise.
15616 (Symbol::init_base_constant): Likewise.
15617 (Symbol::init_base_undefined): New function.
15618 (Sized_symbol::init_object): Rename from init. Change all
15619 callers.
15620 (Sized_symbol::init_output_data): Likewise.
15621 (Sized_symbol::init_output_segment): Likewise.
15622 (Sized_symbol::init_constant): Likewise.
15623 (Sized_symbol::init_undefined): New function.
15624 (Symbol_table::add_undefined_symbols_from_command_line): New
15625 function.
15626 (Symbol_table::do_add_undefined_symbols_from_command_line): New
15627 function.
15628 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
15629 (Symbol::output_section): Likewise.
15630 (Symbol::set_output_section): Likewise.
15631 (Symbol_table::sized_finalize_symbol): Likewise.
15632 (Symbol_table::sized_write_globals): Likewise.
15633 * resolve.cc (Symbol_table::should_override): Likewise.
15634 (Symbol::override_base_with_special): Likewise.
15635
8bdcdf2c
ILT
15636 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
15637 symbol, change it to have default visibility.
15638 * testsuite/protected_1.cc: New file.
15639 * testsuite/protected_2.cc: New file.
15640 * testsuite/protected_3.cc: New file.
15641 * testsuite/protected_main_1.cc: New file.
15642 * testsuite/protected_main_2.cc: New file.
15643 * testsuite/protected_main_3.cc: New file.
15644 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
15645 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
15646 (protected_1_LDFLAGS, protected_1_LDADD): Define.
15647 (protected_1.so): New target.
15648 (protected_1_pic.o, protected_2_pic.o): New targets.
15649 (protected_3_pic.o): New target.
15650 (check_PROGRAMS): Add protected_2.
15651 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
15652 (protected_2_LDFLAGS, protected_2_LDADD): Define.
15653 * testsuite/Makefile.in: Rebuild.
15654
2b706932
ILT
15655 * options.h (DEFINE_var): Add set_user_set_##varname__.
15656 (DEFINE_bool_alias): New macro.
15657 (class General_options): Define -Bstatic using DEFINE_bool_alias
15658 rather than DEFINE_special. Add --undefined as an alias for -z
15659 defs.
15660 * options.cc (General_options::parse_Bstatic): Remove.
15661
d82a5bcc
ILT
15662 * options.h (class General_options): Add --fatal-warnings.
15663 * main.cc (main): Implement --fatal-warnings.
15664 * errors.h (Errors::warning_count): New function.
15665
f1f70eae
ILT
15666 * options.h (class General_options): Add -Bsymbolic-functions.
15667 * symtab.h (Symbol::is_preemptible): Check for
15668 -Bsymbolic-functions.
15669
8825ac63
ILT
156702008-05-05 Ian Lance Taylor <iant@google.com>
15671
d98bc257
ILT
15672 * options.h (DEFINE_bool): For DASH_Z, create the negative option
15673 as noVARNAME rather than no-VARNAME.
15674 (class General_options): Add option -z combreloc.
15675 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
15676 get_address.
15677 (Output_reloc::sort_before) [SHT_REL]: New function.
15678 (Output_reloc::sort_before) [SHT_RELA]: New function.
15679 (class Output_data_reloc_base): Add sort_relocs_ field. Define
15680 Sort_relocs_comparison.
15681 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
15682 parameter. Change all callers.
15683 (Output_data_reloc::Output_data_reloc) [both versions]: Add
15684 sort_relocs parameter. Change all callers.
15685 * output.cc (Output_reloc::get_address): New function, broken out
15686 of write_rel.
15687 (Output_reloc::write_rel): Call it.
15688 (Output_reloc::compare): New function.
15689 (Output_data_reloc_base::do_write): Optionally sort relocs.
15690
60b2b4e7
ILT
15691 * configure.ac: If targ_extra_obj is set, link it in.
15692 * configure.tgt: Initialize all variables.
15693 (x86_64*): Set targ_extra_obj and targ_extra_size.
15694 * configure: Rebuild.
15695
8825ac63
ILT
15696 * object.cc (Sized_relobj::include_section_group): Adjust section
15697 indexes read from group data. Build vector to pass to
15698 layout_group.
15699 * layout.cc (Layout::layout_group): Add flags and shndxes
15700 parameters. Remove contents parameter. Change caller. Update
15701 explicit instantiations.
15702 * layout.h (class Layout): Update layout_group declaration.
15703 * output.cc (Output_data_group::Output_data_group): Add flags and
15704 input_shndxes parameters. Remove contents parameter. Change
15705 caller.
15706 (Output_data_group::do_write): Change input_sections_ to
15707 input_shndxes_.
15708 * output.h (class Output_data_group): Update constructor
15709 declaration. Rename input_sections_ to input_shndxes_.
15710 * testsuite/many_sections_test.cc: Add template.
15711
e94cf127
CC
157122008-04-30 Cary Coutant <ccoutant@google.com>
15713
4418b2d5
CC
15714 * target-reloc.h (relocate_section): Fix dead-pointer bug.
15715
e94cf127
CC
15716 * layout.cc (Layout::include_section): Refactored check for debug
15717 info section.
15718 (Layout::add_comdat): Add new parameters. Change type
15719 of signature parameter. Add object and shndx to signatures table.
15720 (Layout::find_kept_object): New function.
15721 * layout.h: Include <cstring>.
15722 (Layout::is_debug_info_section): New function.
15723 (Layout::add_comdat): Add new parameters.
15724 (Layout::find_kept_object): New function.
15725 (Layout::Kept_section): New struct.
15726 (Layout::Signatures): Change type of map range.
15727 * object.cc (Relobj::output_section_address): New function.
15728 (Sized_relobj::include_section_group): Add new parameters. Change
15729 calls to Layout::add_comdat. Change to build table of kept comdat
15730 groups and table mapping discarded sections to kept sections.
15731 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
15732 (Sized_relobj::do_layout): Change calls to include_section_group and
15733 include_linkonce_section.
15734 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
15735 value to zero when section is discarded.
15736 (Sized_relobj::map_to_kept_section): New function.
15737 * object.h (Relobj::output_section_address): New function.
15738 (Relobj::Comdat_group): New type.
15739 (Relobj::find_comdat_group): New function.
15740 (Relobj::Comdat_group_table): New type.
15741 (Relobj::Kept_comdat_section): New type.
15742 (Relobj::Kept_comdat_section_table): New type.
15743 (Relobj::add_comdat_group): New function.
15744 (Relobj::set_kept_comdat_section): New function.
15745 (Relobj::get_kept_comdat_section): New function.
15746 (Relobj::comdat_groups_): New field.
15747 (Relobj::kept_comdat_sections_): New field.
15748 (Symbol_value::input_value): Update comment.
15749 (Sized_relobj::map_to_kept_section) New function.
15750 (Sized_relobj::include_linkonce_section): Add new parameter.
15751 * target-reloc.h (Comdat_behavior): New type.
15752 (get_comdat_behavior): New function.
15753 (relocate_section): Add code to map a discarded section to the
15754 corresponding kept section when applying a relocation.
15755
e4e5049b
CS
157562008-04-30 Craig Silverstein <csilvers@google.com>
15757
15758 * dwarf_reader.cc (next_generation_count): New static var.
15759 (Addr2line_cache_entry): New struct.
15760 (addr2line_cache): New static var.
15761 (Dwarf_line_info::one_addr2line): Added caching.
15762 (Dwarf_line_info::clear_addr2line_cache): New function.
15763 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
15764 cache-size parameter.
15765 (Dwarf_line_info::one_addr2line_cache): New function.
15766 * symtab.cc (Symbol_table::detect_odr_violations): Pass
15767 new cache-size argument to one_addr2line(), and clear cache.
15768
d09e9154
CC
157692008-04-28 Cary Coutant <ccoutant@google.com>
15770
15771 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
15772 R_386_PC8 relocations.
15773
7ef73768
ILT
157742008-04-23 Ian Lance Taylor <iant@google.com>
15775
55438702
ILT
15776 * object.cc (Sized_relobj::include_section_group): Check for
15777 invalid section group.
15778
c165fb93
ILT
15779 * object.cc (make_elf_object): Correct test for 64-bit ELF file
15780 header size.
15781
7ef73768
ILT
15782 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
15783 than read for file header.
15784 * archive.cc (Archive::include_member): Likewise.
15785
6194aaab
L
157862008-04-23 Paolo Bonzini <bonzini@gnu.org>
15787
15788 * aclocal.m4: Regenerate.
15789 * configure: Regenerate.
15790
d491d34e
ILT
157912008-04-19 Ian Lance Taylor <iant@google.com>
15792
5ea2bac6
ILT
15793 * version.cc (version_string): Bump to 1.6.
15794
7bc3e21a
ILT
15795 * testsuite/Makefile.am (many_sections_r_test): New target.
15796 (many_sections_r_test_SOURCES): Remove.
15797 (many_sections_r_test_DEPENDENCIES): Remove.
15798 (many_sections_r_test_LDFLAGS): Remove.
15799 (many_sections_r_test_LDADD): Remove.
15800
7fcd3aa9
ILT
15801 * object.cc (Sized_relobj::do_add_symbols): Always pass
15802 local_symbol_count_ to add_from_relobj.
15803
4c94d6ae
ILT
15804 * testsuite/Makefile.am (many_sections_check.h): Only check one in
15805 every thousand variables.
15806 * testsuite/Makefile.in: Rebuild.
15807
d491d34e
ILT
15808 * object.cc (Xindex::initialize_symtab_xindex): New function.
15809 (Xindex::read_symtab_xindex): New function.
15810 (Xindex::sym_xindex_to_shndx): New function.
15811 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
15812 available.
15813 (Sized_relobj::do_initialize_xindex): New function.
15814 (Sized_relobj::do_read_symbols): Adjust section links.
15815 (Sized_relobj::symbol_section_and_value): Add is_ordinary
15816 parameter. Change all callers.
15817 (Sized_relobj::include_section_group): Adjust section links and
15818 symbol section indexes.
15819 (Sized_relobj::do_layout): Adjust section links.
15820 (Sized_relobj::do_count_local_symbols): Adjust section links and
15821 symbol section indexes.
15822 (Sized_relobj::do_finalize_local_symbols): Distinguish between
15823 ordinary and special symbols.
15824 (Sized_relobj::write_local_symbols): Add symtab_xindex and
15825 dynsym_xindex parameters. Change all callers. Adjust section
15826 links. Use SHN_XINDEX when needed.
15827 (Sized_relobj::get_symbol_location_info): Adjust section links.
15828 Don't get fooled by special symbols.
15829 * object.h (class Xindex): Define.
15830 (class Object): Add xindex_ parameter. Declare virtual functoin
15831 do_initialize_xindex.
15832 (Object::adjust_sym_shndx): New function.
15833 (Object::set_xindex): New protected function.
15834 (class Symbol_value): Add is_ordinary_shndx_ field.
15835 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
15836 (Symbol_value::value): Assert ordinary section.
15837 (Symbol_value::initialize_input_to_output_map): Likewise.
15838 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
15839 Change all callers.
15840 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
15841 all callers.
15842 (class Sized_relobj): Update declarations.
15843 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
15844 parameter. Change all callers.
15845 (Sized_relobj::adjust_shndx): New function.
15846 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
15847 field.
15848 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
15849 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
15850 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
15851 (Sized_dynobj::read_dynsym_section): Adjust section links.
15852 (Sized_dynobj::read_dynamic): Likewise.
15853 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
15854 section links.
15855 (Sized_dynobj::do_initialize_xindex): New function.
15856 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
15857 do_initialize_xindex.
15858 (Sized_dynobj::adjust_shndx): New function.
15859 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
15860 dynsym_xindex_ fields.
15861 (Layout::finalize): Add a call to set_section_indexes before
15862 creating the symtab sections.
15863 (Layout::set_section_indexes): Don't do anything if the section
15864 already has a section index.
15865 (Layout::create_symtab_sections): Add shnum parameter. Change
15866 caller. Create .symtab_shndx section if needed.
15867 (Layout::create_shdrs): Add shstrtab_section parameter. Change
15868 caller.
15869 (Layout::allocated_output_section_count): New function.
15870 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
15871 needed.
15872 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
15873 fields. Update declarations.
15874 (Layout::symtab_xindex): New function.
15875 (Layout::dynsym_xindex): New function.
15876 (class Write_symbols_task): Add layout_ field.
15877 (Write_symbols_task::Write_symbols_task): Add layout parameter.
15878 Change caller.
15879 * output.cc (Output_section_headers::Output_section_headers): Add
15880 shstrtab_section parameter. Change all callers.
15881 (Output_section_headers::do_sized_write): Store overflow values
15882 for section count and section string table section index in
15883 section header zero.
15884 (Output_file_header::do_sized_write): Check for overflow of
15885 section count and section string table section index.
15886 (Output_symtab_xindex::do_write): New function.
15887 (Output_symtab_xindex::endian_do_write): New function.
15888 * output.h (class Output_section_headers): Add shstrtab_section_.
15889 Update declarations.
15890 (class Output_symtab_xindex): Define.
15891 (Output_section::has_out_shndx): New function.
15892 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
15893 field.
15894 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
15895 Change all callers.
15896 (Sized_symbol::init): Likewise.
15897 (Symbol::output_section): Check for ordinary symbol.
15898 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
15899 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
15900 callers.
15901 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
15902 Change all callers. Simplify handling of symbols from sections
15903 not included in the link.
15904 (Symbol_table::add_from_dynobj): Handle ordinary symbol
15905 distinction.
15906 (Weak_alias_sorter::operator()): Assert that symbols are
15907 ordinary.
15908 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
15909 distinction.
15910 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
15911 parameters. Change all callers.
15912 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
15913 symbol distinction. Use SHN_XINDEX when needed.
15914 (Symbol_table::write_section_symbol): Add symtab_xindex
15915 parameter. Change all callers.
15916 (Symbol_table::sized_write_section_symbol): Likewise. Use
15917 SHN_XINDEX when needed.
15918 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
15919 declarations.
15920 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
15921 (Symbol::is_defined): Check is_ordinary.
15922 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
15923 (Symbol::is_absolute, Symbol::is_common): Likewise.
15924 (class Sized_symbol): Update declarations.
15925 (class Symbol_table): Update declarations.
15926 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
15927 parameters. Change all callers.
15928 (Sized_symbol::override): Likewise.
15929 (Symbol_table::override): Likewise.
15930 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
15931 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
15932 is_ordinary, and orig_st_shndx parameters. Change all callers.
15933 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
15934 to be in an ordinary section.
15935 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
15936 object and is_ordinary parameters. Change all callers.
15937 (Sized_dwarf_line_info::read_relocs): Add object parameter.
15938 Change all callers. Don't add undefined or non-ordinary symbols
15939 to reloc_map_.
15940 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
15941 Change all callers.
15942 * dwarf_reader.h (class Sized_dwarf_line_info): Update
15943 declarations.
15944 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
15945 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
15946 (Sized_relobj::relocate_sections): Likewise.
15947 * target-reloc.h (scan_relocs): Adjust section symbol index.
15948 (scan_relocatable_relocs): Likewise.
15949 * i386.cc (Scan::local): Check for ordinary symbols.
15950 * sparc.cc (Scan::local): Likewise.
15951 * x86_64.cc (Scan::local): Likewise.
15952 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
15953 to symbol_section_and_value.
15954 * testsuite/many_sections_test.cc: New file.
15955 * testsuite/Makefile.am (BUILT_SOURCES): Define.
15956 (check_PROGRAMS): Add many_sections_test.
15957 (many_sections_test_SOURCES): Define.
15958 (many_sections_test_DEPENDENCIES): Define.
15959 (many_sections_test_LDFLAGS): Define.
15960 (BUILT_SOURCES): Add many_sections_define.h.
15961 (many_sections_define.h): New target.
15962 (BUILT_SOURCES): Add many_sections_check.h.
15963 (many_sections_check.h): New target.
15964 (check_PROGRAMS): Add many_sections_r_test.
15965 (many_sections_r_test_SOURCES): Define.
15966 (many_sections_r_test_DEPENDENCIES): Define.
15967 (many_sections_r_test_LDFLAGS): Define.
15968 (many_sections_r_test_LDADD): Define.
15969 (many_sections_r_test.o): New target.
15970 * testsuite/Makefile.in: Rebuild.
15971
c5818ff1
CC
159722008-04-17 Cary Coutant <ccoutant@google.com>
15973
15974 * errors.cc (Errors::info): New function.
15975 (gold_info): New function.
15976 * errors.h (Errors::info): New function.
15977 * gold.h (gold_info): New function.
15978 * object.cc (Input_objects::add_object): Print trace output.
15979 * options.cc (options::parse_set): New function.
15980 (General_options::parse_wrap): Deleted.
15981 (General_options::General_options): Deleted initializer.
15982 * options.h (options::String_set): New typedef.
15983 (options::parse_set): New function.
15984 (DEFINE_set): New macro.
15985 (General_options::wrap): Changed to use DEFINE_set. Changed
15986 callers of any_wrap_symbols and is_wrap_symbol.
15987 (General_options::trace, General_options::trace_symbol):
15988 New options.
15989 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
15990 (General_options::wrap_symbols_): Deleted.
15991 * symtab.cc (Symbol_table::add_from_object): Print trace output.
15992
b5be4a7c
DM
159932008-04-17 David S. Miller <davem@davemloft.net>
15994
15995 * options.cc (General_options::parse_V): New function.
15996 * options.h: Add entries for -V and -Qy.
15997
155a0dd7
ILT
159982008-04-17 Ian Lance Taylor <iant@google.com>
15999
16000 * common.cc (Symbol_table::allocate_commons): Remove options
16001 parameter. Change caller.
16002 (Symbol_table::do_allocate_commons): Remove options parameter.
16003 Change caller. Just call do_allocate_commons_list twice.
16004 (Symbol_table::do_allocate_commons_list): New function, broken out
16005 of do_allocate_commons.
16006 * common.h (class Allocate_commons_task): Remove options_ field.
16007 Update constructor.
16008 * symtab.cc (Symbol_table::Symbol_table): Initialize
16009 tls_commons_.
16010 (Symbol_table::add_from_object): Put TLS common symbols on
16011 tls_commons_ list.
16012 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
16013 which are IN_OUTPUT_DATA.
16014 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
16015 allocate_commons and do_allocate_commons declarations. Declare
16016 do_allocate_commons_list.
16017 * gold.cc (queue_middle_tasks): Update creation of
16018 Allocate_commons_task to not pass options.
16019 * testsuite/Makefile.am (INCLUDES): Add -I.. .
16020 (TLS_TEST_C_FLAGS): New variable.
16021 (tls_test_c_pic.o): New target.
16022 (tls_test_shared.so): Link in tls_test_c_pic.o.
16023 (tls_test_c_pic_ie.o): New target.
16024 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
16025 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
16026 (tls_test_c.o): New target.
16027 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
16028 (tls_pic_test_LDADD): Likewise.
16029 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
16030 (tls_shared_gd_to_ie_test_LDADD): Likewise.
16031 (tls_test_c_gnu2.o): New target.
16032 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
16033 tls_test_c_gnu2.o.
16034 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
16035 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
16036 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
16037 * testsuite/tls_test.cc: Include "config.h".
16038 (t_last): Call t11_last.
16039 * testsuite/tls_test.h (t11, t11_last): Declare.
16040 * testsuite/tls_test_c.c: New file.
16041 * testsuite/tls_test_main.cc (thread_routine): Call t11.
16042 * configure.ac: Check for OpenMP support.
16043 * configure, config.in, Makefile.in: Rebuild.
16044 * testsuite/Makefile.in: Rebuild.
16045
edfbb029
CC
160462008-04-16 Cary Coutant <ccoutant@google.com>
16047
16048 * i386.cc (Target_i386::define_tls_base_symbol): New function.
16049 (Target_i386::tls_base_symbol_defined_): New field.
16050 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16051 (Target_i386::Scan::global): Likewise.
16052 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
16053 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
16054 (Target_x86_64::tls_base_symbol_defined_): New field.
16055 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16056 (Target_x86_64::Scan::global): Likewise.
16057
f3c69fca
CC
160582008-04-16 Cary Coutant <ccoutant@google.com>
16059
16060 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
16061 (Symbol::needs_plt_entry): Allow weak undefined symbols.
16062 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
16063 building shared libraries.
16064 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
16065 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
16066 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
16067 * testsuite/Makefile.in: Rebuild.
16068 * testsuite/weak_undef.h: New file.
16069 * testsuite/weak_undef_file1.cc: Add extra test cases.
16070 * testsuite/weak_undef_file2.cc: Likewise.
16071 * testsuite/weak_undef_test.cc: Likewise.
16072
7c414435
DM
160732008-04-16 David S. Miller <davem@davemloft.net>
16074
32b769e1
DM
16075 * sparc.cc (Target_sparc::Scan): Change from struct to class.
16076 Add issued_non_pic_error_ field. Declare check_non_pic.
16077 (Target_sparc::Scan::check_non_pic): New function.
16078 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
16079 (Target_sparc::Scan::global): Likewise.
16080
11936fb1
DM
16081 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
16082 * configure: Rebuild.
16083
7c414435
DM
16084 * options.h (DEFINE_enable): New macro.
16085 (new_dtags): New enable option.
16086 (initfirst, interpose, loadfltr, nodefaultlib,
16087 nodelete, nodlopen, nodump): New -z options.
16088 * layout.cc (Layout:finish_dynamic_section): If new
16089 dtags enabled, emit DT_RUNPATH. Also, emit a
16090 DT_FLAGS_1 containing any specified -z flags.
16091
85c7bf8b
ILT
160922008-04-16 Ian Lance Taylor <iant@google.com>
16093
12c0daef
ILT
16094 * copy-relocs.cc: New file.
16095 * copy-relocs.h: New file.
16096 * reloc.cc: Remove Copy_relocs code.
16097 * reloc.h: Likewise.
16098 * reloc-types.h (struct Reloc_types) [both versions]: Add
16099 get_reloc_addend_noerror.
16100 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
16101 variants of add_global which take an addend which must be zero.
16102 * i386.cc: Include "copy-relocs.h".
16103 (class Target_i386): Change type of copy_relocs_ to variable,
16104 update initializer.
16105 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
16106 Change all callers.
16107 (Target_i386::do_finalize_sections): Change handling of
16108 copy_relocs_.
16109 * sparc.cc: Include "copy-relocs.h".
16110 (class Target_sparc): Change type of copy_relocs_ to variable,
16111 update initializer.
16112 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
16113 Change all callers.
16114 (Target_sparc::do_finalize_sections): Change handling of
16115 copy_relocs_.
16116 * x86_64.cc: Include "copy-relocs.h".
16117 (class Target_x86_64): Change type of copy_relocs_ to variable,
16118 update initializer.
16119 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
16120 class. Change all callers.
16121 (Target_x86_64::do_finalize_sections): Change handling of
16122 copy_relocs_.
16123 * Makefile.am (CCFILES): Add copy-relocs.cc.
16124 (HFILES): Add copy-relocs.h.
16125
4f4995b6
ILT
16126 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
16127
85c7bf8b
ILT
16128 * testsuite/script_test_4.sh: Permit leading zeroes.
16129
4f2a9edd
ILT
161302008-04-15 Ian Lance Taylor <iant@google.com>
16131
e6188289
ILT
16132 * script-sections.cc (Script_sections::create_segments): Use
16133 header_size_adjustment even when there is enough room for the
16134 headers.
16135 * testsuite/script_test_4.sh: New file.
16136 * testsuite/script_test_4.t: New file.
16137 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
16138 (check_DATA): Add script_test_4.stdout.
16139 (MOSTLYCLEANFILES): Likewise.
16140 (script_test_4): New target.
16141 (script_test_4.stdout): New target.
16142 * testsuite/Makefile.in: Rebuild.
16143
4f2a9edd
ILT
16144 * sparc.cc: Add definitions for Output_data_plt_sparc class
16145 constants.
16146
f5314dd5
DM
161472008-04-14 David S. Miller <davem@davemloft.net>
16148
16149 * sparc.cc: New file.
16150 * Makefile.am (TARGETSOURCES): Add sparc.cc
16151 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
16152 * configure.tgt: Document targ_extra_size and
16153 targ_extra_big_endian. Add entries for sparc-* and
16154 sparc64-*.
16155 * configure.ac: Handle targ_extra_size and
16156 targ_extra_big_endian.
16157 * Makefile.in: Rebuild.
16158 * configure: Likewise.
16159 * po/POTFILES.in: Likewise.
16160 * po/gold.pot: Likewise.
16161
154e0e9a
ILT
161622008-04-14 Ian Lance Taylor <iant@google.com>
16163
16164 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
16165 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
16166 in the name/type/flags to section mapping. Don't call
16167 allocate_output_section.
16168 (Layout::choose_output_section): Change parameter from adjust_name
16169 to is_input_section. Don't permit input sections after sections
16170 are attached to segments. Don't call allocate_output_section.
16171 (Layout::layout_eh_frame): Call update_flags_for_input_section,
16172 not write_enable_output_section.
16173 (Layout::make_output_section): Don't push to
16174 unattached_section_list_ nor call attach_to_segment. Call
16175 attach_section_to_segment if sections are attached.
16176 (Layout::attach_sections_to_segments): New function.
16177 (Layout::attach_section_to_segment): New function.
16178 (Layout::attach_allocated_section_to_segment): Rename from
16179 attach_to_segment. Remove flags parameter.
16180 (Layout::allocate_output_section): Remove function.
16181 (Layout::write_enable_output_section): Remove function.
16182 * layout.h (class Layout): Update for above changes. Add new
16183 field sections_are_attached_.
16184 * output.h (Output_section::update_flags_for_input_section): New
16185 function.
16186 * output.cc (Output_section::add_input_section): Call
16187 update_flags_for_input_section.
16188 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
16189
009a67a2
CC
161902008-04-11 Cary Coutant <ccoutant@google.com>
16191
16192 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
16193 thought unnecessary.
16194 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
16195
759b1a24
ILT
161962008-04-11 Ian Lance Taylor <iant@google.com>
16197
16198 * output.h (class Output_section_data): Remove inline definition
16199 of set_addralign.
16200 * output.cc (Output_section_data::set_addralign): New function.
16201
c2b45e22
CC
162022008-04-11 Cary Coutant <ccoutant@google.com>
16203
16204 Add support for TLS descriptors for i386 and x86_64.
16205 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
16206 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
16207 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
16208 GOT_TYPE_TLS_DESC.
16209 (Target_i386::got_mod_index_entry): Remove unnecessary code.
16210 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
16211 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
16212 relocations.
16213 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
16214 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
16215 Fix problem with initial-exec relocations.
16216 (Target_i386::Relocate::relocate_tls): Likewise.
16217 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
16218 relaxation.
16219 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
16220 support for section-plus-offset dynamic table entries.
16221 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
16222 (Output_data_dynamic::Dynamic_entry): Add support for
16223 section-plus-offset dynamic table entries.
16224 (Output_data_dynamic::Classification): Likewise.
16225 (Output_data_dynamic::classification_): Renamed offset_.
16226 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
16227 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
16228 (Target_x86_64::make_plt_section): New function.
16229 (Target_x86_64::reserve_tlsdesc_entries): New function.
16230 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
16231 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
16232 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
16233 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
16234 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
16235 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
16236 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
16237 add extra PLT entry for TLS descriptors.
16238 (Output_data_plt_x86_64::got_): New field.
16239 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
16240 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
16241 fields.
16242 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
16243 descriptors.
16244 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
16245 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
16246 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
16247 R_386_TLS_DESC_CALL relocations.
16248 (Target_x86_64::Scan::global): Likewise.
16249 (Target_x86_64::do_finalize_sections): Add dynamic table entries
16250 for TLS descriptors.
16251 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
16252 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
16253 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
16254 GD-to-IE relaxation.
16255 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
16256 and TLS_DESCRIPTORS.
16257 * Makefile.in: Rebuild.
16258 * configure: Rebuild.
16259 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
16260 (tls_test_shared2.so): New target.
16261 (tls_shared_gd_to_ie_test_SOURCES): New variable.
16262 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
16263 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
16264 (tls_shared_gd_to_ie_test_LDADD): New variable.
16265 (tls_shared_gnu2_gd_to_ie_test): New target.
16266 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
16267 New targets.
16268 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
16269 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
16270 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
16271 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
16272 (tls_shared_gnu2_test): New target.
16273 (tls_test_gnu2_shared.so): New target.
16274 (tls_shared_gnu2_test_SOURCES): New variable.
16275 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
16276 (tls_shared_gnu2_test_LDFLAGS): New variable.
16277 (tls_shared_gnu2_test_LDADD): New variable.
16278 * testsuite/Makefile.in: Rebuild.
16279 * testsuite/Makefile.
16280
83bfb6b7
ILT
162812008-04-11 Ian Lance Taylor <iant@google.com>
16282
16283 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
16284 justsyms.t.
16285 * testsuite/Makefile.in: Rebuild.
16286
16287 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
16288 long.
16289 * testsuite/script_test_2.cc (main): Adjust test.
16290
706e1f5e
ILT
162912008-04-11 David S. Miller <davem@davemloft.net>
16292 Ian Lance Taylor <iant@google.com>
16293
16294 * options.h (General_options): Add entries for '-Y' and
16295 '-relax'.
16296 * options.cc (General_options:finalize): If -Y was used, add those
16297 entries to the library path instead of the default "/lib" and
16298 "/usr/lib".
16299
7c98e6bb
DM
163002008-04-11 David S. Miller <davem@davemloft.net>
16301
16302 * testsuite/justsyms.t: Start at 0x100.
16303 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
16304 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
16305 long.
16306 * testsuite/script_test_2.cc: Adjust string and section length
16307 checks.
7c98e6bb 16308
99a37bfd
ILT
163092008-04-09 Ian Lance Taylor <iant@google.com>
16310
2cefc357
ILT
16311 PR gold/5996
16312 * script-sections.cc (Sections_element::allocate_to_segment): Add
16313 orphan parameter.
16314 (Output_section_definition::allocate_to_segment): Likewise.
16315 (Orphan_output_section::allocate_to_segment): Likewise.
16316 (Script_sections::attach_sections_using_phdrs_clause): Don't
16317 propagate non-PT_LOAD segments to orphan sections.
16318 * testsuite/Makefile.am (script_test_3.stdout): Generate using
16319 readelf rather than objdump.
16320 * testsuite/script_test_3.sh: Adjust accordingly. Test that
16321 .interp section and PT_INTERP segment are the same size.
16322 * testsuite/Makefile.in: Rebuild.
16323
99a37bfd
ILT
16324 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
16325 aliases for symbols defined in the same object.
16326 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
16327 (weak_alias_test_SOURCES): New variable.
16328 (weak_alias_test_DEPENDENCIES): New variable.
16329 (weak_alias_test_LDFLAGS): New variable.
16330 (weak_alias_test_LDADD): New variable.
16331 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
16332 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
16333 (weak_alias_test_3.o): New target.
16334 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
16335 * testsuite/weak_alias_test_main.cc: New file.
16336 * testsuite/weak_alias_test_1.cc: New file.
16337 * testsuite/weak_alias_test_2.cc: New file.
16338 * testsuite/weak_alias_test_3.cc: New file.
16339
780e49c5
ILT
163402008-04-08 Ian Lance Taylor <iant@google.com>
16341
cdb0b8f5
ILT
16342 * options.h (class General_options): Add --noinhibit-exec option.
16343 * main.cc (main): Check --noinhibit-exec.
16344
0864d551
ILT
16345 * options.h (class General_options): Define --wrap as a special
16346 option. Add wrap_symbols_ field.
16347 (General_options::any_wrap_symbols): New function.
16348 (General_options::is_wrap_symbol): New function.
16349 * options.cc (General_options::parse_wrap): New function.
16350 (General_options::General_options): Initialize wrap_symbols_.
16351 * symtab.cc (Symbol_table::wrap_symbol): New function.
16352 (Symbol_table::add_from_object): Handle --wrap.
16353 * symtab.h (class Symbol_table): Declare wrap_symbol.
16354 * target.h (Target::wrap_char): New function.
16355 (Target::Target_info): Add wrap_char field.
16356 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
16357 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
16358 * testsuite/testfile.cc (Target_test::test_target_info):
16359 Likewise.
16360
789aa6de
ILT
16361 * errors.cc (Errors::undefined_symbol): Mention symbol version if
16362 there is one.
16363
2c38906f
ILT
16364 * layout.h (class Layout): Add added_eh_frame_data_ field.
16365 * layout.cc (Layout::Layout): Initialize new field.
16366 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
16367 output section until we find a section we merged successfully.
16368 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
16369 that the size be non-zero.
16370
780e49c5
ILT
16371 * merge.cc (Object_merge_map::get_output_offset): Remove inline
16372 qualifier.
16373
7fcd0256
ILT
163742008-04-08 Craig Silverstein <csilvers@google.com>
16375
16376 * configure.ac: Export new conditional variable HAVE_ZLIB.
16377 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
16378 on HAVE_ZLIB.
16379 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
16380 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16381
6835af53
ILT
163822008-04-07 Ian Lance Taylor <iant@google.com>
16383
e24f324c
ILT
16384 * version.cc (version_string): Set to "1.5".
16385
a036edd8
ILT
16386 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
16387 Add issued_non_pic_error_ field. Declare check_non_pic.
16388 (Target_x86_64::Scan::check_non_pic): New function.
16389 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
16390 (Target_x86_64::Scan::global): Likewise.
16391
624f8810
ILT
16392 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
16393 addend parameter. Change caller. Handle merge sections.
16394 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
16395 Address to Addend. Don't add in the result of
16396 local_section_offset, pass down the addend and use the returned
16397 value.
16398 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
16399 Update declarations of local_section_offset and symbol_value.
16400 * testsuite/two_file_test_1.cc (t18): New function.
16401 * testsuite/two_file_test_2.cc (f18): New function.
16402 * testsuite/two_file_test_main.cc (main): Call t18.
16403 * testsuite/two_file_test.h (t18, f18): Declare.
16404
6835af53
ILT
16405 * configure.ac: Don't test for objdump, c++filt, or readelf.
16406 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
16407 conditionals.
16408 (TEST_READELF): New variable.
16409 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
16410 (check_PROGRAMS): Add two_file_strip_test.
16411 (two_file_strip_test): New target.
16412 (check_PROGRAMS): Add two_file_same_shared_strip_test.
16413 (two_file_same_shared_strip_test_SOURCES): New variable.
16414 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
16415 (two_file_same_shared_strip_test_LDFLAGS): New variable.
16416 (two_file_same_shared_strip_test_LDADD): New variable.
16417 (two_file_shared_strip.so): New target.
16418 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
16419 (ver_test_5.syms, ver_test_7.syms): Likewise.
16420 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
16421 (strip_test_3.stdout): Use TEST_OBJDUMP.
16422 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16423
86925eef
CC
164242008-04-04 Cary Coutant <ccoutant@google.com>
16425
16426 * symtab.h (Symbol::is_weak_undefined): New function.
16427 (Symbol::is_strong_undefined): New function.
16428 (Symbol::is_absolute): New function.
16429 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
16430 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
16431 absolute symbols.
16432 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
16433 (weak_undef_test): New target.
16434 * testsuite/Makefile.in: Rebuild.
16435 * testsuite/weak_undef_file1.cc: New file.
16436 * testsuite/weak_undef_file2.cc: New file.
16437 * testsuite/weak_undef_test.cc: New file.
16438
126f3ece
ILT
164392008-04-03 Craig Silverstein <csilvers@google.com>
16440
16441 * compressed_output.h (class Output_compressed_section): Use
16442 unsigned buffer.
16443 * compressed_output.cc (zlib_compress): Use unsigned buffers,
16444 add zlib header.
16445 (zlib_compressed_suffix): Removed.
16446 (Output_compressed_section::set_final_data_size): Use unsigned
16447 buffers.
16448 * testsuite/Makefile.am (flagstest_compress_debug_sections):
16449 Fix linker invocation.
16450 (flagstest_o_specialfile_and_compress_debug_sections):
16451 Likewise.
16452 * testsuite/Makefile.in: Regenerated.
16453
deae2a14
DM
164542008-04-02 David S. Miller <davem@davemloft.net>
16455
16456 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
16457 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
16458
70752818
ILT
164592008-04-02 Craig Silverstein <csilvers@google.com>
16460
16461 * TODO: New file.
16462
39d0cb0e
ILT
164632008-04-02 Ian Lance Taylor <iant@google.com>
16464
16465 * fileread.cc (File_read::find_view): Add byteshift and vshifted
16466 parameters. Update for new key type to views_. Change all
16467 callers.
16468 (File_read::read): Adjust for byteshift in returned view.
16469 (File_read::add_view): New function, broken out of
16470 find_and_make_view.
16471 (File_read::make_view): New function, broken out of
16472 find_and_make_view.
16473 (File_read::find_or_make_view): Add offset and aligned
16474 parameters. Rewrite accordingly. Change all callers.
16475 (File_read::get_view): Add offset and aligned parameters. Adjust
16476 for byteshift in return value.
16477 (File_read::get_lasting_view): Likewise.
16478 * fileread.h (class File_read): Update declarations.
16479 (class File_read::View): Add byteshift_ field. Add byteshift to
16480 constructor. Add byteshift method.
16481 * archive.h (Archive::clear_uncached_views): New function.
16482 (Archive::get_view): Add aligned parameter. Change all callers.
16483 * object.h (Object::get_view): Add aligned parameter. Change all
16484 callers.
16485 (Object::get_lasting_view): Likewise.
16486
16487 * fileread.cc (File_read::release): Don't call clear_views if
16488 there are multiple objects.
16489 * fileread.h (File_read::clear_uncached_views): New function.
16490 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
16491 on the archive.
16492
a1207466
CC
164932008-03-31 Cary Coutant <ccoutant@google.com>
16494
16495 Add thin archive support.
16496 * archive.cc (Archive::armagt): New const.
16497 (Archive::setup): Remove task parameter and calls to unlock.
16498 (Archive::unlock_nested_archives): New function.
16499 (Archive::read_header): Add nested_off parameter. Change
16500 all callers.
16501 (Archive::interpret_header): Likewise.
16502 (Archive::include_all_members): Change to handle thin
16503 archives.
16504 (Archive::include_member): Likewise.
16505 * archive.h (Archive::Archive): Add new parameters and
16506 initializers.
16507 (Archive::armagt): New const.
16508 (Archive::setup): Remove task parameter.
16509 (Archive::unlock_nested_archives): New function.
16510 (Archive::read_header): Add nested_off parameter.
16511 (Archive::interpret_header): Likewise.
16512 (Archive::Nested_archive_table): New typedef.
16513 (Archive::is_thin_archive_): New field.
16514 (Archive::nested_archives_): New field.
16515 (Archive::options_): New field.
16516 (Archive::dirpath_): New field.
16517 (Archive::task_): New field.
16518 * readsyms.cc (Read_symbols::do_read_symbols): Add check
16519 for thin archives. Pass additional parameters to
16520 Archive::Archive. Unlock the archive file after calling
16521 Archive::setup.
cd536b21 16522
479f6503
ILT
165232008-03-29 Ian Lance Taylor <iant@google.com>
16524
686c8caf
ILT
16525 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
16526 version symbol to be local.
16527 * testsuite/ver_test_4.sh: New file.
16528 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
16529 (check_DATA): Add ver_test_4.syms.
16530 (ver_test_4.syms): New target.
16531 * testsuite/Makefile.in: Rebuild.
16532
ab794b6b
ILT
16533 * output.cc
16534 (Output_section::Input_section_sort_entry::has_priority): New
16535 function.
16536 (Output_section::Input_section_sort_entry::match_file_name): New
16537 function.
16538 (Output_section::Input_section_sort_entry::match_section_name):
16539 Remove.
16540 (Output_section::Input_section_sort_entry::match_section_name_prefix):
16541 Remove.
16542 (Output_section::Input_section_sort_entry::match_section_file):
16543 Remove.
16544 (Output_section::Input_section_sort_compare::operator()): Rewrite
16545 using new Input_section_sort_entry functions. Sort crtbegin and
16546 crtend first. Sort sections with no priority before sections with
16547 a priority.
16548 * testsuite/initpri1.c (d3): Check j != 4.
16549 (cd5): New constructor/destructor function.
16550 (main): Check j != 2.
16551
479f6503
ILT
16552 * symtab.cc (Symbol_table::add_from_object): If we don't use the
16553 new symbol when resolving, don't call set_is_default.
16554 * testsuite/ver_test_7.cc: New file.
16555 * testsuite/ver_test_7.sh: New file.
16556 * testsuite/Makefile.am (ver_test_7.so): New target.
16557 (ver_test_7.o): New target.
16558 (check_SCRIPTS): Add ver_test_7.sh.
16559 (check_DATA): Add ver_test_7.syms.
16560 (ver_test_7.syms): New target.
16561
2fd32231
ILT
165622008-03-28 Ian Lance Taylor <iant@google.com>
16563
16564 * layout.cc (Layout::layout): If we see an input section with a
16565 name that needs sorting, set the must_sort flag for the output
16566 section.
16567 (Layout::make_output_section): If the name of the output section
16568 indicates that it might require sorting, set the may_sort flag.
16569 * output.h (Output_section::may_sort_attached_input_sections): New
16570 function.
16571 (Output_section::set_may_sort_attached_input_sections): New
16572 function.
16573 (Output_section::must_sort_attached_input_sections): New
16574 function.
16575 (Output_section::set_must_sort_attached_input_sections): New
16576 function.
16577 (class Output_section): Declare Input_section_sort_entry. Define
16578 Input_section_sort_compare. Declare
16579 sort_attached_input_sections. Add new fields:
16580 may_sort_attached_input_sections_,
16581 must_sort_attached_input_sections_,
16582 attached_input_sections_are_sorted_.
16583 * output.cc (Output_section::Output_section): Initialize new
16584 fields.
16585 (Output_section::add_input_section): Add an entry to
16586 input_sections_ if may_sort or must_sort are true.
16587 (Output_section::set_final_data_size): Call
16588 sort_attached_input_sections if necessary.
16589 (Output_section::Input_section_sort_entry): Define new class.
16590 (Output_section::Input_section_sort_compare::operator()): New
16591 function.
16592 (Output_section::sort_attached_input_sections): New function.
16593 * configure.ac: Check whether the compiler supports constructor
16594 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
16595 * testsuite/initpri1.c: New file.
16596 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
16597 CONSTRUCTOR_PRIORITY.
16598 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
16599 (initpri1_LDFLAGS): New variable.
16600 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16601
18e6b24e
ILT
166022008-03-27 Ian Lance Taylor <iant@google.com>
16603
49bdd526
ILT
16604 * common.cc (Sort_commons::operator): Correct sorting algorithm.
16605 * testsuite/common_test_1.c: New file.
16606 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
16607 (common_test_1_SOURCES): New variable.
16608 (common_test_1_DEPENDENCIES): New variable.
16609 (common_test_1_LDFLAGS): New variable.
16610
18e6b24e
ILT
16611 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
16612 and commons_ correctly when NAME/VERSION does not override
16613 NAME/NULL.
16614 * testsuite/ver_test_6.c: New file.
16615 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
16616 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
16617 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
16618
04bf7072
ILT
166192008-03-26 Ian Lance Taylor <iant@google.com>
16620
5871526f
ILT
16621 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
16622 of an undefined symbol from a version script.
16623 * testsuite/Makefile.am (ver_test_5.so): New target.
16624 (ver_test_5.o): New target.
16625 (check_SCRIPTS): Add ver_test_5.sh.
16626 (check_DATA): Add ver_test_5.syms.
16627 (ver_test_5.syms): New target.
16628 * testsuite/ver_test_5.cc: New file.
16629 * testsuite/ver_test_5.script: New file.
16630 * testsuite/ver_test_5.sh: New file.
16631 * Makefile.in, testsuite/Makefile.in: Rebuild.
16632
04bf7072
ILT
16633 PR gold/5986
16634 Fix problems building gold with gcc 4.3.0.
16635 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
16636 (gold_error_at_location, gold_warning_at_location): Use it.
16637 * configure.ac: Check whether we can compile and use a template
16638 function with a printf attribute.
16639 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
16640 when jumping over bytes.
16641 * object.cc: Instantiate Object::read_section_data.
16642 * debug.h: Include <cstring>
16643 * dwarf_reader.cc: Include <algorithm>
16644 * main.cc: Include <cstring>.
16645 * options.cc: Include <cstring>.
16646 * output.cc: Include <cstring>.
16647 * script.cc: Include <cstring>.
16648 * script.h: Include <string>.
16649 * symtab.cc: Include <cstring> and <algorithm>.
16650 * target-select.cc: Include <cstring>.
16651 * version.cc: Include <string>.
16652 * testsuite/testmain.cc: Include <cstdlib>.
16653 * configure, config.in: Rebuild.
16654
874c5b28
ILT
166552008-03-25 Ian Lance Taylor <iant@google.com>
16656
819d6c3a
ILT
16657 * options.cc: Include "../bfd/bfdver.h".
16658 (options::help): Print bug reporting address.
16659
f4b2c6f5
ILT
16660 * version.cc (print_version): Adjust output for current value of
16661 BFD_VERSION_STRING.
16662
16663 * NEWS: New file.
16664
e96caa79
ILT
16665 * options.cc (options::help): Print list of supported targets.
16666 * target-select.h: Include <vector>.
16667 (class Target_selector): Make machine_, size_, and is_big_endian_
16668 fields const. Add bfd_name_ and instantiated_target_ fields.
16669 (Target_selector::Target_selector): Add bfd_name parameter.
16670 (Target_selector::recognize): Make non-virtual, call
16671 do_recognize.
16672 (Target_selector::recognize_by_name): Make non-virtual, call
16673 do_recognize_by_name.
16674 (Target_selector::supported_names): New function.
16675 (Target_selector::bfd_name): New function.
16676 (Target_selector::do_instantiate_target): New pure virtual
16677 function.
16678 (Target_selector::do_recognize): New virtual function.
16679 (Target_selector::do_recognize_by_name): New virtual function.
16680 (Target_selector::instantiate_target): New private function.
16681 (supported_target_names): Declare.
16682 * target-select.cc (Target_selector::Target_selector): Update for
16683 new parameter and fields.
16684 (select_target_by_name): Check that the name matches before
16685 calling recognize_by_name.
16686 (supported_target_names): New function.
16687 * i386.cc (class Target_selector_i386): Update Target_selector
16688 constructor call. Remove recognize and recognize_by_name. Add
16689 do_instantiate_target.
16690 * x86_64.cc (class Target_selector_x86_64): Likewise.
16691 * testsuite/testfile.cc (class Target_selector_test): Update for
16692 changes to Target_selector.
16693
874c5b28
ILT
16694 * README: Rewrite, with some notes on unsupported features.
16695
0a65a3a7
CC
166962008-03-24 Cary Coutant <ccoutant@google.com>
16697
16698 * i386.cc (Target_i386::Got_type): New enum declaration.
16699 (Target_i386::Scan::local): Updated callers of Output_data_got
16700 member functions.
16701 (Target_i386::Scan::global): Likewise.
16702 (Target_i386::Relocate::relocate): Likewise.
16703 (Target_i386::Relocate::relocate_tls): Likewise.
16704 * object.h (Got_offset_list): New class.
16705 (Sized_relobj::local_has_got_offset): Added got_type parameter.
16706 (Sized_relobj::local_got_offset): Likewise.
16707 (Sized_relobj::set_local_got_offset): Likewise.
16708 (Sized_relobj::local_has_tls_got_offset): Removed.
16709 (Sized_relobj::local_tls_got_offset): Removed.
16710 (Sized_relobj::set_local_tls_got_offset): Removed.
16711 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
16712 * output.cc (Output_data_got::add_global): Added got_type parameter.
16713 (Output_data_got::add_global_with_rel): Likewise.
16714 (Output_data_got::add_global_with_rela): Likewise.
16715 (Output_data_got::add_global_pair_with_rel): New function.
16716 (Output_data_got::add_global_pair_with_rela): New function.
16717 (Output_data_got::add_local): Added got_type parameter.
16718 (Output_data_got::add_local_with_rel): Likewise.
16719 (Output_data_got::add_local_with_rela): Likewise.
16720 (Output_data_got::add_local_pair_with_rel): New function.
16721 (Output_data_got::add_local_pair_with_rela): New function.
16722 (Output_data_got::add_global_tls): Removed.
16723 (Output_data_got::add_global_tls_with_rel): Removed.
16724 (Output_data_got::add_global_tls_with_rela): Removed.
16725 (Output_data_got::add_local_tls): Removed.
16726 (Output_data_got::add_local_tls_with_rel): Removed.
16727 (Output_data_got::add_local_tls_with_rela): Removed.
16728 * output.h (Output_data_got::add_global): Added got_type parameter.
16729 (Output_data_got::add_global_with_rel): Likewise.
16730 (Output_data_got::add_global_with_rela): Likewise.
16731 (Output_data_got::add_global_pair_with_rel): New function.
16732 (Output_data_got::add_global_pair_with_rela): New function.
16733 (Output_data_got::add_local): Added got_type parameter.
16734 (Output_data_got::add_local_with_rel): Likewise.
16735 (Output_data_got::add_local_with_rela): Likewise.
16736 (Output_data_got::add_local_pair_with_rel): New function.
16737 (Output_data_got::add_local_pair_with_rela): New function.
16738 (Output_data_got::add_global_tls): Removed.
16739 (Output_data_got::add_global_tls_with_rel): Removed.
16740 (Output_data_got::add_global_tls_with_rela): Removed.
16741 (Output_data_got::add_local_tls): Removed.
16742 (Output_data_got::add_local_tls_with_rel): Removed.
16743 (Output_data_got::add_local_tls_with_rela): Removed.
16744 * resolve.cc (Symbol::override_base_with_special): Removed
16745 reference to has_got_offset_ field.
16746 * symtab.cc (Symbol::init_fields): Replaced initialization
16747 of got_offset_ with got_offsets_. Removed initialization
16748 of has_got_offset_
53fcba31 16749 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
16750 (Symbol::got_offset): Likewise.
16751 (Symbol::set_got_offset): Likewise.
16752 (Symbol::has_tls_got_offset): Removed.
16753 (Symbol::tls_got_offset): Removed.
16754 (Symbol::set_tls_got_offset): Removed.
16755 (Symbol::got_offset_): Removed.
16756 (Symbol::tls_mod_got_offset_): Removed.
16757 (Symbol::tls_pair_got_offset_): Removed.
16758 (Symbol::got_offsets_): New field.
16759 (Symbol::has_got_offset): Removed.
16760 (Symbol::has_tls_mod_got_offset): Removed.
16761 (Symbol::has_tls_pair_got_offset): Removed.
16762 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
16763 (Target_x86_64::Scan::local): Updated callers of Output_data_got
16764 member functions.
16765 (Target_x86_64::Scan::global): Likewise.
16766 (Target_x86_64::Relocate::relocate): Likewise.
16767 (Target_x86_64::Relocate::relocate_tls): Likewise.
16768
bd52eafb
BE
167692008-03-25 Ben Elliston <bje@au.ibm.com>
16770
16771 * yyscript.y: Fix spelling error in comment.
16772
8b105e34
ILT
167732008-03-24 Ian Lance Taylor <iant@google.com>
16774
8ed814a9
ILT
16775 * options.h (class General_options): Define build_id option.
16776 * layout.h (class Layout): Declare write_build_id, create_note,
16777 create_build_id. Add build_id_note_ member.
16778 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
16779 "libiberty.h", "md5.h", "sha1.h".
16780 (Layout::Layout): Initialize eh_frame_data_,
16781 eh_frame_hdr_section_, and build_id_note_.
16782 (Layout::finalize): Call create_build_id.
16783 (Layout::create_note): New function, broken out of
16784 Layout::create_gold_note.
16785 (Layout::create_gold_note): Call create_note.
16786 (Layout::create_build_id): New function.
16787 (Layout::write_build_id): New function.
16788 (Close_task_runner::run): Call write_build_id.
16789
8b105e34
ILT
16790 * x86_64.cc: Correct license to GPLv3.
16791
086a1841
ILT
167922008-03-23 Ian Lance Taylor <iant@google.com>
16793
16794 * options.cc: Include "demangle.h".
16795 (parse_optional_string): New function.
16796 (parse_long_option): Handle takes_optional_argument.
16797 (parse_short_option): Update dash_z initializer. Handle
16798 takes_optional_argument.
16799 (General_options::General_options): Initialize do_demangle_.
16800 (General_options::finalize): Set do_demangle_. Handle demangling
16801 style.
16802 * options.h (parse_optional_string): Declare.
16803 (struct One_option): Add optional_arg field. Update constructor.
16804 Update call constructor calls. Add takes_optional_argument
16805 function.
16806 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
16807 (DEFINE_optional_string): Define.
16808 (General_options::demangle): Change from DEFINE_bool to
16809 DEFINE_optional_string.
16810 (General_options::no_demangle): New function.
16811 (General_options::do_demangle): New function.
16812 (General_options::set_do_demangle): New function.
16813 (General_options::execstack_status_): Move definition to end of
16814 class definition.
16815 (General_options::static_): Likewise.
16816 (General_options::do_demangle_): New field.
16817 * object.cc (big_endian>::get_symbol_location_info): Call
16818 Options::do_demangle, not Options::demangle.
16819 * symtab.cc (demangle): Likewise.
16820
cbb93e63
ILT
168212008-03-22 Ian Lance Taylor <iant@google.com>
16822
16823 * gold.h: Include <cstddef> and <sys/types.h>
16824 * options.h: Include <cstring>.
16825
ec531623
ILT
168262008-03-21 Ian Lance Taylor <iant@google.com>
16827
16828 * Added source code to GNU binutils.
752937aa 16829\f
b90efa5b 16830Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
16831
16832Copying and distribution of this file, with or without modification,
16833are permitted in any medium without royalty provided the copyright
16834notice and this notice are preserved.
16835
16836Local Variables:
16837mode: change-log
16838left-margin: 8
16839fill-column: 74
16840version-control: never
16841End:
This page took 1.116456 seconds and 4 git commands to generate.