Use do_target_resume when stepping past permanent breakpoint too
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
6b0ad2eb
JY
12015-03-30 Jing Yu <jingyu@google.com>
2
3 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
4 TLSLD_ADD_DTPREL_LO12_NC.
5 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
6 _TLS_MODULE_BASE_ point to the start of tls segment.
7 (Target_aarch64::optimize_tls_reloc): Add cases for
8 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
9 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
10 (Target_aarch64::Scan::local): Likewise.
11 (Target_aarch64::Scan::global): Likewise.
12 (Target_aarch64::Relocate::relocate): Likewise.
13 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
14 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
15 relocations.
16
0916f9e7
RÁE
172015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
18
19 * merge.cc (Object_merge_map::add_mapping): call
20 Object_merge_map::Input_merge_map::add_mapping.
21 (Object_merge_map::Input_merge_map::add_mapping): New.
22 (Output_merge_data::do_add_input_section): Call
23 get_or_make_input_merge_map before a loop.
24 (Output_merge_string<Char_type>::finalize_merged_data): Call
25 get_or_make_input_merge_map before a loop.
26 * merge.h (Object_merge_map): Make Input_merge_map public.
27 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
28 (Relobj::get_or_create_merge_map): New.
29 * object.h (Relobj::get_or_create_merge_map): New.
30
282c9750
AM
312015-03-24 Alan Modra <amodra@gmail.com>
32
33 PR 18147
34 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
35 relocation errors for branches to strong undefined symbols.
36
67f95b96
RÁE
372015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
38
39 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
40 (Object_merge_map::is_merge_section_for): Remove.
41 (Object_merge_map::find_merge_section): New.
42 * merge.h (Object_merge_map::is_merge_section_for): Remove.
43 (Object_merge_map::find_merge_section): New.
44 (Object_merge_map::get_input_merge_map): Add a const version.
45 * object.cc (Relobj::is_merge_section_for): Remove.
46 (Relobj::find_merge_section): New.
47 * object.h (Relobj::is_merge_section_for): Remove.
48 (Relobj::find_merge_section): New.
49 * output.cc
50 (Output_section::Input_section::is_merge_section_for): Remove.
51 (Output_section::add_merge_input_section): Don't call
52 add_merge_input_section.
53 (Output_section::find_merge_section): Return const. Use
54 object->find_merge_section.
55 (Output_section::build_lookup_maps): Don't build a map for
56 merge sections.
57 (Output_section::is_input_address_mapped): Return false if
58 section is not found.
59 (Output_section::find_starting_output_address): Use
60 find_merge_section instead of is_merge_section_for.
61 (Output_section::add_script_input_section): Don't build a map for
62 merge sections.
63 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
64 (Output_section_lookup_maps::find_merge_section): Remove.
65 (Output_section_lookup_maps::add_merge_input_section) Remove.
66 (Output_section::find_merge_section): Return const.
67
152f7024
CC
682015-03-22 Cary Coutant <cary@google.com>
69
70 PR gold/18106
71 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
72 non-SIB form of lea, with nop after the call.
73
bccffdfd
CC
742015-03-21 Cary Coutant <cary@google.com>
75
76 PR gold/14217
77 * output.cc (Output_segment::is_first_section_relro): Don't ignore
78 .tdata section.
79 (Output_segment::set_section_addresses): Don't align size of relro
80 segment for .tbss.
81
1c582fe7
CC
822015-03-21 Cary Coutant <cary@google.com>
83
84 PR gold/18010
85 * stringpool.cc (Stringpool_template): Don't optimize if section
86 alignment is greater than sizeof(char).
87
410da591
CC
882015-03-21 Cary Coutant <cary@google.com>
89
90 PR gold/18048
91 * script-c.h (script_include_directive): Add first_token parameter.
92 * script.cc (script_include_directive): Add first_token parameter, and
93 pass it to read_script_file.
94 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
95 (PARSING_MEMORY_DEF): New tokens.
96 (top): Add new productions for INCLUDE files.
97 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
98 Pass PARSING_LINKER_SCRIPT to script_include_directive.
99 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
100 (section_cmd): Pass PARSING_SECTION_CMDS.
101 (file_or_sections_cmd): Remove.
102 (memory_def): Pass PARSING_MEMORY_DEF.
103 * testsuite/Makefile.am (memory_test_2): New test.
104 * testsuite/Makefile.in: Regenerate.
105 * testsuite/memory_test_inc.t: New script file.
106 * testsuite/memory_test_inc_1.t.src: New script file.
107 * testsuite/memory_test_inc_2.t.src: New script file.
108 * testsuite/memory_test_inc_3.t.src: New script file.
109
0d5bbdb0
CC
1102015-03-21 Cary Coutant <cary@google.com>
111
112 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
113 (Sized_relobj_dwo::setup): Build compressed section map.
114 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
115 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
116 section map.
117 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
118 compressed_sections_ field.
119 (build_compressed_section_map): Take Object instead of
120 Sized_relobj_file parameter; add decompress_if_needed parameter.
121 (Sized_relobj_file::do_find_special_sections): Store compressed
122 section map in parent Object.
123 (Sized_relobj_file::do_decompressed_section_contents): Move
124 implementation to Object::decompressed_section_contents.
125 (Sized_relobj_file::do_discard_decompressed_sections): Move
126 implementation to Object::discard_decompressed_sections.
127 * object.h (build_compressed_section_map): Declare.
128 (Object::Object): Add compressed_sections_ field.
129 (Object::section_is_compressed): Move implementation here.
130 (Object::decompressed_section_contents): De-virtualize.
131 (Object::discard_decompressed_sections): De-virtualize.
132 (Object::do_section_is_compressed): Delete.
133 (Object::do_decompressed_section_contents): Delete.
134 (Object::set_compressed_sections): New method.
135 (Object::compressed_sections): New method.
136 (Object::compressed_sections_): New data member.
137 (Compressed_section_info, Compressed_section_map): Move to top of file.
138 (Sized_relobj_file::do_section_is_compressed): Delete.
139 (Sized_relobj_file::do_decompressed_section_contents): Delete.
140 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
141 (Sized_relobj_file::compressed_sections_): Move to Object class.
142
bd9e0d46
CC
1432015-03-21 Cary Coutant <ccoutant@google.com>
144
145 PR gold/18152
146 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
147 deferred objects.
148
943c8b43
CC
1492015-03-11 Cary Coutant <ccoutant@google.com>
150
151 * options.cc (General_options::finalize): Don't allow -z relro
152 with incremental linking.
153 * testsuite/Makefile.am (incremental_test): Add -z norelro.
154 (incremental_test_2): Likewise.
155 (incremental_test_3): Likewise.
156 (incremental_test_4): Likewise.
157 (incremental_test_5): Likewise.
158 (incremental_test_6): Likewise.
159 (incremental_copy_test): Likewise.
160 (incremental_common_test_1): Likewise.
161 (incremental_comdat_test_1): Likewise.
162 * testsuite/Makefile.in: Regenerate.
163
e1663197
CC
1642015-03-09 Cary Coutant <ccoutant@google.com>
165
166 PR gold/14675
167 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
168 return enum indicating whether .eh_frame section is empty, optimizable,
169 unrecognized, or an end marker. Adjust explicit instantiations.
170 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
171 (Eh_frame::add_ehframe_input_section): Change return type.
172 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
173 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
174 to the .eh_frame output section until we see the end marker.
175 (Layout::finalize_eh_frame_section): New.
176 * layout.h: (Layout::finalize_eh_frame_section): New.
177
beb8418f
L
1782015-03-05 H.J. Lu <hongjiu.lu@intel.com>
179
180 * output.cc (Relobj::initialize_input_to_output_map<size>):
181 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
182
48c73428
CC
1832015-03-04 Cary Coutant <ccoutant@google.com>
184
185 * parameters.cc (Parameters::set_target_once): Call
186 Target::select_as_default_target just once from here...
187 (set_parameters_target): ...instead of from here.
188
1892015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
dbe40a88
RÁE
190
191 * ehframe.cc (Cie::set_output_offset): Pass in and use a
192 Output_section_data instead of a Merge_map.
193 (Eh_frame::Eh_frame): Don't initialize merge_map_.
194 (Eh_frame::read_cie): Use add_merge_mapping instead of
195 Merge_map::add_mapping.
196 (Eh_frame::read_fde): Ditto.
197 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
198 (Eh_frame::do_output_offset): Use merge_output_offset istead of
199 merge_map_->get_output_offset.
200 (Eh_frame::do_is_merge_section_for): Delete.
201 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
202 instead of a Merge_map.
203 (Cie::set_output_offset): Pass in a Output_section_data instead of a
204 Merge_map.
205 (Eh_frame::do_is_merge_section_for): Delete.
206 (Eh_frame::merge_map_): Delete.
207 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
208 and use a Output_section_data instead of a Merge_map.
209 (Object_merge_map::add_mapping): Ditto.
210 (Object_merge_map::get_output_offset): Remove the merge_map argument.
211 (Object_merge_map::is_merge_section_for): Pass in and use a
212 Output_section_data instead of a Merge_map.
213 (Merge_map): Delete.
214 (Output_merge_base::do_output_offset): Use merge_output_offset instead
215 of merge_map_.get_output_offset.
216 (Output_merge_base::do_is_merge_section_for): Delete.
217 (Output_merge_data::do_add_input_section): Use
218 object->add_merge_mapping instead of add_mapping.
219 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
220 * merge.h (Merge_map): Delete forward declaration.
221 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
222 instead of a Merge_map.
223 (Object_merge_map::get_output_offset): Remove the merge_map argument.
224 (Object_merge_map::is_merge_section_for): Pass in and use a
225 Output_section_data instead of a Merge_map.
226 (Input_merge_map::Object_merge_map::merge_map): Replace with
227 output_data.
228 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
229 Output_section_data instead of a Merge_map.
230 (Merge_map): Delete.
231 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
232 (Output_merge_base::do_is_merge_section_for): Delete.
233 (Output_merge_base::add_mapping): Delete.
234 (Output_merge_base::merge_map_): Delete.
235 * object.cc (Relobj::initialize_input_to_output_map): New.
236 (Relobj::initialize_input_to_output_map): New.
237 (Relobj::merge_output_offset): New.
238 (Relobj::is_merge_section_for): New.
239 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
240 bits.
241 * object.h (Relobj::merge_map): Delete.
242 (initialize_input_to_output_map): New.
243 (set_merge_map): Delete.
244 (add_merge_mapping): New.
245 (merge_output_offset): New.
246 (is_merge_section_for): New.
247 * output.cc (Output_section::Input_section::is_merge_section_for):
248 Use object->is_merge_section_for.
249 * output.h (Output_section_data::is_merge_section_for): Delete.
250 (Output_section_data::do_is_merge_section_for): Delete.
251 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
252 Use object->initialize_input_to_output_map.
253 (Merged_symbol_value<size>::value_from_output_section): Use
254 object->merge_output_offset.
255
48c73428 2562015-03-02 Peter Collingbourne <pcc@google.com>
2c7b626c
CC
257 Cary Coutant <ccoutant@google.com>
258
259 * output.cc (Output_section::add_merge_input_section): Do not
260 attempt to merge sections with an entsize of 0.
261
48c73428 2622015-03-02 Khem Raj <raj.khem@gmail.com>
5b07cd84
CC
263
264 * attributes.h (class Output_attributes_section_data ): Add
265 do_print_to_mapfile function.
266
ec86f434
AM
2672015-02-24 Alan Modra <amodra@gmail.com>
268
269 PR 18010
270 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
271 complain if value is not a multiple of four.
272 (Target_powerpc::Relocate::relocate): Correct handling of
273 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
274
be66981e
L
2752015-02-21 H.J. Lu <hongjiu.lu@intel.com>
276
277 * configure.ac (default_size): Set to 32 for x32.
278 * configure: Regenerated.
279
e3ee8ed4
AM
2802015-02-18 Alan Modra <amodra@gmail.com>
281
282 PR 17954
283 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
284 visibility.
285
3a935c6c
RÁE
2862015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
287
288 * gc.h (Garbage_collection::add_reference): Don't use find.
289
e0a1e121
RÁE
2902015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
291
292 * object.cc (write_local_symbols): avoid std::vector copy.
293
45a4fb1a
RÁE
2942015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
295
296 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
297
2d9afefe
MW
2982015-02-09 Mark Wielaard <mjw@redhat.com>
299
300 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
301 DW_LANG_Fortran03 and DW_LANG_Fortran08.
302
e9c1bdad
CC
3032015-02-16 Cary Coutant <ccoutant@google.com>
304
305 PR gold/13577
306 PR gold/16992
307 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
308 DF_SYMBOLIC if --dynamic-list option is used.
309 * options.cc (General_options::finalize): --dynamic-list is not
310 mutually exclusive with -Bsymbolic.
311 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
312 listed in --dynamic-list.
313 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
314 -Bsymbolic-functions.
315 * testsuite/Makefile.in: Regenerate.
316
0ed4b0bf
CC
3172015-02-16 Cary Coutant <ccoutant@google.com>
318
319 PR gold/17971
320 * incremental.cc: Remove redundant include of "output.h".
321
1a920511
JY
3222015-02-12 Jing Yu <jingyu@google.com>
323
324 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
325 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
326 New relocation.
327 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
328 TLSLE_MOVW_* relocations.
329 (Target_aarch64::Scan::global): Likewise.
330 (Target_aarch64::Relocate::relocate): Likewise.
331 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
332 for new TLSLE_MOVW_* relocations.
333
07f107f3
WN
3342015-02-11 Will Newton <will.newton@linaro.org>
335
336 PR gold/13321
337 * arm.cc (Target_arm::make_plt_section): Create an ARM
338 state mapping symbol at the start of the PLT.
339
e051a5b5
L
3402015-02-09 H.J. Lu <hongjiu.lu@intel.com>
341
342 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
343 Replace two_file_shared_2.so with two_file_shared_1.so.
344 * testsuite/Makefile.in: Regenerated.
345
dddcc5b9
AM
3462015-02-09 Alan Modra <amodra@gmail.com>
347
348 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
349 plugin_test_thin.a and defsym_test.
350 * testsuite/Makefile.in: Regenerate.
351
b39b8b9d
RÁE
3522015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
353
354 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
355 body.
356
b66d1c52
CC
3572015-02-04 Peter Collingbourne <pcc@google.com>
358
359 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
360 forwarding symbols when computing symbol resolution info for plugins.
361 * plugin.h (Plugin_manager::symtab): New method.
362 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
363
23081de0
CC
3642015-02-03 Cary Coutant <ccoutant@google.com>
365 Peter Collingbourne <pcc@google.com>
366
367 PR gold/15660
368 * archive.cc (Thin_archive_object_unlocker): New class.
369 (Archive::include_member): Unlock external members of thin archives.
370 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
371 (plugin_test_2): Likewise.
372 (plugin_test_3): Likewise.
373 (plugin_test_4): Likewise.
374 (plugin_test_5): Likewise.
375 (plugin_test_6): Likewise.
376 (plugin_test_7): Likewise.
377 (plugin_test_8): Likewise.
378 (plugin_test_9): Likewise.
379 (plugin_test_10): Likewise.
380 (plugin_test_11): New test case.
381 * testsuite/Makefile.in: Regenerate.
382 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
383 file to decide whether to claim file.
384 (all_symbols_read_hook): Likewise.
385 * testsuite/plugin_test_1.sh: Adjust expected output.
386 * testsuite/plugin_test_2.sh: Likewise.
387 * testsuite/plugin_test_3.sh: Likewise.
388 * testsuite/plugin_test_6.sh: Likewise.
389 * testsuite/plugin_test_tls.sh: Likewise.
390 * testsuite/plugin_test_11.sh: New testcase.
391
3922015-02-03 Cary Coutant <ccoutant@google.com>
393
394 * descriptors.cc (Descriptors::open): Set artificially-low limit for
395 file descriptors when debugging enabled. Add debug output.
396 (Descriptors::release): Add debug output.
397 (Descriptors::close_some_descriptor): Likewise.
398 (Descriptors::close_all): Likewise.
399 * fileread.cc (File_read::lock): Likewise.
400 (File_read::unlock): Likewise.
401
24dd5808
CC
4022015-02-02 Cary Coutant <ccoutant@google.com>
403
404 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
405 executable output file.
406
fa89cc82
HS
4072015-01-22 Han Shen <shenhan@google.com>
408
409 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
410 (Target_arm::do_plt_address_for_global): New method.
411 (Target_arm::do_plt_address_for_local): New method.
412 (Target_arm::rel_irelative_section): New method.
413 (Target_arm::make_data_plt): Add more parameters for plt ctor.
414 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
415 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
416 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
417 (Target_arm::Scan::check_non_pic): Add ifunc support.
418 (Target_arm::Scan::local): Add ifunc support.
419 (Target_arm::Scan::global): Add ifunc support.
420 (Target_arm::make_plt_section): New method.
421 (Target_arm::make_plt_entry): Change to call to make_plt_section.
422 (Target_arm::make_local_ifunc_plt_entry): New method.
423 (Target_arm::got_irelative_): New member.
424 (Target_arm::rel_irelative_): New member.
425 (Target_arm::got_section): Add creation for got_irelative_.
426 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
427 (Target_arm::Relocate::relocate): Properly set local ifunc address.
428 (Target_arm::do_dynsym_value): Properly set global ifunc address.
429 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
430 (Output_data_plt_arm::IRelative_data): New type.
431 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
432 (Output_data_plt_arm::add_entry): Add more parameters.
433 (Output_data_plt_arm::add_relocation): New method.
434 (Output_data_plt_arm::add_local_ifunc_entry): New method.
435 (Output_data_plt_arm::rel_irelative): New method.
436 (Output_data_plt_arm::entry_count): Modified.
437 (Output_data_plt_arm::address_for_global): New method.
438 (Output_data_plt_arm::address_for_local): New method.
23081de0 439gold/
fa89cc82
HS
440 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
441 (Output_data_plt_arm::insert_irelative_data): New method.
442 (Output_data_plt_arm::irelative_rel_): New member.
443 (Output_data_plt_arm::got_): New member.
444 (Output_data_plt_arm::got_irelative_): New member.
445 (Output_data_plt_arm::irelative_count_): New member.
446 (Output_data_plt_arm::IRelative_data_vec): New typedef.
447 (Output_data_plt_arm::irelative_data_vec_): New member.
448 (Output_data_plt_arm::do_write): Write out irelative entries.
449 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
450 more parameters to ctor.
451 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
452 more parameters to ctor.
453 * output.h (Output_data_reloc::add_local_relative): New method.
454 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
455
0f81d3f0
AM
4562015-01-29 Alan Modra <amodra@gmail.com>
457
458 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
459 and GOT_TLSGD to LE optimization.
460
65d92137
CC
4612015-01-28 Cary Coutant <ccoutant@google.com>
462
463 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
464 for undef TLS symbols.
465 (Target_x86_64::Relocate::relocate_tls): Likewise.
466 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
467
5485698a
CC
4682015-01-25 Cary Coutant <ccoutant@google.com>
469
470 * output.cc (Output_segment::set_section_addresses): Fix calculation
471 of size of relro segment.
472
b01a4b04
AM
4732015-01-22 Alan Modra <amodra@gmail.com>
474
475 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
476 condition for need of ifunc plt entry.
477 (Target_powerpc::Scan::global <got relocs>): Likewise.
478
3d0064a9
CC
4792015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
480
481 * mips.cc (reloc_high): Add r_sym.
482 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
483 reloc_high constructor.
484 (Mips_relocate_functions::relgot16_local): Likewise.
485 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
486 r_type to decide whether LO16 matches HI16.
487 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
488 rello16 and relgot16_local.
489
a5cd8f05
CC
4902015-01-09 Cary Coutant <ccoutant@google.com>
491
492 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
493 unless alignment is larger than page size.
494
4fc1b9d4
L
4952015-01-06 H.J. Lu <hongjiu.lu@intel.com>
496 Cary Coutant <ccoutant@google.com>
497
498 PR gold/17729
499 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
500 (DEFAULT_TARGET_X32): Set for x32.
501 * x86_64.cc (cmp_insn_32): New.
502 (lea_r10_insn_32): Likewise.
503 (lea_r11_insn_32): Likewise.
504 (cmp_insn_64): Likewise.
505 (lea_r10_insn_64): Likewise.
506 (lea_r11_insn_64): Likewise.
507 (Target_x86_64<size>::do_calls_non_split): Handle x32.
508 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
509 (check_DATA): Add split_x32 files.
510 (split_x32_[1234n].o): New targets.
511 (split_x32_[124]): New targets.
512 (split_x32_[1234r].stdout): New targets.
513 * testsuite/split_x32.sh: New file.
514 * testsuite/split_x32_1.s: Likewise.
515 * testsuite/split_x32_2.s: Likewise.
516 * testsuite/split_x32_3.s: Likewise.
517 * testsuite/split_x32_4.s: Likewise.
518 * testsuite/split_x32_n.s: Likewise.
519 * configure: Regenerated.
520 * testsuite/Makefile.in: Likewise.
521
e749cab8
L
5222015-01-06 H.J. Lu <hongjiu.lu@intel.com>
523
524 PR gold/17809
525 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
526 x32.
527
af759df0
AM
5282015-01-02 Alan Modra <amodra@gmail.com>
529
530 * version.cc (print_version): Just print current year.
531 * dwp.cc (print_version): Likewise.
532
b90efa5b
AM
5332015-01-01 Alan Modra <amodra@gmail.com>
534
535 Update year range in copyright notice of all files.
536
f12d1e8a
AM
5372014-12-25 Alan Modra <amodra@gmail.com>
538
539 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
540 new enums.
541 (Target_arm::merge_object_attributes, ): Likewise.
542
5c294fee
TG
5432014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
544
545 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
546 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
547 AEABI_VFP_args_vfp to check that.
548 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
549 value and replace hardcoded values by enum values.
550
e30880c2
CC
5512014-12-22 Cary Coutant <ccoutant@google.com>
552
553 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
554
bd040da1
L
5552014-12-20 H.J. Lu <hongjiu.lu@intel.com>
556
557 PR gold/14608
558 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
559 to "return i * i * 3;".
560
e02a4046
CC
5612014-12-16 Cary Coutant <ccoutant@google.com>
562
563 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
564 (Mapfile::print_output_data): Use current_data_size() to avoid
565 assert for sections requiring postprocessing; if address is not valid,
566 print 0.
567 (Mapfile::print_output_section): Use current_data_size(); print note
568 that addresses and sizes are before compression.
569
add6016b
L
5702014-12-14 H.J. Lu <hongjiu.lu@intel.com>
571
572 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
573 Cast current_group_size to unsigned long when reporting error.
574
0bf32ea9
JY
5752014-12-10 Jing Yu <jingyu@google.com>
576
577 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
578 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
579 Update error message.
580 (Target_aarch64::do_relax): Use absolute value of option
581 stub_group_size. Replace local variable with class member
582 stub_group_size_.
583
cbcb23fa
AM
5842014-12-04 Alan Modra <amodra@gmail.com>
585
586 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
587 addend of PLTREL24 reloc when not generating a plt stub. Make
588 max_branch_offset an "Address".
fbad6518 589 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
590 (Target_powerpc::Relocate::relocate): Likewise.
591
1611bc4a
AM
5922014-12-04 Alan Modra <amodra@gmail.com>
593
594 PR 17670
595 * symtab.cc (Symbol::set_undefined): Remove assertion.
596 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
597 on symbols defined in discarded sections, instead return false.
598 Rearrange params, update all callers.
599 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
600 branches to syms in discarded sections.
601 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
602 undefined and flag as discarded.
603 (Target_powerpc::Relocate::relocate): Localize variable.
604
4759c34e
L
6052014-12-03 H.J. Lu <hongjiu.lu@intel.com>
606
607 PR gold/17675
608 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
609 * testsuite/Makefile.in: Regenerated.
610
1f98a074
AM
6112014-12-03 Alan Modra <amodra@gmail.com>
612
613 PR 17566
614 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
615 when adding dynamic relocations against section symbols.
616
fb257835
DI
6172014-12-01 Dimitry Ivanov <dimitry@google.com>
618
619 * layout.cc (Layout::finish_dynamic_section): When '-z global'
620 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
621 * options.h (General_options): New -z option (global).
622
d8e60314
CC
6232014-12-01 Cary Coutant <ccoutant@google.com>
624
625 PR gold/17578
626 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
627 is given.
628 (Layout::create_executable_stack_info): Warn when -z noexecstack is
629 given but some inputs require executable stack.
630
982bbd97
CC
6312014-11-26 Cary Coutant <ccoutant@google.com>
632
633 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
634 .debug_str_offsets; strip .debug_gnu_pubnames and
635 .debug_gnu_pubtypes.
636 (lines_only_debug_sections): Strip all four new sections.
637
bb779192
HS
6382014-11-26 Jing Yu <jingyu@google.com>
639
640 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
641 register to be x0 when to relax TLSDESC_LD64_LO12.
642
a3e60ddb
AM
6432014-11-26 Alan Modra <amodra@gmail.com>
644
645 * powerpc.cc (struct Stub_table_owner): New.
646 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
647 unsigned int vector. Update all references.
648 (powerpc_relobj::set_stub_table): Take an unsigned int param
649 rather than a Stub_table. Update callers.
650 (Powerpc_relobj::clear_stub_table): New function.
651 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
652 stub_group_size_ vars.
653 (Target_powerpc::new_stub_table): Delete.
654 (max_branch_delta): New function, extracted from..
655 (Target_powerpc::Relocate::relocate): ..here..
656 (Target_powerpc::Branch_info::make_stub): ..and here. Return
657 status on whether stub created successfully.
658 (Stub_control::Stub_control): Add "no_size_errors" param. Move
659 default sizing to..
660 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
661 reduce on relax failure.
662 (Target_powerpc::group_sections): Add "no_size_errors" param.
663 Use stub_group_size_. Set up group info in a temp vector,
664 before building Stub_table vector. Account for input sections
665 possibly already converted to relaxed sections.
666 (Stub_table::init): Delete. Merge into..
667 (Stub_table::Stub_table): ..here.
668 (Stub_table::can_reach_stub): New function.
669 (Stub_table::add_plt_call_entry): Add "from" parameter and
670 return true iff stub could be reached.
671 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
672 param too.
673 (Stub_table::clear_stubs): Add "all" param.
674
a20605cf
AM
6752014-11-26 Alan Modra <amodra@gmail.com>
676
677 * powerpc.cc (Stub_control::set_output_and_owner): New function.
678 (Target_powerpc::group_sections): Use it.
679
43b64deb
CC
6802014-11-25 Cary Coutant <ccoutant@google.com>
681
682 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
683 (Binary_to_elf::write_symbol): Add st_size parameter.
684 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
685
c924eb67
CC
6862014-11-25 Cary Coutant <ccoutant@google.com>
687
688 PR gold/17639
689 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
690 (Sized_relobj_file::do_layout): Handle deferred sections properly
691 during GC pass 1. Don't add reloc sections to deferred list twice.
692 * object.h (Sized_relobj_file::is_deferred_layout): New function.
693 (Sized_relobj_file::is_deferred_layout_): New data member.
694
9d585188
L
6952014-11-21 H.J. Lu <hongjiu.lu@intel.com>
696
697 PR gold/17619
698 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
699 Check PC-relative offset overflow in PLT entry.
700
3ffaac20
AM
7012014-11-21 Alan Modra <amodra@gmail.com>
702
703 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
704 for undefined weaks.
705
0cfb0717
AM
7062014-11-20 Alan Modra <amodra@gmail.com>
707
708 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
709 from --stub-group-size parameter divided by 1024.
710 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
711 template parameter. Update all uses.
712 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
713 has_stub_value. Set for long branches. Don't report overflow for
714 branch to undefined weak symbols. Print info message on
715 overflowing branch to stub.
716
f9dffbf0
AM
7172014-11-20 Alan Modra <amodra@gmail.com>
718
719 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
720
e88ba8d5
L
7212014-11-13 H.J. Lu <hongjiu.lu@intel.com>
722
723 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
724 entry for R_X86_64_GOTPLT64.
725 (Target_x86_64<size>::Relocate::relocate): Update comments for
726 R_X86_64_GOTPLT64.
727
d37ffe25
ED
7282014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
729
730 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
731 * plugin.h: add lock definition
732
9726c3c1
HS
7332014-10-29 Han Shen <shenhan@google.com>
734 Jing Yu <jingyu@google.com>
735
736 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
737 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
738 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
739 Symbol::TLS_REF.
740 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
741 method.
742 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
743 (Target_aarch64::tls_ld_to_le): New method.
744 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
745 for 64bit targets.
746 (Output_data_plt_aarch64::irelative_rel_): New data member.
747 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
748 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
749 (Output_data_plt_aarch64::add_relocation): New method.
750 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
751 offset. Add got_irelative size to got size.
752 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
753 type string with the new typename.
754 (AArch64_relocate_functions::update_adr): Replace parameter x with
755 immed.
756 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
757 (AArch64_relocate_functions::reloc_common): New method.
758 (AArch64_relocate_funcsions::rela_general): Extract common part out
759 into reloc_common method.
760 (AArch64_relocate_functions::rela_general): Likewise.
761 (AArch64_relocate_functions::pcrela_general): Likewise.
762 (AArch64_relocate_functions::adr): New method.
763 (AArch64_relocate_functions::adrp): Calculate immed before calling
764 update_adr.
765 (AArch64_relocate_functions::adrp): Likewise.
766 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
767 comparing x to 0. Calculate immed from ~x when x < 0.
768 (Target_aarch64::optimize_tls_reloc): Add new cases for
769 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
770 TLSLD_MOVW_DTPREL_G0_NC.
771 (Target_aarch64::possible_function_pointer_reloc): Implement this
772 method.
773 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
774 comment.
775 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
776 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
777 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
778 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
779 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
780 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
781 (Target_aarch64::make_plt_entry): Call add_entry with two more
782 parameters.
783 (Target_aarch64::make_local_ifunc_plt_entry): New method.
784 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
785 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
786 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
787 (Target_aarch64::Relocate::relocate_tls): Add cases for
788 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
789 TLSLD_MOVW_DTPREL_G0_NC.
790 * testsuite/icf_safe_so_test.cc: Correct test comment.
791 * testsuite/icf_safe_test.sh: Add AArch64 arch.
792
80272b8c
AM
7932014-10-22 Alan Modra <amodra@gmail.com>
794
795 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
796 thread_starter.
797
998a69f4
AS
7982014-10-18 Andreas Schwab <schwab@linux-m68k.org>
799
800 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
801
aed56ec5
CC
8022014-10-17 Cary Coutant <ccoutant@google.com>
803
804 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
805 Add "typename" keyword.
806
bb779192 8072014-10-15 Han Shen <shenhan@google.com>
83a01957
HS
808 Jing Yu <jingyu@google.com>
809
810 Patch for gold aarch64 backend to support relaxation.
811 * aarch64-reloc.def: Change format.
812 * aarch64.cc (class Reloc_stub): New class.
813 (class Stub_table): New class.
814 (class AArch64_relobj): New class.
815 (class AArch64_input_section): New class.
816 (class AArch64_output_section): New class.
817 (Target_aarch64::new_stub_table): New method.
818 (Target_aarch64::new_aarch64_input_section): New method.
819 (Target_aarch64::find_aarch64_input_section): New method.
820 (Target_aarch64::scan_section_for_stubs): New method.
821 (Target_aarch64::scan_reloc_section_for_stubs): New method.
822 (Target_aarch64::relocate_stub): New method.
823 (Target_aarch64::current_target): New method.
824 (Target_aarch64::do_make_elf_object): New method.
825 (Target_aarch64::do_may_relax): New method.
826 (Target_aarch64::do_relax): New method.
827 (Target_aarch64::group_sections): New method.
828 (Target_aarch64::scan_reloc_for_stub): New method.
829 (Target_aarch64::do_make_output_section): New method.
830 (Target_aarch64::stub_tables_): New data member.
831 (Target_aarch64::aarch64_input_section_map_): New data member.
832 (AArch64_relocate_functions::maybe_apply_stub): New method.
833
db4c9594
CC
8342014-09-30 Cary Coutant <ccoutant@google.com>
835
836 PR gold/17432
837 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
838
cd6da036
KC
8392014-09-30 Kito Cheng <kito@0xlab.org>
840
841 PR gold/13597
842 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
843 hash table before sysv-style hash table.
844
5f772412
ST
8452014-09-29 Sriraman Tallam <tmsriram@google.com>
846
847 * options.h (--pic-executable): Add negative to alias to -no-pie.
848
5efeedf6
CC
8492014-09-26 Cary Coutant <ccoutant@google.com>
850
851 PR gold/16773
852 * object.cc (Sized_relobj_file): Compute value of section symbols
853 for TLS sections the same as TLS symbols.
854
1707f183
CC
8552014-09-25 Cary Coutant <ccoutant@google.com>
856
857 PR gold/17432
858 * resolve.cc (Symbol_table::resolve): Override common placeholder
859 symbols, but adjust sizes.
860 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
861 symbols to common lists.
862
00cac886
AM
8632014-09-24 Alan Modra <amodra@gmail.com>
864
865 * po/POTFILES.in: Regenerate.
866
635aa30e
CC
8672014-09-23 Taiju Tsuiki <tzik@google.com>
868 Cary Coutant <ccoutant@google.com>
869
71b9b91b 870 PR gold/14860
635aa30e
CC
871 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
872 on input_sections_blocker.
873 * layout.cc (Write_sections_task::locks): Unblock
874 input_sections_blocker_.
875 * layout.h (Write_sections_task::Write_sections_task): Add
876 input_sections_blocker.
877 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
878 to DEPENDENCIES.
879 * testsuite/Makefile.in: Regenerate.
880
c0c71592
RÁE
8812014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
882
883 * testsuite/Makefile.am (plugin_test_10): New test.
884 * testsuite/Makefile.in: Regenerate
885 * testsuite/plugin_common_test_2.c (c1): Align to 8.
886 * testsuite/plugin_test_10.sh: New file.
887
6168c2a1
RÁE
8882014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
889
890 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
891 * resolve.cc (Symbol_table::resolve): Don't override common symbols
892 during the replacement phase.
893
3a531937
JY
8942014-09-17 Han Shen <shenhan@google.com>
895 Jing Yu <jingyu@google.com>
896
897 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
898 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
899 * aarch64.cc (Target_aarch64): Add data members
900 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
901 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
902 constructor.
903 (Target_aarch64::do_reloc_symbol_index): New method.
904 (Target_aarch64::do_reloc_addend): New method.
905 (Target_aarch64::add_tlsdesc_info): New method.
906 (Target_aarch64::do_dynsym_value): New method.
907 (Target_aarch64::do_make_data_plt): Add new parameters: got,
908 got_irelative. Pass them to Output_data_plt_aarch64_standard.
909 (Target_aarch64::make_data_plt): Add new parameters: got,
910 got_irelative. Pass them to do_make_data_plt.
911 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
912 (Target_aarch64::Relocate:tls_gd_to_le): New method.
913 (Target_aarch64::Relocate:tls_ie_to_le): New method.
914 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
915 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
916 (Target_aarch64::got_tlsdesc_section): New method.
917 (Target_aarch64::make_local_ifunc_plt_entry): New method.
918 (Target_aarch64::define_tls_base_symbol): New method.
919 (Target_aarch64::reserve_tlsdesc_entries): New method.
920 (Target_aarch64::got_mod_index_entry): New method.
921 (Target_aarch64::rela_tlsdesc_section): New method.
922 (Target_aarch64::rela_irelative_section): New method.
923 (Target_aarch64::Tlsdesc_info): New struct.
924 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
925 relocations and tlsdesc relocations.
926 (Target_aarch64::optimize_tls_reloc): Implement method.
927 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
928 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
929 in constructor.
930 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
931 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
932 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
933 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
934 (Output_data_plt_aarch64::rela_tlsdesc): New method.
935 (Output_data_plt_aarch64::rela_irelative): New method.
936 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
937 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
938 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
939 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
940 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
941 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
942 (Output_data_plt_aarch64_standard): New member variables:
943 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
944 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
945 New parameter: got, got_irelative.
946 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
947 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
948 (Output_data_plt_aarch64::do_write): Replace got_address with
949 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
950 (AArch64_relocate_functions::update_movnz): New method.
951 (AArch64_relocate_functions): Correct format.
952 (AArch64_relocate_functions::movnz): New method.
953 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
954 before the switch. Add new cases to switch.
00cac886 955 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
956 tlsgd tlsdesc cases.
957 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
958 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
959 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
960 Call reloc_name_in_error_message to print unsupported reloc.
961 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
962 make_data_plt.
963 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
964 relocs. Fill in some more dynamic tags.
965 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
966 Skip call tls_get_addr when tlsgd is relaxed.
967 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
968 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
969 tlsdesc->ie relaxation.
970
62661c93
SS
9712014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
972
973 * mips.cc (Target_mips_nacl): New class.
974 (Target_selector_mips_nacl): New class.
975 (target_selector_mips32): Rename from target_selector_mips32be and use
976 Target_selector_mips_nacl instead of Target_selector_mips.
977 (target_selector_mips32el): Rename from target_selector_mips32 and use
978 Target_selector_mips_nacl instead of Target_selector_mips.
979 (target_selector_mips64): Rename from target_selector_mips64be and use
980 Target_selector_mips_nacl instead of Target_selector_mips.
981 (target_selector_mips64el): Rename from target_selector_mips64 and use
982 Target_selector_mips_nacl instead of Target_selector_mips.
983 (Target_mips::mips_info): Add const attribute.
984
54674d38
CC
9852014-09-02 Cary Coutant <ccoutant@google.com>
986
987 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
988 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
989 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
990 (Sized_incr_dynobj::do_section_name): Likewise.
991 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
992 (Sized_incr_dynobj::do_section_name): Likewise.
993 * object.h (Object::section_name): Likewise.
994 (Object::do_section_name): Likewise.
995 (Sized_relobj_file::do_section_name): Likewise.
996 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
997 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
998
9860cbcf
CC
9992014-09-02 Cary Coutant <ccoutant@google.com>
1000
1001 PR gold/17005
1002 * ehframe.cc (Fde::write): Add output_offset parameter.
1003 (Cie::write): Likewise.
1004 (Eh_frame::set_final_data_size): Account for offset within output
1005 section.
1006 (Eh_frame::do_sized_write): Likewise.
1007 * ehframe.h (Fde::write): Add output_offset parameter.
1008 (Cie::write): Likewise.
1009 * output.cc (Output_section::Input_section_sort_entry): Remove
1010 section_has_name_; add output_section_name parameter. Use
1011 output section name for non-input sections.
1012 (Output_section::Input_section_sort_entry::section_has_name): Remove.
1013 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
1014 (Output_section::Input_section_sort_compare): Remove logic for
1015 sections without names.
1016 (Output_section::Input_section_sort_init_fini_compare): Likewise.
1017 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
1018 Likewise.
1019 (Output_section::Input_section_sort_section_name_compare): Likewise.
1020
8e33481e
HS
10212014-08-29 Han Shen <shenhan@google.com>
1022 Jing Yu <jingyu@google.com>
1023
1024 * aarch64-reloc-property.cc
1025 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
1026 reference reloc property in the table.
1027 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
1028 3 other entries.
1029 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
1030 2 new overloaded methods.
1031 (Output_data_got_aarch64::do_write): Add code to write out
1032 static relocs.
1033 (class Output_data_got_aarch64::Static_reloc): New class to wrap
1034 static relocs.
1035 (Output_data_got_aarch64::static_relocs): New vector to
1036 hold static relocs.
1037 (Target_aarch64::TCB_SIZE): New const static memeber.
1038 (Target_aarch64::tcb_size): New method.
1039 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
1040 (Target_aarch64::Relocate::relocate_tls): New method.
1041 (Target_aarch64::Scan::local): Add code handling new reloc types.
1042 (Target_aarch64::Scan::global): Add code handling new reloc types.
1043
81233653
ST
10442014-08-13 Sriraman Tallam <tmsriram@google.com>
1045
1046 * options.h (-no-pie): Add option.
1047
9363c7c3
JY
10482014-08-08 Jing Yu <jingyu@google.com>
1049 Han Shen <shenhan@google.com>
1050
1051 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
1052 (DEFFILES): add aarch64-reloc.def.
1053 (TARGETSOURCES): Add aarch64-reloc-property.cc.
1054 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
1055 * Makefile.in: Regenerate.
1056 * aarch64-reloc-property.cc: New file.
1057 * aarch64-reloc-property.h: New file.
1058 * aarch64-reloc.def: New file.
1059 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
1060 with tab to make the format consistent.
1061 (Output_data_got_aarch64::symbol_table_): New method.
1062 (Target_aarch64::do_plt_address_for_global): New method.
1063 (Target_aarch64::do_plt_address_for_local): New method.
1064 (Target_aarch64::do_select_as_default_target): New method.
1065 (Target_aarch64::do_make_data_plt): New method.
1066 (Target_aarch64::make_data_plt): New method.
1067 (Output_data_plt_aarch64::has_irelative_section): New method.
1068 (Output_data_plt_aarch64::address_for_global): New method.
1069 (Output_data_plt_aarch64::address_for_local): New method.
1070 (Output_data_plt_aarch64::irelative_rel_): New parameter.
1071 (Output_data_plt_aarch64::add_entry): Implement contents.
1072 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
1073 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
1074 the got_pov entry to plt0.
1075 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
1076 Implement contents.
1077 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
1078 (AArch64_howto): New struct.
1079 (aarch64_howto[]): New static const array.
1080 (AArch64_relocate_functions): New class.
1081 (Target_aarch64::Scan::get_reference_flags): Remove method.
1082 (Target_aarch64::Scan::local): Implement to support a few relocations.
1083 (Target_aarch64::Scan::global): Implement to support a few relocations.
1084 (Target_aarch64::make_plt_section): Implement contents.
1085 (Target_aarch64::make_plt_entry): Implement contents.
1086 (Target_aarch64::do_finalize_sections): Implement contents.
1087 (Target_aarch64::Relocate::relocate): Implement a few relocations.
1088 (Target_aarch64::relocate_section): Implement contents.
1089
ad9fe6c1
AM
10902014-08-06 Alan Modra <amodra@gmail.com>
1091
1092 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
1093
7cd4e5b7
AM
10942014-08-06 Alan Modra <amodra@gmail.com>
1095
1096 PR 13227
1097 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
1098
5ad9b0a7
ST
10992014-07-21 Sriraman Tallam <tmsriram@google.com>
1100
1101 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 1102 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 1103
e051745c
CC
11042014-07-08 Cary Coutant <ccoutant@google.com>
1105
1106 * expression.cc (struct Expression::Expression_eval_info): Add
1107 new fields type_pointer, vis_pointer, and nonvis_pointer.
1108 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
1109 nonvis_pointer parameters. Adjust all calls.
1110 (Symbol_expression::value): Update type, visibility, and nonvis bits
1111 in caller.
1112 * script.cc (Symbol_assignment::sized_finalize): Update type,
1113 visibility, and remaining st_other bits for new symbol.
1114 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
1115 vis_pointer, and nonvis_pointer parameters.
1116 * symtab.h (Symbol::set_type): New method.
1117
1118 * testsuite/Makefile.am (defsym_test): New test.
1119 * testsuite/Makefile.in: Regenerate.
1120 * testsuite/defsym_test.c: New file.
1121 * testsuite/defsym_test.sh: New file.
1122
f35c4853
CC
11232014-07-08 Cary Coutant <ccoutant@google.com>
1124
1125 PR gold/15639
1126 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
1127 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
1128 (Sized_dynobj::base_read_symbols): ...new method.
1129 * object.h (Sized_relobj_file::base_read_symbols): New method.
1130 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
1131 (Sized_relobj_file::base_read_symbols): ...new method.
1132 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
1133 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
1134 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
1135
2900af2d
AM
11362014-07-04 Alan Modra <amodra@gmail.com>
1137
1138 * po/POTFILES.in: Regenerate.
1139
053a4d68
JY
11402014-07-02 Jing Yu <jingyu@google.com>
1141
1142 * aarch64.cc: New file
1143 * Makefile.am (TARGETSOURCES): Add aarch64.cc
1144 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
1145 * Makefile.in: Regenerate.
1146 * configure.tgt: Add entries for aarch64*.
1147 * configure.ac: Likewise.
1148 * configure: Likewise.
1149
7b549045
AM
11502014-06-27 Alan Modra <amodra@gmail.com>
1151
1152 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
1153
cb818dbf
CC
11542014-06-24 Cary Coutant <ccoutant@google.com>
1155
1156 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
1157 sections.
1158 (Dwo_file::sized_read_unit_index): Likewise.
1159
9810d34d
SS
11602014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1161
1162 * mips.cc: New file.
1163 * Makefile.am (TARGETSOURCES): Add mips.cc
1164 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
1165 * configure.tgt: Add entries for mips*.
1166 * configure.ac: Likewise.
1167 * Makefile.in: Regenerate.
1168 * configure: Likewise.
1169
9baa787b
CC
11702014-06-09 Cary Coutant <ccoutant@google.com>
1171
1172 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
1173 unit_length is within section bounds.
1174
8f89af0a
CC
11752014-06-09 Cary Coutant <ccoutant@google.com>
1176
1177 PR gold/16980
1178 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
1179 map.
1180
a47622ac
AM
11812014-06-07 Alan Modra <amodra@gmail.com>
1182
1183 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
1184
4320c691
CC
11852014-06-06 Cary Coutant <ccoutant@google.com>
1186
1187 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
1188 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
1189 (Dwarf_pubnames_table::read_header): Likewise.
1190 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
1191 .debug_gnu_pubtypes.
1192
270c9937
JB
11932014-06-05 Joel Brobecker <brobecker@adacore.com>
1194
1195 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
1196 * Makefile.in, configure: Regenerate.
1197
397998fc
AM
11982014-06-03 Alan Modra <amodra@gmail.com>
1199
1200 * powerpc.cc (addis_12_2): Define.
1201 (Stub_table::do_write): Support fusion on ELFv2 stubs.
1202
61f5c66f
AM
12032014-06-03 Alan Modra <amodra@gmail.com>
1204
1205 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
1206 st_other output.
1207
f6971787
AM
12082014-06-02 Alan Modra <amodra@gmail.com>
1209
1210 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
1211 Only ignore relocs on ELFv1.
1212 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
1213
f6fb8322
CC
12142014-05-30 Cary Coutant <ccoutant@google.com>
1215
1216 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
1217 * testsuite/Makefile.in: Regenerate.
1218 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
1219
c23dd342
L
12202014-05-27 H.J. Lu <hongjiu.lu@intel.com>
1221
1222 PR gold/16945
1223 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
1224 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
1225
5fe7ffdc
AM
12262014-05-15 Alan Modra <amodra@gmail.com>
1227
1228 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
1229 Compare FDE contents with DW_CFA_nop rather than 0.
1230
a82bef93
ST
12312014-05-13 Sriraman Tallam <tmsriram@google.com>
1232
1233 * symtab.h (may_need_copy_reloc): Remove check for position independent
1234 code.
1235 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
1236 position independence before pc absolute may_need_copy_reloc call.
1237 Add check for executable output befor pc relative may_need_copy_reloc
1238 call.
1239 * i386.cc: Ditto.
1240 * arm.cc: Ditto.
1241 * sparc.cc: Ditto.
1242 * tilegx.cc: Ditto.
1243 * powerpc.cc: Add check for no position independence before
1244 may_need_copy_reloc calls.
1245 * testsuite/pie_copyrelocs_test.cc: New file.
1246 * testsuite/pie_copyrelocs_shared_test.cc: New file.
1247 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 1248 * Makefile.in: Regenerate.
a82bef93 1249
53c66605
ML
12502014-05-08 Martin Liška <mliska@suse.cz>
1251
1252 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
1253
57b2284c
CC
12542014-05-06 Cary Coutant <ccoutant@google.com>
1255
1256 PR gold/16900
1257 * i386.cc (Output_data_got_plt_i386): New class.
1258 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
1259 parameter. Change all callers.
1260 (Output_data_plt_i386::layout_): Remove.
1261 (Output_data_plt_i386::got_plt_): Change type.
1262 (Target_i386::got_plt_): Change type. Change all references.
1263 (Target_i386::got_section): Create instance of new class.
1264 (Output_data_got_plt_i386::do_write): New function.
1265 * x86_64.cc (Output_data_got_plt_x86_64): New class.
1266 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
1267 parameter. Change all callers.
1268 (Output_data_plt_x86_64::layout_): Remove.
1269 (Output_data_plt_x86_64::got_plt_): Change type.
1270 (Target_x86_64::got_plt_): Change type. Change all references.
1271 (Target_x86_64::got_section): Create instance of new class.
1272 (Output_data_got_plt_x86_64::do_write): New function.
1273 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
1274 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
1275 class.
1276
6b97515d 12772014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 1278
6b97515d
CC
1279 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
1280 if we have pubnames/pubtypes.
1281
d1bddd3c
CC
12822014-05-02 Cary Coutant <ccoutant@google.com>
1283
5fe7ffdc
AM
1284 * defstd.cc (in_segment): Define __ehdr_start here...
1285 * layout.cc (Layout::finalize): ...Instead of here. Set the
1286 output segment when known.
1287 * resolve.cc (Symbol::override_base_with_special): Remember
1288 the original binding.
1289 * symtab.cc (Symbol::set_output_segment): New function.
1290 (Symbol::set_undefined): New function.
1291 * symtab.h (Symbol::is_weak_undefined): Check original undef
1292 binding.
1293 (Symbol::is_strong_undefined): New function.
1294 (Symbol::set_output_segment): New function.
1295 (Symbol::set_undefined): New function.
1296 * target-reloc.h (is_strong_undefined): Remove.
1297 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
1298 Check for hidden undefs.
1299 (relocate_section): Call Symbol::is_strong_undefined.
1300
1301 * testsuite/Makefile.am (ehdr_start_test_1)
1302 (ehdr_start_test_2, ehdr_start_test_3)
1303 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
1304 * testsuite/Makefile.in: Regenerate.
1305 * testsuite/ehdr_start_def.cc: New source file.
1306 * testsuite/ehdr_start_test.cc: New source file.
1307 * testsuite/ehdr_start_test.t: New linker script.
1308 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 1309
7849f6d8
CC
13102014-04-23 Cary Coutant <ccoutant@google.com>
1311
bf2cc635 1312 PR gold/16870
7849f6d8
CC
1313 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
1314
99fd8cff
CC
13152014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1316
1317 * layout.cc (Layout::include_section): Allow a target to decide
1318 whether to include a section.
1319 * target.h (Target::should_include_section): New function.
1320 (Target::do_should_include_section): New function.
1321
91f43acd
CC
13222014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1323
1324 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
1325 inline into ...
1326 (Copy_relocs::emit): ... here.
1327 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
1328 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
1329 (Copy_reloc_entry::entries_): Change from private to protected.
1330
c4eb27e1
ST
13312014-04-02 Sriraman Tallam <tmsriram@google.com>
1332
1333 * icf.cc (get_section_contents): Replace copies of reloc
1334 vectors with const references.
1335
ae447ddd
CC
13362014-04-02 Cary Coutant <ccoutant@google.com>
1337
1338 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
1339 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
1340 * configure: Regenerate.
1341 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
1342 -fno-use-linker-plugin.
1343 (LINK1, CXXLINK1): Add it to the link command.
1344 * testsuite/Makefile.in: Regenerate.
1345
fa47fa92
AM
13462014-03-12 Alan Modra <amodra@gmail.com>
1347
1348 * Makefile.in: Regenerate.
1349
9b12c500
CC
13502014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1351
1352 * symtab.h (Symbol::set_nonvis): New function.
1353
beacaa96
CC
13542014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1355
1356 * symtab.cc (Sized_symbol<32>::init_output_data):
1357 Instantiate the template.
1358 (Sized_symbol<64>::init_output_data): Likewise.
1359
800d9823
CC
13602014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1361
1362 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
1363 adjust dynamic symbol value.
1364 * target.h (Target::adjust_dyn_symbol): New function.
1365 (Target::do_adjust_dyn_symbol): New function.
1366
918fc1f8 13672014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 1368
918fc1f8
CC
1369 * output.cc (Output_data_dynamic::Dynamic_entry::write):
1370 Get the value of DYNAMIC_CUSTOM dynamic entry.
1371 * output.h (Output_data_dynamic::add_custom): New function.
1372 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
1373 dynamic entry.
1374 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
1375 * target.h (Target::dynamic_tag_custom_value): New function.
1376 (Target::do_dynamic_tag_custom_value): New function.
1377
98ff9231
CC
13782014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1379
1380 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
1381 dynsym indexes.
1382 * target.h (Target::has_custom_set_dynsym_indexes): New function.
1383 (Target::do_has_custom_set_dynsym_indexes): New function.
1384 (Target::set_dynsym_indexes): New function.
1385 (Target::do_set_dynsym_indexes): New function.
1386
b80eed39
AM
13872014-03-07 Alan Modra <amodra@gmail.com>
1388
1389 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
1390 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
1391 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
1392 (Powerpc_relocate_functions::has_overflow_bitfield,
1393 overflowed): Use the above.
1394 (Target_powerpc::Relocate::relocate): Correct overflow checking
1395 for a number of relocations. Modify overflow test for 16-bit
1396 fields in instructions to signed/unsigned according to whether
1397 the field takes a signed or unsigned value.
1398
4b95cf5c
AM
13992014-03-05 Alan Modra <amodra@gmail.com>
1400
1401 Update copyright years.
1402
45965137
AM
14032014-03-05 Alan Modra <amodra@gmail.com>
1404
1405 * powerpc.cc (Target_powerpc::Scan::local, global): Support
1406 R_PPC64_ADDR64_LOCAL.
1407 (Target_powerpc::Relocate::relocate): Likewise.
1408
2c80b753
AM
14092014-03-03 Alan Modra <amodra@gmail.com>
1410
1411 * dwp.cc (print_version): Update copyright year to current.
1412
c1c69e83
AM
14132014-02-10 Alan Modra <amodra@gmail.com>
1414
1415 * po/gold.pot: Regenerate.
1416
dd0c4e70
CC
14172014-02-06 Cary Coutant <ccoutant@google.com>
1418
1419 Fix problem where -u is ignored when a weak undef is seen.
1420
1421 * archive.cc (Library_base::should_include_member): Reorder
1422 code to check for -u option if a weak undef has already been seen.
1423 * testsuite/Makefile.am (weak_undef_test_2): New test case.
1424 * testsuite/Makefile.in: Regenerate.
1425 * testsuite/weak_undef_file3.cc: New file.
1426 * testsuite/weak_undef_file4.cc: New file.
1427 * testsuite/weak_undef_test_2.cc: New file.
1428
1a221d3d
CC
14292014-02-05 Cary Coutant <ccoutant@google.com>
1430
1431 Fix issues with gold undefined symbol diagnostics.
1432
1433 PR binutils/15435
1434 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
1435 check to here.
1436 * target-reloc.h (is_strong_undefined): New function.
1437 (relocate_section): Move undef vtable symbol check from here.
1438 Check for is_strong_undefined.
1439
e889f0a4 14402014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 1441
e889f0a4
CC
1442 Fix problems with the --dynamic-list option.
1443
1444 PR gold/13577
1445 * options.cc (General_options::parse_dynamic_list):
1446 Set have_dynamic_list_.
1447 (General_options::General_options): Initialize have_dynamic_list_.
1448 (General_options::finalize): Turn off -Bsymbolic and
1449 -Bsymbolic-functions if --dynamic-list provided.
1450 * options.h (General_options::have_dynamic_list): New function.
1451 (General_options::have_dynamic_list_): New data member.
1452 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
1453 correctly.
5fe7ffdc 1454
e889f0a4
CC
1455 PR gold/16530
1456 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
1457 in --dynamic-list, mark it.
5fe7ffdc 1458
e889f0a4
CC
1459 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
1460 (dynamic_list_2): New test case.
1461 * testsuite/Makefile.in: Regenerate.
1462 * testsuite/dynamic_list_2.cc: New file.
1463 * testsuite/dynamic_list_2.t: New file.
1464 * testsuite/dynamic_list_lib1.cc: New file.
1465 * testsuite/dynamic_list_lib2.cc: New file.
1466 * testsuite/gc_dynamic_list_test.c: New file.
1467 * testsuite/gc_dynamic_list_test.sh: New file.
1468 * testsuite/gc_dynamic_list_test.t: New file.
1469
ec673e64
CC
14702014-01-28 Cary Coutant <ccoutant@google.com>
1471
1472 Add .gdb_index version 7 support.
1473
1474 * gold/dwarf_reader.cc: include <utility> (for make_pair).
1475 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
1476 debug sections.
1477 (Dwarf_ranges_table::read_ranges_table): Likewise.
1478 (Dwarf_pubnames_table::read_section): Check for GNU-style
1479 sections, and for compressed debug sections.
1480 (Dwarf_pubnames_table::read_header): Compute end address of table.
1481 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
1482 for end of list by offset, not by offset == 0.
1483 (Dwarf_info_reader::do_read_string_table): Check for compressed
1484 debug sections.
1485 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1486 Initialize new data members.
1487 (Dwarf_pubnames_table::next_name): return flag_byte.
1488 (Dwarf_pubnames_table::end_of_table_): New data member.
1489 (Dwarf_pubnames_table::is_gnu_style_): New data member.
1490 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
1491 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
1492 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
1493 read skeleton type unit DIEs.
1494 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
1495 (Gdb_index::do_write): Write flag_byte.
1496 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
1497 (Gdb_index::Cu_vector): Store flags along with cu indexes.
1498 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
1499 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
1500
221fd5d5
L
15012014-01-08 H.J. Lu <hongjiu.lu@intel.com>
1502
1503 * version.cc (print_version): Update copyright year to 2014.
1504
6c09fb0b
ILT
15052013-12-19 Dimitry Andric <dimitry@andric.com>
1506
1507 * stringpool.cc (Stringpool_template::reserve): Add
1508 HAVE_UNORDERED_MAP case.
1509 * stringpool.cc (Stringpool_template::print_stats): Likewise.
1510
8356f2d0
CC
15112013-12-18 Cary Coutant <ccoutant@google.com>
1512
1513 * configure.ac: Check for <unordered_set> and <unordered_map>.
1514 * config.in: Regenerate.
1515 * configure: Regenerate.
1516 * system.h: Use <unordered_set> and <unordered_map> if available.
1517
f2c7d7ee
RM
15182013-12-10 Roland McGrath <mcgrathr@google.com>
1519
1520 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
1521 with $(INSTALL_PROGRAM_ENV).
1522 * Makefile.in: Regenerate.
1523
6632e8cc
CC
15242013-11-22 Cary Coutant <ccoutant@google.com>
1525
1526 * configure.ac: Add check for which library is needed for
1527 dlopen.
1528 * configure: Regenerate.
1529
0c075858
CC
15302013-11-22 Cary Coutant <ccoutant@google.com>
1531
1532 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
1533 assembler.
1534 * testsuite/Makefile.in: Regenerate.
1535
f49fe902
L
15362013-11-17 H.J. Lu <hongjiu.lu@intel.com>
1537
1538 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
1539 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
1540 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
1541 (Target_x86_64<size>::Scan::local): Likewise.
1542 (Target_x86_64<size>::Scan::global): Likewise.
1543 (Target_x86_64<size>::Relocate::relocate): Likewise.
1544 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
1545 Likewise.
1546 (Target_x86_64<size>::Scan::check_non_pic(): Handle
1547 R_X86_64_PC32_BND.
1548
1549 * testsuite/Makefile.am (check_PROGRAMS): Add
1550 exception_x86_64_bnd_test.
1551 (exception_x86_64_bnd_test_SOURCES): New macro.
1552 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
1553 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
1554 (exception_x86_64_bnd_test_LDADD): Likewise.
1555 (exception_x86_64_bnd_1.o): New rule.
1556 (exception_x86_64_bnd_2.o): Likewise.
1557 * testsuite/Makefile.in: Regenerated.
1558
9055360d
AM
15592013-11-15 Alan Modra <amodra@gmail.com>
1560
1561 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
1562 accessor.
1563 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
1564 Only call ppc64_local_entry_offset for 64-bit. Restrict
1565 symval_for_branch lookup to ELFv1.
1566 (Stub_table::add_plt_call_entry): Use unsigned int off.
1567 (Output_data_glink::Address, invalid_address): New.
1568 (Output_data_glink::add_eh_frame): Move out of line. Add
1569 support for ELFv2.
1570 (Output_data_glink::add_global_entry, find_global_entry,
1571 global_entry_address): New functions.
1572 (Output_data_glink::global_entry_stubs_, end_branch_table_,
1573 ge_size): New variables.
1574 (Output_data_glink::set_final_data_size): Add global entry
1575 stub sizing.
1576 (Output_data_glink::do_write): Write global entry stubs.
1577 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
1578 parameter. Return true for ELFv2. Adjust callers.
1579 (Target_powerpc::Scan::local, global): Restrict opd lookup to
1580 ELFv1. Similarly for ifunc and dynamic relocation processing
1581 specific to ELFv1. Recognize that symbols are defined on
1582 their plt entries for ELFv2.
1583 (Target_powerpc::symval_for_branch): Assert if called for
1584 ELFv2 or ppc32.
1585 (Target_powerpc::Relocate::relocate): Use global entry plt
1586 stub for symbol value if such exists on ELFv2.
1587 (Target_powerpc::Relocate::relocate): Don't call
1588 symval_for_branch when ELFv2. Do adjust for local entry
1589 offset when ELFv2.
1590 (Target_powerpc::do_dynsym_value): Set symbols to global entry
1591 plt stub for ELFv2.
1592 (Target_powerpc::do_plt_address_for_global): Similarly.
1593
cafdd569
CC
15942013-11-14 Cary Coutant <ccoutant@google.com>
1595
1596 Revert patch -- this did not fix the problem, and there is
1597 no race there.
1598
1599 2013-11-14 Cary Coutant <ccoutant@google.com>
1600
1601 PR gold/14860
1602 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1603 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1604 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1605 updating fde_offsets_.
1606 (Eh_frame_hdr::lock_): New data member.
1607
94e49e16
CC
16082013-11-14 Cary Coutant <ccoutant@google.com>
1609
1610 * dwp.cc (Dwo_file_entry): New type.
1611 (File_list): Use Dwo_file_entry.
1612 (Dwo_file::verify): New function.
1613 (Dwo_file::verify_dwo_list): New function.
1614 (Dwo_file::sized_verify_dwo_list): New function.
1615 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
1616 list.
1617 (Dwp_options): New enum type.
1618 (dwp_options): Add --verify-only.
1619 (usage): Likewise.
1620 (main): Likewise.
1621 * dwp.h (gold_info): Add declaration.
1622
7cdd7d57
CC
16232013-11-14 Cary Coutant <ccoutant@google.com>
1624
1625 PR gold/14860
1626 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1627 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1628 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1629 updating fde_offsets_.
1630 (Eh_frame_hdr::lock_): New data member.
1631
1d946cb3
CC
16322013-11-06 Cary Coutant <ccoutant@google.com>
1633
1634 PR gold/15758
1635 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
1636 before reloc sections.
1637
4f65b40e
AM
16382013-11-04 Alan Modra <amodra@gmail.com>
1639
1640 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
1641 (Symbol::needs_dynamic_reloc): Test new flag.
1642 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
1643 (Target_powerpc::Scan::get_reference_flags): Add target param.
1644 Return FUNC_DESC_ABI for 64-bit ELFv1.
1645 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
1646 call.
1647 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
1648 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
1649
908794a9
CC
16502013-10-31 Cary Coutant <ccoutant@google.com>
1651
1652 Restore support for dwp v2 DWARF package file format.
1653
1654 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1655 tu_length parameter. Adjust all callers.
1656 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1657 * dwp.cc: Include dwarf.h.
1658 (Section_bounds): New struct type.
1659 (Unit_set): New struct type.
1660 (Dwo_file::Dwo_file): Initialize new data member.
1661 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1662 Combine and rename to...
1663 (Dwo_file::read_unit_index): ...this.
1664 (Dwo_file::sized_read_compunit_index)
1665 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1666 (Dwo_file::sized_read_unit_index): ...this.
1667 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1668 parameters; add section_id parameter.
1669 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1670 (Dwo_file::add_unit_set): ...this.
1671 (Dwo_file::shndx_map_): Remove.
1672 (Dwo_file::sect_offsets_): New data member.
1673 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1674 (Dwp_output_file::add_section): Rename to...
1675 (Dwp_output_file::add_contribution): ...this.
1676 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1677 (Dwp_output_file::add_tu_set): Likewise.
1678 (Dwp_output_file::Contribution): New type.
1679 (Dwp_output_file::Section::contributions): New data member.
1680 (Dwp_output_file::Cu_or_tu_set): Remove.
1681 (Dwp_output_file::Section::Section): New ctor.
1682 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1683 (Dwp_output_file::Dwp_index::Section_table): New type.
1684 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1685 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1686 parameter.
1687 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1688 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1689 (Dwp_output_file::Dwp_index::section_table): New member function.
1690 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1691 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1692 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1693 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1694 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1695 (Dwp_output_file::Dwp_index::section_table_): New data member.
1696 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1697 (Dwp_output_file::add_output_section): New member function.
1698 (Dwp_output_file::write_new_section): New member function.
1699 (Dwp_output_file::write_contributions): New member function.
1700 (Dwp_output_file::section_id_map_): New data member.
1701 (class Dwo_id_info_reader): Remove.
1702 (class Unit_reader): New class.
1703 (get_dwarf_section_name): New function.
1704 (Dwo_file::read_executable): Adjust initializations of class data.
1705 (Dwo_file::read): Add support for v2 package file format.
1706 (Dwo_file::read_unit_index): Likewise.
1707 (Dwo_file::sized_read_unit_index): Likewise.
1708 (Dwo_file::copy_section): Likewise.
1709 (Dwo_file::add_unit_set): Likewise.
1710 (Dwp_output_file::add_output_section): Likewise.
1711 (Dwp_output_file::add_contribution): Likewise.
1712 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1713 for empty slot.
1714 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1715 file format.
1716 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1717 slot.
1718 (Dwp_output_file::initialize): Remove unused function.
1719 (Dwp_output_file::finalize): Add support for v2 package file format.
1720 (Dwp_output_file::write_index): Likewise.
1721 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1722 function prototype.
1723
2500c017
CC
17242013-10-31 Cary Coutant <ccoutant@google.com>
1725
1726 * configure.ac: Fix check for -fmerge-constants.
1727 * configure.ac: Regenerate.
1728
dd0845d7
RM
17292013-10-30 Roland McGrath <mcgrathr@google.com>
1730
1731 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
1732 Correct 9-byte nop sequence to match what the assembler generates.
1733
b4f7960d
AM
17342013-10-30 Alan Modra <amodra@gmail.com>
1735
1736 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
1737 ppc64_local_entry_offset, ppc64_local_entry_offset,
1738 do_read_symbols): New functions.
1739 (Powerpc_relobj::e_flags_, st_other_): New vars.
1740 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
1741 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
1742 (Powerpc_relobj::e_flags_): New var.
1743 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
1744 and adjust for ELFv2.
1745 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
1746 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
1747 (Powerpc_dynobj::do_find_special_sections): Likewise.
1748 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
1749 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
1750 to ELFv2 local entry.
1751 (Target_powerpc::do_relax): No thread safe barriers needed for
1752 ELFv2.
1753 (Output_data_plt_powerpc::initial_plt_entry_size_,
1754 plt_entry_size): Delete. Replace all uses with
1755 first_plt_entry_offset() and plt_entry_size().
1756 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
1757 reserved_size parm. Update callers.
1758 (Output_data_plt_powerpc::entry_count): Update.
1759 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
1760 and use Target_powerpc::first_plt_entry_offset().
1761 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
1762 rename to plt_entry_size.
1763 (Output_data_plt_powerpc::add_ifunc_entry,
1764 add_local_ifunc_entry): Adjust reloc for ELFv2.
1765 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
1766 (glink_eh_frame_fde_64v2): New.
1767 (Stub_table::plt_call_size): Support ELFv2 sizing.
1768 (Output_data_glink::add_eh_frame): Use the new FDE.
1769 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
1770 (Stub_table::do_write): Write ELFv2 stubs and glink.
1771 (Target_powerpc::Relocate::relocate): Replaces nop after call
1772 with ld 2,24(1) and adjust local offset destination for ELFv2.
1773
f9c6b907
AM
17742013-10-30 Alan Modra <amodra@gmail.com>
1775
1776 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
1777 (Target_powerpc::Scan::global, local): Likewise.
1778 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
1779 on all ppc64 @h and @ha relocs.
1780
e84fe78f
AM
17812013-10-14 Alan Modra <amodra@gmail.com>
1782
1783 * output.h (Output_data_got::add_constant): Tidy.
1784 (Output_data_got::add_constant_pair): New function.
1785 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
1786 methods used so as to first call reserve_ent().
1787
679e4abf
RM
17882013-10-11 Roland McGrath <mcgrathr@google.com>
1789
44dcb735
RM
1790 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
1791 add_got_entry and add_got_entry_pair.
1792
13323c49
RM
1793 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
1794 (HAVE_PUBNAMES): Likewise.
1795 * configure: Regenerate.
1796
1496b446
RM
1797 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
1798 * testsuite/Makefile.in: Regenerate.
1799
cc84c10b
RM
1800 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
1801 Remove const from declaration.
1802 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
1803 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
1804 * output.h (Output_file_header): Remove const from member target_
1805 and corresponding constructor argument.
1806 * output.cc (Output_file_header::Output_file_header): Update prototype.
1807 (Output_file_header::do_sized_write): Use this->target_ in place
1808 of parameters()->target().
1809
52f66a2c
RM
1810 * testsuite/undef_symbol.cc (Foo::get_a): New method.
1811
2b64b551
RM
1812 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
1813 * configure: Regenerate.
1814 * Makefile.in: Regenerate.
1815 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
1816 * testsuite/merge_string_literals_2.c: Likewise.
1817 * testsuite/Makefile.am
1818 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
1819 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
1820 literal -fmerge-constants.
1821 * testsuite/Makefile.in: Regenerate.
1822
43819297
RM
1823 * i386.cc (Target_i386): Remove unused member dynbss_.
1824 * arm.cc (Target_arm): Likewise.
1825 * powerpc.cc (Target_powerpc): Likewise.
1826 * sparc.cc (Target_sparc): Likewise.
1827 * tilegx.cc (Target_tilegx): Likewise.
1828 * x86_64.cc (Target_x86_64): Likewise.
1829 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
1830 type_signature_, type_offset_.
1831 * plugin.h (Plugin_hook): Remove unused member layout_.
1832 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
1833 mapfile_.
1834 (Read_member): Remove unused members input_objects_, symtab_,
1835 mapfile_, layout_.
1836 (Check_library): Remove unused member symtab_.
1837 * archive.h (Lib_group): Remove unused member lib_.
1838 * archive.cc (Lib_group::Lib_group): Update initializer.
1839 * incremental.h (Incremental_binary): Remove unused member target_.
1840 (Incremental_script_entry): Removed unused member script_.
1841 * layout.h (Write_symbols_task): Remove unused member input_objects_.
1842 * icf.h (Icf): Remove unused member num_tracked_relocs.
1843
39d9ead7
RM
1844 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
1845 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
1846 its only use.
1847 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
1848
679e4abf
RM
1849 * archive.h: Use struct rather than class for forward declaration
1850 of Read_symbols_data.
1851
54de2ea6
CC
18522013-10-07 Cary Coutant <ccoutant@google.com>
1853
1854 PR gold/16010
1855 * testsuite/Makefile.am (icf_test): Fix dependencies.
1856 (icf_safe_test): Likewise.
1857 (icf_safe_so_test): Likewise.
1858 (large_symbol_alignment): Add empty _LDADD rule.
1859 * testsuite/Makefile.in: Regenerate.
1860
b14016f0
L
18612013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
1862
1863 PR gold/15927
1864 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
1865 relocation for R_X86_64_32 on x32.
1866
eb426534
RM
18672013-08-27 Roland McGrath <mcgrathr@google.com>
1868
1869 * output.cc (Output_segment::set_section_addresses): Take new
1870 Target* argument. If target->isolate_execinstr() and the segment
1871 is executable and starts at a target->abi_pagesize() boundary,
1872 pad its end out to a target->abi_pagesize() boundary with code fill.
1873 * output.h (Output_segment::set_section_addresses): Update decl.
1874 * layout.h (Layout::check_output_data_for_reset_values): Take new
1875 argument RELAX_OUTPUTS.
1876 (Layout): New member relax_output_list_.
1877 (Layout::add_relax_output): New method.
1878 * layout.cc (Layout::Layout): Update constructor.
1879 (Layout::reset_relax_output): New method.
1880 (Layout::clean_up_after_relaxation): Call it.
1881 (Layout::prepare_for_relaxation): Update caller.
1882 (Layout::set_segment_offsets): Update callers of set_section_addresses.
1883 Call reset_relax_output before re-processing segments for
1884 isolate_execinstr case.
1885 (Layout::write_data): Handle relax_output_list_.
1886 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
1887 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
1888
9aff4b7a
NC
18892013-08-23 Yuri Chornoivan <yurchor@ukr.net>
1890
1891 PR binutils/15834
1892 * object.h: Fix typos.
1893
93f8221c
RM
18942013-08-16 Roland McGrath <mcgrathr@google.com>
1895
1896 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
1897 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
1898
e44c3715
CC
18992013-08-07 Cary Coutant <ccoutant@google.com>
1900
1901 Revert support for v2 DWP files:
1902
1903 2013-03-01 Cary Coutant <ccoutant@google.com>
1904
1905 Add dwp support for v2 DWARF package file format.
1906 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1907 tu_length parameter. Adjust all callers.
1908 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1909 * dwp.cc: Include dwarf.h.
1910 (Section_bounds): New struct type.
1911 (Unit_set): New struct type.
1912 (Dwo_file::Dwo_file): Initialize new data member.
1913 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1914 Combine and rename to...
1915 (Dwo_file::read_unit_index): ...this.
1916 (Dwo_file::sized_read_compunit_index)
1917 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1918 (Dwo_file::sized_read_unit_index): ...this.
1919 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1920 parameters; add section_id parameter.
1921 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1922 (Dwo_file::add_unit_set): ...this.
1923 (Dwo_file::shndx_map_): Remove.
1924 (Dwo_file::sect_offsets_): New data member.
1925 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1926 (Dwp_output_file::add_section): Rename to...
1927 (Dwp_output_file::add_contribution): ...this.
1928 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1929 (Dwp_output_file::add_tu_set): Likewise.
1930 (Dwp_output_file::Contribution): New type.
1931 (Dwp_output_file::Section::contributions): New data member.
1932 (Dwp_output_file::Cu_or_tu_set): Remove.
1933 (Dwp_output_file::Section::Section): New ctor.
1934 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1935 (Dwp_output_file::Dwp_index::Section_table): New type.
1936 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1937 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1938 parameter.
1939 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1940 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1941 (Dwp_output_file::Dwp_index::section_table): New member function.
1942 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1943 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1944 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1945 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1946 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1947 (Dwp_output_file::Dwp_index::section_table_): New data member.
1948 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1949 (Dwp_output_file::add_output_section): New member function.
1950 (Dwp_output_file::write_new_section): New member function.
1951 (Dwp_output_file::write_contributions): New member function.
1952 (Dwp_output_file::section_id_map_): New data member.
1953 (class Dwo_id_info_reader): Remove.
1954 (class Unit_reader): New class.
1955 (get_dwarf_section_name): New function.
1956 (Dwo_file::read_executable): Adjust initializations of class data.
1957 (Dwo_file::read): Add support for v2 package file format.
1958 (Dwo_file::read_unit_index): Likewise.
1959 (Dwo_file::sized_read_unit_index): Likewise.
1960 (Dwo_file::copy_section): Likewise.
1961 (Dwo_file::add_unit_set): Likewise.
1962 (Dwp_output_file::add_output_section): Likewise.
1963 (Dwp_output_file::add_contribution): Likewise.
1964 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1965 for empty slot.
1966 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1967 file format.
1968 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1969 slot.
1970 (Dwp_output_file::initialize): Remove unused function.
1971 (Dwp_output_file::finalize): Add support for v2 package file format.
1972 (Dwp_output_file::write_index): Likewise.
1973 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1974 function prototype.
1975
c6905c28
CC
19762013-07-31 Cary Coutant <ccoutant@google.com>
1977
1978 * object.cc (Sized_relobj::do_output_section_address): New function.
1979 (Sized_relobj): Instantiate explicitly.
1980 * object.h (Object::output_section_address): New function.
1981 (Object::do_output_section_address): New function.
1982 (Sized_relobj::do_output_section_address): New function.
1983 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
1984
19852013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 1986 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
1987
1988 * parameters.cc (Parameters::entry): Return target-specific entry
1989 symbol name.
1990 * target.h (Target::entry_symbol_name): New function.
1991 (Target_info::entry_symbol_name): New data member.
1992
1993 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
1994 * i386.cc (Target_i386::i386_info): Likewise.
1995 (Target_i386_nacl::i386_nacl_info): Likewise.
1996 * sparc.cc (Target_sparc::sparc_info): Likewise.
1997 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
1998 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
1999 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
2000 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2001
234d4ab8
SA
20022013-07-22 Sterling Augustine <saugustine@google.com>
2003
2004 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
2005 Convert parameter shndx to local variable. Add parameters symtab
2006 and symtab_size. Scan over section names. Find relocation
2007 section corresponding to current section. Create and initialize
2008 reloc_mapper_ and reloc_type_.
2009 (Dwarf_pubnames_table::read_header): Add assertion. Change
2010 unit_length to off_t. Initialize member unit_length_. Fill in field
2011 cu_offset_.
2012 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2013 Initialize new fields unit_length_ and cu_offset_.
2014 (Dwarf_pubnames_table::read_section): Update prototype.
2015 (Dwarf_pubnames_table::cu_offset): New member function.
2016 (Dwarf_pubnames_table::subsection_size): Likewise.
2017 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
2018 New fields.
2019 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
2020 member functions public.
2021 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
2022 Update comment. Rework logic. Move repeated parts to...
2023 (Gdb_index_info_reader::read_pubtable): ...here. New function.
2024 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
2025 pubtypes_table_, and stmt_list_offset.
2026 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2027 Gdb_index::find_pubtype_offset,
2028 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
2029 (Gdb_index::pubnames_read): Update prototype and rework logic.
2030 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
2031 Forward declare.
2032 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2033 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
2034 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
2035 Gdb_index::map_pubtable_to_dies):
2036 Declare functions.
2037 (Gdb_index::pubnames_read): Update declaration.
2038 (Gdb_index::Pubname_offset_map): New type.
2039 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
2040 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
2041 Gdb_index::stmt_list_offset): Declare.
2042 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
2043 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
2044 Gdb_index::pubtypes_offset_): Remove.
2045
a3ed37d8
RM
20462013-07-19 Roland McGrath <mcgrathr@google.com>
2047
2048 * options.h (General_options): Add -Trodata-segment option.
2049 * parameters.cc (Parameters::check_rodata_segment): New function.
2050 (Parameters::set_target_once): Call it.
2051 * parameters.h (Parameters): Declare it (private member function).
2052 * layout.cc (load_seg_unusable_for_headers): New function, broken
2053 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
2054 then validate rodata segment rather than text segment.
2055 (relaxation_loop_body): Call that.
2056 (is_text_segment): New function. Don't admit a non-executable
2057 segment if TARGET->isolate_execinstr().
2058 (set_segment_offsets): Call it. Honor -Trodata-segment option.
2059
eb5b4ded
CC
20602013-07-15 Shawn Landden <shawnlandden@gmail.com>
2061
2062 PR gold/15070
2063 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
2064 * nacl.h (Sniff_file::View::View): Request aligned view.
2065
4d5effb9
CC
20662013-07-11 Cary Coutant <ccoutant@google.com>
2067
2068 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
2069 correct BRLT entry size.
2070
ba8ca3e7
AM
20712013-07-03 Alan Modra <amodra@gmail.com>
2072
2073 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
2074 comment.
2075
267257d2
CC
20762013-07-01 Cary Coutant <ccoutant@google.com>
2077
2078 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
2079 reloc_type_.
2080 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
2081 (Dwarf_ranges_table::lookup_reloc): New function.
2082 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
2083 reloc_type_.
2084 (Dwarf_ranges_table::lookup_reloc): New function.
2085 (Dwarf_ranges_table::reloc_type_): New data member.
2086
06f30c9d
CC
20872013-06-27 Jing Yu <jingyu@google.com>
2088
2089 PR gold/15662
2090 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
2091 function.
2092 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
2093 (Target_powerpc::do_relax): Call the above.
2094
a2d7bf59
AM
20952013-06-27 Cary Coutant <ccoutant@google.com>
2096
2097 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
2098 on garbage collected .opd section.
2099
21002013-06-27 Alan Modra <amodra@gmail.com>
2101
2102 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
2103 is non-zero.
2104 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
2105 (Target_powerpc::do_function_location): Likewise for loc->shndx.
2106
32364e50
CC
21072013-06-14 Cary Coutant <ccoutant@google.com>
2108
2109 * resolve.cc (Symbol::override_base): Don't override st_type
2110 from plugin placeholder symbols.
2111 (Symbol_table::resolve): Likewise.
2112 (Symbol_table::should_override): Don't complain about TLS mismatch
2113 if the TO symbol is a plugin placeholder.
2114 * testsuite/Makefile.am (plugin_test_tls): New test.
2115 * testsuite/Makefile.in: Regenerate.
2116 * testsuite/plugin_test_tls.sh: New test script.
2117 * testsuite/two_file_test_2_tls.cc: New test source.
2118 * testsuite/two_file_test_tls.cc: New test source.
2119
7fb47cc9
CC
21202013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
2121
2122 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
2123 the maximum segment alignment is larger than the page size.
2124 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
2125 correctly aligns the symbols with large alignemnt.
2126 * testsuite/Makefile.in: Regenerate.
2127 * testsuite/large_symbol_alignment.cc: New file.
2128
6934001a
CC
21292013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
2130 Sriraman Tallam <tmsriram@google.com>
2131
2132 * options.h (sort_section): New option.
2133 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
2134 Rename from Input_section_sort_section_name_special_ordering_compare.
2135 (Input_section_sort_section_name_compare): New struct.
2136 * output.cc (Output_section::Input_section_sort_section_name_compare::
2137 operator()): New function.
2138 (Output_section::sort_attached_input_sections): Use new sort function
2139 for .text if --sort-section=name is specified.
2140 * layout.cc (Layout::make_output_section):
2141 Add sorting by name when --sort-section=name is specified.
2142 * testsuite/Makefile.am (text_section_grouping): Test option
2143 --sort-section=name.
2144 * testsuite/Makefile.in: Regenerate.
2145 * testsuite/section_sorting_name.cc: New file.
2146 * testsuite/section_sorting_name.sh: New file.
2147
93acabad
CC
21482013-05-21 Cary Coutant <ccoutant@google.com>
2149
2150 * symtab.h (Symbol::is_cxx_vtable): New function.
2151 * target-reloc.h (relocate_section): Check for vtable symbol.
2152 * testsuite/Makefile.am (missing_key_func.sh): New test case.
2153 * testsuite/Makefile.in: Regenerate.
2154 * testsuite/missing_key_func.cc: New test source.
2155 * testsuite/missing_key_func.sh: New test script.
2156
60e8b3fc
CC
21572013-05-21 Cary Coutant <ccoutant@google.com>
2158
2b64b551
RM
2159 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
2160 type of enclosing symbol.
2161 (Relocate_info::location): Check symbol type when describing symbol.
2162 * object.h (Symbol_location_info): Remove unused line_number;
2163 add enclosing_symbol_type.
2164 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 2165
9df9de2c
CC
21662013-05-13 Cary Coutant <ccoutant@google.com>
2167
2b64b551
RM
2168 * configure.ac: Export DEFAULT_TARGET.
2169 * configure: Regenerate.
2170 * Makefile.in: Regenerate.
2171 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
2172 * testsuite/Makefile.in: Regenerate.
2173 * testsuite/debug_msg.sh: Delete duplicate tests.
2174 Don't check undef_int error message match for powerpc where the
2175 source file and line number aren't available.
9df9de2c 2176
bbc5ae17
RM
21772013-05-10 Roland McGrath <mcgrathr@google.com>
2178
2179 * options.h (General_options): Add --rosegment-gap option.
2180 * options.cc (finalize): --rosegment-gap implies --rosegment.
2181 * layout.cc (set_segment_offsets): Let user option override
2182 target->rosegment_gap().
2183
0c6e6c39
RM
21842013-05-10 Roland McGrath <mcgrathr@google.com>
2185
2186 * options.h (General_options): Remove leading space from help
2187 messages for -nostdlib and --rosegment.
2188
cde7cb01
MR
21892013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
2190
2191 PR ld/15365
2192 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
2193
f31ae5b8
AM
21942013-05-03 Alan Modra <amodra@gmail.com>
2195
2196 * merge.cc (Output_merge_string::do_add_input_section): Correct
2197 scan for number of strings. Rename vars to avoid shadowing.
2198 Include missing terminator in input_size_.
2199
d3a7cd45
L
22002013-05-01 H.J. Lu <hongjiu.lu@intel.com>
2201
2202 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
2203 Restore empty string handling.
2204
6ad3daba
CC
22052013-05-01 Cary Coutant <ccoutant@google.com>
2206
2207 * stringpool.cc (Stringpool_template::new_key_offset): Fix
2208 uninitialized warning.
2209
e31908b6
CC
22102013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
2211
2212 * output.cc (Output_section::add_merge_input_section): Allow
2213 to merge sections if the alignment is more than character size.
2214 * merge.h (Output_merge_string::Output_merge_string): Remove
2215 assert.
2216 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
2217 only not-null strings. Check the alignment of strings.
2218 * stringpool.h
2219 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
2220 alignment as the argument.
2221 (Stringpool_template<Stringpool_char>::addralign_): New class member.
2222 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
2223 Align non-zero length strings according to the addralign_.
2224 (Stringpool_template<Stringpool_char>::set_string_offsets):
2225 Updating offsets according to the given alignment.
2226 * testsuite/Makefile.am (text_section_grouping): Test if string
2227 literals are getting merged.
2228 * testsuite/Makefile.in: Regenerate.
2229 * testsuite/merge_string_literals_1.c: New file.
2230 * testsuite/merge_string_literals_2.c: Ditto.
2231 * testsuite/merge_string_literals.sh: Ditto.
2232
0e804863
ILT
22332013-04-26 Ian Lance Taylor <iant@google.com>
2234
2235 * target-reloc.h (relocate_section): If the reloc offset is out of
2236 range, pass VIEW as NULL to relocate.relocate.
2237 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
2238 * i386.cc (Target_i386::Relocate::relocate): Likewise.
2239 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
2240 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
2241 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
2242 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
2243
e7c5ea40
CC
22442013-04-26 Geoff Pike <gpike@chromium.org>
2245
2246 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
2247 * layout.cc (Hash_task): New class.
2248 (Layout::queue_build_id_tasks): New function.
2249 (Layout::write_build_id): Handle single-thread portion of build ID
2250 computation. (In some cases, all of it is single-threaded.) Replace
2251 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
2252 functionality in fewer lines of code.
2253 * layout.h (Layout::queue_build_id_tasks): New function declaration.
2254 * options.h (General_options): make "--build-id" default to tree
2255 rather than sha1. Add two new options related to --build-id=tree:
2256 --build-id-chunk-size-for-treehash and
2257 --build-id-min-file-size-for-treehash.
2258 * Makefile.am: add testing of --build-id=tree and related new options
2259 (these tests will be invoked by "make check").
2260 * Makefile.in: Regenerate.
2261
49926cd0
AM
22622013-04-25 Alan Modra <amodra@gmail.com>
2263
2264 * configure.tgt: Add powerpcle and powerpc64le.
2265
a4034750
AM
22662013-04-22 Alan Modra <amodra@gmail.com>
2267
2268 PR gold/15355
2269 * layout.cc (Layout::segment_precedes): Allow more than one
2270 segment with the same type and flags.
2271
e79c84aa
CC
22722013-04-15 Cary Coutant <ccoutant@google.com>
2273
2274 * layout.cc (Layout::set_relocatable_section_offsets): Don't
2275 allocate space in file for BSS sections.
2276
2199fbe7
CC
22772013-04-15 Cary Coutant <ccoutant@google.com>
2278
2279 * script-sections.cc (Orphan_output_section): Reset address
2280 to zero after each orphaned section for relocatable links.
2281
502e8a84
CC
22822013-04-15 Cary Coutant <ccoutant@google.com>
2283
a4034750
AM
2284 * symtab.cc (Symbol_table::sized_write_globals): Subtract
2285 section starting address for relocatable link.
2286 * testsuite/Makefile.am (script_test_11): New test.
2287 * testsuite/Makefile.in: Regenerate.
2288 * testsuite/script_test_11.c: New source file.
2289 * testsuite/script_test_11.t: New linker script.
502e8a84 2290
0cfdc767
AM
22912013-04-13 Alan Modra <amodra@gmail.com>
2292
2293 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
2294 owner when sections are not adjacent and exceed group size.
2295 (Target_powerpc::group_sections): Handle corner case.
2296 (Target_powerpc::Branch_info::make_stub): Handle case where
2297 stub table doesn't exist due to branches in non-exec sections.
2298 (Target_powerpc::Relocate::relocate): Likewise.
2299
6830ee24
AM
23002013-04-11 Alan Modra <amodra@gmail.com>
2301
2302 PR gold/15354
2303 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
2304 .branch_lt to match bfd ld. Adjust comments throughout file.
2305
54a3d865
ILT
23062013-04-04 Ian Lance Taylor <iant@google.com>
2307
2308 GCC PR c++/56840
2309 * object.cc (do_layout_deferred_sections): Handle .eh_frame
2310 sections before checking whether they are included in the link.
2311
9993ba11
ST
23122013-03-29 Sriraman Tallam <tmsriram@google.com>
2313
2314 * archive.cc (Archive::get_elf_object_for_member): Create the elf
2315 object before calling the plugin claim_file handler. Pass the elf
2316 object of the archive to the plugin. Delete the elf object if the
2317 plugin claims the file.
2318
ebacd51e
AM
23192013-03-21 Alan Modra <amodra@gmail.com>
2320
2321 * layout.cc (Layout::set_segment_offsets): Accept writable .text
2322 segment when omagic.
2323
117be58f
AM
23242013-03-21 Alan Modra <amodra@gmail.com>
2325
2326 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
2327 comparison warning.
2328 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
2329 uninitialized" warning.
2330
32e2b61d
AM
23312013-03-20 Alan Modra <amodra@gmail.com>
2332
2333 * symtab.h (Symbol::clear_version): New function.
2334 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
2335 is_needed by weak references. Clear version for symbols defined
2336 in as-needed objects that are not needed.
2337
b3ccdeb5
AM
23382013-03-15 Alan Modra <amodra@gmail.com>
2339
2340 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
2341 static and public. Add report_err param. Return false for data refs.
2342 (Target_powerpc::rela_dyn_section): New overloaded function.
2343 (Target_powerpc::plt_, iplt_): Elucidate.
2344 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
2345 (Output_data_plt_powerpc::do_write): Don't write .iplt.
2346 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
2347 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
2348 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
2349 push_branch and make_plt_entry for ifunc syms when
2350 reloc_needs_plt_for_ifunc.
2351 (Target_powerpc::Relocate::relocate): Don't use plt entry value
2352 for ifunc unless reloc_needs_plt_for_ifunc.
2353
ad3d8a2f
AM
23542013-03-15 Alan Modra <amodra@gmail.com>
2355
2356 * gc.h (gc_process_relocs): Don't look through function descriptors.
2357 * icf.cc (get_section_contents): Do so here instead.
2358
4d9aa155
AM
23592013-03-13 Alan Modra <amodra@gmail.com>
2360
2361 * powerpc.cc (is_branch_reloc): Forward declare.
2362 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
2363 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
2364 false for 64-bit, true for 32-bit non-branch relocs.
2365 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
2366 * testsuite/Makefile.am (icf_test): Use linker map file instead of
2367 nm output.
2368 (icf_safe_test): Generate linker map file as well as nm output.
2369 (icf_safe_so_test): Likewise.
2370 * testsuite/Makefile.in: Regenerate.
2371 * testsuite/icf_test.sh: Parse linker map file to determine
2372 section folding.
2373 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
2374 * testsuite/icf_safe_so_test.sh: Likewise.
2375 (X86_32_or_ARM_specific_safe_fold): Merge into..
2376 (arch_specific_safe_fold): ..this.
2377 (X86_64_specific_safe_fold): Delete unused function.
2378
57420c20
AM
23792013-03-12 Alan Modra <amodra@gmail.com>
2380
2381 * gc.h (gc_process_relocs): Look through function descriptors
2382 to determine shndx, symvalue and addend used by ICF. Tidy
2383 variable duplication.
2384
dc3714f3
AM
23852013-03-11 Alan Modra <amodra@gmail.com>
2386
2387 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
2388 * layout.cc (Layout_task_runner::run): ..to here.
2389 * symtab.h (struct Symbol_location): Extract from..
2390 (class Symbol_table): ..here.
2391 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
2392 * target.h (class Target): Add function_location and
2393 do_function_location functions.
2394 (class Sized_target): Add do_function_location.
2395 * object.h (class Sized_relobj_file): Move find_shdr..
2396 (class Object): ..to here.
2397 * object.cc: Likewise. Update to suit. Instantiate.
2398 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
2399 * powerpc.cc (class Powerpc_dynobj): New.
2400 (Target_powerpc::do_function_location): New function.
2401 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
2402 (Powerpc_dynobj::do_read_symbols): New function.
2403 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
2404
956b03bb
ILT
24052013-03-08 Ian Lance Taylor <iant@google.com>
2406
2407 * options.cc (General_options::string_to_object_format): Accept
2408 "default".
2409
4bead2d5
AM
24102013-03-08 Alan Modra <amodra@gmail.com>
2411
2412 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
2413 pointer to Post_fde.
2414 (struct Post_fde): Move definition to here..
2415 * ehframe.cc (struct Post_fde): ..from here.
2416 (Cie::write): Don't alloc Post_fde.
2417 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
2418
02e60bf7
AM
24192013-03-07 Alan Modra <amodra@gmail.com>
2420
2421 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
2422 relocation referencing .LC0.
2423 * testsuite/discard_locals_test.sh: Remove FIXMEs.
2424
8343f03a
AM
24252013-03-07 Alan Modra <amodra@gmail.com>
2426
2427 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
2428 always_inline. Add assembly for powerpc to avoid GOT.
2429
3366d57c
AM
24302013-03-07 Alan Modra <amodra@gmail.com>
2431
2432 * testsuite/script_test_10.sh: Don't test .bss section
2433 header number.
2434
6c77229c
AM
24352013-03-06 Alan Modra <amodra@gmail.com>
2436
2437 * powerpc.cc (class Powerpc_relobj): Move some member functions.
2438 (Target_powerpc::symval_for_branch): Add symtab param. Update
2439 all callers. Handle folded sections.
2440 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
2441 to Powerpc_relobj.
2442 (Global_symbol_visitor_opd::operator()): Likewise.
2443
a39e4af6
AM
24442013-03-04 Alan Modra <amodra@gmail.com>
2445
2446 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
2447 * testsuite/Makefile.in: Regenerate.
2448
d5834edb
CC
24492013-03-01 Cary Coutant <ccoutant@google.com>
2450
2451 Add dwp support for v2 DWARF package file format.
2452 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2453 tu_length parameter. Adjust all callers.
2454 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2455 * dwp.cc: Include dwarf.h.
2456 (Section_bounds): New struct type.
2457 (Unit_set): New struct type.
2458 (Dwo_file::Dwo_file): Initialize new data member.
2459 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2460 Combine and rename to...
2461 (Dwo_file::read_unit_index): ...this.
2462 (Dwo_file::sized_read_compunit_index)
2463 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2464 (Dwo_file::sized_read_unit_index): ...this.
2465 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2466 parameters; add section_id parameter.
2467 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2468 (Dwo_file::add_unit_set): ...this.
2469 (Dwo_file::shndx_map_): Remove.
2470 (Dwo_file::sect_offsets_): New data member.
2471 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2472 (Dwp_output_file::add_section): Rename to...
2473 (Dwp_output_file::add_contribution): ...this.
2474 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2475 (Dwp_output_file::add_tu_set): Likewise.
2476 (Dwp_output_file::Contribution): New type.
2477 (Dwp_output_file::Section::contributions): New data member.
2478 (Dwp_output_file::Cu_or_tu_set): Remove.
2479 (Dwp_output_file::Section::Section): New ctor.
2480 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2481 (Dwp_output_file::Dwp_index::Section_table): New type.
2482 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2483 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2484 parameter.
2485 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2486 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2487 (Dwp_output_file::Dwp_index::section_table): New member function.
2488 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2489 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2490 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2491 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2492 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2493 (Dwp_output_file::Dwp_index::section_table_): New data member.
2494 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2495 (Dwp_output_file::add_output_section): New member function.
2496 (Dwp_output_file::write_new_section): New member function.
2497 (Dwp_output_file::write_contributions): New member function.
2498 (Dwp_output_file::section_id_map_): New data member.
2499 (class Dwo_id_info_reader): Remove.
2500 (class Unit_reader): New class.
2501 (get_dwarf_section_name): New function.
2502 (Dwo_file::read_executable): Adjust initializations of class data.
2503 (Dwo_file::read): Add support for v2 package file format.
2504 (Dwo_file::read_unit_index): Likewise.
2505 (Dwo_file::sized_read_unit_index): Likewise.
2506 (Dwo_file::copy_section): Likewise.
2507 (Dwo_file::add_unit_set): Likewise.
2508 (Dwp_output_file::add_output_section): Likewise.
2509 (Dwp_output_file::add_contribution): Likewise.
2510 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2511 for empty slot.
2512 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2513 file format.
2514 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2515 slot.
2516 (Dwp_output_file::initialize): Remove unused function.
2517 (Dwp_output_file::finalize): Add support for v2 package file format.
2518 (Dwp_output_file::write_index): Likewise.
2519 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2520 function prototype.
2521
a68a081d
CC
25222013-03-01 Cary Coutant <ccoutant@google.com>
2523
2524 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
2525 function into class definition in header file.
2526 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
2527 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
2528 New function.
2529 (Dwarf_info_reader::check_buffer): Move here from .cc file.
2530
9d5781f8
AM
25312013-02-28 Alan Modra <amodra@gmail.com>
2532
2533 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
2534 * target.cc (Target::do_plt_fde_location): New function.
2535 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
2536 accessor function, and constructor param.
2537 (struct Post_fde, Post_fdes): Declare.
2538 (Cie::write): Add post_fdes param.
2539 * ehframe.cc (Fde::write): Use plt_fde_location.
2540 (struct Post_fde): Define.
2541 (Cie::write): Stash FDEs added post merge mapping.
2542 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
2543 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
2544 (Eh_frame::do_sized_write): Arrange to write post map FDES after
2545 other FDEs.
2546 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
2547 (Target_powerpc::has_glink): New function.
2548 (Target_powerpc::do_relax): Add eh_frame info for stubs.
2549 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
2550 glink_eh_frame_fde_32, default_fde): New data.
2551 (Stub_table::eh_frame_added_): New var.
2552 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
2553 Make const.
2554 (Stub_table::add_eh_frame): New function.
2555 (Output_data_glink::add_eh_frame): New function.
2556 (Target_powerpc::make_glink_section): Call add_eh_frame.
2557
214383dd
ILT
25582013-02-15 Ian Lance Taylor <iant@google.com>
2559
2560 * options.h (DEFINE_uint64_alias): Define.
2561 (class General_options): Add -Ttext-segment as an alias for
2562 -Ttext.
2563
91c2b899
AM
25642013-02-15 Alan Modra <amodra@gmail.com>
2565
2566 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
2567 (Stub_table::do_write): ..here, two places.
2568 (Stub_table::plt_call_size): Use it here too.
2569
20e2a8aa
ILT
25702013-02-11 Ian Lance Taylor <iant@google.com>
2571
2572 * descriptors.cc (Descriptors::close_all): New function.
2573 * descriptors.h (class Descriptors): Declare close_all.
2574 (close_all_descriptors): New inline function.
2575 * plugin.cc: Include "descriptors.h".
2576 (Plugin_manager::cleanup): Call close_all_descriptors.
2577
8952bc69
AM
25782013-02-06 Alan Modra <amodra@gmail.com>
2579
2580 * README: Update coding style link.
2581
29bd8b6b
CC
25822013-01-28 Cary Coutant <ccoutant@google.com>
2583
a4034750
AM
2584 * dwp.cc (File_list): New typedef.
2585 (Dwo_name_info_reader): New class.
2586 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
2587 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
2588 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
2589 (Dwo_file::read_executable): New function.
2590 (Dwo_file::read): Move common setup code to ...
2591 (Dwo_file::make_object): ... here.
2592 (dwp_options): Add --exec/-e.
2593 (usage): Likewise.
2594 (main): Likewise.
29bd8b6b 2595
c6ac678d
ST
25962013-01-24 Sriraman Tallam <tmsriram@google.com>
2597
2598 * layout.cc (Layout::layout): Check for option text_reorder.
2599 (Layout::make_output_section): Ditto.
2600 * options.h (text_reorder): New option.
2601 * output.cc (Input_section_sort_compare): Remove special ordering
2602 of section names.
2603 (Output_section::
2604 Input_section_sort_section_name_special_ordering_compare::
2605 operator()): New function.
2606 (Output_section::sort_attached_input_sections): Use new sort function
2607 for .text.
2608 * output.h (Input_section_sort_section_name_special_ordering_compare):
2609 New struct.
2610 * testsuite/Makefile.am (text_section_grouping): Test option
2611 --no-text-reorder
2612 * testsuite/Makefile.in: Regenerate.
2613 * testsuite/text_section_grouping.sh: Check order of functions without
2614 default text reordering.
2615
50701cc1
MF
26162013-01-18 Mike Frysinger <vapier@gentoo.org>
2617
2618 * options.h (General_options): Change default to true for new_dtags.
2619
b1b00fcc
MF
26202013-01-18 Mike Frysinger <vapier@gentoo.org>
2621
2622 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
2623 when enable_new_dtags is false. Only add DT_RUNPATH when
2624 enable_new_dtags is true.
2625
ec5b8187
AM
26262013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
2627
2628 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
2629 used in declaration and definition consistent.
2630 (Target_powerpc::symval_for_branch): Ditto.
2631
a880d4c4
ST
26322013-01-16 Sriraman Tallam <tmsriram@google.com>
2633
2634 * testsuite/plugin_final_layout.cc: Fix comment.
2635
7c381248
ST
26362013-01-16 Sriraman Tallam <tmsriram@google.com>
2637
2638 * layout.cc (Layout::layout): Do not do default sorting for
2639 text sections when section ordering is specified.
2640 (make_output_section): Ditto.
2641 * testsuite/plugin_final_layout.cc: Name the function sections
2642 to catch reordering issues.
2643
e2458743
AM
26442013-01-15 Alan Modra <amodra@gmail.com>
2645
2646 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
2647 plt-thread-safe.
2648
431ed302
AM
26492013-01-15 Alan Modra <amodra@gmail.com>
2650
2651 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
2652 * testsuite/Makefile.in: Regenerate.
2653
0ec6429b
AM
26542013-01-14 Alan Modra <amodra@gmail.com>
2655
2656 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
2657 * testsuite/Makefile.in: Regenerate.
2658
0bf402d5
ILT
26592013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
2660
36af3926 2661 PR bfd/14430
0bf402d5
ILT
2662 Fix mingw gold build with plugins enabled
2663 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
2664 * configure.ac: Export DLOPEN_LIBS and add headers check.
2665 * plugin.cc: Handle non-dlfcn case.
2666 * Makefile.in: Regenerate.
2667 * config.in: Regenerate.
2668 * configure: Regenerate.
2669 * testsuite/Makefile.in: Regenerate.
2670
9e9143bc
ST
26712013-01-09 Sriraman Tallam <tmsriram@google.com>
2672
2673 * output.h (sort_attached_input_sections): Change to be public.
2674 * script-sections.cc
2675 (Output_section_definition::set_section_addresses): Sort
2676 attached input sections according to section order before linker
2677 script assigns section addresses.
2678 (Orphan_output_section::set_section_addresses): Sort
2679 attached input sections according to section order before linker
2680 script assigns section addresses.
2681 * Makefile.am (final_layout.sh): Use a simple linker script to
2682 check if section ordering still works.
2683 * Makefile.in: Regenerate.
2684
679af368
ILT
26852013-01-09 Ben Cheng <bccheng@google.com>
2686
2687 * arm.cc (Target_arm::attributes_accept_div): New function.
2688 (Target_arm::attributes_forbid_div): New function.
2689 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
2690 attribute using the same new functions as what bfd/elf32_arm.c
2691 does.
2692
3136a00e
CC
26932013-01-07 Cary Coutant <ccoutant@google.com>
2694
2695 PR gold/14993
2696 * output.cc (Output_section::add_input_section): For incremental
2697 updates, don't track input sections that are allocated from patch
2698 space.
2699
f2a6224b
L
27002013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2701 Ian Lance Taylor <iant@google.com>
2702
2703 PR gold/14897
2704 * configure.ac (--enable-ld): Removed.
2705 (install_as_default): Set to yes only for --enable-gold=default
2706 or --disable-ld.
2707 * configure: Regenerated.
2708
4f46f626
L
27092013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2710
2711 * options.h (General_options): Add -fuse-ld= for GCC linker
2712 option compatibility.
2713
26e4ef59
CC
27142013-01-04 Cary Coutant <ccoutant@google.com>
2715
2716 * configure.ac: Fix typo restoring CXXFLAGS.
2717 * configure: Regenerate.
2718
3d587466
CC
27192013-01-04 Cary Coutant <ccoutant@google.com>
2720
4f46f626
L
2721 * testsuite/Makefile.am (CXXLINK_S): New macro.
2722 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
2723 * testsuite/Makefile.in: Regenerate.
3d587466 2724
44db6695
L
27252013-01-02 H.J. Lu <hongjiu.lu@intel.com>
2726
2727 * version.cc (print_version): Update copyright year to 2013.
2728
edcac0c1
ILT
27292012-12-20 Ian Lance Taylor <iant@google.com>
2730
2731 * layout.cc (Layout::special_ordering_of_input_section): New
2732 function.
2733 (Layout::layout): If input section requires special ordering, must
2734 sort input sections.
2735 (Layout::make_output_section): May sort .text input sections.
2736 (Layout::is_section_name_prefix_grouped): Remove.
2737 * layout.h (class Layout): Declare
2738 special_ordering_of_input_section. Don't declare
2739 is_section_name_prefix_grouped.
2740 * output.cc (Output_section::add_input_section): Revert last
2741 change.
2742 (Output_section::Input_section_sort::match_file_name): Don't crash
2743 if called on output section data.
2744 (Output_section::Input_section_sort_compare): Sort based on
2745 special ordering.
2746 (Output_section::Input_section_sort_section_order_index_compare):
2747 Revert last patch.
2748 (Output_section::sort_attached_input_sections): Likewise.
2749
28f2a4ac
ST
27502012-12-18 Sriraman Tallam <tmsriram@google.com>
2751
edcac0c1 2752 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
2753 * layout.h (Layout::is_section_name_prefix_grouped): New function.
2754 * output.cc (Output_section::add_input_section): Check if section
2755 name contains special prefix. Keep input sections to sort such
2756 sections.
2757 (Output_section::Input_section_sort_section_order_index_compare
2758 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
2759 (Output_section::sort_attached_input_sections): Add condition to
2760 Input_section_entry constructor call.
28f2a4ac
ST
2761 * testsuite/Makefile.am (text_section_grouping): New test.
2762 * testsuite/Makefile.in: Regenerate.
2763 * testsuite/text_section_grouping.cc: New file.
2764 * testsuite/text_section_grouping.sh: New file.
2765
5bf135a7
NC
27662012-12-17 Nick Clifton <nickc@redhat.com>
2767
2768 * Makefile.am: Add copyright notice.
2769 * NEWS: Likewise.
2770 * README: Likewise.
2771 * configure.ac: Likewise.
2772 * ftruncate.c: Likewise.
2773 * Makefile.in: Regenerate.
2774
59965708
CC
27752012-12-14 Cary Coutant <ccoutant@google.com>
2776
a4034750
AM
2777 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
2778 --no-as-needed flag.
2779 (exception_separate_shared_12_test): Likewise.
2780 (incremental_copy_test): Likewise.
2781 * testsuite/Makefile.in: Regenerate.
59965708 2782
2a77e2ab
CC
27832012-12-14 Cary Coutant <ccoutant@google.com>
2784
2785 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
2786 (Dwp_output_file::Dwp_index::enter_set): Add assert.
2787
e3deeb9c
AM
27882012-12-12 Alan Modra <amodra@gmail.com>
2789
2790 * powerpc.cc (class Track_tls): New.
2791 (class Relocate, class Scan): Inherit Track_tls.
2792 (Target_powerpc::Scan::local, global): Track tls optimization
2793 and avoid creating plt entry for __tls_get_addr if all uses
2794 are optimized away.
2795 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
2796
d8f5a274
AM
27972012-12-12 Alan Modra <amodra@gmail.com>
2798
2799 * options.h (General_options): Add --toc-sort/--no-toc-sort.
2800 Replace no_toc_optimize with toc_optimize.
2801 * output.h (Output_section::input_sections): Provide non-const variant.
2802 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
2803 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
2804 accessors.
2805 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
2806 (class Sort_toc_sections): New.
2807 (Target_powerpc::do_finalize_sections): Sort toc sections.
2808 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
2809
4c8a1de1
RM
28102012-12-10 Roland McGrath <mcgrathr@google.com>
2811
2812 * testsuite/binary_unittest.cc (read_all): New function.
2813 (Sized_binary_test): Use it instead of ::read.
2814 * fileread.cc (do_read): Don't assume pread always reads the whole
2815 amount in a single call.
2816
edc27beb
AM
28172012-12-10 Alan Modra <amodra@gmail.com>
2818
2819 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
2820 Set EM_PPC64 or EM_PPC here.
2821 (Target_selector_powerpc::do_recognize): Delete.
2822
906b9150
AM
28232012-12-10 Alan Modra <amodra@gmail.com>
2824
2825 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
2826 stub_table_.
2827 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
2828
418c15ae
RM
28292012-12-07 Roland McGrath <mcgrathr@google.com>
2830
2831 * testsuite/binary_unittest.cc (Sized_binary_test):
2832 Use open_descriptor rather than ::open.
2833
decdd3bc
AM
28342012-12-07 Alan Modra <amodra@gmail.com>
2835
2836 * powerpc.cc (Stub_table::do_write): Delete redundant Address
2837 typedef and invalid_address constant.
2838 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
2839 instantiate constants.
2840
db399005
ILT
28412012-12-06 Roland McGrath <mcgrathr@google.com>
2842
2843 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
2844 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
2845 * aclocal.m4: Regenerate.
2846 * configure: Regenerate.
2847 * Makefile.in: Regenerate.
2848 * testsuite/Makefile.in: Regenerate.
2849
aba6bc71
AM
28502012-12-07 Alan Modra <amodra@gmail.com>
2851
2852 * options.h (General_options): Add no_toc_optimize.
2853 * powerpc.cc (ok_lo_toc_insn): New function.
2854 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
2855
9e69ed50
AM
28562012-12-06 Alan Modra <amodra@gmail.com>
2857
2858 * options.h (General_options): Add plt_align, plt_static_chain,
2859 plt_thread_safe. Update stub_group_size help text.
2860 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
2861 for new plt_thread_safe_ var.
2862 (use_plt_offset): Correct comments.
2863 (Target_powerpc::do_relax): Look for thread creation symbols to
2864 determine default plt_thread_safe value. Clear plt call stubs
2865 as well as branch stubs each iteration.
2866 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
2867 insn constants.
2868 (l, hi, ha, write_insn): Move earlier.
2869 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
2870 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
2871 plt stubs too.
2872 (Stub_table::update_size): Adjust.
2873 (Stub_table::prev_size, set_prev_size): Delete.
2874 (Stub_table::stub_align): Let --plt-align affect result.
2875 (Stub_table::plt_call_size): Calculate sizes for various stubs.
2876 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
2877 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
2878 (Stub_table::do_write): Support more stub variants.
2879
f43ba157
AM
28802012-12-04 Alan Modra <amodra@gmail.com>
2881
2882 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
2883 (Target_powerpc::do_define_standard_symbols): New function.
2884
34171bc5
AM
28852012-12-03 Alan Modra <amodra@gmail.com>
2886
2887 * output.h: Formatting, whitespace.
2888
dc9589e9 28892012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
2890
2891 * layout.h (Layout::get_executable_sections): Declare.
2892 * layout.cc (Layout::get_executable_sections): New function.
2893 * arm.cc (Target_arm::group_sections): Use it.
2894 (Arm_output_section::group_sections): Delete now redundant test.
2895 * output.cc (Output_reloc::Output_reloc): Add is_relative.
2896 param to handle relative relocs.
2897 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
2898 (Output_data_reloc::add_absolute): Adjust.
2899 (Output_data_reloc::add_relative): New function.
2900 (Output_data::reset_data_size): New function.
2901 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
2902 (Output_section::set_addralign): New function.
2903 (Output_section::checkpoint_set_addralign): New function.
2904 (Output_section::clear_section_offsets_need_adjustment): New function.
2905 (Output_section::input_sections): Make public.
2906 * powerpc.cc (class Output_data_brlt_powerpc): New.
2907 (class Stub_table, class Stub_control): New.
2908 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
2909 stub_table_, set_stub_table, stub_table): New vectors and accessor
2910 functions.
2911 (Target_powerpc::do_may_relax, do_relax, push_branch,
2912 new_stub_table, stub_tables, brlt_section, group_sections,
2913 add_branch_lookup_table, find_branch_lookup_table,
2914 write_branch_lookup_table, make_brlt_section): New functions.
2915 (Target_powerpc::struct Sort_sections, class Branch_info): New.
2916 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
2917 branch_info_): New vars.
2918 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
2919 make call stubs here.
2920 (Output_data_glink): Remove all call stub handling from this class.
2921 (Target_powerpc::Scan::local, global): Save interesting branch
2922 relocs and relocs for ifunc. Adjust calls to plt entry functions.
2923 (Target_powerpc::do_finalize_sections): Only make reg save/restore
2924 functions on final link.
2925 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
2926 Handle long branch destinations too.
2927 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
2928 do_plt_address_for_local): Adjust lookup of plt call stubs.
2929
627b30b7
AM
29302012-11-30 Alan Modra <amodra@gmail.com>
2931
2932 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
2933 relocs against protected symbols when building 32-bit shared libs.
2934
40b469d7
AM
29352012-11-30 Alan Modra <amodra@gmail.com>
2936
2937 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
2938 param. Call got_section() to make .got. Update all callers
2939 and their callers and so on.
2940
bb66a627
AM
29412012-11-30 Alan Modra <amodra@gmail.com>
2942
2943 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
2944 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
2945 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
2946 value if it already exists.
2947
d2cf1c6c
L
29482012-11-19 H.J. Lu <hongjiu.lu@intel.com>
2949
2950 PR gold/14858
2951 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
2952
edccdf7c
RM
29532012-11-14 Roland McGrath <mcgrathr@google.com>
2954
2955 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
2956 than bfc instruction for data sandboxing.
2957
6febeb74
AM
29582012-11-08 Alan Modra <amodra@gmail.com>
2959
2960 * po/POTFILES.in: Regenerate.
2961
0a6f1bf2
AM
29622012-11-05 Alan Modra <amodra@gmail.com>
2963
2964 * configure.ac: Apply 2012-09-10 change to config.in here.
2965 * configure: Regenerate.
2966
26a4e9cb
AM
29672012-11-05 Alan Modra <amodra@gmail.com>
2968
2969 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
2970 (struct Opd_ent): Use "Address" rather than "Offset".
2971 (Output_data_got_powerpc::got_base_offset): Return Valtype.
2972 (Target_powerpc::got_section): Make public.
2973 (Target_powerpc::scan_relocs): Move code setting symbols..
2974 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
2975 Create _SDA_BASE_ only when referenced.
2976
cc928013
RM
29772012-11-02 Roland McGrath <mcgrathr@google.com>
2978
2979 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
2980 from last change.
2981
50ed5eb1
RM
29822012-11-01 Roland McGrath <mcgrathr@google.com>
2983
62fe925a
RM
2984 * target.h (Sized_target::relocate_relocs): Use Elf_Off
2985 for offset_in_output_section parameter.
2986 (Sized_target::relocate_special_relocatable): Likewise.
2987 * arm.cc (Target_arm::relocate_relocs): Likewise.
2988 (Target_arm::relocate_special_relocatable): Likewise.
2989 * i386.cc (Target_i386::relocate_relocs): Likewise.
2990 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
2991 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
2992 * target-reloc.h (relocate_relocs): Likewise.
2993 * testsuite/testfile.cc (Target_test): Likewise.
2994 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
2995 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
2996
2997 * system.h: Move inclusion of <clocale> to after <libintl.h> in
2998 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
2999
3000 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
3001 parameter, which is unused in the [!F_SETFD] case.
3002
50ed5eb1
RM
3003 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
3004 SYMNDX to off_t before comparing it to this->data_size().
3005 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
3006 * incremental.cc (Output_section_incremental_inputs::do_write):
3007 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
3008
2cadc0bf
RM
3009 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
3010
3bfcb652
NC
30112012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
3012
3013 * gold.cc (Target_arm::do_adjust_elf_header): Add the
3014 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
3015 in EABI_VER5.
3016
c1a8d56e
CC
30172012-10-29 Cary Coutant <ccoutant@google.com>
3018
3019 * dwp.cc (usage): Add file and exit status parameters;
3020 add --help and --version options.
3021 (print_version): New function.
3022 (main): Add --help and --version options.
3023
b2490a7b
L
30242012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3025
3026 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
3027 final_layout_sequence.txt.
3028 * testsuite/Makefile.in: Regenerated.
3029
aa543512
L
30302012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3031
3032 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
3033 COMPILE generated by automake.
3034 (LINK1): Likewise.
3035 (CXXCOMPILE1): Likewise.
3036 (CXXLINK1): Likewise.
3037 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
3038 (LINK): Likewise.
3039 (CXXCOMPILE): Likewise.
3040 (CXXLINK): Likewise.
3041 * testsuite/Makefile.in: Regenerated.
3042
d361fafb
L
30432012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3044
3045 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
3046 on bad fwrite return.
3047
598c7410
L
30482012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3049
3050 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
3051 on val.
3052
35c813e2
CC
30532012-10-23 Cary Coutant <ccoutant@google.com>
3054
3055 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
3056 * testsuite/Makefile.in: Regenerate.
3057 * testsuite/dwp_test.h: New source file.
3058 * testsuite/dwp_test_1.cc: New source file.
3059 * testsuite/dwp_test_1.s: New source file.
3060 * testsuite/dwp_test_1.sh: New source file.
3061 * testsuite/dwp_test_1b.cc: New source file.
3062 * testsuite/dwp_test_1b.s: New source file.
3063 * testsuite/dwp_test_2.cc: New source file.
3064 * testsuite/dwp_test_2.s: New source file.
3065 * testsuite/dwp_test_2.sh: New source file.
3066 * testsuite/dwp_test_main.cc: New source file.
3067 * testsuite/dwp_test_main.s: New source file.
3068
77429909
CC
30692012-10-23 Cary Coutant <ccoutant@google.com>
3070
3071 * dwp.h: New header file.
3072 * dwp.cc: New source file.
3073 * gold.h: Move shared declarations to system.h.
3074 * system.h: New header file.
3075 * Makefile.am: Add dwp.
3076 * Makefile.in: Regenerate.
3077
ed5d6712
CC
30782012-10-23 Cary Coutant <ccoutant@google.com>
3079
3080 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
3081 Dwarf_info_reader::read_from_pointer.
3082 (Dwarf_pubnames_table::read_header): Likewise.
3083 (Dwarf_pubnames_table::next_name): Likewise.
3084 (Dwarf_die::read_attributes): Likewise.
3085 (Dwarf_die::skip_attributes): Likewise.
3086 (Dwarf_info_reader::read_from_pointer): New function template.
3087 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
3088 (Dwarf_pubnames_table): Likewise.
3089 (Dwarf_info_reader::read_from_pointer): New function template.
3090 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
3091 Dwarf_pubnames_table ctor.
3092
8787852d
CC
30932012-10-23 Cary Coutant <ccoutant@google.com>
3094
3095 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
3096 abbrev_shndx.
3097 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
3098 abbrev_shndx_.
3099 (Dwarf_info_reader::set_abbrev_shndx): New method.
3100 (Dwarf_info_reader::abbrev_shndx_): New data member.
3101
9fc236f3
CC
31022012-10-23 Cary Coutant <ccoutant@google.com>
3103
3104 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
3105 from object, not parameters.
3106 (Dwarf_info_reader::parse): Likewise.
3107 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
3108 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
3109 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
3110 methods.
3111
effe8365
CC
31122012-10-23 Cary Coutant <ccoutant@google.com>
3113
3114 * fileread.cc (Input_file::Input_file): New constructor.
3115 * fileread.h (class Input_file): Add new constructor.
3116
1698990d
AM
31172012-10-18 Alan Modra <amodra@gmail.com>
3118
3119 PR gold/14727
3120 * object.cc (Relobj::is_section_name_included): Also match
3121 .sdata personality section.
3122
168a4726
AM
31232012-10-18 Alan Modra <amodra@gmail.com>
3124
3125 * target-reloc.h (class Default_comdat_behavior): New, package up..
3126 (get_comdat_behaviour): ..this.
3127 (relocate_section): Add Relocate_comdat_behavior template arg,
3128 adjust code to suit.
3129 * arm.cc (Target_arm::relocate_section): Adjust to suit.
3130 (Target_arm::scan_reloc_section): Likewise.
3131 * i386.cc (Target_i386::relocate_section): Likewise.
3132 * sparc.cc (Target_sparc::relocate_section): Likewise.
3133 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
3134 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
3135 * powerpc.cc (class Relocate_comdat_behavior): New.
3136 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
3137 gold::relocate_section with new template arg.
3138
acc276d8
AM
31392012-10-18 Alan Modra <amodra@gmail.com>
3140
3141 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
3142 dynamic relocs for GOT_TPREL got entries, without symbol if
3143 resolving locally.
3144 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
3145 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
3146 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
3147
e10f9870
AM
31482012-10-17 Alan Modra <amodra@gmail.com>
3149
3150 PR gold/14726
3151 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
3152
ae034989
ST
31532012-10-16 Sriraman Tallam <tmsriram@google.com>
3154
3155 * layout.cc (Layout::include_section): Keep sections marked
3156 SHF_EXCLUDE when doing relocatable links.
3157
f3a0ed29
AM
31582012-10-16 Alan Modra <amodra@gmail.com>
3159
3160 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
3161 (Target_powerpc::do_finalize_sections): Call it.
3162 (Output_data_save_res): New class and supporting functions.
3163 (Target_powerpc::symval_for_branch): Only look up .opd entry for
3164 normal symbols defined in object files.
3165
c6de8ed4
AM
31662012-10-12 Alan Modra <amodra@gmail.com>
3167
3168 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
3169 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
3170 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
3171 section if scan_opd_relocs not yet called.
3172 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
3173
03e25981
AM
31742012-10-12 Alan Modra <amodra@gmail.com>
3175
3176 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3177 add_local_ifunc_entry): Revert last change.
3178 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
3179
c9824451
AM
31802012-10-05 Alan Modra <amodra@gmail.com>
3181
3182 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
3183 do_plt_address_for_global): New functions.
3184 (Output_data_got_powerpc::do_write): Don't segfault when linking
3185 statically.
3186 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3187 add_local_ifunc_entry): Return true on adding entry..
3188 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
3189 glink->add_entry call. Remove unused symtab param. Adjust calls.
3190 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
3191 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
3192 set up symbols here.
3193 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
3194 syms here. Do so even when no .iplt. Don't segfault when linking
3195 statically.
3196 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
3197 new variants without reloc param.
3198 (Glink_sym_ent::Glink_sym_ent): Likewise.
3199 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
3200 reloc when refs will resolve to plt call stub.
3201 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
3202 R_PPC_PLTREL24 to resolve locally.
3203 (Target_powerpc::Scan::global): Correct ifunc handling.
3204 (Target_powerpc::Relocate::relocate): Correct local sym glink
3205 lookup. Don't destroy "value" when we have a plt call stub,
3206 and when checking plt call validity.
3207 (Target_powerpc::do_dynsym_value): Simplify.
3208
19fec8c1
AM
32092012-10-05 Alan Modra <amodra@gmail.com>
3210
3211 * i386.cc (Output_data_plt_i386::address_for_global,
3212 address_for_local): Add plt offset to returned value. Adjust uses.
3213 * sparc.cc (Output_data_plt_sparc::address_for_global,
3214 address_for_local): Likewise.
3215 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
3216 address_for_local): Likewise.
3217 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
3218 address_for_local): Likewise.
3219 * target.h (Target::plt_address_for_global, plt_address_for_local):
3220 Update comment.
3221 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
3222 (Output_data_got::Got_entry::write): Nor here.
3223 * output.h: Comment fix.
3224
e867b647
WL
32252012-10-02 Jiong Wang <jiwang@tilera.com>
3226
3227 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
3228 global_offset_table_ value for larget got.
3229 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
3230
e5d5f5ed
AM
32312012-09-29 Alan Modra <amodra@gmail.com>
3232
3233 * powerpc.cc (Target_powerpc::iplt_): New output section.
3234 (Target_powerpc::iplt_section, make_iplt_section,
3235 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
3236 (Target_powerpc::make_plt_entry): Handle ifunc syms.
3237 Target_powerpc::plt_entry_count): Count iplt entries too.
3238 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
3239 reloc section in constructor. New params.
3240 (Target_powerpc::make_plt_section): Create reloc section here instead.
3241 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
3242 functions.
3243 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
3244 (Output_data_glink::add_entry, find_entry): New functions to
3245 deal with local syms.
3246 (Glink_sym_ent): Add support for local syms.
3247 (Output_data_glink::do_write): Handle ifunc plt entries.
3248 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3249 (Target_powerpc::Scan::local, global): Handle ifunc syms.
3250 (Target_powerpc::Relocate::relocate): Likewise.
3251 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
3252
ec4dbad3
AM
32532012-09-25 Alan Modra <amodra@gmail.com>
3254
3255 * object.h (Sized_relobj_file::adjust_local_symbol,
3256 do_adjust_local_symbol): New functions.
3257 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
3258 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
3259 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
3260 and irregular opd entry spacing.
3261 (Powerpc_relobj::do_read_relocs): Add opd size checks.
3262 (Global_symbol_visitor_opd): New functor.
3263 (Target_powerpc::do_finalize_sections): Omit global symbols defined
3264 on deleted opd entries.
3265
5c0b3823
WL
32662012-09-15 Jiong Wang <jiwang@tilera.com>
3267
3268 * tilegx.cc: New file.
3269 * Makefile.am (TARGETSOURCES): Add tilegx.cc
3270 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
3271 * configure.tgt: Add entries for tilegx*.
3272 * configure.ac: Likewise.
3273 * Makefile.in: Rebuild.
3274 * configure: Likewise.
3275 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
3276 tilegx.
3277
bfdfa4cd
AM
32782012-09-13 Alan Modra <amodra@gmail.com>
3279
3280 * target-reloc.h (scan_relocs): Call scan.local for relocs
3281 against symbols in discarded sections. Pass is_discarded
3282 param.
3283 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
3284 Add is_discarded param.
3285 * powerpc (Target_powerpc::Scan::local): Likewise. Use
3286 is_discarded to flag opd entry as discarded. Don't emit dyn
3287 relocs on such entries.
3288 (Target_powerpc::Scan::global): Similarly detect and handle
3289 such opd entries.
3290 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
3291 opd_ent_. Update all uses.
3292 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
3293 (Target_powerpc::relocate_section): Zero out discarded opd
3294 entry relocs.
3295
d77a0555
ILT
32962012-09-12 Ian Lance Taylor <iant@google.com>
3297
3298 PR gold/14570
3299 * output.cc: Rename Output_data_got template parameter from size
3300 to got_size for all functions. Compile all variants of
3301 Output_data_got.
3302 (Output_data_got::Got_entry::write): Correct use of size for
3303 symbol value. Use local_is_tls rather than casting to
3304 Sized_relobj_file.
3305 * object.h (class Object): Add local_is_tls and do_local_is_tls.
3306 (class Sized_relobj_file): Add do_local_is_tls.
3307 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
3308
815a1205
AM
33092012-09-11 Alan Modra <amodra@gmail.com>
3310
3311 PR gold/14566
3312 * layout.cc (Layout::set_segment_offsets): When using
3313 common-page-size alignment, ensure we are on a new max-page-size
3314 page.
3315 * output.cc (Output_segment::set_section_addresses): Use
3316 abi_pagesize, not common_pagesize for relro boundary.
3317 (Output_segment::set_offset): Likewise.
3318
bd73a62d
AM
33192012-09-11 Alan Modra <amodra@gmail.com>
3320
3321 * output.h (Output_data_got::add_global_tls, add_local_tls,
3322 add_local_tls_pair): New functions.
3323 (Output_data_got::add_local_pair_with_rel): Remove second
3324 reloc param. Expand comment.
3325 (Output_data_got::Got_entry): Rename use_plt_offset_ to
3326 use_plt_or_tls_offset_, similarly for constructor param.
3327 (Output_data_got::Got_entry::write): Add got_index param.
3328 * output.cc (Output_data_got::add_global_tls, add_local_tls,
3329 add_local_tls_pair): New functions.
3330 (Output_data_got::Got_entry::write): Handle tls symbols
3331 with use_plt_or_tls_offset_ set specially.
3332 (Output_data_got::add_local_pair_with_rel): Only one reloc.
3333 (Output_data_got::do_write): Replace iterator with index, pass
3334 index to entry write function.
3335 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
3336 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
3337 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
3338 call.
3339 * i386.cc (Target_i386::Scan::local): Likewise.
3340 * sparc.cc (Target_sparc::Scan::local): Likewise.
3341 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
3342 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
3343 do_tls_offset_for_global): New functions.
3344 (Target_powerpc::Scan::local): Correct TLS relocations and got
3345 entry values.
3346 (Target_powerpc::Scan::global): Don't emit unnecessary
3347 dynamic relocations on TLS GOT entries.
3348
00716ab1
AM
33492012-09-10 Matthias Klose <doko@ubuntu.com>
3350
3351 * config.in: Disable sanity check for kfreebsd.
3352
c891b3f9
SA
33532012-09-10 Sterling Augustine <saugustine@google.com>
3354
3355 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
3356 (Gdb_index::pubtypes_read): New parameter.
3357 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
3358 to calls.
3359 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
3360 pubtypes_object_.
3361
e81fea4d
AM
33622012-09-09 Alan Modra <amodra@gmail.com>
3363
3364 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
3365 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
3366 * gc.h (gc_process_relocs): Call target gc_add_reference.
3367 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
3368 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
3369 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
3370 unnecessary cast.
3371 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
3372 to cater for when we don't need code offset. Update use.
3373 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
3374 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
3375 set_opd_valid): New functions.
3376 (Target_powerpc::do_gc_add_reference): New function.
3377 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
3378 stashed refs.
3379 (Target_powerpc::do_gc_mark_symbol): New function.
3380
d2d60eef
CC
33812012-09-06 Cary Coutant <ccoutant@google.com>
3382
3383 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
3384 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
3385 (Dwarf_die::skip_attributes): Likewise.
3386 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
3387 * testsuite/gdb_index_test.cc (inline_func_1): New function.
3388 (main): Call it.
3389 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
3390
32ed4573
L
33912012-09-05 H.J. Lu <hongjiu.lu@intel.com>
3392
3393 * testsuite/script_test_3.t: Add .got.plt output section
3394 statement.
3395 * testsuite/script_test_4.t: Likewise.
3396
f4baf0d4
AM
33972012-09-05 Alan Modra <amodra@gmail.com>
3398
3399 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
3400 update all uses and lose "enum" when using type.
3401
864a1b56
AM
34022012-09-05 Alan Modra <amodra@gmail.com>
3403
3404 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
3405 * configure: Regenerate.
3406 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
3407 (plugin_final_layout.stdout): Likewise.
3408 (memory_test): Set page sizes to 0x1000.
3409 * testsuite/Makefile.in: Regenerate.
3410 * testsuite/discard_locals_test.sh: Add FIXME comment.
3411 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
3412 * testsuite/pr14265.t: Add .got output section statement.
3413 * testsuite/script_test_2.t: Likewise.
3414 * testsuite/script_test_3.t: Likewise.
3415 * testsuite/script_test_4.t: Likewise.
3416 * testsuite/script_test_5.t: Likewise.
3417 * testsuite/script_test_6.t: Likewise.
3418 * testsuite/script_test_7.t: Likewise.
3419 * testsuite/script_test_9.t: Likewise.
3420
3ea0a085
AM
34212012-09-05 Alan Modra <amodra@gmail.com>
3422
3423 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
3424 (Powerpc_relocate_functions::Status): New typedef.
3425 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3426 (Target_powerpc::Scan::local): Handle REL64.
3427 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
3428 for REL32 and REL64.
3429 (Target_powerpc::symval_for_branch): New function, extracted from..
3430 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
3431 checks. Report overflow errors.
3432
7404fe1b
AM
34332012-09-05 Alan Modra <amodra@gmail.com>
3434
3435 * object.h (Sized_relobj_file::emit_relocs): Delete.
3436 (Sized_relobj_file::emit_relocs_reltype): Delete.
3437 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
3438 relocate_relocs for --emit-relocs.
3439 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
3440 * output.h: Update comment.
3441 (Output_segment::first_section): New function.
3442 (Output_segment::first_section_load_address): Use first_section.
3443 * output.cc (Output_segment::first_section): New function extracted..
3444 (Output_segment::first_section_load_address): ..from here. Delete.
3445 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
3446 * target.h (Sized_target::relocate_for_relocatable): Likewise.
3447 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
3448 adjust call to target.h function.
3449 * i386.cc (Target_i386): Likewise.
3450 * sparc.cc (Target_sparc): Likewise.
3451 * x86_64.cc (Target_x86_64): Likewise.
3452 * powerpc.cc (Target_powerpc): Likewise.
3453 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
3454 first tls section has section symbol for optimised local dynamic
3455 output relocs.
3456 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
3457 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
3458 optimised tls code.
3459 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
3460 Rename to relocate_relocs. Update error message.
3461
957564c9
AS
34622012-09-04 Andreas Schwab <schwab@linux-m68k.org>
3463
3464 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
3465 --just-symbols.
3466
dd93cd0a
AM
34672012-08-31 Alan Modra <amodra@gmail.com>
3468
3469 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
3470 (Powerpc_relobj::toc_base_offset): New stub function.
3471 (Target_powerpc): Add tp_offset, dtp_offset. Rename
3472 got_mod_index_offset to tlsld_got_offset. Update all refs.
3473 (Target_powerpc::Relocate::enum skip_tls): New.
3474 (Target_powerpc::call_tls_get_addr_): New var.
3475 (Target_powerpc::is_branch_reloc): Move to file scope.
3476 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
3477 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
3478 New functions.
3479 (Target_powerpc::enum Got_type): Delete old values, add new ones.
3480 (powerpc_info): Correct common_pagesize for ppc64.
3481 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
3482 (Powerpc_relocate_functions): Add overflow check enums and functions.
3483 Add non-shift version of rela, rela_ua. Delete all rel public
3484 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
3485 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
3486 addr16_ha3, addr14 functions.
3487 (Output_data_got_powerpc::add_constant_pair): New function.
3488 (Output_data_got_powerpc::got_base_offset): Likewise.
3489 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
3490 (instruction constants): Sort, add some more.
3491 (Output_data_glink::do_write): Add and use Address typedef. Use
3492 object->toc_base_offset() stub for 64-bit.
3493 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
3494 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3495 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
3496 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
3497 Always treat .opd relocs as against locally defined symbol.
3498 Correct condition for RELATIVE relocs.
3499 (Target_powerpc::do_finalize_sections): Test for NULL sections.
3500 (Target_powerpc::Relocate::relocate): Use plt call stub as value
3501 for 32-bit syms with a plt entry. Correct ppc64 toc base
3502 calculations. Handle TLS relocs, and more. Add overflow
3503 checking and adjust for Powerpc_relocate_functions changes.
3504 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
3505 Reinstate --emit-relocs code with FIXME.
3506
a1373b60
AM
35072012-08-30 Alan Modra <amodra@gmail.com>
3508
3509 * layout.cc (Layout::set_segment_offsets): Set p_align to
3510 abi_pagesize, not common_pagesize.
3511 (Layout::relaxation_loop_body): Similarly use abi_pagesize
3512 to determine whether file header can go in segment.
3513
703d02da
AM
35142012-08-30 Alan Modra <amodra@gmail.com>
3515
3516 * output.h (Output_reloc::Output_reloc <output section>): Add
3517 is_relative param. Adjust calls.
3518 (Output_reloc::add_output_section_relative): New functions.
3519 * output.cc (Output_reloc::Output_reloc <output section>): Handle
3520 is_relative.
3521 (Output_reloc::symbol_value): Handle SECTION_CODE.
3522
16164a6b
ST
35232012-08-24 Sriraman Tallam <tmsriram@google.com>
3524
3525 * gold.cc (queue_middle_tasks): Call layout again when unique
3526 segments for sections is desired.
3527 * layout.cc (Layout::Layout): Initialize new members.
3528 (Layout::get_output_section_flags): New function.
3529 (Layout::choose_output_section): Call get_output_section_flags.
3530 (Layout::layout): Make output section for mapping to a unique segment.
3531 (Layout::insert_section_segment_map): New function.
3532 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 3533 output sections marked so.
16164a6b
ST
3534 (Layout::segment_precedes): Check for unique segments when sorting.
3535 * layout.h (Layout::Unique_segment_info): New struct.
3536 (Layout::Section_segment_map): New typedef.
3537 (Layout::insert_section_segment_map): New function.
3538 (Layout::get_output_section_flags): New function.
3539 (Layout::is_unique_segment_for_sections_specified): New function.
3540 (Layout::set_unique_segment_for_sections_specified): New function.
3541 (Layout::unique_segment_for_sections_specified_): New member.
3542 (Layout::section_segment_map_): New member.
3543 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
3544 Rename is_gc_pass_one to is_pass_one.
3545 Rename is_gc_pass_two to is_pass_two.
3546 Rename is_gc_or_icf to is_two_pass.
3547 Check for which pass based on whether symbols data is present.
3548 Make it two pass when unique segments for sections is desired.
3549 * output.cc (Output_section::Output_section): Initialize new
3550 members.
3551 * output.h (Output_section::is_unique_segment): New function.
3552 (Output_section::set_is_unique_segment): New function.
3553 (Output_section::is_unique_segment_): New member.
3554 (Output_section::extra_segment_flags): New function.
3555 (Output_section::set_extra_segment_flags): New function.
3556 (Output_section::extra_segment_flags_): New member.
3557 (Output_section::segment_alignment): New function.
3558 (Output_section::set_segment_alignment): New function.
3559 (Output_section::segment_alignment_): New member.
3560 (Output_segment::Output_segment): Initialize is_unique_segment_.
3561 (Output_segment::is_unique_segment): New function.
3562 (Output_segment::set_is_unique_segment): New function.
3563 (Output_segment::is_unique_segment_): New member.
3564 * plugin.cc (allow_unique_segment_for_sections): New function.
3565 (unique_segment_for_sections): New function.
3566 (Plugin::load): Add new functions to transfer vector.
3567 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
3568 * Makefile.in: Regenerate.
3569 * testsuite/plugin_final_layout.sh: Check if unique segment
3570 functionality works.
3571 * testsuite/plugin_section_order.c (onload): Check if new interfaces
3572 are available.
3573 (allow_unique_segment_for_sections): New global.
3574 (unique_segment_for_sections): New global.
3575 (claim_file_hook): Call allow_unique_segment_for_sections.
3576 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 3577
1e2bee4f
CC
35782012-08-22 Cary Coutant <ccoutant@google.com>
3579
3580 * layout.cc (Layout::include_section): Don't assert on GROUP
3581 sections with --emit-relocs.
3582
1d5dfe78
CC
35832012-08-21 Cary Coutant <ccoutant@google.com>
3584
3585 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
3586 if --export-dynamic-symbol names an undef symbol.
3587
c9269dff
AM
35882012-08-18 Alan Modra <amodra@gmail.com>
3589
3590 * powerpc.cc: Formatting and white space.
3591 (Powerpc_relobj): Rename got2_section_ to special_.
3592 Add opd_ent_shndx_ and opd_ent_off_ vectors.
3593 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
3594 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
3595 (Target_powerpc): Add Address typedef and invalid_address. Use
3596 throughout.
3597 (Target_powerpc::is_branch_reloc): New function.
3598 (Powerpc_relocate_functions): Add Address typedef, use throughout.
3599 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
3600 for dst_mask, value and addend.
3601 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
3602 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
3603 (Output_data_glink::do_write): Correct toc base. Don't try to use
3604 uint16_t for 24-bit offset. Use get_output_section_offset and
3605 check return.
3606 (Target_powerpc::Scan::local): Handle more relocs.
3607 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
3608 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
3609 Plug in toc restoring insn after plt calls. Translate branches
3610 to function descriptor symbols to corresponding entry point.
3611 (Target_powerpc::relocate_for_relocatable): Check return from
3612 get_output_section_offset.
3613 * symtab.h: Comment typo.
3614
b1759dce
ILT
36152012-08-14 Ian Lance Taylor <iant@google.com>
3616
3617 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
3618 unsupported_relocal_local to call unsupported_reloc_global.
3619
b9b2ae8b
NC
36202012-08-14 Nick Clifton <nickc@redhat.com>
3621
3622 PR ld/14265
3623 * script-sections.cc (Sections_element::output_section_name): Add
3624 keep return parameter.
3625 (Output_section_element::match_name): Add keep return parameter.
3626 Return the value of the keep_ member.
3627 * script-sections.h (class Output_section): Update
3628 output_section_name prototype.
3629 * layout.cc (Layout::keep_input_section): New public member
3630 function.
3631 (Layout::choose_output_section): Pass keep parameter to
3632 output_section_name.
3633 * layout.h (class Layout): Add keep_input_section.
3634 * object.cc (Sized_relobj_file::do_layout): Check for kept input
3635 sections.
3636 * testsuite/Makefile.am: Add a test.
3637 * testsuite/Makefile.in: Regenerate.
3638 * testsuite/pr14265.c: Source file for the test.
3639 * testsuite/pr14265.t: Linker script for the test.
3640 * testsuite/pr14265.sh: Shell script for the test.
3641
921b5322
AM
36422012-08-14 Alan Modra <amodra@gmail.com>
3643
3644 * target.h (Target::output_section_name): New function.
3645 (Target::do_output_section_name): New function.
3646 * layout.cc (Layout::choose_output_section): Call the above.
3647 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
3648
6ce78956
AM
36492012-08-14 Alan Modra <amodra@gmail.com>
3650
3651 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
3652 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
3653 for replace_constant call.
3654 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
3655 (Output_data_glink::do_print_to_mapfile): New function.
3656 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
3657 (Target_powerpc::Relocate::relocate): Likewise.
3658
d1a8cabd
AM
36592012-08-14 Alan Modra <amodra@gmail.com>
3660
3661 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
3662 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
3663 (Output_data_glink::add_entry,find_entry): Remove shndx param.
3664 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
3665 all references to shndx_. Handle special case for R_PPC_PLTREL24
3666 here.
3667 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
3668 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
3669 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
3670 here.
3671 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
3672 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
3673
d83ce4e3
AM
36742012-08-12 Alan Modra <amodra@gmail.com>
3675
3676 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
3677 (glink insn constants): Use uint32_t.
3678 (Output_data_glink::add_entry): Use insert, not [] operator.
3679
cf43a2fe
AM
36802012-08-11 Alan Modra <amodra@gmail.com>
3681
3682 * object.h (Sized_relobj_file::find_shdr): New function.
3683 (Sized_relobj_file::find_special_sections): New function.
3684 * object.cc (Sized_relobj_file::find_shdr): New function.
3685 (Sized_relobj_file::find_eh_frame): Use find_shdr.
3686 (Sized_relobj_file::find_special_sections): New function, split out..
3687 (Sized_relobj_file::do_read_symbols): ..from here.
3688 * output.h (Output_data_got::replace_constant): New function.
3689 (Output_data_got::num_entries): New function.
3690 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
3691 (Output_data_got::got_offset): Protected rather than private.
3692 (Output_data_got::replace_got_entry): New function.
3693 * output.cc (Output_data_got::replace_got_entry): New function.
3694 * powerpc.cc (class Powerpc_relobj): New.
3695 (class Powerpc_relocate_functions): Delete all psymval variants or
3696 convert to value,addend type. Delete pcrela, pcrela_unaligned.
3697 Implement _ha functions using corresponding _hi function.
3698 (Powerpc_relobj::find_special_sections): New function.
3699 (Target_powerpc::do_make_elf_object): New function.
3700 (class Output_data_got_powerpc): New.
3701 (class Output_data_glink): New.
3702 (class Powerpc_scan_relocatable_reloc): New.
3703 Many more changes througout file.
3704
3c892704
NC
37052012-08-09 Nick Clifton <nickc@redhat.com>
3706
3707 * po/vi.po: Updated Vietnamese translation.
3708
82435b3b
ILT
37092012-08-07 Ian Lance Taylor <iant@google.com>
3710
3711 * layout.cc (Layout::add_target_dynamic_tags): If
3712 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
3713 plt_rel.
3714
a6dc81d2
NC
37152012-07-30 Nick Clifton <nickc@redhat.com>
3716
3717 * po/gold.pot: Updated template.
3718 * po/es.po: Updated Spanish translation.
3719
f1415016
CC
37202012-07-18 Cary Coutant <ccoutant@google.com>
3721
3722 PR gold/14344
3723 * configure.ac: Add check for -gpubnames support.
3724 * configure: Regenerate.
3725 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
3726 support; force -gno-pubnames.
3727 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
3728 support.
3729 (gdb_index_test_4): New test.
3730 * testsuite/Makefile.in: Regenerate.
3731 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
3732 * testsuite/gdb_index_test_2.sh: Likewise.
3733 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
3734 * testsuite/gdb_index_test_4.sh: New script.
3735 * testsuite/gdb_index_test_comm.sh: New script with common code;
3736 don't look for space after colon.
3737
b7fd7c37
ST
37382012-07-16 Sriraman Tallam <tmsriram@google.com>
3739
3740 * gold.cc (queue_middle_tasks): Update function order only after
3741 deferred objects due to plugins are processed.
3742
1f3212db
ILT
37432012-07-11 Ian Lance Taylor <iant@google.com>
3744
3745 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
3746 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
3747 (Target_arm::scan_reloc_for_stub): Likewise.
3748 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
3749 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
3750 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
3751 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
3752 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
3753
81c82a68
ILT
37542012-07-10 Dodji Seketeli <dodji@redhat.com>
3755 Ian Lance Taylor <iant@google.com>
3756
3757 PR gold/14309
3758 * configure.ac: Test whether std::tr1::hash<off_t> works.
3759 * gold.h: Add a specialization for std::tr1::hash<off_t> if
3760 needed.
3761 * output.h (class Output_fill): Add virtual destructor.
3762 * configure, config.in: Rebuild.
3763
eabc84f4
RM
37642012-06-22 Roland McGrath <mcgrathr@google.com>
3765
3766 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
3767
370e30b6
RÁE
37682012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
3769
3770 * plugin.cc (Plugin::load): Handle position independent executables.
3771
fb1b895d
CC
37722012-06-06 Cary Coutant <ccoutant@google.com>
3773
3774 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
3775 add .debug_macro.
3776 (lines_only_debug_sections): Likewise.
3777 (gdb_fast_lookup_sections): New static array.
3778 (is_gdb_debug_section): Rename formal parameter.
3779 (is_lines_only_debug_section): Likewise.
3780 (is_gdb_fast_lookup_section): New function.
3781 (Layout::include_section): Check for ".zdebug_" prefix; pass
3782 section name suffix to is_gdb_debug_section, et al.; check for
3783 fast-lookup sections when building .gdb_index.
3784 * options.h (--strip-debug-gdb): Update GDB version number.
3785
7c0640fa
CC
37862012-06-06 Cary Coutant <ccoutant@google.com>
3787
3788 * configure.ac: Add check for fallocate.
3789 * configure: Regenerate.
3790 * config.in: Regenerate.
3791
3792 * options.h (class General_options): Add --mmap-output-file and
3793 --posix-fallocate options.
3794 * output.cc: (posix_fallocate): Remove; replace with...
3795 (gold_fallocate): New function.
3796 (Output_file::map_no_anonymous): Call gold_fallocate.
3797 (Output_file::map): Check --mmap-output-file option.
3798
2a49eb69
DK
37992012-06-05 Jing Yu <jingyu@google.com>
3800
3801 * gold.h (textdomain): Add do {} to empty while(0).
3802 (bindtextdomain): Likewise.
3803
fad072ac
CC
38042012-06-04 Cary Coutant <ccoutant@google.com>
3805
3806 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
3807 has_dynsym_index.
3808
8cc69fb6
ST
38092012-05-25 Sriraman Tallam <tmsriram@google.com>
3810
3811 * symtab.cc (Symbol_table::define_special_symbol):
3812 Initialize *poldsym to prevent uninitialized variable errors.
3813
1be75daa
CC
38142012-05-23 Cary Coutant <ccoutant@google.com>
3815
3816 * layout.cc (Layout::section_name_mapping): Add rules to handle
3817 exact match on .data.rel.ro.local or .data.rel.ro.
3818 (Layout::output_section_name): Check for exact matches.
3819
9b689de0
CC
38202012-05-23 Cary Coutant <ccoutant@google.com>
3821
3822 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
3823 more carefully.
3824
b24fdbf5
CC
38252012-05-22 Cary Coutant <ccoutant@google.com>
3826
3827 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
3828 object before exporting symbol.
3829
e550e1a2
L
38302012-05-21 H.J. Lu <hongjiu.lu@intel.com>
3831
3832 * testsuite/tls_test.cc: Include "config.h" first.
3833 * testsuite/tls_test_c.c: Likewise.
3834
df7b86aa
NC
38352012-05-17 Daniel Richard G. <skunk@iskunk.org>
3836 Nick Clifton <nickc@redhat.com>
3837
3838 PR 14072
3839 * configure.in: Add check that sysdep.h has been included before
3840 any system header files.
3841 * configure: Regenerate.
3842 * config.in: Regenerate.
3843
1007b503
CC
38442012-05-14 Cary Coutant <ccoutant@google.com>
3845
3846 * layout.cc (Layout::make_output_section): Mark .tdata section
3847 as RELRO.
3848 * testsuite/relro_test.cc: Add a TLS variable.
3849
fd885f3a
L
38502012-05-10 H.J. Lu <hongjiu.lu@intel.com>
3851
3852 PR gold/14091
3853 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
3854 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
3855 R_X86_64_64.
3856
80f5885c
CC
38572012-05-08 Cary Coutant <ccoutant@google.com>
3858
3859 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
3860 (lines_only_debug_sections): Likewise.
3861
2e702c99
RM
38622012-05-02 Roland McGrath <mcgrathr@google.com>
3863
3864 * nacl.cc: New file.
3865 * nacl.h: New file.
3866 * Makefile.am (CCFILES, HFILES): Add them.
3867 * Makefile.in: Regenerate.
3868 * i386.cc (Output_data_plt_i386_nacl): New class.
3869 (Output_data_plt_i386_nacl_exec): New class.
3870 (Output_data_plt_i386_nacl_dyn): New class.
3871 (Target_i386_nacl): New class.
3872 (Target_selector_i386_nacl): New class.
3873 (target_selector_i386): Use it instead of Target_selector_i386.
3874 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
3875 (Target_x86_64_nacl): New class.
3876 (Target_selector_x86_64_nacl): New class.
3877 (target_selector_x86_64, target_selector_x32): Use it instead of
3878 Target_selector_x86_64.
3879 * arm.cc (Output_data_plt_arm_nacl): New class.
3880 (Target_arm_nacl): New class.
3881 (Target_selector_arm_nacl): New class.
3882 (target_selector_arm, target_selector_armbe): Use it instead of
3883 Target_selector_arm.
3884
3885 * target-select.cc (select_target): Take new Input_file* and off_t
3886 arguments, pass them on to recognize method of selector.
3887 * object.cc (make_elf_sized_object): Update caller.
3888 * parameters.cc (parameters_force_valid_target): Likewise.
3889 * incremental.cc (make_sized_incremental_binary): Likewise.
3890 * target-select.h: Update decl.
3891 (Target_selector::recognize): Take new Input_file* argument,
3892 pass it on to do_recognize.
3893 (Target_selector::do_recognize): Take new Input_file* argument.
3894 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
3895 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
3896 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
3897 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
3898
3899 * target.h (Target::Target_info): New members isolate_execinstr
3900 and rosegment_gap.
3901 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
3902 * arm.cc (Target_arm::arm_info): Update initializer.
3903 * i386.cc (Target_i386::i386_info): Likewise.
3904 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
3905 * sparc.cc (Target_sparc::sparc_info): Likewise.
3906 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
3907 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3908 * layout.cc (Layout::attach_allocated_section_to_segment):
3909 Take new const Target* argument. If target->isolate_execinstr(), act
3910 like --rosegment.
3911 (Layout::find_first_load_seg): Take new const Target* argument;
3912 if target->isolate_execinstr(), reject PF_X segments.
3913 (Layout::relaxation_loop_body): Update caller.
3914 (Layout::set_segment_offsets): If target->isolate_execinstr(),
3915 reset file offset to zero when we hit LOAD_SEG, and then do a second
3916 loop over the segments before LOAD_SEG to reassign offsets after
3917 addresses have been determined. Handle target->rosegment_gap().
3918 (Layout::attach_section_to_segment): Take new const Target* argument;
3919 pass it to attach_allocated_section_to_segment.
3920 (Layout::make_output_section): Update caller.
3921 (Layout::attach_sections_to_segments): Take new const Target* argument;
3922 pass it to attach_section_to_segment.
3923 * gold.cc (queue_middle_tasks): Update caller.
3924 * layout.h (Layout): Update method decls with new arguments.
3925
3926 * arm.cc (Target_arm::Target_arm): Take optional argument for the
3927 Target_info pointer to use.
3928 (Target_arm::do_make_data_plt): New virtual method.
3929 (Target_arm::make_data_plt): New method that calls it.
3930 (Target_arm::make_plt_entry): Use it.
3931 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
3932 for the section alignment.
3933 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
3934 method.
3935 (Output_data_plt_arm::first_plt_entry_offset): Call it.
3936 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
3937 method.
3938 (Output_data_plt_arm::get_plt_entry_size): Call it.
3939 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
3940 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
3941 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
3942 method.
3943 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
3944 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
3945 method instead of sizeof(plt_entry).
3946 (Output_data_plt_arm::add_entry): Likewise.
3947 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
3948 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
3949 than static method.
3950 (Target_arm::plt_entry_size): Likewise.
3951 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
3952 Move to ...
3953 (Output_data_plt_arm_standard): ... here, new class.
3954 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
3955 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
3956 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
3957
3958 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3959 Take additional argument for the PLT entry size.
3960 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
3961 Use get_plt_entry_size method rather than plt_entry_size variable.
3962 (Output_data_plt_x86_64::reserve_slot): Likewise.
3963 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
3964 (Output_data_plt_x86_64::add_entry): Likewise.
3965 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
3966 (Output_data_plt_x86_64::address_for_global): Likewise.
3967 (Output_data_plt_x86_64::address_for_local): Likewise.
3968 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3969 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
3970 Make method non-static.
3971 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
3972 method.
3973 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
3974 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
3975 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
3976 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
3977 virtual method.
3978 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
3979 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
3980 virtual method.
3981 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
3982 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
3983 virtual method.
3984 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
3985 (Output_data_plt_x86_64::plt_entry_size)
3986 (Output_data_plt_x86_64::first_plt_entry)
3987 (Output_data_plt_x86_64::plt_entry)
3988 (Output_data_plt_x86_64::tlsdesc_plt_entry)
3989 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
3990 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
3991 (Output_data_plt_x86_64_standard): ... here, new class.
3992 (Target_x86_64::Target_x86_64): Take optional argument for the
3993 Target_info pointer to use.
3994 (Target_x86_64::do_make_data_plt): New virtual method.
3995 (Target_x86_64::make_data_plt): New method to call it.
3996 (Target_x86_64::init_got_plt_for_update): Use that.
3997 Call this->plt_->add_eh_frame method here.
3998 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
3999 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
4000 rather than static method.
4001 (Target_x86_64::plt_entry_size): Likewise.
4002 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
4003 rather than plt_entry_size variable. Move guts of PLT filling to...
4004 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
4005 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
4006 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
4007
4008 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
4009 additional argument for the section alignment.
4010 Don't do add_eh_frame_for_plt here.
4011 (Output_data_plt_i386::first_plt_entry_offset): Make the method
4012 non-static. Use get_plt_entry_size method rather than plt_entry_size
4013 variable.
4014 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
4015 method.
4016 (Output_data_plt_i386::get_plt_entry_size): Call it.
4017 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
4018 (Output_data_plt_i386::add_eh_frame): New method to call it.
4019 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
4020 method.
4021 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
4022 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
4023 method.
4024 (Output_data_plt_i386::fill_plt_entry): New method to call it.
4025 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
4026 method instead of plt_entry_size.
4027 (Output_data_plt_i386::plt_entry_size)
4028 (Output_data_plt_i386::plt_eh_frame_fde_size)
4029 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
4030 (Output_data_plt_i386_standard): ... here, new class.
4031 (Output_data_plt_i386_exec): New class.
4032 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
4033 (Output_data_plt_i386_exec::first_plt_entry): ... here.
4034 (Output_data_plt_i386::exec_plt_entry): Move to ...
4035 (Output_data_plt_i386_exec::plt_entry): ... here.
4036 (Output_data_plt_i386_dyn): New class.
4037 (Output_data_plt_i386::first_plt_entry): Move to ...
4038 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
4039 (Output_data_plt_i386::dyn_plt_entry): Move to ...
4040 (Output_data_plt_i386_dyn::plt_entry): ... here.
4041 (Target_i386::Target_i386): Take optional argument for the Target_info
4042 pointer to use.
4043 (Target_i386::do_make_data_plt): New virtual method.
4044 (Target_i386::make_data_plt): New method to call it.
4045 (Target_i386::make_plt_section): Use that.
4046 Call this->plt_->add_eh_frame method here.
4047 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
4048 rather than plt_entry_size variable.
4049 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
4050 (Output_data_plt_i386::address_for_local): Likewise.
4051 (Output_data_plt_i386::do_write): Likewise.
4052 Move guts of PLT filling to...
4053 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
4054 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
4055 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
4056 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
4057
b9b9f2ee
CC
40582012-05-01 Cary Coutant <ccoutant@google.com>
4059
4060 * dwarf_reader.cc (Dwarf_die::read_attributes)
4061 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
4062 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
4063 * reduced_debug_output.cc
4064 (Output_reduced_debug_info_section::get_die_end): Remove
4065 DW_FORM_GNU_ref_index. Add default case.
4066
57923f48
MW
40672012-04-26 Mark Wielaard <mjw@redhat.com>
4068
4069 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
4070 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
4071 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
4072 DW_AT_high_pc as offset from DW_AT_low_pc.
4073
4074 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
4075 * testsuite/Makefile.in: Regenerate.
4076 * testsuite/gdb_index_test_3.c: New test source file.
4077 * testsuite/gdb_index_test_3.sh: New test source file.
4078
2c54b4f4
ILT
40792012-04-25 Ian Lance Taylor <iant@google.com>
4080
4081 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
4082 pointer.
4083 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
4084 as a class, not a struct.
4085 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
4086 (Target_arm::apply_cortex_a8_workaround): Likewise.
4087 * gc.h: Declare Reloc_types as a struct, not a class.
4088 * object.h: Declare Symbols_data as a struct.
4089 * reloc.h: Declare Read_relocs_data as a struct.
4090 * target.h: Declare Relocate_info as a struct.
4091
a5a5f7a3
DM
40922012-04-24 David S. Miller <davem@davemloft.net>
4093
4094 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
4095 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
4096 and R_SPARC_WPLT30.
4097
f038d496
CC
40982012-04-24 Cary Coutant <ccoutant@google.com>
4099
4100 * incremental-dump.cc (find_input_containing_global): Replace
4101 magic number with symbolic constant.
4102 (dump_incremental_inputs): Update version number.
4103 * incremental.cc (Output_section_incremental_inputs): Update version
4104 number; import symbolic constants from Incremental_inputs_reader.
4105 (Incremental_inputs::create_data_sections): Align relocations
4106 section correctly for 64-bit targets.
4107 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
4108 constants; add padding.
4109 (Output_section_incremental_inputs::write_header): Add assert for
4110 header_size.
4111 (Output_section_incremental_inputs::write_input_files): Add assert
4112 for input_entry_size.
4113 (Output_section_incremental_inputs::write_info_blocks): Add padding;
4114 add assert for object_info_size, input_section_entry_size,
4115 global_sym_entry_size.
4116 * incremental.h (Incremental_inputs_reader): Add symbolic constants
4117 for data structure sizes; use them.
4118 (Incremental_input_entry_reader): Import symbolic constants from
4119 Incremental_inputs_reader; use them.
4120
a4d85145
DM
41212012-04-23 David S. Miller <davem@davemloft.net>
4122
4123 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
4124 and elf_flags_set_.
4125 (Target_sparc::Target_sparc): Initialize new fields.
4126 (Target_sparc::do_make_elf_object): New function.
4127 (Target_sparc::do_adjust_elf_header): New function.
4128
1d509098
CC
41292012-04-23 Cary Coutant <ccoutant@google.com>
4130
4131 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
4132 CU range table of gdb index.
4133
7ebeff7f
DM
41342012-04-20 David S. Miller <davem@davemloft.net>
4135
4136 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
4137 instead of false.
4138
13cf9988
DM
41392012-04-16 David S. Miller <davem@davemloft.net>
4140
2a1079e8
DM
4141 * sparc.cc (Target_sparc::got_address): New function.
4142 (Sparc_relocate_functions::gdop_hix22): New function.
4143 (Sparc_relocate_functions::gdop_lox10): New function.
4144 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
4145 relocs.
4146 (Target_sparc::Scan::local): Likewise if the global symbol is not
4147 preemptible and is not IFUNC.
4148 (Target_sparc::Relocate::relocate): Perform GOTDATA code
4149 transformations for local and non-preemptible non-IFUNC global
4150 symbols.
4151
0bc964fc
DM
4152 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
4153 writing out 64-bit part of ranges.
4154
661d7a80
DM
4155 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
4156 -fpic and -fpie respectively.
4157 * Makefile.in: Regenerate.
4158
8c2bf391
DM
4159 * sparc.cc (class Target_sparc): Add rela_ifunc_.
4160 (Target_sparc::Target_sparc): Initialize new field.
4161 (Target_sparc::do_plt_section_for_global): New function.
4162 (Target_sparc::do_plt_section_for_local): New function.
4163 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
4164 (Target_sparc::make_plt_section): New function, broken out of
4165 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
4166 (Target_sparc::make_plt_entry): Call make_plt_section.
4167 (Target_sparc::make_local_ifunc_plt_entry): New function.
4168 (Target_sparc::rela_ifunc_section): New function.
4169 (Target_sparc::plt_section): Remove const.
4170 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
4171 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
4172 and ifunc_count_ fields.
4173 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
4174 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
4175 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
4176 (Output_data_plt_sparc::rela_ifunc): New function.
4177 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
4178 (Output_data_plt_sparc::has_ifunc_section): New function.
4179 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
4180 (Output_data_plt_sparc::address_for_global): New function.
4181 (Output_data_plt_sparc::address_for_local): New function.
4182 (Output_data_plt_sparc::plt_index_to_offset): New function.
4183 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
4184 and entry_count.
4185 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
4186 entry_count.
4187 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
4188 R_SPARC_JMP_IREL to switch.
4189 (Target_sparc::Scan::check_non_pic): Likewise.
4190 (Target_sparc::Scan::local): Handle IFUNC symbols.
4191 (Target_sparc::Scan::local): Likewise.
4192 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
4193 and plt_address_for_local.
4194 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
4195 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
4196
13cf9988
DM
4197 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
4198 (class Output_data_reloc): Adjust calls to Output_reloc_type.
4199 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
4200 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
4201 global relocs too.
4202 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
4203 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
4204 calls.
4205 * sparc.cc (Target_sparc::Scan::global): Likewise.
4206 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4207
31821be0
CC
42082012-04-16 Cary Coutant <ccoutant@google.com>
4209
4210 * archive.cc (Library_base::should_include_member): Check for
4211 --export-dynamic-symbol.
4212 * options.h (class General_options): Add --export-dynamic-symbol.
4213 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
4214 --export-dynamic-symbol.
4215 (Symbol_table::gc_mark_undef_symbols): Likewise.
4216 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
4217
2615994e
DM
42182012-04-12 David S. Miller <davem@davemloft.net>
4219
4220 * sparc.cc (Reloc::wdisp10): New relocation method.
4221 (Reloc::h34): Likewise.
4222 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
4223 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
4224 R_SPARC_WDISP10.
4225 (Target_sparc::Scan::local): Likewise.
4226 (Target_sparc::Scan::global): Likewise.
4227 (Target_sparc::Relocate::relocate): Likewise.
4228
6782735d
CC
42292012-04-09 Cary Coutant <ccoutant@google.com>
4230
4231 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
4232 low_pc == 0.
4233
8c7a0b00
ILT
42342012-04-06 Ian Lance Taylor <iant@google.com>
4235
4236 * timer.cc: #include <unistd.h>.
4237
58797674
RM
42382012-04-06 Roland McGrath <mcgrathr@google.com>
4239
4240 * configure.in (AC_CHECK_HEADERS): Add locale.h.
4241 * config.in: Regenerate.
4242 * configure: Regenerate.
4243
44350750
NC
42442012-04-05 Nick Clifton <nickc@redhat.com>
4245
4246 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
4247 (AM_LC_MESSAGES): Add.
4248 * aclocal.m4: Regenerate.
4249 * config.in: Regenerate.
4250 * configure: Regenerate.
4251
c1027032
CC
42522012-03-21 Cary Coutant <ccoutant@google.com>
4253
4254 * Makefile.am: Add gdb-index.cc, gdb-index.h.
4255 * Makefile.in: Regenerate.
4256 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
4257 (Sized_elf_reloc_mapper::symbol_section): New function.
4258 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
4259 (make_elf_reloc_mapper): New function.
4260 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
4261 (Dwarf_abbrev_table::do_read_abbrevs): New function.
4262 (Dwarf_abbrev_table::do_get_abbrev): New function.
4263 (Dwarf_ranges_table::read_ranges_table): New function.
4264 (Dwarf_ranges_table::read_range_list): New function.
4265 (Dwarf_pubnames_table::read_section): New function.
4266 (Dwarf_pubnames_table::read_header): New function.
4267 (Dwarf_pubnames_table::next_name): New function.
4268 (Dwarf_die::Dwarf_die): New function.
4269 (Dwarf_die::read_attributes): New function.
4270 (Dwarf_die::skip_attributes): New function.
4271 (Dwarf_die::set_name): New function.
4272 (Dwarf_die::set_linkage_name): New function.
4273 (Dwarf_die::attribute): New function.
4274 (Dwarf_die::string_attribute): New function.
4275 (Dwarf_die::int_attribute): New function.
4276 (Dwarf_die::uint_attribute): New function.
4277 (Dwarf_die::ref_attribute): New function.
4278 (Dwarf_die::child_offset): New function.
4279 (Dwarf_die::sibling_offset): New function.
4280 (Dwarf_info_reader::check_buffer): New function.
4281 (Dwarf_info_reader::parse): New function.
4282 (Dwarf_info_reader::do_parse): New function.
4283 (Dwarf_info_reader::do_read_string_table): New function.
4284 (Dwarf_info_reader::lookup_reloc): New function.
4285 (Dwarf_info_reader::get_string): New function.
4286 (Dwarf_info_reader::visit_compilation_unit): New function.
4287 (Dwarf_info_reader::visit_type_unit): New function.
4288 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
4289 Sized_elf_reloc_mapper.
4290 (Sized_dwarf_line_info::symbol_section): Remove function.
4291 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
4292 (Sized_dwarf_line_info::read_line_mappings): Remove object
4293 parameter, adjust callers.
4294 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
4295 * dwarf_reader.h: Include <sys/types.h>.
4296 (class Track_relocs): Remove forward declaration.
4297 (class Elf_reloc_mapper): New class.
4298 (class Sized_elf_reloc_mapper): New class.
4299 (class Dwarf_abbrev_table): New class.
4300 (class Dwarf_range_list): New class.
4301 (class Dwarf_ranges_table): New class.
4302 (class Dwarf_pubnames_table): New class.
4303 (class Dwarf_die): New class.
4304 (class Dwarf_info_reader): New class.
4305 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
4306 (Sized_dwarf_line_info::symbol_section): Remove member function.
4307 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
4308 base class.
4309 * gdb-index.cc: New source file.
4310 * gdb-index.h: New source file.
4311 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
4312 and .debug_types sections, call Layout::add_to_gdb_index.
4313 (Sized_relobj_incr::do_section_name): Implement.
4314 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
4315 return type; Implement.
4316 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
4317 return type.
4318 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
4319 parameter list and return type.
4320 (Sized_incr_dynobj::do_section_contents): Likewise.
4321 * layout.cc: Include gdb-index.h.
4322 (Layout::Layout): Initialize gdb_index_data_.
4323 (Layout::init_fixed_output_section): Check for .gdb_index section.
4324 (Layout::add_to_gdb_index): New function. Instantiate.
4325 * layout.h: Add forward declaration for class Gdb_index.
4326 (Layout::add_to_gdb_index): New member function.
4327 (Layout::gdb_index_data_): New data member.
4328 * main.cc: Include gdb-index.h.
4329 (main): Print statistics for gdb index.
4330 * object.cc (Object::section_contents): Move code into
4331 do_section_contents.
4332 (need_decompressed_section): Check for sections needed when building
4333 gdb index.
4334 (build_compressed_section_map): Likewise.
4335 (Sized_relobj_file::do_read_symbols): Need local symbols when building
4336 gdb index.
4337 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
4338 sections; call Layout::add_to_gdb_index.
4339 (Sized_relobj_file::do_decompressed_section_contents): Call
4340 do_section_contents directly.
4341 * object.h (Object::do_section_contents): Adjust parameter list and
4342 return type.
4343 (Object::do_decompressed_section_contents): Call do_section_contents
4344 directly.
4345 (Sized_relobj_file::do_section_contents): Adjust parameter list and
4346 return type.
4347 * options.h (class General_options): Add --gdb-index option.
4348 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
4349 list and return type.
4350 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
4351 * reloc.h (Track_relocs::checkpoint): New function.
4352 (Track_relocs::reset): New function.
4353
4354 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
4355 New test cases.
4356 * testsuite/Makefile.in: Regenerate.
4357 * testsuite/gdb_index_test.cc: New test source file.
4358 * testsuite/gdb_index_test_1.sh: New test source file.
4359 * testsuite/gdb_index_test_2.sh: New test source file.
4360
647f1574
DK
43612012-03-19 Doug Kwan <dougkwan@google.com>
4362
4363 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 4364 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
4365 __exidx_start and __exidx_end. Make symbol table parameter
4366 anonymous as it is not used.
4367 * gold.cc (queue_middle_tasks): Call target hook to define any
4368 target-specific symbols.
4369 * target.h (Target::define_standard_symbols): New method.
4370 (Target::do_define_standard_symbols): Same.
4371 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
4372 * testsuite/Makefile.in: Regenerate.
4373 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
4374 and __exidx_end.
4375 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
4376 relocations are generated for __exidx_start and __exidx_end.
4377
7c6109da
DK
43782012-03-16 Doug Kwan <dougkwan@google.com>
4379
4380 * testsuite/Makefile.am: Disable test initpri3b.
4381 * testsuite/Makefile.in: Regenerate.
4382
7b8957f8
DK
43832012-03-15 Doug Kwan <dougkwan@google.com>
4384
4385 * arm.cc (Target_arm::got_section): Make .got section read-only
4386 if -z now is given.
4387
14dc9ef7
ILT
43882012-03-15 Ian Lance Taylor <iant@google.com>
4389
4390 PR gold/13850
4391 * layout.cc (Layout::make_output_section): Correctly mark
4392 SHT_INIT_ARRAY, et. al., as relro.
4393
fa40b62a
DK
43942012-03-14 Doug Kwan <dougkwan@google.com>
4395
4396 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
4397 dynamic relocations for protected symbols in shared objects.
4398
fd325007
ILT
43992012-03-13 Ian Lance Taylor <iant@google.com>
4400
4401 * resolve.cc (Symbol_table::resolve): When merging common symbols,
4402 keep the larger alignment.
4403
e8dd54e1
CC
44042012-03-12 Cary Coutant <ccoutant@google.com>
4405
4406 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
4407 handling of DW_LNE_define_file.
4408
feb5f3b0
CC
44092012-03-12 Cary Coutant <ccoutant@google.com>
4410
4411 * reduced_debug_output.cc
4412 (Output_reduced_debug_info_section::get_die_end): Add new FORM
4413 codes to switch.
4414
a1fb4256
CC
44152012-02-29 Cary Coutant <ccoutant@google.com>
4416
4417 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
4418
5dd8762a
CC
44192012-02-29 Cary Coutant <ccoutant@google.com>
4420
4421 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4422 Call Object::decompressed_section_contents.
4423 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
4424 New dtor.
4425 (Sized_dwarf_line_info::buffer_start_): New data member.
4426 * merge.cc (Output_merge_data::do_add_input_section): Call
4427 Object::decompressed_section_contents.
4428 (Output_merge_string::do_add_input_section): Likewise.
4429 * object.cc (need_decompressed_section): New function.
4430 (build_compressed_section_map): Decompress sections needed later.
4431 (Sized_relobj_file::do_decompressed_section_contents): New function.
4432 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4433 * object.h (Object::decompressed_section_contents): New function.
4434 (Object::discard_decompressed_sections): New function.
4435 (Object::do_decompressed_section_contents): New function.
4436 (Object::do_discard_decompressed_sections): New function.
4437 (Compressed_section_info): New type.
4438 (Compressed_section_map): Include decompressed section contents.
4439 (Sized_relobj_file::do_decompressed_section_contents): New function.
4440 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4441
7b5de7ee
CC
44422012-02-16 Cary Coutant <ccoutant@google.com>
4443
4444 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
4445 * testsuite/Makefile.in: Regenerate.
4446
f9fa4a63
CC
44472012-02-14 Cary Coutant <ccoutant@google.com>
4448
4449 * options.cc (General_options::finalize): Disallow -pie and -static.
4450
2c175ebc
DK
44512012-02-03 Doug Kwan <dougkwan@google.com>
4452
4453 * arm.cc (Arm_relocate_functions::abs8,
4454 Arm_relocate_functions::abs16): Use
4455 Bits::has_signed_unsigned_overflow32.
4456 (Arm_relocate_functions::thm_abs8): Correct range of
4457 overflow check.
4458 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
4459 in assertions.
4460
90cff06f
DK
44612012-02-02 Doug Kwan <dougkwan@google.com>
4462
4463 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
4464 position independent outputs, not just shared objects.
4465
63887f3d
L
44662012-01-30 H.J. Lu <hongjiu.lu@intel.com>
4467
4468 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
4469 * configure: Regenerated.
4470
bef2b434
ILT
44712012-01-27 Ian Lance Taylor <iant@google.com>
4472
4473 * reloc.h (Bits): New class with static functions, copied from
4474 namespace utils in arm.cc.
4475 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
4476 instead.
4477
c335b55d
L
44782012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4479
4480 * incremental.cc (write_info_blocks): Correct relocation offset.
4481
41194d9f
L
44822012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4483
4484 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
4485 (Relocate::tls_gd_to_le): Likewise.
4486
1bae613c
L
44872012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4488
4489 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
4490
24482ca0
L
44912012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4492
4493 * configure.ac: Check if -mcmodel=medium works.
4494 * configure: Regenerated.
4495
c2c7840a
CC
44962012-01-24 Cary Coutant <ccoutant@google.com>
4497
4498 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
4499 definition and ...
4500 (read_unsigned_LEB_128_x): ... this new function.
4501 (read_signed_LEB_128): Replaced with inline definition and ...
4502 (read_signed_LEB_128_x): ... this new function.
4503 * int_encoding.h (read_unsigned_LEB_128_x): New function.
4504 (read_unsigned_LEB_128): Add inline definition.
4505 (read_signed_LEB_128_x): New function.
4506 (read_signed_LEB_128): Add inline definition.
4507 * testsuite/Makefile.am (leb128_unittest): New unit test.
4508 * testsuite/Makefile.in: Regenerate.
4509 * testsuite/leb128_unittest.cc: New unit test.
4510
833de760 45112012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
4512
4513 PR gold/13617
4514 * i386.cc (Target_i386::do_code_fill): When using a jmp
4515 instruction, pad with nop instructions.
4516 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4517
618d6666
L
45182012-01-22 H.J. Lu <hongjiu.lu@intel.com>
4519
4520 * x86_64.cc (gc_process_relocs): Add typename on types used in
4521 template.
4522 (scan_relocs): Likewise.
4523 (relocate_section): Likewise.
4524 (apply_relocation): Likewise.
4525
3660ff06
L
45262012-01-10 H.J. Lu <hongjiu.lu@intel.com>
4527
4528 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
4529 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
4530 under x32.
4531
fc51264f
L
45322012-01-09 H.J. Lu <hongjiu.lu@intel.com>
4533
4534 * x86_64.cc: Initial support for x32.
4535
dd74ae06
CC
45362012-01-03 Cary Coutant <ccoutant@google.com>
4537
4538 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
4539 Use abstract base class for GOT.
4540 * gold/output.h (class Output_data_got_base): New abstract base class.
4541 (class Output_data_got): Derive from new base class, adjust ctors.
4542 (Output_data_got::reserve_slot): Make virtual; rename to
4543 do_reserve_slot; Adjust callers.
4544 * gold/target.h (Sized_target::init_got_plt_for_update): Return
4545 pointer to abstract base class.
4546 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
4547
83896202
ILT
45482011-12-18 Ian Lance Taylor <iant@google.com>
4549
4550 * object.h (Relobj::local_symbol_value): New function.
4551 (Relobj::local_plt_offset): New function.
4552 (Relobj::local_has_got_offset): New function.
4553 (Relobj::local_got_offset): New function.
4554 (Relobj::set_local_got_offset): New function.
4555 (Relobj::do_local_symbol_value): New pure virtual function.
4556 (Relobj::do_local_plt_offset): Likewise.
4557 (Relobj::do_local_has_got_offset): Likewise.
4558 (Relobj::do_local_got_offset): Likewise.
4559 (Relobj::do_set_local_got_offset): Likewise.
4560 (Sized_relobj::do_local_has_got_offset): Rename from
4561 local_has_got_offset.
4562 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
4563 (Sized_relobj::do_set_local_got_offset): Rename from
4564 set_local_got_offset.
4565 (Sized_relobj_file::do_local_plt_offset): Rename from
4566 local_plt_offset.
4567 (Sized_relobj_file::do_local_symbol_value): New function.
4568 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
4569 local_plt_offset.
4570 * output.cc (Output_data_got::Got_entry::write): Change object to
4571 Relobj. Use local_symbol_value.
4572 (Output_data_got::add_global_with_rel): Change rel_dyn to
4573 Output_data_reloc_generic*. Use add_global_generic.
4574 (Output_data_got::add_global_with_rela): Remove. Change all
4575 callers to use add_global_with_rel.
4576 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
4577 Output_data_reloc_generic*. Use add_global_generic.
4578 (Output_data_got::add_global_pair_with_rela): Remove. Change all
4579 callers to use add_global_pair_with_rel.
4580 (Output_data_got::add_local): Change object to Relobj*.
4581 (Output_data_got::add_local_plt): Likewise.
4582 (Output_data_got::add_local_with_rel): Change object to Relobj*,
4583 change rel_dyn to Output_data_reloc_generic*. Use
4584 add_local_generic.
4585 (Output_data_got::add_local_with_rela): Remove. Change all
4586 callers to use all_local_with_rel.
4587 (Output_data_got::add_local_pair_with_rel): Change object to
4588 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
4589 add_output_section_generic.
4590 (Output_data_got::add_local_pair_with_rela): Remove. Change all
4591 callers to use add_local_pair_with_rel.
4592 (Output_data_got::reserve_local): Change object to Relobj*.
4593 * output.h: (class Output_data_reloc_generic): Add pure virtual
4594 declarations for add_global_generic, add_local_generic,
4595 add_output_section_generic.
4596 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
4597 functions for Output_data_reloc_generic. Update declarations for
4598 changes listed in output.cc.
4599 (class Output_data_got): Change template parameter to got_size.
4600 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
4601 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
4602 function.
4603 (Sized_relobj_incr::do_local_plt_offset): New function.
4604 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
4605 add_global_generic.
4606
76677ad0
CC
46072011-12-17 Cary Coutant <ccoutant@google.com>
4608
4609 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
4610 * resolve.cc (Symbol_table::resolve): Likewise.
4611 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
4612 arrays.
4613 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4614
8b8dd8d5
ILT
46152011-12-16 Ian Lance Taylor <iant@google.com>
4616
4617 * output.h (Output_data_reloc_generic::add): Only call
4618 add_dynamic_reloc if this is a dynamic reloc section.
4619
d55525b9
L
46202011-12-15 H.J. Lu <hongjiu.lu@intel.com>
4621
4622 PR gold/13505
4623 * target-reloc.h (apply_relocation): Replace <64, false> with
4624 <size, big_endian>.
4625
ff81c7c1
NC
46262011-11-25 Nick Clifton <nickc@redhat.com>
4627
4628 * po/it.po: New Italian translation.
4629
628f39be
SA
46302011-11-17 Sterling Augustine <saugustine@google.com>
4631
4632 * script.cc (script_include_directive): Implement.
4633 (read_script_file): New local variables name and search_path. Update
4634 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
4635 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
4636 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
4637
98ef3ea4
SA
46382011-11-11 Sterling Augustine <saugustine@google.com>
4639
4640 * yyscript.y (section_cmd): Add support for INCLUDE directive.
4641 (file_or_sections_cmd): Likewise.
4642
f4a8b6d7
DK
46432011-11-11 Doug Kwan <dougkwan@google.com>
4644
4645 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
4646 if --just-symbols is given.
4647
29ab395d
DK
46482011-11-10 Doug Kwan <dougkwan@google.com>
4649
4650 PR gold/13362
4651 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
4652 when processing data relocs.
4653 * reloc.h (Relocate_functions::rel_unaligned): New method.
4654 (Relocate_functions::pcrel_unaligned): Ditto.
4655 (Relocate_functions::rel32_unaligned): Ditto.
4656 (Relocate_functions::pcrel32_unaligned): Ditto.
4657
2c339f71
DK
46582011-11-09 Doug Kwan <dougkwan@google.com>
4659
4660 PR gold/13362
4661 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
4662 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
4663 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
4664 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4665 (Relocate_functions::rel_unaligned): New.
4666 (Relocate_functions::rel32_unaligned): New.
4667 * target-reloc.h (relocate_for_relocatable): Add code to handle
4668 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4669 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
4670 arm_unaligned_reloc_r): New targets.
4671 * testsuite/Makefile.in: Regenerate.
4672 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
4673 linking.
4674
3f3cddf1
ILT
46752011-11-02 Ian Lance Taylor <iant@google.com>
4676
4677 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
4678 NATIVE_LINKER.
4679 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
4680 * options.cc (General_options::finalize): Use library search path
4681 from configure script if specified. If not native and no sysroot,
4682 only search TOOLLIBDIR.
4683 * options.h (Search_directory::Search_directory): Change name to
4684 const std::string&.
4685 (General_options::add_to_library_path_with_sysroot): Change arg to
4686 const std::string&.
4687 * configure, Makefile.in, config.in: Rebuild.
4688
a8e2273b
ILT
46892011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4690
4691 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
4692 we are working around the ARM1176 Erratum.
4693 * options.h (General_options::fix_arm1176): Add option.
4694 * testsuite/Makefile.am: Add testcases, and keep current ones
4695 working.
4696 * testsuite/Makefile.in: Regenerate.
4697 * testsuite/arm_fix_1176.s: New file.
4698 * testsuite/arm_fix_1176.sh: Likewise.
4699
cd6eab1c
ILT
47002011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4701
4702 * arm.cc (Target_arm::Target_arm): Remove initialisation of
4703 may_use_blx_.
4704 (Target_arm::may_use_blx): Remove method.
4705 (Target_arm::set_may_use_blx): Likewise.
4706 (Target_arm::may_use_v4t_interworking): New method.
4707 (Target_arm::may_use_v5t_interworking): Likewise.
4708 (Target_arm::may_use_blx_): Remove member variable.
4709 (Arm_relocate_functions::arm_branch_common): Check for v5T
4710 interworking.
4711 (Arm_relocate_functions::thumb_branch_common): Likewise.
4712 (Reloc_stub::stub_type_for_reloc): Likewise.
4713 (Target_arm::do_finalize_sections): Correct interworking checks.
4714 * testsuite/Makefile.am: Add new tests.
4715 * testsuite/Makefile.in: Regenerate.
4716 * testsuite/arm_farcall_arm_arm.s: New test.
4717 * testsuite/arm_farcall_arm_arm.sh: Likewise.
4718 * testsuite/arm_farcall_arm_thumb.s: Likewise.
4719 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
4720 * testsuite/arm_farcall_thumb_arm.s: Likewise.
4721 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
4722 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
4723 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
4724
286adcf4
CC
47252011-10-31 Cary Coutant <ccoutant@google.com>
4726
4727 PR gold/13023
4728 * expression.cc (Expression::eval_with_dot): Add
4729 is_section_dot_assignment parameter.
4730 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
4731 absolute and assigning to dot within a section.
4732 * script-sections.cc
4733 (Output_section_element_assignment::set_section_addresses): Pass
4734 dot_section to set_if_absolute.
4735 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
4736 as is_section_dot_assignment flag to eval_with_dot.
4737 (Output_section_element_dot_assignment::set_section_addresses):
4738 Likewise.
4739 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
4740 parameter. Also set value if relative to dot_section; set the
4741 symbol's output_section.
4742 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
4743 parameter. Adjust all callers.
4744 (Expression::eval_maybe_dot): Likewise.
4745 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
4746 Adjust all callers.
4747 * testsuite/script_test_2.t: Test assignment of an absolute value
4748 to dot within an output section element.
4749
9634ed06
CC
47502011-10-31 Cary Coutant <ccoutant@google.com>
4751
4752 * options.h (class General_options): Add --[no-]gnu-unique options.
4753 * symtab.cc (Symbol_table::sized_write_globals): Convert
4754 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
4755
de4101c7
CC
47562011-10-31 Cary Coutant <ccoutant@google.com>
4757
4758 PR gold/13359
4759 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
4760 unnecessary assertion.
4761 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
4762
7257cc92
ST
47632011-10-31 Sriraman Tallam <tmsriram@google.com>
4764
4765 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4766 gc_mark_symbol.
4767 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4768 gc_mark_symbol.
4769 Change to just keep the section associated with symbol.
4770 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
4771 they are externally visible and --export-dynamic is turned on.
4772 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
4773
bfc34b3f
ILT
47742011-10-19 Ian Lance Taylor <iant@google.com>
4775
4776 PR gold/13163
4777 * script-sections.cc
4778 (Output_section_element_dot_assignment::needs_output_section): New
4779 function.
4780
ea0d8c47
ILT
47812011-10-19 Ian Lance Taylor <iant@google.com>
4782
4783 PR gold/13204
4784 * layout.cc (Layout::segment_precedes): Don't assert failure if a
4785 --section-start option was seen.
4786 * options.h (General_options::any_section_start): New function.
4787
abd242a9
DM
47882011-10-18 David S. Miller <davem@davemloft.net>
4789
4790 PR binutils/13301
4791 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
4792 member to track relocation locations that have moved during TLS
4793 reloc optimizations.
4794 (Target_sparc::Relocate::Relocate): Initialize to NULL.
4795 (Target_sparc::Relocate::relocate): Adjust view down by 4
4796 bytes if it matches reloc_adjust_addr_.
4797 (Target_sparc::Relocate::relocate_tls): Always move the
4798 __tls_get_addr call delay slot instruction forward 4 bytes when
4799 performing relaxation.
4800
bab9090f
CC
48012011-10-18 Cary Coutant <ccoutant@google.com>
4802
4803 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
4804 (Output_file::map_no_anonymous): Check for non-zero
4805 return code from posix_fallocate.
4806
f7c5b166
CC
48072011-10-17 Cary Coutant <ccoutant@google.com>
4808
4809 PR gold/13245
4810 * plugin.cc (is_visible_from_outside): Check for symbols
4811 referenced from dynamic objects.
4812 * resolve.cc (Symbol_table::resolve): Don't count references
4813 from dynamic objects as references from real ELF files.
4814 * testsuite/plugin_test_2.sh: Adjust expected result.
4815
b490c0bb
CC
48162011-10-17 Cary Coutant <ccoutant@google.com>
4817
4818 * gold.cc: Include timer.h.
4819 (queue_middle_tasks): Stamp time.
4820 (queue_final_tasks): Likewise.
4821 * main.cc (main): Store timer in parameters. Print timers
4822 for each pass.
4823 * parameters.cc (Parameters::Parameters): Initialize timer_.
4824 (Parameters::set_timer): New function.
4825 (set_parameters_timer): New function.
4826 * parameters.h (Parameters::set_timer): New function.
4827 (Parameters::timer): New function.
4828 (Parameters::timer_): New data member.
4829 (set_parameters_timer): New function.
4830 * timer.cc (Timer::stamp): New function.
4831 (Timer::get_pass_time): New function.
4832 * timer.h (Timer::stamp): New function.
4833 (Timer::get_pass_time): New function.
4834 (Timer::pass_times_): New data member.
4835
f475cf7b
CC
48362011-10-17 Cary Coutant <ccoutant@google.com>
4837
4838 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
4839 task for members of lib groups.
4840
cdd7e244
CC
48412011-10-17 Cary Coutant <ccoutant@google.com>
4842
4843 PR gold/13288
4f95c8b4 4844 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
4845 (File_read::make_view): Move bounds check (replace with assert)...
4846 (File_read::find_or_make_view): ... to here.
4847
dfb45471
CC
48482011-10-12 Cary Coutant <ccoutant@google.com>
4849
4f95c8b4 4850 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
4851 ::read returns less than requested size.
4852
53bbcc1b
CC
48532011-10-10 Cary Coutant <ccoutant@google.com>
4854
4f95c8b4 4855 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
4856 Initialize defined_count_.
4857 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
4858 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
4859 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
4860 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
4861 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 4862 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
4863 member.
4864 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 4865 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
4866 Return zeroes instead of internal error.
4867
397b129b
CC
48682011-10-10 Cary Coutant <ccoutant@google.com>
4869
4870 PR gold/13249
4f95c8b4 4871 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 4872 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 4873 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
4874 (Output_reloc::type_): Adjust size of bit field.
4875 (Output_reloc::use_plt_offset_): New bit field.
4876 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
4877 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
4878 flag. Adjust all callers.
4f95c8b4 4879 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
4880 creating RELATIVE relocations.
4881
d5698657
NC
48822011-10-10 Nick Clifton <nickc@redhat.com>
4883
4884 * po/es.po: Updated Spanish translation.
4885 * po/fi.po: Updated Finnish translation.
4886
6a59a5c2
DN
48872011-10-03 Diego Novillo <dnovillo@google.com>
4888
4889 * options.cc (parse_uint): Fix dereference of RETVAL.
4890
f0558624
ST
48912011-09-29 Sriraman Tallam <tmsriram@google.com>
4892
4893 * layout.h (section_order_map_): New member.
4894 (get_section_order_map): New member function.
4895 * output.cc (Output_section::add_input_section): Check for patterns
4896 only when --section-ordering-file is specified.
4897 * gold.cc (queue_middle_tasks): Delay updating order of sections till
4898 output_sections have been formed.
4899 * layout.cc (Layout_Layout): Initialize section_order_map_.
4900 * plugin.cc (update_section_order): Store order in order_map. Do not
4901 update the order.
4902 * testsuite/Makefile.am: Add test case for plugin_final_layout.
4903 * testsuite/Makefile.in: Regenerate.
4904 * testsuite/plugin_section_order.c: New file.
4905 * testsuite/plugin_final_layout.cc: New file.
4906 * testsuite/plugin_final_layout.sh: New file.
4907
a7dac153
CC
49082011-09-29 Cary Coutant <ccoutant@google.com>
4909
4f95c8b4 4910 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 4911 Check for NULL.
4f95c8b4 4912 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
4913 symbols during incremental update.
4914 (Symbol_table::add_from_dynobj): Likewise.
4915
eebd87a5
ILT
49162011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4917 Ian Lance Taylor <iant@google.com>
4918
4919 * symtab.cc (Symbol_table::define_special_symbol): Always
4920 canonicalize version string.
4921
403a3331
CC
49222011-09-26 Cary Coutant <ccoutant@google.com>
4923
4f95c8b4
CC
4924 * gold.cc (queue_initial_tasks): Move option checks ...
4925 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
4926 some options; make others fatal.
4927
235061c2
CC
49282011-09-26 Cary Coutant <ccoutant@google.com>
4929
4930 gcc PR lto/47247
4931 * plugin.cc (get_symbols_v2): New function.
4932 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
4933 (is_referenced_from_outside): New function.
4934 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
4935 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
4936 (get_symbols): Pass version parameter.
4937 (get_symbols_v2): New function.
4938 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
4939 parameter.
4940 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
4941 (onload): Add LDPT_GET_SYMBOLS_V2.
4942 (all_symbols_read_hook): Use get_symbols_v2; check for
4943 LDPR_PREVAILING_DEF_IRONLY_EXP.
4944 * testsuite/plugin_test_3.sh: Update expected results.
4945
dc87f620
ILT
49462011-09-23 Simon Baldwin <simonb@google.com>
4947
4948 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
4949 configuration options.
4950 * configure: Regenerate.
4951 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
4952 * Makefile.in: Regenerate.
4953 * testsuite/Makefile.in: Regenerate.
4954
a8279f82
ST
49552011-09-19 Sriraman Tallam <tmsriram@google.com>
4956
4957 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
4958
0c9350c8
CC
49592011-09-19 Cary Coutant <ccoutant@google.com>
4960
4961 * incremental.cc (can_incremental_update): Fix typo in comment.
4962 * incremental.h (can_incremental_update): Likewise.
4963
aa06ae28
CC
49642011-09-18 Cary Coutant <ccoutant@google.com>
4965
4966 * incremental.cc (can_incremental_update): New function.
4967 * incremental.h (can_incremental_update): New function.
4968 * layout.cc (Layout::init_fixed_output_section): Call it.
4969 (Layout::make_output_section): Don't allow patch space in .eh_frame.
4970 * object.cc (Sized_relobj_file::do_layout): Call
4971 can_incremental_update.
4972
ebb300b2
CC
49732011-09-13 Cary Coutant <ccoutant@google.com>
4974
4975 * configure.ac: Check for glibc support for gnu_indirect_function
4976 support with static linking, setting automake conditional
4977 IFUNC_STATIC.
4978 * Makefile.in: Regenerate.
4979 * configure: Regenerate.
4980
4981 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
4982 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
4983 for IFUNC_STATIC.
4984 * testsuite/Makefile.in: Regenerate.
4985
1206d0d5
CC
49862011-09-13 Cary Coutant <ccoutant@google.com>
4987
4988 * incremental.cc (Sized_relobj_incr::do_layout): Call
4989 report_comdat_group for kept comdat sections.
4990 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
4991 * testsuite/Makefile.in: Regenerate.
4992 * testsuite/incr_comdat_test_1.cc: New source file.
4993 * testsuite/incr_comdat_test_2_v1.cc: New source file.
4994 * testsuite/incr_comdat_test_2_v2.cc: New source file.
4995 * testsuite/incr_comdat_test_2_v3.cc: New source file.
4996
40b29874
ILT
49972011-09-13 Ian Lance Taylor <iant@google.com>
4998
4999 * object.cc (Sized_relobj_file::do_layout): Remove unused local
5000 variable external_symbols_offset.
5001
1b045aac
ILT
50022011-09-12 Ian Lance Taylor <iant@google.com>
5003
5004 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
5005 triggered if object has no symbols.
5006
24c6c55a
DM
50072011-09-09 David S. Miller <davem@davemloft.net>
5008
5009 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
5010 (Output_fill_debug_line::do_write): Likewise.
5011
66570254
CC
50122011-08-29 Cary Coutant <ccoutant@google.com>
5013
5014 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
5015 casts to match formatting specs.
5016 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
5017
8ea8cd50
CC
50182011-08-26 Cary Coutant <ccoutant@google.com>
5019
5020 * layout.cc (Free_list::allocate): Provide guarantee of minimum
5021 remaining hole size when allocating.
5022 (Layout::make_output_section): Set fill methods for debug sections.
5023 * layout.h (Free_list::Free_list_node): Move from private to
5024 public.
5025 (Free_list::set_min_hole_size): New function.
5026 (Free_list::begin, Free_list::end): New functions.
5027 (Free_list::min_hole_): New data member.
5028 * output.cc: Include dwarf.h.
5029 (Output_fill_debug_info::do_minimum_hole_size): New function.
5030 (Output_fill_debug_info::do_write): New function.
5031 (Output_fill_debug_line::do_minimum_hole_size): New function.
5032 (Output_fill_debug_line::do_write): New function.
5033 (Output_section::Output_section): Initialize new data member.
5034 (Output_section::set_final_data_size): Ensure patch space is larger
5035 than minimum hole size.
5036 (Output_section::do_write): Fill holes in debug sections.
5037 * output.h (Output_fill): New class.
5038 (Output_fill_debug_info): New class.
5039 (Output_fill_debug_line): New class.
5040 (Output_section::set_free_space_fill): New function.
5041 (Output_section::free_space_fill_): New data member.
5042 * testsuite/Makefile.am (incremental_test_3): Add
5043 --incremental-patch option.
5044 (incremental_test_4): Likewise.
5045 (incremental_test_5): Likewise.
5046 (incremental_test_6): Likewise.
5047 (incremental_copy_test): Likewise.
5048 (incremental_common_test_1): Likewise.
5049 * testsuite/Makefile.in: Regenerate.
5050
7cf80422
NC
50512011-08-26 Nick Clifton <nickc@redhat.com>
5052
5053 * po/es.po: Updated Spanish translation.
5054
c3f7b0e5
CC
50552011-08-01 Cary Coutant <ccoutant@google.com>
5056
5057 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
5058 * gold/testsuite/Makefile.in: Regenerate.
5059 * gold/testsuite/justsyms_exec.c: New source file.
5060 * gold/testsuite/justsyms_lib.c: New source file.
5061
9590bf25
CC
50622011-08-01 Cary Coutant <ccoutant@google.com>
5063
5064 * layout.cc (Layout::set_segment_offsets): Don't realign text
5065 segment if -Ttext was specified.
5066 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
5067 file type.
5068 * object.h (Sized_relobj_file::e_type): New function.
5069 (Sized_relobj_file::e_type_): New data member.
5070 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
5071 base address for ET_EXEC files.
5072 * target.cc (Target::do_make_elf_object_implementation): Allow
5073 ET_EXEC files with --just-symbols option.
5074
dcd8d12e
CC
50752011-07-28 Cary Coutant <ccoutant@google.com>
5076
5077 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
5078 Add thread_number parameter.
5079 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
5080 * workqueue-threads.cc
5081 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
5082 current thread if its thread number is greater than desired thread
5083 count.
5084 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
5085 Add thread_number parameter.
5086 (Workqueue::should_cancel_thread): Likewise.
5087 (Workqueue::find_runnable_or_wait): Pass thread_number to
5088 should_cancel_thread.
5089 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
5090 parameter.
5091
804eb480
ST
50922011-07-22 Sriraman Tallam <tmsriram@google.com>
5093
5094 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
5095 only after checking if it cannot be forced local.
5096 * symtab.h (is_externally_visible): Check if the symbol is not forced
5097 local.
5098
f1ddb600
ILT
50992011-07-15 Ian Lance Taylor <iant@google.com>
5100
5101 * options.h (class General_options): Add --print-output-format.
5102 Move -EL next to -EB, for better --help output.
5103 * target-select.cc: Include <cstdio>, "options.h", and
5104 "parameters.h".
5105 (Target_selector::do_target_bfd_name): New function.
5106 (print_output_format): New function.
5107 * target-select.h (class Target_selector): Update declarations.
5108 (Target_selector::target_bfd_name): New function.
5109 (print_output_format): Declare.
5110 * main.cc: Include "target-select.h".
5111 (main): Handle --print-output-format.
5112 * gold.cc: Include "target-select.h".
5113 (queue_initial_tasks): Handle --print-output-format when there are
5114 no input files.
5115 * parameters.cc (parameters_force_valid_target): Give a better
5116 error message if -EB/-EL does not match target.
5117 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
5118 function.
5119
7d172687
ILT
51202011-07-15 Ian Lance Taylor <iant@google.com>
5121
5122 * i386.cc (class Output_data_plt_i386): Add layout_ field.
5123 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
5124 (Output_data_plt_i386::do_write): Write address of .dynamic
5125 section to first entry in .got.plt section.
5126 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
5127 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5128 Initialize layout_.
5129 (Output_data_plt_x86_64::do_write): Write address of .dynamic
5130 section to first entry in .got.plt section.
5131 * layout.h (Layout::dynamic_section): New function.
5132
e9552f7e
ST
51332011-07-13 Sriraman Tallam <tmsriram@google.com>
5134
5135 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
5136 to claim_file call.
5137 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
5138 input_section_position_, and input_section_glob_.
5139 (read_layout_from_file): Call function section_ordering_specified.
5140 * layout.h (is_section_ordering_specified): New function.
5141 (section_ordering_specified): New function.
5142 (section_ordering_specified_): New boolean member.
5143 * main.cc(main): Call load_plugins after layout object is defined.
5144 * output.cc (Output_section::add_input_section): Use
5145 function section_ordering_specified to check if section ordering is
5146 needed.
5147 * output.cc (Output_section::add_relaxed_input_section): Use
5148 function section_ordering_specified to check if section ordering is
5149 needed.
5150 (Output_section::update_section_layout): New function.
5151 (Output_section::sort_attached_input_sections): Check if input section
5152 must be reordered.
5153 * output.h (Output_section::update_section_layout): New function.
5154 * plugin.cc (get_section_count): New function.
5155 (get_section_type): New function.
5156 (get_section_name): New function.
5157 (get_section_contents): New function.
5158 (update_section_order): New function.
58797674 5159 (allow_section_ordering): New function.
e9552f7e
ST
5160 (Plugin::load): Add the new interfaces to the transfer vector.
5161 (Plugin_manager::load_plugins): New parameter.
5162 (Plugin_manager::all_symbols_read): New parameter.
5163 (Plugin_manager::claim_file): New parameter. Save the elf object for
5164 unclaimed objects.
5165 (Plugin_manager::get_elf_object): New function.
5166 (Plugin_manager::get_view): Change to directly use the bool to check
5167 if get_view is called from claim_file_hook.
5168 * plugin.h (input_objects): New function
5169 (Plugin__manager::load_plugins): New parameter.
5170 (Plugin_manager::claim_file): New parameter.
5171 (Plugin_manager::get_elf_object): New function.
5172 (Plugin_manager::in_claim_file_handler): New function.
5173 (Plugin_manager::in_claim_file_handler_): New member.
5174 (layout): New function.
5175 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
5176 handler with an extra parameter. Make the elf object before calling
5177 claim_file handler.
5178 * testsuite/plugin_test.c (get_section_count): New function pointer.
5179 (get_section_type): New function pointer.
5180 (get_section_name): New function pointer.
5181 (get_section_contents): New function pointer.
5182 (update_section_order): New function pointer.
5183 (allow_section_ordering): New function pointer.
5184 (onload): Check if the new interfaces exist.
5185
9446efde
ILT
51862011-07-13 Ian Lance Taylor <iant@google.com>
5187
5188 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
5189 relro section.
5190 * x86_64.cc (Target_x86_64::got_section): Likewise.
5191 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
5192 (relro_now_test_SOURCES): New variable.
5193 (relro_now_test_DEPENDENCIES): New variable.
5194 (relro_now_test_LDFLAGS): New variable.
5195 (relro_now_test_LDADD): New variable.
5196 (relro_now_test.so): New target.
5197 * testsuite/Makefile.in: Rebuild.
5198
07aa62f2
ILT
51992011-07-12 Ian Lance Taylor <iant@google.com>
5200
5201 PR gold/12980
5202 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
5203 GLOB_DAT relocation rather than a RELATIVE relocation for a
5204 protected symbol when creating a shared library.
5205 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5206 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
5207 * testsuite/protected_main_1.cc (main): Test that protected
5208 function has same address.
5209
e2153196
ILT
52102011-07-11 Ian Lance Taylor <iant@google.com>
5211
5212 PR gold/12979
5213 * options.h (class General_options): Add -Bgroup.
5214 * options.cc (General_options::finalize): If -Bgroup is set,
5215 default to --unresolved-symbols=report-all.
5216 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
5217 * target-reloc.h (issue_undefined_symbol_error): Handle
5218 --unresolved-symbols=report-all.
5219
6daf5215
ILT
52202011-07-08 Ian Lance Taylor <iant@google.com>
5221
5222 PR gold/11985
5223 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
5224 if linker script discards key sections.
5225 (Layout::create_dynamic_symtab): Likewise.
5226 (Layout::assign_local_dynsym_offsets): Likewise.
5227 (Layout::sized_create_version_sections): Likewise.
5228 (Layout::create_interp): Likewise.
5229 (Layout::finish_dynamic_section): Likewise.
5230 (Layout::set_dynamic_symbol_size): Likewise.
5231
beabb2c6
ILT
52322011-07-08 Ian Lance Taylor <iant@google.com>
5233
5234 PR gold/12386
5235 * options.h (class General_options): Add --unresolved-symbols.
5236 * target-reloc.h (issue_undefined_symbol_error): Check
5237 --unresolved-symbols. Add comments.
5238
9c16daf1
ILT
52392011-07-08 Ian Lance Taylor <iant@google.com>
5240
5241 * testsuite/odr_violation2.cc (Ordering::operator()): Make
5242 expression more complex.
5243
191f1a2d
ILT
52442011-07-08 Ian Lance Taylor <iant@google.com>
5245
5246 PR gold/11317
5247 * target-reloc.h (issue_undefined_symbol_error): New inline
5248 function, broken out of relocate_section.
5249 (relocate_section): Call issue_undefined_symbol_error.
5250 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5251 there is no TLS segment if we are about to issue an undefined
5252 symbol error.
5253 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5254
62855347
ILT
52552011-07-08 Ian Lance Taylor <iant@google.com>
5256
5257 PR gold/12279
5258 * resolve.cc (Symbol_table::should_override): Add fromtype
5259 parameter. Change all callers. Give error when linking together
5260 TLS and non-TLS symbol.
5261 (Symbol_table::should_override_with_special): Add fromtype
5262 parameter. Change all callers.
5263 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5264 there is no TLS segment if we have reported some errors.
5265 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5266
67181c72
ILT
52672011-07-08 Ian Lance Taylor <iant@google.com>
5268
5269 PR gold/12372
5270 * target.h (Target::plt_address_for_global): New function.
5271 (Target::plt_address_for_local): New function.
5272 (Target::plt_section_for_global): Remove.
5273 (Target::plt_section_for_local): Remove.
5274 (Target::do_plt_address_for_global): New virtual function.
5275 (Target::do_plt_address_for_local): New virtual function.
5276 (Target::do_plt_section_for_global): Remove.
5277 (Target::do_plt_section_for_local): Remove.
5278 (Target::register_global_plt_entry): Add Symbol_table and Layout
5279 parameters.
5280 * output.cc (Output_data_got::Got_entry::write): Use
5281 plt_address_for_global and plt_address_for_local.
5282 * layout.cc (Layout::add_target_dynamic_tags): Use size and
5283 address of output section.
5284 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
5285 got_irelative_, and irelative_count_ fields. Update
5286 declarations.
5287 (Output_data_plt_i386::has_irelative_section): New function.
5288 (Output_data_plt_i386::entry_count): Add irelative_count_.
5289 (Output_data_plt_i386::set_final_data_size): Likewise.
5290 (class Target_i386): Add got_irelative_ and rel_irelative_
5291 fields. Update declarations.
5292 (Target_i386::Target_i386): Initialize new fields.
5293 (Target_i386::do_plt_address_for_global): New function replacing
5294 do_plt_section_for_global.
5295 (Target_i386::do_plt_address_for_local): New function replacing
5296 do_plt_section_for_local.
5297 (Target_i386::got_section): Create got_irelative_.
5298 (Target_i386::rel_irelative_section): New function.
5299 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
5300 fields. Don't define __rel_iplt_{start,end}.
5301 (Output_data_plt_i386::add_entry): Add symtab and layout
5302 parameters. Change all callers. Use different PLT and GOT for
5303 IFUNC symbols.
5304 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
5305 layout parameters. Change all callers. Use different PLT and
5306 GOT.
5307 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
5308 (Output_data_plt_i386::rel_irelative): New function.
5309 (Output_data_plt_i386::address_for_global): New function.
5310 (Output_data_plt_i386::address_for_local): New function.
5311 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
5312 IRELATIVE GOT when changing IFUNC GOT entries.
5313 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
5314 reloc.
5315 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
5316 if we didn't create an IRELATIVE GOT.
5317 (Target_i386::Relocate::relocate): Use plt_address_for_global and
5318 plt_address_for_local.
5319 (Target_i386::do_dynsym_value): Use plt_address_for_global.
5320 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
5321 got_irelative_, and irelative_count_ fields. Update
5322 declarations.
5323 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5324 Initialize new fields. Remove symtab parameter. Change all
5325 callers.
5326 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
5327 irelative_count_.
5328 (Output_data_plt_x86_64::has_irelative_section): New function.
5329 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
5330 (class Target_x86_64): Add got_irelative_ and rel_irelative_
5331 fields. Update declarations.
5332 (Target_x86_64::Target_x86_64): Initialize new fields.
5333 (Target_x86_64::do_plt_address_for_global): New function replacing
5334 do_plt_section_for_global.
5335 (Target_x86_64::do_plt_address_for_local): New function replacing
5336 do_plt_section_for_local.
5337 (Target_x86_64::got_section): Create got_irelative_.
5338 (Target_x86_64::rela_irelative_section): New function.
5339 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
5340 all callers. Don't create __rel_iplt_{start,end}.
5341 (Output_data_plt_x86_64::add_entry): Add symtab and layout
5342 parameters. Change all callers. Use different PLT and GOT for
5343 IFUNC symbols.
5344 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
5345 layout parameters. Change all callers. Use different PLT and
5346 GOT.
5347 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
5348 parameters. Change all callers. Use different PLT and GOT for
5349 IFUNC symbols.
5350 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
5351 (Output_data_plt_x86_64::rela_irelative): New function.
5352 (Output_data_plt_x86_64::address_for_global): New function.
5353 (Output_data_plt_x86_64::address_for_local): New function.
5354 (Output_data_plt_x86_64::set_final_data_size): Likewise.
5355 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
5356 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
5357 (Target_x86_64::register_global_plt_entry): Add symtab and layout
5358 parameters.
5359 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
5360 reloc.
5361 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
5362 symbols if we didn't create an IRELATIVE GOT.
5363 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
5364 plt_address_for_local.
5365 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
5366 * testsuite/ifuncvar1.c: New test file.
5367 * testsuite/ifuncvar2.c: New test file.
5368 * testsuite/ifuncvar3.c: New test file.
5369 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
5370 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
5371 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
5372 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
5373 * testsuite/Makefile.in: Rebuild.
5374
33c15b45
CC
53752011-07-07 Cary Coutant <ccoutant@google.com>
5376
5377 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
5378 (two_file_test_1_ndebug.o): Likewise.
5379 (two_file_test_1b_ndebug.o): Likewise.
5380 (two_file_test_2_ndebug.o): Likewise.
5381 (two_file_test_main_ndebug.o): Likewise.
5382 (incremental_test_2): Link with no-debug versions.
5383
f48b5fb7
CC
53842011-07-06 Cary Coutant <ccoutant@google.com>
5385
5386 * gold/incremental.cc
5387 (Output_section_incremental_inputs::write_info_blocks): Check for
5388 hidden and internal symbols.
5389
221597a5
CC
53902011-07-06 Cary Coutant <ccoutant@google.com>
5391
5392 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
5393 Check disposition for startup file.
5394 (Incremental_inputs::report_command_line): Ignore
5395 --incremental-startup-unchanged option.
5396 * options.cc (General_options::parse_incremental_startup_unchanged):
5397 New function.
5398 (General_options::General_options): Initialize new data member.
5399 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
5400 (General_options): Add --incremental-startup-unchanged option.
5401 (General_options::incremental_startup_disposition): New function.
5402 (General_options::incremental_startup_disposition_): New data member.
5403
e24719f6
CC
54042011-07-06 Cary Coutant <ccoutant@google.com>
5405
5406 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
5407 input file index to Script_info ctor.
5408 (Sized_incremental_binary::do_file_has_changed): Find the
5409 command-line argument for files named in scripts.
5410 * incremental.h (Script_info::Script_info): New ctor
5411 with input file index.
5412 (Script_info::input_file_index): New function.
5413 (Script_info::input_file_index_): New data member.
5414 (Incremental_binary::get_library): Add const.
5415 (Incremental_binary::get_script_info): Add const.
5416 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
5417 * testsuite/Makefile.am (incremental_test_5): New test case.
5418 (incremental_test_6): New test case.
5419 * testsuite/Makefile.in: Regenerate.
5420
8f7c81e8
CC
54212011-07-06 Cary Coutant <ccoutant@google.com>
5422
5423 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
5424 debug output when command lines differ.
5425
9fbd3822
CC
54262011-07-06 Cary Coutant <ccoutant@google.com>
5427
5428 * incremental.cc (Incremental_inputs::report_command_line): Ignore
5429 --incremental-patch option.
5430 * layout.cc (Free_list::allocate): Extend allocation beyond original
5431 end if enabled.
5432 (Layout::make_output_section): Mark sections that should get
5433 patch space.
5434 * options.cc (parse_percent): New function.
5435 * options.h (parse_percent): New function.
5436 (DEFINE_percent): New macro.
5437 (General_options): Add --incremental-patch option.
5438 * output.cc (Output_section::Output_section): Initialize new data
5439 members.
5440 (Output_section::add_input_section): Print section name when out
5441 of patch space.
5442 (Output_section::add_output_section_data): Likewise.
5443 (Output_section::set_final_data_size): Add patch space when
5444 doing --incremental-full.
5445 (Output_section::do_reset_address_and_file_offset): Remove patch
5446 space.
5447 (Output_segment::set_section_list_addresses): Print debug output
5448 only if --incremental-update.
5449 * output.h (Output_section::set_is_patch_space_allowed): New function.
5450 (Output_section::is_patch_space_allowed_): New data member.
5451 (Output_section::patch_space_): New data member.
5452 * parameters.cc (Parameters::incremental_full): New function.
5453 * parameters.h (Parameters::incremental_full): New function
5454 * testsuite/Makefile.am (incremental_test_2): Add test for
5455 --incremental-patch option.
5456 * testsuite/Makefile.in: Regenerate.
5457 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
5458 (t18): Remove function body.
5459
f6cccc2c
DK
54602011-07-05 Doug Kwan <dougkwan@google.com>
5461
5462 PR gold/12771
5463 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
5464 Arm_Address type for relocation result.
5465 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
5466 overflow check.
5467 (Arm_relocate_functions::abs32): Use unaligned access.
5468 (Arm_relocate_functions::rel32): Ditto.
5469 (Arm_relocate_functions::prel31): Ditto.
5470 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
5471 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
5472 static data relocations.
5473 * testsuite/Makefile.in: Regnerate.
5474 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
5475
28a13fec
ILT
54762011-07-05 Ian Lance Taylor <iant@google.com>
5477
5478 PR gold/12392
5479 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
5480 symbols if necessary.
5481 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5482
24d47b34
ILT
54832011-07-05 Ian Lance Taylor <iant@google.com>
5484
5485 PR gold/12952
5486 * resolve.cc (Symbol::override_base_with_special): Simply override
5487 version with special symbol version, ignoring previous version.
5488
41f9cbbe
ILT
54892011-07-05 Ian Lance Taylor <iant@google.com>
5490
5491 * object.cc (Sized_relobj_file::include_section_group): Add
5492 information to comment about signature location.
5493
886288f1
ILT
54942011-07-02 Ian Lance Taylor <iant@google.com>
5495
5496 PR gold/12957
5497 * options.h (class General_options): Add -f and -F.
5498 * options.cc (General_options::finalize): Fatal error if -f/-F
5499 are used without -shared.
5500 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
5501
ae3a6d4f
ILT
55022011-07-02 Ian Lance Taylor <iant@google.com>
5503
5504 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
5505
21131061
ILT
55062011-07-01 Ian Lance Taylor <iant@google.com>
5507
5508 PR gold/12525
5509 PR gold/12952
5510 * resolve.cc (Symbol::override_base_with_special): Don't override
5511 the version if the overriding symbol has a different name.
5512 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
5513 all callers. If we give an error about an undefined version,
5514 define the base version if necessary.
5515 * dynobj.h (class Versions): Update declaration.
5516 * testsuite/weak_alias_test_5.cc: New file.
5517 * testsuite/weak_alias_test.script: New file.
5518 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
5519 and versioned_alias have the right value, and call t2.
5520 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
5521 weak_alias_test_5.so.
5522 (weak_alias_test_LDADD): Likewise.
5523 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
5524 * testsuite/Makefile.in: Rebuild.
5525
611062c0
ILT
55262011-07-01 Ian Lance Taylor <iant@google.com>
5527
5528 PR gold/12525
5529 * options.h (class General_options): Support -z notext.
5530 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
5531 -Wl,-z,notext.
5532 (two_file_shared_nonpic.so): Likewise.
5533 (two_file_shared_mixed.so): Likewise.
5534 (two_file_shared_mixed_1.so): Likewise.
5535 (weak_undef_lib_nonpic.so): Likewise.
5536 (alt/weak_undef_lib_nonpic.so): Likewise.
5537 (tls_test_shared_nonpic.so): Likewise.
5538 * testsuite/Makefile.in: Rebuild.
5539
328c7c2f
ILT
55402011-07-01 Ian Lance Taylor <iant@google.com>
5541
5542 PR gold/12525
5543 * configure.ac: Test whether static linking works, setting
5544 the automake conditional HAVE_STATIC.
5545 * testsuite/Makefile.am: Disable tests using -static if
5546 HAVE_STATIC is not true.
5547 * configure, testsuite/Makefile.in: Rebuild.
5548
02d7cd44
ILT
55492011-07-01 Ian Lance Taylor <iant@google.com>
5550
5551 PR gold/12525
5552 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
5553 Assert if we see DW_EH_PE_indirect.
5554 * target.h (Target::ehframe_datarel_base): New function.
5555 (Target::do_ehframe_datarel_base): New target function.
5556 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
5557 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
5558 function.
5559
07a60597
ILT
55602011-07-01 Ian Lance Taylor <iant@google.com>
5561
5562 PR gold/12571
5563 * options.h (class General_options): Add
5564 --ld-generated-unwind-info.
5565 * ehframe.cc (Fde::write): Add address parameter. Change all
5566 callers. If associated with PLT, fill in address and size.
5567 (Cie::set_output_offset): Only add merge mapping if there is an
5568 object.
5569 (Cie::write): Add address parameter. Change all callers.
5570 (Eh_frame::add_ehframe_for_plt): New function.
5571 * ehframe.h (class Fde): Update declarations. Move shndx_ and
5572 input_offset_ fields into union u_, with new plt field.
5573 (Fde::Fde): Adjust for new union field.
5574 (Fde::Fde) [Output_data version]: New constructor.
5575 (Fde::add_mapping): Only add merge mapping if there is an object.
5576 (class Cie): Update declarations.
5577 (class Eh_frame): Declare add_ehframe_for_plt.
5578 * layout.cc (Layout::layout_eh_frame): Break out code into
5579 make_eh_frame_section, and call it.
5580 (Layout::make_eh_frame_section): New function.
5581 (Layout::add_eh_frame_for_plt): New function.
5582 * layout.h (class Layout): Update declarations.
5583 * merge.cc (Merge_map::add_mapping): Add assertion.
5584 * i386.cc: Include "dwarf.h".
5585 (class Output_data_plt_i386): Make first_plt_entry,
5586 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
5587 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5588 and plt_eh_frame_fde.
5589 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
5590 boundary. Call add_eh_frame_for_plt if appropriate.
5591 * x86_64.cc: Include "dwarf.h".
5592 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
5593 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
5594 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5595 and plt_eh_frame_fde.
5596 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
5597 appropriate.
5598
14788a3f
ILT
55992011-06-29 Ian Lance Taylor <iant@google.com>
5600
5601 PR gold/12629
5602 * object.cc (Sized_relobj_file::layout_section): Change shdr
5603 parameter to be const.
5604 (Sized_relobj_file::layout_eh_frame_section): New function, broken
5605 out of do_layout.
5606 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
5607 appropriate. Call layout_eh_frame_section.
5608 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
5609 sections.
5610 * object.h (class Sized_relobj_file): Update declarations.
5611
6c21fce1
ILT
56122011-06-29 Ian Lance Taylor <iant@google.com>
5613
37e41b03 5614 PR gold/12652
6c21fce1
ILT
5615 * script.cc (Token::integer_value): Accept trailing M/m/K/k
5616 modifier.
5617 (Lex::gather_token): Accept trailing M/m/K/k for integers.
5618
4d5e4e62
ILT
56192011-06-29 Ian Lance Taylor <iant@google.com>
5620
5621 PR gold/12675
5622 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
5623 SHT_X86_64_UNWIND.
5624 * layout.cc (Layout::layout_eh_frame): Likewise.
5625
886f533a
ILT
56262011-06-29 Ian Lance Taylor <iant@google.com>
5627
5628 PR gold/12695
5629 * layout.cc (Layout::symtab_section_shndx): New function.
5630 * layout.h (class Layout): Declare symtab_section_shndx.
5631 * output.cc (Output_section::write_header): Call it.
5632
f3ae1b28
ILT
56332011-06-29 Ian Lance Taylor <iant@google.com>
5634
5635 PR gold/12818
5636 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
5637 symbols which are not used in a relocation.
5638
aecf301f
ILT
56392011-06-28 Ian Lance Taylor <iant@google.com>
5640
5641 PR gold/12898
5642 * layout.cc (Layout::segment_precedes): Don't crash if a linker
5643 script create indistinguishable segments.
5644 (Layout::set_segment_offsets): Use stable_sort when sorting
5645 segments. Pass this to Compare_segments constructor.
5646 * layout.h (class Layout): Make segment_precedes non-static.
5647 (class Compare_segments): Change from struct to class. Add
5648 layout_ field. Add constructor.
5649 * script-sections.cc
5650 (Script_sections::attach_sections_using_phdrs_clause): Rename
5651 local orphan to is_orphan. Don't report failure to put empty
5652 section in segment. On attachment failure, report name of
5653 section, and attach to first PT_LOAD segment.
5654
03ef7571
ILT
56552011-06-28 Ian Lance Taylor <iant@google.com>
5656
5657 PR gold/12934
5658 * target-select.cc (Target_selector::Target_selector): Add
5659 emulation parameter. Change all callers.
5660 (select_target_by_bfd_name): Rename from select_target_by_name.
5661 Change all callers.
5662 (select_target_by_emulation): New function.
5663 (supported_emulation_names): New function.
5664 * target-select.h (class Target_selector): Add emulation_ field.
5665 Update declarations.
5666 (Target_selector::recognize_by_bfd_name): Rename from
5667 recognize_by_name. Change all callers.
5668 (Target_selector::supported_bfd_names): Rename from
5669 supported_names. Change all callers.
5670 (Target_selector::recognize_by_emulation): New function.
5671 (Target_selector::supported_emulations): New function.
5672 (Target_selector::emulation): New function.
5673 (Target_selector::do_recognize_by_bfd_name): Rename from
5674 do_recognize_by_name. Change all callers.
5675 (Target_selector::do_supported_bfd_names): Rename from
5676 do_supported_names. Change all callers.
5677 (Target_selector::do_recognize_by_emulation): New function.
5678 (Target_selector::do_supported_emulations): New function.
5679 (select_target_by_bfd_name): Change name in declaration.
5680 (select_target_by_emulation): Declare.
5681 (supported_emulation_names): Declare.
5682 * parameters.cc (parameters_force_valid_target): Try to find
5683 target based on emulation from -m option.
5684 * options.h (class General_options): Change doc string for -m.
5685 * options.cc (help): Print emulations.
5686 (General_options::parse_V): Likewise.
5687 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
5688 Add emulation parameter. Change all callers.
5689
200b2bb9
ILT
56902011-06-28 Ian Lance Taylor <iant@google.com>
5691
5692 * target.h (class Target): Add osabi_ field.
5693 (Target::osabi): New function.
5694 (Target::set_osabi): New function.
5695 (Target::Target): Initialize osabi_.
5696 (Target::do_adjust_elf_header): Make pure virtual.
5697 (Sized_target::do_adjust_elf_header): Declare.
5698 * target.cc (Sized_target::do_adjust_elf_header): New function.
5699 (class Sized_target): Instantiate all versions.
5700 * freebsd.h (class Target_freebsd): Remove.
5701 (Target_selector_freebsd::do_recognize): Call set_osabi on
5702 Target.
5703 (Target_selector_freebsd::do_recognize_by_name): Likewise.
5704 (Target_selector_freebsd::set_osabi): Remove.
5705 * i386.cc (class Target_i386): Inherit from Sized_target rather
5706 than Target_freebsd.
5707 * x86_64.cc (class Target_x86_64): Likewise.
5708
b3ce541e
ILT
57092011-06-28 Ian Lance Taylor <iant@google.com>
5710
5711 * target.h (Target::can_check_for_function_pointers): Rewrite.
5712 Make non-virtual.
5713 (Target::can_icf_inline_merge_sections): Likewise.
5714 (Target::section_may_have_icf_unsafe_poineters): Likewise.
5715 (Target::Target_info): Add can_icf_inline_merge_sections field.
5716 (Target::do_can_check_for_function_pointers): New virtual
5717 function.
5718 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
5719 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
5720 from can_check_for_function_pointers, move in file.
5721 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
5722 section_may_have_icf_unsafe_poineters, move in file.
5723 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
5724 * i386.cc (Target_i386::do_can_check_for_function_pointers):
5725 Rename from can_check_for_function_pointers, move in file.
5726 (Target_i386::can_icf_inline_merge_sections): Remove.
5727 (Target_i386::i386_info): Initialize
5728 can_icf_inline_merge_sections.
5729 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
5730 Initialize can_icf_inline_merge_sections.
5731 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
5732 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
5733 Rename from can_check_for_function_pointers, move in file.
5734 (Target_x86_64::can_icf_inline_merge_sections): Remove.
5735 (Target_x86_64::x86_64_info): Initialize
5736 can_icf_inline_merge_sections.
5737 * testsuite/testfile.cc (Target_test::test_target_info):
5738 Likewise.
5739 * icf.cc (get_section_contents): Correct formatting.
5740
6d1c4efb
ILT
57412011-06-27 Ian Lance Taylor <iant@google.com>
5742
5743 * symtab.cc (Symbol::versioned_name): New function.
5744 (Symbol_table::add_to_final_symtab): Use versioned_name when
5745 appropriate.
5746 (Symbol_table::sized_write_symbol): Likewise.
5747 * symtab.h (class Symbol): Declare versioned_name.
5748 * stringpool.h (class Stringpool_template): Add variant of add
5749 which takes a std::basic_string.
5750 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
5751 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
5752 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
5753 (ver_test_12.o): New target.
5754 * testsuite/Makefile.in: Rebuild.
5755
57eb9b50
DK
57562011-06-27 Doug Kwan <dougkwan@google.com>
5757
5758 * arm.cc (Arm_relocate_functions::thm_jump8,
5759 Arm_relocate_functions::thm_jump11): Use a wider signed
5760 type to compute offset.
5761 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
5762 arm_thm_jump8.
5763 * testsuite/Makefile.in: Regenerate.
5764 * testsuite/arm_branch_in_range.sh: Check test results of
5765 arm_thm_jump11 and arm_thm_jump8.
5766 * testsuite/arm_thm_jump11.s: New test source file.
5767 * testsuite/arm_thm_jump11.t: New linker script.
5768 * testsuite/arm_thm_jump8.s: New test source file.
5769 * testsuite/arm_thm_jump8.t: New linker script.
5770
487b39df
ILT
57712011-06-24 Ian Lance Taylor <iant@google.com>
5772
5773 * layout.cc: Include "object.h".
5774 (ctors_sections_in_init_array): New static variable.
5775 (Layout::is_ctors_in_init_array): New function.
5776 (Layout::layout): Add entry to ctors_sections_in_init_array if
5777 appropriate.
5778 * layout.h (class Layout): Declare is_ctors_in_init_array.
5779 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
5780 is_ctors_reverse_view is set.
5781 (Sized_relobj_file::write_sections): Add layout parameter. Change
5782 all callers. Set is_ctors_reverse_view field of View_size.
5783 (Sized_relobj_file::reverse_words): New function.
5784 * object.h (Sized_relobj_file::View_size): Add
5785 is_ctors_reverse_view field.
5786 (class Sized_relobj_file): Update declarations.
5787 * testsuite/initpri3.c: New test.
5788 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
5789 initpri3b.
5790 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
5791 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
5792 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
5793 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
5794 * testsuite/Makefile.in: Rebuild.
5795
472076e4
CC
57962011-06-24 Cary Coutant <ccoutant@google.com>
5797
5798 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
5799 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
5800 (debug_msg_cdebug.err): New targets.
5801 * testsuite/Makefile.in: Regenerate.
5802 * testsuite/debug_msg.sh: Check output of link with compressed debug.
5803 Fix checks for link with shared library.
5804
a60af0db
DK
58052011-06-24 Doug Kwan <dougkwan@google.com>
5806
5807 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
5808 skip empty text sections.
5809 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
5810
5393d741
ILT
58112011-06-22 Ian Lance Taylor <iant@google.com>
5812
5813 PR gold/12910
5814 * options.h (class General_options): Add --ctors-in-init-array.
5815 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
5816 friends as SHT_PROGBITS for merging sections.
5817 (Layout::layout): Remove special handling of .init_array and
5818 friends. Don't sort if doing relocatable link. Sort for .ctors
5819 and .dtors if ctors_in_init_array.
5820 (Layout::make_output_section): Force correct section types for
5821 .init_array and friends. Don't sort if doing relocatable link,
5822 Don't sort .ctors and .dtors if ctors_in_init_array.
5823 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
5824 (Layout::output_section_name): Add relobj parameter. Change all
5825 callers. Handle .ctors. and .dtors. in code rather than table.
5826 Handle .ctors and .dtors if ctors_in_init_array.
5827 (Layout::match_file_name): New function, moved from output.cc.
5828 * layout.h (class Layout): Update declarations.
5829 * output.cc: Include "layout.h".
5830 (Input_section_sort_entry::get_priority): New function.
5831 (Input_section_sort_entry::match_file_name): Just call
5832 Layout::match_file_name.
5833 (Output_section::Input_section_sort_init_fini_compare::operator()):
5834 Handle .ctors and .dtors. Sort by explicit priority rather than
5835 by name.
5836 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
5837 * testsuite/initpri2.c: New test.
5838 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
5839 (check_PROGRAMS): Add initpri2.
5840 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
5841 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
5842 * configure, testsuite/Makefile.in: Rebuild.
5843
e1f74f98
ILT
58442011-06-19 Ian Lance Taylor <iant@google.com>
5845
5846 PR gold/12880
5847 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
5848 .interp section to a PT_INTERP segment even if we have seen a
5849 --dynamic-linker option. Don't do it if we have seen a PHDRS
5850 clause in a linker script.
5851 (Layout::finalize): Don't create a .interp section if we've
5852 already create a PT_INTERP segment.
5853 (Layout::create_interp): Always call choose_output_section (revert
5854 patch of 2011-06-17). Don't create PT_INTERP segment.
5855 * script-sections.cc
5856 (Script_sections::create_note_and_tls_segments): Add a .interp
5857 section to a PT_INTERP segment even if we have seen a
5858 --dynamic-linker option.
5859
766f91bb
ILT
58602011-06-18 Ian Lance Taylor <iant@google.com>
5861
5862 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
5863 merely because a non-PT_LOAD segment has a dynamic reloc.
5864
0d212c3a
ILT
58652011-06-18 Ian Lance Taylor <iant@google.com>
5866
5867 * layout.cc (Layout::finish_dynamic_section): Don't create
5868 DT_FLAGS entry if not needed.
5869
911a5072
ILT
58702011-06-18 Ian Lance Taylor <iant@google.com>
5871
5872 PR gold/12745
5873 * layout.cc (Layout::layout_eh_frame): Correct handling of
5874 writable .eh_frame section.
5875
534b4e5f
ILT
58762011-06-17 Ian Lance Taylor <iant@google.com>
5877
5878 PR gold/12893
5879 * resolve.cc (Symbol_table::resolve): Don't give an error if a
5880 symbol is redefined with the exact same object and value.
5881
10b4f102
ILT
58822011-06-17 Ian Lance Taylor <iant@google.com>
5883
5884 PR gold/12880
5885 * layout.h (class Layout): Add interp_segment_ field.
5886 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
5887 (Layout::attach_allocated_section_to_segment): If making shared
5888 library, put .interp section in PT_INTERP segment.
5889 (Layout::finalize): Also call create_interp if -dynamic-linker
5890 option was used.
5891 (Layout::create_interp): Assert that there is no PT_INTERP
5892 segment. If not using a SECTIONS clause, use make_output_section.
5893 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
5894 * script-sections.cc
5895 (Script_sections::create_note_and_tls_segments): If making shared
5896 library, put .interp section in PT_INTERP segment.
5897
a29b0dad
ILT
58982011-06-17 Ian Lance Taylor <iant@google.com>
5899
e588ea8d
ILT
5900 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
5901 when making a shared library.
5902
59032011-06-17 Ian Lance Taylor <iant@google.com>
5904
5905 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
5906 parameter. Change all callers. Don't issue warning about PC32
5907 against locally defined symbol.
a29b0dad 5908
9d3b0698
ILT
59092011-06-16 Ian Lance Taylor <iant@google.com>
5910
5911 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
5912 occurs in same object.
5913
85b0f90c
AM
59142011-06-14 Alan Modra <amodra@gmail.com>
5915
5916 * po/POTFILES.in: Regenerate.
5917
a94907d9
ILT
59182011-06-09 Ian Lance Taylor <iant@google.com>
5919
5920 * script-sections.cc
5921 (Orphan_output_section::set_section_addresses): For a relocatable
5922 link set address to 0.
5923
4fb3a1c3
CC
59242011-06-09 Cary Coutant <ccoutant@google.com>
5925
5926 PR gold/12804
5927 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
5928 used with --compress-debug-sections.
5929 * gold/object.cc (Sized_relobj_file::do_layout): Report
5930 uncompressed size of compressed input sections.
5931
61220854
CC
59322011-06-08 Cary Coutant <ccoutant@google.com>
5933
5934 PR gold/12804
5935 * testsuite/two_file_test_2_v1.cc: Change initialization of
5936 v2 to keep it in .data.
5937
e6455dfb
CC
59382011-06-07 Cary Coutant <ccoutant@google.com>
5939
5940 * common.cc (Symbol_table::do_allocate_commons_list): Call
5941 gold_fallback.
5942 * errors.cc (Errors::fatal): Adjust call to gold_exit.
5943 (Errors::fallback): New function.
5944 (gold_fallback): New function.
5945 * errors.h (Errors::fallback): New function.
5946 * gold.cc (gold_exit): Change status parameter to enum; adjust
5947 all callers.
5948 (queue_initial_tasks): Call gold_fallback.
5949 * gold.h: Include cstdlib.
5950 (Exit_status): New enum type.
5951 (gold_exit): Change status parameter to enum.
5952 (gold_fallback): New function.
5953 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
5954 (Layout::create_symtab_sections): Likewise.
5955 (Layout::create_shdrs): Likewise.
5956 * main.cc (main): Adjust call to gold_exit.
5957 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
5958 (Output_data_got::add_got_entry_pair): Likewise.
5959 (Output_section::add_input_section): Likewise.
5960 (Output_section::add_output_section_data): Likewise.
5961 (Output_segment::set_section_list_addresses): Likewise.
5962 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
5963
fb0e076f
CC
59642011-06-07 Cary Coutant <ccoutant@google.com>
5965
5966 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
5967 for incremental links.
5968 * output.cc (Output_segment::set_section_list_addresses): Remove
5969 FIXME and test for TLS or BSS.
5970
a5ee4d5d
CC
59712011-06-07 Cary Coutant <ccoutant@google.com>
5972
5973 * testsuite/Makefile.am: Add incremental_copy_test,
5974 incremental_common_test_1.
5975 * testsuite/Makefile.in: Regenerate.
5976 * testsuite/common_test_1_v1.c: New source file.
5977 * testsuite/common_test_1_v2.c: New source file.
5978 * testsuite/copy_test_v1.cc: New source file.
5979
5146f448
CC
59802011-06-07 Cary Coutant <ccoutant@google.com>
5981
5982 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
5983 update, allocate common from bss section's free list.
5984 * incremental-dump.cc (dump_incremental_inputs): Print flag for
5985 linker-defined symbols.
5986 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
5987 Skip GOT and PLT entries that are no longer referenced.
5988 (Output_section_incremental_inputs::write_info_blocks): Mark
5989 linker-defined symbols.
5990 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
5991 * output.cc (Output_section::allocate): New function.
5992 * output.h (Output_section::allocate): New function.
5993 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
5994 linker-defined symbols.
5995 (Symbol::override_base_with_special): Copy is_predefined_ flag.
5996 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
5997 (Symbol::init_base_output_data): Likewise.
5998 (Symbol::init_base_output_segment): Likewise.
5999 (Symbol::init_base_constant): Likewise.
6000 (Sized_symbol::init_output_data): Likewise.
6001 (Sized_symbol::init_output_segment): Likewise.
6002 (Sized_symbol::init_constant): Likewise.
6003 (Symbol_table::do_define_in_output_data): Likewise.
6004 (Symbol_table::do_define_in_output_segment): Likewise.
6005 (Symbol_table::do_define_as_constant): Likewise.
6006 * symtab.h (Symbol::is_predefined): New function.
6007 (Symbol::init_base_output_data): Add is_predefined parameter.
6008 (Symbol::init_base_output_segment): Likewise.
6009 (Symbol::init_base_constant): Likewise.
6010 (Symbol::is_predefined_): New data member.
6011 (Sized_symbol::init_output_data): Add is_predefined parameter.
6012 (Sized_symbol::init_output_segment): Likewise.
6013 (Sized_symbol::init_constant): Likewise.
6014 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
6015
26d3c67d
CC
60162011-06-07 Cary Coutant <ccoutant@google.com>
6017
6018 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
6019 instead of emit_copy_reloc.
6020 (Copy_relocs::emit_copy_reloc): Refactor.
6021 (Copy_relocs::make_copy_reloc): New function.
6022 (Copy_relocs::add_copy_reloc): Remove.
6023 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
6024 section.
6025 (Copy_relocs::make_copy_reloc): New function.
6026 (Copy_relocs::add_copy_reloc): Remove.
6027 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
6028 unchanged input files.
6029 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
6030 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
6031 Reserve BSS space for COPY relocations.
6032 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6033 (Output_section_incremental_inputs::write_info_blocks): Record
6034 whether a symbol is copied from a shared object.
6035 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
6036 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
6037 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
6038 (Incremental_input_entry_reader::get_output_symbol_index): Add
6039 is_copy parameter.
6040 (Incremental_binary::emit_copy_relocs): New function.
6041 (Incremental_binary::do_emit_copy_relocs): New function.
6042 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6043 new data member.
6044 (Sized_incremental_binary::add_copy_reloc): New function.
6045 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6046 (Sized_incremental_binary::Copy_reloc): New struct.
6047 (Sized_incremental_binary::Copy_relocs): New typedef.
6048 (Sized_incremental_binary::copy_relocs_): New data member.
6049 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
6050 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
6051 * target.h (Sized_target::emit_copy_reloc): New function.
6052 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
6053
7cdb37d9
CC
60542011-06-02 Cary Coutant <ccoutant@google.com>
6055
6056 PR gold/12163
6057 * gold/archive.cc (Archive::Archive): Initialize new data member.
6058 (Archive::include_all_members): Return if archive has already been
6059 included.
6060 * gold/archive.h (Archive::include_all_members_): New data member.
6061
cc643b88
NC
60622011-06-02 Nick Clifton <nickc@redhat.com>
6063
6064 * dynobj.h: Fix spelling mistake in comment.
6065 * output.cc: Likewise.
6066
f62a3ca7 60672011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 6068 Asier Llano
f62a3ca7
DK
6069
6070 PR gold/12826
cc643b88 6071 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
6072 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
6073 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
6074 redundant arm_exidx_test.so.
6075 * testsuite/Makefile.in: Regenerate.
6076 (check_SCRIPTS): Add pr12826.sh
6077 (check_DATA): Add pr12826.stdout
6078 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
6079 * testsuite/pr12826.sh: New file.
6080 * testsuite/pr12826_1.s: Ditto.
6081 * testsuite/pr12826_1.s: Ditto.
6082
8dbe1edc
ILT
60832011-05-30 Ian Lance Taylor <iant@google.com>
6084
6085 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
6086 sections.
6087
c49875be
ILT
60882011-05-29 Ian Lance Taylor <iant@google.com>
6089
6090 PR gold/12804
6091 * testsuite/Makefile.am: Use different file name for two_file_test
6092 temporary file for each incremental test.
6093 * testsuite/Makefile.in: Rebuild.
6094
69d53f7a
ILT
60952011-05-29 Ian Lance Taylor <iant@google.com>
6096
6097 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
6098 binary input file is empty.
6099
41d0ab5f
ILT
61002011-05-27 Ian Lance Taylor <iant@google.com>
6101
6102 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
6103 (ver_test_9.so): Likewise.
6104 * testsuite/Makefile.in: Rebuild.
6105
89d8a36b
CC
61062011-05-26 Cary Coutant <ccoutant@google.com>
6107
6108 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
6109 * incremental.cc (Incremental_inputs::report_input_section): Fix
6110 comment, indentation.
6111 (Incremental_inputs::report_comdat_group): New function.
6112 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6113 of data for incremental input file entry.
6114 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
6115 group count, COMDAT group signatures.
6116 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
6117 an unchanged input file.
6118 * incremental.h (Incremental_object_entry::Incremental_object_entry):
6119 Initialize new data member.
6120 (Incremental_object_entry::add_comdat_group): New function.
6121 (Incremental_object_entry::get_comdat_group_count): New function.
6122 (Incremental_object_entry::get_comdat_signature_key): New function.
6123 (Incremental_object_entry::groups_): New data member.
6124 (Incremental_inputs::report_comdat_group): New function.
6125 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
6126 data for incremental input file entry.
6127 (Incremental_input_entry_reader::get_comdat_group_count): New function.
6128 (Incremental_input_entry_reader::get_input_section): Adjust size of
6129 data for incremental input file entry.
6130 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
6131 (Incremental_input_entry_reader::get_comdat_group_signature): New
6132 function.
6133 * object.cc (Sized_relobj::include_section_group): Report kept
6134 COMDAT groups for incremental links.
6135
1706a06f
ILT
61362011-05-24 David Meyer <pdox@google.com>
6137
6138 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
6139 with name parameter. Add found_name parameter.
6140 * fileread.cc (Input_file::find_file): Adjust code accordingly.
6141 * dirsearch.h (class Dirsearch): Update declaration.
6142
a10ae760
ILT
61432011-05-24 Ian Lance Taylor <iant@google.com>
6144
6145 * archive.cc (Library_base::should_include_member): Pull in object
6146 from archive if it defines the entry symbol.
6147 * parameters.cc (Parameters::entry): New function.
6148 * parameters.h (class Parameters): Declare entry.
6149 * output.h (class Output_file_header): Remove entry_ field.
6150 * output.cc (Output_file_header::Output_file_header): Remove entry
6151 parameter. Change all callers.
6152 (Output_file_header::entry): Use parameters->entry.
6153 * gold.cc (queue_middle_tasks): Likewise.
6154 * plugin.cc (Plugin_hook::run): Likewise.
6155
aa92d6ed
CC
61562011-05-24 Cary Coutant <ccoutant@google.com>
6157
6158 * gold.cc (queue_initial_tasks): Pass incremental base filename
6159 to Output_file::open_base_file; don't print error message.
6160 * incremental-dump.cc (main): Adjust call to
6161 Output_file::open_for_modification.
6162 * incremental-dump.cc (main): Likewise.
6163 * incremental.cc (Incremental_inputs::report_command_line):
6164 Ignore --incremental-base option when comparing command lines.
6165 Ignore parameter when given as separate argument.
6166 * options.h (class General_options): Add --incremental-base.
6167 * output.cc (Output_file::Output_file):
6168 (Output_file::open_base_file): Add base_name and writable parameters;
6169 read base file into new file; print error message here.
6170 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6171 callers.
6172 * output.h (Output_file::open_for_modification): Rename to...
6173 (Output_file::open_base_file): ...this; add base_name and
6174 writable parameters; adjust all callers.
6175 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6176 callers.
6177 * testsuite/Makefile.am (incremental_test_4): Test
6178 --incremental-base.
6179 * testsuite/Makefile.in: Regenerate.
6180
2eedd706
CC
61812011-05-24 Cary Coutant <ccoutant@google.com>
6182
6183 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
6184 incremental_test_4.
6185 * testsuite/Makefile.in: Regenerate.
6186 * testsuite/two_file_test_1_v1.cc: New test source file.
6187 * testsuite/two_file_test_1b_v1.cc: New test source file.
6188 * testsuite/two_file_test_2_v1.cc: New test source file.
6189
0f1c85a6
CC
61902011-05-24 Cary Coutant <ccoutant@google.com>
6191
6192 * dynobj.h (Dynobj::do_dynobj): New function.
6193 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
6194 flag and soname for shared objects.
6195 * incremental.cc (Incremental_inputs::report_object): Make
6196 either Incremental_object_entry or Incremental_dynobj_entry; add
6197 soname to string table.
6198 (Incremental_inputs::report_input_section): Add assertion.
6199 (Output_section_incremental_inputs::set_final_data_size): Adjust
6200 type of input file entry for shared libraries; adjust size of
6201 shared library info entry.
6202 (Output_section_incremental_inputs::write_input_files): Write
6203 as_needed flag for shared libraries.
6204 (Output_section_incremental_inputs::write_info_blocks): Adjust type
6205 of input file entry for shared libraries; write soname.
6206 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
6207 soname from incremental info.
6208 * incremental.h (enum Incremental_input_flags): Add
6209 INCREMENTAL_INPUT_AS_NEEDED.
6210 (Incremental_input_entry::Incremental_input_entry): Initialize new
6211 data member.
6212 (Incremental_input_entry::set_as_needed): New function.
6213 (Incremental_input_entry::as_needed): New function.
6214 (Incremental_input_entry::do_dynobj_entry): New function.
6215 (Incremental_input_entry::as_needed_): New data member.
6216 (Incremental_object_entry::Incremental_object_entry): Don't check
6217 for shared library.
6218 (Incremental_object_entry::do_type): Likewise.
6219 (class Incremental_dynobj_entry): New class.
6220 (Incremental_input_entry_reader::as_needed): New function.
6221 (Incremental_input_entry_reader::get_soname): New function.
6222 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
6223 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
6224 size of shared library info entry.
58797674 6225 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
6226 incremental link when adding DT_NEEDED entries.
6227 * object.h (Object::Object): Initialize new data member.
6228 (Object::dynobj): New function.
6229 (Object::set_as_needed): New function.
6230 (Object::as_needed): New function.
6231 (Object::do_dynobj): New function.
6232 (Object::as_needed_): New data member.
6233
6fa2a40b
CC
62342011-05-24 Cary Coutant <ccoutant@google.com>
6235
6236 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
6237 info; adjust display of GOT entries.
6238 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6239 vector of input objects; remove file_status_.
6240 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
6241 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
6242 got_plt reader; call target hooks to reserve GOT entries.
6243 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6244 of input file info header and GOT info entry.
6245 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
6246 relocation info.
6247 (Got_plt_view_info::got_descriptor): Remove.
6248 (Got_plt_view_info::sym_index): New data member.
6249 (Got_plt_view_info::input_index): New data member.
6250 (Local_got_offset_visitor::visit): Write input file index.
6251 (Global_got_offset_visitor::visit): Write 0 for input file index.
6252 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
6253 with sym_index and input_index.
6254 (Output_section_incremental_inputs::write_got_plt): Adjust size of
6255 incremental info GOT entry; replace got_descriptor with input_index.
6256 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
6257 map from input file index to object.
6258 (Sized_relobj_incr::do_layout): Replace direct data member reference
6259 with accessor function.
6260 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
6261 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
6262 Adjust size of input file info header.
6263 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
6264 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
6265 (Incremental_input_entry_reader::get_input_section): Adjust size of
6266 input file info header.
6267 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
6268 of incremental info GOT entry.
6269 (Incremental_got_plt_reader::get_got_desc): Remove.
6270 (Incremental_got_plt_reader::get_got_symndx): New function.
6271 (Incremental_got_plt_reader::get_got_input_index): New function.
6272 (Sized_incremental_binary::Sized_incremental_binary): Remove
6273 file_status_; add input_objects_.
6274 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
6275 (Sized_incremental_binary::set_file_is_unchanged): Remove.
6276 (Sized_incremental_binary::file_is_unchanged): Remove.
6277 (Sized_incremental_binary::set_input_object): New function.
6278 (Sized_incremental_binary::input_object): New function.
6279 (Sized_incremental_binary::file_status_): Remove.
6280 (Sized_incremental_binary::input_objects_): New data member.
6281 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
6282 references.
6283 (Sized_relobj_incr::invalid_address): Move to base class.
6284 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
6285 class.
6286 (Sized_relobj_incr::do_output_section_offset): Likewise.
6287 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
6288 (Sized_relobj_incr::section_offsets_): Likewise.
6289 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
6290 function.
6291 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
6292 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
6293 with accessor function.
6294 (Sized_relobj_file::do_layout): Likewise.
6295 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
6296 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
6297 (Sized_relobj_file::compute_final_local_value): Replace refs to
6298 section_offsets_ with accessor function.
6299 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
6300 * object.h (Relobj::Relobj): Initialize new data members.
6301 (Relobj::add_dyn_reloc): New function.
6302 (Relobj::first_dyn_reloc): New function.
6303 (Relobj::dyn_reloc_count): New function.
6304 (Relobj::first_dyn_reloc_): New data member.
6305 (Relobj::dyn_reloc_count_): New data member.
6306 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
6307 references.
6308 (Sized_relobj::Address): New typedef.
6309 (Sized_relobj::invalid_address): Move here from child class.
6310 (Sized_relobj::Sized_relobj): Initialize new data members.
6311 (Sized_relobj::sized_relobj): New function.
6312 (Sized_relobj::is_output_section_offset_invalid): Move here from
6313 child class.
6314 (Sized_relobj::get_output_section_offset): Likewise.
6315 (Sized_relobj::local_has_got_offset): Likewise.
6316 (Sized_relobj::local_got_offset): Likewise.
6317 (Sized_relobj::set_local_got_offset): Likewise.
6318 (Sized_relobj::do_for_all_local_got_entries): Likewise.
6319 (Sized_relobj::clear_got_offsets): New function.
6320 (Sized_relobj::section_offsets): Move here from child class.
6321 (Sized_relobj::do_output_section_offset): Likewise.
6322 (Sized_relobj::do_set_section_offset): Likewise.
6323 (Sized_relobj::Local_got_offsets): Likewise.
6324 (Sized_relobj::local_got_offsets_): Likewise.
6325 (Sized_relobj::section_offsets_): Likewise.
6326 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
6327 references.
6328 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
6329 class.
6330 (Sized_relobj_file::sized_relobj): New function
6331 (Sized_relobj_file::local_has_got_offset): Move to base class.
6332 (Sized_relobj_file::local_got_offset): Likewise.
6333 (Sized_relobj_file::set_local_got_offset): Likewise.
6334 (Sized_relobj_file::get_output_section_offset): Likewise.
6335 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
6336 (Sized_relobj_file::do_output_section_offset): Likewise.
6337 (Sized_relobj_file::do_set_section_offset): Likewise.
6338 (Sized_relobj_file::Local_got_offsets): Likewise.
6339 (Sized_relobj_file::local_got_offsets_): Likewise.
6340 (Sized_relobj_file::section_offsets_): Likewise.
6341 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
6342 (all constructors).
6343 (set_needs_dynsym_index): Convert relobj to derived class pointer.
6344 (Output_reloc::get_symbol_index): Likewise.
6345 (Output_reloc::local_section_offset): Likewise.
6346 (Output_reloc::get_address): Likewise.
6347 (Output_reloc::symbol_value): Likewise.
6348 (Output_data_got::reserve_slot): Move to class definition.
6349 (Output_data_got::reserve_local): New function.
6350 (Output_data_got::reserve_slot_for_global): Remove.
6351 (Output_data_got::reserve_global): New function.
6352 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
6353 (all constructors, two instantiations).
6354 (Output_reloc::get_relobj): New function (two instantiations).
6355 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
6356 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
6357 (Output_data_reloc::add_global): Adjust type of relobj.
6358 (Output_data_reloc::add_global_relative): Likewise.
6359 (Output_data_reloc::add_symbolless_global_addend): Likewise.
6360 (Output_data_reloc::add_local): Likewise.
6361 (Output_data_reloc::add_local_relative): Likewise.
6362 (Output_data_reloc::add_symbolless_local_addend): Likewise.
6363 (Output_data_reloc::add_local_section): Likewise.
6364 (Output_data_reloc::add_output_section): Likewise.
6365 (Output_data_reloc::add_absolute): Likewise.
6366 (Output_data_reloc::add_target_specific): Likewise.
6367 (Output_data_got::reserve_slot): Move definition here.
6368 (Output_data_got::reserve_local): New function.
6369 (Output_data_got::reserve_global): New function.
6370 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
6371 section_offsets_ with accessor function.
6372 (Sized_relobj_file::write_sections): Likewise.
6373 (Sized_relobj_file::do_relocate_sections): Likewise.
6374 * target.h (Sized_target::reserve_local_got_entry): New function.
6375 (Sized_target::reserve_global_got_entry): New function.
6376 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
6377 (Target_x86_64::reserve_global_got_entry): New function.
6378 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
6379
4829d394
CC
63802011-05-23 Cary Coutant <ccoutant@google.com>
6381
6382 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
6383 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
6384 bit when checking got_type.
6385 * incremental.cc (Sized_incremental_binary::setup_readers):
6386 Store symbol table and string table locations; initialize bit vector
6387 of file status flags.
6388 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
6389 unchanged files.
6390 (Sized_incremental_binary::do_process_got_plt): New function.
6391 (Sized_incremental_binary::get_symtab_view): Use stored locations.
6392 (Output_section_incremental_inputs::set_final_data_size): Record
6393 file index for each input file.
6394 (Output_section_incremental_inputs::write_got_plt): Store file index
6395 instead of input entry offset for each GOT entry.
6396 * incremental.h
6397 (Incremental_input_entry::Incremental_input_entry): Initialize new
6398 data member.
6399 (Incremental_input_entry::set_offset): Store file index.
6400 (Incremental_input_entry::get_file_index): New function.
6401 (Incremental_input_entry::file_index_): New data member.
6402 (Incremental_binary::process_got_plt): New function.
6403 (Incremental_binary::do_process_got_plt): New function.
6404 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6405 data members.
6406 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
6407 (Sized_incremental_binary::set_file_is_unchanged): New function.
6408 (Sized_incremental_binary::file_is_unchanged): New function.
6409 (Sized_incremental_binary::do_process_got_plt): New function.
6410 (Sized_incremental_binary::file_status_): New data member.
6411 (Sized_incremental_binary::main_symtab_loc_): New data member.
6412 (Sized_incremental_binary::main_strtab_loc_): New data member.
6413 * output.cc (Output_data_got::Got_entry::write): Add case
6414 RESERVED_CODE.
6415 (Output_data_got::add_global): Call add_got_entry.
6416 (Output_data_got::add_global_plt): Likewise.
6417 (Output_data_got::add_global_with_rel): Likewise.
6418 (Output_data_got::add_global_with_rela): Likewise.
6419 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
6420 (Output_data_got::add_global_pair_with_rela): Likewise.
6421 (Output_data_got::add_local): Call add_got_entry.
6422 (Output_data_got::add_local_plt): Likewise.
6423 (Output_data_got::add_local_with_rel): Likewise.
6424 (Output_data_got::add_local_with_rela): Likewise.
6425 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
6426 (Output_data_got::add_local_pair_with_rela): Likewise.
6427 (Output_data_got::reserve_slot): New function.
6428 (Output_data_got::reserve_slot_for_global): New function.
6429 (Output_data_got::add_got_entry): New function.
6430 (Output_data_got::add_got_entry_pair): New function.
6431 (Output_section::add_output_section_data): Edit FIXME.
6432 * output.h
6433 (Output_section_data_build::Output_section_data_build): New
6434 constructor with size parameter.
6435 (Output_data_space::Output_data_space): Likewise.
6436 (Output_data_got::Output_data_got): Initialize new data member; new
6437 constructor with size parameter.
6438 (Output_data_got::add_constant): Call add_got_entry.
6439 (Output_data_got::reserve_slot): New function.
6440 (Output_data_got::reserve_slot_for_global): New function.
6441 (class Output_data_got::Got_entry): Add RESERVED_CODE.
6442 (Output_data_got::add_got_entry): New function.
6443 (Output_data_got::add_got_entry_pair): New function.
6444 (Output_data_got::free_list_): New data member.
6445 * target.h (Sized_target::init_got_plt_for_update): New function.
6446 (Sized_target::register_global_plt_entry): New function.
6447 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
6448 Initialize new data member; call init; add constructor with PLT count.
6449 (Output_data_plt_x86_64::init): New function.
6450 (Output_data_plt_x86_64::add_relocation): New function.
6451 (Output_data_plt_x86_64::reserve_slot): New function.
6452 (Output_data_plt_x86_64::free_list_): New data member.
6453 (Target_x86_64::init_got_plt_for_update): New function.
6454 (Target_x86_64::register_global_plt_entry): New function.
6455 (Output_data_plt_x86_64::add_entry): Allocate from free list for
6456 incremental updates.
6457 (Output_data_plt_x86_64::add_relocation): New function.
6458 * testsuite/object_unittest.cc (Object_test): Set default options.
6459
ec69d6da
ILT
64602011-05-16 Ian Lance Taylor <iant@google.com>
6461
6462 * options.h (class General_options): Make -i a synonym for -r.
6463
732e31de
ILT
64642011-05-16 Ian Lance Taylor <iant@google.com>
6465
6466 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
6467
403676b5
CC
64682011-05-10 Cary Coutant <ccoutant@google.com>
6469
6470 * object.cc (Sized_relobj::do_count_local_symbols): Check for
6471 strip_all (-s).
6472
5b7b7d6e
ILT
64732011-05-06 Ian Lance Taylor <iant@google.com>
6474
6475 * layout.cc (Layout::layout): If the output section flags change,
6476 update the ordering.
6477
f0f9babf
CC
64782011-04-25 Cary Coutant <ccoutant@google.com>
6479
6480 * incremental-dump.cc (dump_incremental_inputs): Print local
6481 symbol info for each input file.
6482 * incremental.cc
6483 (Output_section_incremental_inputs::set_final_data_size): Add local
6484 symbol info to input file entries in incremental info.
6485 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6486 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
6487 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
6488 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
6489 implementation.
6490 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
6491 (Sized_incr_relobj::do_relocate): Write the local symbols.
6492 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
6493 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
6494 Adjust size of input file header.
6495 (Incremental_inputs_reader::get_local_symbol_offset): New function.
6496 (Incremental_inputs_reader::get_local_symbol_count): New function.
6497 (Incremental_inputs_reader::get_input_section): Adjust size of input
6498 file header.
6499 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
6500 (Sized_incr_relobj::This): New typedef.
6501 (Sized_incr_relobj::sym_size): New const data member.
6502 (Sized_incr_relobj::Local_symbol): New struct.
6503 (Sized_incr_relobj::do_output_local_symbol_count): New function.
6504 (Sized_incr_relobj::do_local_symbol_offset): New function.
6505 (Sized_incr_relobj::local_symbol_count_): New data member.
6506 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
6507 (Sized_incr_relobj::local_symbol_index_): New data member.
6508 (Sized_incr_relobj::local_symbol_offset_): New data member.
6509 (Sized_incr_relobj::local_dynsym_offset_): New data member.
6510 (Sized_incr_relobj::local_symbols_): New data member.
6511 * object.h (Relobj::output_local_symbol_count): New function.
6512 (Relobj::local_symbol_offset): New function.
6513 (Relobj::do_output_local_symbol_count): New function.
6514 (Relobj::do_local_symbol_offset): New function.
6515 (Sized_relobj::do_output_local_symbol_count): New function.
6516 (Sized_relobj::do_local_symbol_offset): New function.
6517
d0a9ace3
ILT
65182011-04-22 Vladimir Simonov <sv@sw.ru>
6519
6520 * descriptors.cc (set_close_on_exec): New function.
6521 (Descriptors::open): Use set_close_on_exec.
6522 * output.cc (S_ISLNK): Define if not defined.
6523
94a3fc8b
CC
65242011-04-22 Cary Coutant <ccoutant@google.com>
6525
6526 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6527 global symbol map.
6528 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6529 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
6530 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
6531 relocations.
6532 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
6533 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
6534 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
6535 * incremental.h
6536 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
6537 function.
6538 (Incremental_binary::apply_incremental_relocs): New function.
6539 (Incremental_binary::do_apply_incremental_relocs): New function.
6540 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6541 data member.
6542 (Sized_incremental_binary::add_global_symbol): New function.
6543 (Sized_incremental_binary::global_symbol): New function.
6544 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6545 (Sized_incremental_binary::symbol_map_): New data member.
6546 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
6547 * target.h (Sized_target::apply_relocation): New function.
6548 * target-reloc.h (apply_relocation): New function.
6549 * x86_64.cc (Target_x86_64::apply_relocation): New function.
6550
c87e4302
DK
65512011-04-22 Doug Kwan <dougkwan@google.com>
6552
6553 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
6554 flag of a SHT_ARM_EXIDX section.
2e702c99 6555 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
6556 * testsuite/Makefile.in: Regenerate.
6557 * testsuite/arm_exidx_test.s: New file.
6558 * testsuite/arm_exidx_test.sh: Same.
6559
e7782cf6
CC
65602011-04-20 Cary Coutant <ccoutant@google.com>
6561
6562 PR gold/12689
6563 * archive.h (Incremental_archive_entry::Archive_member):
6564 Initialize arg_serial_ (second constructor).
6565
308ecdc7
ILT
65662011-04-17 Ian Lance Taylor <iant@google.com>
6567
6568 * object.cc (Relocate_info::location): Simplify location string.
6569 * errors.cc (Errors::error_at_location): Don't print program
6570 name.
6571 (Errors::warning_at_location): Likewise.
6572 (Errors::undefined_symbol): Likewise.
6573 * testsuite/debug_msg.sh: Update accordingly.
6574
bec5b579
CC
65752011-04-14 Cary Coutant <ccoutant@google.com>
6576
6577 * gold/layout.cc (Layout::symtab_section_offset): New function.
6578 * gold/layout.h (Layout::symtab_section_offset): New function.
6579 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
6580
88597d34
ILT
65812011-04-12 Ian Lance Taylor <iant@google.com>
6582
6583 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
6584 with MREMAP_MAYMOVE.
6585 * output.h (class Output_file): Add map_is_allocated_ field.
6586 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
6587 not available, provide stubs. If mremap is not available, #define
6588 it to gold_mremap.
6589 (MREMAP_MAYMOVE): Define if not defined.
6590 (Output_file::Output_file): Initialize map_is_allocated_.
6591 (Output_file::resize): Check map_is_allocated_.
6592 (Output_file::map_anonymous): If mmap fails, use malloc.
6593 (Output_file::unmap): Don't do anything for an anonymous map.
6594 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
6595 is not available, provide stubs.
6596 (File_read::View::~View): Use free rather than delete[].
6597 (File_read::make_view): Use malloc rather than new[]. If mmap
6598 fails, use malloc.
6599 (File_read::find_or_make_view): Use malloc rather than new[].
6600 * gold.h: Remove HAVE_REMAP code.
6601 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
6602 exists. Rename mremap to gold_mremap. If mmap is not available
6603 don't do anything.
6604 * configure, config.in: Rebuild.
6605
11e361bc
ILT
66062011-04-11 Ian Lance Taylor <iant@google.com>
6607
6608 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
6609 initialize local variable v.
6610
cdc29364
CC
66112011-04-11 Cary Coutant <ccoutant@google.com>
6612
6613 * archive.cc (Archive::include_member): Adjust call to
6614 report_object.
6615 (Add_archive_symbols::run): Track argument serial numbers.
6616 (Lib_group::include_member): Likewise.
6617 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
6618 * archive.h (Incremental_archive_entry::Archive_member):
6619 Initialize arg_serial_.
6620 (Archive_member::arg_serial_): New data member.
6621 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
6622 (Sized_dynobj::do_add_symbols): Track symbols when doing an
6623 incremental link.
6624 (Sized_dynobj::do_for_all_local_got_entries): New function.
6625 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
6626 function.
6627 * fileread.cc (get_mtime): New function.
6628 * fileread.h (get_mtime): New function.
6629 * gold.cc (queue_initial_tasks): Check for incremental update.
6630 (process_incremental_input): New function.
6631 (queue_middle_tasks): Don't force valid target for incremental
6632 update.
6633 * incremental-dump.cc (find_input_containing_global): Adjust
6634 size of symbol info entry.
6635 (dump_incremental_inputs): Dump argument serial number and
6636 in_system_directory flag; bias shndx by 1; print symbol names
6637 when dumping per-file symbol lists; use new symbol info readers.
6638 * incremental.cc
6639 (Output_section_incremental_inputs:update_data_size): New function.
6640 (Sized_incremental_binary::setup_readers): Setup input readers
6641 for each input file; build maps for files added from libraries
6642 and scripts.
6643 (Sized_incremental_binary::check_input_args): New function.
6644 (Sized_incremental_binary::do_check_inputs): Build map of argument
6645 serial numbers to input arguments.
6646 (Sized_incremental_binary::do_file_has_changed): Rename
6647 do_file_is_unchanged to this; compare file modification times.
6648 (Sized_incremental_binary::do_init_layout): New function.
6649 (Sized_incremental_binary::do_reserve_layout): New function.
6650 (Sized_incremental_binary::do_get_input_reader): Remove.
6651 (Sized_incremental_binary::get_symtab_view): New function.
6652 (Incremental_checker::can_incrementally_link_output_file): Remove.
6653 (Incremental_inputs::report_command_line): Exclude --debug options.
6654 (Incremental_inputs::report_archive_begin): Add parameter; track
6655 argument serial numbers; don't put input file entry for archive
6656 before archive members.
6657 (Incremental_inputs::report_archive_end): Put input file entry
6658 for archive after archive members.
6659 (Incremental_inputs::report_object): Add parameter; track argument
6660 serial numbers and in_system_directory flag.
6661 (Incremental_inputs::report_script): Add parameter; track argument
6662 serial numbers.
6663 (Output_section_incremental_inputs::set_final_data_size): Adjust
6664 size of symbol info entry; check for forwarding symbols.
6665 (Output_section_incremental_inputs::write_input_files): Write
6666 in_system_directory flag and argument serial number.
6667 (Output_section_incremental_inputs::write_info_blocks): Map section
6668 indices between incremental info and original input file; store
6669 input section index for each symbol.
6670 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
6671 change operator() to visit().
6672 (class Global_got_offset_visitor): Likewise.
6673 (class Global_symbol_visitor_got_plt):
6674 (Output_section_incremental_inputs::write_got_plt): Use new visitor
6675 classes.
6676 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
6677 (Sized_incr_relobj::do_read_symbols): New function.
6678 (Sized_incr_relobj::do_layout): New function.
6679 (Sized_incr_relobj::do_layout_deferred_sections): New function.
6680 (Sized_incr_relobj::do_add_symbols): New function.
6681 (Sized_incr_relobj::do_should_include_member): New function.
6682 (Sized_incr_relobj::do_for_all_global_symbols): New function.
6683 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
6684 (Sized_incr_relobj::do_section_size): New function.
6685 (Sized_incr_relobj::do_section_name): New function.
6686 (Sized_incr_relobj::do_section_contents): New function.
6687 (Sized_incr_relobj::do_section_flags): New function.
6688 (Sized_incr_relobj::do_section_entsize): New function.
6689 (Sized_incr_relobj::do_section_address): New function.
6690 (Sized_incr_relobj::do_section_type): New function.
6691 (Sized_incr_relobj::do_section_link): New function.
6692 (Sized_incr_relobj::do_section_info): New function.
6693 (Sized_incr_relobj::do_section_addralign): New function.
6694 (Sized_incr_relobj::do_initialize_xindex): New function.
6695 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
6696 (Sized_incr_relobj::do_read_relocs): New function.
6697 (Sized_incr_relobj::do_gc_process_relocs): New function.
6698 (Sized_incr_relobj::do_scan_relocs): New function.
6699 (Sized_incr_relobj::do_count_local_symbols): New function.
6700 (Sized_incr_relobj::do_finalize_local_symbols): New function.
6701 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
6702 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
6703 (Sized_incr_relobj::do_relocate): New function.
6704 (Sized_incr_relobj::do_set_section_offset): New function.
6705 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
6706 (Sized_incr_dynobj::do_read_symbols): New function.
6707 (Sized_incr_dynobj::do_layout): New function.
6708 (Sized_incr_dynobj::do_add_symbols): New function.
6709 (Sized_incr_dynobj::do_should_include_member): New function.
6710 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
6711 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
6712 (Sized_incr_dynobj::do_section_size): New function.
6713 (Sized_incr_dynobj::do_section_name): New function.
6714 (Sized_incr_dynobj::do_section_contents): New function.
6715 (Sized_incr_dynobj::do_section_flags): New function.
6716 (Sized_incr_dynobj::do_section_entsize): New function.
6717 (Sized_incr_dynobj::do_section_address): New function.
6718 (Sized_incr_dynobj::do_section_type): New function.
6719 (Sized_incr_dynobj::do_section_link): New function.
6720 (Sized_incr_dynobj::do_section_info): New function.
6721 (Sized_incr_dynobj::do_section_addralign): New function.
6722 (Sized_incr_dynobj::do_initialize_xindex): New function.
6723 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
6724 (make_sized_incremental_object): New function.
6725 (Incremental_library::copy_unused_symbols): New function.
6726 (Incremental_library::do_for_all_unused_symbols): New function.
6727 * incremental.h (enum Incremental_input_flags): New type.
6728 (class Incremental_checker): Remove.
6729 (Incremental_input_entry::Incremental_input_entry): Add argument
6730 serial number.
6731 (Incremental_input_entry::arg_serial): New function.
6732 (Incremental_input_entry::set_is_in_system_directory): New function.
6733 (Incremental_input_entry::is_in_system_directory): New function.
6734 (Incremental_input_entry::arg_serial_): New data member.
6735 (Incremental_input_entry::is_in_system_directory_): New data member.
6736 (class Script_info): Move here from script.h.
6737 (Script_info::Script_info): Add filename parameter.
6738 (Script_info::filename): New function.
6739 (Script_info::filename_): New data member.
6740 (Incremental_script_entry::Incremental_script_entry): Add argument
6741 serial number.
6742 (Incremental_object_entry::Incremental_object_entry): Likewise.
6743 (Incremental_object_entry::add_input_section): Build list of input
6744 sections with map to original shndx.
6745 (Incremental_object_entry::get_input_section_index): New function.
6746 (Incremental_object_entry::shndx_): New data member.
6747 (Incremental_object_entry::name_key_): Rename; adjust all refs.
6748 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
6749 (Incremental_archive_entry::Incremental_archive_entry): Add argument
6750 serial number.
6751 (Incremental_inputs::report_archive_begin): Likewise.
6752 (Incremental_inputs::report_object): Likewise.
6753 (Incremental_inputs::report_script): Likewise.
6754 (class Incremental_global_symbol_reader): New class.
6755 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
6756 and store flags and input file type.
6757 (Incremental_input_entry_reader::arg_serial): New function.
6758 (Incremental_input_entry_reader::type): Extract type from flags.
6759 (Incremental_input_entry_reader::is_in_system_directory): New function.
6760 (Incremental_input_entry_reader::get_input_section_count): Call
6761 accessor function for type.
6762 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
6763 function for type; adjust size of global symbol entry.
6764 (Incremental_input_entry_reader::get_global_symbol_count): Call
6765 accessor function for type.
6766 (Incremental_input_entry_reader::get_object_count): Likewise.
6767 (Incremental_input_entry_reader::get_object_offset): Likewise.
6768 (Incremental_input_entry_reader::get_member_count): Likewise.
6769 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
6770 (Incremental_input_entry_reader::get_member_offset): Likewise.
6771 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
6772 (Incremental_input_entry_reader::Global_symbol_info): Remove.
6773 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
6774 (Incremental_input_entry_reader::get_global_symbol_reader): New
6775 function.
6776 (Incremental_input_entry_reader::get_output_symbol_index): New
6777 function.
6778 (Incremental_input_entry_reader::type_): Remove.
6779 (Incremental_input_entry_reader::flags_): New data member.
6780 (Incremental_inputs_reader::input_file_offset): New function.
6781 (Incremental_inputs_reader::input_file_index): New function.
6782 (Incremental_inputs_reader::input_file): Call input_file_offset.
6783 (Incremental_inputs_reader::input_file_at_offset): New function.
6784 (Incremental_relocs_reader::get_r_type): Reformat.
6785 (Incremental_relocs_reader::get_r_shndx): Reformat.
6786 (Incremental_relocs_reader::get_r_offset): Reformat.
6787 (Incremental_relocs_reader::data): New function.
6788 (Incremental_binary::Incremental_binary): Initialize new data members.
6789 (Incremental_binary::check_inputs): Add cmdline parameter.
6790 (Incremental_binary::file_is_unchanged): Remove.
6791 (Input_reader::arg_serial): New function.
6792 (Input_reader::get_unused_symbol_count): New function.
6793 (Input_reader::get_unused_symbol): New function.
6794 (Input_reader::do_arg_serial): New function.
6795 (Input_reader::do_get_unused_symbol_count): New function.
6796 (Input_reader::do_get_unused_symbol): New function.
6797 (Incremental_binary::input_file_count): New function.
6798 (Incremental_binary::get_input_reader): Change signature to use
6799 index instead of filename.
6800 (Incremental_binary::file_has_changed): New function.
6801 (Incremental_binary::get_input_argument): New function.
6802 (Incremental_binary::get_library): New function.
6803 (Incremental_binary::get_script_info): New function.
6804 (Incremental_binary::init_layout): New function.
6805 (Incremental_binary::reserve_layout): New function.
6806 (Incremental_binary::output_file): New function.
6807 (Incremental_binary::do_check_inputs): New function.
6808 (Incremental_binary::do_file_is_unchanged): Remove.
6809 (Incremental_binary::do_file_has_changed): New function.
6810 (Incremental_binary::do_init_layout): New function.
6811 (Incremental_binary::do_reserve_layout): New function.
6812 (Incremental_binary::do_input_file_count): New function.
6813 (Incremental_binary::do_get_input_reader): Change signature.
6814 (Incremental_binary::input_args_map_): New data member.
6815 (Incremental_binary::library_map_): New data member.
6816 (Incremental_binary::script_map_): New data member.
6817 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6818 new data members.
6819 (Sized_incremental_binary::output_section): New function.
6820 (Sized_incremental_binary::inputs_reader): Add const.
6821 (Sized_incremental_binary::symtab_reader): Add const.
6822 (Sized_incremental_binary::relocs_reader): Add const.
6823 (Sized_incremental_binary::got_plt_reader): Add const.
6824 (Sized_incremental_binary::get_symtab_view): New function.
6825 (Sized_incremental_binary::Inputs_reader): New typedef.
6826 (Sized_incremental_binary::Input_entry_reader): New typedef.
6827 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
6828 (Sized_incremental_binary::do_file_is_unchanged): Remove.
6829 (Sized_incremental_binary::do_file_has_changed): New function.
6830 (Sized_incremental_binary::do_init_layout): New function.
6831 (Sized_incremental_binary::do_reserve_layout): New function.
6832 (Sized_input_reader::Inputs_reader): Remove.
6833 (Sized_input_reader::Input_entry_reader): Remove.
6834 (Sized_input_reader::do_arg_serial): New function.
6835 (Sized_input_reader::do_get_unused_symbol_count): New function.
6836 (Sized_input_reader::do_get_unused_symbol): New function.
6837 (Sized_incremental_binary::do_input_file_count): New function.
6838 (Sized_incremental_binary::do_get_input_reader): Change signature;
6839 use index instead of filename.
6840 (Sized_incremental_binary::section_map_): New data member.
6841 (Sized_incremental_binary::input_entry_readers_): New data member.
6842 (class Sized_incr_relobj): New class.
6843 (class Sized_incr_dynobj): New class.
6844 (make_sized_incremental_object): New function.
6845 (class Incremental_library): New class.
6846 * layout.cc (Free_list::num_lists): New static data member.
6847 (Free_list::num_nodes): New static data member.
6848 (Free_list::num_removes): New static data member.
6849 (Free_list::num_remove_visits): New static data member.
6850 (Free_list::num_allocates): New static data member.
6851 (Free_list::num_allocate_visits): New static data member.
6852 (Free_list::init): New function.
6853 (Free_list::remove): New function.
6854 (Free_list::allocate): New function.
6855 (Free_list::dump): New function.
6856 (Free_list::print_stats): New function.
6857 (Layout_task_runner::run): Resize output file for incremental updates.
6858 (Layout::Layout): Initialize new data members.
6859 (Layout::set_incremental_base): New function.
6860 (Layout::init_fixed_output_section): New function.
6861 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
6862 incremental updates.
6863 (Layout::create_gold_note): Do not create gold note section for
6864 incremental updates.
6865 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
6866 for incremental updates.
6867 (Layout::set_section_offsets): For incremental updates, allocate space
6868 from free list.
6869 (Layout::create_symtab_sections): Layout with offsets relative to
6870 start of section; for incremental updates, allocate space from free
6871 list.
6872 (Layout::create_shdrs): For incremental updates, allocate space from
6873 free list.
6874 (Layout::finish_dynamic_section): For incremental updates, do not
6875 check --as-needed (fixed in subsequent patch).
6876 * layout.h (class Free_list): New class.
6877 (Layout::set_incremental_base): New function.
6878 (Layout::incremental_base): New function.
6879 (Layout::init_fixed_output_section): New function.
6880 (Layout::allocate): New function.
6881 (Layout::incremental_base_): New data member.
6882 (Layout::free_list_): New data member.
6883 * main.cc (main): Print Free_list statistics.
6884 * object.cc (Relobj::finalize_incremental_relocs): Add
6885 clear_counts parameter; clear counts only when clear_counts is set.
6886 (Sized_relobj::Sized_relobj): Initialize new base class.
6887 (Sized_relobj::do_layout): Don't report special sections.
6888 (Sized_relobj::do_for_all_local_got_entries): New function.
6889 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
6890 symtab_off to all symbol table offsets.
6891 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
6892 * object.h (class Got_offset_list): Move to top of file.
6893 (Object::Object): Allow case where input_file == NULL.
6894 (Object::~Object): Likewise.
6895 (Object::input_file): Assert that input_file != NULL.
6896 (Object::lock): Allow case where input_file == NULL.
6897 (Object::unlock): Likewise.
6898 (Object::is_locked): Likewise.
6899 (Object::token): Likewise.
6900 (Object::release): Likewise.
6901 (Object::is_incremental): New function.
6902 (Object::get_mtime): New function.
6903 (Object::for_all_local_got_entries): New function.
6904 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
6905 (Object::set_is_in_system_directory): New function.
6906 (Object::is_in_system_directory): New function.
6907 (Object::do_is_incremental): New function.
6908 (Object::do_get_mtime): New function.
6909 (Object::do_for_all_local_got_entries): New function.
6910 (Object::is_in_system_directory_): New data member.
6911 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
6912 (class Sized_relobj_base): New class.
6913 (class Sized_relobj): Derive from Sized_relobj_base.
6914 (class Sized_relobj::Symbols): Redeclare from base class.
6915 (class Sized_relobj::local_got_offset_list): Remove.
6916 (class Sized_relobj::Output_sections): Redeclare from base class.
6917 (class Sized_relobj::do_for_all_local_got_entries): New function.
6918 (class Sized_relobj::write_local_symbols): Add offset parameter.
6919 (class Sized_relobj::local_symbol_offset_): Update comment.
6920 (class Sized_relobj::local_dynsym_offset_): Update comment.
6921 * options.cc (Input_arguments::add_file): Remove const.
6922 * options.h (Input_file_argument::Input_file_argument):
6923 Initialize arg_serial_ (all constructors).
6924 (Input_file_argument::set_arg_serial): New function.
6925 (Input_file_argument::arg_serial): New function.
6926 (Input_file_argument::arg_serial_): New data member.
6927 (Input_arguments::Input_arguments): Initialize file_count_.
6928 (Input_arguments::add_file): Remove const.
6929 (Input_arguments::number_of_input_files): New function.
6930 (Input_arguments::file_count_): New data member.
6931 (Command_line::number_of_input_files): Call
6932 Input_arguments::number_of_input_files.
6933 * output.cc (Output_segment_headers::Output_segment_headers):
6934 Set current size.
6935 (Output_section::Input_section::current_data_size): New function.
6936 (Output_section::Output_section): Initialize new data members.
6937 (Output_section::add_input_section): Don't do merge sections for
6938 an incremental link; allocate space from free list for an
6939 incremental update.
6940 (Output_section::add_output_section_data): Allocate space from
6941 free list for an incremental update.
6942 (Output_section::update_data_size): New function.
6943 (Output_section::set_fixed_layout): New function.
6944 (Output_section::reserve): New function.
6945 (Output_segment::set_section_addresses): Remove const.
6946 (Output_segment::set_section_list_addresses): Remove const; allocate
6947 space from free list for an incremental update.
6948 (Output_segment::set_offset): Adjust size of RELRO segment for an
6949 incremental update.
6950 * output.h (Output_data::current_data_size): Move here from
6951 child classes.
6952 (Output_data::pre_finalize_data_size): New function.
6953 (Output_data::update_data_size): New function.
6954 (Output_section_headers::update_data_size): new function.
6955 (Output_section_data_build::current_data_size): Move to Output_data.
6956 (Output_data_strtab::update_data_size): New function.
6957 (Output_section::current_data_size): Move to Output_data.
6958 (Output_section::set_fixed_layout): New function.
6959 (Output_section::has_fixed_layout): New function.
6960 (Output_section::reserve): New function.
6961 (Output_section::update_data_size): New function.
6962 (Output_section::has_fixed_layout_): New data member.
6963 (Output_section::free_list_): New data member.
6964 (Output_segment::set_section_addresses): Remove const.
6965 (Output_segment::set_section_list_addresses): Remove const.
6966 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
6967 New function.
6968 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
6969 New function.
6970 * readsyms.cc (Read_symbols::do_read_symbols): Add library
6971 parameter when calling Add_symbols constructor; store argument
6972 serial number for members of a lib group.
6973 (Add_symbols::locks): Allow case where token == NULL.
6974 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
6975 (Read_member::~Read_member): New function.
6976 (Read_member::is_runnable): New function.
6977 (Read_member::locks): New function.
6978 (Read_member::run): New function.
6979 (Check_script::~Check_script): New function.
6980 (Check_script::is_runnable): New function.
6981 (Check_script::locks): New function.
6982 (Check_script::run): New function.
6983 (Check_library::~Check_library): New function.
6984 (Check_library::is_runnable): New function.
6985 (Check_library::locks): New function.
6986 (Check_library::run): New function.
6987 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
6988 (Add_symbols::library_): New data member.
6989 (class Read_member): New class.
6990 (class Check_script): New class.
6991 (class Check_library): New class.
6992 * reloc.cc (Read_relocs::is_runnable): Allow case where
6993 token == NULL.
6994 (Read_relocs::locks): Likewise.
6995 (Scan_relocs::locks): Likewise.
6996 (Relocate_task::locks): Likewise.
6997 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
6998 to clear counters.
6999 (Sized_relobj::incremental_relocs_scan): Fix comment.
7000 (Sized_relobj::do_relocate): Pass output file offset to
7001 write_local_symbols.
7002 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
7003 from class declaration.
7004 * script.cc (read_input_script): Allocate Script_info; pass
7005 argument serial number to report_script.
7006 * script.h (class Script_info): Move to incremental.h.
7007 * symtab.cc (Symbol_table::add_from_incrobj): New function.
7008 * symtab.h (Symbol_table::add_from_incrobj): New function.
7009 (Symbol_table::set_file_offset): New function.
7010
b961d0d7
CC
70112011-04-05 Cary Coutant <ccoutant@google.com>
7012
7013 * incremental-dump.cc (dump_incremental_inputs): Change signature
7014 to take a Sized_incremental_binary; change caller. Use readers
7015 in Sized_incremental_binary.
7016 * incremental.cc
7017 (Sized_incremental_binary::find_incremental_inputs_sections):
7018 Rename do_find_incremental_inputs_sections to this.
7019 (Sized_incremental_binary::setup_readers): New function.
7020 (Sized_incremental_binary::do_check_inputs): Check
7021 has_incremental_info_ flag; move setup code to setup_readers;
7022 use input readers.
7023 (Sized_incremental_binary::do_file_is_unchanged): New function.
7024 (Sized_incremental_binary::do_get_input_reader): New function.
7025 * incremental.h (class Incremental_binary): Move to end of file.
7026 (Incremental_binary::file_is_unchanged): New function.
7027 (Incremental_binary::do_file_is_unchanged): New function.
7028 (Incremental_binary::Input_reader): New class.
7029 (Incremental_binary::get_input_reader): New function.
7030 (class Sized_incremental_binary): Move to end of file.
7031 (Sized_incremental_binary::Sized_incremental_binary): Setup the
7032 input section reader classes.
7033 (Sized_incremental_binary::has_incremental_info): New function.
7034 (Sized_incremental_binary::inputs_reader): New function.
7035 (Sized_incremental_binary::symtab_reader): New function.
7036 (Sized_incremental_binary::relocs_reader): New function.
7037 (Sized_incremental_binary::got_plt_reader): New function.
7038 (Sized_incremental_binary::do_file_is_unchanged): New function.
7039 (Sized_incremental_binary::Sized_input_reader): New class.
7040 (Sized_incremental_binary::get_input_reader): New function.
7041 (Sized_incremental_binary::find_incremental_inputs_sections):
7042 Rename do_find_incremental_inputs_sections to this.
7043 (Sized_incremental_binary::setup_readers): New function.
7044 (Sized_incremental_binary::has_incremental_info_): New data member.
7045 (Sized_incremental_binary::inputs_reader_): New data member.
7046 (Sized_incremental_binary::symtab_reader_): New data member.
7047 (Sized_incremental_binary::relocs_reader_): New data member.
7048 (Sized_incremental_binary::got_plt_reader_): New data member.
7049 (Sized_incremental_binary::current_input_file_): New data member.
7050
a869183f
PP
70512011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
7052
7053 PR gold/12640
7054 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
7055 violation.
7056
70572011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
7058
7059 * archive.cc (Archive::include_member): Adjust call to report_object.
7060 (Add_archive_symbols::run): Add script_info to call to
7061 report_archive_begin.
7062 (Lib_group::include_member): Adjust call to report_object.
7063 (Add_lib_group_symbols::run): Adjust call to report_object.
7064 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
7065 blocks. Add object count for script input files.
7066 * incremental.cc (Incremental_inputs::report_archive_begin): Add
7067 script_info parameter; change all callers.
7068 (Incremental_inputs::report_object): Add script_info parameter;
7069 change all callers.
7070 (Incremental_inputs::report_script): Store backpointer to
7071 incremental info entry.
7072 (Output_section_incremental_inputs::set_final_data_size): Record
7073 additional information for scripts.
7074 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7075 * incremental.h (Incremental_script_entry::add_object): New function.
7076 (Incremental_script_entry::get_object_count): New function.
7077 (Incremental_script_entry::get_object): New function.
7078 (Incremental_script_entry::objects_): New data member; adjust
7079 constructor.
7080 (Incremental_inputs::report_archive_begin): Add script_info parameter.
7081 (Incremental_inputs::report_object): Add script_info parameter.
7082 (Incremental_inputs_reader::get_object_count): New function.
7083 (Incremental_inputs_reader::get_object_offset): New function.
7084 * options.cc (Input_arguments::add_file): Return reference to
7085 new input argument.
7086 * options.h (Input_argument::set_script_info): New function.
7087 (Input_argument::script_info): New function.
7088 (Input_argument::script_info_): New data member; adjust all
7089 constructors.
7090 (Input_file_group::add_file): Return reference to new input argument.
7091 (Input_file_lib::add_file): Likewise.
7092 (Input_arguments::add_file): Likewise.
7093 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
7094 * script.cc (Parser_closure::Parser_closure): Add script_info
7095 parameter; adjust all callers.
7096 (Parser_closure::script_info): New function.
7097 (Parser_closure::script_info_): New data member.
7098 (read_input_script): Report scripts earlier to incremental info.
7099 (script_add_file): Set script_info in Input_argument.
7100 (script_add_library): Likewise.
7101 * script.h (Script_options::Script_info): Rewrite class.
7102
a869183f 71032011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
7104
7105 * archive.cc (Library_base::should_include_member): Move
7106 method here from class Archive.
7107 (Archive::Archive): Initialize base class.
7108 (Archive::should_include_member): Move to base class.
7109 (Archive::do_for_all_unused_symbols): New function.
7110 (Add_archive_symbols::run): Remove redundant access to
7111 incremental_inputs.
7112 (Lib_group::Lib_group): Initialize base class.
7113 (Lib_group::do_filename): New function.
7114 (Lib_group::include_member): Pass pointer to Lib_group to
7115 report_object.
7116 (Lib_group::do_for_all_unused_symbols): New function.
7117 (Add_lib_group_symbols::run): Report archive information for
7118 incremental links.
7119 * archive.h (class Library_base): New base class.
7120 (class Archive): Derive from Library_base.
7121 (Archive::filename): Move to base class.
7122 (Archive::set_incremental_info): Likewise.
7123 (Archive::incremental_info): Likewise.
7124 (Archive::Should_include): Likewise.
7125 (Archive::should_include_member): Likewise.
7126 (Archive::Armap_entry): Remove.
7127 (Archive::Unused_symbol_iterator): Remove.
7128 (Archive::unused_symbols_begin): Remove.
7129 (Archive::unused_symbols_end): Remove.
7130 (Archive::do_filename): New function.
7131 (Archive::do_get_mtime): New function.
7132 (Archive::do_for_all_unused_symbols): New function.
7133 (Archive::task_): Move to base class.
7134 (Archive::incremental_info_): Likewise.
7135 (class Lib_group): Derive from Library_base.
7136 (Lib_group::do_filename): New function.
7137 (Lib_group::do_get_mtime): New function.
7138 (Lib_group::do_for_all_unused_symbols): New function.
7139 (Lib_group::task_): Move to base class.
7140 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
7141 function.
7142 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
7143 function.
7144 * incremental.cc (Incremental_inputs::report_archive_begin):
7145 Use Library_base; call library's get_mtime; add incremental inputs
7146 entry before members.
7147 (class Unused_symbol_visitor): New class.
7148 (Incremental_inputs::report_archive_end): Use Library_base; use
7149 visitor class to record unused symbols; don't add incremental inputs
7150 entry after members.
7151 (Incremental_inputs::report_object): Use Library_base.
7152 * incremental.h
7153 (Incremental_archive_entry::Incremental_archive_entry): Remove
7154 unused Archive parameter.
7155 (Incremental_inputs::report_archive_begin): Use Library_base.
7156 (Incremental_inputs::report_archive_end): Likewise.
7157 (Incremental_inputs::report_object): Likewise.
7158 * object.cc (Sized_relobj::do_for_all_global_symbols): New
7159 function.
7160 * object.h (Object::for_all_global_symbols): New function.
7161 (Object::do_for_all_global_symbols): New function.
7162 (Sized_relobj::do_for_all_global_symbols): New function.
7163 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
7164 function.
7165 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
7166 function.
7167
61ab3e40
ILT
71682011-03-27 Ian Lance Taylor <iant@google.com>
7169
7170 * archive.cc (Archive::interpret_header): Return -1 if something
7171 goes wrong. Change callers accordingly.
7172
30e1f9e6
CC
71732011-03-25 Cary Coutant <ccoutant@google.com>
7174
7175 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
7176 * testsuite/Makefile.in: Regenerate.
7177
9370ce59 71782011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
7179
7180 * plugin.cc (get_view): New.
7181 (Plugin::load): Pass get_view to the plugin.
7182 (Plugin_manager::get_view): New.
7183
9312bb0a
ILT
71842011-03-21 Ian Lance Taylor <iant@google.com>
7185
7186 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 7187 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 7188
7e12ba9e
ST
71892011-03-21 Sriraman Tallam <tmsriram@google.com>
7190
7191 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
7192 Change == to -eq.
7193 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
7194 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
7195 Change == to -eq.
7196 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
7197 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
7198
fd7a005d
ILT
71992011-03-14 Ian Lance Taylor <iant@google.com>
7200
7201 * script-sections.cc (Sort_output_sections::script_compare):
7202 Rename from is_before, change return type.
7203 (Sort_output_sections::operator()): Adjust accordingly.
7204
ed16fd1b
ILT
72052011-03-11 Jeffrey Yasskin <jyasskin@google.com>
7206
7207 PR gold/12572
7208 * testsuite/odr_violation2.cc: Add comment to make all error line
7209 numbers double digits.
7210 * testsuite/debug_msg.sh: Adjust expected errors.
7211
71ff8986
ILT
72122011-03-09 Jeffrey Yasskin <jyasskin@google.com>
7213
7214 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
7215 but mark earlier ones as non-canonical
7216 (offset_to_iterator): Update search target and example
7217 (do_addr2line): Return extra lines in a vector*
7218 (format_file_lineno): Extract from do_addr2line
7219 (one_addr2line): Add vector* out-param
7220 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
7221 when a lineno entry appeared last for its instruction
7222 (Dwarf_line_info): Add vector* out-param
7223 * object.cc (Relocate_info): Pass NULL for the vector* out-param
7224 * symtab.cc (Odr_violation_compare): Include the lineno in the
7225 comparison again.
7226 (linenos_from_loc): New. Combine the canonical line for an
7227 address with its other lines.
7228 (True_if_intersect): New. Helper functor to make
7229 std::set_intersection a query.
7230 (detect_odr_violations): Compare sets of lines instead of just
7231 one line for each function. This became less deterministic, but
7232 has fewer false positives.
7233 * symtab.h: Declarations.
7234 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
7235 mix an optimized and non-optimized object in the same binary
7236 (odr_violation2.so): Same.
7237 * testsuite/Makefile.in: Regenerate from Makefile.am.
7238 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
7239 * testsuite/debug_msg.sh: Update line numbers and add
7240 assertions.
7241 * testsuite/odr_violation1.cc: Use OdrDerived, in a
7242 non-optimized context.
7243 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
7244 isn't inlined, and use OdrDerived in an optimized context.
7245 * testsuite/odr_header1.h: Defines OdrDerived, where
7246 optimization will change the
7247 first-instruction-in-the-destructor's file and line number.
7248 * testsuite/odr_header2.h: Defines OdrBase.
7249
a19fefdc
ILT
72502011-03-09 Ian Lance Taylor <iant@google.com>
7251
7252 * fileread.cc (File_read::clear_views): Don't delete the whole
7253 file view.
7254
ecb351e9
ILT
72552011-03-08 Ian Lance Taylor <iant@google.com>
7256
7257 PR gold/12525
7258 * fileread.cc: #include <climits>.
7259 (GOLD_IOV_MAX): Define.
7260 (File_read::read_multiple): Limit number of entries by iov_max.
7261 * fileread.h (class File_read): Always set max_readv_entries to
7262 128.
7263
b821d13c
ILT
72642011-03-07 Ian Lance Taylor <iant@google.com>
7265
7266 PR gold/12525
7267 * options.h (class General_options): Add -dy and -dn.
7268
89243142
CC
72692011-03-02 Cary Coutant <ccoutant@google.com>
7270
7271 * testsuite/script_test_9.t: Add TLS segment.
7272
d0773f31
ILT
72732011-03-02 Simon Baldwin <simonb@google.com>
7274
7275 * configure.ac: Add check for gnu_indirect_function support in
7276 the toolchain building binutils.
7277 * configure: Rebuild.
7278
9370ce59 72792011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
7280
7281 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
7282 plugin only symbols.
7283 (Symbol_table::sized_finalize_symbol) Mark symbol only present
7284 in plugin files as not needed in the symbol table.
7285
4cf7a849
ST
72862011-02-11 Sriraman Tallam <tmsriram@google.com>
7287
7288 * output.cc (Output_section::add_input_section): Delay fill
7289 generation for section ordering.
7290
b578bd7d
ILT
72912011-02-09 Ian Lance Taylor <iant@google.com>
7292
7293 PR gold/12316
7294 * object.h (class Sized_relobj): Remove clear_local_symbols.
7295 * reloc.cc (Sized_relobj::do_relocate): Don't call
7296 clear_local_symbols.
7297
9370ce59 72982011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
7299
7300 * plugin.cc (is_visible_from_outside): Return true for symbols
7301 in the -u option.
7302
55382fb7
ILT
73032011-02-04 Jeffrey Yasskin <jyasskin@google.com>
7304
7305 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
7306 filename.
7307
4e271fff
ST
73082011-02-02 Sriraman Tallam <tmsriram@google.com>
7309
7310 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 7311 to std::string.
4e271fff 7312 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 7313 section_name to be std::string.
4e271fff
ST
7314 (is_function_ctor_or_dtor): Change type of parameter to std::string.
7315
d433c3ac
ILT
73162011-01-25 Ian Lance Taylor <iant@google.com>
7317
7318 * script.cc (script_add_extern): Rewrite to use
7319 add_symbol_reference.
7320
880473a6
DK
73212011-01-25 Doug Kwan <dougkwan@google.com>
7322
d433c3ac 7323 * icf.cc (get_section_contents): Always lock section's object.
880473a6 7324
f30f86fa
ILT
73252011-01-24 Ian Lance Taylor <iant@google.com>
7326
7327 * options.h (class General_options): Accept
7328 --no-detect-odr-violations.
7329
8e51a0b9
ILT
73302011-01-24 Ian Lance Taylor <iant@google.com>
7331
7332 * version.cc (version_string): Bump to 1.11.
7333
0f3b89d8
ILT
73342011-01-24 Ian Lance Taylor <iant@google.com>
7335
7336 * plugin.cc (class Plugin_rescan): Define new class.
7337 (Plugin_manager::claim_file): Set any_claimed_.
7338 (Plugin_manager::save_archive): New function.
7339 (Plugin_manager::save_input_group): New function.
7340 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
7341 necessary.
7342 (Plugin_manager::new_undefined_symbol): New function.
7343 (Plugin_manager::rescan): New function.
7344 (Plugin_manager::rescannable_defines): New function.
7345 (Plugin_manager::add_input_file): Set any_added_.
7346 * plugin.h (class Plugin_manager): define new fields rescannable_,
7347 undefined_symbols_, any_claimed_, and any_added_. Declare
7348 Plugin_rescan as friend. Declare new functions.
7349 (Plugin_manager::Rescannable): Define type.
7350 (Plugin_manager::Rescannable_list): Define type.
7351 (Plugin_manager::Undefined_symbol_list): Define type.
7352 (Plugin_manager::Plugin_manager): Initialize new fields.
7353 * archive.cc (Archive::defines_symbol): New function.
7354 (Add_archive_symbols::run): Pass archive to plugins if any.
7355 * archive.h (class Archive): Declare defines_symbol.
7356 * readsyms.cc (Input_group::~Input_group): New function.
7357 (Finish_group::run): Pass input_group to plugins if any.
7358 * readsyms.h (class Input_group): Declare destructor.
7359 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
7360 any.
7361
3bb951e5
ILT
73622011-01-10 Ian Lance Taylor <iant@google.com>
7363
7364 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
7365 section as relro.
7366 (Layout::set_segment_offsets): Reset increase_relro before calling
7367 set_section_addresses a second time.
7368
0aa45fac
CC
73692011-01-04 Cary Coutant <ccoutant@google.com>
7370
7371 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
7372 sections before NOBITS sections.
7373
0db46eb4
L
73742011-01-01 H.J. Lu <hongjiu.lu@intel.com>
7375
7376 * version.cc (print_version): Update copyright to 2011.
7377
829c9745
CC
73782010-12-23 Cary Coutant <ccoutant@google.com>
7379
7380 * output.h (Output_data_reloc::add_output_section): Pass OD instead
7381 of OS to this->add. Add OD parameter to second form of the function.
7382
7500420b
ILT
73832010-12-20 Ian Lance Taylor <iant@google.com>
7384
7385 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
7386 second of two consecutive entries with same offset.
7387
f8e9a930
RW
73882010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7389
7390 * testsuite/Makefile.am (ifuncmain2static_LDADD)
7391 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
7392 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
7393 to avoid unneeded links against $(LDADD).
7394 * testsuite/Makefile.in: Regenerate.
7395
2fbb4320
ILT
73962010-12-15 Ian Lance Taylor <iant@google.com>
7397
7398 PR gold/12324
7399 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
7400 for R_X86_64_32 and R_X86_64_PC32.
7401 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
7402 ver_matching_def_pic.o.
7403 (ver_matching_def_pic.o): New target.
7404
fedb228d
RW
74052010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7406
7407 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
7408 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
7409 Move definition before File_read::View member definitions.
7410 (File_read::View::~View): Initialize and hold lock before
7411 updating current_mapped_bytes.
7412
9b547ce6
RW
74132010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7414
7415 * dwarf_reader.cc: Remove outdated comment.
7416 * gold-threads.cc: Fix typo in error message.
7417 * archive.cc: Fix typos in comments.
7418 * archive.h: Likewise.
7419 * arm-reloc-property.cc: Likewise.
7420 * arm-reloc-property.h: Likewise.
7421 * arm-reloc.def: Likewise.
7422 * arm.cc: Likewise.
7423 * attributes.h: Likewise.
7424 * cref.cc: Likewise.
7425 * ehframe.cc: Likewise.
7426 * fileread.h: Likewise.
7427 * gold.h: Likewise.
7428 * i386.cc: Likewise.
7429 * icf.cc: Likewise.
7430 * incremental.h: Likewise.
7431 * int_encoding.cc: Likewise.
7432 * layout.h: Likewise.
7433 * main.cc: Likewise.
7434 * merge.h: Likewise.
7435 * object.cc: Likewise.
7436 * object.h: Likewise.
7437 * options.cc: Likewise.
7438 * readsyms.cc: Likewise.
7439 * reduced_debug_output.cc: Likewise.
7440 * reloc.cc: Likewise.
7441 * script-sections.cc: Likewise.
7442 * sparc.cc: Likewise.
7443 * symtab.h: Likewise.
7444 * target-reloc.h: Likewise.
7445 * target.cc: Likewise.
7446 * target.h: Likewise.
7447 * timer.cc: Likewise.
7448 * timer.h: Likewise.
7449 * x86_64.cc: Likewise.
7450
83e17bd5
CC
74512010-12-09 Cary Coutant <ccoutant@google.com>
7452
7453 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
7454 stack.
7455 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
7456 parameter; change all callers.
7457 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
7458 * options.h (warn_execstack): New option.
7459
017257f8
DK
74602010-12-07 Doug Kwan <dougkwan@google.com>
7461
7462 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
7463 like function call relocations.
7464
c20cbc06
ILT
74652010-12-07 Ian Lance Taylor <iant@google.com>
7466
7467 * archive.cc (Archive::get_elf_object_for_member): Permit
7468 punconfigured to be NULL.
7469 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
7470 (Archive::include_member): Pass NULL to get_elf_object_for_member
7471 if we searched for the archive and this is the first included
7472 object.
7473
4dbfafcc
ILT
74742010-12-01 Ian Lance Taylor <iant@google.com>
7475
7476 * dwarf_reader.h (class Sized_dwarf_line_info): Add
7477 track_relocs_type_ field.
7478 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7479 Set track_relocs_type_.
7480 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
7481 contents when using RELA relocs.
7482 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
7483 reloc_map_.
7484 * reloc.cc (Track_relocs::next_addend): New function.
7485 * reloc.h (class Track_relocs): Declare next_addend.
7486
e5e19edd
ILT
74872010-12-01 Ian Lance Taylor <iant@google.com>
7488
7489 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
7490 virtual destructor.
7491
9a5ce24c
ILT
74922010-12-01 Ian Lance Taylor <iant@google.com>
7493
7494 * README: Update compilers known to work and fail.
7495
c7791212
NC
74962010-11-23 Matthias Klose <doko@ubuntu.com>
7497
7498 * configure.in: For --enable-gold, handle value `default' instead of
7499 `both*'. Always install ld as ld.bfd, install as ld if gold is
7500 not the default.
7501 * configure: Regenerate.
7502
0ad220c9
DK
75032010-11-18 Doug Kwan <dougkwan@google.com>
7504
7505 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
7506 and right_alignment to be zero. Store result alignment only if it is
7507 greater than existing alignment.
7508
ab8056e0
CC
75092010-11-16 Cary Coutant <ccoutant@google.com>
7510
7511 PR gold/12220
7512 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7513 Check for ".zdebug_line".
7514
fd064a5b
CC
75152010-11-16 Doug Kwan <dougkwan@google.com>
7516 Cary Coutant <ccoutant@google.com>
7517
7518 * output.h (Output_segment::set_section_addresses): Pass increase_relro
7519 by reference; adjust all callers.
7520 * output.cc (Output_segment::set_section_addresses): Adjust references
7521 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
7522 list is empty.
7523 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
7524 end at page boundary.
7525
6fc6ea19
CC
75262010-11-16 Cary Coutant <ccoutant@google.com>
7527
7528 PR gold/12220
7529 * layout.cc (Layout::choose_output_section): Transform names of
7530 compressed sections even when using a script with a SECTIONS clause.
7531 (Layout::output_section_name): Remove code to transform
7532 compressed debug section names.
7533 * output.cc (Output_section::add_input_section): Use uncompressed
7534 section size when tracking input sections.
7535
95a2c8d6
RS
75362010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
7537
7538 * symtab.h (Symbol::NON_PIC_REF): Remove.
7539 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
7540 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
7541 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
7542 (Symbol::use_plt_offset): Take a flags argument and pass it
7543 directly to needs_dynamic_reloc. Restrict check for undefined
7544 weak symbols to function calls.
7545 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
7546 (Target_arm::Scan::global): Use it.
7547 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
7548 (Target_arm::Relocate::relocate): Likewise.
7549 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
7550 parameter with an r_type parameter. Use get_reference_flags
7551 to get the flags.
7552 (Target_arm::Relocate::relocate): Update accordingly.
7553 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
7554 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
7555 (Target_i386::Scan::global): Likewise.
7556 (Target_i386::Relocate::relocate): Likewise.
7557 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
7558 parameter with an r_type parameter. Use get_reference_flags
7559 to get the flags.
7560 (Target_i386::Relocate::relocate): Update accordingly.
7561 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
7562 (Target_powerpc::Scan::global): Use it.
7563 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
7564 (Target_powerpc::Relocate::relocate): Likewise.
7565 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
7566 (Target_sparc::Scan::global): Use it.
7567 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
7568 (Target_sparc::Relocate::relocate): Likewise.
7569 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
7570 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
7571 (Target_x86_64::Scan::global): Likewise.
7572 (Target_x86_64::Relocate::relocate): Likewise.
7573
f625ae50
DK
75742010-11-08 Doug Kwan <dougkwan@google.com>
7575 Cary Coutant <ccoutant@google.com>
7576
7577 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
7578 (Arm_exidx_merge_section::section_contents_): New data member.
7579 (Arm_input_section::Arm_input_section): Initialize original_contents_.
7580 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 7581 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
7582 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
7583 in parameters instead of calling Object::section_contents without
7584 locking.
7585 (Arm_output_section::group_section): New parameter TASK. Pass it
7586 to callees that need locking objects.
7587 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
7588 to lock EXIDX input sections. Fix a formatting issue. Call
7589 Arm_exidx_merged_section::build_contents to create merged section
7590 contents.
7591 (Arm_output_section::create_stub_group): New parameter TASK. Use it
7592 to lock object of stub table owner.
7593 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
7594 TEXT_SIZE to initialize data member TEXT_SIZE_.
7595 (Arm_exidx_input_section::addralign): Fix typo in comment.
7596 (Arm_exidx_input_section::text_size): New method.
7597 (Target_arm::do_relax): New parameter TASK. Pass it to callees
7598 that require locking objects. Lock objects before scanning for stubs
7599 and updating local symbols.
7600 (Arm_input_section<big_endian>::init): Copy contents of original
7601 input section.
2e702c99 7602 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
7603 original input section instead of calling Object::section_contents
7604 without locking.
7605 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
7606 size without calling Object::section_size().
7607 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
7608 for size. Allocate a buffer for merged EXIDX entries.
7609 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 7610 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
7611 building code to Arm_exidx_merged_section::build_contetns. Write
7612 out contetns in buffer instead of building it on the fly.
7613 (Arm_relobj::make_exidx_input_section): Also pass text section size
7614 to Arm_exidx_input_section constructor.
7615 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
7616 (Arm_dynobj::do_read_symbols): Fix memory leak.
7617 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
7618 * target.h: (class Task): Add forward declaration.
7619 (Target::relax): Add new parameter TASK and pass it to
7620 Target::do_relax().
7621 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
7622
5f9bcf58
CC
76232010-11-05 Cary Coutant <ccoutant@google.com>
7624
7625 PR gold/10708
7626 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
7627 object when reading from the file.
7628 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
7629 second layout pass.
7630 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
7631 when reading section contents.
7632 (get_section_contents): Likewise.
7633 (icf::find_identical_sections): Likewise.
7634 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
7635 object when reading from the file.
7636 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
7637 the object when doing deferred section layout.
7638
e597fa08
NC
76392010-11-03 Nick Clifton <nickc@redhat.com>
7640
7641 PR gold/12001
7642 * script.h (class Symbol_assignment: name): New member. Returns
7643 the name of the symbol.
7644 * scrfipt.cc (Script_options::is_pending_assignment): New member.
7645 Returns true if the given symbol name is on the list of
7646 assignments wating to be processed.
7647 * archive.cc (should_incldue_member): If the symbol is undefined,
7648 check to see if it is on the list of symbols pending assignment.
7649
3f9a3278
ILT
76502010-11-03 Ryan Mansfield <rmansfield@qnx.com>
7651
7652 * script-sections.cc (Script_sections::find_memory_region): Check
7653 for a NULL output section pointer.
7654
d06fb4d1
DK
76552010-10-29 Doug Kwan <dougkwan@google.com>
7656
7657 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
7658 Output_section::add_relaxed_input_section.
7659 * output.cc (Output_section::add_relaxed_input_section): Add new
7660 arguments LAYOUT and NAME. Set section order index.
7661 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7662 Copy section order index.
7663 * output.h (Output_section::add_relaxed_input_section): Add new
7664 arguments LAYOUT and NAME.
7665
90e24de5
ILT
76662010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7667
7668 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 7669 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
7670 * testsuite/Makefile.in: Regenerate.
7671
c9484ea5
DK
76722010-10-20 Doug Kwan <dougkwan@google.com>
7673
7674 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
7675 without SHF_LINK_ORDER flags.
7676 * layout.cc (Layout::choose_output_section): Do not filter
7677 SHF_LINK_ORDER flag in a relocatable link.
7678
5bc2f5be
CC
76792010-10-17 Cary Coutant <ccoutant@google.com>
7680
7681 * output.h (Output_segment::set_section_addresses): Change function
7682 signature. Update all callers.
7683 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
7684 sections.
7685 (Output_segment::set_section_addresses): Align after last TLS
7686 section. Add padding before last relro section instead of after.
7687
0c91cf04
DK
76882010-10-17 Doug Kwan <dougkwan@google.com>
7689
7690 * gold/arm.cc (Target_arm::got_section): Use correct order and set
7691 GOT output section to be writable.
7692
8c21d9d3
CC
76932010-10-14 Cary Coutant <ccoutant@google.com>
7694
7695 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
7696 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
7697 * gold.cc (queue_initial_tasks): Check parameters for incremental link
7698 mode.
7699 * incremental.cc (report_command_line): Ignore all forms of
7700 --incremental.
7701 * layout.cc (Layout::Layout): Check parameters for incremental link
7702 mode.
7703 * options.cc (General_options::parse_incremental): New function.
7704 (General_options::parse_no_incremental): New function.
7705 (General_options::parse_incremental_full): New function.
7706 (General_options::parse_incremental_update): New function.
7707 (General_options::incremental_mode_): New data member.
7708 (General_options::finalize): Check incremental_mode_.
7709 * options.h (General_options): Update help text for --incremental.
7710 Add --no-incremental, --incremental-full, --incremental-update.
7711 (General_options::Incremental_mode): New enum type.
7712 (General_options::incremental_mode): New function.
7713 (General_options::incremental_mode_): New data member.
7714 * parameters.cc (Parameters::incremental_mode_): New data member.
7715 (Parameters::set_options): Set incremental_mode_.
7716 (Parameters::set_incremental_full): New function.
7717 (Parameters::incremental): New function.
7718 (Parameters::incremental_update): New function.
7719 (set_parameters_incremental_full): New function.
7720 * parameters.h (Parameters::set_incremental_full): New function.
7721 (Parameters::incremental): New function.
7722 (Parameters::incremental_update): New function.
7723 (Parameters::incremental_mode_): New data member.
7724 (set_parameters_incremental_full): New function.
7725 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
7726 incremental link mode.
7727 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
7728 (Sized_relobj::do_relocate_sections): Likewise.
7729 * testsuite/Makefile.am (incremental_test): Use --incremental-full
7730 option.
7731 * testsuite/Makefile.in: Regenerate.
7732 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 7733
bb32aa18 77342010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
7735
7736 * script-sections.h (class Script_sections): Make
7737 Sections_elements typedef public.
7738 * script-sections.cc (class Sort_output_sections): Add elements_
7739 field. Add constructor which sets it; change all callers.
7740 (Sort_output_sections::is_before): New function.
7741 (Sort_output_sections::operator()): Call is_before.
7742 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
7743 conditional.
7744 * testsuite/script_test_10.sh: New test. Test script section
7745 order.
7746 * testsuite/script_test_10.t: Likewise.
7747 * testsuite/script_test_10.s: Likewise.
7748 * testsuite/Makefile.am: Wrap the cross linker tests and the
7749 common tests into NATIVE_OR_CROSS_LINKER.
7750 (check_SCRIPTS): Add script_test_10.sh.
7751 (check_DATA): Add script_test_10.stdout.
7752 (script_test_10.o, script_test_10): New targets.
7753 (script_test_10.stdout): New target.
7754 * configure, testsuite/Makefile.in: Regenerate.
7755
3cef7179
ILT
77562010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7757
7758 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
7759 error for the deprecated relocations.
7760 (Target_arm::Scan::global): Likewise.
7761 (Target_arm::Relocate::relocate): Likewise.
7762
7411e9a8
RS
77632010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
7764
7765 * fileread.cc (Input_file::find_file): Initialize *found_name
7766 and *namep when using the fallback search for case 4.
7767
6a9da32a
CC
77682010-10-11 Cary Coutant <ccoutant@google.com>
7769
7770 * options.h (class General_options): Redefine -z lazy as an alias for
7771 the negation of -z now.
7772
ac897c20
ILT
77732010-10-11 Ian Lance Taylor <iant@google.com>
7774
7775 * resolve.cc (symbol_to_bits): Report the value of the unsupported
7776 binding.
7777
ea5cae92
NC
77782010-10-06 Nick Clifton <nickc@redhat.com>
7779
7780 * script-sections.cc(class Memory_region): Remove
7781 current_lma_offset_ field. Rename current_vma_offset_ to
7782 current_offset_. Add last_section_ field.
7783 (Memory_region::get_current_vma_address): Rename to
7784 get_current_address.
7785 (Memory_region::get_current_lma_address): Delete.
7786 (Memory_region::increment_vma_offset): Rename to
7787 increment_offset.
7788 (Memory_region::increment_lma_offset): Delete.
7789 (Memory_region::attributes_compatible): New method. Returns
7790 true if the provided section is compatible with the region.
7791 (Memory_region::get_last_section): New method. Returns the last
7792 section to use the region.
7793 (Memory_region::set_last_section): New method. Stores the last
7794 section to use the region.
7795 (Script_sections::block_in_region): New method. Returns true if
7796 a block of memory is contained within a region.
7797 (Script_sections::find_memory_region): New method. Locates a
7798 memory region to be used to set a VMA or LMA address.
7799 (Output_section_definition::set_section_addresses): Add code to
7800 check for addresses set by memory regions.
7801 (Output_segment::set_section_addresses): Remove memory region
7802 walking code.
7803 (Script_sections::create_segment): Add a warning if a header
7804 segment is created outside of any region.
7805 * script-sections.h (class Script_sections): Add prototypes for
7806 find_memory_region and block_in_region methods.
7807 * testsuite/memory_test.s: Use .long instead of .word.
7808 * testsuite/memory_test.t: Add some more output sections.
7809 * testsuite/memory_test.sh: Update expected output.
7810
a9bfd952
DK
78112010-10-02 Doug Kwan <dougkwan@google.com>
7812
7813 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
7814 defintion to symtab.h
7815 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
7816 declaration to defintion.
7817
bacff3ab
NC
78182010-10-01 Nick Clifton <nickc@redhat.com>
7819
7820 * expression.cc (eval): Replace dummy argument with NULL.
7821 (eval_maybe_dot): Check for a NULL result section pointer.
7822 (Symbol_expression::value): Likewise.
7823 (Dot_expression::value): Likewise.
7824 (BINARY_EXPRESSION): Likewise.
7825 (Max_expression::value): Likewise.
7826 (Min_expression::value): Likewise.
7827 (Absolute_expression::value): Likewise.
7828 (Addr_expression::value_from_output_section): Likewise.
7829 (Loaddddr_expression::value_from_output_section): Likewise.
7830 (Segment_start_expression::value): Likewise.
7831 * script-sections.cc
7832 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
7833 argument with NULL.
7834 (Sections_elememt_dot_assignment::set_section_addresses):
7835 Likewise.
7836 (Output_data_expression::do_write_to_buffer): Likewise.
7837 (Output_section_definition::finalize_symbols): Likewise.
7838 (Output_section_definition::set_section_addresses): Likewise.
7839
f81bc8b5
DK
78402010-09-30 Doug Kwan <dougkwan@google.com>
7841
7842 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
7843
c95e9f27
ST
78442010-09-28 Sriraman Tallam <tmsriram@google.com>
7845
7846 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 7847 function.
c95e9f27
ST
7848 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
7849 virtual function.
7850 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
7851 virtual function.
7852 * icf.cc (get_section_contents): Inline merge sections only when
7853 target allows it.
7854
3cac54d2
RW
78552010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7856
7857 * configure: Regenerate.
7858
2904037a
ILT
78592010-09-17 Ian Lance Taylor <iant@google.com>
7860
7861 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
7862 * testsuite/Makefile.am (memory_test.o): New target.
7863 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
7864 memory_test.t.
7865 * testsuite/Makefile.in: Rebuild.
2904037a 7866
bca7fb63
DK
78672010-09-17 Doug Kwan <dougkwan@google.com>
7868
7869 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
7870 defintion if relocation uses GOT entries of the symbol.
7871 * testsuite/icf_safe_test.sh: Fix test.
7872 * testsuite/icf_safe_so_test.sh: Fix test.
7873
4ef28648
CC
78742010-09-16 Cary Coutant <ccoutant@google.com>
7875
7876 * script_sections.cc (class Memory_region): Remove "NULL" from
7877 vector initializations.
7878
793990de
CC
78792010-09-15 Cary Coutant <ccoutant@google.com>
7880
7881 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
7882 Resolve forwarding symbols.
7883
81e015e2
DK
78842010-09-15 Doug Kwan <dougkwan@google.com>
7885
7886 * gold/testsuite/script_test_3.t: Add ARM special sections.
7887 * gold/testsuite/script_test_4.t: Same.
7888 * gold/testsuite/script_test_5.t: Same.
7889 * gold/testsuite/script_test_6.t: Same.
7890 * gold/testsuite/script_test_7.t: Same.
7891 * gold/testsuite/script_test_7.t: Same.
7892 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
7893
36171d64
CC
78942010-09-14 Cary Coutant <ccoutant@google.com>
7895
7896 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
7897 (Target_x86_64::Relocate::relocate_tls): Replace check for
7898 saw_tls_block_reloc_ with test for executable section.
7899
d89051bd
CC
79002010-09-12 Cary Coutant <ccoutant@google.com>
7901
7902 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
7903 position-independent executables to shared libraries need dynamic
7904 relocations.
7905 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
7906 position-independent executables.
7907 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
7908 * testsuite/Makefile.in: Regenerate.
7909
fca41f0f
NC
79102010-09-10 Nick Clifton <nickc@redhat.com>
7911
7912 PR gold/11997
7913 * testsuite/memory_test.t: Discard any sections that are not
7914 needed.
7915
6695e4b3
L
79162010-09-09 H.J. Lu <hongjiu.lu@intel.com>
7917
7918 PR gold/11996
7919 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
7920 "This::" to work around a bug in gcc 4.2.
7921
7922 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
7923
0f72bf6f
RÁE
79242010-09-09 Rafael Espindola <espindola@google.com>
7925
7926 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
7927 sections with different PF_X flags in the same segment.
7928 (Layout::find_first_load_seg): Search all segments to find the first
7929 one.
7930 * options.h (rosegment): New.
7931
79322010-09-08 Rafael Espindola <espindola@google.com>
a6577478 7933
05a79166 7934 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 7935
aa98ff75
DK
79362010-09-08 Doug Kwan <dougkwan@google.com>
7937
7938 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
7939 (Arm_relobj::do_relocate_sections): Add new parameter for output
7940 file to match the parent.
7941 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
7942 of local symbols instead of input values. Update code to track
7943 changes in gold::relocate_section.
7944 * object.cc (Sized_relobj::compute_final_local_value): New methods.
7945 (Sized_relobj::compute_final_local_value_internal): New methods.
7946 (Sized_relobj::do_finalize_local_symbols): Move code from loop
7947 body into private version of Sized_relobj::compute_final_local_value.
7948 Call the inline method.
7949 * object.h (Symbol_value::Symbol_value): Define destructor. Free
7950 merged symbol value if there is one.
7951 (Symbol_value::has_output_value): New method defintiion.
7952 (Sized_relobj::Compute_final_local_value_status): New enum type.
7953 (Sized_relobj::compute_final_local_value): New methods.
7954 (Sized_relobj::compute_final_local_value_internal): New methods.
7955 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
7956 and arm_cortex_a8.sh.
7957 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
7958 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
7959 New tests.
7960 * Makefile.in: Regenerate.
7961 * testsuite/arm_bl_out_of_range.s: Update test.
7962 * testsuite/thumb_bl_out_of_range.s: Ditto.
7963 * testsuite/thumb_blx_out_of_range.s: Ditto.
7964 * testsuite/arm_branch_out_of_range.sh: New file.
7965 * testsuite/arm_cortex_a8.sh: Ditto.
7966 * testsuite/arm_cortex_a8_b.s: Ditto.
7967 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
7968 * testsuite/arm_cortex_a8_b_local.s: Ditto.
7969 * testsuite/arm_cortex_a8_bl.s: Ditto.
7970 * testsuite/arm_cortex_a8_blx.s: Ditto.
7971 * testsuite/arm_cortex_a8_local.s: Ditto.
7972 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
7973 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
7974
05a79166
L
79752010-09-08 Rafael Espindola <espindola@google.com>
7976
7977 * Makefile.am (memory_test.stdout): Run readelf with -W.
7978 * Makefile.in: Regenerate.
7979 * testsuite/memory_test.sh: Make the regexps accept both 32 and
7980 64 bit output.
7981
33dbc701
RÁE
79822010-09-08 Rafael Espindola <espindola@google.com>
7983
7984 * script-sections.cc (Script_sections::add_memory_region): Convert
7985 field precision to int.
7986 * script.cc (script_set_section_region, script_set_section_region):
7987 Convert field precision to int.
7988
731ca54a
RÁE
79892010-09-08 Rafael Espindola <espindola@google.com>
7990
7991 * arm.cc (do_finalize_sections): Create the __exidx_start and
7992 __exdix_end symbols even when the section is missing.
7993
7f8cd844
NC
79942010-09-08 Nick Clifton <nickc@redhat.com>
7995
7996 * README: Remove claim that MEMORY is not supported.
7997 * expression.cc (script_exp_function_origin)
7998 (script_exp_function_length): Move from here to ...
7999 * script.cc: ... here.
8000 (script_set_section_region, script_add_memory)
8001 (script_parse_memory_attr, script_include_directive): New
8002 functions.
8003 * script-sections.cc
8004 (class Memory_region): New class.
8005 (class Output_section_definition): Add set_memory_region,
8006 set_section_vma, set_section_lma and get_section_name methods.
8007 (class Script_Sections): Add add_memory_region,
8008 find_memory_region, find_memory_region_origin,
8009 find_memory_region_length and set_memory_region methods.
8010 Have set_section_addresses method walk the list of set memory
8011 regions.
8012 Extend the print methos to display memory regions.
8013 * script-sections.h: Add prototypes for new methods.
8014 Add enum for MEMORY region attributes.
8015 * yyscript.y: Add support for parsing MEMORY regions.
8016 * script-c.h: Add prototypes for new functions.
8017 * testsuite/Makefile.am: Add test of MEMORY region functionality.
8018 * testsuite/Makefile.in: Regenerate.
8019 * testsuite/memory_test.sh: New script.
8020 * testsuite/memory_test.s: New assembler source file.
8021 * testsuite/memory_test.t: New linker script.
8022
a4649286
DK
80232010-08-27 Doug Kwan <dougkwan@google.com>
8024
8025 * gold/resolve.cc (Symbol_table::should_override): Let a weak
8026 reference override an existing dynamic weak reference.
8027 * testsuite/Makefile.am: Add new test dyn_weak_ref.
8028 * testsuite/Makefile.in: Regenerate.
8029 * testsuite/dyn_weak_ref.sh: New file.
8030 * testsuite/dyn_weak_ref_1.c: Ditto.
8031 * testsuite/dyn_weak_ref_2.c: Ditto.
8032
b56648ad
ILT
80332010-08-27 Ian Lance Taylor <iant@google.com>
8034
8035 * incremental.h (class Incremental_input_entry): Add virtual
8036 destructor.
8037
809313cb
ILT
80382010-08-27 Ian Lance Taylor <iant@google.com>
8039
8040 * testsuite/start_lib_test_3.c: Mark t3 as used.
8041
11e32464
NC
80422010-08-27 Nick Clifton <nickc@redhat.com>
8043
8044 * options.cc (version_script): Fix small typo in previous
8045 whitespace tidyup.
8046
ca09d69a
NC
80472010-08-25 Nick Clifton <nickc@redhat.com>
8048
8049 * archive.cc: Formatting fixes: Remove whitespace between
8050 typename and following asterisk. Remove whitespace between
8051 function name and opening parenthesis.
8052 * archive.h: Likewise.
8053 * arm.cc: Likewise.
8054 * attributes.cc: Likewise.
8055 * attributes.h: Likewise.
8056 * common.cc: Likewise.
8057 * copy-relocs.cc: Likewise.
8058 * dirsearch.h: Likewise.
8059 * dynobj.cc: Likewise.
8060 * ehframe.cc: Likewise.
8061 * ehframe.h: Likewise.
8062 * expression.cc: Likewise.
8063 * fileread.cc: Likewise.
8064 * fileread.h: Likewise.
8065 * gc.h: Likewise.
8066 * gold-threads.cc: Likewise.
8067 * gold.cc: Likewise.
8068 * i386.cc: Likewise.
8069 * icf.h: Likewise.
8070 * incremental-dump.cc: Likewise.
8071 * incremental.cc: Likewise.
8072 * layout.cc: Likewise.
8073 * layout.h: Likewise.
8074 * main.cc: Likewise.
8075 * merge.cc: Likewise.
8076 * merge.h: Likewise.
8077 * object.cc: Likewise.
8078 * object.h: Likewise.
8079 * options.cc: Likewise.
8080 * options.h: Likewise.
8081 * output.cc: Likewise.
8082 * output.h: Likewise.
8083 * plugin.cc: Likewise.
8084 * plugin.h: Likewise.
8085 * powerpc.cc: Likewise.
8086 * reloc.cc: Likewise.
8087 * script-c.h: Likewise.
8088 * script-sections.cc: Likewise.
8089 * script.cc: Likewise.
8090 * stringpool.cc: Likewise.
8091 * symtab.cc: Likewise.
8092 * symtab.h: Likewise.
8093 * target.cc: Likewise.
8094 * timer.cc: Likewise.
8095 * timer.h: Likewise.
8096 * version.cc: Likewise.
8097 * x86_64.cc: Likewise.
8098
b8fa8750
NC
80992010-08-24 Nick Clifton <nickc@redhat.com>
8100
8101 PR 11899
8102 * layout.cc (segment_precedes): Sort segments by their physical
8103 addresses, if they have been set.
8104
9919d93b
CC
81052010-08-23 Cary Coutant <ccoutant@google.com>
8106
8107 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
8108 symbols data.
8109 (Lib_group::include_member): Unlock object after deleting its
8110 symbols data.
8111 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
8112 the bug fixed here.
8113
97b4be1c
CC
81142010-08-19 Neil Vachharajani <nvachhar@google.com>
8115 Cary Coutant <ccoutant@google.com>
8116
8117 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
8118 constructor, and set_blocker.
8119 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
8120 readsyms_blocker_.
8121 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
8122 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
8123 * testsuite/Makefile.am (start_lib_test): New test case.
8124 * testsuite/Makefile.in: Regenerate.
8125 * testsuite/start_lib_test_main.c: New file.
8126 * testsuite/start_lib_test_1.c: New file.
8127 * testsuite/start_lib_test_2.c: New file.
8128 * testsuite/start_lib_test_3.c: New file.
8129
dd0b1884
ILT
81302010-08-19 Ian Lance Taylor <iant@google.com>
8131
8132 * Makefile.in: Rebuild with automake 1.11.1.
8133 * aclocal.m4: Likewise.
8134 * testsuite/Makefile.in: Likewise.
8135
7223e9ca
ILT
81362010-08-19 Ian Lance Taylor <iant@google.com>
8137
8138 PR 10893
8139 * i386.cc (class Output_data_plt_i386): Update declarations.
8140 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
8141 local_ifuncs_ fields.
8142 (Target_i386::do_plt_section_for_global): New function.
8143 (Target_i386::do_plt_section_for_local): New function.
8144 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
8145 parameter; change all callers. Initialize global_ifuncs_ and
8146 local_ifuncs_. If doing a static link define __rel_iplt_start and
8147 __rel_iplt_end.
8148 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
8149 (Output_data_plt_i386::add_local_ifunc_entry): New function.
8150 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
8151 symbols.
8152 (Target_i386::make_plt_section): New function, broken out of
8153 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
8154 (Target_i386::make_plt_entry): Call make_plt_section.
8155 (Target_i386::make_local_ifunc_plt_entry): New function.
8156 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
8157 (Target_i386::Scan::local): Handle IFUNC symbols. Add
8158 R_386_IRELATIVE to switch.
8159 (Target_i386::Scan::global): Likewise.
8160 (Target_i386::Relocate::relocate): Likewise.
8161 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
8162 switch.
8163 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
8164 (Target_x86_64::do_plt_section_for_global): New function.
8165 (Target_x86_64::do_plt_section_for_local): New function.
8166 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
8167 parameter; change all callers. If doing a static link define
8168 __rela_iplt_start and __rela_iplt_end.
8169 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
8170 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
8171 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
8172 to point to .plt.
8173 (Target_x86_64::make_local_ifunc_plt_entry): New function.
8174 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
8175 switch.
8176 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
8177 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
8178 R_X86_64_IRELATIVE to switch.
8179 (Target_x86_64::Scan::global): Likewise.
8180 (Target_x86_64::Relocate::relocate): Likewise.
8181 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
8182 switch.
8183 * target.h (class Target): Add plt_section_for_global and
8184 plt_section_for_local functions. Add do_plt_section_for_global
8185 and do_plt_section_for_local virtual functions.
8186 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
8187 clarifying comments.
8188 (Symbol::use_plt_offset): Handle IFUNC symbol.
8189 * object.cc (Sized_relobj::Sized_relobj): Initialize
8190 local_plt_offsets_.
8191 (Sized_relobj::local_has_plt_offset): New function.
8192 (Sized_relobj::local_plt_offset): New function.
8193 (Sized_relobj::set_local_plt_offset): New function.
8194 (Sized_relobj::do_count): Handle IFUNC symbol.
8195 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
8196 a bit away from input_shndx_ field. Add set_is_func_symbol and
8197 is_ifunc_symbol functions.
8198 (class Sized_relobj): Update declarations. Remove Tls_got_entry
8199 and Local_tls_got_offsets. Define Local_plt_offsets. Add
8200 local_plt_offsets_ field.
8201 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
8202 * output.h (class Output_section_data): Add non-const
8203 output_section function.
8204 (class Output_data_got): Update declarations.
8205 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
8206 Add use_plt_offset parameter to global and local constructors.
8207 Change all callers. Change local_sym_index_ field to 31 bits.
8208 Change GSYM_CODE and CONSTANT_CODE accordingly.
8209 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
8210 doing a static link don't set sh_link field.
8211 (Output_data_got::Got_entry::write): Use PLT offset if
8212 appropriate.
8213 (Output_data_got::add_global_plt): New function.
8214 (Output_data_got::add_local_plt): New function.
8215 * target-reloc.h (relocate_section): Handle IFUNC symbol.
8216 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
8217 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
8218 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
8219 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
8220 IFUNC conditional.
8221 * testsuite/ifunc-sel.h: New file.
8222 * testsuite/ifuncmain1.c: New file.
8223 * testsuite/ifuncmain1vis.c: New file.
8224 * testsuite/ifuncmod1.c: New file.
8225 * testsuite/ifuncdep2.c: New file.
8226 * testsuite/ifuncmain2.c: New file.
8227 * testsuite/ifuncmain3.c: New file.
8228 * testsuite/ifuncmod3.c: New file.
8229 * testsuite/ifuncmain4.c: New file.
8230 * testsuite/ifuncmain5.c: New file.
8231 * testsuite/ifuncmod5.c: New file.
8232 * testsuite/ifuncmain6pie.c: New file.
8233 * testsuite/ifuncmod6.c: New file.
8234 * testsuite/ifuncmain7.c: New file.
8235 * configure, testsuite/Makefile.in: Rebuild.
8236
56f75c03
ILT
82372010-08-18 Ian Lance Taylor <iant@google.com>
8238
8239 * incremental.cc
8240 (Output_section_incremental_inputs::write_input_files): Add cast
8241 to avoid signed/unsigned comparison warning.
8242 (Output_section_incremental_inputs::write_info_blocks): Likewise.
8243
55455f89
CC
82442010-08-12 Cary Coutant <ccoutant@google.com>
8245
8246 * common.cc (Sort_commons::operator()): Remove unnecessary code.
8247
e2054bcb
ILT
82482010-08-13 Ian Lance Taylor <iant@google.com>
8249
8250 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
8251
74f67560
DK
82522010-08-12 Cary Coutant <ccoutant@google.com>
8253 Doug Kwan <dougkwan@google.com>
8254
8255 * resolve.cc (Symbol_table::should_override): When a weak dynamic
8256 defintion overrides non-weak undef, remember that the original undef
8257 is not weak.
8258 * symtab.cc (Symbol_table::sized_write_global): For undef without
8259 an original weak binding, set binding to global in output.
8260 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
8261 * testsuite/Makefile.in: Regenerate.
8262 * testsuite/strong_ref_weak_def.sh: New file.
8263 * testsuite/strong_ref_weak_def_1.c: Ditto.
8264 * testsuite/strong_ref_weak_def_2.c: Ditto.
8265
d1238d12
CC
82662010-08-12 Cary Coutant <ccoutant@google.com>
8267
8268 * testsuite/incremental_test.sh: Rewrite.
8269 * testsuite/incremental_test_1.c: Rewrite.
8270 * testsuite/incremental_test_2.c: Rewrite.
8271
0e70b911
CC
82722010-08-12 Cary Coutant <ccoutant@google.com>
8273
8274 * arm.cc (Target_arm::got_size): Add const.
8275 (Target_arm::got_entry_count): New function.
8276 (Target_arm::plt_entry_count): New function.
8277 (Target_arm::first_plt_entry_offset): New function.
8278 (Target_arm::plt_entry_size): New function.
8279 (Output_data_plt_arm::entry_count): New function.
8280 (Output_data_plt_arm::first_plt_entry_offset): New function.
8281 (Output_data_plt_arm::get_plt_entry_size): New function.
8282 * i386.cc (Target_i386::got_size): Add const.
8283 (Target_i386::got_entry_count): New function.
8284 (Target_i386::plt_entry_count): New function.
8285 (Target_i386::first_plt_entry_offset): New function.
8286 (Target_i386::plt_entry_size): New function.
8287 (Output_data_plt_i386::entry_count): New function.
8288 (Output_data_plt_i386::first_plt_entry_offset): New function.
8289 (Output_data_plt_i386::get_plt_entry_size): New function.
8290 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
8291 find_incremental_inputs_sections. Dump incremental_got_plt section.
8292 * incremental.cc: Include target.h.
8293 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
8294 parameter. Adjust all callers. Find incremental_got_plt section.
8295 (Incremental_inputs::create_data_sections): Create incremental_got_plt
8296 section.
8297 (Output_section_incremental_inputs::set_final_data_size): Calculate
8298 size of incremental_got_plt section.
8299 (Output_section_incremental_inputs::do_write): Write the
8300 incremental_got_plt section.
8301 (Got_plt_view_info): New struct.
8302 (Local_got_offset_visitor): New class.
8303 (Global_got_offset_visitor): New class.
8304 (Global_symbol_visitor_got_plt): New class.
8305 (Output_section_incremental_inputs::write_got_plt): New function.
8306 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
8307 Add parameter. Adjust all callers.
8308 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8309 (Incremental_inputs::got_plt_section): New function.
8310 (Incremental_inputs::got_plt_section_): New data member.
8311 (Incremental_got_plt_reader): New class.
8312 * layout.cc (Layout::create_incremental_info_sections): Add the
8313 incremental_got_plt section.
8314 * object.h (Got_offset_list::get_list): New function.
8315 (Got offset_list::for_all_got_offsets): New function.
8316 (Sized_relobj::local_got_offset_list): New function.
8317 * powerpc.cc (Target_powerpc::got_size): Add const.
8318 (Target_powerpc::got_entry_count): New function.
8319 (Target_powerpc::plt_entry_count): New function.
8320 (Target_powerpc::first_plt_entry_offset): New function.
8321 (Target_powerpc::plt_entry_size): New function.
8322 (Output_data_plt_powerpc::entry_count): New function.
8323 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
8324 (Output_data_plt_powerpc::get_plt_entry_size): New function.
8325 * sparc.cc (Target_sparc::got_size): Add const.
8326 (Target_sparc::got_entry_count): New function.
8327 (Target_sparc::plt_entry_count): New function.
8328 (Target_sparc::first_plt_entry_offset): New function.
8329 (Target_sparc::plt_entry_size): New function.
8330 (Output_data_plt_sparc::entry_count): New function.
8331 (Output_data_plt_sparc::first_plt_entry_offset): New function.
8332 (Output_data_plt_sparc::get_plt_entry_size): New function.
8333 * symtab.h (Symbol::got_offset_list): New function.
8334 (Symbol_table::for_all_symbols): New function.
8335 * target.h (Sized_target::got_entry_count): New function.
8336 (Sized_target::plt_entry_count): New function.
8337 (Sized_target::plt_entry_size): New function.
8338 * x86_64.cc (Target_x86_64::got_size): Add const.
8339 (Target_x86_64::got_entry_count): New function.
8340 (Target_x86_64::plt_entry_count): New function.
8341 (Target_x86_64::first_plt_entry_offset): New function.
8342 (Target_x86_64::plt_entry_size): New function.
8343 (Output_data_plt_x86_64::entry_count): New function.
8344 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
8345 (Output_data_plt_x86_64::get_plt_entry_size): New function.
8346
09ec0418
CC
83472010-08-12 Cary Coutant <ccoutant@google.com>
8348
8349 * archive.cc: Include incremental.h.
8350 (Archive::Archive): Initialize incremental_info_.
8351 (Archive::include_member): Record archive members in incremental info.
8352 (Add_archive_symbols::run): Record begin and end of an archive in
8353 incremental info.
8354 (Lib_group::include_member): Record objects in incremental info.
8355 * archive.h (Incremental_archive_entry): Forward declaration.
8356 (Archive::set_incremental_info): New member function.
8357 (Archive::incremental_info): New member function.
8358 (Archive::Unused_symbol_iterator): New class.
8359 (Archive::unused_symbols_begin): New member function.
8360 (Archive::unused_symbols_end): New member function.
8361 (Archive::incremental_info_): New data member.
8362 * incremental-dump.cc (find_input_containing_global): New function.
8363 (dump_incremental_inputs): Dump new incremental info sections.
8364 * incremental.cc: Include symtab.h.
8365 (Output_section_incremental_inputs): New class.
8366 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
8367 new incremental info sections.
8368 (Sized_incremental_binary::do_check_inputs): Likewise.
8369 (Incremental_inputs::report_archive): Remove.
8370 (Incremental_inputs::report_archive_begin): New function.
8371 (Incremental_inputs::report_archive_end): New function.
8372 (Incremental_inputs::report_object): New function.
8373 (Incremental_inputs::finalize_inputs): Remove.
8374 (Incremental_inputs::report_input_section): New function.
8375 (Incremental_inputs::report_script): Rewrite.
8376 (Incremental_inputs::finalize): Do nothing but finalize string table.
8377 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8378 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8379 (Incremental_inputs::create_data_sections): New function.
8380 (Incremental_inputs::relocs_entsize): New function.
8381 (Output_section_incremental_inputs::set_final_data_size): New function.
8382 (Output_section_incremental_inputs::do_write): New function.
8383 (Output_section_incremental_inputs::write_header): New function.
8384 (Output_section_incremental_inputs::write_input_files): New function.
8385 (Output_section_incremental_inputs::write_info_blocks): New function.
8386 (Output_section_incremental_inputs::write_symtab): New function.
8387 * incremental.h (Incremental_script_entry): Forward declaration.
8388 (Incremental_object_entry): Forward declaration.
8389 (Incremental_archive_entry): Forward declaration.
8390 (Incremental_inputs): Forward declaration.
8391 (Incremental_inputs_header_data): Remove.
8392 (Incremental_inputs_header): Remove.
8393 (Incremental_inputs_header_write): Remove.
8394 (Incremental_inputs_entry_data): Remove.
8395 (Incremental_inputs_entry): Remove.
8396 (Incremental_inputs_entry_write): Remove.
8397 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
8398 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
8399 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8400 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
8401 Likewise.
8402 (Incremental_input_entry): New class.
8403 (Incremental_script_entry): New class.
8404 (Incremental_object_entry): New class.
8405 (Incremental_archive_entry): New class.
8406 (Incremental_inputs::Incremental_inputs): Initialize new data members.
8407 (Incremental_inputs::report_inputs): Remove.
8408 (Incremental_inputs::report_archive): Remove.
8409 (Incremental_inputs::report_archive_begin): New function.
8410 (Incremental_inputs::report_archive_end): New function.
8411 (Incremental_inputs::report_object): Change prototype.
8412 (Incremental_inputs::report_input_section): New function.
8413 (Incremental_inputs::report_script): Change prototype.
8414 (Incremental_inputs::get_reloc_count): New function.
8415 (Incremental_inputs::set_reloc_count): New function.
8416 (Incremental_inputs::create_data_sections): New function.
8417 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8418 (Incremental_inputs::inputs_section): New function.
8419 (Incremental_inputs::symtab_section): New function.
8420 (Incremental_inputs::relocs_section): New function.
8421 (Incremental_inputs::get_stringpool): Add const.
8422 (Incremental_inputs::command_line): Add const.
8423 (Incremental_inputs::inputs): Remove.
8424 (Incremental_inputs::command_line_key): New function.
8425 (Incremental_inputs::input_file_count): New function.
8426 (Incremental_inputs::input_files): New function.
8427 (Incremental_inputs::relocs_entsize): New function.
8428 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8429 (Incremental_inputs::finalize_inputs): Remove.
8430 (Incremental_inputs::Input_info): Remove.
8431 (Incremental_inputs::lock_): Remove.
8432 (Incremental_inputs::inputs_): Change type.
8433 (Incremental_inputs::inputs_map_): Remove.
8434 (Incremental_inputs::current_object_entry_): New data member.
8435 (Incremental_inputs::inputs_section_): New data member.
8436 (Incremental_inputs::symtab_section_): New data member.
8437 (Incremental_inputs::relocs_section_): New data member.
8438 (Incremental_inputs::reloc_count_): New data member.
8439 (Incremental_inputs_reader): New class.
8440 (Incremental_symtab_reader): New class.
8441 (Incremental_relocs_reader): New class.
8442 * layout.cc (Layout::finalize): Move finalization of incremental info
8443 and creation of incremental info sections to follow finalization of
8444 symbol table. Set offsets for postprocessing sections.
8445 (Layout::create_incremental_info_sections): Call
8446 Incremental_inputs::create_data_sections. Add incremental symtab
8447 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
8448 sections to layout after input sections.
8449 * layout.h (struct Timespec): Forward declaration.
8450 (Layout::incremental_inputs): Add const.
8451 (Layout::create_incremental_info_sections): Add parameter.
8452 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
8453 * object.cc: Include incremental.h.
8454 (Relobj::finalize_incremental_relocs): New function.
8455 (Sized_relobj::do_layout): Record input sections in incremental info.
8456 * object.h (Object::output_section): New function.
8457 (Object::output_section_offset): Moved from Relobj.
8458 (Object::get_incremental_reloc_base): New function.
8459 (Object::get_incremental_reloc_count): New function.
8460 (Object::do_output_section): New function.
8461 (Object::do_output_section_offset): Moved from Relobj.
8462 (Object::do_get_incremental_reloc_base): New function.
8463 (Object::do_get_incremental_reloc_count): New function.
8464 (Object::Object): Initialize new data members.
8465 (Relobj::output_section): Renamed do_output_section and moved to
8466 protected.
8467 (Relobj::output_section_offset): Moved to Object.
8468 (Relobj::do_get_incremental_reloc_base): New function.
8469 (Relobj::do_get_incremental_reloc_count): New function.
8470 (Relobj::allocate_incremental_reloc_counts): New function.
8471 (Relobj::count_incremental_reloc): New function.
8472 (Relobj::finalize_incremental_relocs): New function.
8473 (Relobj::next_incremental_reloc_index): New function.
8474 (Relobj::reloc_counts_): New data member.
8475 (Relobj::reloc_bases_): New data member.
8476 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
8477 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
8478 (Sized_relobj::incremental_relocs_scan): New function.
8479 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8480 (Sized_relobj::incremental_relocs_write): New function.
8481 (Sized_relobj::incremental_relocs_write_reltype): New function.
8482 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
8483 incremental link.
8484 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
8485 archives and object files elsewhere.
8486 (Add_symbols::run): Report object files here.
8487 (Finish_group::run): Report end of archive at end of group.
8488 * reloc.cc: Include layout.h, incremental.h.
8489 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
8490 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
8491 (Sized_relobj::incremental_relocs_scan): New function.
8492 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8493 (Sized_relobj::do_relocate_sections): Write incremental relocations.
8494 (Sized_relobj::incremental_relocs_write): New function.
8495 (Sized_relobj::incremental_relocs_write_reltype): New function.
8496 * script.cc (read_input_script): Rewrite test for incremental link.
8497 Change call to Incremental_inputs::report_script.
8498 * symtab.h (Symbol_table::first_global_index): New function.
8499 (Symbol_table::output_count): New function.
8500
ce0d1972
DK
85012010-08-12 Doug Kwan <dougkwan@google.com>
8502
8503 * arm.cc (Target_arm::merge_object_attributes): Check command line
8504 options --no-wchar-size-warning and --no-enum-size-warning.
8505 * options.h (General_options): Add ld-compatible options
8506 --no-enum-size-warning and --no-wchar-size-warning.
8507
6e5710ce
ILT
85082010-08-04 Ian Lance Taylor <iant@google.com>
8509
8510 * x86_64.cc (Target_x86_64::Scan::local): Use
8511 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
8512 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
8513 (Target_x86_64::Scan::global): Likewise.
8514 (Target_x86_64::Relocate::relocate): Likewise.
8515 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
8516 Likewise.
8517
fef830db
CC
85182010-08-03 Cary Coutant <ccoutant@google.com>
8519
8520 * merge.cc (Output_merge_string::do_add_input_section): Count strings
8521 to reserve space in merged_strings vector. Keep total input size
8522 for stats.
8523 (Output_merge_string::do_print_merge_stats): Print total input size.
8524 * merge.h (Output_merge_string): Add input_size_ field.
8525 * stringpool.cc (Stringpool_template::string_length): Move
8526 implementations out of Stringpool_template class and place in
8527 stringpool.h.
8528 * stringpool.h (string_length): Move out of Stringpool_template.
8529
1e3811b0
ILT
85302010-08-03 Ian Lance Taylor <iant@google.com>
8531
8532 PR 11712
8533 * layout.cc (relaxation_loop_body): If address of load segment is
8534 set, adjust address to include headers if possible.
8535
7af0c620
ILT
85362010-08-03 Ian Lance Taylor <iant@google.com>
8537
8538 * version.cc (version_string): Bump to 1.10.
8539
22f0da72
ILT
85402010-08-03 Ian Lance Taylor <iant@google.com>
8541
8542 PR 11805
8543 * layout.h (enum Output_section_order): Define.
8544 (class Layout): Update declarations.
8545 * layout.cc (Layout::get_output_section): Add order parameter.
8546 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
8547 is_first_non_relro parameters. Change all callers.
8548 (Layout::choose_output_section): Likewise.
8549 (Layout::add_output_section_data): Likewise.
8550 (Layout::make_output_section): Likewise. Set order.
8551 (Layout::default_section_order): New function.
8552 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
8553 * output.cc (Output_section::Output_section): Initialize order_.
8554 Don't initialize deleted fields.
8555 (Output_segment::Output_segment): Don't initialize deleted
8556 fields.
8557 (Output_segment::add_output_section_to_load): New function
8558 replacing add_output_section. Change all callers to call this or
8559 add_output_section_to_nonload.
8560 (Output_segment::add_output_section_to_nonload): New function.
8561 (Output_segment::remove_output_section): Rewrite.
8562 (Output_segment::add_initial_output_data): Likewise.
8563 (Output_segment::has_any_data_sections): Likewise.
8564 (Output_segment::is_first_section_relro): Likewise.
8565 (Output_segment::maximum_alignment): Likewise.
8566 (Output_segment::has_dynamic_reloc): New function replacing
8567 dynamic_reloc_count. Change all callers.
8568 (Output_segment::has_dynamic_reloc_list): New function replacing
8569 dynamic_reloc_count_list. Change all callers.
8570 (Output_segment::set_section_addresses): Rewrite.
8571 (Output_segment::set_offset): Rewrite.
8572 (Output_segment::find_first_and_last_list): Remove.
8573 (Output_segment::set_tls_offsets): Rewrite.
8574 (Output_segment::first_section_load_address): Likewise.
8575 (Output_segment::output_section_count): Likewise.
8576 (Output_segment::section_with_lowest_load_address): Likewise.
8577 (Output_segment::write_section_headers): Likewise.
8578 (Output_segment::print_sections_to_map): Likewise.
8579 * output.h (class Output_data): Remove dynamic_reloc_count_
8580 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
8581 (Output_data::add_dynamic_reloc): Rewrite.
8582 (Output_data::has_dynamic_reloc): New function.
8583 (Output_data::dynamic_reloc_count): Remove.
8584 (class Output_section): Add order_ field. Remvoe is_relro_local_,
8585 is_last_relro_, is_first_non_relro_, is_interp_,
8586 is_dynamic_linker_section_ fields. Add order and set_order
8587 functions. Remove is_relro_local, set_is_relro_local,
8588 is_last_relro, set_is_last_relro, is_first_non_relro,
8589 set_is_first_non_relro functions, is_interp, set_is_interp,
8590 is_dynamic_linker_section, and set_is_dynamic_linker_section
8591 functions.
8592 (class Output_segment): Change Output_data_list from std::list to
8593 std:;vector. Add output_lists_ field. Remove output_data_ and
8594 output_bss_ fields. Update declarations.
8595
3ff2ccb0
ILT
85962010-08-02 Ian Lance Taylor <iant@google.com>
8597
8598 * arm.cc (Target_arm::gc_process_relocs): Use typename.
8599 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
8600 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
8601
88a4108b
ILT
86022010-08-02 Ian Lance Taylor <iant@google.com>
8603
8604 PR 11855
8605 * script.cc (Script_options::Script_options): Initialize
8606 symbol_definitions_ and symbol_references_.
8607 (Script_options::add_symbol_assignment): Update
8608 symbol_definitions_ and symbol_references_.
8609 (Script_options::add_symbol_reference): New function.
8610 (script_symbol): New function.
8611 * script.h (class Script_options): Add symbol_definitions_ and
8612 symbol_references_ fields.
8613 (Script_options::referenced_const_iterator): New type.
8614 (Script_options::referenced_begin): New function.
8615 (Script_options::referenced_end): New function.
8616 (Script_options::is_referenced): New function.
8617 (Script_options::any_unreferenced): New function.
8618 * script-c.h (script_symbol): Declare.
8619 * yyscript.y (exp): Call script_symbol.
8620 * symtab.cc: Include "script.h".
8621 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
8622 Change all callers. Check symbols referenced by scripts.
8623 (Symbol_table::add_undefined_symbols_from_command_line): Add
8624 layout parameter. Change all callers.
8625 (Symbol_table::do_add_undefined_symbols_from_command_line):
8626 Likewise. Break out loop body. Check symbols referenced by
8627 scripts.
8628 (Symbol_table::add_undefined_symbol_from_command_line): New
8629 function broken out of
8630 do_add_undefined_symbols_from_command_line.
8631 * symtab.h (class Symbol_table): Update declarations.
8632 * archive.cc: Include "layout.h".
8633 (Archive::should_include_member): Add layout parameter. Change
8634 all callers. Check for symbol mentioned in expression.
8635 * archive.h (class Archive): Update declaration.
8636 * object.cc (Sized_relobj::do_should_include_member): Add layout
8637 parameter.
8638 * object.h (Object::should_include_member): Add layout parameter.
8639 Change all callers.
8640 (Object::do_should_include_member): Add layout parameter.
8641 (class Sized_relobj): Update declaration.
8642 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
8643 parameter.
8644 * dynobj.h (class Sized_dynobj): Update declaration.
8645 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
8646 layout parameter.
8647 * plugin.h (class Sized_pluginobj): Update declaration.
8648
5f1ab67a
ILT
86492010-08-02 Ian Lance Taylor <iant@google.com>
8650
8651 PR 11866
8652 * output.cc (Output_segment::set_offset): Search for the first and
8653 last sections rather than assuming that the list is in order.
8654 (Output_segment::find_first_and_last_list): New function.
8655 * output.h (class Output_segment): Update declarations.
8656 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
8657 (relro_strip_test_SOURCES): New variable.
8658 (relro_strip_test_DEPENDENCIES): New variable.
8659 (relro_strip_test_LDFLAGS): New variable.
8660 (relro_strip_test_LDADD): New variable.
8661 (relro_strip_test.so): New target.
8662
a8df5856
ILT
86632010-08-02 Ian Lance Taylor <iant@google.com>
8664
8665 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
8666 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
8667 (Target_i386::got_tlsdesc_section): New function.
8668 (Target_i386::got_section): Create space for GOT entries for
8669 TLSDESC relocations.
8670 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
8671 R_386_TLS_GOTDESC.
8672 (Target_i386::Scan::global): Likewise.
8673 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
8674 using TLSDESC GOT.
8675 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
8676 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
8677 (Target_x86_64::got_tlsdesc_section): New function.
8678 (Target_x86_64::got_section): Create space for GOT entries for
8679 TLSDESC relocations.
8680 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
8681 R_386_TLS_GOTDESC.
8682 (Target_x86_64::Scan::global): Likewise.
8683 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
8684 using TLSDESC GOT.
8685
0c10a0a6
ILT
86862010-08-02 Ian Lance Taylor <iant@google.com>
8687
8688 * testsuite/final_layout.sh: Use dc to convert from hex to
8689 decimal.
8690
41cbeecc
ST
86912010-07-29 Sriraman Tallam <tmsriram@google.com>
8692
8693 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
8694 paramter to the call to gold::gc_process_relocs.
8695 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
8696 paramter to the call to gold::gc_process_relocs.
8697 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
8698 parameter to the call to gold::gc_process_relocs.
8699 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
8700 template parameter to the call to gold::gc_process_relocs.
8701 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
8702 paramter to the call to gold::gc_process_relocs.
8703 * gc.h (get_embedded_addend_size): New function.
8704 (gc_process_relocs): Save the size of the reloc for use by ICF.
8705 * icf.cc (get_section_contents): Get the addend from the text section
8706 for SHT_REL relocation sections.
8707 * icf.h (Icf::Reloc_addend_size_info): New typedef.
8708 (Icf::Reloc_info): Add new member reloc_addend_size_info.
8709 * int_encoding.h (read_from_pointer): New overloaded function.
8710 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
8711 * testsuite/icf_sht_rel_addend_test.sh: New file.
8712 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
8713 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
8714
6ea55b82
RW
87152010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8716
8717 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
8718 * Makefile.in: Regenerate.
8719 * testsuite/Makefile.in: Regenerate.
8720
9691462b
ILT
87212010-07-27 Jeffrey Yasskin <jyasskin@google.com>
8722
8723 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
8724 * gold/testsuite/debug_msg.cc: Likewise.
8725 * gold/testsuite/odr_violation1.cc
8726 * gold/testsuite/odr_violation2.cc
8727
76897331
CC
87282010-07-21 Cary Coutant <ccoutant@google.com>
8729
8730 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
8731 string, and length fields.
8732 (Output_merge_string::Merged_strings_list): New type.
8733 (Output_merge_string::Merged_strings_lists): New typedef.
8734 (Output_merge_string): Replace merged_strings_ with
8735 merged_strings_lists_.
8736 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
8737 Merged_strings_list per input object and section. Don't store pointer
8738 to the string. Don't store length with each merged string entry.
8739 (Output_merge_string::finalize_merged_data): Loop over list of merged
8740 strings lists. Recompute length of each merged string.
8741
78384e8f
CC
87422010-07-15 Cary Coutant <ccoutant@google.com>
8743
8744 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
8745 here.
8746
783659f9
ILT
87472010-07-14 Ian Lance Taylor <iant@google.com>
8748
8749 * descriptors.cc (Descriptors::open): Report correct name in error
8750 message.
8751
131687b4
DK
87522010-07-13 Doug Kwan <dougkwan@google.com>
8753
8754 * arm.cc (Arm_input_section::Arm_input_section): For a
8755 SHT_ARM_EXIDX section, always keeps the input sections.
8756 (Arm_input_section::set_exidx_section_link): New method.
8757 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
8758 has_errors_ to false.
8759 (Arm_exidx_input_section::has_errors,
8760 Arm_exidx_input_section::set_has_errors): New methods.
8761 (Arm_exidx_input_section::has_errors_): New data member.
8762 (Arm_relobj::get_exidx_shndx_list): New method.
8763 (Arm_output_section::append_text_sections_to_list): Do not skip
8764 section without SHF_EXECINSTR.
8765 (Arm_output_section::fix_exidx_coverage): Skip input sections with
8766 errors.
2e702c99 8767 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
8768 section header. Make error messages more verbose. Check for
8769 a non-executable section linked to an EXIDX section.
8770 (Arm_relobj::do_read_symbols): Remove error checking, which has been
8771 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
8772 check that there is no deferred EXIDX section if we exit early.
8773 Instead of not making an EXIDX section in case of an error, make one
8774 and set the has_errors flag of it.
8775 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
8776 in a relocatable link.
8777 (Target_arm::do_relax): Look for the EXIDX output section instead of
8778 assuming that it is called .ARM.exidx.
2e702c99 8779 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
8780 section list. Do not check for SHF_EXECINSTR section flags but
8781 skip any input section with errors.
8782 * output.cc (Output_section::Output_section): Initialize
8783 always_keeps_input_sections_ to false.
8784 (Output_section::add_input_section): Check for
8785 always_keeps_input_sections_.
8786 * output.h (Output_section::always_keeps_input_sections,
8787 Output_section::set_always_keeps_input_sections): New methods.
8788 (Output_section::always_keeps_input_sections): New data member.
8789
69517287
RÁE
87902010-07-13 Rafael Espindola <espindola@google.com>
8791
8792 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
8793 * fileread.h (Input_file): Add try_extra_search_path and find_file.
8794
82742395
ILT
87952010-07-13 Philip Herron <herron.philip@googlemail.com>
8796 Ian Lance Taylor <iant@google.com>
8797
8798 * output.h (Output_section_lookup_maps::add_merge_section):
8799 Correct check of whether value was inserted.
8800 (Output_section_lookup_maps::add_merge_input_section): Likewise.
8801 (Output_section_lookup_maps::add_relaxed_input_section):
8802 Likewise.
8803 * arm.cc (Target_arm::got_section): Remove used local os.
8804 * i386.cc (Target_i386::got_section): Likewise.
8805 * x86_64.cc (Target_x86_64::got_section): Likewise.
8806 * sparc.cc (Target_sparc::got_section): Likewise.
8807 (Target_sparc::relocate): Remove unused local have_got_offset.
8808 * powerpc.cc (Target_powerpc::relocate): Likewise.
8809
f2d707b5
ILT
88102010-07-13 Ian Lance Taylor <iant@google.com>
8811
241531d6
ILT
8812 * compressed_output.cc (zlib_decompress): Fix signature in
8813 !HAVE_ZLIB_H case.
8814
f2d707b5
ILT
8815 * archive.cc (Archive::include_member): Unlock an external member
8816 of a thin archive. Don't bother to delete an object we know is
8817 NULL.
8818
a2e47362
CC
88192010-07-12 Cary Coutant <ccoutant@google.com>
8820
8821 * compressed_output.cc (zlib_decompress): New function.
8822 (get_uncompressed_size): New function.
8823 (decompress_input_section): New function.
8824 * compressed_output.h (get_uncompressed_size): New function.
8825 (decompress_input_section): New function.
8826 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
8827 Handle compressed debug sections.
8828 * layout.cc (is_compressed_debug_section): New function.
8829 (Layout::output_section_name): Map compressed section names to
8830 canonical names.
8831 * layout.h (is_compressed_debug_section): New function.
8832 (is_debug_info_section): Recognize compressed debug sections.
8833 * merge.cc: Include compressed_output.h.
8834 (Output_merge_data::do_add_input_section): Handle compressed
8835 debug sections.
8836 (Output_merge_string::do_add_input_section): Handle compressed
8837 debug sections.
8838 * object.cc: Include compressed_output.h.
8839 (Sized_relobj::Sized_relobj): Initialize new data members.
8840 (build_compressed_section_map): New function.
8841 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
8842 * object.h (Object::section_is_compressed): New method.
8843 (Object::do_section_is_compressed): New method.
8844 (Sized_relobj::Compressed_section_map): New type.
8845 (Sized_relobj::do_section_is_compressed): New method.
8846 (Sized_relobj::compressed_sections_): New data member.
8847 * output.cc (Output_section::add_input_section): Handle compressed
8848 debug sections.
8849 * reloc.cc: Include compressed_output.h.
8850 (Sized_relobj::write_sections): Handle compressed debug sections.
8851
ce279a62
CC
88522010-07-08 Cary Coutant <ccoutant@google.com>
8853
8854 * resolve.cc (Symbol_table::resolve): Remember whether undef was
8855 weak when resolving to a dynamic def.
8856 (Symbol_table::should_override): Add adjust_dyndef flag; set it
8857 for weak undef/dynamic def cases. Adjust callers.
8858 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
8859 undef_binding_weak_.
8860 (Symbol_table::sized_write_globals): Adjust symbol binding.
8861 (Symbol_table::sized_write_symbol): Add binding parameter.
8862 * symtab.h (Symbol::set_undef_binding): New method.
8863 (Symbol::is_undef_binding_weak): New method.
8864 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
8865 (Symbol_table::should_override): Add new parameter.
8866 (Symbol_table::sized_write_symbol): Add new parameter.
8867
8868 * testsuite/weak_undef_file1.cc: Add new test case.
8869 * testsuite/weak_undef_file2.cc: Fix header comment.
8870 * testsuite/weak_undef_test.cc: Add new test case.
8871
b2286c10
DK
88722010-06-29 Doug Kwan <dougkwan@google.com>
8873
8874 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
8875 Initialize USE_SYMBOL_.
8876 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
8877 definition.
8878 (Arm_reloc_property::uses_symbol_): New data member declaration.
8879 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
8880 uses symbol value and symbol is undefined but not weakly undefined.
8881
4802450a
RÁE
88822010-06-28 Rafael Espindola <espindola@google.com>
8883
8884 * plugin.cc (Plugin::load): Use dlerror.
8885
e5ca47ba
ILT
88862010-06-26 Jeffrey Yaskin <jyasskin@google.com>
8887
8888 * symtab.cc (detect_odr_violations): When reporting an ODR
8889 violation, report an object where the symbol is defined.
8890
8a75a161
DK
88912010-06-25 Doug Kwan <dougkwan@google.com>
8892
8893 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
8894 (Target_arm::section_may_have_icf_unsafe_pointers): New method
8895 definition.
8896 (Target_arm::Scan::local_reloc_may_be_function_pointer,
8897 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
8898 target hook to detect function points.
8899 (Target_arm::Scan::possible_function_pointer_reloc): New method.
8900 * icf.h (Icf::check_section_for_function_pointers): Change type of
8901 parameter SECTION_NAME to const reference to std::string. Use
8902 target hook to determine if section may have unsafe pointers.
8903 * target.h (Target::section_may_have_icf_unsafe_pointers): New
8904 method definition.
8905
42218b9f
RÁE
89062010-06-21 Rafael Espindola <espindola@google.com>
8907
8908 * fileread.cc (Input_file::find_fie): New
8909 (Input_file::open): Use Input_file::find_fie.
8910 * fileread.h (Input_file::find_fie): New
8911 * plugin.cc (set_extra_library_path): New.
8912 (Plugin::load): Add set_extra_library_path to the transfer vector.
8913 (Plugin_manager::set_extra_library_path): New.
8914 (Plugin_manager::add_input_file): Use the extra search path if set.
8915 (set_extra_library_path(): New.
8916 * plugin.h (Plugin_manager): Add set_extra_library_path and
8917 extra_search_path_.
8918
a0506cca
CC
89192010-06-19 Cary Coutant <ccoutant@google.com>
8920
8921 * layout.cc (gdb_sections): Add .debug_types.
8922 (lines_only_debug_sections): Likewise.
8923
6508b958
RÁE
89242010-06-18 Rafael Espindola <espindola@google.com>
8925
8926 * plugin.cc (add_input_file,add_input_library)
8927 (Plugin_manager::add_input_file): Make filename arguments const.
8928 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
8929 const.
8930
3e235302
DK
89312010-06-16 Doug Kwan <dougkwan@google.com>
8932
8933 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
8934 .ARM.attributes section if we have not merged any input
8935 attributes sections.
8936
106e8a6c
DK
89372010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8938
8939 * arm.cc: Allow combining objects with no EABI version
8940 information.
8941
91ff43fe
RÁE
89422010-06-15 Rafael Espindola <espindola@google.com>
8943
8944 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
8945
68ed838c
ILT
89462010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8947
8948 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
8949 (struct iovec): Correct !HAVE_READV definition.
8950
f3a2388f
CC
89512010-06-10 Cary Coutant <ccoutant@google.com>
8952
8953 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
8954 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
8955 reloc sections.
8956 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
8957
8958 PR 11683
8959 * symtab.h (Symbol::is_placeholder): New member function.
8960 * target-reloc.h (relocate_section): Check for placeholder symbols.
8961
8962 * testsuite/Makefile.am (plugin_test_8): New test.
8963 (plugin_test_9): New test.
8964 * testsuite/Makefile.in: Regenerate.
8965
e1df38aa
NC
89662010-06-09 Nick Clifton <nickc@redhat.com>
8967
8968 * yyscript.y (input_list_element): Allow strings prefixed with
8969 the '-' character. Treat these as libraries.
8970 * script.cc (script_add_library): New function. Adds a library
8971 specified by "-l<name>" found in an input script.
8972 * script-c.h: Add prototype for script_add_library.
8973
25bbe950
DK
89742010-06-07 Doug Kwan <dougkwan@google.com>
8975
8976 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
8977 Restrict stub-group size to be within long conditional branch
8978 range when working around cortex-A8 erratum.
8979
0f32ea4c
ILT
89802010-06-07 Damien Diederen <dd@crosstwine.com>
8981
8982 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
8983 #ifdef typo.
8984
8fe2a369
ST
89852010-06-03 Sriraman Tallam <tmsriram@google.com>
8986
8987 PR gold/11658
8988 * output.cc
8989 (Output_section::Input_section_sort_entry::compare_section_ordering):
8990 Change to return non-zero correctly.
8991 (Output_section::Input_section_sort_section_order_index_compare
8992 ::operator()): Change to fix ambiguity in comparisons.
8993
6e9ba2ca
ST
89942010-06-01 Sriraman Tallam <tmsriram@google.com>
8995
8996 * gold.h (is_wildcard_string): New function.
8997 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
8998 (Layout::layout_eh_frame): Ditto.
8999 (Layout::find_section_order_index): New method.
9000 (Layout::read_layout_from_file): New method.
9001 * layout.h (Layout::find_section_order_index): New method.
9002 (Layout::read_layout_from_file): New method.
9003 (Layout::input_section_position_): New private member.
9004 (Layout::input_section_glob_): New private member.
9005 * main.cc (main): Call read_layout_from_file here.
9006 * options.h (--section-ordering-file): New option.
9007 * output.cc (Output_section::input_section_order_specified_): New
9008 member.
9009 (Output_section::Output_section): Initialize new member.
9010 (Output_section::add_input_section): Add new parameter.
9011 Keep input sections when --section-ordering-file is used.
9012 (Output_section::set_final_data_size): Sort input sections when
9013 section ordering file is specified.
9014 (Output_section::Input_section_sort_entry): Add new parameter.
9015 Check sorting type.
9016 (Output_section::Input_section_sort_entry::compare_section_ordering):
9017 New method.
9018 (Output_section::Input_section_sort_compare::operator()): Change to
9019 consider section_order_index.
9020 (Output_section::Input_section_sort_init_fini_compare::operator()):
9021 Change to consider section_order_index.
9022 (Output_section::Input_section_sort_section_order_index_compare
9023 ::operator()): New method.
9024 (Output_section::sort_attached_input_sections): Change to sort
9025 according to section order when specified.
e1df38aa
NC
9026 (Output_section::add_input_section<32, true>): Add new parameter.
9027 (Output_section::add_input_section<64, true>): Add new parameter.
9028 (Output_section::add_input_section<32, false>): Add new parameter.
9029 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
9030 * output.h (Output_section::add_input_section): Add new parameter.
9031 (Output_section::input_section_order_specified): New
9032 method.
9033 (Output_section::set_input_section_order_specified): New method.
9034 (Input_section::Input_section): Initialize section_order_index_.
9035 (Input_section::section_order_index): New method.
9036 (Input_section::set_section_order_index): New method.
9037 (Input_section::section_order_index_): New member.
9038 (Input_section::Input_section_sort_section_order_index_compare): New
9039 struct.
9040 (Output_section::input_section_order_specified_): New member.
9041 * script-sections.cc (is_wildcard_string): Delete and move modified
9042 method to gold.h.
9043 (Output_section_element_input::Output_section_element_input): Modify
9044 call to is_wildcard_string.
9045 (Output_section_element_input::Input_section_pattern
9046 ::Input_section_pattern): Ditto.
9047 (Output_section_element_input::Output_section_element_input): Ditto.
9048 * testsuite/Makefile.am (final_layout): New test case.
9049 * testsuite/Makefile.in: Regenerate.
9050 * testsuite/final_layout.cc: New file.
9051 * testsuite/final_layout.sh: New file.
9052
3537c84b
RÁE
90532010-06-01 Rafael Espindola <espindola@google.com>
9054
9055 * plugin.cc (Plugin::load): Pass the output name to the plugin.
9056
105b6afd
RÁE
90572010-06-01 Rafael Espindola <espindola@google.com>
9058
9059 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
9060 visibility of symbols.
9061
29e11421
DK
90622010-05-27 Doug Kwan <dougkwan@google.com>
9063
9064 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
9065 from start of output section instead of address for a local symbol
9066 in a merged or relaxed section when doing a relocatable link.
9067
5e0f337e
RÁE
90682010-05-26 Rafael Espindola <espindola@google.com>
9069
703d02da 9070 PR 11604
5e0f337e
RÁE
9071 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
9072 adding sections the garbage collector removed.
9073 * gold/testsuite/Makefile.am: Add test.
9074 * gold/testsuite/Makefile.in: Regenerate.
9075 * gold/testsuite/plugin_test_7.sh: New.
9076 * gold/testsuite/plugin_test_7_1.c: New.
9077 * gold/testsuite/plugin_test_7_2.c: New.
9078
f4187277
RÁE
90792010-05-26 Rafael Espindola <espindola@google.com>
9080
9081 * script-sections.cc (Output_section_definition::set_section_addresses):
9082 Check for --section-start.
9083
5c388529
DK
90842010-05-26 Doug Kwan <dougkwan@google.com>
9085
9086 * arm.cc (Arm_scan_relocatable_relocs): New class.
9087 (Target_arm::relocate_special_relocatable): New method.
9088 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
9089 (Arm_relocate_functions::thumb_branch_common): Same.
9090 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
9091 instead of Default_scan_relocatable_relocs.
9092 * target-reloc.h (relocate_for_relocatable): Let target handle
9093 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
9094 * target.h (Sized_target::relocate_special_relocatable): New method.
9095
bca1c3ae
ILT
90962010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9097
9098 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
9099
0439c796
DK
91002010-05-23 Doug Kwan <dougkwan@google.com>
9101
9102 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
9103 instead of a cast.
9104 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
9105 with a direct branch, not a conditional branch, to a stub.
9106 * merge.cc (Output_merge_base::record_input_section): New method
9107 defintion.
9108 (Output_merge_data::do_add_input_section): Record input section if
9109 keeps-input-sections flag is set.
9110 (Output_merge_string::do_add_input_section): Ditto.
9111 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
9112 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
9113 INPUT_SECTIONS_.
9114 (Output_merge_base::keeps_input_sections,
9115 Output_merge_base::set_keeps_input_sections,
9116 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
9117 method definitions.
9118 (Output_merge_base::Input_sections): New type declaration.
9119 (Output_merge_base::input_sections_begin,
9120 Output_merge_base::input_sections_end,
9121 Output_merge_base::do_set_keeps_input_sections): New method definitions.
9122 (Output_merge_base::bool keeps_input_sections_,
9123 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
9124 Output_merge_base::input_sections_): New data members.
9125 (Output_merge_data::do_set_keeps_input_sections): New method
9126 defintion.
9127 (Output_merge_string::do_set_keeps_input_sections): Ditto.
9128 * output.cc (Output_section::Input_section::relobj): Move method
9129 defintion from class declaration to here and handle merge sections.
9130 (Output_section::Input_section::shndx): Ditto.
9131 (Output_section::Output_section): Remove initializations of removed
9132 data members and initialize new data member LOOKUP_MAPS_.
9133 (Output_section::add_input_section): Set keeps-input-sections flag
9134 for a newly created merge output section as appropriate. Adjust code
9135 to use Output_section_lookup_maps class.
9136 (Output_section::add_relaxed_input_section): Adjst code for lookup
9137 maps code refactoring.
2e702c99 9138 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
9139 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
9140 class. If adding input section to a newly created merge output
9141 section fails, remove the new merge section.
9142 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 9143 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 9144 (Output_section::find_merge_section): Ditto.
0439c796 9145 (Output_section::build_lookup_maps): New method defintion.
2e702c99 9146 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
9147 Output_section_lookup_maps class.
9148 (Output_section::get_input_sections): Export merge sections. Adjust
9149 code to use Output_section_lookup_maps class.
9150 (Output_section:::add_script_input_section): Adjust code to use
9151 Output_section_lookup_maps class. Update lookup maps for merge
9152 sections also.
9153 (Output_section::discard_states): Use Output_section_lookup_maps.
9154 (Output_section::restore_states): Same.
9155 * output.h (Merge_section_properties): Move class defintion out of
9156 Output_section.
9157 (Output_section_lookup_maps): New class.
9158 (Output_section::Input_section::is_merge_section): New method
9159 defintion.
9160 (Output_section::Input_section::relobj): Move defintion out of class
9161 defintion. Declare method only.
9162 (Output_section::Input_section::shndx): Ditto.
9163 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 9164 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
9165 (Output_section::Merge_section_by_properties_map,
9166 Output_section::Output_section_data_by_input_section_map,
9167 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
9168 Remove types.
2e702c99 9169 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
9170 KEEPS_INPUT_SECTIONS.
9171 (Output_section::build_lookup_maps): New method declaration.
9172 (Output_section::merge_section_map_,
9173 Output_section::merge_section_by_properties_map_,
9174 Output_section::relaxed_input_section_map_,
9175 Output_section::is_relaxed_input_section_map_valid_): Remove data
9176 members.
9177 (Output_section::lookup_maps_): New data member.
9178
76295588
L
91792010-05-21 Doug Kwan <dougkwan@google.com>
9180
9181 PR gold/11619
9182 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
9183 avoid a compilation error.
9184
d103a984
RÁE
91852010-05-19 Rafael Espindola <espindola@google.com>
9186
9187 * script-sections.cc (Output_section_definition::allocate_to_segment):
9188 Update the phdrs_list even when the output section is NULL.
9189 * testsuite/Makefile.am: Add test.
9190 * testsuite/Makefile.in: Regenerate.
9191 * testsuite/script_test_9.cc: New.
9192 * testsuite/script_test_9.sh: New.
9193 * testsuite/script_test_9.t: New.
9194
6625d24e
DK
91952010-05-19 Doug Kwan <dougkwan@google.com>
9196
9197 * arm.cc (Arm_input_section::original_size): New method.
9198 (Arm_input_section::do_addralign): Add a cast.
9199 (Arm_input_section::do_output_offset): Remove static cast.
9200 (Arm_input_section::original_addralign,
9201 Arm_input_section::original_size_): Change type to uint32_t.
9202 (Arm_input_section::init): Add safe casts for section alignment
9203 and size.
9204 (Arm_input_section::set_final_data_size): Do not set address and
9205 offset of stub table.
9206 (Arm_output_section::fix_exidx_coverage): Change use of of
9207 Output_section::Simple_input_section to that of
9208 Output_section::Input_section.
9209 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
9210 except for the first pass.
9211 * output.cc (Output_section::get_input_sections): Change type of
9212 input_sections to std::list<Input_section>.
9213 (Output_section::add_script_input_section): Rename from
9214 Output_section::add_simple_input_section. Change type of SIS
9215 parameter from Simple_input_section to Input_section.
9216 * output.h (Output_section::Simple_input_section): Remove class.
9217 (Output_section::Input_section): Change class visibility to public.
9218 (Output_section::Input_section::addralign): Use stored alignments
9219 for special input sections if set.
9220 (Output_section::Input_section::set_addralign): New method.
9221 (Output_section::get_input_sections): Change parameter type from
9222 list of Simple_input_section to list of Input_section.
9223 (Output_section::add_script_input_section): Rename from
9224 Output_section::add_simple_input_section. Change first parameter's
9225 type from Simple_input_section to Input_section and remove the
9226 second and third parameters.
9227 * script-sections.cc (Input_section::Input_section_list): Change
9228 type to list of Output_section::Input_section/
9229 (Input_section_info::Input_section_info): Change parameter type of
9230 INPUT_SECTION to Output_section::Input_section.
9231 (Input_section_info::input_section): Change return type.
9232 (Input_section_info::input_section_): Change type to
9233 Output_section::Input_section.
9234 (Output_section_element_input::set_section_addresses): Adjust code
9235 to use Output_section::Input_section instead of
9236 Output_section::Simple_input_section. Adjust code for renaming
9237 of Output_section::add_simple_input_section.
9238 (Orphan_output_section::set_section_addresses): Ditto.
9239
e1e82ea4
RW
92402010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9241
9242 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
9243 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
9244
91e75c8a
RÁE
92452010-05-18 Rafael Espindola <espindola@google.com>
9246
9247 * options.cc (General_options::finalize): Handle -nostdlib.
9248 * options.h (nostdlib): New option.
9249 * script.cc (script_add_search_dir): Handle -nostdlib.
9250
da59ad79
DK
92512010-05-12 Doug Kwan <dougkwan@google.com>
9252
9253 * arm.cc (Target_arm::do_finalize_sections): Create an empty
9254 attributes section only if there no attributes section after merging.
9255 (Target_arm::merge_object_attributes): Move value of
e1df38aa 9256 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
9257 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
9258 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
9259 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
9260 and arm_attr_merge_7.stdout.
9261 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
9262 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
9263 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
9264 arm_attr_merge_7b.o): New rules.
9265 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
9266 arm_attr_merge_7
9267 * testsuite/Makefile.in: Regenerate.
9268 * testsuite/arm_attr_merge.sh: New file.
9269 * testsuite/arm_attr_merge_[67][ab].s: Same.
9270
3e01a7fd
NC
92712010-05-05 Nick Clifton <nickc@redhat.com>
9272
9273 * po/es.po: Updated Spanish translation.
9274
7ad2014a
L
92752010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9276
9277 * Makefile.am (install-exec-local): Properly install gold as
9278 default cross linker.
9279 * Makefile.in: Regenerated.
9280
4fda8867
NC
92812010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9282 Nick Clifton <nickc@redhat.com>
9283
9284 * configure.ac (install_as_default): Define and set to false
9285 unless --enable-gold or --enable-gold=both/gold has been
9286 specified.
9287 * configure: Regenerate.
9288
9289 * Makefile.am (install-exec-local): Install the executable as
9290 'ld.gold'. If install_as_default is true then also install it as
9291 'ld'.
9292 * Makefile.in: Regenerated.
9293
bd288ea2
ILT
92942010-04-24 Ian Lance Taylor <iant@google.com>
9295
9296 * layout.cc (Layout::layout_reloc): In relocatable link don't
9297 combine reloc sections for grouped sections.
9298
ef38fd8a
ST
92992010-04-23 Sriraman Tallam <tmsriram@google.com>
9300
9301 * gc.h (gc_process_relocs): Pass information on relocs pointing to
9302 sections that are not ordinary to icf.
9303 * icf.cc (get_section_contents): Handle relocation pointing to section
9304 with no object or shndx information.
9305 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
9306 * testsuite/Makefile.in: Regenerate.
9307 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
9308 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
9309
f6973bdc
ILT
93102010-04-22 Ian Lance Taylor <iant@google.com>
9311
9312 * expression.cc (Expression::Expression_eval_info): Add
9313 result_alignment_pointer field.
9314 (Expression::eval_with_dot): Add result_alignment_pointer
9315 parameter. Change all callers.
9316 (Expression::eval_maybe_dot): Likewise.
9317 (class Binary_expression): Add alignment_pointer parameter to
9318 left_value and right_value. Change all callers.
9319 (BINARY_EXPRESSION): Set result alignment.
9320 (class Trinary_expression): Add alignment_pointer parameter to
9321 arg2_value and arg3_value. Change all callers.
9322 (Trinary_cond::value): Set result alignment.
9323 (Max_expression::value, Min_expression::value): Likewise.
9324 (Align_expression::value): Likewise.
9325 * script-sections.cc (class Sections_element): Add dot_alignment
9326 parameter to set_section_addresses virtual function. Update
9327 instantiations.
9328 (class Output_section_element): Likewise.
9329 (Script_sections::create_segments): Add dot_alignment parameter.
9330 Change all callers.
9331 (Script_sections::create_segments_from_phdrs_clause): Likewise.
9332 (Script_sections::set_phdrs_clause_addresses): Likewise.
9333 * script-sections.h: Update declarations.
9334 * script.h: Update declarations.
9335 * output.h (Output_segment::set_minimum_p_align): Don't decrease
9336 min_p_align.
9337 * testsuite/script_test_3.t: Set large alignment.
9338 * testsuite/script_test_3.sh: Make sure that at least one LOAD
9339 segment has expected alignment.
9340
9c9c98a5
NC
93412010-04-22 Nick Clifton <nickc@redhat.com>
9342
9343 * po/gold.pot: Updated by the Translation project.
9344 * po/vi.po: Updated Vietnamese translation.
9345
2253bfba
L
93462010-04-22 H.J. Lu <hongjiu.lu@intel.com>
9347
9348 * testsuite/Makefile.am (check_PROGRAMS): Add
9349 icf_virtual_function_folding_test.
9350 * testsuite/Makefile.in: Regenerated.
9351
85fdf906
AH
93522010-04-15 Andrew Haley <aph@redhat.com>
9353
9354 * options.h (merge_exidx_entries): New option.
9355 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
9356 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
9357 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
9358 (Target_arm::merge_exidx_entries): New function.
9359 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
9360 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
9361 to Arm_exidx_fixup constructor.
9362 Add new arg, merge_exidx_entries.
9363 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
9364 Arm_output_section::fix_exidx_coverage.
9365
ce97fa81
ST
93662010-04-18 Sriraman Tallam <tmsriram@google.com>
9367
9368 * icf.cc (get_section_contents): Check for preemptible functions.
9369 Ignore addend when appropriate.
9370 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
9371 section folded.
9372 (add_from_relobj): Check for section folded.
9373 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
9374 * symtab.h (should_add_dynsym_entry): Add new parameter.
9375 * target-reloc.h (scan_relocs): Check for section folded.
9376 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
9377 Check reloc types for function pointers in shared objects.
9378 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
9379 case.
9380 (icf_preemptible_functions_test): New test case.
9381 (icf_string_merge_test): New test case.
9382 * testsuite.Makefile.in: Regenerate.
9383 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
9384 bar_glob. Refactor code.
9385 * testsuite/icf_preemptible_functions_test.cc: New file.
9386 * testsuite/icf_preemptible_functions_test.sh: New file.
9387 * testsuite/icf_string_merge_test.cc: New file.
9388 * testsuite/icf_string_merge_test.sh: New file.
9389 * testsuite/icf_virtual_function_folding_test.cc: New file.
9390 * testsuite/icf_virtual_function_folding_test.sh: New file.
9391
04ceb17c
DK
93922010-04-14 Doug Kwan <dougkwan@google.com>
9393
9394 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
9395 for local symbol recounting if we remove a section due to ICF.
9396 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
9397 there are no regular objects in input.
9398
153e7da4
DK
93992010-04-13 Doug Kwan <dougkwan@google.com>
9400
9401 * arm.cc (Arm_input_section::set_final_data_size): Compute
9402 accurate final data size instead of using current data size.
9403
4dbd9faf
DK
94042010-04-09 Doug Kwan <dougkwan@google.com>
9405
9406 * layout.cc (Layout::choose_output_section): Handle script section
9407 types.
9408 (Layout::make_output_section_for_script): Add section type parameter.
9409 Handle script section types.
9410 * layout.h (Layout::make_output_section_for_script): Add section
9411 type parameter.
9412 * output.cc (Output_section::Output_section): Initialize data member
9413 is_noload_.
9414 (Output_section::do_reset_address_and_file_offset): Do not set address
9415 to 0 if section is a NOLOAD section.
9416 * output.h (Output_section::is_noload): New method.
9417 (Output_section::set_is_noload): Ditto.
9418 (Output_section::is_noload_): New data member.
9419 * script-c.h (Script_section_type): New enum type.
9420 (struct Parser_output_section_header): Add new file section_type.
9421 * script-sections.cc (Sections_element::output_section_name): Add
9422 parameter for returning script section type.
9423 (Output_section_definition::output_section_name): Ditto.
9424 (Output_section_definition::section_type)P; New method.
9425 (Output_section_definiton::script_section_type_name): Ditto.
9426 (Output_section_definition::script_section_type_): New data member.
9427 (Output_section_definition::Output_section_definition): Initialize
9428 data member Output_section_definition::script_section_type_.
9429 (Output_section_definition::create_sections): Pass script section type
9430 to Layout::make_output_section_for_script.
9431 (Output_section_definition::output_section_name): Return script
9432 section type to caller.
9433 (Output_section_definition::set_section_address): Do not advance
9434 dot value and load address if section type is NOLOAD. Set address
9435 of NOLOAD sections regardless of section flags.
9436 (Output_section_definition::print): Print section type if it is
9437 not SCRIPT_SECTION_TYPE_NONE.
9438 (Output_section_definition::section_type): New method.
9439 (Output_section_definition::script_section_type_name): Ditto.
9440 (Script_sections::output_section_name): Add new parameter
9441 PSECTION_TYPE for returning script section type. Pass it to
9442 section elements. Handle discard sections.
9443 (Sort_output_sections::operator()): Handle NOLOAD sections.
9444 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 9445 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
9446 returning script section type.
9447 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
9448 INFO and NOLOAD.
9449 * yyscript.y (union): Add new field SECTION_TYPE.
9450 (COPY, DSECT, INFO, NOLOAD): New tokens.
9451 (opt_address_and_section_type): Change type to output_section_header.
9452 (section_type): New non-terminal
9453 (section_header): Handle section type.
2253bfba 9454 (opt_address_and_section_type): Return section type value.
4dbd9faf 9455
721ea635
L
94562010-04-09 H.J. Lu <hongjiu.lu@intel.com>
9457
9458 * testsuite/plugin_common_test_1.c (foo): Add prototype.
9459 * testsuite/plugin_common_test_2.c (foo): Likewise.
9460
6bf924b0
DK
94612010-04-08 Doug Kwan <dougkwan@google.com>
9462
9463 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
9464 Output_merge_data.
9465 * output.cc (Output_section::add_merge_input_section): Simplify
9466 code and return status of Output_merge_base::add_input_section.
e1df38aa 9467 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
9468 returns true.
9469
24af6f92
DK
94702010-04-07 Doug Kwan <dougkwan@google.com>
9471
9472 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
9473 if section is marked as containing instructions but has no mapping
9474 symbols.
9475 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
9476 correct section index.
9477 (Arm_relobj::find_linked_text_section): Ditto.
9478
00698fc5
CC
94792010-04-07 Cary Coutant <ccoutant@google.com>
9480
9481 * archive.cc (include_member): Destroy Read_symbols_data object before
9482 releasing file.
9483 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
9484 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
9485 (Read_symbols_data::~Read_symbols_data) New destructor.
9486 (Section_relocs::Section_relocs) New constructor.
9487 (Section_relocs::~Section_relocs) New destructor.
9488 (Read_relocs_data::Read_relocs_data) New constructor.
9489 (Read_relocs_data::~Read_relocs_data) New destructor.
9490 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
9491 pointers to NULL after deleting.
9492
7296d933
DK
94932010-04-07 Doug Kwan <dougkwan@google.com>
9494
9495 * arm.cc: Replace "endianity" with "endianness" in comments.
9496 (Arm_exidx_cantunwind): Ditto.
9497 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
9498 (Arm_relobj::merge_flags_and_attributes): New method.
9499 (Arm_relobj::merge_flags_and_attributes_): New data member.
9500 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
9501 (Arm_relobj::scan_sections_for_stubs): Ditto.
9502 (Arm_relobj::do_read_symbols): Check to see if we really want to
9503 merge processor-specific flags and attributes. Exit early if
9504 an object is empty except for section names and the undefined symbol.
9505 (Target_arm::do_finalize_sections): Move check for ELF format to
9506 Arm_relobj::do_read_symbols. Merge processor specific flags and
9507 attributes from a regular object only when we have determined that
9508 it is aapropriate. Do not create an .ARM.attributes section in
9509 output if there is no regular input object.
9510 (Target_arm::merge_processor_specific_flags): Check
9511 --warn-mismatch before printing any error.
9512 (Target_arm::merge_object_attributes): Ditto.
9513 * gold.cc (queue_middle_tasks): Handle the case in which there is
9514 no regular object in input.
9515 * options.cc (General_options::parse_EB): New method.
9516 (General_options::parse_EL): Same.
9517 (General_options::General_options): Initialize endianness_.
9518 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
9519 New options.
9520 (General_options::Endianness): New enum.
9521 (General_options::endianness): New method.
9522 (General_options::endianness_): New data member.
9523 * parameters.cc (Parameters::set_options): Check target endianness.
9524 (Parameters::set_target_once): Ditto.
9525 (Parameters::check_target_endianness): New method.
9526 (parameters_force_valid_target): If either -EL or -EB is specified,
9527 use it to define endianness of default target.
9528 * parameters.h (Parameters::check_target_endianness): New method
9529 declaration.
9530 * target.h (class Target): Change "endianity" to "endianness"
9531 in comments.
9532
efc8d4f2
RW
95332010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9534
9535 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
9536 * configure: Regenerate.
9537 * Makefile.in: Regenerate.
9538 * testsuite/Makefile.in: Regenerate.
9539
be234d88
CC
95402010-04-06 Cary Coutant <ccoutant@google.com>
9541
9542 gcc PR lto/42757
9543 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
9544 prevailing definitions of common symbols.
9545 * testsuite/plugin_test_6.sh: New test case.
9546 * testsuite/plugin_common_test_1.c: New test case.
9547 * testsuite/plugin_common_test_2.c: New test case.
9548 * testsuite/Makefile.am (plugin_test_6): New test case.
9549 * testsuite/Makefile.in: Regenerate.
9550
bd32c6bd
NC
95512010-04-06 Nick Clifton <nickc@redhat.com>
9552
9553 * po/vi.po: New Vietnamese translation.
9554
323c532f
DK
95552010-03-30 Doug Kwan <dougkwan@google.com>
9556
9557 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
9558
4fcd97eb
DK
95592010-03-25 Doug Kwan <dougkwan@google.com>
9560
9561 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
9562 to avoid a conversion warning on a 32-bit host.
9563
4ebf39db
ILT
95642010-03-24 Ian Lance Taylor <iant@google.com>
9565
9566 * testsuite/script_test_3.t: Add a TLS segment.
9567 * testsuite/Makefile.am (check_PROGRAMS): Add
9568 tls_phdrs_script_test.
9569 (tls_phdrs_script_test_SOURCES): Define.
9570 (tls_phdrs_script_test_DEPENDENCIES): Define.
9571 (tls_phdrs_script_test_LDFLAGS): Define.
9572 (tls_phdrs_script_test_LDADD): Define.
9573 * testsuite/Makefile.in: Rebuild.
9574
4a599bdd
CC
95752010-03-23 Cary Coutant <ccoutant@google.com>
9576
9577 * fileread.cc (find_or_make_view): Fix comment.
9578
6c93b22c
ILT
95792010-03-23 Ian Lance Taylor <iant@google.com>
9580
9581 * script-sections.cc (class Orphan_section_placement): Define
9582 PLACE_TLS and PLACE_TLS_BSS.
9583 (Orphan_section_placement::Orphan_section_placement): Initialize
9584 new places.
9585 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
9586 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
9587 (tls_script_test_SOURCES): Define.
9588 (tls_script_test_DEPENDENCIES): Define.
9589 (tls_script_test_LDFLAGS): Define.
9590 (tls_script_test_LDADD): Define.
9591 * testsuite/Makefile.in: Rebuild.
9592
a2c7281b
DK
95932010-03-22 Doug Kwan <dougkwan@google.com>
9594
9595 * arm.cc (Arm_relocate_functions::abs8,
9596 Arm_relocate_functions::abs16): Use correct check for overflow
9597 specified in the ARM ELF specs.
9598 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
9599 target of a BLX instruction specially.
9600 (Reloc_stub::stub_type_for_reloc): Ditto.
9601 (Relocate::relocate): Use symbolic names instead of numeric relocation
9602 codes to report error.
9603 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
9604 workaround.
9605 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
9606 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
9607 thumb2_blx_out_of_range.stdout
9608 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
9609 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
9610 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
9611 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
9612 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
9613 thumb2_blx_in_range, thumb2_blx_in_range.o,
9614 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
9615 thumb2_blx_out_of_range.o): New rules.
2e702c99 9616 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
9617 thumb2_blx_in_range and thumb2_blx_out_of_range.
9618 * testsuite/Makefile.in: Regenerate.
9619 * arm_branch_in_range.sh: Add tests for THUMB BLX.
9620 * testsuite/thumb_blx_in_range.s: New file.
9621 * testsuite/thumb_blx_out_of_range.s: New file.
9622
b0193076
RÁE
96232010-03-22 Rafael Espindola <espindola@google.com>
9624
9625 * archive.cc (Should_include): Move to archive.h.
9626 (should_include_member): Make it a member of Archive.
9627 (Lib_group): New.
9628 (Add_lib_group_symbols): New.
9629 * archive.h: Include options.h.
9630 (Archive_member): Moved from Archive.
9631 (Should_include): Moved from archive.cc.
9632 (Lib_group): New.
9633 (Add_lib_group_symbols): New.
9634 * dynobj.cc (do_should_include_member): New.
9635 * dynobj.h (do_should_include_member): New.
9636 * gold.cc (queue_initial_tasks): Update call to queue.
9637 * main.cc (main): Print lib group stats.
9638 * object.cc (do_should_include_member): New.
9639 * object.h: Include archive.h.
9640 (Object::should_include_member): New.
9641 (Object::do_should_include_member): New.
9642 (Sized_relobj::do_should_include_member): New.
9643 * options.cc (General_options::parse_start_lib): New.
9644 (General_options::parse_end_lib): New.
9645 (Input_arguments::add_file): Handle lib groups.
9646 (Input_arguments::start_group): Check we are not in a lib.
9647 (Input_arguments::start_lib): New.
9648 (Input_arguments::end_lib): New.
9649 * options.h (General_options): Add start_lib and end_lib.
9650 (Input_argument::lib_): New.
9651 (Input_argument::lib): New.
9652 (Input_argument::is_lib): New.
9653 (Input_file_lib): New.
9654 (Input_arguments::in_lib_): New.
9655 (Input_arguments::in_lib): New.
9656 (Input_arguments::start_lib): New.
9657 (Input_arguments::end_lib_): New.
9658 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
9659 in unused members as preempted.
9660 (Sized_pluginobj::do_should_include_member): New.
9661 * plugin.h (Sized_pluginobj::do_should_include_member): New.
9662 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
9663 return the blocker.
9664 (Read_symbols::do_whole_lib_group): New.
9665 (Read_symbols::do_lib_group): New.
9666 (Read_symbols::do_read_symbols): Handle lib groups.
9667 (Read_symbols::get_name): Handle lib groups.
9668 * readsyms.h (Read_symbols): Add an archive member pointer.
9669 (Read_symbols::do_whole_lib_group): New.
9670 (Read_symbols::do_lib_group): New.
9671 (Read_symbols::member_): New.
9672 * script.cc (read_input_script): Update call to queue_soon.
9673
d099120c
DK
96742010-03-19 Doug Kwan <dougkwan@google.com>
9675
9676 * arm.cc (Stub_table::Stub_table): Initialize new data members
9677 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9678 (Stub_table::add_reloc_stub): Assign stub offset and update
9679 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9680 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
9681 New data members.
2e702c99 9682 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
9683 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
9684 instead of going over all reloc stubs.
2e702c99 9685 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
9686 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9687 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 9688 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
9689 Stringpool_template::offset_.
9690 * stringpool.h (Stringpool_template::set_no_zero_null): Set
9691 Stringpool_template::offset_ to zero.
9692
1aa37384
DK
96932010-03-15 Doug Kwan <dougkwan@google.com>
9694
9695 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9696 offset_.
9697 (Stringpool_template::new_key_offset): New method.
9698 (Stringpool_template::add_string): Assign offsets when adding new
9699 strings.
9700 (Stringpool_template::set_string_offsets): Do not set string offsets
9701 when not optimizing.
9702 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
9703 member size_.
2e702c99
RM
9704 (Chunked_vector::clear): Clear size_.
9705 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
9706 (Chunked_vector::size): Return size_.
9707 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 9708 (Chunked_vector::size_): New data member.
1aa37384
DK
9709 (Stringpool_template::set_no_zero_null): Assert string set is empty.
9710 (Stringpool_template::new_key_offset): New method declaration.
9711 (Stringpool_template::offset_): New data member.
9712
b672b057
RÁE
97132010-03-15 Rafael Espindola <espindola@google.com>
9714
9715 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
9716 Add_symbols' constructor.
9717 * readsyms.h (Add_symbols): Remove the input_group member.
9718
b6848d3c
ILT
97192010-03-10 Ian Lance Taylor <iant@google.com>
9720
9721 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
9722 target to ask whether a reference to a symbol requires a stack
9723 split.
9724 * target.h (Target::is_call_to_non_split): New function.
9725 (Target::do_is_call_to_non_split): Declare virtual function.
9726 * target.cc: Include "symtab.h".
9727 (Target::do_is_call_to_non_split): New function.
9728 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
9729
a2a5469e
CC
97302010-03-10 Cary Coutant <ccoutant@google.com>
9731
9732 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
9733 (File_read::open[1]): Remove initial mapping of whole_file_view_.
9734 (File_read::open[2]): Add whole_file_view_ to list of views.
9735 (File_read::make_view): Remove test of whole_file_view_.
9736 (File_read::find_or_make_view): Create whole_file_view_ if
9737 necessary.
9738 (File_read::clear_views): Replace bool parameter with enum;
9739 adjust all callers. Don't delete views with permanent data;
9740 do delete cached views and views from archives if
9741 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
9742 if clearing the corresponding view.
9743 * fileread.h (File_read::Clear_views_mode): New enum.
9744 (File_read::View::is_permanent_view): New method.
9745 (File_read::clear_views): Replace bool parameter
9746 with enum; adjust all callers.
9747 * options.h (General_options): Change keep_files_mapped option;
9748 add map_whole_files.
9749 * readsyms.cc (Add_symbols::run): Delete sd_ object before
9750 releasing the file.
9751 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
9752 the file.
9753
8861f32b
DM
97542010-03-10 David S. Miller <davem@davemloft.net>
9755
9756 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
9757
d62d0f5f
ST
97582010-03-09 Sriraman Tallam <tmsriram@google.com>
9759
9760 * icf.cc (get_section_contents): Add '@' marker after processing the
9761 merge reloc.
9762
9177756d
DK
97632010-03-08 Doug Kwan <dougkwan@google.com>
9764
9765 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
9766 due to a conversion warning.
9767 (Arm_relobj::update_output_local_symbol_count): Check for local
9768 symbol with unset output index.
9769
9e9e071b
ILT
97702010-03-05 Ian Lance Taylor <iant@google.com>
9771
9772 * options.h (class General_options): Add --spare-dynamic-tags.
9773 * output.cc (Output_data_dynamic::set_final_data_size): Implement
9774 --spare-dynamic-tags.
9775
a81ee015
ILT
97762010-03-05 Ian Lance Taylor <iant@google.com>
9777
9778 * incremental.cc: Include "libiberty.h".
9779
44ec90b9
RO
97802010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
9781
9782 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
9783 function, is_info_ member.
9784 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
9785 (Versions::Versions): Update caller.
9786 (Versions::define_base_version): Likewise.
9787 (Versions::add_def): Likewise.
9788
0897ed3b
ST
97892010-03-03 Sriraman Tallam <tmsriram@google.com>
9790
9791 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
9792 (Scan::possible_function_pointer_reloc): New function.
9793 (Scan::local_reloc_may_be_function_pointer): Change to call
9794 possible_function_pointer_reloc.
9795 (Scan::global_reloc_may_be_function_pointer): Ditto.
9796 * icf.h (Icf::check_section_for_function_pointers): Change to reject
9797 relocations in ".data.rel.ro._ZTV" section.
9798 * testsuite/icf_safe_so_test.sh: Change to pass i386.
9799 * testsuite/icf_safe_so_test.cc: Ditto.
9800 * testsuite/icf_safe_test.cc: Ditto.
9801 * testsuite/icf_safe_test.sh: Ditto.
9802
d3bbad62
ILT
98032010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9804 Ian Lance Taylor <iant@google.com>
9805
9806 * target-reloc.h (relocate_section): Check the symbol table index
9807 for -1U before setting the local symbol index.
9808 (scan_relocatable_relocs): If copying the relocation, record that
9809 the local symbol is required.
9810 * object.h (Symbol_value::is_output_symtab_index_set): New
9811 function.
9812 (Symbol_value::may_be_discarded_from_output_symtab): New
9813 function.
9814 (Symbol_value::has_output_symtab_entry): New function.
9815 (Symbol_value::needs_output_symtab_entry): Remove.
9816 (Symbol_value::output_symtab_index): Make sure the symbol index is
9817 set.
9818 (Symbol_value::set_output_symtab_index): Make sure the symbol
9819 index is not set. Make sure the new index is valid.
9820 (Symbol_value::set_must_have_output_symtab_entry): New function.
9821 (Symbol_value::has_output_dynsym_entry): New function.
9822 (Symbol_value::set_output_dynsym_index): Make sure the new index
9823 is valid.
9824 (Sized_relobj::set_must_have_output_symtab_entry): New function.
9825 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
9826 local symbol if permitted.
9827 (Sized_relobj::do_finalize_local_symbols): Call
9828 is_output_symtab_index_set rather than needs_output_symtab_entry.
9829 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
9830 rather than needs_output_symtab_entry. Call
9831 has_output_dynsym_entry rather than needs_output_dynsym_entry.
9832 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
9833 is_output_symtab_index_set rather than needs_output_symtab_entry.
9834 * testsuite/discard_locals_relocatable_test.c: New file.
9835 * testsuite/discard_locals_test.sh: Test -r.
9836 * testsuite/Makefile.am (check_DATA): Add
9837 discard_locals_relocatable_test1.syms,
9838 discard_local_relocatable_test2.syms.
9839 (MOSTLYCLEANFILES): Likewise. Also add
9840 discard_locals_relocatable_test1.lout and
9841 discard_locals_relocatable_test2.out.
9842 (discard_locals_relocatable_test1.syms): New target.
9843 (discard_locals_relocatable_test.o): New target.
9844 (discard_locals_relocatable_test1.out): New target.
9845 (discard_locals_relocatable_test2.syms): New target.
9846 (discard_locals_relocatable_test2.out): New target.
9847 (various): Add missing ../ld-new dependencies.
9848 * testsuite/Makefile.in: Rebuild.
9849
7e8ccf26
NC
98502010-03-03 Nick Clifton <nickc@redhat.com>
9851
9852 * po/fi.po: New Finnish translation.
9853
2a0ff005
DK
98542010-03-01 Doug Kwan <dougkwan@google.com>
9855
9856 * layout.cc (Layout::Layout): Force section types of .init_array*,
9857 .preinit_array* and .fini_array* sections.
9858 * output.cc (Output_section::Input_section_sort_entry::has_priority):
9859 Fix check of return value of std::string::find.().
9860 (Output_section::Input_section_sort_compare::operator()): Remove
9861 comment about .init_array.
9862 (Output_section::Input_section_sort_init_fini_compare::operator()):
9863 New method.
9864 (Output_section::sort_attached_input_sections): Handle .init_array
9865 and .fini_array specially.
9866 * output.h (Output_section::Inut_section_sort_compare): Update
9867 comment.
9868 (Output_section::Input_section_sort_init_fini_compare): New struct.
9869
c3e4ae29
DK
98702010-02-26 Doug Kwan <dougkwan@google.com>
9871
9872 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
9873 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
9874 * testsuite/debug_msg.sh: Avoid matching source line number for
9875 use of global variable undef_int.
9876
2fd9ae7a
DK
98772010-02-26 Doug Kwan <dougkwan@google.com>
9878
9879 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
9880 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
9881 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
9882 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
9883 * options.cc (General_options::General_options): Initialize member
9884 fix_v4bx_.
9885 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
9886 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
9887 and rm_no_fix_v4bx.stdout
9888 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
9889 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
9890 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
9891 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
9892 and arm_no_fix_v4bx.
9893 * Makefile.in: Regenerate.
9894 * testsuite/arm_fix_v4bx.s: New file.
9895 * testsuite/arm_fix_v4bx.sh: Ditto.
9896
67ec7d0b
DK
98972010-02-24 Doug Kwan <dougkwan@google.com>
9898
9899 * arm.cc (Target_arm::got_section): Make the .got section the first
9900 non RELRO section in the data segment.
9901 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
9902 suffixes of section names.
9903
10165461
DK
99042010-02-24 Doug Kwan <dougkwan@google.com>
9905
9906 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
9907 flags and attributes merging if an input file is a binary file.
9908 * fileread.cc (Input_file::open): Record format of original file.
9909 * fileread.h (Input_file::Format): New enum type.
2e702c99 9910 (Input_file::Input_file): Initialize data member format_.
10165461
DK
9911 (Input_file::format): New method definition.
9912 (Input_file::format_):: New data member.
9913
4a54abbb
DK
99142010-02-24 Doug Kwan <dougkwan@google.com>
9915
9916 * arm.cc (Arm_output_data_got): New class.
9917 (ARM_TCB_SIZE): New constant
9918 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
9919 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
9920 If user uses a script with a SECTIONS clause, issue only a warning
9921 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 9922 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
9923 garbage collection.
9924 (Target_arm::got_mode_index_entry): Handle static linking.
9925 (Target_arm::Scan::local): Ditto.
9926 (Target_arm::Scan::global): Ditto.
9927 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
9928 all incorrectly implemented relocations.
e1df38aa 9929 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
9930 Arm_output_section::fix_exidx_coverage.
9931 * layout.cc (Layout::section_name_mapping): Remove trailing dots
9932 from ".ARM.exidx." and ".ARM.extab.".
9933
ca419a6f
ILT
99342010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9935
9936 * arm.cc (Target_arm::do_finalize_sections): Create attribute
9937 section if it does not already exist.
9938 * attributes.cc (Attributes_section_data::Attributes_section_data):
9939 Don't crash if size is zero.
9940
135b9c78
ILT
99412010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9942 Ian Lance Taylor <iant@google.com>
9943
9944 * gold.cc (queue_middle_tasks): If no input files were opened,
9945 exit.
9946 * workqueue.h (Task_function::Task_function): Assert that there is
9947 a blocker.
9948
bb0bfe4f
DK
99492010-02-22 Doug Kwan <dougkwan@google.com>
9950
9951 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
9952 * icf.cc (get_section_contents): Cast snprintf arguments to long long
9953 types to avoid warnings due to different uint64_t implementations
9954 on different hosts.
9955
2a2b6d42
DK
99562010-02-21 Doug Kwan <dougkwan@google.com>
9957
9958 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
9959 handling of the maximum backward branch offset.
2e702c99 9960 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
9961 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
9962 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 9963 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
9964 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
9965 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
9966 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
9967 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
9968 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
9969 thumb_bl_out_of_range thumb_bl_out_of_range.o,
9970 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
9971 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
9972 thumb2_bl_out_of_range.o): New rules.
9973 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
9974 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
9975 thumb2_bl_out_of_range
9976 * testsuite/Makefile.in: Regenerate.
9977 * testsuite/arm_bl_in_range.s: New file.
9978 * testsuite/arm_bl_out_of_range.s: Ditto.
9979 * testsuite/arm_branch_in_range.sh: Ditto.
9980 * testsuite/arm_branch_range.t: Ditto.
9981 * testsuite/thumb2_branch_range.t: Ditto.
9982 * testsuite/thumb_bl_in_range.s: Ditto.
9983 * testsuite/thumb_bl_out_of_range.s: Ditto.
9984 * testsuite/thumb_branch_range.t: Ditto.
9985
b487ad64
ST
99862010-02-20 Sriraman Tallam <tmsriram@google.com>
9987
9988 * gc.h (gc_process_relocs): Change vectors to point to the new list.
9989 Add reloc offset information.
9990 * icf.cc (get_section_contents): Change iterators to point to the new
9991 vectors. Add reloc offset information to the contents.
9992 * icf.h (Icf::Sections_reachable_info): New typedef.
9993 (Icf::Sections_reachable_list): New typedef.
9994 (Icf::Offset_info): New typedef.
9995 (Icf::Reloc_info): New struct typedef.
9996 (Icf::Reloc_info_list): New typedef.
9997 (Icf::symbol_reloc_list): Delete method.
9998 (Icf::addend_reloc_list): Delete method.
9999 (Icf::section_reloc_list): Delete method.
10000 (Icf::reloc_info_list): New method.
10001 (Icf::reloc_info_list_): New member.
10002
f96accdf
DK
100032010-02-19 Doug Kwan <dougkwan@google.com>
10004
10005 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
10006 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
10007 * arm.cc (Arm_relocation_functions): New forward declaration.
10008 (Target_arm::Target_arm): Initialize new data members
10009 got_mod_index_offset_ and tls_base_symbol_defined_.
10010 (Target_arm::Relocate::relocate_tls): New method.
10011 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
10012 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
10013 New methods.
2e702c99 10014 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
10015 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
10016 (Target_arm::got_mod_index_offset_,
10017 Target_arm::tls_base_symbol_defined_): New data members.
10018 (Target_arm::Scan::local, Target::Scan::global,
10019 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
10020 relocations.
10021
c8761b9a
DK
100222010-02-18 Doug Kwan <dougkwan@google.com>
10023
10024 * arm.cc (Arm_relobj::find_linked_text_section): New method.
10025 (Arm_relobj::make_exidx_input_section): Pass section index of linked
10026 text section as a parameter becuase some broken tools may not set
10027 the link in section header.
10028 (Target_arm::has_got_section): New method.
10029 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
10030 without any mapping symbol as data only. Remove warning.
10031 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
10032 link in its section header, try to discover the link by inspecting the
10033 REL31 relocation at the beginning of the section.
10034 (Target_arm::Scan::check_non_pic): Report name of offending relocation
10035 in error message.
10036 (Target_arm::Scan::global): Treat any reference to the symbol
10037 _GLOBAL_OFFSET_TABLE_ as a GOT access.
10038
21bb3914
ST
100392010-02-12 Sriraman Tallam <tmsriram@google.com>
10040
10041 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
10042 (Scan::global_reloc_may_be_function_pointer): New function.
10043 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10044 (Scan::global_reloc_may_be_function_pointer): New function.
10045 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10046 (Scan::global_reloc_may_be_function_pointer): New function.
10047 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
10048 (Scan::global_reloc_may_be_function_pointer): New function.
10049 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
10050 (Scan::global_reloc_may_be_function_pointer): New function.
10051 (Scan::possible_function_pointer_reloc): New function.
10052 (Target_x86_64::can_check_for_function_pointers): New function.
10053 * gc.h (gc_process_relocs): Scan relocation types to determine if
10054 function pointers were taken for targets that support it.
10055 * icf.cc (Icf::find_identical_sections): Include functions for
10056 folding in safe ICF whose pointer is not taken.
10057 * icf.h (Secn_fptr_taken_set): New typedef.
10058 (fptr_section_id_): New member.
10059 (section_has_function_pointers): New function.
10060 (set_section_has_function_pointers): New function.
10061 (check_section_for_function_pointers): New function.
10062 * options.h: Fix comment for safe ICF option.
10063 * target.h (can_check_for_function_pointers): New function.
10064 * testsuite/Makefile.am: Add icf_safe_so_test test case.
10065 Modify icf_safe_test for X86-64.
10066 * testsuite/Makefile.in: Regenerate.
10067 * testsuite/icf_safe_so_test.cc: New file.
10068 * testsuite/icf_safe_so_test.sh: New file.
10069 * testsuite/icf_safe_test.cc (kept_func_3): New function.
10070 (main): Change to take pointer to function kept_func_3.
10071 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
10072 folding is done correctly for X86-64.
10073
0da6fa6c
DM
100742010-02-12 David S. Miller <davem@davemloft.net>
10075
10076 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
10077 is_symbolless parameter.
10078 (Output_reloc<SHT_REL>::is_symbolless): New.
10079 (Output_reloc<SHT_REL>::is_symbolless_): New.
10080 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
10081 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
10082 (Output_reloc<SHT_RELA>::is_symbolless): New.
10083 (Output_data_reloc::add_global): Handle is_symbolless.
10084 (Output_data_reloc::add_global_relative): Likewise.
10085 (Output_data_reloc::add_local): Likewise.
10086 (Output_data_reloc::add_local_relative): Likewise.
10087 (Output_data_reloc::add_symbolless_global_addend): New.
10088 (Output_data_reloc::add_symbolless_local_addend): New.
10089 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
10090 is_symbolless.
10091 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
10092 instead of ->is_relative_
10093 (Output_reloc::write): Likewise.
10094 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
10095 (Output_reloc::write_rel): Simplify.
10096
10097 * sparc.cc (Target_sparc::Scan::local): Use
10098 ->add_symbolless_local_addend as needed.
10099 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
10100 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
10101 based upon relocation offset.
10102
e4782e83
DK
101032010-02-11 Doug Kwan <dougkwan@google.com>
10104
10105 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
10106 (Target_arm::Scan::global): Ditto. Also remove a comment before the
10107 beginning of function.
10108 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
10109 and MOVT_ABS relocations. Those are non issued in scanning. Fix
10110 parameter is_32bit in calls to should_apply_static_reloc.
10111 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
10112 (check_DATA): Add arm_abs_global.stdout.
10113 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
10114 arm_abs_global.stdout): New rules.
10115 (MOSTLLYCLEANFILES): Add arm_abs_global
10116 * Makefile.in: Regenerate.
10117 * testsuite/arm_abs_global.s: New file.
10118 * testsuite/arm_abs_global.sh: Ditto.
10119 * testsuite/arm_abs_lib.s: Ditto.
10120
93ceb764
ILT
101212010-02-11 Ian Lance Taylor <iant@google.com>
10122
10123 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
10124 Read_relocs task.
10125 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
10126 Allocate_commons_task first.
10127 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
10128 task, rather than symtab_lock_.
10129 (Gc_process_relocs::~Gc_process_relocs): New function.
10130 (Gc_process_relocs::is_runnable): Check this_blocker_.
10131 (Gc_process_relocs::locks): Use next_blocker_ rather than
10132 blocker_.
10133 (Scan_relocs::~Scan_relocs): New function.
10134 (Scan_relocs::is_runnable): Check this_blocker_ rather than
10135 symtab_lock_.
10136 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
10137 next_blocker_.
10138 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
10139 fields. Add this_blocker_ and next_blocker_ fields. Adjust
10140 constructor accordingly.
10141 (class Gc_process_relocs): Likewise.
10142 (class Scan_relocs): Likewise.
10143 * common.h (class Allocate_commons_task): Remove symtab_lock_
10144 field, and corresponding constructor parameter.
10145 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
10146 symtab_lock_.
10147 (Allocate_commons_task::locks): Likewise.
10148
114dfbe1
ILT
101492010-02-11 Ian Lance Taylor <iant@google.com>
10150
10151 * gold-threads.h (class Once): Define.
10152 (class Initialize_lock): Rewrite as child of Once.
10153 * gold-threads.cc (class Once_initialize): Define.
10154 (once_pointer_control): New static variable.
10155 (once_pointer, once_arg): New static variables.
10156 (c_run_once): New static function.
10157 (Once::Once, Once::run_once, Once::internal_run): New functions.
10158 (class Initialize_lock_once): Remove.
10159 (initialize_lock_control): Remove.
10160 (initialize_lock_pointer): Remove.
10161 (initialize_lock_once): Remove.
10162 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
10163 (Initialize_lock::initialize): Rewrite.
10164 (Initialize_lock::do_run_once): New function.
10165 * archive.cc (Archive::interpret_header): Only clear name if it is
10166 not already empty.
10167 * fileread.cc: Include "gold-threads.h"
10168 (file_counts_lock): New static variable.
10169 (file_counts_initialize_lock): Likewise.
10170 (File_read::release): Only increment counts when using --stats.
10171 Use a lock around the increment.
10172 * parameters.cc (class Set_parameters_target_once): Define.
10173 (set_parameters_target_once): New static variable.
10174 (Parameters::Parameters): Move here from parameters.h.
10175 (Parameters::set_target): Rewrite.
10176 (Parameters::set_target_once): New function.
10177 (Parameters::clear_target): Move here and rewrite.
10178 * parameters.h (class Parameters): Update declarations. Add
10179 set_parameters_target_once_ field.
10180 (Parameters::Parameters): Move to parameters.cc.
10181 (Parameters::clear_target): Likewise.
10182 * readsyms.cc (Read_symbols::do_group): Create a Start_group
10183 task.
10184 (Start_group::~Start_group): New function.
10185 (Start_group::is_runnable): New function.
10186 (Start_group::locks, Start_group::run): New functions.
10187 (Finish_group::run): Change saw_undefined to size_t.
10188 * readsyms.h (class Start_group): Define.
10189 (class Finish_group): Change saw_undefined_ field to size_t.
10190 (Finish_group::Finish_group): Remove saw_undefined and
10191 this_blocker parameters. Change all callers.
10192 (Finish_group::set_saw_undefined): New function.
10193 (Finish_group::set_blocker): New function.
10194 * symtab.h (class Symbol_table): Change saw_undefined to return
10195 size_t. Change saw_undefined_ field to size_t.
10196 * target-select.cc (Set_target_once::do_run_once): New function.
10197 (Target_selector::Target_selector): Initialize set_target_once_
10198 field. Don't initialize lock_ and initialize_lock_ fields.
10199 (Target_selector::instantiate_target): Rewrite.
10200 (Target_selector::set_target): New function.
10201 * target-select.h (class Set_target_once): Define.
10202 (class Target_selector): Update declarations. Make
10203 Set_target_once a friend. Remove lock_ and initialize_lock_
10204 fields. Add set_target_once_ field.
10205
fa17a3f4
ILT
102062010-02-10 Ian Lance Taylor <iant@google.com>
10207
10208 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
10209 queueing any tasks.
10210 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
10211 (queue_middle_tasks): Add all blockers before queueing any tasks.
10212 (queue_final_tasks): Likewise.
10213 * token.h (Task_token::add_blockers): New function.
10214 * object.h (Input_objects::number_of_relobjs): New function.
10215
c7177d31
ILT
102162010-02-10 Ian Lance Taylor <iant@google.com>
10217
5de0e392
ILT
10218 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
10219 shared, not if not position independent.
10220 * x86_64.cc (Relocate::relocate_tls): Likewise.
10221 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
10222 (tls_pie_pic_test): New target.
10223 * testsuite/Makefile.in: Rebuild.
10224
c7177d31
ILT
10225 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
10226 (tls_test_main_pie.o, tls_test_pie.o): New targets.
10227 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
10228 * testsuite/Makefile.in: Rebuild.
10229
684b268a
DM
102302010-02-09 David S. Miller <davem@davemloft.net>
10231
10232 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
10233 R_SPARC_RELATIVE using ->add_local_relative().
10234 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
10235
612a8d3d
DM
10236 * output.h (Output_data_dynamic::add_section_size): New method
10237 that takes two Output_data objects.
10238 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
10239 entry param. Handle it in initializers.
10240 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
10241 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
10242 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
10243 arg.
10244 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
10245 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
10246 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
10247 for dynrel_includes_plt.
10248 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10249 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10250 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
10251 before .rela.plt
10252 (Target_sparc::do_finalize_sections): Update to pass true for
10253 dynrel_includes_plt.
10254 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
10255 output before .rela.plt
10256 (Target_powerpc::do_finalize_sections): Update to pass true for
10257 dynrel_includes_plt when 32-bit.
10258
cb1be87e
DK
102592010-02-08 Doug Kwan <dougkwan@google.com>
10260
10261 * arm.cc (Arm_relobj::simple_input_section_output_address): New
10262 method.
10263 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
10264 Arm_relobj::scan_section_for_cortex_a8_stubs,
10265 Arm_relobj::do_relocation_section): Instead of calling
10266 Output_section::output_address, use faster
10267 Arm_relobj::simple_input_section_output_address.
10268
705b5121
DM
102692010-02-08 David S. Miller <davem@davemloft.net>
10270
10271 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
10272 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
10273 relocation helper function.
10274
024c4466
DM
10275 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
10276 just like R_SPARC_GOT{10,13,22}.
10277 (Target_sparc::Scan::local): Likewise.
10278 (Target_sparc::Relocate:relocate): Likewise.
10279
9109c078
ILT
102802010-02-06 Ian Lance Taylor <iant@google.com>
10281
10282 * configure.ac: Rewrite targetobjs duplicate removal code to use
10283 only shell constructs.
10284 * configure: Rebuild.
10285
cf846138
DK
102862010-02-05 Doug Kwan <dougkwan@google.com>
10287
10288 PR 11247
10289 * arm.cc (Arm_relobj::section_is_scannable): New method.
10290 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
10291 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
10292
6cfaf60b
DK
102932010-02-04 Doug Kwan <dougkwan@google.com>
10294
10295 PR 11247
10296 * arm-reloc-property.cc (cstdio): Include.
10297 * configure.ac (targetobjs): Remove duplicates.
10298 * configure: Regenerate.
10299 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
10300 big and little endian version for a given address size.
10301
5c57f1be
DK
103022010-02-03 Doug Kwan <dougkwan@google.com>
10303
10304 * arm-reloc-property.cc
10305 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10306 definition.
10307 * arm-reloc-property.h
10308 (Arm_reloc_property_table::get_implemented_static_reloc_property):
10309 New method definition.
10310 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10311 declaration.
10312 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
10313 overflow to N.
10314 (GOT_PREL): Change implemented to Y.
10315 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
10316 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
10317 (Arm_relocate_functions::movw_abs_nc): Remove method.
10318 (Arm_relocate_functions::movt_abs): Ditto.
10319 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
10320 (Arm_relocate_functions::thm_movt_abs): Ditto.
10321 (Arm_relocate_functions::movw_rel_nc): Ditto.
10322 (Arm_relocate_functions::movw_rel): Ditto.
10323 (Arm_relocate_functions::movt_rel): Ditto.
10324 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
10325 (Arm_relocate_functions:thm_movw_rel): Ditto.
10326 (Arm_relocate_functions:thm_movt_rel): Ditto.
10327 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
10328 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
10329 New method definitions.
10330 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
10331 (Arm_relocation_functions::arm_grp_ldr): Ditto.
10332 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
10333 (Arm_relocation_functions::arm_grp_ldc): Ditto.
10334 (Target_arm::Relocate::relocate): Check for non-static or
10335 unimplemented relocation code and exit early. Change calls to
10336 Target_arm::reloc_uses_thumb_bit and
10337 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
10338 instead. Refactor code to handle similar relocations to increase
10339 code sharing. Remove check for unsupported relocation code in switch
10340 statement.
10341 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
10342 relocation property table to find out size. Change error message to
10343 print out the name of a relocation code instead of the numeric value.
10344 (Target_arm::scan_reloc_for_stub): Use relocation property table
10345 instead of calling Target_arm::reloc_uses_thumb_bit().
10346
218c5831
DK
103472010-02-02 Doug Kwan <dougkwan@google.com>
10348
10349 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
10350 types of relaxed input section.
10351
0d31c79d
DK
103522010-02-02 Doug Kwan <dougkwan@google.com>
10353
10354 * Makefile.am (HFILES): Add arm-reloc-property.h.
10355 (DEFFILES): New.
2e702c99
RM
10356 (TARGETSOURCES): Add arm-reloc-property.cc
10357 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
10358 (libgold_a_SOURCES): $(DEFFILES)
10359 * Makefile.in: Regenerate.
10360 * arm-reloc-property.cc: New file.
10361 * arm-reloc-property.h: New file.
10362 * arm-reloc.def: New file.
10363 * arm.cc: Update comments.
10364 (arm-reloc-property.h): New included header.
10365 (arm_reloc_property_table): New global variable.
10366 (Target_arm::do_select_as_default_target): New method definition.
10367 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
10368 arm-reloc-property to targ_extra_obj.
10369 * parameters.cc (set_parameters_target): Call
10370 Target::select_as_default_target().
10371 * target.h (Target::select_as_default_target): New method definition.
10372 (Target::do_select_as_default_target): Same.
10373
546c7457
DK
103742010-02-01 Doug Kwan <dougkwan@google.com>
10375
10376 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
10377 first_output_text_section_.
10378 (Arm_exidx_fixup::first_output_text_section): New method definition.
10379 (Arm_exidx_fixup::first_output_text_section_): New data member.
10380 (Arm_exidx_fixup::process_exidx_section): Record the first text
10381 output section seen.
10382 (Arm_output_section::fix_exidx_coverage): Set correct linked section
10383 and entsize in output section header.
10384
11b861d5
DK
103852010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10386
10387 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
10388 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
10389 (Arm_relocate_functions::thm_alu11): New Method.
10390 (Arm_relocate_functions::thm_pc8): New Method.
10391 (Arm_relocate_functions::thm_pc12): New Method.
10392 (Target_arm::Scan::local): Handle the relocations.
10393 (Target_arm::Scan::global): Likewise.
10394 (Target_arm::Relocate::relocate): Likewise.
10395 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10396
c9a2c125
DK
103972010-01-29 Doug Kwan <dougkwan@google.com>
10398
10399 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
10400 of relocation types as ld.
10401
1521477a
DK
104022010-01-29 Doug Kwan <dougkwan@google.com>
10403
10404 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
10405 to public.
10406 (Arm_relocate_functions::thumb_branch_common): Ditto.
10407 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
10408 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
10409 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
10410 Arm_relocate_functions::jump24): Remove.
10411 (Target_arm::Relocate::relocate): Adjust code to call
10412 Arm_relocation_functions::arm_branch_common and
10413 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 10414 wrappers. Merge switch-cases together to reduce source code size.
1521477a 10415
e7eca48c
DK
104162010-01-29 Doug Kwan <dougkwan@google.com>
10417
10418 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
10419 output_local_symbol_count_needs_update_.
10420 (Arm_relobj::output_local_symbol_count_needs_update,
10421 Arm_relobj::set_output_local_symbol_count_needs_update,
10422 Arm_relobj::update_output_local_symbol_count): New methods.
10423 (Arm_relobj::output_local_symbol_count_needs_update_): New data
10424 member.
10425 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
10426 of pointed function as in a R_ARM_PREL31 relocation.
10427 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
10428 for output local symbol count updating.
10429 (Target_arm::do_relax): Update output local symbol counts in objects
10430 if necessary.
10431 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
10432
02961d7e
ILT
104332010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10434
10435 * arm.cc: Added support for the ARM relocations:
10436 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
10437 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
10438 (Arm_relocate_functions::movw_rel_nc): Renamed (was
10439 movw_prel_nc).
10440 (Arm_relocate_functions::movw_rel): New method.
10441 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
10442 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
10443 thm_movw_prel_nc).
10444 (Arm_relocate_functions::thm_movw_rel): New method.
10445 (Arm_relocate_functions::thm_movt_rel): Renamed (was
10446 thm_movt_prel).
10447 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
10448 relocations.
10449 (Target_arm::Scan::global): Likewise.
10450 (Target_arm::Relocate::relocate): Likewise.
10451 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10452 Likewise.
10453
b10d2873
ILT
104542010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10455
10456 * arm.cc: Added support for ARM group relocations.
10457 (Target_arm::reloc_needs_sym_origin): New method.
10458 (Arm_relocate_functions::calc_grp_kn): New method.
10459 (Arm_relocate_functions::calc_grp_residual): New method.
10460 (Arm_relocate_functions::calc_grp_gn): New method.
10461 (Arm_relocate_functions::arm_grp_alu): New Method.
10462 (Arm_relocate_functions::arm_grp_ldr): New Method.
10463 (Arm_relocate_functions::arm_grp_ldrs): New Method.
10464 (Arm_relocate_functions::arm_grp_ldc): New Method.
10465 (Target_arm::Scan::local): Handle the ARM group relocations.
10466 (Target_arm::Scan::global): Likewise.
10467 (Target_arm::Relocate::relocate): Likewise.
10468 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10469 Likewise.
10470
2b328d4e
DK
104712010-01-26 Doug Kwan <dougkwan@google.com>
10472
10473 * arm.cc (set): Include.
10474 (class Arm_exidx_fixup): Change type of last_input_section_ to const
10475 pointer type.
2e702c99 10476 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
10477 (Arm_output_section::append_text_sections_to_list): New method.
10478 (Arm_output_section::fix_exidx_coverage): Ditto.
10479 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 10480 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
10481 Relobj::set_section_offset() instead of
10482 Sized_relobj::invalidate_section_offset().
2e702c99 10483 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
10484 parameter for section headers. Ignore relocation sections for
10485 unallocated sections and EXIDX sections.
10486 (Target_arm::fix_exidx_coverage): New method.
10487 (Target_arm::output_section_address_less_than): New type.
10488 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
10489 linked text section instead of the EXIDX section.
10490 (Arm_output_section::create_stub_group): Add an assertion to check
10491 that this is not an EXIDX output section.
10492 (Arm_output_section::append_text_sections_to_list): New method.
10493 (Arm_output_section::fix_exidx_coverage): Ditto.
10494 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 10495 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
10496 (Target_arm::do_relax): Fix EXIDX output section coverage in the
10497 first pass.
10498 (Target_arm::fix_exidx_coverage): New method.
10499 * object.h (Relobj::set_output_section): New method.
10500 (Sized_relobj::invalidate_section_offset): Remove method.
10501 (Sized_relobj::do_invalidate_section_offset): Remove method.
10502 (Sized_relobj::do_set_section_offset): Handle offset value -1.
10503
c7f3c371
DK
105042010-01-25 Doug Kwan <dougkwan@google.com>
10505
10506 * arm.cc (Arm_exidx_merged_section::do_output_offset):
10507 Fix warning due to signed and unsigned comparison on a 32-bit host.
10508
8923b24c
DK
105092010-01-22 Doug Kwan <dougkwan@google.com>
10510
10511 * arm.cc (Target_arm::do_relax): Record an output section for section
10512 offset adjustment it contains any stub table that has changed.
10513 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
10514 offsets in an output section if necessary.
10515 * output.cc (Output_section::Output_section): Initialize
10516 section_offsets_need_adjustments_.
10517 (Output_section::add_input_section_for_script): Renamed to
10518 Output_section::add_simple_input_section.
10519 (Output_section::save_states): Add a comment.
10520 (Output_section::discard_states): New method defintion.
10521 (Output_section::adjust_section_offsets): Same.
10522 * output.h (Output_section::add_input_section_for_script): Renamed to
10523 Output_section::add_simple_input_section.
10524 (Output_section::discard_states): New method declaration.
10525 (Output_section::adjust_section_offsets): Same.
10526 (Output_section::section_offsets_need_adjustment,
10527 Output_section::set_section_offsets_need_adjustment): New method
10528 definitions.
10529 (Output_section::section_offsets_need_adjustment_): New data member.
10530 * script-sections.cc
10531 (Output_section_element_input::set_section_address): Adjust code for
10532 renaming of Output_section::add_input_section_for_script.
10533 (Orphan_output_section::set_section_address): Same.
10534
9b2fd367
DK
105352010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10536
10537 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
10538 Fix_v4bx enum values .
10539 * gold/options.h (General_options): New option definitions.
10540 (General_options::fix_v4bx): New method.
10541 (General_options::Fix_v4bx): New enum.
10542 * gold/options.cc (General_options::parse_fix_v4bx): New method.
10543 (General_options::parse_fix_v4bx_interworking): New method.
10544
80d0d023
DK
105452010-01-22 Doug Kwan <dougkwan@google.com>
10546
10547 * arm.cc (Arm_exidx_fixup): New class.
10548
af2cdeae
DK
105492010-01-21 Doug Kwan <dougkwan@google.com>
10550
10551 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
10552 classes.
10553 (Arm_exidx_section_offset_map): New type.
10554
993d07c1
DK
105552010-01-21 Doug Kwan <dougkwan@google.com>
10556
10557 * arm.cc (Arm_exidx_input_section): New class.
10558 (Arm_relobj::exidx_input_section_by_link,
10559 Arm_relobj::exidx_input_section_by_shndx,
10560 Arm_relobj::make_exidx_input_section): New methods.
10561 (read_arm_attributes_section): Remove.
10562 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
10563 information about them.
10564 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
10565 to here.
10566
5ac169d4
DK
105672010-01-20 Doug Kwan <dougkwan@google.com>
10568
10569 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
10570 Input_section_specifier to Section_id.
10571 (Target_arm::new_arm_input_section: Adjust code for change of key
10572 type.
10573 (Target_arm::find_arm_input_section): Ditto.
10574 * gc.h (object.h): Include for Section_id nand Section_id_hash.
10575 (Section_id): Remove.
10576 (Garbage_collection::Section_id_hash): Remove.
10577 * icf.h (object.h): Include for Section_id nand Section_id_hash.
10578 (Section_id): Remove.
10579 (Icf::Section_id_hash): Remove.
10580 * object.h (Section_id, Const_section_id, Section_id_hash,
10581 Const_section_id_hash): New type definitions.
10582 * output.cc (Output_section::add_relaxed_input_section): Change to
10583 use Const_section_id instead of Input_section_specifier as key type.
10584 (Output_section::add_merge_input_section): Ditto.
10585 (Output_section::build_relaxation_map): Change to use Section_id
10586 instead of Input_section_specifier as key type.
2e702c99 10587 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
10588 Ditto.
10589 (Output_section::convert_input_sections_to_relaxed_sections): Change
10590 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 10591 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
10592 (Output_section::find_relaxed_input_section): Ditto.
10593 * output.h (Input_section_specifier): Remove class.
10594 (Output_section::Output_section_data_by_input_section_map): Change
10595 key type to Const_section_id.
10596 (Output_section::Output_relaxed_input_section_by_input_section_map):
10597 Ditto.
10598 (Output_section::Relaxation_map): Change key type to Section_id.
10599
a2162063
ILT
106002010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10601
10602 * gold/arm.cc: Added support for R_ARM_V4BX relocation
10603 (class Arm_v4bx_stub): New class.
10604 (DEF_STUBS): Updated definition to support v4_veneer_bx.
10605 (Stub_factory::make_arm_v4bx_stub): New method.
10606 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
10607 (Stub_table::empty): Handle v4bx stubs.
10608 (Stub_table::add_arm_v4bx_stub): New method.
10609 (Stub_table::find_arm_v4bx_stub): New method.
10610 (Arm_relocate_functions::v4bx): New method.
10611 (Target_arm::fix_v4bx): New method.
10612 (Target_arm::Target_arm): Handle R_ARM_V4BX.
10613 (Stub_table::relocate_stubs): Likewise.
10614 (Stub_table::do_write): Likewise.
10615 (Stub_table::update_data_size_and_addralign): Likewise.
10616 (Stub_table::finalize_stubs): Likewise.
10617 (Target_arm::Scan::local): Likewise.
10618 (Target_arm::Scan::global): Likewise.
10619 (Target_arm::do_finalize_sections): Likewise.
10620 (Target_arm::Relocate::relocate): Likewise.
10621 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10622 Likewise.
10623 (Target_arm::scan_reloc_for_stub): Likewise.
10624 (Target_arm::scan_reloc_section_for_stubs): Likewise.
10625
5696ab0b
ILT
106262010-01-19 Ian Lance Taylor <iant@google.com>
10627
10628 * output.cc (Output_section_headers::do_sized_write): Write large
10629 segment count to sh_info field.
10630 (Output_file_header::do_sized_write): For large segment count,
10631 write PN_XNUM to e_phnum field.
10632
800d0f56
ILT
106332010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10634
10635 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
10636 (Arm_relocate_functions::thm_jump8): New function.
10637 (Arm_relocate_functions::thm_jump11): New function.
10638 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
10639 R_ARM_THM_JUMP11.
10640 (Target_arm::Scan::global): Likewise.
10641 (Target_arm::Relocate::relocate): Likewise.
10642 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10643 Likewise.
10644
41263c05
DK
106452010-01-14 Doug Kwan <dougkwan@google.com>
10646
10647 * arm.cc (map, utility): Include headers.
10648 (Target_arm::apply_cortex_a8_workaround): New method.
10649 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
10650 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
10651 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
10652 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
10653 the --[no-]fix-cortex-a8 command line options.
10654 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
10655 (Target_arm::relocate_stub): Use addend in instruction template.
10656 * options.h (DEFINE_bool): Set the user-set flag.
10657 (General_options): Add --[no-]-fix-cortex options.
10658 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 10659 : Update fast look-up map after conversion.
41263c05 10660
459e9b03
ST
106612010-01-14 Sriraman Tallam <tmsriram@google.com>
10662
10663 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
10664 in the first pass of do_layout.
10665
b521dfe4
DK
106662010-01-13 Doug Kwan <dougkwan@google.com>
10667
10668 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10669 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
10670 apparent compiler problem of not folding static constant integral
10671 data members of elfcpp::Elf_sizes<32>.
10672
44272192
DK
106732010-01-13 Doug Kwan <dougkwan@google.com>
10674
10675 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10676 Arm_relobj::section_needs_cortex_a8_stub_scanning,
10677 Arm_relobj::scan_section_for_cortex_a8_erratum,
10678 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
10679 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
10680 sections to scan for relocation stubs into a new method
10681 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
10682 relocation and Cortex-A8 stub scanning.
10683 (Target_arm::do_relax): Force stubs to be after stubbed sections
10684 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 10685 the beginning of a new relaxation pass. Update a comment.
44272192
DK
10686 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
10687
44b71ece
ILT
106882010-01-12 Ian Lance Taylor <iant@google.com>
10689
10690 * target-reloc.h (visibility_error): New inline function.
10691 (relocate_section): Call visibility_error.
10692 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
10693 (MOSTLYCLEANFILES): Likewise.
10694 (protected_4_pic.o, protected_3.err): New targets.
10695 * testsuite/protected_4.cc: New file.
10696
a120bc7f
DK
106972010-01-12 Doug Kwan <dougkwan@google.com>
10698
10699 * arm.cc (Cortex_a8_reloc): New class.
10700 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
10701 and cortex_a8_relocs_info_.
10702 (Target_arm::fix_cortex_a8): New method definition.
10703 (Target_arm::Cortex_a8_relocs_info): New type.
10704 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
10705 New data member declarations.
10706 (Target_arm::scan_reloc_for_stub): Record information about
10707 relocations for THUMB branches that might be exempted from the
10708 Cortex-A8 workaround.
10709 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
10710 at the beginning of a relaxation pass.
10711
20138696
DK
107122010-01-12 Doug Kwan <dougkwan@google.com>
10713
10714 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
10715 (Arm_relobj::Mapping_symbol_position,
10716 Arm_reloj::Mapping_symbol_position_less,
10717 Arm_relobj::Mapping_symbols_info): New types.
10718 (Target_arm::is_mapping_symbol_name): New method definition.
10719 (Arm_relobj::do_count_local_symbols): Save information about mapping
10720 symbols.
10721
089d69dc
DK
107222010-01-11 Doug Kwan <dougkwan@google.com>
10723
10724 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
10725 Arm_relocate_functions::thumb32_branch_upper,
10726 Arm_relocate_functions::thumb32_branch_lower,
10727 Arm_relocate_functions::thumb32_cond_branch_offset,
10728 Arm_relocate_functions::thumb32_cond_branch_upper,
10729 Arm_relocate_functions::thumb32_cond_branch_lower,
10730 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
10731 branch offset encoding.
10732 (Arm_relocate_functions::thumb_branch_common): Use new branch
10733 offset encoding methods to avoid code duplication.
10734 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
10735 (Stub_addend_reader::operator()): Use new branch encoding method
10736 to avoid code duplication.
10737
99e5bff2
DK
107382010-01-11 Doug Kwan <dougkwan@google.com>
10739
10740 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
10741 (Target_arm::do_finalize_sections): Define special EXIDX section
10742 symbols only if referenced.
10743 * gc.h (Garbage_collection::add_reference): New method.
10744 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
10745 code duplication.
10746
98e090bd
ILT
107472010-01-11 Ian Lance Taylor <iant@google.com>
10748
d0a91bd8
ILT
10749 * script.cc (Version_script_info::build_expression_list_lookup):
10750 Change complaing about duplicate wildcard match from error to
10751 warning.
10752
98e090bd
ILT
10753 * script.cc (class Lazy_demangler): Recreate--revert part of patch
10754 of 2009-12-30.
10755 (Version_script_info::Version_script_info): Initialize globs_,
10756 default_version_, default_is_global_, and exact_. Don't
10757 initialize globals_ or locals_.
10758 (Version_script_info::build_lookup_tables): Build local symbols
10759 first.
10760 (Version_script_info::unquote): New function.
10761 (Version_script_info::add_exact_match): New function.
10762 (Version_script_info::build_expression_list_lookup): Remove lookup
10763 parameter. Add is_global parameter. Change all callers. Handle
10764 wildcard pattern specially. Unquote pattern. Call
10765 add_exact_match.
10766 (Version_script_info::get_name_to_match): New function.
10767 (Version_script_info::get_symbol_version): New function.
10768 (Version_script_info::get_symbol_version_helper): Remove.
10769 (Version_script_info::check_unmatched_names): Call unquote.
10770 * script.h (class Version_script_info): Change get_symbol_version
10771 to be non-inline and add is_global parameter; change all callers.
10772 Rewrite symbol_is_local. Update declarations. Define struct
10773 Version_tree_match, Exact, Globs. Don't define struct Lookup.
10774 Remove globals_ and locals_ members. Add exact_, globs_,
10775 default_version_, is_global_.
10776 (Version_script_info::Glob): Remove pattern, add expression and
10777 is_global. Update constructor. Change all callers.
10778 * dynobj.cc (Versions::finalize): Mark the version symbol as the
10779 default version.
10780 (Versions::symbol_section_contents): If a symbol is undefined, or
10781 defined in a dynamic object, set the version index to
10782 VER_NDX_LOCAL.
10783 * symtab.cc (Symbol_table::add_from_relobj): Don't call
10784 symbol_is_local.
10785 (Symbol_table::add_from_pluginobj): Likewise.
10786 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
10787
d56962d3
DK
107882010-01-11 Doug Kwan <dougkwan@google.com>
10789
10790 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
10791 (incremental_dump_LDADD): Add linking option for libintl.
10792 * Makefile.in: Regenerate.
10793
94e6ee91
L
107942010-01-11 H.J. Lu <hongjiu.lu@intel.com>
10795
10796 PR gold/11144
10797 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
10798 instead of -Ds.
10799 * testsuite/Makefile.in: Regenerated.
10800
e96c574b
DK
108012010-01-10 Doug Kwan <dougkwan@google.com>
10802
10803 * options.h (DEFINE_var): Use parentheses around argument varname__
10804 in macro body to avoid any unintended subsequent substitutions.
10805
7198066b
ILT
108062010-01-10 Ian Lance Taylor <iant@google.com>
10807
ba4d53bf
ILT
10808 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
10809 candidates before doing symbol resolution.
10810
7198066b
ILT
10811 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
10812 ODR candidates if only one is weak.
10813
a2beed37
ILT
108142010-01-08 Ian Lance Taylor <iant@google.com>
10815
10816 * script.cc (Version_script_info::build_expression_list_lookup):
10817 Don't warn about ambiguous version, just record the ambiguity.
10818 (Version_script_info::get_symbol_version_helper): Give error if
10819 version is ambiguous.
10820
2fb7225c
DK
108212010-01-08 Doug Kwan <dougkwan@google.com>
10822
10823 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
10824 prev_data_size_ and prev_addralign_. Remove initializer for
10825 deleted data member has_been_changed_.
10826 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
10827 to determine if the table is empty.
10828 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
10829 Remove.
10830 (Stub_table::add_reloc_stub): Define method in class definition
10831 instead of just declaring it there.
10832 (Stub_table::add_cortex_a8_stub): New method definition.
10833 (Stub_table::update_data_size_and_addralign): Ditto.
10834 (Stub_table::finalize_stubs): Ditto.
10835 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
10836 (Stub_table::do_addralign_): Return address alignment in the
10837 (Stub_table::do_reset_address_and_file_offset): Define method in
10838 class definition instead of declaring it there. Set current data
10839 size to be the data size of the previous pass.
10840 (Stub_table::set_final_data_size): Use current data size as the
10841 final data size.
10842 (Stub_table::relocate_stub): Change parameter type of stub from
10843 Reloc_stub pointer to Stub pointer.
10844 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
10845 (Stub_table::Cortex_a8_stub_list): New typedef.
10846 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
10847 Stub_table::prev_addralign_): New data member.
10848 (Arm_relobj::Arm_relobj): Initialize data member
10849 section_has_cortex_a8_workaround_.
10850 (Arm_relobj::section_has_cortex_a8_workaround,
10851 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
10852 definitions.
10853 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
10854 declarations.
10855 (Target_arm::relocate_stub): Change parameter type of stub from
10856 Reloc_stub pointer to Stub pointer.
10857 (Insn_template::size, Insn_template::alignment): Handle
10858 THUMB16_SPECIAL_TYPE.
10859 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
10860 Stub_table::update_data_size_and_addralign,
10861 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
10862 definitions.
10863 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
10864 (Stub_table::do_write): Ditto.
10865 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 10866
880cd20d
ILT
108672010-01-08 Ian Lance Taylor <iant@google.com>
10868
10869 PR 11108
10870 * symtab.h (class Symbol): Remove fields is_target_special_ and
10871 has_plt_offset_. Add field is_defined_in_discarded_section_.
10872 (Symbol::is_defined_in_discarded_section): New function.
10873 (Symbol::set_is_defined_in_discarded_section): New function.
10874 (Symbol::has_plt_offset): Rewrite.
10875 (Symbol::set_plt_offset): Verify that new offset is not -1U.
10876 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
10877 Don't initialize is_target_special_ or has_plt_offset_.
10878 Initialize is_defined_in_discarded_section_.
10879 (Symbol_table::add_from_relobj): If appropriate, set
10880 is_defined_in_discarded_section.
10881 * resolve.cc (Symbol::override_base_with_special): Don't test
10882 is_target_special_. Change has_plt_offset_ to has_plt_offset().
10883 * target-reloc.h (relocate_section): Do special handling for
10884 symbols defined in discarded sections for global symbols as well
10885 as local symbols.
10886
2703e3eb
ILT
108872010-01-08 Ian Lance Taylor <iant@google.com>
10888
10889 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
10890 the SHT_SYMTAB case.
10891
339d40a3
ILT
108922010-01-08 Ian Lance Taylor <iant@google.com>
10893
10894 * object.cc (Sized_relobj::do_layout): Don't get confused if
10895 layout_eh_frame returns NULL.
10896
abecea76
ILT
108972010-01-08 Ian Lance Taylor <iant@google.com>
10898
10899 PR 11084
10900 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
10901 dynamic symbol table, use the normal symbol table.
10902 (Sized_dynobj::do_read_symbols): Remove assertion about type of
10903 symbol table.
10904
6b7dd3f3
ILT
109052010-01-08 Ian Lance Taylor <iant@google.com>
10906
10907 PR 11072
10908 * layout.cc (Layout::include_section): Remove .gnu_debuglink
10909 sections.
10910
36c50e63
L
109112010-01-08 H.J. Lu <hongjiu.lu@intel.com>
10912
10913 * version.cc (print_version): Change to "Copyright 2010".
10914
e291e7b9
ILT
109152010-01-08 Ian Lance Taylor <iant@google.com>
10916
10917 PR 10287
10918 PR 11063
10919 * i386.cc (class Target_i386): Change return type of plt_section
10920 to be non-const.
10921 (class Output_data_plt_i386): Add tls_desc_rel_ field.
10922 (Output_data_plt_i386::Output_data_plt_i386): Initialize
10923 tls_desc_rel_ field.
10924 (Output_data_plt_i386::rel_tls_desc): New function.
10925 (Target_i386::rel_tls_desc_section): New function.
10926 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
10927 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
10928 R_386_TLS_DESC reloc in rel_tls_desc_section.
10929 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
10930 Define struct Tlsdesc_info.
10931 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
10932 (Target_x86_64::do_reloc_symbol_index): New function.
10933 (Target_x86_64::add_tlsdesc_info): New function.
10934 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
10935 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
10936 tlsdesc_rel_ field.
10937 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
10938 all callers.
10939 (Output_data_plt_x86_64::rela_tlsdesc): New function.
10940 (Target_x86_64::rela_tlsdesc_section): New function.
10941 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
10942 handling.
10943 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
10944 (Target_x86_64::do_reloc_addend): New function.
10945 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
10946 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
10947 declarations. Define TARGET_CODE. Add arg field to u1_ union.
10948 (Output_reloc::type): New function.
10949 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
10950 (Output_reloc::is_target_specific): New function.
10951 (Output_reloc::target_arg): New function.
10952 (class Output_reloc) [SHT_RELA]: Add four new constructors for
10953 absolute relocs and target specific relocs.
10954 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
10955 add_target_specific.
10956 (class Output_data_reloc) [SHT_RELA]: Likewise.
10957 * output.cc (Output_reloc::Output_reloc): Add four new versions
10958 for absolute relocs and target specific relocs.
10959 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
10960 (Output_reloc::get_symbol_index): Likewise.
10961 (Output_reloc::local_section_offset): Check that local_sym_index_
10962 is not TARGET_CODE or 0.
10963 (Output_reloc::symbol_value): Likewise.
10964 (Output_reloc::write) [SHT_RELA]: Call target for target specific
10965 reloc.
10966 * target.h (class Target): Add reloc_symbol_index and reloc_addend
10967 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
10968 functions.
10969 * layout.cc (add_target_dynamic_tags): Use output section for
10970 DT_PLTRELSZ and DT_JMPREL.
10971
3a44184e
ILT
109722010-01-07 Ian Lance Taylor <iant@google.com>
10973
10974 PR 11061
10975 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
10976 function.
10977 (class Output_data_reloc_generic): Define.
10978 (class Output_data_reloc_base): Change base class to
10979 Output_data_reloc_generic. Change add() method to call
10980 bump_relative_reloc_count for a relative reloc. Remove
10981 sort_relocs_ field.
10982 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
10983 to sort_relocs().
10984 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
10985 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
10986 appropriate.
10987 * layout.h (class Layout): Update declaration.
10988
ea715a34
ILT
109892010-01-07 Ian Lance Taylor <iant@google.com>
10990
10991 * output.h (class Output_data): Add const version of
10992 output_section and do_output_section.
10993 (class Output_section_data): Add const version of
10994 do_output_section.
10995 (class Output_section): Likewise.
10996 * layout.cc (Layout::add_target_dynamic_tags): New function.
10997 * layout.h (class Layout): Update declarations.
10998 * arm.cc (Target_arm::do_finalize_sections): Use
10999 add_target_dynamic_tags.
11000 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11001 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11002 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11003 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11004
659948a4
ILT
110052010-01-07 Ian Lance Taylor <iant@google.com>
11006
11007 PR 11042
11008 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
11009 object as needed.
11010
9d3b86f6
ILT
110112010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
11012 Ian Lance Taylor <iant@google.com>
11013
11014 PR 11019
11015 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
11016 Xindex::read_symtab_xindex.
11017
bb0d3eb0
DK
110182010-01-07 Doug Kwan <dougkwan@google.com>
11019
11020 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
11021 (Insn_template::thumb16_bcond_insn): New method declaration.
11022 (Insn_template): Fix spelling.
11023 (Stub::thumb16_special): New method declaration.
11024 (Stub::do_write): Define virtual method which was previously pure
11025 virtual.
11026 (Stub::do_thumb16_special): New method declaration.
11027 (Stub::do_fixed_endian_write): New template member.
11028 (Reloc_stub::do_write): Remove.
11029 (Reloc_stub::do_fixed_endian_write): Remove.
11030 (Cortex_a8_stub): New class definition.
11031 (Stub_factory::make_cortex_a8_stub): New method definition.
11032 (Stub_factory::Stub_factory): Add missing static storage class
11033 qualifier for elf32_arm_stub_a8_veneer_blx.
11034
ffeef7df
ILT
110352010-01-07 Ian Lance Taylor <iant@google.com>
11036
dc3f80fe
ILT
11037 PR 10980
11038 * options.h (class General_options): Add --warn-unresolved-symbols
11039 and --error-unresolved-symbols.
11040 * errors.cc (Errors::undefined_symbol): Implement
11041 --warn-unresolved-symbols.
11042
ffeef7df
ILT
11043 * options.h (class General_options): Add -z text and -z textoff.
11044 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
11045
f1ec9ded
ST
110462010-01-06 Sriraman Tallam <tmsriram@google.com>
11047
11048 * gc.h (Garbage_collection::Cident_section_map): New typedef.
11049 (Garbage_collection::cident_sections): New function.
11050 (Garbage_collection::add_cident_section): New function.
11051 (Garbage_collection::cident_sections_): New member.
11052 (gc_process_relocs): Add references to sections whose names are C
11053 identifiers.
11054 * gold.h (cident_section_start_prefix): New constant.
11055 (cident_section_stop_prefix): New constant.
11056 (is_cident): New function.
11057 * layout.cc (Layout::define_section_symbols): Replace string constants
11058 with the newly defined constants.
11059 * object.cc (Sized_relobj::do_layout): Track sections whose names are
11060 C identifiers.
11061 * testsuite/Makefile.am: Add gc_orphan_section_test.
11062 * testsuite/Makefile.in: Regenerate.
11063 * testsuite/gc_orphan_section_test.cc: New file.
11064 * testsuite/gc_orphan_section_test.sh: New file.
11065
6eda8c29
ILT
110662010-01-06 Ian Lance Taylor <iant@google.com>
11067
b9674e17
ILT
11068 PR 10980
11069 * options.h (class General_options): Add --warn-shared-textrel.
11070 * layout.cc (Layout::finish_dynamic_section): Implement
11071 --warn-shared-textrel.
11072
6eda8c29
ILT
11073 PR 10980
11074 * options.h (class General_options): Add --warn-multiple-gp.
11075
32dcd44e
ILT
110762010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11077
11078 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
11079 $(THREADSLIB) and $(LIBDL).
11080 * Makefile.in: Rebuild.
11081
a192ba05
ILT
110822010-01-06 Ian Lance Taylor <iant@google.com>
11083
11084 PR 10980
11085 * options.cc (General_options::parse_section_start): New function.
11086 (General_options::section_start): New function.
11087 (General_options::General_options): Initialize all members.
11088 * options.h: Include <map>
11089 (class General_options): Add --section-start. Add section_starts_
11090 member.
11091 * layout.cc (Layout::attach_allocated_section_to_segment): If
11092 --section-start was used, set the address of the segment. Remove
11093 local sort_sections.
11094 (Layout::relaxation_loop_body): If the address of the load segment
11095 has been set by --section-start, don't use it.
11096 * output.h (Output_segment::update_flags_for_output_section): New
11097 function.
11098 * output.cc (Output_segment::add_output_section): Call
11099 update_flags_for_output_section.
11100
dde3f402
ILT
111012010-01-05 Ian Lance Taylor <iant@google.com>
11102
62dfdd4d
ILT
11103 PR 10980
11104 * options.h (class General_options): Add --undefined-version.
11105 * script.cc (struct Version_expression): Add was_matched_by_symbol
11106 field.
11107 (Version_script_info::matched_symbol): New function.
11108 (Version_script_info::get_symbol_version_helper): Call
11109 matched_symbol.
11110 (Version_script_info::check_unmatched_names): New function.
11111 * script.h (class Version_script_info): Update declarations.
11112 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
11113
9c4ae156
ILT
11114 * options.h (class General_options): Use DEFINE_bool_alias for
11115 allow_multiple_definition.
11116 * resolve.cc (Symbol_table::should_override): Don't test
11117 allow_multiple_definition.
11118
dde3f402
ILT
11119 PR 10980
11120 * options.h (class General_options): Add --cref.
11121 * main.cc (main): Print cref table if --cref. Don't close mapfile
11122 until after printing cref table.
11123 * cref.cc: Include "symtab.h".
11124 (class Cref_inputs): Define Cref_table_compare and Cref_table.
11125 (Cref_table_compare::operator()): New function.
11126 (Cref_inputs::gather_cref): New function.
11127 (filecol): New static const.
11128 (Cref_inputs::print_cref): New function.
11129 (Cref::print_cref): New function.
11130 * cref.h: Include <cstdio>.
11131 (class Cref): Update declarations.
11132 * mapfile.h (Mapfile::file): New function.
11133 * object.h (class Object): Define Symbols. Declare virtual
11134 do_get_global_symbols.
11135 (Object::get_global_symbols): New function.
11136 * object.cc (Input_objects::add_object): Pass object to cref_ if
11137 --cref.
11138 (Input_objects::archive_start): Likewise.
11139 (Input_objects::archive_stop): Likewise.
11140 (Input_objects::print_cref): New function.
11141 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
11142 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
11143 --cref.
11144 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
11145 function.
11146 * plugin.h (class Sized_pluginobj): Update declarations.
11147
8781f709
ILT
111482010-01-05 Ian Lance Taylor <iant@google.com>
11149
11150 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
11151 to is_default_version. Rename insdef to insdefault.
11152 (Symbol_table::add_from_relobj): Rename def to is_default_version
11153 and local to is_forced_local.
11154 (Symbol_table::add_from_pluginobj): Likewise.
11155 (Symbol_table::add_from_dynobj): Likewise.
11156 (Symbol_table::define_special_symbol): Rename insdef to
11157 insdefault.
11158
fe35d28d
ILT
111592010-01-04 Ian Lance Taylor <iant@google.com>
11160
30bc8c46
ILT
11161 PR 10980
11162 * options.h (class General_options): Add
11163 --allow-multiple-definition and -z muldefs.
11164 * resolve.cc (Symbol_table::should_override): Don't warn about a
11165 multiple symbol definition if --allow-multiple-definition or -z
11166 muldefs.
11167
7eaea549
ILT
11168 PR 10980
11169 * options.h (class General_options): Add --add-needed and
11170 --copy-dt-needed-entries. Tweak --as-needed help entry.
11171 * object.cc (Input_objects::check_dynamic_dependencies): Give an
11172 error if --copy-dt-needed-entries aka --add-needed is used and
11173 would cause a change in behaviour.
11174
fe35d28d
ILT
11175 PR 10980
11176 * options.h (class General_options): Add -G as a short version of
11177 --shared. Add no-op options -assert, -g, and -i.
11178
55a2bb35
ST
111792010-01-04 Sriraman Tallam <tmsriram@google.com>
11180
11181 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
11182 check for .text or .gnu.linkonce.t sections.
11183 * icf.cc (Icf::find_identical_sections): Ditto.
11184 Change the detection for mangled function name within the section
11185 name.
11186 * icf.h (is_section_foldable_candidate): New function.
11187
719328e1
ILT
111882009-12-30 Ian Lance Taylor <iant@google.com>
11189
11190 PR 10980
11191 * options.h (class General_options): Permit two dashes with
11192 --retain-symbols-file.
11193
d7bb5745
ILT
111942009-12-30 Ian Lance Taylor <iant@google.com>
11195
403a15dd
ILT
11196 PR 10979
11197 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
11198 don't put the file header and segment headers in the text
11199 segment.
11200
eda294df
ILT
11201 PR 10979
11202 * common.cc (Sort_commons::operator()): Stabilize sort when both
11203 entries are NULL.
11204 (Symbol_table::do_allocate_commons_list): When allocating common
11205 symbols, skip a symbol which is no longer common.
11206 * symtab.h (Symbol::is_common): Test whether the symbol comes from
11207 an object before checking its type.
11208 * testsuite/common_test_2.c: New file.
11209 * testsuite/common_test_3.c: New file.
11210 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
11211 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
11212 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
11213 (common_test_2_pic.o, common_test_2.so): New targets.
11214 (common_test_3_pic.o, common_test_3.so): New targets.
11215 * testsuite/Makefile.in: Rebuild.
11216
d7bb5745
ILT
11217 PR 10979
11218 * script.cc (read_input_script): If we see a new SECTIONS clause,
11219 and we have added an input section, give an error.
11220 * layout.h (class Layout): Add have_added_input_section function.
11221 Add have_added_input_section_ field.
11222 * layout.cc (Layout::Layout): Initialize
11223 have_added_input_section_.
11224 (Layout::layout): Set have_added_input_section_.
11225 (Layout::layout_eh_frame): Likewise.
11226
fc59c572
ILT
112272009-12-30 Ian Lance Taylor <iant@google.com>
11228
11229 PR 10931
11230 * options.h (class General_options): Add --sort-common option.
11231 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
11232 * common.cc (Sort_common): Add sort_order parameter to
11233 constructor. Add sort_order_ field.
11234 (Sort_commons::operator): Check sort_order_.
11235 (Symbol_table::allocate_commons): Determine the sort order.
11236 (Symbol_table::do_allocate_commons): Add sort_order parameter.
11237 Change all callers.
11238 (Symbol_table::do_allocate_commons_list): Likewise.
11239
1c74fab0
ILT
112402009-12-30 Ian Lance Taylor <iant@google.com>
11241
11242 PR 10916
11243 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
11244 symbols from this object, don't change the visibility of an
11245 undefined symbol.
11246 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
11247
6affe781
ILT
112482009-12-30 Ian Lance Taylor <iant@google.com>
11249
11250 PR 10861
11251 * script.h (class Version_script_info): Define Language enum.
11252 Update declarations. Define Glob, Exact, and Lookup types. Add
11253 new fields globals_, locals_, and is_finalized_.
11254 * script.cc: Various formatting fixes.
11255 (class Parser_closure): Change language_stack_ from a vector of
11256 std::string to one of Version_script_info::Language. Adjust all
11257 uses accordingly.
11258 (class Lazy_demangler): Remove.
11259 (struct Version_expression): Change language from std::string to
11260 Version_script_info::Language.
11261 (Version_script_info::Version_script_info): New function.
11262 (Version_script_info::~Version_script_info): Don't call clear.
11263 (Version_script_info::finalize): New function.
11264 (Version_script_info::build_lookup_tables): New function.
11265 (Version_script_info::build_expression_list_lookup): New
11266 function.
11267 (Version_script_info::get_symbol_version_helper): Rewrite to use
11268 lookup tables.
11269 (Version_script_info::print_expression_list): Adjust to use
11270 Version_script_info::Language.
11271 (script_push_lex_into_version_mode): Check that the version script
11272 has not been finalized.
11273 (version_script_push_lang): Change language string to
11274 Version_script_info::Language.
11275 * options.cc (Command_line::version_script): New function.
11276 * options.h (class General_options): Add finalize_dynamic_list
11277 function. Change version_script from declaration to definition.
11278 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
11279 * testsuite/version_script.map: Remove duplicate def of foo.
11280 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
11281 version_script.map.
11282 * testsuite/Makefile.in: Rebuild.
11283
818bf354
ILT
112842009-12-30 Ian Lance Taylor <iant@google.com>
11285
11286 PR 10843
11287 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
11288 if the input symbol index is 0, make the output symbol index 0.
11289
ebcc8304
ILT
112902009-12-30 Ian Lance Taylor <iant@google.com>
11291
11292 PR 10670
11293 * options.h (class General_options): Add -x/--discard-all.
11294 * object.cc (Sized_relobj::do_count_local_symbols): Handle
11295 --discard-all. If the local symbol needs a dynamic entry, check
11296 that before handling --discard-locals.
11297
176fe33f
ILT
112982009-12-30 Ian Lance Taylor <iant@google.com>
11299
bb321bb1
ILT
11300 PR 10450
11301 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
11302 flags to PF_R.
11303 (Output_segment::add_output_section): Don't change the flags if
11304 the type is PT_TLS.
11305
176fe33f
ILT
11306 PR 10450
11307 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
11308 GNU hash table if they need a dynamic value. Otherwise, don't add
11309 them if they are defined in a dynamic object or are forced local.
11310
e8cd95c7
ILT
113112009-12-29 Ian Lance Taylor <iant@google.com>
11312
1b81fb71
ILT
11313 PR 10450
11314 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
11315 .gnu.hash table for a 32-bit target.
11316
8d6d383d
ILT
11317 PR 10450
11318 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
11319 regular and a dynamic object only needs a dynamic symbol table
11320 entry if it is externally visible.
11321
e785ec03
ILT
11322 PR 10450
11323 * i386.cc (class Target_i386): Initialize global_offset_table_ in
11324 constructor. Add global_offset_table_ field.
11325 (Target_i386::got_section): Set global_offset_table_.
11326 (Target_i386::do_finalize_sections): Set global_offset_table_
11327 size.
11328 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
11329 in constructor. Add global_offset_table_ field.
11330 (Target_x86_64::got_section): Set global_offset_table_.
11331 (Target_x86_64::do_finalize_sections): Set global_offset_table_
11332 size.
11333
1a2dff53
ILT
11334 * layout.cc (Layout::Layout): Initialize increase_relro_.
11335 (Layout::get_output_section): Add is_relro, is_last_relro, and
11336 is_first_non_relro parameters. Change all callers.
11337 (Layout::choose_output_section): Likewise.
11338 (Layout::add_output_section_data): Likewise.
11339 (Layout::make_output_section): Likewise.
11340 (Layout::set_segment_offsets): Clear increase_relro when using a
11341 linker script.
11342 * layout.h (class Layout): Add increase_relro method. Add
11343 increase_relro_ field. Update declarations.
11344 * output.cc (Output_section::Output_section): Initialize
11345 is_last_relro_ and is_first_non_relro_.
11346 (Output_segment::add_output_section): Group relro sections is
11347 do_sort is true. Handle is_last_relro and is_first_non_relro.
11348 (Output_segment::maximum_alignment): Remove relro handling.
11349 (Output_segment::set_section_addresses): Add increase_relro
11350 parameter. Change all callers. Add initial alignment to align
11351 relro sections on separate page. Remove old relro handling.
11352 (Output_segment::set_section_list_addresses): Remove in_relro
11353 parameter. Change all callers.
11354 (Output_segment::set_offset): Add increase parameter. Change all
11355 callers. Remove old relro handling.
11356 * output.h (class Output_section): Add new methods: is_last_relro,
11357 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
11358 Add is_last_relro_ and is_first_non_relro_ fields.
11359 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
11360 Create separate .got.plt section. Call increase_relro.
11361 * x86_64.cc (Target_x86_64::got_section): Likewise.
11362 * testsuite/relro_script_test.t: Add .got.plt.
11363
f0ba79e2
ILT
11364 PR 10450
11365 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
11366 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
11367 (Layout::finalize): Call set_dynamic_symbol_size.
11368 (Layout::set_dynamic_symbol_size): New function.
11369 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
11370 set_dynamic_symbol_size.
11371
e8cd95c7
ILT
11372 PR 10450
11373 * output.h (class Output_section): Add is_entsize_zero_ field.
11374 * output.cc (Output_section::Output_section): Initialize
11375 is_entsize_zero_.
11376 (Output_section::set_entsize): If two different entsizes are
11377 requested, force it to zero.
11378 (Output_section::add_input_section): Set flags for .debug_str
11379 before updating section flags. Set entsize.
11380 (Output_section::update_flags_for_input_section): Set SHF_MERGE
11381 and SHF_STRING if all input sections have those flags.
11382
3e1b9a8a
RÁE
113832009-12-29 Rafael Espindola <espindola@google.com>
11384
11385 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
11386 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
11387 reporting.
3e1b9a8a 11388
3dcad376
ST
113892009-12-29 Sriraman Tallam <tmsriram@google.com>
11390
11391 * options.cc (General_options::parse_version): Allow -v to exit
11392 without an error if there is nothing to link.
11393
084e2665
ILT
113942009-12-29 Ian Lance Taylor <iant@google.com>
11395
11396 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
11397 using a version of gcc before 4.1.
11398 * configure: Rebuild.
11399
250acde3
CD
114002009-12-28 Chris Demetriou <cgd@google.com>
11401
11402 * attributes.cc (Output_attributes_section_data::do_write): Use
11403 std::vector::front rather than std::vector::data.
11404
99fff23b
ILT
114052009-12-28 Ian Lance Taylor <iant@google.com>
11406
11407 * symtab.h (class Symbol_table): Add enum Defined.
11408 * resolve.cc (Symbol_table::should_override): Add defined
11409 parameter. Change all callers. Test whether object is NULL
11410 before calling a method on it.
11411 (Symbol_table::report_resolve_problem): Add defined parameter.
11412 Change all callers.
11413 (Symbol_table::should_override_with_special): Likewise.
11414 * symtab.cc (Symbol_table::define_in_output_data): Add defined
11415 parameter. Change all callers.
11416 (Symbol_table::do_define_in_output_data): Likewise.
11417 (Symbol_table::define_in_output_segment): Likewise.
11418 (Symbol_table::do_define_in_output_segment): Likewise.
11419 (Symbol_table::define_as_constant): Likewise.
11420 (Symbol_table::do_define_as_constant): Likewise.
11421 * script.h (class Symbol_assignment): Add is_defsym parameter to
11422 constructor; change all callers.
11423 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
11424 parameter. Change all callers. Add is_defsym_ field.
11425 (class Parser_closure): Add parsing_defsym parameter to
11426 constructor; change all callers. Add parsing_defsym accessor
11427 function. Add parsing_defsym_ field.
11428
556bd683
ILT
114292009-12-28 Ian Lance Taylor <iant@google.com>
11430
11431 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 11432 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 11433
1782c879
ILT
114342009-12-23 Ian Lance Taylor <iant@google.com>
11435
11436 * i386.cc (Target_i386::do_calls_non_split): Recognize
11437 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
11438 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
11439 -fsplit-stack prologue when using %r11.
1782c879 11440
329ca2b1
ST
114412009-12-21 Sriraman Tallam <tmsriram@google.com>
11442
11443 * options.cc (General_options::parse_version): Make -v continue and do
11444 the link like GNU ld does.
11445
d675ff46
RÁE
114462009-12-17 Rafael Avila de Espindola <espindola@google.com>
11447
11448 * Makefile.am (CCFILES): Add timer.cc.
11449 (HFILES): Add timer.h.
11450 * configure.ac: Check for sysconf and times.
11451 * main.cc: include timer.h.
11452 (main): Use Timer instead of get_run_time.
11453 * timer.cc: New.
11454 * timer.h: New.
11455 * workqueue.cc: include timer.h.
11456 (Workqueue::find_and_run_task):
11457 Report user, sys and wall time.
11458 * Makefile.in: Regenerate.
11459 * config.in: Regenerate.
11460 * configure: Regenerate.
11461
d6344fb5
DK
114622009-12-16 Doug Kwan <dougkwan@google.com>
11463
11464 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
11465 sections.
11466 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
11467 relaxed input sections.
11468 * output.cc (Output_section::find_relaxed_input_section): Change
11469 return type to Output_relaxed_input_section pointer. Adjust code
11470 for new type of relaxed_input_section_map_.
11471 * output.h (Output_section::find_relaxed_input_section): Change
11472 return type to Output_relaxed_input_section pointer.
11473 (Output_section::Output_relaxed_input_section_by_input_section_map):
11474 New type.
11475 (Output_section::relaxed_input_section_map_): Change type to
11476 Output_section::Output_relaxed_input_section_by_input_section_map.
11477 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
11478 input section.
11479
0e0d5469
ILT
114802009-12-15 Ian Lance Taylor <iant@google.com>
11481
11482 * layout.cc (Layout::create_shstrtab): Only write out after input
11483 sections if we are compressing debug sections.
11484
0649a889
ILT
114852009-12-15 Ian Lance Taylor <iant@google.com>
11486
11487 * archive.cc (Archive::add_symbols): Only look up a symbol without
11488 a version if there is, in fact, a version.
11489
2ea97941
ILT
114902009-12-14 Ian Lance Taylor <iant@google.com>
11491
11492 Revert -Wshadow changes, all changes from:
11493 2009-12-11 Doug Kwan <dougkwan@google.com>
11494 2009-12-11 Nick Clifton <nickc@redhat.com>
11495 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
11496
b0eec2cc
DK
114972009-12-11 Doug Kwan <dougkwan@google.com>
11498
11499 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
11500 due to -Wshadow.
11501 * attributes.cc (Object_attribute::size): Ditto.
11502 (Attributes_section_data::size): Ditto.
11503 (Attributes_section_data::Attributes_section_data): Ditto.
11504 (Output_attributes_section_data::do_write): Ditto.
11505 * attributes.h (Object_attribute::set_type): Ditto.
11506 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
11507
91d6fa6a
NC
115082009-12-11 Nick Clifton <nickc@redhat.com>
11509
11510 * archive.cc: Fix shadowed variable warnings.
11511 * arm.cc: Likewise.
11512 * compressed_output.cc: Likewise.
11513 * compressed_output.h: Likewise.
11514 * configure: Likewise.
11515 * dwarf_reader.cc: Likewise.
11516 * dynobj.cc: Likewise.
11517 * dynobj.h: Likewise.
11518 * ehframe.cc: Likewise.
11519 * ehframe.h: Likewise.
11520 * errors.cc: Likewise.
11521 * expression.cc: Likewise.
11522 * fileread.cc: Likewise.
11523 * fileread.h: Likewise.
11524 * freebsd.h: Likewise.
11525 * i386.cc: Likewise.
11526 * icf.cc: Likewise.
11527 * incremental.h: Likewise.
11528 * layout.cc: Likewise.
11529 * layout.h: Likewise.
11530 * mapfile.cc: Likewise.
11531 * merge.cc: Likewise.
11532 * merge.h: Likewise.
11533 * object.cc: Likewise.
11534 * object.h: Likewise.
11535 * options.h: Likewise.
11536 * output.cc: Likewise.
11537 * output.h: Likewise.
11538 * parameters.cc: Likewise.
11539 * plugin.cc: Likewise.
11540 * powerpc.cc: Likewise.
11541 * reduced_debug_output.cc: Likewise.
11542 * reduced_debug_output.h: Likewise.
11543 * reloc.cc: Likewise.
11544 * reloc.h: Likewise.
11545 * resolve.cc: Likewise.
11546 * script-sections.cc: Likewise.
11547 * script.cc: Likewise.
11548 * script.h: Likewise.
11549 * sparc.cc: Likewise.
11550 * symtab.cc: Likewise.
11551 * symtab.h: Likewise.
11552 * target-select.cc: Likewise.
11553 * target-select.h: Likewise.
11554 * token.h: Likewise.
11555 * workqueue.cc: Likewise.
11556 * workqueue.h: Likewise.
11557 * x86_64.cc: Likewise.
11558
a0351a69
DK
115592009-12-10 Doug Kwan <dougkwan@google.com>
11560
11561 * arm.cc (attributes.h): New include.
11562 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
11563 (Arm_relobj::~Arm_relobj): Delete object pointed by
11564 attributes_section_data_.
11565 (Arm_relobj::attributes_section_data): New method definition.
11566 (Arm_relobj::attributes_section_data_): New data member declaration.
11567 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
11568 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
11569 attributes_section_data_.
11570 (Arm_dynobj::attributes_section_data): New method definition.
11571 (Arm_dynobj::attributes_section_data_): New data member declaration.
11572 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
11573 initialization value of may_use_blx_ to false.
2e702c99 11574 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
11575 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
11576 object attributes to compute results instead of hard-coding.
11577 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
11578 Target_arm::get_secondary_compatible_arch,
11579 Target_arm::set_secondary_compatible_arch
11580 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11581 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
11582 New method declarations.
11583 (Target_arm::get_aeabi_object_attribute): New method definition.
11584 (Target_arm::attributes_section_data_): New data member declaration.
11585 (read_arm_attributes_section): New template definition.
11586 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
11587 (Arm_dynobj::do_read_symbols): Ditto.
11588 (Target_arm::do_finalize_sections): Merge attributes sections from
11589 input. Check for BLX use after attributes section merging.
11590 Fix __exidx_start and __exidx_end visibility. Create an
11591 .ARM.attributes section if necessary.
11592 (Target_arm::get_secondary_compatible_arch,
11593 Target_arm::set_secondary_compatible_arch,
11594 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11595 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 11596 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
11597 New method definitions.
11598
b59befec
ILT
115992009-12-09 Ian Lance Taylor <iant@google.com>
11600
11601 * plugin.cc (Plugin::load): Don't cast from void* to a function
11602 pointer.
11603
1276bc89
ILT
116042009-12-09 Ian Lance Taylor <iant@google.com>
11605
11606 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
11607 information fields.
11608
2f2de248
L
116092009-12-09 H.J. Lu <hongjiu.lu@intel.com>
11610
11611 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
11612 Replace two_file_shared_1.so with two_file_shared_2.so.
11613 * testsuite/Makefile.in: Regenerated.
11614
4f787271
DK
116152009-12-08 Doug Kwan <dougkwan@google.com>
11616
11617 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
11618 (HFILES): Add attributes.h and int_encoding.h.
11619 * Makefile.in: Regenerate.
11620 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
11621 function definitions to int_encoding.cc
11622 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
11623 prototypes to int_encoding.h
11624 * reduced_debug_output.cc (int_encoding.h): New include.
11625 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
11626 function definitions to int_encoding.cc
11627 (insert_into_vector, read_from_pointer): Move template definitions to
11628 int_encoding.h
11629 * attributes.cc: New file.
11630 * attributes.h: New file.
11631 * int_encoding.cc: New file.
11632 * int_encoding.h: New file.
11633
20b52f1a
RÁE
116342009-12-07 Rafael Avila de Espindola <espindola@google.com>
11635
11636 PR gold/11055
11637 * incremental-dump.cc (dump_incremental_inputs): New.
11638 (main): Use dump_incremental_inputs.
11639
53d7974c
L
116402009-12-07 H.J. Lu <hongjiu.lu@intel.com>
11641
11642 PR gold/10893
11643 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
11644 checking elfcpp::STT_FUNC.
11645 (Target_i386::Relocate::relocate): Likewise.
11646 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
11647
11648 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
11649 symbols from shared libraries into normal FUNC symbols.
11650
11651 * symtab.h (Symbol): Add is_func and use it.
11652
05a352e6
DK
116532009-12-05 Doug Kwan <dougkwan@google.com>
11654
11655 * arm.cc (Target_arm::arm_info): Initialize new fields
11656 attributes_section and attributes_vendor.
11657 * i386.cc (Target_i386::i386_info): Same.
11658 * object.cc (Sized_relobj::do_layout): Skip attribute section.
11659 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
11660 fields attributes_section and attributes_vendor.
53d7974c 11661 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
11662 * target.h (Target::attributes_section, Target::attributes_vendor,
11663 Target::is_attributes_section, Target::attribute_arg_type,
11664 Target::attributes_order): New method definitions.
11665 (Target::Target_info::attributes_section,
11666 Target::Target_info::attributes_vendor): New fields.
11667 (Target::do_attribute_arg_type, Target::do_attributes_order): New
11668 virtual method definitions.
11669 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
11670 attributes_section and attributes_vendor.
11671 * testsuite/testfile.cc (Target_test::test_target_info): Same.
11672
f4e5969c
DK
116732009-12-05 Doug Kwan <dougkwan@google.com>
11674
11675 * arm.cc: Update comments about interworking and stub generation.
11676 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
11677 considered as non-PIC.
11678 (Arm_relocate_functions::base_abs): Fix formatting.
11679 (Arm_relocate_functions::got_prel): Fix comment. Change interface
11680 of function to use GOT entry address instead of offset.
11681 (Target_arm::Scan::global): Issue an error if a symbol would need a
11682 PLT does not get one because it is untyped. Remove code to create
11683 dynamic symbols for relative branches.
11684 (Target_arm::Relocate::relocate: Use 0 instead of false since function
11685 takes unsigned integer instead of boolean.
11686
1abce4a6
L
116872009-12-05 H.J. Lu <hongjiu.lu@intel.com>
11688
11689 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
11690 (two_file_test_LDADD): Likewise.
11691 (common_test_1_LDADD): Likewise.
11692 (exception_test_LDADD) Likewise.
11693 (weak_test_LDADD): Likewise.
11694 (many_sections_test_LDADD): Likewise.
11695 (initpri1_LDADD): Likewise.
11696 (script_test_1_LDADD): Likewise.
11697 (script_test_2_LDADD): Likewise.
11698 (justsyms_LDADD): Likewise.
11699 (binary_test_LDADD): Likewise.
11700 (large_LDADD): Likewise.
11701 * testsuite/Makefile.in: Regenerated.
11702
adcf2816 117032009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 11704
adcf2816
L
11705 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
11706 (Symbol_table::override_with_special): Likewise.
11707 (Symbol_table::add_from_object): Likewise.
11708
28e67f5d
RÁE
117092009-12-04 Rafael Avila de Espindola <espindola@google.com>
11710
11711 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11712 Don't set the data_offset twice.
11713
ae10a101
RÁE
117142009-12-04 Rafael Avila de Espindola <espindola@google.com>
11715
11716 * testsuite/Makefile.in: Regenerate.
11717
f59f41f3
DK
117182009-12-03 Doug Kwan <dougkwan@google.com>
11719
11720 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
11721 (Target_arm::do_finalize_sections): Add parameter for symbol table
11722 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
11723 * i386.cc (Target_i386::do_finalize_sections): Add an additional
11724 parameter for symbol table pointer.
11725 * layout.cc (Layout::finalize): Call Target::finalize_sections with
11726 an additional parameter for a pointer to symbol table.
11727 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
11728 parameter for a symbol table pointer.
11729 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
11730 * target.h (Target::finalize_sections, Target::do_finalize_sections):
11731 Ditto.
11732 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
11733 parameter for a symbol table pointer.
11734
ca55d848
RÁE
117352009-12-03 Rafael Avila de Espindola <espindola@google.com>
11736
11737 * incremental.cc (Incremental_inputs_header)
11738 (Incremental_inputs_header_write, Incremental_inputs_entry)
11739 (Incremental_inputs_entry_write): Move ...
11740 * incremental.h (Incremental_inputs_header)
11741 (Incremental_inputs_header_write, Incremental_inputs_entry)
11742 (Incremental_inputs_entry_write): here.
11743
3aec4f9c
RÁE
117442009-12-02 Rafael Avila de Espindola <espindola@google.com>
11745
11746 * incremental.cc (make_sized_incremental_binary): Set the target.
11747 Error if it is incompatible.
11748 * output.h (Output_file): Add filename method.
11749
9c0ae74d
RÁE
117502009-12-02 Rafael Avila de Espindola <espindola@google.com>
11751
11752 * incremental.cc (Incremental_inputs_entry): Remove unused argument
11753 from the get_* methods.
11754
a45500ae
RÁE
117552009-12-02 Rafael Avila de Espindola <espindola@google.com>
11756
11757 * incremental-dump.cc (main): Check that the offeset of a script is 0.
11758 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11759 Write 0 for the data_offset of scripts.
11760
325e6408
RÁE
117612009-12-02 Rafael Avila de Espindola <espindola@google.com>
11762
11763 * testsuite/Makefile.am: Add the incremental_test.sh test.
11764 * testsuite/incremental_test.sh: New.
11765 * testsuite/incremental_test_1.c: New.
11766 * testsuite/incremental_test_2.c: New.
11767
954c3e2e
RÁE
117682009-12-01 Rafael Avila de Espindola <espindola@google.com>
11769
703d02da 11770 * incremental-dump.cc (main): Fix typos.
954c3e2e 11771
f8086623
RÁE
117722009-11-27 Rafael Avila de Espindola <espindola@google.com>
11773
11774 PR gold/11025
11775 * incremental-dump.cc (main): Use llu to print 64 bit values.
11776
3b0dd6ac
L
117772009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
11778 H.J. Lu <hongjiu.lu@intel.com>
11779
11780 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
11781 $(LIBDL).
11782 (incremental_dump_LDADD): Likewise.
11783 * Makefile.in: Regenerated.
11784
a6d1ef57 117852009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 11786
a6d1ef57
DK
11787 Revert:
11788
11789 2009-11-25 Doug Kwan <dougkwan@google.com>
11790
11791 * arm.cc (Target_arm::Target_arm): Move method definition
11792 outside of class definition. Add code to handle
11793 --target1-rel, --target1-abs and --target2= options.
11794 (Target_arm::get_reloc_reloc_type): Change method to be
11795 non-static and const.
11796 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
11797 New data member declaration.
11798 (Target_arm::Scan::local, Target_arm::Scan::global,
11799 Target_arm::Relocate::relocate,
11800 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11801 Adjust call to Target_arm::get_real_reloc_type.
11802 (Target_arm::get_real_reloc_type): Use command line options
11803 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11804 * options.h (--target1-rel, --target1-abs, --target2): New
11805 ARM-only options.
11806
50aeb7d4
DK
118072009-11-25 Doug Kwan <dougkwan@google.com>
11808
11809 * arm.cc (Target_arm::Target_arm): Move method definition outside of
11810 class definition. Add code to handle --target1-rel, --target1-abs
11811 and --target2= options.
11812 (Target_arm::get_reloc_reloc_type): Change method to be non-static
11813 and const.
11814 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
11815 member declaration.
11816 (Target_arm::Scan::local, Target_arm::Scan::global,
11817 Target_arm::Relocate::relocate,
11818 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
11819 call to Target_arm::get_real_reloc_type.
11820 (Target_arm::get_real_reloc_type): Use command line options to
11821 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11822 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
11823 options.
11824
51938283
DK
118252009-11-25 Doug Kwan <dougkwan@google.com>
11826
11827 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
11828 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
11829 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
11830 formatting.
11831 (Arm_relocate_functions::thm_call): Replace body with a call to
11832 Arm_relocate_functions::thumb_branch_common.
11833 (Arm_relocate_functions::thm_jump24,
11834 Arm_relocate_functions::thm_xpc22): New method definitions.
11835 (Arm_relocate_functions::thumb_branch_common): New method definition.
11836 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
11837 operator.
11838 (Target_arm::Relocate::relocate): Adjust call to thm_call.
11839 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
11840
e2b8f3c4
RÁE
118412009-11-24 Rafael Avila de Espindola <espindola@google.com>
11842
11843 * Makefile.am: Build incremental-dump
11844 * Makefile.in: Regenerate.
11845 * incremental-dump.cc: New.
11846 * incremental.cc (Incremental_inputs_header_data,
11847 Incremental_inputs_entry_data): Move to incremental.h
11848 * incremental.h: (Incremental_inputs_header_data,
11849 Incremental_inputs_entry_data): Move from incremental.cc
11850
bcba9aec
RÁE
118512009-11-24 Rafael Avila de Espindola <espindola@google.com>
11852
11853 * incremental.cc (Incremental_inputs_header,
11854 Incremental_inputs_header_write, Incremental_inputs_entry,
11855 Incremental_inputs_entry_write): Add a typedef with the data type.
11856
7c3afe08
RÁE
118572009-11-24 Rafael Avila de Espindola <espindola@google.com>
11858
11859 * incremental.cc (Incremental_inputs_header,
11860 Incremental_inputs_header_write, Incremental_inputs_entry,
11861 Incremental_inputs_entry_write): Update comment about which
11862 type has the filed descriptions.
11863
d204b6e9
DK
118642009-11-15 Doug Kwan <dougkwan@google.com>
11865
11866 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
11867 (Arm_relocate_functions::arm_branch_common): Change method defintion
11868 in class definition to a method declaration and update list of formal
11869 parameters.
11870 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
11871 Arm_relocation_functions::jump24): Adjust call to
11872 Arm_relocate_functions::arm_branch_common. Update list of formal
11873 parameters.
11874 (Arm_relocate_functions::xpc25): New method definition.
11875 (Arm_relocate_functions::arm_branch_common): Move method defintion
11876 out from class definition. Use stubs for mode-switching and extending
11877 branch ranges.
11878 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
11879 specially. Change code to enable use of stubs in ARM branches.
11880
43d12afe
DK
118812009-11-10 Doug Kwan <dougkwan@google.com>
11882
11883 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
11884 in method declaration.
11885 (Target_arm::relocate_stub): New method declaration.
11886 (Target_arm::default_target): Change to return a pointer instead of
11887 a const reference.
11888 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
11889 Target_arm::default_target.
11890 (Arm_Relobj::do_relocate_sections): Remove options paramater in
11891 method definition.
11892 (Target_arm::relocate_section): Adjust view.
11893 (Target_arm::relocate_stub): New method definition.
11894
ac33a407
DK
118952009-11-10 Doug Kwan <dougkwan@google.com>
11896
11897 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
11898 a format warning.
11899 * incremental.cc (open_incremental_binary): Initialized local
11900 variables to avoid warnings.
11901 * object.cc (make_elf_object): Ditto.
11902 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
11903 a format warning.
e1df38aa 11904
88ee28e9
L
11905009-11-09 H.J. Lu <hongjiu.lu@intel.com>
11906
11907 PR gold/10930
11908 * testsuite/plugin_test.c: Include "config.h".
11909
2daedcd6
DK
119102009-11-09 Doug Kwan <dougkwan@google.com>
11911
11912 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
11913 (arm_symbol_value): Remove.
11914 (Arm_relocate_functions::arm_branch_common,
11915 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
11916 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
11917 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
11918 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
11919 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
11920 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
11921 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
11922 Arm_relocate_functions::thm_mobw_abs_nc,
11923 Arm_relocate_functions::thm_mov_abs,
11924 Arm_relocate_functions::movw_prel_nc,
11925 Arm_relocate_functions::thm_movt_abs,
11926 Arm_relocate_functions::movt_prel,
11927 Arm_relocate_functions::thm_movw_prel_nc,
11928 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
11929 (Target_arm::Relocate::relocate): Only decompose address into two
11930 parts if relocation type uses the thumb-bit and pass the actual
11931 bit instead of a flag indicating that the thumb-bit is used. Adjust
11932 calls to methods in Arm_relocate_functions for this change.
11933
1276bc89 119342009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
11935
11936 PR 10925
11937 * reloc.cc: Instantiate
11938 Sized_relobj::initialize_input_to_output_maps and
11939 Sized_relobj:free_input_to_output_maps.
11940
e53ad1b5
ILT
119412009-11-06 Ian Lance Taylor <iant@google.com>
11942
11943 PR 10876
11944 * defstd.cc (in_segment): Set only_if_ref true for "end".
11945
eb44217c
DK
119462009-11-06 Doug Kwan <dougkwan@google.com>
11947
11948 * arm.cc (class Reloc_stub): Correct a comment.
11949 (Target_arm::Target_arm): Initialize arm_input_section_map_.
11950 (Target_arm::scan_section_for_stubs): New method declaration.
11951 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
11952 Change methods from private to protected.
11953 (Target_arm::do_may_relax): New method definition.
11954 (Target_arm::do_relax, Target_arm::group_sections,
11955 Target_arm::scan_reloc_for_stub,
11956 Target_arm::scan_reloc_section_for_stubs): New method declarations.
11957 (Target_arm::arm_input_section_map_): New data member declaration.
11958 (Target_arm::scan_reloc_for_stub,
11959 Target_arm::scan_reloc_section_for_stubs,
11960 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
11961 Target_arm::do_relax): New method definitions.
11962
5d329b7d
ILT
119632009-11-06 Mikolaj Zalewski <mikolaj@google.com>
11964
11965 * configure.ac: Check for (struct stat)::st_mtim
11966 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
11967 * config.in: Regenerate.
11968 * configure: Regenerate.
11969
96a0d71b
ILT
119702009-11-05 Ian Lance Taylor <iant@google.com>
11971
11972 PR 10910
11973 * output.cc (Output_segment::add_output_section): Add missing
11974 return statement.
11975
594c8e5e
ILT
119762009-11-04 Ian Lance Taylor <iant@google.com>
11977
11978 PR 10880
11979 * object.h (class Object): Add is_needed and set_is_needed
11980 methods. Add is_needed_ field. Make bool fields into bitfields.
11981 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
11982 defined in a dynamic object and referenced by a regular object,
11983 set is_needed for the dynamic object.
11984 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
11985 if the file is marked with as_needed and it is not needed.
11986
22b127cc
ILT
119872009-11-04 Ian Lance Taylor <iant@google.com>
11988
11989 PR 10887
11990 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
11991 tags if data is discarded by linker script.
11992 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11993 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11994 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11995 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11996
f5c870d2
ILT
119972009-11-04 Ian Lance Taylor <iant@google.com>
11998
11999 * layout.cc (Layout::get_output_section): Add is_interp and
12000 is_dynamic_linker_section parameters. Change all callers.
12001 (Layout::choose_output_section): Likewise.
12002 (Layout::make_output_section): Likewise.
12003 (Layout::add_output_section_data): Add is_dynamic_linker_section
12004 parameter. Change all callers.
12005 * layout.h (class Layout): Update declarations.
12006 * output.h (class Output_section): Add is_interp, set_is_interp,
12007 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
12008 Add is_interp_, is_dynamic_linker_section_ fields. Change
12009 generate_code_fills_at_write_ to a bitfield.
12010 * output.cc (Output_section::Output_sections): Initialize new
12011 fields.
12012 (Output_segment::add_output_section): Add do_sort parameter.
12013 Change all callers.
12014
1ae4d23b
ILT
120152009-11-03 Ian Lance Taylor <iant@google.com>
12016
12017 PR 10860
12018 * options.h (class General_options): Add --warn-common.
12019 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
12020 merging two common symbols.
12021 (Symbol_table::should_override): Handle --warn-common when merging
12022 a common symbol with a defined symbol. Use report_resolve_problem
12023 for multiple definitions.
12024 (Symbol_table::report_resolve_problem): New function.
12025 * symtab.h (class Symbol_table): Declare report_resolve_problem.
12026
55da9579
DK
120272009-11-03 Doug Kwan <dougkwan@google.com>
12028
12029 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
12030 stub_factory_.
12031 (Target_arm::stub_factory): New method definition.
12032 (Target_arm::new_arm_input_section,
12033 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
12034 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 12035 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
12036 New type definitions.
12037 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
12038 member declarations.
12039 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
12040 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
12041 New method definitions.
12042
37a9ac43
ILT
120432009-11-03 Ian Lance Taylor <iant@google.com>
12044
12045 * options.h (class General_options): Add --warn_constructors.
12046
b3d6a3d4
ILT
120472009-11-03 Ian Lance Taylor <iant@google.com>
12048
12049 PR 10893
12050 * defstd.cc (in_section): Add entries for __rel_iplt_start,
12051 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
12052
934b01dd
ILT
120532009-11-03 Ian Lance Taylor <iant@google.com>
12054
12055 PR 10895
12056 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
12057 --msgid-bugs-address.
12058 (install-pdf): New target.
12059 (install-data_yes): Look up one directory to find mkinstalldirs.
12060
03c1939b
L
120612009-11-03 H.J. Lu <hongjiu.lu@intel.com>
12062
12063 * po/Make-in (.po.gmo): Don't generate .gmo files in source
12064 tree.
12065
ebd95253
DK
120662009-10-30 Doug Kwan <dougkwan@google.com>
12067
12068 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
12069
e9bbb538
DK
120702009-10-30 Doug Kwan <dougkwan@google.com>
12071
12072 * arm.cc (Stub_addend_reader): New struct template definition
12073 and partial specializations.
12074 (Stub_addend_reader::operator()): New method definition for a
12075 partially specialized template.
12076
d5b40221
DK
120772009-10-30 Doug Kwan <dougkwan@google.com>
12078
12079 * arm.cc (Arm_relobj::processor_specific_flags): New method
12080 definition.
12081 (Arm_relobj::do_read_symbols): New method declaration.
12082 (Arm_relobj::processor_specific_flags_): New data member declaration.
12083 (Arm_dynobj): New class definition.
12084 (Target_arm::do_finalize_sections): Add input_objects parameter.
12085 (Target_arm::do_adjust_elf_header): New method declaration.
12086 (Target_arm::are_eabi_versions_compatible,
12087 (Target_arm::merge_processor_specific_flags): New method declaration.
12088 (Target_arm::do_make_elf_object): New overloaded method definitions
12089 and declaration.
12090 (Arm_relobj::do_read_symbols): New method definition.
12091 (Arm_dynobj::do_read_symbols): Ditto.
12092 (Target_arm::do_finalize_sections): Add input_objects parameters.
12093 Merge processor-specific flags from all input objects.
12094 (Target_arm::are_eabi_versions_compatible,
12095 Target_arm::merge_processor_specific_flags,
12096 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
12097 New method definitions.
12098 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
12099 Input_objects pointer type parameter.
12100 * layout.cc (Layout::finalize): Pass input objects to target's.
12101 finalize_sections function.
12102 * output.cc (Output_file_header::do_sized_write): Set ELF file
12103 header's processor-specific flags.
12104 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
12105 Input_objects pointer type parameter.
12106 * sparc.cc (Target_sparc::do_finalize_sections): Same.
12107 * target.h (Input_objects): New forward class declaration.
12108 (Target::processor_specific_flags,
12109 Target::are_processor_specific_flags_sect): New method definitions.
12110 (Target::finalize_sections): Add input_objects parameter.
12111 (Target::Target): Initialize processor_specific_flags_ and
12112 are_processor_specific_flags_set_.
12113 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
12114 parameter.
12115 (Target::set_processor_specific_flags): New method definition.
12116 (Target::processor_specific_flags_,
12117 Target::are_processor_specific_flags_set_): New data member
12118 declarations.
12119 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
12120 Input_objects pointer type parameter.
12121
ebabffbd
DK
121222009-10-30 Doug Kwan <dougkwan@google.com>
12123
12124 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
12125
ad0f2072
ILT
121262009-10-28 Ian Lance Taylor <iant@google.com>
12127
12128 * object.h (class Relobj): Drop options parameter from
12129 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
12130 do_scan_relocs, do_relocate. Change all callers.
12131 (class Sized_relobj): Drop options parameters from
12132 do_gc_process_relocs, do_scan_relocs, do_relocate,
12133 do_relocate_sections, relocate_sections, emit_relocs_scan,
12134 emit_relocs_scan_reltype. Change all callers.
12135 (struct Relocate_info): Remove options field and all references to
12136 it.
12137 * reloc.h (class Read_relocs): Remove options constructor
12138 parameter and options_ field. Change all callers.
12139 (class Gc_process_relocs, class Scan_relocs): Likewise.
12140 (class Relocate_task): Likewise.
12141 * target-reloc.h (scan_relocs): Remove options parameter. Change
12142 all callers.
12143 (scan_relocatable_relocs): Likewise.
12144 * target.h (class Sized_target): Remove options parameter from
12145 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
12146 all callers.
12147 * gc.h (gc_process_relocs): Remove options parameter. Change all
12148 callers.
12149 * arm.cc: Update functions to remove options parameters.
12150 * i386.cc: Likewise.
12151 * powerpc.cc: Likewise.
12152 * sparc.cc: Likewise.
12153 * x86_64.cc: Likewise.
12154 * testsuite/testfile.cc: Likewise.
12155
8ffa3667
DK
121562009-10-28 Doug Kwan <dougkwan@google.com>
12157
12158 * arm.cc (Arm_relobj): New class definition.
e1df38aa 12159 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
12160 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
12161 New method definitions.
12162
40f36857
CC
121632009-10-28 Cary Coutant <ccoutant@google.com>
12164
12165 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
12166 (Plugin::cleanup_done_): New member.
12167 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
12168 (Plugin_manager::cleanup_done_): Remove.
12169 (Plugin_manager::add_input_file): Edit error message.
12170 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
12171 (Plugin_manager::cleanup): Remove use of cleanup_done_.
12172
2c849493
ILT
121732009-10-27 Mikolaj Zalewski <mikolajz@google.com>
12174
12175 * fileread.cc: (File_read::View::~View): Use the new
12176 data_ownership_ filed.
12177 (File_read::~File_read): Dispose the new whole_file_view_.
12178 (File_read::open): Mmap the whole file if needed.
12179 (File_read::open): Use whole_file_view_ instead of contents_.
12180 (File_read::find_view): Use whole_file_view_ if applicable.
12181 (File_read::do_read): Use whole_file_view_ instead of contents_.
12182 (File_read::make_view): Use whole_file_view_ instead of contents_,
12183 update File_read::View::View call.
12184 (File_read::find_or_make_view): Update File_read::View::View
12185 call.
12186 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
12187 remove contents_
12188 (File_read::View::Data_ownership): New enum.
12189 (File_read::View::View): Replace bool mapped_ with Data_ownership
12190 argument.
12191 (File_read::View::mapped_): Remove (replaced by data_ownership_).
12192 (File_read::View::data_ownership_): New field.
12193 (File_read::contents_): Remove (replaced by whole_file_view_).
12194 (File_read::whole_file_view_): New field.
12195 * options.h (class General_options): Add --keep-files-mapped.
12196
24998053
CC
121972009-10-27 Cary Coutant <ccoutant@google.com>
12198
12199 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
12200 * testsuite/Makefile.am (plugin_test_5): New test case.
12201 * testsuite/Makefile.in: Regenerate.
12202
72adc4fa
DK
122032009-10-25 Doug Kwan <dougkwan@google.com>
12204
12205 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
12206 from private to protected to allow access by child class.
12207 (Sized_relobj::do_relocate_sections): New method declaration.
12208 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 12209 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
12210 Sized_relobj::relocate_sections. Instantiate template explicitly
12211 for different target sizes and endianity.
12212
07f508a2
DK
122132009-10-24 Doug Kwan <dougkwan@google.com>
12214
12215 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
12216 (Arm_input_section::as_arm_input_section): New method.
12217 (Arm_output_section): New class definition.
12218 (Arm_output_section::create_stub_group,
12219 Arm_output_section::group_sections): New method definitions.
12220
10ad9fe5
DK
122212009-10-22 Doug Kwan <dougkwan@google.com>
12222
12223 * arm.cc (Arm_input_section): New class definition.
12224 (Arm_input_section::init, Arm_input_section:do_write,
12225 Arm_input_section::set_final_data_size,
12226 Arm_input_section::do_reset_address_and_file_offset): New method
12227 definitions.
12228
56ee5e00
DK
122292009-10-21 Doug Kwan <dougkwan@google.com>
12230
12231 * arm.cc (Stub_table, Arm_input_section): New forward class
12232 declarations.
12233 (Stub_table): New class defintion.
12234 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
12235 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
12236 New method definition.
12237
b569affa
DK
122382009-10-21 Doug Kwan <dougkwan@google.com>
12239
12240 * arm.cc: Update copyright comments.
12241 (Target_arm): New forward class template declaration.
12242 (Arm_address): New type.
12243 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
12244 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
12245 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
12246 constants.
12247 (Insn_template): Same.
12248 (DEF_STUBS): New macro.
12249 (Stub_type): New enum type.
12250 (Stub_template): New class definition.
12251 (Stub): Same.
12252 (Reloc_stub): Same.
12253 (Stub_factory): Same.
12254 (Target_arm::Target_arm): Initialize may_use_blx_ and
12255 should_force_pic_veneer_.
12256 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
12257 Target_arm::should_force_pic_veneer,
12258 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
12259 Target_arm::using_thumb_only, Target_arm:;default_target): New
12260 method defintions.
12261 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
12262 New data member declarations.
12263 (Insn_template::size, Insn_template::alignment): New method defintions.
12264 (Stub_template::Stub_template): New method definition.
12265 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
12266 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
12267 (Stub_factory::Stub_factory): New method definition.
12268 * gold.h (string_hash): New template.
12269 * output.h (Input_section_specifier::hash_value): Use
12270 gold::string_hash.
12271 (Input_section_specifier::string_hash): Remove.
12272 * stringpool.cc (Stringpool_template::string_hash): Use
12273 gold::string_hash.
12274
6c172549
DK
122752009-10-20 Doug Kwan <dougkwan@google.com>
12276
12277 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
12278 symbols of relaxed input sections.
12279 * output.h (Output_section::find_relaxed_input_section): Make
12280 method public.
12281
c5617f2f
DK
122822009-10-16 Doug Kwan <dougkwan@google.com>
12283
12284 * dynobj.cc (Versions::Versions): Initialize version_script_.
12285 Only insert base version symbol definition for a shared object
12286 if version script defines any version versions.
12287 (Versions::define_base_version): New method definition.
12288 (Versions::add_def): Check that base version is not needed.
12289 (Versions::add_need): Define base version lazily.
12290 * dynobj.h (Versions::define_base_version): New method declaration.
12291 (Versions::needs_base_version_): New data member declaration.
12292 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
12293 (check_DATA): Add no_version_test.stdout.
12294 (libno_version_test.so, no_version_test.o no_version_test.stdout):
12295 New make rules.
12296 * testsuite/Makefile.in: Regenerate.
12297 * testsuite/no_version_test.c: New file.
12298 * testsuite/no_version_test.sh: Ditto.
12299
3c12dcdb
DK
123002009-10-16 Doug Kwan <dougkwan@google.com>
12301
12302 * expression.cc (class Segment_start_expression): New class definition.
12303 (Segment_start_expression::value): New method definition.
12304 (script_exp_function_segment_start): Return a new
12305 Segment_start_expression.
12306 * gold/script-c.h (script_saw_segment_start_expression): New function
12307 prototype.
12308 * script-sections.cc (Script_sections::Script_sections): Initialize
12309 SAW_SEGMENT_START_EXPRESSION_ to false.
12310 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
12311 and -Tbbs options to specify section addresses if given in
12312 command line and no SEGMENT_START expression is seen in a script.
12313 * script-sections.h (Script_sections::saw_segment_start_expression,
12314 Script_sections::set_saw_segment_start_expression): New method
12315 definition.
12316 (Script_sections::saw_segment_start_expression_): New data member
12317 declaration.
12318 * script.cc (script_saw_segment_start_expression): New function.
12319 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
12320 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
12321 script_test_7.sh and script_test_8.sh.
12322 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
12323 script_test_8.stdout.
12324 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
12325 (script_test_6, script_test_6.stdout, script_test_7,
12326 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
12327 * Makefile.in: Regenerate.
12328 * testsuite/script_test_6.sh: New file.
12329 * testsuite/script_test_6.t: Same.
12330 * testsuite/script_test_7.sh: Same.
12331 * testsuite/script_test_7.t: Same.
12332 * testsuite/script_test_8.sh: Same.
12333
64b1ae37
DK
123342009-10-16 Doug Kwan <dougkwan@google.com>
12335
12336 * output.cc (Output_segment::set_section_list_address): Cast
12337 expressions to unsigned long long type to avoid format warnings.
12338
661be1e2
ILT
123392009-10-15 Ian Lance Taylor <iant@google.com>
12340
12edd763 12341 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 12342 dot assignment to script_sections_.
12edd763
ILT
12343 * script-sections.cc (Script_sections::add_dot_assignment):
12344 Initialize if necessary.
12345
68b6574b
ILT
12346 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
12347 program headers with no load segment if there is a linker script.
12348
661be1e2
ILT
12349 * layout.cc (Layout::set_segment_offsets): Align the file offset
12350 to the segment aligment for -N or -n with no load segment.
12351 * output.cc (Output_segment::add_output_section): Don't crash if
12352 the first section is a TLS section.
12353 (Output_segment::set_section_list_addresses): Print an error
12354 message if the address moves backward in a linker script.
12355 * script-sections.cc
12356 (Output_section_element_input::set_section_addresses): Don't
12357 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
12358 (Orphan_output_section::set_section_addresses): Likewise.
12359
f15f61a7
DK
123602009-10-15 Doug Kwan <dougkwan@google.com>
12361
12362 * layout.cc (Layout::finish_dynamic_section): Generate tags
12363 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
12364 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
12365 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
12366
82bb573a
ILT
123672009-10-14 Ian Lance Taylor <iant@google.com>
12368
12369 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
12370 fields.
12371 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
12372 data_shdr fields of relinfo.
12373 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
12374 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
12375 R_386_TLS_LDO_32, adjust based on section flags.
12376 (Target_i386::Relocate::fix_up_ldo): Remove.
12377
374ad285
ILT
123782009-10-13 Ian Lance Taylor <iant@google.com>
12379
12380 Add support for -pie.
12381 * options.h (class General_options): Add -pie and
12382 --pic-executable.
12383 (General_options::output_is_position_independent): Test -pie.
12384 (General_options::output_is_executable): Return true if not shared
12385 and not relocatable.
12386 (General_options::output_is_pie): Remove.
12387 * options.cc (General_options::finalize): Reject incompatible uses
12388 of -pie.
12389 * gold.cc (queue_middle_tasks): A -pie link is not static.
12390 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
12391 * symtab.cc (Symbol::final_value_is_known): Return false if
12392 output_is_position_independent.
12393 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
12394 output_is_position_independent.
12395 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
12396 output_is_position_independent.
12397 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
12398 output_is_position_independent.
12399 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
12400 two_file_pie_test.
12401 (basic_pie_test.o, basic_pie_test): New targets.
12402 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
12403 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
12404 (two_file_pie_test): New target.
12405 * testsuite/Makefile.in: Rebuild.
12406 * README: Remove note saying that -pie is not supported.
12407
c6585162
ILT
124082009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
12409
12410 * options.h (class General_options): Add -init and -fini.
12411 * layout.cc (Layout::finish_dynamic_section): Emit
12412 given init and fini functions.
12413
032ce4e9
ST
124142009-10-13 Sriraman Tallam <tmsriram@google.com>
12415
12416 * gc.h (gc_process_relocs): Check if icf is enabled using new
12417 function.
12418 * gold.cc (queue_initial_tasks): Likewise.
12419 (queue_middle_tasks): Likewise.
12420 * object.cc (do_layout): Likewise.
12421 * symtab.cc (is_section_folded): Likewise.
12422 * main.cc (main): Likewise.
12423 * reloc.cc (Read_relocs::run): Likewise.
12424 (Sized_relobj::do_scan_relocs): Likewise.
12425 * icf.cc (is_function_ctor_or_dtor): New function.
12426 (Icf::find_identical_sections): Check if function is ctor or dtor when
12427 safe icf is chosen.
12428 * options.h (General_options::icf): Change option to be an enum.
12429 (Icf_status): New enum.
12430 (icf_enabled): New method.
12431 (icf_safe_folding): New method.
12432 (set_icf_status): New method.
12433 (icf_status_): New variable.
12434 * (options.cc) (General_options::finalize): Set icf_status_.
12435 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
12436 icf_test and icf_keep_unique_test to use the --icf enum flag.
12437 * testsuite/icf_safe_test.sh: New file.
e1df38aa 12438 * testsuite/icf_safe_test.cc: New file.
032ce4e9 12439
f345227a
ST
124402009-10-12 Sriraman Tallam <tmsriram@google.com>
12441
12442 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
12443 includes to gc.h and icf.h.
12444 * arm.cc: Include gc.h.
12445 * gold.cc: Likewise.
12446 * i386.cc: Likewise.
12447 * powerpc.cc: Likewise.
12448 * sparc.cc: Likewise.
12449 * x86_64.cc: Likewise.
12450 * gc.h: Include icf.h.
12451
1c7814ed
ILT
124522009-10-11 Ian Lance Taylor <iant@google.com>
12453
12454 * plugin.cc: Include "gold.h" before other header files.
12455
ae3b5189
CD
124562009-10-10 Chris Demetriou <cgd@google.com>
12457
12458 * options.h (Input_file_argument::Input_file_type): New enum.
12459 (Input_file_argument::is_lib_): Replace with...
12460 (Input_file_argument::type_): New member.
12461 (Input_file_argument::Input_file_argument): Take Input_file_type
12462 'type' rather than boolean 'is_lib' as second argument.
12463 (Input_file_argument::is_lib): Use type_.
12464 (Input_file_argument::is_searched_file): New function.
12465 (Input_file_argument::may_need_search): Handle is_searched_file.
12466 * options.cc (General_options::parse_library): Support -l:filename.
12467 (General_options::parse_just_symbols): Update for Input_file_argument
12468 changes.
12469 (Command_line::process): Likewise.
12470 * archive.cc (Archive::get_file_and_offset): Likewise.
12471 * plugin.cc (Plugin_manager::release_input_file): Likewise.
12472 * script.cc (read_script_file, script_add_file): Likewise.
12473 * fileread.cc (Input_file::Input_file): Likewise.
12474 (Input_file::will_search_for): Handle is_searched_file.
12475 (Input_file::open): Likewise.
12476 * readsyms.cc (Read_symbols::get_name): Likewise.
12477 * testsuite/Makefile.am (searched_file_test): New test.
12478 * testsuite/Makefile.in: Regenerate.
12479 * testsuite/searched_file_test.cc: New file.
12480 * testsuite/searched_file_test_lib.cc: New file.
12481
f3048a1d
ILT
124822009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12483 Ian Lance Taylor <iant@google.com>
12484
12485 * descriptor.cc: Include <cstdio> and "binary-io.h".
12486 (Descriptors::open): Open the files in binary mode always.
12487 * script.cc (Lex::get_token): Treat \r as whitespace.
12488
d4780e57
ILT
124892009-10-09 Ian Lance Taylor <iant@google.com>
12490
12491 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
12492
d9a893b8
ILT
124932009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12494 Ian Lance Taylor <iant@google.com>
12495
12496 * configure.ac: Check for readv function also.
12497 * fileread.cc (readv): Define if not HAVE_READV.
12498 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
12499 does not exist.
12500 * config.in: Regenerate.
12501 * configure: Regenerate.
12502
c0a62865
DK
125032009-10-09 Doug Kwan <dougkwan@google.com>
12504
12505 * layout.cc (Layout::make_output_section): Call target hook to make
12506 ordinary output section.
12507 (Layout::finalize): Adjust parameter list of call the
12508 Target::may_relax().
12509 * layout.h (class Layout::section_list): New method.
12510 * merge.h (Output_merge_base::entsize): Change visibility to public.
12511 (Output_merge_base::is_string, Output_merge_base::do_is_string):
12512 New methods.
12513 (Output_merge_string::do_is_string): New method.
12514 * object.cc (Sized_relobj::do_setup): renamed from
12515 Sized_relobj::set_up.
12516 * object.h (Sized_relobj::adjust_shndx,
12517 Sized_relobj::initializ_input_to_output_maps,
12518 Sized_relobj::free_input_to_output_maps): Change visibilities to
12519 protected.
12520 (Sized_relobj::setup): Virtualize.
12521 (Sized_relobj::do_setup): New method declaration.
12522 (Sized_relobj::invalidate_section_offset,
12523 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
12524 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
12525 * options.cc (parse_int): New function.
12526 * options.h (parse_int): New declaration.
12527 (DEFINE_int): New macro.
12528 (stub_group_size): New option.
12529 * output.cc (Output_section::Output_section): Initialize memebers
12530 merge_section_map_, merge_section_by_properties_map_,
12531 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
12532 (Output_section::add_input_section): Handled deferred code-fill
12533 generation and remove an old comment.
12534 (Output_section::add_relaxed_input_section): New method definition.
12535 (Output_section::add_merge_input_section): Use merge section by
12536 properties map to speed to search. Update merge section maps
12537 as appropriate.
12538 (Output_section::build_relaxation_map): New method definition.
12539 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
12540 Same.
12541 (Output_section::relax_input_section): Renamed to
12542 Output_section::convert_input_sections_to_relaxed_sections and change
12543 interface to take a vector of pointers to relaxed sections.
12544 (Output_section::find_merge_section,
12545 Output_section::find_relaxed_input_section): New method definitions.
12546 (Output_section::is_input_address_mapped,
12547 Output_section::output_offset, Output_section::output_address):
12548 Use output section data maps to speed up searching.
12549 (Output_section::find_starting_output_address): Add comments.
12550 (Output_section::do_write,
12551 Output_section::write_to_postprocessing_buffer): Do code-fill
12552 generation as appropriate.
12553 (Output_section::get_input_sections): Invalidate relaxed input section
12554 map.
12555 (Output_section::restore_states): Adjust type of checkpoint .
12556 Invalidate relaxed input section map.
12557 * output.h (Output_merge_base): New class declaration.
12558 (Input_section_specifier): New class defintion.
12559 (class Output_relaxed_input_section) Change base class to
12560 Output_section_data_build.
12561 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
12562 base class initializer.
12563 (Output_section::add_relaxed_input_section): New method declaration.
12564 (Output_section::Input_section): Change visibility to protected.
2e702c99 12565 (Output_section::Input_section::relobj,
c0a62865
DK
12566 Output_section::Input_section::shndx): Handle relaxed input sections.
12567 Output_section::input_sections) Change visibility to protected. Also
12568 define overload to return a non-const pointer.
12569 (Output_section::Merge_section_properties): New class defintion.
12570 (Output_section::Merge_section_by_properties_map,
12571 Output_section::Output_section_data_by_input_section_map,
12572 Output_section::Relaxation_map): New types.
12573 (Output_section::relax_input_section): Rename method to
12574 Output_section::convert_input_sections_to_relaxed_sections and change
12575 interface to take a vector of relaxed section pointers.
12576 (Output_section::find_merge_section,
12577 Output_section::find_relaxed_input_section,
12578 Output_section::build_relaxation_map,
12579 Output_section::convert_input_sections_in_list_to_relaxed_sections):
12580 New method declarations.
12581 (Output_section::merge_section_map_
12582 Output_section::merge_section_by_properties_map_,
12583 Output_section::relaxed_input_section_map_,
12584 Output_section::is_relaxed_input_section_map_valid_,
12585 Output_section::generate_code_fills_at_write_): New data members.
12586 * script-sections.cc
12587 (Output_section_element_input::set_section_addresses): Call
12588 current_data_size and addralign methods of relaxed input sections.
12589 (Orphan_output_section::set_section_addresses): Call current_data_size
12590 and addralign methods of relaxed input sections.
12591 * symtab.cc (Symbol_table::compute_final_value): Extract template
12592 from the body of Symbol_table::sized_finalize_symbol.
12593 (Symbol_table::sized_finalized_symbol): Call
12594 Symbol_table::compute_final_value.
12595 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
12596 (Symbol_table::compute_final_value): New templated method declaration.
12597 * target.cc (Target::do_make_output_section): New method defintion.
12598 * target.h (Target::make_output_section): New method declaration.
12599 (Target::relax): Add more parameters for input objects, symbol table
12600 and layout. Adjust call to do_relax.
12601 (Target::do_make_output_section): New method declaration.
12602 (Target::do_relax): Add parameters for input objects, symbol table
12603 and layout.
12604
d446d6c4
ILT
126052009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12606
12607 * pread.c: Include stdio.h.
12608
bc06c745
ILT
126092009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12610
12611 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
12612 defined.
12613
75aea3d0
ILT
126142009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12615
12616 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
12617 Change read_shndx type to unsigned int.
12618 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12619 int.
12620 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12621 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
12622 Change read_shndx type to unsigned int.
12623 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12624 int.
12625 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12626 * layout.cc (Layout::create_symtab_sections): Cast the result of
12627 local_symcount * symsize to off_t in the gold_assert.
12628
be8fcb75
ILT
126292009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12630
12631 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
12632 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
12633 R_ARM_BASE_ABS.
12634 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
12635 (Arm_relocate_functions::thm_abs5): New function.
12636 (Arm_relocate_functions::abs12): New function.
12637 (Arm_relocate_functions::abs16): New function.
12638 (Arm_relocate_functions::base_abs): New function.
12639 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
12640 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
12641 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
12642 R_ARM_BASE_ABS.
12643 (Scan::global): Likewise.
12644 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
12645 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
12646 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
12647 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
12648 R_ARM_BASE_ABS.
12649
c2a122b6
ILT
126502009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12651
12652 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
12653 (Arm_relocate_functions::movt_prel): New function.
12654 (Arm_relocate_functions::thm_movw_prel_nc): New function.
12655 (Arm_relocate_functions::thm_movt_prel): New function.
12656 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
12657 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
12658 (Scan::global, Relocate::relocate): Likewise.
12659 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12660
c4aa1e2d
ILT
126612009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12662
12663 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
12664 Incremental_checker.
12665 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
12666 unsigned int.
12667 (class Incremental_inputs_header): New class.
12668 (Incremental_inputs_header_writer): Edit comment.
12669 (Incremental_inputs_entry): New class.
12670 (Incremental_inputs_entry_writer): Edit comment.
12671 (Sized_incremental_binary::do_find_incremental_inputs_section):
12672 Add *strtab_shndx parameter, fill it.
12673 (Sized_incremental_binary::do_check_inputs): New method.
12674 (Incremental_checker::can_incrementally_link_output_file): Use
12675 Sized_incremental_binary::check_inputs.
12676 (Incremental_inputs::report_command_line): Save command line in
12677 command_line_.
12678 * incremental.h:
12679 (Incremental_binary::find_incremental_inputs_section): New
12680 method.
12681 (Incremental_binary::do_find_incremental_inputs_section): Add
12682 strtab_shndx parameter.
12683 (Incremental_binary::do_check_inputs): New pure virtual method.
12684 (Sized_incremental_binary::do_check_inputs): Declare.
12685 (Incremental_checker::Incremental_checker): Add incremental_inputs
12686 parameter, use it to initialize incremental_inputs_.
12687 (Incremental_checker::incremental_inputs_): New field.
12688 (Incremental_checker::command_line): New method.
12689 (Incremental_checker::inputs): New method.
12690 (Incremental_checker::command_line_): New field.
12691
c549a694
ILT
126922009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12693
12694 * incremental.cc: Include <cstdarg> and "target-select.h".
12695 (vexplain_no_incremental): New function.
12696 (explain_no_incremental): New function.
12697 (Incremental_binary::error): New method.
12698 (Sized_incremental_binary::do_find_incremental_inputs_section): New
12699 method.
12700 (make_sized_incremental_binary): New function.
12701 (open_incremental_binary): New function.
12702 (can_incrementally_link_file): Add checks if output is ELF and has
12703 inputs section.
12704 * incremental.h: Include "elfcpp_file.h" and "output.h".
12705 (Incremental_binary): New class.
12706 (Sized_incremental_binary): New class.
12707 (open_incremental_binary): Declare.
12708 * object.cc (is_elf_object): Use
12709 elfcpp::Elf_recognizer::is_elf_file.
12710 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
12711 * output.h (Output_file::filesize): New method.
12712
fd3c5f0b
ILT
127132009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12714
12715 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
12716 New function.
12717 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
12718 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
12719 function.
12720 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
12721 function.
12722 (Arm_relocate_functions::movw_abs_nc): New function.
12723 (Arm_relocate_functions::movt_abs): New function.
12724 (Arm_relocate_functions::thm_movw_abs_nc): New function.
12725 (Arm_relocate_functions::thm_movt_abs): New function.
12726 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
12727 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
12728 (Scan::global): Likewise.
12729 (Relocate::relocate): Likewise.
12730 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12731
7f5309a5
ILT
127322009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12733
12734 * arm.cc (Arm_relocate_functions::got_prel) New function.
12735 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
12736 (Relocate::relocate): Likewise.
12737 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12738
364c7fa5
ILT
127392009-10-06 Ian Lance Taylor <iant@google.com>
12740
12741 * options.h (class General_options): Define
12742 split_stack_adjust_size parameter.
12743 * object.h (class Object): Add uses_split_stack_ and
12744 has_no_split_stack_ fields. Add uses_split_stack and
12745 has_no_split_stack accessor functions. Declare
12746 handle_split_stack_section.
12747 (class Reloc_symbol_changes): Define.
12748 (class Sized_relobj): Define Function_offsets. Declare
12749 split_stack_adjust, split_stack_adjust_reltype, and
12750 find_functions.
12751 * object.cc (Object::handle_split_stack_section): New function.
12752 (Sized_relobj::do_layout): Call handle_split_stack_section.
12753 * dynobj.cc (Sized_dynobj::do_layout): Call
12754 handle_split_stack_section.
12755 * reloc.cc (Sized_relobj::relocate_sections): Call
12756 split_stack_adjust for executable sections in split_stack
12757 objects. Pass reloc_map to relocate_section.
12758 (Sized_relobj::split_stack_adjust): New function.
12759 (Sized_relobj::split_stack_adjust_reltype): New function.
12760 (Sized_relobj::find_functions): New function.
12761 * target-reloc.h: Include "object.h".
12762 (relocate_section): Add reloc_symbol_changes parameter. Change
12763 all callers.
12764 * target.h (class Target): Add calls_non_split method. Declare
12765 do_calls_non_split virtual method. Declare match_view and
12766 set_view_to_nop.
12767 * target.cc: Include "elfcpp.h".
12768 (Target::do_calls_non_split): New function.
12769 (Target::match_view): New function.
12770 (Target::set_view_to_nop): New function.
12771 * gold.cc (queue_middle_tasks): Give an error if mixing
12772 split-stack and non-split-stack objects with -r.
12773 * i386.cc (Target_i386::relocate_section): Add
12774 reloc_symbol_changes parameter.
12775 (Target_i386::do_calls_non_split): New function.
12776 * x86_64.cc (Target_x86_64::relocate_section): Add
12777 reloc_symbol_changes parameter.
12778 (Target_x86_64::do_calls_non_split): New function.
12779 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
12780 parameter.
12781 * powerpc.cc (Target_powerpc::relocate_section): Add
12782 reloc_symbol_changes parameter.
12783 * sparc.cc (Target_sparc::relocate_section): Add
12784 reloc_symbol_changes parameter.
12785 * configure.ac: Call AM_CONDITIONAL for the default target.
12786 * configure: Rebuild.
12787 * testsuite/Makefile.am (TEST_AS): New variable.
12788 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
12789 (check_DATA): Add split_i386 and split_x86_64 files.
12790 (SPLIT_DEFSYMS): Define.
12791 (split_i386_[1234n].o): New targets.
12792 (split_i386_[124]): New targets.
12793 (split_i386_[1234r].stdout): New targets.
12794 (split_x86_64_[1234n].o): New targets.
12795 (split_x86_64_[124]): New targets.
12796 (split_x86_64_[1234r].stdout): New targets.
12797 (MOSTLYCLEANFILES): Add new executables.
12798 * testsuite/split_i386.sh: New file.
12799 * testsuite/split_x86_64.sh: New file.
12800 * testsuite/split_i386_1.s: New file.
12801 * testsuite/split_i386_2.s: New file.
12802 * testsuite/split_i386_3.s: New file.
12803 * testsuite/split_i386_4.s: New file.
12804 * testsuite/split_i386_n.s: New file.
12805 * testsuite/split_x86_64_1.s: New file.
12806 * testsuite/split_x86_64_2.s: New file.
12807 * testsuite/split_x86_64_3.s: New file.
12808 * testsuite/split_x86_64_4.s: New file.
12809 * testsuite/split_x86_64_n.s: New file.
12810 * testsuite/testfile.cc (Target_test): Update relocation_section
12811 function.
12812 * testsuite/Makefile.in: Rebuild.
12813
e8a9fcda
ILT
128142009-10-06 Ian Lance Taylor <iant@google.com>
12815
12816 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
12817 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
12818 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
12819 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
12820 the address on ldo_addrs_.
12821 (Target_i386::Relocate::fix_up_ldo): New function.
12822
e99daf92
ILT
128232009-10-06 Rafael Espindola <espindola@google.com>
12824
12825 * plugin.cc (add_input_library): New.
12826 (Plugin::load): Add add_input_library to tv.
12827 (Plugin_manager::add_input_file): Add the is_lib argument.
12828 (add_input_file): Update call to Plugin_manager::add_input_file.
12829 (add_input_library): New.
12830 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
12831
966d4097
DK
128322009-09-30 Doug Kwan <dougkwan@google.com>
12833
12834 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
12835 symbol and call Symbol::may_need_copy_reloc to determine if
12836 a copy reloc is needed.
12837 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
12838 nocopyreloc is given in command line.
12839 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
12840 given in command line.
12841 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
12842 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
12843 of the removed Target_i386::may_need_copy_reloc.
12844 * options.h (copyreloc): New option with default value false.
12845 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12846 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
12847 instead of the removed Target_powerpc::may_need_copy_reloc.
12848 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12849 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
12850 instead of the removed Target_sparc::may_need_copy_reloc.
12851 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
12852 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
12853 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
12854 instead of the removed Target_x86_64::may_need_copy_reloc.
12855
029ba973
ILT
128562009-09-30 Ian Lance Taylor <iant@google.com>
12857
12858 * object.h (class Object): Remove target_ field, and target,
12859 sized_target, and set_target methods.
12860 (Object::sized_target): Remove.
12861 (class Sized_relobj): Update declarations. Remove sized_target.
12862 * object.cc (Sized_relobj::setup): Remove target parameter.
12863 Change all callers.
12864 (Input_objects::add_object): Don't do anything with the target.
12865 (make_elf_sized_object): Add punconfigured parameter. Change all
12866 callers. Set or test parameter target.
12867 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
12868 Change all callers.
12869 * parameters.cc (Parameters::set_target): Change parameter type to
12870 be non-const.
12871 (Parameters::default_target): Remove.
12872 (set_parameters_target): Change parameter type to be non-const.
12873 (parameters_force_valid_target): New function.
12874 (parameters_clear_target): New function.
12875 * parameters.h (class Parameters): Update declarations. Remove
12876 default_target method. Add sized_target and clear_target
12877 methods. Change target_ to be non-const.
12878 (set_parameters_target): Update declaration.
12879 (parameters_force_valid_target): Declare.
12880 (parameters_clear_target): Declare.
12881 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
12882 as NULL if we aren't searching.
12883 (Add_symbols::run): Don't check for compatible target.
12884 * fileread.cc (Input_file::open_binary): Call
12885 parameters_force_valid_target.
12886 * gold.cc (queue_middle_tasks): Likewise.
12887 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
12888 set_target on object.
12889 * dynobj.h (class Sized_dynobj): Update declarations.
12890 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
12891 make_elf_object returns NULL.
12892 (Archive::include_member): Don't check whether object target is
12893 compatible.
12894 * output.cc (Output_section::add_input_section): Get target from
12895 parameters.
12896 (Output_section::relax_input_section): Likewise.
12897 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
12898 parameters.
12899 (Sized_relobj::do_scan_relocs): Likewise.
12900 (Sized_relobj::relocate_sections): Likewise.
12901 * resolve.cc (Symbol_table::resolve): Likewise.
12902 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
12903 parameter. Change all callers.
12904 (Symbol_table::add_from_object): Get target from parameters.
12905 (Symbol_table::add_from_relobj): Don't check object target.
12906 (Symbol_table::add_from_dynobj): Likewise.
12907 (Symbol_table::define_special_symbol): Get target from
12908 parameters.
12909 * symtab.h (class Symbol_table): Update declaration.
12910 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
12911 parameter. Change all callers. Clear parameter target.
12912 (Binary_test): Test target here.
12913 * testsuite/object_unittest.cc (gold_testsuite): Remove
12914 target_test_pointer parameter. Change all callers.
12915 (Object_test): Test target here.
12916
a6a22b83
ILT
129172009-09-26 Ian Lance Taylor <iant@google.com>
12918
12919 * testsuite/initpri1.c: Don't try to use constructor priorities if
12920 compiling with gcc before 4.3.
12921
6a8f49fe
ILT
129222009-09-22 Mikolaj Zalewski <mikolajz@google.com>
12923
12924 * testsuite/retain_symbols_file_test.sh (check_present): Change
12925 output file name to retain_symbols_file_test.stdout.
12926 (check_absent): Likewise.
12927
8c604651
CS
129282009-09-18 Craig Silverstein <csilvers@google.com>
12929
12930 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
12931 * options.cc: Include <cerrno> and <fstream>.
12932 (General_options::finalize): Parse -retain-symbols-file tag.
12933 * options.h: New flag.
12934 (General_options): New method should_retain_symbol, new
12935 variable symbols_to_retain.
12936 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
12937 should_retain_symbol map.
12938 * testsuite/Makefile.am (retain_symbols_file_test): New test.
12939 * testsuite/Makefile.in: Regenerate.
12940 * testsuite/retain_symbols_file_test.sh: New file.
12941
ca58b19f
NC
129422009-09-18 Nick Clifton <nickc@redhat.com>
12943
12944 * po/es.po: Updated Spanish translation.
12945
20e6d0d6
DK
129462009-09-17 Doug Kwan <dougkwan@google.com>
12947
12948 * debug.h (DEBUG_RELAXATION): New constant.
12949 (DEBUG_ALL): Add DEBUG_RELAXATION.
12950 (debug_string_to_enum): Add relaxation debug option.
12951 * layout.cc
12952 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
12953 Layout::Relaxation_debug_check::read_sections,
12954 Layout::Relaxation_debug_check::read_sections): New method definitions.
12955 (Layout::Layout): Initialize data members
12956 record_output_section_data_from_scrips_,
12957 script_output_section_data_list_ and relaxation_debug_check_.
12958 (Layout::save_segments, Layout::restore_segments,
12959 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12960 Layout::relaxation_loop_body): New method definitions.
12961 (Layout::finalize): Support relaxation. Move section layout code to
12962 Layout::relaxation_loop_body.
12963 (Layout::set_asection_address_from_script): Move code for orphan
12964 section placement out.
12965 (Layout::place_orphan_sections_in_script): New method definition.
12966 * layout.h (Output_segment_headers, Output_file_header):
12967 New forward class declarations.
12968 (Layout::~Layout): Define.
12969 (Layout::new_output_section_data_from_script): New method definition.
12970 (Layout::place_orphan_sections_in_script): New method declaration.
12971 (Layout::Segment_states): New type declaration.
12972 (Layout::save_segments, Layout::restore_segments,
12973 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12974 Layout::relaxation_loop_body): New method declarations.
12975 (Layout::Output_section_data_list): New type declaration.
12976 (Layout::Relaxation_debug_check): New class definition.
12977 (Layout::record_output_section_data_from_script_,
12978 Layout::script_output_section_data_list_, Layout::segment_states_,
12979 Layout::relaxation_debug_check_): New data members.
12980 * output.cc: (Output_section_headers::do_size): New method definition.
12981 (Output_section_headers::Output_section_headers): Move size
12982 computation to Output_section_headers::do_size.
12983 (Output_segment_headers::do_size): New method definition.
e1df38aa 12984 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
12985 Output_file_header::do_size and call it.
12986 (Output_file_header::do_size): New method definition.
12987 (Output_data_group::Output_data_group): Adjust call to
12988 Output_section_data.
12989 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
12990 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 12991 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
12992 RELAXED_INPUT_SECTION_CODE.
12993 (Output_section::Output_section): Initialize data member checkpoint_.
12994 (Output_section::~Output_section): Delete checkpoint object pointed
12995 by checkpoint_.
12996 (Output_section::add_input_section): Always add an Input_section if
12997 relaxing.
12998 (Output_section::add_merge_input_section): Add assert.
12999 (Output_section::relax_input_section): New method definition.
13000 (Output_section::set_final_data_size): Set load address to zero for
13001 an unallocated section.
13002 (Output_section::do_address_and_file_offset_have_reset_values):
13003 New method definition.
13004 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
13005 Handle relaxed input section.
13006 (Output_section::sort_attached_input_sections): Checkpoint input
13007 section list lazily.
13008 (Output_section::get_input_sections): Change type of input_sections to
13009 list of Simple_input_section pointers. Checkpoint input section list
13010 lazily. Also handle relaxed input sections.
13011 (Output_section::add_input_section_for_script): Take a reference to
13012 a Simple_input_section object instead of Relobj pointer and section
13013 index as parameter. Handle relaxed input sections.
13014 (Output_section::save_states, Output_section::restore_states): New
13015 method definitions.
13016 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
13017 (Output_data::is_data_size_fixed): New method definition.
13018 (Output_data::reset_addresss_and_file_offset): Do not reset data size
13019 if it is fixed.
13020 (Output_data::address_and_file_offset_have_reset_values): New method
13021 definition.
13022 (Output_data::do_address_and_file_offset_have_reset_values): New method
13023 definition.
13024 (Output_data::set_data_size): Check that data size is not fixed.
13025 (Output_data::fix_data_size): New method definition.
13026 (Output_data::is_data_size_fixed_): New data member.
13027 (Output_section_headers::set_final_data_size): New method definition.
13028 (Output_section_headers::do_size): New method declaration.
13029 (Output_segment_headers::set_final_data_size): New method definition.
13030 (Output_segment_headers::do_size): New method declaration.
13031 (Output_file_header::set_final_data_size)::New method definition.
13032 (Output_file_header::do_size)::New method declaration.
13033 (Output_section_data::Output_section_data): Add new parameter
13034 is_data_size_fixed and use it to fix data size.
13035 (Output_data_const::Output_data_const): Adjust call to base class
13036 constructor and fix data size.
13037 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
13038 base class constructor and fix data size.
13039 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
13040 base class constructor and fix data size.
13041 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
13042 class constructor and fix data size.
13043 (Output_data_group::set_final_data_size): New method definition.
13044 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
13045 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
13046 class constructor and fix data size.
13047 (Output_relaxed_input_section): New class definition.
13048 (Output_section::Simple_input_section): New class definition.
13049 (Output_section::get_input_sections): Adjust parameter list.
13050 (Output_section::add_input_section_for_script): Same.
13051 (Output_section::save_states, Output_section::restore_states,
13052 Output_section::do_address_and_file_offset_have_reset_values,
13053 (Output_section::Input_section::Input_section): Handle
13054 RELAXED_INPUT_SECTION_CODE. Add new overload for
13055 Output_relaxed_input_section.
13056 (Output_section::Input_section::is_input_section,
13057 Output_section::Input_section::set_output_section): Handle relaxed
13058 input section.
13059 (Output_section::Input_section::is_relaxed_input_section,
13060 Output_section::Input_section::output_section_data,
13061 Output_section::Input_section::relaxed_input_section): New method
13062 definitions.
13063 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
13064 value.
13065 (Output_section::Input_section::u1_): Update comments.
13066 (Output_section::Input_section::u2_): Add new union member poris.
13067 (Output_section::Checkpoint_output_section): New classs definition.
13068 (Output_section::relax_input_section): New method declaration.
13069 (Output_section::checkpoint_): New data member.
13070 (Output_segment): Update comments.
13071 (Output_segment::Output_segment): Un-privatize copy constructor.
13072 (Output_segment::operator=): Un-privatize.
13073 * script-sections.cc (Output_section_element::Input_section_list):
13074 Change element type to Output_section::Simple_input_section.
13075 (Output_section_element_dot_assignment::set_section_addresses):
13076 Register output section data for relaxation clean up.
13077 (Output_data_exression::Output_data_expression): Adjust call to base
13078 constructor to fix data size.
13079 (Output_section_element_data::set_section_addresses): Register
13080 Output_data_expression object for relaxation clean up.
13081 (struct Input_section_info): Replace Relobj pointer and section index
13082 pair with Output_section::Simple_input_section and Convert struct to a
13083 class.
13084 (Input_section_sorter::operator()): Adjust access to
e1df38aa 13085 Input_section_info data member to use accessors.
20e6d0d6
DK
13086 (Output_section_element_input::set_section_addresses): Use layout
13087 parameter. Adjust code to use Output_section::Simple_input_section
13088 and Input_secction_info classes. Register filler for relaxation
13089 clean up.
13090 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
13091 and section index pair with Output_section::Simple_input_section
13092 class. Adjust code accordingly.
13093 (Phdrs_element::release_segment): New method definition.
13094 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
13095 segment list.
13096 (Script_sections::release_segments): New method definition.
13097 * gold/script-sections.h (Script_sections::release_segments): New
13098 method declaration.
13099 * gold/target.h (Target::may_relax, Target::relax,
13100 Target::do_may_relax, Target::do_relax): New method definitions.
13101
5e445df6
ILT
131022009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13103
13104 * arm.cc (has_signed_unsigned_overflow): New function.
13105 (Arm_relocate_functions::abs8): New function.
13106 (Target_arm::Scan::local): Handle R_ARM_ABS8.
13107 (Target_arm::Scan::global): Likewise.
13108 (Target_arm::relocate::relocate): Likewise.
13109 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
13110 Likewise.
13111
8c604651 131122009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
13113
13114 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
13115 * testsuite/Makefile.in: Regenerate.
13116
1e9cc1c2
NC
131172009-09-11 Nick Clifton <nickc@redhat.com>
13118
13119 * po/gold.pot: Updated by the Translation project.
13120
6a89f575
CC
131212009-09-08 Cary Coutant <ccoutant@google.com>
13122
13123 * output.cc (Output_file::open): Add execute permission to empty file.
13124 * testsuite/Makefile.am (permission_test): New test.
13125 * testsuite/Makefile.in: Regenerate.
13126
fdcac5af
ILT
131272009-09-02 Ian Lance Taylor <iant@google.com>
13128
13129 * output.cc (Output_file::resize): Call map_no_anonymous rather
13130 than map.
13131
44453f85
ILT
131322009-09-01 Mikolaj Zalewski <mikolajz@google.com>
13133
13134 * gold.cc: Include "incremental.h".
13135 (queue_initial_tasks): Call Incremental_checker methods.
13136 * incremental.cc: Include "output.h".
13137 (Incremental_checker::can_incrementally_link_output_file): New
13138 method.
13139 * incremental.h (Incremental_checker): New class.
13140
13141 * output.cc (Output_file::open_for_modification): New method.
13142 (Output_file::map_anonymous): Changed return type to bool. Record
13143 map in base_ field.
13144 (Output_file::map_no_anonymous): New method, broken out of map.
13145 (Output_file::map): Use map_no_anonymous and map_anonymous.
13146 * output.h (class Output_file): Update declarations.
13147
293c1386
CC
131482009-08-24 Cary Coutant <ccoutant@google.com>
13149
13150 * options.h (Command_line::Pre_options): New class.
13151 (Command_line::pre_options): New member.
13152 * options.cc (gold::options::ready_to_register): New variable.
13153 (One_option::register_option): Do nothing if not registering options.
13154 Assert if same short option registered twice.
13155 (General_options::General_options): Turn off option registration when
13156 done constructing.
13157 (Command_line::Pre_options::Pre_options): New constructor.
13158
f773f3d2
CC
131592009-08-24 Cary Coutant <ccoutant@google.com>
13160
06a73cfe
CC
13161 * options.h (General_options::no_keep_memory): Remove incorrect
13162 short option.
f773f3d2 13163
a15af8e2
RW
131642009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13165
13166 * Makefile.am (am__skiplex, am__skipyacc): New.
13167 * Makefile.in: Regenerate.
13168
c462b41b
RW
131692009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13170
14ec8efd
RW
13171 * Makefile.am (AM_CPPFLAGS): Renamed from ...
13172 (INCLUDES): ... this.
13173 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
13174 (AM_CPPFLAGS): Renamed from ...
13175 (INCLUDE): ... this.
13176 * Makefile.in, testsuite/Makefile.in: Regenerate.
13177
81ecdfbb
RW
13178 * Makefile.in: Regenerate.
13179 * aclocal.m4: Likewise.
13180 * config.in: Likewise.
13181 * configure: Likewise.
13182 * testsuite/Makefile.in: Likewise.
13183
c462b41b
RW
13184 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13185 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13186 * Makefile.in: Regenerate.
13187 * testsuite/Makefile.in: Regenerate.
13188
2da73f13
CC
131892009-08-19 Cary Coutant <ccoutant@google.com>
13190
13191 * resolve.cc (Symbol_table::resolve): Don't complain about defined
13192 symbols in shared libraries overridden by hidden or internal symbols
13193 in the main program.
13194
2db70501
CD
131952009-08-19 Chris Demetriou <cgd@google.com>
13196
13197 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
13198 checking source file names in error messages.
13199
f733487b
DK
132002009-08-18 Doug Kwan <dougkwan@google.com>
13201
13202 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
13203 an elcpp::Ehdr as parameter. Adjust call to set_target.
13204 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
13205 an elfcpp::Ehdr as parameter.
13206 * object.cc (Object::set_target): Remove the version that looks up
13207 a target and sets it.
13208 (Sized_relobj::setup): Take a Target object instead of
13209 an elfcpp::Ehdr as parameter. Adjust call to set_target.
13210 (make_elf_sized_object): Find target and ask target to
13211 make an ELF object.
13212 * object.h: (Object::set_target): Remove the version that looks up
13213 a target and sets it.
13214 (Sized_relobj::setup): Take a Target object instead of
13215 an elfcpp:Ehdr as parameter.
13216 * target.cc: Include dynobj.h.
13217 (Target::do_make_elf_object_implementation): New.
2e702c99 13218 (Target::do_make_elf_object): New.
f733487b
DK
13219 * target.h (Target::make_elf_object): New template declaration.
13220 (Target::do_make_elf_object): New method declarations.
13221 (Target::do_make_elf_object_implementation): New template declaration.
13222
cc70f101
ILT
132232009-08-14 Ian Lance Taylor <iant@google.com>
13224
13225 * gold.h (FUNCTION_NAME): Define.
13226 (gold_unreachable): Use FUNCTION_NAME.
13227
ef5e0cb1
ST
132282009-08-12 Sriraman Tallam <tmsriram@google.com>
13229
13230 * icf.cc (Icf::find_identical_sections): Issue a warning when a
13231 symbol in the --keep-unique list is not found.
13232
48c187ce
ST
132332009-08-12 Sriraman Tallam <tmsriram@google.com>
13234
13235 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
13236 been maked as --keep-unique.
13237 (Icf::unfold_section): New function.
13238 * icf.h (Icf::unfold_section): New function.
13239 * options.h (General_options::keep_unique): New option.
13240 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
13241 * testsuite/Makefile.in: Regenerate.
13242 * testsuite/icf_keep_unique_test.sh: New file.
13243 * testsuite/icf_keep_unique_test.cc: New file.
13244
645afe0c
CC
132452009-08-12 Cary Coutant <ccoutant@google.com>
13246
13247 PR 10471
13248 * resolve.cc (Symbol_table::resolve): Check for references from
13249 dynamic objects to hidden and internal symbols.
13250 * testsuite/Makefile.am (hidden_test.sh): New test.
13251 * testsuite/Makefile.in: Regenerate.
13252 * testsuite/hidden_test.sh: New script.
13253 * testsuite/hidden_test_1.c: New test source.
13254 * testsuite/hidden_test_main.c: New test source.
13255
11af873f
DK
132562009-08-11 Doug Kwan <dougkwan@google.com>
13257
13258 * arm.cc: Update comments.
13259 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
13260 segment to locate the .ARM.exidx section if present.
13261
b9f7d72d
DK
132622009-08-09 Doug Kwan <dougkwan@google.com>
13263
13264 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
13265 patch.
13266
ddd3c53c
ST
132672009-08-07 Sriraman Tallam <tmsriram@google.com>
13268 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
13269 compiler warnings.
13270
27721062
ST
132712009-08-06 Sriraman Tallam <tmsriram@google.com>
13272
13273 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
13274 valid tls_segment only for non-debug-section relocations.
13275 * testsuite/Makefile.am: Add gc_tls_test.
13276 * testsuite/Makefile.in: Regenerate.
13277 * testsuite/gc_tls_test.cc: New file.
13278 * testsuite/gc_tls_test.sh: New file.
13279
ef15dade 132802009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 13281
ef15dade
ST
13282 * icf.cc: New file.
13283 * icf.h: New file.
13284 * Makefile.am (CCFILES): Add icf.cc.
13285 (HFILES): Add icf.h
13286 * Makefile.in: Regenerate.
13287 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
13288 * gc.h (gc_process_relocs): Populate lists used by icf to contain
13289 section, symbol and addend information for the relocs.
13290 * gold.cc (queue_middle_tasks): Call identical code folding.
13291 * gold.h: Add defines for multimap.
13292 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
13293 to the call of finalize_local_symbols.
13294 * main.cc (main): Create object of class Icf.
13295 * object.cc (Sized_relobj::do_layout): Allow this function to be
13296 called twice during icf.
13297 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
13298 to sections marked as identical by icf.
13299 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
13300 when available.
13301 (Sized_relobj::do_section_entsize): New function.
13302 * object.h (Object::section_entsize): New function.
13303 (Object::do_section_entsize): New pure virtual function.
13304 (Relobj::finalize_local_symbols): Add new parameter.
13305 (Relobj::do_section_entsize): New function.
13306 * options.h (General_options::icf): New option.
13307 (General_options::icf_iterations): New option.
13308 (General_options::print_icf_sections): New option.
13309 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
13310 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
13311 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
13312 icf.
13313 * symtab.cc (Symbol_table::is_section_folded): New function.
13314 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
13315 to sections marked as identical by icf.
13316 * symtab.h (Symbol_table::set_icf): New function.
13317 (Symbol_table::icf): New function.
13318 (Symbol_table::is_section_folded): New function.
13319 (Symbol_table::icf_): New data member.
13320 * target-reloc.h (relocate_section): Ignore sections folded by icf.
13321 * testsuite/Makefile.am: Add commands to build icf_test.
13322 * testsuite/Makefile.in: Regenerate.
13323 * testsuite/icf_test.sh: New file.
13324 * testsuite/icf_test.cc: New file.
13325
c3b65ac4
CD
133262009-07-24 Chris Demetriou <cgd@google.com>
13327
13328 * layout.cc (is_compressible_debug_section): Fix incorrect
13329 comment about compressed section names.
13330
1caf2c51
ILT
133312009-07-20 Ian Lance Taylor <ian@airs.com>
13332
13333 PR 10419
13334 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
13335
1ef4d87f
ILT
133362009-07-16 Ian Lance Taylor <iant@google.com>
13337
13338 PR 10400
13339 * layout.h: #include <map>.
13340 (class Kept_section): Change from struct to class. Add accessors
13341 and setters. Add section size to Comdat_group mapping. Change
13342 Comdat_group to std::map. Add is_comdat_ field. Add
13343 linkonce_size field in union.
13344 (class Layout): Update declaration of find_or_add_kept_section.
13345 Don't declare find_kept_object.
13346 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
13347 parameter. Add object, shndx, is_comdat, and is_group_name
13348 parameters. Change all callers. Adjust for new Kept_section.
13349 (Layout::find_kept_object): Remove.
13350 * object.cc (Sized_relobj::include_section_group): Update use of
13351 Kept_section. Rename secnum to shndx. Only record
13352 Kept_comdat_section if sections are the same size.
13353 (Sized_relobj::include_linkonce_section): Update use of
13354 Kept_section. Only record Kept_comdat_section if sections are the
13355 same size. Set size of linkonce section.
13356 (Sized_relobj::map_to_kept_section): Update call to
13357 get_kept_comdat_section.
13358 * object.h (class Sized_relobj): Rename fields in
13359 Kept_comdat_section to drop trailing underscores; change object
13360 field to Relobj*. Change Kept_comdat_section_table to store
13361 struct rather than pointer.
13362 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
13363 Add kept_object and kept_shndx parameters. Change all callers.
13364 (Sized_relobj::get_kept_comdat_section): Change return type to
13365 bool. Add kept_object and kept_shndx parameters. Change all
13366 callers.
13367 * plugin.cc (Pluginobj::include_comdat_group): Update call to
13368 Layout::find_or_add_kept_section.
13369
37c3b7b0
ILT
133702009-07-09 Ian Lance Taylor <iant@google.com>
13371
13372 * merge.cc (Object_merge_map::initialize_input_to_output_map):
13373 Reserve space in the hash table.
13374
98fa85cb
ILT
133752009-07-06 Mikolaj Zalewski <mikolajz@google.com>
13376
13377 * fileread.cc (File_read::get_mtime): New method.
13378 * fileread.h (Timespec): New structure.
13379 (File_read::get_mtime): New method.
13380 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
13381 Renamed from timestamp_nsec.
13382 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
13383 Elf_Xword.
e1df38aa 13384 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 13385 timestamp_nsec.
e1df38aa 13386 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
13387 (Incremental_inputs::report_obejct): Save mtime; style fix.
13388 (Incremental_inputs::report_script): Save mtime; style fix.
13389 (Incremental_inputs::finalize_inputs): Style fix.
13390 (Incremental_inputs::finalize): Style fix.
13391 (Incremental_inputs::create_input_section_data): Store inputs
13392 mtime.
13393 * incremental.h (Incremental_inputs::report_script): Add mtime
13394 argument.
13395 (Incremental_inputs::Input_info::Input_info): Intialize only one
13396 union member.
13397 (Incremental_inputs::Input_info::archive): Move to nameless
13398 union.
13399 (Incremental_inputs::Input_info::obejct): Move to nameless union.
13400 (Incremental_inputs::Input_info::script): Move to nameless union.
13401 (Incremental_inputs::mtime): New field.
13402 * script.cc (read_input_script): Pass file mtime to
13403 Incremental_input.
13404 * script.h (Script_info::inputs): Style fix.
13405
c9d70757
ILT
134062009-07-01 Ian Lance Taylor <ian@airs.com>
13407
13408 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
13409 instead of 32.
13410
9c547ec3
ILT
134112009-06-24 Ian Lance Taylor <iant@google.com>
13412
13413 PR 10156
13414 * layout.cc (Layout::choose_output_section): If we find an
13415 existing section, update the flags.
13416 (Layout::create_notes): New function, broken out of
13417 Layout::finalize.
13418 (Layout::finalize): Don't create note sections.
13419 (Layout::create_note): Don't crash if linker script discards
13420 section.
13421 (Layout::create_gold_note): Likewise.
13422 (Layout::create_build_id): Likewise. Don't set
13423 after_input_sections on the section.
13424 (Layout::create_executable_stack_info): Remove target parameter.
13425 Change caller.
13426 * layout.h (class Layout): Declare create_notes. Update
13427 declaration of create_executable_stack_info.
13428 * gold.cc (queue_middle_tasks): Call create_notes.
13429 * output.cc (Output_section::update_flags_for_input_section): Move
13430 here from output.h. If SHF_ALLOC flag is newly set, mark address
13431 invalid.
13432 * output.h (Output_data::mark_address_invalid): New function.
13433 (class Output_section): Only declare, not define,
13434 update_flags_for_input_section. Remove set_flags.
13435
55458500
ILT
134362009-06-24 Ian Lance Taylor <iant@google.com>
13437
13438 * script-sections.cc (Output_section_definition::
13439 set_section_addresses): Rename shadowing local load_address to
13440 laddr.
13441
1307d6cd
ILT
134422009-06-24 Ian Lance Taylor <iant@google.com>
13443
13444 PR 10244
13445 * reloc.cc (relocate_sections): Skip empty relocation sections.
13446
ec3f783e
ILT
134472009-06-23 Ian Lance Taylor <iant@google.com>
13448
13449 PR 10156
13450 * layout.cc (Layout::create_note): Use choose_output_section
13451 rather than make_output_section.
13452
459c9f1c
ILT
134532009-06-23 Ian Lance Taylor <iant@google.com>
13454
13455 PR 10237
13456 * options.cc (General_options::parse_V): Set printed_version_.
13457 (General_options::General_options): Initialize printed_version_.
13458 * options.h (class General_options): Add printed_version_ field.
13459 * gold.cc (queue_initial_tasks): If there are no input files,
13460 don't give a fatal error if we printed the version information.
13461 (queue_middle_tasks): If using -r with a shared object, give a
13462 fatal error rather than an ordinary error.
13463
1518dc8f
ILT
134642009-06-23 Ian Lance Taylor <iant@google.com>
13465
13466 PR 10219
13467 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
13468 (Layout::make_output_section): Set have_stabstr_section_ if we see
13469 a .stab*str section.
13470 (Layout::finalize): Call link_stabs_sections.
13471 (Layout::link_stabs_sections): New file.
13472 * layout.h (class Layout): Add have_stabstr_section_ field.
13473 Declare link_stabs_sections.
13474
3d857b98
DK
134752009-06-23 Doug Kwan <dougkwan@google.com>
13476
13477 * Makefile.am (libgold_a_LIBADD): New.
13478 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 13479 * Makefile.in: Regenerate.
3d857b98
DK
13480 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
13481 * configure: Regenerate.
13482 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
13483 * fileread.cc: Include sys/state.h
13484 * gold.h: Declare memmem and strndup if found missing.
13485 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
13486
0639a6f6
ILT
134872009-06-23 Ian Lance Taylor <iant@google.com>
13488
13489 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
13490 * configure: Rebuild.
13491
8d63875c
ILT
134922009-06-23 Ian Lance Taylor <iant@google.com>
13493
13494 PR 10147
13495 * object.cc (Object::section_contents): Don't try to get a view if
13496 the section has length zero.
13497 (Object::handle_gnu_warning_section): If the section is empty, use
13498 the name of the section as the warning.
13499
f7c8a183
ILT
135002009-06-23 Ian Lance Taylor <iant@google.com>
13501
13502 PR 10133
13503 * stringpool.h (class Stringpool_template): Add optimize_ field.
13504 (Stringpool_template::set_optimize): New function.
13505 * stringpool.cc (Stringpool_template::Stringpool_template):
13506 Initialize optimize_ field.
13507 (Stringpool_template::set_string_offsets): Test local optimize
13508 fild rather than parameter.
13509 * layout.cc (Layout::Layout): Call set_optimize on the section
13510 name stringpool.
13511
e6a307ba
ILT
135122009-06-22 Ian Lance Taylor <iant@google.com>
13513
13514 PR 10030
13515 * yyscript.y: Parse TARGET.
13516 * script.cc (script_set_target): New function.
13517 * script-c.h (script_set_target): Declare.
13518 * options.cc (General_options::string_to_object_format): Rename
13519 from string_to_object_format in anonymous namespace. Change
13520 callers.
13521 * options.h (class General_options): Declare
13522 string_to_object_format.
13523
3ee173de
ILT
135242009-06-22 Ian Lance Taylor <iant@google.com>
13525
13526 * script-sections.cc (Script_sections::create_segments): Don't put
13527 program headers in a PT_LOAD segment if -n or -N.
13528
135292009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
13530
13531 PR 10141
13532 * options.h (class General_options): Add -z lazy and -z now. Sort
13533 -z options into alphabetical order.
13534 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
13535
cd6739a1 135362009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
13537
13538 * layout.cc (Layout::make_output_section): Call
13539 Target::new_output_section.
13540 (Layout::attach_allocated_section_to_segment): Put large section
13541 sections in a separate load segment with the large segment flag
13542 set.
13543 (Layout::segment_precedes): Sort large data segments after other
13544 load segments.
13545 (align_file_offset): New static function.
13546 (Layout::set_segment_offsets): Use align_file_offset.
13547 * output.h (class Output_section): Add is_small_section_ and
13548 is_large_section_ fields.
13549 (Output_section::is_small_section): New function.
13550 (Output_section::set_is_small_section): New function.
13551 (Output_section::is_large_section): New function.
13552 (Output_section::set_is_large_section): New function.
13553 (Output_section::is_large_data_section): New function.
13554 (class Output_segment): Add is_large_data_segment_ field.
13555 (Output_segment::is_large_data_segment): New function.
13556 (Output_segment::set_is_large_data_segment): New function.
13557 * output.cc (Output_section::Output_section): Initialize new
13558 fields.
13559 (Output_segment::Output_segment): Likewise.
13560 (Output_segment::add_output_section): Add assertion that large
13561 data sections always go in large data segments. Force small data
13562 sections to the end of the list of data sections. Force small BSS
13563 sections to the start of the list of BSS sections. For large BSS
13564 sections to the end of the list of BSS sections.
13565 * symtab.h (class Symbol): Declare is_common_shndx.
13566 (Symbol::is_defined): Check Symbol::is_common_shndx.
13567 (Symbol::is_common): Likewise.
13568 (class Symbol_table): Define enum Commons_section_type. Update
13569 declarations. Add small_commons_ and large_commons_ fields.
13570 * symtab.cc (Symbol::is_common_shndx): New function.
13571 (Symbol_table::Symbol_table): Initialize new fields.
13572 (Symbol_table::add_from_object): Put small and large common
13573 symbols in the right list.
13574 (Symbol_table::sized_finalized_symbol): Check
13575 Symbol::is_common_shndx.
13576 (Symbol_table::sized_write_globals): Likewise.
13577 * common.cc (Symbol_table::do_allocate_commons): Allocate new
13578 common symbol lists. Don't call do_allocate_commons_list if the
13579 list is empty.
13580 (Symbol_table::do_allocate_commons_list): Remove is_tls
13581 parameter. Add comons_section_type parameter. Change all
13582 callers. Handle small and large common symbols.
13583 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
13584 Symbol::is_common_shndx.
13585 * resolve.cc (symbol_to_bits): Likewise.
13586 * target.h (Target::small_common_shndx): New function.
13587 (Target::small_common_section_flags): New function.
13588 (Target::large_common_shndx): New function.
13589 (Target::large_common_section_flags): New function.
13590 (Target::new_output_section): New function.
13591 (Target::Target_info): Add small_common_shndx, large_common_shndx,
13592 small_common_section_flags, and large_common_section_flags
13593 fields.
13594 (Target::do_new_output_section): New virtual function.
13595 * arm.cc (Target_arm::arm_info): Initialize new fields.
13596 * i386.cc (Target_i386::i386_info): Likewise.
13597 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
13598 Likewise.
13599 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
13600 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13601 (Target_x86_64::do_new_output_section): New function.
13602 * configure.ac: Define conditional MCMODEL_MEDIUM.
13603 * testsuite/Makefile.am (check_PROGRAMS): Add large.
13604 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
13605 (large_LDFLAGS): Define.
13606 * testsuite/large.c: New file.
13607 * testsuite/testfile.cc (Target_test::test_target_info):
13608 Initialize new fields.
13609 * configure, testsuite/Makefile.in: Rebuild.
13610
bb04269c
DK
136112009-06-05 Doug Kwan <dougkwan@google.com>
13612
13613 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 13614 * Makefile.in: Regenerate.
bb04269c
DK
13615 * i386.cc (class Target_i386): Define new virtual method to
13616 override do_is_local_label_name in parent.
13617 * object.cc (Sized_relobj::do_count_local_symbols): Discard
13618 local symbols if --discard-locals or -X is given.
13619 * options.h (class General_options): Declare new options
13620 '--discard-locals' and '-X' for discarding locals.
13621 * target.h (class Target): Define new methods is_local_label_name.
13622 Declare new virtual method do_is_local_label_name.
13623 * target.cc: New file.
13624 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
13625 (check_SCRIPTS): Add discard_locals_test.sh.
13626 (check_DATA): Add discard_local_tests.syms.
13627 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
13628 (discard_local_tests.syms, discard_locals_test.o): New make rules.
13629 * testsuite/Makefile.in: Regenerate.
13630 * testsuite/discard_locals_test.c: New file.
13631 * testsuite/discard_locals_test.sh: Same.
13632
805bb01c
DK
136332009-06-05 Doug Kwan <dougkwan@google.com>
13634
13635 * object.cc (Sized_relobj::Sized_relobj): Initialize
13636 discarded_eh_frame_shndx_ to -1U.
13637 (Sized_relobj::do_layout): Record index of a discard .eh_frame
13638 section.
13639 (Sized_relobj::do_count_local_symbols): Skip local symbols in
13640 a discarded .eh_frame section.
13641 (Sized_relobj::do_finalize_local_symbols): Ditto.
13642 * object.h (class Sized_relobj): Declare new member
13643 discarded_eh_frame_shndx_.
13644 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
13645 (local_labels_test.o, local_labels_test): New rules.
13646 * testsuite/Makefile.in: Regenerate.
13647
1dcd334d
DK
136482009-06-04 Doug Kwan <dougkwan@google.com>
13649
13650 * layout.cc (Layout::section_name_mapping): Add mapping for
13651 special ARM sections.
13652
96d49306
DK
136532009-06-03 Doug Kwan <dougkwan@google.com>
13654
13655 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
13656 (utils::has_overflow): Same.
13657
dff16297
ILT
136582009-06-03 Ian Lance Taylor <iant@google.com>
13659
13660 * layout.cc (Layout::section_name_mapping): New array, replacing
13661 Layout::linkonce_mapping.
13662 (Layout::section_name_mapping_count): New variable, replacing
13663 Layout::linkonce_mapping_count.
13664 (Layout::linkonce_output_name): Remove.
13665 (Layout::output_section_name): Rewrite.
13666 * layout.h (class Layout): Rename Linkonce_mapping to
13667 Section_name_mapping, linkonce_mapping to section_name_mapping,
13668 linkonce_mapping_count to section_name_mapping_count. Don't
13669 declare linkonce_output_name.
13670
c121c671
DK
136712009-06-03 Doug Kwan <dougkwan@google.com>
13672
13673 * gold/arm.cc (namespace utils): New.
13674 (Target_arm::reloc_is_non_pic): Define new method.
13675 (class Arm_relocate_functions): New.
13676 (Target_arm::Relocate::relocate): Handle relocation types used by
13677 Android.
13678
07800fab
ILT
136792009-06-03 Ian Lance Taylor <iant@google.com>
13680
13681 * arm.cc (Target_arm::scan::global): Use || instead of |.
13682
c121c671
DK
136832009-06-02 Doug Kwan <dougkwan@google.com>
13684
13685 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
13686 issued_non_pic_error_.
13687 (class Target_arm::Scan): Declare new method check_non_pic.
13688 Define new method symbol_needs_plt_entry.
13689 Declare new data member issued_non_pic_error_.
13690 (class Target_arm::Relocate): Declare new method
13691 should_apply_static_reloc.
13692 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
13693 (Target_arm::Scan::check_non_pic): Define new method.
13694 (Target_arm::Scan::local): Handle a small subset of reloc types used
13695 by Android.
13696 (Target_arm::Scan::local): Same.
13697 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
13698
b19b0c6d
ILT
136992009-05-31 Mikolaj Zalewski <mikolajz@google.com>
13700
13701 * incremental.cc (Incremental_inputs::report_command_line): Filter
13702 out --incremental-* options.
13703
94cdfcff
DK
137042009-05-29 Doug Kwan <dougkwan@google.com>
13705
13706 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
13707 template class.
13708 (class Target_arm): Update comment.
13709 (Target_arm::Target_arm): Initialize new data members GOT_,
13710 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
13711 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
13712 and Target_arm::rel_dyn_section.
13713 Declare new_enum Target_arm::Got_type.
13714 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
13715 and DYNBSS_.
13716 Update commments for member do_dynsym_value.
13717 (Target_arm::got_size, Target_arm::plt_section,
13718 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
13719 new methods inside class defintion.
13720 (Target_arm::got_section): Define new method.
13721 (Target_arm::rel_dyn_section): Same.
13722 (Output_data_plt_arm): New template class.
13723 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
13724 (Output_data_plt_arm:do_adjust_output_section): Define new method.
13725 (Output_data_plt_arm::add_entry): Same.
13726 (Output_data_plt_arm::first_plt_entry): Define new
13727 static data member for PLT instruction template.
13728 (Output_data_plt_arm::plt_entry): Same.
13729 (Output_data_plt_arm::do_write): Define new method.
13730 (Target_arm::make_plt_entry): Same.
13731 (Target_arm::do_finalize_sections): Same.
13732 (Target_arm::do_dynsym_value): Same.
13733
4a657b0d
DK
137342009-05-28 Doug Kwan <dougkwan@google.com>
13735
13736 * Makefile.am (TARGETSOURCES): Add arm.cc.
13737 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
13738 * Makefile.in: Regenerate.
13739 * arm.cc: New file.
13740 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
13741
e7ae8c36
DK
137422009-05-26 Doug Kwan <dougkwan@google.com>
13743
13744 * options.cc (General_options::parse_exclude_libs). Fix a comment.
13745 (General_options::check_excluded_libs): Strip off directories in
13746 archive name before matching like GNU ld does.
13747 * testsuite/Makefile.am (MOSTLYCLEANFILES,
13748 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
13749 (exclude_libs_test_LDFLAGS): Add linker option
13750 -Wl,--exclude-libs,libexclude_libs_test_3
13751 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
13752 an explicit archive without using -l.
13753 (alt/libexclude_libs_test_3.a): New make rule.
13754 * testsuite/Makefile.in: Regenerate.
13755 * testsuite/exclude_libs_test.c : Declare lib3_default().
13756 (main): Call it.
13757 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
13758 * exclude_libs_test_3.c: New file.
13759
f12e7348
NC
137602009-05-26 Nick Clifton <nickc@redhat.com>
13761
13762 * po/id.po: New Indonesian translation.
13763 * po/gold.pot: Updated template file.
13764
4daadc0d
ST
137652009-05-22 Sriraman Tallam <tmsriram@google.com>
13766
e1df38aa 13767 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
13768 gc_comdat_test files. Add -Wl,--gc-sections to build
13769 gc_comdat_test.
13770 * testsuite/Makefile.in: Regenerate.
13771 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
13772
531813ad
ST
137732009-05-21 Sriraman Tallam <tmsriram@google.com>
13774
13775 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
13776 kept comdat section was garbage collected.
13777 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
13778 * testsuite/Makefile.in: Regenerate.
13779 * testsuite/gc_comdat_test.sh: New file.
13780 * testsuite/gc_comdat_test_1.cc: New file.
13781 * testsuite/gc_comdat_test_2.cc: New file.
13782
65514900
CC
137832009-05-19 Doug Kwan <dougkwan@google.com>
13784
13785 * archive.cc (Archive::Archive): Move constructor from archive.h
13786 to here. Initialize no_export_.
13787 (Archive::get_elf_object_for_member): Set no_export flag of object.
13788 * archive.h (Archive::Archive): Move constructor body to
13789 archive.cc.
13790 (Archive::no_export): New method.
13791 (Archive::no_export_): New field.
13792 * object.h (Object::Object): Initialize no_export_ to false.
13793 (Object::no_export, Object::set_no_export): New methods.
13794 (Object::no_export_): New field.
13795 * options.cc (General_options::parse_exclude_libs): New method.
13796 (General_options::check_excluded_libs) Same.
13797 * options.h (exclude_libs): New option.
13798 (General_options::check_excluded_libs): New method declaration.
13799 (General_options::excluded_libs_): New field.
13800 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
13801 default or protected visibility if an object has no-export flag set.
13802 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
13803 (check_SCRIPTS): Add exclude_libs_test.sh.
13804 (check_DATA): Add exclude_libs_test.syms.
13805 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
13806 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
13807 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
13808 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
13809 (exclude_libs_test.syms, libexclude_libs_test_1.a,
13810 libexclude_libs_test_2.a): New rules.
13811 * testsuite/Makefile.in: Regenerate.
13812 * testsuite/exclude_libs_test.c: New file.
13813 * testsuite/exclude_libs_test.sh: Ditto.
13814 * testsuite/exclude_libs_test_1.c: Ditto.
13815 * testsuite/exclude_libs_test_2.c: Ditto.
13816
1b77ea50
ILT
138172009-05-15 Ian Lance Taylor <iant@google.com>
13818
13819 * configure.ac: Check for declarations for cases where libiberty.h
13820 checks HAVE_DECL_xxx.
13821 * configure, config.in: Rebuild.
13822
072fe7ce
ILT
138232009-05-15 Mikolaj Zalewski <mikolajz@google.com>
13824
13825 * gold.h (Incremental_argument_list): Remove (invalid) forward
13826 declaration.
13827 * incremental.cc (Incremental_inputs::report_achive): New method.
13828 (Incremental_inputs::report_object): New method.
13829 (Incremental_inputs::report_script): New method.
13830 (Incremental_inputs::finalize_inputs): New method.
13831 (Incremental_inputs::finalize): Call finalize_inputs().
13832 (Incremental_inputs::sized_create_incremental_inputs_section_data):
13833 Create inputs entries.
13834 * incremental.h (Incremental_input_type): New enum.
13835 (Incremental_inputs::Incremental_input): Initialize new fields.
13836 (Incremental_inputs::report_inputs): New method.
13837 (Incremental_inputs::report_achive): New method.
13838 (Incremental_inputs::report_object): New method.
13839 (Incremental_inputs::report_script): New method.
13840 (Incremental_inputs::finalize_inputs): New method.
13841 (Incremental_inputs::Input_info): New struct.
13842 (Incremental_inputs::Input_info_map): New typedef.
13843 (Incremental_inputs::lock_): New field.
13844 (Incremental_inputs::Inputs_): New field.
13845 (Incremental_inputs::Inputs_map): New field.
13846 * main.cc (main): Call Incremental_input::report_inputs.
13847 * options.h (Input_argument_list): Typedef moved from
13848 Input_arguments.
13849 (Input_file_group::Files): Remove, use ::Input_argument_list.
13850 (Input_file_group::Input_argument_list): Remove, use
13851 ::Input_argument_list.
13852 * plugin.cc (Plugin_manager::add_input_file): Add error in
13853 incremental build.
13854 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
13855 functions.
13856 * script.cc (read_input_script): Call
13857 Incremental_input::report_script.
13858 * script.h (Script_info): New class.
13859
b0481b0b
ILT
138602009-04-27 Ian Lance Taylor <iant@google.com>
13861
13862 * x86_64.cc (do_adjust_output_section): Set entsize to
13863 plt_entry_size.
13864
b22a5a41 138652009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
13866
13867 * output.cc (Output_file::close): After short writes, continue
13868 writing from the correct offset in the buffer being written.
13869
40fde488
CD
138702009-04-23 Chris Demetriou <cgd@google.com>
13871
13872 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
13873 * configure: Regenerate.
13874 * config.in: Regenerate.
13875 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
13876 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
13877
3ce2c28e
ILT
138782009-04-21 Mikolaj Zalewski <mikolajz@google.com>
13879
13880 * incremental.cc (Incremental_inputs_header_data): Renamed from
13881 Incremental_input_header_data.
13882 (Incremental_inputs_header_data::data_size): New field.
13883 (Incremental_inputs_header_data::put_input_file_count): Renamed
13884 from input_file_count.
13885 (Incremental_inputs_header_data::put_command_line_offset): Renamed
13886 from command_line_offset.
13887 (Incremental_inputs_header_data::put_reserved): Renamed from
13888 put_reserved.
13889 (Incremental_inputs_entry_data): Renamed from
13890 Incremental_input_entry_data.
13891 (Incremental_inputs_entry_data::data_size): New field.
13892 (Incremental_inputs::report_command_line): New method.
13893 (Incremental_inputs::finalize): New method.
13894 (Incremental_inputs::create_incremental_inputs_data): New method.
13895 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
13896 * incremental.h: New file.
13897 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 13898 (Layout::finalize): Create incremental inputs section in
3ce2c28e 13899 incremental builds.
703d02da 13900 (Layout::create_incremental_info_sections): New method.
3ce2c28e 13901 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
13902 (Layout::create_incremental_info_sections): New method.
13903 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
13904 * main.cc (main): Notify Incremental_input of the command line.
13905
e55bde5e
ILT
139062009-04-01 Ian Lance Taylor <iant@google.com>
13907 Mikolaj Zalewski <mikolajz@google.com>
13908
13909 * gold.h (reserve_unordered_map): Define, three versions, one for
13910 each version of Unordered_map.
13911 * layout.cc (Layout::Layout): Remove options parameter. Add
13912 number_of_input_files parameter. Don't initialize options_.
13913 Initialize number_of_input_files_ and resized_signatures_. Move
13914 sections_are_attached_.
13915 (Layout::layout_group): Reserve space for group_signatures_.
13916 (Layout::find_or_add_kept_section): Change name parameter to be a
13917 reference. Resize signatures_ map when it gets large enough.
13918 (Layout::layout_eh_frame): Use parameters->options() instead of
13919 this->options_.
13920 (Layout::make_output_section): Likewise.
13921 (Layout::attach_allocated_section_to_segment): Likewise.
13922 (Layout::finalize, Layout::create_executable_stack): Likewise.
13923 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
13924 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
13925 * layout.h (class Layout): Update declarations. Remove options_
13926 field. Add number_of_input_files_ and resized_signatures_
13927 fields. Move sections_are_attached_ field.
13928 * main.cc (main): Pass number of input files to Layout
13929 constructor. Don't pass options.
13930
154b857c
ILT
139312009-03-30 Ian Lance Taylor <iant@google.com>
13932
13933 * ffsll.c (ffsll): Correct implementation.
13934
2f35ab9b
ILT
139352009-03-27 Ian Lance Taylor <iant@google.com>
13936
fd03461a
ILT
13937 * ffsll.c: New file.
13938 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
13939 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
13940 * ftruncate.c (ftruncate): Declare before definition.
13941 * mremap.c (mremap): Likewise.
13942 * pread.c (pread): Likewise.
13943 * configure, Makefile.in, config.in: Rebuild.
13944
2f35ab9b
ILT
13945 * mremap.c: New file.
13946 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
13947 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
13948 (mremap): Declare if HAVE_MREMAP is not defined.
13949 * configure, Makefile.in, config.in: Rebuild.
13950
33aea2fd
CC
139512009-03-27 Cary Coutant <ccoutant@google.com>
13952
13953 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
13954 position independent.
13955 * sparc.cc (Target_sparc::check_non_pic): Likewise.
13956 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
13957
6d479619
CC
139582009-03-24 Cary Coutant <ccoutant@google.com>
13959
13960 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
13961 an executable.
13962 (needs_dynamic_reloc): Likewise.
13963
afc06bb8
ILT
139642009-03-24 Ian Lance Taylor <iant@google.com>
13965
13966 * yyscript.y (file_cmd): Recognize EXTERN.
13967 (extern_name_list, extern_name_list_body): New nonterminals.
13968 * script.cc (script_add_extern): Define.
13969 * script-c.h (script_add_extern): Declare.
13970
f6060a4d
ILT
139712009-03-24 Rafael Avila de Espindola <espindola@google.com>
13972
13973 * object.cc (is_elf_object): Define.
13974 * object.h (is_elf_object): Declare.
13975 * archive.cc (Archive::get_elf_object_for_member): Call
13976 is_elf_object.
33aea2fd 13977 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 13978
26736d8e
ILT
139792009-03-24 Elliott Hughes <enh@google.com>
13980
13981 * output.cc (Output_file::map_anonymous): Define.
13982 (Output_file::map): Use map_anonymous. If the regular mmap fails,
13983 try an anonymous one. Report the size if the mmap fails.
13984 * output.h (class Output_file): Declare map_anonymous.
13985
22fd9730
ILT
139862009-03-24 Ian Lance Taylor <iant@google.com>
13987
13988 * target-select.cc (instantiate_target): Don't acquire the lock if
13989 the instantiated_target_ field has already been set.
13990
cb010894
ILT
139912009-03-23 Ian Lance Taylor <iant@google.com>
13992
7f055c20
ILT
13993 * gold-threads.h (class Initialize_lock): Define.
13994 * gold-threads.cc (class Initialize_lock_once): Define.
13995 (initialize_lock_control): New static variable.
13996 (initialize_lock_pointer): New static variable.
13997 (initialize_lock_once): New static function.
13998 (Initialize_lock::Initialize_lock): Define.
13999 (Initialize_lock::initialize): Define.
14000 * target-select.h: Include "gold-threads.h".
14001 (class Target_selector): Add lock_ and initialize_lock_ fields.
14002 Don't define instantiate_target, just declare it.
14003 * target-select.cc (Target_selector::Target_selector): Initialize
14004 new fields.
14005 (Target_selector::instantiate_target): Define.
14006 * descriptors.h: Include "gold-threads.h".
14007 (class Descriptors): Add initialize_lock_ field.
14008 * descriptors.cc (Descriptors::Descriptors): Initialize new
14009 field.
14010 (Descriptors::open): Use initialize_lock_ field
14011 * errors.h (class Errors): Add initialize_lock_ field.
14012 * errors.cc (Errors::Errors): Initialize new field.
14013 (Errors::initialize_lock): Use initialize_lock_ field.
14014 * powerpc.cc (class Target_selector_powerpc): Remove
14015 instantiated_target_ field. In do_recognize call
14016 instantiate_target rather than do_instantiate_target. In
14017 do_instantiate_target just allocate a new target.
14018 * sparc.cc (class Target_selector_sparc): Likewise.
14019
36959681
ILT
14020 * freebsd.h: New file.
14021 * i386.cc: Include "freebsd.h".
14022 (Target_i386): Derive from Target_freebsd rather than
14023 Sized_target.
14024 (Target_selector_i386): Derive from Target_selector_freebsd rather
14025 than Target_selector.
14026 * x86_64.cc: Include "freebsd.h".
14027 (Target_x86_64): Derive from Target_freebsd rather than
14028 Sized_target.
14029 (Target_selector_x86_64): Derive from Target_selector_freebsd
14030 rather than Target_selector.
14031 * target.h (class Target): Add adjust_elf_header and
14032 do_adjust_elf_header.
14033 * output.cc (Output_file_header:: do_sized_write): Call target
14034 adjust_elf_header routine.
14035 * configure.tgt: Set targ_osabi.
14036 * configure.ac: Define GOLD_DEFAULT_OSABI.
14037 * parameters.cc (Parameters::default_target): Pass
14038 GOLD_DEFAULT_OSABI to select_target.
14039 * target-select.h (class Target_selector): Make instantiate_target
14040 protected rather than private.
14041 * Makefile.am (HFILES): Add freebsd.h.
14042 * configure, Makefile.in, config.in: Rebuild.
14043
cb010894
ILT
14044 * merge.cc (do_add_input_section): Correct pend value. Change
14045 message about last entry not being null terminated from error to
14046 warning.
14047
0e879927
ILT
140482009-03-20 Mikolaj Zalewski <mikolajz@google.com>
14049
14050 * incremental.cc: New file.
14051 * Makefile.am (CCFILES): Add incremental.cc.
14052 * Makefile.in: Rebuild.
14053
41105937
PP
140542009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
14055
14056 * layout.cc (Layout::output_section_name): Preserve names
14057 of '.note.' sections.
e1df38aa 14058
60439920
ILT
140592009-03-19 Ian Lance Taylor <iant@google.com>
14060
14061 * descriptors.cc (Descriptors::open): Check that the options are
14062 valid before using them.
14063
0d371ad3
ILT
140642009-03-18 Ian Lance Taylor <iant@google.com>
14065
14066 * script-sections.h: Include <list>.
14067 (class Script_sections): Change Sections_elements from std::vector
14068 to std::list. Typedef public Elements_iterator. Add
14069 orphan_section_placement_, data_segment_align_start_, and
14070 saw_data_segment_align_ fields. Remove data_segment_align_index_
14071 field.
14072 * script-sections.cc (class Orphan_section_placement): New class.
14073 (class Sections_element): Add virtual functions is_relro and
14074 orphan_section_init. Remove virtual function place_orphan_here.
14075 (class Output_section_definition): Add is_relro and
14076 orphan_section_init. Remove place_orphan_here.
14077 (class Orphan_output_section): Likewise.
14078 (Script_sections::Script_sections): Update for field changes.
14079 (Script_sections::data_segment_align): Set saw_data_segment_align_
14080 and data_segment_align_start_, not data_segment_align_index.
14081 (Script_sections::data_segment_relro_end): Check
14082 saw_data_segment_align_. Use data_segment_align_start_ rather
14083 than data_segment_align_index_.
14084 (Script_sections::place_orphan): Rewrite to use
14085 Orphan_section_placement.
14086
9201d894
ILT
140872009-03-17 Ian Lance Taylor <iant@google.com>
14088
9c5b8369
ILT
14089 * archive.cc (Archive::add_symbols): Check for a version attached
14090 to the symbol name in the archive map.
14091 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
14092 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
14093 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
14094 (ver_test_11.a): New target.
14095 * testsuite/Makefile.in: Rebuild.
14096
9201d894
ILT
14097 * configure.ac: Check for chsize and posix_fallocate. Replace
14098 ftruncate.
14099 * ftruncate.c: New file, from gnulib.
14100 * output.cc (posix_fallocate): Define dummy version if not
14101 HAVE_POSIX_FALLOCATE.
14102 (Output_file::map): Call posix_fallocate rather than lseek and
14103 write.
14104 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
14105 * configure, Makefile.in, config.in: Rebuild.
14106
ef4ab7a8 141072009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 14108
ef4ab7a8
PP
14109 * layout.h (Layout::create_note): Add section_name parameter.
14110 * layout.cc (Layout::create_note): Likewise.
14111 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 14112
8c500701
ILT
141132009-03-17 Ian Lance Taylor <iant@google.com>
14114
e85b18e1
ILT
14115 * descriptors.cc: Include "options.h".
14116 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
14117 (Descriptors::open): Always use O_CLOEXEC when opening a new
14118 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
14119 then set FD_CLOEXEC.
14120
9efe6174
ILT
14121 * sparc.cc (class Target_sparc): Add has_got_section.
14122 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
14123 make sure we have a GOT section.
14124
14125 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
14126 (Target_sparc::Scan::local): Likewise.
14127 (Target_sparc::Scan::global): Likewise.
14128 (Target_sparc::Relocate::relocate): Likewise.
14129 (Target_sparc::Relocate::relocate_tls): Likewise.
14130
8c500701
ILT
14131 * symtab.cc (Symbol_table::define_default_version): New function,
14132 broken out of add_from_object.
14133 (Symbol_table::add_from_object): Call define_default_version.
14134 (Symbol_table::define_special_symbol): Add resolve_oldsym
14135 parameter. Change all callers. If the version for a symbol comes
14136 from a version script, resolve it with the symbol with the same
14137 name with no version. Also add the symbol without a version if
14138 appropriate.
14139 (do_define_in_output_data): If resolving with oldsym, don't delete
14140 sym.
14141 (do_define_in_output_segment): Likewise.
14142 (do_define_as_constant): Likewise.
14143 * symtab.h (class Symbol_table): Update declarations.
14144
f1ed28fb
ILT
141452009-03-13 Ian Lance Taylor <iant@google.com>
14146
15f8229b
ILT
14147 * readsyms.cc (Read_symbols::incompatible_warning): New function.
14148 (Read_symbols::requeue): New function.
14149 (Read_symbols::do_read_symbols): If make_elf_object fails because
14150 the target type is not configured, and the file was searched for,
14151 issue a warning and retry with the next directory.
14152 (Add_symbols::run): If the file has an incompatible format, and
14153 it was searched for, requeue the Read_symbols task. On error,
14154 release the object.
14155 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
14156 dirindex parameter to constructor. Change all callers. Declare
14157 incompatible_warning and requeue.
14158 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
14159 input_argument_ and input_group_ fields. Add them to
14160 constructor. Change all callers.
14161 (class Read_script): Add dirindex_ field. Add it to constructor.
14162 Change all callers.
14163 * archive.cc (Archive::setup): Remove input_objects parameter.
14164 Change all callers.
14165 (Archive::get_file_and_offset): Likewise.
14166 (Archive::read_all_symbols): Likewise.
14167 (Archive::read_symbols): Likewise.
14168 (Archive::get_elf_object_for_member): Remove input_objects
14169 parameter. Add punconfigured parameter. Change all callers.
14170 (Archive::add_symbols): Change return type to bool. Check return
14171 value of include_member.
14172 (Archive::include_all_members): Likewise.
14173 (Archive::include_member): Change return type to bool. Return
14174 false if first included object has incompatible target. Set
14175 included_member_ field.
14176 (Add_archive_symbols::run): If add_symbols returns false, requeue
14177 Read_symbols task.
14178 * archive.h (class Archive): Add included_member_ field.
14179 Initialize it in constructor. Add input_file and searched_for
14180 methods. Update declarations.
14181 (class Add_archive_symbols): Add dirpath_, dirindex_, and
14182 input_argument_ fields. Add them to constructor. Change all
14183 callers.
14184 * script.cc: Include "target-select.h".
14185 (class Parser_closure): Add skip_on_incompatible_target_ and
14186 found_incompatible_target_ fields. Add
14187 skip_on_incompatible_target parameter to constructor. Change all
14188 callers. Add methods skip_on_incompatible_target,
14189 clear_skip_on_incompatible_target, found_incompatible_target, and
14190 set_found_incompatible_target.
14191 (read_input_script): Add dirindex parameter. Change all callers.
14192 If parser finds an incompatible target, requeue Read_symbols
14193 task.
14194 (script_set_symbol): Clear skip_on_incompatible_target in
14195 closure.
14196 (script_add_assertion, script_parse_option): Likewise.
14197 (script_start_sections, script_add_phdr): Likewise.
14198 (script_check_output_format): New function.
14199 * script.h (read_input_script): Update declaration.
14200 * script-c.h (script_check_output_format): Declare.
14201 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
14202 (ignore_cmd): Remove OUTPUT_FORMAT.
14203 * fileread.cc (Input_file::Input_file): Add explicit this.
14204 (Input_file::will_search_for): New function.
14205 (Input_file::open): Add pindex parameter. Change all callers.
14206 * fileread.h (class Input_file): Add input_file_argument method.
14207 Declare will_search_for. Update declarations.
14208 * object.cc (make_elf_object): Add punconfigured parameter.
14209 Change all callers.
14210 * object.h (class Object): Make input_file public. Add
14211 searched_for method.
14212 (make_elf_object): Update declaration.
14213 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
14214 restart search.
14215 * dirsearch.h (class Dirsearch): Update declaration.
14216 * options.h (class General_options): Add --warn-search-mismatch.
14217 * parameters.cc (Parameters::is_compatible_target): New function.
14218 * parameters.h (class Parameters): Declare is_compatible_target.
14219 * workqueue.cc (Workqueue::add_blocker): New function.
14220 * workqueue.h (class Workqueue): Declare add_blocker.
14221
f1ed28fb
ILT
14222 * fileread.cc (Input_file::open): Remove options parameter.
14223 Change all callers.
14224 (Input_file::open_binary): Likewise.
14225 * script.cc (read_input_script): Likewise.
14226 * readsyms.h (class Read_symbols): Remove options_ field. Remove
14227 options parameter from constructor. Change all callers.
14228 (class Read_script): Likewise.
14229 * fileread.h (class Input_file): Update declarations.
14230 * script.h (read_input_script): Update declaration.
14231
34dd024a
NC
142322009-03-10 Nick Clifton <nickc@redhat.com>
14233
14234 * po/es.po: New Spanish translation.
14235
6d71b17c
CC
142362009-03-06 Cary Coutant <ccoutant@google.com>
14237
14238 * options.cc (parse_short_option): Keep dash_z from registering itself.
14239
031cdbed
ILT
142402009-03-03 Ian Lance Taylor <iant@google.com>
14241
14242 PR 9918
14243 * target-reloc.h (relocate_section): Pass output_section to
14244 relocate.
14245 * i386.cc (Target_i386::should_apply_static_reloc): Add
14246 output_section parameter. Change all callers.
14247 (Target_i386::Relocate::relocate): Add output_section parameter.
14248 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14249 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
14250 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
14251 * testsuite/two_file_shared.sh: New script.
14252 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
14253 (check_DATA): Add two_file_shared.dbg.
14254 (two_file_shared.dbg): New target.
14255 * testsuite/Makefile.in: Rebuild.
14256
15d5fa16
ILT
142572009-03-01 Ian Lance Taylor <iant@google.com>
14258
14259 * configure.ac: Check for byteswap.h.
14260 * configure: Rebuild.
14261 * config.in: Rebuild.
14262
8a4c0b0d
ILT
142632009-03-01 Mikolaj Zalewski <mikolajz@google.com>
14264
14265 * layout.cc (Layout::find_or_add_kept_section): New function.
14266 (Layout::add_comdat): Removed.
14267 * layout.h (struct Kept_section): Move out of class Layout.
14268 Remove trailing underscores from field names. Add group_sections
14269 field. Rename group_ field to is_group. Change all uses.
14270 (class Layout): Declare find_or_add_kept_section, not add_comdat.
14271 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
14272 comdat_groups_ field.
14273 (Sized_relobj::include_section_group): Use
14274 find_or_add_kept_section and Kept_section::group_sections.
14275 (Sized_relobj::include_linkonce_section): Likewise.
14276 * object.cc (class Sized_relobj): Don't define Comdat_group or
14277 Comdat_group_table. Remove find_comdat_group and
14278 add_comdat_group. Remove comdat_groups_ field.
14279 * plugin.cc (include_comdat_group): Use
14280 Layout::find_or_add_kept_section.
14281
b4ecf66b
ILT
142822009-02-28 Ian Lance Taylor <iant@google.com>
14283
14359ca0
ILT
14284 * README: --gc-sections and map files are now supported. Document
14285 some build requirements.
14286
b4ecf66b
ILT
14287 PR 6992
14288 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
14289 relocatable link set the value of the section symbol to zero.
14290 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
14291 relocatable link don't include the section address in the local
14292 symbol value.
14293
0602e05a
ILT
142942009-02-27 Ian Lance Taylor <iant@google.com>
14295
fd9d194f
ILT
14296 PR 6811
14297 * options.h (class Search_directory): Add is_system_directory.
14298 (class General_options): Declare is_in_system_directory.
14299 * options.cc (get_relative_sysroot): Make static.
14300 (get_default_sysroot): Make static.
14301 (General_optoins::is_in_system_directory): New function.
14302 * fileread.cc (Input_file::is_in_system_directory): New function.
14303 * fileread.h (class Input_file): Declare is_in_system_directory.
14304 * object.h (class Object): Add is_in_system_directory.
14305 (class Input_objects): Remove system_library_directory_ field.
14306 * object.cc (Input_objects::add_object): Don't set
14307 system_library_directory_.
14308 (input_objects::found_in_system_library_directory): Remove.
14309 * symtab.cc (Symbol_table::write_globals): Remove input_objects
14310 parameter. Change all callers.
14311 (Symbol_table::sized_write_globals): Likewise.
14312 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
14313 Call Object::is_in_system_directory.
14314 * symtab.h (class Symbol_table): Update declarations.
14315
61edd21f
ILT
14316 PR 5990
14317 * descriptors.h (Open_descriptor): Add is_on_stack field.
14318 * descriptors.cc (Descriptors::open): If the descriptor is on the
14319 top of the stack, remove it. Initialize is_on_stack field.
14320 (Descriptors::release): Only add pod to stack if it is not on the
14321 stack already.
14322 (Descriptors::close_some_descriptor): Clear stack_next and
14323 is_on_stack fields.
14324
e29e076a
ILT
14325 PR 7091
14326 * output.cc (Output_section::find_starting_output_address): Rename
14327 from starting_output_address; add PADDR parameter; change return
14328 type.
14329 * output.h (class Output_section): Declare
14330 find_starting_output_address instead of starting_output_address.
14331 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
14332 section symbol for which we can't find a merge section.
14333
0602e05a
ILT
14334 PR 9836
14335 * symtab.cc (Symbol_table::add_from_object): If the visibility is
14336 hidden or internal, force the symbol to be local.
14337 * resolve.cc (Symbol::override_visibility): Define.
14338 (Symbol::override_base): Use override_visibility.
14339 (Symbol_table::resolve): Likewise.
14340 (Symbol::override_base_with_special): Likewise.
14341 (Symbol_table::override_with_special): If the visibility is hidden
14342 or internal, force the symbol to be local.
14343 * symtab.h (class Symbol): Add set_visibility and
14344 override_visibility.
14345 * testsuite/ver_test_1.sh: New file.
14346 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
14347 (check_DATA): Add ver_test_1.syms.
14348 (ver_test_1.syms): New target.
14349 * testsuite/Makefile.in: Rebuild.
14350
401a9a73
CC
143512009-02-25 Cary Coutant <ccoutant@google.com>
14352
14353 * layout.cc (Layout::choose_output_section): Don't rename sections
14354 when using a linker script that has a SECTIONS clause.
14355 * Makefile.in: Regenerate.
14356
14357 * testsuite/Makefile.am (script_test_5.sh): New test case.
14358 * testsuite/Makefile.in: Regenerate.
14359 * testsuite/script_test_5.cc: New file.
14360 * testsuite/script_test_5.sh: New file.
14361 * testsuite/script_test_5.t: New file.
14362
f488e4b0
CC
143632009-02-13 Rafael Avila de Espindola <espindola@google.com>
14364
14365 * archive.cc (Archive::include_member): Update calls to add_symbols.
14366 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
14367 the Layout argument.
14368 * dynobj.h (do_add_symbols): Add the Layout argument.
14369 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
14370 Layout argument.
14371 * object.h (Object::add_symbols): Add the Layout argument.
14372 (Object::do_add_symbols): Add the Layout argument.
14373 (Sized_relobj::do_add_symbols): Add the Layout argument.
14374 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
14375 Unify the two versions.
14376 (Add_plugin_symbols): Remove.
14377 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
14378 (Sized_pluginobj::do_add_symbols): Unify the two versions.
14379 (Add_plugin_symbols): Remove.
14380 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
14381 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
14382 (Add_symbols::run): Make it work with Pulginobj.
14383
89dd1680
ILT
143842009-02-06 Ian Lance Taylor <iant@google.com>
14385
14386 * object.cc (Sized_relobj::do_layout): Make info message start
14387 with lower case letter.
14388
266d0a74
ILT
143892009-02-06 Mikolaj Zalewski <mikolajz@google.com>
14390
602b464e
ILT
14391 * binary.cc: Fix file comment.
14392
266d0a74
ILT
14393 * options.h (enum Incremental_disposition): Define.
14394 (class General_options): Add new options: --incremental,
14395 --incremental_changed, --incremental_unchanged,
14396 --incremental_unknown. Add incremental_disposition_ and
14397 implicit_incremental_ fields.
14398 (General_options::incremental_disposition): New function.
14399 (class Position_dependent_options): Add incremental_disposition
14400 option.
14401 (Position_dependent_options::copy_from_options): Set incremental
14402 dispositions.
14403 * options.cc (General_options::parse_incremental_changed): New
14404 function.
2e702c99
RM
14405 (General_options::parse_incremental_unchanged): New function.
14406 (General_options::parse_incremental_unknown): New function.
14407 (General_options::General_options): Initialize new fields
266d0a74 14408 incremental_disposition_ and implicit_incremental_.
2e702c99 14409 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
14410 without --incremental.
14411
f073bbf7
CD
144122009-02-06 Chris Demetriou <cgd@google.com>
14413
14414 * gold.h (gold_undefined_symbol): Change to take only a Symbol
14415 pointer and to report location as the file name associated with
14416 the symbol.
14417 (gold_undefined_symbol_at_location): New function to replace the
14418 old gold_undefined_symbol functionality.
14419 * target-reloc.h (relocate_section): Update to use
14420 gold_undefined_symbol_at_location.
14421 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14422 Call gold_undefined_symbol function rather than gold_error.
14423 * errors.h (Errors::undefined_symbol): Take location as a
14424 string, rather than calculating it from a relocation.
14425 * errors.cc (Errors::fatal): Print "fatal error:" before the
14426 formatted message.
14427 (Errors::error, Errors::error_at_location): Print "error: "
14428 before the formatted message.
14429 (Errors::undefined_symbol): Take location as a string, rather
14430 than calculating it from a relocation.
14431 (gold_undefined_symbol_at_location): New function akin to
14432 old gold_undefined_symbol, calculates location from relocation.
14433 (gold_undefined_symbol): Change to take only a Symbol pointer
14434 and to report location as the file name associated with the symbol.
14435 * testsuite/debug_msg.sh: Update for changed error messages.
14436 * testsuite/undef_symbol.sh: Likewise.
14437
8e94a90c
ILT
144382009-02-04 Duncan Sands <baldrick@free.fr>
14439
14440 PR 9812
14441 * reduced_debug_output.h
14442 (Output_reduced_debug_abbrev_section::failed): Use format for
14443 gold_warning.
14444 (Output_reduced_debug_info_section::faild): Likewise.
14445
88a0e15b
ILT
144462009-01-31 Mikolaj Zalewski <mikolajz@google.com>
14447
14448 * script.cc (Lazy_demangler): New class.
2e702c99 14449 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
14450 symbol only once.
14451
5efc7cd2
CC
144522009-01-29 Cary Coutant <ccoutant@google.com>
14453
14454 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
14455 to __tls_get_addr.
14456 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14457
e0ebcf42
ILT
144582009-01-28 Ian Lance Taylor <iant@google.com>
14459
5efc7cd2 14460 * version.cc (version_string): Bump to 1.9.
75fe7426 14461
e0ebcf42
ILT
14462 * gold.h: Include <cstring> and <stdint.h>.
14463 * version.cc: Include <cstdio>.
14464 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
14465 warning.
14466 * reduced_debug_output.cc (insert_into_vector): Rename from
14467 Insert_into_vector; change all callers. Use Swap_unaligned to
14468 avoid aliasing issue; remove union since it is unnecessary.
14469
8e2813be 144702009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
14471
14472 * Makefile.am (CCFILES): Add gc.cc.
14473 (HFILES): Add gc.h.
14474 * Makefile.in: Regenerate.
14475 * gold.cc (Gc_runner): New class.
14476 (queue_initial_tasks): Call garbage collection related tasks
14477 when corresponding options are invoked.
14478 (queue_middle_gc_tasks): New function.
14479 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
14480 processed early before laying out sections during garbage collection.
14481 * gold.h (queue_middle_gc_tasks): New function.
14482 (is_prefix_of): Move from "layout.cc".
14483 * i386.cc (Target_i386::gc_process_relocs): New function.
14484 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
14485 * main.cc (main): Create object of class "Garbage_collection".
14486 * object.cc (Relobj::copy_symbols_data): New function.
14487 (Relobj::is_section_name_included): New function.
e1df38aa
NC
14488 (Sized_relobj::do_layout): Allow this function to be called twice
14489 during garbage collection and defer layout of section during the
6d03d481
ST
14490 first call.
14491 * object.h (Relobj::get_symbols_data): New function.
14492 (Relobj::is_section_name_included): New function.
14493 (Relobj::copy_symbols_data): New function.
14494 (Relobj::set_symbols_data): New function.
14495 (Relobj::get_relocs_data): New function.
14496 (Relobj::set_relocs_data): New function.
14497 (Relobj::is_output_section_offset_invalid): New pure virtual function.
14498 (Relobj::gc_process_relocs): New function.
14499 (Relobj::do_gc_process_relocs): New pure virtual function.
14500 (Relobj::sd_): New data member.
14501 (Sized_relobj::is_output_section_offset_invalid): New function.
14502 (Sized_relobj::do_gc_process_relocs): New function.
14503 * options.h (General_options::gc_sections): Modify to not be a no-op.
14504 (General_options::print_gc_sections): New option.
14505 * plugin.cc (Plugin_finish::run): Remove function call to
14506 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
14507 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
14508 * reloc.cc (Read_relocs::run): Add task to process relocs and
14509 determine unreferenced sections when doing garbage collection.
14510 (Gc_process_relocs): New class.
14511 (Sized_relobj::do_gc_process_relocs): New function.
14512 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
14513 sections that are garbage collected.
14514 * reloc.h (Gc_process_relocs): New class.
14515 * sparc.cc (Target_sparc::gc_process_relocs): New function.
14516 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
14517 symbols whose corresponding sections are garbage collected.
14518 (Symbol_table::Symbol_table): Add new parameter for the garbage
14519 collection object.
14520 (Symbol_table::gc_mark_undef_symbols): New function.
14521 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14522 (Symbol_table::gc_mark_dyn_syms): New function.
14523 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
14524 as garbage.
14525 (Symbol_table::add_from_object): Likewise.
14526 (Symbol_table::add_from_relobj): When building shared objects, do not
14527 treat externally visible symbols as garbage.
14528 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
14529 table information for static and relocatable links.
14530 * symtab.h (Symbol_table::set_gc): New function.
14531 (Symbol_table::gc): New function.
14532 (Symbol_table::gc_mark_undef_symbols): New function.
14533 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14534 (Symbol_table::gc_mark_dyn_syms): New function.
14535 (Symbol_table::gc_): New data member.
e1df38aa 14536 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
14537 function.
14538 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
14539 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
14540
3b293544
CF
145412009-01-20 Chris Faylor <me.sourceware@sourceware.org>
14542
14543 * options.h (General_options::gc_sections): Define as a no-op for now.
14544 (General_options::no_keep_memory): Ditto.
14545 (General_options::Bshareable): Define.
14546 * options.cc (General_options::finalize): Honor -Bshareable.
14547
83d22aa8
AS
145482009-01-20 Andreas Schwab <schwab@suse.de>
14549
14550 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
14551 read the value in the contents, since we don't use it. Use the
14552 template endianness when writing.
14553 (Relocate::relocate): Use it for R_PPC_REL16_HA.
14554
cd536b21
AS
145552009-01-19 Andreas Schwab <schwab@suse.de>
14556
14557 * configure.tgt (powerpc64-*): Fix targ_obj.
14558
99e9a495
ILT
145592009-01-15 Ian Lance Taylor <iant@google.com>
14560
14561 * object.cc (Sized_relobj::write_local_symbols): Don't write out
14562 local symbols when stripping all symbols.
14563
bbbfea06
CC
145642009-01-14 Cary Coutant <ccoutant@google.com>
14565
99e9a495 14566 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 14567
0f7c0701
CC
145682009-01-14 Cary Coutant <ccoutant@google.com>
14569
14570 * archive.cc (Archive::get_elf_object_for_member): Remove call
14571 to File_read::claim_for_plugin.
14572 * descriptors.cc (Descriptors::open): Remove reference to
14573 is_claimed.
14574 (Descriptors::claim_for_plugin): Remove.
14575 * descriptors.h (Descriptors::claim_for_plugin): Remove.
14576 (Descriptors::is_claimed): Remove.
14577 (claim_descriptor_for_plugin): Remove.
14578 * fileread.cc (File_read::claim_for_plugin): Remove.
14579 * fileread.h (File_read::claim_for_plugin): Remove.
14580 (File_read::descriptor): Reopen descriptor if necessary.
14581 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
14582 (Plugin_manager::all_symbols_read): Add task parameter. Change
14583 all callers.
14584 (Plugin_manager::get_input_file): New function.
14585 (Plugin_manager::release_input_file): New function.
14586 (Pluginobj::Pluginobj): Add filesize parameter and initialize
14587 corresponding data member.
14588 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
14589 and pass to base constructor. Change all callers.
14590 (get_input_file, release_input_file): New functions.
14591 (make_sized_plugin_object): Add filesize parameter. Change all callers.
14592 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
14593 (Plugin_manager::all_symbols_read): Add task parameter.
14594 (Plugin_manager::get_input_file): New function.
14595 (Plugin_manager::release_input_file): New function.
14596 (Plugin_manager::task_): New data member.
14597 (Pluginobj::Pluginobj): Add filesize parameter.
14598 (Pluginobj::filename): New function.
14599 (Pluginobj::descriptor): New function.
14600 (Pluginobj::filesize): New function.
14601 (Pluginobj::filesize_): New data member.
14602 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
14603 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
14604 File_read::claim_for_plugin; use Object::unlock to unlock the file.
14605
14606 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
14607 with archive libraries.
14608 * testsuite/Makefile.in: Regenerate.
14609 * testsuite/plugin_test.c (struct sym_info): New type.
14610 (get_input_file, release_input_file): New static variables.
14611 (onload): Capture new transfer vector entries.
14612 (claim_file_hook): Stop reading at end of file according to filesize.
14613 Factor out parsing of readelf output into separate function.
14614 (all_symbols_read_hook): Exercise get_input_file and release_input_file
14615 APIs and get the source file name from the symbol table. Convert
14616 source file name to corresponding object file name. Print info
14617 message when adding new input files.
14618 (parse_readelf_line): New function.
14619 * testsuite/plugin_test_1.sh: Add checks for new info messages.
14620 * testsuite/plugin_test_2.sh: Likewise.
14621 * testsuite/plugin_test_3.sh: Likewise.
14622 * testsuite/plugin_test_4.sh: New test case.
14623
62a6d109
ILT
146242009-01-07 Ian Lance Taylor <iant@google.com>
14625
14626 * version.cc (version_string): Bump to 1.8.
14627
483620e8
CC
146282008-12-23 Cary Coutant <ccoutant@google.com>
14629
14630 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
14631 * plugin.cc (Plugin_manager::finish): Rename as
14632 layout_deferred_objects. Move cleanup to separate function.
14633 (Plugin_manager::cleanup): New function.
14634 (Plugin_finish::run): Call layout_deferred_objects and cleanup
14635 separately.
14636 * plugin.h (Plugin_manager::finish): Rename as
14637 layout_deferred_objects.
14638 (Plugin_manager::cleanup): New function.
14639 (Plugin_manager::cleanup_done): New field.
14640
d66a9eb3
CC
146412008-12-23 Cary Coutant <ccoutant@google.com>
14642
14643 * plugin.cc (is_visible_from_outside): New function.
14644 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
14645 so we don't return "IR only" status for exported symbols or -r links.
14646
14647 * testsuite/Makefile.am (plugin_test_3): New test case.
14648 * testsuite/Makefile.in: Regenerate.
14649 * testsuite/plugin_test_3.sh: New file.
14650
5995b570
CC
146512008-12-22 Cary Coutant <ccoutant@google.com>
14652
14653 * object.cc (Sized_relobj::layout_section): New function.
14654 (Sized_relobj::do_layout): Defer layout of input sections until after
14655 plugin has provided replacement files.
14656 (Sized_relobj::do_layout_deferred_sections): New function.
14657 * object.h (Relobj::set_section_offset): Remove virtual keyword.
14658 (Relobj::layout_deferred_sections): New function.
14659 (Relobj::do_layout_deferred_sections): New function.
14660 (Sized_relobj::do_layout_deferred_sections): New function.
14661 (Sized_relobj::layout_section): New function.
14662 (Sized_relobj::Deferred_layout): New structure.
14663 (Sized_relobj::deferred_layout_): New field.
14664 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
14665 Change all callers. Layout deferred sections.
14666 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
14667 references.
14668 (Plugin_hook::run): Move code from do_plugin_hook inline.
14669 (Plugin_hook::do_plugin_hook): Remove.
14670 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
14671 (Plugin_manager::finish): Renamed, was cleanup.
14672 (Plugin_manager::should_defer_layout): New function.
14673 (Plugin_manager::add_deferred_layout_object): New function.
14674 (Plugin_manager::Deferred_layout_list): New type.
14675 (Plugin_manager::deferred_layout_objects_): New field.
14676 (Plugin_hook::do_plugin_hook): Remove.
14677
ee769c88
ILT
146782008-12-17 Ian Lance Taylor <iant@google.com>
14679
14680 * options.h (class General_options): Add --no case for
14681 --export-dynamic.
14682
abc8dcba
CC
146832008-12-16 Cary Coutant <ccoutant@google.com>
14684
14685 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
14686 vector.
14687 (Plugin_manager::claim_file): Create plugin object even if
14688 plugin did not call the add_symbols callback.
14689 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
14690 asking for more symbols than were added.
14691 * testsuite/Makefile.am (plugin_test_1): Add test case with
14692 no global symbols.
14693 (empty.syms): New target.
14694 * testsuite/Makefile.in: Regenerate.
14695 * testsuite/plugin_test.c (claim_file_hook): Add new debug
14696 message. Don't call add_symbols if no globals.
14697 (all_symbols_read_hook): Don't provide replacement for empty
14698 claimed file.
14699
b0074644
ILT
147002008-12-12 Ian Lance Taylor <iant@google.com>
14701
68943102
ILT
14702 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
14703 r_type == 0 for a local symbol with r_sym == 0.
14704 (scan_relocatable_relocs): Pass r_sym to
14705 local_non_section_strategy.
14706 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
14707 r_sym parameter.
14708
b0074644
ILT
14709 * configure.ac: Update test for TLS descriptors: they are
14710 supported as of glibc 2.9.
14711 * configure: Rebuild.
14712
c2508178
ILT
147132008-12-11 Ian Lance Taylor <iant@google.com>
14714
14715 PR 7091
14716 * target-reloc.h (Default_scan_relocatable_relocs): For each
14717 function, map r_type == 0 to RELOC_DISCARD.
14718
2756a258
CC
147192008-12-10 Cary Coutant <ccoutant@google.com>
14720
14721 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
14722 object to override a kept COMDAT group from a plugin object.
14723
bb6f53d3
ILT
147242008-12-09 Ian Lance Taylor <iant@google.com>
14725
fbc558e1
ILT
14726 PR 7088
14727 * yyscript.y (file_cmd): Handle INPUT.
14728
bb6f53d3
ILT
14729 * testsuite/initpri1.c: Change all declarations to be full
14730 prototypes by adding void, to avoid compiler warnings.
14731
4674ecfc
CC
147322008-12-05 Rafael Avila de Espindola <espindola@google.com>
14733
14734 * options.cc (General_options::parse_plugin_opt): New.
14735 (General_options::add_plugin): The argument now is just the filename.
14736 (General_options::add_plugin_option): New.
14737 * options.h (plugin_opt): New.
14738 (add_plugin): Change argument name.
14739 (add_plugin_option): New.
14740 * plugin.cc (Plugin::load): Don't parse the plugin option.
14741 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
14742 (Plugin::add_option): New.
14743 (Plugin::args_): Change type.
14744 (Plugin::filename_): New.
14745 (Plugin_manager::add_plugin_option): New.
14746 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
14747 * testsuite/Makefile.in: Regenerate.
14748
fd06b4aa
CC
147492008-12-05 Cary Coutant <ccoutant@google.com>
14750
14751 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
14752 Handle --strip-lto-sections option.
14753 * options.h (strip_lto_sections): New option.
14754
6c52134c
CC
147552008-12-01 Cary Coutant <ccoutant@google.com>
14756
14757 * plugin.cc (ld_plugin_message): Change format parameter to const.
14758 Fix mismatch between new[] and delete.
14759
a45248e0
CC
147602008-11-14 Cary Coutant <ccoutant@google.com>
14761
14762 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
14763 instead of -1U.
14764
c82fbeee
CS
147652008-11-05 Craig Silverstein <csilvers@google.com>
14766
14767 * options.cc (General_options::parse_dynamic_list): New function.
14768 * options.h (General_options): New flags dynamic_list,
14769 dynamic_list_data, dynamic_list_cpp_new, and
14770 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
14771 (General_options::in_dynamic_list): New function.
14772 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
14773 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
14774 (Lex::can_continue_name): Likewise.
14775 (yylex): Likewise.
14776 (read_script_file): New parameter script_options.
14777 (read_dynamic_list): New function.
14778 (Script_options::define_dynamic_list): New function.
14779 (dynamic_list_keyword_parsecodes): New variable.
14780 (dynamic_list_keywords): New variable.
14781 * script.h (Script_options::define_dynamic_list): New function
14782 prototype.
14783 (read_dynamic_list): New function prototype.
14784 * symtab.cc (strprefix): New macro.
14785 (Symbol::should_add_dynsym_entry): Support dynamic_list,
14786 dynamic_list_data, dynamic_list_cpp_new, and
14787 dynamic_list_cpp_typeinfo.
14788 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
14789 (dynamic_list_expr): New rule.
14790 (dynamic_list_nodes): Likewise.
14791 (dynamic_list_node): Likewise.
14792 * testsuite/Makefile.am (dynamic_list): New test.
14793 * testsuite/Makefile.in: Regenerated.
14794 * testsuite/dynamic_list.t: New file.
14795 * testsuite/dynamic_list.sh: New file.
14796
e0bb29a5
CS
147972008-11-05 Craig Silverstein <csilvers@google.com>
14798
14799 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
14800 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
14801 (t11_last): Likewise.
14802 * testsuite/ver_test_6.c (main): Likewise.
14803
4e1e25e0
CC
148042008-10-07 Cary Coutant <ccoutant@google.com>
14805
14806 * options.c (General_options::finalize): Add check for -static and
14807 -shared.
14808 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
14809 is not empty.
14810
92f03fcb
CC
148112008-10-02 Cary Coutant <ccoutant@google.com>
14812
14813 * plugin.cc (make_sized_plugin_object): Fix conditional
14814 compilation to work when not all targets are enabled.
14815
fbd8a257
CC
148162008-09-29 Cary Coutant <ccoutant@google.com>
14817
14818 * archive.cc (Archive::get_file_and_offset): Use filename instead
14819 of name to get library path.
14820 (Archive::include_member): Unlock external member of a thin archive.
14821
14822 * testsuite/Makefile.am (TEST_AR): New variable.
14823 (thin_archive_test_1): New test.
14824 (thin_archive_test_2): New test.
81636b3f
CC
14825 * testsuite/Makefile.in: Regenerate.
14826 * testsuite/thin_archive_main.cc: New file.
14827 * testsuite/thin_archive_test_1.cc: New file.
14828 * testsuite/thin_archive_test_2.cc: New file.
14829 * testsuite/thin_archive_test_3.cc: New file.
14830 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 14831
eff45813
CC
148322008-09-29 Cary Coutant <ccoutant@google.com>
14833
14834 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
14835 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
14836 instead of -1U.
14837 (Sized_relobj::do_finalize_local_symbols): Likewise.
14838 (Sized_relobj::map_to_kept_section): Likewise.
14839 * object.h (Sized_relobj::invalid_address): New constant.
14840 (Sized_relobj::do_output_section_offset): Check for invalid_address
14841 and return -1ULL.
14842 * output.cc (Output_reloc::local_section_offset): Use constant
14843 invalid_address instead of -1U.
14844 (Output_reloc::get_address): Likewise.
14845 (Output_section::output_address): Change -1U to -1ULL.
14846 * output.h (Output_reloc::invalid_address): New constant.
14847 * reloc.cc (Sized_relobj::write_sections): Use constant
14848 invalid_address instead of -1U.
14849 (Sized_relobj::relocate_sections): Likewise.
14850 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
14851 values for merge sections.
14852 * target-reloc.h (relocate_for_relocatable): Use constant
14853 invalid_address instead of -1U.
14854
89fc3421
CC
148552008-09-19 Cary Coutant <ccoutant@google.com>
14856
14857 Add plugin functionality for link-time optimization (LTO).
14858 * configure.ac (plugins): Add --enable-plugins option.
14859 * configure: Regenerate.
14860 * config.in: Regenerate.
14861 * Makefile.am (LIBDL): New variable.
14862 (CCFILES): Add plugin.cc.
14863 (HFILES): Add plugin.h.
14864 (ldadd_var): Add LIBDL.
14865 * Makefile.in: Regenerate.
14866
14867 * archive.cc: Include "plugin.h".
14868 (Archive::setup): Don't preread archive symbols when using a plugin.
14869 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
14870 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
14871 files.
14872 (Archive::include_member): Add symbols from plugin objects.
14873 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
14874 * descriptors.cc (Descriptors::open): Check for file descriptors
14875 abandoned by plugins.
14876 (Descriptors::claim_for_plugin): New function.
14877 * descriptors.h (Descriptors::claim_for_plugin): New function.
14878 (Open_descriptor::is_claimed): New field.
14879 (claim_descriptor_for_plugin): New function.
14880 * fileread.cc (File_read::claim_for_plugin): New function.
14881 * fileread.h (File_read::claim_for_plugin): New function.
14882 (File_read::descriptor): New function.
14883 * gold.cc: Include "plugin.h".
14884 (queue_initial_tasks): Add task to call plugin hooks for generating
14885 new object files.
14886 * main.cc: Include "plugin.h".
14887 (main): Load plugin libraries.
14888 * object.h (Pluginobj): Declare.
14889 (Object::pluginobj): New function.
14890 (Object::do_pluginobj): New function.
14891 (Object::set_target): New function.
14892 * options.cc: Include "plugin.h".
14893 (General_options::parse_plugin): New function.
14894 (General_options::General_options): Initialize plugins_ field.
14895 (General_options::add_plugin): New function.
14896 * options.h (Plugin_manager): Declare.
14897 (General_options): Add --plugin option.
14898 (General_options::has_plugins): New function.
14899 (General_options::plugins): New function.
14900 (General_options::add_plugin): New function.
14901 (General_options::plugins_): New field.
14902 * plugin.cc: New file.
14903 * plugin.h: New file.
14904 * readsyms.cc: Include "plugin.h".
14905 (Read_symbols::do_read_symbols): Check for archive before checking
14906 for ELF file. Call plugin hooks to claim files.
14907 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
14908 from a real object file; force override when processing replacement
14909 files.
14910 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
14911 (Symbol::init_base_object): Likewise.
14912 (Symbol::init_base_output_data): Likewise.
14913 (Symbol::init_base_output_segment): Likewise.
14914 (Symbol::init_base_constant): Likewise.
14915 (Symbol::init_base_undefined): Likewise.
14916 (Symbol::output_section): Assert that object is not a plugin.
14917 (Symbol_table::add_from_pluginobj): New function.
14918 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
14919 undefined.
14920 (Symbol_table::sized_write_globals): Likewise.
14921 (Symbol_table::add_from_pluginobj): Instantiate template.
14922 * symtab.h (Sized_pluginobj): Declare.
14923 (Symbol::in_real_elf): New function.
14924 (Symbol::set_in_real_elf): New function.
14925 (Symbol::in_real_elf_): New field.
14926 (Symbol_table::add_from_pluginobj): New function.
14927
14928 * testsuite/Makefile.am (AM_CFLAGS): New variable.
14929 (LIBDL): New variable.
14930 (LDADD): Add LIBDL.
14931 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
14932 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
14933 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
14934 (MOSTLYCLEANFILES): Likewise.
14935 * testsuite/Makefile.in: Regenerate.
14936 * testsuite/plugin_test.c: New file.
14937 * testsuite/plugin_test_1.sh: New file.
14938 * testsuite/plugin_test_2.sh: New file.
14939
de31bda5
ILT
149402008-09-16 Ian Lance Taylor <iant@google.com>
14941
9c2d0ef9
ILT
14942 * target-reloc.h (relocate_section): Check whether a symbol is
14943 defined by the ABI before reporting an undefined symbol error.
14944 * target.h (Target::is_defined_by_abi): Make parameter const.
14945 (Target::do_is_defined_by_abi): Likewise.
14946 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
14947 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
14948 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
14949 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
14950 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
14951 * testsuite/Makefile.in: Rebuild.
14952
de31bda5
ILT
14953 * fileread.cc (make_view): Add casts to avoid warning.
14954
9fa33bee
AO
149552008-09-16 Alexandre Oliva <aoliva@redhat.com>
14956
14957 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
14958 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14959
183fd0e3
AO
149602008-09-16 Alexandre Oliva <aoliva@redhat.com>
14961
14962 * options.h (General_options::output_is_executable): New.
14963 (General_options::output_is_pie): New.
14964 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
14965 for shared libraries.
14966 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14967
7be8330a
CD
149682008-09-11 Chris Demetriou <cgd@google.com>
14969
14970 * options.h (origin): New -z option.
14971 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
14972 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
14973 in DT_FLAGS_1.
14974
a9caad02
CC
149752008-09-05 Cary Coutant <ccoutant@google.com>
14976
14977 * fileread.cc (File_read::make_view): Add check for attempt to map
14978 beyond end of file.
14979
ae6dce4d
CC
149802008-09-05 Cary Coutant <ccoutant@google.com>
14981
14982 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
14983 explicit instantiations.
14984
d7ab2a47
KVH
149852008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
14986
14987 PR gold/6858
14988 * options.cc (General_options::finalize): Allow undefined symbols
14989 in shlibs if linking -shared.
14990
14991 PR gold/6859
14992 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
14993 symbols as not needing a dynsym entry.
14994
1e52a9c1
CS
149952008-08-20 Craig Silverstein <csilvers@google.com>
14996
14997 * fileread.cc (File_read::open): Do not lock the file unless it
14998 was successfully opened.
14999
d85c80a3
CC
150002008-08-14 Cary Coutant <ccoutant@google.com>
15001
15002 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
15003 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
15004 * testsuite/tls_test.cc (struct int128): 128-bit struct
15005 for testing TLS relocs with non-zero addend.
15006 (v12): New TLS variable.
15007 (t12): New test.
15008 (t_last): Add check for v12.
15009 * testsuite/tls_test.h (t12): New function.
15010 * testsuite/tls_test_main.cc (thread_routine): Call new test.
15011
2d924fd9
ILT
150122008-08-13 Ian Lance Taylor <iant@google.com>
15013
15014 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
15015 set tls_segment_ or relro_segment_.
15016 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
15017 when appropriate.
15018 * output.h (Output_section::clear_is_relro): New function.
15019 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
15020 sections specially even when output_data_ is empty.
15021 (Output_segment::maximum_alignment): When first section is relro,
15022 only force alignment for PT_LOAD segments.
15023 * script.cc (script_data_segment_align): New function.
15024 (script_data_segment_relro_end): New function.
15025 * script-c.h (script_data_segment_align): Declare.
15026 (script_data_segment_relro_end): Declare.
15027 * script-sections.h (class Script_sections): Declare
15028 data_segment_align and data_segment_relro_end. Add fields
15029 segment_align_index_ and saw_relro_end_.
15030 * script-sections.cc (class Sections_element): Add set_is_relro
15031 virtual function. Add new bool* parameter to place_orphan_here.
15032 Add get_output_section virtual function.
15033 (class Output_section_definition): Add set_is_relro. Add new
15034 bool* parameter to place_orphan_here. Add get_output_section.
15035 Add is_relro_ field.
15036 (Output_section_definition::Output_section_definition): Initialize
15037 evaluated_address_, evaluated_load_address, evaluated_addralign_,
15038 and is_relro_ fields.
15039 (Output_section_definition::place_orphan_here): Add is_relro
15040 parameter.
15041 (Output_section_definition::set_section_addresses): Set relro for
15042 output section.
15043 (Output_section_definition::alternate_constraint): Likewise.
15044 (class Orphan_output_section): Add new bool* parameter to
15045 place_orphan_here. Add get_output_section.
15046 (Orphan_output_section::place_orphan_here): Add is_relro
15047 parameter.
15048 (Script_sections::Script_sections): Initialize
15049 data_segment_align_index_ and saw_relro_end_.
15050 (Script_sections::data_segment_align): New function.
15051 (Script_sections::data_segment_relro_end): New function.
15052 (Script_sections::place_orphan): Set or clear is_relro.
15053 (Script_sections::set_section_addresses): Force alignment of first
15054 TLS section.
15055 * yyscript.y (exp): Call script_data_segment_align and
15056 script_data_segment_relro_end.
15057 * testsuite/relro_script_test.t: New file.
15058 * testsuite/relro_test.cc (using_script): Declare.
15059 (t1, t2): Test using_script.
15060 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
15061 (relro_script_test_SOURCES): Define.
15062 (relro_script_test_DEPENDENCIES): Define.
15063 (relro_script_test_LDFLAGS): Define.
15064 (relro_script_test_LDADD): Define.
15065 (relro_script_test.so): New target.
15066 * testsuite/Makefile.in: Rebuild.
15067
f827c9a9
CC
150682008-08-06 Cary Coutant <ccoutant@google.com>
15069
15070 * archive.cc (Archive::total_archives, Archive::total_members)
15071 (Archive::total_members_loaded): New variables.
15072 (Archive::setup): Add parameter. Add option to preread
15073 archive symbols.
15074 (Archive::read_armap): Add counter.
15075 (Archive::get_file_and_offset): New function.
15076 (Archive::get_elf_object_for_member): New function.
15077 (Archive::read_all_symbols): New function.
15078 (Archive::read_symbols): New function.
15079 (Archive::add_symbols): Add counters.
15080 (Archive::include_all_members): Use armap to find members if it's
15081 already built.
15082 (Archive::include_member): Skip reading symbols if already read.
15083 Factored code into Archive::get_file_and_offset and
15084 Archive::get_elf_object_for_member. Changed call to
15085 Mapfile::report_include_archive_member.
15086 (Archive::print_stats): New function.
15087 * archive.h: Declare Object and Read_symbols_data classes.
15088 (Archive::Archive): Add initializers for new members.
15089 (Archive::setup): Add parameter.
15090 (Archive::print_stats): New function.
15091 (Archive::total_archives, Archive::total_members)
15092 (Archive::total_members_loaded): New variables.
15093 (Archive::get_file_and_offset): New function.
15094 (Archive::get_elf_object_for_member): New function.
15095 (Archive::read_all_symbols): New function.
15096 (Archive::read_symbols): New function.
15097 (Archive::Archive_member): New class.
15098 (Archive::members_): New member.
15099 (Archive::num_members_): New member.
15100 * main.cc: Include archive.h.
15101 (main): Call Archive::print_stats.
15102 * mapfile.cc (Mapfile::report_include_archive_member): Delete
15103 archive parameter; member_name is now the fully-decorated name.
15104 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
15105 * options.h: (General_options): Add --preread-archive-symbols option.
15106 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
15107 Archive::setup.
15108
de4c45bd
ILT
151092008-08-04 Ian Lance Taylor <iant@google.com>
15110
15111 * symtab.h (Symbol::use_plt_offset): New function.
15112 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
15113 * powerpc.cc (Relocate::relocate): Likewise.
15114 * sparc.cc (Relocate::relocate): Likewise.
15115 * x86_64.cc (Relocate::relocate): Likewise.
15116 * testsuite/weak_plt.sh: New test.
15117 * testsuite/weak_plt_main.cc: New test.
15118 * testsuite/weak_plt_shared.cc: New test.
15119 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
15120 (check_PROGRAMS): Add weak_plt.
15121 (check_DATA): Add weak_plt_shared.so.
15122 (weak_plt_main_pic.o, weak_plt): New targets.
15123 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
15124 * testsuite/Makefile.in: Rebuild.
15125
15126 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
15127 gcctestdir/ld.
15128 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
15129 * testsuite/Makefile.in: Rebuild.
15130
323ee3f4
AM
151312008-08-04 Alan Modra <amodra@bigpond.net.au>
15132
15133 * Makefile.am (POTFILES.in): Set LC_ALL=C.
15134 * Makefile.in: Regenerate.
15135 * po/POTFILES.in: Regenerate.
15136
7c07ecec
ILT
151372008-07-29 Ian Lance Taylor <iant@google.com>
15138
15139 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
15140 symbols before other symbols.
15141 * testsuite/script_test_2.cc (test_addr): Declare.
15142 (test_addr_alias): Declare.
15143 (main): Check that test_addr and test_addr_alias have the right
cd536b21 15144 values.
7c07ecec
ILT
15145 * testsuite/script_test_2.t: Define test_addr_alias and
15146 test_addr.
15147
5778530e
ILT
151482008-07-24 Ian Lance Taylor <iant@google.com>
15149
2a00e4fb
ILT
15150 PR 5990
15151 * descriptors.cc: New file.
15152 * descriptors.h: New file.
15153 * gold-threads.h (class Hold_optional_lock): New class.
15154 * fileread.cc: Include "descriptors.h".
15155 (File_read::~File_read): Release descriptor rather than closing
15156 it.
15157 (File_read::open) [file]: Call open_descriptor rather than open.
15158 Set is_descriptor_opened_.
15159 (File_read::open) [memory]: Assert that descriptor is not open.
15160 (File_read::reopen_descriptor): New function.
15161 (File_read::release): Release descriptor.
15162 (File_read::do_read): Make non-const. Reopen descriptor.
15163 (File_read::read): Make non-const.
15164 (File_read::make_view): Reopen descriptor.
15165 (File_read::do_readv): Likewise.
15166 * fileread.h (class File_read): Add is_descriptor_opened_ field.
15167 Update declarations.
15168 * layout.cc: Include "descriptors.h".
15169 (Layout::create_build_id): Use open_descriptor rather than open.
15170 * output.cc: Include "descriptors.h".
15171 (Output_file::open): Use open_descriptor rather than open.
15172 * archive.cc (Archive::const_iterator): Change Archive to be
15173 non-const.
15174 (Archive::begin, Archive::end): Make non-const.
15175 (Archive::count_members): Likewise.
15176 * archive.h (class Archive): Update declarations.
15177 * object.h (Object::read): Make non-const.
15178 * Makefile.am (CCFILES): Add descriptors.cc.
15179 (HFILES): Add descriptors.h.
15180 * Makefile.in: Rebuild.
15181
801647d1
ILT
15182 PR 6716
15183 * gold.h: Always include <clocale>. Add Solaris workarounds
15184 following code in binutils/sysdep.h.
15185
5edd166e
ILT
15186 PR 6048
15187 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
15188 this->eh_frame_hdr_ is NULL before using it.
15189
c89ad728
ILT
15190 * dynobj.cc (Versions::Versions): Update comment.
15191
aa86f06b
ILT
15192 * dynobj.cc (Versions::Versions): If there is an soname, use it as
15193 the base version name.
15194
5778530e
ILT
15195 * stringpool.cc (Stringpool_template::add_with_length): Set key to
15196 array size plus one.
15197 (Stringpool_template::set_string_offsets): Subtract one from key
15198 before using it as an array index.
15199 (Stringpool_template::get_offset_with_length): Likewise.
15200 (Stringpool_template::write_to_buffer): Likewise.
15201 * stringpool.h (Stringpool_template::get_offset_from_key):
15202 Likewise.
15203
057ead22
ILT
152042008-07-23 Ian Lance Taylor <iant@google.com>
15205
7f649c59
ILT
15206 PR 6658
15207 * object.h (Merged_symbol_value::value): Do our best to handle a
15208 negative addend.
15209
057ead22
ILT
15210 PR 6647
15211 * script.cc (Version_script_info::get_versions): Don't add empty
15212 version tag to return value.
15213 (Version_script_info::get_symbol_version_helper): Change return
15214 type to bool. Add pversion parameter. Change all callers.
15215 (script_register_vers_node): Don't require a non-NULL tag.
15216 * script.h (class Version_script_info): Update declarations.
15217 (Version_script_info::get_symbol_version): Change return type to
15218 bool. Add version parameter. Change all callers.
15219 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
15220 handling. Handle an empty version from a version script.
15221 (Symbol_table::define_special_symbol): Likewise.
15222 * testsuite/ver_test_10.script: New file.
15223 * testsuite/ver_test_10.sh: New file.
15224 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
15225 (check_DATA): Add ver_test_10.syms.
15226 (ver_test_10.syms, ver_test_10.so): New target.
15227 * testsuite/Makefile.in: Rebuild.
15228
58e54ac2
CD
152292008-07-23 Simon Baldwin <simonb@google.com>
15230
15231 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
15232 to zero for undefined symbols from dynamic libraries.
15233
95d14cd3
ILT
152342008-07-23 Ian Lance Taylor <iant@google.com>
15235
15236 * symtab.cc (Symbol_table::resolve): Remove version parameter.
15237 Change all callers.
15238 * symtab.h (class Symbol_table): Update declaration.
15239 * testsuite/ver_test_9.cc: New file.
15240 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
15241 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
15242 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
15243 (ver_test_9.so, ver_test_9.o): New targets.
15244 * testsuite/Makefile.in: Rebuild.
15245
92de84a6
ILT
152462008-07-22 Ian Lance Taylor <iant@google.com>
15247
34810851
ILT
15248 * options.h (class General_options): Define --check-sections.
15249 * layout.cc (Layout::set_segment_offsets): Handle
15250 --check-sections.
15251
af6156ef
ILT
15252 * options.h (class General_options): Define -n/--nmagic and
15253 -N/--omagic.
15254 * options.cc (General_options::finalize): For -n/--nmagic or
15255 -N/--omagic, set -static.
15256 * layout.cc (Layout::attach_allocated_section_to_segment): If
15257 -N/--omagic, don't put read-only and read-write sections in
15258 different segments.
15259 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
15260 finding a read-only segment.
15261 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
15262 don't set the minimum segment alignment to the common page size,
15263 and don't set the file offset to the address modulo the page size.
15264 * script-sections.cc (Script_sections::create_segments): If
15265 -n/--omagic, don't put read-only and read-write sections in
15266 different segments.
15267
92de84a6
ILT
15268 * cref.cc: New file.
15269 * cref.h: New file.
15270 * options.h (class General_options): Add --print-symbol-counts.
15271 * main.cc (main): Issue defined symbol report if requested.
15272 * archive.cc (Archive::interpret_header): Make into a const member
15273 function.
15274 (Archive::add_symbols): Call Input_objects::archive_start and
15275 archive_stop.
15276 (Archive::const_iterator): Define new class.
15277 (Archive::begin, Archive::end): New functions.
15278 (Archive::include_all_members): Rewrite to use iterator.
15279 (Archive::count_members): New function.
15280 * archive.h (class Archive): Update declarations.
15281 (Archive::filename): New function.
15282 * object.cc: Include "cref.h".
15283 (Sized_relobj::Sized_relobj): Initialize defined_count_.
15284 (Sized_relobj::do_get_global_symbol_counts): New function.
15285 (Input_objects::add_object): Add object to cross-referencer.
15286 (Input_objects::archive_start): New function.
15287 (Input_objects::archive_stop): New function.
15288 (Input_objects::print_symbol_counts): New function.
15289 * object.h: Declare Cref and Archive.
15290 (Object::get_global_symbol_counts): New function.
15291 (Object::do_get_global_symbol_counts): New pure virtual function.
15292 (class Sized_relobj): Add defined_count_ field. Update
15293 declarations.
15294 (class Input_objects): Add cref_ field. Update constructor.
15295 Update declarations.
15296 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
15297 defined_count_.
15298 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
15299 symbol counts.
15300 (Sized_dynobj::do_get_global_symbol_counts): New function.
15301 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
15302 defined_count_. Update declarations. Define Symbols typedef.
15303 * symtab.cc (Symbol_table::add_from_relobj): Add defined
15304 parameter. Change all callers.
15305 (Symbol_table::add_from_dynobj): Add sympointers and defined
15306 parameters. Change all callers.
15307 * symtab.h (class Symbol_table): Update declarations.
15308 * Makefile.am (CCFILES): Add cref.cc.
15309 (HFILES): Add cref.h.
15310 * Makefile.in: Rebuild.
15311
3f7c5e1d
CD
153122008-07-22 Simon Baldwin <simonb@google.com>
15313
15314 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
15315 to zero when writing undefined symbols.
15316
e0b64032
ILT
153172008-07-22 Ian Lance Taylor <iant@google.com>
15318
15319 * output.cc (Output_section::add_input_section): Don't try to
15320 merge empty merge sections.
15321
096b02cf
CS
153222008-07-21 Craig Silverstein <csilvers@google.com>
15323
15324 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15325 Include symbol version in error message.
cd536b21 15326
1d1f116d
CD
153272008-07-20 Chris Demetriou <cgd@google.com>
15328
cd536b21 15329 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
15330 (RANDOM_SEED_CFLAGS): New substituted variable.
15331 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
15332 * configure: Rebuild.
15333 * Makefile.in: Likewise.
15334 * testsuite/Makefile.in: Likewise.
15335
a18f591e
ILT
153362008-07-18 Ian Lance Taylor <iant@google.com>
15337
15338 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
15339 where we see NAME/NULL and NAME/VERSION as separate symbols.
15340 * testsuite/ver_test_main.cc (main): Call t4.
15341 (t4, t4_2a): Define.
15342 * testsuite/ver_test_2.cc (t4_2): Define.
15343 * testsuite/ver_test_2.script: Put t4_2a in VER2.
15344 * testsuite/ver_test_4.cc (t4_2a): Define.
15345 * testsuite/ver_test_4.script: Put t4_2a in VER2.
15346 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
15347
c6e3f6ed
ILT
153482008-07-17 Ian Lance Taylor <iant@google.com>
15349
15350 * dynobj.cc (Versions::add_def): If we give an error about a
15351 missing version, go ahead and create the version anyhow.
15352
ef9beddf
ILT
153532008-07-10 Ian Lance Taylor <iant@google.com>
15354
15355 Handle output sections with more than 0x7fffffff bytes.
15356 * object.h (class Relobj): Change map_to_output_ to
15357 output_sections_, and just keep a section pointer. Change all
15358 uses. Move comdat group support to Sized_relobj.
15359 (Relobj::is_section_specially_mapped): Remove.
15360 (Relobj::output_section): Remove poff parameter. Change all
15361 callers.
15362 (Relobj::output_section_offset): New function.
15363 (Relobj::set_section_offset): Rewrite.
15364 (Relobj::map_to_output): Remove.
15365 (Relobj::output_sections): New function.
15366 (Relobj::do_output_section_offset): New pure virtual function.
15367 (Relobj::do_set_section_offset): Likewise.
15368 (class Sized_relobj): Add section_offsets_ field. Add comdat
15369 group support from Relobj. Update declarations.
15370 (Sized_relobj::get_output_section_offset): New function.
15371 (Sized_relobj::do_output_section_offset): New function.
15372 (Sized_relobj::do_set_section_offset): New function.
15373 * object.cc (Relobj::output_section_address): Remove.
15374 (Sized_relobj::Sized_relobj): Initialize new fields.
15375 (Sized_relobj::include_section_group): Cast find_kept_object to
15376 Sized_relobj.
15377 (Sized_relobj::include_linkonce_section): Likewise.
15378 (Sized_relobj::do_layout): Use separate arrays for output section
15379 and output offset.
15380 (Sized_relobj::do_count_local_symbols): Change map_to_output to
15381 output_sections.
15382 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
15383 output_sections and section_offsets.
15384 (Sized_relobj::write_local_symbols): Likewise.
15385 (map_to_kept_section): Compute output address directly.
15386 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
15387 output_sections and section_offsets.
15388 (Sized_relobj::write_sections): Likewise.
15389 (Sized_relobj::relocate_sections): Likewise.
15390 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
15391 * output.h (class Output_reloc): Update declarations. Change
15392 u2_.relobj to Sized_relobj*.
15393 (class Output_data_reloc): Change add functions to use
15394 Sized_relobj*.
15395 * output.cc (Output_reloc::Output_reloc): Change relobj to
15396 Sized_relobj*.
15397 (Output_reloc::local_section_offset): Change return type to
15398 Elf_Addr. Use get_output_section_offset.
15399 (Output_reloc::get_address): Likewise.
15400 (Output_section::is_input_address_mapped): Don't call
15401 is_section_specially_mapped.
15402 (Output_section::output_offset): Likewise.
15403 (Output_section::output_address): Likewise.
15404 (Output_section::starting_output_address): Likewise.
15405 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
15406 parameter to Sized_relobj*.
15407 (Copy_relocs::need_copy_reloc): Likewise.
15408 (Copy_relocs::save): Likewise.
15409 * copy-relocs.h (class Copy_relocs): Update declarations.
15410 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
15411 Sized_relobj*. Change relobj_ field to Sized_relobj*.
15412 * target-reloc.h (relocate_for_relocatable): Change
15413 offset_in_output_section type to Elf_Addr. Change code that uses
15414 it as well.
15415 * layout.cc (Layout::layout): Always set *off.
15416 * mapfile.cc (Mapfile::print_input_section): Use
15417 output_section_offset.
15418 * i386.cc (Target_i386::copy_reloc): Change object parameter to
15419 Sized_relobj*.
15420 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
15421 * sparc.cc (Target_sparc::copy_reloc): Likewise.
15422 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
15423
5cb66f97
ILT
154242008-07-03 Ian Lance Taylor <iant@google.com>
15425
15426 * layout.cc (Layout::include_section): Do not discard unrecognized
15427 SHT_STRTAB sections.
15428
afe47622
CS
154292008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
15430
15431 * script.cc (Lex::can_continue_name): Make '?' allowable in
15432 version-script names.
15433 * testsuite/version_script.map: Change glob pattern to use '?'
15434
5adf9721
ILT
154352008-06-30 Manish Singh <yosh@gimp.org>
15436
15437 PR 6585
15438 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
15439 Correct typo.
15440
e6fde208
ILT
154412008-06-30 Ian Lance Taylor <iant@google.com>
15442
15443 PR 6660
15444 PR 6682
15445 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
15446 versions]: Don't try to read the value in the contents, since we
15447 don't use it. Use the template endianness when writing.
15448
3f2e6a2d
CC
154492008-06-25 Cary Coutant <ccoutant@google.com>
15450
15451 * fileread.cc (File_read::make_view): Assert on zero-length view.
15452 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
15453 symbol table when there are no symbols to read.
15454
c43d3a48
CS
154552008-06-23 Craig Silverstein <csilvers@google.com>
15456
15457 * version.cc (version_string): Bump to 1.7
15458
5f494ea0
CS
154592008-06-18 Craig Silverstein <csilvers@google.com>
15460
15461 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
15462 constant 0xFFFF to type Valtype.
15463 (Powerpc_relocate_functions::rel16_ha): Likewise.
15464
c42e122e
ILT
154652008-06-17 Ian Lance Taylor <iant@google.com>
15466
f34787f8
ILT
15467 * output.h (Output_section::Input_section): Initialize p2align_ to
15468 zero for Output_section_data constructors.
15469 (Output_section::Input_section::addralign): If not an input
15470 section, return the alignment of the Output_section_data.
15471 * testsuite/copy_test.cc: New file.
15472 * testsuite/copy_test_1.cc: New file.
15473 * testsuite/copy_test_2.cc: New file.
15474 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
15475 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
15476 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
15477 (copy_test_1_pic.o, copy_test_1.so): New targets.
15478 (copy_test_2_pic.o, copy_test_2.so): New targets.
15479 * testsuite/Makefile.in: Rebuild.
15480
c42e122e
ILT
15481 * script-sections.cc (Script_sections::place_orphan): Initialize
15482 local variable exact.
15483
ce3ac18a
DE
154842008-06-13 David Edelsohn <edelsohn@gnu.org>
15485
15486 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
15487
42cacb20
DE
154882008-06-12 David Edelsohn <edelsohn@gnu.org>
15489 David S. Miller <davem@davemloft.net>
15490
15491 * powerpc.cc: New file.
15492 * Makefile.am (TARGETSOURCES): Add powerpc.cc
15493 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
15494 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
15495 * Makefile.in: Rebuild.
15496
7b308235
ILT
154972008-06-09 Ian Lance Taylor <iant@google.com>
15498
15499 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
15500 <exception>.
15501 (throwing, orig_terminate): New static variables.
15502 (terminate_handler): New static function.
15503 (t2): Set terminate handler.
15504
f0b886e3
ILT
155052008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
15506
15507 PR 6584
cd536b21 15508 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
15509 alignment.
15510
3e90f135
CC
155112008-05-30 Cary Coutant <ccoutant@google.com>
15512
15513 * archive.cc (Archive::include_all_members) Correct to step
15514 over symbol table and extended name table in thin archives.
15515
e09ad04a
ILT
155162008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
15517
15518 PR 6407
15519 * target-reloc.h (relocate_for_relocatable): Fix new_offset
15520 calculation.
15521
62b01cb5
ILT
155222008-05-28 Caleb Howe <cshowe@google.com>
15523
15524 * reduced_debug_output.cc: New file.
15525 * reduced_debug_output.h: New file.
92de84a6 15526 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
15527 * options.cc (General_options::finalize): Add strip_debug_non_line
15528 to the strip heirarchy.
15529 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
15530 fields.
15531 * layout.cc: Include "reduced_debug_output.h".
15532 (Layout::Layout): Initialize new fields.
15533 (line_only_debug_sections): New static array.
15534 (is_lines_only_debug_sections): New static inline function.
15535 (Layout::include_section): Handle --strip-debug-non-line.
15536 (Layout::make_output_section): If --strip-debug-non-line, build
15537 new output sections for .debug_abbrev and .debug_info.
15538 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
15539 gold. Warn about possible overflow.
15540 (read_signed_LEB_128): Likewise.
15541 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
15542 (read_signed_LEB_128): Declare.
15543 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
15544 (HFILES): Add reduced_debug_output.h.
15545 * Makefile.in: Rebuild.
15546
7d9e3d98
ILT
155472008-05-21 Ian Lance Taylor <iant@google.com>
15548
15549 * mapfile.cc: New file.
15550 * mapfile.h: New file.
15551 * options.h (class General_options): Add -M/--print-map and -Map.
15552 * options.cc (General_options::finalize): Make -M equivalent to
15553 -Map -.
15554 * main.cc: Include <cstdio> and "mapfile.h".
15555 (main): Open mapfile if requested.
15556 * gold.cc (class Middle_runner): Add mapfile_ field. Update
15557 constructor. Change caller.
15558 (queue_initial_tasks): Add mapfile parameter. Change caller.
15559 (queue_middle_tasks): Likewise.
15560 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
15561 declarations.
15562 * archive.cc: Include "mapfile.h".
15563 (Archive::add_symbols): Add mapfile parameter. Change all
15564 callers. Pass mapfile, symbol, and reason to include_member.
15565 (Archive::include_all_members): Add mapfile parameter. Change all
15566 callers.
15567 (Archive::include_member): Add mapfile, sym, and why parameters.
15568 Change all callers. Report inclusion to map file.
15569 * archive.h: Include "fileread.h".
15570 (class Archive): Update declarations.
15571 (Archive::file): New const method.
15572 (class Add_archive_symbols): Add mapfile_ field. Update
15573 constructor. Change all callers.
15574 * readsyms.h (class Read_symbols): Likewise.
15575 (class Finish_group): Likewise.
15576 (class Read_script): Likewise.
15577 * common.cc: Include "mapfile.h".
15578 (Symbol_table::allocate_commons): Add mapfile parameter. Change
15579 all callers.
15580 (Symbol_table::do_allocate_commons): Likewise.
15581 (Symbol_table::do_allocate_commons_list): Likewise. Report common
15582 symbol allocation to mapfile.
15583 * common.h (class Allocate_commons_task): Add mapfile_ field.
15584 Update constructor. Change all callers.
15585 * symtab.h (class Symbol_table): Update declarations.
15586 * layout.cc: Include "mapfile.h".
15587 (Layout_task_runner::run): Print information to mapfile.
15588 (Layout::create_gold_note): Change Output_data_fixed_space to
15589 Output_data_zero_fill.
15590 (Layout::create_build_id): Likewise.
15591 (Layout::print_to_mapfile): New function.
15592 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
15593 constructor. Change caller.
15594 (class Layout): Declare print_to_mapfile.
15595 * output.cc (Output_section::Input_section::print_to_mapfile): New
15596 function.
15597 (Output_section::add_input_section): If producing a map, always
15598 add to input_sections_ list.
15599 (Output_section::do_print_to_mapfile): New function.
15600 (Output_segment::print_sections_to_mapfile): New function.
15601 (Output_segment::print_section_list_to_mapfile): New function.
15602 * output.h: Include "mapfile.h".
15603 (Output_data::print_to_mapfile): New function.
15604 (Output_data::do_print_to_mapfile): New virtual function.
15605 (Output_segment_headers::do_print_to_mapfile): New function.
15606 (Output_file_header::do_print_to_mapfile): New function.
15607 (Output_data_const::do_print_to_mapfile): New function.
15608 (class Output_data_const_buffer): Add map_name_ field. Update
15609 constructor. Change all callers. Add do_print_to_mapfile
15610 function.
15611 (class Output_data_fixed_space): Likewise.
15612 (class Output_data_space): Likewise.
15613 (class Output_data_zero_fill): New class.
15614 (Output_data_strtab::do_print_to_mapfile): New function.
15615 (Output_data_reloc_base::do_print_to_mapfile): New function.
15616 (Output_relocatable_relocs::do_print_to_mapfile): New function.
15617 (Output_data_group::do_print_to_mapfile): New function.
15618 (Output_data_got::do_print_to_mapfile): New function.
15619 (Output_data_dynamic::do_print_to_mapfile): New function.
15620 (Output_symtab_xindex::do_print_to_mapfile): New function.
15621 (class Output_section): Declare do_print_to_mapflie. Declare
15622 print_to_mapfile in Input_section.
15623 (class Output_segment): Declare new functions.
15624 * object.h (Sized_relobj::symbol_count): New function.
15625 * script-sections.cc
15626 (Output_section_element_dot_assignment::set_section_addresses):
15627 Change Output_data_fixed_space to Output_data_zero_fill.
15628 (Output_data_expression::do_print_to_mapfile): New function.
15629 * script.cc (read_input_script): Add mapfile parameter. Change
15630 all callers.
15631 * script.h (read_input_script): Update declaration.
15632 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
15633 (Eh_frame::do_print_to_mapfile): New function.
15634 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
15635 (Output_merge_string::do_print_to_mapfile): New function.
15636 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
15637 function.
15638 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
15639 function.
15640 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
15641 function.
15642 * Makefile.am (CCFILES): Add mapfile.cc.
15643 (HFILES): Add mapfile.h.
15644 * Makefile.in: Rebuild.
15645
9f1d377b
ILT
156462008-05-19 Ian Lance Taylor <iant@google.com>
15647
15648 * options.h (class General_options): Add -z relro.
15649 * layout.cc (Layout::Layout): Initialize relro_segment_.
15650 (Layout::add_output_section_data): Return the output section.
15651 (Layout::make_output_section): Rcognize relro sections and mark
15652 them appropriately.
15653 (Layout::attach_allocated_section_to_segment): Put relro sections
15654 in a PT_GNU_RELRO segment.
15655 (Layout::create_initial_dynamic_sections): Mark the .dynamic
15656 section as relro.
15657 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
15658 PT_TLS segments.
15659 (Layout::linkonce_mapping): Map d.rel.ro.local to
15660 .data.rel.ro.local.
15661 (Layout::output_section_name): Us .data.rel.ro.local for any
15662 section which begins with that.
15663 * layout.h (class Layout): Update add_output_section_data
15664 declaration. Add relro_segment_ field.
15665 * output.cc (Output_section::Output_section): Initialize is_relro_
15666 and is_relro_local_ fields.
15667 (Output_segment::add_output_section): Group relro sections.
15668 (Output_segment::is_first_section_relro): New function.
15669 (Output_segment::maximum_alignment): If there is a relro section,
15670 align the segment to the common page size.
15671 (Output_segment::set_section_addresses): Track whether we are
15672 looking at relro sections. If the last section is a relro
15673 section, align to the common page size.
15674 (Output_segment::set_section_list_addresses): Add in_relro
15675 parameter. Change all callers. Align to the page size when
15676 moving from relro to non-relro section.
15677 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
15678 segment.
15679 * output.h (class Output_section): Add is_relro_ and
15680 is_relro_local_ fields.
15681 (Output_section::is_relro): New function.
15682 (Output_section::set_is_relro): New function.
15683 (Output_section::is_relro_local): New function.
15684 (Output_section::set_is_relro_local): New function.
15685 (class Output_segment): Update declarations.
15686 * i386.cc (Target_i386::got_section): Mark .got section as relro.
15687 * sparc.cc (Target_sparc::got_section): Likewise.
15688 * x86_64.cc (Target_x86_64::got_section): Likewise.
15689 * testsuite/relro_test_main.cc: New file.
15690 * testsuite/relro_test.cc: New file.
15691 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
15692 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
15693 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
15694 (relro_test.so, relro_test_pic.o): New targets.
15695 * testsuite/Makefile.in: Rebuild.
15696
a984ee1d
ILT
156972008-05-16 Ian Lance Taylor <iant@google.com>
15698
01676dcd
ILT
15699 * output.cc (Output_segment::add_output_section): Remove front
15700 parameter.
15701 * output.h (class Output_segment): Remove
15702 add_initial_output_section and overloaded add_output_section.
15703 Update declaration of remaining add_output_section.
15704 * layout.cc (Layout::create_interp): Call add_output_section
15705 rather than add_initial_output_section.
15706 (Layout::finish_dynamic_section): Likewise.
15707
497897f9
ILT
15708 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
15709 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
15710 know the dynamic type.
15711 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
15712 field. Initialize it in constructor.
15713 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
15714 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
15715 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
15716 reloc.
15717
a984ee1d
ILT
15718 * output.cc (Output_reloc::get_address): Change return type to
15719 Elf_Addr.
15720 * output.h (class Output_reloc): Update get_address declaration.
15721 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
15722 for section addresses.
15723
55ba0940
ILT
157242008-05-09 Ian Lance Taylor <iant@google.com>
15725
15726 PR 6493
15727 * gold.cc (gold_nomem): Use return value of write.
15728
75517b77
ILT
157292008-05-08 Ian Lance Taylor <iant@google.com>
15730
15731 * symtab.c (Symbol::init_base_output_data): Add version
15732 parameter. Change all callers.
15733 (Symbol::init_base_output_segment): Likewise.
15734 (Symbol::init_base_constant): Likewise.
15735 (Symbol::init_base_undefined): Likewise.
15736 (Sized_symbol::init_output_data): Likewise.
15737 (Sized_symbol::init_output_segment): Likewise.
15738 (Sized_symbol::init_constant): Likewise.
15739 (Sized_symbol::init_undefined): Likewise.
15740 (Symbol_table::do_define_in_output_data): If the new symbol has a
15741 version, mark it as the default.
15742 (Symbol_table::do_define_in_output_segment): Likewise.
15743 (Symbol_table::do_define_as_constant): Likewise.
15744 * symtab.h (class Symbol): Update declarations.
15745 (class Sized_symbol): Likewise.
15746 * resolve.cc (Symbol::override_version): New function.
c42e122e 15747 (Symbol::override_base): Call override_version.
75517b77
ILT
15748 (Symbol::override_base_with_special): Likewise.
15749 * testsuite/ver_script_8.script: New file.
15750 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
15751 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
15752 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
15753 (ver_test_8_1.so, ver_test_8_2.so): New targets.
15754
f1f70eae
ILT
157552008-05-06 Ian Lance Taylor <iant@google.com>
15756
f3e9c5c5
ILT
15757 PR 6049
15758 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
15759 functions.
15760 (class General_options): Remove existing --undefined, and add
15761 --no-undefined instead. Add new --undefined as synonym for -u.
15762 * archive.cc (Archive::add_symbols): Check whether symbol was
15763 named with -u.
15764 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
15765 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
15766 all uses. Add IS_UNDEFINED. Update declarations to split
15767 different versions of init_base. Declare init_base_undefined.
15768 (Symbol::is_defined): Handle IS_UNDEFINED.
15769 (Symbol::is_undefined): Likewise.
15770 (Symbol::is_weak_undefined): Call is_undefined.
15771 (Symbol::is_absolute): Handle IS_CONSTANT.
15772 (class Sized_symbol): Update declarations to split different
15773 versions of init. Declare init_undefined.
15774 (class Symbol_table): Declare new functions.
15775 * symtab.cc (Symbol::init_base_object): Rename from init_base.
15776 Change all callers.
15777 (Symbol::init_base_output_data): Likewise.
15778 (Symbol::init_base_output_segment): Likewise.
15779 (Symbol::init_base_constant): Likewise.
15780 (Symbol::init_base_undefined): New function.
15781 (Sized_symbol::init_object): Rename from init. Change all
15782 callers.
15783 (Sized_symbol::init_output_data): Likewise.
15784 (Sized_symbol::init_output_segment): Likewise.
15785 (Sized_symbol::init_constant): Likewise.
15786 (Sized_symbol::init_undefined): New function.
15787 (Symbol_table::add_undefined_symbols_from_command_line): New
15788 function.
15789 (Symbol_table::do_add_undefined_symbols_from_command_line): New
15790 function.
15791 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
15792 (Symbol::output_section): Likewise.
15793 (Symbol::set_output_section): Likewise.
15794 (Symbol_table::sized_finalize_symbol): Likewise.
15795 (Symbol_table::sized_write_globals): Likewise.
15796 * resolve.cc (Symbol_table::should_override): Likewise.
15797 (Symbol::override_base_with_special): Likewise.
15798
8bdcdf2c
ILT
15799 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
15800 symbol, change it to have default visibility.
15801 * testsuite/protected_1.cc: New file.
15802 * testsuite/protected_2.cc: New file.
15803 * testsuite/protected_3.cc: New file.
15804 * testsuite/protected_main_1.cc: New file.
15805 * testsuite/protected_main_2.cc: New file.
15806 * testsuite/protected_main_3.cc: New file.
15807 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
15808 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
15809 (protected_1_LDFLAGS, protected_1_LDADD): Define.
15810 (protected_1.so): New target.
15811 (protected_1_pic.o, protected_2_pic.o): New targets.
15812 (protected_3_pic.o): New target.
15813 (check_PROGRAMS): Add protected_2.
15814 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
15815 (protected_2_LDFLAGS, protected_2_LDADD): Define.
15816 * testsuite/Makefile.in: Rebuild.
15817
2b706932
ILT
15818 * options.h (DEFINE_var): Add set_user_set_##varname__.
15819 (DEFINE_bool_alias): New macro.
15820 (class General_options): Define -Bstatic using DEFINE_bool_alias
15821 rather than DEFINE_special. Add --undefined as an alias for -z
15822 defs.
15823 * options.cc (General_options::parse_Bstatic): Remove.
15824
d82a5bcc
ILT
15825 * options.h (class General_options): Add --fatal-warnings.
15826 * main.cc (main): Implement --fatal-warnings.
15827 * errors.h (Errors::warning_count): New function.
15828
f1f70eae
ILT
15829 * options.h (class General_options): Add -Bsymbolic-functions.
15830 * symtab.h (Symbol::is_preemptible): Check for
15831 -Bsymbolic-functions.
15832
8825ac63
ILT
158332008-05-05 Ian Lance Taylor <iant@google.com>
15834
d98bc257
ILT
15835 * options.h (DEFINE_bool): For DASH_Z, create the negative option
15836 as noVARNAME rather than no-VARNAME.
15837 (class General_options): Add option -z combreloc.
15838 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
15839 get_address.
15840 (Output_reloc::sort_before) [SHT_REL]: New function.
15841 (Output_reloc::sort_before) [SHT_RELA]: New function.
15842 (class Output_data_reloc_base): Add sort_relocs_ field. Define
15843 Sort_relocs_comparison.
15844 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
15845 parameter. Change all callers.
15846 (Output_data_reloc::Output_data_reloc) [both versions]: Add
15847 sort_relocs parameter. Change all callers.
15848 * output.cc (Output_reloc::get_address): New function, broken out
15849 of write_rel.
15850 (Output_reloc::write_rel): Call it.
15851 (Output_reloc::compare): New function.
15852 (Output_data_reloc_base::do_write): Optionally sort relocs.
15853
60b2b4e7
ILT
15854 * configure.ac: If targ_extra_obj is set, link it in.
15855 * configure.tgt: Initialize all variables.
15856 (x86_64*): Set targ_extra_obj and targ_extra_size.
15857 * configure: Rebuild.
15858
8825ac63
ILT
15859 * object.cc (Sized_relobj::include_section_group): Adjust section
15860 indexes read from group data. Build vector to pass to
15861 layout_group.
15862 * layout.cc (Layout::layout_group): Add flags and shndxes
15863 parameters. Remove contents parameter. Change caller. Update
15864 explicit instantiations.
15865 * layout.h (class Layout): Update layout_group declaration.
15866 * output.cc (Output_data_group::Output_data_group): Add flags and
15867 input_shndxes parameters. Remove contents parameter. Change
15868 caller.
15869 (Output_data_group::do_write): Change input_sections_ to
15870 input_shndxes_.
15871 * output.h (class Output_data_group): Update constructor
15872 declaration. Rename input_sections_ to input_shndxes_.
15873 * testsuite/many_sections_test.cc: Add template.
15874
e94cf127
CC
158752008-04-30 Cary Coutant <ccoutant@google.com>
15876
4418b2d5
CC
15877 * target-reloc.h (relocate_section): Fix dead-pointer bug.
15878
e94cf127
CC
15879 * layout.cc (Layout::include_section): Refactored check for debug
15880 info section.
15881 (Layout::add_comdat): Add new parameters. Change type
15882 of signature parameter. Add object and shndx to signatures table.
15883 (Layout::find_kept_object): New function.
15884 * layout.h: Include <cstring>.
15885 (Layout::is_debug_info_section): New function.
15886 (Layout::add_comdat): Add new parameters.
15887 (Layout::find_kept_object): New function.
15888 (Layout::Kept_section): New struct.
15889 (Layout::Signatures): Change type of map range.
15890 * object.cc (Relobj::output_section_address): New function.
15891 (Sized_relobj::include_section_group): Add new parameters. Change
15892 calls to Layout::add_comdat. Change to build table of kept comdat
15893 groups and table mapping discarded sections to kept sections.
15894 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
15895 (Sized_relobj::do_layout): Change calls to include_section_group and
15896 include_linkonce_section.
15897 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
15898 value to zero when section is discarded.
15899 (Sized_relobj::map_to_kept_section): New function.
15900 * object.h (Relobj::output_section_address): New function.
15901 (Relobj::Comdat_group): New type.
15902 (Relobj::find_comdat_group): New function.
15903 (Relobj::Comdat_group_table): New type.
15904 (Relobj::Kept_comdat_section): New type.
15905 (Relobj::Kept_comdat_section_table): New type.
15906 (Relobj::add_comdat_group): New function.
15907 (Relobj::set_kept_comdat_section): New function.
15908 (Relobj::get_kept_comdat_section): New function.
15909 (Relobj::comdat_groups_): New field.
15910 (Relobj::kept_comdat_sections_): New field.
15911 (Symbol_value::input_value): Update comment.
15912 (Sized_relobj::map_to_kept_section) New function.
15913 (Sized_relobj::include_linkonce_section): Add new parameter.
15914 * target-reloc.h (Comdat_behavior): New type.
15915 (get_comdat_behavior): New function.
15916 (relocate_section): Add code to map a discarded section to the
15917 corresponding kept section when applying a relocation.
15918
e4e5049b
CS
159192008-04-30 Craig Silverstein <csilvers@google.com>
15920
15921 * dwarf_reader.cc (next_generation_count): New static var.
15922 (Addr2line_cache_entry): New struct.
15923 (addr2line_cache): New static var.
15924 (Dwarf_line_info::one_addr2line): Added caching.
15925 (Dwarf_line_info::clear_addr2line_cache): New function.
15926 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
15927 cache-size parameter.
15928 (Dwarf_line_info::one_addr2line_cache): New function.
15929 * symtab.cc (Symbol_table::detect_odr_violations): Pass
15930 new cache-size argument to one_addr2line(), and clear cache.
15931
d09e9154
CC
159322008-04-28 Cary Coutant <ccoutant@google.com>
15933
15934 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
15935 R_386_PC8 relocations.
15936
7ef73768
ILT
159372008-04-23 Ian Lance Taylor <iant@google.com>
15938
55438702
ILT
15939 * object.cc (Sized_relobj::include_section_group): Check for
15940 invalid section group.
15941
c165fb93
ILT
15942 * object.cc (make_elf_object): Correct test for 64-bit ELF file
15943 header size.
15944
7ef73768
ILT
15945 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
15946 than read for file header.
15947 * archive.cc (Archive::include_member): Likewise.
15948
6194aaab
L
159492008-04-23 Paolo Bonzini <bonzini@gnu.org>
15950
15951 * aclocal.m4: Regenerate.
15952 * configure: Regenerate.
15953
d491d34e
ILT
159542008-04-19 Ian Lance Taylor <iant@google.com>
15955
5ea2bac6
ILT
15956 * version.cc (version_string): Bump to 1.6.
15957
7bc3e21a
ILT
15958 * testsuite/Makefile.am (many_sections_r_test): New target.
15959 (many_sections_r_test_SOURCES): Remove.
15960 (many_sections_r_test_DEPENDENCIES): Remove.
15961 (many_sections_r_test_LDFLAGS): Remove.
15962 (many_sections_r_test_LDADD): Remove.
15963
7fcd3aa9
ILT
15964 * object.cc (Sized_relobj::do_add_symbols): Always pass
15965 local_symbol_count_ to add_from_relobj.
15966
4c94d6ae
ILT
15967 * testsuite/Makefile.am (many_sections_check.h): Only check one in
15968 every thousand variables.
15969 * testsuite/Makefile.in: Rebuild.
15970
d491d34e
ILT
15971 * object.cc (Xindex::initialize_symtab_xindex): New function.
15972 (Xindex::read_symtab_xindex): New function.
15973 (Xindex::sym_xindex_to_shndx): New function.
15974 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
15975 available.
15976 (Sized_relobj::do_initialize_xindex): New function.
15977 (Sized_relobj::do_read_symbols): Adjust section links.
15978 (Sized_relobj::symbol_section_and_value): Add is_ordinary
15979 parameter. Change all callers.
15980 (Sized_relobj::include_section_group): Adjust section links and
15981 symbol section indexes.
15982 (Sized_relobj::do_layout): Adjust section links.
15983 (Sized_relobj::do_count_local_symbols): Adjust section links and
15984 symbol section indexes.
15985 (Sized_relobj::do_finalize_local_symbols): Distinguish between
15986 ordinary and special symbols.
15987 (Sized_relobj::write_local_symbols): Add symtab_xindex and
15988 dynsym_xindex parameters. Change all callers. Adjust section
15989 links. Use SHN_XINDEX when needed.
15990 (Sized_relobj::get_symbol_location_info): Adjust section links.
15991 Don't get fooled by special symbols.
15992 * object.h (class Xindex): Define.
15993 (class Object): Add xindex_ parameter. Declare virtual functoin
15994 do_initialize_xindex.
15995 (Object::adjust_sym_shndx): New function.
15996 (Object::set_xindex): New protected function.
15997 (class Symbol_value): Add is_ordinary_shndx_ field.
15998 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
15999 (Symbol_value::value): Assert ordinary section.
16000 (Symbol_value::initialize_input_to_output_map): Likewise.
16001 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
16002 Change all callers.
16003 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
16004 all callers.
16005 (class Sized_relobj): Update declarations.
16006 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
16007 parameter. Change all callers.
16008 (Sized_relobj::adjust_shndx): New function.
16009 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
16010 field.
16011 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
16012 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
16013 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
16014 (Sized_dynobj::read_dynsym_section): Adjust section links.
16015 (Sized_dynobj::read_dynamic): Likewise.
16016 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
16017 section links.
16018 (Sized_dynobj::do_initialize_xindex): New function.
16019 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
16020 do_initialize_xindex.
16021 (Sized_dynobj::adjust_shndx): New function.
16022 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
16023 dynsym_xindex_ fields.
16024 (Layout::finalize): Add a call to set_section_indexes before
16025 creating the symtab sections.
16026 (Layout::set_section_indexes): Don't do anything if the section
16027 already has a section index.
16028 (Layout::create_symtab_sections): Add shnum parameter. Change
16029 caller. Create .symtab_shndx section if needed.
16030 (Layout::create_shdrs): Add shstrtab_section parameter. Change
16031 caller.
16032 (Layout::allocated_output_section_count): New function.
16033 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
16034 needed.
16035 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
16036 fields. Update declarations.
16037 (Layout::symtab_xindex): New function.
16038 (Layout::dynsym_xindex): New function.
16039 (class Write_symbols_task): Add layout_ field.
16040 (Write_symbols_task::Write_symbols_task): Add layout parameter.
16041 Change caller.
16042 * output.cc (Output_section_headers::Output_section_headers): Add
16043 shstrtab_section parameter. Change all callers.
16044 (Output_section_headers::do_sized_write): Store overflow values
16045 for section count and section string table section index in
16046 section header zero.
16047 (Output_file_header::do_sized_write): Check for overflow of
16048 section count and section string table section index.
16049 (Output_symtab_xindex::do_write): New function.
16050 (Output_symtab_xindex::endian_do_write): New function.
16051 * output.h (class Output_section_headers): Add shstrtab_section_.
16052 Update declarations.
16053 (class Output_symtab_xindex): Define.
16054 (Output_section::has_out_shndx): New function.
16055 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
16056 field.
16057 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
16058 Change all callers.
16059 (Sized_symbol::init): Likewise.
16060 (Symbol::output_section): Check for ordinary symbol.
16061 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
16062 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
16063 callers.
16064 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
16065 Change all callers. Simplify handling of symbols from sections
16066 not included in the link.
16067 (Symbol_table::add_from_dynobj): Handle ordinary symbol
16068 distinction.
16069 (Weak_alias_sorter::operator()): Assert that symbols are
16070 ordinary.
16071 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
16072 distinction.
16073 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
16074 parameters. Change all callers.
16075 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
16076 symbol distinction. Use SHN_XINDEX when needed.
16077 (Symbol_table::write_section_symbol): Add symtab_xindex
16078 parameter. Change all callers.
16079 (Symbol_table::sized_write_section_symbol): Likewise. Use
16080 SHN_XINDEX when needed.
16081 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
16082 declarations.
16083 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
16084 (Symbol::is_defined): Check is_ordinary.
16085 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
16086 (Symbol::is_absolute, Symbol::is_common): Likewise.
16087 (class Sized_symbol): Update declarations.
16088 (class Symbol_table): Update declarations.
16089 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
16090 parameters. Change all callers.
16091 (Sized_symbol::override): Likewise.
16092 (Symbol_table::override): Likewise.
16093 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
16094 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
16095 is_ordinary, and orig_st_shndx parameters. Change all callers.
16096 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
16097 to be in an ordinary section.
16098 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
16099 object and is_ordinary parameters. Change all callers.
16100 (Sized_dwarf_line_info::read_relocs): Add object parameter.
16101 Change all callers. Don't add undefined or non-ordinary symbols
16102 to reloc_map_.
16103 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
16104 Change all callers.
16105 * dwarf_reader.h (class Sized_dwarf_line_info): Update
16106 declarations.
16107 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
16108 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
16109 (Sized_relobj::relocate_sections): Likewise.
16110 * target-reloc.h (scan_relocs): Adjust section symbol index.
16111 (scan_relocatable_relocs): Likewise.
16112 * i386.cc (Scan::local): Check for ordinary symbols.
16113 * sparc.cc (Scan::local): Likewise.
16114 * x86_64.cc (Scan::local): Likewise.
16115 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
16116 to symbol_section_and_value.
16117 * testsuite/many_sections_test.cc: New file.
16118 * testsuite/Makefile.am (BUILT_SOURCES): Define.
16119 (check_PROGRAMS): Add many_sections_test.
16120 (many_sections_test_SOURCES): Define.
16121 (many_sections_test_DEPENDENCIES): Define.
16122 (many_sections_test_LDFLAGS): Define.
16123 (BUILT_SOURCES): Add many_sections_define.h.
16124 (many_sections_define.h): New target.
16125 (BUILT_SOURCES): Add many_sections_check.h.
16126 (many_sections_check.h): New target.
16127 (check_PROGRAMS): Add many_sections_r_test.
16128 (many_sections_r_test_SOURCES): Define.
16129 (many_sections_r_test_DEPENDENCIES): Define.
16130 (many_sections_r_test_LDFLAGS): Define.
16131 (many_sections_r_test_LDADD): Define.
16132 (many_sections_r_test.o): New target.
16133 * testsuite/Makefile.in: Rebuild.
16134
c5818ff1
CC
161352008-04-17 Cary Coutant <ccoutant@google.com>
16136
16137 * errors.cc (Errors::info): New function.
16138 (gold_info): New function.
16139 * errors.h (Errors::info): New function.
16140 * gold.h (gold_info): New function.
16141 * object.cc (Input_objects::add_object): Print trace output.
16142 * options.cc (options::parse_set): New function.
16143 (General_options::parse_wrap): Deleted.
16144 (General_options::General_options): Deleted initializer.
16145 * options.h (options::String_set): New typedef.
16146 (options::parse_set): New function.
16147 (DEFINE_set): New macro.
16148 (General_options::wrap): Changed to use DEFINE_set. Changed
16149 callers of any_wrap_symbols and is_wrap_symbol.
16150 (General_options::trace, General_options::trace_symbol):
16151 New options.
16152 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
16153 (General_options::wrap_symbols_): Deleted.
16154 * symtab.cc (Symbol_table::add_from_object): Print trace output.
16155
b5be4a7c
DM
161562008-04-17 David S. Miller <davem@davemloft.net>
16157
16158 * options.cc (General_options::parse_V): New function.
16159 * options.h: Add entries for -V and -Qy.
16160
155a0dd7
ILT
161612008-04-17 Ian Lance Taylor <iant@google.com>
16162
16163 * common.cc (Symbol_table::allocate_commons): Remove options
16164 parameter. Change caller.
16165 (Symbol_table::do_allocate_commons): Remove options parameter.
16166 Change caller. Just call do_allocate_commons_list twice.
16167 (Symbol_table::do_allocate_commons_list): New function, broken out
16168 of do_allocate_commons.
16169 * common.h (class Allocate_commons_task): Remove options_ field.
16170 Update constructor.
16171 * symtab.cc (Symbol_table::Symbol_table): Initialize
16172 tls_commons_.
16173 (Symbol_table::add_from_object): Put TLS common symbols on
16174 tls_commons_ list.
16175 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
16176 which are IN_OUTPUT_DATA.
16177 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
16178 allocate_commons and do_allocate_commons declarations. Declare
16179 do_allocate_commons_list.
16180 * gold.cc (queue_middle_tasks): Update creation of
16181 Allocate_commons_task to not pass options.
16182 * testsuite/Makefile.am (INCLUDES): Add -I.. .
16183 (TLS_TEST_C_FLAGS): New variable.
16184 (tls_test_c_pic.o): New target.
16185 (tls_test_shared.so): Link in tls_test_c_pic.o.
16186 (tls_test_c_pic_ie.o): New target.
16187 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
16188 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
16189 (tls_test_c.o): New target.
16190 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
16191 (tls_pic_test_LDADD): Likewise.
16192 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
16193 (tls_shared_gd_to_ie_test_LDADD): Likewise.
16194 (tls_test_c_gnu2.o): New target.
16195 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
16196 tls_test_c_gnu2.o.
16197 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
16198 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
16199 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
16200 * testsuite/tls_test.cc: Include "config.h".
16201 (t_last): Call t11_last.
16202 * testsuite/tls_test.h (t11, t11_last): Declare.
16203 * testsuite/tls_test_c.c: New file.
16204 * testsuite/tls_test_main.cc (thread_routine): Call t11.
16205 * configure.ac: Check for OpenMP support.
16206 * configure, config.in, Makefile.in: Rebuild.
16207 * testsuite/Makefile.in: Rebuild.
16208
edfbb029
CC
162092008-04-16 Cary Coutant <ccoutant@google.com>
16210
16211 * i386.cc (Target_i386::define_tls_base_symbol): New function.
16212 (Target_i386::tls_base_symbol_defined_): New field.
16213 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16214 (Target_i386::Scan::global): Likewise.
16215 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
16216 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
16217 (Target_x86_64::tls_base_symbol_defined_): New field.
16218 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16219 (Target_x86_64::Scan::global): Likewise.
16220
f3c69fca
CC
162212008-04-16 Cary Coutant <ccoutant@google.com>
16222
16223 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
16224 (Symbol::needs_plt_entry): Allow weak undefined symbols.
16225 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
16226 building shared libraries.
16227 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
16228 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
16229 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
16230 * testsuite/Makefile.in: Rebuild.
16231 * testsuite/weak_undef.h: New file.
16232 * testsuite/weak_undef_file1.cc: Add extra test cases.
16233 * testsuite/weak_undef_file2.cc: Likewise.
16234 * testsuite/weak_undef_test.cc: Likewise.
16235
7c414435
DM
162362008-04-16 David S. Miller <davem@davemloft.net>
16237
32b769e1
DM
16238 * sparc.cc (Target_sparc::Scan): Change from struct to class.
16239 Add issued_non_pic_error_ field. Declare check_non_pic.
16240 (Target_sparc::Scan::check_non_pic): New function.
16241 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
16242 (Target_sparc::Scan::global): Likewise.
16243
11936fb1
DM
16244 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
16245 * configure: Rebuild.
16246
7c414435
DM
16247 * options.h (DEFINE_enable): New macro.
16248 (new_dtags): New enable option.
16249 (initfirst, interpose, loadfltr, nodefaultlib,
16250 nodelete, nodlopen, nodump): New -z options.
16251 * layout.cc (Layout:finish_dynamic_section): If new
16252 dtags enabled, emit DT_RUNPATH. Also, emit a
16253 DT_FLAGS_1 containing any specified -z flags.
16254
85c7bf8b
ILT
162552008-04-16 Ian Lance Taylor <iant@google.com>
16256
12c0daef
ILT
16257 * copy-relocs.cc: New file.
16258 * copy-relocs.h: New file.
16259 * reloc.cc: Remove Copy_relocs code.
16260 * reloc.h: Likewise.
16261 * reloc-types.h (struct Reloc_types) [both versions]: Add
16262 get_reloc_addend_noerror.
16263 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
16264 variants of add_global which take an addend which must be zero.
16265 * i386.cc: Include "copy-relocs.h".
16266 (class Target_i386): Change type of copy_relocs_ to variable,
16267 update initializer.
16268 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
16269 Change all callers.
16270 (Target_i386::do_finalize_sections): Change handling of
16271 copy_relocs_.
16272 * sparc.cc: Include "copy-relocs.h".
16273 (class Target_sparc): Change type of copy_relocs_ to variable,
16274 update initializer.
16275 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
16276 Change all callers.
16277 (Target_sparc::do_finalize_sections): Change handling of
16278 copy_relocs_.
16279 * x86_64.cc: Include "copy-relocs.h".
16280 (class Target_x86_64): Change type of copy_relocs_ to variable,
16281 update initializer.
16282 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
16283 class. Change all callers.
16284 (Target_x86_64::do_finalize_sections): Change handling of
16285 copy_relocs_.
16286 * Makefile.am (CCFILES): Add copy-relocs.cc.
16287 (HFILES): Add copy-relocs.h.
16288
4f4995b6
ILT
16289 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
16290
85c7bf8b
ILT
16291 * testsuite/script_test_4.sh: Permit leading zeroes.
16292
4f2a9edd
ILT
162932008-04-15 Ian Lance Taylor <iant@google.com>
16294
e6188289
ILT
16295 * script-sections.cc (Script_sections::create_segments): Use
16296 header_size_adjustment even when there is enough room for the
16297 headers.
16298 * testsuite/script_test_4.sh: New file.
16299 * testsuite/script_test_4.t: New file.
16300 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
16301 (check_DATA): Add script_test_4.stdout.
16302 (MOSTLYCLEANFILES): Likewise.
16303 (script_test_4): New target.
16304 (script_test_4.stdout): New target.
16305 * testsuite/Makefile.in: Rebuild.
16306
4f2a9edd
ILT
16307 * sparc.cc: Add definitions for Output_data_plt_sparc class
16308 constants.
16309
f5314dd5
DM
163102008-04-14 David S. Miller <davem@davemloft.net>
16311
16312 * sparc.cc: New file.
16313 * Makefile.am (TARGETSOURCES): Add sparc.cc
16314 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
16315 * configure.tgt: Document targ_extra_size and
16316 targ_extra_big_endian. Add entries for sparc-* and
16317 sparc64-*.
16318 * configure.ac: Handle targ_extra_size and
16319 targ_extra_big_endian.
16320 * Makefile.in: Rebuild.
16321 * configure: Likewise.
16322 * po/POTFILES.in: Likewise.
16323 * po/gold.pot: Likewise.
16324
154e0e9a
ILT
163252008-04-14 Ian Lance Taylor <iant@google.com>
16326
16327 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
16328 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
16329 in the name/type/flags to section mapping. Don't call
16330 allocate_output_section.
16331 (Layout::choose_output_section): Change parameter from adjust_name
16332 to is_input_section. Don't permit input sections after sections
16333 are attached to segments. Don't call allocate_output_section.
16334 (Layout::layout_eh_frame): Call update_flags_for_input_section,
16335 not write_enable_output_section.
16336 (Layout::make_output_section): Don't push to
16337 unattached_section_list_ nor call attach_to_segment. Call
16338 attach_section_to_segment if sections are attached.
16339 (Layout::attach_sections_to_segments): New function.
16340 (Layout::attach_section_to_segment): New function.
16341 (Layout::attach_allocated_section_to_segment): Rename from
16342 attach_to_segment. Remove flags parameter.
16343 (Layout::allocate_output_section): Remove function.
16344 (Layout::write_enable_output_section): Remove function.
16345 * layout.h (class Layout): Update for above changes. Add new
16346 field sections_are_attached_.
16347 * output.h (Output_section::update_flags_for_input_section): New
16348 function.
16349 * output.cc (Output_section::add_input_section): Call
16350 update_flags_for_input_section.
16351 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
16352
009a67a2
CC
163532008-04-11 Cary Coutant <ccoutant@google.com>
16354
16355 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
16356 thought unnecessary.
16357 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
16358
759b1a24
ILT
163592008-04-11 Ian Lance Taylor <iant@google.com>
16360
16361 * output.h (class Output_section_data): Remove inline definition
16362 of set_addralign.
16363 * output.cc (Output_section_data::set_addralign): New function.
16364
c2b45e22
CC
163652008-04-11 Cary Coutant <ccoutant@google.com>
16366
16367 Add support for TLS descriptors for i386 and x86_64.
16368 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
16369 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
16370 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
16371 GOT_TYPE_TLS_DESC.
16372 (Target_i386::got_mod_index_entry): Remove unnecessary code.
16373 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
16374 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
16375 relocations.
16376 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
16377 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
16378 Fix problem with initial-exec relocations.
16379 (Target_i386::Relocate::relocate_tls): Likewise.
16380 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
16381 relaxation.
16382 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
16383 support for section-plus-offset dynamic table entries.
16384 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
16385 (Output_data_dynamic::Dynamic_entry): Add support for
16386 section-plus-offset dynamic table entries.
16387 (Output_data_dynamic::Classification): Likewise.
16388 (Output_data_dynamic::classification_): Renamed offset_.
16389 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
16390 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
16391 (Target_x86_64::make_plt_section): New function.
16392 (Target_x86_64::reserve_tlsdesc_entries): New function.
16393 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
16394 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
16395 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
16396 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
16397 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
16398 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
16399 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
16400 add extra PLT entry for TLS descriptors.
16401 (Output_data_plt_x86_64::got_): New field.
16402 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
16403 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
16404 fields.
16405 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
16406 descriptors.
16407 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
16408 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
16409 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
16410 R_386_TLS_DESC_CALL relocations.
16411 (Target_x86_64::Scan::global): Likewise.
16412 (Target_x86_64::do_finalize_sections): Add dynamic table entries
16413 for TLS descriptors.
16414 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
16415 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
16416 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
16417 GD-to-IE relaxation.
16418 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
16419 and TLS_DESCRIPTORS.
16420 * Makefile.in: Rebuild.
16421 * configure: Rebuild.
16422 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
16423 (tls_test_shared2.so): New target.
16424 (tls_shared_gd_to_ie_test_SOURCES): New variable.
16425 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
16426 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
16427 (tls_shared_gd_to_ie_test_LDADD): New variable.
16428 (tls_shared_gnu2_gd_to_ie_test): New target.
16429 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
16430 New targets.
16431 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
16432 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
16433 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
16434 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
16435 (tls_shared_gnu2_test): New target.
16436 (tls_test_gnu2_shared.so): New target.
16437 (tls_shared_gnu2_test_SOURCES): New variable.
16438 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
16439 (tls_shared_gnu2_test_LDFLAGS): New variable.
16440 (tls_shared_gnu2_test_LDADD): New variable.
16441 * testsuite/Makefile.in: Rebuild.
16442 * testsuite/Makefile.
16443
83bfb6b7
ILT
164442008-04-11 Ian Lance Taylor <iant@google.com>
16445
16446 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
16447 justsyms.t.
16448 * testsuite/Makefile.in: Rebuild.
16449
16450 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
16451 long.
16452 * testsuite/script_test_2.cc (main): Adjust test.
16453
706e1f5e
ILT
164542008-04-11 David S. Miller <davem@davemloft.net>
16455 Ian Lance Taylor <iant@google.com>
16456
16457 * options.h (General_options): Add entries for '-Y' and
16458 '-relax'.
16459 * options.cc (General_options:finalize): If -Y was used, add those
16460 entries to the library path instead of the default "/lib" and
16461 "/usr/lib".
16462
7c98e6bb
DM
164632008-04-11 David S. Miller <davem@davemloft.net>
16464
16465 * testsuite/justsyms.t: Start at 0x100.
16466 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
16467 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
16468 long.
16469 * testsuite/script_test_2.cc: Adjust string and section length
16470 checks.
7c98e6bb 16471
99a37bfd
ILT
164722008-04-09 Ian Lance Taylor <iant@google.com>
16473
2cefc357
ILT
16474 PR gold/5996
16475 * script-sections.cc (Sections_element::allocate_to_segment): Add
16476 orphan parameter.
16477 (Output_section_definition::allocate_to_segment): Likewise.
16478 (Orphan_output_section::allocate_to_segment): Likewise.
16479 (Script_sections::attach_sections_using_phdrs_clause): Don't
16480 propagate non-PT_LOAD segments to orphan sections.
16481 * testsuite/Makefile.am (script_test_3.stdout): Generate using
16482 readelf rather than objdump.
16483 * testsuite/script_test_3.sh: Adjust accordingly. Test that
16484 .interp section and PT_INTERP segment are the same size.
16485 * testsuite/Makefile.in: Rebuild.
16486
99a37bfd
ILT
16487 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
16488 aliases for symbols defined in the same object.
16489 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
16490 (weak_alias_test_SOURCES): New variable.
16491 (weak_alias_test_DEPENDENCIES): New variable.
16492 (weak_alias_test_LDFLAGS): New variable.
16493 (weak_alias_test_LDADD): New variable.
16494 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
16495 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
16496 (weak_alias_test_3.o): New target.
16497 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
16498 * testsuite/weak_alias_test_main.cc: New file.
16499 * testsuite/weak_alias_test_1.cc: New file.
16500 * testsuite/weak_alias_test_2.cc: New file.
16501 * testsuite/weak_alias_test_3.cc: New file.
16502
780e49c5
ILT
165032008-04-08 Ian Lance Taylor <iant@google.com>
16504
cdb0b8f5
ILT
16505 * options.h (class General_options): Add --noinhibit-exec option.
16506 * main.cc (main): Check --noinhibit-exec.
16507
0864d551
ILT
16508 * options.h (class General_options): Define --wrap as a special
16509 option. Add wrap_symbols_ field.
16510 (General_options::any_wrap_symbols): New function.
16511 (General_options::is_wrap_symbol): New function.
16512 * options.cc (General_options::parse_wrap): New function.
16513 (General_options::General_options): Initialize wrap_symbols_.
16514 * symtab.cc (Symbol_table::wrap_symbol): New function.
16515 (Symbol_table::add_from_object): Handle --wrap.
16516 * symtab.h (class Symbol_table): Declare wrap_symbol.
16517 * target.h (Target::wrap_char): New function.
16518 (Target::Target_info): Add wrap_char field.
16519 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
16520 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
16521 * testsuite/testfile.cc (Target_test::test_target_info):
16522 Likewise.
16523
789aa6de
ILT
16524 * errors.cc (Errors::undefined_symbol): Mention symbol version if
16525 there is one.
16526
2c38906f
ILT
16527 * layout.h (class Layout): Add added_eh_frame_data_ field.
16528 * layout.cc (Layout::Layout): Initialize new field.
16529 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
16530 output section until we find a section we merged successfully.
16531 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
16532 that the size be non-zero.
16533
780e49c5
ILT
16534 * merge.cc (Object_merge_map::get_output_offset): Remove inline
16535 qualifier.
16536
7fcd0256
ILT
165372008-04-08 Craig Silverstein <csilvers@google.com>
16538
16539 * configure.ac: Export new conditional variable HAVE_ZLIB.
16540 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
16541 on HAVE_ZLIB.
16542 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
16543 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16544
6835af53
ILT
165452008-04-07 Ian Lance Taylor <iant@google.com>
16546
e24f324c
ILT
16547 * version.cc (version_string): Set to "1.5".
16548
a036edd8
ILT
16549 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
16550 Add issued_non_pic_error_ field. Declare check_non_pic.
16551 (Target_x86_64::Scan::check_non_pic): New function.
16552 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
16553 (Target_x86_64::Scan::global): Likewise.
16554
624f8810
ILT
16555 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
16556 addend parameter. Change caller. Handle merge sections.
16557 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
16558 Address to Addend. Don't add in the result of
16559 local_section_offset, pass down the addend and use the returned
16560 value.
16561 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
16562 Update declarations of local_section_offset and symbol_value.
16563 * testsuite/two_file_test_1.cc (t18): New function.
16564 * testsuite/two_file_test_2.cc (f18): New function.
16565 * testsuite/two_file_test_main.cc (main): Call t18.
16566 * testsuite/two_file_test.h (t18, f18): Declare.
16567
6835af53
ILT
16568 * configure.ac: Don't test for objdump, c++filt, or readelf.
16569 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
16570 conditionals.
16571 (TEST_READELF): New variable.
16572 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
16573 (check_PROGRAMS): Add two_file_strip_test.
16574 (two_file_strip_test): New target.
16575 (check_PROGRAMS): Add two_file_same_shared_strip_test.
16576 (two_file_same_shared_strip_test_SOURCES): New variable.
16577 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
16578 (two_file_same_shared_strip_test_LDFLAGS): New variable.
16579 (two_file_same_shared_strip_test_LDADD): New variable.
16580 (two_file_shared_strip.so): New target.
16581 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
16582 (ver_test_5.syms, ver_test_7.syms): Likewise.
16583 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
16584 (strip_test_3.stdout): Use TEST_OBJDUMP.
16585 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16586
86925eef
CC
165872008-04-04 Cary Coutant <ccoutant@google.com>
16588
16589 * symtab.h (Symbol::is_weak_undefined): New function.
16590 (Symbol::is_strong_undefined): New function.
16591 (Symbol::is_absolute): New function.
16592 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
16593 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
16594 absolute symbols.
16595 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
16596 (weak_undef_test): New target.
16597 * testsuite/Makefile.in: Rebuild.
16598 * testsuite/weak_undef_file1.cc: New file.
16599 * testsuite/weak_undef_file2.cc: New file.
16600 * testsuite/weak_undef_test.cc: New file.
16601
126f3ece
ILT
166022008-04-03 Craig Silverstein <csilvers@google.com>
16603
16604 * compressed_output.h (class Output_compressed_section): Use
16605 unsigned buffer.
16606 * compressed_output.cc (zlib_compress): Use unsigned buffers,
16607 add zlib header.
16608 (zlib_compressed_suffix): Removed.
16609 (Output_compressed_section::set_final_data_size): Use unsigned
16610 buffers.
16611 * testsuite/Makefile.am (flagstest_compress_debug_sections):
16612 Fix linker invocation.
16613 (flagstest_o_specialfile_and_compress_debug_sections):
16614 Likewise.
16615 * testsuite/Makefile.in: Regenerated.
16616
deae2a14
DM
166172008-04-02 David S. Miller <davem@davemloft.net>
16618
16619 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
16620 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
16621
70752818
ILT
166222008-04-02 Craig Silverstein <csilvers@google.com>
16623
16624 * TODO: New file.
16625
39d0cb0e
ILT
166262008-04-02 Ian Lance Taylor <iant@google.com>
16627
16628 * fileread.cc (File_read::find_view): Add byteshift and vshifted
16629 parameters. Update for new key type to views_. Change all
16630 callers.
16631 (File_read::read): Adjust for byteshift in returned view.
16632 (File_read::add_view): New function, broken out of
16633 find_and_make_view.
16634 (File_read::make_view): New function, broken out of
16635 find_and_make_view.
16636 (File_read::find_or_make_view): Add offset and aligned
16637 parameters. Rewrite accordingly. Change all callers.
16638 (File_read::get_view): Add offset and aligned parameters. Adjust
16639 for byteshift in return value.
16640 (File_read::get_lasting_view): Likewise.
16641 * fileread.h (class File_read): Update declarations.
16642 (class File_read::View): Add byteshift_ field. Add byteshift to
16643 constructor. Add byteshift method.
16644 * archive.h (Archive::clear_uncached_views): New function.
16645 (Archive::get_view): Add aligned parameter. Change all callers.
16646 * object.h (Object::get_view): Add aligned parameter. Change all
16647 callers.
16648 (Object::get_lasting_view): Likewise.
16649
16650 * fileread.cc (File_read::release): Don't call clear_views if
16651 there are multiple objects.
16652 * fileread.h (File_read::clear_uncached_views): New function.
16653 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
16654 on the archive.
16655
a1207466
CC
166562008-03-31 Cary Coutant <ccoutant@google.com>
16657
16658 Add thin archive support.
16659 * archive.cc (Archive::armagt): New const.
16660 (Archive::setup): Remove task parameter and calls to unlock.
16661 (Archive::unlock_nested_archives): New function.
16662 (Archive::read_header): Add nested_off parameter. Change
16663 all callers.
16664 (Archive::interpret_header): Likewise.
16665 (Archive::include_all_members): Change to handle thin
16666 archives.
16667 (Archive::include_member): Likewise.
16668 * archive.h (Archive::Archive): Add new parameters and
16669 initializers.
16670 (Archive::armagt): New const.
16671 (Archive::setup): Remove task parameter.
16672 (Archive::unlock_nested_archives): New function.
16673 (Archive::read_header): Add nested_off parameter.
16674 (Archive::interpret_header): Likewise.
16675 (Archive::Nested_archive_table): New typedef.
16676 (Archive::is_thin_archive_): New field.
16677 (Archive::nested_archives_): New field.
16678 (Archive::options_): New field.
16679 (Archive::dirpath_): New field.
16680 (Archive::task_): New field.
16681 * readsyms.cc (Read_symbols::do_read_symbols): Add check
16682 for thin archives. Pass additional parameters to
16683 Archive::Archive. Unlock the archive file after calling
16684 Archive::setup.
cd536b21 16685
479f6503
ILT
166862008-03-29 Ian Lance Taylor <iant@google.com>
16687
686c8caf
ILT
16688 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
16689 version symbol to be local.
16690 * testsuite/ver_test_4.sh: New file.
16691 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
16692 (check_DATA): Add ver_test_4.syms.
16693 (ver_test_4.syms): New target.
16694 * testsuite/Makefile.in: Rebuild.
16695
ab794b6b
ILT
16696 * output.cc
16697 (Output_section::Input_section_sort_entry::has_priority): New
16698 function.
16699 (Output_section::Input_section_sort_entry::match_file_name): New
16700 function.
16701 (Output_section::Input_section_sort_entry::match_section_name):
16702 Remove.
16703 (Output_section::Input_section_sort_entry::match_section_name_prefix):
16704 Remove.
16705 (Output_section::Input_section_sort_entry::match_section_file):
16706 Remove.
16707 (Output_section::Input_section_sort_compare::operator()): Rewrite
16708 using new Input_section_sort_entry functions. Sort crtbegin and
16709 crtend first. Sort sections with no priority before sections with
16710 a priority.
16711 * testsuite/initpri1.c (d3): Check j != 4.
16712 (cd5): New constructor/destructor function.
16713 (main): Check j != 2.
16714
479f6503
ILT
16715 * symtab.cc (Symbol_table::add_from_object): If we don't use the
16716 new symbol when resolving, don't call set_is_default.
16717 * testsuite/ver_test_7.cc: New file.
16718 * testsuite/ver_test_7.sh: New file.
16719 * testsuite/Makefile.am (ver_test_7.so): New target.
16720 (ver_test_7.o): New target.
16721 (check_SCRIPTS): Add ver_test_7.sh.
16722 (check_DATA): Add ver_test_7.syms.
16723 (ver_test_7.syms): New target.
16724
2fd32231
ILT
167252008-03-28 Ian Lance Taylor <iant@google.com>
16726
16727 * layout.cc (Layout::layout): If we see an input section with a
16728 name that needs sorting, set the must_sort flag for the output
16729 section.
16730 (Layout::make_output_section): If the name of the output section
16731 indicates that it might require sorting, set the may_sort flag.
16732 * output.h (Output_section::may_sort_attached_input_sections): New
16733 function.
16734 (Output_section::set_may_sort_attached_input_sections): New
16735 function.
16736 (Output_section::must_sort_attached_input_sections): New
16737 function.
16738 (Output_section::set_must_sort_attached_input_sections): New
16739 function.
16740 (class Output_section): Declare Input_section_sort_entry. Define
16741 Input_section_sort_compare. Declare
16742 sort_attached_input_sections. Add new fields:
16743 may_sort_attached_input_sections_,
16744 must_sort_attached_input_sections_,
16745 attached_input_sections_are_sorted_.
16746 * output.cc (Output_section::Output_section): Initialize new
16747 fields.
16748 (Output_section::add_input_section): Add an entry to
16749 input_sections_ if may_sort or must_sort are true.
16750 (Output_section::set_final_data_size): Call
16751 sort_attached_input_sections if necessary.
16752 (Output_section::Input_section_sort_entry): Define new class.
16753 (Output_section::Input_section_sort_compare::operator()): New
16754 function.
16755 (Output_section::sort_attached_input_sections): New function.
16756 * configure.ac: Check whether the compiler supports constructor
16757 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
16758 * testsuite/initpri1.c: New file.
16759 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
16760 CONSTRUCTOR_PRIORITY.
16761 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
16762 (initpri1_LDFLAGS): New variable.
16763 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16764
18e6b24e
ILT
167652008-03-27 Ian Lance Taylor <iant@google.com>
16766
49bdd526
ILT
16767 * common.cc (Sort_commons::operator): Correct sorting algorithm.
16768 * testsuite/common_test_1.c: New file.
16769 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
16770 (common_test_1_SOURCES): New variable.
16771 (common_test_1_DEPENDENCIES): New variable.
16772 (common_test_1_LDFLAGS): New variable.
16773
18e6b24e
ILT
16774 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
16775 and commons_ correctly when NAME/VERSION does not override
16776 NAME/NULL.
16777 * testsuite/ver_test_6.c: New file.
16778 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
16779 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
16780 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
16781
04bf7072
ILT
167822008-03-26 Ian Lance Taylor <iant@google.com>
16783
5871526f
ILT
16784 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
16785 of an undefined symbol from a version script.
16786 * testsuite/Makefile.am (ver_test_5.so): New target.
16787 (ver_test_5.o): New target.
16788 (check_SCRIPTS): Add ver_test_5.sh.
16789 (check_DATA): Add ver_test_5.syms.
16790 (ver_test_5.syms): New target.
16791 * testsuite/ver_test_5.cc: New file.
16792 * testsuite/ver_test_5.script: New file.
16793 * testsuite/ver_test_5.sh: New file.
16794 * Makefile.in, testsuite/Makefile.in: Rebuild.
16795
04bf7072
ILT
16796 PR gold/5986
16797 Fix problems building gold with gcc 4.3.0.
16798 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
16799 (gold_error_at_location, gold_warning_at_location): Use it.
16800 * configure.ac: Check whether we can compile and use a template
16801 function with a printf attribute.
16802 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
16803 when jumping over bytes.
16804 * object.cc: Instantiate Object::read_section_data.
16805 * debug.h: Include <cstring>
16806 * dwarf_reader.cc: Include <algorithm>
16807 * main.cc: Include <cstring>.
16808 * options.cc: Include <cstring>.
16809 * output.cc: Include <cstring>.
16810 * script.cc: Include <cstring>.
16811 * script.h: Include <string>.
16812 * symtab.cc: Include <cstring> and <algorithm>.
16813 * target-select.cc: Include <cstring>.
16814 * version.cc: Include <string>.
16815 * testsuite/testmain.cc: Include <cstdlib>.
16816 * configure, config.in: Rebuild.
16817
874c5b28
ILT
168182008-03-25 Ian Lance Taylor <iant@google.com>
16819
819d6c3a
ILT
16820 * options.cc: Include "../bfd/bfdver.h".
16821 (options::help): Print bug reporting address.
16822
f4b2c6f5
ILT
16823 * version.cc (print_version): Adjust output for current value of
16824 BFD_VERSION_STRING.
16825
16826 * NEWS: New file.
16827
e96caa79
ILT
16828 * options.cc (options::help): Print list of supported targets.
16829 * target-select.h: Include <vector>.
16830 (class Target_selector): Make machine_, size_, and is_big_endian_
16831 fields const. Add bfd_name_ and instantiated_target_ fields.
16832 (Target_selector::Target_selector): Add bfd_name parameter.
16833 (Target_selector::recognize): Make non-virtual, call
16834 do_recognize.
16835 (Target_selector::recognize_by_name): Make non-virtual, call
16836 do_recognize_by_name.
16837 (Target_selector::supported_names): New function.
16838 (Target_selector::bfd_name): New function.
16839 (Target_selector::do_instantiate_target): New pure virtual
16840 function.
16841 (Target_selector::do_recognize): New virtual function.
16842 (Target_selector::do_recognize_by_name): New virtual function.
16843 (Target_selector::instantiate_target): New private function.
16844 (supported_target_names): Declare.
16845 * target-select.cc (Target_selector::Target_selector): Update for
16846 new parameter and fields.
16847 (select_target_by_name): Check that the name matches before
16848 calling recognize_by_name.
16849 (supported_target_names): New function.
16850 * i386.cc (class Target_selector_i386): Update Target_selector
16851 constructor call. Remove recognize and recognize_by_name. Add
16852 do_instantiate_target.
16853 * x86_64.cc (class Target_selector_x86_64): Likewise.
16854 * testsuite/testfile.cc (class Target_selector_test): Update for
16855 changes to Target_selector.
16856
874c5b28
ILT
16857 * README: Rewrite, with some notes on unsupported features.
16858
0a65a3a7
CC
168592008-03-24 Cary Coutant <ccoutant@google.com>
16860
16861 * i386.cc (Target_i386::Got_type): New enum declaration.
16862 (Target_i386::Scan::local): Updated callers of Output_data_got
16863 member functions.
16864 (Target_i386::Scan::global): Likewise.
16865 (Target_i386::Relocate::relocate): Likewise.
16866 (Target_i386::Relocate::relocate_tls): Likewise.
16867 * object.h (Got_offset_list): New class.
16868 (Sized_relobj::local_has_got_offset): Added got_type parameter.
16869 (Sized_relobj::local_got_offset): Likewise.
16870 (Sized_relobj::set_local_got_offset): Likewise.
16871 (Sized_relobj::local_has_tls_got_offset): Removed.
16872 (Sized_relobj::local_tls_got_offset): Removed.
16873 (Sized_relobj::set_local_tls_got_offset): Removed.
16874 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
16875 * output.cc (Output_data_got::add_global): Added got_type parameter.
16876 (Output_data_got::add_global_with_rel): Likewise.
16877 (Output_data_got::add_global_with_rela): Likewise.
16878 (Output_data_got::add_global_pair_with_rel): New function.
16879 (Output_data_got::add_global_pair_with_rela): New function.
16880 (Output_data_got::add_local): Added got_type parameter.
16881 (Output_data_got::add_local_with_rel): Likewise.
16882 (Output_data_got::add_local_with_rela): Likewise.
16883 (Output_data_got::add_local_pair_with_rel): New function.
16884 (Output_data_got::add_local_pair_with_rela): New function.
16885 (Output_data_got::add_global_tls): Removed.
16886 (Output_data_got::add_global_tls_with_rel): Removed.
16887 (Output_data_got::add_global_tls_with_rela): Removed.
16888 (Output_data_got::add_local_tls): Removed.
16889 (Output_data_got::add_local_tls_with_rel): Removed.
16890 (Output_data_got::add_local_tls_with_rela): Removed.
16891 * output.h (Output_data_got::add_global): Added got_type parameter.
16892 (Output_data_got::add_global_with_rel): Likewise.
16893 (Output_data_got::add_global_with_rela): Likewise.
16894 (Output_data_got::add_global_pair_with_rel): New function.
16895 (Output_data_got::add_global_pair_with_rela): New function.
16896 (Output_data_got::add_local): Added got_type parameter.
16897 (Output_data_got::add_local_with_rel): Likewise.
16898 (Output_data_got::add_local_with_rela): Likewise.
16899 (Output_data_got::add_local_pair_with_rel): New function.
16900 (Output_data_got::add_local_pair_with_rela): New function.
16901 (Output_data_got::add_global_tls): Removed.
16902 (Output_data_got::add_global_tls_with_rel): Removed.
16903 (Output_data_got::add_global_tls_with_rela): Removed.
16904 (Output_data_got::add_local_tls): Removed.
16905 (Output_data_got::add_local_tls_with_rel): Removed.
16906 (Output_data_got::add_local_tls_with_rela): Removed.
16907 * resolve.cc (Symbol::override_base_with_special): Removed
16908 reference to has_got_offset_ field.
16909 * symtab.cc (Symbol::init_fields): Replaced initialization
16910 of got_offset_ with got_offsets_. Removed initialization
16911 of has_got_offset_
53fcba31 16912 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
16913 (Symbol::got_offset): Likewise.
16914 (Symbol::set_got_offset): Likewise.
16915 (Symbol::has_tls_got_offset): Removed.
16916 (Symbol::tls_got_offset): Removed.
16917 (Symbol::set_tls_got_offset): Removed.
16918 (Symbol::got_offset_): Removed.
16919 (Symbol::tls_mod_got_offset_): Removed.
16920 (Symbol::tls_pair_got_offset_): Removed.
16921 (Symbol::got_offsets_): New field.
16922 (Symbol::has_got_offset): Removed.
16923 (Symbol::has_tls_mod_got_offset): Removed.
16924 (Symbol::has_tls_pair_got_offset): Removed.
16925 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
16926 (Target_x86_64::Scan::local): Updated callers of Output_data_got
16927 member functions.
16928 (Target_x86_64::Scan::global): Likewise.
16929 (Target_x86_64::Relocate::relocate): Likewise.
16930 (Target_x86_64::Relocate::relocate_tls): Likewise.
16931
bd52eafb
BE
169322008-03-25 Ben Elliston <bje@au.ibm.com>
16933
16934 * yyscript.y: Fix spelling error in comment.
16935
8b105e34
ILT
169362008-03-24 Ian Lance Taylor <iant@google.com>
16937
8ed814a9
ILT
16938 * options.h (class General_options): Define build_id option.
16939 * layout.h (class Layout): Declare write_build_id, create_note,
16940 create_build_id. Add build_id_note_ member.
16941 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
16942 "libiberty.h", "md5.h", "sha1.h".
16943 (Layout::Layout): Initialize eh_frame_data_,
16944 eh_frame_hdr_section_, and build_id_note_.
16945 (Layout::finalize): Call create_build_id.
16946 (Layout::create_note): New function, broken out of
16947 Layout::create_gold_note.
16948 (Layout::create_gold_note): Call create_note.
16949 (Layout::create_build_id): New function.
16950 (Layout::write_build_id): New function.
16951 (Close_task_runner::run): Call write_build_id.
16952
8b105e34
ILT
16953 * x86_64.cc: Correct license to GPLv3.
16954
086a1841
ILT
169552008-03-23 Ian Lance Taylor <iant@google.com>
16956
16957 * options.cc: Include "demangle.h".
16958 (parse_optional_string): New function.
16959 (parse_long_option): Handle takes_optional_argument.
16960 (parse_short_option): Update dash_z initializer. Handle
16961 takes_optional_argument.
16962 (General_options::General_options): Initialize do_demangle_.
16963 (General_options::finalize): Set do_demangle_. Handle demangling
16964 style.
16965 * options.h (parse_optional_string): Declare.
16966 (struct One_option): Add optional_arg field. Update constructor.
16967 Update call constructor calls. Add takes_optional_argument
16968 function.
16969 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
16970 (DEFINE_optional_string): Define.
16971 (General_options::demangle): Change from DEFINE_bool to
16972 DEFINE_optional_string.
16973 (General_options::no_demangle): New function.
16974 (General_options::do_demangle): New function.
16975 (General_options::set_do_demangle): New function.
16976 (General_options::execstack_status_): Move definition to end of
16977 class definition.
16978 (General_options::static_): Likewise.
16979 (General_options::do_demangle_): New field.
16980 * object.cc (big_endian>::get_symbol_location_info): Call
16981 Options::do_demangle, not Options::demangle.
16982 * symtab.cc (demangle): Likewise.
16983
cbb93e63
ILT
169842008-03-22 Ian Lance Taylor <iant@google.com>
16985
16986 * gold.h: Include <cstddef> and <sys/types.h>
16987 * options.h: Include <cstring>.
16988
ec531623
ILT
169892008-03-21 Ian Lance Taylor <iant@google.com>
16990
16991 * Added source code to GNU binutils.
752937aa 16992\f
b90efa5b 16993Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
16994
16995Copying and distribution of this file, with or without modification,
16996are permitted in any medium without royalty provided the copyright
16997notice and this notice are preserved.
16998
16999Local Variables:
17000mode: change-log
17001left-margin: 8
17002fill-column: 74
17003version-control: never
17004End:
This page took 1.164772 seconds and 4 git commands to generate.