Regenerate configure in sim
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
c4fc4724
IT
12015-04-01 Ilya Tocar <ilya.tocar@intel.com>
2
3 PR gold/17640
4 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
5 (Target_i386::Scan::local): Don't create GOT entry, when we
6 can convert GOT to GOTOFF.
7 (Target_i386::Scan::global): Ditto.
8 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
9 lea foo@GOTOFF(%reg), %reg if possible.
10 * testsuite/Makefile.am (i386_mov_to_lea): New test.
11 * testsuite/i386_mov_to_lea1.s: New.
12 * testsuite/i386_mov_to_lea2.s: Ditto.
13 * testsuite/i386_mov_to_lea3.s: Ditto.
14 * testsuite/i386_mov_to_lea4.s: Ditto.
15 * testsuite/i386_mov_to_lea5.s: Ditto.
16 * testsuite/i386_mov_to_lea.sh: Ditto.
17
918357b9
L
182015-04-01 H.J. Lu <hongjiu.lu@intel.com>
19
20 * Makefile.am (ZLIB): New.
21 (ZLIBINC): Likewise.
22 (AM_CFLAGS): Add $(ZLIBINC).
23 (AM_CXXFLAGS): Likewise.
24 (ldadd_varldadd_var): Add $(ZLIB).
25 (incremental_dump_LDADD): Likewise.
26 (dwp_LDADD): Likewise.
27 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
28 <zlib.h>.
29 (zlib_compress): Don't check HAVE_ZLIB_H.
30 (zlib_decompress): Likewise.
31 * options.h (compress_debug_sections): Likewise.
32 * configure.ac (AM_CONDITIONAL): Removed.
33 * testsuite/Makefile.am (ZLIB): New.
34 (LDADD): Add $(ZLIB).
35 Don't check HAVE_ZLIB.
36 * Makefile.in: Regenerated.
37 * config.in: Likewise.
38 * configure: Likewise.
39 * testsuite/Makefile.in: Likewise.
40
6b0ad2eb
JY
412015-03-30 Jing Yu <jingyu@google.com>
42
43 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
44 TLSLD_ADD_DTPREL_LO12_NC.
45 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
46 _TLS_MODULE_BASE_ point to the start of tls segment.
47 (Target_aarch64::optimize_tls_reloc): Add cases for
48 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
49 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
50 (Target_aarch64::Scan::local): Likewise.
51 (Target_aarch64::Scan::global): Likewise.
52 (Target_aarch64::Relocate::relocate): Likewise.
53 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
54 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
55 relocations.
56
0916f9e7
RÁE
572015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
58
59 * merge.cc (Object_merge_map::add_mapping): call
60 Object_merge_map::Input_merge_map::add_mapping.
61 (Object_merge_map::Input_merge_map::add_mapping): New.
62 (Output_merge_data::do_add_input_section): Call
63 get_or_make_input_merge_map before a loop.
64 (Output_merge_string<Char_type>::finalize_merged_data): Call
65 get_or_make_input_merge_map before a loop.
66 * merge.h (Object_merge_map): Make Input_merge_map public.
67 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
68 (Relobj::get_or_create_merge_map): New.
69 * object.h (Relobj::get_or_create_merge_map): New.
70
282c9750
AM
712015-03-24 Alan Modra <amodra@gmail.com>
72
73 PR 18147
74 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
75 relocation errors for branches to strong undefined symbols.
76
67f95b96
RÁE
772015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
78
79 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
80 (Object_merge_map::is_merge_section_for): Remove.
81 (Object_merge_map::find_merge_section): New.
82 * merge.h (Object_merge_map::is_merge_section_for): Remove.
83 (Object_merge_map::find_merge_section): New.
84 (Object_merge_map::get_input_merge_map): Add a const version.
85 * object.cc (Relobj::is_merge_section_for): Remove.
86 (Relobj::find_merge_section): New.
87 * object.h (Relobj::is_merge_section_for): Remove.
88 (Relobj::find_merge_section): New.
89 * output.cc
90 (Output_section::Input_section::is_merge_section_for): Remove.
91 (Output_section::add_merge_input_section): Don't call
92 add_merge_input_section.
93 (Output_section::find_merge_section): Return const. Use
94 object->find_merge_section.
95 (Output_section::build_lookup_maps): Don't build a map for
96 merge sections.
97 (Output_section::is_input_address_mapped): Return false if
98 section is not found.
99 (Output_section::find_starting_output_address): Use
100 find_merge_section instead of is_merge_section_for.
101 (Output_section::add_script_input_section): Don't build a map for
102 merge sections.
103 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
104 (Output_section_lookup_maps::find_merge_section): Remove.
105 (Output_section_lookup_maps::add_merge_input_section) Remove.
106 (Output_section::find_merge_section): Return const.
107
152f7024
CC
1082015-03-22 Cary Coutant <cary@google.com>
109
110 PR gold/18106
111 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
112 non-SIB form of lea, with nop after the call.
113
bccffdfd
CC
1142015-03-21 Cary Coutant <cary@google.com>
115
116 PR gold/14217
117 * output.cc (Output_segment::is_first_section_relro): Don't ignore
118 .tdata section.
119 (Output_segment::set_section_addresses): Don't align size of relro
120 segment for .tbss.
121
1c582fe7
CC
1222015-03-21 Cary Coutant <cary@google.com>
123
124 PR gold/18010
125 * stringpool.cc (Stringpool_template): Don't optimize if section
126 alignment is greater than sizeof(char).
127
410da591
CC
1282015-03-21 Cary Coutant <cary@google.com>
129
130 PR gold/18048
131 * script-c.h (script_include_directive): Add first_token parameter.
132 * script.cc (script_include_directive): Add first_token parameter, and
133 pass it to read_script_file.
134 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
135 (PARSING_MEMORY_DEF): New tokens.
136 (top): Add new productions for INCLUDE files.
137 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
138 Pass PARSING_LINKER_SCRIPT to script_include_directive.
139 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
140 (section_cmd): Pass PARSING_SECTION_CMDS.
141 (file_or_sections_cmd): Remove.
142 (memory_def): Pass PARSING_MEMORY_DEF.
143 * testsuite/Makefile.am (memory_test_2): New test.
144 * testsuite/Makefile.in: Regenerate.
145 * testsuite/memory_test_inc.t: New script file.
146 * testsuite/memory_test_inc_1.t.src: New script file.
147 * testsuite/memory_test_inc_2.t.src: New script file.
148 * testsuite/memory_test_inc_3.t.src: New script file.
149
0d5bbdb0
CC
1502015-03-21 Cary Coutant <cary@google.com>
151
152 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
153 (Sized_relobj_dwo::setup): Build compressed section map.
154 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
155 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
156 section map.
157 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
158 compressed_sections_ field.
159 (build_compressed_section_map): Take Object instead of
160 Sized_relobj_file parameter; add decompress_if_needed parameter.
161 (Sized_relobj_file::do_find_special_sections): Store compressed
162 section map in parent Object.
163 (Sized_relobj_file::do_decompressed_section_contents): Move
164 implementation to Object::decompressed_section_contents.
165 (Sized_relobj_file::do_discard_decompressed_sections): Move
166 implementation to Object::discard_decompressed_sections.
167 * object.h (build_compressed_section_map): Declare.
168 (Object::Object): Add compressed_sections_ field.
169 (Object::section_is_compressed): Move implementation here.
170 (Object::decompressed_section_contents): De-virtualize.
171 (Object::discard_decompressed_sections): De-virtualize.
172 (Object::do_section_is_compressed): Delete.
173 (Object::do_decompressed_section_contents): Delete.
174 (Object::set_compressed_sections): New method.
175 (Object::compressed_sections): New method.
176 (Object::compressed_sections_): New data member.
177 (Compressed_section_info, Compressed_section_map): Move to top of file.
178 (Sized_relobj_file::do_section_is_compressed): Delete.
179 (Sized_relobj_file::do_decompressed_section_contents): Delete.
180 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
181 (Sized_relobj_file::compressed_sections_): Move to Object class.
182
bd9e0d46
CC
1832015-03-21 Cary Coutant <ccoutant@google.com>
184
185 PR gold/18152
186 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
187 deferred objects.
188
943c8b43
CC
1892015-03-11 Cary Coutant <ccoutant@google.com>
190
191 * options.cc (General_options::finalize): Don't allow -z relro
192 with incremental linking.
193 * testsuite/Makefile.am (incremental_test): Add -z norelro.
194 (incremental_test_2): Likewise.
195 (incremental_test_3): Likewise.
196 (incremental_test_4): Likewise.
197 (incremental_test_5): Likewise.
198 (incremental_test_6): Likewise.
199 (incremental_copy_test): Likewise.
200 (incremental_common_test_1): Likewise.
201 (incremental_comdat_test_1): Likewise.
202 * testsuite/Makefile.in: Regenerate.
203
e1663197
CC
2042015-03-09 Cary Coutant <ccoutant@google.com>
205
206 PR gold/14675
207 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
208 return enum indicating whether .eh_frame section is empty, optimizable,
209 unrecognized, or an end marker. Adjust explicit instantiations.
210 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
211 (Eh_frame::add_ehframe_input_section): Change return type.
212 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
213 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
214 to the .eh_frame output section until we see the end marker.
215 (Layout::finalize_eh_frame_section): New.
216 * layout.h: (Layout::finalize_eh_frame_section): New.
217
beb8418f
L
2182015-03-05 H.J. Lu <hongjiu.lu@intel.com>
219
220 * output.cc (Relobj::initialize_input_to_output_map<size>):
221 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
222
48c73428
CC
2232015-03-04 Cary Coutant <ccoutant@google.com>
224
225 * parameters.cc (Parameters::set_target_once): Call
226 Target::select_as_default_target just once from here...
227 (set_parameters_target): ...instead of from here.
228
2292015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
dbe40a88
RÁE
230
231 * ehframe.cc (Cie::set_output_offset): Pass in and use a
232 Output_section_data instead of a Merge_map.
233 (Eh_frame::Eh_frame): Don't initialize merge_map_.
234 (Eh_frame::read_cie): Use add_merge_mapping instead of
235 Merge_map::add_mapping.
236 (Eh_frame::read_fde): Ditto.
237 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
238 (Eh_frame::do_output_offset): Use merge_output_offset istead of
239 merge_map_->get_output_offset.
240 (Eh_frame::do_is_merge_section_for): Delete.
241 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
242 instead of a Merge_map.
243 (Cie::set_output_offset): Pass in a Output_section_data instead of a
244 Merge_map.
245 (Eh_frame::do_is_merge_section_for): Delete.
246 (Eh_frame::merge_map_): Delete.
247 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
248 and use a Output_section_data instead of a Merge_map.
249 (Object_merge_map::add_mapping): Ditto.
250 (Object_merge_map::get_output_offset): Remove the merge_map argument.
251 (Object_merge_map::is_merge_section_for): Pass in and use a
252 Output_section_data instead of a Merge_map.
253 (Merge_map): Delete.
254 (Output_merge_base::do_output_offset): Use merge_output_offset instead
255 of merge_map_.get_output_offset.
256 (Output_merge_base::do_is_merge_section_for): Delete.
257 (Output_merge_data::do_add_input_section): Use
258 object->add_merge_mapping instead of add_mapping.
259 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
260 * merge.h (Merge_map): Delete forward declaration.
261 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
262 instead of a Merge_map.
263 (Object_merge_map::get_output_offset): Remove the merge_map argument.
264 (Object_merge_map::is_merge_section_for): Pass in and use a
265 Output_section_data instead of a Merge_map.
266 (Input_merge_map::Object_merge_map::merge_map): Replace with
267 output_data.
268 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
269 Output_section_data instead of a Merge_map.
270 (Merge_map): Delete.
271 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
272 (Output_merge_base::do_is_merge_section_for): Delete.
273 (Output_merge_base::add_mapping): Delete.
274 (Output_merge_base::merge_map_): Delete.
275 * object.cc (Relobj::initialize_input_to_output_map): New.
276 (Relobj::initialize_input_to_output_map): New.
277 (Relobj::merge_output_offset): New.
278 (Relobj::is_merge_section_for): New.
279 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
280 bits.
281 * object.h (Relobj::merge_map): Delete.
282 (initialize_input_to_output_map): New.
283 (set_merge_map): Delete.
284 (add_merge_mapping): New.
285 (merge_output_offset): New.
286 (is_merge_section_for): New.
287 * output.cc (Output_section::Input_section::is_merge_section_for):
288 Use object->is_merge_section_for.
289 * output.h (Output_section_data::is_merge_section_for): Delete.
290 (Output_section_data::do_is_merge_section_for): Delete.
291 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
292 Use object->initialize_input_to_output_map.
293 (Merged_symbol_value<size>::value_from_output_section): Use
294 object->merge_output_offset.
295
48c73428 2962015-03-02 Peter Collingbourne <pcc@google.com>
2c7b626c
CC
297 Cary Coutant <ccoutant@google.com>
298
299 * output.cc (Output_section::add_merge_input_section): Do not
300 attempt to merge sections with an entsize of 0.
301
48c73428 3022015-03-02 Khem Raj <raj.khem@gmail.com>
5b07cd84
CC
303
304 * attributes.h (class Output_attributes_section_data ): Add
305 do_print_to_mapfile function.
306
ec86f434
AM
3072015-02-24 Alan Modra <amodra@gmail.com>
308
309 PR 18010
310 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
311 complain if value is not a multiple of four.
312 (Target_powerpc::Relocate::relocate): Correct handling of
313 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
314
be66981e
L
3152015-02-21 H.J. Lu <hongjiu.lu@intel.com>
316
317 * configure.ac (default_size): Set to 32 for x32.
318 * configure: Regenerated.
319
e3ee8ed4
AM
3202015-02-18 Alan Modra <amodra@gmail.com>
321
322 PR 17954
323 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
324 visibility.
325
3a935c6c
RÁE
3262015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
327
328 * gc.h (Garbage_collection::add_reference): Don't use find.
329
e0a1e121
RÁE
3302015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
331
332 * object.cc (write_local_symbols): avoid std::vector copy.
333
45a4fb1a
RÁE
3342015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
335
336 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
337
2d9afefe
MW
3382015-02-09 Mark Wielaard <mjw@redhat.com>
339
340 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
341 DW_LANG_Fortran03 and DW_LANG_Fortran08.
342
e9c1bdad
CC
3432015-02-16 Cary Coutant <ccoutant@google.com>
344
345 PR gold/13577
346 PR gold/16992
347 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
348 DF_SYMBOLIC if --dynamic-list option is used.
349 * options.cc (General_options::finalize): --dynamic-list is not
350 mutually exclusive with -Bsymbolic.
351 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
352 listed in --dynamic-list.
353 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
354 -Bsymbolic-functions.
355 * testsuite/Makefile.in: Regenerate.
356
0ed4b0bf
CC
3572015-02-16 Cary Coutant <ccoutant@google.com>
358
359 PR gold/17971
360 * incremental.cc: Remove redundant include of "output.h".
361
1a920511
JY
3622015-02-12 Jing Yu <jingyu@google.com>
363
364 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
365 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
366 New relocation.
367 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
368 TLSLE_MOVW_* relocations.
369 (Target_aarch64::Scan::global): Likewise.
370 (Target_aarch64::Relocate::relocate): Likewise.
371 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
372 for new TLSLE_MOVW_* relocations.
373
07f107f3
WN
3742015-02-11 Will Newton <will.newton@linaro.org>
375
376 PR gold/13321
377 * arm.cc (Target_arm::make_plt_section): Create an ARM
378 state mapping symbol at the start of the PLT.
379
e051a5b5
L
3802015-02-09 H.J. Lu <hongjiu.lu@intel.com>
381
382 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
383 Replace two_file_shared_2.so with two_file_shared_1.so.
384 * testsuite/Makefile.in: Regenerated.
385
dddcc5b9
AM
3862015-02-09 Alan Modra <amodra@gmail.com>
387
388 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
389 plugin_test_thin.a and defsym_test.
390 * testsuite/Makefile.in: Regenerate.
391
b39b8b9d
RÁE
3922015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
393
394 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
395 body.
396
b66d1c52
CC
3972015-02-04 Peter Collingbourne <pcc@google.com>
398
399 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
400 forwarding symbols when computing symbol resolution info for plugins.
401 * plugin.h (Plugin_manager::symtab): New method.
402 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
403
23081de0
CC
4042015-02-03 Cary Coutant <ccoutant@google.com>
405 Peter Collingbourne <pcc@google.com>
406
407 PR gold/15660
408 * archive.cc (Thin_archive_object_unlocker): New class.
409 (Archive::include_member): Unlock external members of thin archives.
410 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
411 (plugin_test_2): Likewise.
412 (plugin_test_3): Likewise.
413 (plugin_test_4): Likewise.
414 (plugin_test_5): Likewise.
415 (plugin_test_6): Likewise.
416 (plugin_test_7): Likewise.
417 (plugin_test_8): Likewise.
418 (plugin_test_9): Likewise.
419 (plugin_test_10): Likewise.
420 (plugin_test_11): New test case.
421 * testsuite/Makefile.in: Regenerate.
422 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
423 file to decide whether to claim file.
424 (all_symbols_read_hook): Likewise.
425 * testsuite/plugin_test_1.sh: Adjust expected output.
426 * testsuite/plugin_test_2.sh: Likewise.
427 * testsuite/plugin_test_3.sh: Likewise.
428 * testsuite/plugin_test_6.sh: Likewise.
429 * testsuite/plugin_test_tls.sh: Likewise.
430 * testsuite/plugin_test_11.sh: New testcase.
431
4322015-02-03 Cary Coutant <ccoutant@google.com>
433
434 * descriptors.cc (Descriptors::open): Set artificially-low limit for
435 file descriptors when debugging enabled. Add debug output.
436 (Descriptors::release): Add debug output.
437 (Descriptors::close_some_descriptor): Likewise.
438 (Descriptors::close_all): Likewise.
439 * fileread.cc (File_read::lock): Likewise.
440 (File_read::unlock): Likewise.
441
24dd5808
CC
4422015-02-02 Cary Coutant <ccoutant@google.com>
443
444 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
445 executable output file.
446
fa89cc82
HS
4472015-01-22 Han Shen <shenhan@google.com>
448
449 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
450 (Target_arm::do_plt_address_for_global): New method.
451 (Target_arm::do_plt_address_for_local): New method.
452 (Target_arm::rel_irelative_section): New method.
453 (Target_arm::make_data_plt): Add more parameters for plt ctor.
454 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
455 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
456 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
457 (Target_arm::Scan::check_non_pic): Add ifunc support.
458 (Target_arm::Scan::local): Add ifunc support.
459 (Target_arm::Scan::global): Add ifunc support.
460 (Target_arm::make_plt_section): New method.
461 (Target_arm::make_plt_entry): Change to call to make_plt_section.
462 (Target_arm::make_local_ifunc_plt_entry): New method.
463 (Target_arm::got_irelative_): New member.
464 (Target_arm::rel_irelative_): New member.
465 (Target_arm::got_section): Add creation for got_irelative_.
466 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
467 (Target_arm::Relocate::relocate): Properly set local ifunc address.
468 (Target_arm::do_dynsym_value): Properly set global ifunc address.
469 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
470 (Output_data_plt_arm::IRelative_data): New type.
471 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
472 (Output_data_plt_arm::add_entry): Add more parameters.
473 (Output_data_plt_arm::add_relocation): New method.
474 (Output_data_plt_arm::add_local_ifunc_entry): New method.
475 (Output_data_plt_arm::rel_irelative): New method.
476 (Output_data_plt_arm::entry_count): Modified.
477 (Output_data_plt_arm::address_for_global): New method.
478 (Output_data_plt_arm::address_for_local): New method.
23081de0 479gold/
fa89cc82
HS
480 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
481 (Output_data_plt_arm::insert_irelative_data): New method.
482 (Output_data_plt_arm::irelative_rel_): New member.
483 (Output_data_plt_arm::got_): New member.
484 (Output_data_plt_arm::got_irelative_): New member.
485 (Output_data_plt_arm::irelative_count_): New member.
486 (Output_data_plt_arm::IRelative_data_vec): New typedef.
487 (Output_data_plt_arm::irelative_data_vec_): New member.
488 (Output_data_plt_arm::do_write): Write out irelative entries.
489 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
490 more parameters to ctor.
491 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
492 more parameters to ctor.
493 * output.h (Output_data_reloc::add_local_relative): New method.
494 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
495
0f81d3f0
AM
4962015-01-29 Alan Modra <amodra@gmail.com>
497
498 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
499 and GOT_TLSGD to LE optimization.
500
65d92137
CC
5012015-01-28 Cary Coutant <ccoutant@google.com>
502
503 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
504 for undef TLS symbols.
505 (Target_x86_64::Relocate::relocate_tls): Likewise.
506 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
507
5485698a
CC
5082015-01-25 Cary Coutant <ccoutant@google.com>
509
510 * output.cc (Output_segment::set_section_addresses): Fix calculation
511 of size of relro segment.
512
b01a4b04
AM
5132015-01-22 Alan Modra <amodra@gmail.com>
514
515 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
516 condition for need of ifunc plt entry.
517 (Target_powerpc::Scan::global <got relocs>): Likewise.
518
3d0064a9
CC
5192015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
520
521 * mips.cc (reloc_high): Add r_sym.
522 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
523 reloc_high constructor.
524 (Mips_relocate_functions::relgot16_local): Likewise.
525 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
526 r_type to decide whether LO16 matches HI16.
527 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
528 rello16 and relgot16_local.
529
a5cd8f05
CC
5302015-01-09 Cary Coutant <ccoutant@google.com>
531
532 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
533 unless alignment is larger than page size.
534
4fc1b9d4
L
5352015-01-06 H.J. Lu <hongjiu.lu@intel.com>
536 Cary Coutant <ccoutant@google.com>
537
538 PR gold/17729
539 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
540 (DEFAULT_TARGET_X32): Set for x32.
541 * x86_64.cc (cmp_insn_32): New.
542 (lea_r10_insn_32): Likewise.
543 (lea_r11_insn_32): Likewise.
544 (cmp_insn_64): Likewise.
545 (lea_r10_insn_64): Likewise.
546 (lea_r11_insn_64): Likewise.
547 (Target_x86_64<size>::do_calls_non_split): Handle x32.
548 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
549 (check_DATA): Add split_x32 files.
550 (split_x32_[1234n].o): New targets.
551 (split_x32_[124]): New targets.
552 (split_x32_[1234r].stdout): New targets.
553 * testsuite/split_x32.sh: New file.
554 * testsuite/split_x32_1.s: Likewise.
555 * testsuite/split_x32_2.s: Likewise.
556 * testsuite/split_x32_3.s: Likewise.
557 * testsuite/split_x32_4.s: Likewise.
558 * testsuite/split_x32_n.s: Likewise.
559 * configure: Regenerated.
560 * testsuite/Makefile.in: Likewise.
561
e749cab8
L
5622015-01-06 H.J. Lu <hongjiu.lu@intel.com>
563
564 PR gold/17809
565 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
566 x32.
567
af759df0
AM
5682015-01-02 Alan Modra <amodra@gmail.com>
569
570 * version.cc (print_version): Just print current year.
571 * dwp.cc (print_version): Likewise.
572
b90efa5b
AM
5732015-01-01 Alan Modra <amodra@gmail.com>
574
575 Update year range in copyright notice of all files.
576
f12d1e8a
AM
5772014-12-25 Alan Modra <amodra@gmail.com>
578
579 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
580 new enums.
581 (Target_arm::merge_object_attributes, ): Likewise.
582
5c294fee
TG
5832014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
584
585 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
586 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
587 AEABI_VFP_args_vfp to check that.
588 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
589 value and replace hardcoded values by enum values.
590
e30880c2
CC
5912014-12-22 Cary Coutant <ccoutant@google.com>
592
593 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
594
bd040da1
L
5952014-12-20 H.J. Lu <hongjiu.lu@intel.com>
596
597 PR gold/14608
598 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
599 to "return i * i * 3;".
600
e02a4046
CC
6012014-12-16 Cary Coutant <ccoutant@google.com>
602
603 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
604 (Mapfile::print_output_data): Use current_data_size() to avoid
605 assert for sections requiring postprocessing; if address is not valid,
606 print 0.
607 (Mapfile::print_output_section): Use current_data_size(); print note
608 that addresses and sizes are before compression.
609
add6016b
L
6102014-12-14 H.J. Lu <hongjiu.lu@intel.com>
611
612 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
613 Cast current_group_size to unsigned long when reporting error.
614
0bf32ea9
JY
6152014-12-10 Jing Yu <jingyu@google.com>
616
617 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
618 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
619 Update error message.
620 (Target_aarch64::do_relax): Use absolute value of option
621 stub_group_size. Replace local variable with class member
622 stub_group_size_.
623
cbcb23fa
AM
6242014-12-04 Alan Modra <amodra@gmail.com>
625
626 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
627 addend of PLTREL24 reloc when not generating a plt stub. Make
628 max_branch_offset an "Address".
fbad6518 629 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
630 (Target_powerpc::Relocate::relocate): Likewise.
631
1611bc4a
AM
6322014-12-04 Alan Modra <amodra@gmail.com>
633
634 PR 17670
635 * symtab.cc (Symbol::set_undefined): Remove assertion.
636 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
637 on symbols defined in discarded sections, instead return false.
638 Rearrange params, update all callers.
639 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
640 branches to syms in discarded sections.
641 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
642 undefined and flag as discarded.
643 (Target_powerpc::Relocate::relocate): Localize variable.
644
4759c34e
L
6452014-12-03 H.J. Lu <hongjiu.lu@intel.com>
646
647 PR gold/17675
648 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
649 * testsuite/Makefile.in: Regenerated.
650
1f98a074
AM
6512014-12-03 Alan Modra <amodra@gmail.com>
652
653 PR 17566
654 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
655 when adding dynamic relocations against section symbols.
656
fb257835
DI
6572014-12-01 Dimitry Ivanov <dimitry@google.com>
658
659 * layout.cc (Layout::finish_dynamic_section): When '-z global'
660 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
661 * options.h (General_options): New -z option (global).
662
d8e60314
CC
6632014-12-01 Cary Coutant <ccoutant@google.com>
664
665 PR gold/17578
666 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
667 is given.
668 (Layout::create_executable_stack_info): Warn when -z noexecstack is
669 given but some inputs require executable stack.
670
982bbd97
CC
6712014-11-26 Cary Coutant <ccoutant@google.com>
672
673 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
674 .debug_str_offsets; strip .debug_gnu_pubnames and
675 .debug_gnu_pubtypes.
676 (lines_only_debug_sections): Strip all four new sections.
677
bb779192
HS
6782014-11-26 Jing Yu <jingyu@google.com>
679
680 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
681 register to be x0 when to relax TLSDESC_LD64_LO12.
682
a3e60ddb
AM
6832014-11-26 Alan Modra <amodra@gmail.com>
684
685 * powerpc.cc (struct Stub_table_owner): New.
686 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
687 unsigned int vector. Update all references.
688 (powerpc_relobj::set_stub_table): Take an unsigned int param
689 rather than a Stub_table. Update callers.
690 (Powerpc_relobj::clear_stub_table): New function.
691 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
692 stub_group_size_ vars.
693 (Target_powerpc::new_stub_table): Delete.
694 (max_branch_delta): New function, extracted from..
695 (Target_powerpc::Relocate::relocate): ..here..
696 (Target_powerpc::Branch_info::make_stub): ..and here. Return
697 status on whether stub created successfully.
698 (Stub_control::Stub_control): Add "no_size_errors" param. Move
699 default sizing to..
700 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
701 reduce on relax failure.
702 (Target_powerpc::group_sections): Add "no_size_errors" param.
703 Use stub_group_size_. Set up group info in a temp vector,
704 before building Stub_table vector. Account for input sections
705 possibly already converted to relaxed sections.
706 (Stub_table::init): Delete. Merge into..
707 (Stub_table::Stub_table): ..here.
708 (Stub_table::can_reach_stub): New function.
709 (Stub_table::add_plt_call_entry): Add "from" parameter and
710 return true iff stub could be reached.
711 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
712 param too.
713 (Stub_table::clear_stubs): Add "all" param.
714
a20605cf
AM
7152014-11-26 Alan Modra <amodra@gmail.com>
716
717 * powerpc.cc (Stub_control::set_output_and_owner): New function.
718 (Target_powerpc::group_sections): Use it.
719
43b64deb
CC
7202014-11-25 Cary Coutant <ccoutant@google.com>
721
722 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
723 (Binary_to_elf::write_symbol): Add st_size parameter.
724 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
725
c924eb67
CC
7262014-11-25 Cary Coutant <ccoutant@google.com>
727
728 PR gold/17639
729 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
730 (Sized_relobj_file::do_layout): Handle deferred sections properly
731 during GC pass 1. Don't add reloc sections to deferred list twice.
732 * object.h (Sized_relobj_file::is_deferred_layout): New function.
733 (Sized_relobj_file::is_deferred_layout_): New data member.
734
9d585188
L
7352014-11-21 H.J. Lu <hongjiu.lu@intel.com>
736
737 PR gold/17619
738 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
739 Check PC-relative offset overflow in PLT entry.
740
3ffaac20
AM
7412014-11-21 Alan Modra <amodra@gmail.com>
742
743 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
744 for undefined weaks.
745
0cfb0717
AM
7462014-11-20 Alan Modra <amodra@gmail.com>
747
748 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
749 from --stub-group-size parameter divided by 1024.
750 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
751 template parameter. Update all uses.
752 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
753 has_stub_value. Set for long branches. Don't report overflow for
754 branch to undefined weak symbols. Print info message on
755 overflowing branch to stub.
756
f9dffbf0
AM
7572014-11-20 Alan Modra <amodra@gmail.com>
758
759 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
760
e88ba8d5
L
7612014-11-13 H.J. Lu <hongjiu.lu@intel.com>
762
763 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
764 entry for R_X86_64_GOTPLT64.
765 (Target_x86_64<size>::Relocate::relocate): Update comments for
766 R_X86_64_GOTPLT64.
767
d37ffe25
ED
7682014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
769
770 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
771 * plugin.h: add lock definition
772
9726c3c1
HS
7732014-10-29 Han Shen <shenhan@google.com>
774 Jing Yu <jingyu@google.com>
775
776 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
777 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
778 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
779 Symbol::TLS_REF.
780 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
781 method.
782 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
783 (Target_aarch64::tls_ld_to_le): New method.
784 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
785 for 64bit targets.
786 (Output_data_plt_aarch64::irelative_rel_): New data member.
787 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
788 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
789 (Output_data_plt_aarch64::add_relocation): New method.
790 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
791 offset. Add got_irelative size to got size.
792 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
793 type string with the new typename.
794 (AArch64_relocate_functions::update_adr): Replace parameter x with
795 immed.
796 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
797 (AArch64_relocate_functions::reloc_common): New method.
798 (AArch64_relocate_funcsions::rela_general): Extract common part out
799 into reloc_common method.
800 (AArch64_relocate_functions::rela_general): Likewise.
801 (AArch64_relocate_functions::pcrela_general): Likewise.
802 (AArch64_relocate_functions::adr): New method.
803 (AArch64_relocate_functions::adrp): Calculate immed before calling
804 update_adr.
805 (AArch64_relocate_functions::adrp): Likewise.
806 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
807 comparing x to 0. Calculate immed from ~x when x < 0.
808 (Target_aarch64::optimize_tls_reloc): Add new cases for
809 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
810 TLSLD_MOVW_DTPREL_G0_NC.
811 (Target_aarch64::possible_function_pointer_reloc): Implement this
812 method.
813 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
814 comment.
815 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
816 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
817 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
818 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
819 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
820 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
821 (Target_aarch64::make_plt_entry): Call add_entry with two more
822 parameters.
823 (Target_aarch64::make_local_ifunc_plt_entry): New method.
824 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
825 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
826 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
827 (Target_aarch64::Relocate::relocate_tls): Add cases for
828 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
829 TLSLD_MOVW_DTPREL_G0_NC.
830 * testsuite/icf_safe_so_test.cc: Correct test comment.
831 * testsuite/icf_safe_test.sh: Add AArch64 arch.
832
80272b8c
AM
8332014-10-22 Alan Modra <amodra@gmail.com>
834
835 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
836 thread_starter.
837
998a69f4
AS
8382014-10-18 Andreas Schwab <schwab@linux-m68k.org>
839
840 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
841
aed56ec5
CC
8422014-10-17 Cary Coutant <ccoutant@google.com>
843
844 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
845 Add "typename" keyword.
846
bb779192 8472014-10-15 Han Shen <shenhan@google.com>
83a01957
HS
848 Jing Yu <jingyu@google.com>
849
850 Patch for gold aarch64 backend to support relaxation.
851 * aarch64-reloc.def: Change format.
852 * aarch64.cc (class Reloc_stub): New class.
853 (class Stub_table): New class.
854 (class AArch64_relobj): New class.
855 (class AArch64_input_section): New class.
856 (class AArch64_output_section): New class.
857 (Target_aarch64::new_stub_table): New method.
858 (Target_aarch64::new_aarch64_input_section): New method.
859 (Target_aarch64::find_aarch64_input_section): New method.
860 (Target_aarch64::scan_section_for_stubs): New method.
861 (Target_aarch64::scan_reloc_section_for_stubs): New method.
862 (Target_aarch64::relocate_stub): New method.
863 (Target_aarch64::current_target): New method.
864 (Target_aarch64::do_make_elf_object): New method.
865 (Target_aarch64::do_may_relax): New method.
866 (Target_aarch64::do_relax): New method.
867 (Target_aarch64::group_sections): New method.
868 (Target_aarch64::scan_reloc_for_stub): New method.
869 (Target_aarch64::do_make_output_section): New method.
870 (Target_aarch64::stub_tables_): New data member.
871 (Target_aarch64::aarch64_input_section_map_): New data member.
872 (AArch64_relocate_functions::maybe_apply_stub): New method.
873
db4c9594
CC
8742014-09-30 Cary Coutant <ccoutant@google.com>
875
876 PR gold/17432
877 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
878
cd6da036
KC
8792014-09-30 Kito Cheng <kito@0xlab.org>
880
881 PR gold/13597
882 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
883 hash table before sysv-style hash table.
884
5f772412
ST
8852014-09-29 Sriraman Tallam <tmsriram@google.com>
886
887 * options.h (--pic-executable): Add negative to alias to -no-pie.
888
5efeedf6
CC
8892014-09-26 Cary Coutant <ccoutant@google.com>
890
891 PR gold/16773
892 * object.cc (Sized_relobj_file): Compute value of section symbols
893 for TLS sections the same as TLS symbols.
894
1707f183
CC
8952014-09-25 Cary Coutant <ccoutant@google.com>
896
897 PR gold/17432
898 * resolve.cc (Symbol_table::resolve): Override common placeholder
899 symbols, but adjust sizes.
900 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
901 symbols to common lists.
902
00cac886
AM
9032014-09-24 Alan Modra <amodra@gmail.com>
904
905 * po/POTFILES.in: Regenerate.
906
635aa30e
CC
9072014-09-23 Taiju Tsuiki <tzik@google.com>
908 Cary Coutant <ccoutant@google.com>
909
71b9b91b 910 PR gold/14860
635aa30e
CC
911 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
912 on input_sections_blocker.
913 * layout.cc (Write_sections_task::locks): Unblock
914 input_sections_blocker_.
915 * layout.h (Write_sections_task::Write_sections_task): Add
916 input_sections_blocker.
917 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
918 to DEPENDENCIES.
919 * testsuite/Makefile.in: Regenerate.
920
c0c71592
RÁE
9212014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
922
923 * testsuite/Makefile.am (plugin_test_10): New test.
924 * testsuite/Makefile.in: Regenerate
925 * testsuite/plugin_common_test_2.c (c1): Align to 8.
926 * testsuite/plugin_test_10.sh: New file.
927
6168c2a1
RÁE
9282014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
929
930 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
931 * resolve.cc (Symbol_table::resolve): Don't override common symbols
932 during the replacement phase.
933
3a531937
JY
9342014-09-17 Han Shen <shenhan@google.com>
935 Jing Yu <jingyu@google.com>
936
937 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
938 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
939 * aarch64.cc (Target_aarch64): Add data members
940 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
941 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
942 constructor.
943 (Target_aarch64::do_reloc_symbol_index): New method.
944 (Target_aarch64::do_reloc_addend): New method.
945 (Target_aarch64::add_tlsdesc_info): New method.
946 (Target_aarch64::do_dynsym_value): New method.
947 (Target_aarch64::do_make_data_plt): Add new parameters: got,
948 got_irelative. Pass them to Output_data_plt_aarch64_standard.
949 (Target_aarch64::make_data_plt): Add new parameters: got,
950 got_irelative. Pass them to do_make_data_plt.
951 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
952 (Target_aarch64::Relocate:tls_gd_to_le): New method.
953 (Target_aarch64::Relocate:tls_ie_to_le): New method.
954 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
955 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
956 (Target_aarch64::got_tlsdesc_section): New method.
957 (Target_aarch64::make_local_ifunc_plt_entry): New method.
958 (Target_aarch64::define_tls_base_symbol): New method.
959 (Target_aarch64::reserve_tlsdesc_entries): New method.
960 (Target_aarch64::got_mod_index_entry): New method.
961 (Target_aarch64::rela_tlsdesc_section): New method.
962 (Target_aarch64::rela_irelative_section): New method.
963 (Target_aarch64::Tlsdesc_info): New struct.
964 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
965 relocations and tlsdesc relocations.
966 (Target_aarch64::optimize_tls_reloc): Implement method.
967 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
968 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
969 in constructor.
970 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
971 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
972 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
973 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
974 (Output_data_plt_aarch64::rela_tlsdesc): New method.
975 (Output_data_plt_aarch64::rela_irelative): New method.
976 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
977 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
978 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
979 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
980 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
981 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
982 (Output_data_plt_aarch64_standard): New member variables:
983 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
984 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
985 New parameter: got, got_irelative.
986 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
987 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
988 (Output_data_plt_aarch64::do_write): Replace got_address with
989 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
990 (AArch64_relocate_functions::update_movnz): New method.
991 (AArch64_relocate_functions): Correct format.
992 (AArch64_relocate_functions::movnz): New method.
993 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
994 before the switch. Add new cases to switch.
00cac886 995 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
996 tlsgd tlsdesc cases.
997 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
998 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
999 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
1000 Call reloc_name_in_error_message to print unsupported reloc.
1001 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
1002 make_data_plt.
1003 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
1004 relocs. Fill in some more dynamic tags.
1005 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
1006 Skip call tls_get_addr when tlsgd is relaxed.
1007 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
1008 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
1009 tlsdesc->ie relaxation.
1010
62661c93
SS
10112014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1012
1013 * mips.cc (Target_mips_nacl): New class.
1014 (Target_selector_mips_nacl): New class.
1015 (target_selector_mips32): Rename from target_selector_mips32be and use
1016 Target_selector_mips_nacl instead of Target_selector_mips.
1017 (target_selector_mips32el): Rename from target_selector_mips32 and use
1018 Target_selector_mips_nacl instead of Target_selector_mips.
1019 (target_selector_mips64): Rename from target_selector_mips64be and use
1020 Target_selector_mips_nacl instead of Target_selector_mips.
1021 (target_selector_mips64el): Rename from target_selector_mips64 and use
1022 Target_selector_mips_nacl instead of Target_selector_mips.
1023 (Target_mips::mips_info): Add const attribute.
1024
54674d38
CC
10252014-09-02 Cary Coutant <ccoutant@google.com>
1026
1027 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
1028 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
1029 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
1030 (Sized_incr_dynobj::do_section_name): Likewise.
1031 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
1032 (Sized_incr_dynobj::do_section_name): Likewise.
1033 * object.h (Object::section_name): Likewise.
1034 (Object::do_section_name): Likewise.
1035 (Sized_relobj_file::do_section_name): Likewise.
1036 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
1037 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
1038
9860cbcf
CC
10392014-09-02 Cary Coutant <ccoutant@google.com>
1040
1041 PR gold/17005
1042 * ehframe.cc (Fde::write): Add output_offset parameter.
1043 (Cie::write): Likewise.
1044 (Eh_frame::set_final_data_size): Account for offset within output
1045 section.
1046 (Eh_frame::do_sized_write): Likewise.
1047 * ehframe.h (Fde::write): Add output_offset parameter.
1048 (Cie::write): Likewise.
1049 * output.cc (Output_section::Input_section_sort_entry): Remove
1050 section_has_name_; add output_section_name parameter. Use
1051 output section name for non-input sections.
1052 (Output_section::Input_section_sort_entry::section_has_name): Remove.
1053 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
1054 (Output_section::Input_section_sort_compare): Remove logic for
1055 sections without names.
1056 (Output_section::Input_section_sort_init_fini_compare): Likewise.
1057 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
1058 Likewise.
1059 (Output_section::Input_section_sort_section_name_compare): Likewise.
1060
8e33481e
HS
10612014-08-29 Han Shen <shenhan@google.com>
1062 Jing Yu <jingyu@google.com>
1063
1064 * aarch64-reloc-property.cc
1065 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
1066 reference reloc property in the table.
1067 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
1068 3 other entries.
1069 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
1070 2 new overloaded methods.
1071 (Output_data_got_aarch64::do_write): Add code to write out
1072 static relocs.
1073 (class Output_data_got_aarch64::Static_reloc): New class to wrap
1074 static relocs.
1075 (Output_data_got_aarch64::static_relocs): New vector to
1076 hold static relocs.
1077 (Target_aarch64::TCB_SIZE): New const static memeber.
1078 (Target_aarch64::tcb_size): New method.
1079 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
1080 (Target_aarch64::Relocate::relocate_tls): New method.
1081 (Target_aarch64::Scan::local): Add code handling new reloc types.
1082 (Target_aarch64::Scan::global): Add code handling new reloc types.
1083
81233653
ST
10842014-08-13 Sriraman Tallam <tmsriram@google.com>
1085
1086 * options.h (-no-pie): Add option.
1087
9363c7c3
JY
10882014-08-08 Jing Yu <jingyu@google.com>
1089 Han Shen <shenhan@google.com>
1090
1091 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
1092 (DEFFILES): add aarch64-reloc.def.
1093 (TARGETSOURCES): Add aarch64-reloc-property.cc.
1094 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
1095 * Makefile.in: Regenerate.
1096 * aarch64-reloc-property.cc: New file.
1097 * aarch64-reloc-property.h: New file.
1098 * aarch64-reloc.def: New file.
1099 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
1100 with tab to make the format consistent.
1101 (Output_data_got_aarch64::symbol_table_): New method.
1102 (Target_aarch64::do_plt_address_for_global): New method.
1103 (Target_aarch64::do_plt_address_for_local): New method.
1104 (Target_aarch64::do_select_as_default_target): New method.
1105 (Target_aarch64::do_make_data_plt): New method.
1106 (Target_aarch64::make_data_plt): New method.
1107 (Output_data_plt_aarch64::has_irelative_section): New method.
1108 (Output_data_plt_aarch64::address_for_global): New method.
1109 (Output_data_plt_aarch64::address_for_local): New method.
1110 (Output_data_plt_aarch64::irelative_rel_): New parameter.
1111 (Output_data_plt_aarch64::add_entry): Implement contents.
1112 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
1113 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
1114 the got_pov entry to plt0.
1115 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
1116 Implement contents.
1117 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
1118 (AArch64_howto): New struct.
1119 (aarch64_howto[]): New static const array.
1120 (AArch64_relocate_functions): New class.
1121 (Target_aarch64::Scan::get_reference_flags): Remove method.
1122 (Target_aarch64::Scan::local): Implement to support a few relocations.
1123 (Target_aarch64::Scan::global): Implement to support a few relocations.
1124 (Target_aarch64::make_plt_section): Implement contents.
1125 (Target_aarch64::make_plt_entry): Implement contents.
1126 (Target_aarch64::do_finalize_sections): Implement contents.
1127 (Target_aarch64::Relocate::relocate): Implement a few relocations.
1128 (Target_aarch64::relocate_section): Implement contents.
1129
ad9fe6c1
AM
11302014-08-06 Alan Modra <amodra@gmail.com>
1131
1132 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
1133
7cd4e5b7
AM
11342014-08-06 Alan Modra <amodra@gmail.com>
1135
1136 PR 13227
1137 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
1138
5ad9b0a7
ST
11392014-07-21 Sriraman Tallam <tmsriram@google.com>
1140
1141 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 1142 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 1143
e051745c
CC
11442014-07-08 Cary Coutant <ccoutant@google.com>
1145
1146 * expression.cc (struct Expression::Expression_eval_info): Add
1147 new fields type_pointer, vis_pointer, and nonvis_pointer.
1148 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
1149 nonvis_pointer parameters. Adjust all calls.
1150 (Symbol_expression::value): Update type, visibility, and nonvis bits
1151 in caller.
1152 * script.cc (Symbol_assignment::sized_finalize): Update type,
1153 visibility, and remaining st_other bits for new symbol.
1154 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
1155 vis_pointer, and nonvis_pointer parameters.
1156 * symtab.h (Symbol::set_type): New method.
1157
1158 * testsuite/Makefile.am (defsym_test): New test.
1159 * testsuite/Makefile.in: Regenerate.
1160 * testsuite/defsym_test.c: New file.
1161 * testsuite/defsym_test.sh: New file.
1162
f35c4853
CC
11632014-07-08 Cary Coutant <ccoutant@google.com>
1164
1165 PR gold/15639
1166 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
1167 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
1168 (Sized_dynobj::base_read_symbols): ...new method.
1169 * object.h (Sized_relobj_file::base_read_symbols): New method.
1170 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
1171 (Sized_relobj_file::base_read_symbols): ...new method.
1172 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
1173 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
1174 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
1175
2900af2d
AM
11762014-07-04 Alan Modra <amodra@gmail.com>
1177
1178 * po/POTFILES.in: Regenerate.
1179
053a4d68
JY
11802014-07-02 Jing Yu <jingyu@google.com>
1181
1182 * aarch64.cc: New file
1183 * Makefile.am (TARGETSOURCES): Add aarch64.cc
1184 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
1185 * Makefile.in: Regenerate.
1186 * configure.tgt: Add entries for aarch64*.
1187 * configure.ac: Likewise.
1188 * configure: Likewise.
1189
7b549045
AM
11902014-06-27 Alan Modra <amodra@gmail.com>
1191
1192 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
1193
cb818dbf
CC
11942014-06-24 Cary Coutant <ccoutant@google.com>
1195
1196 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
1197 sections.
1198 (Dwo_file::sized_read_unit_index): Likewise.
1199
9810d34d
SS
12002014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1201
1202 * mips.cc: New file.
1203 * Makefile.am (TARGETSOURCES): Add mips.cc
1204 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
1205 * configure.tgt: Add entries for mips*.
1206 * configure.ac: Likewise.
1207 * Makefile.in: Regenerate.
1208 * configure: Likewise.
1209
9baa787b
CC
12102014-06-09 Cary Coutant <ccoutant@google.com>
1211
1212 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
1213 unit_length is within section bounds.
1214
8f89af0a
CC
12152014-06-09 Cary Coutant <ccoutant@google.com>
1216
1217 PR gold/16980
1218 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
1219 map.
1220
a47622ac
AM
12212014-06-07 Alan Modra <amodra@gmail.com>
1222
1223 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
1224
4320c691
CC
12252014-06-06 Cary Coutant <ccoutant@google.com>
1226
1227 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
1228 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
1229 (Dwarf_pubnames_table::read_header): Likewise.
1230 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
1231 .debug_gnu_pubtypes.
1232
270c9937
JB
12332014-06-05 Joel Brobecker <brobecker@adacore.com>
1234
1235 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
1236 * Makefile.in, configure: Regenerate.
1237
397998fc
AM
12382014-06-03 Alan Modra <amodra@gmail.com>
1239
1240 * powerpc.cc (addis_12_2): Define.
1241 (Stub_table::do_write): Support fusion on ELFv2 stubs.
1242
61f5c66f
AM
12432014-06-03 Alan Modra <amodra@gmail.com>
1244
1245 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
1246 st_other output.
1247
f6971787
AM
12482014-06-02 Alan Modra <amodra@gmail.com>
1249
1250 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
1251 Only ignore relocs on ELFv1.
1252 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
1253
f6fb8322
CC
12542014-05-30 Cary Coutant <ccoutant@google.com>
1255
1256 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
1257 * testsuite/Makefile.in: Regenerate.
1258 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
1259
c23dd342
L
12602014-05-27 H.J. Lu <hongjiu.lu@intel.com>
1261
1262 PR gold/16945
1263 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
1264 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
1265
5fe7ffdc
AM
12662014-05-15 Alan Modra <amodra@gmail.com>
1267
1268 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
1269 Compare FDE contents with DW_CFA_nop rather than 0.
1270
a82bef93
ST
12712014-05-13 Sriraman Tallam <tmsriram@google.com>
1272
1273 * symtab.h (may_need_copy_reloc): Remove check for position independent
1274 code.
1275 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
1276 position independence before pc absolute may_need_copy_reloc call.
1277 Add check for executable output befor pc relative may_need_copy_reloc
1278 call.
1279 * i386.cc: Ditto.
1280 * arm.cc: Ditto.
1281 * sparc.cc: Ditto.
1282 * tilegx.cc: Ditto.
1283 * powerpc.cc: Add check for no position independence before
1284 may_need_copy_reloc calls.
1285 * testsuite/pie_copyrelocs_test.cc: New file.
1286 * testsuite/pie_copyrelocs_shared_test.cc: New file.
1287 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 1288 * Makefile.in: Regenerate.
a82bef93 1289
53c66605
ML
12902014-05-08 Martin Liška <mliska@suse.cz>
1291
1292 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
1293
57b2284c
CC
12942014-05-06 Cary Coutant <ccoutant@google.com>
1295
1296 PR gold/16900
1297 * i386.cc (Output_data_got_plt_i386): New class.
1298 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
1299 parameter. Change all callers.
1300 (Output_data_plt_i386::layout_): Remove.
1301 (Output_data_plt_i386::got_plt_): Change type.
1302 (Target_i386::got_plt_): Change type. Change all references.
1303 (Target_i386::got_section): Create instance of new class.
1304 (Output_data_got_plt_i386::do_write): New function.
1305 * x86_64.cc (Output_data_got_plt_x86_64): New class.
1306 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
1307 parameter. Change all callers.
1308 (Output_data_plt_x86_64::layout_): Remove.
1309 (Output_data_plt_x86_64::got_plt_): Change type.
1310 (Target_x86_64::got_plt_): Change type. Change all references.
1311 (Target_x86_64::got_section): Create instance of new class.
1312 (Output_data_got_plt_x86_64::do_write): New function.
1313 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
1314 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
1315 class.
1316
6b97515d 13172014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 1318
6b97515d
CC
1319 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
1320 if we have pubnames/pubtypes.
1321
d1bddd3c
CC
13222014-05-02 Cary Coutant <ccoutant@google.com>
1323
5fe7ffdc
AM
1324 * defstd.cc (in_segment): Define __ehdr_start here...
1325 * layout.cc (Layout::finalize): ...Instead of here. Set the
1326 output segment when known.
1327 * resolve.cc (Symbol::override_base_with_special): Remember
1328 the original binding.
1329 * symtab.cc (Symbol::set_output_segment): New function.
1330 (Symbol::set_undefined): New function.
1331 * symtab.h (Symbol::is_weak_undefined): Check original undef
1332 binding.
1333 (Symbol::is_strong_undefined): New function.
1334 (Symbol::set_output_segment): New function.
1335 (Symbol::set_undefined): New function.
1336 * target-reloc.h (is_strong_undefined): Remove.
1337 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
1338 Check for hidden undefs.
1339 (relocate_section): Call Symbol::is_strong_undefined.
1340
1341 * testsuite/Makefile.am (ehdr_start_test_1)
1342 (ehdr_start_test_2, ehdr_start_test_3)
1343 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
1344 * testsuite/Makefile.in: Regenerate.
1345 * testsuite/ehdr_start_def.cc: New source file.
1346 * testsuite/ehdr_start_test.cc: New source file.
1347 * testsuite/ehdr_start_test.t: New linker script.
1348 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 1349
7849f6d8
CC
13502014-04-23 Cary Coutant <ccoutant@google.com>
1351
bf2cc635 1352 PR gold/16870
7849f6d8
CC
1353 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
1354
99fd8cff
CC
13552014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1356
1357 * layout.cc (Layout::include_section): Allow a target to decide
1358 whether to include a section.
1359 * target.h (Target::should_include_section): New function.
1360 (Target::do_should_include_section): New function.
1361
91f43acd
CC
13622014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1363
1364 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
1365 inline into ...
1366 (Copy_relocs::emit): ... here.
1367 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
1368 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
1369 (Copy_reloc_entry::entries_): Change from private to protected.
1370
c4eb27e1
ST
13712014-04-02 Sriraman Tallam <tmsriram@google.com>
1372
1373 * icf.cc (get_section_contents): Replace copies of reloc
1374 vectors with const references.
1375
ae447ddd
CC
13762014-04-02 Cary Coutant <ccoutant@google.com>
1377
1378 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
1379 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
1380 * configure: Regenerate.
1381 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
1382 -fno-use-linker-plugin.
1383 (LINK1, CXXLINK1): Add it to the link command.
1384 * testsuite/Makefile.in: Regenerate.
1385
fa47fa92
AM
13862014-03-12 Alan Modra <amodra@gmail.com>
1387
1388 * Makefile.in: Regenerate.
1389
9b12c500
CC
13902014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1391
1392 * symtab.h (Symbol::set_nonvis): New function.
1393
beacaa96
CC
13942014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1395
1396 * symtab.cc (Sized_symbol<32>::init_output_data):
1397 Instantiate the template.
1398 (Sized_symbol<64>::init_output_data): Likewise.
1399
800d9823
CC
14002014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1401
1402 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
1403 adjust dynamic symbol value.
1404 * target.h (Target::adjust_dyn_symbol): New function.
1405 (Target::do_adjust_dyn_symbol): New function.
1406
918fc1f8 14072014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 1408
918fc1f8
CC
1409 * output.cc (Output_data_dynamic::Dynamic_entry::write):
1410 Get the value of DYNAMIC_CUSTOM dynamic entry.
1411 * output.h (Output_data_dynamic::add_custom): New function.
1412 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
1413 dynamic entry.
1414 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
1415 * target.h (Target::dynamic_tag_custom_value): New function.
1416 (Target::do_dynamic_tag_custom_value): New function.
1417
98ff9231
CC
14182014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1419
1420 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
1421 dynsym indexes.
1422 * target.h (Target::has_custom_set_dynsym_indexes): New function.
1423 (Target::do_has_custom_set_dynsym_indexes): New function.
1424 (Target::set_dynsym_indexes): New function.
1425 (Target::do_set_dynsym_indexes): New function.
1426
b80eed39
AM
14272014-03-07 Alan Modra <amodra@gmail.com>
1428
1429 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
1430 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
1431 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
1432 (Powerpc_relocate_functions::has_overflow_bitfield,
1433 overflowed): Use the above.
1434 (Target_powerpc::Relocate::relocate): Correct overflow checking
1435 for a number of relocations. Modify overflow test for 16-bit
1436 fields in instructions to signed/unsigned according to whether
1437 the field takes a signed or unsigned value.
1438
4b95cf5c
AM
14392014-03-05 Alan Modra <amodra@gmail.com>
1440
1441 Update copyright years.
1442
45965137
AM
14432014-03-05 Alan Modra <amodra@gmail.com>
1444
1445 * powerpc.cc (Target_powerpc::Scan::local, global): Support
1446 R_PPC64_ADDR64_LOCAL.
1447 (Target_powerpc::Relocate::relocate): Likewise.
1448
2c80b753
AM
14492014-03-03 Alan Modra <amodra@gmail.com>
1450
1451 * dwp.cc (print_version): Update copyright year to current.
1452
c1c69e83
AM
14532014-02-10 Alan Modra <amodra@gmail.com>
1454
1455 * po/gold.pot: Regenerate.
1456
dd0c4e70
CC
14572014-02-06 Cary Coutant <ccoutant@google.com>
1458
1459 Fix problem where -u is ignored when a weak undef is seen.
1460
1461 * archive.cc (Library_base::should_include_member): Reorder
1462 code to check for -u option if a weak undef has already been seen.
1463 * testsuite/Makefile.am (weak_undef_test_2): New test case.
1464 * testsuite/Makefile.in: Regenerate.
1465 * testsuite/weak_undef_file3.cc: New file.
1466 * testsuite/weak_undef_file4.cc: New file.
1467 * testsuite/weak_undef_test_2.cc: New file.
1468
1a221d3d
CC
14692014-02-05 Cary Coutant <ccoutant@google.com>
1470
1471 Fix issues with gold undefined symbol diagnostics.
1472
1473 PR binutils/15435
1474 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
1475 check to here.
1476 * target-reloc.h (is_strong_undefined): New function.
1477 (relocate_section): Move undef vtable symbol check from here.
1478 Check for is_strong_undefined.
1479
e889f0a4 14802014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 1481
e889f0a4
CC
1482 Fix problems with the --dynamic-list option.
1483
1484 PR gold/13577
1485 * options.cc (General_options::parse_dynamic_list):
1486 Set have_dynamic_list_.
1487 (General_options::General_options): Initialize have_dynamic_list_.
1488 (General_options::finalize): Turn off -Bsymbolic and
1489 -Bsymbolic-functions if --dynamic-list provided.
1490 * options.h (General_options::have_dynamic_list): New function.
1491 (General_options::have_dynamic_list_): New data member.
1492 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
1493 correctly.
5fe7ffdc 1494
e889f0a4
CC
1495 PR gold/16530
1496 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
1497 in --dynamic-list, mark it.
5fe7ffdc 1498
e889f0a4
CC
1499 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
1500 (dynamic_list_2): New test case.
1501 * testsuite/Makefile.in: Regenerate.
1502 * testsuite/dynamic_list_2.cc: New file.
1503 * testsuite/dynamic_list_2.t: New file.
1504 * testsuite/dynamic_list_lib1.cc: New file.
1505 * testsuite/dynamic_list_lib2.cc: New file.
1506 * testsuite/gc_dynamic_list_test.c: New file.
1507 * testsuite/gc_dynamic_list_test.sh: New file.
1508 * testsuite/gc_dynamic_list_test.t: New file.
1509
ec673e64
CC
15102014-01-28 Cary Coutant <ccoutant@google.com>
1511
1512 Add .gdb_index version 7 support.
1513
1514 * gold/dwarf_reader.cc: include <utility> (for make_pair).
1515 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
1516 debug sections.
1517 (Dwarf_ranges_table::read_ranges_table): Likewise.
1518 (Dwarf_pubnames_table::read_section): Check for GNU-style
1519 sections, and for compressed debug sections.
1520 (Dwarf_pubnames_table::read_header): Compute end address of table.
1521 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
1522 for end of list by offset, not by offset == 0.
1523 (Dwarf_info_reader::do_read_string_table): Check for compressed
1524 debug sections.
1525 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1526 Initialize new data members.
1527 (Dwarf_pubnames_table::next_name): return flag_byte.
1528 (Dwarf_pubnames_table::end_of_table_): New data member.
1529 (Dwarf_pubnames_table::is_gnu_style_): New data member.
1530 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
1531 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
1532 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
1533 read skeleton type unit DIEs.
1534 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
1535 (Gdb_index::do_write): Write flag_byte.
1536 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
1537 (Gdb_index::Cu_vector): Store flags along with cu indexes.
1538 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
1539 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
1540
221fd5d5
L
15412014-01-08 H.J. Lu <hongjiu.lu@intel.com>
1542
1543 * version.cc (print_version): Update copyright year to 2014.
1544
6c09fb0b
ILT
15452013-12-19 Dimitry Andric <dimitry@andric.com>
1546
1547 * stringpool.cc (Stringpool_template::reserve): Add
1548 HAVE_UNORDERED_MAP case.
1549 * stringpool.cc (Stringpool_template::print_stats): Likewise.
1550
8356f2d0
CC
15512013-12-18 Cary Coutant <ccoutant@google.com>
1552
1553 * configure.ac: Check for <unordered_set> and <unordered_map>.
1554 * config.in: Regenerate.
1555 * configure: Regenerate.
1556 * system.h: Use <unordered_set> and <unordered_map> if available.
1557
f2c7d7ee
RM
15582013-12-10 Roland McGrath <mcgrathr@google.com>
1559
1560 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
1561 with $(INSTALL_PROGRAM_ENV).
1562 * Makefile.in: Regenerate.
1563
6632e8cc
CC
15642013-11-22 Cary Coutant <ccoutant@google.com>
1565
1566 * configure.ac: Add check for which library is needed for
1567 dlopen.
1568 * configure: Regenerate.
1569
0c075858
CC
15702013-11-22 Cary Coutant <ccoutant@google.com>
1571
1572 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
1573 assembler.
1574 * testsuite/Makefile.in: Regenerate.
1575
f49fe902
L
15762013-11-17 H.J. Lu <hongjiu.lu@intel.com>
1577
1578 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
1579 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
1580 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
1581 (Target_x86_64<size>::Scan::local): Likewise.
1582 (Target_x86_64<size>::Scan::global): Likewise.
1583 (Target_x86_64<size>::Relocate::relocate): Likewise.
1584 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
1585 Likewise.
1586 (Target_x86_64<size>::Scan::check_non_pic(): Handle
1587 R_X86_64_PC32_BND.
1588
1589 * testsuite/Makefile.am (check_PROGRAMS): Add
1590 exception_x86_64_bnd_test.
1591 (exception_x86_64_bnd_test_SOURCES): New macro.
1592 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
1593 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
1594 (exception_x86_64_bnd_test_LDADD): Likewise.
1595 (exception_x86_64_bnd_1.o): New rule.
1596 (exception_x86_64_bnd_2.o): Likewise.
1597 * testsuite/Makefile.in: Regenerated.
1598
9055360d
AM
15992013-11-15 Alan Modra <amodra@gmail.com>
1600
1601 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
1602 accessor.
1603 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
1604 Only call ppc64_local_entry_offset for 64-bit. Restrict
1605 symval_for_branch lookup to ELFv1.
1606 (Stub_table::add_plt_call_entry): Use unsigned int off.
1607 (Output_data_glink::Address, invalid_address): New.
1608 (Output_data_glink::add_eh_frame): Move out of line. Add
1609 support for ELFv2.
1610 (Output_data_glink::add_global_entry, find_global_entry,
1611 global_entry_address): New functions.
1612 (Output_data_glink::global_entry_stubs_, end_branch_table_,
1613 ge_size): New variables.
1614 (Output_data_glink::set_final_data_size): Add global entry
1615 stub sizing.
1616 (Output_data_glink::do_write): Write global entry stubs.
1617 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
1618 parameter. Return true for ELFv2. Adjust callers.
1619 (Target_powerpc::Scan::local, global): Restrict opd lookup to
1620 ELFv1. Similarly for ifunc and dynamic relocation processing
1621 specific to ELFv1. Recognize that symbols are defined on
1622 their plt entries for ELFv2.
1623 (Target_powerpc::symval_for_branch): Assert if called for
1624 ELFv2 or ppc32.
1625 (Target_powerpc::Relocate::relocate): Use global entry plt
1626 stub for symbol value if such exists on ELFv2.
1627 (Target_powerpc::Relocate::relocate): Don't call
1628 symval_for_branch when ELFv2. Do adjust for local entry
1629 offset when ELFv2.
1630 (Target_powerpc::do_dynsym_value): Set symbols to global entry
1631 plt stub for ELFv2.
1632 (Target_powerpc::do_plt_address_for_global): Similarly.
1633
cafdd569
CC
16342013-11-14 Cary Coutant <ccoutant@google.com>
1635
1636 Revert patch -- this did not fix the problem, and there is
1637 no race there.
1638
1639 2013-11-14 Cary Coutant <ccoutant@google.com>
1640
1641 PR gold/14860
1642 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1643 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1644 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1645 updating fde_offsets_.
1646 (Eh_frame_hdr::lock_): New data member.
1647
94e49e16
CC
16482013-11-14 Cary Coutant <ccoutant@google.com>
1649
1650 * dwp.cc (Dwo_file_entry): New type.
1651 (File_list): Use Dwo_file_entry.
1652 (Dwo_file::verify): New function.
1653 (Dwo_file::verify_dwo_list): New function.
1654 (Dwo_file::sized_verify_dwo_list): New function.
1655 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
1656 list.
1657 (Dwp_options): New enum type.
1658 (dwp_options): Add --verify-only.
1659 (usage): Likewise.
1660 (main): Likewise.
1661 * dwp.h (gold_info): Add declaration.
1662
7cdd7d57
CC
16632013-11-14 Cary Coutant <ccoutant@google.com>
1664
1665 PR gold/14860
1666 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1667 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1668 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1669 updating fde_offsets_.
1670 (Eh_frame_hdr::lock_): New data member.
1671
1d946cb3
CC
16722013-11-06 Cary Coutant <ccoutant@google.com>
1673
1674 PR gold/15758
1675 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
1676 before reloc sections.
1677
4f65b40e
AM
16782013-11-04 Alan Modra <amodra@gmail.com>
1679
1680 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
1681 (Symbol::needs_dynamic_reloc): Test new flag.
1682 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
1683 (Target_powerpc::Scan::get_reference_flags): Add target param.
1684 Return FUNC_DESC_ABI for 64-bit ELFv1.
1685 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
1686 call.
1687 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
1688 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
1689
908794a9
CC
16902013-10-31 Cary Coutant <ccoutant@google.com>
1691
1692 Restore support for dwp v2 DWARF package file format.
1693
1694 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1695 tu_length parameter. Adjust all callers.
1696 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1697 * dwp.cc: Include dwarf.h.
1698 (Section_bounds): New struct type.
1699 (Unit_set): New struct type.
1700 (Dwo_file::Dwo_file): Initialize new data member.
1701 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1702 Combine and rename to...
1703 (Dwo_file::read_unit_index): ...this.
1704 (Dwo_file::sized_read_compunit_index)
1705 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1706 (Dwo_file::sized_read_unit_index): ...this.
1707 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1708 parameters; add section_id parameter.
1709 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1710 (Dwo_file::add_unit_set): ...this.
1711 (Dwo_file::shndx_map_): Remove.
1712 (Dwo_file::sect_offsets_): New data member.
1713 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1714 (Dwp_output_file::add_section): Rename to...
1715 (Dwp_output_file::add_contribution): ...this.
1716 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1717 (Dwp_output_file::add_tu_set): Likewise.
1718 (Dwp_output_file::Contribution): New type.
1719 (Dwp_output_file::Section::contributions): New data member.
1720 (Dwp_output_file::Cu_or_tu_set): Remove.
1721 (Dwp_output_file::Section::Section): New ctor.
1722 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1723 (Dwp_output_file::Dwp_index::Section_table): New type.
1724 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1725 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1726 parameter.
1727 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1728 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1729 (Dwp_output_file::Dwp_index::section_table): New member function.
1730 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1731 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1732 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1733 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1734 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1735 (Dwp_output_file::Dwp_index::section_table_): New data member.
1736 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1737 (Dwp_output_file::add_output_section): New member function.
1738 (Dwp_output_file::write_new_section): New member function.
1739 (Dwp_output_file::write_contributions): New member function.
1740 (Dwp_output_file::section_id_map_): New data member.
1741 (class Dwo_id_info_reader): Remove.
1742 (class Unit_reader): New class.
1743 (get_dwarf_section_name): New function.
1744 (Dwo_file::read_executable): Adjust initializations of class data.
1745 (Dwo_file::read): Add support for v2 package file format.
1746 (Dwo_file::read_unit_index): Likewise.
1747 (Dwo_file::sized_read_unit_index): Likewise.
1748 (Dwo_file::copy_section): Likewise.
1749 (Dwo_file::add_unit_set): Likewise.
1750 (Dwp_output_file::add_output_section): Likewise.
1751 (Dwp_output_file::add_contribution): Likewise.
1752 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1753 for empty slot.
1754 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1755 file format.
1756 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1757 slot.
1758 (Dwp_output_file::initialize): Remove unused function.
1759 (Dwp_output_file::finalize): Add support for v2 package file format.
1760 (Dwp_output_file::write_index): Likewise.
1761 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1762 function prototype.
1763
2500c017
CC
17642013-10-31 Cary Coutant <ccoutant@google.com>
1765
1766 * configure.ac: Fix check for -fmerge-constants.
1767 * configure.ac: Regenerate.
1768
dd0845d7
RM
17692013-10-30 Roland McGrath <mcgrathr@google.com>
1770
1771 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
1772 Correct 9-byte nop sequence to match what the assembler generates.
1773
b4f7960d
AM
17742013-10-30 Alan Modra <amodra@gmail.com>
1775
1776 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
1777 ppc64_local_entry_offset, ppc64_local_entry_offset,
1778 do_read_symbols): New functions.
1779 (Powerpc_relobj::e_flags_, st_other_): New vars.
1780 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
1781 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
1782 (Powerpc_relobj::e_flags_): New var.
1783 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
1784 and adjust for ELFv2.
1785 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
1786 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
1787 (Powerpc_dynobj::do_find_special_sections): Likewise.
1788 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
1789 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
1790 to ELFv2 local entry.
1791 (Target_powerpc::do_relax): No thread safe barriers needed for
1792 ELFv2.
1793 (Output_data_plt_powerpc::initial_plt_entry_size_,
1794 plt_entry_size): Delete. Replace all uses with
1795 first_plt_entry_offset() and plt_entry_size().
1796 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
1797 reserved_size parm. Update callers.
1798 (Output_data_plt_powerpc::entry_count): Update.
1799 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
1800 and use Target_powerpc::first_plt_entry_offset().
1801 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
1802 rename to plt_entry_size.
1803 (Output_data_plt_powerpc::add_ifunc_entry,
1804 add_local_ifunc_entry): Adjust reloc for ELFv2.
1805 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
1806 (glink_eh_frame_fde_64v2): New.
1807 (Stub_table::plt_call_size): Support ELFv2 sizing.
1808 (Output_data_glink::add_eh_frame): Use the new FDE.
1809 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
1810 (Stub_table::do_write): Write ELFv2 stubs and glink.
1811 (Target_powerpc::Relocate::relocate): Replaces nop after call
1812 with ld 2,24(1) and adjust local offset destination for ELFv2.
1813
f9c6b907
AM
18142013-10-30 Alan Modra <amodra@gmail.com>
1815
1816 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
1817 (Target_powerpc::Scan::global, local): Likewise.
1818 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
1819 on all ppc64 @h and @ha relocs.
1820
e84fe78f
AM
18212013-10-14 Alan Modra <amodra@gmail.com>
1822
1823 * output.h (Output_data_got::add_constant): Tidy.
1824 (Output_data_got::add_constant_pair): New function.
1825 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
1826 methods used so as to first call reserve_ent().
1827
679e4abf
RM
18282013-10-11 Roland McGrath <mcgrathr@google.com>
1829
44dcb735
RM
1830 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
1831 add_got_entry and add_got_entry_pair.
1832
13323c49
RM
1833 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
1834 (HAVE_PUBNAMES): Likewise.
1835 * configure: Regenerate.
1836
1496b446
RM
1837 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
1838 * testsuite/Makefile.in: Regenerate.
1839
cc84c10b
RM
1840 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
1841 Remove const from declaration.
1842 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
1843 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
1844 * output.h (Output_file_header): Remove const from member target_
1845 and corresponding constructor argument.
1846 * output.cc (Output_file_header::Output_file_header): Update prototype.
1847 (Output_file_header::do_sized_write): Use this->target_ in place
1848 of parameters()->target().
1849
52f66a2c
RM
1850 * testsuite/undef_symbol.cc (Foo::get_a): New method.
1851
2b64b551
RM
1852 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
1853 * configure: Regenerate.
1854 * Makefile.in: Regenerate.
1855 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
1856 * testsuite/merge_string_literals_2.c: Likewise.
1857 * testsuite/Makefile.am
1858 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
1859 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
1860 literal -fmerge-constants.
1861 * testsuite/Makefile.in: Regenerate.
1862
43819297
RM
1863 * i386.cc (Target_i386): Remove unused member dynbss_.
1864 * arm.cc (Target_arm): Likewise.
1865 * powerpc.cc (Target_powerpc): Likewise.
1866 * sparc.cc (Target_sparc): Likewise.
1867 * tilegx.cc (Target_tilegx): Likewise.
1868 * x86_64.cc (Target_x86_64): Likewise.
1869 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
1870 type_signature_, type_offset_.
1871 * plugin.h (Plugin_hook): Remove unused member layout_.
1872 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
1873 mapfile_.
1874 (Read_member): Remove unused members input_objects_, symtab_,
1875 mapfile_, layout_.
1876 (Check_library): Remove unused member symtab_.
1877 * archive.h (Lib_group): Remove unused member lib_.
1878 * archive.cc (Lib_group::Lib_group): Update initializer.
1879 * incremental.h (Incremental_binary): Remove unused member target_.
1880 (Incremental_script_entry): Removed unused member script_.
1881 * layout.h (Write_symbols_task): Remove unused member input_objects_.
1882 * icf.h (Icf): Remove unused member num_tracked_relocs.
1883
39d9ead7
RM
1884 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
1885 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
1886 its only use.
1887 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
1888
679e4abf
RM
1889 * archive.h: Use struct rather than class for forward declaration
1890 of Read_symbols_data.
1891
54de2ea6
CC
18922013-10-07 Cary Coutant <ccoutant@google.com>
1893
1894 PR gold/16010
1895 * testsuite/Makefile.am (icf_test): Fix dependencies.
1896 (icf_safe_test): Likewise.
1897 (icf_safe_so_test): Likewise.
1898 (large_symbol_alignment): Add empty _LDADD rule.
1899 * testsuite/Makefile.in: Regenerate.
1900
b14016f0
L
19012013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
1902
1903 PR gold/15927
1904 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
1905 relocation for R_X86_64_32 on x32.
1906
eb426534
RM
19072013-08-27 Roland McGrath <mcgrathr@google.com>
1908
1909 * output.cc (Output_segment::set_section_addresses): Take new
1910 Target* argument. If target->isolate_execinstr() and the segment
1911 is executable and starts at a target->abi_pagesize() boundary,
1912 pad its end out to a target->abi_pagesize() boundary with code fill.
1913 * output.h (Output_segment::set_section_addresses): Update decl.
1914 * layout.h (Layout::check_output_data_for_reset_values): Take new
1915 argument RELAX_OUTPUTS.
1916 (Layout): New member relax_output_list_.
1917 (Layout::add_relax_output): New method.
1918 * layout.cc (Layout::Layout): Update constructor.
1919 (Layout::reset_relax_output): New method.
1920 (Layout::clean_up_after_relaxation): Call it.
1921 (Layout::prepare_for_relaxation): Update caller.
1922 (Layout::set_segment_offsets): Update callers of set_section_addresses.
1923 Call reset_relax_output before re-processing segments for
1924 isolate_execinstr case.
1925 (Layout::write_data): Handle relax_output_list_.
1926 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
1927 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
1928
9aff4b7a
NC
19292013-08-23 Yuri Chornoivan <yurchor@ukr.net>
1930
1931 PR binutils/15834
1932 * object.h: Fix typos.
1933
93f8221c
RM
19342013-08-16 Roland McGrath <mcgrathr@google.com>
1935
1936 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
1937 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
1938
e44c3715
CC
19392013-08-07 Cary Coutant <ccoutant@google.com>
1940
1941 Revert support for v2 DWP files:
1942
1943 2013-03-01 Cary Coutant <ccoutant@google.com>
1944
1945 Add dwp support for v2 DWARF package file format.
1946 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1947 tu_length parameter. Adjust all callers.
1948 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1949 * dwp.cc: Include dwarf.h.
1950 (Section_bounds): New struct type.
1951 (Unit_set): New struct type.
1952 (Dwo_file::Dwo_file): Initialize new data member.
1953 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1954 Combine and rename to...
1955 (Dwo_file::read_unit_index): ...this.
1956 (Dwo_file::sized_read_compunit_index)
1957 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1958 (Dwo_file::sized_read_unit_index): ...this.
1959 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1960 parameters; add section_id parameter.
1961 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1962 (Dwo_file::add_unit_set): ...this.
1963 (Dwo_file::shndx_map_): Remove.
1964 (Dwo_file::sect_offsets_): New data member.
1965 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1966 (Dwp_output_file::add_section): Rename to...
1967 (Dwp_output_file::add_contribution): ...this.
1968 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1969 (Dwp_output_file::add_tu_set): Likewise.
1970 (Dwp_output_file::Contribution): New type.
1971 (Dwp_output_file::Section::contributions): New data member.
1972 (Dwp_output_file::Cu_or_tu_set): Remove.
1973 (Dwp_output_file::Section::Section): New ctor.
1974 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1975 (Dwp_output_file::Dwp_index::Section_table): New type.
1976 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1977 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1978 parameter.
1979 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1980 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1981 (Dwp_output_file::Dwp_index::section_table): New member function.
1982 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1983 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1984 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1985 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1986 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1987 (Dwp_output_file::Dwp_index::section_table_): New data member.
1988 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1989 (Dwp_output_file::add_output_section): New member function.
1990 (Dwp_output_file::write_new_section): New member function.
1991 (Dwp_output_file::write_contributions): New member function.
1992 (Dwp_output_file::section_id_map_): New data member.
1993 (class Dwo_id_info_reader): Remove.
1994 (class Unit_reader): New class.
1995 (get_dwarf_section_name): New function.
1996 (Dwo_file::read_executable): Adjust initializations of class data.
1997 (Dwo_file::read): Add support for v2 package file format.
1998 (Dwo_file::read_unit_index): Likewise.
1999 (Dwo_file::sized_read_unit_index): Likewise.
2000 (Dwo_file::copy_section): Likewise.
2001 (Dwo_file::add_unit_set): Likewise.
2002 (Dwp_output_file::add_output_section): Likewise.
2003 (Dwp_output_file::add_contribution): Likewise.
2004 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2005 for empty slot.
2006 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2007 file format.
2008 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2009 slot.
2010 (Dwp_output_file::initialize): Remove unused function.
2011 (Dwp_output_file::finalize): Add support for v2 package file format.
2012 (Dwp_output_file::write_index): Likewise.
2013 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2014 function prototype.
2015
c6905c28
CC
20162013-07-31 Cary Coutant <ccoutant@google.com>
2017
2018 * object.cc (Sized_relobj::do_output_section_address): New function.
2019 (Sized_relobj): Instantiate explicitly.
2020 * object.h (Object::output_section_address): New function.
2021 (Object::do_output_section_address): New function.
2022 (Sized_relobj::do_output_section_address): New function.
2023 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
2024
20252013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 2026 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
2027
2028 * parameters.cc (Parameters::entry): Return target-specific entry
2029 symbol name.
2030 * target.h (Target::entry_symbol_name): New function.
2031 (Target_info::entry_symbol_name): New data member.
2032
2033 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
2034 * i386.cc (Target_i386::i386_info): Likewise.
2035 (Target_i386_nacl::i386_nacl_info): Likewise.
2036 * sparc.cc (Target_sparc::sparc_info): Likewise.
2037 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
2038 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
2039 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
2040 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2041
234d4ab8
SA
20422013-07-22 Sterling Augustine <saugustine@google.com>
2043
2044 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
2045 Convert parameter shndx to local variable. Add parameters symtab
2046 and symtab_size. Scan over section names. Find relocation
2047 section corresponding to current section. Create and initialize
2048 reloc_mapper_ and reloc_type_.
2049 (Dwarf_pubnames_table::read_header): Add assertion. Change
2050 unit_length to off_t. Initialize member unit_length_. Fill in field
2051 cu_offset_.
2052 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2053 Initialize new fields unit_length_ and cu_offset_.
2054 (Dwarf_pubnames_table::read_section): Update prototype.
2055 (Dwarf_pubnames_table::cu_offset): New member function.
2056 (Dwarf_pubnames_table::subsection_size): Likewise.
2057 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
2058 New fields.
2059 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
2060 member functions public.
2061 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
2062 Update comment. Rework logic. Move repeated parts to...
2063 (Gdb_index_info_reader::read_pubtable): ...here. New function.
2064 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
2065 pubtypes_table_, and stmt_list_offset.
2066 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2067 Gdb_index::find_pubtype_offset,
2068 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
2069 (Gdb_index::pubnames_read): Update prototype and rework logic.
2070 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
2071 Forward declare.
2072 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2073 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
2074 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
2075 Gdb_index::map_pubtable_to_dies):
2076 Declare functions.
2077 (Gdb_index::pubnames_read): Update declaration.
2078 (Gdb_index::Pubname_offset_map): New type.
2079 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
2080 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
2081 Gdb_index::stmt_list_offset): Declare.
2082 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
2083 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
2084 Gdb_index::pubtypes_offset_): Remove.
2085
a3ed37d8
RM
20862013-07-19 Roland McGrath <mcgrathr@google.com>
2087
2088 * options.h (General_options): Add -Trodata-segment option.
2089 * parameters.cc (Parameters::check_rodata_segment): New function.
2090 (Parameters::set_target_once): Call it.
2091 * parameters.h (Parameters): Declare it (private member function).
2092 * layout.cc (load_seg_unusable_for_headers): New function, broken
2093 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
2094 then validate rodata segment rather than text segment.
2095 (relaxation_loop_body): Call that.
2096 (is_text_segment): New function. Don't admit a non-executable
2097 segment if TARGET->isolate_execinstr().
2098 (set_segment_offsets): Call it. Honor -Trodata-segment option.
2099
eb5b4ded
CC
21002013-07-15 Shawn Landden <shawnlandden@gmail.com>
2101
2102 PR gold/15070
2103 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
2104 * nacl.h (Sniff_file::View::View): Request aligned view.
2105
4d5effb9
CC
21062013-07-11 Cary Coutant <ccoutant@google.com>
2107
2108 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
2109 correct BRLT entry size.
2110
ba8ca3e7
AM
21112013-07-03 Alan Modra <amodra@gmail.com>
2112
2113 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
2114 comment.
2115
267257d2
CC
21162013-07-01 Cary Coutant <ccoutant@google.com>
2117
2118 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
2119 reloc_type_.
2120 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
2121 (Dwarf_ranges_table::lookup_reloc): New function.
2122 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
2123 reloc_type_.
2124 (Dwarf_ranges_table::lookup_reloc): New function.
2125 (Dwarf_ranges_table::reloc_type_): New data member.
2126
06f30c9d
CC
21272013-06-27 Jing Yu <jingyu@google.com>
2128
2129 PR gold/15662
2130 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
2131 function.
2132 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
2133 (Target_powerpc::do_relax): Call the above.
2134
a2d7bf59
AM
21352013-06-27 Cary Coutant <ccoutant@google.com>
2136
2137 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
2138 on garbage collected .opd section.
2139
21402013-06-27 Alan Modra <amodra@gmail.com>
2141
2142 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
2143 is non-zero.
2144 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
2145 (Target_powerpc::do_function_location): Likewise for loc->shndx.
2146
32364e50
CC
21472013-06-14 Cary Coutant <ccoutant@google.com>
2148
2149 * resolve.cc (Symbol::override_base): Don't override st_type
2150 from plugin placeholder symbols.
2151 (Symbol_table::resolve): Likewise.
2152 (Symbol_table::should_override): Don't complain about TLS mismatch
2153 if the TO symbol is a plugin placeholder.
2154 * testsuite/Makefile.am (plugin_test_tls): New test.
2155 * testsuite/Makefile.in: Regenerate.
2156 * testsuite/plugin_test_tls.sh: New test script.
2157 * testsuite/two_file_test_2_tls.cc: New test source.
2158 * testsuite/two_file_test_tls.cc: New test source.
2159
7fb47cc9
CC
21602013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
2161
2162 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
2163 the maximum segment alignment is larger than the page size.
2164 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
2165 correctly aligns the symbols with large alignemnt.
2166 * testsuite/Makefile.in: Regenerate.
2167 * testsuite/large_symbol_alignment.cc: New file.
2168
6934001a
CC
21692013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
2170 Sriraman Tallam <tmsriram@google.com>
2171
2172 * options.h (sort_section): New option.
2173 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
2174 Rename from Input_section_sort_section_name_special_ordering_compare.
2175 (Input_section_sort_section_name_compare): New struct.
2176 * output.cc (Output_section::Input_section_sort_section_name_compare::
2177 operator()): New function.
2178 (Output_section::sort_attached_input_sections): Use new sort function
2179 for .text if --sort-section=name is specified.
2180 * layout.cc (Layout::make_output_section):
2181 Add sorting by name when --sort-section=name is specified.
2182 * testsuite/Makefile.am (text_section_grouping): Test option
2183 --sort-section=name.
2184 * testsuite/Makefile.in: Regenerate.
2185 * testsuite/section_sorting_name.cc: New file.
2186 * testsuite/section_sorting_name.sh: New file.
2187
93acabad
CC
21882013-05-21 Cary Coutant <ccoutant@google.com>
2189
2190 * symtab.h (Symbol::is_cxx_vtable): New function.
2191 * target-reloc.h (relocate_section): Check for vtable symbol.
2192 * testsuite/Makefile.am (missing_key_func.sh): New test case.
2193 * testsuite/Makefile.in: Regenerate.
2194 * testsuite/missing_key_func.cc: New test source.
2195 * testsuite/missing_key_func.sh: New test script.
2196
60e8b3fc
CC
21972013-05-21 Cary Coutant <ccoutant@google.com>
2198
2b64b551
RM
2199 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
2200 type of enclosing symbol.
2201 (Relocate_info::location): Check symbol type when describing symbol.
2202 * object.h (Symbol_location_info): Remove unused line_number;
2203 add enclosing_symbol_type.
2204 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 2205
9df9de2c
CC
22062013-05-13 Cary Coutant <ccoutant@google.com>
2207
2b64b551
RM
2208 * configure.ac: Export DEFAULT_TARGET.
2209 * configure: Regenerate.
2210 * Makefile.in: Regenerate.
2211 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
2212 * testsuite/Makefile.in: Regenerate.
2213 * testsuite/debug_msg.sh: Delete duplicate tests.
2214 Don't check undef_int error message match for powerpc where the
2215 source file and line number aren't available.
9df9de2c 2216
bbc5ae17
RM
22172013-05-10 Roland McGrath <mcgrathr@google.com>
2218
2219 * options.h (General_options): Add --rosegment-gap option.
2220 * options.cc (finalize): --rosegment-gap implies --rosegment.
2221 * layout.cc (set_segment_offsets): Let user option override
2222 target->rosegment_gap().
2223
0c6e6c39
RM
22242013-05-10 Roland McGrath <mcgrathr@google.com>
2225
2226 * options.h (General_options): Remove leading space from help
2227 messages for -nostdlib and --rosegment.
2228
cde7cb01
MR
22292013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
2230
2231 PR ld/15365
2232 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
2233
f31ae5b8
AM
22342013-05-03 Alan Modra <amodra@gmail.com>
2235
2236 * merge.cc (Output_merge_string::do_add_input_section): Correct
2237 scan for number of strings. Rename vars to avoid shadowing.
2238 Include missing terminator in input_size_.
2239
d3a7cd45
L
22402013-05-01 H.J. Lu <hongjiu.lu@intel.com>
2241
2242 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
2243 Restore empty string handling.
2244
6ad3daba
CC
22452013-05-01 Cary Coutant <ccoutant@google.com>
2246
2247 * stringpool.cc (Stringpool_template::new_key_offset): Fix
2248 uninitialized warning.
2249
e31908b6
CC
22502013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
2251
2252 * output.cc (Output_section::add_merge_input_section): Allow
2253 to merge sections if the alignment is more than character size.
2254 * merge.h (Output_merge_string::Output_merge_string): Remove
2255 assert.
2256 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
2257 only not-null strings. Check the alignment of strings.
2258 * stringpool.h
2259 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
2260 alignment as the argument.
2261 (Stringpool_template<Stringpool_char>::addralign_): New class member.
2262 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
2263 Align non-zero length strings according to the addralign_.
2264 (Stringpool_template<Stringpool_char>::set_string_offsets):
2265 Updating offsets according to the given alignment.
2266 * testsuite/Makefile.am (text_section_grouping): Test if string
2267 literals are getting merged.
2268 * testsuite/Makefile.in: Regenerate.
2269 * testsuite/merge_string_literals_1.c: New file.
2270 * testsuite/merge_string_literals_2.c: Ditto.
2271 * testsuite/merge_string_literals.sh: Ditto.
2272
0e804863
ILT
22732013-04-26 Ian Lance Taylor <iant@google.com>
2274
2275 * target-reloc.h (relocate_section): If the reloc offset is out of
2276 range, pass VIEW as NULL to relocate.relocate.
2277 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
2278 * i386.cc (Target_i386::Relocate::relocate): Likewise.
2279 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
2280 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
2281 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
2282 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
2283
e7c5ea40
CC
22842013-04-26 Geoff Pike <gpike@chromium.org>
2285
2286 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
2287 * layout.cc (Hash_task): New class.
2288 (Layout::queue_build_id_tasks): New function.
2289 (Layout::write_build_id): Handle single-thread portion of build ID
2290 computation. (In some cases, all of it is single-threaded.) Replace
2291 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
2292 functionality in fewer lines of code.
2293 * layout.h (Layout::queue_build_id_tasks): New function declaration.
2294 * options.h (General_options): make "--build-id" default to tree
2295 rather than sha1. Add two new options related to --build-id=tree:
2296 --build-id-chunk-size-for-treehash and
2297 --build-id-min-file-size-for-treehash.
2298 * Makefile.am: add testing of --build-id=tree and related new options
2299 (these tests will be invoked by "make check").
2300 * Makefile.in: Regenerate.
2301
49926cd0
AM
23022013-04-25 Alan Modra <amodra@gmail.com>
2303
2304 * configure.tgt: Add powerpcle and powerpc64le.
2305
a4034750
AM
23062013-04-22 Alan Modra <amodra@gmail.com>
2307
2308 PR gold/15355
2309 * layout.cc (Layout::segment_precedes): Allow more than one
2310 segment with the same type and flags.
2311
e79c84aa
CC
23122013-04-15 Cary Coutant <ccoutant@google.com>
2313
2314 * layout.cc (Layout::set_relocatable_section_offsets): Don't
2315 allocate space in file for BSS sections.
2316
2199fbe7
CC
23172013-04-15 Cary Coutant <ccoutant@google.com>
2318
2319 * script-sections.cc (Orphan_output_section): Reset address
2320 to zero after each orphaned section for relocatable links.
2321
502e8a84
CC
23222013-04-15 Cary Coutant <ccoutant@google.com>
2323
a4034750
AM
2324 * symtab.cc (Symbol_table::sized_write_globals): Subtract
2325 section starting address for relocatable link.
2326 * testsuite/Makefile.am (script_test_11): New test.
2327 * testsuite/Makefile.in: Regenerate.
2328 * testsuite/script_test_11.c: New source file.
2329 * testsuite/script_test_11.t: New linker script.
502e8a84 2330
0cfdc767
AM
23312013-04-13 Alan Modra <amodra@gmail.com>
2332
2333 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
2334 owner when sections are not adjacent and exceed group size.
2335 (Target_powerpc::group_sections): Handle corner case.
2336 (Target_powerpc::Branch_info::make_stub): Handle case where
2337 stub table doesn't exist due to branches in non-exec sections.
2338 (Target_powerpc::Relocate::relocate): Likewise.
2339
6830ee24
AM
23402013-04-11 Alan Modra <amodra@gmail.com>
2341
2342 PR gold/15354
2343 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
2344 .branch_lt to match bfd ld. Adjust comments throughout file.
2345
54a3d865
ILT
23462013-04-04 Ian Lance Taylor <iant@google.com>
2347
2348 GCC PR c++/56840
2349 * object.cc (do_layout_deferred_sections): Handle .eh_frame
2350 sections before checking whether they are included in the link.
2351
9993ba11
ST
23522013-03-29 Sriraman Tallam <tmsriram@google.com>
2353
2354 * archive.cc (Archive::get_elf_object_for_member): Create the elf
2355 object before calling the plugin claim_file handler. Pass the elf
2356 object of the archive to the plugin. Delete the elf object if the
2357 plugin claims the file.
2358
ebacd51e
AM
23592013-03-21 Alan Modra <amodra@gmail.com>
2360
2361 * layout.cc (Layout::set_segment_offsets): Accept writable .text
2362 segment when omagic.
2363
117be58f
AM
23642013-03-21 Alan Modra <amodra@gmail.com>
2365
2366 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
2367 comparison warning.
2368 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
2369 uninitialized" warning.
2370
32e2b61d
AM
23712013-03-20 Alan Modra <amodra@gmail.com>
2372
2373 * symtab.h (Symbol::clear_version): New function.
2374 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
2375 is_needed by weak references. Clear version for symbols defined
2376 in as-needed objects that are not needed.
2377
b3ccdeb5
AM
23782013-03-15 Alan Modra <amodra@gmail.com>
2379
2380 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
2381 static and public. Add report_err param. Return false for data refs.
2382 (Target_powerpc::rela_dyn_section): New overloaded function.
2383 (Target_powerpc::plt_, iplt_): Elucidate.
2384 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
2385 (Output_data_plt_powerpc::do_write): Don't write .iplt.
2386 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
2387 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
2388 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
2389 push_branch and make_plt_entry for ifunc syms when
2390 reloc_needs_plt_for_ifunc.
2391 (Target_powerpc::Relocate::relocate): Don't use plt entry value
2392 for ifunc unless reloc_needs_plt_for_ifunc.
2393
ad3d8a2f
AM
23942013-03-15 Alan Modra <amodra@gmail.com>
2395
2396 * gc.h (gc_process_relocs): Don't look through function descriptors.
2397 * icf.cc (get_section_contents): Do so here instead.
2398
4d9aa155
AM
23992013-03-13 Alan Modra <amodra@gmail.com>
2400
2401 * powerpc.cc (is_branch_reloc): Forward declare.
2402 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
2403 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
2404 false for 64-bit, true for 32-bit non-branch relocs.
2405 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
2406 * testsuite/Makefile.am (icf_test): Use linker map file instead of
2407 nm output.
2408 (icf_safe_test): Generate linker map file as well as nm output.
2409 (icf_safe_so_test): Likewise.
2410 * testsuite/Makefile.in: Regenerate.
2411 * testsuite/icf_test.sh: Parse linker map file to determine
2412 section folding.
2413 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
2414 * testsuite/icf_safe_so_test.sh: Likewise.
2415 (X86_32_or_ARM_specific_safe_fold): Merge into..
2416 (arch_specific_safe_fold): ..this.
2417 (X86_64_specific_safe_fold): Delete unused function.
2418
57420c20
AM
24192013-03-12 Alan Modra <amodra@gmail.com>
2420
2421 * gc.h (gc_process_relocs): Look through function descriptors
2422 to determine shndx, symvalue and addend used by ICF. Tidy
2423 variable duplication.
2424
dc3714f3
AM
24252013-03-11 Alan Modra <amodra@gmail.com>
2426
2427 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
2428 * layout.cc (Layout_task_runner::run): ..to here.
2429 * symtab.h (struct Symbol_location): Extract from..
2430 (class Symbol_table): ..here.
2431 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
2432 * target.h (class Target): Add function_location and
2433 do_function_location functions.
2434 (class Sized_target): Add do_function_location.
2435 * object.h (class Sized_relobj_file): Move find_shdr..
2436 (class Object): ..to here.
2437 * object.cc: Likewise. Update to suit. Instantiate.
2438 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
2439 * powerpc.cc (class Powerpc_dynobj): New.
2440 (Target_powerpc::do_function_location): New function.
2441 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
2442 (Powerpc_dynobj::do_read_symbols): New function.
2443 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
2444
956b03bb
ILT
24452013-03-08 Ian Lance Taylor <iant@google.com>
2446
2447 * options.cc (General_options::string_to_object_format): Accept
2448 "default".
2449
4bead2d5
AM
24502013-03-08 Alan Modra <amodra@gmail.com>
2451
2452 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
2453 pointer to Post_fde.
2454 (struct Post_fde): Move definition to here..
2455 * ehframe.cc (struct Post_fde): ..from here.
2456 (Cie::write): Don't alloc Post_fde.
2457 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
2458
02e60bf7
AM
24592013-03-07 Alan Modra <amodra@gmail.com>
2460
2461 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
2462 relocation referencing .LC0.
2463 * testsuite/discard_locals_test.sh: Remove FIXMEs.
2464
8343f03a
AM
24652013-03-07 Alan Modra <amodra@gmail.com>
2466
2467 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
2468 always_inline. Add assembly for powerpc to avoid GOT.
2469
3366d57c
AM
24702013-03-07 Alan Modra <amodra@gmail.com>
2471
2472 * testsuite/script_test_10.sh: Don't test .bss section
2473 header number.
2474
6c77229c
AM
24752013-03-06 Alan Modra <amodra@gmail.com>
2476
2477 * powerpc.cc (class Powerpc_relobj): Move some member functions.
2478 (Target_powerpc::symval_for_branch): Add symtab param. Update
2479 all callers. Handle folded sections.
2480 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
2481 to Powerpc_relobj.
2482 (Global_symbol_visitor_opd::operator()): Likewise.
2483
a39e4af6
AM
24842013-03-04 Alan Modra <amodra@gmail.com>
2485
2486 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
2487 * testsuite/Makefile.in: Regenerate.
2488
d5834edb
CC
24892013-03-01 Cary Coutant <ccoutant@google.com>
2490
2491 Add dwp support for v2 DWARF package file format.
2492 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2493 tu_length parameter. Adjust all callers.
2494 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2495 * dwp.cc: Include dwarf.h.
2496 (Section_bounds): New struct type.
2497 (Unit_set): New struct type.
2498 (Dwo_file::Dwo_file): Initialize new data member.
2499 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2500 Combine and rename to...
2501 (Dwo_file::read_unit_index): ...this.
2502 (Dwo_file::sized_read_compunit_index)
2503 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2504 (Dwo_file::sized_read_unit_index): ...this.
2505 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2506 parameters; add section_id parameter.
2507 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2508 (Dwo_file::add_unit_set): ...this.
2509 (Dwo_file::shndx_map_): Remove.
2510 (Dwo_file::sect_offsets_): New data member.
2511 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2512 (Dwp_output_file::add_section): Rename to...
2513 (Dwp_output_file::add_contribution): ...this.
2514 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2515 (Dwp_output_file::add_tu_set): Likewise.
2516 (Dwp_output_file::Contribution): New type.
2517 (Dwp_output_file::Section::contributions): New data member.
2518 (Dwp_output_file::Cu_or_tu_set): Remove.
2519 (Dwp_output_file::Section::Section): New ctor.
2520 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2521 (Dwp_output_file::Dwp_index::Section_table): New type.
2522 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2523 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2524 parameter.
2525 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2526 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2527 (Dwp_output_file::Dwp_index::section_table): New member function.
2528 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2529 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2530 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2531 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2532 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2533 (Dwp_output_file::Dwp_index::section_table_): New data member.
2534 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2535 (Dwp_output_file::add_output_section): New member function.
2536 (Dwp_output_file::write_new_section): New member function.
2537 (Dwp_output_file::write_contributions): New member function.
2538 (Dwp_output_file::section_id_map_): New data member.
2539 (class Dwo_id_info_reader): Remove.
2540 (class Unit_reader): New class.
2541 (get_dwarf_section_name): New function.
2542 (Dwo_file::read_executable): Adjust initializations of class data.
2543 (Dwo_file::read): Add support for v2 package file format.
2544 (Dwo_file::read_unit_index): Likewise.
2545 (Dwo_file::sized_read_unit_index): Likewise.
2546 (Dwo_file::copy_section): Likewise.
2547 (Dwo_file::add_unit_set): Likewise.
2548 (Dwp_output_file::add_output_section): Likewise.
2549 (Dwp_output_file::add_contribution): Likewise.
2550 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2551 for empty slot.
2552 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2553 file format.
2554 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2555 slot.
2556 (Dwp_output_file::initialize): Remove unused function.
2557 (Dwp_output_file::finalize): Add support for v2 package file format.
2558 (Dwp_output_file::write_index): Likewise.
2559 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2560 function prototype.
2561
a68a081d
CC
25622013-03-01 Cary Coutant <ccoutant@google.com>
2563
2564 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
2565 function into class definition in header file.
2566 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
2567 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
2568 New function.
2569 (Dwarf_info_reader::check_buffer): Move here from .cc file.
2570
9d5781f8
AM
25712013-02-28 Alan Modra <amodra@gmail.com>
2572
2573 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
2574 * target.cc (Target::do_plt_fde_location): New function.
2575 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
2576 accessor function, and constructor param.
2577 (struct Post_fde, Post_fdes): Declare.
2578 (Cie::write): Add post_fdes param.
2579 * ehframe.cc (Fde::write): Use plt_fde_location.
2580 (struct Post_fde): Define.
2581 (Cie::write): Stash FDEs added post merge mapping.
2582 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
2583 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
2584 (Eh_frame::do_sized_write): Arrange to write post map FDES after
2585 other FDEs.
2586 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
2587 (Target_powerpc::has_glink): New function.
2588 (Target_powerpc::do_relax): Add eh_frame info for stubs.
2589 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
2590 glink_eh_frame_fde_32, default_fde): New data.
2591 (Stub_table::eh_frame_added_): New var.
2592 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
2593 Make const.
2594 (Stub_table::add_eh_frame): New function.
2595 (Output_data_glink::add_eh_frame): New function.
2596 (Target_powerpc::make_glink_section): Call add_eh_frame.
2597
214383dd
ILT
25982013-02-15 Ian Lance Taylor <iant@google.com>
2599
2600 * options.h (DEFINE_uint64_alias): Define.
2601 (class General_options): Add -Ttext-segment as an alias for
2602 -Ttext.
2603
91c2b899
AM
26042013-02-15 Alan Modra <amodra@gmail.com>
2605
2606 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
2607 (Stub_table::do_write): ..here, two places.
2608 (Stub_table::plt_call_size): Use it here too.
2609
20e2a8aa
ILT
26102013-02-11 Ian Lance Taylor <iant@google.com>
2611
2612 * descriptors.cc (Descriptors::close_all): New function.
2613 * descriptors.h (class Descriptors): Declare close_all.
2614 (close_all_descriptors): New inline function.
2615 * plugin.cc: Include "descriptors.h".
2616 (Plugin_manager::cleanup): Call close_all_descriptors.
2617
8952bc69
AM
26182013-02-06 Alan Modra <amodra@gmail.com>
2619
2620 * README: Update coding style link.
2621
29bd8b6b
CC
26222013-01-28 Cary Coutant <ccoutant@google.com>
2623
a4034750
AM
2624 * dwp.cc (File_list): New typedef.
2625 (Dwo_name_info_reader): New class.
2626 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
2627 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
2628 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
2629 (Dwo_file::read_executable): New function.
2630 (Dwo_file::read): Move common setup code to ...
2631 (Dwo_file::make_object): ... here.
2632 (dwp_options): Add --exec/-e.
2633 (usage): Likewise.
2634 (main): Likewise.
29bd8b6b 2635
c6ac678d
ST
26362013-01-24 Sriraman Tallam <tmsriram@google.com>
2637
2638 * layout.cc (Layout::layout): Check for option text_reorder.
2639 (Layout::make_output_section): Ditto.
2640 * options.h (text_reorder): New option.
2641 * output.cc (Input_section_sort_compare): Remove special ordering
2642 of section names.
2643 (Output_section::
2644 Input_section_sort_section_name_special_ordering_compare::
2645 operator()): New function.
2646 (Output_section::sort_attached_input_sections): Use new sort function
2647 for .text.
2648 * output.h (Input_section_sort_section_name_special_ordering_compare):
2649 New struct.
2650 * testsuite/Makefile.am (text_section_grouping): Test option
2651 --no-text-reorder
2652 * testsuite/Makefile.in: Regenerate.
2653 * testsuite/text_section_grouping.sh: Check order of functions without
2654 default text reordering.
2655
50701cc1
MF
26562013-01-18 Mike Frysinger <vapier@gentoo.org>
2657
2658 * options.h (General_options): Change default to true for new_dtags.
2659
b1b00fcc
MF
26602013-01-18 Mike Frysinger <vapier@gentoo.org>
2661
2662 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
2663 when enable_new_dtags is false. Only add DT_RUNPATH when
2664 enable_new_dtags is true.
2665
ec5b8187
AM
26662013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
2667
2668 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
2669 used in declaration and definition consistent.
2670 (Target_powerpc::symval_for_branch): Ditto.
2671
a880d4c4
ST
26722013-01-16 Sriraman Tallam <tmsriram@google.com>
2673
2674 * testsuite/plugin_final_layout.cc: Fix comment.
2675
7c381248
ST
26762013-01-16 Sriraman Tallam <tmsriram@google.com>
2677
2678 * layout.cc (Layout::layout): Do not do default sorting for
2679 text sections when section ordering is specified.
2680 (make_output_section): Ditto.
2681 * testsuite/plugin_final_layout.cc: Name the function sections
2682 to catch reordering issues.
2683
e2458743
AM
26842013-01-15 Alan Modra <amodra@gmail.com>
2685
2686 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
2687 plt-thread-safe.
2688
431ed302
AM
26892013-01-15 Alan Modra <amodra@gmail.com>
2690
2691 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
2692 * testsuite/Makefile.in: Regenerate.
2693
0ec6429b
AM
26942013-01-14 Alan Modra <amodra@gmail.com>
2695
2696 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
2697 * testsuite/Makefile.in: Regenerate.
2698
0bf402d5
ILT
26992013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
2700
36af3926 2701 PR bfd/14430
0bf402d5
ILT
2702 Fix mingw gold build with plugins enabled
2703 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
2704 * configure.ac: Export DLOPEN_LIBS and add headers check.
2705 * plugin.cc: Handle non-dlfcn case.
2706 * Makefile.in: Regenerate.
2707 * config.in: Regenerate.
2708 * configure: Regenerate.
2709 * testsuite/Makefile.in: Regenerate.
2710
9e9143bc
ST
27112013-01-09 Sriraman Tallam <tmsriram@google.com>
2712
2713 * output.h (sort_attached_input_sections): Change to be public.
2714 * script-sections.cc
2715 (Output_section_definition::set_section_addresses): Sort
2716 attached input sections according to section order before linker
2717 script assigns section addresses.
2718 (Orphan_output_section::set_section_addresses): Sort
2719 attached input sections according to section order before linker
2720 script assigns section addresses.
2721 * Makefile.am (final_layout.sh): Use a simple linker script to
2722 check if section ordering still works.
2723 * Makefile.in: Regenerate.
2724
679af368
ILT
27252013-01-09 Ben Cheng <bccheng@google.com>
2726
2727 * arm.cc (Target_arm::attributes_accept_div): New function.
2728 (Target_arm::attributes_forbid_div): New function.
2729 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
2730 attribute using the same new functions as what bfd/elf32_arm.c
2731 does.
2732
3136a00e
CC
27332013-01-07 Cary Coutant <ccoutant@google.com>
2734
2735 PR gold/14993
2736 * output.cc (Output_section::add_input_section): For incremental
2737 updates, don't track input sections that are allocated from patch
2738 space.
2739
f2a6224b
L
27402013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2741 Ian Lance Taylor <iant@google.com>
2742
2743 PR gold/14897
2744 * configure.ac (--enable-ld): Removed.
2745 (install_as_default): Set to yes only for --enable-gold=default
2746 or --disable-ld.
2747 * configure: Regenerated.
2748
4f46f626
L
27492013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2750
2751 * options.h (General_options): Add -fuse-ld= for GCC linker
2752 option compatibility.
2753
26e4ef59
CC
27542013-01-04 Cary Coutant <ccoutant@google.com>
2755
2756 * configure.ac: Fix typo restoring CXXFLAGS.
2757 * configure: Regenerate.
2758
3d587466
CC
27592013-01-04 Cary Coutant <ccoutant@google.com>
2760
4f46f626
L
2761 * testsuite/Makefile.am (CXXLINK_S): New macro.
2762 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
2763 * testsuite/Makefile.in: Regenerate.
3d587466 2764
44db6695
L
27652013-01-02 H.J. Lu <hongjiu.lu@intel.com>
2766
2767 * version.cc (print_version): Update copyright year to 2013.
2768
edcac0c1
ILT
27692012-12-20 Ian Lance Taylor <iant@google.com>
2770
2771 * layout.cc (Layout::special_ordering_of_input_section): New
2772 function.
2773 (Layout::layout): If input section requires special ordering, must
2774 sort input sections.
2775 (Layout::make_output_section): May sort .text input sections.
2776 (Layout::is_section_name_prefix_grouped): Remove.
2777 * layout.h (class Layout): Declare
2778 special_ordering_of_input_section. Don't declare
2779 is_section_name_prefix_grouped.
2780 * output.cc (Output_section::add_input_section): Revert last
2781 change.
2782 (Output_section::Input_section_sort::match_file_name): Don't crash
2783 if called on output section data.
2784 (Output_section::Input_section_sort_compare): Sort based on
2785 special ordering.
2786 (Output_section::Input_section_sort_section_order_index_compare):
2787 Revert last patch.
2788 (Output_section::sort_attached_input_sections): Likewise.
2789
28f2a4ac
ST
27902012-12-18 Sriraman Tallam <tmsriram@google.com>
2791
edcac0c1 2792 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
2793 * layout.h (Layout::is_section_name_prefix_grouped): New function.
2794 * output.cc (Output_section::add_input_section): Check if section
2795 name contains special prefix. Keep input sections to sort such
2796 sections.
2797 (Output_section::Input_section_sort_section_order_index_compare
2798 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
2799 (Output_section::sort_attached_input_sections): Add condition to
2800 Input_section_entry constructor call.
28f2a4ac
ST
2801 * testsuite/Makefile.am (text_section_grouping): New test.
2802 * testsuite/Makefile.in: Regenerate.
2803 * testsuite/text_section_grouping.cc: New file.
2804 * testsuite/text_section_grouping.sh: New file.
2805
5bf135a7
NC
28062012-12-17 Nick Clifton <nickc@redhat.com>
2807
2808 * Makefile.am: Add copyright notice.
2809 * NEWS: Likewise.
2810 * README: Likewise.
2811 * configure.ac: Likewise.
2812 * ftruncate.c: Likewise.
2813 * Makefile.in: Regenerate.
2814
59965708
CC
28152012-12-14 Cary Coutant <ccoutant@google.com>
2816
a4034750
AM
2817 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
2818 --no-as-needed flag.
2819 (exception_separate_shared_12_test): Likewise.
2820 (incremental_copy_test): Likewise.
2821 * testsuite/Makefile.in: Regenerate.
59965708 2822
2a77e2ab
CC
28232012-12-14 Cary Coutant <ccoutant@google.com>
2824
2825 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
2826 (Dwp_output_file::Dwp_index::enter_set): Add assert.
2827
e3deeb9c
AM
28282012-12-12 Alan Modra <amodra@gmail.com>
2829
2830 * powerpc.cc (class Track_tls): New.
2831 (class Relocate, class Scan): Inherit Track_tls.
2832 (Target_powerpc::Scan::local, global): Track tls optimization
2833 and avoid creating plt entry for __tls_get_addr if all uses
2834 are optimized away.
2835 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
2836
d8f5a274
AM
28372012-12-12 Alan Modra <amodra@gmail.com>
2838
2839 * options.h (General_options): Add --toc-sort/--no-toc-sort.
2840 Replace no_toc_optimize with toc_optimize.
2841 * output.h (Output_section::input_sections): Provide non-const variant.
2842 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
2843 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
2844 accessors.
2845 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
2846 (class Sort_toc_sections): New.
2847 (Target_powerpc::do_finalize_sections): Sort toc sections.
2848 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
2849
4c8a1de1
RM
28502012-12-10 Roland McGrath <mcgrathr@google.com>
2851
2852 * testsuite/binary_unittest.cc (read_all): New function.
2853 (Sized_binary_test): Use it instead of ::read.
2854 * fileread.cc (do_read): Don't assume pread always reads the whole
2855 amount in a single call.
2856
edc27beb
AM
28572012-12-10 Alan Modra <amodra@gmail.com>
2858
2859 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
2860 Set EM_PPC64 or EM_PPC here.
2861 (Target_selector_powerpc::do_recognize): Delete.
2862
906b9150
AM
28632012-12-10 Alan Modra <amodra@gmail.com>
2864
2865 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
2866 stub_table_.
2867 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
2868
418c15ae
RM
28692012-12-07 Roland McGrath <mcgrathr@google.com>
2870
2871 * testsuite/binary_unittest.cc (Sized_binary_test):
2872 Use open_descriptor rather than ::open.
2873
decdd3bc
AM
28742012-12-07 Alan Modra <amodra@gmail.com>
2875
2876 * powerpc.cc (Stub_table::do_write): Delete redundant Address
2877 typedef and invalid_address constant.
2878 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
2879 instantiate constants.
2880
db399005
ILT
28812012-12-06 Roland McGrath <mcgrathr@google.com>
2882
2883 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
2884 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
2885 * aclocal.m4: Regenerate.
2886 * configure: Regenerate.
2887 * Makefile.in: Regenerate.
2888 * testsuite/Makefile.in: Regenerate.
2889
aba6bc71
AM
28902012-12-07 Alan Modra <amodra@gmail.com>
2891
2892 * options.h (General_options): Add no_toc_optimize.
2893 * powerpc.cc (ok_lo_toc_insn): New function.
2894 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
2895
9e69ed50
AM
28962012-12-06 Alan Modra <amodra@gmail.com>
2897
2898 * options.h (General_options): Add plt_align, plt_static_chain,
2899 plt_thread_safe. Update stub_group_size help text.
2900 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
2901 for new plt_thread_safe_ var.
2902 (use_plt_offset): Correct comments.
2903 (Target_powerpc::do_relax): Look for thread creation symbols to
2904 determine default plt_thread_safe value. Clear plt call stubs
2905 as well as branch stubs each iteration.
2906 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
2907 insn constants.
2908 (l, hi, ha, write_insn): Move earlier.
2909 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
2910 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
2911 plt stubs too.
2912 (Stub_table::update_size): Adjust.
2913 (Stub_table::prev_size, set_prev_size): Delete.
2914 (Stub_table::stub_align): Let --plt-align affect result.
2915 (Stub_table::plt_call_size): Calculate sizes for various stubs.
2916 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
2917 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
2918 (Stub_table::do_write): Support more stub variants.
2919
f43ba157
AM
29202012-12-04 Alan Modra <amodra@gmail.com>
2921
2922 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
2923 (Target_powerpc::do_define_standard_symbols): New function.
2924
34171bc5
AM
29252012-12-03 Alan Modra <amodra@gmail.com>
2926
2927 * output.h: Formatting, whitespace.
2928
dc9589e9 29292012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
2930
2931 * layout.h (Layout::get_executable_sections): Declare.
2932 * layout.cc (Layout::get_executable_sections): New function.
2933 * arm.cc (Target_arm::group_sections): Use it.
2934 (Arm_output_section::group_sections): Delete now redundant test.
2935 * output.cc (Output_reloc::Output_reloc): Add is_relative.
2936 param to handle relative relocs.
2937 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
2938 (Output_data_reloc::add_absolute): Adjust.
2939 (Output_data_reloc::add_relative): New function.
2940 (Output_data::reset_data_size): New function.
2941 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
2942 (Output_section::set_addralign): New function.
2943 (Output_section::checkpoint_set_addralign): New function.
2944 (Output_section::clear_section_offsets_need_adjustment): New function.
2945 (Output_section::input_sections): Make public.
2946 * powerpc.cc (class Output_data_brlt_powerpc): New.
2947 (class Stub_table, class Stub_control): New.
2948 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
2949 stub_table_, set_stub_table, stub_table): New vectors and accessor
2950 functions.
2951 (Target_powerpc::do_may_relax, do_relax, push_branch,
2952 new_stub_table, stub_tables, brlt_section, group_sections,
2953 add_branch_lookup_table, find_branch_lookup_table,
2954 write_branch_lookup_table, make_brlt_section): New functions.
2955 (Target_powerpc::struct Sort_sections, class Branch_info): New.
2956 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
2957 branch_info_): New vars.
2958 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
2959 make call stubs here.
2960 (Output_data_glink): Remove all call stub handling from this class.
2961 (Target_powerpc::Scan::local, global): Save interesting branch
2962 relocs and relocs for ifunc. Adjust calls to plt entry functions.
2963 (Target_powerpc::do_finalize_sections): Only make reg save/restore
2964 functions on final link.
2965 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
2966 Handle long branch destinations too.
2967 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
2968 do_plt_address_for_local): Adjust lookup of plt call stubs.
2969
627b30b7
AM
29702012-11-30 Alan Modra <amodra@gmail.com>
2971
2972 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
2973 relocs against protected symbols when building 32-bit shared libs.
2974
40b469d7
AM
29752012-11-30 Alan Modra <amodra@gmail.com>
2976
2977 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
2978 param. Call got_section() to make .got. Update all callers
2979 and their callers and so on.
2980
bb66a627
AM
29812012-11-30 Alan Modra <amodra@gmail.com>
2982
2983 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
2984 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
2985 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
2986 value if it already exists.
2987
d2cf1c6c
L
29882012-11-19 H.J. Lu <hongjiu.lu@intel.com>
2989
2990 PR gold/14858
2991 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
2992
edccdf7c
RM
29932012-11-14 Roland McGrath <mcgrathr@google.com>
2994
2995 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
2996 than bfc instruction for data sandboxing.
2997
6febeb74
AM
29982012-11-08 Alan Modra <amodra@gmail.com>
2999
3000 * po/POTFILES.in: Regenerate.
3001
0a6f1bf2
AM
30022012-11-05 Alan Modra <amodra@gmail.com>
3003
3004 * configure.ac: Apply 2012-09-10 change to config.in here.
3005 * configure: Regenerate.
3006
26a4e9cb
AM
30072012-11-05 Alan Modra <amodra@gmail.com>
3008
3009 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
3010 (struct Opd_ent): Use "Address" rather than "Offset".
3011 (Output_data_got_powerpc::got_base_offset): Return Valtype.
3012 (Target_powerpc::got_section): Make public.
3013 (Target_powerpc::scan_relocs): Move code setting symbols..
3014 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
3015 Create _SDA_BASE_ only when referenced.
3016
cc928013
RM
30172012-11-02 Roland McGrath <mcgrathr@google.com>
3018
3019 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
3020 from last change.
3021
50ed5eb1
RM
30222012-11-01 Roland McGrath <mcgrathr@google.com>
3023
62fe925a
RM
3024 * target.h (Sized_target::relocate_relocs): Use Elf_Off
3025 for offset_in_output_section parameter.
3026 (Sized_target::relocate_special_relocatable): Likewise.
3027 * arm.cc (Target_arm::relocate_relocs): Likewise.
3028 (Target_arm::relocate_special_relocatable): Likewise.
3029 * i386.cc (Target_i386::relocate_relocs): Likewise.
3030 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
3031 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
3032 * target-reloc.h (relocate_relocs): Likewise.
3033 * testsuite/testfile.cc (Target_test): Likewise.
3034 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
3035 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
3036
3037 * system.h: Move inclusion of <clocale> to after <libintl.h> in
3038 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
3039
3040 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
3041 parameter, which is unused in the [!F_SETFD] case.
3042
50ed5eb1
RM
3043 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
3044 SYMNDX to off_t before comparing it to this->data_size().
3045 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
3046 * incremental.cc (Output_section_incremental_inputs::do_write):
3047 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
3048
2cadc0bf
RM
3049 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
3050
3bfcb652
NC
30512012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
3052
3053 * gold.cc (Target_arm::do_adjust_elf_header): Add the
3054 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
3055 in EABI_VER5.
3056
c1a8d56e
CC
30572012-10-29 Cary Coutant <ccoutant@google.com>
3058
3059 * dwp.cc (usage): Add file and exit status parameters;
3060 add --help and --version options.
3061 (print_version): New function.
3062 (main): Add --help and --version options.
3063
b2490a7b
L
30642012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3065
3066 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
3067 final_layout_sequence.txt.
3068 * testsuite/Makefile.in: Regenerated.
3069
aa543512
L
30702012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3071
3072 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
3073 COMPILE generated by automake.
3074 (LINK1): Likewise.
3075 (CXXCOMPILE1): Likewise.
3076 (CXXLINK1): Likewise.
3077 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
3078 (LINK): Likewise.
3079 (CXXCOMPILE): Likewise.
3080 (CXXLINK): Likewise.
3081 * testsuite/Makefile.in: Regenerated.
3082
d361fafb
L
30832012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3084
3085 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
3086 on bad fwrite return.
3087
598c7410
L
30882012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3089
3090 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
3091 on val.
3092
35c813e2
CC
30932012-10-23 Cary Coutant <ccoutant@google.com>
3094
3095 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
3096 * testsuite/Makefile.in: Regenerate.
3097 * testsuite/dwp_test.h: New source file.
3098 * testsuite/dwp_test_1.cc: New source file.
3099 * testsuite/dwp_test_1.s: New source file.
3100 * testsuite/dwp_test_1.sh: New source file.
3101 * testsuite/dwp_test_1b.cc: New source file.
3102 * testsuite/dwp_test_1b.s: New source file.
3103 * testsuite/dwp_test_2.cc: New source file.
3104 * testsuite/dwp_test_2.s: New source file.
3105 * testsuite/dwp_test_2.sh: New source file.
3106 * testsuite/dwp_test_main.cc: New source file.
3107 * testsuite/dwp_test_main.s: New source file.
3108
77429909
CC
31092012-10-23 Cary Coutant <ccoutant@google.com>
3110
3111 * dwp.h: New header file.
3112 * dwp.cc: New source file.
3113 * gold.h: Move shared declarations to system.h.
3114 * system.h: New header file.
3115 * Makefile.am: Add dwp.
3116 * Makefile.in: Regenerate.
3117
ed5d6712
CC
31182012-10-23 Cary Coutant <ccoutant@google.com>
3119
3120 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
3121 Dwarf_info_reader::read_from_pointer.
3122 (Dwarf_pubnames_table::read_header): Likewise.
3123 (Dwarf_pubnames_table::next_name): Likewise.
3124 (Dwarf_die::read_attributes): Likewise.
3125 (Dwarf_die::skip_attributes): Likewise.
3126 (Dwarf_info_reader::read_from_pointer): New function template.
3127 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
3128 (Dwarf_pubnames_table): Likewise.
3129 (Dwarf_info_reader::read_from_pointer): New function template.
3130 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
3131 Dwarf_pubnames_table ctor.
3132
8787852d
CC
31332012-10-23 Cary Coutant <ccoutant@google.com>
3134
3135 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
3136 abbrev_shndx.
3137 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
3138 abbrev_shndx_.
3139 (Dwarf_info_reader::set_abbrev_shndx): New method.
3140 (Dwarf_info_reader::abbrev_shndx_): New data member.
3141
9fc236f3
CC
31422012-10-23 Cary Coutant <ccoutant@google.com>
3143
3144 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
3145 from object, not parameters.
3146 (Dwarf_info_reader::parse): Likewise.
3147 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
3148 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
3149 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
3150 methods.
3151
effe8365
CC
31522012-10-23 Cary Coutant <ccoutant@google.com>
3153
3154 * fileread.cc (Input_file::Input_file): New constructor.
3155 * fileread.h (class Input_file): Add new constructor.
3156
1698990d
AM
31572012-10-18 Alan Modra <amodra@gmail.com>
3158
3159 PR gold/14727
3160 * object.cc (Relobj::is_section_name_included): Also match
3161 .sdata personality section.
3162
168a4726
AM
31632012-10-18 Alan Modra <amodra@gmail.com>
3164
3165 * target-reloc.h (class Default_comdat_behavior): New, package up..
3166 (get_comdat_behaviour): ..this.
3167 (relocate_section): Add Relocate_comdat_behavior template arg,
3168 adjust code to suit.
3169 * arm.cc (Target_arm::relocate_section): Adjust to suit.
3170 (Target_arm::scan_reloc_section): Likewise.
3171 * i386.cc (Target_i386::relocate_section): Likewise.
3172 * sparc.cc (Target_sparc::relocate_section): Likewise.
3173 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
3174 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
3175 * powerpc.cc (class Relocate_comdat_behavior): New.
3176 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
3177 gold::relocate_section with new template arg.
3178
acc276d8
AM
31792012-10-18 Alan Modra <amodra@gmail.com>
3180
3181 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
3182 dynamic relocs for GOT_TPREL got entries, without symbol if
3183 resolving locally.
3184 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
3185 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
3186 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
3187
e10f9870
AM
31882012-10-17 Alan Modra <amodra@gmail.com>
3189
3190 PR gold/14726
3191 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
3192
ae034989
ST
31932012-10-16 Sriraman Tallam <tmsriram@google.com>
3194
3195 * layout.cc (Layout::include_section): Keep sections marked
3196 SHF_EXCLUDE when doing relocatable links.
3197
f3a0ed29
AM
31982012-10-16 Alan Modra <amodra@gmail.com>
3199
3200 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
3201 (Target_powerpc::do_finalize_sections): Call it.
3202 (Output_data_save_res): New class and supporting functions.
3203 (Target_powerpc::symval_for_branch): Only look up .opd entry for
3204 normal symbols defined in object files.
3205
c6de8ed4
AM
32062012-10-12 Alan Modra <amodra@gmail.com>
3207
3208 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
3209 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
3210 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
3211 section if scan_opd_relocs not yet called.
3212 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
3213
03e25981
AM
32142012-10-12 Alan Modra <amodra@gmail.com>
3215
3216 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3217 add_local_ifunc_entry): Revert last change.
3218 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
3219
c9824451
AM
32202012-10-05 Alan Modra <amodra@gmail.com>
3221
3222 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
3223 do_plt_address_for_global): New functions.
3224 (Output_data_got_powerpc::do_write): Don't segfault when linking
3225 statically.
3226 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3227 add_local_ifunc_entry): Return true on adding entry..
3228 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
3229 glink->add_entry call. Remove unused symtab param. Adjust calls.
3230 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
3231 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
3232 set up symbols here.
3233 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
3234 syms here. Do so even when no .iplt. Don't segfault when linking
3235 statically.
3236 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
3237 new variants without reloc param.
3238 (Glink_sym_ent::Glink_sym_ent): Likewise.
3239 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
3240 reloc when refs will resolve to plt call stub.
3241 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
3242 R_PPC_PLTREL24 to resolve locally.
3243 (Target_powerpc::Scan::global): Correct ifunc handling.
3244 (Target_powerpc::Relocate::relocate): Correct local sym glink
3245 lookup. Don't destroy "value" when we have a plt call stub,
3246 and when checking plt call validity.
3247 (Target_powerpc::do_dynsym_value): Simplify.
3248
19fec8c1
AM
32492012-10-05 Alan Modra <amodra@gmail.com>
3250
3251 * i386.cc (Output_data_plt_i386::address_for_global,
3252 address_for_local): Add plt offset to returned value. Adjust uses.
3253 * sparc.cc (Output_data_plt_sparc::address_for_global,
3254 address_for_local): Likewise.
3255 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
3256 address_for_local): Likewise.
3257 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
3258 address_for_local): Likewise.
3259 * target.h (Target::plt_address_for_global, plt_address_for_local):
3260 Update comment.
3261 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
3262 (Output_data_got::Got_entry::write): Nor here.
3263 * output.h: Comment fix.
3264
e867b647
WL
32652012-10-02 Jiong Wang <jiwang@tilera.com>
3266
3267 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
3268 global_offset_table_ value for larget got.
3269 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
3270
e5d5f5ed
AM
32712012-09-29 Alan Modra <amodra@gmail.com>
3272
3273 * powerpc.cc (Target_powerpc::iplt_): New output section.
3274 (Target_powerpc::iplt_section, make_iplt_section,
3275 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
3276 (Target_powerpc::make_plt_entry): Handle ifunc syms.
3277 Target_powerpc::plt_entry_count): Count iplt entries too.
3278 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
3279 reloc section in constructor. New params.
3280 (Target_powerpc::make_plt_section): Create reloc section here instead.
3281 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
3282 functions.
3283 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
3284 (Output_data_glink::add_entry, find_entry): New functions to
3285 deal with local syms.
3286 (Glink_sym_ent): Add support for local syms.
3287 (Output_data_glink::do_write): Handle ifunc plt entries.
3288 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3289 (Target_powerpc::Scan::local, global): Handle ifunc syms.
3290 (Target_powerpc::Relocate::relocate): Likewise.
3291 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
3292
ec4dbad3
AM
32932012-09-25 Alan Modra <amodra@gmail.com>
3294
3295 * object.h (Sized_relobj_file::adjust_local_symbol,
3296 do_adjust_local_symbol): New functions.
3297 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
3298 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
3299 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
3300 and irregular opd entry spacing.
3301 (Powerpc_relobj::do_read_relocs): Add opd size checks.
3302 (Global_symbol_visitor_opd): New functor.
3303 (Target_powerpc::do_finalize_sections): Omit global symbols defined
3304 on deleted opd entries.
3305
5c0b3823
WL
33062012-09-15 Jiong Wang <jiwang@tilera.com>
3307
3308 * tilegx.cc: New file.
3309 * Makefile.am (TARGETSOURCES): Add tilegx.cc
3310 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
3311 * configure.tgt: Add entries for tilegx*.
3312 * configure.ac: Likewise.
3313 * Makefile.in: Rebuild.
3314 * configure: Likewise.
3315 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
3316 tilegx.
3317
bfdfa4cd
AM
33182012-09-13 Alan Modra <amodra@gmail.com>
3319
3320 * target-reloc.h (scan_relocs): Call scan.local for relocs
3321 against symbols in discarded sections. Pass is_discarded
3322 param.
3323 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
3324 Add is_discarded param.
3325 * powerpc (Target_powerpc::Scan::local): Likewise. Use
3326 is_discarded to flag opd entry as discarded. Don't emit dyn
3327 relocs on such entries.
3328 (Target_powerpc::Scan::global): Similarly detect and handle
3329 such opd entries.
3330 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
3331 opd_ent_. Update all uses.
3332 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
3333 (Target_powerpc::relocate_section): Zero out discarded opd
3334 entry relocs.
3335
d77a0555
ILT
33362012-09-12 Ian Lance Taylor <iant@google.com>
3337
3338 PR gold/14570
3339 * output.cc: Rename Output_data_got template parameter from size
3340 to got_size for all functions. Compile all variants of
3341 Output_data_got.
3342 (Output_data_got::Got_entry::write): Correct use of size for
3343 symbol value. Use local_is_tls rather than casting to
3344 Sized_relobj_file.
3345 * object.h (class Object): Add local_is_tls and do_local_is_tls.
3346 (class Sized_relobj_file): Add do_local_is_tls.
3347 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
3348
815a1205
AM
33492012-09-11 Alan Modra <amodra@gmail.com>
3350
3351 PR gold/14566
3352 * layout.cc (Layout::set_segment_offsets): When using
3353 common-page-size alignment, ensure we are on a new max-page-size
3354 page.
3355 * output.cc (Output_segment::set_section_addresses): Use
3356 abi_pagesize, not common_pagesize for relro boundary.
3357 (Output_segment::set_offset): Likewise.
3358
bd73a62d
AM
33592012-09-11 Alan Modra <amodra@gmail.com>
3360
3361 * output.h (Output_data_got::add_global_tls, add_local_tls,
3362 add_local_tls_pair): New functions.
3363 (Output_data_got::add_local_pair_with_rel): Remove second
3364 reloc param. Expand comment.
3365 (Output_data_got::Got_entry): Rename use_plt_offset_ to
3366 use_plt_or_tls_offset_, similarly for constructor param.
3367 (Output_data_got::Got_entry::write): Add got_index param.
3368 * output.cc (Output_data_got::add_global_tls, add_local_tls,
3369 add_local_tls_pair): New functions.
3370 (Output_data_got::Got_entry::write): Handle tls symbols
3371 with use_plt_or_tls_offset_ set specially.
3372 (Output_data_got::add_local_pair_with_rel): Only one reloc.
3373 (Output_data_got::do_write): Replace iterator with index, pass
3374 index to entry write function.
3375 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
3376 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
3377 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
3378 call.
3379 * i386.cc (Target_i386::Scan::local): Likewise.
3380 * sparc.cc (Target_sparc::Scan::local): Likewise.
3381 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
3382 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
3383 do_tls_offset_for_global): New functions.
3384 (Target_powerpc::Scan::local): Correct TLS relocations and got
3385 entry values.
3386 (Target_powerpc::Scan::global): Don't emit unnecessary
3387 dynamic relocations on TLS GOT entries.
3388
00716ab1
AM
33892012-09-10 Matthias Klose <doko@ubuntu.com>
3390
3391 * config.in: Disable sanity check for kfreebsd.
3392
c891b3f9
SA
33932012-09-10 Sterling Augustine <saugustine@google.com>
3394
3395 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
3396 (Gdb_index::pubtypes_read): New parameter.
3397 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
3398 to calls.
3399 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
3400 pubtypes_object_.
3401
e81fea4d
AM
34022012-09-09 Alan Modra <amodra@gmail.com>
3403
3404 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
3405 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
3406 * gc.h (gc_process_relocs): Call target gc_add_reference.
3407 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
3408 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
3409 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
3410 unnecessary cast.
3411 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
3412 to cater for when we don't need code offset. Update use.
3413 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
3414 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
3415 set_opd_valid): New functions.
3416 (Target_powerpc::do_gc_add_reference): New function.
3417 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
3418 stashed refs.
3419 (Target_powerpc::do_gc_mark_symbol): New function.
3420
d2d60eef
CC
34212012-09-06 Cary Coutant <ccoutant@google.com>
3422
3423 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
3424 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
3425 (Dwarf_die::skip_attributes): Likewise.
3426 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
3427 * testsuite/gdb_index_test.cc (inline_func_1): New function.
3428 (main): Call it.
3429 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
3430
32ed4573
L
34312012-09-05 H.J. Lu <hongjiu.lu@intel.com>
3432
3433 * testsuite/script_test_3.t: Add .got.plt output section
3434 statement.
3435 * testsuite/script_test_4.t: Likewise.
3436
f4baf0d4
AM
34372012-09-05 Alan Modra <amodra@gmail.com>
3438
3439 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
3440 update all uses and lose "enum" when using type.
3441
864a1b56
AM
34422012-09-05 Alan Modra <amodra@gmail.com>
3443
3444 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
3445 * configure: Regenerate.
3446 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
3447 (plugin_final_layout.stdout): Likewise.
3448 (memory_test): Set page sizes to 0x1000.
3449 * testsuite/Makefile.in: Regenerate.
3450 * testsuite/discard_locals_test.sh: Add FIXME comment.
3451 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
3452 * testsuite/pr14265.t: Add .got output section statement.
3453 * testsuite/script_test_2.t: Likewise.
3454 * testsuite/script_test_3.t: Likewise.
3455 * testsuite/script_test_4.t: Likewise.
3456 * testsuite/script_test_5.t: Likewise.
3457 * testsuite/script_test_6.t: Likewise.
3458 * testsuite/script_test_7.t: Likewise.
3459 * testsuite/script_test_9.t: Likewise.
3460
3ea0a085
AM
34612012-09-05 Alan Modra <amodra@gmail.com>
3462
3463 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
3464 (Powerpc_relocate_functions::Status): New typedef.
3465 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3466 (Target_powerpc::Scan::local): Handle REL64.
3467 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
3468 for REL32 and REL64.
3469 (Target_powerpc::symval_for_branch): New function, extracted from..
3470 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
3471 checks. Report overflow errors.
3472
7404fe1b
AM
34732012-09-05 Alan Modra <amodra@gmail.com>
3474
3475 * object.h (Sized_relobj_file::emit_relocs): Delete.
3476 (Sized_relobj_file::emit_relocs_reltype): Delete.
3477 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
3478 relocate_relocs for --emit-relocs.
3479 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
3480 * output.h: Update comment.
3481 (Output_segment::first_section): New function.
3482 (Output_segment::first_section_load_address): Use first_section.
3483 * output.cc (Output_segment::first_section): New function extracted..
3484 (Output_segment::first_section_load_address): ..from here. Delete.
3485 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
3486 * target.h (Sized_target::relocate_for_relocatable): Likewise.
3487 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
3488 adjust call to target.h function.
3489 * i386.cc (Target_i386): Likewise.
3490 * sparc.cc (Target_sparc): Likewise.
3491 * x86_64.cc (Target_x86_64): Likewise.
3492 * powerpc.cc (Target_powerpc): Likewise.
3493 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
3494 first tls section has section symbol for optimised local dynamic
3495 output relocs.
3496 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
3497 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
3498 optimised tls code.
3499 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
3500 Rename to relocate_relocs. Update error message.
3501
957564c9
AS
35022012-09-04 Andreas Schwab <schwab@linux-m68k.org>
3503
3504 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
3505 --just-symbols.
3506
dd93cd0a
AM
35072012-08-31 Alan Modra <amodra@gmail.com>
3508
3509 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
3510 (Powerpc_relobj::toc_base_offset): New stub function.
3511 (Target_powerpc): Add tp_offset, dtp_offset. Rename
3512 got_mod_index_offset to tlsld_got_offset. Update all refs.
3513 (Target_powerpc::Relocate::enum skip_tls): New.
3514 (Target_powerpc::call_tls_get_addr_): New var.
3515 (Target_powerpc::is_branch_reloc): Move to file scope.
3516 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
3517 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
3518 New functions.
3519 (Target_powerpc::enum Got_type): Delete old values, add new ones.
3520 (powerpc_info): Correct common_pagesize for ppc64.
3521 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
3522 (Powerpc_relocate_functions): Add overflow check enums and functions.
3523 Add non-shift version of rela, rela_ua. Delete all rel public
3524 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
3525 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
3526 addr16_ha3, addr14 functions.
3527 (Output_data_got_powerpc::add_constant_pair): New function.
3528 (Output_data_got_powerpc::got_base_offset): Likewise.
3529 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
3530 (instruction constants): Sort, add some more.
3531 (Output_data_glink::do_write): Add and use Address typedef. Use
3532 object->toc_base_offset() stub for 64-bit.
3533 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
3534 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3535 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
3536 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
3537 Always treat .opd relocs as against locally defined symbol.
3538 Correct condition for RELATIVE relocs.
3539 (Target_powerpc::do_finalize_sections): Test for NULL sections.
3540 (Target_powerpc::Relocate::relocate): Use plt call stub as value
3541 for 32-bit syms with a plt entry. Correct ppc64 toc base
3542 calculations. Handle TLS relocs, and more. Add overflow
3543 checking and adjust for Powerpc_relocate_functions changes.
3544 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
3545 Reinstate --emit-relocs code with FIXME.
3546
a1373b60
AM
35472012-08-30 Alan Modra <amodra@gmail.com>
3548
3549 * layout.cc (Layout::set_segment_offsets): Set p_align to
3550 abi_pagesize, not common_pagesize.
3551 (Layout::relaxation_loop_body): Similarly use abi_pagesize
3552 to determine whether file header can go in segment.
3553
703d02da
AM
35542012-08-30 Alan Modra <amodra@gmail.com>
3555
3556 * output.h (Output_reloc::Output_reloc <output section>): Add
3557 is_relative param. Adjust calls.
3558 (Output_reloc::add_output_section_relative): New functions.
3559 * output.cc (Output_reloc::Output_reloc <output section>): Handle
3560 is_relative.
3561 (Output_reloc::symbol_value): Handle SECTION_CODE.
3562
16164a6b
ST
35632012-08-24 Sriraman Tallam <tmsriram@google.com>
3564
3565 * gold.cc (queue_middle_tasks): Call layout again when unique
3566 segments for sections is desired.
3567 * layout.cc (Layout::Layout): Initialize new members.
3568 (Layout::get_output_section_flags): New function.
3569 (Layout::choose_output_section): Call get_output_section_flags.
3570 (Layout::layout): Make output section for mapping to a unique segment.
3571 (Layout::insert_section_segment_map): New function.
3572 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 3573 output sections marked so.
16164a6b
ST
3574 (Layout::segment_precedes): Check for unique segments when sorting.
3575 * layout.h (Layout::Unique_segment_info): New struct.
3576 (Layout::Section_segment_map): New typedef.
3577 (Layout::insert_section_segment_map): New function.
3578 (Layout::get_output_section_flags): New function.
3579 (Layout::is_unique_segment_for_sections_specified): New function.
3580 (Layout::set_unique_segment_for_sections_specified): New function.
3581 (Layout::unique_segment_for_sections_specified_): New member.
3582 (Layout::section_segment_map_): New member.
3583 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
3584 Rename is_gc_pass_one to is_pass_one.
3585 Rename is_gc_pass_two to is_pass_two.
3586 Rename is_gc_or_icf to is_two_pass.
3587 Check for which pass based on whether symbols data is present.
3588 Make it two pass when unique segments for sections is desired.
3589 * output.cc (Output_section::Output_section): Initialize new
3590 members.
3591 * output.h (Output_section::is_unique_segment): New function.
3592 (Output_section::set_is_unique_segment): New function.
3593 (Output_section::is_unique_segment_): New member.
3594 (Output_section::extra_segment_flags): New function.
3595 (Output_section::set_extra_segment_flags): New function.
3596 (Output_section::extra_segment_flags_): New member.
3597 (Output_section::segment_alignment): New function.
3598 (Output_section::set_segment_alignment): New function.
3599 (Output_section::segment_alignment_): New member.
3600 (Output_segment::Output_segment): Initialize is_unique_segment_.
3601 (Output_segment::is_unique_segment): New function.
3602 (Output_segment::set_is_unique_segment): New function.
3603 (Output_segment::is_unique_segment_): New member.
3604 * plugin.cc (allow_unique_segment_for_sections): New function.
3605 (unique_segment_for_sections): New function.
3606 (Plugin::load): Add new functions to transfer vector.
3607 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
3608 * Makefile.in: Regenerate.
3609 * testsuite/plugin_final_layout.sh: Check if unique segment
3610 functionality works.
3611 * testsuite/plugin_section_order.c (onload): Check if new interfaces
3612 are available.
3613 (allow_unique_segment_for_sections): New global.
3614 (unique_segment_for_sections): New global.
3615 (claim_file_hook): Call allow_unique_segment_for_sections.
3616 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 3617
1e2bee4f
CC
36182012-08-22 Cary Coutant <ccoutant@google.com>
3619
3620 * layout.cc (Layout::include_section): Don't assert on GROUP
3621 sections with --emit-relocs.
3622
1d5dfe78
CC
36232012-08-21 Cary Coutant <ccoutant@google.com>
3624
3625 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
3626 if --export-dynamic-symbol names an undef symbol.
3627
c9269dff
AM
36282012-08-18 Alan Modra <amodra@gmail.com>
3629
3630 * powerpc.cc: Formatting and white space.
3631 (Powerpc_relobj): Rename got2_section_ to special_.
3632 Add opd_ent_shndx_ and opd_ent_off_ vectors.
3633 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
3634 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
3635 (Target_powerpc): Add Address typedef and invalid_address. Use
3636 throughout.
3637 (Target_powerpc::is_branch_reloc): New function.
3638 (Powerpc_relocate_functions): Add Address typedef, use throughout.
3639 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
3640 for dst_mask, value and addend.
3641 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
3642 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
3643 (Output_data_glink::do_write): Correct toc base. Don't try to use
3644 uint16_t for 24-bit offset. Use get_output_section_offset and
3645 check return.
3646 (Target_powerpc::Scan::local): Handle more relocs.
3647 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
3648 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
3649 Plug in toc restoring insn after plt calls. Translate branches
3650 to function descriptor symbols to corresponding entry point.
3651 (Target_powerpc::relocate_for_relocatable): Check return from
3652 get_output_section_offset.
3653 * symtab.h: Comment typo.
3654
b1759dce
ILT
36552012-08-14 Ian Lance Taylor <iant@google.com>
3656
3657 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
3658 unsupported_relocal_local to call unsupported_reloc_global.
3659
b9b2ae8b
NC
36602012-08-14 Nick Clifton <nickc@redhat.com>
3661
3662 PR ld/14265
3663 * script-sections.cc (Sections_element::output_section_name): Add
3664 keep return parameter.
3665 (Output_section_element::match_name): Add keep return parameter.
3666 Return the value of the keep_ member.
3667 * script-sections.h (class Output_section): Update
3668 output_section_name prototype.
3669 * layout.cc (Layout::keep_input_section): New public member
3670 function.
3671 (Layout::choose_output_section): Pass keep parameter to
3672 output_section_name.
3673 * layout.h (class Layout): Add keep_input_section.
3674 * object.cc (Sized_relobj_file::do_layout): Check for kept input
3675 sections.
3676 * testsuite/Makefile.am: Add a test.
3677 * testsuite/Makefile.in: Regenerate.
3678 * testsuite/pr14265.c: Source file for the test.
3679 * testsuite/pr14265.t: Linker script for the test.
3680 * testsuite/pr14265.sh: Shell script for the test.
3681
921b5322
AM
36822012-08-14 Alan Modra <amodra@gmail.com>
3683
3684 * target.h (Target::output_section_name): New function.
3685 (Target::do_output_section_name): New function.
3686 * layout.cc (Layout::choose_output_section): Call the above.
3687 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
3688
6ce78956
AM
36892012-08-14 Alan Modra <amodra@gmail.com>
3690
3691 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
3692 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
3693 for replace_constant call.
3694 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
3695 (Output_data_glink::do_print_to_mapfile): New function.
3696 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
3697 (Target_powerpc::Relocate::relocate): Likewise.
3698
d1a8cabd
AM
36992012-08-14 Alan Modra <amodra@gmail.com>
3700
3701 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
3702 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
3703 (Output_data_glink::add_entry,find_entry): Remove shndx param.
3704 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
3705 all references to shndx_. Handle special case for R_PPC_PLTREL24
3706 here.
3707 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
3708 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
3709 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
3710 here.
3711 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
3712 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
3713
d83ce4e3
AM
37142012-08-12 Alan Modra <amodra@gmail.com>
3715
3716 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
3717 (glink insn constants): Use uint32_t.
3718 (Output_data_glink::add_entry): Use insert, not [] operator.
3719
cf43a2fe
AM
37202012-08-11 Alan Modra <amodra@gmail.com>
3721
3722 * object.h (Sized_relobj_file::find_shdr): New function.
3723 (Sized_relobj_file::find_special_sections): New function.
3724 * object.cc (Sized_relobj_file::find_shdr): New function.
3725 (Sized_relobj_file::find_eh_frame): Use find_shdr.
3726 (Sized_relobj_file::find_special_sections): New function, split out..
3727 (Sized_relobj_file::do_read_symbols): ..from here.
3728 * output.h (Output_data_got::replace_constant): New function.
3729 (Output_data_got::num_entries): New function.
3730 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
3731 (Output_data_got::got_offset): Protected rather than private.
3732 (Output_data_got::replace_got_entry): New function.
3733 * output.cc (Output_data_got::replace_got_entry): New function.
3734 * powerpc.cc (class Powerpc_relobj): New.
3735 (class Powerpc_relocate_functions): Delete all psymval variants or
3736 convert to value,addend type. Delete pcrela, pcrela_unaligned.
3737 Implement _ha functions using corresponding _hi function.
3738 (Powerpc_relobj::find_special_sections): New function.
3739 (Target_powerpc::do_make_elf_object): New function.
3740 (class Output_data_got_powerpc): New.
3741 (class Output_data_glink): New.
3742 (class Powerpc_scan_relocatable_reloc): New.
3743 Many more changes througout file.
3744
3c892704
NC
37452012-08-09 Nick Clifton <nickc@redhat.com>
3746
3747 * po/vi.po: Updated Vietnamese translation.
3748
82435b3b
ILT
37492012-08-07 Ian Lance Taylor <iant@google.com>
3750
3751 * layout.cc (Layout::add_target_dynamic_tags): If
3752 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
3753 plt_rel.
3754
a6dc81d2
NC
37552012-07-30 Nick Clifton <nickc@redhat.com>
3756
3757 * po/gold.pot: Updated template.
3758 * po/es.po: Updated Spanish translation.
3759
f1415016
CC
37602012-07-18 Cary Coutant <ccoutant@google.com>
3761
3762 PR gold/14344
3763 * configure.ac: Add check for -gpubnames support.
3764 * configure: Regenerate.
3765 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
3766 support; force -gno-pubnames.
3767 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
3768 support.
3769 (gdb_index_test_4): New test.
3770 * testsuite/Makefile.in: Regenerate.
3771 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
3772 * testsuite/gdb_index_test_2.sh: Likewise.
3773 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
3774 * testsuite/gdb_index_test_4.sh: New script.
3775 * testsuite/gdb_index_test_comm.sh: New script with common code;
3776 don't look for space after colon.
3777
b7fd7c37
ST
37782012-07-16 Sriraman Tallam <tmsriram@google.com>
3779
3780 * gold.cc (queue_middle_tasks): Update function order only after
3781 deferred objects due to plugins are processed.
3782
1f3212db
ILT
37832012-07-11 Ian Lance Taylor <iant@google.com>
3784
3785 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
3786 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
3787 (Target_arm::scan_reloc_for_stub): Likewise.
3788 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
3789 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
3790 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
3791 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
3792 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
3793
81c82a68
ILT
37942012-07-10 Dodji Seketeli <dodji@redhat.com>
3795 Ian Lance Taylor <iant@google.com>
3796
3797 PR gold/14309
3798 * configure.ac: Test whether std::tr1::hash<off_t> works.
3799 * gold.h: Add a specialization for std::tr1::hash<off_t> if
3800 needed.
3801 * output.h (class Output_fill): Add virtual destructor.
3802 * configure, config.in: Rebuild.
3803
eabc84f4
RM
38042012-06-22 Roland McGrath <mcgrathr@google.com>
3805
3806 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
3807
370e30b6
RÁE
38082012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
3809
3810 * plugin.cc (Plugin::load): Handle position independent executables.
3811
fb1b895d
CC
38122012-06-06 Cary Coutant <ccoutant@google.com>
3813
3814 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
3815 add .debug_macro.
3816 (lines_only_debug_sections): Likewise.
3817 (gdb_fast_lookup_sections): New static array.
3818 (is_gdb_debug_section): Rename formal parameter.
3819 (is_lines_only_debug_section): Likewise.
3820 (is_gdb_fast_lookup_section): New function.
3821 (Layout::include_section): Check for ".zdebug_" prefix; pass
3822 section name suffix to is_gdb_debug_section, et al.; check for
3823 fast-lookup sections when building .gdb_index.
3824 * options.h (--strip-debug-gdb): Update GDB version number.
3825
7c0640fa
CC
38262012-06-06 Cary Coutant <ccoutant@google.com>
3827
3828 * configure.ac: Add check for fallocate.
3829 * configure: Regenerate.
3830 * config.in: Regenerate.
3831
3832 * options.h (class General_options): Add --mmap-output-file and
3833 --posix-fallocate options.
3834 * output.cc: (posix_fallocate): Remove; replace with...
3835 (gold_fallocate): New function.
3836 (Output_file::map_no_anonymous): Call gold_fallocate.
3837 (Output_file::map): Check --mmap-output-file option.
3838
2a49eb69
DK
38392012-06-05 Jing Yu <jingyu@google.com>
3840
3841 * gold.h (textdomain): Add do {} to empty while(0).
3842 (bindtextdomain): Likewise.
3843
fad072ac
CC
38442012-06-04 Cary Coutant <ccoutant@google.com>
3845
3846 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
3847 has_dynsym_index.
3848
8cc69fb6
ST
38492012-05-25 Sriraman Tallam <tmsriram@google.com>
3850
3851 * symtab.cc (Symbol_table::define_special_symbol):
3852 Initialize *poldsym to prevent uninitialized variable errors.
3853
1be75daa
CC
38542012-05-23 Cary Coutant <ccoutant@google.com>
3855
3856 * layout.cc (Layout::section_name_mapping): Add rules to handle
3857 exact match on .data.rel.ro.local or .data.rel.ro.
3858 (Layout::output_section_name): Check for exact matches.
3859
9b689de0
CC
38602012-05-23 Cary Coutant <ccoutant@google.com>
3861
3862 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
3863 more carefully.
3864
b24fdbf5
CC
38652012-05-22 Cary Coutant <ccoutant@google.com>
3866
3867 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
3868 object before exporting symbol.
3869
e550e1a2
L
38702012-05-21 H.J. Lu <hongjiu.lu@intel.com>
3871
3872 * testsuite/tls_test.cc: Include "config.h" first.
3873 * testsuite/tls_test_c.c: Likewise.
3874
df7b86aa
NC
38752012-05-17 Daniel Richard G. <skunk@iskunk.org>
3876 Nick Clifton <nickc@redhat.com>
3877
3878 PR 14072
3879 * configure.in: Add check that sysdep.h has been included before
3880 any system header files.
3881 * configure: Regenerate.
3882 * config.in: Regenerate.
3883
1007b503
CC
38842012-05-14 Cary Coutant <ccoutant@google.com>
3885
3886 * layout.cc (Layout::make_output_section): Mark .tdata section
3887 as RELRO.
3888 * testsuite/relro_test.cc: Add a TLS variable.
3889
fd885f3a
L
38902012-05-10 H.J. Lu <hongjiu.lu@intel.com>
3891
3892 PR gold/14091
3893 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
3894 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
3895 R_X86_64_64.
3896
80f5885c
CC
38972012-05-08 Cary Coutant <ccoutant@google.com>
3898
3899 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
3900 (lines_only_debug_sections): Likewise.
3901
2e702c99
RM
39022012-05-02 Roland McGrath <mcgrathr@google.com>
3903
3904 * nacl.cc: New file.
3905 * nacl.h: New file.
3906 * Makefile.am (CCFILES, HFILES): Add them.
3907 * Makefile.in: Regenerate.
3908 * i386.cc (Output_data_plt_i386_nacl): New class.
3909 (Output_data_plt_i386_nacl_exec): New class.
3910 (Output_data_plt_i386_nacl_dyn): New class.
3911 (Target_i386_nacl): New class.
3912 (Target_selector_i386_nacl): New class.
3913 (target_selector_i386): Use it instead of Target_selector_i386.
3914 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
3915 (Target_x86_64_nacl): New class.
3916 (Target_selector_x86_64_nacl): New class.
3917 (target_selector_x86_64, target_selector_x32): Use it instead of
3918 Target_selector_x86_64.
3919 * arm.cc (Output_data_plt_arm_nacl): New class.
3920 (Target_arm_nacl): New class.
3921 (Target_selector_arm_nacl): New class.
3922 (target_selector_arm, target_selector_armbe): Use it instead of
3923 Target_selector_arm.
3924
3925 * target-select.cc (select_target): Take new Input_file* and off_t
3926 arguments, pass them on to recognize method of selector.
3927 * object.cc (make_elf_sized_object): Update caller.
3928 * parameters.cc (parameters_force_valid_target): Likewise.
3929 * incremental.cc (make_sized_incremental_binary): Likewise.
3930 * target-select.h: Update decl.
3931 (Target_selector::recognize): Take new Input_file* argument,
3932 pass it on to do_recognize.
3933 (Target_selector::do_recognize): Take new Input_file* argument.
3934 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
3935 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
3936 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
3937 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
3938
3939 * target.h (Target::Target_info): New members isolate_execinstr
3940 and rosegment_gap.
3941 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
3942 * arm.cc (Target_arm::arm_info): Update initializer.
3943 * i386.cc (Target_i386::i386_info): Likewise.
3944 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
3945 * sparc.cc (Target_sparc::sparc_info): Likewise.
3946 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
3947 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3948 * layout.cc (Layout::attach_allocated_section_to_segment):
3949 Take new const Target* argument. If target->isolate_execinstr(), act
3950 like --rosegment.
3951 (Layout::find_first_load_seg): Take new const Target* argument;
3952 if target->isolate_execinstr(), reject PF_X segments.
3953 (Layout::relaxation_loop_body): Update caller.
3954 (Layout::set_segment_offsets): If target->isolate_execinstr(),
3955 reset file offset to zero when we hit LOAD_SEG, and then do a second
3956 loop over the segments before LOAD_SEG to reassign offsets after
3957 addresses have been determined. Handle target->rosegment_gap().
3958 (Layout::attach_section_to_segment): Take new const Target* argument;
3959 pass it to attach_allocated_section_to_segment.
3960 (Layout::make_output_section): Update caller.
3961 (Layout::attach_sections_to_segments): Take new const Target* argument;
3962 pass it to attach_section_to_segment.
3963 * gold.cc (queue_middle_tasks): Update caller.
3964 * layout.h (Layout): Update method decls with new arguments.
3965
3966 * arm.cc (Target_arm::Target_arm): Take optional argument for the
3967 Target_info pointer to use.
3968 (Target_arm::do_make_data_plt): New virtual method.
3969 (Target_arm::make_data_plt): New method that calls it.
3970 (Target_arm::make_plt_entry): Use it.
3971 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
3972 for the section alignment.
3973 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
3974 method.
3975 (Output_data_plt_arm::first_plt_entry_offset): Call it.
3976 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
3977 method.
3978 (Output_data_plt_arm::get_plt_entry_size): Call it.
3979 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
3980 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
3981 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
3982 method.
3983 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
3984 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
3985 method instead of sizeof(plt_entry).
3986 (Output_data_plt_arm::add_entry): Likewise.
3987 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
3988 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
3989 than static method.
3990 (Target_arm::plt_entry_size): Likewise.
3991 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
3992 Move to ...
3993 (Output_data_plt_arm_standard): ... here, new class.
3994 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
3995 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
3996 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
3997
3998 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3999 Take additional argument for the PLT entry size.
4000 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
4001 Use get_plt_entry_size method rather than plt_entry_size variable.
4002 (Output_data_plt_x86_64::reserve_slot): Likewise.
4003 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
4004 (Output_data_plt_x86_64::add_entry): Likewise.
4005 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
4006 (Output_data_plt_x86_64::address_for_global): Likewise.
4007 (Output_data_plt_x86_64::address_for_local): Likewise.
4008 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4009 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
4010 Make method non-static.
4011 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
4012 method.
4013 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
4014 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
4015 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
4016 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
4017 virtual method.
4018 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
4019 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
4020 virtual method.
4021 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
4022 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
4023 virtual method.
4024 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
4025 (Output_data_plt_x86_64::plt_entry_size)
4026 (Output_data_plt_x86_64::first_plt_entry)
4027 (Output_data_plt_x86_64::plt_entry)
4028 (Output_data_plt_x86_64::tlsdesc_plt_entry)
4029 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
4030 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
4031 (Output_data_plt_x86_64_standard): ... here, new class.
4032 (Target_x86_64::Target_x86_64): Take optional argument for the
4033 Target_info pointer to use.
4034 (Target_x86_64::do_make_data_plt): New virtual method.
4035 (Target_x86_64::make_data_plt): New method to call it.
4036 (Target_x86_64::init_got_plt_for_update): Use that.
4037 Call this->plt_->add_eh_frame method here.
4038 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
4039 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
4040 rather than static method.
4041 (Target_x86_64::plt_entry_size): Likewise.
4042 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
4043 rather than plt_entry_size variable. Move guts of PLT filling to...
4044 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
4045 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
4046 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
4047
4048 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
4049 additional argument for the section alignment.
4050 Don't do add_eh_frame_for_plt here.
4051 (Output_data_plt_i386::first_plt_entry_offset): Make the method
4052 non-static. Use get_plt_entry_size method rather than plt_entry_size
4053 variable.
4054 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
4055 method.
4056 (Output_data_plt_i386::get_plt_entry_size): Call it.
4057 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
4058 (Output_data_plt_i386::add_eh_frame): New method to call it.
4059 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
4060 method.
4061 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
4062 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
4063 method.
4064 (Output_data_plt_i386::fill_plt_entry): New method to call it.
4065 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
4066 method instead of plt_entry_size.
4067 (Output_data_plt_i386::plt_entry_size)
4068 (Output_data_plt_i386::plt_eh_frame_fde_size)
4069 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
4070 (Output_data_plt_i386_standard): ... here, new class.
4071 (Output_data_plt_i386_exec): New class.
4072 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
4073 (Output_data_plt_i386_exec::first_plt_entry): ... here.
4074 (Output_data_plt_i386::exec_plt_entry): Move to ...
4075 (Output_data_plt_i386_exec::plt_entry): ... here.
4076 (Output_data_plt_i386_dyn): New class.
4077 (Output_data_plt_i386::first_plt_entry): Move to ...
4078 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
4079 (Output_data_plt_i386::dyn_plt_entry): Move to ...
4080 (Output_data_plt_i386_dyn::plt_entry): ... here.
4081 (Target_i386::Target_i386): Take optional argument for the Target_info
4082 pointer to use.
4083 (Target_i386::do_make_data_plt): New virtual method.
4084 (Target_i386::make_data_plt): New method to call it.
4085 (Target_i386::make_plt_section): Use that.
4086 Call this->plt_->add_eh_frame method here.
4087 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
4088 rather than plt_entry_size variable.
4089 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
4090 (Output_data_plt_i386::address_for_local): Likewise.
4091 (Output_data_plt_i386::do_write): Likewise.
4092 Move guts of PLT filling to...
4093 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
4094 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
4095 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
4096 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
4097
b9b9f2ee
CC
40982012-05-01 Cary Coutant <ccoutant@google.com>
4099
4100 * dwarf_reader.cc (Dwarf_die::read_attributes)
4101 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
4102 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
4103 * reduced_debug_output.cc
4104 (Output_reduced_debug_info_section::get_die_end): Remove
4105 DW_FORM_GNU_ref_index. Add default case.
4106
57923f48
MW
41072012-04-26 Mark Wielaard <mjw@redhat.com>
4108
4109 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
4110 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
4111 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
4112 DW_AT_high_pc as offset from DW_AT_low_pc.
4113
4114 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
4115 * testsuite/Makefile.in: Regenerate.
4116 * testsuite/gdb_index_test_3.c: New test source file.
4117 * testsuite/gdb_index_test_3.sh: New test source file.
4118
2c54b4f4
ILT
41192012-04-25 Ian Lance Taylor <iant@google.com>
4120
4121 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
4122 pointer.
4123 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
4124 as a class, not a struct.
4125 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
4126 (Target_arm::apply_cortex_a8_workaround): Likewise.
4127 * gc.h: Declare Reloc_types as a struct, not a class.
4128 * object.h: Declare Symbols_data as a struct.
4129 * reloc.h: Declare Read_relocs_data as a struct.
4130 * target.h: Declare Relocate_info as a struct.
4131
a5a5f7a3
DM
41322012-04-24 David S. Miller <davem@davemloft.net>
4133
4134 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
4135 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
4136 and R_SPARC_WPLT30.
4137
f038d496
CC
41382012-04-24 Cary Coutant <ccoutant@google.com>
4139
4140 * incremental-dump.cc (find_input_containing_global): Replace
4141 magic number with symbolic constant.
4142 (dump_incremental_inputs): Update version number.
4143 * incremental.cc (Output_section_incremental_inputs): Update version
4144 number; import symbolic constants from Incremental_inputs_reader.
4145 (Incremental_inputs::create_data_sections): Align relocations
4146 section correctly for 64-bit targets.
4147 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
4148 constants; add padding.
4149 (Output_section_incremental_inputs::write_header): Add assert for
4150 header_size.
4151 (Output_section_incremental_inputs::write_input_files): Add assert
4152 for input_entry_size.
4153 (Output_section_incremental_inputs::write_info_blocks): Add padding;
4154 add assert for object_info_size, input_section_entry_size,
4155 global_sym_entry_size.
4156 * incremental.h (Incremental_inputs_reader): Add symbolic constants
4157 for data structure sizes; use them.
4158 (Incremental_input_entry_reader): Import symbolic constants from
4159 Incremental_inputs_reader; use them.
4160
a4d85145
DM
41612012-04-23 David S. Miller <davem@davemloft.net>
4162
4163 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
4164 and elf_flags_set_.
4165 (Target_sparc::Target_sparc): Initialize new fields.
4166 (Target_sparc::do_make_elf_object): New function.
4167 (Target_sparc::do_adjust_elf_header): New function.
4168
1d509098
CC
41692012-04-23 Cary Coutant <ccoutant@google.com>
4170
4171 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
4172 CU range table of gdb index.
4173
7ebeff7f
DM
41742012-04-20 David S. Miller <davem@davemloft.net>
4175
4176 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
4177 instead of false.
4178
13cf9988
DM
41792012-04-16 David S. Miller <davem@davemloft.net>
4180
2a1079e8
DM
4181 * sparc.cc (Target_sparc::got_address): New function.
4182 (Sparc_relocate_functions::gdop_hix22): New function.
4183 (Sparc_relocate_functions::gdop_lox10): New function.
4184 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
4185 relocs.
4186 (Target_sparc::Scan::local): Likewise if the global symbol is not
4187 preemptible and is not IFUNC.
4188 (Target_sparc::Relocate::relocate): Perform GOTDATA code
4189 transformations for local and non-preemptible non-IFUNC global
4190 symbols.
4191
0bc964fc
DM
4192 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
4193 writing out 64-bit part of ranges.
4194
661d7a80
DM
4195 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
4196 -fpic and -fpie respectively.
4197 * Makefile.in: Regenerate.
4198
8c2bf391
DM
4199 * sparc.cc (class Target_sparc): Add rela_ifunc_.
4200 (Target_sparc::Target_sparc): Initialize new field.
4201 (Target_sparc::do_plt_section_for_global): New function.
4202 (Target_sparc::do_plt_section_for_local): New function.
4203 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
4204 (Target_sparc::make_plt_section): New function, broken out of
4205 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
4206 (Target_sparc::make_plt_entry): Call make_plt_section.
4207 (Target_sparc::make_local_ifunc_plt_entry): New function.
4208 (Target_sparc::rela_ifunc_section): New function.
4209 (Target_sparc::plt_section): Remove const.
4210 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
4211 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
4212 and ifunc_count_ fields.
4213 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
4214 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
4215 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
4216 (Output_data_plt_sparc::rela_ifunc): New function.
4217 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
4218 (Output_data_plt_sparc::has_ifunc_section): New function.
4219 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
4220 (Output_data_plt_sparc::address_for_global): New function.
4221 (Output_data_plt_sparc::address_for_local): New function.
4222 (Output_data_plt_sparc::plt_index_to_offset): New function.
4223 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
4224 and entry_count.
4225 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
4226 entry_count.
4227 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
4228 R_SPARC_JMP_IREL to switch.
4229 (Target_sparc::Scan::check_non_pic): Likewise.
4230 (Target_sparc::Scan::local): Handle IFUNC symbols.
4231 (Target_sparc::Scan::local): Likewise.
4232 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
4233 and plt_address_for_local.
4234 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
4235 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
4236
13cf9988
DM
4237 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
4238 (class Output_data_reloc): Adjust calls to Output_reloc_type.
4239 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
4240 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
4241 global relocs too.
4242 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
4243 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
4244 calls.
4245 * sparc.cc (Target_sparc::Scan::global): Likewise.
4246 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4247
31821be0
CC
42482012-04-16 Cary Coutant <ccoutant@google.com>
4249
4250 * archive.cc (Library_base::should_include_member): Check for
4251 --export-dynamic-symbol.
4252 * options.h (class General_options): Add --export-dynamic-symbol.
4253 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
4254 --export-dynamic-symbol.
4255 (Symbol_table::gc_mark_undef_symbols): Likewise.
4256 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
4257
2615994e
DM
42582012-04-12 David S. Miller <davem@davemloft.net>
4259
4260 * sparc.cc (Reloc::wdisp10): New relocation method.
4261 (Reloc::h34): Likewise.
4262 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
4263 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
4264 R_SPARC_WDISP10.
4265 (Target_sparc::Scan::local): Likewise.
4266 (Target_sparc::Scan::global): Likewise.
4267 (Target_sparc::Relocate::relocate): Likewise.
4268
6782735d
CC
42692012-04-09 Cary Coutant <ccoutant@google.com>
4270
4271 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
4272 low_pc == 0.
4273
8c7a0b00
ILT
42742012-04-06 Ian Lance Taylor <iant@google.com>
4275
4276 * timer.cc: #include <unistd.h>.
4277
58797674
RM
42782012-04-06 Roland McGrath <mcgrathr@google.com>
4279
4280 * configure.in (AC_CHECK_HEADERS): Add locale.h.
4281 * config.in: Regenerate.
4282 * configure: Regenerate.
4283
44350750
NC
42842012-04-05 Nick Clifton <nickc@redhat.com>
4285
4286 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
4287 (AM_LC_MESSAGES): Add.
4288 * aclocal.m4: Regenerate.
4289 * config.in: Regenerate.
4290 * configure: Regenerate.
4291
c1027032
CC
42922012-03-21 Cary Coutant <ccoutant@google.com>
4293
4294 * Makefile.am: Add gdb-index.cc, gdb-index.h.
4295 * Makefile.in: Regenerate.
4296 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
4297 (Sized_elf_reloc_mapper::symbol_section): New function.
4298 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
4299 (make_elf_reloc_mapper): New function.
4300 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
4301 (Dwarf_abbrev_table::do_read_abbrevs): New function.
4302 (Dwarf_abbrev_table::do_get_abbrev): New function.
4303 (Dwarf_ranges_table::read_ranges_table): New function.
4304 (Dwarf_ranges_table::read_range_list): New function.
4305 (Dwarf_pubnames_table::read_section): New function.
4306 (Dwarf_pubnames_table::read_header): New function.
4307 (Dwarf_pubnames_table::next_name): New function.
4308 (Dwarf_die::Dwarf_die): New function.
4309 (Dwarf_die::read_attributes): New function.
4310 (Dwarf_die::skip_attributes): New function.
4311 (Dwarf_die::set_name): New function.
4312 (Dwarf_die::set_linkage_name): New function.
4313 (Dwarf_die::attribute): New function.
4314 (Dwarf_die::string_attribute): New function.
4315 (Dwarf_die::int_attribute): New function.
4316 (Dwarf_die::uint_attribute): New function.
4317 (Dwarf_die::ref_attribute): New function.
4318 (Dwarf_die::child_offset): New function.
4319 (Dwarf_die::sibling_offset): New function.
4320 (Dwarf_info_reader::check_buffer): New function.
4321 (Dwarf_info_reader::parse): New function.
4322 (Dwarf_info_reader::do_parse): New function.
4323 (Dwarf_info_reader::do_read_string_table): New function.
4324 (Dwarf_info_reader::lookup_reloc): New function.
4325 (Dwarf_info_reader::get_string): New function.
4326 (Dwarf_info_reader::visit_compilation_unit): New function.
4327 (Dwarf_info_reader::visit_type_unit): New function.
4328 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
4329 Sized_elf_reloc_mapper.
4330 (Sized_dwarf_line_info::symbol_section): Remove function.
4331 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
4332 (Sized_dwarf_line_info::read_line_mappings): Remove object
4333 parameter, adjust callers.
4334 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
4335 * dwarf_reader.h: Include <sys/types.h>.
4336 (class Track_relocs): Remove forward declaration.
4337 (class Elf_reloc_mapper): New class.
4338 (class Sized_elf_reloc_mapper): New class.
4339 (class Dwarf_abbrev_table): New class.
4340 (class Dwarf_range_list): New class.
4341 (class Dwarf_ranges_table): New class.
4342 (class Dwarf_pubnames_table): New class.
4343 (class Dwarf_die): New class.
4344 (class Dwarf_info_reader): New class.
4345 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
4346 (Sized_dwarf_line_info::symbol_section): Remove member function.
4347 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
4348 base class.
4349 * gdb-index.cc: New source file.
4350 * gdb-index.h: New source file.
4351 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
4352 and .debug_types sections, call Layout::add_to_gdb_index.
4353 (Sized_relobj_incr::do_section_name): Implement.
4354 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
4355 return type; Implement.
4356 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
4357 return type.
4358 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
4359 parameter list and return type.
4360 (Sized_incr_dynobj::do_section_contents): Likewise.
4361 * layout.cc: Include gdb-index.h.
4362 (Layout::Layout): Initialize gdb_index_data_.
4363 (Layout::init_fixed_output_section): Check for .gdb_index section.
4364 (Layout::add_to_gdb_index): New function. Instantiate.
4365 * layout.h: Add forward declaration for class Gdb_index.
4366 (Layout::add_to_gdb_index): New member function.
4367 (Layout::gdb_index_data_): New data member.
4368 * main.cc: Include gdb-index.h.
4369 (main): Print statistics for gdb index.
4370 * object.cc (Object::section_contents): Move code into
4371 do_section_contents.
4372 (need_decompressed_section): Check for sections needed when building
4373 gdb index.
4374 (build_compressed_section_map): Likewise.
4375 (Sized_relobj_file::do_read_symbols): Need local symbols when building
4376 gdb index.
4377 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
4378 sections; call Layout::add_to_gdb_index.
4379 (Sized_relobj_file::do_decompressed_section_contents): Call
4380 do_section_contents directly.
4381 * object.h (Object::do_section_contents): Adjust parameter list and
4382 return type.
4383 (Object::do_decompressed_section_contents): Call do_section_contents
4384 directly.
4385 (Sized_relobj_file::do_section_contents): Adjust parameter list and
4386 return type.
4387 * options.h (class General_options): Add --gdb-index option.
4388 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
4389 list and return type.
4390 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
4391 * reloc.h (Track_relocs::checkpoint): New function.
4392 (Track_relocs::reset): New function.
4393
4394 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
4395 New test cases.
4396 * testsuite/Makefile.in: Regenerate.
4397 * testsuite/gdb_index_test.cc: New test source file.
4398 * testsuite/gdb_index_test_1.sh: New test source file.
4399 * testsuite/gdb_index_test_2.sh: New test source file.
4400
647f1574
DK
44012012-03-19 Doug Kwan <dougkwan@google.com>
4402
4403 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 4404 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
4405 __exidx_start and __exidx_end. Make symbol table parameter
4406 anonymous as it is not used.
4407 * gold.cc (queue_middle_tasks): Call target hook to define any
4408 target-specific symbols.
4409 * target.h (Target::define_standard_symbols): New method.
4410 (Target::do_define_standard_symbols): Same.
4411 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
4412 * testsuite/Makefile.in: Regenerate.
4413 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
4414 and __exidx_end.
4415 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
4416 relocations are generated for __exidx_start and __exidx_end.
4417
7c6109da
DK
44182012-03-16 Doug Kwan <dougkwan@google.com>
4419
4420 * testsuite/Makefile.am: Disable test initpri3b.
4421 * testsuite/Makefile.in: Regenerate.
4422
7b8957f8
DK
44232012-03-15 Doug Kwan <dougkwan@google.com>
4424
4425 * arm.cc (Target_arm::got_section): Make .got section read-only
4426 if -z now is given.
4427
14dc9ef7
ILT
44282012-03-15 Ian Lance Taylor <iant@google.com>
4429
4430 PR gold/13850
4431 * layout.cc (Layout::make_output_section): Correctly mark
4432 SHT_INIT_ARRAY, et. al., as relro.
4433
fa40b62a
DK
44342012-03-14 Doug Kwan <dougkwan@google.com>
4435
4436 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
4437 dynamic relocations for protected symbols in shared objects.
4438
fd325007
ILT
44392012-03-13 Ian Lance Taylor <iant@google.com>
4440
4441 * resolve.cc (Symbol_table::resolve): When merging common symbols,
4442 keep the larger alignment.
4443
e8dd54e1
CC
44442012-03-12 Cary Coutant <ccoutant@google.com>
4445
4446 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
4447 handling of DW_LNE_define_file.
4448
feb5f3b0
CC
44492012-03-12 Cary Coutant <ccoutant@google.com>
4450
4451 * reduced_debug_output.cc
4452 (Output_reduced_debug_info_section::get_die_end): Add new FORM
4453 codes to switch.
4454
a1fb4256
CC
44552012-02-29 Cary Coutant <ccoutant@google.com>
4456
4457 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
4458
5dd8762a
CC
44592012-02-29 Cary Coutant <ccoutant@google.com>
4460
4461 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4462 Call Object::decompressed_section_contents.
4463 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
4464 New dtor.
4465 (Sized_dwarf_line_info::buffer_start_): New data member.
4466 * merge.cc (Output_merge_data::do_add_input_section): Call
4467 Object::decompressed_section_contents.
4468 (Output_merge_string::do_add_input_section): Likewise.
4469 * object.cc (need_decompressed_section): New function.
4470 (build_compressed_section_map): Decompress sections needed later.
4471 (Sized_relobj_file::do_decompressed_section_contents): New function.
4472 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4473 * object.h (Object::decompressed_section_contents): New function.
4474 (Object::discard_decompressed_sections): New function.
4475 (Object::do_decompressed_section_contents): New function.
4476 (Object::do_discard_decompressed_sections): New function.
4477 (Compressed_section_info): New type.
4478 (Compressed_section_map): Include decompressed section contents.
4479 (Sized_relobj_file::do_decompressed_section_contents): New function.
4480 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4481
7b5de7ee
CC
44822012-02-16 Cary Coutant <ccoutant@google.com>
4483
4484 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
4485 * testsuite/Makefile.in: Regenerate.
4486
f9fa4a63
CC
44872012-02-14 Cary Coutant <ccoutant@google.com>
4488
4489 * options.cc (General_options::finalize): Disallow -pie and -static.
4490
2c175ebc
DK
44912012-02-03 Doug Kwan <dougkwan@google.com>
4492
4493 * arm.cc (Arm_relocate_functions::abs8,
4494 Arm_relocate_functions::abs16): Use
4495 Bits::has_signed_unsigned_overflow32.
4496 (Arm_relocate_functions::thm_abs8): Correct range of
4497 overflow check.
4498 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
4499 in assertions.
4500
90cff06f
DK
45012012-02-02 Doug Kwan <dougkwan@google.com>
4502
4503 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
4504 position independent outputs, not just shared objects.
4505
63887f3d
L
45062012-01-30 H.J. Lu <hongjiu.lu@intel.com>
4507
4508 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
4509 * configure: Regenerated.
4510
bef2b434
ILT
45112012-01-27 Ian Lance Taylor <iant@google.com>
4512
4513 * reloc.h (Bits): New class with static functions, copied from
4514 namespace utils in arm.cc.
4515 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
4516 instead.
4517
c335b55d
L
45182012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4519
4520 * incremental.cc (write_info_blocks): Correct relocation offset.
4521
41194d9f
L
45222012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4523
4524 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
4525 (Relocate::tls_gd_to_le): Likewise.
4526
1bae613c
L
45272012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4528
4529 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
4530
24482ca0
L
45312012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4532
4533 * configure.ac: Check if -mcmodel=medium works.
4534 * configure: Regenerated.
4535
c2c7840a
CC
45362012-01-24 Cary Coutant <ccoutant@google.com>
4537
4538 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
4539 definition and ...
4540 (read_unsigned_LEB_128_x): ... this new function.
4541 (read_signed_LEB_128): Replaced with inline definition and ...
4542 (read_signed_LEB_128_x): ... this new function.
4543 * int_encoding.h (read_unsigned_LEB_128_x): New function.
4544 (read_unsigned_LEB_128): Add inline definition.
4545 (read_signed_LEB_128_x): New function.
4546 (read_signed_LEB_128): Add inline definition.
4547 * testsuite/Makefile.am (leb128_unittest): New unit test.
4548 * testsuite/Makefile.in: Regenerate.
4549 * testsuite/leb128_unittest.cc: New unit test.
4550
833de760 45512012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
4552
4553 PR gold/13617
4554 * i386.cc (Target_i386::do_code_fill): When using a jmp
4555 instruction, pad with nop instructions.
4556 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4557
618d6666
L
45582012-01-22 H.J. Lu <hongjiu.lu@intel.com>
4559
4560 * x86_64.cc (gc_process_relocs): Add typename on types used in
4561 template.
4562 (scan_relocs): Likewise.
4563 (relocate_section): Likewise.
4564 (apply_relocation): Likewise.
4565
3660ff06
L
45662012-01-10 H.J. Lu <hongjiu.lu@intel.com>
4567
4568 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
4569 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
4570 under x32.
4571
fc51264f
L
45722012-01-09 H.J. Lu <hongjiu.lu@intel.com>
4573
4574 * x86_64.cc: Initial support for x32.
4575
dd74ae06
CC
45762012-01-03 Cary Coutant <ccoutant@google.com>
4577
4578 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
4579 Use abstract base class for GOT.
4580 * gold/output.h (class Output_data_got_base): New abstract base class.
4581 (class Output_data_got): Derive from new base class, adjust ctors.
4582 (Output_data_got::reserve_slot): Make virtual; rename to
4583 do_reserve_slot; Adjust callers.
4584 * gold/target.h (Sized_target::init_got_plt_for_update): Return
4585 pointer to abstract base class.
4586 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
4587
83896202
ILT
45882011-12-18 Ian Lance Taylor <iant@google.com>
4589
4590 * object.h (Relobj::local_symbol_value): New function.
4591 (Relobj::local_plt_offset): New function.
4592 (Relobj::local_has_got_offset): New function.
4593 (Relobj::local_got_offset): New function.
4594 (Relobj::set_local_got_offset): New function.
4595 (Relobj::do_local_symbol_value): New pure virtual function.
4596 (Relobj::do_local_plt_offset): Likewise.
4597 (Relobj::do_local_has_got_offset): Likewise.
4598 (Relobj::do_local_got_offset): Likewise.
4599 (Relobj::do_set_local_got_offset): Likewise.
4600 (Sized_relobj::do_local_has_got_offset): Rename from
4601 local_has_got_offset.
4602 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
4603 (Sized_relobj::do_set_local_got_offset): Rename from
4604 set_local_got_offset.
4605 (Sized_relobj_file::do_local_plt_offset): Rename from
4606 local_plt_offset.
4607 (Sized_relobj_file::do_local_symbol_value): New function.
4608 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
4609 local_plt_offset.
4610 * output.cc (Output_data_got::Got_entry::write): Change object to
4611 Relobj. Use local_symbol_value.
4612 (Output_data_got::add_global_with_rel): Change rel_dyn to
4613 Output_data_reloc_generic*. Use add_global_generic.
4614 (Output_data_got::add_global_with_rela): Remove. Change all
4615 callers to use add_global_with_rel.
4616 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
4617 Output_data_reloc_generic*. Use add_global_generic.
4618 (Output_data_got::add_global_pair_with_rela): Remove. Change all
4619 callers to use add_global_pair_with_rel.
4620 (Output_data_got::add_local): Change object to Relobj*.
4621 (Output_data_got::add_local_plt): Likewise.
4622 (Output_data_got::add_local_with_rel): Change object to Relobj*,
4623 change rel_dyn to Output_data_reloc_generic*. Use
4624 add_local_generic.
4625 (Output_data_got::add_local_with_rela): Remove. Change all
4626 callers to use all_local_with_rel.
4627 (Output_data_got::add_local_pair_with_rel): Change object to
4628 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
4629 add_output_section_generic.
4630 (Output_data_got::add_local_pair_with_rela): Remove. Change all
4631 callers to use add_local_pair_with_rel.
4632 (Output_data_got::reserve_local): Change object to Relobj*.
4633 * output.h: (class Output_data_reloc_generic): Add pure virtual
4634 declarations for add_global_generic, add_local_generic,
4635 add_output_section_generic.
4636 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
4637 functions for Output_data_reloc_generic. Update declarations for
4638 changes listed in output.cc.
4639 (class Output_data_got): Change template parameter to got_size.
4640 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
4641 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
4642 function.
4643 (Sized_relobj_incr::do_local_plt_offset): New function.
4644 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
4645 add_global_generic.
4646
76677ad0
CC
46472011-12-17 Cary Coutant <ccoutant@google.com>
4648
4649 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
4650 * resolve.cc (Symbol_table::resolve): Likewise.
4651 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
4652 arrays.
4653 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4654
8b8dd8d5
ILT
46552011-12-16 Ian Lance Taylor <iant@google.com>
4656
4657 * output.h (Output_data_reloc_generic::add): Only call
4658 add_dynamic_reloc if this is a dynamic reloc section.
4659
d55525b9
L
46602011-12-15 H.J. Lu <hongjiu.lu@intel.com>
4661
4662 PR gold/13505
4663 * target-reloc.h (apply_relocation): Replace <64, false> with
4664 <size, big_endian>.
4665
ff81c7c1
NC
46662011-11-25 Nick Clifton <nickc@redhat.com>
4667
4668 * po/it.po: New Italian translation.
4669
628f39be
SA
46702011-11-17 Sterling Augustine <saugustine@google.com>
4671
4672 * script.cc (script_include_directive): Implement.
4673 (read_script_file): New local variables name and search_path. Update
4674 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
4675 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
4676 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
4677
98ef3ea4
SA
46782011-11-11 Sterling Augustine <saugustine@google.com>
4679
4680 * yyscript.y (section_cmd): Add support for INCLUDE directive.
4681 (file_or_sections_cmd): Likewise.
4682
f4a8b6d7
DK
46832011-11-11 Doug Kwan <dougkwan@google.com>
4684
4685 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
4686 if --just-symbols is given.
4687
29ab395d
DK
46882011-11-10 Doug Kwan <dougkwan@google.com>
4689
4690 PR gold/13362
4691 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
4692 when processing data relocs.
4693 * reloc.h (Relocate_functions::rel_unaligned): New method.
4694 (Relocate_functions::pcrel_unaligned): Ditto.
4695 (Relocate_functions::rel32_unaligned): Ditto.
4696 (Relocate_functions::pcrel32_unaligned): Ditto.
4697
2c339f71
DK
46982011-11-09 Doug Kwan <dougkwan@google.com>
4699
4700 PR gold/13362
4701 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
4702 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
4703 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
4704 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4705 (Relocate_functions::rel_unaligned): New.
4706 (Relocate_functions::rel32_unaligned): New.
4707 * target-reloc.h (relocate_for_relocatable): Add code to handle
4708 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4709 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
4710 arm_unaligned_reloc_r): New targets.
4711 * testsuite/Makefile.in: Regenerate.
4712 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
4713 linking.
4714
3f3cddf1
ILT
47152011-11-02 Ian Lance Taylor <iant@google.com>
4716
4717 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
4718 NATIVE_LINKER.
4719 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
4720 * options.cc (General_options::finalize): Use library search path
4721 from configure script if specified. If not native and no sysroot,
4722 only search TOOLLIBDIR.
4723 * options.h (Search_directory::Search_directory): Change name to
4724 const std::string&.
4725 (General_options::add_to_library_path_with_sysroot): Change arg to
4726 const std::string&.
4727 * configure, Makefile.in, config.in: Rebuild.
4728
a8e2273b
ILT
47292011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4730
4731 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
4732 we are working around the ARM1176 Erratum.
4733 * options.h (General_options::fix_arm1176): Add option.
4734 * testsuite/Makefile.am: Add testcases, and keep current ones
4735 working.
4736 * testsuite/Makefile.in: Regenerate.
4737 * testsuite/arm_fix_1176.s: New file.
4738 * testsuite/arm_fix_1176.sh: Likewise.
4739
cd6eab1c
ILT
47402011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4741
4742 * arm.cc (Target_arm::Target_arm): Remove initialisation of
4743 may_use_blx_.
4744 (Target_arm::may_use_blx): Remove method.
4745 (Target_arm::set_may_use_blx): Likewise.
4746 (Target_arm::may_use_v4t_interworking): New method.
4747 (Target_arm::may_use_v5t_interworking): Likewise.
4748 (Target_arm::may_use_blx_): Remove member variable.
4749 (Arm_relocate_functions::arm_branch_common): Check for v5T
4750 interworking.
4751 (Arm_relocate_functions::thumb_branch_common): Likewise.
4752 (Reloc_stub::stub_type_for_reloc): Likewise.
4753 (Target_arm::do_finalize_sections): Correct interworking checks.
4754 * testsuite/Makefile.am: Add new tests.
4755 * testsuite/Makefile.in: Regenerate.
4756 * testsuite/arm_farcall_arm_arm.s: New test.
4757 * testsuite/arm_farcall_arm_arm.sh: Likewise.
4758 * testsuite/arm_farcall_arm_thumb.s: Likewise.
4759 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
4760 * testsuite/arm_farcall_thumb_arm.s: Likewise.
4761 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
4762 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
4763 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
4764
286adcf4
CC
47652011-10-31 Cary Coutant <ccoutant@google.com>
4766
4767 PR gold/13023
4768 * expression.cc (Expression::eval_with_dot): Add
4769 is_section_dot_assignment parameter.
4770 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
4771 absolute and assigning to dot within a section.
4772 * script-sections.cc
4773 (Output_section_element_assignment::set_section_addresses): Pass
4774 dot_section to set_if_absolute.
4775 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
4776 as is_section_dot_assignment flag to eval_with_dot.
4777 (Output_section_element_dot_assignment::set_section_addresses):
4778 Likewise.
4779 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
4780 parameter. Also set value if relative to dot_section; set the
4781 symbol's output_section.
4782 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
4783 parameter. Adjust all callers.
4784 (Expression::eval_maybe_dot): Likewise.
4785 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
4786 Adjust all callers.
4787 * testsuite/script_test_2.t: Test assignment of an absolute value
4788 to dot within an output section element.
4789
9634ed06
CC
47902011-10-31 Cary Coutant <ccoutant@google.com>
4791
4792 * options.h (class General_options): Add --[no-]gnu-unique options.
4793 * symtab.cc (Symbol_table::sized_write_globals): Convert
4794 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
4795
de4101c7
CC
47962011-10-31 Cary Coutant <ccoutant@google.com>
4797
4798 PR gold/13359
4799 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
4800 unnecessary assertion.
4801 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
4802
7257cc92
ST
48032011-10-31 Sriraman Tallam <tmsriram@google.com>
4804
4805 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4806 gc_mark_symbol.
4807 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4808 gc_mark_symbol.
4809 Change to just keep the section associated with symbol.
4810 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
4811 they are externally visible and --export-dynamic is turned on.
4812 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
4813
bfc34b3f
ILT
48142011-10-19 Ian Lance Taylor <iant@google.com>
4815
4816 PR gold/13163
4817 * script-sections.cc
4818 (Output_section_element_dot_assignment::needs_output_section): New
4819 function.
4820
ea0d8c47
ILT
48212011-10-19 Ian Lance Taylor <iant@google.com>
4822
4823 PR gold/13204
4824 * layout.cc (Layout::segment_precedes): Don't assert failure if a
4825 --section-start option was seen.
4826 * options.h (General_options::any_section_start): New function.
4827
abd242a9
DM
48282011-10-18 David S. Miller <davem@davemloft.net>
4829
4830 PR binutils/13301
4831 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
4832 member to track relocation locations that have moved during TLS
4833 reloc optimizations.
4834 (Target_sparc::Relocate::Relocate): Initialize to NULL.
4835 (Target_sparc::Relocate::relocate): Adjust view down by 4
4836 bytes if it matches reloc_adjust_addr_.
4837 (Target_sparc::Relocate::relocate_tls): Always move the
4838 __tls_get_addr call delay slot instruction forward 4 bytes when
4839 performing relaxation.
4840
bab9090f
CC
48412011-10-18 Cary Coutant <ccoutant@google.com>
4842
4843 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
4844 (Output_file::map_no_anonymous): Check for non-zero
4845 return code from posix_fallocate.
4846
f7c5b166
CC
48472011-10-17 Cary Coutant <ccoutant@google.com>
4848
4849 PR gold/13245
4850 * plugin.cc (is_visible_from_outside): Check for symbols
4851 referenced from dynamic objects.
4852 * resolve.cc (Symbol_table::resolve): Don't count references
4853 from dynamic objects as references from real ELF files.
4854 * testsuite/plugin_test_2.sh: Adjust expected result.
4855
b490c0bb
CC
48562011-10-17 Cary Coutant <ccoutant@google.com>
4857
4858 * gold.cc: Include timer.h.
4859 (queue_middle_tasks): Stamp time.
4860 (queue_final_tasks): Likewise.
4861 * main.cc (main): Store timer in parameters. Print timers
4862 for each pass.
4863 * parameters.cc (Parameters::Parameters): Initialize timer_.
4864 (Parameters::set_timer): New function.
4865 (set_parameters_timer): New function.
4866 * parameters.h (Parameters::set_timer): New function.
4867 (Parameters::timer): New function.
4868 (Parameters::timer_): New data member.
4869 (set_parameters_timer): New function.
4870 * timer.cc (Timer::stamp): New function.
4871 (Timer::get_pass_time): New function.
4872 * timer.h (Timer::stamp): New function.
4873 (Timer::get_pass_time): New function.
4874 (Timer::pass_times_): New data member.
4875
f475cf7b
CC
48762011-10-17 Cary Coutant <ccoutant@google.com>
4877
4878 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
4879 task for members of lib groups.
4880
cdd7e244
CC
48812011-10-17 Cary Coutant <ccoutant@google.com>
4882
4883 PR gold/13288
4f95c8b4 4884 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
4885 (File_read::make_view): Move bounds check (replace with assert)...
4886 (File_read::find_or_make_view): ... to here.
4887
dfb45471
CC
48882011-10-12 Cary Coutant <ccoutant@google.com>
4889
4f95c8b4 4890 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
4891 ::read returns less than requested size.
4892
53bbcc1b
CC
48932011-10-10 Cary Coutant <ccoutant@google.com>
4894
4f95c8b4 4895 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
4896 Initialize defined_count_.
4897 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
4898 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
4899 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
4900 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
4901 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 4902 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
4903 member.
4904 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 4905 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
4906 Return zeroes instead of internal error.
4907
397b129b
CC
49082011-10-10 Cary Coutant <ccoutant@google.com>
4909
4910 PR gold/13249
4f95c8b4 4911 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 4912 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 4913 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
4914 (Output_reloc::type_): Adjust size of bit field.
4915 (Output_reloc::use_plt_offset_): New bit field.
4916 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
4917 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
4918 flag. Adjust all callers.
4f95c8b4 4919 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
4920 creating RELATIVE relocations.
4921
d5698657
NC
49222011-10-10 Nick Clifton <nickc@redhat.com>
4923
4924 * po/es.po: Updated Spanish translation.
4925 * po/fi.po: Updated Finnish translation.
4926
6a59a5c2
DN
49272011-10-03 Diego Novillo <dnovillo@google.com>
4928
4929 * options.cc (parse_uint): Fix dereference of RETVAL.
4930
f0558624
ST
49312011-09-29 Sriraman Tallam <tmsriram@google.com>
4932
4933 * layout.h (section_order_map_): New member.
4934 (get_section_order_map): New member function.
4935 * output.cc (Output_section::add_input_section): Check for patterns
4936 only when --section-ordering-file is specified.
4937 * gold.cc (queue_middle_tasks): Delay updating order of sections till
4938 output_sections have been formed.
4939 * layout.cc (Layout_Layout): Initialize section_order_map_.
4940 * plugin.cc (update_section_order): Store order in order_map. Do not
4941 update the order.
4942 * testsuite/Makefile.am: Add test case for plugin_final_layout.
4943 * testsuite/Makefile.in: Regenerate.
4944 * testsuite/plugin_section_order.c: New file.
4945 * testsuite/plugin_final_layout.cc: New file.
4946 * testsuite/plugin_final_layout.sh: New file.
4947
a7dac153
CC
49482011-09-29 Cary Coutant <ccoutant@google.com>
4949
4f95c8b4 4950 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 4951 Check for NULL.
4f95c8b4 4952 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
4953 symbols during incremental update.
4954 (Symbol_table::add_from_dynobj): Likewise.
4955
eebd87a5
ILT
49562011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4957 Ian Lance Taylor <iant@google.com>
4958
4959 * symtab.cc (Symbol_table::define_special_symbol): Always
4960 canonicalize version string.
4961
403a3331
CC
49622011-09-26 Cary Coutant <ccoutant@google.com>
4963
4f95c8b4
CC
4964 * gold.cc (queue_initial_tasks): Move option checks ...
4965 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
4966 some options; make others fatal.
4967
235061c2
CC
49682011-09-26 Cary Coutant <ccoutant@google.com>
4969
4970 gcc PR lto/47247
4971 * plugin.cc (get_symbols_v2): New function.
4972 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
4973 (is_referenced_from_outside): New function.
4974 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
4975 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
4976 (get_symbols): Pass version parameter.
4977 (get_symbols_v2): New function.
4978 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
4979 parameter.
4980 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
4981 (onload): Add LDPT_GET_SYMBOLS_V2.
4982 (all_symbols_read_hook): Use get_symbols_v2; check for
4983 LDPR_PREVAILING_DEF_IRONLY_EXP.
4984 * testsuite/plugin_test_3.sh: Update expected results.
4985
dc87f620
ILT
49862011-09-23 Simon Baldwin <simonb@google.com>
4987
4988 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
4989 configuration options.
4990 * configure: Regenerate.
4991 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
4992 * Makefile.in: Regenerate.
4993 * testsuite/Makefile.in: Regenerate.
4994
a8279f82
ST
49952011-09-19 Sriraman Tallam <tmsriram@google.com>
4996
4997 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
4998
0c9350c8
CC
49992011-09-19 Cary Coutant <ccoutant@google.com>
5000
5001 * incremental.cc (can_incremental_update): Fix typo in comment.
5002 * incremental.h (can_incremental_update): Likewise.
5003
aa06ae28
CC
50042011-09-18 Cary Coutant <ccoutant@google.com>
5005
5006 * incremental.cc (can_incremental_update): New function.
5007 * incremental.h (can_incremental_update): New function.
5008 * layout.cc (Layout::init_fixed_output_section): Call it.
5009 (Layout::make_output_section): Don't allow patch space in .eh_frame.
5010 * object.cc (Sized_relobj_file::do_layout): Call
5011 can_incremental_update.
5012
ebb300b2
CC
50132011-09-13 Cary Coutant <ccoutant@google.com>
5014
5015 * configure.ac: Check for glibc support for gnu_indirect_function
5016 support with static linking, setting automake conditional
5017 IFUNC_STATIC.
5018 * Makefile.in: Regenerate.
5019 * configure: Regenerate.
5020
5021 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
5022 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
5023 for IFUNC_STATIC.
5024 * testsuite/Makefile.in: Regenerate.
5025
1206d0d5
CC
50262011-09-13 Cary Coutant <ccoutant@google.com>
5027
5028 * incremental.cc (Sized_relobj_incr::do_layout): Call
5029 report_comdat_group for kept comdat sections.
5030 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
5031 * testsuite/Makefile.in: Regenerate.
5032 * testsuite/incr_comdat_test_1.cc: New source file.
5033 * testsuite/incr_comdat_test_2_v1.cc: New source file.
5034 * testsuite/incr_comdat_test_2_v2.cc: New source file.
5035 * testsuite/incr_comdat_test_2_v3.cc: New source file.
5036
40b29874
ILT
50372011-09-13 Ian Lance Taylor <iant@google.com>
5038
5039 * object.cc (Sized_relobj_file::do_layout): Remove unused local
5040 variable external_symbols_offset.
5041
1b045aac
ILT
50422011-09-12 Ian Lance Taylor <iant@google.com>
5043
5044 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
5045 triggered if object has no symbols.
5046
24c6c55a
DM
50472011-09-09 David S. Miller <davem@davemloft.net>
5048
5049 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
5050 (Output_fill_debug_line::do_write): Likewise.
5051
66570254
CC
50522011-08-29 Cary Coutant <ccoutant@google.com>
5053
5054 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
5055 casts to match formatting specs.
5056 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
5057
8ea8cd50
CC
50582011-08-26 Cary Coutant <ccoutant@google.com>
5059
5060 * layout.cc (Free_list::allocate): Provide guarantee of minimum
5061 remaining hole size when allocating.
5062 (Layout::make_output_section): Set fill methods for debug sections.
5063 * layout.h (Free_list::Free_list_node): Move from private to
5064 public.
5065 (Free_list::set_min_hole_size): New function.
5066 (Free_list::begin, Free_list::end): New functions.
5067 (Free_list::min_hole_): New data member.
5068 * output.cc: Include dwarf.h.
5069 (Output_fill_debug_info::do_minimum_hole_size): New function.
5070 (Output_fill_debug_info::do_write): New function.
5071 (Output_fill_debug_line::do_minimum_hole_size): New function.
5072 (Output_fill_debug_line::do_write): New function.
5073 (Output_section::Output_section): Initialize new data member.
5074 (Output_section::set_final_data_size): Ensure patch space is larger
5075 than minimum hole size.
5076 (Output_section::do_write): Fill holes in debug sections.
5077 * output.h (Output_fill): New class.
5078 (Output_fill_debug_info): New class.
5079 (Output_fill_debug_line): New class.
5080 (Output_section::set_free_space_fill): New function.
5081 (Output_section::free_space_fill_): New data member.
5082 * testsuite/Makefile.am (incremental_test_3): Add
5083 --incremental-patch option.
5084 (incremental_test_4): Likewise.
5085 (incremental_test_5): Likewise.
5086 (incremental_test_6): Likewise.
5087 (incremental_copy_test): Likewise.
5088 (incremental_common_test_1): Likewise.
5089 * testsuite/Makefile.in: Regenerate.
5090
7cf80422
NC
50912011-08-26 Nick Clifton <nickc@redhat.com>
5092
5093 * po/es.po: Updated Spanish translation.
5094
c3f7b0e5
CC
50952011-08-01 Cary Coutant <ccoutant@google.com>
5096
5097 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
5098 * gold/testsuite/Makefile.in: Regenerate.
5099 * gold/testsuite/justsyms_exec.c: New source file.
5100 * gold/testsuite/justsyms_lib.c: New source file.
5101
9590bf25
CC
51022011-08-01 Cary Coutant <ccoutant@google.com>
5103
5104 * layout.cc (Layout::set_segment_offsets): Don't realign text
5105 segment if -Ttext was specified.
5106 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
5107 file type.
5108 * object.h (Sized_relobj_file::e_type): New function.
5109 (Sized_relobj_file::e_type_): New data member.
5110 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
5111 base address for ET_EXEC files.
5112 * target.cc (Target::do_make_elf_object_implementation): Allow
5113 ET_EXEC files with --just-symbols option.
5114
dcd8d12e
CC
51152011-07-28 Cary Coutant <ccoutant@google.com>
5116
5117 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
5118 Add thread_number parameter.
5119 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
5120 * workqueue-threads.cc
5121 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
5122 current thread if its thread number is greater than desired thread
5123 count.
5124 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
5125 Add thread_number parameter.
5126 (Workqueue::should_cancel_thread): Likewise.
5127 (Workqueue::find_runnable_or_wait): Pass thread_number to
5128 should_cancel_thread.
5129 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
5130 parameter.
5131
804eb480
ST
51322011-07-22 Sriraman Tallam <tmsriram@google.com>
5133
5134 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
5135 only after checking if it cannot be forced local.
5136 * symtab.h (is_externally_visible): Check if the symbol is not forced
5137 local.
5138
f1ddb600
ILT
51392011-07-15 Ian Lance Taylor <iant@google.com>
5140
5141 * options.h (class General_options): Add --print-output-format.
5142 Move -EL next to -EB, for better --help output.
5143 * target-select.cc: Include <cstdio>, "options.h", and
5144 "parameters.h".
5145 (Target_selector::do_target_bfd_name): New function.
5146 (print_output_format): New function.
5147 * target-select.h (class Target_selector): Update declarations.
5148 (Target_selector::target_bfd_name): New function.
5149 (print_output_format): Declare.
5150 * main.cc: Include "target-select.h".
5151 (main): Handle --print-output-format.
5152 * gold.cc: Include "target-select.h".
5153 (queue_initial_tasks): Handle --print-output-format when there are
5154 no input files.
5155 * parameters.cc (parameters_force_valid_target): Give a better
5156 error message if -EB/-EL does not match target.
5157 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
5158 function.
5159
7d172687
ILT
51602011-07-15 Ian Lance Taylor <iant@google.com>
5161
5162 * i386.cc (class Output_data_plt_i386): Add layout_ field.
5163 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
5164 (Output_data_plt_i386::do_write): Write address of .dynamic
5165 section to first entry in .got.plt section.
5166 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
5167 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5168 Initialize layout_.
5169 (Output_data_plt_x86_64::do_write): Write address of .dynamic
5170 section to first entry in .got.plt section.
5171 * layout.h (Layout::dynamic_section): New function.
5172
e9552f7e
ST
51732011-07-13 Sriraman Tallam <tmsriram@google.com>
5174
5175 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
5176 to claim_file call.
5177 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
5178 input_section_position_, and input_section_glob_.
5179 (read_layout_from_file): Call function section_ordering_specified.
5180 * layout.h (is_section_ordering_specified): New function.
5181 (section_ordering_specified): New function.
5182 (section_ordering_specified_): New boolean member.
5183 * main.cc(main): Call load_plugins after layout object is defined.
5184 * output.cc (Output_section::add_input_section): Use
5185 function section_ordering_specified to check if section ordering is
5186 needed.
5187 * output.cc (Output_section::add_relaxed_input_section): Use
5188 function section_ordering_specified to check if section ordering is
5189 needed.
5190 (Output_section::update_section_layout): New function.
5191 (Output_section::sort_attached_input_sections): Check if input section
5192 must be reordered.
5193 * output.h (Output_section::update_section_layout): New function.
5194 * plugin.cc (get_section_count): New function.
5195 (get_section_type): New function.
5196 (get_section_name): New function.
5197 (get_section_contents): New function.
5198 (update_section_order): New function.
58797674 5199 (allow_section_ordering): New function.
e9552f7e
ST
5200 (Plugin::load): Add the new interfaces to the transfer vector.
5201 (Plugin_manager::load_plugins): New parameter.
5202 (Plugin_manager::all_symbols_read): New parameter.
5203 (Plugin_manager::claim_file): New parameter. Save the elf object for
5204 unclaimed objects.
5205 (Plugin_manager::get_elf_object): New function.
5206 (Plugin_manager::get_view): Change to directly use the bool to check
5207 if get_view is called from claim_file_hook.
5208 * plugin.h (input_objects): New function
5209 (Plugin__manager::load_plugins): New parameter.
5210 (Plugin_manager::claim_file): New parameter.
5211 (Plugin_manager::get_elf_object): New function.
5212 (Plugin_manager::in_claim_file_handler): New function.
5213 (Plugin_manager::in_claim_file_handler_): New member.
5214 (layout): New function.
5215 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
5216 handler with an extra parameter. Make the elf object before calling
5217 claim_file handler.
5218 * testsuite/plugin_test.c (get_section_count): New function pointer.
5219 (get_section_type): New function pointer.
5220 (get_section_name): New function pointer.
5221 (get_section_contents): New function pointer.
5222 (update_section_order): New function pointer.
5223 (allow_section_ordering): New function pointer.
5224 (onload): Check if the new interfaces exist.
5225
9446efde
ILT
52262011-07-13 Ian Lance Taylor <iant@google.com>
5227
5228 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
5229 relro section.
5230 * x86_64.cc (Target_x86_64::got_section): Likewise.
5231 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
5232 (relro_now_test_SOURCES): New variable.
5233 (relro_now_test_DEPENDENCIES): New variable.
5234 (relro_now_test_LDFLAGS): New variable.
5235 (relro_now_test_LDADD): New variable.
5236 (relro_now_test.so): New target.
5237 * testsuite/Makefile.in: Rebuild.
5238
07aa62f2
ILT
52392011-07-12 Ian Lance Taylor <iant@google.com>
5240
5241 PR gold/12980
5242 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
5243 GLOB_DAT relocation rather than a RELATIVE relocation for a
5244 protected symbol when creating a shared library.
5245 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5246 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
5247 * testsuite/protected_main_1.cc (main): Test that protected
5248 function has same address.
5249
e2153196
ILT
52502011-07-11 Ian Lance Taylor <iant@google.com>
5251
5252 PR gold/12979
5253 * options.h (class General_options): Add -Bgroup.
5254 * options.cc (General_options::finalize): If -Bgroup is set,
5255 default to --unresolved-symbols=report-all.
5256 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
5257 * target-reloc.h (issue_undefined_symbol_error): Handle
5258 --unresolved-symbols=report-all.
5259
6daf5215
ILT
52602011-07-08 Ian Lance Taylor <iant@google.com>
5261
5262 PR gold/11985
5263 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
5264 if linker script discards key sections.
5265 (Layout::create_dynamic_symtab): Likewise.
5266 (Layout::assign_local_dynsym_offsets): Likewise.
5267 (Layout::sized_create_version_sections): Likewise.
5268 (Layout::create_interp): Likewise.
5269 (Layout::finish_dynamic_section): Likewise.
5270 (Layout::set_dynamic_symbol_size): Likewise.
5271
beabb2c6
ILT
52722011-07-08 Ian Lance Taylor <iant@google.com>
5273
5274 PR gold/12386
5275 * options.h (class General_options): Add --unresolved-symbols.
5276 * target-reloc.h (issue_undefined_symbol_error): Check
5277 --unresolved-symbols. Add comments.
5278
9c16daf1
ILT
52792011-07-08 Ian Lance Taylor <iant@google.com>
5280
5281 * testsuite/odr_violation2.cc (Ordering::operator()): Make
5282 expression more complex.
5283
191f1a2d
ILT
52842011-07-08 Ian Lance Taylor <iant@google.com>
5285
5286 PR gold/11317
5287 * target-reloc.h (issue_undefined_symbol_error): New inline
5288 function, broken out of relocate_section.
5289 (relocate_section): Call issue_undefined_symbol_error.
5290 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5291 there is no TLS segment if we are about to issue an undefined
5292 symbol error.
5293 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5294
62855347
ILT
52952011-07-08 Ian Lance Taylor <iant@google.com>
5296
5297 PR gold/12279
5298 * resolve.cc (Symbol_table::should_override): Add fromtype
5299 parameter. Change all callers. Give error when linking together
5300 TLS and non-TLS symbol.
5301 (Symbol_table::should_override_with_special): Add fromtype
5302 parameter. Change all callers.
5303 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5304 there is no TLS segment if we have reported some errors.
5305 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5306
67181c72
ILT
53072011-07-08 Ian Lance Taylor <iant@google.com>
5308
5309 PR gold/12372
5310 * target.h (Target::plt_address_for_global): New function.
5311 (Target::plt_address_for_local): New function.
5312 (Target::plt_section_for_global): Remove.
5313 (Target::plt_section_for_local): Remove.
5314 (Target::do_plt_address_for_global): New virtual function.
5315 (Target::do_plt_address_for_local): New virtual function.
5316 (Target::do_plt_section_for_global): Remove.
5317 (Target::do_plt_section_for_local): Remove.
5318 (Target::register_global_plt_entry): Add Symbol_table and Layout
5319 parameters.
5320 * output.cc (Output_data_got::Got_entry::write): Use
5321 plt_address_for_global and plt_address_for_local.
5322 * layout.cc (Layout::add_target_dynamic_tags): Use size and
5323 address of output section.
5324 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
5325 got_irelative_, and irelative_count_ fields. Update
5326 declarations.
5327 (Output_data_plt_i386::has_irelative_section): New function.
5328 (Output_data_plt_i386::entry_count): Add irelative_count_.
5329 (Output_data_plt_i386::set_final_data_size): Likewise.
5330 (class Target_i386): Add got_irelative_ and rel_irelative_
5331 fields. Update declarations.
5332 (Target_i386::Target_i386): Initialize new fields.
5333 (Target_i386::do_plt_address_for_global): New function replacing
5334 do_plt_section_for_global.
5335 (Target_i386::do_plt_address_for_local): New function replacing
5336 do_plt_section_for_local.
5337 (Target_i386::got_section): Create got_irelative_.
5338 (Target_i386::rel_irelative_section): New function.
5339 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
5340 fields. Don't define __rel_iplt_{start,end}.
5341 (Output_data_plt_i386::add_entry): Add symtab and layout
5342 parameters. Change all callers. Use different PLT and GOT for
5343 IFUNC symbols.
5344 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
5345 layout parameters. Change all callers. Use different PLT and
5346 GOT.
5347 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
5348 (Output_data_plt_i386::rel_irelative): New function.
5349 (Output_data_plt_i386::address_for_global): New function.
5350 (Output_data_plt_i386::address_for_local): New function.
5351 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
5352 IRELATIVE GOT when changing IFUNC GOT entries.
5353 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
5354 reloc.
5355 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
5356 if we didn't create an IRELATIVE GOT.
5357 (Target_i386::Relocate::relocate): Use plt_address_for_global and
5358 plt_address_for_local.
5359 (Target_i386::do_dynsym_value): Use plt_address_for_global.
5360 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
5361 got_irelative_, and irelative_count_ fields. Update
5362 declarations.
5363 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5364 Initialize new fields. Remove symtab parameter. Change all
5365 callers.
5366 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
5367 irelative_count_.
5368 (Output_data_plt_x86_64::has_irelative_section): New function.
5369 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
5370 (class Target_x86_64): Add got_irelative_ and rel_irelative_
5371 fields. Update declarations.
5372 (Target_x86_64::Target_x86_64): Initialize new fields.
5373 (Target_x86_64::do_plt_address_for_global): New function replacing
5374 do_plt_section_for_global.
5375 (Target_x86_64::do_plt_address_for_local): New function replacing
5376 do_plt_section_for_local.
5377 (Target_x86_64::got_section): Create got_irelative_.
5378 (Target_x86_64::rela_irelative_section): New function.
5379 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
5380 all callers. Don't create __rel_iplt_{start,end}.
5381 (Output_data_plt_x86_64::add_entry): Add symtab and layout
5382 parameters. Change all callers. Use different PLT and GOT for
5383 IFUNC symbols.
5384 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
5385 layout parameters. Change all callers. Use different PLT and
5386 GOT.
5387 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
5388 parameters. Change all callers. Use different PLT and GOT for
5389 IFUNC symbols.
5390 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
5391 (Output_data_plt_x86_64::rela_irelative): New function.
5392 (Output_data_plt_x86_64::address_for_global): New function.
5393 (Output_data_plt_x86_64::address_for_local): New function.
5394 (Output_data_plt_x86_64::set_final_data_size): Likewise.
5395 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
5396 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
5397 (Target_x86_64::register_global_plt_entry): Add symtab and layout
5398 parameters.
5399 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
5400 reloc.
5401 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
5402 symbols if we didn't create an IRELATIVE GOT.
5403 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
5404 plt_address_for_local.
5405 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
5406 * testsuite/ifuncvar1.c: New test file.
5407 * testsuite/ifuncvar2.c: New test file.
5408 * testsuite/ifuncvar3.c: New test file.
5409 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
5410 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
5411 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
5412 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
5413 * testsuite/Makefile.in: Rebuild.
5414
33c15b45
CC
54152011-07-07 Cary Coutant <ccoutant@google.com>
5416
5417 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
5418 (two_file_test_1_ndebug.o): Likewise.
5419 (two_file_test_1b_ndebug.o): Likewise.
5420 (two_file_test_2_ndebug.o): Likewise.
5421 (two_file_test_main_ndebug.o): Likewise.
5422 (incremental_test_2): Link with no-debug versions.
5423
f48b5fb7
CC
54242011-07-06 Cary Coutant <ccoutant@google.com>
5425
5426 * gold/incremental.cc
5427 (Output_section_incremental_inputs::write_info_blocks): Check for
5428 hidden and internal symbols.
5429
221597a5
CC
54302011-07-06 Cary Coutant <ccoutant@google.com>
5431
5432 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
5433 Check disposition for startup file.
5434 (Incremental_inputs::report_command_line): Ignore
5435 --incremental-startup-unchanged option.
5436 * options.cc (General_options::parse_incremental_startup_unchanged):
5437 New function.
5438 (General_options::General_options): Initialize new data member.
5439 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
5440 (General_options): Add --incremental-startup-unchanged option.
5441 (General_options::incremental_startup_disposition): New function.
5442 (General_options::incremental_startup_disposition_): New data member.
5443
e24719f6
CC
54442011-07-06 Cary Coutant <ccoutant@google.com>
5445
5446 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
5447 input file index to Script_info ctor.
5448 (Sized_incremental_binary::do_file_has_changed): Find the
5449 command-line argument for files named in scripts.
5450 * incremental.h (Script_info::Script_info): New ctor
5451 with input file index.
5452 (Script_info::input_file_index): New function.
5453 (Script_info::input_file_index_): New data member.
5454 (Incremental_binary::get_library): Add const.
5455 (Incremental_binary::get_script_info): Add const.
5456 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
5457 * testsuite/Makefile.am (incremental_test_5): New test case.
5458 (incremental_test_6): New test case.
5459 * testsuite/Makefile.in: Regenerate.
5460
8f7c81e8
CC
54612011-07-06 Cary Coutant <ccoutant@google.com>
5462
5463 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
5464 debug output when command lines differ.
5465
9fbd3822
CC
54662011-07-06 Cary Coutant <ccoutant@google.com>
5467
5468 * incremental.cc (Incremental_inputs::report_command_line): Ignore
5469 --incremental-patch option.
5470 * layout.cc (Free_list::allocate): Extend allocation beyond original
5471 end if enabled.
5472 (Layout::make_output_section): Mark sections that should get
5473 patch space.
5474 * options.cc (parse_percent): New function.
5475 * options.h (parse_percent): New function.
5476 (DEFINE_percent): New macro.
5477 (General_options): Add --incremental-patch option.
5478 * output.cc (Output_section::Output_section): Initialize new data
5479 members.
5480 (Output_section::add_input_section): Print section name when out
5481 of patch space.
5482 (Output_section::add_output_section_data): Likewise.
5483 (Output_section::set_final_data_size): Add patch space when
5484 doing --incremental-full.
5485 (Output_section::do_reset_address_and_file_offset): Remove patch
5486 space.
5487 (Output_segment::set_section_list_addresses): Print debug output
5488 only if --incremental-update.
5489 * output.h (Output_section::set_is_patch_space_allowed): New function.
5490 (Output_section::is_patch_space_allowed_): New data member.
5491 (Output_section::patch_space_): New data member.
5492 * parameters.cc (Parameters::incremental_full): New function.
5493 * parameters.h (Parameters::incremental_full): New function
5494 * testsuite/Makefile.am (incremental_test_2): Add test for
5495 --incremental-patch option.
5496 * testsuite/Makefile.in: Regenerate.
5497 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
5498 (t18): Remove function body.
5499
f6cccc2c
DK
55002011-07-05 Doug Kwan <dougkwan@google.com>
5501
5502 PR gold/12771
5503 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
5504 Arm_Address type for relocation result.
5505 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
5506 overflow check.
5507 (Arm_relocate_functions::abs32): Use unaligned access.
5508 (Arm_relocate_functions::rel32): Ditto.
5509 (Arm_relocate_functions::prel31): Ditto.
5510 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
5511 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
5512 static data relocations.
5513 * testsuite/Makefile.in: Regnerate.
5514 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
5515
28a13fec
ILT
55162011-07-05 Ian Lance Taylor <iant@google.com>
5517
5518 PR gold/12392
5519 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
5520 symbols if necessary.
5521 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5522
24d47b34
ILT
55232011-07-05 Ian Lance Taylor <iant@google.com>
5524
5525 PR gold/12952
5526 * resolve.cc (Symbol::override_base_with_special): Simply override
5527 version with special symbol version, ignoring previous version.
5528
41f9cbbe
ILT
55292011-07-05 Ian Lance Taylor <iant@google.com>
5530
5531 * object.cc (Sized_relobj_file::include_section_group): Add
5532 information to comment about signature location.
5533
886288f1
ILT
55342011-07-02 Ian Lance Taylor <iant@google.com>
5535
5536 PR gold/12957
5537 * options.h (class General_options): Add -f and -F.
5538 * options.cc (General_options::finalize): Fatal error if -f/-F
5539 are used without -shared.
5540 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
5541
ae3a6d4f
ILT
55422011-07-02 Ian Lance Taylor <iant@google.com>
5543
5544 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
5545
21131061
ILT
55462011-07-01 Ian Lance Taylor <iant@google.com>
5547
5548 PR gold/12525
5549 PR gold/12952
5550 * resolve.cc (Symbol::override_base_with_special): Don't override
5551 the version if the overriding symbol has a different name.
5552 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
5553 all callers. If we give an error about an undefined version,
5554 define the base version if necessary.
5555 * dynobj.h (class Versions): Update declaration.
5556 * testsuite/weak_alias_test_5.cc: New file.
5557 * testsuite/weak_alias_test.script: New file.
5558 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
5559 and versioned_alias have the right value, and call t2.
5560 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
5561 weak_alias_test_5.so.
5562 (weak_alias_test_LDADD): Likewise.
5563 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
5564 * testsuite/Makefile.in: Rebuild.
5565
611062c0
ILT
55662011-07-01 Ian Lance Taylor <iant@google.com>
5567
5568 PR gold/12525
5569 * options.h (class General_options): Support -z notext.
5570 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
5571 -Wl,-z,notext.
5572 (two_file_shared_nonpic.so): Likewise.
5573 (two_file_shared_mixed.so): Likewise.
5574 (two_file_shared_mixed_1.so): Likewise.
5575 (weak_undef_lib_nonpic.so): Likewise.
5576 (alt/weak_undef_lib_nonpic.so): Likewise.
5577 (tls_test_shared_nonpic.so): Likewise.
5578 * testsuite/Makefile.in: Rebuild.
5579
328c7c2f
ILT
55802011-07-01 Ian Lance Taylor <iant@google.com>
5581
5582 PR gold/12525
5583 * configure.ac: Test whether static linking works, setting
5584 the automake conditional HAVE_STATIC.
5585 * testsuite/Makefile.am: Disable tests using -static if
5586 HAVE_STATIC is not true.
5587 * configure, testsuite/Makefile.in: Rebuild.
5588
02d7cd44
ILT
55892011-07-01 Ian Lance Taylor <iant@google.com>
5590
5591 PR gold/12525
5592 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
5593 Assert if we see DW_EH_PE_indirect.
5594 * target.h (Target::ehframe_datarel_base): New function.
5595 (Target::do_ehframe_datarel_base): New target function.
5596 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
5597 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
5598 function.
5599
07a60597
ILT
56002011-07-01 Ian Lance Taylor <iant@google.com>
5601
5602 PR gold/12571
5603 * options.h (class General_options): Add
5604 --ld-generated-unwind-info.
5605 * ehframe.cc (Fde::write): Add address parameter. Change all
5606 callers. If associated with PLT, fill in address and size.
5607 (Cie::set_output_offset): Only add merge mapping if there is an
5608 object.
5609 (Cie::write): Add address parameter. Change all callers.
5610 (Eh_frame::add_ehframe_for_plt): New function.
5611 * ehframe.h (class Fde): Update declarations. Move shndx_ and
5612 input_offset_ fields into union u_, with new plt field.
5613 (Fde::Fde): Adjust for new union field.
5614 (Fde::Fde) [Output_data version]: New constructor.
5615 (Fde::add_mapping): Only add merge mapping if there is an object.
5616 (class Cie): Update declarations.
5617 (class Eh_frame): Declare add_ehframe_for_plt.
5618 * layout.cc (Layout::layout_eh_frame): Break out code into
5619 make_eh_frame_section, and call it.
5620 (Layout::make_eh_frame_section): New function.
5621 (Layout::add_eh_frame_for_plt): New function.
5622 * layout.h (class Layout): Update declarations.
5623 * merge.cc (Merge_map::add_mapping): Add assertion.
5624 * i386.cc: Include "dwarf.h".
5625 (class Output_data_plt_i386): Make first_plt_entry,
5626 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
5627 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5628 and plt_eh_frame_fde.
5629 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
5630 boundary. Call add_eh_frame_for_plt if appropriate.
5631 * x86_64.cc: Include "dwarf.h".
5632 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
5633 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
5634 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5635 and plt_eh_frame_fde.
5636 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
5637 appropriate.
5638
14788a3f
ILT
56392011-06-29 Ian Lance Taylor <iant@google.com>
5640
5641 PR gold/12629
5642 * object.cc (Sized_relobj_file::layout_section): Change shdr
5643 parameter to be const.
5644 (Sized_relobj_file::layout_eh_frame_section): New function, broken
5645 out of do_layout.
5646 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
5647 appropriate. Call layout_eh_frame_section.
5648 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
5649 sections.
5650 * object.h (class Sized_relobj_file): Update declarations.
5651
6c21fce1
ILT
56522011-06-29 Ian Lance Taylor <iant@google.com>
5653
37e41b03 5654 PR gold/12652
6c21fce1
ILT
5655 * script.cc (Token::integer_value): Accept trailing M/m/K/k
5656 modifier.
5657 (Lex::gather_token): Accept trailing M/m/K/k for integers.
5658
4d5e4e62
ILT
56592011-06-29 Ian Lance Taylor <iant@google.com>
5660
5661 PR gold/12675
5662 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
5663 SHT_X86_64_UNWIND.
5664 * layout.cc (Layout::layout_eh_frame): Likewise.
5665
886f533a
ILT
56662011-06-29 Ian Lance Taylor <iant@google.com>
5667
5668 PR gold/12695
5669 * layout.cc (Layout::symtab_section_shndx): New function.
5670 * layout.h (class Layout): Declare symtab_section_shndx.
5671 * output.cc (Output_section::write_header): Call it.
5672
f3ae1b28
ILT
56732011-06-29 Ian Lance Taylor <iant@google.com>
5674
5675 PR gold/12818
5676 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
5677 symbols which are not used in a relocation.
5678
aecf301f
ILT
56792011-06-28 Ian Lance Taylor <iant@google.com>
5680
5681 PR gold/12898
5682 * layout.cc (Layout::segment_precedes): Don't crash if a linker
5683 script create indistinguishable segments.
5684 (Layout::set_segment_offsets): Use stable_sort when sorting
5685 segments. Pass this to Compare_segments constructor.
5686 * layout.h (class Layout): Make segment_precedes non-static.
5687 (class Compare_segments): Change from struct to class. Add
5688 layout_ field. Add constructor.
5689 * script-sections.cc
5690 (Script_sections::attach_sections_using_phdrs_clause): Rename
5691 local orphan to is_orphan. Don't report failure to put empty
5692 section in segment. On attachment failure, report name of
5693 section, and attach to first PT_LOAD segment.
5694
03ef7571
ILT
56952011-06-28 Ian Lance Taylor <iant@google.com>
5696
5697 PR gold/12934
5698 * target-select.cc (Target_selector::Target_selector): Add
5699 emulation parameter. Change all callers.
5700 (select_target_by_bfd_name): Rename from select_target_by_name.
5701 Change all callers.
5702 (select_target_by_emulation): New function.
5703 (supported_emulation_names): New function.
5704 * target-select.h (class Target_selector): Add emulation_ field.
5705 Update declarations.
5706 (Target_selector::recognize_by_bfd_name): Rename from
5707 recognize_by_name. Change all callers.
5708 (Target_selector::supported_bfd_names): Rename from
5709 supported_names. Change all callers.
5710 (Target_selector::recognize_by_emulation): New function.
5711 (Target_selector::supported_emulations): New function.
5712 (Target_selector::emulation): New function.
5713 (Target_selector::do_recognize_by_bfd_name): Rename from
5714 do_recognize_by_name. Change all callers.
5715 (Target_selector::do_supported_bfd_names): Rename from
5716 do_supported_names. Change all callers.
5717 (Target_selector::do_recognize_by_emulation): New function.
5718 (Target_selector::do_supported_emulations): New function.
5719 (select_target_by_bfd_name): Change name in declaration.
5720 (select_target_by_emulation): Declare.
5721 (supported_emulation_names): Declare.
5722 * parameters.cc (parameters_force_valid_target): Try to find
5723 target based on emulation from -m option.
5724 * options.h (class General_options): Change doc string for -m.
5725 * options.cc (help): Print emulations.
5726 (General_options::parse_V): Likewise.
5727 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
5728 Add emulation parameter. Change all callers.
5729
200b2bb9
ILT
57302011-06-28 Ian Lance Taylor <iant@google.com>
5731
5732 * target.h (class Target): Add osabi_ field.
5733 (Target::osabi): New function.
5734 (Target::set_osabi): New function.
5735 (Target::Target): Initialize osabi_.
5736 (Target::do_adjust_elf_header): Make pure virtual.
5737 (Sized_target::do_adjust_elf_header): Declare.
5738 * target.cc (Sized_target::do_adjust_elf_header): New function.
5739 (class Sized_target): Instantiate all versions.
5740 * freebsd.h (class Target_freebsd): Remove.
5741 (Target_selector_freebsd::do_recognize): Call set_osabi on
5742 Target.
5743 (Target_selector_freebsd::do_recognize_by_name): Likewise.
5744 (Target_selector_freebsd::set_osabi): Remove.
5745 * i386.cc (class Target_i386): Inherit from Sized_target rather
5746 than Target_freebsd.
5747 * x86_64.cc (class Target_x86_64): Likewise.
5748
b3ce541e
ILT
57492011-06-28 Ian Lance Taylor <iant@google.com>
5750
5751 * target.h (Target::can_check_for_function_pointers): Rewrite.
5752 Make non-virtual.
5753 (Target::can_icf_inline_merge_sections): Likewise.
5754 (Target::section_may_have_icf_unsafe_poineters): Likewise.
5755 (Target::Target_info): Add can_icf_inline_merge_sections field.
5756 (Target::do_can_check_for_function_pointers): New virtual
5757 function.
5758 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
5759 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
5760 from can_check_for_function_pointers, move in file.
5761 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
5762 section_may_have_icf_unsafe_poineters, move in file.
5763 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
5764 * i386.cc (Target_i386::do_can_check_for_function_pointers):
5765 Rename from can_check_for_function_pointers, move in file.
5766 (Target_i386::can_icf_inline_merge_sections): Remove.
5767 (Target_i386::i386_info): Initialize
5768 can_icf_inline_merge_sections.
5769 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
5770 Initialize can_icf_inline_merge_sections.
5771 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
5772 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
5773 Rename from can_check_for_function_pointers, move in file.
5774 (Target_x86_64::can_icf_inline_merge_sections): Remove.
5775 (Target_x86_64::x86_64_info): Initialize
5776 can_icf_inline_merge_sections.
5777 * testsuite/testfile.cc (Target_test::test_target_info):
5778 Likewise.
5779 * icf.cc (get_section_contents): Correct formatting.
5780
6d1c4efb
ILT
57812011-06-27 Ian Lance Taylor <iant@google.com>
5782
5783 * symtab.cc (Symbol::versioned_name): New function.
5784 (Symbol_table::add_to_final_symtab): Use versioned_name when
5785 appropriate.
5786 (Symbol_table::sized_write_symbol): Likewise.
5787 * symtab.h (class Symbol): Declare versioned_name.
5788 * stringpool.h (class Stringpool_template): Add variant of add
5789 which takes a std::basic_string.
5790 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
5791 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
5792 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
5793 (ver_test_12.o): New target.
5794 * testsuite/Makefile.in: Rebuild.
5795
57eb9b50
DK
57962011-06-27 Doug Kwan <dougkwan@google.com>
5797
5798 * arm.cc (Arm_relocate_functions::thm_jump8,
5799 Arm_relocate_functions::thm_jump11): Use a wider signed
5800 type to compute offset.
5801 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
5802 arm_thm_jump8.
5803 * testsuite/Makefile.in: Regenerate.
5804 * testsuite/arm_branch_in_range.sh: Check test results of
5805 arm_thm_jump11 and arm_thm_jump8.
5806 * testsuite/arm_thm_jump11.s: New test source file.
5807 * testsuite/arm_thm_jump11.t: New linker script.
5808 * testsuite/arm_thm_jump8.s: New test source file.
5809 * testsuite/arm_thm_jump8.t: New linker script.
5810
487b39df
ILT
58112011-06-24 Ian Lance Taylor <iant@google.com>
5812
5813 * layout.cc: Include "object.h".
5814 (ctors_sections_in_init_array): New static variable.
5815 (Layout::is_ctors_in_init_array): New function.
5816 (Layout::layout): Add entry to ctors_sections_in_init_array if
5817 appropriate.
5818 * layout.h (class Layout): Declare is_ctors_in_init_array.
5819 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
5820 is_ctors_reverse_view is set.
5821 (Sized_relobj_file::write_sections): Add layout parameter. Change
5822 all callers. Set is_ctors_reverse_view field of View_size.
5823 (Sized_relobj_file::reverse_words): New function.
5824 * object.h (Sized_relobj_file::View_size): Add
5825 is_ctors_reverse_view field.
5826 (class Sized_relobj_file): Update declarations.
5827 * testsuite/initpri3.c: New test.
5828 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
5829 initpri3b.
5830 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
5831 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
5832 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
5833 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
5834 * testsuite/Makefile.in: Rebuild.
5835
472076e4
CC
58362011-06-24 Cary Coutant <ccoutant@google.com>
5837
5838 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
5839 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
5840 (debug_msg_cdebug.err): New targets.
5841 * testsuite/Makefile.in: Regenerate.
5842 * testsuite/debug_msg.sh: Check output of link with compressed debug.
5843 Fix checks for link with shared library.
5844
a60af0db
DK
58452011-06-24 Doug Kwan <dougkwan@google.com>
5846
5847 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
5848 skip empty text sections.
5849 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
5850
5393d741
ILT
58512011-06-22 Ian Lance Taylor <iant@google.com>
5852
5853 PR gold/12910
5854 * options.h (class General_options): Add --ctors-in-init-array.
5855 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
5856 friends as SHT_PROGBITS for merging sections.
5857 (Layout::layout): Remove special handling of .init_array and
5858 friends. Don't sort if doing relocatable link. Sort for .ctors
5859 and .dtors if ctors_in_init_array.
5860 (Layout::make_output_section): Force correct section types for
5861 .init_array and friends. Don't sort if doing relocatable link,
5862 Don't sort .ctors and .dtors if ctors_in_init_array.
5863 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
5864 (Layout::output_section_name): Add relobj parameter. Change all
5865 callers. Handle .ctors. and .dtors. in code rather than table.
5866 Handle .ctors and .dtors if ctors_in_init_array.
5867 (Layout::match_file_name): New function, moved from output.cc.
5868 * layout.h (class Layout): Update declarations.
5869 * output.cc: Include "layout.h".
5870 (Input_section_sort_entry::get_priority): New function.
5871 (Input_section_sort_entry::match_file_name): Just call
5872 Layout::match_file_name.
5873 (Output_section::Input_section_sort_init_fini_compare::operator()):
5874 Handle .ctors and .dtors. Sort by explicit priority rather than
5875 by name.
5876 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
5877 * testsuite/initpri2.c: New test.
5878 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
5879 (check_PROGRAMS): Add initpri2.
5880 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
5881 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
5882 * configure, testsuite/Makefile.in: Rebuild.
5883
e1f74f98
ILT
58842011-06-19 Ian Lance Taylor <iant@google.com>
5885
5886 PR gold/12880
5887 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
5888 .interp section to a PT_INTERP segment even if we have seen a
5889 --dynamic-linker option. Don't do it if we have seen a PHDRS
5890 clause in a linker script.
5891 (Layout::finalize): Don't create a .interp section if we've
5892 already create a PT_INTERP segment.
5893 (Layout::create_interp): Always call choose_output_section (revert
5894 patch of 2011-06-17). Don't create PT_INTERP segment.
5895 * script-sections.cc
5896 (Script_sections::create_note_and_tls_segments): Add a .interp
5897 section to a PT_INTERP segment even if we have seen a
5898 --dynamic-linker option.
5899
766f91bb
ILT
59002011-06-18 Ian Lance Taylor <iant@google.com>
5901
5902 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
5903 merely because a non-PT_LOAD segment has a dynamic reloc.
5904
0d212c3a
ILT
59052011-06-18 Ian Lance Taylor <iant@google.com>
5906
5907 * layout.cc (Layout::finish_dynamic_section): Don't create
5908 DT_FLAGS entry if not needed.
5909
911a5072
ILT
59102011-06-18 Ian Lance Taylor <iant@google.com>
5911
5912 PR gold/12745
5913 * layout.cc (Layout::layout_eh_frame): Correct handling of
5914 writable .eh_frame section.
5915
534b4e5f
ILT
59162011-06-17 Ian Lance Taylor <iant@google.com>
5917
5918 PR gold/12893
5919 * resolve.cc (Symbol_table::resolve): Don't give an error if a
5920 symbol is redefined with the exact same object and value.
5921
10b4f102
ILT
59222011-06-17 Ian Lance Taylor <iant@google.com>
5923
5924 PR gold/12880
5925 * layout.h (class Layout): Add interp_segment_ field.
5926 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
5927 (Layout::attach_allocated_section_to_segment): If making shared
5928 library, put .interp section in PT_INTERP segment.
5929 (Layout::finalize): Also call create_interp if -dynamic-linker
5930 option was used.
5931 (Layout::create_interp): Assert that there is no PT_INTERP
5932 segment. If not using a SECTIONS clause, use make_output_section.
5933 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
5934 * script-sections.cc
5935 (Script_sections::create_note_and_tls_segments): If making shared
5936 library, put .interp section in PT_INTERP segment.
5937
a29b0dad
ILT
59382011-06-17 Ian Lance Taylor <iant@google.com>
5939
e588ea8d
ILT
5940 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
5941 when making a shared library.
5942
59432011-06-17 Ian Lance Taylor <iant@google.com>
5944
5945 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
5946 parameter. Change all callers. Don't issue warning about PC32
5947 against locally defined symbol.
a29b0dad 5948
9d3b0698
ILT
59492011-06-16 Ian Lance Taylor <iant@google.com>
5950
5951 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
5952 occurs in same object.
5953
85b0f90c
AM
59542011-06-14 Alan Modra <amodra@gmail.com>
5955
5956 * po/POTFILES.in: Regenerate.
5957
a94907d9
ILT
59582011-06-09 Ian Lance Taylor <iant@google.com>
5959
5960 * script-sections.cc
5961 (Orphan_output_section::set_section_addresses): For a relocatable
5962 link set address to 0.
5963
4fb3a1c3
CC
59642011-06-09 Cary Coutant <ccoutant@google.com>
5965
5966 PR gold/12804
5967 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
5968 used with --compress-debug-sections.
5969 * gold/object.cc (Sized_relobj_file::do_layout): Report
5970 uncompressed size of compressed input sections.
5971
61220854
CC
59722011-06-08 Cary Coutant <ccoutant@google.com>
5973
5974 PR gold/12804
5975 * testsuite/two_file_test_2_v1.cc: Change initialization of
5976 v2 to keep it in .data.
5977
e6455dfb
CC
59782011-06-07 Cary Coutant <ccoutant@google.com>
5979
5980 * common.cc (Symbol_table::do_allocate_commons_list): Call
5981 gold_fallback.
5982 * errors.cc (Errors::fatal): Adjust call to gold_exit.
5983 (Errors::fallback): New function.
5984 (gold_fallback): New function.
5985 * errors.h (Errors::fallback): New function.
5986 * gold.cc (gold_exit): Change status parameter to enum; adjust
5987 all callers.
5988 (queue_initial_tasks): Call gold_fallback.
5989 * gold.h: Include cstdlib.
5990 (Exit_status): New enum type.
5991 (gold_exit): Change status parameter to enum.
5992 (gold_fallback): New function.
5993 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
5994 (Layout::create_symtab_sections): Likewise.
5995 (Layout::create_shdrs): Likewise.
5996 * main.cc (main): Adjust call to gold_exit.
5997 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
5998 (Output_data_got::add_got_entry_pair): Likewise.
5999 (Output_section::add_input_section): Likewise.
6000 (Output_section::add_output_section_data): Likewise.
6001 (Output_segment::set_section_list_addresses): Likewise.
6002 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
6003
fb0e076f
CC
60042011-06-07 Cary Coutant <ccoutant@google.com>
6005
6006 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
6007 for incremental links.
6008 * output.cc (Output_segment::set_section_list_addresses): Remove
6009 FIXME and test for TLS or BSS.
6010
a5ee4d5d
CC
60112011-06-07 Cary Coutant <ccoutant@google.com>
6012
6013 * testsuite/Makefile.am: Add incremental_copy_test,
6014 incremental_common_test_1.
6015 * testsuite/Makefile.in: Regenerate.
6016 * testsuite/common_test_1_v1.c: New source file.
6017 * testsuite/common_test_1_v2.c: New source file.
6018 * testsuite/copy_test_v1.cc: New source file.
6019
5146f448
CC
60202011-06-07 Cary Coutant <ccoutant@google.com>
6021
6022 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
6023 update, allocate common from bss section's free list.
6024 * incremental-dump.cc (dump_incremental_inputs): Print flag for
6025 linker-defined symbols.
6026 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
6027 Skip GOT and PLT entries that are no longer referenced.
6028 (Output_section_incremental_inputs::write_info_blocks): Mark
6029 linker-defined symbols.
6030 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
6031 * output.cc (Output_section::allocate): New function.
6032 * output.h (Output_section::allocate): New function.
6033 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
6034 linker-defined symbols.
6035 (Symbol::override_base_with_special): Copy is_predefined_ flag.
6036 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
6037 (Symbol::init_base_output_data): Likewise.
6038 (Symbol::init_base_output_segment): Likewise.
6039 (Symbol::init_base_constant): Likewise.
6040 (Sized_symbol::init_output_data): Likewise.
6041 (Sized_symbol::init_output_segment): Likewise.
6042 (Sized_symbol::init_constant): Likewise.
6043 (Symbol_table::do_define_in_output_data): Likewise.
6044 (Symbol_table::do_define_in_output_segment): Likewise.
6045 (Symbol_table::do_define_as_constant): Likewise.
6046 * symtab.h (Symbol::is_predefined): New function.
6047 (Symbol::init_base_output_data): Add is_predefined parameter.
6048 (Symbol::init_base_output_segment): Likewise.
6049 (Symbol::init_base_constant): Likewise.
6050 (Symbol::is_predefined_): New data member.
6051 (Sized_symbol::init_output_data): Add is_predefined parameter.
6052 (Sized_symbol::init_output_segment): Likewise.
6053 (Sized_symbol::init_constant): Likewise.
6054 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
6055
26d3c67d
CC
60562011-06-07 Cary Coutant <ccoutant@google.com>
6057
6058 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
6059 instead of emit_copy_reloc.
6060 (Copy_relocs::emit_copy_reloc): Refactor.
6061 (Copy_relocs::make_copy_reloc): New function.
6062 (Copy_relocs::add_copy_reloc): Remove.
6063 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
6064 section.
6065 (Copy_relocs::make_copy_reloc): New function.
6066 (Copy_relocs::add_copy_reloc): Remove.
6067 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
6068 unchanged input files.
6069 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
6070 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
6071 Reserve BSS space for COPY relocations.
6072 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6073 (Output_section_incremental_inputs::write_info_blocks): Record
6074 whether a symbol is copied from a shared object.
6075 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
6076 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
6077 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
6078 (Incremental_input_entry_reader::get_output_symbol_index): Add
6079 is_copy parameter.
6080 (Incremental_binary::emit_copy_relocs): New function.
6081 (Incremental_binary::do_emit_copy_relocs): New function.
6082 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6083 new data member.
6084 (Sized_incremental_binary::add_copy_reloc): New function.
6085 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6086 (Sized_incremental_binary::Copy_reloc): New struct.
6087 (Sized_incremental_binary::Copy_relocs): New typedef.
6088 (Sized_incremental_binary::copy_relocs_): New data member.
6089 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
6090 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
6091 * target.h (Sized_target::emit_copy_reloc): New function.
6092 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
6093
7cdb37d9
CC
60942011-06-02 Cary Coutant <ccoutant@google.com>
6095
6096 PR gold/12163
6097 * gold/archive.cc (Archive::Archive): Initialize new data member.
6098 (Archive::include_all_members): Return if archive has already been
6099 included.
6100 * gold/archive.h (Archive::include_all_members_): New data member.
6101
cc643b88
NC
61022011-06-02 Nick Clifton <nickc@redhat.com>
6103
6104 * dynobj.h: Fix spelling mistake in comment.
6105 * output.cc: Likewise.
6106
f62a3ca7 61072011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 6108 Asier Llano
f62a3ca7
DK
6109
6110 PR gold/12826
cc643b88 6111 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
6112 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
6113 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
6114 redundant arm_exidx_test.so.
6115 * testsuite/Makefile.in: Regenerate.
6116 (check_SCRIPTS): Add pr12826.sh
6117 (check_DATA): Add pr12826.stdout
6118 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
6119 * testsuite/pr12826.sh: New file.
6120 * testsuite/pr12826_1.s: Ditto.
6121 * testsuite/pr12826_1.s: Ditto.
6122
8dbe1edc
ILT
61232011-05-30 Ian Lance Taylor <iant@google.com>
6124
6125 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
6126 sections.
6127
c49875be
ILT
61282011-05-29 Ian Lance Taylor <iant@google.com>
6129
6130 PR gold/12804
6131 * testsuite/Makefile.am: Use different file name for two_file_test
6132 temporary file for each incremental test.
6133 * testsuite/Makefile.in: Rebuild.
6134
69d53f7a
ILT
61352011-05-29 Ian Lance Taylor <iant@google.com>
6136
6137 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
6138 binary input file is empty.
6139
41d0ab5f
ILT
61402011-05-27 Ian Lance Taylor <iant@google.com>
6141
6142 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
6143 (ver_test_9.so): Likewise.
6144 * testsuite/Makefile.in: Rebuild.
6145
89d8a36b
CC
61462011-05-26 Cary Coutant <ccoutant@google.com>
6147
6148 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
6149 * incremental.cc (Incremental_inputs::report_input_section): Fix
6150 comment, indentation.
6151 (Incremental_inputs::report_comdat_group): New function.
6152 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6153 of data for incremental input file entry.
6154 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
6155 group count, COMDAT group signatures.
6156 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
6157 an unchanged input file.
6158 * incremental.h (Incremental_object_entry::Incremental_object_entry):
6159 Initialize new data member.
6160 (Incremental_object_entry::add_comdat_group): New function.
6161 (Incremental_object_entry::get_comdat_group_count): New function.
6162 (Incremental_object_entry::get_comdat_signature_key): New function.
6163 (Incremental_object_entry::groups_): New data member.
6164 (Incremental_inputs::report_comdat_group): New function.
6165 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
6166 data for incremental input file entry.
6167 (Incremental_input_entry_reader::get_comdat_group_count): New function.
6168 (Incremental_input_entry_reader::get_input_section): Adjust size of
6169 data for incremental input file entry.
6170 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
6171 (Incremental_input_entry_reader::get_comdat_group_signature): New
6172 function.
6173 * object.cc (Sized_relobj::include_section_group): Report kept
6174 COMDAT groups for incremental links.
6175
1706a06f
ILT
61762011-05-24 David Meyer <pdox@google.com>
6177
6178 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
6179 with name parameter. Add found_name parameter.
6180 * fileread.cc (Input_file::find_file): Adjust code accordingly.
6181 * dirsearch.h (class Dirsearch): Update declaration.
6182
a10ae760
ILT
61832011-05-24 Ian Lance Taylor <iant@google.com>
6184
6185 * archive.cc (Library_base::should_include_member): Pull in object
6186 from archive if it defines the entry symbol.
6187 * parameters.cc (Parameters::entry): New function.
6188 * parameters.h (class Parameters): Declare entry.
6189 * output.h (class Output_file_header): Remove entry_ field.
6190 * output.cc (Output_file_header::Output_file_header): Remove entry
6191 parameter. Change all callers.
6192 (Output_file_header::entry): Use parameters->entry.
6193 * gold.cc (queue_middle_tasks): Likewise.
6194 * plugin.cc (Plugin_hook::run): Likewise.
6195
aa92d6ed
CC
61962011-05-24 Cary Coutant <ccoutant@google.com>
6197
6198 * gold.cc (queue_initial_tasks): Pass incremental base filename
6199 to Output_file::open_base_file; don't print error message.
6200 * incremental-dump.cc (main): Adjust call to
6201 Output_file::open_for_modification.
6202 * incremental-dump.cc (main): Likewise.
6203 * incremental.cc (Incremental_inputs::report_command_line):
6204 Ignore --incremental-base option when comparing command lines.
6205 Ignore parameter when given as separate argument.
6206 * options.h (class General_options): Add --incremental-base.
6207 * output.cc (Output_file::Output_file):
6208 (Output_file::open_base_file): Add base_name and writable parameters;
6209 read base file into new file; print error message here.
6210 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6211 callers.
6212 * output.h (Output_file::open_for_modification): Rename to...
6213 (Output_file::open_base_file): ...this; add base_name and
6214 writable parameters; adjust all callers.
6215 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6216 callers.
6217 * testsuite/Makefile.am (incremental_test_4): Test
6218 --incremental-base.
6219 * testsuite/Makefile.in: Regenerate.
6220
2eedd706
CC
62212011-05-24 Cary Coutant <ccoutant@google.com>
6222
6223 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
6224 incremental_test_4.
6225 * testsuite/Makefile.in: Regenerate.
6226 * testsuite/two_file_test_1_v1.cc: New test source file.
6227 * testsuite/two_file_test_1b_v1.cc: New test source file.
6228 * testsuite/two_file_test_2_v1.cc: New test source file.
6229
0f1c85a6
CC
62302011-05-24 Cary Coutant <ccoutant@google.com>
6231
6232 * dynobj.h (Dynobj::do_dynobj): New function.
6233 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
6234 flag and soname for shared objects.
6235 * incremental.cc (Incremental_inputs::report_object): Make
6236 either Incremental_object_entry or Incremental_dynobj_entry; add
6237 soname to string table.
6238 (Incremental_inputs::report_input_section): Add assertion.
6239 (Output_section_incremental_inputs::set_final_data_size): Adjust
6240 type of input file entry for shared libraries; adjust size of
6241 shared library info entry.
6242 (Output_section_incremental_inputs::write_input_files): Write
6243 as_needed flag for shared libraries.
6244 (Output_section_incremental_inputs::write_info_blocks): Adjust type
6245 of input file entry for shared libraries; write soname.
6246 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
6247 soname from incremental info.
6248 * incremental.h (enum Incremental_input_flags): Add
6249 INCREMENTAL_INPUT_AS_NEEDED.
6250 (Incremental_input_entry::Incremental_input_entry): Initialize new
6251 data member.
6252 (Incremental_input_entry::set_as_needed): New function.
6253 (Incremental_input_entry::as_needed): New function.
6254 (Incremental_input_entry::do_dynobj_entry): New function.
6255 (Incremental_input_entry::as_needed_): New data member.
6256 (Incremental_object_entry::Incremental_object_entry): Don't check
6257 for shared library.
6258 (Incremental_object_entry::do_type): Likewise.
6259 (class Incremental_dynobj_entry): New class.
6260 (Incremental_input_entry_reader::as_needed): New function.
6261 (Incremental_input_entry_reader::get_soname): New function.
6262 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
6263 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
6264 size of shared library info entry.
58797674 6265 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
6266 incremental link when adding DT_NEEDED entries.
6267 * object.h (Object::Object): Initialize new data member.
6268 (Object::dynobj): New function.
6269 (Object::set_as_needed): New function.
6270 (Object::as_needed): New function.
6271 (Object::do_dynobj): New function.
6272 (Object::as_needed_): New data member.
6273
6fa2a40b
CC
62742011-05-24 Cary Coutant <ccoutant@google.com>
6275
6276 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
6277 info; adjust display of GOT entries.
6278 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6279 vector of input objects; remove file_status_.
6280 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
6281 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
6282 got_plt reader; call target hooks to reserve GOT entries.
6283 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6284 of input file info header and GOT info entry.
6285 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
6286 relocation info.
6287 (Got_plt_view_info::got_descriptor): Remove.
6288 (Got_plt_view_info::sym_index): New data member.
6289 (Got_plt_view_info::input_index): New data member.
6290 (Local_got_offset_visitor::visit): Write input file index.
6291 (Global_got_offset_visitor::visit): Write 0 for input file index.
6292 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
6293 with sym_index and input_index.
6294 (Output_section_incremental_inputs::write_got_plt): Adjust size of
6295 incremental info GOT entry; replace got_descriptor with input_index.
6296 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
6297 map from input file index to object.
6298 (Sized_relobj_incr::do_layout): Replace direct data member reference
6299 with accessor function.
6300 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
6301 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
6302 Adjust size of input file info header.
6303 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
6304 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
6305 (Incremental_input_entry_reader::get_input_section): Adjust size of
6306 input file info header.
6307 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
6308 of incremental info GOT entry.
6309 (Incremental_got_plt_reader::get_got_desc): Remove.
6310 (Incremental_got_plt_reader::get_got_symndx): New function.
6311 (Incremental_got_plt_reader::get_got_input_index): New function.
6312 (Sized_incremental_binary::Sized_incremental_binary): Remove
6313 file_status_; add input_objects_.
6314 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
6315 (Sized_incremental_binary::set_file_is_unchanged): Remove.
6316 (Sized_incremental_binary::file_is_unchanged): Remove.
6317 (Sized_incremental_binary::set_input_object): New function.
6318 (Sized_incremental_binary::input_object): New function.
6319 (Sized_incremental_binary::file_status_): Remove.
6320 (Sized_incremental_binary::input_objects_): New data member.
6321 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
6322 references.
6323 (Sized_relobj_incr::invalid_address): Move to base class.
6324 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
6325 class.
6326 (Sized_relobj_incr::do_output_section_offset): Likewise.
6327 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
6328 (Sized_relobj_incr::section_offsets_): Likewise.
6329 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
6330 function.
6331 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
6332 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
6333 with accessor function.
6334 (Sized_relobj_file::do_layout): Likewise.
6335 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
6336 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
6337 (Sized_relobj_file::compute_final_local_value): Replace refs to
6338 section_offsets_ with accessor function.
6339 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
6340 * object.h (Relobj::Relobj): Initialize new data members.
6341 (Relobj::add_dyn_reloc): New function.
6342 (Relobj::first_dyn_reloc): New function.
6343 (Relobj::dyn_reloc_count): New function.
6344 (Relobj::first_dyn_reloc_): New data member.
6345 (Relobj::dyn_reloc_count_): New data member.
6346 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
6347 references.
6348 (Sized_relobj::Address): New typedef.
6349 (Sized_relobj::invalid_address): Move here from child class.
6350 (Sized_relobj::Sized_relobj): Initialize new data members.
6351 (Sized_relobj::sized_relobj): New function.
6352 (Sized_relobj::is_output_section_offset_invalid): Move here from
6353 child class.
6354 (Sized_relobj::get_output_section_offset): Likewise.
6355 (Sized_relobj::local_has_got_offset): Likewise.
6356 (Sized_relobj::local_got_offset): Likewise.
6357 (Sized_relobj::set_local_got_offset): Likewise.
6358 (Sized_relobj::do_for_all_local_got_entries): Likewise.
6359 (Sized_relobj::clear_got_offsets): New function.
6360 (Sized_relobj::section_offsets): Move here from child class.
6361 (Sized_relobj::do_output_section_offset): Likewise.
6362 (Sized_relobj::do_set_section_offset): Likewise.
6363 (Sized_relobj::Local_got_offsets): Likewise.
6364 (Sized_relobj::local_got_offsets_): Likewise.
6365 (Sized_relobj::section_offsets_): Likewise.
6366 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
6367 references.
6368 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
6369 class.
6370 (Sized_relobj_file::sized_relobj): New function
6371 (Sized_relobj_file::local_has_got_offset): Move to base class.
6372 (Sized_relobj_file::local_got_offset): Likewise.
6373 (Sized_relobj_file::set_local_got_offset): Likewise.
6374 (Sized_relobj_file::get_output_section_offset): Likewise.
6375 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
6376 (Sized_relobj_file::do_output_section_offset): Likewise.
6377 (Sized_relobj_file::do_set_section_offset): Likewise.
6378 (Sized_relobj_file::Local_got_offsets): Likewise.
6379 (Sized_relobj_file::local_got_offsets_): Likewise.
6380 (Sized_relobj_file::section_offsets_): Likewise.
6381 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
6382 (all constructors).
6383 (set_needs_dynsym_index): Convert relobj to derived class pointer.
6384 (Output_reloc::get_symbol_index): Likewise.
6385 (Output_reloc::local_section_offset): Likewise.
6386 (Output_reloc::get_address): Likewise.
6387 (Output_reloc::symbol_value): Likewise.
6388 (Output_data_got::reserve_slot): Move to class definition.
6389 (Output_data_got::reserve_local): New function.
6390 (Output_data_got::reserve_slot_for_global): Remove.
6391 (Output_data_got::reserve_global): New function.
6392 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
6393 (all constructors, two instantiations).
6394 (Output_reloc::get_relobj): New function (two instantiations).
6395 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
6396 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
6397 (Output_data_reloc::add_global): Adjust type of relobj.
6398 (Output_data_reloc::add_global_relative): Likewise.
6399 (Output_data_reloc::add_symbolless_global_addend): Likewise.
6400 (Output_data_reloc::add_local): Likewise.
6401 (Output_data_reloc::add_local_relative): Likewise.
6402 (Output_data_reloc::add_symbolless_local_addend): Likewise.
6403 (Output_data_reloc::add_local_section): Likewise.
6404 (Output_data_reloc::add_output_section): Likewise.
6405 (Output_data_reloc::add_absolute): Likewise.
6406 (Output_data_reloc::add_target_specific): Likewise.
6407 (Output_data_got::reserve_slot): Move definition here.
6408 (Output_data_got::reserve_local): New function.
6409 (Output_data_got::reserve_global): New function.
6410 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
6411 section_offsets_ with accessor function.
6412 (Sized_relobj_file::write_sections): Likewise.
6413 (Sized_relobj_file::do_relocate_sections): Likewise.
6414 * target.h (Sized_target::reserve_local_got_entry): New function.
6415 (Sized_target::reserve_global_got_entry): New function.
6416 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
6417 (Target_x86_64::reserve_global_got_entry): New function.
6418 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
6419
4829d394
CC
64202011-05-23 Cary Coutant <ccoutant@google.com>
6421
6422 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
6423 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
6424 bit when checking got_type.
6425 * incremental.cc (Sized_incremental_binary::setup_readers):
6426 Store symbol table and string table locations; initialize bit vector
6427 of file status flags.
6428 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
6429 unchanged files.
6430 (Sized_incremental_binary::do_process_got_plt): New function.
6431 (Sized_incremental_binary::get_symtab_view): Use stored locations.
6432 (Output_section_incremental_inputs::set_final_data_size): Record
6433 file index for each input file.
6434 (Output_section_incremental_inputs::write_got_plt): Store file index
6435 instead of input entry offset for each GOT entry.
6436 * incremental.h
6437 (Incremental_input_entry::Incremental_input_entry): Initialize new
6438 data member.
6439 (Incremental_input_entry::set_offset): Store file index.
6440 (Incremental_input_entry::get_file_index): New function.
6441 (Incremental_input_entry::file_index_): New data member.
6442 (Incremental_binary::process_got_plt): New function.
6443 (Incremental_binary::do_process_got_plt): New function.
6444 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6445 data members.
6446 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
6447 (Sized_incremental_binary::set_file_is_unchanged): New function.
6448 (Sized_incremental_binary::file_is_unchanged): New function.
6449 (Sized_incremental_binary::do_process_got_plt): New function.
6450 (Sized_incremental_binary::file_status_): New data member.
6451 (Sized_incremental_binary::main_symtab_loc_): New data member.
6452 (Sized_incremental_binary::main_strtab_loc_): New data member.
6453 * output.cc (Output_data_got::Got_entry::write): Add case
6454 RESERVED_CODE.
6455 (Output_data_got::add_global): Call add_got_entry.
6456 (Output_data_got::add_global_plt): Likewise.
6457 (Output_data_got::add_global_with_rel): Likewise.
6458 (Output_data_got::add_global_with_rela): Likewise.
6459 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
6460 (Output_data_got::add_global_pair_with_rela): Likewise.
6461 (Output_data_got::add_local): Call add_got_entry.
6462 (Output_data_got::add_local_plt): Likewise.
6463 (Output_data_got::add_local_with_rel): Likewise.
6464 (Output_data_got::add_local_with_rela): Likewise.
6465 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
6466 (Output_data_got::add_local_pair_with_rela): Likewise.
6467 (Output_data_got::reserve_slot): New function.
6468 (Output_data_got::reserve_slot_for_global): New function.
6469 (Output_data_got::add_got_entry): New function.
6470 (Output_data_got::add_got_entry_pair): New function.
6471 (Output_section::add_output_section_data): Edit FIXME.
6472 * output.h
6473 (Output_section_data_build::Output_section_data_build): New
6474 constructor with size parameter.
6475 (Output_data_space::Output_data_space): Likewise.
6476 (Output_data_got::Output_data_got): Initialize new data member; new
6477 constructor with size parameter.
6478 (Output_data_got::add_constant): Call add_got_entry.
6479 (Output_data_got::reserve_slot): New function.
6480 (Output_data_got::reserve_slot_for_global): New function.
6481 (class Output_data_got::Got_entry): Add RESERVED_CODE.
6482 (Output_data_got::add_got_entry): New function.
6483 (Output_data_got::add_got_entry_pair): New function.
6484 (Output_data_got::free_list_): New data member.
6485 * target.h (Sized_target::init_got_plt_for_update): New function.
6486 (Sized_target::register_global_plt_entry): New function.
6487 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
6488 Initialize new data member; call init; add constructor with PLT count.
6489 (Output_data_plt_x86_64::init): New function.
6490 (Output_data_plt_x86_64::add_relocation): New function.
6491 (Output_data_plt_x86_64::reserve_slot): New function.
6492 (Output_data_plt_x86_64::free_list_): New data member.
6493 (Target_x86_64::init_got_plt_for_update): New function.
6494 (Target_x86_64::register_global_plt_entry): New function.
6495 (Output_data_plt_x86_64::add_entry): Allocate from free list for
6496 incremental updates.
6497 (Output_data_plt_x86_64::add_relocation): New function.
6498 * testsuite/object_unittest.cc (Object_test): Set default options.
6499
ec69d6da
ILT
65002011-05-16 Ian Lance Taylor <iant@google.com>
6501
6502 * options.h (class General_options): Make -i a synonym for -r.
6503
732e31de
ILT
65042011-05-16 Ian Lance Taylor <iant@google.com>
6505
6506 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
6507
403676b5
CC
65082011-05-10 Cary Coutant <ccoutant@google.com>
6509
6510 * object.cc (Sized_relobj::do_count_local_symbols): Check for
6511 strip_all (-s).
6512
5b7b7d6e
ILT
65132011-05-06 Ian Lance Taylor <iant@google.com>
6514
6515 * layout.cc (Layout::layout): If the output section flags change,
6516 update the ordering.
6517
f0f9babf
CC
65182011-04-25 Cary Coutant <ccoutant@google.com>
6519
6520 * incremental-dump.cc (dump_incremental_inputs): Print local
6521 symbol info for each input file.
6522 * incremental.cc
6523 (Output_section_incremental_inputs::set_final_data_size): Add local
6524 symbol info to input file entries in incremental info.
6525 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6526 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
6527 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
6528 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
6529 implementation.
6530 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
6531 (Sized_incr_relobj::do_relocate): Write the local symbols.
6532 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
6533 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
6534 Adjust size of input file header.
6535 (Incremental_inputs_reader::get_local_symbol_offset): New function.
6536 (Incremental_inputs_reader::get_local_symbol_count): New function.
6537 (Incremental_inputs_reader::get_input_section): Adjust size of input
6538 file header.
6539 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
6540 (Sized_incr_relobj::This): New typedef.
6541 (Sized_incr_relobj::sym_size): New const data member.
6542 (Sized_incr_relobj::Local_symbol): New struct.
6543 (Sized_incr_relobj::do_output_local_symbol_count): New function.
6544 (Sized_incr_relobj::do_local_symbol_offset): New function.
6545 (Sized_incr_relobj::local_symbol_count_): New data member.
6546 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
6547 (Sized_incr_relobj::local_symbol_index_): New data member.
6548 (Sized_incr_relobj::local_symbol_offset_): New data member.
6549 (Sized_incr_relobj::local_dynsym_offset_): New data member.
6550 (Sized_incr_relobj::local_symbols_): New data member.
6551 * object.h (Relobj::output_local_symbol_count): New function.
6552 (Relobj::local_symbol_offset): New function.
6553 (Relobj::do_output_local_symbol_count): New function.
6554 (Relobj::do_local_symbol_offset): New function.
6555 (Sized_relobj::do_output_local_symbol_count): New function.
6556 (Sized_relobj::do_local_symbol_offset): New function.
6557
d0a9ace3
ILT
65582011-04-22 Vladimir Simonov <sv@sw.ru>
6559
6560 * descriptors.cc (set_close_on_exec): New function.
6561 (Descriptors::open): Use set_close_on_exec.
6562 * output.cc (S_ISLNK): Define if not defined.
6563
94a3fc8b
CC
65642011-04-22 Cary Coutant <ccoutant@google.com>
6565
6566 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6567 global symbol map.
6568 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6569 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
6570 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
6571 relocations.
6572 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
6573 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
6574 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
6575 * incremental.h
6576 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
6577 function.
6578 (Incremental_binary::apply_incremental_relocs): New function.
6579 (Incremental_binary::do_apply_incremental_relocs): New function.
6580 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6581 data member.
6582 (Sized_incremental_binary::add_global_symbol): New function.
6583 (Sized_incremental_binary::global_symbol): New function.
6584 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6585 (Sized_incremental_binary::symbol_map_): New data member.
6586 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
6587 * target.h (Sized_target::apply_relocation): New function.
6588 * target-reloc.h (apply_relocation): New function.
6589 * x86_64.cc (Target_x86_64::apply_relocation): New function.
6590
c87e4302
DK
65912011-04-22 Doug Kwan <dougkwan@google.com>
6592
6593 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
6594 flag of a SHT_ARM_EXIDX section.
2e702c99 6595 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
6596 * testsuite/Makefile.in: Regenerate.
6597 * testsuite/arm_exidx_test.s: New file.
6598 * testsuite/arm_exidx_test.sh: Same.
6599
e7782cf6
CC
66002011-04-20 Cary Coutant <ccoutant@google.com>
6601
6602 PR gold/12689
6603 * archive.h (Incremental_archive_entry::Archive_member):
6604 Initialize arg_serial_ (second constructor).
6605
308ecdc7
ILT
66062011-04-17 Ian Lance Taylor <iant@google.com>
6607
6608 * object.cc (Relocate_info::location): Simplify location string.
6609 * errors.cc (Errors::error_at_location): Don't print program
6610 name.
6611 (Errors::warning_at_location): Likewise.
6612 (Errors::undefined_symbol): Likewise.
6613 * testsuite/debug_msg.sh: Update accordingly.
6614
bec5b579
CC
66152011-04-14 Cary Coutant <ccoutant@google.com>
6616
6617 * gold/layout.cc (Layout::symtab_section_offset): New function.
6618 * gold/layout.h (Layout::symtab_section_offset): New function.
6619 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
6620
88597d34
ILT
66212011-04-12 Ian Lance Taylor <iant@google.com>
6622
6623 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
6624 with MREMAP_MAYMOVE.
6625 * output.h (class Output_file): Add map_is_allocated_ field.
6626 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
6627 not available, provide stubs. If mremap is not available, #define
6628 it to gold_mremap.
6629 (MREMAP_MAYMOVE): Define if not defined.
6630 (Output_file::Output_file): Initialize map_is_allocated_.
6631 (Output_file::resize): Check map_is_allocated_.
6632 (Output_file::map_anonymous): If mmap fails, use malloc.
6633 (Output_file::unmap): Don't do anything for an anonymous map.
6634 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
6635 is not available, provide stubs.
6636 (File_read::View::~View): Use free rather than delete[].
6637 (File_read::make_view): Use malloc rather than new[]. If mmap
6638 fails, use malloc.
6639 (File_read::find_or_make_view): Use malloc rather than new[].
6640 * gold.h: Remove HAVE_REMAP code.
6641 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
6642 exists. Rename mremap to gold_mremap. If mmap is not available
6643 don't do anything.
6644 * configure, config.in: Rebuild.
6645
11e361bc
ILT
66462011-04-11 Ian Lance Taylor <iant@google.com>
6647
6648 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
6649 initialize local variable v.
6650
cdc29364
CC
66512011-04-11 Cary Coutant <ccoutant@google.com>
6652
6653 * archive.cc (Archive::include_member): Adjust call to
6654 report_object.
6655 (Add_archive_symbols::run): Track argument serial numbers.
6656 (Lib_group::include_member): Likewise.
6657 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
6658 * archive.h (Incremental_archive_entry::Archive_member):
6659 Initialize arg_serial_.
6660 (Archive_member::arg_serial_): New data member.
6661 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
6662 (Sized_dynobj::do_add_symbols): Track symbols when doing an
6663 incremental link.
6664 (Sized_dynobj::do_for_all_local_got_entries): New function.
6665 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
6666 function.
6667 * fileread.cc (get_mtime): New function.
6668 * fileread.h (get_mtime): New function.
6669 * gold.cc (queue_initial_tasks): Check for incremental update.
6670 (process_incremental_input): New function.
6671 (queue_middle_tasks): Don't force valid target for incremental
6672 update.
6673 * incremental-dump.cc (find_input_containing_global): Adjust
6674 size of symbol info entry.
6675 (dump_incremental_inputs): Dump argument serial number and
6676 in_system_directory flag; bias shndx by 1; print symbol names
6677 when dumping per-file symbol lists; use new symbol info readers.
6678 * incremental.cc
6679 (Output_section_incremental_inputs:update_data_size): New function.
6680 (Sized_incremental_binary::setup_readers): Setup input readers
6681 for each input file; build maps for files added from libraries
6682 and scripts.
6683 (Sized_incremental_binary::check_input_args): New function.
6684 (Sized_incremental_binary::do_check_inputs): Build map of argument
6685 serial numbers to input arguments.
6686 (Sized_incremental_binary::do_file_has_changed): Rename
6687 do_file_is_unchanged to this; compare file modification times.
6688 (Sized_incremental_binary::do_init_layout): New function.
6689 (Sized_incremental_binary::do_reserve_layout): New function.
6690 (Sized_incremental_binary::do_get_input_reader): Remove.
6691 (Sized_incremental_binary::get_symtab_view): New function.
6692 (Incremental_checker::can_incrementally_link_output_file): Remove.
6693 (Incremental_inputs::report_command_line): Exclude --debug options.
6694 (Incremental_inputs::report_archive_begin): Add parameter; track
6695 argument serial numbers; don't put input file entry for archive
6696 before archive members.
6697 (Incremental_inputs::report_archive_end): Put input file entry
6698 for archive after archive members.
6699 (Incremental_inputs::report_object): Add parameter; track argument
6700 serial numbers and in_system_directory flag.
6701 (Incremental_inputs::report_script): Add parameter; track argument
6702 serial numbers.
6703 (Output_section_incremental_inputs::set_final_data_size): Adjust
6704 size of symbol info entry; check for forwarding symbols.
6705 (Output_section_incremental_inputs::write_input_files): Write
6706 in_system_directory flag and argument serial number.
6707 (Output_section_incremental_inputs::write_info_blocks): Map section
6708 indices between incremental info and original input file; store
6709 input section index for each symbol.
6710 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
6711 change operator() to visit().
6712 (class Global_got_offset_visitor): Likewise.
6713 (class Global_symbol_visitor_got_plt):
6714 (Output_section_incremental_inputs::write_got_plt): Use new visitor
6715 classes.
6716 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
6717 (Sized_incr_relobj::do_read_symbols): New function.
6718 (Sized_incr_relobj::do_layout): New function.
6719 (Sized_incr_relobj::do_layout_deferred_sections): New function.
6720 (Sized_incr_relobj::do_add_symbols): New function.
6721 (Sized_incr_relobj::do_should_include_member): New function.
6722 (Sized_incr_relobj::do_for_all_global_symbols): New function.
6723 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
6724 (Sized_incr_relobj::do_section_size): New function.
6725 (Sized_incr_relobj::do_section_name): New function.
6726 (Sized_incr_relobj::do_section_contents): New function.
6727 (Sized_incr_relobj::do_section_flags): New function.
6728 (Sized_incr_relobj::do_section_entsize): New function.
6729 (Sized_incr_relobj::do_section_address): New function.
6730 (Sized_incr_relobj::do_section_type): New function.
6731 (Sized_incr_relobj::do_section_link): New function.
6732 (Sized_incr_relobj::do_section_info): New function.
6733 (Sized_incr_relobj::do_section_addralign): New function.
6734 (Sized_incr_relobj::do_initialize_xindex): New function.
6735 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
6736 (Sized_incr_relobj::do_read_relocs): New function.
6737 (Sized_incr_relobj::do_gc_process_relocs): New function.
6738 (Sized_incr_relobj::do_scan_relocs): New function.
6739 (Sized_incr_relobj::do_count_local_symbols): New function.
6740 (Sized_incr_relobj::do_finalize_local_symbols): New function.
6741 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
6742 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
6743 (Sized_incr_relobj::do_relocate): New function.
6744 (Sized_incr_relobj::do_set_section_offset): New function.
6745 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
6746 (Sized_incr_dynobj::do_read_symbols): New function.
6747 (Sized_incr_dynobj::do_layout): New function.
6748 (Sized_incr_dynobj::do_add_symbols): New function.
6749 (Sized_incr_dynobj::do_should_include_member): New function.
6750 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
6751 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
6752 (Sized_incr_dynobj::do_section_size): New function.
6753 (Sized_incr_dynobj::do_section_name): New function.
6754 (Sized_incr_dynobj::do_section_contents): New function.
6755 (Sized_incr_dynobj::do_section_flags): New function.
6756 (Sized_incr_dynobj::do_section_entsize): New function.
6757 (Sized_incr_dynobj::do_section_address): New function.
6758 (Sized_incr_dynobj::do_section_type): New function.
6759 (Sized_incr_dynobj::do_section_link): New function.
6760 (Sized_incr_dynobj::do_section_info): New function.
6761 (Sized_incr_dynobj::do_section_addralign): New function.
6762 (Sized_incr_dynobj::do_initialize_xindex): New function.
6763 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
6764 (make_sized_incremental_object): New function.
6765 (Incremental_library::copy_unused_symbols): New function.
6766 (Incremental_library::do_for_all_unused_symbols): New function.
6767 * incremental.h (enum Incremental_input_flags): New type.
6768 (class Incremental_checker): Remove.
6769 (Incremental_input_entry::Incremental_input_entry): Add argument
6770 serial number.
6771 (Incremental_input_entry::arg_serial): New function.
6772 (Incremental_input_entry::set_is_in_system_directory): New function.
6773 (Incremental_input_entry::is_in_system_directory): New function.
6774 (Incremental_input_entry::arg_serial_): New data member.
6775 (Incremental_input_entry::is_in_system_directory_): New data member.
6776 (class Script_info): Move here from script.h.
6777 (Script_info::Script_info): Add filename parameter.
6778 (Script_info::filename): New function.
6779 (Script_info::filename_): New data member.
6780 (Incremental_script_entry::Incremental_script_entry): Add argument
6781 serial number.
6782 (Incremental_object_entry::Incremental_object_entry): Likewise.
6783 (Incremental_object_entry::add_input_section): Build list of input
6784 sections with map to original shndx.
6785 (Incremental_object_entry::get_input_section_index): New function.
6786 (Incremental_object_entry::shndx_): New data member.
6787 (Incremental_object_entry::name_key_): Rename; adjust all refs.
6788 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
6789 (Incremental_archive_entry::Incremental_archive_entry): Add argument
6790 serial number.
6791 (Incremental_inputs::report_archive_begin): Likewise.
6792 (Incremental_inputs::report_object): Likewise.
6793 (Incremental_inputs::report_script): Likewise.
6794 (class Incremental_global_symbol_reader): New class.
6795 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
6796 and store flags and input file type.
6797 (Incremental_input_entry_reader::arg_serial): New function.
6798 (Incremental_input_entry_reader::type): Extract type from flags.
6799 (Incremental_input_entry_reader::is_in_system_directory): New function.
6800 (Incremental_input_entry_reader::get_input_section_count): Call
6801 accessor function for type.
6802 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
6803 function for type; adjust size of global symbol entry.
6804 (Incremental_input_entry_reader::get_global_symbol_count): Call
6805 accessor function for type.
6806 (Incremental_input_entry_reader::get_object_count): Likewise.
6807 (Incremental_input_entry_reader::get_object_offset): Likewise.
6808 (Incremental_input_entry_reader::get_member_count): Likewise.
6809 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
6810 (Incremental_input_entry_reader::get_member_offset): Likewise.
6811 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
6812 (Incremental_input_entry_reader::Global_symbol_info): Remove.
6813 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
6814 (Incremental_input_entry_reader::get_global_symbol_reader): New
6815 function.
6816 (Incremental_input_entry_reader::get_output_symbol_index): New
6817 function.
6818 (Incremental_input_entry_reader::type_): Remove.
6819 (Incremental_input_entry_reader::flags_): New data member.
6820 (Incremental_inputs_reader::input_file_offset): New function.
6821 (Incremental_inputs_reader::input_file_index): New function.
6822 (Incremental_inputs_reader::input_file): Call input_file_offset.
6823 (Incremental_inputs_reader::input_file_at_offset): New function.
6824 (Incremental_relocs_reader::get_r_type): Reformat.
6825 (Incremental_relocs_reader::get_r_shndx): Reformat.
6826 (Incremental_relocs_reader::get_r_offset): Reformat.
6827 (Incremental_relocs_reader::data): New function.
6828 (Incremental_binary::Incremental_binary): Initialize new data members.
6829 (Incremental_binary::check_inputs): Add cmdline parameter.
6830 (Incremental_binary::file_is_unchanged): Remove.
6831 (Input_reader::arg_serial): New function.
6832 (Input_reader::get_unused_symbol_count): New function.
6833 (Input_reader::get_unused_symbol): New function.
6834 (Input_reader::do_arg_serial): New function.
6835 (Input_reader::do_get_unused_symbol_count): New function.
6836 (Input_reader::do_get_unused_symbol): New function.
6837 (Incremental_binary::input_file_count): New function.
6838 (Incremental_binary::get_input_reader): Change signature to use
6839 index instead of filename.
6840 (Incremental_binary::file_has_changed): New function.
6841 (Incremental_binary::get_input_argument): New function.
6842 (Incremental_binary::get_library): New function.
6843 (Incremental_binary::get_script_info): New function.
6844 (Incremental_binary::init_layout): New function.
6845 (Incremental_binary::reserve_layout): New function.
6846 (Incremental_binary::output_file): New function.
6847 (Incremental_binary::do_check_inputs): New function.
6848 (Incremental_binary::do_file_is_unchanged): Remove.
6849 (Incremental_binary::do_file_has_changed): New function.
6850 (Incremental_binary::do_init_layout): New function.
6851 (Incremental_binary::do_reserve_layout): New function.
6852 (Incremental_binary::do_input_file_count): New function.
6853 (Incremental_binary::do_get_input_reader): Change signature.
6854 (Incremental_binary::input_args_map_): New data member.
6855 (Incremental_binary::library_map_): New data member.
6856 (Incremental_binary::script_map_): New data member.
6857 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6858 new data members.
6859 (Sized_incremental_binary::output_section): New function.
6860 (Sized_incremental_binary::inputs_reader): Add const.
6861 (Sized_incremental_binary::symtab_reader): Add const.
6862 (Sized_incremental_binary::relocs_reader): Add const.
6863 (Sized_incremental_binary::got_plt_reader): Add const.
6864 (Sized_incremental_binary::get_symtab_view): New function.
6865 (Sized_incremental_binary::Inputs_reader): New typedef.
6866 (Sized_incremental_binary::Input_entry_reader): New typedef.
6867 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
6868 (Sized_incremental_binary::do_file_is_unchanged): Remove.
6869 (Sized_incremental_binary::do_file_has_changed): New function.
6870 (Sized_incremental_binary::do_init_layout): New function.
6871 (Sized_incremental_binary::do_reserve_layout): New function.
6872 (Sized_input_reader::Inputs_reader): Remove.
6873 (Sized_input_reader::Input_entry_reader): Remove.
6874 (Sized_input_reader::do_arg_serial): New function.
6875 (Sized_input_reader::do_get_unused_symbol_count): New function.
6876 (Sized_input_reader::do_get_unused_symbol): New function.
6877 (Sized_incremental_binary::do_input_file_count): New function.
6878 (Sized_incremental_binary::do_get_input_reader): Change signature;
6879 use index instead of filename.
6880 (Sized_incremental_binary::section_map_): New data member.
6881 (Sized_incremental_binary::input_entry_readers_): New data member.
6882 (class Sized_incr_relobj): New class.
6883 (class Sized_incr_dynobj): New class.
6884 (make_sized_incremental_object): New function.
6885 (class Incremental_library): New class.
6886 * layout.cc (Free_list::num_lists): New static data member.
6887 (Free_list::num_nodes): New static data member.
6888 (Free_list::num_removes): New static data member.
6889 (Free_list::num_remove_visits): New static data member.
6890 (Free_list::num_allocates): New static data member.
6891 (Free_list::num_allocate_visits): New static data member.
6892 (Free_list::init): New function.
6893 (Free_list::remove): New function.
6894 (Free_list::allocate): New function.
6895 (Free_list::dump): New function.
6896 (Free_list::print_stats): New function.
6897 (Layout_task_runner::run): Resize output file for incremental updates.
6898 (Layout::Layout): Initialize new data members.
6899 (Layout::set_incremental_base): New function.
6900 (Layout::init_fixed_output_section): New function.
6901 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
6902 incremental updates.
6903 (Layout::create_gold_note): Do not create gold note section for
6904 incremental updates.
6905 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
6906 for incremental updates.
6907 (Layout::set_section_offsets): For incremental updates, allocate space
6908 from free list.
6909 (Layout::create_symtab_sections): Layout with offsets relative to
6910 start of section; for incremental updates, allocate space from free
6911 list.
6912 (Layout::create_shdrs): For incremental updates, allocate space from
6913 free list.
6914 (Layout::finish_dynamic_section): For incremental updates, do not
6915 check --as-needed (fixed in subsequent patch).
6916 * layout.h (class Free_list): New class.
6917 (Layout::set_incremental_base): New function.
6918 (Layout::incremental_base): New function.
6919 (Layout::init_fixed_output_section): New function.
6920 (Layout::allocate): New function.
6921 (Layout::incremental_base_): New data member.
6922 (Layout::free_list_): New data member.
6923 * main.cc (main): Print Free_list statistics.
6924 * object.cc (Relobj::finalize_incremental_relocs): Add
6925 clear_counts parameter; clear counts only when clear_counts is set.
6926 (Sized_relobj::Sized_relobj): Initialize new base class.
6927 (Sized_relobj::do_layout): Don't report special sections.
6928 (Sized_relobj::do_for_all_local_got_entries): New function.
6929 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
6930 symtab_off to all symbol table offsets.
6931 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
6932 * object.h (class Got_offset_list): Move to top of file.
6933 (Object::Object): Allow case where input_file == NULL.
6934 (Object::~Object): Likewise.
6935 (Object::input_file): Assert that input_file != NULL.
6936 (Object::lock): Allow case where input_file == NULL.
6937 (Object::unlock): Likewise.
6938 (Object::is_locked): Likewise.
6939 (Object::token): Likewise.
6940 (Object::release): Likewise.
6941 (Object::is_incremental): New function.
6942 (Object::get_mtime): New function.
6943 (Object::for_all_local_got_entries): New function.
6944 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
6945 (Object::set_is_in_system_directory): New function.
6946 (Object::is_in_system_directory): New function.
6947 (Object::do_is_incremental): New function.
6948 (Object::do_get_mtime): New function.
6949 (Object::do_for_all_local_got_entries): New function.
6950 (Object::is_in_system_directory_): New data member.
6951 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
6952 (class Sized_relobj_base): New class.
6953 (class Sized_relobj): Derive from Sized_relobj_base.
6954 (class Sized_relobj::Symbols): Redeclare from base class.
6955 (class Sized_relobj::local_got_offset_list): Remove.
6956 (class Sized_relobj::Output_sections): Redeclare from base class.
6957 (class Sized_relobj::do_for_all_local_got_entries): New function.
6958 (class Sized_relobj::write_local_symbols): Add offset parameter.
6959 (class Sized_relobj::local_symbol_offset_): Update comment.
6960 (class Sized_relobj::local_dynsym_offset_): Update comment.
6961 * options.cc (Input_arguments::add_file): Remove const.
6962 * options.h (Input_file_argument::Input_file_argument):
6963 Initialize arg_serial_ (all constructors).
6964 (Input_file_argument::set_arg_serial): New function.
6965 (Input_file_argument::arg_serial): New function.
6966 (Input_file_argument::arg_serial_): New data member.
6967 (Input_arguments::Input_arguments): Initialize file_count_.
6968 (Input_arguments::add_file): Remove const.
6969 (Input_arguments::number_of_input_files): New function.
6970 (Input_arguments::file_count_): New data member.
6971 (Command_line::number_of_input_files): Call
6972 Input_arguments::number_of_input_files.
6973 * output.cc (Output_segment_headers::Output_segment_headers):
6974 Set current size.
6975 (Output_section::Input_section::current_data_size): New function.
6976 (Output_section::Output_section): Initialize new data members.
6977 (Output_section::add_input_section): Don't do merge sections for
6978 an incremental link; allocate space from free list for an
6979 incremental update.
6980 (Output_section::add_output_section_data): Allocate space from
6981 free list for an incremental update.
6982 (Output_section::update_data_size): New function.
6983 (Output_section::set_fixed_layout): New function.
6984 (Output_section::reserve): New function.
6985 (Output_segment::set_section_addresses): Remove const.
6986 (Output_segment::set_section_list_addresses): Remove const; allocate
6987 space from free list for an incremental update.
6988 (Output_segment::set_offset): Adjust size of RELRO segment for an
6989 incremental update.
6990 * output.h (Output_data::current_data_size): Move here from
6991 child classes.
6992 (Output_data::pre_finalize_data_size): New function.
6993 (Output_data::update_data_size): New function.
6994 (Output_section_headers::update_data_size): new function.
6995 (Output_section_data_build::current_data_size): Move to Output_data.
6996 (Output_data_strtab::update_data_size): New function.
6997 (Output_section::current_data_size): Move to Output_data.
6998 (Output_section::set_fixed_layout): New function.
6999 (Output_section::has_fixed_layout): New function.
7000 (Output_section::reserve): New function.
7001 (Output_section::update_data_size): New function.
7002 (Output_section::has_fixed_layout_): New data member.
7003 (Output_section::free_list_): New data member.
7004 (Output_segment::set_section_addresses): Remove const.
7005 (Output_segment::set_section_list_addresses): Remove const.
7006 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
7007 New function.
7008 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
7009 New function.
7010 * readsyms.cc (Read_symbols::do_read_symbols): Add library
7011 parameter when calling Add_symbols constructor; store argument
7012 serial number for members of a lib group.
7013 (Add_symbols::locks): Allow case where token == NULL.
7014 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
7015 (Read_member::~Read_member): New function.
7016 (Read_member::is_runnable): New function.
7017 (Read_member::locks): New function.
7018 (Read_member::run): New function.
7019 (Check_script::~Check_script): New function.
7020 (Check_script::is_runnable): New function.
7021 (Check_script::locks): New function.
7022 (Check_script::run): New function.
7023 (Check_library::~Check_library): New function.
7024 (Check_library::is_runnable): New function.
7025 (Check_library::locks): New function.
7026 (Check_library::run): New function.
7027 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
7028 (Add_symbols::library_): New data member.
7029 (class Read_member): New class.
7030 (class Check_script): New class.
7031 (class Check_library): New class.
7032 * reloc.cc (Read_relocs::is_runnable): Allow case where
7033 token == NULL.
7034 (Read_relocs::locks): Likewise.
7035 (Scan_relocs::locks): Likewise.
7036 (Relocate_task::locks): Likewise.
7037 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
7038 to clear counters.
7039 (Sized_relobj::incremental_relocs_scan): Fix comment.
7040 (Sized_relobj::do_relocate): Pass output file offset to
7041 write_local_symbols.
7042 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
7043 from class declaration.
7044 * script.cc (read_input_script): Allocate Script_info; pass
7045 argument serial number to report_script.
7046 * script.h (class Script_info): Move to incremental.h.
7047 * symtab.cc (Symbol_table::add_from_incrobj): New function.
7048 * symtab.h (Symbol_table::add_from_incrobj): New function.
7049 (Symbol_table::set_file_offset): New function.
7050
b961d0d7
CC
70512011-04-05 Cary Coutant <ccoutant@google.com>
7052
7053 * incremental-dump.cc (dump_incremental_inputs): Change signature
7054 to take a Sized_incremental_binary; change caller. Use readers
7055 in Sized_incremental_binary.
7056 * incremental.cc
7057 (Sized_incremental_binary::find_incremental_inputs_sections):
7058 Rename do_find_incremental_inputs_sections to this.
7059 (Sized_incremental_binary::setup_readers): New function.
7060 (Sized_incremental_binary::do_check_inputs): Check
7061 has_incremental_info_ flag; move setup code to setup_readers;
7062 use input readers.
7063 (Sized_incremental_binary::do_file_is_unchanged): New function.
7064 (Sized_incremental_binary::do_get_input_reader): New function.
7065 * incremental.h (class Incremental_binary): Move to end of file.
7066 (Incremental_binary::file_is_unchanged): New function.
7067 (Incremental_binary::do_file_is_unchanged): New function.
7068 (Incremental_binary::Input_reader): New class.
7069 (Incremental_binary::get_input_reader): New function.
7070 (class Sized_incremental_binary): Move to end of file.
7071 (Sized_incremental_binary::Sized_incremental_binary): Setup the
7072 input section reader classes.
7073 (Sized_incremental_binary::has_incremental_info): New function.
7074 (Sized_incremental_binary::inputs_reader): New function.
7075 (Sized_incremental_binary::symtab_reader): New function.
7076 (Sized_incremental_binary::relocs_reader): New function.
7077 (Sized_incremental_binary::got_plt_reader): New function.
7078 (Sized_incremental_binary::do_file_is_unchanged): New function.
7079 (Sized_incremental_binary::Sized_input_reader): New class.
7080 (Sized_incremental_binary::get_input_reader): New function.
7081 (Sized_incremental_binary::find_incremental_inputs_sections):
7082 Rename do_find_incremental_inputs_sections to this.
7083 (Sized_incremental_binary::setup_readers): New function.
7084 (Sized_incremental_binary::has_incremental_info_): New data member.
7085 (Sized_incremental_binary::inputs_reader_): New data member.
7086 (Sized_incremental_binary::symtab_reader_): New data member.
7087 (Sized_incremental_binary::relocs_reader_): New data member.
7088 (Sized_incremental_binary::got_plt_reader_): New data member.
7089 (Sized_incremental_binary::current_input_file_): New data member.
7090
a869183f
PP
70912011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
7092
7093 PR gold/12640
7094 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
7095 violation.
7096
70972011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
7098
7099 * archive.cc (Archive::include_member): Adjust call to report_object.
7100 (Add_archive_symbols::run): Add script_info to call to
7101 report_archive_begin.
7102 (Lib_group::include_member): Adjust call to report_object.
7103 (Add_lib_group_symbols::run): Adjust call to report_object.
7104 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
7105 blocks. Add object count for script input files.
7106 * incremental.cc (Incremental_inputs::report_archive_begin): Add
7107 script_info parameter; change all callers.
7108 (Incremental_inputs::report_object): Add script_info parameter;
7109 change all callers.
7110 (Incremental_inputs::report_script): Store backpointer to
7111 incremental info entry.
7112 (Output_section_incremental_inputs::set_final_data_size): Record
7113 additional information for scripts.
7114 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7115 * incremental.h (Incremental_script_entry::add_object): New function.
7116 (Incremental_script_entry::get_object_count): New function.
7117 (Incremental_script_entry::get_object): New function.
7118 (Incremental_script_entry::objects_): New data member; adjust
7119 constructor.
7120 (Incremental_inputs::report_archive_begin): Add script_info parameter.
7121 (Incremental_inputs::report_object): Add script_info parameter.
7122 (Incremental_inputs_reader::get_object_count): New function.
7123 (Incremental_inputs_reader::get_object_offset): New function.
7124 * options.cc (Input_arguments::add_file): Return reference to
7125 new input argument.
7126 * options.h (Input_argument::set_script_info): New function.
7127 (Input_argument::script_info): New function.
7128 (Input_argument::script_info_): New data member; adjust all
7129 constructors.
7130 (Input_file_group::add_file): Return reference to new input argument.
7131 (Input_file_lib::add_file): Likewise.
7132 (Input_arguments::add_file): Likewise.
7133 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
7134 * script.cc (Parser_closure::Parser_closure): Add script_info
7135 parameter; adjust all callers.
7136 (Parser_closure::script_info): New function.
7137 (Parser_closure::script_info_): New data member.
7138 (read_input_script): Report scripts earlier to incremental info.
7139 (script_add_file): Set script_info in Input_argument.
7140 (script_add_library): Likewise.
7141 * script.h (Script_options::Script_info): Rewrite class.
7142
a869183f 71432011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
7144
7145 * archive.cc (Library_base::should_include_member): Move
7146 method here from class Archive.
7147 (Archive::Archive): Initialize base class.
7148 (Archive::should_include_member): Move to base class.
7149 (Archive::do_for_all_unused_symbols): New function.
7150 (Add_archive_symbols::run): Remove redundant access to
7151 incremental_inputs.
7152 (Lib_group::Lib_group): Initialize base class.
7153 (Lib_group::do_filename): New function.
7154 (Lib_group::include_member): Pass pointer to Lib_group to
7155 report_object.
7156 (Lib_group::do_for_all_unused_symbols): New function.
7157 (Add_lib_group_symbols::run): Report archive information for
7158 incremental links.
7159 * archive.h (class Library_base): New base class.
7160 (class Archive): Derive from Library_base.
7161 (Archive::filename): Move to base class.
7162 (Archive::set_incremental_info): Likewise.
7163 (Archive::incremental_info): Likewise.
7164 (Archive::Should_include): Likewise.
7165 (Archive::should_include_member): Likewise.
7166 (Archive::Armap_entry): Remove.
7167 (Archive::Unused_symbol_iterator): Remove.
7168 (Archive::unused_symbols_begin): Remove.
7169 (Archive::unused_symbols_end): Remove.
7170 (Archive::do_filename): New function.
7171 (Archive::do_get_mtime): New function.
7172 (Archive::do_for_all_unused_symbols): New function.
7173 (Archive::task_): Move to base class.
7174 (Archive::incremental_info_): Likewise.
7175 (class Lib_group): Derive from Library_base.
7176 (Lib_group::do_filename): New function.
7177 (Lib_group::do_get_mtime): New function.
7178 (Lib_group::do_for_all_unused_symbols): New function.
7179 (Lib_group::task_): Move to base class.
7180 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
7181 function.
7182 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
7183 function.
7184 * incremental.cc (Incremental_inputs::report_archive_begin):
7185 Use Library_base; call library's get_mtime; add incremental inputs
7186 entry before members.
7187 (class Unused_symbol_visitor): New class.
7188 (Incremental_inputs::report_archive_end): Use Library_base; use
7189 visitor class to record unused symbols; don't add incremental inputs
7190 entry after members.
7191 (Incremental_inputs::report_object): Use Library_base.
7192 * incremental.h
7193 (Incremental_archive_entry::Incremental_archive_entry): Remove
7194 unused Archive parameter.
7195 (Incremental_inputs::report_archive_begin): Use Library_base.
7196 (Incremental_inputs::report_archive_end): Likewise.
7197 (Incremental_inputs::report_object): Likewise.
7198 * object.cc (Sized_relobj::do_for_all_global_symbols): New
7199 function.
7200 * object.h (Object::for_all_global_symbols): New function.
7201 (Object::do_for_all_global_symbols): New function.
7202 (Sized_relobj::do_for_all_global_symbols): New function.
7203 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
7204 function.
7205 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
7206 function.
7207
61ab3e40
ILT
72082011-03-27 Ian Lance Taylor <iant@google.com>
7209
7210 * archive.cc (Archive::interpret_header): Return -1 if something
7211 goes wrong. Change callers accordingly.
7212
30e1f9e6
CC
72132011-03-25 Cary Coutant <ccoutant@google.com>
7214
7215 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
7216 * testsuite/Makefile.in: Regenerate.
7217
9370ce59 72182011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
7219
7220 * plugin.cc (get_view): New.
7221 (Plugin::load): Pass get_view to the plugin.
7222 (Plugin_manager::get_view): New.
7223
9312bb0a
ILT
72242011-03-21 Ian Lance Taylor <iant@google.com>
7225
7226 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 7227 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 7228
7e12ba9e
ST
72292011-03-21 Sriraman Tallam <tmsriram@google.com>
7230
7231 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
7232 Change == to -eq.
7233 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
7234 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
7235 Change == to -eq.
7236 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
7237 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
7238
fd7a005d
ILT
72392011-03-14 Ian Lance Taylor <iant@google.com>
7240
7241 * script-sections.cc (Sort_output_sections::script_compare):
7242 Rename from is_before, change return type.
7243 (Sort_output_sections::operator()): Adjust accordingly.
7244
ed16fd1b
ILT
72452011-03-11 Jeffrey Yasskin <jyasskin@google.com>
7246
7247 PR gold/12572
7248 * testsuite/odr_violation2.cc: Add comment to make all error line
7249 numbers double digits.
7250 * testsuite/debug_msg.sh: Adjust expected errors.
7251
71ff8986
ILT
72522011-03-09 Jeffrey Yasskin <jyasskin@google.com>
7253
7254 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
7255 but mark earlier ones as non-canonical
7256 (offset_to_iterator): Update search target and example
7257 (do_addr2line): Return extra lines in a vector*
7258 (format_file_lineno): Extract from do_addr2line
7259 (one_addr2line): Add vector* out-param
7260 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
7261 when a lineno entry appeared last for its instruction
7262 (Dwarf_line_info): Add vector* out-param
7263 * object.cc (Relocate_info): Pass NULL for the vector* out-param
7264 * symtab.cc (Odr_violation_compare): Include the lineno in the
7265 comparison again.
7266 (linenos_from_loc): New. Combine the canonical line for an
7267 address with its other lines.
7268 (True_if_intersect): New. Helper functor to make
7269 std::set_intersection a query.
7270 (detect_odr_violations): Compare sets of lines instead of just
7271 one line for each function. This became less deterministic, but
7272 has fewer false positives.
7273 * symtab.h: Declarations.
7274 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
7275 mix an optimized and non-optimized object in the same binary
7276 (odr_violation2.so): Same.
7277 * testsuite/Makefile.in: Regenerate from Makefile.am.
7278 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
7279 * testsuite/debug_msg.sh: Update line numbers and add
7280 assertions.
7281 * testsuite/odr_violation1.cc: Use OdrDerived, in a
7282 non-optimized context.
7283 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
7284 isn't inlined, and use OdrDerived in an optimized context.
7285 * testsuite/odr_header1.h: Defines OdrDerived, where
7286 optimization will change the
7287 first-instruction-in-the-destructor's file and line number.
7288 * testsuite/odr_header2.h: Defines OdrBase.
7289
a19fefdc
ILT
72902011-03-09 Ian Lance Taylor <iant@google.com>
7291
7292 * fileread.cc (File_read::clear_views): Don't delete the whole
7293 file view.
7294
ecb351e9
ILT
72952011-03-08 Ian Lance Taylor <iant@google.com>
7296
7297 PR gold/12525
7298 * fileread.cc: #include <climits>.
7299 (GOLD_IOV_MAX): Define.
7300 (File_read::read_multiple): Limit number of entries by iov_max.
7301 * fileread.h (class File_read): Always set max_readv_entries to
7302 128.
7303
b821d13c
ILT
73042011-03-07 Ian Lance Taylor <iant@google.com>
7305
7306 PR gold/12525
7307 * options.h (class General_options): Add -dy and -dn.
7308
89243142
CC
73092011-03-02 Cary Coutant <ccoutant@google.com>
7310
7311 * testsuite/script_test_9.t: Add TLS segment.
7312
d0773f31
ILT
73132011-03-02 Simon Baldwin <simonb@google.com>
7314
7315 * configure.ac: Add check for gnu_indirect_function support in
7316 the toolchain building binutils.
7317 * configure: Rebuild.
7318
9370ce59 73192011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
7320
7321 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
7322 plugin only symbols.
7323 (Symbol_table::sized_finalize_symbol) Mark symbol only present
7324 in plugin files as not needed in the symbol table.
7325
4cf7a849
ST
73262011-02-11 Sriraman Tallam <tmsriram@google.com>
7327
7328 * output.cc (Output_section::add_input_section): Delay fill
7329 generation for section ordering.
7330
b578bd7d
ILT
73312011-02-09 Ian Lance Taylor <iant@google.com>
7332
7333 PR gold/12316
7334 * object.h (class Sized_relobj): Remove clear_local_symbols.
7335 * reloc.cc (Sized_relobj::do_relocate): Don't call
7336 clear_local_symbols.
7337
9370ce59 73382011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
7339
7340 * plugin.cc (is_visible_from_outside): Return true for symbols
7341 in the -u option.
7342
55382fb7
ILT
73432011-02-04 Jeffrey Yasskin <jyasskin@google.com>
7344
7345 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
7346 filename.
7347
4e271fff
ST
73482011-02-02 Sriraman Tallam <tmsriram@google.com>
7349
7350 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 7351 to std::string.
4e271fff 7352 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 7353 section_name to be std::string.
4e271fff
ST
7354 (is_function_ctor_or_dtor): Change type of parameter to std::string.
7355
d433c3ac
ILT
73562011-01-25 Ian Lance Taylor <iant@google.com>
7357
7358 * script.cc (script_add_extern): Rewrite to use
7359 add_symbol_reference.
7360
880473a6
DK
73612011-01-25 Doug Kwan <dougkwan@google.com>
7362
d433c3ac 7363 * icf.cc (get_section_contents): Always lock section's object.
880473a6 7364
f30f86fa
ILT
73652011-01-24 Ian Lance Taylor <iant@google.com>
7366
7367 * options.h (class General_options): Accept
7368 --no-detect-odr-violations.
7369
8e51a0b9
ILT
73702011-01-24 Ian Lance Taylor <iant@google.com>
7371
7372 * version.cc (version_string): Bump to 1.11.
7373
0f3b89d8
ILT
73742011-01-24 Ian Lance Taylor <iant@google.com>
7375
7376 * plugin.cc (class Plugin_rescan): Define new class.
7377 (Plugin_manager::claim_file): Set any_claimed_.
7378 (Plugin_manager::save_archive): New function.
7379 (Plugin_manager::save_input_group): New function.
7380 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
7381 necessary.
7382 (Plugin_manager::new_undefined_symbol): New function.
7383 (Plugin_manager::rescan): New function.
7384 (Plugin_manager::rescannable_defines): New function.
7385 (Plugin_manager::add_input_file): Set any_added_.
7386 * plugin.h (class Plugin_manager): define new fields rescannable_,
7387 undefined_symbols_, any_claimed_, and any_added_. Declare
7388 Plugin_rescan as friend. Declare new functions.
7389 (Plugin_manager::Rescannable): Define type.
7390 (Plugin_manager::Rescannable_list): Define type.
7391 (Plugin_manager::Undefined_symbol_list): Define type.
7392 (Plugin_manager::Plugin_manager): Initialize new fields.
7393 * archive.cc (Archive::defines_symbol): New function.
7394 (Add_archive_symbols::run): Pass archive to plugins if any.
7395 * archive.h (class Archive): Declare defines_symbol.
7396 * readsyms.cc (Input_group::~Input_group): New function.
7397 (Finish_group::run): Pass input_group to plugins if any.
7398 * readsyms.h (class Input_group): Declare destructor.
7399 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
7400 any.
7401
3bb951e5
ILT
74022011-01-10 Ian Lance Taylor <iant@google.com>
7403
7404 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
7405 section as relro.
7406 (Layout::set_segment_offsets): Reset increase_relro before calling
7407 set_section_addresses a second time.
7408
0aa45fac
CC
74092011-01-04 Cary Coutant <ccoutant@google.com>
7410
7411 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
7412 sections before NOBITS sections.
7413
0db46eb4
L
74142011-01-01 H.J. Lu <hongjiu.lu@intel.com>
7415
7416 * version.cc (print_version): Update copyright to 2011.
7417
829c9745
CC
74182010-12-23 Cary Coutant <ccoutant@google.com>
7419
7420 * output.h (Output_data_reloc::add_output_section): Pass OD instead
7421 of OS to this->add. Add OD parameter to second form of the function.
7422
7500420b
ILT
74232010-12-20 Ian Lance Taylor <iant@google.com>
7424
7425 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
7426 second of two consecutive entries with same offset.
7427
f8e9a930
RW
74282010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7429
7430 * testsuite/Makefile.am (ifuncmain2static_LDADD)
7431 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
7432 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
7433 to avoid unneeded links against $(LDADD).
7434 * testsuite/Makefile.in: Regenerate.
7435
2fbb4320
ILT
74362010-12-15 Ian Lance Taylor <iant@google.com>
7437
7438 PR gold/12324
7439 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
7440 for R_X86_64_32 and R_X86_64_PC32.
7441 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
7442 ver_matching_def_pic.o.
7443 (ver_matching_def_pic.o): New target.
7444
fedb228d
RW
74452010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7446
7447 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
7448 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
7449 Move definition before File_read::View member definitions.
7450 (File_read::View::~View): Initialize and hold lock before
7451 updating current_mapped_bytes.
7452
9b547ce6
RW
74532010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7454
7455 * dwarf_reader.cc: Remove outdated comment.
7456 * gold-threads.cc: Fix typo in error message.
7457 * archive.cc: Fix typos in comments.
7458 * archive.h: Likewise.
7459 * arm-reloc-property.cc: Likewise.
7460 * arm-reloc-property.h: Likewise.
7461 * arm-reloc.def: Likewise.
7462 * arm.cc: Likewise.
7463 * attributes.h: Likewise.
7464 * cref.cc: Likewise.
7465 * ehframe.cc: Likewise.
7466 * fileread.h: Likewise.
7467 * gold.h: Likewise.
7468 * i386.cc: Likewise.
7469 * icf.cc: Likewise.
7470 * incremental.h: Likewise.
7471 * int_encoding.cc: Likewise.
7472 * layout.h: Likewise.
7473 * main.cc: Likewise.
7474 * merge.h: Likewise.
7475 * object.cc: Likewise.
7476 * object.h: Likewise.
7477 * options.cc: Likewise.
7478 * readsyms.cc: Likewise.
7479 * reduced_debug_output.cc: Likewise.
7480 * reloc.cc: Likewise.
7481 * script-sections.cc: Likewise.
7482 * sparc.cc: Likewise.
7483 * symtab.h: Likewise.
7484 * target-reloc.h: Likewise.
7485 * target.cc: Likewise.
7486 * target.h: Likewise.
7487 * timer.cc: Likewise.
7488 * timer.h: Likewise.
7489 * x86_64.cc: Likewise.
7490
83e17bd5
CC
74912010-12-09 Cary Coutant <ccoutant@google.com>
7492
7493 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
7494 stack.
7495 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
7496 parameter; change all callers.
7497 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
7498 * options.h (warn_execstack): New option.
7499
017257f8
DK
75002010-12-07 Doug Kwan <dougkwan@google.com>
7501
7502 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
7503 like function call relocations.
7504
c20cbc06
ILT
75052010-12-07 Ian Lance Taylor <iant@google.com>
7506
7507 * archive.cc (Archive::get_elf_object_for_member): Permit
7508 punconfigured to be NULL.
7509 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
7510 (Archive::include_member): Pass NULL to get_elf_object_for_member
7511 if we searched for the archive and this is the first included
7512 object.
7513
4dbfafcc
ILT
75142010-12-01 Ian Lance Taylor <iant@google.com>
7515
7516 * dwarf_reader.h (class Sized_dwarf_line_info): Add
7517 track_relocs_type_ field.
7518 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7519 Set track_relocs_type_.
7520 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
7521 contents when using RELA relocs.
7522 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
7523 reloc_map_.
7524 * reloc.cc (Track_relocs::next_addend): New function.
7525 * reloc.h (class Track_relocs): Declare next_addend.
7526
e5e19edd
ILT
75272010-12-01 Ian Lance Taylor <iant@google.com>
7528
7529 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
7530 virtual destructor.
7531
9a5ce24c
ILT
75322010-12-01 Ian Lance Taylor <iant@google.com>
7533
7534 * README: Update compilers known to work and fail.
7535
c7791212
NC
75362010-11-23 Matthias Klose <doko@ubuntu.com>
7537
7538 * configure.in: For --enable-gold, handle value `default' instead of
7539 `both*'. Always install ld as ld.bfd, install as ld if gold is
7540 not the default.
7541 * configure: Regenerate.
7542
0ad220c9
DK
75432010-11-18 Doug Kwan <dougkwan@google.com>
7544
7545 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
7546 and right_alignment to be zero. Store result alignment only if it is
7547 greater than existing alignment.
7548
ab8056e0
CC
75492010-11-16 Cary Coutant <ccoutant@google.com>
7550
7551 PR gold/12220
7552 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7553 Check for ".zdebug_line".
7554
fd064a5b
CC
75552010-11-16 Doug Kwan <dougkwan@google.com>
7556 Cary Coutant <ccoutant@google.com>
7557
7558 * output.h (Output_segment::set_section_addresses): Pass increase_relro
7559 by reference; adjust all callers.
7560 * output.cc (Output_segment::set_section_addresses): Adjust references
7561 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
7562 list is empty.
7563 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
7564 end at page boundary.
7565
6fc6ea19
CC
75662010-11-16 Cary Coutant <ccoutant@google.com>
7567
7568 PR gold/12220
7569 * layout.cc (Layout::choose_output_section): Transform names of
7570 compressed sections even when using a script with a SECTIONS clause.
7571 (Layout::output_section_name): Remove code to transform
7572 compressed debug section names.
7573 * output.cc (Output_section::add_input_section): Use uncompressed
7574 section size when tracking input sections.
7575
95a2c8d6
RS
75762010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
7577
7578 * symtab.h (Symbol::NON_PIC_REF): Remove.
7579 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
7580 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
7581 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
7582 (Symbol::use_plt_offset): Take a flags argument and pass it
7583 directly to needs_dynamic_reloc. Restrict check for undefined
7584 weak symbols to function calls.
7585 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
7586 (Target_arm::Scan::global): Use it.
7587 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
7588 (Target_arm::Relocate::relocate): Likewise.
7589 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
7590 parameter with an r_type parameter. Use get_reference_flags
7591 to get the flags.
7592 (Target_arm::Relocate::relocate): Update accordingly.
7593 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
7594 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
7595 (Target_i386::Scan::global): Likewise.
7596 (Target_i386::Relocate::relocate): Likewise.
7597 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
7598 parameter with an r_type parameter. Use get_reference_flags
7599 to get the flags.
7600 (Target_i386::Relocate::relocate): Update accordingly.
7601 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
7602 (Target_powerpc::Scan::global): Use it.
7603 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
7604 (Target_powerpc::Relocate::relocate): Likewise.
7605 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
7606 (Target_sparc::Scan::global): Use it.
7607 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
7608 (Target_sparc::Relocate::relocate): Likewise.
7609 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
7610 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
7611 (Target_x86_64::Scan::global): Likewise.
7612 (Target_x86_64::Relocate::relocate): Likewise.
7613
f625ae50
DK
76142010-11-08 Doug Kwan <dougkwan@google.com>
7615 Cary Coutant <ccoutant@google.com>
7616
7617 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
7618 (Arm_exidx_merge_section::section_contents_): New data member.
7619 (Arm_input_section::Arm_input_section): Initialize original_contents_.
7620 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 7621 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
7622 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
7623 in parameters instead of calling Object::section_contents without
7624 locking.
7625 (Arm_output_section::group_section): New parameter TASK. Pass it
7626 to callees that need locking objects.
7627 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
7628 to lock EXIDX input sections. Fix a formatting issue. Call
7629 Arm_exidx_merged_section::build_contents to create merged section
7630 contents.
7631 (Arm_output_section::create_stub_group): New parameter TASK. Use it
7632 to lock object of stub table owner.
7633 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
7634 TEXT_SIZE to initialize data member TEXT_SIZE_.
7635 (Arm_exidx_input_section::addralign): Fix typo in comment.
7636 (Arm_exidx_input_section::text_size): New method.
7637 (Target_arm::do_relax): New parameter TASK. Pass it to callees
7638 that require locking objects. Lock objects before scanning for stubs
7639 and updating local symbols.
7640 (Arm_input_section<big_endian>::init): Copy contents of original
7641 input section.
2e702c99 7642 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
7643 original input section instead of calling Object::section_contents
7644 without locking.
7645 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
7646 size without calling Object::section_size().
7647 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
7648 for size. Allocate a buffer for merged EXIDX entries.
7649 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 7650 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
7651 building code to Arm_exidx_merged_section::build_contetns. Write
7652 out contetns in buffer instead of building it on the fly.
7653 (Arm_relobj::make_exidx_input_section): Also pass text section size
7654 to Arm_exidx_input_section constructor.
7655 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
7656 (Arm_dynobj::do_read_symbols): Fix memory leak.
7657 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
7658 * target.h: (class Task): Add forward declaration.
7659 (Target::relax): Add new parameter TASK and pass it to
7660 Target::do_relax().
7661 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
7662
5f9bcf58
CC
76632010-11-05 Cary Coutant <ccoutant@google.com>
7664
7665 PR gold/10708
7666 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
7667 object when reading from the file.
7668 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
7669 second layout pass.
7670 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
7671 when reading section contents.
7672 (get_section_contents): Likewise.
7673 (icf::find_identical_sections): Likewise.
7674 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
7675 object when reading from the file.
7676 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
7677 the object when doing deferred section layout.
7678
e597fa08
NC
76792010-11-03 Nick Clifton <nickc@redhat.com>
7680
7681 PR gold/12001
7682 * script.h (class Symbol_assignment: name): New member. Returns
7683 the name of the symbol.
7684 * scrfipt.cc (Script_options::is_pending_assignment): New member.
7685 Returns true if the given symbol name is on the list of
7686 assignments wating to be processed.
7687 * archive.cc (should_incldue_member): If the symbol is undefined,
7688 check to see if it is on the list of symbols pending assignment.
7689
3f9a3278
ILT
76902010-11-03 Ryan Mansfield <rmansfield@qnx.com>
7691
7692 * script-sections.cc (Script_sections::find_memory_region): Check
7693 for a NULL output section pointer.
7694
d06fb4d1
DK
76952010-10-29 Doug Kwan <dougkwan@google.com>
7696
7697 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
7698 Output_section::add_relaxed_input_section.
7699 * output.cc (Output_section::add_relaxed_input_section): Add new
7700 arguments LAYOUT and NAME. Set section order index.
7701 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7702 Copy section order index.
7703 * output.h (Output_section::add_relaxed_input_section): Add new
7704 arguments LAYOUT and NAME.
7705
90e24de5
ILT
77062010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7707
7708 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 7709 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
7710 * testsuite/Makefile.in: Regenerate.
7711
c9484ea5
DK
77122010-10-20 Doug Kwan <dougkwan@google.com>
7713
7714 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
7715 without SHF_LINK_ORDER flags.
7716 * layout.cc (Layout::choose_output_section): Do not filter
7717 SHF_LINK_ORDER flag in a relocatable link.
7718
5bc2f5be
CC
77192010-10-17 Cary Coutant <ccoutant@google.com>
7720
7721 * output.h (Output_segment::set_section_addresses): Change function
7722 signature. Update all callers.
7723 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
7724 sections.
7725 (Output_segment::set_section_addresses): Align after last TLS
7726 section. Add padding before last relro section instead of after.
7727
0c91cf04
DK
77282010-10-17 Doug Kwan <dougkwan@google.com>
7729
7730 * gold/arm.cc (Target_arm::got_section): Use correct order and set
7731 GOT output section to be writable.
7732
8c21d9d3
CC
77332010-10-14 Cary Coutant <ccoutant@google.com>
7734
7735 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
7736 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
7737 * gold.cc (queue_initial_tasks): Check parameters for incremental link
7738 mode.
7739 * incremental.cc (report_command_line): Ignore all forms of
7740 --incremental.
7741 * layout.cc (Layout::Layout): Check parameters for incremental link
7742 mode.
7743 * options.cc (General_options::parse_incremental): New function.
7744 (General_options::parse_no_incremental): New function.
7745 (General_options::parse_incremental_full): New function.
7746 (General_options::parse_incremental_update): New function.
7747 (General_options::incremental_mode_): New data member.
7748 (General_options::finalize): Check incremental_mode_.
7749 * options.h (General_options): Update help text for --incremental.
7750 Add --no-incremental, --incremental-full, --incremental-update.
7751 (General_options::Incremental_mode): New enum type.
7752 (General_options::incremental_mode): New function.
7753 (General_options::incremental_mode_): New data member.
7754 * parameters.cc (Parameters::incremental_mode_): New data member.
7755 (Parameters::set_options): Set incremental_mode_.
7756 (Parameters::set_incremental_full): New function.
7757 (Parameters::incremental): New function.
7758 (Parameters::incremental_update): New function.
7759 (set_parameters_incremental_full): New function.
7760 * parameters.h (Parameters::set_incremental_full): New function.
7761 (Parameters::incremental): New function.
7762 (Parameters::incremental_update): New function.
7763 (Parameters::incremental_mode_): New data member.
7764 (set_parameters_incremental_full): New function.
7765 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
7766 incremental link mode.
7767 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
7768 (Sized_relobj::do_relocate_sections): Likewise.
7769 * testsuite/Makefile.am (incremental_test): Use --incremental-full
7770 option.
7771 * testsuite/Makefile.in: Regenerate.
7772 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 7773
bb32aa18 77742010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
7775
7776 * script-sections.h (class Script_sections): Make
7777 Sections_elements typedef public.
7778 * script-sections.cc (class Sort_output_sections): Add elements_
7779 field. Add constructor which sets it; change all callers.
7780 (Sort_output_sections::is_before): New function.
7781 (Sort_output_sections::operator()): Call is_before.
7782 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
7783 conditional.
7784 * testsuite/script_test_10.sh: New test. Test script section
7785 order.
7786 * testsuite/script_test_10.t: Likewise.
7787 * testsuite/script_test_10.s: Likewise.
7788 * testsuite/Makefile.am: Wrap the cross linker tests and the
7789 common tests into NATIVE_OR_CROSS_LINKER.
7790 (check_SCRIPTS): Add script_test_10.sh.
7791 (check_DATA): Add script_test_10.stdout.
7792 (script_test_10.o, script_test_10): New targets.
7793 (script_test_10.stdout): New target.
7794 * configure, testsuite/Makefile.in: Regenerate.
7795
3cef7179
ILT
77962010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7797
7798 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
7799 error for the deprecated relocations.
7800 (Target_arm::Scan::global): Likewise.
7801 (Target_arm::Relocate::relocate): Likewise.
7802
7411e9a8
RS
78032010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
7804
7805 * fileread.cc (Input_file::find_file): Initialize *found_name
7806 and *namep when using the fallback search for case 4.
7807
6a9da32a
CC
78082010-10-11 Cary Coutant <ccoutant@google.com>
7809
7810 * options.h (class General_options): Redefine -z lazy as an alias for
7811 the negation of -z now.
7812
ac897c20
ILT
78132010-10-11 Ian Lance Taylor <iant@google.com>
7814
7815 * resolve.cc (symbol_to_bits): Report the value of the unsupported
7816 binding.
7817
ea5cae92
NC
78182010-10-06 Nick Clifton <nickc@redhat.com>
7819
7820 * script-sections.cc(class Memory_region): Remove
7821 current_lma_offset_ field. Rename current_vma_offset_ to
7822 current_offset_. Add last_section_ field.
7823 (Memory_region::get_current_vma_address): Rename to
7824 get_current_address.
7825 (Memory_region::get_current_lma_address): Delete.
7826 (Memory_region::increment_vma_offset): Rename to
7827 increment_offset.
7828 (Memory_region::increment_lma_offset): Delete.
7829 (Memory_region::attributes_compatible): New method. Returns
7830 true if the provided section is compatible with the region.
7831 (Memory_region::get_last_section): New method. Returns the last
7832 section to use the region.
7833 (Memory_region::set_last_section): New method. Stores the last
7834 section to use the region.
7835 (Script_sections::block_in_region): New method. Returns true if
7836 a block of memory is contained within a region.
7837 (Script_sections::find_memory_region): New method. Locates a
7838 memory region to be used to set a VMA or LMA address.
7839 (Output_section_definition::set_section_addresses): Add code to
7840 check for addresses set by memory regions.
7841 (Output_segment::set_section_addresses): Remove memory region
7842 walking code.
7843 (Script_sections::create_segment): Add a warning if a header
7844 segment is created outside of any region.
7845 * script-sections.h (class Script_sections): Add prototypes for
7846 find_memory_region and block_in_region methods.
7847 * testsuite/memory_test.s: Use .long instead of .word.
7848 * testsuite/memory_test.t: Add some more output sections.
7849 * testsuite/memory_test.sh: Update expected output.
7850
a9bfd952
DK
78512010-10-02 Doug Kwan <dougkwan@google.com>
7852
7853 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
7854 defintion to symtab.h
7855 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
7856 declaration to defintion.
7857
bacff3ab
NC
78582010-10-01 Nick Clifton <nickc@redhat.com>
7859
7860 * expression.cc (eval): Replace dummy argument with NULL.
7861 (eval_maybe_dot): Check for a NULL result section pointer.
7862 (Symbol_expression::value): Likewise.
7863 (Dot_expression::value): Likewise.
7864 (BINARY_EXPRESSION): Likewise.
7865 (Max_expression::value): Likewise.
7866 (Min_expression::value): Likewise.
7867 (Absolute_expression::value): Likewise.
7868 (Addr_expression::value_from_output_section): Likewise.
7869 (Loaddddr_expression::value_from_output_section): Likewise.
7870 (Segment_start_expression::value): Likewise.
7871 * script-sections.cc
7872 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
7873 argument with NULL.
7874 (Sections_elememt_dot_assignment::set_section_addresses):
7875 Likewise.
7876 (Output_data_expression::do_write_to_buffer): Likewise.
7877 (Output_section_definition::finalize_symbols): Likewise.
7878 (Output_section_definition::set_section_addresses): Likewise.
7879
f81bc8b5
DK
78802010-09-30 Doug Kwan <dougkwan@google.com>
7881
7882 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
7883
c95e9f27
ST
78842010-09-28 Sriraman Tallam <tmsriram@google.com>
7885
7886 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 7887 function.
c95e9f27
ST
7888 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
7889 virtual function.
7890 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
7891 virtual function.
7892 * icf.cc (get_section_contents): Inline merge sections only when
7893 target allows it.
7894
3cac54d2
RW
78952010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7896
7897 * configure: Regenerate.
7898
2904037a
ILT
78992010-09-17 Ian Lance Taylor <iant@google.com>
7900
7901 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
7902 * testsuite/Makefile.am (memory_test.o): New target.
7903 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
7904 memory_test.t.
7905 * testsuite/Makefile.in: Rebuild.
2904037a 7906
bca7fb63
DK
79072010-09-17 Doug Kwan <dougkwan@google.com>
7908
7909 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
7910 defintion if relocation uses GOT entries of the symbol.
7911 * testsuite/icf_safe_test.sh: Fix test.
7912 * testsuite/icf_safe_so_test.sh: Fix test.
7913
4ef28648
CC
79142010-09-16 Cary Coutant <ccoutant@google.com>
7915
7916 * script_sections.cc (class Memory_region): Remove "NULL" from
7917 vector initializations.
7918
793990de
CC
79192010-09-15 Cary Coutant <ccoutant@google.com>
7920
7921 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
7922 Resolve forwarding symbols.
7923
81e015e2
DK
79242010-09-15 Doug Kwan <dougkwan@google.com>
7925
7926 * gold/testsuite/script_test_3.t: Add ARM special sections.
7927 * gold/testsuite/script_test_4.t: Same.
7928 * gold/testsuite/script_test_5.t: Same.
7929 * gold/testsuite/script_test_6.t: Same.
7930 * gold/testsuite/script_test_7.t: Same.
7931 * gold/testsuite/script_test_7.t: Same.
7932 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
7933
36171d64
CC
79342010-09-14 Cary Coutant <ccoutant@google.com>
7935
7936 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
7937 (Target_x86_64::Relocate::relocate_tls): Replace check for
7938 saw_tls_block_reloc_ with test for executable section.
7939
d89051bd
CC
79402010-09-12 Cary Coutant <ccoutant@google.com>
7941
7942 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
7943 position-independent executables to shared libraries need dynamic
7944 relocations.
7945 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
7946 position-independent executables.
7947 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
7948 * testsuite/Makefile.in: Regenerate.
7949
fca41f0f
NC
79502010-09-10 Nick Clifton <nickc@redhat.com>
7951
7952 PR gold/11997
7953 * testsuite/memory_test.t: Discard any sections that are not
7954 needed.
7955
6695e4b3
L
79562010-09-09 H.J. Lu <hongjiu.lu@intel.com>
7957
7958 PR gold/11996
7959 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
7960 "This::" to work around a bug in gcc 4.2.
7961
7962 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
7963
0f72bf6f
RÁE
79642010-09-09 Rafael Espindola <espindola@google.com>
7965
7966 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
7967 sections with different PF_X flags in the same segment.
7968 (Layout::find_first_load_seg): Search all segments to find the first
7969 one.
7970 * options.h (rosegment): New.
7971
79722010-09-08 Rafael Espindola <espindola@google.com>
a6577478 7973
05a79166 7974 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 7975
aa98ff75
DK
79762010-09-08 Doug Kwan <dougkwan@google.com>
7977
7978 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
7979 (Arm_relobj::do_relocate_sections): Add new parameter for output
7980 file to match the parent.
7981 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
7982 of local symbols instead of input values. Update code to track
7983 changes in gold::relocate_section.
7984 * object.cc (Sized_relobj::compute_final_local_value): New methods.
7985 (Sized_relobj::compute_final_local_value_internal): New methods.
7986 (Sized_relobj::do_finalize_local_symbols): Move code from loop
7987 body into private version of Sized_relobj::compute_final_local_value.
7988 Call the inline method.
7989 * object.h (Symbol_value::Symbol_value): Define destructor. Free
7990 merged symbol value if there is one.
7991 (Symbol_value::has_output_value): New method defintiion.
7992 (Sized_relobj::Compute_final_local_value_status): New enum type.
7993 (Sized_relobj::compute_final_local_value): New methods.
7994 (Sized_relobj::compute_final_local_value_internal): New methods.
7995 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
7996 and arm_cortex_a8.sh.
7997 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
7998 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
7999 New tests.
8000 * Makefile.in: Regenerate.
8001 * testsuite/arm_bl_out_of_range.s: Update test.
8002 * testsuite/thumb_bl_out_of_range.s: Ditto.
8003 * testsuite/thumb_blx_out_of_range.s: Ditto.
8004 * testsuite/arm_branch_out_of_range.sh: New file.
8005 * testsuite/arm_cortex_a8.sh: Ditto.
8006 * testsuite/arm_cortex_a8_b.s: Ditto.
8007 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
8008 * testsuite/arm_cortex_a8_b_local.s: Ditto.
8009 * testsuite/arm_cortex_a8_bl.s: Ditto.
8010 * testsuite/arm_cortex_a8_blx.s: Ditto.
8011 * testsuite/arm_cortex_a8_local.s: Ditto.
8012 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
8013 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
8014
05a79166
L
80152010-09-08 Rafael Espindola <espindola@google.com>
8016
8017 * Makefile.am (memory_test.stdout): Run readelf with -W.
8018 * Makefile.in: Regenerate.
8019 * testsuite/memory_test.sh: Make the regexps accept both 32 and
8020 64 bit output.
8021
33dbc701
RÁE
80222010-09-08 Rafael Espindola <espindola@google.com>
8023
8024 * script-sections.cc (Script_sections::add_memory_region): Convert
8025 field precision to int.
8026 * script.cc (script_set_section_region, script_set_section_region):
8027 Convert field precision to int.
8028
731ca54a
RÁE
80292010-09-08 Rafael Espindola <espindola@google.com>
8030
8031 * arm.cc (do_finalize_sections): Create the __exidx_start and
8032 __exdix_end symbols even when the section is missing.
8033
7f8cd844
NC
80342010-09-08 Nick Clifton <nickc@redhat.com>
8035
8036 * README: Remove claim that MEMORY is not supported.
8037 * expression.cc (script_exp_function_origin)
8038 (script_exp_function_length): Move from here to ...
8039 * script.cc: ... here.
8040 (script_set_section_region, script_add_memory)
8041 (script_parse_memory_attr, script_include_directive): New
8042 functions.
8043 * script-sections.cc
8044 (class Memory_region): New class.
8045 (class Output_section_definition): Add set_memory_region,
8046 set_section_vma, set_section_lma and get_section_name methods.
8047 (class Script_Sections): Add add_memory_region,
8048 find_memory_region, find_memory_region_origin,
8049 find_memory_region_length and set_memory_region methods.
8050 Have set_section_addresses method walk the list of set memory
8051 regions.
8052 Extend the print methos to display memory regions.
8053 * script-sections.h: Add prototypes for new methods.
8054 Add enum for MEMORY region attributes.
8055 * yyscript.y: Add support for parsing MEMORY regions.
8056 * script-c.h: Add prototypes for new functions.
8057 * testsuite/Makefile.am: Add test of MEMORY region functionality.
8058 * testsuite/Makefile.in: Regenerate.
8059 * testsuite/memory_test.sh: New script.
8060 * testsuite/memory_test.s: New assembler source file.
8061 * testsuite/memory_test.t: New linker script.
8062
a4649286
DK
80632010-08-27 Doug Kwan <dougkwan@google.com>
8064
8065 * gold/resolve.cc (Symbol_table::should_override): Let a weak
8066 reference override an existing dynamic weak reference.
8067 * testsuite/Makefile.am: Add new test dyn_weak_ref.
8068 * testsuite/Makefile.in: Regenerate.
8069 * testsuite/dyn_weak_ref.sh: New file.
8070 * testsuite/dyn_weak_ref_1.c: Ditto.
8071 * testsuite/dyn_weak_ref_2.c: Ditto.
8072
b56648ad
ILT
80732010-08-27 Ian Lance Taylor <iant@google.com>
8074
8075 * incremental.h (class Incremental_input_entry): Add virtual
8076 destructor.
8077
809313cb
ILT
80782010-08-27 Ian Lance Taylor <iant@google.com>
8079
8080 * testsuite/start_lib_test_3.c: Mark t3 as used.
8081
11e32464
NC
80822010-08-27 Nick Clifton <nickc@redhat.com>
8083
8084 * options.cc (version_script): Fix small typo in previous
8085 whitespace tidyup.
8086
ca09d69a
NC
80872010-08-25 Nick Clifton <nickc@redhat.com>
8088
8089 * archive.cc: Formatting fixes: Remove whitespace between
8090 typename and following asterisk. Remove whitespace between
8091 function name and opening parenthesis.
8092 * archive.h: Likewise.
8093 * arm.cc: Likewise.
8094 * attributes.cc: Likewise.
8095 * attributes.h: Likewise.
8096 * common.cc: Likewise.
8097 * copy-relocs.cc: Likewise.
8098 * dirsearch.h: Likewise.
8099 * dynobj.cc: Likewise.
8100 * ehframe.cc: Likewise.
8101 * ehframe.h: Likewise.
8102 * expression.cc: Likewise.
8103 * fileread.cc: Likewise.
8104 * fileread.h: Likewise.
8105 * gc.h: Likewise.
8106 * gold-threads.cc: Likewise.
8107 * gold.cc: Likewise.
8108 * i386.cc: Likewise.
8109 * icf.h: Likewise.
8110 * incremental-dump.cc: Likewise.
8111 * incremental.cc: Likewise.
8112 * layout.cc: Likewise.
8113 * layout.h: Likewise.
8114 * main.cc: Likewise.
8115 * merge.cc: Likewise.
8116 * merge.h: Likewise.
8117 * object.cc: Likewise.
8118 * object.h: Likewise.
8119 * options.cc: Likewise.
8120 * options.h: Likewise.
8121 * output.cc: Likewise.
8122 * output.h: Likewise.
8123 * plugin.cc: Likewise.
8124 * plugin.h: Likewise.
8125 * powerpc.cc: Likewise.
8126 * reloc.cc: Likewise.
8127 * script-c.h: Likewise.
8128 * script-sections.cc: Likewise.
8129 * script.cc: Likewise.
8130 * stringpool.cc: Likewise.
8131 * symtab.cc: Likewise.
8132 * symtab.h: Likewise.
8133 * target.cc: Likewise.
8134 * timer.cc: Likewise.
8135 * timer.h: Likewise.
8136 * version.cc: Likewise.
8137 * x86_64.cc: Likewise.
8138
b8fa8750
NC
81392010-08-24 Nick Clifton <nickc@redhat.com>
8140
8141 PR 11899
8142 * layout.cc (segment_precedes): Sort segments by their physical
8143 addresses, if they have been set.
8144
9919d93b
CC
81452010-08-23 Cary Coutant <ccoutant@google.com>
8146
8147 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
8148 symbols data.
8149 (Lib_group::include_member): Unlock object after deleting its
8150 symbols data.
8151 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
8152 the bug fixed here.
8153
97b4be1c
CC
81542010-08-19 Neil Vachharajani <nvachhar@google.com>
8155 Cary Coutant <ccoutant@google.com>
8156
8157 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
8158 constructor, and set_blocker.
8159 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
8160 readsyms_blocker_.
8161 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
8162 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
8163 * testsuite/Makefile.am (start_lib_test): New test case.
8164 * testsuite/Makefile.in: Regenerate.
8165 * testsuite/start_lib_test_main.c: New file.
8166 * testsuite/start_lib_test_1.c: New file.
8167 * testsuite/start_lib_test_2.c: New file.
8168 * testsuite/start_lib_test_3.c: New file.
8169
dd0b1884
ILT
81702010-08-19 Ian Lance Taylor <iant@google.com>
8171
8172 * Makefile.in: Rebuild with automake 1.11.1.
8173 * aclocal.m4: Likewise.
8174 * testsuite/Makefile.in: Likewise.
8175
7223e9ca
ILT
81762010-08-19 Ian Lance Taylor <iant@google.com>
8177
8178 PR 10893
8179 * i386.cc (class Output_data_plt_i386): Update declarations.
8180 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
8181 local_ifuncs_ fields.
8182 (Target_i386::do_plt_section_for_global): New function.
8183 (Target_i386::do_plt_section_for_local): New function.
8184 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
8185 parameter; change all callers. Initialize global_ifuncs_ and
8186 local_ifuncs_. If doing a static link define __rel_iplt_start and
8187 __rel_iplt_end.
8188 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
8189 (Output_data_plt_i386::add_local_ifunc_entry): New function.
8190 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
8191 symbols.
8192 (Target_i386::make_plt_section): New function, broken out of
8193 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
8194 (Target_i386::make_plt_entry): Call make_plt_section.
8195 (Target_i386::make_local_ifunc_plt_entry): New function.
8196 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
8197 (Target_i386::Scan::local): Handle IFUNC symbols. Add
8198 R_386_IRELATIVE to switch.
8199 (Target_i386::Scan::global): Likewise.
8200 (Target_i386::Relocate::relocate): Likewise.
8201 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
8202 switch.
8203 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
8204 (Target_x86_64::do_plt_section_for_global): New function.
8205 (Target_x86_64::do_plt_section_for_local): New function.
8206 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
8207 parameter; change all callers. If doing a static link define
8208 __rela_iplt_start and __rela_iplt_end.
8209 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
8210 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
8211 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
8212 to point to .plt.
8213 (Target_x86_64::make_local_ifunc_plt_entry): New function.
8214 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
8215 switch.
8216 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
8217 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
8218 R_X86_64_IRELATIVE to switch.
8219 (Target_x86_64::Scan::global): Likewise.
8220 (Target_x86_64::Relocate::relocate): Likewise.
8221 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
8222 switch.
8223 * target.h (class Target): Add plt_section_for_global and
8224 plt_section_for_local functions. Add do_plt_section_for_global
8225 and do_plt_section_for_local virtual functions.
8226 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
8227 clarifying comments.
8228 (Symbol::use_plt_offset): Handle IFUNC symbol.
8229 * object.cc (Sized_relobj::Sized_relobj): Initialize
8230 local_plt_offsets_.
8231 (Sized_relobj::local_has_plt_offset): New function.
8232 (Sized_relobj::local_plt_offset): New function.
8233 (Sized_relobj::set_local_plt_offset): New function.
8234 (Sized_relobj::do_count): Handle IFUNC symbol.
8235 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
8236 a bit away from input_shndx_ field. Add set_is_func_symbol and
8237 is_ifunc_symbol functions.
8238 (class Sized_relobj): Update declarations. Remove Tls_got_entry
8239 and Local_tls_got_offsets. Define Local_plt_offsets. Add
8240 local_plt_offsets_ field.
8241 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
8242 * output.h (class Output_section_data): Add non-const
8243 output_section function.
8244 (class Output_data_got): Update declarations.
8245 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
8246 Add use_plt_offset parameter to global and local constructors.
8247 Change all callers. Change local_sym_index_ field to 31 bits.
8248 Change GSYM_CODE and CONSTANT_CODE accordingly.
8249 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
8250 doing a static link don't set sh_link field.
8251 (Output_data_got::Got_entry::write): Use PLT offset if
8252 appropriate.
8253 (Output_data_got::add_global_plt): New function.
8254 (Output_data_got::add_local_plt): New function.
8255 * target-reloc.h (relocate_section): Handle IFUNC symbol.
8256 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
8257 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
8258 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
8259 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
8260 IFUNC conditional.
8261 * testsuite/ifunc-sel.h: New file.
8262 * testsuite/ifuncmain1.c: New file.
8263 * testsuite/ifuncmain1vis.c: New file.
8264 * testsuite/ifuncmod1.c: New file.
8265 * testsuite/ifuncdep2.c: New file.
8266 * testsuite/ifuncmain2.c: New file.
8267 * testsuite/ifuncmain3.c: New file.
8268 * testsuite/ifuncmod3.c: New file.
8269 * testsuite/ifuncmain4.c: New file.
8270 * testsuite/ifuncmain5.c: New file.
8271 * testsuite/ifuncmod5.c: New file.
8272 * testsuite/ifuncmain6pie.c: New file.
8273 * testsuite/ifuncmod6.c: New file.
8274 * testsuite/ifuncmain7.c: New file.
8275 * configure, testsuite/Makefile.in: Rebuild.
8276
56f75c03
ILT
82772010-08-18 Ian Lance Taylor <iant@google.com>
8278
8279 * incremental.cc
8280 (Output_section_incremental_inputs::write_input_files): Add cast
8281 to avoid signed/unsigned comparison warning.
8282 (Output_section_incremental_inputs::write_info_blocks): Likewise.
8283
55455f89
CC
82842010-08-12 Cary Coutant <ccoutant@google.com>
8285
8286 * common.cc (Sort_commons::operator()): Remove unnecessary code.
8287
e2054bcb
ILT
82882010-08-13 Ian Lance Taylor <iant@google.com>
8289
8290 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
8291
74f67560
DK
82922010-08-12 Cary Coutant <ccoutant@google.com>
8293 Doug Kwan <dougkwan@google.com>
8294
8295 * resolve.cc (Symbol_table::should_override): When a weak dynamic
8296 defintion overrides non-weak undef, remember that the original undef
8297 is not weak.
8298 * symtab.cc (Symbol_table::sized_write_global): For undef without
8299 an original weak binding, set binding to global in output.
8300 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
8301 * testsuite/Makefile.in: Regenerate.
8302 * testsuite/strong_ref_weak_def.sh: New file.
8303 * testsuite/strong_ref_weak_def_1.c: Ditto.
8304 * testsuite/strong_ref_weak_def_2.c: Ditto.
8305
d1238d12
CC
83062010-08-12 Cary Coutant <ccoutant@google.com>
8307
8308 * testsuite/incremental_test.sh: Rewrite.
8309 * testsuite/incremental_test_1.c: Rewrite.
8310 * testsuite/incremental_test_2.c: Rewrite.
8311
0e70b911
CC
83122010-08-12 Cary Coutant <ccoutant@google.com>
8313
8314 * arm.cc (Target_arm::got_size): Add const.
8315 (Target_arm::got_entry_count): New function.
8316 (Target_arm::plt_entry_count): New function.
8317 (Target_arm::first_plt_entry_offset): New function.
8318 (Target_arm::plt_entry_size): New function.
8319 (Output_data_plt_arm::entry_count): New function.
8320 (Output_data_plt_arm::first_plt_entry_offset): New function.
8321 (Output_data_plt_arm::get_plt_entry_size): New function.
8322 * i386.cc (Target_i386::got_size): Add const.
8323 (Target_i386::got_entry_count): New function.
8324 (Target_i386::plt_entry_count): New function.
8325 (Target_i386::first_plt_entry_offset): New function.
8326 (Target_i386::plt_entry_size): New function.
8327 (Output_data_plt_i386::entry_count): New function.
8328 (Output_data_plt_i386::first_plt_entry_offset): New function.
8329 (Output_data_plt_i386::get_plt_entry_size): New function.
8330 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
8331 find_incremental_inputs_sections. Dump incremental_got_plt section.
8332 * incremental.cc: Include target.h.
8333 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
8334 parameter. Adjust all callers. Find incremental_got_plt section.
8335 (Incremental_inputs::create_data_sections): Create incremental_got_plt
8336 section.
8337 (Output_section_incremental_inputs::set_final_data_size): Calculate
8338 size of incremental_got_plt section.
8339 (Output_section_incremental_inputs::do_write): Write the
8340 incremental_got_plt section.
8341 (Got_plt_view_info): New struct.
8342 (Local_got_offset_visitor): New class.
8343 (Global_got_offset_visitor): New class.
8344 (Global_symbol_visitor_got_plt): New class.
8345 (Output_section_incremental_inputs::write_got_plt): New function.
8346 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
8347 Add parameter. Adjust all callers.
8348 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8349 (Incremental_inputs::got_plt_section): New function.
8350 (Incremental_inputs::got_plt_section_): New data member.
8351 (Incremental_got_plt_reader): New class.
8352 * layout.cc (Layout::create_incremental_info_sections): Add the
8353 incremental_got_plt section.
8354 * object.h (Got_offset_list::get_list): New function.
8355 (Got offset_list::for_all_got_offsets): New function.
8356 (Sized_relobj::local_got_offset_list): New function.
8357 * powerpc.cc (Target_powerpc::got_size): Add const.
8358 (Target_powerpc::got_entry_count): New function.
8359 (Target_powerpc::plt_entry_count): New function.
8360 (Target_powerpc::first_plt_entry_offset): New function.
8361 (Target_powerpc::plt_entry_size): New function.
8362 (Output_data_plt_powerpc::entry_count): New function.
8363 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
8364 (Output_data_plt_powerpc::get_plt_entry_size): New function.
8365 * sparc.cc (Target_sparc::got_size): Add const.
8366 (Target_sparc::got_entry_count): New function.
8367 (Target_sparc::plt_entry_count): New function.
8368 (Target_sparc::first_plt_entry_offset): New function.
8369 (Target_sparc::plt_entry_size): New function.
8370 (Output_data_plt_sparc::entry_count): New function.
8371 (Output_data_plt_sparc::first_plt_entry_offset): New function.
8372 (Output_data_plt_sparc::get_plt_entry_size): New function.
8373 * symtab.h (Symbol::got_offset_list): New function.
8374 (Symbol_table::for_all_symbols): New function.
8375 * target.h (Sized_target::got_entry_count): New function.
8376 (Sized_target::plt_entry_count): New function.
8377 (Sized_target::plt_entry_size): New function.
8378 * x86_64.cc (Target_x86_64::got_size): Add const.
8379 (Target_x86_64::got_entry_count): New function.
8380 (Target_x86_64::plt_entry_count): New function.
8381 (Target_x86_64::first_plt_entry_offset): New function.
8382 (Target_x86_64::plt_entry_size): New function.
8383 (Output_data_plt_x86_64::entry_count): New function.
8384 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
8385 (Output_data_plt_x86_64::get_plt_entry_size): New function.
8386
09ec0418
CC
83872010-08-12 Cary Coutant <ccoutant@google.com>
8388
8389 * archive.cc: Include incremental.h.
8390 (Archive::Archive): Initialize incremental_info_.
8391 (Archive::include_member): Record archive members in incremental info.
8392 (Add_archive_symbols::run): Record begin and end of an archive in
8393 incremental info.
8394 (Lib_group::include_member): Record objects in incremental info.
8395 * archive.h (Incremental_archive_entry): Forward declaration.
8396 (Archive::set_incremental_info): New member function.
8397 (Archive::incremental_info): New member function.
8398 (Archive::Unused_symbol_iterator): New class.
8399 (Archive::unused_symbols_begin): New member function.
8400 (Archive::unused_symbols_end): New member function.
8401 (Archive::incremental_info_): New data member.
8402 * incremental-dump.cc (find_input_containing_global): New function.
8403 (dump_incremental_inputs): Dump new incremental info sections.
8404 * incremental.cc: Include symtab.h.
8405 (Output_section_incremental_inputs): New class.
8406 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
8407 new incremental info sections.
8408 (Sized_incremental_binary::do_check_inputs): Likewise.
8409 (Incremental_inputs::report_archive): Remove.
8410 (Incremental_inputs::report_archive_begin): New function.
8411 (Incremental_inputs::report_archive_end): New function.
8412 (Incremental_inputs::report_object): New function.
8413 (Incremental_inputs::finalize_inputs): Remove.
8414 (Incremental_inputs::report_input_section): New function.
8415 (Incremental_inputs::report_script): Rewrite.
8416 (Incremental_inputs::finalize): Do nothing but finalize string table.
8417 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8418 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8419 (Incremental_inputs::create_data_sections): New function.
8420 (Incremental_inputs::relocs_entsize): New function.
8421 (Output_section_incremental_inputs::set_final_data_size): New function.
8422 (Output_section_incremental_inputs::do_write): New function.
8423 (Output_section_incremental_inputs::write_header): New function.
8424 (Output_section_incremental_inputs::write_input_files): New function.
8425 (Output_section_incremental_inputs::write_info_blocks): New function.
8426 (Output_section_incremental_inputs::write_symtab): New function.
8427 * incremental.h (Incremental_script_entry): Forward declaration.
8428 (Incremental_object_entry): Forward declaration.
8429 (Incremental_archive_entry): Forward declaration.
8430 (Incremental_inputs): Forward declaration.
8431 (Incremental_inputs_header_data): Remove.
8432 (Incremental_inputs_header): Remove.
8433 (Incremental_inputs_header_write): Remove.
8434 (Incremental_inputs_entry_data): Remove.
8435 (Incremental_inputs_entry): Remove.
8436 (Incremental_inputs_entry_write): Remove.
8437 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
8438 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
8439 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8440 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
8441 Likewise.
8442 (Incremental_input_entry): New class.
8443 (Incremental_script_entry): New class.
8444 (Incremental_object_entry): New class.
8445 (Incremental_archive_entry): New class.
8446 (Incremental_inputs::Incremental_inputs): Initialize new data members.
8447 (Incremental_inputs::report_inputs): Remove.
8448 (Incremental_inputs::report_archive): Remove.
8449 (Incremental_inputs::report_archive_begin): New function.
8450 (Incremental_inputs::report_archive_end): New function.
8451 (Incremental_inputs::report_object): Change prototype.
8452 (Incremental_inputs::report_input_section): New function.
8453 (Incremental_inputs::report_script): Change prototype.
8454 (Incremental_inputs::get_reloc_count): New function.
8455 (Incremental_inputs::set_reloc_count): New function.
8456 (Incremental_inputs::create_data_sections): New function.
8457 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8458 (Incremental_inputs::inputs_section): New function.
8459 (Incremental_inputs::symtab_section): New function.
8460 (Incremental_inputs::relocs_section): New function.
8461 (Incremental_inputs::get_stringpool): Add const.
8462 (Incremental_inputs::command_line): Add const.
8463 (Incremental_inputs::inputs): Remove.
8464 (Incremental_inputs::command_line_key): New function.
8465 (Incremental_inputs::input_file_count): New function.
8466 (Incremental_inputs::input_files): New function.
8467 (Incremental_inputs::relocs_entsize): New function.
8468 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8469 (Incremental_inputs::finalize_inputs): Remove.
8470 (Incremental_inputs::Input_info): Remove.
8471 (Incremental_inputs::lock_): Remove.
8472 (Incremental_inputs::inputs_): Change type.
8473 (Incremental_inputs::inputs_map_): Remove.
8474 (Incremental_inputs::current_object_entry_): New data member.
8475 (Incremental_inputs::inputs_section_): New data member.
8476 (Incremental_inputs::symtab_section_): New data member.
8477 (Incremental_inputs::relocs_section_): New data member.
8478 (Incremental_inputs::reloc_count_): New data member.
8479 (Incremental_inputs_reader): New class.
8480 (Incremental_symtab_reader): New class.
8481 (Incremental_relocs_reader): New class.
8482 * layout.cc (Layout::finalize): Move finalization of incremental info
8483 and creation of incremental info sections to follow finalization of
8484 symbol table. Set offsets for postprocessing sections.
8485 (Layout::create_incremental_info_sections): Call
8486 Incremental_inputs::create_data_sections. Add incremental symtab
8487 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
8488 sections to layout after input sections.
8489 * layout.h (struct Timespec): Forward declaration.
8490 (Layout::incremental_inputs): Add const.
8491 (Layout::create_incremental_info_sections): Add parameter.
8492 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
8493 * object.cc: Include incremental.h.
8494 (Relobj::finalize_incremental_relocs): New function.
8495 (Sized_relobj::do_layout): Record input sections in incremental info.
8496 * object.h (Object::output_section): New function.
8497 (Object::output_section_offset): Moved from Relobj.
8498 (Object::get_incremental_reloc_base): New function.
8499 (Object::get_incremental_reloc_count): New function.
8500 (Object::do_output_section): New function.
8501 (Object::do_output_section_offset): Moved from Relobj.
8502 (Object::do_get_incremental_reloc_base): New function.
8503 (Object::do_get_incremental_reloc_count): New function.
8504 (Object::Object): Initialize new data members.
8505 (Relobj::output_section): Renamed do_output_section and moved to
8506 protected.
8507 (Relobj::output_section_offset): Moved to Object.
8508 (Relobj::do_get_incremental_reloc_base): New function.
8509 (Relobj::do_get_incremental_reloc_count): New function.
8510 (Relobj::allocate_incremental_reloc_counts): New function.
8511 (Relobj::count_incremental_reloc): New function.
8512 (Relobj::finalize_incremental_relocs): New function.
8513 (Relobj::next_incremental_reloc_index): New function.
8514 (Relobj::reloc_counts_): New data member.
8515 (Relobj::reloc_bases_): New data member.
8516 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
8517 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
8518 (Sized_relobj::incremental_relocs_scan): New function.
8519 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8520 (Sized_relobj::incremental_relocs_write): New function.
8521 (Sized_relobj::incremental_relocs_write_reltype): New function.
8522 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
8523 incremental link.
8524 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
8525 archives and object files elsewhere.
8526 (Add_symbols::run): Report object files here.
8527 (Finish_group::run): Report end of archive at end of group.
8528 * reloc.cc: Include layout.h, incremental.h.
8529 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
8530 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
8531 (Sized_relobj::incremental_relocs_scan): New function.
8532 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8533 (Sized_relobj::do_relocate_sections): Write incremental relocations.
8534 (Sized_relobj::incremental_relocs_write): New function.
8535 (Sized_relobj::incremental_relocs_write_reltype): New function.
8536 * script.cc (read_input_script): Rewrite test for incremental link.
8537 Change call to Incremental_inputs::report_script.
8538 * symtab.h (Symbol_table::first_global_index): New function.
8539 (Symbol_table::output_count): New function.
8540
ce0d1972
DK
85412010-08-12 Doug Kwan <dougkwan@google.com>
8542
8543 * arm.cc (Target_arm::merge_object_attributes): Check command line
8544 options --no-wchar-size-warning and --no-enum-size-warning.
8545 * options.h (General_options): Add ld-compatible options
8546 --no-enum-size-warning and --no-wchar-size-warning.
8547
6e5710ce
ILT
85482010-08-04 Ian Lance Taylor <iant@google.com>
8549
8550 * x86_64.cc (Target_x86_64::Scan::local): Use
8551 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
8552 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
8553 (Target_x86_64::Scan::global): Likewise.
8554 (Target_x86_64::Relocate::relocate): Likewise.
8555 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
8556 Likewise.
8557
fef830db
CC
85582010-08-03 Cary Coutant <ccoutant@google.com>
8559
8560 * merge.cc (Output_merge_string::do_add_input_section): Count strings
8561 to reserve space in merged_strings vector. Keep total input size
8562 for stats.
8563 (Output_merge_string::do_print_merge_stats): Print total input size.
8564 * merge.h (Output_merge_string): Add input_size_ field.
8565 * stringpool.cc (Stringpool_template::string_length): Move
8566 implementations out of Stringpool_template class and place in
8567 stringpool.h.
8568 * stringpool.h (string_length): Move out of Stringpool_template.
8569
1e3811b0
ILT
85702010-08-03 Ian Lance Taylor <iant@google.com>
8571
8572 PR 11712
8573 * layout.cc (relaxation_loop_body): If address of load segment is
8574 set, adjust address to include headers if possible.
8575
7af0c620
ILT
85762010-08-03 Ian Lance Taylor <iant@google.com>
8577
8578 * version.cc (version_string): Bump to 1.10.
8579
22f0da72
ILT
85802010-08-03 Ian Lance Taylor <iant@google.com>
8581
8582 PR 11805
8583 * layout.h (enum Output_section_order): Define.
8584 (class Layout): Update declarations.
8585 * layout.cc (Layout::get_output_section): Add order parameter.
8586 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
8587 is_first_non_relro parameters. Change all callers.
8588 (Layout::choose_output_section): Likewise.
8589 (Layout::add_output_section_data): Likewise.
8590 (Layout::make_output_section): Likewise. Set order.
8591 (Layout::default_section_order): New function.
8592 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
8593 * output.cc (Output_section::Output_section): Initialize order_.
8594 Don't initialize deleted fields.
8595 (Output_segment::Output_segment): Don't initialize deleted
8596 fields.
8597 (Output_segment::add_output_section_to_load): New function
8598 replacing add_output_section. Change all callers to call this or
8599 add_output_section_to_nonload.
8600 (Output_segment::add_output_section_to_nonload): New function.
8601 (Output_segment::remove_output_section): Rewrite.
8602 (Output_segment::add_initial_output_data): Likewise.
8603 (Output_segment::has_any_data_sections): Likewise.
8604 (Output_segment::is_first_section_relro): Likewise.
8605 (Output_segment::maximum_alignment): Likewise.
8606 (Output_segment::has_dynamic_reloc): New function replacing
8607 dynamic_reloc_count. Change all callers.
8608 (Output_segment::has_dynamic_reloc_list): New function replacing
8609 dynamic_reloc_count_list. Change all callers.
8610 (Output_segment::set_section_addresses): Rewrite.
8611 (Output_segment::set_offset): Rewrite.
8612 (Output_segment::find_first_and_last_list): Remove.
8613 (Output_segment::set_tls_offsets): Rewrite.
8614 (Output_segment::first_section_load_address): Likewise.
8615 (Output_segment::output_section_count): Likewise.
8616 (Output_segment::section_with_lowest_load_address): Likewise.
8617 (Output_segment::write_section_headers): Likewise.
8618 (Output_segment::print_sections_to_map): Likewise.
8619 * output.h (class Output_data): Remove dynamic_reloc_count_
8620 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
8621 (Output_data::add_dynamic_reloc): Rewrite.
8622 (Output_data::has_dynamic_reloc): New function.
8623 (Output_data::dynamic_reloc_count): Remove.
8624 (class Output_section): Add order_ field. Remvoe is_relro_local_,
8625 is_last_relro_, is_first_non_relro_, is_interp_,
8626 is_dynamic_linker_section_ fields. Add order and set_order
8627 functions. Remove is_relro_local, set_is_relro_local,
8628 is_last_relro, set_is_last_relro, is_first_non_relro,
8629 set_is_first_non_relro functions, is_interp, set_is_interp,
8630 is_dynamic_linker_section, and set_is_dynamic_linker_section
8631 functions.
8632 (class Output_segment): Change Output_data_list from std::list to
8633 std:;vector. Add output_lists_ field. Remove output_data_ and
8634 output_bss_ fields. Update declarations.
8635
3ff2ccb0
ILT
86362010-08-02 Ian Lance Taylor <iant@google.com>
8637
8638 * arm.cc (Target_arm::gc_process_relocs): Use typename.
8639 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
8640 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
8641
88a4108b
ILT
86422010-08-02 Ian Lance Taylor <iant@google.com>
8643
8644 PR 11855
8645 * script.cc (Script_options::Script_options): Initialize
8646 symbol_definitions_ and symbol_references_.
8647 (Script_options::add_symbol_assignment): Update
8648 symbol_definitions_ and symbol_references_.
8649 (Script_options::add_symbol_reference): New function.
8650 (script_symbol): New function.
8651 * script.h (class Script_options): Add symbol_definitions_ and
8652 symbol_references_ fields.
8653 (Script_options::referenced_const_iterator): New type.
8654 (Script_options::referenced_begin): New function.
8655 (Script_options::referenced_end): New function.
8656 (Script_options::is_referenced): New function.
8657 (Script_options::any_unreferenced): New function.
8658 * script-c.h (script_symbol): Declare.
8659 * yyscript.y (exp): Call script_symbol.
8660 * symtab.cc: Include "script.h".
8661 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
8662 Change all callers. Check symbols referenced by scripts.
8663 (Symbol_table::add_undefined_symbols_from_command_line): Add
8664 layout parameter. Change all callers.
8665 (Symbol_table::do_add_undefined_symbols_from_command_line):
8666 Likewise. Break out loop body. Check symbols referenced by
8667 scripts.
8668 (Symbol_table::add_undefined_symbol_from_command_line): New
8669 function broken out of
8670 do_add_undefined_symbols_from_command_line.
8671 * symtab.h (class Symbol_table): Update declarations.
8672 * archive.cc: Include "layout.h".
8673 (Archive::should_include_member): Add layout parameter. Change
8674 all callers. Check for symbol mentioned in expression.
8675 * archive.h (class Archive): Update declaration.
8676 * object.cc (Sized_relobj::do_should_include_member): Add layout
8677 parameter.
8678 * object.h (Object::should_include_member): Add layout parameter.
8679 Change all callers.
8680 (Object::do_should_include_member): Add layout parameter.
8681 (class Sized_relobj): Update declaration.
8682 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
8683 parameter.
8684 * dynobj.h (class Sized_dynobj): Update declaration.
8685 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
8686 layout parameter.
8687 * plugin.h (class Sized_pluginobj): Update declaration.
8688
5f1ab67a
ILT
86892010-08-02 Ian Lance Taylor <iant@google.com>
8690
8691 PR 11866
8692 * output.cc (Output_segment::set_offset): Search for the first and
8693 last sections rather than assuming that the list is in order.
8694 (Output_segment::find_first_and_last_list): New function.
8695 * output.h (class Output_segment): Update declarations.
8696 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
8697 (relro_strip_test_SOURCES): New variable.
8698 (relro_strip_test_DEPENDENCIES): New variable.
8699 (relro_strip_test_LDFLAGS): New variable.
8700 (relro_strip_test_LDADD): New variable.
8701 (relro_strip_test.so): New target.
8702
a8df5856
ILT
87032010-08-02 Ian Lance Taylor <iant@google.com>
8704
8705 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
8706 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
8707 (Target_i386::got_tlsdesc_section): New function.
8708 (Target_i386::got_section): Create space for GOT entries for
8709 TLSDESC relocations.
8710 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
8711 R_386_TLS_GOTDESC.
8712 (Target_i386::Scan::global): Likewise.
8713 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
8714 using TLSDESC GOT.
8715 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
8716 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
8717 (Target_x86_64::got_tlsdesc_section): New function.
8718 (Target_x86_64::got_section): Create space for GOT entries for
8719 TLSDESC relocations.
8720 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
8721 R_386_TLS_GOTDESC.
8722 (Target_x86_64::Scan::global): Likewise.
8723 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
8724 using TLSDESC GOT.
8725
0c10a0a6
ILT
87262010-08-02 Ian Lance Taylor <iant@google.com>
8727
8728 * testsuite/final_layout.sh: Use dc to convert from hex to
8729 decimal.
8730
41cbeecc
ST
87312010-07-29 Sriraman Tallam <tmsriram@google.com>
8732
8733 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
8734 paramter to the call to gold::gc_process_relocs.
8735 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
8736 paramter to the call to gold::gc_process_relocs.
8737 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
8738 parameter to the call to gold::gc_process_relocs.
8739 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
8740 template parameter to the call to gold::gc_process_relocs.
8741 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
8742 paramter to the call to gold::gc_process_relocs.
8743 * gc.h (get_embedded_addend_size): New function.
8744 (gc_process_relocs): Save the size of the reloc for use by ICF.
8745 * icf.cc (get_section_contents): Get the addend from the text section
8746 for SHT_REL relocation sections.
8747 * icf.h (Icf::Reloc_addend_size_info): New typedef.
8748 (Icf::Reloc_info): Add new member reloc_addend_size_info.
8749 * int_encoding.h (read_from_pointer): New overloaded function.
8750 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
8751 * testsuite/icf_sht_rel_addend_test.sh: New file.
8752 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
8753 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
8754
6ea55b82
RW
87552010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8756
8757 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
8758 * Makefile.in: Regenerate.
8759 * testsuite/Makefile.in: Regenerate.
8760
9691462b
ILT
87612010-07-27 Jeffrey Yasskin <jyasskin@google.com>
8762
8763 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
8764 * gold/testsuite/debug_msg.cc: Likewise.
8765 * gold/testsuite/odr_violation1.cc
8766 * gold/testsuite/odr_violation2.cc
8767
76897331
CC
87682010-07-21 Cary Coutant <ccoutant@google.com>
8769
8770 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
8771 string, and length fields.
8772 (Output_merge_string::Merged_strings_list): New type.
8773 (Output_merge_string::Merged_strings_lists): New typedef.
8774 (Output_merge_string): Replace merged_strings_ with
8775 merged_strings_lists_.
8776 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
8777 Merged_strings_list per input object and section. Don't store pointer
8778 to the string. Don't store length with each merged string entry.
8779 (Output_merge_string::finalize_merged_data): Loop over list of merged
8780 strings lists. Recompute length of each merged string.
8781
78384e8f
CC
87822010-07-15 Cary Coutant <ccoutant@google.com>
8783
8784 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
8785 here.
8786
783659f9
ILT
87872010-07-14 Ian Lance Taylor <iant@google.com>
8788
8789 * descriptors.cc (Descriptors::open): Report correct name in error
8790 message.
8791
131687b4
DK
87922010-07-13 Doug Kwan <dougkwan@google.com>
8793
8794 * arm.cc (Arm_input_section::Arm_input_section): For a
8795 SHT_ARM_EXIDX section, always keeps the input sections.
8796 (Arm_input_section::set_exidx_section_link): New method.
8797 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
8798 has_errors_ to false.
8799 (Arm_exidx_input_section::has_errors,
8800 Arm_exidx_input_section::set_has_errors): New methods.
8801 (Arm_exidx_input_section::has_errors_): New data member.
8802 (Arm_relobj::get_exidx_shndx_list): New method.
8803 (Arm_output_section::append_text_sections_to_list): Do not skip
8804 section without SHF_EXECINSTR.
8805 (Arm_output_section::fix_exidx_coverage): Skip input sections with
8806 errors.
2e702c99 8807 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
8808 section header. Make error messages more verbose. Check for
8809 a non-executable section linked to an EXIDX section.
8810 (Arm_relobj::do_read_symbols): Remove error checking, which has been
8811 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
8812 check that there is no deferred EXIDX section if we exit early.
8813 Instead of not making an EXIDX section in case of an error, make one
8814 and set the has_errors flag of it.
8815 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
8816 in a relocatable link.
8817 (Target_arm::do_relax): Look for the EXIDX output section instead of
8818 assuming that it is called .ARM.exidx.
2e702c99 8819 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
8820 section list. Do not check for SHF_EXECINSTR section flags but
8821 skip any input section with errors.
8822 * output.cc (Output_section::Output_section): Initialize
8823 always_keeps_input_sections_ to false.
8824 (Output_section::add_input_section): Check for
8825 always_keeps_input_sections_.
8826 * output.h (Output_section::always_keeps_input_sections,
8827 Output_section::set_always_keeps_input_sections): New methods.
8828 (Output_section::always_keeps_input_sections): New data member.
8829
69517287
RÁE
88302010-07-13 Rafael Espindola <espindola@google.com>
8831
8832 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
8833 * fileread.h (Input_file): Add try_extra_search_path and find_file.
8834
82742395
ILT
88352010-07-13 Philip Herron <herron.philip@googlemail.com>
8836 Ian Lance Taylor <iant@google.com>
8837
8838 * output.h (Output_section_lookup_maps::add_merge_section):
8839 Correct check of whether value was inserted.
8840 (Output_section_lookup_maps::add_merge_input_section): Likewise.
8841 (Output_section_lookup_maps::add_relaxed_input_section):
8842 Likewise.
8843 * arm.cc (Target_arm::got_section): Remove used local os.
8844 * i386.cc (Target_i386::got_section): Likewise.
8845 * x86_64.cc (Target_x86_64::got_section): Likewise.
8846 * sparc.cc (Target_sparc::got_section): Likewise.
8847 (Target_sparc::relocate): Remove unused local have_got_offset.
8848 * powerpc.cc (Target_powerpc::relocate): Likewise.
8849
f2d707b5
ILT
88502010-07-13 Ian Lance Taylor <iant@google.com>
8851
241531d6
ILT
8852 * compressed_output.cc (zlib_decompress): Fix signature in
8853 !HAVE_ZLIB_H case.
8854
f2d707b5
ILT
8855 * archive.cc (Archive::include_member): Unlock an external member
8856 of a thin archive. Don't bother to delete an object we know is
8857 NULL.
8858
a2e47362
CC
88592010-07-12 Cary Coutant <ccoutant@google.com>
8860
8861 * compressed_output.cc (zlib_decompress): New function.
8862 (get_uncompressed_size): New function.
8863 (decompress_input_section): New function.
8864 * compressed_output.h (get_uncompressed_size): New function.
8865 (decompress_input_section): New function.
8866 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
8867 Handle compressed debug sections.
8868 * layout.cc (is_compressed_debug_section): New function.
8869 (Layout::output_section_name): Map compressed section names to
8870 canonical names.
8871 * layout.h (is_compressed_debug_section): New function.
8872 (is_debug_info_section): Recognize compressed debug sections.
8873 * merge.cc: Include compressed_output.h.
8874 (Output_merge_data::do_add_input_section): Handle compressed
8875 debug sections.
8876 (Output_merge_string::do_add_input_section): Handle compressed
8877 debug sections.
8878 * object.cc: Include compressed_output.h.
8879 (Sized_relobj::Sized_relobj): Initialize new data members.
8880 (build_compressed_section_map): New function.
8881 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
8882 * object.h (Object::section_is_compressed): New method.
8883 (Object::do_section_is_compressed): New method.
8884 (Sized_relobj::Compressed_section_map): New type.
8885 (Sized_relobj::do_section_is_compressed): New method.
8886 (Sized_relobj::compressed_sections_): New data member.
8887 * output.cc (Output_section::add_input_section): Handle compressed
8888 debug sections.
8889 * reloc.cc: Include compressed_output.h.
8890 (Sized_relobj::write_sections): Handle compressed debug sections.
8891
ce279a62
CC
88922010-07-08 Cary Coutant <ccoutant@google.com>
8893
8894 * resolve.cc (Symbol_table::resolve): Remember whether undef was
8895 weak when resolving to a dynamic def.
8896 (Symbol_table::should_override): Add adjust_dyndef flag; set it
8897 for weak undef/dynamic def cases. Adjust callers.
8898 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
8899 undef_binding_weak_.
8900 (Symbol_table::sized_write_globals): Adjust symbol binding.
8901 (Symbol_table::sized_write_symbol): Add binding parameter.
8902 * symtab.h (Symbol::set_undef_binding): New method.
8903 (Symbol::is_undef_binding_weak): New method.
8904 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
8905 (Symbol_table::should_override): Add new parameter.
8906 (Symbol_table::sized_write_symbol): Add new parameter.
8907
8908 * testsuite/weak_undef_file1.cc: Add new test case.
8909 * testsuite/weak_undef_file2.cc: Fix header comment.
8910 * testsuite/weak_undef_test.cc: Add new test case.
8911
b2286c10
DK
89122010-06-29 Doug Kwan <dougkwan@google.com>
8913
8914 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
8915 Initialize USE_SYMBOL_.
8916 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
8917 definition.
8918 (Arm_reloc_property::uses_symbol_): New data member declaration.
8919 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
8920 uses symbol value and symbol is undefined but not weakly undefined.
8921
4802450a
RÁE
89222010-06-28 Rafael Espindola <espindola@google.com>
8923
8924 * plugin.cc (Plugin::load): Use dlerror.
8925
e5ca47ba
ILT
89262010-06-26 Jeffrey Yaskin <jyasskin@google.com>
8927
8928 * symtab.cc (detect_odr_violations): When reporting an ODR
8929 violation, report an object where the symbol is defined.
8930
8a75a161
DK
89312010-06-25 Doug Kwan <dougkwan@google.com>
8932
8933 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
8934 (Target_arm::section_may_have_icf_unsafe_pointers): New method
8935 definition.
8936 (Target_arm::Scan::local_reloc_may_be_function_pointer,
8937 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
8938 target hook to detect function points.
8939 (Target_arm::Scan::possible_function_pointer_reloc): New method.
8940 * icf.h (Icf::check_section_for_function_pointers): Change type of
8941 parameter SECTION_NAME to const reference to std::string. Use
8942 target hook to determine if section may have unsafe pointers.
8943 * target.h (Target::section_may_have_icf_unsafe_pointers): New
8944 method definition.
8945
42218b9f
RÁE
89462010-06-21 Rafael Espindola <espindola@google.com>
8947
8948 * fileread.cc (Input_file::find_fie): New
8949 (Input_file::open): Use Input_file::find_fie.
8950 * fileread.h (Input_file::find_fie): New
8951 * plugin.cc (set_extra_library_path): New.
8952 (Plugin::load): Add set_extra_library_path to the transfer vector.
8953 (Plugin_manager::set_extra_library_path): New.
8954 (Plugin_manager::add_input_file): Use the extra search path if set.
8955 (set_extra_library_path(): New.
8956 * plugin.h (Plugin_manager): Add set_extra_library_path and
8957 extra_search_path_.
8958
a0506cca
CC
89592010-06-19 Cary Coutant <ccoutant@google.com>
8960
8961 * layout.cc (gdb_sections): Add .debug_types.
8962 (lines_only_debug_sections): Likewise.
8963
6508b958
RÁE
89642010-06-18 Rafael Espindola <espindola@google.com>
8965
8966 * plugin.cc (add_input_file,add_input_library)
8967 (Plugin_manager::add_input_file): Make filename arguments const.
8968 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
8969 const.
8970
3e235302
DK
89712010-06-16 Doug Kwan <dougkwan@google.com>
8972
8973 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
8974 .ARM.attributes section if we have not merged any input
8975 attributes sections.
8976
106e8a6c
DK
89772010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8978
8979 * arm.cc: Allow combining objects with no EABI version
8980 information.
8981
91ff43fe
RÁE
89822010-06-15 Rafael Espindola <espindola@google.com>
8983
8984 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
8985
68ed838c
ILT
89862010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8987
8988 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
8989 (struct iovec): Correct !HAVE_READV definition.
8990
f3a2388f
CC
89912010-06-10 Cary Coutant <ccoutant@google.com>
8992
8993 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
8994 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
8995 reloc sections.
8996 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
8997
8998 PR 11683
8999 * symtab.h (Symbol::is_placeholder): New member function.
9000 * target-reloc.h (relocate_section): Check for placeholder symbols.
9001
9002 * testsuite/Makefile.am (plugin_test_8): New test.
9003 (plugin_test_9): New test.
9004 * testsuite/Makefile.in: Regenerate.
9005
e1df38aa
NC
90062010-06-09 Nick Clifton <nickc@redhat.com>
9007
9008 * yyscript.y (input_list_element): Allow strings prefixed with
9009 the '-' character. Treat these as libraries.
9010 * script.cc (script_add_library): New function. Adds a library
9011 specified by "-l<name>" found in an input script.
9012 * script-c.h: Add prototype for script_add_library.
9013
25bbe950
DK
90142010-06-07 Doug Kwan <dougkwan@google.com>
9015
9016 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
9017 Restrict stub-group size to be within long conditional branch
9018 range when working around cortex-A8 erratum.
9019
0f32ea4c
ILT
90202010-06-07 Damien Diederen <dd@crosstwine.com>
9021
9022 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
9023 #ifdef typo.
9024
8fe2a369
ST
90252010-06-03 Sriraman Tallam <tmsriram@google.com>
9026
9027 PR gold/11658
9028 * output.cc
9029 (Output_section::Input_section_sort_entry::compare_section_ordering):
9030 Change to return non-zero correctly.
9031 (Output_section::Input_section_sort_section_order_index_compare
9032 ::operator()): Change to fix ambiguity in comparisons.
9033
6e9ba2ca
ST
90342010-06-01 Sriraman Tallam <tmsriram@google.com>
9035
9036 * gold.h (is_wildcard_string): New function.
9037 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
9038 (Layout::layout_eh_frame): Ditto.
9039 (Layout::find_section_order_index): New method.
9040 (Layout::read_layout_from_file): New method.
9041 * layout.h (Layout::find_section_order_index): New method.
9042 (Layout::read_layout_from_file): New method.
9043 (Layout::input_section_position_): New private member.
9044 (Layout::input_section_glob_): New private member.
9045 * main.cc (main): Call read_layout_from_file here.
9046 * options.h (--section-ordering-file): New option.
9047 * output.cc (Output_section::input_section_order_specified_): New
9048 member.
9049 (Output_section::Output_section): Initialize new member.
9050 (Output_section::add_input_section): Add new parameter.
9051 Keep input sections when --section-ordering-file is used.
9052 (Output_section::set_final_data_size): Sort input sections when
9053 section ordering file is specified.
9054 (Output_section::Input_section_sort_entry): Add new parameter.
9055 Check sorting type.
9056 (Output_section::Input_section_sort_entry::compare_section_ordering):
9057 New method.
9058 (Output_section::Input_section_sort_compare::operator()): Change to
9059 consider section_order_index.
9060 (Output_section::Input_section_sort_init_fini_compare::operator()):
9061 Change to consider section_order_index.
9062 (Output_section::Input_section_sort_section_order_index_compare
9063 ::operator()): New method.
9064 (Output_section::sort_attached_input_sections): Change to sort
9065 according to section order when specified.
e1df38aa
NC
9066 (Output_section::add_input_section<32, true>): Add new parameter.
9067 (Output_section::add_input_section<64, true>): Add new parameter.
9068 (Output_section::add_input_section<32, false>): Add new parameter.
9069 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
9070 * output.h (Output_section::add_input_section): Add new parameter.
9071 (Output_section::input_section_order_specified): New
9072 method.
9073 (Output_section::set_input_section_order_specified): New method.
9074 (Input_section::Input_section): Initialize section_order_index_.
9075 (Input_section::section_order_index): New method.
9076 (Input_section::set_section_order_index): New method.
9077 (Input_section::section_order_index_): New member.
9078 (Input_section::Input_section_sort_section_order_index_compare): New
9079 struct.
9080 (Output_section::input_section_order_specified_): New member.
9081 * script-sections.cc (is_wildcard_string): Delete and move modified
9082 method to gold.h.
9083 (Output_section_element_input::Output_section_element_input): Modify
9084 call to is_wildcard_string.
9085 (Output_section_element_input::Input_section_pattern
9086 ::Input_section_pattern): Ditto.
9087 (Output_section_element_input::Output_section_element_input): Ditto.
9088 * testsuite/Makefile.am (final_layout): New test case.
9089 * testsuite/Makefile.in: Regenerate.
9090 * testsuite/final_layout.cc: New file.
9091 * testsuite/final_layout.sh: New file.
9092
3537c84b
RÁE
90932010-06-01 Rafael Espindola <espindola@google.com>
9094
9095 * plugin.cc (Plugin::load): Pass the output name to the plugin.
9096
105b6afd
RÁE
90972010-06-01 Rafael Espindola <espindola@google.com>
9098
9099 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
9100 visibility of symbols.
9101
29e11421
DK
91022010-05-27 Doug Kwan <dougkwan@google.com>
9103
9104 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
9105 from start of output section instead of address for a local symbol
9106 in a merged or relaxed section when doing a relocatable link.
9107
5e0f337e
RÁE
91082010-05-26 Rafael Espindola <espindola@google.com>
9109
703d02da 9110 PR 11604
5e0f337e
RÁE
9111 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
9112 adding sections the garbage collector removed.
9113 * gold/testsuite/Makefile.am: Add test.
9114 * gold/testsuite/Makefile.in: Regenerate.
9115 * gold/testsuite/plugin_test_7.sh: New.
9116 * gold/testsuite/plugin_test_7_1.c: New.
9117 * gold/testsuite/plugin_test_7_2.c: New.
9118
f4187277
RÁE
91192010-05-26 Rafael Espindola <espindola@google.com>
9120
9121 * script-sections.cc (Output_section_definition::set_section_addresses):
9122 Check for --section-start.
9123
5c388529
DK
91242010-05-26 Doug Kwan <dougkwan@google.com>
9125
9126 * arm.cc (Arm_scan_relocatable_relocs): New class.
9127 (Target_arm::relocate_special_relocatable): New method.
9128 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
9129 (Arm_relocate_functions::thumb_branch_common): Same.
9130 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
9131 instead of Default_scan_relocatable_relocs.
9132 * target-reloc.h (relocate_for_relocatable): Let target handle
9133 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
9134 * target.h (Sized_target::relocate_special_relocatable): New method.
9135
bca1c3ae
ILT
91362010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9137
9138 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
9139
0439c796
DK
91402010-05-23 Doug Kwan <dougkwan@google.com>
9141
9142 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
9143 instead of a cast.
9144 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
9145 with a direct branch, not a conditional branch, to a stub.
9146 * merge.cc (Output_merge_base::record_input_section): New method
9147 defintion.
9148 (Output_merge_data::do_add_input_section): Record input section if
9149 keeps-input-sections flag is set.
9150 (Output_merge_string::do_add_input_section): Ditto.
9151 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
9152 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
9153 INPUT_SECTIONS_.
9154 (Output_merge_base::keeps_input_sections,
9155 Output_merge_base::set_keeps_input_sections,
9156 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
9157 method definitions.
9158 (Output_merge_base::Input_sections): New type declaration.
9159 (Output_merge_base::input_sections_begin,
9160 Output_merge_base::input_sections_end,
9161 Output_merge_base::do_set_keeps_input_sections): New method definitions.
9162 (Output_merge_base::bool keeps_input_sections_,
9163 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
9164 Output_merge_base::input_sections_): New data members.
9165 (Output_merge_data::do_set_keeps_input_sections): New method
9166 defintion.
9167 (Output_merge_string::do_set_keeps_input_sections): Ditto.
9168 * output.cc (Output_section::Input_section::relobj): Move method
9169 defintion from class declaration to here and handle merge sections.
9170 (Output_section::Input_section::shndx): Ditto.
9171 (Output_section::Output_section): Remove initializations of removed
9172 data members and initialize new data member LOOKUP_MAPS_.
9173 (Output_section::add_input_section): Set keeps-input-sections flag
9174 for a newly created merge output section as appropriate. Adjust code
9175 to use Output_section_lookup_maps class.
9176 (Output_section::add_relaxed_input_section): Adjst code for lookup
9177 maps code refactoring.
2e702c99 9178 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
9179 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
9180 class. If adding input section to a newly created merge output
9181 section fails, remove the new merge section.
9182 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 9183 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 9184 (Output_section::find_merge_section): Ditto.
0439c796 9185 (Output_section::build_lookup_maps): New method defintion.
2e702c99 9186 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
9187 Output_section_lookup_maps class.
9188 (Output_section::get_input_sections): Export merge sections. Adjust
9189 code to use Output_section_lookup_maps class.
9190 (Output_section:::add_script_input_section): Adjust code to use
9191 Output_section_lookup_maps class. Update lookup maps for merge
9192 sections also.
9193 (Output_section::discard_states): Use Output_section_lookup_maps.
9194 (Output_section::restore_states): Same.
9195 * output.h (Merge_section_properties): Move class defintion out of
9196 Output_section.
9197 (Output_section_lookup_maps): New class.
9198 (Output_section::Input_section::is_merge_section): New method
9199 defintion.
9200 (Output_section::Input_section::relobj): Move defintion out of class
9201 defintion. Declare method only.
9202 (Output_section::Input_section::shndx): Ditto.
9203 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 9204 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
9205 (Output_section::Merge_section_by_properties_map,
9206 Output_section::Output_section_data_by_input_section_map,
9207 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
9208 Remove types.
2e702c99 9209 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
9210 KEEPS_INPUT_SECTIONS.
9211 (Output_section::build_lookup_maps): New method declaration.
9212 (Output_section::merge_section_map_,
9213 Output_section::merge_section_by_properties_map_,
9214 Output_section::relaxed_input_section_map_,
9215 Output_section::is_relaxed_input_section_map_valid_): Remove data
9216 members.
9217 (Output_section::lookup_maps_): New data member.
9218
76295588
L
92192010-05-21 Doug Kwan <dougkwan@google.com>
9220
9221 PR gold/11619
9222 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
9223 avoid a compilation error.
9224
d103a984
RÁE
92252010-05-19 Rafael Espindola <espindola@google.com>
9226
9227 * script-sections.cc (Output_section_definition::allocate_to_segment):
9228 Update the phdrs_list even when the output section is NULL.
9229 * testsuite/Makefile.am: Add test.
9230 * testsuite/Makefile.in: Regenerate.
9231 * testsuite/script_test_9.cc: New.
9232 * testsuite/script_test_9.sh: New.
9233 * testsuite/script_test_9.t: New.
9234
6625d24e
DK
92352010-05-19 Doug Kwan <dougkwan@google.com>
9236
9237 * arm.cc (Arm_input_section::original_size): New method.
9238 (Arm_input_section::do_addralign): Add a cast.
9239 (Arm_input_section::do_output_offset): Remove static cast.
9240 (Arm_input_section::original_addralign,
9241 Arm_input_section::original_size_): Change type to uint32_t.
9242 (Arm_input_section::init): Add safe casts for section alignment
9243 and size.
9244 (Arm_input_section::set_final_data_size): Do not set address and
9245 offset of stub table.
9246 (Arm_output_section::fix_exidx_coverage): Change use of of
9247 Output_section::Simple_input_section to that of
9248 Output_section::Input_section.
9249 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
9250 except for the first pass.
9251 * output.cc (Output_section::get_input_sections): Change type of
9252 input_sections to std::list<Input_section>.
9253 (Output_section::add_script_input_section): Rename from
9254 Output_section::add_simple_input_section. Change type of SIS
9255 parameter from Simple_input_section to Input_section.
9256 * output.h (Output_section::Simple_input_section): Remove class.
9257 (Output_section::Input_section): Change class visibility to public.
9258 (Output_section::Input_section::addralign): Use stored alignments
9259 for special input sections if set.
9260 (Output_section::Input_section::set_addralign): New method.
9261 (Output_section::get_input_sections): Change parameter type from
9262 list of Simple_input_section to list of Input_section.
9263 (Output_section::add_script_input_section): Rename from
9264 Output_section::add_simple_input_section. Change first parameter's
9265 type from Simple_input_section to Input_section and remove the
9266 second and third parameters.
9267 * script-sections.cc (Input_section::Input_section_list): Change
9268 type to list of Output_section::Input_section/
9269 (Input_section_info::Input_section_info): Change parameter type of
9270 INPUT_SECTION to Output_section::Input_section.
9271 (Input_section_info::input_section): Change return type.
9272 (Input_section_info::input_section_): Change type to
9273 Output_section::Input_section.
9274 (Output_section_element_input::set_section_addresses): Adjust code
9275 to use Output_section::Input_section instead of
9276 Output_section::Simple_input_section. Adjust code for renaming
9277 of Output_section::add_simple_input_section.
9278 (Orphan_output_section::set_section_addresses): Ditto.
9279
e1e82ea4
RW
92802010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9281
9282 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
9283 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
9284
91e75c8a
RÁE
92852010-05-18 Rafael Espindola <espindola@google.com>
9286
9287 * options.cc (General_options::finalize): Handle -nostdlib.
9288 * options.h (nostdlib): New option.
9289 * script.cc (script_add_search_dir): Handle -nostdlib.
9290
da59ad79
DK
92912010-05-12 Doug Kwan <dougkwan@google.com>
9292
9293 * arm.cc (Target_arm::do_finalize_sections): Create an empty
9294 attributes section only if there no attributes section after merging.
9295 (Target_arm::merge_object_attributes): Move value of
e1df38aa 9296 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
9297 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
9298 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
9299 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
9300 and arm_attr_merge_7.stdout.
9301 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
9302 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
9303 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
9304 arm_attr_merge_7b.o): New rules.
9305 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
9306 arm_attr_merge_7
9307 * testsuite/Makefile.in: Regenerate.
9308 * testsuite/arm_attr_merge.sh: New file.
9309 * testsuite/arm_attr_merge_[67][ab].s: Same.
9310
3e01a7fd
NC
93112010-05-05 Nick Clifton <nickc@redhat.com>
9312
9313 * po/es.po: Updated Spanish translation.
9314
7ad2014a
L
93152010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9316
9317 * Makefile.am (install-exec-local): Properly install gold as
9318 default cross linker.
9319 * Makefile.in: Regenerated.
9320
4fda8867
NC
93212010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9322 Nick Clifton <nickc@redhat.com>
9323
9324 * configure.ac (install_as_default): Define and set to false
9325 unless --enable-gold or --enable-gold=both/gold has been
9326 specified.
9327 * configure: Regenerate.
9328
9329 * Makefile.am (install-exec-local): Install the executable as
9330 'ld.gold'. If install_as_default is true then also install it as
9331 'ld'.
9332 * Makefile.in: Regenerated.
9333
bd288ea2
ILT
93342010-04-24 Ian Lance Taylor <iant@google.com>
9335
9336 * layout.cc (Layout::layout_reloc): In relocatable link don't
9337 combine reloc sections for grouped sections.
9338
ef38fd8a
ST
93392010-04-23 Sriraman Tallam <tmsriram@google.com>
9340
9341 * gc.h (gc_process_relocs): Pass information on relocs pointing to
9342 sections that are not ordinary to icf.
9343 * icf.cc (get_section_contents): Handle relocation pointing to section
9344 with no object or shndx information.
9345 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
9346 * testsuite/Makefile.in: Regenerate.
9347 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
9348 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
9349
f6973bdc
ILT
93502010-04-22 Ian Lance Taylor <iant@google.com>
9351
9352 * expression.cc (Expression::Expression_eval_info): Add
9353 result_alignment_pointer field.
9354 (Expression::eval_with_dot): Add result_alignment_pointer
9355 parameter. Change all callers.
9356 (Expression::eval_maybe_dot): Likewise.
9357 (class Binary_expression): Add alignment_pointer parameter to
9358 left_value and right_value. Change all callers.
9359 (BINARY_EXPRESSION): Set result alignment.
9360 (class Trinary_expression): Add alignment_pointer parameter to
9361 arg2_value and arg3_value. Change all callers.
9362 (Trinary_cond::value): Set result alignment.
9363 (Max_expression::value, Min_expression::value): Likewise.
9364 (Align_expression::value): Likewise.
9365 * script-sections.cc (class Sections_element): Add dot_alignment
9366 parameter to set_section_addresses virtual function. Update
9367 instantiations.
9368 (class Output_section_element): Likewise.
9369 (Script_sections::create_segments): Add dot_alignment parameter.
9370 Change all callers.
9371 (Script_sections::create_segments_from_phdrs_clause): Likewise.
9372 (Script_sections::set_phdrs_clause_addresses): Likewise.
9373 * script-sections.h: Update declarations.
9374 * script.h: Update declarations.
9375 * output.h (Output_segment::set_minimum_p_align): Don't decrease
9376 min_p_align.
9377 * testsuite/script_test_3.t: Set large alignment.
9378 * testsuite/script_test_3.sh: Make sure that at least one LOAD
9379 segment has expected alignment.
9380
9c9c98a5
NC
93812010-04-22 Nick Clifton <nickc@redhat.com>
9382
9383 * po/gold.pot: Updated by the Translation project.
9384 * po/vi.po: Updated Vietnamese translation.
9385
2253bfba
L
93862010-04-22 H.J. Lu <hongjiu.lu@intel.com>
9387
9388 * testsuite/Makefile.am (check_PROGRAMS): Add
9389 icf_virtual_function_folding_test.
9390 * testsuite/Makefile.in: Regenerated.
9391
85fdf906
AH
93922010-04-15 Andrew Haley <aph@redhat.com>
9393
9394 * options.h (merge_exidx_entries): New option.
9395 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
9396 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
9397 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
9398 (Target_arm::merge_exidx_entries): New function.
9399 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
9400 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
9401 to Arm_exidx_fixup constructor.
9402 Add new arg, merge_exidx_entries.
9403 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
9404 Arm_output_section::fix_exidx_coverage.
9405
ce97fa81
ST
94062010-04-18 Sriraman Tallam <tmsriram@google.com>
9407
9408 * icf.cc (get_section_contents): Check for preemptible functions.
9409 Ignore addend when appropriate.
9410 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
9411 section folded.
9412 (add_from_relobj): Check for section folded.
9413 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
9414 * symtab.h (should_add_dynsym_entry): Add new parameter.
9415 * target-reloc.h (scan_relocs): Check for section folded.
9416 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
9417 Check reloc types for function pointers in shared objects.
9418 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
9419 case.
9420 (icf_preemptible_functions_test): New test case.
9421 (icf_string_merge_test): New test case.
9422 * testsuite.Makefile.in: Regenerate.
9423 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
9424 bar_glob. Refactor code.
9425 * testsuite/icf_preemptible_functions_test.cc: New file.
9426 * testsuite/icf_preemptible_functions_test.sh: New file.
9427 * testsuite/icf_string_merge_test.cc: New file.
9428 * testsuite/icf_string_merge_test.sh: New file.
9429 * testsuite/icf_virtual_function_folding_test.cc: New file.
9430 * testsuite/icf_virtual_function_folding_test.sh: New file.
9431
04ceb17c
DK
94322010-04-14 Doug Kwan <dougkwan@google.com>
9433
9434 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
9435 for local symbol recounting if we remove a section due to ICF.
9436 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
9437 there are no regular objects in input.
9438
153e7da4
DK
94392010-04-13 Doug Kwan <dougkwan@google.com>
9440
9441 * arm.cc (Arm_input_section::set_final_data_size): Compute
9442 accurate final data size instead of using current data size.
9443
4dbd9faf
DK
94442010-04-09 Doug Kwan <dougkwan@google.com>
9445
9446 * layout.cc (Layout::choose_output_section): Handle script section
9447 types.
9448 (Layout::make_output_section_for_script): Add section type parameter.
9449 Handle script section types.
9450 * layout.h (Layout::make_output_section_for_script): Add section
9451 type parameter.
9452 * output.cc (Output_section::Output_section): Initialize data member
9453 is_noload_.
9454 (Output_section::do_reset_address_and_file_offset): Do not set address
9455 to 0 if section is a NOLOAD section.
9456 * output.h (Output_section::is_noload): New method.
9457 (Output_section::set_is_noload): Ditto.
9458 (Output_section::is_noload_): New data member.
9459 * script-c.h (Script_section_type): New enum type.
9460 (struct Parser_output_section_header): Add new file section_type.
9461 * script-sections.cc (Sections_element::output_section_name): Add
9462 parameter for returning script section type.
9463 (Output_section_definition::output_section_name): Ditto.
9464 (Output_section_definition::section_type)P; New method.
9465 (Output_section_definiton::script_section_type_name): Ditto.
9466 (Output_section_definition::script_section_type_): New data member.
9467 (Output_section_definition::Output_section_definition): Initialize
9468 data member Output_section_definition::script_section_type_.
9469 (Output_section_definition::create_sections): Pass script section type
9470 to Layout::make_output_section_for_script.
9471 (Output_section_definition::output_section_name): Return script
9472 section type to caller.
9473 (Output_section_definition::set_section_address): Do not advance
9474 dot value and load address if section type is NOLOAD. Set address
9475 of NOLOAD sections regardless of section flags.
9476 (Output_section_definition::print): Print section type if it is
9477 not SCRIPT_SECTION_TYPE_NONE.
9478 (Output_section_definition::section_type): New method.
9479 (Output_section_definition::script_section_type_name): Ditto.
9480 (Script_sections::output_section_name): Add new parameter
9481 PSECTION_TYPE for returning script section type. Pass it to
9482 section elements. Handle discard sections.
9483 (Sort_output_sections::operator()): Handle NOLOAD sections.
9484 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 9485 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
9486 returning script section type.
9487 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
9488 INFO and NOLOAD.
9489 * yyscript.y (union): Add new field SECTION_TYPE.
9490 (COPY, DSECT, INFO, NOLOAD): New tokens.
9491 (opt_address_and_section_type): Change type to output_section_header.
9492 (section_type): New non-terminal
9493 (section_header): Handle section type.
2253bfba 9494 (opt_address_and_section_type): Return section type value.
4dbd9faf 9495
721ea635
L
94962010-04-09 H.J. Lu <hongjiu.lu@intel.com>
9497
9498 * testsuite/plugin_common_test_1.c (foo): Add prototype.
9499 * testsuite/plugin_common_test_2.c (foo): Likewise.
9500
6bf924b0
DK
95012010-04-08 Doug Kwan <dougkwan@google.com>
9502
9503 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
9504 Output_merge_data.
9505 * output.cc (Output_section::add_merge_input_section): Simplify
9506 code and return status of Output_merge_base::add_input_section.
e1df38aa 9507 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
9508 returns true.
9509
24af6f92
DK
95102010-04-07 Doug Kwan <dougkwan@google.com>
9511
9512 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
9513 if section is marked as containing instructions but has no mapping
9514 symbols.
9515 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
9516 correct section index.
9517 (Arm_relobj::find_linked_text_section): Ditto.
9518
00698fc5
CC
95192010-04-07 Cary Coutant <ccoutant@google.com>
9520
9521 * archive.cc (include_member): Destroy Read_symbols_data object before
9522 releasing file.
9523 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
9524 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
9525 (Read_symbols_data::~Read_symbols_data) New destructor.
9526 (Section_relocs::Section_relocs) New constructor.
9527 (Section_relocs::~Section_relocs) New destructor.
9528 (Read_relocs_data::Read_relocs_data) New constructor.
9529 (Read_relocs_data::~Read_relocs_data) New destructor.
9530 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
9531 pointers to NULL after deleting.
9532
7296d933
DK
95332010-04-07 Doug Kwan <dougkwan@google.com>
9534
9535 * arm.cc: Replace "endianity" with "endianness" in comments.
9536 (Arm_exidx_cantunwind): Ditto.
9537 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
9538 (Arm_relobj::merge_flags_and_attributes): New method.
9539 (Arm_relobj::merge_flags_and_attributes_): New data member.
9540 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
9541 (Arm_relobj::scan_sections_for_stubs): Ditto.
9542 (Arm_relobj::do_read_symbols): Check to see if we really want to
9543 merge processor-specific flags and attributes. Exit early if
9544 an object is empty except for section names and the undefined symbol.
9545 (Target_arm::do_finalize_sections): Move check for ELF format to
9546 Arm_relobj::do_read_symbols. Merge processor specific flags and
9547 attributes from a regular object only when we have determined that
9548 it is aapropriate. Do not create an .ARM.attributes section in
9549 output if there is no regular input object.
9550 (Target_arm::merge_processor_specific_flags): Check
9551 --warn-mismatch before printing any error.
9552 (Target_arm::merge_object_attributes): Ditto.
9553 * gold.cc (queue_middle_tasks): Handle the case in which there is
9554 no regular object in input.
9555 * options.cc (General_options::parse_EB): New method.
9556 (General_options::parse_EL): Same.
9557 (General_options::General_options): Initialize endianness_.
9558 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
9559 New options.
9560 (General_options::Endianness): New enum.
9561 (General_options::endianness): New method.
9562 (General_options::endianness_): New data member.
9563 * parameters.cc (Parameters::set_options): Check target endianness.
9564 (Parameters::set_target_once): Ditto.
9565 (Parameters::check_target_endianness): New method.
9566 (parameters_force_valid_target): If either -EL or -EB is specified,
9567 use it to define endianness of default target.
9568 * parameters.h (Parameters::check_target_endianness): New method
9569 declaration.
9570 * target.h (class Target): Change "endianity" to "endianness"
9571 in comments.
9572
efc8d4f2
RW
95732010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9574
9575 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
9576 * configure: Regenerate.
9577 * Makefile.in: Regenerate.
9578 * testsuite/Makefile.in: Regenerate.
9579
be234d88
CC
95802010-04-06 Cary Coutant <ccoutant@google.com>
9581
9582 gcc PR lto/42757
9583 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
9584 prevailing definitions of common symbols.
9585 * testsuite/plugin_test_6.sh: New test case.
9586 * testsuite/plugin_common_test_1.c: New test case.
9587 * testsuite/plugin_common_test_2.c: New test case.
9588 * testsuite/Makefile.am (plugin_test_6): New test case.
9589 * testsuite/Makefile.in: Regenerate.
9590
bd32c6bd
NC
95912010-04-06 Nick Clifton <nickc@redhat.com>
9592
9593 * po/vi.po: New Vietnamese translation.
9594
323c532f
DK
95952010-03-30 Doug Kwan <dougkwan@google.com>
9596
9597 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
9598
4fcd97eb
DK
95992010-03-25 Doug Kwan <dougkwan@google.com>
9600
9601 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
9602 to avoid a conversion warning on a 32-bit host.
9603
4ebf39db
ILT
96042010-03-24 Ian Lance Taylor <iant@google.com>
9605
9606 * testsuite/script_test_3.t: Add a TLS segment.
9607 * testsuite/Makefile.am (check_PROGRAMS): Add
9608 tls_phdrs_script_test.
9609 (tls_phdrs_script_test_SOURCES): Define.
9610 (tls_phdrs_script_test_DEPENDENCIES): Define.
9611 (tls_phdrs_script_test_LDFLAGS): Define.
9612 (tls_phdrs_script_test_LDADD): Define.
9613 * testsuite/Makefile.in: Rebuild.
9614
4a599bdd
CC
96152010-03-23 Cary Coutant <ccoutant@google.com>
9616
9617 * fileread.cc (find_or_make_view): Fix comment.
9618
6c93b22c
ILT
96192010-03-23 Ian Lance Taylor <iant@google.com>
9620
9621 * script-sections.cc (class Orphan_section_placement): Define
9622 PLACE_TLS and PLACE_TLS_BSS.
9623 (Orphan_section_placement::Orphan_section_placement): Initialize
9624 new places.
9625 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
9626 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
9627 (tls_script_test_SOURCES): Define.
9628 (tls_script_test_DEPENDENCIES): Define.
9629 (tls_script_test_LDFLAGS): Define.
9630 (tls_script_test_LDADD): Define.
9631 * testsuite/Makefile.in: Rebuild.
9632
a2c7281b
DK
96332010-03-22 Doug Kwan <dougkwan@google.com>
9634
9635 * arm.cc (Arm_relocate_functions::abs8,
9636 Arm_relocate_functions::abs16): Use correct check for overflow
9637 specified in the ARM ELF specs.
9638 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
9639 target of a BLX instruction specially.
9640 (Reloc_stub::stub_type_for_reloc): Ditto.
9641 (Relocate::relocate): Use symbolic names instead of numeric relocation
9642 codes to report error.
9643 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
9644 workaround.
9645 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
9646 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
9647 thumb2_blx_out_of_range.stdout
9648 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
9649 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
9650 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
9651 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
9652 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
9653 thumb2_blx_in_range, thumb2_blx_in_range.o,
9654 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
9655 thumb2_blx_out_of_range.o): New rules.
2e702c99 9656 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
9657 thumb2_blx_in_range and thumb2_blx_out_of_range.
9658 * testsuite/Makefile.in: Regenerate.
9659 * arm_branch_in_range.sh: Add tests for THUMB BLX.
9660 * testsuite/thumb_blx_in_range.s: New file.
9661 * testsuite/thumb_blx_out_of_range.s: New file.
9662
b0193076
RÁE
96632010-03-22 Rafael Espindola <espindola@google.com>
9664
9665 * archive.cc (Should_include): Move to archive.h.
9666 (should_include_member): Make it a member of Archive.
9667 (Lib_group): New.
9668 (Add_lib_group_symbols): New.
9669 * archive.h: Include options.h.
9670 (Archive_member): Moved from Archive.
9671 (Should_include): Moved from archive.cc.
9672 (Lib_group): New.
9673 (Add_lib_group_symbols): New.
9674 * dynobj.cc (do_should_include_member): New.
9675 * dynobj.h (do_should_include_member): New.
9676 * gold.cc (queue_initial_tasks): Update call to queue.
9677 * main.cc (main): Print lib group stats.
9678 * object.cc (do_should_include_member): New.
9679 * object.h: Include archive.h.
9680 (Object::should_include_member): New.
9681 (Object::do_should_include_member): New.
9682 (Sized_relobj::do_should_include_member): New.
9683 * options.cc (General_options::parse_start_lib): New.
9684 (General_options::parse_end_lib): New.
9685 (Input_arguments::add_file): Handle lib groups.
9686 (Input_arguments::start_group): Check we are not in a lib.
9687 (Input_arguments::start_lib): New.
9688 (Input_arguments::end_lib): New.
9689 * options.h (General_options): Add start_lib and end_lib.
9690 (Input_argument::lib_): New.
9691 (Input_argument::lib): New.
9692 (Input_argument::is_lib): New.
9693 (Input_file_lib): New.
9694 (Input_arguments::in_lib_): New.
9695 (Input_arguments::in_lib): New.
9696 (Input_arguments::start_lib): New.
9697 (Input_arguments::end_lib_): New.
9698 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
9699 in unused members as preempted.
9700 (Sized_pluginobj::do_should_include_member): New.
9701 * plugin.h (Sized_pluginobj::do_should_include_member): New.
9702 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
9703 return the blocker.
9704 (Read_symbols::do_whole_lib_group): New.
9705 (Read_symbols::do_lib_group): New.
9706 (Read_symbols::do_read_symbols): Handle lib groups.
9707 (Read_symbols::get_name): Handle lib groups.
9708 * readsyms.h (Read_symbols): Add an archive member pointer.
9709 (Read_symbols::do_whole_lib_group): New.
9710 (Read_symbols::do_lib_group): New.
9711 (Read_symbols::member_): New.
9712 * script.cc (read_input_script): Update call to queue_soon.
9713
d099120c
DK
97142010-03-19 Doug Kwan <dougkwan@google.com>
9715
9716 * arm.cc (Stub_table::Stub_table): Initialize new data members
9717 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9718 (Stub_table::add_reloc_stub): Assign stub offset and update
9719 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9720 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
9721 New data members.
2e702c99 9722 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
9723 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
9724 instead of going over all reloc stubs.
2e702c99 9725 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
9726 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9727 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 9728 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
9729 Stringpool_template::offset_.
9730 * stringpool.h (Stringpool_template::set_no_zero_null): Set
9731 Stringpool_template::offset_ to zero.
9732
1aa37384
DK
97332010-03-15 Doug Kwan <dougkwan@google.com>
9734
9735 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9736 offset_.
9737 (Stringpool_template::new_key_offset): New method.
9738 (Stringpool_template::add_string): Assign offsets when adding new
9739 strings.
9740 (Stringpool_template::set_string_offsets): Do not set string offsets
9741 when not optimizing.
9742 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
9743 member size_.
2e702c99
RM
9744 (Chunked_vector::clear): Clear size_.
9745 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
9746 (Chunked_vector::size): Return size_.
9747 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 9748 (Chunked_vector::size_): New data member.
1aa37384
DK
9749 (Stringpool_template::set_no_zero_null): Assert string set is empty.
9750 (Stringpool_template::new_key_offset): New method declaration.
9751 (Stringpool_template::offset_): New data member.
9752
b672b057
RÁE
97532010-03-15 Rafael Espindola <espindola@google.com>
9754
9755 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
9756 Add_symbols' constructor.
9757 * readsyms.h (Add_symbols): Remove the input_group member.
9758
b6848d3c
ILT
97592010-03-10 Ian Lance Taylor <iant@google.com>
9760
9761 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
9762 target to ask whether a reference to a symbol requires a stack
9763 split.
9764 * target.h (Target::is_call_to_non_split): New function.
9765 (Target::do_is_call_to_non_split): Declare virtual function.
9766 * target.cc: Include "symtab.h".
9767 (Target::do_is_call_to_non_split): New function.
9768 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
9769
a2a5469e
CC
97702010-03-10 Cary Coutant <ccoutant@google.com>
9771
9772 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
9773 (File_read::open[1]): Remove initial mapping of whole_file_view_.
9774 (File_read::open[2]): Add whole_file_view_ to list of views.
9775 (File_read::make_view): Remove test of whole_file_view_.
9776 (File_read::find_or_make_view): Create whole_file_view_ if
9777 necessary.
9778 (File_read::clear_views): Replace bool parameter with enum;
9779 adjust all callers. Don't delete views with permanent data;
9780 do delete cached views and views from archives if
9781 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
9782 if clearing the corresponding view.
9783 * fileread.h (File_read::Clear_views_mode): New enum.
9784 (File_read::View::is_permanent_view): New method.
9785 (File_read::clear_views): Replace bool parameter
9786 with enum; adjust all callers.
9787 * options.h (General_options): Change keep_files_mapped option;
9788 add map_whole_files.
9789 * readsyms.cc (Add_symbols::run): Delete sd_ object before
9790 releasing the file.
9791 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
9792 the file.
9793
8861f32b
DM
97942010-03-10 David S. Miller <davem@davemloft.net>
9795
9796 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
9797
d62d0f5f
ST
97982010-03-09 Sriraman Tallam <tmsriram@google.com>
9799
9800 * icf.cc (get_section_contents): Add '@' marker after processing the
9801 merge reloc.
9802
9177756d
DK
98032010-03-08 Doug Kwan <dougkwan@google.com>
9804
9805 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
9806 due to a conversion warning.
9807 (Arm_relobj::update_output_local_symbol_count): Check for local
9808 symbol with unset output index.
9809
9e9e071b
ILT
98102010-03-05 Ian Lance Taylor <iant@google.com>
9811
9812 * options.h (class General_options): Add --spare-dynamic-tags.
9813 * output.cc (Output_data_dynamic::set_final_data_size): Implement
9814 --spare-dynamic-tags.
9815
a81ee015
ILT
98162010-03-05 Ian Lance Taylor <iant@google.com>
9817
9818 * incremental.cc: Include "libiberty.h".
9819
44ec90b9
RO
98202010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
9821
9822 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
9823 function, is_info_ member.
9824 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
9825 (Versions::Versions): Update caller.
9826 (Versions::define_base_version): Likewise.
9827 (Versions::add_def): Likewise.
9828
0897ed3b
ST
98292010-03-03 Sriraman Tallam <tmsriram@google.com>
9830
9831 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
9832 (Scan::possible_function_pointer_reloc): New function.
9833 (Scan::local_reloc_may_be_function_pointer): Change to call
9834 possible_function_pointer_reloc.
9835 (Scan::global_reloc_may_be_function_pointer): Ditto.
9836 * icf.h (Icf::check_section_for_function_pointers): Change to reject
9837 relocations in ".data.rel.ro._ZTV" section.
9838 * testsuite/icf_safe_so_test.sh: Change to pass i386.
9839 * testsuite/icf_safe_so_test.cc: Ditto.
9840 * testsuite/icf_safe_test.cc: Ditto.
9841 * testsuite/icf_safe_test.sh: Ditto.
9842
d3bbad62
ILT
98432010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9844 Ian Lance Taylor <iant@google.com>
9845
9846 * target-reloc.h (relocate_section): Check the symbol table index
9847 for -1U before setting the local symbol index.
9848 (scan_relocatable_relocs): If copying the relocation, record that
9849 the local symbol is required.
9850 * object.h (Symbol_value::is_output_symtab_index_set): New
9851 function.
9852 (Symbol_value::may_be_discarded_from_output_symtab): New
9853 function.
9854 (Symbol_value::has_output_symtab_entry): New function.
9855 (Symbol_value::needs_output_symtab_entry): Remove.
9856 (Symbol_value::output_symtab_index): Make sure the symbol index is
9857 set.
9858 (Symbol_value::set_output_symtab_index): Make sure the symbol
9859 index is not set. Make sure the new index is valid.
9860 (Symbol_value::set_must_have_output_symtab_entry): New function.
9861 (Symbol_value::has_output_dynsym_entry): New function.
9862 (Symbol_value::set_output_dynsym_index): Make sure the new index
9863 is valid.
9864 (Sized_relobj::set_must_have_output_symtab_entry): New function.
9865 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
9866 local symbol if permitted.
9867 (Sized_relobj::do_finalize_local_symbols): Call
9868 is_output_symtab_index_set rather than needs_output_symtab_entry.
9869 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
9870 rather than needs_output_symtab_entry. Call
9871 has_output_dynsym_entry rather than needs_output_dynsym_entry.
9872 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
9873 is_output_symtab_index_set rather than needs_output_symtab_entry.
9874 * testsuite/discard_locals_relocatable_test.c: New file.
9875 * testsuite/discard_locals_test.sh: Test -r.
9876 * testsuite/Makefile.am (check_DATA): Add
9877 discard_locals_relocatable_test1.syms,
9878 discard_local_relocatable_test2.syms.
9879 (MOSTLYCLEANFILES): Likewise. Also add
9880 discard_locals_relocatable_test1.lout and
9881 discard_locals_relocatable_test2.out.
9882 (discard_locals_relocatable_test1.syms): New target.
9883 (discard_locals_relocatable_test.o): New target.
9884 (discard_locals_relocatable_test1.out): New target.
9885 (discard_locals_relocatable_test2.syms): New target.
9886 (discard_locals_relocatable_test2.out): New target.
9887 (various): Add missing ../ld-new dependencies.
9888 * testsuite/Makefile.in: Rebuild.
9889
7e8ccf26
NC
98902010-03-03 Nick Clifton <nickc@redhat.com>
9891
9892 * po/fi.po: New Finnish translation.
9893
2a0ff005
DK
98942010-03-01 Doug Kwan <dougkwan@google.com>
9895
9896 * layout.cc (Layout::Layout): Force section types of .init_array*,
9897 .preinit_array* and .fini_array* sections.
9898 * output.cc (Output_section::Input_section_sort_entry::has_priority):
9899 Fix check of return value of std::string::find.().
9900 (Output_section::Input_section_sort_compare::operator()): Remove
9901 comment about .init_array.
9902 (Output_section::Input_section_sort_init_fini_compare::operator()):
9903 New method.
9904 (Output_section::sort_attached_input_sections): Handle .init_array
9905 and .fini_array specially.
9906 * output.h (Output_section::Inut_section_sort_compare): Update
9907 comment.
9908 (Output_section::Input_section_sort_init_fini_compare): New struct.
9909
c3e4ae29
DK
99102010-02-26 Doug Kwan <dougkwan@google.com>
9911
9912 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
9913 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
9914 * testsuite/debug_msg.sh: Avoid matching source line number for
9915 use of global variable undef_int.
9916
2fd9ae7a
DK
99172010-02-26 Doug Kwan <dougkwan@google.com>
9918
9919 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
9920 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
9921 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
9922 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
9923 * options.cc (General_options::General_options): Initialize member
9924 fix_v4bx_.
9925 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
9926 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
9927 and rm_no_fix_v4bx.stdout
9928 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
9929 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
9930 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
9931 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
9932 and arm_no_fix_v4bx.
9933 * Makefile.in: Regenerate.
9934 * testsuite/arm_fix_v4bx.s: New file.
9935 * testsuite/arm_fix_v4bx.sh: Ditto.
9936
67ec7d0b
DK
99372010-02-24 Doug Kwan <dougkwan@google.com>
9938
9939 * arm.cc (Target_arm::got_section): Make the .got section the first
9940 non RELRO section in the data segment.
9941 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
9942 suffixes of section names.
9943
10165461
DK
99442010-02-24 Doug Kwan <dougkwan@google.com>
9945
9946 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
9947 flags and attributes merging if an input file is a binary file.
9948 * fileread.cc (Input_file::open): Record format of original file.
9949 * fileread.h (Input_file::Format): New enum type.
2e702c99 9950 (Input_file::Input_file): Initialize data member format_.
10165461
DK
9951 (Input_file::format): New method definition.
9952 (Input_file::format_):: New data member.
9953
4a54abbb
DK
99542010-02-24 Doug Kwan <dougkwan@google.com>
9955
9956 * arm.cc (Arm_output_data_got): New class.
9957 (ARM_TCB_SIZE): New constant
9958 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
9959 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
9960 If user uses a script with a SECTIONS clause, issue only a warning
9961 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 9962 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
9963 garbage collection.
9964 (Target_arm::got_mode_index_entry): Handle static linking.
9965 (Target_arm::Scan::local): Ditto.
9966 (Target_arm::Scan::global): Ditto.
9967 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
9968 all incorrectly implemented relocations.
e1df38aa 9969 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
9970 Arm_output_section::fix_exidx_coverage.
9971 * layout.cc (Layout::section_name_mapping): Remove trailing dots
9972 from ".ARM.exidx." and ".ARM.extab.".
9973
ca419a6f
ILT
99742010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9975
9976 * arm.cc (Target_arm::do_finalize_sections): Create attribute
9977 section if it does not already exist.
9978 * attributes.cc (Attributes_section_data::Attributes_section_data):
9979 Don't crash if size is zero.
9980
135b9c78
ILT
99812010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9982 Ian Lance Taylor <iant@google.com>
9983
9984 * gold.cc (queue_middle_tasks): If no input files were opened,
9985 exit.
9986 * workqueue.h (Task_function::Task_function): Assert that there is
9987 a blocker.
9988
bb0bfe4f
DK
99892010-02-22 Doug Kwan <dougkwan@google.com>
9990
9991 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
9992 * icf.cc (get_section_contents): Cast snprintf arguments to long long
9993 types to avoid warnings due to different uint64_t implementations
9994 on different hosts.
9995
2a2b6d42
DK
99962010-02-21 Doug Kwan <dougkwan@google.com>
9997
9998 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
9999 handling of the maximum backward branch offset.
2e702c99 10000 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
10001 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
10002 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 10003 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
10004 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
10005 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
10006 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
10007 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
10008 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
10009 thumb_bl_out_of_range thumb_bl_out_of_range.o,
10010 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
10011 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
10012 thumb2_bl_out_of_range.o): New rules.
10013 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
10014 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
10015 thumb2_bl_out_of_range
10016 * testsuite/Makefile.in: Regenerate.
10017 * testsuite/arm_bl_in_range.s: New file.
10018 * testsuite/arm_bl_out_of_range.s: Ditto.
10019 * testsuite/arm_branch_in_range.sh: Ditto.
10020 * testsuite/arm_branch_range.t: Ditto.
10021 * testsuite/thumb2_branch_range.t: Ditto.
10022 * testsuite/thumb_bl_in_range.s: Ditto.
10023 * testsuite/thumb_bl_out_of_range.s: Ditto.
10024 * testsuite/thumb_branch_range.t: Ditto.
10025
b487ad64
ST
100262010-02-20 Sriraman Tallam <tmsriram@google.com>
10027
10028 * gc.h (gc_process_relocs): Change vectors to point to the new list.
10029 Add reloc offset information.
10030 * icf.cc (get_section_contents): Change iterators to point to the new
10031 vectors. Add reloc offset information to the contents.
10032 * icf.h (Icf::Sections_reachable_info): New typedef.
10033 (Icf::Sections_reachable_list): New typedef.
10034 (Icf::Offset_info): New typedef.
10035 (Icf::Reloc_info): New struct typedef.
10036 (Icf::Reloc_info_list): New typedef.
10037 (Icf::symbol_reloc_list): Delete method.
10038 (Icf::addend_reloc_list): Delete method.
10039 (Icf::section_reloc_list): Delete method.
10040 (Icf::reloc_info_list): New method.
10041 (Icf::reloc_info_list_): New member.
10042
f96accdf
DK
100432010-02-19 Doug Kwan <dougkwan@google.com>
10044
10045 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
10046 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
10047 * arm.cc (Arm_relocation_functions): New forward declaration.
10048 (Target_arm::Target_arm): Initialize new data members
10049 got_mod_index_offset_ and tls_base_symbol_defined_.
10050 (Target_arm::Relocate::relocate_tls): New method.
10051 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
10052 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
10053 New methods.
2e702c99 10054 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
10055 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
10056 (Target_arm::got_mod_index_offset_,
10057 Target_arm::tls_base_symbol_defined_): New data members.
10058 (Target_arm::Scan::local, Target::Scan::global,
10059 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
10060 relocations.
10061
c8761b9a
DK
100622010-02-18 Doug Kwan <dougkwan@google.com>
10063
10064 * arm.cc (Arm_relobj::find_linked_text_section): New method.
10065 (Arm_relobj::make_exidx_input_section): Pass section index of linked
10066 text section as a parameter becuase some broken tools may not set
10067 the link in section header.
10068 (Target_arm::has_got_section): New method.
10069 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
10070 without any mapping symbol as data only. Remove warning.
10071 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
10072 link in its section header, try to discover the link by inspecting the
10073 REL31 relocation at the beginning of the section.
10074 (Target_arm::Scan::check_non_pic): Report name of offending relocation
10075 in error message.
10076 (Target_arm::Scan::global): Treat any reference to the symbol
10077 _GLOBAL_OFFSET_TABLE_ as a GOT access.
10078
21bb3914
ST
100792010-02-12 Sriraman Tallam <tmsriram@google.com>
10080
10081 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
10082 (Scan::global_reloc_may_be_function_pointer): New function.
10083 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10084 (Scan::global_reloc_may_be_function_pointer): New function.
10085 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10086 (Scan::global_reloc_may_be_function_pointer): New function.
10087 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
10088 (Scan::global_reloc_may_be_function_pointer): New function.
10089 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
10090 (Scan::global_reloc_may_be_function_pointer): New function.
10091 (Scan::possible_function_pointer_reloc): New function.
10092 (Target_x86_64::can_check_for_function_pointers): New function.
10093 * gc.h (gc_process_relocs): Scan relocation types to determine if
10094 function pointers were taken for targets that support it.
10095 * icf.cc (Icf::find_identical_sections): Include functions for
10096 folding in safe ICF whose pointer is not taken.
10097 * icf.h (Secn_fptr_taken_set): New typedef.
10098 (fptr_section_id_): New member.
10099 (section_has_function_pointers): New function.
10100 (set_section_has_function_pointers): New function.
10101 (check_section_for_function_pointers): New function.
10102 * options.h: Fix comment for safe ICF option.
10103 * target.h (can_check_for_function_pointers): New function.
10104 * testsuite/Makefile.am: Add icf_safe_so_test test case.
10105 Modify icf_safe_test for X86-64.
10106 * testsuite/Makefile.in: Regenerate.
10107 * testsuite/icf_safe_so_test.cc: New file.
10108 * testsuite/icf_safe_so_test.sh: New file.
10109 * testsuite/icf_safe_test.cc (kept_func_3): New function.
10110 (main): Change to take pointer to function kept_func_3.
10111 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
10112 folding is done correctly for X86-64.
10113
0da6fa6c
DM
101142010-02-12 David S. Miller <davem@davemloft.net>
10115
10116 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
10117 is_symbolless parameter.
10118 (Output_reloc<SHT_REL>::is_symbolless): New.
10119 (Output_reloc<SHT_REL>::is_symbolless_): New.
10120 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
10121 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
10122 (Output_reloc<SHT_RELA>::is_symbolless): New.
10123 (Output_data_reloc::add_global): Handle is_symbolless.
10124 (Output_data_reloc::add_global_relative): Likewise.
10125 (Output_data_reloc::add_local): Likewise.
10126 (Output_data_reloc::add_local_relative): Likewise.
10127 (Output_data_reloc::add_symbolless_global_addend): New.
10128 (Output_data_reloc::add_symbolless_local_addend): New.
10129 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
10130 is_symbolless.
10131 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
10132 instead of ->is_relative_
10133 (Output_reloc::write): Likewise.
10134 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
10135 (Output_reloc::write_rel): Simplify.
10136
10137 * sparc.cc (Target_sparc::Scan::local): Use
10138 ->add_symbolless_local_addend as needed.
10139 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
10140 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
10141 based upon relocation offset.
10142
e4782e83
DK
101432010-02-11 Doug Kwan <dougkwan@google.com>
10144
10145 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
10146 (Target_arm::Scan::global): Ditto. Also remove a comment before the
10147 beginning of function.
10148 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
10149 and MOVT_ABS relocations. Those are non issued in scanning. Fix
10150 parameter is_32bit in calls to should_apply_static_reloc.
10151 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
10152 (check_DATA): Add arm_abs_global.stdout.
10153 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
10154 arm_abs_global.stdout): New rules.
10155 (MOSTLLYCLEANFILES): Add arm_abs_global
10156 * Makefile.in: Regenerate.
10157 * testsuite/arm_abs_global.s: New file.
10158 * testsuite/arm_abs_global.sh: Ditto.
10159 * testsuite/arm_abs_lib.s: Ditto.
10160
93ceb764
ILT
101612010-02-11 Ian Lance Taylor <iant@google.com>
10162
10163 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
10164 Read_relocs task.
10165 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
10166 Allocate_commons_task first.
10167 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
10168 task, rather than symtab_lock_.
10169 (Gc_process_relocs::~Gc_process_relocs): New function.
10170 (Gc_process_relocs::is_runnable): Check this_blocker_.
10171 (Gc_process_relocs::locks): Use next_blocker_ rather than
10172 blocker_.
10173 (Scan_relocs::~Scan_relocs): New function.
10174 (Scan_relocs::is_runnable): Check this_blocker_ rather than
10175 symtab_lock_.
10176 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
10177 next_blocker_.
10178 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
10179 fields. Add this_blocker_ and next_blocker_ fields. Adjust
10180 constructor accordingly.
10181 (class Gc_process_relocs): Likewise.
10182 (class Scan_relocs): Likewise.
10183 * common.h (class Allocate_commons_task): Remove symtab_lock_
10184 field, and corresponding constructor parameter.
10185 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
10186 symtab_lock_.
10187 (Allocate_commons_task::locks): Likewise.
10188
114dfbe1
ILT
101892010-02-11 Ian Lance Taylor <iant@google.com>
10190
10191 * gold-threads.h (class Once): Define.
10192 (class Initialize_lock): Rewrite as child of Once.
10193 * gold-threads.cc (class Once_initialize): Define.
10194 (once_pointer_control): New static variable.
10195 (once_pointer, once_arg): New static variables.
10196 (c_run_once): New static function.
10197 (Once::Once, Once::run_once, Once::internal_run): New functions.
10198 (class Initialize_lock_once): Remove.
10199 (initialize_lock_control): Remove.
10200 (initialize_lock_pointer): Remove.
10201 (initialize_lock_once): Remove.
10202 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
10203 (Initialize_lock::initialize): Rewrite.
10204 (Initialize_lock::do_run_once): New function.
10205 * archive.cc (Archive::interpret_header): Only clear name if it is
10206 not already empty.
10207 * fileread.cc: Include "gold-threads.h"
10208 (file_counts_lock): New static variable.
10209 (file_counts_initialize_lock): Likewise.
10210 (File_read::release): Only increment counts when using --stats.
10211 Use a lock around the increment.
10212 * parameters.cc (class Set_parameters_target_once): Define.
10213 (set_parameters_target_once): New static variable.
10214 (Parameters::Parameters): Move here from parameters.h.
10215 (Parameters::set_target): Rewrite.
10216 (Parameters::set_target_once): New function.
10217 (Parameters::clear_target): Move here and rewrite.
10218 * parameters.h (class Parameters): Update declarations. Add
10219 set_parameters_target_once_ field.
10220 (Parameters::Parameters): Move to parameters.cc.
10221 (Parameters::clear_target): Likewise.
10222 * readsyms.cc (Read_symbols::do_group): Create a Start_group
10223 task.
10224 (Start_group::~Start_group): New function.
10225 (Start_group::is_runnable): New function.
10226 (Start_group::locks, Start_group::run): New functions.
10227 (Finish_group::run): Change saw_undefined to size_t.
10228 * readsyms.h (class Start_group): Define.
10229 (class Finish_group): Change saw_undefined_ field to size_t.
10230 (Finish_group::Finish_group): Remove saw_undefined and
10231 this_blocker parameters. Change all callers.
10232 (Finish_group::set_saw_undefined): New function.
10233 (Finish_group::set_blocker): New function.
10234 * symtab.h (class Symbol_table): Change saw_undefined to return
10235 size_t. Change saw_undefined_ field to size_t.
10236 * target-select.cc (Set_target_once::do_run_once): New function.
10237 (Target_selector::Target_selector): Initialize set_target_once_
10238 field. Don't initialize lock_ and initialize_lock_ fields.
10239 (Target_selector::instantiate_target): Rewrite.
10240 (Target_selector::set_target): New function.
10241 * target-select.h (class Set_target_once): Define.
10242 (class Target_selector): Update declarations. Make
10243 Set_target_once a friend. Remove lock_ and initialize_lock_
10244 fields. Add set_target_once_ field.
10245
fa17a3f4
ILT
102462010-02-10 Ian Lance Taylor <iant@google.com>
10247
10248 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
10249 queueing any tasks.
10250 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
10251 (queue_middle_tasks): Add all blockers before queueing any tasks.
10252 (queue_final_tasks): Likewise.
10253 * token.h (Task_token::add_blockers): New function.
10254 * object.h (Input_objects::number_of_relobjs): New function.
10255
c7177d31
ILT
102562010-02-10 Ian Lance Taylor <iant@google.com>
10257
5de0e392
ILT
10258 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
10259 shared, not if not position independent.
10260 * x86_64.cc (Relocate::relocate_tls): Likewise.
10261 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
10262 (tls_pie_pic_test): New target.
10263 * testsuite/Makefile.in: Rebuild.
10264
c7177d31
ILT
10265 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
10266 (tls_test_main_pie.o, tls_test_pie.o): New targets.
10267 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
10268 * testsuite/Makefile.in: Rebuild.
10269
684b268a
DM
102702010-02-09 David S. Miller <davem@davemloft.net>
10271
10272 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
10273 R_SPARC_RELATIVE using ->add_local_relative().
10274 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
10275
612a8d3d
DM
10276 * output.h (Output_data_dynamic::add_section_size): New method
10277 that takes two Output_data objects.
10278 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
10279 entry param. Handle it in initializers.
10280 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
10281 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
10282 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
10283 arg.
10284 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
10285 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
10286 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
10287 for dynrel_includes_plt.
10288 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10289 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10290 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
10291 before .rela.plt
10292 (Target_sparc::do_finalize_sections): Update to pass true for
10293 dynrel_includes_plt.
10294 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
10295 output before .rela.plt
10296 (Target_powerpc::do_finalize_sections): Update to pass true for
10297 dynrel_includes_plt when 32-bit.
10298
cb1be87e
DK
102992010-02-08 Doug Kwan <dougkwan@google.com>
10300
10301 * arm.cc (Arm_relobj::simple_input_section_output_address): New
10302 method.
10303 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
10304 Arm_relobj::scan_section_for_cortex_a8_stubs,
10305 Arm_relobj::do_relocation_section): Instead of calling
10306 Output_section::output_address, use faster
10307 Arm_relobj::simple_input_section_output_address.
10308
705b5121
DM
103092010-02-08 David S. Miller <davem@davemloft.net>
10310
10311 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
10312 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
10313 relocation helper function.
10314
024c4466
DM
10315 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
10316 just like R_SPARC_GOT{10,13,22}.
10317 (Target_sparc::Scan::local): Likewise.
10318 (Target_sparc::Relocate:relocate): Likewise.
10319
9109c078
ILT
103202010-02-06 Ian Lance Taylor <iant@google.com>
10321
10322 * configure.ac: Rewrite targetobjs duplicate removal code to use
10323 only shell constructs.
10324 * configure: Rebuild.
10325
cf846138
DK
103262010-02-05 Doug Kwan <dougkwan@google.com>
10327
10328 PR 11247
10329 * arm.cc (Arm_relobj::section_is_scannable): New method.
10330 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
10331 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
10332
6cfaf60b
DK
103332010-02-04 Doug Kwan <dougkwan@google.com>
10334
10335 PR 11247
10336 * arm-reloc-property.cc (cstdio): Include.
10337 * configure.ac (targetobjs): Remove duplicates.
10338 * configure: Regenerate.
10339 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
10340 big and little endian version for a given address size.
10341
5c57f1be
DK
103422010-02-03 Doug Kwan <dougkwan@google.com>
10343
10344 * arm-reloc-property.cc
10345 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10346 definition.
10347 * arm-reloc-property.h
10348 (Arm_reloc_property_table::get_implemented_static_reloc_property):
10349 New method definition.
10350 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10351 declaration.
10352 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
10353 overflow to N.
10354 (GOT_PREL): Change implemented to Y.
10355 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
10356 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
10357 (Arm_relocate_functions::movw_abs_nc): Remove method.
10358 (Arm_relocate_functions::movt_abs): Ditto.
10359 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
10360 (Arm_relocate_functions::thm_movt_abs): Ditto.
10361 (Arm_relocate_functions::movw_rel_nc): Ditto.
10362 (Arm_relocate_functions::movw_rel): Ditto.
10363 (Arm_relocate_functions::movt_rel): Ditto.
10364 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
10365 (Arm_relocate_functions:thm_movw_rel): Ditto.
10366 (Arm_relocate_functions:thm_movt_rel): Ditto.
10367 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
10368 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
10369 New method definitions.
10370 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
10371 (Arm_relocation_functions::arm_grp_ldr): Ditto.
10372 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
10373 (Arm_relocation_functions::arm_grp_ldc): Ditto.
10374 (Target_arm::Relocate::relocate): Check for non-static or
10375 unimplemented relocation code and exit early. Change calls to
10376 Target_arm::reloc_uses_thumb_bit and
10377 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
10378 instead. Refactor code to handle similar relocations to increase
10379 code sharing. Remove check for unsupported relocation code in switch
10380 statement.
10381 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
10382 relocation property table to find out size. Change error message to
10383 print out the name of a relocation code instead of the numeric value.
10384 (Target_arm::scan_reloc_for_stub): Use relocation property table
10385 instead of calling Target_arm::reloc_uses_thumb_bit().
10386
218c5831
DK
103872010-02-02 Doug Kwan <dougkwan@google.com>
10388
10389 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
10390 types of relaxed input section.
10391
0d31c79d
DK
103922010-02-02 Doug Kwan <dougkwan@google.com>
10393
10394 * Makefile.am (HFILES): Add arm-reloc-property.h.
10395 (DEFFILES): New.
2e702c99
RM
10396 (TARGETSOURCES): Add arm-reloc-property.cc
10397 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
10398 (libgold_a_SOURCES): $(DEFFILES)
10399 * Makefile.in: Regenerate.
10400 * arm-reloc-property.cc: New file.
10401 * arm-reloc-property.h: New file.
10402 * arm-reloc.def: New file.
10403 * arm.cc: Update comments.
10404 (arm-reloc-property.h): New included header.
10405 (arm_reloc_property_table): New global variable.
10406 (Target_arm::do_select_as_default_target): New method definition.
10407 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
10408 arm-reloc-property to targ_extra_obj.
10409 * parameters.cc (set_parameters_target): Call
10410 Target::select_as_default_target().
10411 * target.h (Target::select_as_default_target): New method definition.
10412 (Target::do_select_as_default_target): Same.
10413
546c7457
DK
104142010-02-01 Doug Kwan <dougkwan@google.com>
10415
10416 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
10417 first_output_text_section_.
10418 (Arm_exidx_fixup::first_output_text_section): New method definition.
10419 (Arm_exidx_fixup::first_output_text_section_): New data member.
10420 (Arm_exidx_fixup::process_exidx_section): Record the first text
10421 output section seen.
10422 (Arm_output_section::fix_exidx_coverage): Set correct linked section
10423 and entsize in output section header.
10424
11b861d5
DK
104252010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10426
10427 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
10428 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
10429 (Arm_relocate_functions::thm_alu11): New Method.
10430 (Arm_relocate_functions::thm_pc8): New Method.
10431 (Arm_relocate_functions::thm_pc12): New Method.
10432 (Target_arm::Scan::local): Handle the relocations.
10433 (Target_arm::Scan::global): Likewise.
10434 (Target_arm::Relocate::relocate): Likewise.
10435 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10436
c9a2c125
DK
104372010-01-29 Doug Kwan <dougkwan@google.com>
10438
10439 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
10440 of relocation types as ld.
10441
1521477a
DK
104422010-01-29 Doug Kwan <dougkwan@google.com>
10443
10444 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
10445 to public.
10446 (Arm_relocate_functions::thumb_branch_common): Ditto.
10447 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
10448 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
10449 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
10450 Arm_relocate_functions::jump24): Remove.
10451 (Target_arm::Relocate::relocate): Adjust code to call
10452 Arm_relocation_functions::arm_branch_common and
10453 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 10454 wrappers. Merge switch-cases together to reduce source code size.
1521477a 10455
e7eca48c
DK
104562010-01-29 Doug Kwan <dougkwan@google.com>
10457
10458 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
10459 output_local_symbol_count_needs_update_.
10460 (Arm_relobj::output_local_symbol_count_needs_update,
10461 Arm_relobj::set_output_local_symbol_count_needs_update,
10462 Arm_relobj::update_output_local_symbol_count): New methods.
10463 (Arm_relobj::output_local_symbol_count_needs_update_): New data
10464 member.
10465 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
10466 of pointed function as in a R_ARM_PREL31 relocation.
10467 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
10468 for output local symbol count updating.
10469 (Target_arm::do_relax): Update output local symbol counts in objects
10470 if necessary.
10471 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
10472
02961d7e
ILT
104732010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10474
10475 * arm.cc: Added support for the ARM relocations:
10476 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
10477 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
10478 (Arm_relocate_functions::movw_rel_nc): Renamed (was
10479 movw_prel_nc).
10480 (Arm_relocate_functions::movw_rel): New method.
10481 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
10482 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
10483 thm_movw_prel_nc).
10484 (Arm_relocate_functions::thm_movw_rel): New method.
10485 (Arm_relocate_functions::thm_movt_rel): Renamed (was
10486 thm_movt_prel).
10487 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
10488 relocations.
10489 (Target_arm::Scan::global): Likewise.
10490 (Target_arm::Relocate::relocate): Likewise.
10491 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10492 Likewise.
10493
b10d2873
ILT
104942010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10495
10496 * arm.cc: Added support for ARM group relocations.
10497 (Target_arm::reloc_needs_sym_origin): New method.
10498 (Arm_relocate_functions::calc_grp_kn): New method.
10499 (Arm_relocate_functions::calc_grp_residual): New method.
10500 (Arm_relocate_functions::calc_grp_gn): New method.
10501 (Arm_relocate_functions::arm_grp_alu): New Method.
10502 (Arm_relocate_functions::arm_grp_ldr): New Method.
10503 (Arm_relocate_functions::arm_grp_ldrs): New Method.
10504 (Arm_relocate_functions::arm_grp_ldc): New Method.
10505 (Target_arm::Scan::local): Handle the ARM group relocations.
10506 (Target_arm::Scan::global): Likewise.
10507 (Target_arm::Relocate::relocate): Likewise.
10508 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10509 Likewise.
10510
2b328d4e
DK
105112010-01-26 Doug Kwan <dougkwan@google.com>
10512
10513 * arm.cc (set): Include.
10514 (class Arm_exidx_fixup): Change type of last_input_section_ to const
10515 pointer type.
2e702c99 10516 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
10517 (Arm_output_section::append_text_sections_to_list): New method.
10518 (Arm_output_section::fix_exidx_coverage): Ditto.
10519 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 10520 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
10521 Relobj::set_section_offset() instead of
10522 Sized_relobj::invalidate_section_offset().
2e702c99 10523 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
10524 parameter for section headers. Ignore relocation sections for
10525 unallocated sections and EXIDX sections.
10526 (Target_arm::fix_exidx_coverage): New method.
10527 (Target_arm::output_section_address_less_than): New type.
10528 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
10529 linked text section instead of the EXIDX section.
10530 (Arm_output_section::create_stub_group): Add an assertion to check
10531 that this is not an EXIDX output section.
10532 (Arm_output_section::append_text_sections_to_list): New method.
10533 (Arm_output_section::fix_exidx_coverage): Ditto.
10534 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 10535 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
10536 (Target_arm::do_relax): Fix EXIDX output section coverage in the
10537 first pass.
10538 (Target_arm::fix_exidx_coverage): New method.
10539 * object.h (Relobj::set_output_section): New method.
10540 (Sized_relobj::invalidate_section_offset): Remove method.
10541 (Sized_relobj::do_invalidate_section_offset): Remove method.
10542 (Sized_relobj::do_set_section_offset): Handle offset value -1.
10543
c7f3c371
DK
105442010-01-25 Doug Kwan <dougkwan@google.com>
10545
10546 * arm.cc (Arm_exidx_merged_section::do_output_offset):
10547 Fix warning due to signed and unsigned comparison on a 32-bit host.
10548
8923b24c
DK
105492010-01-22 Doug Kwan <dougkwan@google.com>
10550
10551 * arm.cc (Target_arm::do_relax): Record an output section for section
10552 offset adjustment it contains any stub table that has changed.
10553 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
10554 offsets in an output section if necessary.
10555 * output.cc (Output_section::Output_section): Initialize
10556 section_offsets_need_adjustments_.
10557 (Output_section::add_input_section_for_script): Renamed to
10558 Output_section::add_simple_input_section.
10559 (Output_section::save_states): Add a comment.
10560 (Output_section::discard_states): New method defintion.
10561 (Output_section::adjust_section_offsets): Same.
10562 * output.h (Output_section::add_input_section_for_script): Renamed to
10563 Output_section::add_simple_input_section.
10564 (Output_section::discard_states): New method declaration.
10565 (Output_section::adjust_section_offsets): Same.
10566 (Output_section::section_offsets_need_adjustment,
10567 Output_section::set_section_offsets_need_adjustment): New method
10568 definitions.
10569 (Output_section::section_offsets_need_adjustment_): New data member.
10570 * script-sections.cc
10571 (Output_section_element_input::set_section_address): Adjust code for
10572 renaming of Output_section::add_input_section_for_script.
10573 (Orphan_output_section::set_section_address): Same.
10574
9b2fd367
DK
105752010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10576
10577 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
10578 Fix_v4bx enum values .
10579 * gold/options.h (General_options): New option definitions.
10580 (General_options::fix_v4bx): New method.
10581 (General_options::Fix_v4bx): New enum.
10582 * gold/options.cc (General_options::parse_fix_v4bx): New method.
10583 (General_options::parse_fix_v4bx_interworking): New method.
10584
80d0d023
DK
105852010-01-22 Doug Kwan <dougkwan@google.com>
10586
10587 * arm.cc (Arm_exidx_fixup): New class.
10588
af2cdeae
DK
105892010-01-21 Doug Kwan <dougkwan@google.com>
10590
10591 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
10592 classes.
10593 (Arm_exidx_section_offset_map): New type.
10594
993d07c1
DK
105952010-01-21 Doug Kwan <dougkwan@google.com>
10596
10597 * arm.cc (Arm_exidx_input_section): New class.
10598 (Arm_relobj::exidx_input_section_by_link,
10599 Arm_relobj::exidx_input_section_by_shndx,
10600 Arm_relobj::make_exidx_input_section): New methods.
10601 (read_arm_attributes_section): Remove.
10602 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
10603 information about them.
10604 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
10605 to here.
10606
5ac169d4
DK
106072010-01-20 Doug Kwan <dougkwan@google.com>
10608
10609 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
10610 Input_section_specifier to Section_id.
10611 (Target_arm::new_arm_input_section: Adjust code for change of key
10612 type.
10613 (Target_arm::find_arm_input_section): Ditto.
10614 * gc.h (object.h): Include for Section_id nand Section_id_hash.
10615 (Section_id): Remove.
10616 (Garbage_collection::Section_id_hash): Remove.
10617 * icf.h (object.h): Include for Section_id nand Section_id_hash.
10618 (Section_id): Remove.
10619 (Icf::Section_id_hash): Remove.
10620 * object.h (Section_id, Const_section_id, Section_id_hash,
10621 Const_section_id_hash): New type definitions.
10622 * output.cc (Output_section::add_relaxed_input_section): Change to
10623 use Const_section_id instead of Input_section_specifier as key type.
10624 (Output_section::add_merge_input_section): Ditto.
10625 (Output_section::build_relaxation_map): Change to use Section_id
10626 instead of Input_section_specifier as key type.
2e702c99 10627 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
10628 Ditto.
10629 (Output_section::convert_input_sections_to_relaxed_sections): Change
10630 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 10631 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
10632 (Output_section::find_relaxed_input_section): Ditto.
10633 * output.h (Input_section_specifier): Remove class.
10634 (Output_section::Output_section_data_by_input_section_map): Change
10635 key type to Const_section_id.
10636 (Output_section::Output_relaxed_input_section_by_input_section_map):
10637 Ditto.
10638 (Output_section::Relaxation_map): Change key type to Section_id.
10639
a2162063
ILT
106402010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10641
10642 * gold/arm.cc: Added support for R_ARM_V4BX relocation
10643 (class Arm_v4bx_stub): New class.
10644 (DEF_STUBS): Updated definition to support v4_veneer_bx.
10645 (Stub_factory::make_arm_v4bx_stub): New method.
10646 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
10647 (Stub_table::empty): Handle v4bx stubs.
10648 (Stub_table::add_arm_v4bx_stub): New method.
10649 (Stub_table::find_arm_v4bx_stub): New method.
10650 (Arm_relocate_functions::v4bx): New method.
10651 (Target_arm::fix_v4bx): New method.
10652 (Target_arm::Target_arm): Handle R_ARM_V4BX.
10653 (Stub_table::relocate_stubs): Likewise.
10654 (Stub_table::do_write): Likewise.
10655 (Stub_table::update_data_size_and_addralign): Likewise.
10656 (Stub_table::finalize_stubs): Likewise.
10657 (Target_arm::Scan::local): Likewise.
10658 (Target_arm::Scan::global): Likewise.
10659 (Target_arm::do_finalize_sections): Likewise.
10660 (Target_arm::Relocate::relocate): Likewise.
10661 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10662 Likewise.
10663 (Target_arm::scan_reloc_for_stub): Likewise.
10664 (Target_arm::scan_reloc_section_for_stubs): Likewise.
10665
5696ab0b
ILT
106662010-01-19 Ian Lance Taylor <iant@google.com>
10667
10668 * output.cc (Output_section_headers::do_sized_write): Write large
10669 segment count to sh_info field.
10670 (Output_file_header::do_sized_write): For large segment count,
10671 write PN_XNUM to e_phnum field.
10672
800d0f56
ILT
106732010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10674
10675 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
10676 (Arm_relocate_functions::thm_jump8): New function.
10677 (Arm_relocate_functions::thm_jump11): New function.
10678 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
10679 R_ARM_THM_JUMP11.
10680 (Target_arm::Scan::global): Likewise.
10681 (Target_arm::Relocate::relocate): Likewise.
10682 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10683 Likewise.
10684
41263c05
DK
106852010-01-14 Doug Kwan <dougkwan@google.com>
10686
10687 * arm.cc (map, utility): Include headers.
10688 (Target_arm::apply_cortex_a8_workaround): New method.
10689 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
10690 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
10691 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
10692 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
10693 the --[no-]fix-cortex-a8 command line options.
10694 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
10695 (Target_arm::relocate_stub): Use addend in instruction template.
10696 * options.h (DEFINE_bool): Set the user-set flag.
10697 (General_options): Add --[no-]-fix-cortex options.
10698 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 10699 : Update fast look-up map after conversion.
41263c05 10700
459e9b03
ST
107012010-01-14 Sriraman Tallam <tmsriram@google.com>
10702
10703 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
10704 in the first pass of do_layout.
10705
b521dfe4
DK
107062010-01-13 Doug Kwan <dougkwan@google.com>
10707
10708 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10709 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
10710 apparent compiler problem of not folding static constant integral
10711 data members of elfcpp::Elf_sizes<32>.
10712
44272192
DK
107132010-01-13 Doug Kwan <dougkwan@google.com>
10714
10715 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10716 Arm_relobj::section_needs_cortex_a8_stub_scanning,
10717 Arm_relobj::scan_section_for_cortex_a8_erratum,
10718 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
10719 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
10720 sections to scan for relocation stubs into a new method
10721 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
10722 relocation and Cortex-A8 stub scanning.
10723 (Target_arm::do_relax): Force stubs to be after stubbed sections
10724 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 10725 the beginning of a new relaxation pass. Update a comment.
44272192
DK
10726 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
10727
44b71ece
ILT
107282010-01-12 Ian Lance Taylor <iant@google.com>
10729
10730 * target-reloc.h (visibility_error): New inline function.
10731 (relocate_section): Call visibility_error.
10732 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
10733 (MOSTLYCLEANFILES): Likewise.
10734 (protected_4_pic.o, protected_3.err): New targets.
10735 * testsuite/protected_4.cc: New file.
10736
a120bc7f
DK
107372010-01-12 Doug Kwan <dougkwan@google.com>
10738
10739 * arm.cc (Cortex_a8_reloc): New class.
10740 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
10741 and cortex_a8_relocs_info_.
10742 (Target_arm::fix_cortex_a8): New method definition.
10743 (Target_arm::Cortex_a8_relocs_info): New type.
10744 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
10745 New data member declarations.
10746 (Target_arm::scan_reloc_for_stub): Record information about
10747 relocations for THUMB branches that might be exempted from the
10748 Cortex-A8 workaround.
10749 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
10750 at the beginning of a relaxation pass.
10751
20138696
DK
107522010-01-12 Doug Kwan <dougkwan@google.com>
10753
10754 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
10755 (Arm_relobj::Mapping_symbol_position,
10756 Arm_reloj::Mapping_symbol_position_less,
10757 Arm_relobj::Mapping_symbols_info): New types.
10758 (Target_arm::is_mapping_symbol_name): New method definition.
10759 (Arm_relobj::do_count_local_symbols): Save information about mapping
10760 symbols.
10761
089d69dc
DK
107622010-01-11 Doug Kwan <dougkwan@google.com>
10763
10764 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
10765 Arm_relocate_functions::thumb32_branch_upper,
10766 Arm_relocate_functions::thumb32_branch_lower,
10767 Arm_relocate_functions::thumb32_cond_branch_offset,
10768 Arm_relocate_functions::thumb32_cond_branch_upper,
10769 Arm_relocate_functions::thumb32_cond_branch_lower,
10770 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
10771 branch offset encoding.
10772 (Arm_relocate_functions::thumb_branch_common): Use new branch
10773 offset encoding methods to avoid code duplication.
10774 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
10775 (Stub_addend_reader::operator()): Use new branch encoding method
10776 to avoid code duplication.
10777
99e5bff2
DK
107782010-01-11 Doug Kwan <dougkwan@google.com>
10779
10780 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
10781 (Target_arm::do_finalize_sections): Define special EXIDX section
10782 symbols only if referenced.
10783 * gc.h (Garbage_collection::add_reference): New method.
10784 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
10785 code duplication.
10786
98e090bd
ILT
107872010-01-11 Ian Lance Taylor <iant@google.com>
10788
d0a91bd8
ILT
10789 * script.cc (Version_script_info::build_expression_list_lookup):
10790 Change complaing about duplicate wildcard match from error to
10791 warning.
10792
98e090bd
ILT
10793 * script.cc (class Lazy_demangler): Recreate--revert part of patch
10794 of 2009-12-30.
10795 (Version_script_info::Version_script_info): Initialize globs_,
10796 default_version_, default_is_global_, and exact_. Don't
10797 initialize globals_ or locals_.
10798 (Version_script_info::build_lookup_tables): Build local symbols
10799 first.
10800 (Version_script_info::unquote): New function.
10801 (Version_script_info::add_exact_match): New function.
10802 (Version_script_info::build_expression_list_lookup): Remove lookup
10803 parameter. Add is_global parameter. Change all callers. Handle
10804 wildcard pattern specially. Unquote pattern. Call
10805 add_exact_match.
10806 (Version_script_info::get_name_to_match): New function.
10807 (Version_script_info::get_symbol_version): New function.
10808 (Version_script_info::get_symbol_version_helper): Remove.
10809 (Version_script_info::check_unmatched_names): Call unquote.
10810 * script.h (class Version_script_info): Change get_symbol_version
10811 to be non-inline and add is_global parameter; change all callers.
10812 Rewrite symbol_is_local. Update declarations. Define struct
10813 Version_tree_match, Exact, Globs. Don't define struct Lookup.
10814 Remove globals_ and locals_ members. Add exact_, globs_,
10815 default_version_, is_global_.
10816 (Version_script_info::Glob): Remove pattern, add expression and
10817 is_global. Update constructor. Change all callers.
10818 * dynobj.cc (Versions::finalize): Mark the version symbol as the
10819 default version.
10820 (Versions::symbol_section_contents): If a symbol is undefined, or
10821 defined in a dynamic object, set the version index to
10822 VER_NDX_LOCAL.
10823 * symtab.cc (Symbol_table::add_from_relobj): Don't call
10824 symbol_is_local.
10825 (Symbol_table::add_from_pluginobj): Likewise.
10826 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
10827
d56962d3
DK
108282010-01-11 Doug Kwan <dougkwan@google.com>
10829
10830 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
10831 (incremental_dump_LDADD): Add linking option for libintl.
10832 * Makefile.in: Regenerate.
10833
94e6ee91
L
108342010-01-11 H.J. Lu <hongjiu.lu@intel.com>
10835
10836 PR gold/11144
10837 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
10838 instead of -Ds.
10839 * testsuite/Makefile.in: Regenerated.
10840
e96c574b
DK
108412010-01-10 Doug Kwan <dougkwan@google.com>
10842
10843 * options.h (DEFINE_var): Use parentheses around argument varname__
10844 in macro body to avoid any unintended subsequent substitutions.
10845
7198066b
ILT
108462010-01-10 Ian Lance Taylor <iant@google.com>
10847
ba4d53bf
ILT
10848 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
10849 candidates before doing symbol resolution.
10850
7198066b
ILT
10851 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
10852 ODR candidates if only one is weak.
10853
a2beed37
ILT
108542010-01-08 Ian Lance Taylor <iant@google.com>
10855
10856 * script.cc (Version_script_info::build_expression_list_lookup):
10857 Don't warn about ambiguous version, just record the ambiguity.
10858 (Version_script_info::get_symbol_version_helper): Give error if
10859 version is ambiguous.
10860
2fb7225c
DK
108612010-01-08 Doug Kwan <dougkwan@google.com>
10862
10863 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
10864 prev_data_size_ and prev_addralign_. Remove initializer for
10865 deleted data member has_been_changed_.
10866 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
10867 to determine if the table is empty.
10868 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
10869 Remove.
10870 (Stub_table::add_reloc_stub): Define method in class definition
10871 instead of just declaring it there.
10872 (Stub_table::add_cortex_a8_stub): New method definition.
10873 (Stub_table::update_data_size_and_addralign): Ditto.
10874 (Stub_table::finalize_stubs): Ditto.
10875 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
10876 (Stub_table::do_addralign_): Return address alignment in the
10877 (Stub_table::do_reset_address_and_file_offset): Define method in
10878 class definition instead of declaring it there. Set current data
10879 size to be the data size of the previous pass.
10880 (Stub_table::set_final_data_size): Use current data size as the
10881 final data size.
10882 (Stub_table::relocate_stub): Change parameter type of stub from
10883 Reloc_stub pointer to Stub pointer.
10884 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
10885 (Stub_table::Cortex_a8_stub_list): New typedef.
10886 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
10887 Stub_table::prev_addralign_): New data member.
10888 (Arm_relobj::Arm_relobj): Initialize data member
10889 section_has_cortex_a8_workaround_.
10890 (Arm_relobj::section_has_cortex_a8_workaround,
10891 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
10892 definitions.
10893 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
10894 declarations.
10895 (Target_arm::relocate_stub): Change parameter type of stub from
10896 Reloc_stub pointer to Stub pointer.
10897 (Insn_template::size, Insn_template::alignment): Handle
10898 THUMB16_SPECIAL_TYPE.
10899 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
10900 Stub_table::update_data_size_and_addralign,
10901 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
10902 definitions.
10903 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
10904 (Stub_table::do_write): Ditto.
10905 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 10906
880cd20d
ILT
109072010-01-08 Ian Lance Taylor <iant@google.com>
10908
10909 PR 11108
10910 * symtab.h (class Symbol): Remove fields is_target_special_ and
10911 has_plt_offset_. Add field is_defined_in_discarded_section_.
10912 (Symbol::is_defined_in_discarded_section): New function.
10913 (Symbol::set_is_defined_in_discarded_section): New function.
10914 (Symbol::has_plt_offset): Rewrite.
10915 (Symbol::set_plt_offset): Verify that new offset is not -1U.
10916 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
10917 Don't initialize is_target_special_ or has_plt_offset_.
10918 Initialize is_defined_in_discarded_section_.
10919 (Symbol_table::add_from_relobj): If appropriate, set
10920 is_defined_in_discarded_section.
10921 * resolve.cc (Symbol::override_base_with_special): Don't test
10922 is_target_special_. Change has_plt_offset_ to has_plt_offset().
10923 * target-reloc.h (relocate_section): Do special handling for
10924 symbols defined in discarded sections for global symbols as well
10925 as local symbols.
10926
2703e3eb
ILT
109272010-01-08 Ian Lance Taylor <iant@google.com>
10928
10929 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
10930 the SHT_SYMTAB case.
10931
339d40a3
ILT
109322010-01-08 Ian Lance Taylor <iant@google.com>
10933
10934 * object.cc (Sized_relobj::do_layout): Don't get confused if
10935 layout_eh_frame returns NULL.
10936
abecea76
ILT
109372010-01-08 Ian Lance Taylor <iant@google.com>
10938
10939 PR 11084
10940 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
10941 dynamic symbol table, use the normal symbol table.
10942 (Sized_dynobj::do_read_symbols): Remove assertion about type of
10943 symbol table.
10944
6b7dd3f3
ILT
109452010-01-08 Ian Lance Taylor <iant@google.com>
10946
10947 PR 11072
10948 * layout.cc (Layout::include_section): Remove .gnu_debuglink
10949 sections.
10950
36c50e63
L
109512010-01-08 H.J. Lu <hongjiu.lu@intel.com>
10952
10953 * version.cc (print_version): Change to "Copyright 2010".
10954
e291e7b9
ILT
109552010-01-08 Ian Lance Taylor <iant@google.com>
10956
10957 PR 10287
10958 PR 11063
10959 * i386.cc (class Target_i386): Change return type of plt_section
10960 to be non-const.
10961 (class Output_data_plt_i386): Add tls_desc_rel_ field.
10962 (Output_data_plt_i386::Output_data_plt_i386): Initialize
10963 tls_desc_rel_ field.
10964 (Output_data_plt_i386::rel_tls_desc): New function.
10965 (Target_i386::rel_tls_desc_section): New function.
10966 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
10967 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
10968 R_386_TLS_DESC reloc in rel_tls_desc_section.
10969 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
10970 Define struct Tlsdesc_info.
10971 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
10972 (Target_x86_64::do_reloc_symbol_index): New function.
10973 (Target_x86_64::add_tlsdesc_info): New function.
10974 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
10975 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
10976 tlsdesc_rel_ field.
10977 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
10978 all callers.
10979 (Output_data_plt_x86_64::rela_tlsdesc): New function.
10980 (Target_x86_64::rela_tlsdesc_section): New function.
10981 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
10982 handling.
10983 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
10984 (Target_x86_64::do_reloc_addend): New function.
10985 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
10986 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
10987 declarations. Define TARGET_CODE. Add arg field to u1_ union.
10988 (Output_reloc::type): New function.
10989 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
10990 (Output_reloc::is_target_specific): New function.
10991 (Output_reloc::target_arg): New function.
10992 (class Output_reloc) [SHT_RELA]: Add four new constructors for
10993 absolute relocs and target specific relocs.
10994 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
10995 add_target_specific.
10996 (class Output_data_reloc) [SHT_RELA]: Likewise.
10997 * output.cc (Output_reloc::Output_reloc): Add four new versions
10998 for absolute relocs and target specific relocs.
10999 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
11000 (Output_reloc::get_symbol_index): Likewise.
11001 (Output_reloc::local_section_offset): Check that local_sym_index_
11002 is not TARGET_CODE or 0.
11003 (Output_reloc::symbol_value): Likewise.
11004 (Output_reloc::write) [SHT_RELA]: Call target for target specific
11005 reloc.
11006 * target.h (class Target): Add reloc_symbol_index and reloc_addend
11007 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
11008 functions.
11009 * layout.cc (add_target_dynamic_tags): Use output section for
11010 DT_PLTRELSZ and DT_JMPREL.
11011
3a44184e
ILT
110122010-01-07 Ian Lance Taylor <iant@google.com>
11013
11014 PR 11061
11015 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
11016 function.
11017 (class Output_data_reloc_generic): Define.
11018 (class Output_data_reloc_base): Change base class to
11019 Output_data_reloc_generic. Change add() method to call
11020 bump_relative_reloc_count for a relative reloc. Remove
11021 sort_relocs_ field.
11022 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
11023 to sort_relocs().
11024 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
11025 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
11026 appropriate.
11027 * layout.h (class Layout): Update declaration.
11028
ea715a34
ILT
110292010-01-07 Ian Lance Taylor <iant@google.com>
11030
11031 * output.h (class Output_data): Add const version of
11032 output_section and do_output_section.
11033 (class Output_section_data): Add const version of
11034 do_output_section.
11035 (class Output_section): Likewise.
11036 * layout.cc (Layout::add_target_dynamic_tags): New function.
11037 * layout.h (class Layout): Update declarations.
11038 * arm.cc (Target_arm::do_finalize_sections): Use
11039 add_target_dynamic_tags.
11040 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11041 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11042 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11043 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11044
659948a4
ILT
110452010-01-07 Ian Lance Taylor <iant@google.com>
11046
11047 PR 11042
11048 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
11049 object as needed.
11050
9d3b86f6
ILT
110512010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
11052 Ian Lance Taylor <iant@google.com>
11053
11054 PR 11019
11055 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
11056 Xindex::read_symtab_xindex.
11057
bb0d3eb0
DK
110582010-01-07 Doug Kwan <dougkwan@google.com>
11059
11060 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
11061 (Insn_template::thumb16_bcond_insn): New method declaration.
11062 (Insn_template): Fix spelling.
11063 (Stub::thumb16_special): New method declaration.
11064 (Stub::do_write): Define virtual method which was previously pure
11065 virtual.
11066 (Stub::do_thumb16_special): New method declaration.
11067 (Stub::do_fixed_endian_write): New template member.
11068 (Reloc_stub::do_write): Remove.
11069 (Reloc_stub::do_fixed_endian_write): Remove.
11070 (Cortex_a8_stub): New class definition.
11071 (Stub_factory::make_cortex_a8_stub): New method definition.
11072 (Stub_factory::Stub_factory): Add missing static storage class
11073 qualifier for elf32_arm_stub_a8_veneer_blx.
11074
ffeef7df
ILT
110752010-01-07 Ian Lance Taylor <iant@google.com>
11076
dc3f80fe
ILT
11077 PR 10980
11078 * options.h (class General_options): Add --warn-unresolved-symbols
11079 and --error-unresolved-symbols.
11080 * errors.cc (Errors::undefined_symbol): Implement
11081 --warn-unresolved-symbols.
11082
ffeef7df
ILT
11083 * options.h (class General_options): Add -z text and -z textoff.
11084 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
11085
f1ec9ded
ST
110862010-01-06 Sriraman Tallam <tmsriram@google.com>
11087
11088 * gc.h (Garbage_collection::Cident_section_map): New typedef.
11089 (Garbage_collection::cident_sections): New function.
11090 (Garbage_collection::add_cident_section): New function.
11091 (Garbage_collection::cident_sections_): New member.
11092 (gc_process_relocs): Add references to sections whose names are C
11093 identifiers.
11094 * gold.h (cident_section_start_prefix): New constant.
11095 (cident_section_stop_prefix): New constant.
11096 (is_cident): New function.
11097 * layout.cc (Layout::define_section_symbols): Replace string constants
11098 with the newly defined constants.
11099 * object.cc (Sized_relobj::do_layout): Track sections whose names are
11100 C identifiers.
11101 * testsuite/Makefile.am: Add gc_orphan_section_test.
11102 * testsuite/Makefile.in: Regenerate.
11103 * testsuite/gc_orphan_section_test.cc: New file.
11104 * testsuite/gc_orphan_section_test.sh: New file.
11105
6eda8c29
ILT
111062010-01-06 Ian Lance Taylor <iant@google.com>
11107
b9674e17
ILT
11108 PR 10980
11109 * options.h (class General_options): Add --warn-shared-textrel.
11110 * layout.cc (Layout::finish_dynamic_section): Implement
11111 --warn-shared-textrel.
11112
6eda8c29
ILT
11113 PR 10980
11114 * options.h (class General_options): Add --warn-multiple-gp.
11115
32dcd44e
ILT
111162010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11117
11118 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
11119 $(THREADSLIB) and $(LIBDL).
11120 * Makefile.in: Rebuild.
11121
a192ba05
ILT
111222010-01-06 Ian Lance Taylor <iant@google.com>
11123
11124 PR 10980
11125 * options.cc (General_options::parse_section_start): New function.
11126 (General_options::section_start): New function.
11127 (General_options::General_options): Initialize all members.
11128 * options.h: Include <map>
11129 (class General_options): Add --section-start. Add section_starts_
11130 member.
11131 * layout.cc (Layout::attach_allocated_section_to_segment): If
11132 --section-start was used, set the address of the segment. Remove
11133 local sort_sections.
11134 (Layout::relaxation_loop_body): If the address of the load segment
11135 has been set by --section-start, don't use it.
11136 * output.h (Output_segment::update_flags_for_output_section): New
11137 function.
11138 * output.cc (Output_segment::add_output_section): Call
11139 update_flags_for_output_section.
11140
dde3f402
ILT
111412010-01-05 Ian Lance Taylor <iant@google.com>
11142
62dfdd4d
ILT
11143 PR 10980
11144 * options.h (class General_options): Add --undefined-version.
11145 * script.cc (struct Version_expression): Add was_matched_by_symbol
11146 field.
11147 (Version_script_info::matched_symbol): New function.
11148 (Version_script_info::get_symbol_version_helper): Call
11149 matched_symbol.
11150 (Version_script_info::check_unmatched_names): New function.
11151 * script.h (class Version_script_info): Update declarations.
11152 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
11153
9c4ae156
ILT
11154 * options.h (class General_options): Use DEFINE_bool_alias for
11155 allow_multiple_definition.
11156 * resolve.cc (Symbol_table::should_override): Don't test
11157 allow_multiple_definition.
11158
dde3f402
ILT
11159 PR 10980
11160 * options.h (class General_options): Add --cref.
11161 * main.cc (main): Print cref table if --cref. Don't close mapfile
11162 until after printing cref table.
11163 * cref.cc: Include "symtab.h".
11164 (class Cref_inputs): Define Cref_table_compare and Cref_table.
11165 (Cref_table_compare::operator()): New function.
11166 (Cref_inputs::gather_cref): New function.
11167 (filecol): New static const.
11168 (Cref_inputs::print_cref): New function.
11169 (Cref::print_cref): New function.
11170 * cref.h: Include <cstdio>.
11171 (class Cref): Update declarations.
11172 * mapfile.h (Mapfile::file): New function.
11173 * object.h (class Object): Define Symbols. Declare virtual
11174 do_get_global_symbols.
11175 (Object::get_global_symbols): New function.
11176 * object.cc (Input_objects::add_object): Pass object to cref_ if
11177 --cref.
11178 (Input_objects::archive_start): Likewise.
11179 (Input_objects::archive_stop): Likewise.
11180 (Input_objects::print_cref): New function.
11181 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
11182 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
11183 --cref.
11184 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
11185 function.
11186 * plugin.h (class Sized_pluginobj): Update declarations.
11187
8781f709
ILT
111882010-01-05 Ian Lance Taylor <iant@google.com>
11189
11190 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
11191 to is_default_version. Rename insdef to insdefault.
11192 (Symbol_table::add_from_relobj): Rename def to is_default_version
11193 and local to is_forced_local.
11194 (Symbol_table::add_from_pluginobj): Likewise.
11195 (Symbol_table::add_from_dynobj): Likewise.
11196 (Symbol_table::define_special_symbol): Rename insdef to
11197 insdefault.
11198
fe35d28d
ILT
111992010-01-04 Ian Lance Taylor <iant@google.com>
11200
30bc8c46
ILT
11201 PR 10980
11202 * options.h (class General_options): Add
11203 --allow-multiple-definition and -z muldefs.
11204 * resolve.cc (Symbol_table::should_override): Don't warn about a
11205 multiple symbol definition if --allow-multiple-definition or -z
11206 muldefs.
11207
7eaea549
ILT
11208 PR 10980
11209 * options.h (class General_options): Add --add-needed and
11210 --copy-dt-needed-entries. Tweak --as-needed help entry.
11211 * object.cc (Input_objects::check_dynamic_dependencies): Give an
11212 error if --copy-dt-needed-entries aka --add-needed is used and
11213 would cause a change in behaviour.
11214
fe35d28d
ILT
11215 PR 10980
11216 * options.h (class General_options): Add -G as a short version of
11217 --shared. Add no-op options -assert, -g, and -i.
11218
55a2bb35
ST
112192010-01-04 Sriraman Tallam <tmsriram@google.com>
11220
11221 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
11222 check for .text or .gnu.linkonce.t sections.
11223 * icf.cc (Icf::find_identical_sections): Ditto.
11224 Change the detection for mangled function name within the section
11225 name.
11226 * icf.h (is_section_foldable_candidate): New function.
11227
719328e1
ILT
112282009-12-30 Ian Lance Taylor <iant@google.com>
11229
11230 PR 10980
11231 * options.h (class General_options): Permit two dashes with
11232 --retain-symbols-file.
11233
d7bb5745
ILT
112342009-12-30 Ian Lance Taylor <iant@google.com>
11235
403a15dd
ILT
11236 PR 10979
11237 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
11238 don't put the file header and segment headers in the text
11239 segment.
11240
eda294df
ILT
11241 PR 10979
11242 * common.cc (Sort_commons::operator()): Stabilize sort when both
11243 entries are NULL.
11244 (Symbol_table::do_allocate_commons_list): When allocating common
11245 symbols, skip a symbol which is no longer common.
11246 * symtab.h (Symbol::is_common): Test whether the symbol comes from
11247 an object before checking its type.
11248 * testsuite/common_test_2.c: New file.
11249 * testsuite/common_test_3.c: New file.
11250 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
11251 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
11252 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
11253 (common_test_2_pic.o, common_test_2.so): New targets.
11254 (common_test_3_pic.o, common_test_3.so): New targets.
11255 * testsuite/Makefile.in: Rebuild.
11256
d7bb5745
ILT
11257 PR 10979
11258 * script.cc (read_input_script): If we see a new SECTIONS clause,
11259 and we have added an input section, give an error.
11260 * layout.h (class Layout): Add have_added_input_section function.
11261 Add have_added_input_section_ field.
11262 * layout.cc (Layout::Layout): Initialize
11263 have_added_input_section_.
11264 (Layout::layout): Set have_added_input_section_.
11265 (Layout::layout_eh_frame): Likewise.
11266
fc59c572
ILT
112672009-12-30 Ian Lance Taylor <iant@google.com>
11268
11269 PR 10931
11270 * options.h (class General_options): Add --sort-common option.
11271 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
11272 * common.cc (Sort_common): Add sort_order parameter to
11273 constructor. Add sort_order_ field.
11274 (Sort_commons::operator): Check sort_order_.
11275 (Symbol_table::allocate_commons): Determine the sort order.
11276 (Symbol_table::do_allocate_commons): Add sort_order parameter.
11277 Change all callers.
11278 (Symbol_table::do_allocate_commons_list): Likewise.
11279
1c74fab0
ILT
112802009-12-30 Ian Lance Taylor <iant@google.com>
11281
11282 PR 10916
11283 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
11284 symbols from this object, don't change the visibility of an
11285 undefined symbol.
11286 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
11287
6affe781
ILT
112882009-12-30 Ian Lance Taylor <iant@google.com>
11289
11290 PR 10861
11291 * script.h (class Version_script_info): Define Language enum.
11292 Update declarations. Define Glob, Exact, and Lookup types. Add
11293 new fields globals_, locals_, and is_finalized_.
11294 * script.cc: Various formatting fixes.
11295 (class Parser_closure): Change language_stack_ from a vector of
11296 std::string to one of Version_script_info::Language. Adjust all
11297 uses accordingly.
11298 (class Lazy_demangler): Remove.
11299 (struct Version_expression): Change language from std::string to
11300 Version_script_info::Language.
11301 (Version_script_info::Version_script_info): New function.
11302 (Version_script_info::~Version_script_info): Don't call clear.
11303 (Version_script_info::finalize): New function.
11304 (Version_script_info::build_lookup_tables): New function.
11305 (Version_script_info::build_expression_list_lookup): New
11306 function.
11307 (Version_script_info::get_symbol_version_helper): Rewrite to use
11308 lookup tables.
11309 (Version_script_info::print_expression_list): Adjust to use
11310 Version_script_info::Language.
11311 (script_push_lex_into_version_mode): Check that the version script
11312 has not been finalized.
11313 (version_script_push_lang): Change language string to
11314 Version_script_info::Language.
11315 * options.cc (Command_line::version_script): New function.
11316 * options.h (class General_options): Add finalize_dynamic_list
11317 function. Change version_script from declaration to definition.
11318 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
11319 * testsuite/version_script.map: Remove duplicate def of foo.
11320 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
11321 version_script.map.
11322 * testsuite/Makefile.in: Rebuild.
11323
818bf354
ILT
113242009-12-30 Ian Lance Taylor <iant@google.com>
11325
11326 PR 10843
11327 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
11328 if the input symbol index is 0, make the output symbol index 0.
11329
ebcc8304
ILT
113302009-12-30 Ian Lance Taylor <iant@google.com>
11331
11332 PR 10670
11333 * options.h (class General_options): Add -x/--discard-all.
11334 * object.cc (Sized_relobj::do_count_local_symbols): Handle
11335 --discard-all. If the local symbol needs a dynamic entry, check
11336 that before handling --discard-locals.
11337
176fe33f
ILT
113382009-12-30 Ian Lance Taylor <iant@google.com>
11339
bb321bb1
ILT
11340 PR 10450
11341 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
11342 flags to PF_R.
11343 (Output_segment::add_output_section): Don't change the flags if
11344 the type is PT_TLS.
11345
176fe33f
ILT
11346 PR 10450
11347 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
11348 GNU hash table if they need a dynamic value. Otherwise, don't add
11349 them if they are defined in a dynamic object or are forced local.
11350
e8cd95c7
ILT
113512009-12-29 Ian Lance Taylor <iant@google.com>
11352
1b81fb71
ILT
11353 PR 10450
11354 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
11355 .gnu.hash table for a 32-bit target.
11356
8d6d383d
ILT
11357 PR 10450
11358 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
11359 regular and a dynamic object only needs a dynamic symbol table
11360 entry if it is externally visible.
11361
e785ec03
ILT
11362 PR 10450
11363 * i386.cc (class Target_i386): Initialize global_offset_table_ in
11364 constructor. Add global_offset_table_ field.
11365 (Target_i386::got_section): Set global_offset_table_.
11366 (Target_i386::do_finalize_sections): Set global_offset_table_
11367 size.
11368 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
11369 in constructor. Add global_offset_table_ field.
11370 (Target_x86_64::got_section): Set global_offset_table_.
11371 (Target_x86_64::do_finalize_sections): Set global_offset_table_
11372 size.
11373
1a2dff53
ILT
11374 * layout.cc (Layout::Layout): Initialize increase_relro_.
11375 (Layout::get_output_section): Add is_relro, is_last_relro, and
11376 is_first_non_relro parameters. Change all callers.
11377 (Layout::choose_output_section): Likewise.
11378 (Layout::add_output_section_data): Likewise.
11379 (Layout::make_output_section): Likewise.
11380 (Layout::set_segment_offsets): Clear increase_relro when using a
11381 linker script.
11382 * layout.h (class Layout): Add increase_relro method. Add
11383 increase_relro_ field. Update declarations.
11384 * output.cc (Output_section::Output_section): Initialize
11385 is_last_relro_ and is_first_non_relro_.
11386 (Output_segment::add_output_section): Group relro sections is
11387 do_sort is true. Handle is_last_relro and is_first_non_relro.
11388 (Output_segment::maximum_alignment): Remove relro handling.
11389 (Output_segment::set_section_addresses): Add increase_relro
11390 parameter. Change all callers. Add initial alignment to align
11391 relro sections on separate page. Remove old relro handling.
11392 (Output_segment::set_section_list_addresses): Remove in_relro
11393 parameter. Change all callers.
11394 (Output_segment::set_offset): Add increase parameter. Change all
11395 callers. Remove old relro handling.
11396 * output.h (class Output_section): Add new methods: is_last_relro,
11397 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
11398 Add is_last_relro_ and is_first_non_relro_ fields.
11399 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
11400 Create separate .got.plt section. Call increase_relro.
11401 * x86_64.cc (Target_x86_64::got_section): Likewise.
11402 * testsuite/relro_script_test.t: Add .got.plt.
11403
f0ba79e2
ILT
11404 PR 10450
11405 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
11406 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
11407 (Layout::finalize): Call set_dynamic_symbol_size.
11408 (Layout::set_dynamic_symbol_size): New function.
11409 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
11410 set_dynamic_symbol_size.
11411
e8cd95c7
ILT
11412 PR 10450
11413 * output.h (class Output_section): Add is_entsize_zero_ field.
11414 * output.cc (Output_section::Output_section): Initialize
11415 is_entsize_zero_.
11416 (Output_section::set_entsize): If two different entsizes are
11417 requested, force it to zero.
11418 (Output_section::add_input_section): Set flags for .debug_str
11419 before updating section flags. Set entsize.
11420 (Output_section::update_flags_for_input_section): Set SHF_MERGE
11421 and SHF_STRING if all input sections have those flags.
11422
3e1b9a8a
RÁE
114232009-12-29 Rafael Espindola <espindola@google.com>
11424
11425 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
11426 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
11427 reporting.
3e1b9a8a 11428
3dcad376
ST
114292009-12-29 Sriraman Tallam <tmsriram@google.com>
11430
11431 * options.cc (General_options::parse_version): Allow -v to exit
11432 without an error if there is nothing to link.
11433
084e2665
ILT
114342009-12-29 Ian Lance Taylor <iant@google.com>
11435
11436 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
11437 using a version of gcc before 4.1.
11438 * configure: Rebuild.
11439
250acde3
CD
114402009-12-28 Chris Demetriou <cgd@google.com>
11441
11442 * attributes.cc (Output_attributes_section_data::do_write): Use
11443 std::vector::front rather than std::vector::data.
11444
99fff23b
ILT
114452009-12-28 Ian Lance Taylor <iant@google.com>
11446
11447 * symtab.h (class Symbol_table): Add enum Defined.
11448 * resolve.cc (Symbol_table::should_override): Add defined
11449 parameter. Change all callers. Test whether object is NULL
11450 before calling a method on it.
11451 (Symbol_table::report_resolve_problem): Add defined parameter.
11452 Change all callers.
11453 (Symbol_table::should_override_with_special): Likewise.
11454 * symtab.cc (Symbol_table::define_in_output_data): Add defined
11455 parameter. Change all callers.
11456 (Symbol_table::do_define_in_output_data): Likewise.
11457 (Symbol_table::define_in_output_segment): Likewise.
11458 (Symbol_table::do_define_in_output_segment): Likewise.
11459 (Symbol_table::define_as_constant): Likewise.
11460 (Symbol_table::do_define_as_constant): Likewise.
11461 * script.h (class Symbol_assignment): Add is_defsym parameter to
11462 constructor; change all callers.
11463 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
11464 parameter. Change all callers. Add is_defsym_ field.
11465 (class Parser_closure): Add parsing_defsym parameter to
11466 constructor; change all callers. Add parsing_defsym accessor
11467 function. Add parsing_defsym_ field.
11468
556bd683
ILT
114692009-12-28 Ian Lance Taylor <iant@google.com>
11470
11471 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 11472 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 11473
1782c879
ILT
114742009-12-23 Ian Lance Taylor <iant@google.com>
11475
11476 * i386.cc (Target_i386::do_calls_non_split): Recognize
11477 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
11478 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
11479 -fsplit-stack prologue when using %r11.
1782c879 11480
329ca2b1
ST
114812009-12-21 Sriraman Tallam <tmsriram@google.com>
11482
11483 * options.cc (General_options::parse_version): Make -v continue and do
11484 the link like GNU ld does.
11485
d675ff46
RÁE
114862009-12-17 Rafael Avila de Espindola <espindola@google.com>
11487
11488 * Makefile.am (CCFILES): Add timer.cc.
11489 (HFILES): Add timer.h.
11490 * configure.ac: Check for sysconf and times.
11491 * main.cc: include timer.h.
11492 (main): Use Timer instead of get_run_time.
11493 * timer.cc: New.
11494 * timer.h: New.
11495 * workqueue.cc: include timer.h.
11496 (Workqueue::find_and_run_task):
11497 Report user, sys and wall time.
11498 * Makefile.in: Regenerate.
11499 * config.in: Regenerate.
11500 * configure: Regenerate.
11501
d6344fb5
DK
115022009-12-16 Doug Kwan <dougkwan@google.com>
11503
11504 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
11505 sections.
11506 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
11507 relaxed input sections.
11508 * output.cc (Output_section::find_relaxed_input_section): Change
11509 return type to Output_relaxed_input_section pointer. Adjust code
11510 for new type of relaxed_input_section_map_.
11511 * output.h (Output_section::find_relaxed_input_section): Change
11512 return type to Output_relaxed_input_section pointer.
11513 (Output_section::Output_relaxed_input_section_by_input_section_map):
11514 New type.
11515 (Output_section::relaxed_input_section_map_): Change type to
11516 Output_section::Output_relaxed_input_section_by_input_section_map.
11517 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
11518 input section.
11519
0e0d5469
ILT
115202009-12-15 Ian Lance Taylor <iant@google.com>
11521
11522 * layout.cc (Layout::create_shstrtab): Only write out after input
11523 sections if we are compressing debug sections.
11524
0649a889
ILT
115252009-12-15 Ian Lance Taylor <iant@google.com>
11526
11527 * archive.cc (Archive::add_symbols): Only look up a symbol without
11528 a version if there is, in fact, a version.
11529
2ea97941
ILT
115302009-12-14 Ian Lance Taylor <iant@google.com>
11531
11532 Revert -Wshadow changes, all changes from:
11533 2009-12-11 Doug Kwan <dougkwan@google.com>
11534 2009-12-11 Nick Clifton <nickc@redhat.com>
11535 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
11536
b0eec2cc
DK
115372009-12-11 Doug Kwan <dougkwan@google.com>
11538
11539 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
11540 due to -Wshadow.
11541 * attributes.cc (Object_attribute::size): Ditto.
11542 (Attributes_section_data::size): Ditto.
11543 (Attributes_section_data::Attributes_section_data): Ditto.
11544 (Output_attributes_section_data::do_write): Ditto.
11545 * attributes.h (Object_attribute::set_type): Ditto.
11546 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
11547
91d6fa6a
NC
115482009-12-11 Nick Clifton <nickc@redhat.com>
11549
11550 * archive.cc: Fix shadowed variable warnings.
11551 * arm.cc: Likewise.
11552 * compressed_output.cc: Likewise.
11553 * compressed_output.h: Likewise.
11554 * configure: Likewise.
11555 * dwarf_reader.cc: Likewise.
11556 * dynobj.cc: Likewise.
11557 * dynobj.h: Likewise.
11558 * ehframe.cc: Likewise.
11559 * ehframe.h: Likewise.
11560 * errors.cc: Likewise.
11561 * expression.cc: Likewise.
11562 * fileread.cc: Likewise.
11563 * fileread.h: Likewise.
11564 * freebsd.h: Likewise.
11565 * i386.cc: Likewise.
11566 * icf.cc: Likewise.
11567 * incremental.h: Likewise.
11568 * layout.cc: Likewise.
11569 * layout.h: Likewise.
11570 * mapfile.cc: Likewise.
11571 * merge.cc: Likewise.
11572 * merge.h: Likewise.
11573 * object.cc: Likewise.
11574 * object.h: Likewise.
11575 * options.h: Likewise.
11576 * output.cc: Likewise.
11577 * output.h: Likewise.
11578 * parameters.cc: Likewise.
11579 * plugin.cc: Likewise.
11580 * powerpc.cc: Likewise.
11581 * reduced_debug_output.cc: Likewise.
11582 * reduced_debug_output.h: Likewise.
11583 * reloc.cc: Likewise.
11584 * reloc.h: Likewise.
11585 * resolve.cc: Likewise.
11586 * script-sections.cc: Likewise.
11587 * script.cc: Likewise.
11588 * script.h: Likewise.
11589 * sparc.cc: Likewise.
11590 * symtab.cc: Likewise.
11591 * symtab.h: Likewise.
11592 * target-select.cc: Likewise.
11593 * target-select.h: Likewise.
11594 * token.h: Likewise.
11595 * workqueue.cc: Likewise.
11596 * workqueue.h: Likewise.
11597 * x86_64.cc: Likewise.
11598
a0351a69
DK
115992009-12-10 Doug Kwan <dougkwan@google.com>
11600
11601 * arm.cc (attributes.h): New include.
11602 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
11603 (Arm_relobj::~Arm_relobj): Delete object pointed by
11604 attributes_section_data_.
11605 (Arm_relobj::attributes_section_data): New method definition.
11606 (Arm_relobj::attributes_section_data_): New data member declaration.
11607 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
11608 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
11609 attributes_section_data_.
11610 (Arm_dynobj::attributes_section_data): New method definition.
11611 (Arm_dynobj::attributes_section_data_): New data member declaration.
11612 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
11613 initialization value of may_use_blx_ to false.
2e702c99 11614 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
11615 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
11616 object attributes to compute results instead of hard-coding.
11617 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
11618 Target_arm::get_secondary_compatible_arch,
11619 Target_arm::set_secondary_compatible_arch
11620 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11621 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
11622 New method declarations.
11623 (Target_arm::get_aeabi_object_attribute): New method definition.
11624 (Target_arm::attributes_section_data_): New data member declaration.
11625 (read_arm_attributes_section): New template definition.
11626 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
11627 (Arm_dynobj::do_read_symbols): Ditto.
11628 (Target_arm::do_finalize_sections): Merge attributes sections from
11629 input. Check for BLX use after attributes section merging.
11630 Fix __exidx_start and __exidx_end visibility. Create an
11631 .ARM.attributes section if necessary.
11632 (Target_arm::get_secondary_compatible_arch,
11633 Target_arm::set_secondary_compatible_arch,
11634 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11635 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 11636 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
11637 New method definitions.
11638
b59befec
ILT
116392009-12-09 Ian Lance Taylor <iant@google.com>
11640
11641 * plugin.cc (Plugin::load): Don't cast from void* to a function
11642 pointer.
11643
1276bc89
ILT
116442009-12-09 Ian Lance Taylor <iant@google.com>
11645
11646 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
11647 information fields.
11648
2f2de248
L
116492009-12-09 H.J. Lu <hongjiu.lu@intel.com>
11650
11651 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
11652 Replace two_file_shared_1.so with two_file_shared_2.so.
11653 * testsuite/Makefile.in: Regenerated.
11654
4f787271
DK
116552009-12-08 Doug Kwan <dougkwan@google.com>
11656
11657 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
11658 (HFILES): Add attributes.h and int_encoding.h.
11659 * Makefile.in: Regenerate.
11660 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
11661 function definitions to int_encoding.cc
11662 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
11663 prototypes to int_encoding.h
11664 * reduced_debug_output.cc (int_encoding.h): New include.
11665 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
11666 function definitions to int_encoding.cc
11667 (insert_into_vector, read_from_pointer): Move template definitions to
11668 int_encoding.h
11669 * attributes.cc: New file.
11670 * attributes.h: New file.
11671 * int_encoding.cc: New file.
11672 * int_encoding.h: New file.
11673
20b52f1a
RÁE
116742009-12-07 Rafael Avila de Espindola <espindola@google.com>
11675
11676 PR gold/11055
11677 * incremental-dump.cc (dump_incremental_inputs): New.
11678 (main): Use dump_incremental_inputs.
11679
53d7974c
L
116802009-12-07 H.J. Lu <hongjiu.lu@intel.com>
11681
11682 PR gold/10893
11683 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
11684 checking elfcpp::STT_FUNC.
11685 (Target_i386::Relocate::relocate): Likewise.
11686 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
11687
11688 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
11689 symbols from shared libraries into normal FUNC symbols.
11690
11691 * symtab.h (Symbol): Add is_func and use it.
11692
05a352e6
DK
116932009-12-05 Doug Kwan <dougkwan@google.com>
11694
11695 * arm.cc (Target_arm::arm_info): Initialize new fields
11696 attributes_section and attributes_vendor.
11697 * i386.cc (Target_i386::i386_info): Same.
11698 * object.cc (Sized_relobj::do_layout): Skip attribute section.
11699 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
11700 fields attributes_section and attributes_vendor.
53d7974c 11701 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
11702 * target.h (Target::attributes_section, Target::attributes_vendor,
11703 Target::is_attributes_section, Target::attribute_arg_type,
11704 Target::attributes_order): New method definitions.
11705 (Target::Target_info::attributes_section,
11706 Target::Target_info::attributes_vendor): New fields.
11707 (Target::do_attribute_arg_type, Target::do_attributes_order): New
11708 virtual method definitions.
11709 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
11710 attributes_section and attributes_vendor.
11711 * testsuite/testfile.cc (Target_test::test_target_info): Same.
11712
f4e5969c
DK
117132009-12-05 Doug Kwan <dougkwan@google.com>
11714
11715 * arm.cc: Update comments about interworking and stub generation.
11716 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
11717 considered as non-PIC.
11718 (Arm_relocate_functions::base_abs): Fix formatting.
11719 (Arm_relocate_functions::got_prel): Fix comment. Change interface
11720 of function to use GOT entry address instead of offset.
11721 (Target_arm::Scan::global): Issue an error if a symbol would need a
11722 PLT does not get one because it is untyped. Remove code to create
11723 dynamic symbols for relative branches.
11724 (Target_arm::Relocate::relocate: Use 0 instead of false since function
11725 takes unsigned integer instead of boolean.
11726
1abce4a6
L
117272009-12-05 H.J. Lu <hongjiu.lu@intel.com>
11728
11729 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
11730 (two_file_test_LDADD): Likewise.
11731 (common_test_1_LDADD): Likewise.
11732 (exception_test_LDADD) Likewise.
11733 (weak_test_LDADD): Likewise.
11734 (many_sections_test_LDADD): Likewise.
11735 (initpri1_LDADD): Likewise.
11736 (script_test_1_LDADD): Likewise.
11737 (script_test_2_LDADD): Likewise.
11738 (justsyms_LDADD): Likewise.
11739 (binary_test_LDADD): Likewise.
11740 (large_LDADD): Likewise.
11741 * testsuite/Makefile.in: Regenerated.
11742
adcf2816 117432009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 11744
adcf2816
L
11745 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
11746 (Symbol_table::override_with_special): Likewise.
11747 (Symbol_table::add_from_object): Likewise.
11748
28e67f5d
RÁE
117492009-12-04 Rafael Avila de Espindola <espindola@google.com>
11750
11751 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11752 Don't set the data_offset twice.
11753
ae10a101
RÁE
117542009-12-04 Rafael Avila de Espindola <espindola@google.com>
11755
11756 * testsuite/Makefile.in: Regenerate.
11757
f59f41f3
DK
117582009-12-03 Doug Kwan <dougkwan@google.com>
11759
11760 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
11761 (Target_arm::do_finalize_sections): Add parameter for symbol table
11762 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
11763 * i386.cc (Target_i386::do_finalize_sections): Add an additional
11764 parameter for symbol table pointer.
11765 * layout.cc (Layout::finalize): Call Target::finalize_sections with
11766 an additional parameter for a pointer to symbol table.
11767 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
11768 parameter for a symbol table pointer.
11769 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
11770 * target.h (Target::finalize_sections, Target::do_finalize_sections):
11771 Ditto.
11772 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
11773 parameter for a symbol table pointer.
11774
ca55d848
RÁE
117752009-12-03 Rafael Avila de Espindola <espindola@google.com>
11776
11777 * incremental.cc (Incremental_inputs_header)
11778 (Incremental_inputs_header_write, Incremental_inputs_entry)
11779 (Incremental_inputs_entry_write): Move ...
11780 * incremental.h (Incremental_inputs_header)
11781 (Incremental_inputs_header_write, Incremental_inputs_entry)
11782 (Incremental_inputs_entry_write): here.
11783
3aec4f9c
RÁE
117842009-12-02 Rafael Avila de Espindola <espindola@google.com>
11785
11786 * incremental.cc (make_sized_incremental_binary): Set the target.
11787 Error if it is incompatible.
11788 * output.h (Output_file): Add filename method.
11789
9c0ae74d
RÁE
117902009-12-02 Rafael Avila de Espindola <espindola@google.com>
11791
11792 * incremental.cc (Incremental_inputs_entry): Remove unused argument
11793 from the get_* methods.
11794
a45500ae
RÁE
117952009-12-02 Rafael Avila de Espindola <espindola@google.com>
11796
11797 * incremental-dump.cc (main): Check that the offeset of a script is 0.
11798 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11799 Write 0 for the data_offset of scripts.
11800
325e6408
RÁE
118012009-12-02 Rafael Avila de Espindola <espindola@google.com>
11802
11803 * testsuite/Makefile.am: Add the incremental_test.sh test.
11804 * testsuite/incremental_test.sh: New.
11805 * testsuite/incremental_test_1.c: New.
11806 * testsuite/incremental_test_2.c: New.
11807
954c3e2e
RÁE
118082009-12-01 Rafael Avila de Espindola <espindola@google.com>
11809
703d02da 11810 * incremental-dump.cc (main): Fix typos.
954c3e2e 11811
f8086623
RÁE
118122009-11-27 Rafael Avila de Espindola <espindola@google.com>
11813
11814 PR gold/11025
11815 * incremental-dump.cc (main): Use llu to print 64 bit values.
11816
3b0dd6ac
L
118172009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
11818 H.J. Lu <hongjiu.lu@intel.com>
11819
11820 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
11821 $(LIBDL).
11822 (incremental_dump_LDADD): Likewise.
11823 * Makefile.in: Regenerated.
11824
a6d1ef57 118252009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 11826
a6d1ef57
DK
11827 Revert:
11828
11829 2009-11-25 Doug Kwan <dougkwan@google.com>
11830
11831 * arm.cc (Target_arm::Target_arm): Move method definition
11832 outside of class definition. Add code to handle
11833 --target1-rel, --target1-abs and --target2= options.
11834 (Target_arm::get_reloc_reloc_type): Change method to be
11835 non-static and const.
11836 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
11837 New data member declaration.
11838 (Target_arm::Scan::local, Target_arm::Scan::global,
11839 Target_arm::Relocate::relocate,
11840 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11841 Adjust call to Target_arm::get_real_reloc_type.
11842 (Target_arm::get_real_reloc_type): Use command line options
11843 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11844 * options.h (--target1-rel, --target1-abs, --target2): New
11845 ARM-only options.
11846
50aeb7d4
DK
118472009-11-25 Doug Kwan <dougkwan@google.com>
11848
11849 * arm.cc (Target_arm::Target_arm): Move method definition outside of
11850 class definition. Add code to handle --target1-rel, --target1-abs
11851 and --target2= options.
11852 (Target_arm::get_reloc_reloc_type): Change method to be non-static
11853 and const.
11854 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
11855 member declaration.
11856 (Target_arm::Scan::local, Target_arm::Scan::global,
11857 Target_arm::Relocate::relocate,
11858 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
11859 call to Target_arm::get_real_reloc_type.
11860 (Target_arm::get_real_reloc_type): Use command line options to
11861 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11862 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
11863 options.
11864
51938283
DK
118652009-11-25 Doug Kwan <dougkwan@google.com>
11866
11867 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
11868 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
11869 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
11870 formatting.
11871 (Arm_relocate_functions::thm_call): Replace body with a call to
11872 Arm_relocate_functions::thumb_branch_common.
11873 (Arm_relocate_functions::thm_jump24,
11874 Arm_relocate_functions::thm_xpc22): New method definitions.
11875 (Arm_relocate_functions::thumb_branch_common): New method definition.
11876 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
11877 operator.
11878 (Target_arm::Relocate::relocate): Adjust call to thm_call.
11879 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
11880
e2b8f3c4
RÁE
118812009-11-24 Rafael Avila de Espindola <espindola@google.com>
11882
11883 * Makefile.am: Build incremental-dump
11884 * Makefile.in: Regenerate.
11885 * incremental-dump.cc: New.
11886 * incremental.cc (Incremental_inputs_header_data,
11887 Incremental_inputs_entry_data): Move to incremental.h
11888 * incremental.h: (Incremental_inputs_header_data,
11889 Incremental_inputs_entry_data): Move from incremental.cc
11890
bcba9aec
RÁE
118912009-11-24 Rafael Avila de Espindola <espindola@google.com>
11892
11893 * incremental.cc (Incremental_inputs_header,
11894 Incremental_inputs_header_write, Incremental_inputs_entry,
11895 Incremental_inputs_entry_write): Add a typedef with the data type.
11896
7c3afe08
RÁE
118972009-11-24 Rafael Avila de Espindola <espindola@google.com>
11898
11899 * incremental.cc (Incremental_inputs_header,
11900 Incremental_inputs_header_write, Incremental_inputs_entry,
11901 Incremental_inputs_entry_write): Update comment about which
11902 type has the filed descriptions.
11903
d204b6e9
DK
119042009-11-15 Doug Kwan <dougkwan@google.com>
11905
11906 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
11907 (Arm_relocate_functions::arm_branch_common): Change method defintion
11908 in class definition to a method declaration and update list of formal
11909 parameters.
11910 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
11911 Arm_relocation_functions::jump24): Adjust call to
11912 Arm_relocate_functions::arm_branch_common. Update list of formal
11913 parameters.
11914 (Arm_relocate_functions::xpc25): New method definition.
11915 (Arm_relocate_functions::arm_branch_common): Move method defintion
11916 out from class definition. Use stubs for mode-switching and extending
11917 branch ranges.
11918 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
11919 specially. Change code to enable use of stubs in ARM branches.
11920
43d12afe
DK
119212009-11-10 Doug Kwan <dougkwan@google.com>
11922
11923 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
11924 in method declaration.
11925 (Target_arm::relocate_stub): New method declaration.
11926 (Target_arm::default_target): Change to return a pointer instead of
11927 a const reference.
11928 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
11929 Target_arm::default_target.
11930 (Arm_Relobj::do_relocate_sections): Remove options paramater in
11931 method definition.
11932 (Target_arm::relocate_section): Adjust view.
11933 (Target_arm::relocate_stub): New method definition.
11934
ac33a407
DK
119352009-11-10 Doug Kwan <dougkwan@google.com>
11936
11937 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
11938 a format warning.
11939 * incremental.cc (open_incremental_binary): Initialized local
11940 variables to avoid warnings.
11941 * object.cc (make_elf_object): Ditto.
11942 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
11943 a format warning.
e1df38aa 11944
88ee28e9
L
11945009-11-09 H.J. Lu <hongjiu.lu@intel.com>
11946
11947 PR gold/10930
11948 * testsuite/plugin_test.c: Include "config.h".
11949
2daedcd6
DK
119502009-11-09 Doug Kwan <dougkwan@google.com>
11951
11952 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
11953 (arm_symbol_value): Remove.
11954 (Arm_relocate_functions::arm_branch_common,
11955 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
11956 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
11957 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
11958 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
11959 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
11960 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
11961 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
11962 Arm_relocate_functions::thm_mobw_abs_nc,
11963 Arm_relocate_functions::thm_mov_abs,
11964 Arm_relocate_functions::movw_prel_nc,
11965 Arm_relocate_functions::thm_movt_abs,
11966 Arm_relocate_functions::movt_prel,
11967 Arm_relocate_functions::thm_movw_prel_nc,
11968 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
11969 (Target_arm::Relocate::relocate): Only decompose address into two
11970 parts if relocation type uses the thumb-bit and pass the actual
11971 bit instead of a flag indicating that the thumb-bit is used. Adjust
11972 calls to methods in Arm_relocate_functions for this change.
11973
1276bc89 119742009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
11975
11976 PR 10925
11977 * reloc.cc: Instantiate
11978 Sized_relobj::initialize_input_to_output_maps and
11979 Sized_relobj:free_input_to_output_maps.
11980
e53ad1b5
ILT
119812009-11-06 Ian Lance Taylor <iant@google.com>
11982
11983 PR 10876
11984 * defstd.cc (in_segment): Set only_if_ref true for "end".
11985
eb44217c
DK
119862009-11-06 Doug Kwan <dougkwan@google.com>
11987
11988 * arm.cc (class Reloc_stub): Correct a comment.
11989 (Target_arm::Target_arm): Initialize arm_input_section_map_.
11990 (Target_arm::scan_section_for_stubs): New method declaration.
11991 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
11992 Change methods from private to protected.
11993 (Target_arm::do_may_relax): New method definition.
11994 (Target_arm::do_relax, Target_arm::group_sections,
11995 Target_arm::scan_reloc_for_stub,
11996 Target_arm::scan_reloc_section_for_stubs): New method declarations.
11997 (Target_arm::arm_input_section_map_): New data member declaration.
11998 (Target_arm::scan_reloc_for_stub,
11999 Target_arm::scan_reloc_section_for_stubs,
12000 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
12001 Target_arm::do_relax): New method definitions.
12002
5d329b7d
ILT
120032009-11-06 Mikolaj Zalewski <mikolaj@google.com>
12004
12005 * configure.ac: Check for (struct stat)::st_mtim
12006 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
12007 * config.in: Regenerate.
12008 * configure: Regenerate.
12009
96a0d71b
ILT
120102009-11-05 Ian Lance Taylor <iant@google.com>
12011
12012 PR 10910
12013 * output.cc (Output_segment::add_output_section): Add missing
12014 return statement.
12015
594c8e5e
ILT
120162009-11-04 Ian Lance Taylor <iant@google.com>
12017
12018 PR 10880
12019 * object.h (class Object): Add is_needed and set_is_needed
12020 methods. Add is_needed_ field. Make bool fields into bitfields.
12021 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
12022 defined in a dynamic object and referenced by a regular object,
12023 set is_needed for the dynamic object.
12024 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
12025 if the file is marked with as_needed and it is not needed.
12026
22b127cc
ILT
120272009-11-04 Ian Lance Taylor <iant@google.com>
12028
12029 PR 10887
12030 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
12031 tags if data is discarded by linker script.
12032 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12033 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12034 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12035 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12036
f5c870d2
ILT
120372009-11-04 Ian Lance Taylor <iant@google.com>
12038
12039 * layout.cc (Layout::get_output_section): Add is_interp and
12040 is_dynamic_linker_section parameters. Change all callers.
12041 (Layout::choose_output_section): Likewise.
12042 (Layout::make_output_section): Likewise.
12043 (Layout::add_output_section_data): Add is_dynamic_linker_section
12044 parameter. Change all callers.
12045 * layout.h (class Layout): Update declarations.
12046 * output.h (class Output_section): Add is_interp, set_is_interp,
12047 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
12048 Add is_interp_, is_dynamic_linker_section_ fields. Change
12049 generate_code_fills_at_write_ to a bitfield.
12050 * output.cc (Output_section::Output_sections): Initialize new
12051 fields.
12052 (Output_segment::add_output_section): Add do_sort parameter.
12053 Change all callers.
12054
1ae4d23b
ILT
120552009-11-03 Ian Lance Taylor <iant@google.com>
12056
12057 PR 10860
12058 * options.h (class General_options): Add --warn-common.
12059 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
12060 merging two common symbols.
12061 (Symbol_table::should_override): Handle --warn-common when merging
12062 a common symbol with a defined symbol. Use report_resolve_problem
12063 for multiple definitions.
12064 (Symbol_table::report_resolve_problem): New function.
12065 * symtab.h (class Symbol_table): Declare report_resolve_problem.
12066
55da9579
DK
120672009-11-03 Doug Kwan <dougkwan@google.com>
12068
12069 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
12070 stub_factory_.
12071 (Target_arm::stub_factory): New method definition.
12072 (Target_arm::new_arm_input_section,
12073 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
12074 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 12075 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
12076 New type definitions.
12077 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
12078 member declarations.
12079 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
12080 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
12081 New method definitions.
12082
37a9ac43
ILT
120832009-11-03 Ian Lance Taylor <iant@google.com>
12084
12085 * options.h (class General_options): Add --warn_constructors.
12086
b3d6a3d4
ILT
120872009-11-03 Ian Lance Taylor <iant@google.com>
12088
12089 PR 10893
12090 * defstd.cc (in_section): Add entries for __rel_iplt_start,
12091 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
12092
934b01dd
ILT
120932009-11-03 Ian Lance Taylor <iant@google.com>
12094
12095 PR 10895
12096 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
12097 --msgid-bugs-address.
12098 (install-pdf): New target.
12099 (install-data_yes): Look up one directory to find mkinstalldirs.
12100
03c1939b
L
121012009-11-03 H.J. Lu <hongjiu.lu@intel.com>
12102
12103 * po/Make-in (.po.gmo): Don't generate .gmo files in source
12104 tree.
12105
ebd95253
DK
121062009-10-30 Doug Kwan <dougkwan@google.com>
12107
12108 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
12109
e9bbb538
DK
121102009-10-30 Doug Kwan <dougkwan@google.com>
12111
12112 * arm.cc (Stub_addend_reader): New struct template definition
12113 and partial specializations.
12114 (Stub_addend_reader::operator()): New method definition for a
12115 partially specialized template.
12116
d5b40221
DK
121172009-10-30 Doug Kwan <dougkwan@google.com>
12118
12119 * arm.cc (Arm_relobj::processor_specific_flags): New method
12120 definition.
12121 (Arm_relobj::do_read_symbols): New method declaration.
12122 (Arm_relobj::processor_specific_flags_): New data member declaration.
12123 (Arm_dynobj): New class definition.
12124 (Target_arm::do_finalize_sections): Add input_objects parameter.
12125 (Target_arm::do_adjust_elf_header): New method declaration.
12126 (Target_arm::are_eabi_versions_compatible,
12127 (Target_arm::merge_processor_specific_flags): New method declaration.
12128 (Target_arm::do_make_elf_object): New overloaded method definitions
12129 and declaration.
12130 (Arm_relobj::do_read_symbols): New method definition.
12131 (Arm_dynobj::do_read_symbols): Ditto.
12132 (Target_arm::do_finalize_sections): Add input_objects parameters.
12133 Merge processor-specific flags from all input objects.
12134 (Target_arm::are_eabi_versions_compatible,
12135 Target_arm::merge_processor_specific_flags,
12136 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
12137 New method definitions.
12138 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
12139 Input_objects pointer type parameter.
12140 * layout.cc (Layout::finalize): Pass input objects to target's.
12141 finalize_sections function.
12142 * output.cc (Output_file_header::do_sized_write): Set ELF file
12143 header's processor-specific flags.
12144 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
12145 Input_objects pointer type parameter.
12146 * sparc.cc (Target_sparc::do_finalize_sections): Same.
12147 * target.h (Input_objects): New forward class declaration.
12148 (Target::processor_specific_flags,
12149 Target::are_processor_specific_flags_sect): New method definitions.
12150 (Target::finalize_sections): Add input_objects parameter.
12151 (Target::Target): Initialize processor_specific_flags_ and
12152 are_processor_specific_flags_set_.
12153 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
12154 parameter.
12155 (Target::set_processor_specific_flags): New method definition.
12156 (Target::processor_specific_flags_,
12157 Target::are_processor_specific_flags_set_): New data member
12158 declarations.
12159 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
12160 Input_objects pointer type parameter.
12161
ebabffbd
DK
121622009-10-30 Doug Kwan <dougkwan@google.com>
12163
12164 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
12165
ad0f2072
ILT
121662009-10-28 Ian Lance Taylor <iant@google.com>
12167
12168 * object.h (class Relobj): Drop options parameter from
12169 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
12170 do_scan_relocs, do_relocate. Change all callers.
12171 (class Sized_relobj): Drop options parameters from
12172 do_gc_process_relocs, do_scan_relocs, do_relocate,
12173 do_relocate_sections, relocate_sections, emit_relocs_scan,
12174 emit_relocs_scan_reltype. Change all callers.
12175 (struct Relocate_info): Remove options field and all references to
12176 it.
12177 * reloc.h (class Read_relocs): Remove options constructor
12178 parameter and options_ field. Change all callers.
12179 (class Gc_process_relocs, class Scan_relocs): Likewise.
12180 (class Relocate_task): Likewise.
12181 * target-reloc.h (scan_relocs): Remove options parameter. Change
12182 all callers.
12183 (scan_relocatable_relocs): Likewise.
12184 * target.h (class Sized_target): Remove options parameter from
12185 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
12186 all callers.
12187 * gc.h (gc_process_relocs): Remove options parameter. Change all
12188 callers.
12189 * arm.cc: Update functions to remove options parameters.
12190 * i386.cc: Likewise.
12191 * powerpc.cc: Likewise.
12192 * sparc.cc: Likewise.
12193 * x86_64.cc: Likewise.
12194 * testsuite/testfile.cc: Likewise.
12195
8ffa3667
DK
121962009-10-28 Doug Kwan <dougkwan@google.com>
12197
12198 * arm.cc (Arm_relobj): New class definition.
e1df38aa 12199 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
12200 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
12201 New method definitions.
12202
40f36857
CC
122032009-10-28 Cary Coutant <ccoutant@google.com>
12204
12205 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
12206 (Plugin::cleanup_done_): New member.
12207 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
12208 (Plugin_manager::cleanup_done_): Remove.
12209 (Plugin_manager::add_input_file): Edit error message.
12210 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
12211 (Plugin_manager::cleanup): Remove use of cleanup_done_.
12212
2c849493
ILT
122132009-10-27 Mikolaj Zalewski <mikolajz@google.com>
12214
12215 * fileread.cc: (File_read::View::~View): Use the new
12216 data_ownership_ filed.
12217 (File_read::~File_read): Dispose the new whole_file_view_.
12218 (File_read::open): Mmap the whole file if needed.
12219 (File_read::open): Use whole_file_view_ instead of contents_.
12220 (File_read::find_view): Use whole_file_view_ if applicable.
12221 (File_read::do_read): Use whole_file_view_ instead of contents_.
12222 (File_read::make_view): Use whole_file_view_ instead of contents_,
12223 update File_read::View::View call.
12224 (File_read::find_or_make_view): Update File_read::View::View
12225 call.
12226 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
12227 remove contents_
12228 (File_read::View::Data_ownership): New enum.
12229 (File_read::View::View): Replace bool mapped_ with Data_ownership
12230 argument.
12231 (File_read::View::mapped_): Remove (replaced by data_ownership_).
12232 (File_read::View::data_ownership_): New field.
12233 (File_read::contents_): Remove (replaced by whole_file_view_).
12234 (File_read::whole_file_view_): New field.
12235 * options.h (class General_options): Add --keep-files-mapped.
12236
24998053
CC
122372009-10-27 Cary Coutant <ccoutant@google.com>
12238
12239 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
12240 * testsuite/Makefile.am (plugin_test_5): New test case.
12241 * testsuite/Makefile.in: Regenerate.
12242
72adc4fa
DK
122432009-10-25 Doug Kwan <dougkwan@google.com>
12244
12245 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
12246 from private to protected to allow access by child class.
12247 (Sized_relobj::do_relocate_sections): New method declaration.
12248 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 12249 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
12250 Sized_relobj::relocate_sections. Instantiate template explicitly
12251 for different target sizes and endianity.
12252
07f508a2
DK
122532009-10-24 Doug Kwan <dougkwan@google.com>
12254
12255 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
12256 (Arm_input_section::as_arm_input_section): New method.
12257 (Arm_output_section): New class definition.
12258 (Arm_output_section::create_stub_group,
12259 Arm_output_section::group_sections): New method definitions.
12260
10ad9fe5
DK
122612009-10-22 Doug Kwan <dougkwan@google.com>
12262
12263 * arm.cc (Arm_input_section): New class definition.
12264 (Arm_input_section::init, Arm_input_section:do_write,
12265 Arm_input_section::set_final_data_size,
12266 Arm_input_section::do_reset_address_and_file_offset): New method
12267 definitions.
12268
56ee5e00
DK
122692009-10-21 Doug Kwan <dougkwan@google.com>
12270
12271 * arm.cc (Stub_table, Arm_input_section): New forward class
12272 declarations.
12273 (Stub_table): New class defintion.
12274 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
12275 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
12276 New method definition.
12277
b569affa
DK
122782009-10-21 Doug Kwan <dougkwan@google.com>
12279
12280 * arm.cc: Update copyright comments.
12281 (Target_arm): New forward class template declaration.
12282 (Arm_address): New type.
12283 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
12284 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
12285 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
12286 constants.
12287 (Insn_template): Same.
12288 (DEF_STUBS): New macro.
12289 (Stub_type): New enum type.
12290 (Stub_template): New class definition.
12291 (Stub): Same.
12292 (Reloc_stub): Same.
12293 (Stub_factory): Same.
12294 (Target_arm::Target_arm): Initialize may_use_blx_ and
12295 should_force_pic_veneer_.
12296 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
12297 Target_arm::should_force_pic_veneer,
12298 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
12299 Target_arm::using_thumb_only, Target_arm:;default_target): New
12300 method defintions.
12301 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
12302 New data member declarations.
12303 (Insn_template::size, Insn_template::alignment): New method defintions.
12304 (Stub_template::Stub_template): New method definition.
12305 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
12306 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
12307 (Stub_factory::Stub_factory): New method definition.
12308 * gold.h (string_hash): New template.
12309 * output.h (Input_section_specifier::hash_value): Use
12310 gold::string_hash.
12311 (Input_section_specifier::string_hash): Remove.
12312 * stringpool.cc (Stringpool_template::string_hash): Use
12313 gold::string_hash.
12314
6c172549
DK
123152009-10-20 Doug Kwan <dougkwan@google.com>
12316
12317 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
12318 symbols of relaxed input sections.
12319 * output.h (Output_section::find_relaxed_input_section): Make
12320 method public.
12321
c5617f2f
DK
123222009-10-16 Doug Kwan <dougkwan@google.com>
12323
12324 * dynobj.cc (Versions::Versions): Initialize version_script_.
12325 Only insert base version symbol definition for a shared object
12326 if version script defines any version versions.
12327 (Versions::define_base_version): New method definition.
12328 (Versions::add_def): Check that base version is not needed.
12329 (Versions::add_need): Define base version lazily.
12330 * dynobj.h (Versions::define_base_version): New method declaration.
12331 (Versions::needs_base_version_): New data member declaration.
12332 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
12333 (check_DATA): Add no_version_test.stdout.
12334 (libno_version_test.so, no_version_test.o no_version_test.stdout):
12335 New make rules.
12336 * testsuite/Makefile.in: Regenerate.
12337 * testsuite/no_version_test.c: New file.
12338 * testsuite/no_version_test.sh: Ditto.
12339
3c12dcdb
DK
123402009-10-16 Doug Kwan <dougkwan@google.com>
12341
12342 * expression.cc (class Segment_start_expression): New class definition.
12343 (Segment_start_expression::value): New method definition.
12344 (script_exp_function_segment_start): Return a new
12345 Segment_start_expression.
12346 * gold/script-c.h (script_saw_segment_start_expression): New function
12347 prototype.
12348 * script-sections.cc (Script_sections::Script_sections): Initialize
12349 SAW_SEGMENT_START_EXPRESSION_ to false.
12350 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
12351 and -Tbbs options to specify section addresses if given in
12352 command line and no SEGMENT_START expression is seen in a script.
12353 * script-sections.h (Script_sections::saw_segment_start_expression,
12354 Script_sections::set_saw_segment_start_expression): New method
12355 definition.
12356 (Script_sections::saw_segment_start_expression_): New data member
12357 declaration.
12358 * script.cc (script_saw_segment_start_expression): New function.
12359 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
12360 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
12361 script_test_7.sh and script_test_8.sh.
12362 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
12363 script_test_8.stdout.
12364 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
12365 (script_test_6, script_test_6.stdout, script_test_7,
12366 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
12367 * Makefile.in: Regenerate.
12368 * testsuite/script_test_6.sh: New file.
12369 * testsuite/script_test_6.t: Same.
12370 * testsuite/script_test_7.sh: Same.
12371 * testsuite/script_test_7.t: Same.
12372 * testsuite/script_test_8.sh: Same.
12373
64b1ae37
DK
123742009-10-16 Doug Kwan <dougkwan@google.com>
12375
12376 * output.cc (Output_segment::set_section_list_address): Cast
12377 expressions to unsigned long long type to avoid format warnings.
12378
661be1e2
ILT
123792009-10-15 Ian Lance Taylor <iant@google.com>
12380
12edd763 12381 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 12382 dot assignment to script_sections_.
12edd763
ILT
12383 * script-sections.cc (Script_sections::add_dot_assignment):
12384 Initialize if necessary.
12385
68b6574b
ILT
12386 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
12387 program headers with no load segment if there is a linker script.
12388
661be1e2
ILT
12389 * layout.cc (Layout::set_segment_offsets): Align the file offset
12390 to the segment aligment for -N or -n with no load segment.
12391 * output.cc (Output_segment::add_output_section): Don't crash if
12392 the first section is a TLS section.
12393 (Output_segment::set_section_list_addresses): Print an error
12394 message if the address moves backward in a linker script.
12395 * script-sections.cc
12396 (Output_section_element_input::set_section_addresses): Don't
12397 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
12398 (Orphan_output_section::set_section_addresses): Likewise.
12399
f15f61a7
DK
124002009-10-15 Doug Kwan <dougkwan@google.com>
12401
12402 * layout.cc (Layout::finish_dynamic_section): Generate tags
12403 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
12404 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
12405 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
12406
82bb573a
ILT
124072009-10-14 Ian Lance Taylor <iant@google.com>
12408
12409 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
12410 fields.
12411 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
12412 data_shdr fields of relinfo.
12413 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
12414 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
12415 R_386_TLS_LDO_32, adjust based on section flags.
12416 (Target_i386::Relocate::fix_up_ldo): Remove.
12417
374ad285
ILT
124182009-10-13 Ian Lance Taylor <iant@google.com>
12419
12420 Add support for -pie.
12421 * options.h (class General_options): Add -pie and
12422 --pic-executable.
12423 (General_options::output_is_position_independent): Test -pie.
12424 (General_options::output_is_executable): Return true if not shared
12425 and not relocatable.
12426 (General_options::output_is_pie): Remove.
12427 * options.cc (General_options::finalize): Reject incompatible uses
12428 of -pie.
12429 * gold.cc (queue_middle_tasks): A -pie link is not static.
12430 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
12431 * symtab.cc (Symbol::final_value_is_known): Return false if
12432 output_is_position_independent.
12433 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
12434 output_is_position_independent.
12435 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
12436 output_is_position_independent.
12437 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
12438 output_is_position_independent.
12439 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
12440 two_file_pie_test.
12441 (basic_pie_test.o, basic_pie_test): New targets.
12442 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
12443 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
12444 (two_file_pie_test): New target.
12445 * testsuite/Makefile.in: Rebuild.
12446 * README: Remove note saying that -pie is not supported.
12447
c6585162
ILT
124482009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
12449
12450 * options.h (class General_options): Add -init and -fini.
12451 * layout.cc (Layout::finish_dynamic_section): Emit
12452 given init and fini functions.
12453
032ce4e9
ST
124542009-10-13 Sriraman Tallam <tmsriram@google.com>
12455
12456 * gc.h (gc_process_relocs): Check if icf is enabled using new
12457 function.
12458 * gold.cc (queue_initial_tasks): Likewise.
12459 (queue_middle_tasks): Likewise.
12460 * object.cc (do_layout): Likewise.
12461 * symtab.cc (is_section_folded): Likewise.
12462 * main.cc (main): Likewise.
12463 * reloc.cc (Read_relocs::run): Likewise.
12464 (Sized_relobj::do_scan_relocs): Likewise.
12465 * icf.cc (is_function_ctor_or_dtor): New function.
12466 (Icf::find_identical_sections): Check if function is ctor or dtor when
12467 safe icf is chosen.
12468 * options.h (General_options::icf): Change option to be an enum.
12469 (Icf_status): New enum.
12470 (icf_enabled): New method.
12471 (icf_safe_folding): New method.
12472 (set_icf_status): New method.
12473 (icf_status_): New variable.
12474 * (options.cc) (General_options::finalize): Set icf_status_.
12475 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
12476 icf_test and icf_keep_unique_test to use the --icf enum flag.
12477 * testsuite/icf_safe_test.sh: New file.
e1df38aa 12478 * testsuite/icf_safe_test.cc: New file.
032ce4e9 12479
f345227a
ST
124802009-10-12 Sriraman Tallam <tmsriram@google.com>
12481
12482 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
12483 includes to gc.h and icf.h.
12484 * arm.cc: Include gc.h.
12485 * gold.cc: Likewise.
12486 * i386.cc: Likewise.
12487 * powerpc.cc: Likewise.
12488 * sparc.cc: Likewise.
12489 * x86_64.cc: Likewise.
12490 * gc.h: Include icf.h.
12491
1c7814ed
ILT
124922009-10-11 Ian Lance Taylor <iant@google.com>
12493
12494 * plugin.cc: Include "gold.h" before other header files.
12495
ae3b5189
CD
124962009-10-10 Chris Demetriou <cgd@google.com>
12497
12498 * options.h (Input_file_argument::Input_file_type): New enum.
12499 (Input_file_argument::is_lib_): Replace with...
12500 (Input_file_argument::type_): New member.
12501 (Input_file_argument::Input_file_argument): Take Input_file_type
12502 'type' rather than boolean 'is_lib' as second argument.
12503 (Input_file_argument::is_lib): Use type_.
12504 (Input_file_argument::is_searched_file): New function.
12505 (Input_file_argument::may_need_search): Handle is_searched_file.
12506 * options.cc (General_options::parse_library): Support -l:filename.
12507 (General_options::parse_just_symbols): Update for Input_file_argument
12508 changes.
12509 (Command_line::process): Likewise.
12510 * archive.cc (Archive::get_file_and_offset): Likewise.
12511 * plugin.cc (Plugin_manager::release_input_file): Likewise.
12512 * script.cc (read_script_file, script_add_file): Likewise.
12513 * fileread.cc (Input_file::Input_file): Likewise.
12514 (Input_file::will_search_for): Handle is_searched_file.
12515 (Input_file::open): Likewise.
12516 * readsyms.cc (Read_symbols::get_name): Likewise.
12517 * testsuite/Makefile.am (searched_file_test): New test.
12518 * testsuite/Makefile.in: Regenerate.
12519 * testsuite/searched_file_test.cc: New file.
12520 * testsuite/searched_file_test_lib.cc: New file.
12521
f3048a1d
ILT
125222009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12523 Ian Lance Taylor <iant@google.com>
12524
12525 * descriptor.cc: Include <cstdio> and "binary-io.h".
12526 (Descriptors::open): Open the files in binary mode always.
12527 * script.cc (Lex::get_token): Treat \r as whitespace.
12528
d4780e57
ILT
125292009-10-09 Ian Lance Taylor <iant@google.com>
12530
12531 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
12532
d9a893b8
ILT
125332009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12534 Ian Lance Taylor <iant@google.com>
12535
12536 * configure.ac: Check for readv function also.
12537 * fileread.cc (readv): Define if not HAVE_READV.
12538 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
12539 does not exist.
12540 * config.in: Regenerate.
12541 * configure: Regenerate.
12542
c0a62865
DK
125432009-10-09 Doug Kwan <dougkwan@google.com>
12544
12545 * layout.cc (Layout::make_output_section): Call target hook to make
12546 ordinary output section.
12547 (Layout::finalize): Adjust parameter list of call the
12548 Target::may_relax().
12549 * layout.h (class Layout::section_list): New method.
12550 * merge.h (Output_merge_base::entsize): Change visibility to public.
12551 (Output_merge_base::is_string, Output_merge_base::do_is_string):
12552 New methods.
12553 (Output_merge_string::do_is_string): New method.
12554 * object.cc (Sized_relobj::do_setup): renamed from
12555 Sized_relobj::set_up.
12556 * object.h (Sized_relobj::adjust_shndx,
12557 Sized_relobj::initializ_input_to_output_maps,
12558 Sized_relobj::free_input_to_output_maps): Change visibilities to
12559 protected.
12560 (Sized_relobj::setup): Virtualize.
12561 (Sized_relobj::do_setup): New method declaration.
12562 (Sized_relobj::invalidate_section_offset,
12563 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
12564 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
12565 * options.cc (parse_int): New function.
12566 * options.h (parse_int): New declaration.
12567 (DEFINE_int): New macro.
12568 (stub_group_size): New option.
12569 * output.cc (Output_section::Output_section): Initialize memebers
12570 merge_section_map_, merge_section_by_properties_map_,
12571 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
12572 (Output_section::add_input_section): Handled deferred code-fill
12573 generation and remove an old comment.
12574 (Output_section::add_relaxed_input_section): New method definition.
12575 (Output_section::add_merge_input_section): Use merge section by
12576 properties map to speed to search. Update merge section maps
12577 as appropriate.
12578 (Output_section::build_relaxation_map): New method definition.
12579 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
12580 Same.
12581 (Output_section::relax_input_section): Renamed to
12582 Output_section::convert_input_sections_to_relaxed_sections and change
12583 interface to take a vector of pointers to relaxed sections.
12584 (Output_section::find_merge_section,
12585 Output_section::find_relaxed_input_section): New method definitions.
12586 (Output_section::is_input_address_mapped,
12587 Output_section::output_offset, Output_section::output_address):
12588 Use output section data maps to speed up searching.
12589 (Output_section::find_starting_output_address): Add comments.
12590 (Output_section::do_write,
12591 Output_section::write_to_postprocessing_buffer): Do code-fill
12592 generation as appropriate.
12593 (Output_section::get_input_sections): Invalidate relaxed input section
12594 map.
12595 (Output_section::restore_states): Adjust type of checkpoint .
12596 Invalidate relaxed input section map.
12597 * output.h (Output_merge_base): New class declaration.
12598 (Input_section_specifier): New class defintion.
12599 (class Output_relaxed_input_section) Change base class to
12600 Output_section_data_build.
12601 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
12602 base class initializer.
12603 (Output_section::add_relaxed_input_section): New method declaration.
12604 (Output_section::Input_section): Change visibility to protected.
2e702c99 12605 (Output_section::Input_section::relobj,
c0a62865
DK
12606 Output_section::Input_section::shndx): Handle relaxed input sections.
12607 Output_section::input_sections) Change visibility to protected. Also
12608 define overload to return a non-const pointer.
12609 (Output_section::Merge_section_properties): New class defintion.
12610 (Output_section::Merge_section_by_properties_map,
12611 Output_section::Output_section_data_by_input_section_map,
12612 Output_section::Relaxation_map): New types.
12613 (Output_section::relax_input_section): Rename method to
12614 Output_section::convert_input_sections_to_relaxed_sections and change
12615 interface to take a vector of relaxed section pointers.
12616 (Output_section::find_merge_section,
12617 Output_section::find_relaxed_input_section,
12618 Output_section::build_relaxation_map,
12619 Output_section::convert_input_sections_in_list_to_relaxed_sections):
12620 New method declarations.
12621 (Output_section::merge_section_map_
12622 Output_section::merge_section_by_properties_map_,
12623 Output_section::relaxed_input_section_map_,
12624 Output_section::is_relaxed_input_section_map_valid_,
12625 Output_section::generate_code_fills_at_write_): New data members.
12626 * script-sections.cc
12627 (Output_section_element_input::set_section_addresses): Call
12628 current_data_size and addralign methods of relaxed input sections.
12629 (Orphan_output_section::set_section_addresses): Call current_data_size
12630 and addralign methods of relaxed input sections.
12631 * symtab.cc (Symbol_table::compute_final_value): Extract template
12632 from the body of Symbol_table::sized_finalize_symbol.
12633 (Symbol_table::sized_finalized_symbol): Call
12634 Symbol_table::compute_final_value.
12635 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
12636 (Symbol_table::compute_final_value): New templated method declaration.
12637 * target.cc (Target::do_make_output_section): New method defintion.
12638 * target.h (Target::make_output_section): New method declaration.
12639 (Target::relax): Add more parameters for input objects, symbol table
12640 and layout. Adjust call to do_relax.
12641 (Target::do_make_output_section): New method declaration.
12642 (Target::do_relax): Add parameters for input objects, symbol table
12643 and layout.
12644
d446d6c4
ILT
126452009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12646
12647 * pread.c: Include stdio.h.
12648
bc06c745
ILT
126492009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12650
12651 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
12652 defined.
12653
75aea3d0
ILT
126542009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12655
12656 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
12657 Change read_shndx type to unsigned int.
12658 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12659 int.
12660 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12661 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
12662 Change read_shndx type to unsigned int.
12663 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12664 int.
12665 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12666 * layout.cc (Layout::create_symtab_sections): Cast the result of
12667 local_symcount * symsize to off_t in the gold_assert.
12668
be8fcb75
ILT
126692009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12670
12671 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
12672 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
12673 R_ARM_BASE_ABS.
12674 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
12675 (Arm_relocate_functions::thm_abs5): New function.
12676 (Arm_relocate_functions::abs12): New function.
12677 (Arm_relocate_functions::abs16): New function.
12678 (Arm_relocate_functions::base_abs): New function.
12679 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
12680 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
12681 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
12682 R_ARM_BASE_ABS.
12683 (Scan::global): Likewise.
12684 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
12685 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
12686 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
12687 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
12688 R_ARM_BASE_ABS.
12689
c2a122b6
ILT
126902009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12691
12692 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
12693 (Arm_relocate_functions::movt_prel): New function.
12694 (Arm_relocate_functions::thm_movw_prel_nc): New function.
12695 (Arm_relocate_functions::thm_movt_prel): New function.
12696 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
12697 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
12698 (Scan::global, Relocate::relocate): Likewise.
12699 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12700
c4aa1e2d
ILT
127012009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12702
12703 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
12704 Incremental_checker.
12705 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
12706 unsigned int.
12707 (class Incremental_inputs_header): New class.
12708 (Incremental_inputs_header_writer): Edit comment.
12709 (Incremental_inputs_entry): New class.
12710 (Incremental_inputs_entry_writer): Edit comment.
12711 (Sized_incremental_binary::do_find_incremental_inputs_section):
12712 Add *strtab_shndx parameter, fill it.
12713 (Sized_incremental_binary::do_check_inputs): New method.
12714 (Incremental_checker::can_incrementally_link_output_file): Use
12715 Sized_incremental_binary::check_inputs.
12716 (Incremental_inputs::report_command_line): Save command line in
12717 command_line_.
12718 * incremental.h:
12719 (Incremental_binary::find_incremental_inputs_section): New
12720 method.
12721 (Incremental_binary::do_find_incremental_inputs_section): Add
12722 strtab_shndx parameter.
12723 (Incremental_binary::do_check_inputs): New pure virtual method.
12724 (Sized_incremental_binary::do_check_inputs): Declare.
12725 (Incremental_checker::Incremental_checker): Add incremental_inputs
12726 parameter, use it to initialize incremental_inputs_.
12727 (Incremental_checker::incremental_inputs_): New field.
12728 (Incremental_checker::command_line): New method.
12729 (Incremental_checker::inputs): New method.
12730 (Incremental_checker::command_line_): New field.
12731
c549a694
ILT
127322009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12733
12734 * incremental.cc: Include <cstdarg> and "target-select.h".
12735 (vexplain_no_incremental): New function.
12736 (explain_no_incremental): New function.
12737 (Incremental_binary::error): New method.
12738 (Sized_incremental_binary::do_find_incremental_inputs_section): New
12739 method.
12740 (make_sized_incremental_binary): New function.
12741 (open_incremental_binary): New function.
12742 (can_incrementally_link_file): Add checks if output is ELF and has
12743 inputs section.
12744 * incremental.h: Include "elfcpp_file.h" and "output.h".
12745 (Incremental_binary): New class.
12746 (Sized_incremental_binary): New class.
12747 (open_incremental_binary): Declare.
12748 * object.cc (is_elf_object): Use
12749 elfcpp::Elf_recognizer::is_elf_file.
12750 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
12751 * output.h (Output_file::filesize): New method.
12752
fd3c5f0b
ILT
127532009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12754
12755 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
12756 New function.
12757 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
12758 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
12759 function.
12760 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
12761 function.
12762 (Arm_relocate_functions::movw_abs_nc): New function.
12763 (Arm_relocate_functions::movt_abs): New function.
12764 (Arm_relocate_functions::thm_movw_abs_nc): New function.
12765 (Arm_relocate_functions::thm_movt_abs): New function.
12766 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
12767 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
12768 (Scan::global): Likewise.
12769 (Relocate::relocate): Likewise.
12770 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12771
7f5309a5
ILT
127722009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12773
12774 * arm.cc (Arm_relocate_functions::got_prel) New function.
12775 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
12776 (Relocate::relocate): Likewise.
12777 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12778
364c7fa5
ILT
127792009-10-06 Ian Lance Taylor <iant@google.com>
12780
12781 * options.h (class General_options): Define
12782 split_stack_adjust_size parameter.
12783 * object.h (class Object): Add uses_split_stack_ and
12784 has_no_split_stack_ fields. Add uses_split_stack and
12785 has_no_split_stack accessor functions. Declare
12786 handle_split_stack_section.
12787 (class Reloc_symbol_changes): Define.
12788 (class Sized_relobj): Define Function_offsets. Declare
12789 split_stack_adjust, split_stack_adjust_reltype, and
12790 find_functions.
12791 * object.cc (Object::handle_split_stack_section): New function.
12792 (Sized_relobj::do_layout): Call handle_split_stack_section.
12793 * dynobj.cc (Sized_dynobj::do_layout): Call
12794 handle_split_stack_section.
12795 * reloc.cc (Sized_relobj::relocate_sections): Call
12796 split_stack_adjust for executable sections in split_stack
12797 objects. Pass reloc_map to relocate_section.
12798 (Sized_relobj::split_stack_adjust): New function.
12799 (Sized_relobj::split_stack_adjust_reltype): New function.
12800 (Sized_relobj::find_functions): New function.
12801 * target-reloc.h: Include "object.h".
12802 (relocate_section): Add reloc_symbol_changes parameter. Change
12803 all callers.
12804 * target.h (class Target): Add calls_non_split method. Declare
12805 do_calls_non_split virtual method. Declare match_view and
12806 set_view_to_nop.
12807 * target.cc: Include "elfcpp.h".
12808 (Target::do_calls_non_split): New function.
12809 (Target::match_view): New function.
12810 (Target::set_view_to_nop): New function.
12811 * gold.cc (queue_middle_tasks): Give an error if mixing
12812 split-stack and non-split-stack objects with -r.
12813 * i386.cc (Target_i386::relocate_section): Add
12814 reloc_symbol_changes parameter.
12815 (Target_i386::do_calls_non_split): New function.
12816 * x86_64.cc (Target_x86_64::relocate_section): Add
12817 reloc_symbol_changes parameter.
12818 (Target_x86_64::do_calls_non_split): New function.
12819 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
12820 parameter.
12821 * powerpc.cc (Target_powerpc::relocate_section): Add
12822 reloc_symbol_changes parameter.
12823 * sparc.cc (Target_sparc::relocate_section): Add
12824 reloc_symbol_changes parameter.
12825 * configure.ac: Call AM_CONDITIONAL for the default target.
12826 * configure: Rebuild.
12827 * testsuite/Makefile.am (TEST_AS): New variable.
12828 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
12829 (check_DATA): Add split_i386 and split_x86_64 files.
12830 (SPLIT_DEFSYMS): Define.
12831 (split_i386_[1234n].o): New targets.
12832 (split_i386_[124]): New targets.
12833 (split_i386_[1234r].stdout): New targets.
12834 (split_x86_64_[1234n].o): New targets.
12835 (split_x86_64_[124]): New targets.
12836 (split_x86_64_[1234r].stdout): New targets.
12837 (MOSTLYCLEANFILES): Add new executables.
12838 * testsuite/split_i386.sh: New file.
12839 * testsuite/split_x86_64.sh: New file.
12840 * testsuite/split_i386_1.s: New file.
12841 * testsuite/split_i386_2.s: New file.
12842 * testsuite/split_i386_3.s: New file.
12843 * testsuite/split_i386_4.s: New file.
12844 * testsuite/split_i386_n.s: New file.
12845 * testsuite/split_x86_64_1.s: New file.
12846 * testsuite/split_x86_64_2.s: New file.
12847 * testsuite/split_x86_64_3.s: New file.
12848 * testsuite/split_x86_64_4.s: New file.
12849 * testsuite/split_x86_64_n.s: New file.
12850 * testsuite/testfile.cc (Target_test): Update relocation_section
12851 function.
12852 * testsuite/Makefile.in: Rebuild.
12853
e8a9fcda
ILT
128542009-10-06 Ian Lance Taylor <iant@google.com>
12855
12856 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
12857 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
12858 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
12859 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
12860 the address on ldo_addrs_.
12861 (Target_i386::Relocate::fix_up_ldo): New function.
12862
e99daf92
ILT
128632009-10-06 Rafael Espindola <espindola@google.com>
12864
12865 * plugin.cc (add_input_library): New.
12866 (Plugin::load): Add add_input_library to tv.
12867 (Plugin_manager::add_input_file): Add the is_lib argument.
12868 (add_input_file): Update call to Plugin_manager::add_input_file.
12869 (add_input_library): New.
12870 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
12871
966d4097
DK
128722009-09-30 Doug Kwan <dougkwan@google.com>
12873
12874 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
12875 symbol and call Symbol::may_need_copy_reloc to determine if
12876 a copy reloc is needed.
12877 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
12878 nocopyreloc is given in command line.
12879 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
12880 given in command line.
12881 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
12882 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
12883 of the removed Target_i386::may_need_copy_reloc.
12884 * options.h (copyreloc): New option with default value false.
12885 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12886 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
12887 instead of the removed Target_powerpc::may_need_copy_reloc.
12888 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12889 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
12890 instead of the removed Target_sparc::may_need_copy_reloc.
12891 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
12892 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
12893 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
12894 instead of the removed Target_x86_64::may_need_copy_reloc.
12895
029ba973
ILT
128962009-09-30 Ian Lance Taylor <iant@google.com>
12897
12898 * object.h (class Object): Remove target_ field, and target,
12899 sized_target, and set_target methods.
12900 (Object::sized_target): Remove.
12901 (class Sized_relobj): Update declarations. Remove sized_target.
12902 * object.cc (Sized_relobj::setup): Remove target parameter.
12903 Change all callers.
12904 (Input_objects::add_object): Don't do anything with the target.
12905 (make_elf_sized_object): Add punconfigured parameter. Change all
12906 callers. Set or test parameter target.
12907 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
12908 Change all callers.
12909 * parameters.cc (Parameters::set_target): Change parameter type to
12910 be non-const.
12911 (Parameters::default_target): Remove.
12912 (set_parameters_target): Change parameter type to be non-const.
12913 (parameters_force_valid_target): New function.
12914 (parameters_clear_target): New function.
12915 * parameters.h (class Parameters): Update declarations. Remove
12916 default_target method. Add sized_target and clear_target
12917 methods. Change target_ to be non-const.
12918 (set_parameters_target): Update declaration.
12919 (parameters_force_valid_target): Declare.
12920 (parameters_clear_target): Declare.
12921 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
12922 as NULL if we aren't searching.
12923 (Add_symbols::run): Don't check for compatible target.
12924 * fileread.cc (Input_file::open_binary): Call
12925 parameters_force_valid_target.
12926 * gold.cc (queue_middle_tasks): Likewise.
12927 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
12928 set_target on object.
12929 * dynobj.h (class Sized_dynobj): Update declarations.
12930 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
12931 make_elf_object returns NULL.
12932 (Archive::include_member): Don't check whether object target is
12933 compatible.
12934 * output.cc (Output_section::add_input_section): Get target from
12935 parameters.
12936 (Output_section::relax_input_section): Likewise.
12937 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
12938 parameters.
12939 (Sized_relobj::do_scan_relocs): Likewise.
12940 (Sized_relobj::relocate_sections): Likewise.
12941 * resolve.cc (Symbol_table::resolve): Likewise.
12942 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
12943 parameter. Change all callers.
12944 (Symbol_table::add_from_object): Get target from parameters.
12945 (Symbol_table::add_from_relobj): Don't check object target.
12946 (Symbol_table::add_from_dynobj): Likewise.
12947 (Symbol_table::define_special_symbol): Get target from
12948 parameters.
12949 * symtab.h (class Symbol_table): Update declaration.
12950 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
12951 parameter. Change all callers. Clear parameter target.
12952 (Binary_test): Test target here.
12953 * testsuite/object_unittest.cc (gold_testsuite): Remove
12954 target_test_pointer parameter. Change all callers.
12955 (Object_test): Test target here.
12956
a6a22b83
ILT
129572009-09-26 Ian Lance Taylor <iant@google.com>
12958
12959 * testsuite/initpri1.c: Don't try to use constructor priorities if
12960 compiling with gcc before 4.3.
12961
6a8f49fe
ILT
129622009-09-22 Mikolaj Zalewski <mikolajz@google.com>
12963
12964 * testsuite/retain_symbols_file_test.sh (check_present): Change
12965 output file name to retain_symbols_file_test.stdout.
12966 (check_absent): Likewise.
12967
8c604651
CS
129682009-09-18 Craig Silverstein <csilvers@google.com>
12969
12970 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
12971 * options.cc: Include <cerrno> and <fstream>.
12972 (General_options::finalize): Parse -retain-symbols-file tag.
12973 * options.h: New flag.
12974 (General_options): New method should_retain_symbol, new
12975 variable symbols_to_retain.
12976 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
12977 should_retain_symbol map.
12978 * testsuite/Makefile.am (retain_symbols_file_test): New test.
12979 * testsuite/Makefile.in: Regenerate.
12980 * testsuite/retain_symbols_file_test.sh: New file.
12981
ca58b19f
NC
129822009-09-18 Nick Clifton <nickc@redhat.com>
12983
12984 * po/es.po: Updated Spanish translation.
12985
20e6d0d6
DK
129862009-09-17 Doug Kwan <dougkwan@google.com>
12987
12988 * debug.h (DEBUG_RELAXATION): New constant.
12989 (DEBUG_ALL): Add DEBUG_RELAXATION.
12990 (debug_string_to_enum): Add relaxation debug option.
12991 * layout.cc
12992 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
12993 Layout::Relaxation_debug_check::read_sections,
12994 Layout::Relaxation_debug_check::read_sections): New method definitions.
12995 (Layout::Layout): Initialize data members
12996 record_output_section_data_from_scrips_,
12997 script_output_section_data_list_ and relaxation_debug_check_.
12998 (Layout::save_segments, Layout::restore_segments,
12999 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13000 Layout::relaxation_loop_body): New method definitions.
13001 (Layout::finalize): Support relaxation. Move section layout code to
13002 Layout::relaxation_loop_body.
13003 (Layout::set_asection_address_from_script): Move code for orphan
13004 section placement out.
13005 (Layout::place_orphan_sections_in_script): New method definition.
13006 * layout.h (Output_segment_headers, Output_file_header):
13007 New forward class declarations.
13008 (Layout::~Layout): Define.
13009 (Layout::new_output_section_data_from_script): New method definition.
13010 (Layout::place_orphan_sections_in_script): New method declaration.
13011 (Layout::Segment_states): New type declaration.
13012 (Layout::save_segments, Layout::restore_segments,
13013 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13014 Layout::relaxation_loop_body): New method declarations.
13015 (Layout::Output_section_data_list): New type declaration.
13016 (Layout::Relaxation_debug_check): New class definition.
13017 (Layout::record_output_section_data_from_script_,
13018 Layout::script_output_section_data_list_, Layout::segment_states_,
13019 Layout::relaxation_debug_check_): New data members.
13020 * output.cc: (Output_section_headers::do_size): New method definition.
13021 (Output_section_headers::Output_section_headers): Move size
13022 computation to Output_section_headers::do_size.
13023 (Output_segment_headers::do_size): New method definition.
e1df38aa 13024 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
13025 Output_file_header::do_size and call it.
13026 (Output_file_header::do_size): New method definition.
13027 (Output_data_group::Output_data_group): Adjust call to
13028 Output_section_data.
13029 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
13030 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 13031 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
13032 RELAXED_INPUT_SECTION_CODE.
13033 (Output_section::Output_section): Initialize data member checkpoint_.
13034 (Output_section::~Output_section): Delete checkpoint object pointed
13035 by checkpoint_.
13036 (Output_section::add_input_section): Always add an Input_section if
13037 relaxing.
13038 (Output_section::add_merge_input_section): Add assert.
13039 (Output_section::relax_input_section): New method definition.
13040 (Output_section::set_final_data_size): Set load address to zero for
13041 an unallocated section.
13042 (Output_section::do_address_and_file_offset_have_reset_values):
13043 New method definition.
13044 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
13045 Handle relaxed input section.
13046 (Output_section::sort_attached_input_sections): Checkpoint input
13047 section list lazily.
13048 (Output_section::get_input_sections): Change type of input_sections to
13049 list of Simple_input_section pointers. Checkpoint input section list
13050 lazily. Also handle relaxed input sections.
13051 (Output_section::add_input_section_for_script): Take a reference to
13052 a Simple_input_section object instead of Relobj pointer and section
13053 index as parameter. Handle relaxed input sections.
13054 (Output_section::save_states, Output_section::restore_states): New
13055 method definitions.
13056 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
13057 (Output_data::is_data_size_fixed): New method definition.
13058 (Output_data::reset_addresss_and_file_offset): Do not reset data size
13059 if it is fixed.
13060 (Output_data::address_and_file_offset_have_reset_values): New method
13061 definition.
13062 (Output_data::do_address_and_file_offset_have_reset_values): New method
13063 definition.
13064 (Output_data::set_data_size): Check that data size is not fixed.
13065 (Output_data::fix_data_size): New method definition.
13066 (Output_data::is_data_size_fixed_): New data member.
13067 (Output_section_headers::set_final_data_size): New method definition.
13068 (Output_section_headers::do_size): New method declaration.
13069 (Output_segment_headers::set_final_data_size): New method definition.
13070 (Output_segment_headers::do_size): New method declaration.
13071 (Output_file_header::set_final_data_size)::New method definition.
13072 (Output_file_header::do_size)::New method declaration.
13073 (Output_section_data::Output_section_data): Add new parameter
13074 is_data_size_fixed and use it to fix data size.
13075 (Output_data_const::Output_data_const): Adjust call to base class
13076 constructor and fix data size.
13077 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
13078 base class constructor and fix data size.
13079 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
13080 base class constructor and fix data size.
13081 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
13082 class constructor and fix data size.
13083 (Output_data_group::set_final_data_size): New method definition.
13084 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
13085 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
13086 class constructor and fix data size.
13087 (Output_relaxed_input_section): New class definition.
13088 (Output_section::Simple_input_section): New class definition.
13089 (Output_section::get_input_sections): Adjust parameter list.
13090 (Output_section::add_input_section_for_script): Same.
13091 (Output_section::save_states, Output_section::restore_states,
13092 Output_section::do_address_and_file_offset_have_reset_values,
13093 (Output_section::Input_section::Input_section): Handle
13094 RELAXED_INPUT_SECTION_CODE. Add new overload for
13095 Output_relaxed_input_section.
13096 (Output_section::Input_section::is_input_section,
13097 Output_section::Input_section::set_output_section): Handle relaxed
13098 input section.
13099 (Output_section::Input_section::is_relaxed_input_section,
13100 Output_section::Input_section::output_section_data,
13101 Output_section::Input_section::relaxed_input_section): New method
13102 definitions.
13103 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
13104 value.
13105 (Output_section::Input_section::u1_): Update comments.
13106 (Output_section::Input_section::u2_): Add new union member poris.
13107 (Output_section::Checkpoint_output_section): New classs definition.
13108 (Output_section::relax_input_section): New method declaration.
13109 (Output_section::checkpoint_): New data member.
13110 (Output_segment): Update comments.
13111 (Output_segment::Output_segment): Un-privatize copy constructor.
13112 (Output_segment::operator=): Un-privatize.
13113 * script-sections.cc (Output_section_element::Input_section_list):
13114 Change element type to Output_section::Simple_input_section.
13115 (Output_section_element_dot_assignment::set_section_addresses):
13116 Register output section data for relaxation clean up.
13117 (Output_data_exression::Output_data_expression): Adjust call to base
13118 constructor to fix data size.
13119 (Output_section_element_data::set_section_addresses): Register
13120 Output_data_expression object for relaxation clean up.
13121 (struct Input_section_info): Replace Relobj pointer and section index
13122 pair with Output_section::Simple_input_section and Convert struct to a
13123 class.
13124 (Input_section_sorter::operator()): Adjust access to
e1df38aa 13125 Input_section_info data member to use accessors.
20e6d0d6
DK
13126 (Output_section_element_input::set_section_addresses): Use layout
13127 parameter. Adjust code to use Output_section::Simple_input_section
13128 and Input_secction_info classes. Register filler for relaxation
13129 clean up.
13130 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
13131 and section index pair with Output_section::Simple_input_section
13132 class. Adjust code accordingly.
13133 (Phdrs_element::release_segment): New method definition.
13134 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
13135 segment list.
13136 (Script_sections::release_segments): New method definition.
13137 * gold/script-sections.h (Script_sections::release_segments): New
13138 method declaration.
13139 * gold/target.h (Target::may_relax, Target::relax,
13140 Target::do_may_relax, Target::do_relax): New method definitions.
13141
5e445df6
ILT
131422009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13143
13144 * arm.cc (has_signed_unsigned_overflow): New function.
13145 (Arm_relocate_functions::abs8): New function.
13146 (Target_arm::Scan::local): Handle R_ARM_ABS8.
13147 (Target_arm::Scan::global): Likewise.
13148 (Target_arm::relocate::relocate): Likewise.
13149 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
13150 Likewise.
13151
8c604651 131522009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
13153
13154 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
13155 * testsuite/Makefile.in: Regenerate.
13156
1e9cc1c2
NC
131572009-09-11 Nick Clifton <nickc@redhat.com>
13158
13159 * po/gold.pot: Updated by the Translation project.
13160
6a89f575
CC
131612009-09-08 Cary Coutant <ccoutant@google.com>
13162
13163 * output.cc (Output_file::open): Add execute permission to empty file.
13164 * testsuite/Makefile.am (permission_test): New test.
13165 * testsuite/Makefile.in: Regenerate.
13166
fdcac5af
ILT
131672009-09-02 Ian Lance Taylor <iant@google.com>
13168
13169 * output.cc (Output_file::resize): Call map_no_anonymous rather
13170 than map.
13171
44453f85
ILT
131722009-09-01 Mikolaj Zalewski <mikolajz@google.com>
13173
13174 * gold.cc: Include "incremental.h".
13175 (queue_initial_tasks): Call Incremental_checker methods.
13176 * incremental.cc: Include "output.h".
13177 (Incremental_checker::can_incrementally_link_output_file): New
13178 method.
13179 * incremental.h (Incremental_checker): New class.
13180
13181 * output.cc (Output_file::open_for_modification): New method.
13182 (Output_file::map_anonymous): Changed return type to bool. Record
13183 map in base_ field.
13184 (Output_file::map_no_anonymous): New method, broken out of map.
13185 (Output_file::map): Use map_no_anonymous and map_anonymous.
13186 * output.h (class Output_file): Update declarations.
13187
293c1386
CC
131882009-08-24 Cary Coutant <ccoutant@google.com>
13189
13190 * options.h (Command_line::Pre_options): New class.
13191 (Command_line::pre_options): New member.
13192 * options.cc (gold::options::ready_to_register): New variable.
13193 (One_option::register_option): Do nothing if not registering options.
13194 Assert if same short option registered twice.
13195 (General_options::General_options): Turn off option registration when
13196 done constructing.
13197 (Command_line::Pre_options::Pre_options): New constructor.
13198
f773f3d2
CC
131992009-08-24 Cary Coutant <ccoutant@google.com>
13200
06a73cfe
CC
13201 * options.h (General_options::no_keep_memory): Remove incorrect
13202 short option.
f773f3d2 13203
a15af8e2
RW
132042009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13205
13206 * Makefile.am (am__skiplex, am__skipyacc): New.
13207 * Makefile.in: Regenerate.
13208
c462b41b
RW
132092009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13210
14ec8efd
RW
13211 * Makefile.am (AM_CPPFLAGS): Renamed from ...
13212 (INCLUDES): ... this.
13213 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
13214 (AM_CPPFLAGS): Renamed from ...
13215 (INCLUDE): ... this.
13216 * Makefile.in, testsuite/Makefile.in: Regenerate.
13217
81ecdfbb
RW
13218 * Makefile.in: Regenerate.
13219 * aclocal.m4: Likewise.
13220 * config.in: Likewise.
13221 * configure: Likewise.
13222 * testsuite/Makefile.in: Likewise.
13223
c462b41b
RW
13224 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13225 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13226 * Makefile.in: Regenerate.
13227 * testsuite/Makefile.in: Regenerate.
13228
2da73f13
CC
132292009-08-19 Cary Coutant <ccoutant@google.com>
13230
13231 * resolve.cc (Symbol_table::resolve): Don't complain about defined
13232 symbols in shared libraries overridden by hidden or internal symbols
13233 in the main program.
13234
2db70501
CD
132352009-08-19 Chris Demetriou <cgd@google.com>
13236
13237 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
13238 checking source file names in error messages.
13239
f733487b
DK
132402009-08-18 Doug Kwan <dougkwan@google.com>
13241
13242 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
13243 an elcpp::Ehdr as parameter. Adjust call to set_target.
13244 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
13245 an elfcpp::Ehdr as parameter.
13246 * object.cc (Object::set_target): Remove the version that looks up
13247 a target and sets it.
13248 (Sized_relobj::setup): Take a Target object instead of
13249 an elfcpp::Ehdr as parameter. Adjust call to set_target.
13250 (make_elf_sized_object): Find target and ask target to
13251 make an ELF object.
13252 * object.h: (Object::set_target): Remove the version that looks up
13253 a target and sets it.
13254 (Sized_relobj::setup): Take a Target object instead of
13255 an elfcpp:Ehdr as parameter.
13256 * target.cc: Include dynobj.h.
13257 (Target::do_make_elf_object_implementation): New.
2e702c99 13258 (Target::do_make_elf_object): New.
f733487b
DK
13259 * target.h (Target::make_elf_object): New template declaration.
13260 (Target::do_make_elf_object): New method declarations.
13261 (Target::do_make_elf_object_implementation): New template declaration.
13262
cc70f101
ILT
132632009-08-14 Ian Lance Taylor <iant@google.com>
13264
13265 * gold.h (FUNCTION_NAME): Define.
13266 (gold_unreachable): Use FUNCTION_NAME.
13267
ef5e0cb1
ST
132682009-08-12 Sriraman Tallam <tmsriram@google.com>
13269
13270 * icf.cc (Icf::find_identical_sections): Issue a warning when a
13271 symbol in the --keep-unique list is not found.
13272
48c187ce
ST
132732009-08-12 Sriraman Tallam <tmsriram@google.com>
13274
13275 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
13276 been maked as --keep-unique.
13277 (Icf::unfold_section): New function.
13278 * icf.h (Icf::unfold_section): New function.
13279 * options.h (General_options::keep_unique): New option.
13280 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
13281 * testsuite/Makefile.in: Regenerate.
13282 * testsuite/icf_keep_unique_test.sh: New file.
13283 * testsuite/icf_keep_unique_test.cc: New file.
13284
645afe0c
CC
132852009-08-12 Cary Coutant <ccoutant@google.com>
13286
13287 PR 10471
13288 * resolve.cc (Symbol_table::resolve): Check for references from
13289 dynamic objects to hidden and internal symbols.
13290 * testsuite/Makefile.am (hidden_test.sh): New test.
13291 * testsuite/Makefile.in: Regenerate.
13292 * testsuite/hidden_test.sh: New script.
13293 * testsuite/hidden_test_1.c: New test source.
13294 * testsuite/hidden_test_main.c: New test source.
13295
11af873f
DK
132962009-08-11 Doug Kwan <dougkwan@google.com>
13297
13298 * arm.cc: Update comments.
13299 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
13300 segment to locate the .ARM.exidx section if present.
13301
b9f7d72d
DK
133022009-08-09 Doug Kwan <dougkwan@google.com>
13303
13304 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
13305 patch.
13306
ddd3c53c
ST
133072009-08-07 Sriraman Tallam <tmsriram@google.com>
13308 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
13309 compiler warnings.
13310
27721062
ST
133112009-08-06 Sriraman Tallam <tmsriram@google.com>
13312
13313 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
13314 valid tls_segment only for non-debug-section relocations.
13315 * testsuite/Makefile.am: Add gc_tls_test.
13316 * testsuite/Makefile.in: Regenerate.
13317 * testsuite/gc_tls_test.cc: New file.
13318 * testsuite/gc_tls_test.sh: New file.
13319
ef15dade 133202009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 13321
ef15dade
ST
13322 * icf.cc: New file.
13323 * icf.h: New file.
13324 * Makefile.am (CCFILES): Add icf.cc.
13325 (HFILES): Add icf.h
13326 * Makefile.in: Regenerate.
13327 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
13328 * gc.h (gc_process_relocs): Populate lists used by icf to contain
13329 section, symbol and addend information for the relocs.
13330 * gold.cc (queue_middle_tasks): Call identical code folding.
13331 * gold.h: Add defines for multimap.
13332 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
13333 to the call of finalize_local_symbols.
13334 * main.cc (main): Create object of class Icf.
13335 * object.cc (Sized_relobj::do_layout): Allow this function to be
13336 called twice during icf.
13337 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
13338 to sections marked as identical by icf.
13339 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
13340 when available.
13341 (Sized_relobj::do_section_entsize): New function.
13342 * object.h (Object::section_entsize): New function.
13343 (Object::do_section_entsize): New pure virtual function.
13344 (Relobj::finalize_local_symbols): Add new parameter.
13345 (Relobj::do_section_entsize): New function.
13346 * options.h (General_options::icf): New option.
13347 (General_options::icf_iterations): New option.
13348 (General_options::print_icf_sections): New option.
13349 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
13350 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
13351 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
13352 icf.
13353 * symtab.cc (Symbol_table::is_section_folded): New function.
13354 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
13355 to sections marked as identical by icf.
13356 * symtab.h (Symbol_table::set_icf): New function.
13357 (Symbol_table::icf): New function.
13358 (Symbol_table::is_section_folded): New function.
13359 (Symbol_table::icf_): New data member.
13360 * target-reloc.h (relocate_section): Ignore sections folded by icf.
13361 * testsuite/Makefile.am: Add commands to build icf_test.
13362 * testsuite/Makefile.in: Regenerate.
13363 * testsuite/icf_test.sh: New file.
13364 * testsuite/icf_test.cc: New file.
13365
c3b65ac4
CD
133662009-07-24 Chris Demetriou <cgd@google.com>
13367
13368 * layout.cc (is_compressible_debug_section): Fix incorrect
13369 comment about compressed section names.
13370
1caf2c51
ILT
133712009-07-20 Ian Lance Taylor <ian@airs.com>
13372
13373 PR 10419
13374 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
13375
1ef4d87f
ILT
133762009-07-16 Ian Lance Taylor <iant@google.com>
13377
13378 PR 10400
13379 * layout.h: #include <map>.
13380 (class Kept_section): Change from struct to class. Add accessors
13381 and setters. Add section size to Comdat_group mapping. Change
13382 Comdat_group to std::map. Add is_comdat_ field. Add
13383 linkonce_size field in union.
13384 (class Layout): Update declaration of find_or_add_kept_section.
13385 Don't declare find_kept_object.
13386 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
13387 parameter. Add object, shndx, is_comdat, and is_group_name
13388 parameters. Change all callers. Adjust for new Kept_section.
13389 (Layout::find_kept_object): Remove.
13390 * object.cc (Sized_relobj::include_section_group): Update use of
13391 Kept_section. Rename secnum to shndx. Only record
13392 Kept_comdat_section if sections are the same size.
13393 (Sized_relobj::include_linkonce_section): Update use of
13394 Kept_section. Only record Kept_comdat_section if sections are the
13395 same size. Set size of linkonce section.
13396 (Sized_relobj::map_to_kept_section): Update call to
13397 get_kept_comdat_section.
13398 * object.h (class Sized_relobj): Rename fields in
13399 Kept_comdat_section to drop trailing underscores; change object
13400 field to Relobj*. Change Kept_comdat_section_table to store
13401 struct rather than pointer.
13402 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
13403 Add kept_object and kept_shndx parameters. Change all callers.
13404 (Sized_relobj::get_kept_comdat_section): Change return type to
13405 bool. Add kept_object and kept_shndx parameters. Change all
13406 callers.
13407 * plugin.cc (Pluginobj::include_comdat_group): Update call to
13408 Layout::find_or_add_kept_section.
13409
37c3b7b0
ILT
134102009-07-09 Ian Lance Taylor <iant@google.com>
13411
13412 * merge.cc (Object_merge_map::initialize_input_to_output_map):
13413 Reserve space in the hash table.
13414
98fa85cb
ILT
134152009-07-06 Mikolaj Zalewski <mikolajz@google.com>
13416
13417 * fileread.cc (File_read::get_mtime): New method.
13418 * fileread.h (Timespec): New structure.
13419 (File_read::get_mtime): New method.
13420 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
13421 Renamed from timestamp_nsec.
13422 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
13423 Elf_Xword.
e1df38aa 13424 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 13425 timestamp_nsec.
e1df38aa 13426 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
13427 (Incremental_inputs::report_obejct): Save mtime; style fix.
13428 (Incremental_inputs::report_script): Save mtime; style fix.
13429 (Incremental_inputs::finalize_inputs): Style fix.
13430 (Incremental_inputs::finalize): Style fix.
13431 (Incremental_inputs::create_input_section_data): Store inputs
13432 mtime.
13433 * incremental.h (Incremental_inputs::report_script): Add mtime
13434 argument.
13435 (Incremental_inputs::Input_info::Input_info): Intialize only one
13436 union member.
13437 (Incremental_inputs::Input_info::archive): Move to nameless
13438 union.
13439 (Incremental_inputs::Input_info::obejct): Move to nameless union.
13440 (Incremental_inputs::Input_info::script): Move to nameless union.
13441 (Incremental_inputs::mtime): New field.
13442 * script.cc (read_input_script): Pass file mtime to
13443 Incremental_input.
13444 * script.h (Script_info::inputs): Style fix.
13445
c9d70757
ILT
134462009-07-01 Ian Lance Taylor <ian@airs.com>
13447
13448 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
13449 instead of 32.
13450
9c547ec3
ILT
134512009-06-24 Ian Lance Taylor <iant@google.com>
13452
13453 PR 10156
13454 * layout.cc (Layout::choose_output_section): If we find an
13455 existing section, update the flags.
13456 (Layout::create_notes): New function, broken out of
13457 Layout::finalize.
13458 (Layout::finalize): Don't create note sections.
13459 (Layout::create_note): Don't crash if linker script discards
13460 section.
13461 (Layout::create_gold_note): Likewise.
13462 (Layout::create_build_id): Likewise. Don't set
13463 after_input_sections on the section.
13464 (Layout::create_executable_stack_info): Remove target parameter.
13465 Change caller.
13466 * layout.h (class Layout): Declare create_notes. Update
13467 declaration of create_executable_stack_info.
13468 * gold.cc (queue_middle_tasks): Call create_notes.
13469 * output.cc (Output_section::update_flags_for_input_section): Move
13470 here from output.h. If SHF_ALLOC flag is newly set, mark address
13471 invalid.
13472 * output.h (Output_data::mark_address_invalid): New function.
13473 (class Output_section): Only declare, not define,
13474 update_flags_for_input_section. Remove set_flags.
13475
55458500
ILT
134762009-06-24 Ian Lance Taylor <iant@google.com>
13477
13478 * script-sections.cc (Output_section_definition::
13479 set_section_addresses): Rename shadowing local load_address to
13480 laddr.
13481
1307d6cd
ILT
134822009-06-24 Ian Lance Taylor <iant@google.com>
13483
13484 PR 10244
13485 * reloc.cc (relocate_sections): Skip empty relocation sections.
13486
ec3f783e
ILT
134872009-06-23 Ian Lance Taylor <iant@google.com>
13488
13489 PR 10156
13490 * layout.cc (Layout::create_note): Use choose_output_section
13491 rather than make_output_section.
13492
459c9f1c
ILT
134932009-06-23 Ian Lance Taylor <iant@google.com>
13494
13495 PR 10237
13496 * options.cc (General_options::parse_V): Set printed_version_.
13497 (General_options::General_options): Initialize printed_version_.
13498 * options.h (class General_options): Add printed_version_ field.
13499 * gold.cc (queue_initial_tasks): If there are no input files,
13500 don't give a fatal error if we printed the version information.
13501 (queue_middle_tasks): If using -r with a shared object, give a
13502 fatal error rather than an ordinary error.
13503
1518dc8f
ILT
135042009-06-23 Ian Lance Taylor <iant@google.com>
13505
13506 PR 10219
13507 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
13508 (Layout::make_output_section): Set have_stabstr_section_ if we see
13509 a .stab*str section.
13510 (Layout::finalize): Call link_stabs_sections.
13511 (Layout::link_stabs_sections): New file.
13512 * layout.h (class Layout): Add have_stabstr_section_ field.
13513 Declare link_stabs_sections.
13514
3d857b98
DK
135152009-06-23 Doug Kwan <dougkwan@google.com>
13516
13517 * Makefile.am (libgold_a_LIBADD): New.
13518 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 13519 * Makefile.in: Regenerate.
3d857b98
DK
13520 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
13521 * configure: Regenerate.
13522 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
13523 * fileread.cc: Include sys/state.h
13524 * gold.h: Declare memmem and strndup if found missing.
13525 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
13526
0639a6f6
ILT
135272009-06-23 Ian Lance Taylor <iant@google.com>
13528
13529 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
13530 * configure: Rebuild.
13531
8d63875c
ILT
135322009-06-23 Ian Lance Taylor <iant@google.com>
13533
13534 PR 10147
13535 * object.cc (Object::section_contents): Don't try to get a view if
13536 the section has length zero.
13537 (Object::handle_gnu_warning_section): If the section is empty, use
13538 the name of the section as the warning.
13539
f7c8a183
ILT
135402009-06-23 Ian Lance Taylor <iant@google.com>
13541
13542 PR 10133
13543 * stringpool.h (class Stringpool_template): Add optimize_ field.
13544 (Stringpool_template::set_optimize): New function.
13545 * stringpool.cc (Stringpool_template::Stringpool_template):
13546 Initialize optimize_ field.
13547 (Stringpool_template::set_string_offsets): Test local optimize
13548 fild rather than parameter.
13549 * layout.cc (Layout::Layout): Call set_optimize on the section
13550 name stringpool.
13551
e6a307ba
ILT
135522009-06-22 Ian Lance Taylor <iant@google.com>
13553
13554 PR 10030
13555 * yyscript.y: Parse TARGET.
13556 * script.cc (script_set_target): New function.
13557 * script-c.h (script_set_target): Declare.
13558 * options.cc (General_options::string_to_object_format): Rename
13559 from string_to_object_format in anonymous namespace. Change
13560 callers.
13561 * options.h (class General_options): Declare
13562 string_to_object_format.
13563
3ee173de
ILT
135642009-06-22 Ian Lance Taylor <iant@google.com>
13565
13566 * script-sections.cc (Script_sections::create_segments): Don't put
13567 program headers in a PT_LOAD segment if -n or -N.
13568
135692009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
13570
13571 PR 10141
13572 * options.h (class General_options): Add -z lazy and -z now. Sort
13573 -z options into alphabetical order.
13574 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
13575
cd6739a1 135762009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
13577
13578 * layout.cc (Layout::make_output_section): Call
13579 Target::new_output_section.
13580 (Layout::attach_allocated_section_to_segment): Put large section
13581 sections in a separate load segment with the large segment flag
13582 set.
13583 (Layout::segment_precedes): Sort large data segments after other
13584 load segments.
13585 (align_file_offset): New static function.
13586 (Layout::set_segment_offsets): Use align_file_offset.
13587 * output.h (class Output_section): Add is_small_section_ and
13588 is_large_section_ fields.
13589 (Output_section::is_small_section): New function.
13590 (Output_section::set_is_small_section): New function.
13591 (Output_section::is_large_section): New function.
13592 (Output_section::set_is_large_section): New function.
13593 (Output_section::is_large_data_section): New function.
13594 (class Output_segment): Add is_large_data_segment_ field.
13595 (Output_segment::is_large_data_segment): New function.
13596 (Output_segment::set_is_large_data_segment): New function.
13597 * output.cc (Output_section::Output_section): Initialize new
13598 fields.
13599 (Output_segment::Output_segment): Likewise.
13600 (Output_segment::add_output_section): Add assertion that large
13601 data sections always go in large data segments. Force small data
13602 sections to the end of the list of data sections. Force small BSS
13603 sections to the start of the list of BSS sections. For large BSS
13604 sections to the end of the list of BSS sections.
13605 * symtab.h (class Symbol): Declare is_common_shndx.
13606 (Symbol::is_defined): Check Symbol::is_common_shndx.
13607 (Symbol::is_common): Likewise.
13608 (class Symbol_table): Define enum Commons_section_type. Update
13609 declarations. Add small_commons_ and large_commons_ fields.
13610 * symtab.cc (Symbol::is_common_shndx): New function.
13611 (Symbol_table::Symbol_table): Initialize new fields.
13612 (Symbol_table::add_from_object): Put small and large common
13613 symbols in the right list.
13614 (Symbol_table::sized_finalized_symbol): Check
13615 Symbol::is_common_shndx.
13616 (Symbol_table::sized_write_globals): Likewise.
13617 * common.cc (Symbol_table::do_allocate_commons): Allocate new
13618 common symbol lists. Don't call do_allocate_commons_list if the
13619 list is empty.
13620 (Symbol_table::do_allocate_commons_list): Remove is_tls
13621 parameter. Add comons_section_type parameter. Change all
13622 callers. Handle small and large common symbols.
13623 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
13624 Symbol::is_common_shndx.
13625 * resolve.cc (symbol_to_bits): Likewise.
13626 * target.h (Target::small_common_shndx): New function.
13627 (Target::small_common_section_flags): New function.
13628 (Target::large_common_shndx): New function.
13629 (Target::large_common_section_flags): New function.
13630 (Target::new_output_section): New function.
13631 (Target::Target_info): Add small_common_shndx, large_common_shndx,
13632 small_common_section_flags, and large_common_section_flags
13633 fields.
13634 (Target::do_new_output_section): New virtual function.
13635 * arm.cc (Target_arm::arm_info): Initialize new fields.
13636 * i386.cc (Target_i386::i386_info): Likewise.
13637 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
13638 Likewise.
13639 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
13640 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13641 (Target_x86_64::do_new_output_section): New function.
13642 * configure.ac: Define conditional MCMODEL_MEDIUM.
13643 * testsuite/Makefile.am (check_PROGRAMS): Add large.
13644 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
13645 (large_LDFLAGS): Define.
13646 * testsuite/large.c: New file.
13647 * testsuite/testfile.cc (Target_test::test_target_info):
13648 Initialize new fields.
13649 * configure, testsuite/Makefile.in: Rebuild.
13650
bb04269c
DK
136512009-06-05 Doug Kwan <dougkwan@google.com>
13652
13653 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 13654 * Makefile.in: Regenerate.
bb04269c
DK
13655 * i386.cc (class Target_i386): Define new virtual method to
13656 override do_is_local_label_name in parent.
13657 * object.cc (Sized_relobj::do_count_local_symbols): Discard
13658 local symbols if --discard-locals or -X is given.
13659 * options.h (class General_options): Declare new options
13660 '--discard-locals' and '-X' for discarding locals.
13661 * target.h (class Target): Define new methods is_local_label_name.
13662 Declare new virtual method do_is_local_label_name.
13663 * target.cc: New file.
13664 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
13665 (check_SCRIPTS): Add discard_locals_test.sh.
13666 (check_DATA): Add discard_local_tests.syms.
13667 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
13668 (discard_local_tests.syms, discard_locals_test.o): New make rules.
13669 * testsuite/Makefile.in: Regenerate.
13670 * testsuite/discard_locals_test.c: New file.
13671 * testsuite/discard_locals_test.sh: Same.
13672
805bb01c
DK
136732009-06-05 Doug Kwan <dougkwan@google.com>
13674
13675 * object.cc (Sized_relobj::Sized_relobj): Initialize
13676 discarded_eh_frame_shndx_ to -1U.
13677 (Sized_relobj::do_layout): Record index of a discard .eh_frame
13678 section.
13679 (Sized_relobj::do_count_local_symbols): Skip local symbols in
13680 a discarded .eh_frame section.
13681 (Sized_relobj::do_finalize_local_symbols): Ditto.
13682 * object.h (class Sized_relobj): Declare new member
13683 discarded_eh_frame_shndx_.
13684 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
13685 (local_labels_test.o, local_labels_test): New rules.
13686 * testsuite/Makefile.in: Regenerate.
13687
1dcd334d
DK
136882009-06-04 Doug Kwan <dougkwan@google.com>
13689
13690 * layout.cc (Layout::section_name_mapping): Add mapping for
13691 special ARM sections.
13692
96d49306
DK
136932009-06-03 Doug Kwan <dougkwan@google.com>
13694
13695 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
13696 (utils::has_overflow): Same.
13697
dff16297
ILT
136982009-06-03 Ian Lance Taylor <iant@google.com>
13699
13700 * layout.cc (Layout::section_name_mapping): New array, replacing
13701 Layout::linkonce_mapping.
13702 (Layout::section_name_mapping_count): New variable, replacing
13703 Layout::linkonce_mapping_count.
13704 (Layout::linkonce_output_name): Remove.
13705 (Layout::output_section_name): Rewrite.
13706 * layout.h (class Layout): Rename Linkonce_mapping to
13707 Section_name_mapping, linkonce_mapping to section_name_mapping,
13708 linkonce_mapping_count to section_name_mapping_count. Don't
13709 declare linkonce_output_name.
13710
c121c671
DK
137112009-06-03 Doug Kwan <dougkwan@google.com>
13712
13713 * gold/arm.cc (namespace utils): New.
13714 (Target_arm::reloc_is_non_pic): Define new method.
13715 (class Arm_relocate_functions): New.
13716 (Target_arm::Relocate::relocate): Handle relocation types used by
13717 Android.
13718
07800fab
ILT
137192009-06-03 Ian Lance Taylor <iant@google.com>
13720
13721 * arm.cc (Target_arm::scan::global): Use || instead of |.
13722
c121c671
DK
137232009-06-02 Doug Kwan <dougkwan@google.com>
13724
13725 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
13726 issued_non_pic_error_.
13727 (class Target_arm::Scan): Declare new method check_non_pic.
13728 Define new method symbol_needs_plt_entry.
13729 Declare new data member issued_non_pic_error_.
13730 (class Target_arm::Relocate): Declare new method
13731 should_apply_static_reloc.
13732 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
13733 (Target_arm::Scan::check_non_pic): Define new method.
13734 (Target_arm::Scan::local): Handle a small subset of reloc types used
13735 by Android.
13736 (Target_arm::Scan::local): Same.
13737 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
13738
b19b0c6d
ILT
137392009-05-31 Mikolaj Zalewski <mikolajz@google.com>
13740
13741 * incremental.cc (Incremental_inputs::report_command_line): Filter
13742 out --incremental-* options.
13743
94cdfcff
DK
137442009-05-29 Doug Kwan <dougkwan@google.com>
13745
13746 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
13747 template class.
13748 (class Target_arm): Update comment.
13749 (Target_arm::Target_arm): Initialize new data members GOT_,
13750 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
13751 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
13752 and Target_arm::rel_dyn_section.
13753 Declare new_enum Target_arm::Got_type.
13754 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
13755 and DYNBSS_.
13756 Update commments for member do_dynsym_value.
13757 (Target_arm::got_size, Target_arm::plt_section,
13758 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
13759 new methods inside class defintion.
13760 (Target_arm::got_section): Define new method.
13761 (Target_arm::rel_dyn_section): Same.
13762 (Output_data_plt_arm): New template class.
13763 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
13764 (Output_data_plt_arm:do_adjust_output_section): Define new method.
13765 (Output_data_plt_arm::add_entry): Same.
13766 (Output_data_plt_arm::first_plt_entry): Define new
13767 static data member for PLT instruction template.
13768 (Output_data_plt_arm::plt_entry): Same.
13769 (Output_data_plt_arm::do_write): Define new method.
13770 (Target_arm::make_plt_entry): Same.
13771 (Target_arm::do_finalize_sections): Same.
13772 (Target_arm::do_dynsym_value): Same.
13773
4a657b0d
DK
137742009-05-28 Doug Kwan <dougkwan@google.com>
13775
13776 * Makefile.am (TARGETSOURCES): Add arm.cc.
13777 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
13778 * Makefile.in: Regenerate.
13779 * arm.cc: New file.
13780 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
13781
e7ae8c36
DK
137822009-05-26 Doug Kwan <dougkwan@google.com>
13783
13784 * options.cc (General_options::parse_exclude_libs). Fix a comment.
13785 (General_options::check_excluded_libs): Strip off directories in
13786 archive name before matching like GNU ld does.
13787 * testsuite/Makefile.am (MOSTLYCLEANFILES,
13788 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
13789 (exclude_libs_test_LDFLAGS): Add linker option
13790 -Wl,--exclude-libs,libexclude_libs_test_3
13791 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
13792 an explicit archive without using -l.
13793 (alt/libexclude_libs_test_3.a): New make rule.
13794 * testsuite/Makefile.in: Regenerate.
13795 * testsuite/exclude_libs_test.c : Declare lib3_default().
13796 (main): Call it.
13797 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
13798 * exclude_libs_test_3.c: New file.
13799
f12e7348
NC
138002009-05-26 Nick Clifton <nickc@redhat.com>
13801
13802 * po/id.po: New Indonesian translation.
13803 * po/gold.pot: Updated template file.
13804
4daadc0d
ST
138052009-05-22 Sriraman Tallam <tmsriram@google.com>
13806
e1df38aa 13807 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
13808 gc_comdat_test files. Add -Wl,--gc-sections to build
13809 gc_comdat_test.
13810 * testsuite/Makefile.in: Regenerate.
13811 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
13812
531813ad
ST
138132009-05-21 Sriraman Tallam <tmsriram@google.com>
13814
13815 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
13816 kept comdat section was garbage collected.
13817 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
13818 * testsuite/Makefile.in: Regenerate.
13819 * testsuite/gc_comdat_test.sh: New file.
13820 * testsuite/gc_comdat_test_1.cc: New file.
13821 * testsuite/gc_comdat_test_2.cc: New file.
13822
65514900
CC
138232009-05-19 Doug Kwan <dougkwan@google.com>
13824
13825 * archive.cc (Archive::Archive): Move constructor from archive.h
13826 to here. Initialize no_export_.
13827 (Archive::get_elf_object_for_member): Set no_export flag of object.
13828 * archive.h (Archive::Archive): Move constructor body to
13829 archive.cc.
13830 (Archive::no_export): New method.
13831 (Archive::no_export_): New field.
13832 * object.h (Object::Object): Initialize no_export_ to false.
13833 (Object::no_export, Object::set_no_export): New methods.
13834 (Object::no_export_): New field.
13835 * options.cc (General_options::parse_exclude_libs): New method.
13836 (General_options::check_excluded_libs) Same.
13837 * options.h (exclude_libs): New option.
13838 (General_options::check_excluded_libs): New method declaration.
13839 (General_options::excluded_libs_): New field.
13840 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
13841 default or protected visibility if an object has no-export flag set.
13842 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
13843 (check_SCRIPTS): Add exclude_libs_test.sh.
13844 (check_DATA): Add exclude_libs_test.syms.
13845 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
13846 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
13847 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
13848 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
13849 (exclude_libs_test.syms, libexclude_libs_test_1.a,
13850 libexclude_libs_test_2.a): New rules.
13851 * testsuite/Makefile.in: Regenerate.
13852 * testsuite/exclude_libs_test.c: New file.
13853 * testsuite/exclude_libs_test.sh: Ditto.
13854 * testsuite/exclude_libs_test_1.c: Ditto.
13855 * testsuite/exclude_libs_test_2.c: Ditto.
13856
1b77ea50
ILT
138572009-05-15 Ian Lance Taylor <iant@google.com>
13858
13859 * configure.ac: Check for declarations for cases where libiberty.h
13860 checks HAVE_DECL_xxx.
13861 * configure, config.in: Rebuild.
13862
072fe7ce
ILT
138632009-05-15 Mikolaj Zalewski <mikolajz@google.com>
13864
13865 * gold.h (Incremental_argument_list): Remove (invalid) forward
13866 declaration.
13867 * incremental.cc (Incremental_inputs::report_achive): New method.
13868 (Incremental_inputs::report_object): New method.
13869 (Incremental_inputs::report_script): New method.
13870 (Incremental_inputs::finalize_inputs): New method.
13871 (Incremental_inputs::finalize): Call finalize_inputs().
13872 (Incremental_inputs::sized_create_incremental_inputs_section_data):
13873 Create inputs entries.
13874 * incremental.h (Incremental_input_type): New enum.
13875 (Incremental_inputs::Incremental_input): Initialize new fields.
13876 (Incremental_inputs::report_inputs): New method.
13877 (Incremental_inputs::report_achive): New method.
13878 (Incremental_inputs::report_object): New method.
13879 (Incremental_inputs::report_script): New method.
13880 (Incremental_inputs::finalize_inputs): New method.
13881 (Incremental_inputs::Input_info): New struct.
13882 (Incremental_inputs::Input_info_map): New typedef.
13883 (Incremental_inputs::lock_): New field.
13884 (Incremental_inputs::Inputs_): New field.
13885 (Incremental_inputs::Inputs_map): New field.
13886 * main.cc (main): Call Incremental_input::report_inputs.
13887 * options.h (Input_argument_list): Typedef moved from
13888 Input_arguments.
13889 (Input_file_group::Files): Remove, use ::Input_argument_list.
13890 (Input_file_group::Input_argument_list): Remove, use
13891 ::Input_argument_list.
13892 * plugin.cc (Plugin_manager::add_input_file): Add error in
13893 incremental build.
13894 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
13895 functions.
13896 * script.cc (read_input_script): Call
13897 Incremental_input::report_script.
13898 * script.h (Script_info): New class.
13899
b0481b0b
ILT
139002009-04-27 Ian Lance Taylor <iant@google.com>
13901
13902 * x86_64.cc (do_adjust_output_section): Set entsize to
13903 plt_entry_size.
13904
b22a5a41 139052009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
13906
13907 * output.cc (Output_file::close): After short writes, continue
13908 writing from the correct offset in the buffer being written.
13909
40fde488
CD
139102009-04-23 Chris Demetriou <cgd@google.com>
13911
13912 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
13913 * configure: Regenerate.
13914 * config.in: Regenerate.
13915 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
13916 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
13917
3ce2c28e
ILT
139182009-04-21 Mikolaj Zalewski <mikolajz@google.com>
13919
13920 * incremental.cc (Incremental_inputs_header_data): Renamed from
13921 Incremental_input_header_data.
13922 (Incremental_inputs_header_data::data_size): New field.
13923 (Incremental_inputs_header_data::put_input_file_count): Renamed
13924 from input_file_count.
13925 (Incremental_inputs_header_data::put_command_line_offset): Renamed
13926 from command_line_offset.
13927 (Incremental_inputs_header_data::put_reserved): Renamed from
13928 put_reserved.
13929 (Incremental_inputs_entry_data): Renamed from
13930 Incremental_input_entry_data.
13931 (Incremental_inputs_entry_data::data_size): New field.
13932 (Incremental_inputs::report_command_line): New method.
13933 (Incremental_inputs::finalize): New method.
13934 (Incremental_inputs::create_incremental_inputs_data): New method.
13935 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
13936 * incremental.h: New file.
13937 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 13938 (Layout::finalize): Create incremental inputs section in
3ce2c28e 13939 incremental builds.
703d02da 13940 (Layout::create_incremental_info_sections): New method.
3ce2c28e 13941 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
13942 (Layout::create_incremental_info_sections): New method.
13943 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
13944 * main.cc (main): Notify Incremental_input of the command line.
13945
e55bde5e
ILT
139462009-04-01 Ian Lance Taylor <iant@google.com>
13947 Mikolaj Zalewski <mikolajz@google.com>
13948
13949 * gold.h (reserve_unordered_map): Define, three versions, one for
13950 each version of Unordered_map.
13951 * layout.cc (Layout::Layout): Remove options parameter. Add
13952 number_of_input_files parameter. Don't initialize options_.
13953 Initialize number_of_input_files_ and resized_signatures_. Move
13954 sections_are_attached_.
13955 (Layout::layout_group): Reserve space for group_signatures_.
13956 (Layout::find_or_add_kept_section): Change name parameter to be a
13957 reference. Resize signatures_ map when it gets large enough.
13958 (Layout::layout_eh_frame): Use parameters->options() instead of
13959 this->options_.
13960 (Layout::make_output_section): Likewise.
13961 (Layout::attach_allocated_section_to_segment): Likewise.
13962 (Layout::finalize, Layout::create_executable_stack): Likewise.
13963 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
13964 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
13965 * layout.h (class Layout): Update declarations. Remove options_
13966 field. Add number_of_input_files_ and resized_signatures_
13967 fields. Move sections_are_attached_ field.
13968 * main.cc (main): Pass number of input files to Layout
13969 constructor. Don't pass options.
13970
154b857c
ILT
139712009-03-30 Ian Lance Taylor <iant@google.com>
13972
13973 * ffsll.c (ffsll): Correct implementation.
13974
2f35ab9b
ILT
139752009-03-27 Ian Lance Taylor <iant@google.com>
13976
fd03461a
ILT
13977 * ffsll.c: New file.
13978 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
13979 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
13980 * ftruncate.c (ftruncate): Declare before definition.
13981 * mremap.c (mremap): Likewise.
13982 * pread.c (pread): Likewise.
13983 * configure, Makefile.in, config.in: Rebuild.
13984
2f35ab9b
ILT
13985 * mremap.c: New file.
13986 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
13987 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
13988 (mremap): Declare if HAVE_MREMAP is not defined.
13989 * configure, Makefile.in, config.in: Rebuild.
13990
33aea2fd
CC
139912009-03-27 Cary Coutant <ccoutant@google.com>
13992
13993 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
13994 position independent.
13995 * sparc.cc (Target_sparc::check_non_pic): Likewise.
13996 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
13997
6d479619
CC
139982009-03-24 Cary Coutant <ccoutant@google.com>
13999
14000 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
14001 an executable.
14002 (needs_dynamic_reloc): Likewise.
14003
afc06bb8
ILT
140042009-03-24 Ian Lance Taylor <iant@google.com>
14005
14006 * yyscript.y (file_cmd): Recognize EXTERN.
14007 (extern_name_list, extern_name_list_body): New nonterminals.
14008 * script.cc (script_add_extern): Define.
14009 * script-c.h (script_add_extern): Declare.
14010
f6060a4d
ILT
140112009-03-24 Rafael Avila de Espindola <espindola@google.com>
14012
14013 * object.cc (is_elf_object): Define.
14014 * object.h (is_elf_object): Declare.
14015 * archive.cc (Archive::get_elf_object_for_member): Call
14016 is_elf_object.
33aea2fd 14017 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 14018
26736d8e
ILT
140192009-03-24 Elliott Hughes <enh@google.com>
14020
14021 * output.cc (Output_file::map_anonymous): Define.
14022 (Output_file::map): Use map_anonymous. If the regular mmap fails,
14023 try an anonymous one. Report the size if the mmap fails.
14024 * output.h (class Output_file): Declare map_anonymous.
14025
22fd9730
ILT
140262009-03-24 Ian Lance Taylor <iant@google.com>
14027
14028 * target-select.cc (instantiate_target): Don't acquire the lock if
14029 the instantiated_target_ field has already been set.
14030
cb010894
ILT
140312009-03-23 Ian Lance Taylor <iant@google.com>
14032
7f055c20
ILT
14033 * gold-threads.h (class Initialize_lock): Define.
14034 * gold-threads.cc (class Initialize_lock_once): Define.
14035 (initialize_lock_control): New static variable.
14036 (initialize_lock_pointer): New static variable.
14037 (initialize_lock_once): New static function.
14038 (Initialize_lock::Initialize_lock): Define.
14039 (Initialize_lock::initialize): Define.
14040 * target-select.h: Include "gold-threads.h".
14041 (class Target_selector): Add lock_ and initialize_lock_ fields.
14042 Don't define instantiate_target, just declare it.
14043 * target-select.cc (Target_selector::Target_selector): Initialize
14044 new fields.
14045 (Target_selector::instantiate_target): Define.
14046 * descriptors.h: Include "gold-threads.h".
14047 (class Descriptors): Add initialize_lock_ field.
14048 * descriptors.cc (Descriptors::Descriptors): Initialize new
14049 field.
14050 (Descriptors::open): Use initialize_lock_ field
14051 * errors.h (class Errors): Add initialize_lock_ field.
14052 * errors.cc (Errors::Errors): Initialize new field.
14053 (Errors::initialize_lock): Use initialize_lock_ field.
14054 * powerpc.cc (class Target_selector_powerpc): Remove
14055 instantiated_target_ field. In do_recognize call
14056 instantiate_target rather than do_instantiate_target. In
14057 do_instantiate_target just allocate a new target.
14058 * sparc.cc (class Target_selector_sparc): Likewise.
14059
36959681
ILT
14060 * freebsd.h: New file.
14061 * i386.cc: Include "freebsd.h".
14062 (Target_i386): Derive from Target_freebsd rather than
14063 Sized_target.
14064 (Target_selector_i386): Derive from Target_selector_freebsd rather
14065 than Target_selector.
14066 * x86_64.cc: Include "freebsd.h".
14067 (Target_x86_64): Derive from Target_freebsd rather than
14068 Sized_target.
14069 (Target_selector_x86_64): Derive from Target_selector_freebsd
14070 rather than Target_selector.
14071 * target.h (class Target): Add adjust_elf_header and
14072 do_adjust_elf_header.
14073 * output.cc (Output_file_header:: do_sized_write): Call target
14074 adjust_elf_header routine.
14075 * configure.tgt: Set targ_osabi.
14076 * configure.ac: Define GOLD_DEFAULT_OSABI.
14077 * parameters.cc (Parameters::default_target): Pass
14078 GOLD_DEFAULT_OSABI to select_target.
14079 * target-select.h (class Target_selector): Make instantiate_target
14080 protected rather than private.
14081 * Makefile.am (HFILES): Add freebsd.h.
14082 * configure, Makefile.in, config.in: Rebuild.
14083
cb010894
ILT
14084 * merge.cc (do_add_input_section): Correct pend value. Change
14085 message about last entry not being null terminated from error to
14086 warning.
14087
0e879927
ILT
140882009-03-20 Mikolaj Zalewski <mikolajz@google.com>
14089
14090 * incremental.cc: New file.
14091 * Makefile.am (CCFILES): Add incremental.cc.
14092 * Makefile.in: Rebuild.
14093
41105937
PP
140942009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
14095
14096 * layout.cc (Layout::output_section_name): Preserve names
14097 of '.note.' sections.
e1df38aa 14098
60439920
ILT
140992009-03-19 Ian Lance Taylor <iant@google.com>
14100
14101 * descriptors.cc (Descriptors::open): Check that the options are
14102 valid before using them.
14103
0d371ad3
ILT
141042009-03-18 Ian Lance Taylor <iant@google.com>
14105
14106 * script-sections.h: Include <list>.
14107 (class Script_sections): Change Sections_elements from std::vector
14108 to std::list. Typedef public Elements_iterator. Add
14109 orphan_section_placement_, data_segment_align_start_, and
14110 saw_data_segment_align_ fields. Remove data_segment_align_index_
14111 field.
14112 * script-sections.cc (class Orphan_section_placement): New class.
14113 (class Sections_element): Add virtual functions is_relro and
14114 orphan_section_init. Remove virtual function place_orphan_here.
14115 (class Output_section_definition): Add is_relro and
14116 orphan_section_init. Remove place_orphan_here.
14117 (class Orphan_output_section): Likewise.
14118 (Script_sections::Script_sections): Update for field changes.
14119 (Script_sections::data_segment_align): Set saw_data_segment_align_
14120 and data_segment_align_start_, not data_segment_align_index.
14121 (Script_sections::data_segment_relro_end): Check
14122 saw_data_segment_align_. Use data_segment_align_start_ rather
14123 than data_segment_align_index_.
14124 (Script_sections::place_orphan): Rewrite to use
14125 Orphan_section_placement.
14126
9201d894
ILT
141272009-03-17 Ian Lance Taylor <iant@google.com>
14128
9c5b8369
ILT
14129 * archive.cc (Archive::add_symbols): Check for a version attached
14130 to the symbol name in the archive map.
14131 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
14132 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
14133 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
14134 (ver_test_11.a): New target.
14135 * testsuite/Makefile.in: Rebuild.
14136
9201d894
ILT
14137 * configure.ac: Check for chsize and posix_fallocate. Replace
14138 ftruncate.
14139 * ftruncate.c: New file, from gnulib.
14140 * output.cc (posix_fallocate): Define dummy version if not
14141 HAVE_POSIX_FALLOCATE.
14142 (Output_file::map): Call posix_fallocate rather than lseek and
14143 write.
14144 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
14145 * configure, Makefile.in, config.in: Rebuild.
14146
ef4ab7a8 141472009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 14148
ef4ab7a8
PP
14149 * layout.h (Layout::create_note): Add section_name parameter.
14150 * layout.cc (Layout::create_note): Likewise.
14151 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 14152
8c500701
ILT
141532009-03-17 Ian Lance Taylor <iant@google.com>
14154
e85b18e1
ILT
14155 * descriptors.cc: Include "options.h".
14156 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
14157 (Descriptors::open): Always use O_CLOEXEC when opening a new
14158 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
14159 then set FD_CLOEXEC.
14160
9efe6174
ILT
14161 * sparc.cc (class Target_sparc): Add has_got_section.
14162 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
14163 make sure we have a GOT section.
14164
14165 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
14166 (Target_sparc::Scan::local): Likewise.
14167 (Target_sparc::Scan::global): Likewise.
14168 (Target_sparc::Relocate::relocate): Likewise.
14169 (Target_sparc::Relocate::relocate_tls): Likewise.
14170
8c500701
ILT
14171 * symtab.cc (Symbol_table::define_default_version): New function,
14172 broken out of add_from_object.
14173 (Symbol_table::add_from_object): Call define_default_version.
14174 (Symbol_table::define_special_symbol): Add resolve_oldsym
14175 parameter. Change all callers. If the version for a symbol comes
14176 from a version script, resolve it with the symbol with the same
14177 name with no version. Also add the symbol without a version if
14178 appropriate.
14179 (do_define_in_output_data): If resolving with oldsym, don't delete
14180 sym.
14181 (do_define_in_output_segment): Likewise.
14182 (do_define_as_constant): Likewise.
14183 * symtab.h (class Symbol_table): Update declarations.
14184
f1ed28fb
ILT
141852009-03-13 Ian Lance Taylor <iant@google.com>
14186
15f8229b
ILT
14187 * readsyms.cc (Read_symbols::incompatible_warning): New function.
14188 (Read_symbols::requeue): New function.
14189 (Read_symbols::do_read_symbols): If make_elf_object fails because
14190 the target type is not configured, and the file was searched for,
14191 issue a warning and retry with the next directory.
14192 (Add_symbols::run): If the file has an incompatible format, and
14193 it was searched for, requeue the Read_symbols task. On error,
14194 release the object.
14195 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
14196 dirindex parameter to constructor. Change all callers. Declare
14197 incompatible_warning and requeue.
14198 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
14199 input_argument_ and input_group_ fields. Add them to
14200 constructor. Change all callers.
14201 (class Read_script): Add dirindex_ field. Add it to constructor.
14202 Change all callers.
14203 * archive.cc (Archive::setup): Remove input_objects parameter.
14204 Change all callers.
14205 (Archive::get_file_and_offset): Likewise.
14206 (Archive::read_all_symbols): Likewise.
14207 (Archive::read_symbols): Likewise.
14208 (Archive::get_elf_object_for_member): Remove input_objects
14209 parameter. Add punconfigured parameter. Change all callers.
14210 (Archive::add_symbols): Change return type to bool. Check return
14211 value of include_member.
14212 (Archive::include_all_members): Likewise.
14213 (Archive::include_member): Change return type to bool. Return
14214 false if first included object has incompatible target. Set
14215 included_member_ field.
14216 (Add_archive_symbols::run): If add_symbols returns false, requeue
14217 Read_symbols task.
14218 * archive.h (class Archive): Add included_member_ field.
14219 Initialize it in constructor. Add input_file and searched_for
14220 methods. Update declarations.
14221 (class Add_archive_symbols): Add dirpath_, dirindex_, and
14222 input_argument_ fields. Add them to constructor. Change all
14223 callers.
14224 * script.cc: Include "target-select.h".
14225 (class Parser_closure): Add skip_on_incompatible_target_ and
14226 found_incompatible_target_ fields. Add
14227 skip_on_incompatible_target parameter to constructor. Change all
14228 callers. Add methods skip_on_incompatible_target,
14229 clear_skip_on_incompatible_target, found_incompatible_target, and
14230 set_found_incompatible_target.
14231 (read_input_script): Add dirindex parameter. Change all callers.
14232 If parser finds an incompatible target, requeue Read_symbols
14233 task.
14234 (script_set_symbol): Clear skip_on_incompatible_target in
14235 closure.
14236 (script_add_assertion, script_parse_option): Likewise.
14237 (script_start_sections, script_add_phdr): Likewise.
14238 (script_check_output_format): New function.
14239 * script.h (read_input_script): Update declaration.
14240 * script-c.h (script_check_output_format): Declare.
14241 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
14242 (ignore_cmd): Remove OUTPUT_FORMAT.
14243 * fileread.cc (Input_file::Input_file): Add explicit this.
14244 (Input_file::will_search_for): New function.
14245 (Input_file::open): Add pindex parameter. Change all callers.
14246 * fileread.h (class Input_file): Add input_file_argument method.
14247 Declare will_search_for. Update declarations.
14248 * object.cc (make_elf_object): Add punconfigured parameter.
14249 Change all callers.
14250 * object.h (class Object): Make input_file public. Add
14251 searched_for method.
14252 (make_elf_object): Update declaration.
14253 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
14254 restart search.
14255 * dirsearch.h (class Dirsearch): Update declaration.
14256 * options.h (class General_options): Add --warn-search-mismatch.
14257 * parameters.cc (Parameters::is_compatible_target): New function.
14258 * parameters.h (class Parameters): Declare is_compatible_target.
14259 * workqueue.cc (Workqueue::add_blocker): New function.
14260 * workqueue.h (class Workqueue): Declare add_blocker.
14261
f1ed28fb
ILT
14262 * fileread.cc (Input_file::open): Remove options parameter.
14263 Change all callers.
14264 (Input_file::open_binary): Likewise.
14265 * script.cc (read_input_script): Likewise.
14266 * readsyms.h (class Read_symbols): Remove options_ field. Remove
14267 options parameter from constructor. Change all callers.
14268 (class Read_script): Likewise.
14269 * fileread.h (class Input_file): Update declarations.
14270 * script.h (read_input_script): Update declaration.
14271
34dd024a
NC
142722009-03-10 Nick Clifton <nickc@redhat.com>
14273
14274 * po/es.po: New Spanish translation.
14275
6d71b17c
CC
142762009-03-06 Cary Coutant <ccoutant@google.com>
14277
14278 * options.cc (parse_short_option): Keep dash_z from registering itself.
14279
031cdbed
ILT
142802009-03-03 Ian Lance Taylor <iant@google.com>
14281
14282 PR 9918
14283 * target-reloc.h (relocate_section): Pass output_section to
14284 relocate.
14285 * i386.cc (Target_i386::should_apply_static_reloc): Add
14286 output_section parameter. Change all callers.
14287 (Target_i386::Relocate::relocate): Add output_section parameter.
14288 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14289 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
14290 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
14291 * testsuite/two_file_shared.sh: New script.
14292 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
14293 (check_DATA): Add two_file_shared.dbg.
14294 (two_file_shared.dbg): New target.
14295 * testsuite/Makefile.in: Rebuild.
14296
15d5fa16
ILT
142972009-03-01 Ian Lance Taylor <iant@google.com>
14298
14299 * configure.ac: Check for byteswap.h.
14300 * configure: Rebuild.
14301 * config.in: Rebuild.
14302
8a4c0b0d
ILT
143032009-03-01 Mikolaj Zalewski <mikolajz@google.com>
14304
14305 * layout.cc (Layout::find_or_add_kept_section): New function.
14306 (Layout::add_comdat): Removed.
14307 * layout.h (struct Kept_section): Move out of class Layout.
14308 Remove trailing underscores from field names. Add group_sections
14309 field. Rename group_ field to is_group. Change all uses.
14310 (class Layout): Declare find_or_add_kept_section, not add_comdat.
14311 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
14312 comdat_groups_ field.
14313 (Sized_relobj::include_section_group): Use
14314 find_or_add_kept_section and Kept_section::group_sections.
14315 (Sized_relobj::include_linkonce_section): Likewise.
14316 * object.cc (class Sized_relobj): Don't define Comdat_group or
14317 Comdat_group_table. Remove find_comdat_group and
14318 add_comdat_group. Remove comdat_groups_ field.
14319 * plugin.cc (include_comdat_group): Use
14320 Layout::find_or_add_kept_section.
14321
b4ecf66b
ILT
143222009-02-28 Ian Lance Taylor <iant@google.com>
14323
14359ca0
ILT
14324 * README: --gc-sections and map files are now supported. Document
14325 some build requirements.
14326
b4ecf66b
ILT
14327 PR 6992
14328 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
14329 relocatable link set the value of the section symbol to zero.
14330 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
14331 relocatable link don't include the section address in the local
14332 symbol value.
14333
0602e05a
ILT
143342009-02-27 Ian Lance Taylor <iant@google.com>
14335
fd9d194f
ILT
14336 PR 6811
14337 * options.h (class Search_directory): Add is_system_directory.
14338 (class General_options): Declare is_in_system_directory.
14339 * options.cc (get_relative_sysroot): Make static.
14340 (get_default_sysroot): Make static.
14341 (General_optoins::is_in_system_directory): New function.
14342 * fileread.cc (Input_file::is_in_system_directory): New function.
14343 * fileread.h (class Input_file): Declare is_in_system_directory.
14344 * object.h (class Object): Add is_in_system_directory.
14345 (class Input_objects): Remove system_library_directory_ field.
14346 * object.cc (Input_objects::add_object): Don't set
14347 system_library_directory_.
14348 (input_objects::found_in_system_library_directory): Remove.
14349 * symtab.cc (Symbol_table::write_globals): Remove input_objects
14350 parameter. Change all callers.
14351 (Symbol_table::sized_write_globals): Likewise.
14352 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
14353 Call Object::is_in_system_directory.
14354 * symtab.h (class Symbol_table): Update declarations.
14355
61edd21f
ILT
14356 PR 5990
14357 * descriptors.h (Open_descriptor): Add is_on_stack field.
14358 * descriptors.cc (Descriptors::open): If the descriptor is on the
14359 top of the stack, remove it. Initialize is_on_stack field.
14360 (Descriptors::release): Only add pod to stack if it is not on the
14361 stack already.
14362 (Descriptors::close_some_descriptor): Clear stack_next and
14363 is_on_stack fields.
14364
e29e076a
ILT
14365 PR 7091
14366 * output.cc (Output_section::find_starting_output_address): Rename
14367 from starting_output_address; add PADDR parameter; change return
14368 type.
14369 * output.h (class Output_section): Declare
14370 find_starting_output_address instead of starting_output_address.
14371 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
14372 section symbol for which we can't find a merge section.
14373
0602e05a
ILT
14374 PR 9836
14375 * symtab.cc (Symbol_table::add_from_object): If the visibility is
14376 hidden or internal, force the symbol to be local.
14377 * resolve.cc (Symbol::override_visibility): Define.
14378 (Symbol::override_base): Use override_visibility.
14379 (Symbol_table::resolve): Likewise.
14380 (Symbol::override_base_with_special): Likewise.
14381 (Symbol_table::override_with_special): If the visibility is hidden
14382 or internal, force the symbol to be local.
14383 * symtab.h (class Symbol): Add set_visibility and
14384 override_visibility.
14385 * testsuite/ver_test_1.sh: New file.
14386 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
14387 (check_DATA): Add ver_test_1.syms.
14388 (ver_test_1.syms): New target.
14389 * testsuite/Makefile.in: Rebuild.
14390
401a9a73
CC
143912009-02-25 Cary Coutant <ccoutant@google.com>
14392
14393 * layout.cc (Layout::choose_output_section): Don't rename sections
14394 when using a linker script that has a SECTIONS clause.
14395 * Makefile.in: Regenerate.
14396
14397 * testsuite/Makefile.am (script_test_5.sh): New test case.
14398 * testsuite/Makefile.in: Regenerate.
14399 * testsuite/script_test_5.cc: New file.
14400 * testsuite/script_test_5.sh: New file.
14401 * testsuite/script_test_5.t: New file.
14402
f488e4b0
CC
144032009-02-13 Rafael Avila de Espindola <espindola@google.com>
14404
14405 * archive.cc (Archive::include_member): Update calls to add_symbols.
14406 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
14407 the Layout argument.
14408 * dynobj.h (do_add_symbols): Add the Layout argument.
14409 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
14410 Layout argument.
14411 * object.h (Object::add_symbols): Add the Layout argument.
14412 (Object::do_add_symbols): Add the Layout argument.
14413 (Sized_relobj::do_add_symbols): Add the Layout argument.
14414 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
14415 Unify the two versions.
14416 (Add_plugin_symbols): Remove.
14417 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
14418 (Sized_pluginobj::do_add_symbols): Unify the two versions.
14419 (Add_plugin_symbols): Remove.
14420 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
14421 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
14422 (Add_symbols::run): Make it work with Pulginobj.
14423
89dd1680
ILT
144242009-02-06 Ian Lance Taylor <iant@google.com>
14425
14426 * object.cc (Sized_relobj::do_layout): Make info message start
14427 with lower case letter.
14428
266d0a74
ILT
144292009-02-06 Mikolaj Zalewski <mikolajz@google.com>
14430
602b464e
ILT
14431 * binary.cc: Fix file comment.
14432
266d0a74
ILT
14433 * options.h (enum Incremental_disposition): Define.
14434 (class General_options): Add new options: --incremental,
14435 --incremental_changed, --incremental_unchanged,
14436 --incremental_unknown. Add incremental_disposition_ and
14437 implicit_incremental_ fields.
14438 (General_options::incremental_disposition): New function.
14439 (class Position_dependent_options): Add incremental_disposition
14440 option.
14441 (Position_dependent_options::copy_from_options): Set incremental
14442 dispositions.
14443 * options.cc (General_options::parse_incremental_changed): New
14444 function.
2e702c99
RM
14445 (General_options::parse_incremental_unchanged): New function.
14446 (General_options::parse_incremental_unknown): New function.
14447 (General_options::General_options): Initialize new fields
266d0a74 14448 incremental_disposition_ and implicit_incremental_.
2e702c99 14449 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
14450 without --incremental.
14451
f073bbf7
CD
144522009-02-06 Chris Demetriou <cgd@google.com>
14453
14454 * gold.h (gold_undefined_symbol): Change to take only a Symbol
14455 pointer and to report location as the file name associated with
14456 the symbol.
14457 (gold_undefined_symbol_at_location): New function to replace the
14458 old gold_undefined_symbol functionality.
14459 * target-reloc.h (relocate_section): Update to use
14460 gold_undefined_symbol_at_location.
14461 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14462 Call gold_undefined_symbol function rather than gold_error.
14463 * errors.h (Errors::undefined_symbol): Take location as a
14464 string, rather than calculating it from a relocation.
14465 * errors.cc (Errors::fatal): Print "fatal error:" before the
14466 formatted message.
14467 (Errors::error, Errors::error_at_location): Print "error: "
14468 before the formatted message.
14469 (Errors::undefined_symbol): Take location as a string, rather
14470 than calculating it from a relocation.
14471 (gold_undefined_symbol_at_location): New function akin to
14472 old gold_undefined_symbol, calculates location from relocation.
14473 (gold_undefined_symbol): Change to take only a Symbol pointer
14474 and to report location as the file name associated with the symbol.
14475 * testsuite/debug_msg.sh: Update for changed error messages.
14476 * testsuite/undef_symbol.sh: Likewise.
14477
8e94a90c
ILT
144782009-02-04 Duncan Sands <baldrick@free.fr>
14479
14480 PR 9812
14481 * reduced_debug_output.h
14482 (Output_reduced_debug_abbrev_section::failed): Use format for
14483 gold_warning.
14484 (Output_reduced_debug_info_section::faild): Likewise.
14485
88a0e15b
ILT
144862009-01-31 Mikolaj Zalewski <mikolajz@google.com>
14487
14488 * script.cc (Lazy_demangler): New class.
2e702c99 14489 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
14490 symbol only once.
14491
5efc7cd2
CC
144922009-01-29 Cary Coutant <ccoutant@google.com>
14493
14494 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
14495 to __tls_get_addr.
14496 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14497
e0ebcf42
ILT
144982009-01-28 Ian Lance Taylor <iant@google.com>
14499
5efc7cd2 14500 * version.cc (version_string): Bump to 1.9.
75fe7426 14501
e0ebcf42
ILT
14502 * gold.h: Include <cstring> and <stdint.h>.
14503 * version.cc: Include <cstdio>.
14504 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
14505 warning.
14506 * reduced_debug_output.cc (insert_into_vector): Rename from
14507 Insert_into_vector; change all callers. Use Swap_unaligned to
14508 avoid aliasing issue; remove union since it is unnecessary.
14509
8e2813be 145102009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
14511
14512 * Makefile.am (CCFILES): Add gc.cc.
14513 (HFILES): Add gc.h.
14514 * Makefile.in: Regenerate.
14515 * gold.cc (Gc_runner): New class.
14516 (queue_initial_tasks): Call garbage collection related tasks
14517 when corresponding options are invoked.
14518 (queue_middle_gc_tasks): New function.
14519 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
14520 processed early before laying out sections during garbage collection.
14521 * gold.h (queue_middle_gc_tasks): New function.
14522 (is_prefix_of): Move from "layout.cc".
14523 * i386.cc (Target_i386::gc_process_relocs): New function.
14524 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
14525 * main.cc (main): Create object of class "Garbage_collection".
14526 * object.cc (Relobj::copy_symbols_data): New function.
14527 (Relobj::is_section_name_included): New function.
e1df38aa
NC
14528 (Sized_relobj::do_layout): Allow this function to be called twice
14529 during garbage collection and defer layout of section during the
6d03d481
ST
14530 first call.
14531 * object.h (Relobj::get_symbols_data): New function.
14532 (Relobj::is_section_name_included): New function.
14533 (Relobj::copy_symbols_data): New function.
14534 (Relobj::set_symbols_data): New function.
14535 (Relobj::get_relocs_data): New function.
14536 (Relobj::set_relocs_data): New function.
14537 (Relobj::is_output_section_offset_invalid): New pure virtual function.
14538 (Relobj::gc_process_relocs): New function.
14539 (Relobj::do_gc_process_relocs): New pure virtual function.
14540 (Relobj::sd_): New data member.
14541 (Sized_relobj::is_output_section_offset_invalid): New function.
14542 (Sized_relobj::do_gc_process_relocs): New function.
14543 * options.h (General_options::gc_sections): Modify to not be a no-op.
14544 (General_options::print_gc_sections): New option.
14545 * plugin.cc (Plugin_finish::run): Remove function call to
14546 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
14547 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
14548 * reloc.cc (Read_relocs::run): Add task to process relocs and
14549 determine unreferenced sections when doing garbage collection.
14550 (Gc_process_relocs): New class.
14551 (Sized_relobj::do_gc_process_relocs): New function.
14552 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
14553 sections that are garbage collected.
14554 * reloc.h (Gc_process_relocs): New class.
14555 * sparc.cc (Target_sparc::gc_process_relocs): New function.
14556 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
14557 symbols whose corresponding sections are garbage collected.
14558 (Symbol_table::Symbol_table): Add new parameter for the garbage
14559 collection object.
14560 (Symbol_table::gc_mark_undef_symbols): New function.
14561 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14562 (Symbol_table::gc_mark_dyn_syms): New function.
14563 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
14564 as garbage.
14565 (Symbol_table::add_from_object): Likewise.
14566 (Symbol_table::add_from_relobj): When building shared objects, do not
14567 treat externally visible symbols as garbage.
14568 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
14569 table information for static and relocatable links.
14570 * symtab.h (Symbol_table::set_gc): New function.
14571 (Symbol_table::gc): New function.
14572 (Symbol_table::gc_mark_undef_symbols): New function.
14573 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14574 (Symbol_table::gc_mark_dyn_syms): New function.
14575 (Symbol_table::gc_): New data member.
e1df38aa 14576 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
14577 function.
14578 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
14579 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
14580
3b293544
CF
145812009-01-20 Chris Faylor <me.sourceware@sourceware.org>
14582
14583 * options.h (General_options::gc_sections): Define as a no-op for now.
14584 (General_options::no_keep_memory): Ditto.
14585 (General_options::Bshareable): Define.
14586 * options.cc (General_options::finalize): Honor -Bshareable.
14587
83d22aa8
AS
145882009-01-20 Andreas Schwab <schwab@suse.de>
14589
14590 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
14591 read the value in the contents, since we don't use it. Use the
14592 template endianness when writing.
14593 (Relocate::relocate): Use it for R_PPC_REL16_HA.
14594
cd536b21
AS
145952009-01-19 Andreas Schwab <schwab@suse.de>
14596
14597 * configure.tgt (powerpc64-*): Fix targ_obj.
14598
99e9a495
ILT
145992009-01-15 Ian Lance Taylor <iant@google.com>
14600
14601 * object.cc (Sized_relobj::write_local_symbols): Don't write out
14602 local symbols when stripping all symbols.
14603
bbbfea06
CC
146042009-01-14 Cary Coutant <ccoutant@google.com>
14605
99e9a495 14606 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 14607
0f7c0701
CC
146082009-01-14 Cary Coutant <ccoutant@google.com>
14609
14610 * archive.cc (Archive::get_elf_object_for_member): Remove call
14611 to File_read::claim_for_plugin.
14612 * descriptors.cc (Descriptors::open): Remove reference to
14613 is_claimed.
14614 (Descriptors::claim_for_plugin): Remove.
14615 * descriptors.h (Descriptors::claim_for_plugin): Remove.
14616 (Descriptors::is_claimed): Remove.
14617 (claim_descriptor_for_plugin): Remove.
14618 * fileread.cc (File_read::claim_for_plugin): Remove.
14619 * fileread.h (File_read::claim_for_plugin): Remove.
14620 (File_read::descriptor): Reopen descriptor if necessary.
14621 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
14622 (Plugin_manager::all_symbols_read): Add task parameter. Change
14623 all callers.
14624 (Plugin_manager::get_input_file): New function.
14625 (Plugin_manager::release_input_file): New function.
14626 (Pluginobj::Pluginobj): Add filesize parameter and initialize
14627 corresponding data member.
14628 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
14629 and pass to base constructor. Change all callers.
14630 (get_input_file, release_input_file): New functions.
14631 (make_sized_plugin_object): Add filesize parameter. Change all callers.
14632 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
14633 (Plugin_manager::all_symbols_read): Add task parameter.
14634 (Plugin_manager::get_input_file): New function.
14635 (Plugin_manager::release_input_file): New function.
14636 (Plugin_manager::task_): New data member.
14637 (Pluginobj::Pluginobj): Add filesize parameter.
14638 (Pluginobj::filename): New function.
14639 (Pluginobj::descriptor): New function.
14640 (Pluginobj::filesize): New function.
14641 (Pluginobj::filesize_): New data member.
14642 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
14643 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
14644 File_read::claim_for_plugin; use Object::unlock to unlock the file.
14645
14646 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
14647 with archive libraries.
14648 * testsuite/Makefile.in: Regenerate.
14649 * testsuite/plugin_test.c (struct sym_info): New type.
14650 (get_input_file, release_input_file): New static variables.
14651 (onload): Capture new transfer vector entries.
14652 (claim_file_hook): Stop reading at end of file according to filesize.
14653 Factor out parsing of readelf output into separate function.
14654 (all_symbols_read_hook): Exercise get_input_file and release_input_file
14655 APIs and get the source file name from the symbol table. Convert
14656 source file name to corresponding object file name. Print info
14657 message when adding new input files.
14658 (parse_readelf_line): New function.
14659 * testsuite/plugin_test_1.sh: Add checks for new info messages.
14660 * testsuite/plugin_test_2.sh: Likewise.
14661 * testsuite/plugin_test_3.sh: Likewise.
14662 * testsuite/plugin_test_4.sh: New test case.
14663
62a6d109
ILT
146642009-01-07 Ian Lance Taylor <iant@google.com>
14665
14666 * version.cc (version_string): Bump to 1.8.
14667
483620e8
CC
146682008-12-23 Cary Coutant <ccoutant@google.com>
14669
14670 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
14671 * plugin.cc (Plugin_manager::finish): Rename as
14672 layout_deferred_objects. Move cleanup to separate function.
14673 (Plugin_manager::cleanup): New function.
14674 (Plugin_finish::run): Call layout_deferred_objects and cleanup
14675 separately.
14676 * plugin.h (Plugin_manager::finish): Rename as
14677 layout_deferred_objects.
14678 (Plugin_manager::cleanup): New function.
14679 (Plugin_manager::cleanup_done): New field.
14680
d66a9eb3
CC
146812008-12-23 Cary Coutant <ccoutant@google.com>
14682
14683 * plugin.cc (is_visible_from_outside): New function.
14684 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
14685 so we don't return "IR only" status for exported symbols or -r links.
14686
14687 * testsuite/Makefile.am (plugin_test_3): New test case.
14688 * testsuite/Makefile.in: Regenerate.
14689 * testsuite/plugin_test_3.sh: New file.
14690
5995b570
CC
146912008-12-22 Cary Coutant <ccoutant@google.com>
14692
14693 * object.cc (Sized_relobj::layout_section): New function.
14694 (Sized_relobj::do_layout): Defer layout of input sections until after
14695 plugin has provided replacement files.
14696 (Sized_relobj::do_layout_deferred_sections): New function.
14697 * object.h (Relobj::set_section_offset): Remove virtual keyword.
14698 (Relobj::layout_deferred_sections): New function.
14699 (Relobj::do_layout_deferred_sections): New function.
14700 (Sized_relobj::do_layout_deferred_sections): New function.
14701 (Sized_relobj::layout_section): New function.
14702 (Sized_relobj::Deferred_layout): New structure.
14703 (Sized_relobj::deferred_layout_): New field.
14704 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
14705 Change all callers. Layout deferred sections.
14706 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
14707 references.
14708 (Plugin_hook::run): Move code from do_plugin_hook inline.
14709 (Plugin_hook::do_plugin_hook): Remove.
14710 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
14711 (Plugin_manager::finish): Renamed, was cleanup.
14712 (Plugin_manager::should_defer_layout): New function.
14713 (Plugin_manager::add_deferred_layout_object): New function.
14714 (Plugin_manager::Deferred_layout_list): New type.
14715 (Plugin_manager::deferred_layout_objects_): New field.
14716 (Plugin_hook::do_plugin_hook): Remove.
14717
ee769c88
ILT
147182008-12-17 Ian Lance Taylor <iant@google.com>
14719
14720 * options.h (class General_options): Add --no case for
14721 --export-dynamic.
14722
abc8dcba
CC
147232008-12-16 Cary Coutant <ccoutant@google.com>
14724
14725 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
14726 vector.
14727 (Plugin_manager::claim_file): Create plugin object even if
14728 plugin did not call the add_symbols callback.
14729 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
14730 asking for more symbols than were added.
14731 * testsuite/Makefile.am (plugin_test_1): Add test case with
14732 no global symbols.
14733 (empty.syms): New target.
14734 * testsuite/Makefile.in: Regenerate.
14735 * testsuite/plugin_test.c (claim_file_hook): Add new debug
14736 message. Don't call add_symbols if no globals.
14737 (all_symbols_read_hook): Don't provide replacement for empty
14738 claimed file.
14739
b0074644
ILT
147402008-12-12 Ian Lance Taylor <iant@google.com>
14741
68943102
ILT
14742 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
14743 r_type == 0 for a local symbol with r_sym == 0.
14744 (scan_relocatable_relocs): Pass r_sym to
14745 local_non_section_strategy.
14746 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
14747 r_sym parameter.
14748
b0074644
ILT
14749 * configure.ac: Update test for TLS descriptors: they are
14750 supported as of glibc 2.9.
14751 * configure: Rebuild.
14752
c2508178
ILT
147532008-12-11 Ian Lance Taylor <iant@google.com>
14754
14755 PR 7091
14756 * target-reloc.h (Default_scan_relocatable_relocs): For each
14757 function, map r_type == 0 to RELOC_DISCARD.
14758
2756a258
CC
147592008-12-10 Cary Coutant <ccoutant@google.com>
14760
14761 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
14762 object to override a kept COMDAT group from a plugin object.
14763
bb6f53d3
ILT
147642008-12-09 Ian Lance Taylor <iant@google.com>
14765
fbc558e1
ILT
14766 PR 7088
14767 * yyscript.y (file_cmd): Handle INPUT.
14768
bb6f53d3
ILT
14769 * testsuite/initpri1.c: Change all declarations to be full
14770 prototypes by adding void, to avoid compiler warnings.
14771
4674ecfc
CC
147722008-12-05 Rafael Avila de Espindola <espindola@google.com>
14773
14774 * options.cc (General_options::parse_plugin_opt): New.
14775 (General_options::add_plugin): The argument now is just the filename.
14776 (General_options::add_plugin_option): New.
14777 * options.h (plugin_opt): New.
14778 (add_plugin): Change argument name.
14779 (add_plugin_option): New.
14780 * plugin.cc (Plugin::load): Don't parse the plugin option.
14781 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
14782 (Plugin::add_option): New.
14783 (Plugin::args_): Change type.
14784 (Plugin::filename_): New.
14785 (Plugin_manager::add_plugin_option): New.
14786 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
14787 * testsuite/Makefile.in: Regenerate.
14788
fd06b4aa
CC
147892008-12-05 Cary Coutant <ccoutant@google.com>
14790
14791 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
14792 Handle --strip-lto-sections option.
14793 * options.h (strip_lto_sections): New option.
14794
6c52134c
CC
147952008-12-01 Cary Coutant <ccoutant@google.com>
14796
14797 * plugin.cc (ld_plugin_message): Change format parameter to const.
14798 Fix mismatch between new[] and delete.
14799
a45248e0
CC
148002008-11-14 Cary Coutant <ccoutant@google.com>
14801
14802 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
14803 instead of -1U.
14804
c82fbeee
CS
148052008-11-05 Craig Silverstein <csilvers@google.com>
14806
14807 * options.cc (General_options::parse_dynamic_list): New function.
14808 * options.h (General_options): New flags dynamic_list,
14809 dynamic_list_data, dynamic_list_cpp_new, and
14810 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
14811 (General_options::in_dynamic_list): New function.
14812 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
14813 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
14814 (Lex::can_continue_name): Likewise.
14815 (yylex): Likewise.
14816 (read_script_file): New parameter script_options.
14817 (read_dynamic_list): New function.
14818 (Script_options::define_dynamic_list): New function.
14819 (dynamic_list_keyword_parsecodes): New variable.
14820 (dynamic_list_keywords): New variable.
14821 * script.h (Script_options::define_dynamic_list): New function
14822 prototype.
14823 (read_dynamic_list): New function prototype.
14824 * symtab.cc (strprefix): New macro.
14825 (Symbol::should_add_dynsym_entry): Support dynamic_list,
14826 dynamic_list_data, dynamic_list_cpp_new, and
14827 dynamic_list_cpp_typeinfo.
14828 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
14829 (dynamic_list_expr): New rule.
14830 (dynamic_list_nodes): Likewise.
14831 (dynamic_list_node): Likewise.
14832 * testsuite/Makefile.am (dynamic_list): New test.
14833 * testsuite/Makefile.in: Regenerated.
14834 * testsuite/dynamic_list.t: New file.
14835 * testsuite/dynamic_list.sh: New file.
14836
e0bb29a5
CS
148372008-11-05 Craig Silverstein <csilvers@google.com>
14838
14839 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
14840 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
14841 (t11_last): Likewise.
14842 * testsuite/ver_test_6.c (main): Likewise.
14843
4e1e25e0
CC
148442008-10-07 Cary Coutant <ccoutant@google.com>
14845
14846 * options.c (General_options::finalize): Add check for -static and
14847 -shared.
14848 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
14849 is not empty.
14850
92f03fcb
CC
148512008-10-02 Cary Coutant <ccoutant@google.com>
14852
14853 * plugin.cc (make_sized_plugin_object): Fix conditional
14854 compilation to work when not all targets are enabled.
14855
fbd8a257
CC
148562008-09-29 Cary Coutant <ccoutant@google.com>
14857
14858 * archive.cc (Archive::get_file_and_offset): Use filename instead
14859 of name to get library path.
14860 (Archive::include_member): Unlock external member of a thin archive.
14861
14862 * testsuite/Makefile.am (TEST_AR): New variable.
14863 (thin_archive_test_1): New test.
14864 (thin_archive_test_2): New test.
81636b3f
CC
14865 * testsuite/Makefile.in: Regenerate.
14866 * testsuite/thin_archive_main.cc: New file.
14867 * testsuite/thin_archive_test_1.cc: New file.
14868 * testsuite/thin_archive_test_2.cc: New file.
14869 * testsuite/thin_archive_test_3.cc: New file.
14870 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 14871
eff45813
CC
148722008-09-29 Cary Coutant <ccoutant@google.com>
14873
14874 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
14875 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
14876 instead of -1U.
14877 (Sized_relobj::do_finalize_local_symbols): Likewise.
14878 (Sized_relobj::map_to_kept_section): Likewise.
14879 * object.h (Sized_relobj::invalid_address): New constant.
14880 (Sized_relobj::do_output_section_offset): Check for invalid_address
14881 and return -1ULL.
14882 * output.cc (Output_reloc::local_section_offset): Use constant
14883 invalid_address instead of -1U.
14884 (Output_reloc::get_address): Likewise.
14885 (Output_section::output_address): Change -1U to -1ULL.
14886 * output.h (Output_reloc::invalid_address): New constant.
14887 * reloc.cc (Sized_relobj::write_sections): Use constant
14888 invalid_address instead of -1U.
14889 (Sized_relobj::relocate_sections): Likewise.
14890 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
14891 values for merge sections.
14892 * target-reloc.h (relocate_for_relocatable): Use constant
14893 invalid_address instead of -1U.
14894
89fc3421
CC
148952008-09-19 Cary Coutant <ccoutant@google.com>
14896
14897 Add plugin functionality for link-time optimization (LTO).
14898 * configure.ac (plugins): Add --enable-plugins option.
14899 * configure: Regenerate.
14900 * config.in: Regenerate.
14901 * Makefile.am (LIBDL): New variable.
14902 (CCFILES): Add plugin.cc.
14903 (HFILES): Add plugin.h.
14904 (ldadd_var): Add LIBDL.
14905 * Makefile.in: Regenerate.
14906
14907 * archive.cc: Include "plugin.h".
14908 (Archive::setup): Don't preread archive symbols when using a plugin.
14909 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
14910 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
14911 files.
14912 (Archive::include_member): Add symbols from plugin objects.
14913 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
14914 * descriptors.cc (Descriptors::open): Check for file descriptors
14915 abandoned by plugins.
14916 (Descriptors::claim_for_plugin): New function.
14917 * descriptors.h (Descriptors::claim_for_plugin): New function.
14918 (Open_descriptor::is_claimed): New field.
14919 (claim_descriptor_for_plugin): New function.
14920 * fileread.cc (File_read::claim_for_plugin): New function.
14921 * fileread.h (File_read::claim_for_plugin): New function.
14922 (File_read::descriptor): New function.
14923 * gold.cc: Include "plugin.h".
14924 (queue_initial_tasks): Add task to call plugin hooks for generating
14925 new object files.
14926 * main.cc: Include "plugin.h".
14927 (main): Load plugin libraries.
14928 * object.h (Pluginobj): Declare.
14929 (Object::pluginobj): New function.
14930 (Object::do_pluginobj): New function.
14931 (Object::set_target): New function.
14932 * options.cc: Include "plugin.h".
14933 (General_options::parse_plugin): New function.
14934 (General_options::General_options): Initialize plugins_ field.
14935 (General_options::add_plugin): New function.
14936 * options.h (Plugin_manager): Declare.
14937 (General_options): Add --plugin option.
14938 (General_options::has_plugins): New function.
14939 (General_options::plugins): New function.
14940 (General_options::add_plugin): New function.
14941 (General_options::plugins_): New field.
14942 * plugin.cc: New file.
14943 * plugin.h: New file.
14944 * readsyms.cc: Include "plugin.h".
14945 (Read_symbols::do_read_symbols): Check for archive before checking
14946 for ELF file. Call plugin hooks to claim files.
14947 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
14948 from a real object file; force override when processing replacement
14949 files.
14950 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
14951 (Symbol::init_base_object): Likewise.
14952 (Symbol::init_base_output_data): Likewise.
14953 (Symbol::init_base_output_segment): Likewise.
14954 (Symbol::init_base_constant): Likewise.
14955 (Symbol::init_base_undefined): Likewise.
14956 (Symbol::output_section): Assert that object is not a plugin.
14957 (Symbol_table::add_from_pluginobj): New function.
14958 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
14959 undefined.
14960 (Symbol_table::sized_write_globals): Likewise.
14961 (Symbol_table::add_from_pluginobj): Instantiate template.
14962 * symtab.h (Sized_pluginobj): Declare.
14963 (Symbol::in_real_elf): New function.
14964 (Symbol::set_in_real_elf): New function.
14965 (Symbol::in_real_elf_): New field.
14966 (Symbol_table::add_from_pluginobj): New function.
14967
14968 * testsuite/Makefile.am (AM_CFLAGS): New variable.
14969 (LIBDL): New variable.
14970 (LDADD): Add LIBDL.
14971 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
14972 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
14973 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
14974 (MOSTLYCLEANFILES): Likewise.
14975 * testsuite/Makefile.in: Regenerate.
14976 * testsuite/plugin_test.c: New file.
14977 * testsuite/plugin_test_1.sh: New file.
14978 * testsuite/plugin_test_2.sh: New file.
14979
de31bda5
ILT
149802008-09-16 Ian Lance Taylor <iant@google.com>
14981
9c2d0ef9
ILT
14982 * target-reloc.h (relocate_section): Check whether a symbol is
14983 defined by the ABI before reporting an undefined symbol error.
14984 * target.h (Target::is_defined_by_abi): Make parameter const.
14985 (Target::do_is_defined_by_abi): Likewise.
14986 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
14987 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
14988 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
14989 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
14990 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
14991 * testsuite/Makefile.in: Rebuild.
14992
de31bda5
ILT
14993 * fileread.cc (make_view): Add casts to avoid warning.
14994
9fa33bee
AO
149952008-09-16 Alexandre Oliva <aoliva@redhat.com>
14996
14997 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
14998 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14999
183fd0e3
AO
150002008-09-16 Alexandre Oliva <aoliva@redhat.com>
15001
15002 * options.h (General_options::output_is_executable): New.
15003 (General_options::output_is_pie): New.
15004 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
15005 for shared libraries.
15006 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15007
7be8330a
CD
150082008-09-11 Chris Demetriou <cgd@google.com>
15009
15010 * options.h (origin): New -z option.
15011 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
15012 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
15013 in DT_FLAGS_1.
15014
a9caad02
CC
150152008-09-05 Cary Coutant <ccoutant@google.com>
15016
15017 * fileread.cc (File_read::make_view): Add check for attempt to map
15018 beyond end of file.
15019
ae6dce4d
CC
150202008-09-05 Cary Coutant <ccoutant@google.com>
15021
15022 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
15023 explicit instantiations.
15024
d7ab2a47
KVH
150252008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
15026
15027 PR gold/6858
15028 * options.cc (General_options::finalize): Allow undefined symbols
15029 in shlibs if linking -shared.
15030
15031 PR gold/6859
15032 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
15033 symbols as not needing a dynsym entry.
15034
1e52a9c1
CS
150352008-08-20 Craig Silverstein <csilvers@google.com>
15036
15037 * fileread.cc (File_read::open): Do not lock the file unless it
15038 was successfully opened.
15039
d85c80a3
CC
150402008-08-14 Cary Coutant <ccoutant@google.com>
15041
15042 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
15043 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
15044 * testsuite/tls_test.cc (struct int128): 128-bit struct
15045 for testing TLS relocs with non-zero addend.
15046 (v12): New TLS variable.
15047 (t12): New test.
15048 (t_last): Add check for v12.
15049 * testsuite/tls_test.h (t12): New function.
15050 * testsuite/tls_test_main.cc (thread_routine): Call new test.
15051
2d924fd9
ILT
150522008-08-13 Ian Lance Taylor <iant@google.com>
15053
15054 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
15055 set tls_segment_ or relro_segment_.
15056 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
15057 when appropriate.
15058 * output.h (Output_section::clear_is_relro): New function.
15059 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
15060 sections specially even when output_data_ is empty.
15061 (Output_segment::maximum_alignment): When first section is relro,
15062 only force alignment for PT_LOAD segments.
15063 * script.cc (script_data_segment_align): New function.
15064 (script_data_segment_relro_end): New function.
15065 * script-c.h (script_data_segment_align): Declare.
15066 (script_data_segment_relro_end): Declare.
15067 * script-sections.h (class Script_sections): Declare
15068 data_segment_align and data_segment_relro_end. Add fields
15069 segment_align_index_ and saw_relro_end_.
15070 * script-sections.cc (class Sections_element): Add set_is_relro
15071 virtual function. Add new bool* parameter to place_orphan_here.
15072 Add get_output_section virtual function.
15073 (class Output_section_definition): Add set_is_relro. Add new
15074 bool* parameter to place_orphan_here. Add get_output_section.
15075 Add is_relro_ field.
15076 (Output_section_definition::Output_section_definition): Initialize
15077 evaluated_address_, evaluated_load_address, evaluated_addralign_,
15078 and is_relro_ fields.
15079 (Output_section_definition::place_orphan_here): Add is_relro
15080 parameter.
15081 (Output_section_definition::set_section_addresses): Set relro for
15082 output section.
15083 (Output_section_definition::alternate_constraint): Likewise.
15084 (class Orphan_output_section): Add new bool* parameter to
15085 place_orphan_here. Add get_output_section.
15086 (Orphan_output_section::place_orphan_here): Add is_relro
15087 parameter.
15088 (Script_sections::Script_sections): Initialize
15089 data_segment_align_index_ and saw_relro_end_.
15090 (Script_sections::data_segment_align): New function.
15091 (Script_sections::data_segment_relro_end): New function.
15092 (Script_sections::place_orphan): Set or clear is_relro.
15093 (Script_sections::set_section_addresses): Force alignment of first
15094 TLS section.
15095 * yyscript.y (exp): Call script_data_segment_align and
15096 script_data_segment_relro_end.
15097 * testsuite/relro_script_test.t: New file.
15098 * testsuite/relro_test.cc (using_script): Declare.
15099 (t1, t2): Test using_script.
15100 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
15101 (relro_script_test_SOURCES): Define.
15102 (relro_script_test_DEPENDENCIES): Define.
15103 (relro_script_test_LDFLAGS): Define.
15104 (relro_script_test_LDADD): Define.
15105 (relro_script_test.so): New target.
15106 * testsuite/Makefile.in: Rebuild.
15107
f827c9a9
CC
151082008-08-06 Cary Coutant <ccoutant@google.com>
15109
15110 * archive.cc (Archive::total_archives, Archive::total_members)
15111 (Archive::total_members_loaded): New variables.
15112 (Archive::setup): Add parameter. Add option to preread
15113 archive symbols.
15114 (Archive::read_armap): Add counter.
15115 (Archive::get_file_and_offset): New function.
15116 (Archive::get_elf_object_for_member): New function.
15117 (Archive::read_all_symbols): New function.
15118 (Archive::read_symbols): New function.
15119 (Archive::add_symbols): Add counters.
15120 (Archive::include_all_members): Use armap to find members if it's
15121 already built.
15122 (Archive::include_member): Skip reading symbols if already read.
15123 Factored code into Archive::get_file_and_offset and
15124 Archive::get_elf_object_for_member. Changed call to
15125 Mapfile::report_include_archive_member.
15126 (Archive::print_stats): New function.
15127 * archive.h: Declare Object and Read_symbols_data classes.
15128 (Archive::Archive): Add initializers for new members.
15129 (Archive::setup): Add parameter.
15130 (Archive::print_stats): New function.
15131 (Archive::total_archives, Archive::total_members)
15132 (Archive::total_members_loaded): New variables.
15133 (Archive::get_file_and_offset): New function.
15134 (Archive::get_elf_object_for_member): New function.
15135 (Archive::read_all_symbols): New function.
15136 (Archive::read_symbols): New function.
15137 (Archive::Archive_member): New class.
15138 (Archive::members_): New member.
15139 (Archive::num_members_): New member.
15140 * main.cc: Include archive.h.
15141 (main): Call Archive::print_stats.
15142 * mapfile.cc (Mapfile::report_include_archive_member): Delete
15143 archive parameter; member_name is now the fully-decorated name.
15144 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
15145 * options.h: (General_options): Add --preread-archive-symbols option.
15146 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
15147 Archive::setup.
15148
de4c45bd
ILT
151492008-08-04 Ian Lance Taylor <iant@google.com>
15150
15151 * symtab.h (Symbol::use_plt_offset): New function.
15152 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
15153 * powerpc.cc (Relocate::relocate): Likewise.
15154 * sparc.cc (Relocate::relocate): Likewise.
15155 * x86_64.cc (Relocate::relocate): Likewise.
15156 * testsuite/weak_plt.sh: New test.
15157 * testsuite/weak_plt_main.cc: New test.
15158 * testsuite/weak_plt_shared.cc: New test.
15159 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
15160 (check_PROGRAMS): Add weak_plt.
15161 (check_DATA): Add weak_plt_shared.so.
15162 (weak_plt_main_pic.o, weak_plt): New targets.
15163 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
15164 * testsuite/Makefile.in: Rebuild.
15165
15166 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
15167 gcctestdir/ld.
15168 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
15169 * testsuite/Makefile.in: Rebuild.
15170
323ee3f4
AM
151712008-08-04 Alan Modra <amodra@bigpond.net.au>
15172
15173 * Makefile.am (POTFILES.in): Set LC_ALL=C.
15174 * Makefile.in: Regenerate.
15175 * po/POTFILES.in: Regenerate.
15176
7c07ecec
ILT
151772008-07-29 Ian Lance Taylor <iant@google.com>
15178
15179 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
15180 symbols before other symbols.
15181 * testsuite/script_test_2.cc (test_addr): Declare.
15182 (test_addr_alias): Declare.
15183 (main): Check that test_addr and test_addr_alias have the right
cd536b21 15184 values.
7c07ecec
ILT
15185 * testsuite/script_test_2.t: Define test_addr_alias and
15186 test_addr.
15187
5778530e
ILT
151882008-07-24 Ian Lance Taylor <iant@google.com>
15189
2a00e4fb
ILT
15190 PR 5990
15191 * descriptors.cc: New file.
15192 * descriptors.h: New file.
15193 * gold-threads.h (class Hold_optional_lock): New class.
15194 * fileread.cc: Include "descriptors.h".
15195 (File_read::~File_read): Release descriptor rather than closing
15196 it.
15197 (File_read::open) [file]: Call open_descriptor rather than open.
15198 Set is_descriptor_opened_.
15199 (File_read::open) [memory]: Assert that descriptor is not open.
15200 (File_read::reopen_descriptor): New function.
15201 (File_read::release): Release descriptor.
15202 (File_read::do_read): Make non-const. Reopen descriptor.
15203 (File_read::read): Make non-const.
15204 (File_read::make_view): Reopen descriptor.
15205 (File_read::do_readv): Likewise.
15206 * fileread.h (class File_read): Add is_descriptor_opened_ field.
15207 Update declarations.
15208 * layout.cc: Include "descriptors.h".
15209 (Layout::create_build_id): Use open_descriptor rather than open.
15210 * output.cc: Include "descriptors.h".
15211 (Output_file::open): Use open_descriptor rather than open.
15212 * archive.cc (Archive::const_iterator): Change Archive to be
15213 non-const.
15214 (Archive::begin, Archive::end): Make non-const.
15215 (Archive::count_members): Likewise.
15216 * archive.h (class Archive): Update declarations.
15217 * object.h (Object::read): Make non-const.
15218 * Makefile.am (CCFILES): Add descriptors.cc.
15219 (HFILES): Add descriptors.h.
15220 * Makefile.in: Rebuild.
15221
801647d1
ILT
15222 PR 6716
15223 * gold.h: Always include <clocale>. Add Solaris workarounds
15224 following code in binutils/sysdep.h.
15225
5edd166e
ILT
15226 PR 6048
15227 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
15228 this->eh_frame_hdr_ is NULL before using it.
15229
c89ad728
ILT
15230 * dynobj.cc (Versions::Versions): Update comment.
15231
aa86f06b
ILT
15232 * dynobj.cc (Versions::Versions): If there is an soname, use it as
15233 the base version name.
15234
5778530e
ILT
15235 * stringpool.cc (Stringpool_template::add_with_length): Set key to
15236 array size plus one.
15237 (Stringpool_template::set_string_offsets): Subtract one from key
15238 before using it as an array index.
15239 (Stringpool_template::get_offset_with_length): Likewise.
15240 (Stringpool_template::write_to_buffer): Likewise.
15241 * stringpool.h (Stringpool_template::get_offset_from_key):
15242 Likewise.
15243
057ead22
ILT
152442008-07-23 Ian Lance Taylor <iant@google.com>
15245
7f649c59
ILT
15246 PR 6658
15247 * object.h (Merged_symbol_value::value): Do our best to handle a
15248 negative addend.
15249
057ead22
ILT
15250 PR 6647
15251 * script.cc (Version_script_info::get_versions): Don't add empty
15252 version tag to return value.
15253 (Version_script_info::get_symbol_version_helper): Change return
15254 type to bool. Add pversion parameter. Change all callers.
15255 (script_register_vers_node): Don't require a non-NULL tag.
15256 * script.h (class Version_script_info): Update declarations.
15257 (Version_script_info::get_symbol_version): Change return type to
15258 bool. Add version parameter. Change all callers.
15259 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
15260 handling. Handle an empty version from a version script.
15261 (Symbol_table::define_special_symbol): Likewise.
15262 * testsuite/ver_test_10.script: New file.
15263 * testsuite/ver_test_10.sh: New file.
15264 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
15265 (check_DATA): Add ver_test_10.syms.
15266 (ver_test_10.syms, ver_test_10.so): New target.
15267 * testsuite/Makefile.in: Rebuild.
15268
58e54ac2
CD
152692008-07-23 Simon Baldwin <simonb@google.com>
15270
15271 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
15272 to zero for undefined symbols from dynamic libraries.
15273
95d14cd3
ILT
152742008-07-23 Ian Lance Taylor <iant@google.com>
15275
15276 * symtab.cc (Symbol_table::resolve): Remove version parameter.
15277 Change all callers.
15278 * symtab.h (class Symbol_table): Update declaration.
15279 * testsuite/ver_test_9.cc: New file.
15280 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
15281 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
15282 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
15283 (ver_test_9.so, ver_test_9.o): New targets.
15284 * testsuite/Makefile.in: Rebuild.
15285
92de84a6
ILT
152862008-07-22 Ian Lance Taylor <iant@google.com>
15287
34810851
ILT
15288 * options.h (class General_options): Define --check-sections.
15289 * layout.cc (Layout::set_segment_offsets): Handle
15290 --check-sections.
15291
af6156ef
ILT
15292 * options.h (class General_options): Define -n/--nmagic and
15293 -N/--omagic.
15294 * options.cc (General_options::finalize): For -n/--nmagic or
15295 -N/--omagic, set -static.
15296 * layout.cc (Layout::attach_allocated_section_to_segment): If
15297 -N/--omagic, don't put read-only and read-write sections in
15298 different segments.
15299 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
15300 finding a read-only segment.
15301 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
15302 don't set the minimum segment alignment to the common page size,
15303 and don't set the file offset to the address modulo the page size.
15304 * script-sections.cc (Script_sections::create_segments): If
15305 -n/--omagic, don't put read-only and read-write sections in
15306 different segments.
15307
92de84a6
ILT
15308 * cref.cc: New file.
15309 * cref.h: New file.
15310 * options.h (class General_options): Add --print-symbol-counts.
15311 * main.cc (main): Issue defined symbol report if requested.
15312 * archive.cc (Archive::interpret_header): Make into a const member
15313 function.
15314 (Archive::add_symbols): Call Input_objects::archive_start and
15315 archive_stop.
15316 (Archive::const_iterator): Define new class.
15317 (Archive::begin, Archive::end): New functions.
15318 (Archive::include_all_members): Rewrite to use iterator.
15319 (Archive::count_members): New function.
15320 * archive.h (class Archive): Update declarations.
15321 (Archive::filename): New function.
15322 * object.cc: Include "cref.h".
15323 (Sized_relobj::Sized_relobj): Initialize defined_count_.
15324 (Sized_relobj::do_get_global_symbol_counts): New function.
15325 (Input_objects::add_object): Add object to cross-referencer.
15326 (Input_objects::archive_start): New function.
15327 (Input_objects::archive_stop): New function.
15328 (Input_objects::print_symbol_counts): New function.
15329 * object.h: Declare Cref and Archive.
15330 (Object::get_global_symbol_counts): New function.
15331 (Object::do_get_global_symbol_counts): New pure virtual function.
15332 (class Sized_relobj): Add defined_count_ field. Update
15333 declarations.
15334 (class Input_objects): Add cref_ field. Update constructor.
15335 Update declarations.
15336 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
15337 defined_count_.
15338 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
15339 symbol counts.
15340 (Sized_dynobj::do_get_global_symbol_counts): New function.
15341 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
15342 defined_count_. Update declarations. Define Symbols typedef.
15343 * symtab.cc (Symbol_table::add_from_relobj): Add defined
15344 parameter. Change all callers.
15345 (Symbol_table::add_from_dynobj): Add sympointers and defined
15346 parameters. Change all callers.
15347 * symtab.h (class Symbol_table): Update declarations.
15348 * Makefile.am (CCFILES): Add cref.cc.
15349 (HFILES): Add cref.h.
15350 * Makefile.in: Rebuild.
15351
3f7c5e1d
CD
153522008-07-22 Simon Baldwin <simonb@google.com>
15353
15354 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
15355 to zero when writing undefined symbols.
15356
e0b64032
ILT
153572008-07-22 Ian Lance Taylor <iant@google.com>
15358
15359 * output.cc (Output_section::add_input_section): Don't try to
15360 merge empty merge sections.
15361
096b02cf
CS
153622008-07-21 Craig Silverstein <csilvers@google.com>
15363
15364 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15365 Include symbol version in error message.
cd536b21 15366
1d1f116d
CD
153672008-07-20 Chris Demetriou <cgd@google.com>
15368
cd536b21 15369 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
15370 (RANDOM_SEED_CFLAGS): New substituted variable.
15371 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
15372 * configure: Rebuild.
15373 * Makefile.in: Likewise.
15374 * testsuite/Makefile.in: Likewise.
15375
a18f591e
ILT
153762008-07-18 Ian Lance Taylor <iant@google.com>
15377
15378 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
15379 where we see NAME/NULL and NAME/VERSION as separate symbols.
15380 * testsuite/ver_test_main.cc (main): Call t4.
15381 (t4, t4_2a): Define.
15382 * testsuite/ver_test_2.cc (t4_2): Define.
15383 * testsuite/ver_test_2.script: Put t4_2a in VER2.
15384 * testsuite/ver_test_4.cc (t4_2a): Define.
15385 * testsuite/ver_test_4.script: Put t4_2a in VER2.
15386 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
15387
c6e3f6ed
ILT
153882008-07-17 Ian Lance Taylor <iant@google.com>
15389
15390 * dynobj.cc (Versions::add_def): If we give an error about a
15391 missing version, go ahead and create the version anyhow.
15392
ef9beddf
ILT
153932008-07-10 Ian Lance Taylor <iant@google.com>
15394
15395 Handle output sections with more than 0x7fffffff bytes.
15396 * object.h (class Relobj): Change map_to_output_ to
15397 output_sections_, and just keep a section pointer. Change all
15398 uses. Move comdat group support to Sized_relobj.
15399 (Relobj::is_section_specially_mapped): Remove.
15400 (Relobj::output_section): Remove poff parameter. Change all
15401 callers.
15402 (Relobj::output_section_offset): New function.
15403 (Relobj::set_section_offset): Rewrite.
15404 (Relobj::map_to_output): Remove.
15405 (Relobj::output_sections): New function.
15406 (Relobj::do_output_section_offset): New pure virtual function.
15407 (Relobj::do_set_section_offset): Likewise.
15408 (class Sized_relobj): Add section_offsets_ field. Add comdat
15409 group support from Relobj. Update declarations.
15410 (Sized_relobj::get_output_section_offset): New function.
15411 (Sized_relobj::do_output_section_offset): New function.
15412 (Sized_relobj::do_set_section_offset): New function.
15413 * object.cc (Relobj::output_section_address): Remove.
15414 (Sized_relobj::Sized_relobj): Initialize new fields.
15415 (Sized_relobj::include_section_group): Cast find_kept_object to
15416 Sized_relobj.
15417 (Sized_relobj::include_linkonce_section): Likewise.
15418 (Sized_relobj::do_layout): Use separate arrays for output section
15419 and output offset.
15420 (Sized_relobj::do_count_local_symbols): Change map_to_output to
15421 output_sections.
15422 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
15423 output_sections and section_offsets.
15424 (Sized_relobj::write_local_symbols): Likewise.
15425 (map_to_kept_section): Compute output address directly.
15426 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
15427 output_sections and section_offsets.
15428 (Sized_relobj::write_sections): Likewise.
15429 (Sized_relobj::relocate_sections): Likewise.
15430 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
15431 * output.h (class Output_reloc): Update declarations. Change
15432 u2_.relobj to Sized_relobj*.
15433 (class Output_data_reloc): Change add functions to use
15434 Sized_relobj*.
15435 * output.cc (Output_reloc::Output_reloc): Change relobj to
15436 Sized_relobj*.
15437 (Output_reloc::local_section_offset): Change return type to
15438 Elf_Addr. Use get_output_section_offset.
15439 (Output_reloc::get_address): Likewise.
15440 (Output_section::is_input_address_mapped): Don't call
15441 is_section_specially_mapped.
15442 (Output_section::output_offset): Likewise.
15443 (Output_section::output_address): Likewise.
15444 (Output_section::starting_output_address): Likewise.
15445 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
15446 parameter to Sized_relobj*.
15447 (Copy_relocs::need_copy_reloc): Likewise.
15448 (Copy_relocs::save): Likewise.
15449 * copy-relocs.h (class Copy_relocs): Update declarations.
15450 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
15451 Sized_relobj*. Change relobj_ field to Sized_relobj*.
15452 * target-reloc.h (relocate_for_relocatable): Change
15453 offset_in_output_section type to Elf_Addr. Change code that uses
15454 it as well.
15455 * layout.cc (Layout::layout): Always set *off.
15456 * mapfile.cc (Mapfile::print_input_section): Use
15457 output_section_offset.
15458 * i386.cc (Target_i386::copy_reloc): Change object parameter to
15459 Sized_relobj*.
15460 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
15461 * sparc.cc (Target_sparc::copy_reloc): Likewise.
15462 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
15463
5cb66f97
ILT
154642008-07-03 Ian Lance Taylor <iant@google.com>
15465
15466 * layout.cc (Layout::include_section): Do not discard unrecognized
15467 SHT_STRTAB sections.
15468
afe47622
CS
154692008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
15470
15471 * script.cc (Lex::can_continue_name): Make '?' allowable in
15472 version-script names.
15473 * testsuite/version_script.map: Change glob pattern to use '?'
15474
5adf9721
ILT
154752008-06-30 Manish Singh <yosh@gimp.org>
15476
15477 PR 6585
15478 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
15479 Correct typo.
15480
e6fde208
ILT
154812008-06-30 Ian Lance Taylor <iant@google.com>
15482
15483 PR 6660
15484 PR 6682
15485 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
15486 versions]: Don't try to read the value in the contents, since we
15487 don't use it. Use the template endianness when writing.
15488
3f2e6a2d
CC
154892008-06-25 Cary Coutant <ccoutant@google.com>
15490
15491 * fileread.cc (File_read::make_view): Assert on zero-length view.
15492 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
15493 symbol table when there are no symbols to read.
15494
c43d3a48
CS
154952008-06-23 Craig Silverstein <csilvers@google.com>
15496
15497 * version.cc (version_string): Bump to 1.7
15498
5f494ea0
CS
154992008-06-18 Craig Silverstein <csilvers@google.com>
15500
15501 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
15502 constant 0xFFFF to type Valtype.
15503 (Powerpc_relocate_functions::rel16_ha): Likewise.
15504
c42e122e
ILT
155052008-06-17 Ian Lance Taylor <iant@google.com>
15506
f34787f8
ILT
15507 * output.h (Output_section::Input_section): Initialize p2align_ to
15508 zero for Output_section_data constructors.
15509 (Output_section::Input_section::addralign): If not an input
15510 section, return the alignment of the Output_section_data.
15511 * testsuite/copy_test.cc: New file.
15512 * testsuite/copy_test_1.cc: New file.
15513 * testsuite/copy_test_2.cc: New file.
15514 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
15515 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
15516 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
15517 (copy_test_1_pic.o, copy_test_1.so): New targets.
15518 (copy_test_2_pic.o, copy_test_2.so): New targets.
15519 * testsuite/Makefile.in: Rebuild.
15520
c42e122e
ILT
15521 * script-sections.cc (Script_sections::place_orphan): Initialize
15522 local variable exact.
15523
ce3ac18a
DE
155242008-06-13 David Edelsohn <edelsohn@gnu.org>
15525
15526 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
15527
42cacb20
DE
155282008-06-12 David Edelsohn <edelsohn@gnu.org>
15529 David S. Miller <davem@davemloft.net>
15530
15531 * powerpc.cc: New file.
15532 * Makefile.am (TARGETSOURCES): Add powerpc.cc
15533 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
15534 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
15535 * Makefile.in: Rebuild.
15536
7b308235
ILT
155372008-06-09 Ian Lance Taylor <iant@google.com>
15538
15539 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
15540 <exception>.
15541 (throwing, orig_terminate): New static variables.
15542 (terminate_handler): New static function.
15543 (t2): Set terminate handler.
15544
f0b886e3
ILT
155452008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
15546
15547 PR 6584
cd536b21 15548 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
15549 alignment.
15550
3e90f135
CC
155512008-05-30 Cary Coutant <ccoutant@google.com>
15552
15553 * archive.cc (Archive::include_all_members) Correct to step
15554 over symbol table and extended name table in thin archives.
15555
e09ad04a
ILT
155562008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
15557
15558 PR 6407
15559 * target-reloc.h (relocate_for_relocatable): Fix new_offset
15560 calculation.
15561
62b01cb5
ILT
155622008-05-28 Caleb Howe <cshowe@google.com>
15563
15564 * reduced_debug_output.cc: New file.
15565 * reduced_debug_output.h: New file.
92de84a6 15566 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
15567 * options.cc (General_options::finalize): Add strip_debug_non_line
15568 to the strip heirarchy.
15569 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
15570 fields.
15571 * layout.cc: Include "reduced_debug_output.h".
15572 (Layout::Layout): Initialize new fields.
15573 (line_only_debug_sections): New static array.
15574 (is_lines_only_debug_sections): New static inline function.
15575 (Layout::include_section): Handle --strip-debug-non-line.
15576 (Layout::make_output_section): If --strip-debug-non-line, build
15577 new output sections for .debug_abbrev and .debug_info.
15578 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
15579 gold. Warn about possible overflow.
15580 (read_signed_LEB_128): Likewise.
15581 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
15582 (read_signed_LEB_128): Declare.
15583 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
15584 (HFILES): Add reduced_debug_output.h.
15585 * Makefile.in: Rebuild.
15586
7d9e3d98
ILT
155872008-05-21 Ian Lance Taylor <iant@google.com>
15588
15589 * mapfile.cc: New file.
15590 * mapfile.h: New file.
15591 * options.h (class General_options): Add -M/--print-map and -Map.
15592 * options.cc (General_options::finalize): Make -M equivalent to
15593 -Map -.
15594 * main.cc: Include <cstdio> and "mapfile.h".
15595 (main): Open mapfile if requested.
15596 * gold.cc (class Middle_runner): Add mapfile_ field. Update
15597 constructor. Change caller.
15598 (queue_initial_tasks): Add mapfile parameter. Change caller.
15599 (queue_middle_tasks): Likewise.
15600 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
15601 declarations.
15602 * archive.cc: Include "mapfile.h".
15603 (Archive::add_symbols): Add mapfile parameter. Change all
15604 callers. Pass mapfile, symbol, and reason to include_member.
15605 (Archive::include_all_members): Add mapfile parameter. Change all
15606 callers.
15607 (Archive::include_member): Add mapfile, sym, and why parameters.
15608 Change all callers. Report inclusion to map file.
15609 * archive.h: Include "fileread.h".
15610 (class Archive): Update declarations.
15611 (Archive::file): New const method.
15612 (class Add_archive_symbols): Add mapfile_ field. Update
15613 constructor. Change all callers.
15614 * readsyms.h (class Read_symbols): Likewise.
15615 (class Finish_group): Likewise.
15616 (class Read_script): Likewise.
15617 * common.cc: Include "mapfile.h".
15618 (Symbol_table::allocate_commons): Add mapfile parameter. Change
15619 all callers.
15620 (Symbol_table::do_allocate_commons): Likewise.
15621 (Symbol_table::do_allocate_commons_list): Likewise. Report common
15622 symbol allocation to mapfile.
15623 * common.h (class Allocate_commons_task): Add mapfile_ field.
15624 Update constructor. Change all callers.
15625 * symtab.h (class Symbol_table): Update declarations.
15626 * layout.cc: Include "mapfile.h".
15627 (Layout_task_runner::run): Print information to mapfile.
15628 (Layout::create_gold_note): Change Output_data_fixed_space to
15629 Output_data_zero_fill.
15630 (Layout::create_build_id): Likewise.
15631 (Layout::print_to_mapfile): New function.
15632 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
15633 constructor. Change caller.
15634 (class Layout): Declare print_to_mapfile.
15635 * output.cc (Output_section::Input_section::print_to_mapfile): New
15636 function.
15637 (Output_section::add_input_section): If producing a map, always
15638 add to input_sections_ list.
15639 (Output_section::do_print_to_mapfile): New function.
15640 (Output_segment::print_sections_to_mapfile): New function.
15641 (Output_segment::print_section_list_to_mapfile): New function.
15642 * output.h: Include "mapfile.h".
15643 (Output_data::print_to_mapfile): New function.
15644 (Output_data::do_print_to_mapfile): New virtual function.
15645 (Output_segment_headers::do_print_to_mapfile): New function.
15646 (Output_file_header::do_print_to_mapfile): New function.
15647 (Output_data_const::do_print_to_mapfile): New function.
15648 (class Output_data_const_buffer): Add map_name_ field. Update
15649 constructor. Change all callers. Add do_print_to_mapfile
15650 function.
15651 (class Output_data_fixed_space): Likewise.
15652 (class Output_data_space): Likewise.
15653 (class Output_data_zero_fill): New class.
15654 (Output_data_strtab::do_print_to_mapfile): New function.
15655 (Output_data_reloc_base::do_print_to_mapfile): New function.
15656 (Output_relocatable_relocs::do_print_to_mapfile): New function.
15657 (Output_data_group::do_print_to_mapfile): New function.
15658 (Output_data_got::do_print_to_mapfile): New function.
15659 (Output_data_dynamic::do_print_to_mapfile): New function.
15660 (Output_symtab_xindex::do_print_to_mapfile): New function.
15661 (class Output_section): Declare do_print_to_mapflie. Declare
15662 print_to_mapfile in Input_section.
15663 (class Output_segment): Declare new functions.
15664 * object.h (Sized_relobj::symbol_count): New function.
15665 * script-sections.cc
15666 (Output_section_element_dot_assignment::set_section_addresses):
15667 Change Output_data_fixed_space to Output_data_zero_fill.
15668 (Output_data_expression::do_print_to_mapfile): New function.
15669 * script.cc (read_input_script): Add mapfile parameter. Change
15670 all callers.
15671 * script.h (read_input_script): Update declaration.
15672 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
15673 (Eh_frame::do_print_to_mapfile): New function.
15674 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
15675 (Output_merge_string::do_print_to_mapfile): New function.
15676 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
15677 function.
15678 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
15679 function.
15680 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
15681 function.
15682 * Makefile.am (CCFILES): Add mapfile.cc.
15683 (HFILES): Add mapfile.h.
15684 * Makefile.in: Rebuild.
15685
9f1d377b
ILT
156862008-05-19 Ian Lance Taylor <iant@google.com>
15687
15688 * options.h (class General_options): Add -z relro.
15689 * layout.cc (Layout::Layout): Initialize relro_segment_.
15690 (Layout::add_output_section_data): Return the output section.
15691 (Layout::make_output_section): Rcognize relro sections and mark
15692 them appropriately.
15693 (Layout::attach_allocated_section_to_segment): Put relro sections
15694 in a PT_GNU_RELRO segment.
15695 (Layout::create_initial_dynamic_sections): Mark the .dynamic
15696 section as relro.
15697 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
15698 PT_TLS segments.
15699 (Layout::linkonce_mapping): Map d.rel.ro.local to
15700 .data.rel.ro.local.
15701 (Layout::output_section_name): Us .data.rel.ro.local for any
15702 section which begins with that.
15703 * layout.h (class Layout): Update add_output_section_data
15704 declaration. Add relro_segment_ field.
15705 * output.cc (Output_section::Output_section): Initialize is_relro_
15706 and is_relro_local_ fields.
15707 (Output_segment::add_output_section): Group relro sections.
15708 (Output_segment::is_first_section_relro): New function.
15709 (Output_segment::maximum_alignment): If there is a relro section,
15710 align the segment to the common page size.
15711 (Output_segment::set_section_addresses): Track whether we are
15712 looking at relro sections. If the last section is a relro
15713 section, align to the common page size.
15714 (Output_segment::set_section_list_addresses): Add in_relro
15715 parameter. Change all callers. Align to the page size when
15716 moving from relro to non-relro section.
15717 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
15718 segment.
15719 * output.h (class Output_section): Add is_relro_ and
15720 is_relro_local_ fields.
15721 (Output_section::is_relro): New function.
15722 (Output_section::set_is_relro): New function.
15723 (Output_section::is_relro_local): New function.
15724 (Output_section::set_is_relro_local): New function.
15725 (class Output_segment): Update declarations.
15726 * i386.cc (Target_i386::got_section): Mark .got section as relro.
15727 * sparc.cc (Target_sparc::got_section): Likewise.
15728 * x86_64.cc (Target_x86_64::got_section): Likewise.
15729 * testsuite/relro_test_main.cc: New file.
15730 * testsuite/relro_test.cc: New file.
15731 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
15732 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
15733 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
15734 (relro_test.so, relro_test_pic.o): New targets.
15735 * testsuite/Makefile.in: Rebuild.
15736
a984ee1d
ILT
157372008-05-16 Ian Lance Taylor <iant@google.com>
15738
01676dcd
ILT
15739 * output.cc (Output_segment::add_output_section): Remove front
15740 parameter.
15741 * output.h (class Output_segment): Remove
15742 add_initial_output_section and overloaded add_output_section.
15743 Update declaration of remaining add_output_section.
15744 * layout.cc (Layout::create_interp): Call add_output_section
15745 rather than add_initial_output_section.
15746 (Layout::finish_dynamic_section): Likewise.
15747
497897f9
ILT
15748 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
15749 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
15750 know the dynamic type.
15751 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
15752 field. Initialize it in constructor.
15753 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
15754 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
15755 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
15756 reloc.
15757
a984ee1d
ILT
15758 * output.cc (Output_reloc::get_address): Change return type to
15759 Elf_Addr.
15760 * output.h (class Output_reloc): Update get_address declaration.
15761 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
15762 for section addresses.
15763
55ba0940
ILT
157642008-05-09 Ian Lance Taylor <iant@google.com>
15765
15766 PR 6493
15767 * gold.cc (gold_nomem): Use return value of write.
15768
75517b77
ILT
157692008-05-08 Ian Lance Taylor <iant@google.com>
15770
15771 * symtab.c (Symbol::init_base_output_data): Add version
15772 parameter. Change all callers.
15773 (Symbol::init_base_output_segment): Likewise.
15774 (Symbol::init_base_constant): Likewise.
15775 (Symbol::init_base_undefined): Likewise.
15776 (Sized_symbol::init_output_data): Likewise.
15777 (Sized_symbol::init_output_segment): Likewise.
15778 (Sized_symbol::init_constant): Likewise.
15779 (Sized_symbol::init_undefined): Likewise.
15780 (Symbol_table::do_define_in_output_data): If the new symbol has a
15781 version, mark it as the default.
15782 (Symbol_table::do_define_in_output_segment): Likewise.
15783 (Symbol_table::do_define_as_constant): Likewise.
15784 * symtab.h (class Symbol): Update declarations.
15785 (class Sized_symbol): Likewise.
15786 * resolve.cc (Symbol::override_version): New function.
c42e122e 15787 (Symbol::override_base): Call override_version.
75517b77
ILT
15788 (Symbol::override_base_with_special): Likewise.
15789 * testsuite/ver_script_8.script: New file.
15790 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
15791 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
15792 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
15793 (ver_test_8_1.so, ver_test_8_2.so): New targets.
15794
f1f70eae
ILT
157952008-05-06 Ian Lance Taylor <iant@google.com>
15796
f3e9c5c5
ILT
15797 PR 6049
15798 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
15799 functions.
15800 (class General_options): Remove existing --undefined, and add
15801 --no-undefined instead. Add new --undefined as synonym for -u.
15802 * archive.cc (Archive::add_symbols): Check whether symbol was
15803 named with -u.
15804 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
15805 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
15806 all uses. Add IS_UNDEFINED. Update declarations to split
15807 different versions of init_base. Declare init_base_undefined.
15808 (Symbol::is_defined): Handle IS_UNDEFINED.
15809 (Symbol::is_undefined): Likewise.
15810 (Symbol::is_weak_undefined): Call is_undefined.
15811 (Symbol::is_absolute): Handle IS_CONSTANT.
15812 (class Sized_symbol): Update declarations to split different
15813 versions of init. Declare init_undefined.
15814 (class Symbol_table): Declare new functions.
15815 * symtab.cc (Symbol::init_base_object): Rename from init_base.
15816 Change all callers.
15817 (Symbol::init_base_output_data): Likewise.
15818 (Symbol::init_base_output_segment): Likewise.
15819 (Symbol::init_base_constant): Likewise.
15820 (Symbol::init_base_undefined): New function.
15821 (Sized_symbol::init_object): Rename from init. Change all
15822 callers.
15823 (Sized_symbol::init_output_data): Likewise.
15824 (Sized_symbol::init_output_segment): Likewise.
15825 (Sized_symbol::init_constant): Likewise.
15826 (Sized_symbol::init_undefined): New function.
15827 (Symbol_table::add_undefined_symbols_from_command_line): New
15828 function.
15829 (Symbol_table::do_add_undefined_symbols_from_command_line): New
15830 function.
15831 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
15832 (Symbol::output_section): Likewise.
15833 (Symbol::set_output_section): Likewise.
15834 (Symbol_table::sized_finalize_symbol): Likewise.
15835 (Symbol_table::sized_write_globals): Likewise.
15836 * resolve.cc (Symbol_table::should_override): Likewise.
15837 (Symbol::override_base_with_special): Likewise.
15838
8bdcdf2c
ILT
15839 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
15840 symbol, change it to have default visibility.
15841 * testsuite/protected_1.cc: New file.
15842 * testsuite/protected_2.cc: New file.
15843 * testsuite/protected_3.cc: New file.
15844 * testsuite/protected_main_1.cc: New file.
15845 * testsuite/protected_main_2.cc: New file.
15846 * testsuite/protected_main_3.cc: New file.
15847 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
15848 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
15849 (protected_1_LDFLAGS, protected_1_LDADD): Define.
15850 (protected_1.so): New target.
15851 (protected_1_pic.o, protected_2_pic.o): New targets.
15852 (protected_3_pic.o): New target.
15853 (check_PROGRAMS): Add protected_2.
15854 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
15855 (protected_2_LDFLAGS, protected_2_LDADD): Define.
15856 * testsuite/Makefile.in: Rebuild.
15857
2b706932
ILT
15858 * options.h (DEFINE_var): Add set_user_set_##varname__.
15859 (DEFINE_bool_alias): New macro.
15860 (class General_options): Define -Bstatic using DEFINE_bool_alias
15861 rather than DEFINE_special. Add --undefined as an alias for -z
15862 defs.
15863 * options.cc (General_options::parse_Bstatic): Remove.
15864
d82a5bcc
ILT
15865 * options.h (class General_options): Add --fatal-warnings.
15866 * main.cc (main): Implement --fatal-warnings.
15867 * errors.h (Errors::warning_count): New function.
15868
f1f70eae
ILT
15869 * options.h (class General_options): Add -Bsymbolic-functions.
15870 * symtab.h (Symbol::is_preemptible): Check for
15871 -Bsymbolic-functions.
15872
8825ac63
ILT
158732008-05-05 Ian Lance Taylor <iant@google.com>
15874
d98bc257
ILT
15875 * options.h (DEFINE_bool): For DASH_Z, create the negative option
15876 as noVARNAME rather than no-VARNAME.
15877 (class General_options): Add option -z combreloc.
15878 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
15879 get_address.
15880 (Output_reloc::sort_before) [SHT_REL]: New function.
15881 (Output_reloc::sort_before) [SHT_RELA]: New function.
15882 (class Output_data_reloc_base): Add sort_relocs_ field. Define
15883 Sort_relocs_comparison.
15884 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
15885 parameter. Change all callers.
15886 (Output_data_reloc::Output_data_reloc) [both versions]: Add
15887 sort_relocs parameter. Change all callers.
15888 * output.cc (Output_reloc::get_address): New function, broken out
15889 of write_rel.
15890 (Output_reloc::write_rel): Call it.
15891 (Output_reloc::compare): New function.
15892 (Output_data_reloc_base::do_write): Optionally sort relocs.
15893
60b2b4e7
ILT
15894 * configure.ac: If targ_extra_obj is set, link it in.
15895 * configure.tgt: Initialize all variables.
15896 (x86_64*): Set targ_extra_obj and targ_extra_size.
15897 * configure: Rebuild.
15898
8825ac63
ILT
15899 * object.cc (Sized_relobj::include_section_group): Adjust section
15900 indexes read from group data. Build vector to pass to
15901 layout_group.
15902 * layout.cc (Layout::layout_group): Add flags and shndxes
15903 parameters. Remove contents parameter. Change caller. Update
15904 explicit instantiations.
15905 * layout.h (class Layout): Update layout_group declaration.
15906 * output.cc (Output_data_group::Output_data_group): Add flags and
15907 input_shndxes parameters. Remove contents parameter. Change
15908 caller.
15909 (Output_data_group::do_write): Change input_sections_ to
15910 input_shndxes_.
15911 * output.h (class Output_data_group): Update constructor
15912 declaration. Rename input_sections_ to input_shndxes_.
15913 * testsuite/many_sections_test.cc: Add template.
15914
e94cf127
CC
159152008-04-30 Cary Coutant <ccoutant@google.com>
15916
4418b2d5
CC
15917 * target-reloc.h (relocate_section): Fix dead-pointer bug.
15918
e94cf127
CC
15919 * layout.cc (Layout::include_section): Refactored check for debug
15920 info section.
15921 (Layout::add_comdat): Add new parameters. Change type
15922 of signature parameter. Add object and shndx to signatures table.
15923 (Layout::find_kept_object): New function.
15924 * layout.h: Include <cstring>.
15925 (Layout::is_debug_info_section): New function.
15926 (Layout::add_comdat): Add new parameters.
15927 (Layout::find_kept_object): New function.
15928 (Layout::Kept_section): New struct.
15929 (Layout::Signatures): Change type of map range.
15930 * object.cc (Relobj::output_section_address): New function.
15931 (Sized_relobj::include_section_group): Add new parameters. Change
15932 calls to Layout::add_comdat. Change to build table of kept comdat
15933 groups and table mapping discarded sections to kept sections.
15934 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
15935 (Sized_relobj::do_layout): Change calls to include_section_group and
15936 include_linkonce_section.
15937 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
15938 value to zero when section is discarded.
15939 (Sized_relobj::map_to_kept_section): New function.
15940 * object.h (Relobj::output_section_address): New function.
15941 (Relobj::Comdat_group): New type.
15942 (Relobj::find_comdat_group): New function.
15943 (Relobj::Comdat_group_table): New type.
15944 (Relobj::Kept_comdat_section): New type.
15945 (Relobj::Kept_comdat_section_table): New type.
15946 (Relobj::add_comdat_group): New function.
15947 (Relobj::set_kept_comdat_section): New function.
15948 (Relobj::get_kept_comdat_section): New function.
15949 (Relobj::comdat_groups_): New field.
15950 (Relobj::kept_comdat_sections_): New field.
15951 (Symbol_value::input_value): Update comment.
15952 (Sized_relobj::map_to_kept_section) New function.
15953 (Sized_relobj::include_linkonce_section): Add new parameter.
15954 * target-reloc.h (Comdat_behavior): New type.
15955 (get_comdat_behavior): New function.
15956 (relocate_section): Add code to map a discarded section to the
15957 corresponding kept section when applying a relocation.
15958
e4e5049b
CS
159592008-04-30 Craig Silverstein <csilvers@google.com>
15960
15961 * dwarf_reader.cc (next_generation_count): New static var.
15962 (Addr2line_cache_entry): New struct.
15963 (addr2line_cache): New static var.
15964 (Dwarf_line_info::one_addr2line): Added caching.
15965 (Dwarf_line_info::clear_addr2line_cache): New function.
15966 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
15967 cache-size parameter.
15968 (Dwarf_line_info::one_addr2line_cache): New function.
15969 * symtab.cc (Symbol_table::detect_odr_violations): Pass
15970 new cache-size argument to one_addr2line(), and clear cache.
15971
d09e9154
CC
159722008-04-28 Cary Coutant <ccoutant@google.com>
15973
15974 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
15975 R_386_PC8 relocations.
15976
7ef73768
ILT
159772008-04-23 Ian Lance Taylor <iant@google.com>
15978
55438702
ILT
15979 * object.cc (Sized_relobj::include_section_group): Check for
15980 invalid section group.
15981
c165fb93
ILT
15982 * object.cc (make_elf_object): Correct test for 64-bit ELF file
15983 header size.
15984
7ef73768
ILT
15985 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
15986 than read for file header.
15987 * archive.cc (Archive::include_member): Likewise.
15988
6194aaab
L
159892008-04-23 Paolo Bonzini <bonzini@gnu.org>
15990
15991 * aclocal.m4: Regenerate.
15992 * configure: Regenerate.
15993
d491d34e
ILT
159942008-04-19 Ian Lance Taylor <iant@google.com>
15995
5ea2bac6
ILT
15996 * version.cc (version_string): Bump to 1.6.
15997
7bc3e21a
ILT
15998 * testsuite/Makefile.am (many_sections_r_test): New target.
15999 (many_sections_r_test_SOURCES): Remove.
16000 (many_sections_r_test_DEPENDENCIES): Remove.
16001 (many_sections_r_test_LDFLAGS): Remove.
16002 (many_sections_r_test_LDADD): Remove.
16003
7fcd3aa9
ILT
16004 * object.cc (Sized_relobj::do_add_symbols): Always pass
16005 local_symbol_count_ to add_from_relobj.
16006
4c94d6ae
ILT
16007 * testsuite/Makefile.am (many_sections_check.h): Only check one in
16008 every thousand variables.
16009 * testsuite/Makefile.in: Rebuild.
16010
d491d34e
ILT
16011 * object.cc (Xindex::initialize_symtab_xindex): New function.
16012 (Xindex::read_symtab_xindex): New function.
16013 (Xindex::sym_xindex_to_shndx): New function.
16014 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
16015 available.
16016 (Sized_relobj::do_initialize_xindex): New function.
16017 (Sized_relobj::do_read_symbols): Adjust section links.
16018 (Sized_relobj::symbol_section_and_value): Add is_ordinary
16019 parameter. Change all callers.
16020 (Sized_relobj::include_section_group): Adjust section links and
16021 symbol section indexes.
16022 (Sized_relobj::do_layout): Adjust section links.
16023 (Sized_relobj::do_count_local_symbols): Adjust section links and
16024 symbol section indexes.
16025 (Sized_relobj::do_finalize_local_symbols): Distinguish between
16026 ordinary and special symbols.
16027 (Sized_relobj::write_local_symbols): Add symtab_xindex and
16028 dynsym_xindex parameters. Change all callers. Adjust section
16029 links. Use SHN_XINDEX when needed.
16030 (Sized_relobj::get_symbol_location_info): Adjust section links.
16031 Don't get fooled by special symbols.
16032 * object.h (class Xindex): Define.
16033 (class Object): Add xindex_ parameter. Declare virtual functoin
16034 do_initialize_xindex.
16035 (Object::adjust_sym_shndx): New function.
16036 (Object::set_xindex): New protected function.
16037 (class Symbol_value): Add is_ordinary_shndx_ field.
16038 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
16039 (Symbol_value::value): Assert ordinary section.
16040 (Symbol_value::initialize_input_to_output_map): Likewise.
16041 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
16042 Change all callers.
16043 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
16044 all callers.
16045 (class Sized_relobj): Update declarations.
16046 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
16047 parameter. Change all callers.
16048 (Sized_relobj::adjust_shndx): New function.
16049 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
16050 field.
16051 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
16052 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
16053 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
16054 (Sized_dynobj::read_dynsym_section): Adjust section links.
16055 (Sized_dynobj::read_dynamic): Likewise.
16056 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
16057 section links.
16058 (Sized_dynobj::do_initialize_xindex): New function.
16059 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
16060 do_initialize_xindex.
16061 (Sized_dynobj::adjust_shndx): New function.
16062 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
16063 dynsym_xindex_ fields.
16064 (Layout::finalize): Add a call to set_section_indexes before
16065 creating the symtab sections.
16066 (Layout::set_section_indexes): Don't do anything if the section
16067 already has a section index.
16068 (Layout::create_symtab_sections): Add shnum parameter. Change
16069 caller. Create .symtab_shndx section if needed.
16070 (Layout::create_shdrs): Add shstrtab_section parameter. Change
16071 caller.
16072 (Layout::allocated_output_section_count): New function.
16073 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
16074 needed.
16075 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
16076 fields. Update declarations.
16077 (Layout::symtab_xindex): New function.
16078 (Layout::dynsym_xindex): New function.
16079 (class Write_symbols_task): Add layout_ field.
16080 (Write_symbols_task::Write_symbols_task): Add layout parameter.
16081 Change caller.
16082 * output.cc (Output_section_headers::Output_section_headers): Add
16083 shstrtab_section parameter. Change all callers.
16084 (Output_section_headers::do_sized_write): Store overflow values
16085 for section count and section string table section index in
16086 section header zero.
16087 (Output_file_header::do_sized_write): Check for overflow of
16088 section count and section string table section index.
16089 (Output_symtab_xindex::do_write): New function.
16090 (Output_symtab_xindex::endian_do_write): New function.
16091 * output.h (class Output_section_headers): Add shstrtab_section_.
16092 Update declarations.
16093 (class Output_symtab_xindex): Define.
16094 (Output_section::has_out_shndx): New function.
16095 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
16096 field.
16097 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
16098 Change all callers.
16099 (Sized_symbol::init): Likewise.
16100 (Symbol::output_section): Check for ordinary symbol.
16101 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
16102 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
16103 callers.
16104 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
16105 Change all callers. Simplify handling of symbols from sections
16106 not included in the link.
16107 (Symbol_table::add_from_dynobj): Handle ordinary symbol
16108 distinction.
16109 (Weak_alias_sorter::operator()): Assert that symbols are
16110 ordinary.
16111 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
16112 distinction.
16113 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
16114 parameters. Change all callers.
16115 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
16116 symbol distinction. Use SHN_XINDEX when needed.
16117 (Symbol_table::write_section_symbol): Add symtab_xindex
16118 parameter. Change all callers.
16119 (Symbol_table::sized_write_section_symbol): Likewise. Use
16120 SHN_XINDEX when needed.
16121 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
16122 declarations.
16123 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
16124 (Symbol::is_defined): Check is_ordinary.
16125 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
16126 (Symbol::is_absolute, Symbol::is_common): Likewise.
16127 (class Sized_symbol): Update declarations.
16128 (class Symbol_table): Update declarations.
16129 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
16130 parameters. Change all callers.
16131 (Sized_symbol::override): Likewise.
16132 (Symbol_table::override): Likewise.
16133 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
16134 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
16135 is_ordinary, and orig_st_shndx parameters. Change all callers.
16136 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
16137 to be in an ordinary section.
16138 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
16139 object and is_ordinary parameters. Change all callers.
16140 (Sized_dwarf_line_info::read_relocs): Add object parameter.
16141 Change all callers. Don't add undefined or non-ordinary symbols
16142 to reloc_map_.
16143 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
16144 Change all callers.
16145 * dwarf_reader.h (class Sized_dwarf_line_info): Update
16146 declarations.
16147 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
16148 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
16149 (Sized_relobj::relocate_sections): Likewise.
16150 * target-reloc.h (scan_relocs): Adjust section symbol index.
16151 (scan_relocatable_relocs): Likewise.
16152 * i386.cc (Scan::local): Check for ordinary symbols.
16153 * sparc.cc (Scan::local): Likewise.
16154 * x86_64.cc (Scan::local): Likewise.
16155 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
16156 to symbol_section_and_value.
16157 * testsuite/many_sections_test.cc: New file.
16158 * testsuite/Makefile.am (BUILT_SOURCES): Define.
16159 (check_PROGRAMS): Add many_sections_test.
16160 (many_sections_test_SOURCES): Define.
16161 (many_sections_test_DEPENDENCIES): Define.
16162 (many_sections_test_LDFLAGS): Define.
16163 (BUILT_SOURCES): Add many_sections_define.h.
16164 (many_sections_define.h): New target.
16165 (BUILT_SOURCES): Add many_sections_check.h.
16166 (many_sections_check.h): New target.
16167 (check_PROGRAMS): Add many_sections_r_test.
16168 (many_sections_r_test_SOURCES): Define.
16169 (many_sections_r_test_DEPENDENCIES): Define.
16170 (many_sections_r_test_LDFLAGS): Define.
16171 (many_sections_r_test_LDADD): Define.
16172 (many_sections_r_test.o): New target.
16173 * testsuite/Makefile.in: Rebuild.
16174
c5818ff1
CC
161752008-04-17 Cary Coutant <ccoutant@google.com>
16176
16177 * errors.cc (Errors::info): New function.
16178 (gold_info): New function.
16179 * errors.h (Errors::info): New function.
16180 * gold.h (gold_info): New function.
16181 * object.cc (Input_objects::add_object): Print trace output.
16182 * options.cc (options::parse_set): New function.
16183 (General_options::parse_wrap): Deleted.
16184 (General_options::General_options): Deleted initializer.
16185 * options.h (options::String_set): New typedef.
16186 (options::parse_set): New function.
16187 (DEFINE_set): New macro.
16188 (General_options::wrap): Changed to use DEFINE_set. Changed
16189 callers of any_wrap_symbols and is_wrap_symbol.
16190 (General_options::trace, General_options::trace_symbol):
16191 New options.
16192 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
16193 (General_options::wrap_symbols_): Deleted.
16194 * symtab.cc (Symbol_table::add_from_object): Print trace output.
16195
b5be4a7c
DM
161962008-04-17 David S. Miller <davem@davemloft.net>
16197
16198 * options.cc (General_options::parse_V): New function.
16199 * options.h: Add entries for -V and -Qy.
16200
155a0dd7
ILT
162012008-04-17 Ian Lance Taylor <iant@google.com>
16202
16203 * common.cc (Symbol_table::allocate_commons): Remove options
16204 parameter. Change caller.
16205 (Symbol_table::do_allocate_commons): Remove options parameter.
16206 Change caller. Just call do_allocate_commons_list twice.
16207 (Symbol_table::do_allocate_commons_list): New function, broken out
16208 of do_allocate_commons.
16209 * common.h (class Allocate_commons_task): Remove options_ field.
16210 Update constructor.
16211 * symtab.cc (Symbol_table::Symbol_table): Initialize
16212 tls_commons_.
16213 (Symbol_table::add_from_object): Put TLS common symbols on
16214 tls_commons_ list.
16215 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
16216 which are IN_OUTPUT_DATA.
16217 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
16218 allocate_commons and do_allocate_commons declarations. Declare
16219 do_allocate_commons_list.
16220 * gold.cc (queue_middle_tasks): Update creation of
16221 Allocate_commons_task to not pass options.
16222 * testsuite/Makefile.am (INCLUDES): Add -I.. .
16223 (TLS_TEST_C_FLAGS): New variable.
16224 (tls_test_c_pic.o): New target.
16225 (tls_test_shared.so): Link in tls_test_c_pic.o.
16226 (tls_test_c_pic_ie.o): New target.
16227 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
16228 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
16229 (tls_test_c.o): New target.
16230 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
16231 (tls_pic_test_LDADD): Likewise.
16232 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
16233 (tls_shared_gd_to_ie_test_LDADD): Likewise.
16234 (tls_test_c_gnu2.o): New target.
16235 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
16236 tls_test_c_gnu2.o.
16237 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
16238 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
16239 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
16240 * testsuite/tls_test.cc: Include "config.h".
16241 (t_last): Call t11_last.
16242 * testsuite/tls_test.h (t11, t11_last): Declare.
16243 * testsuite/tls_test_c.c: New file.
16244 * testsuite/tls_test_main.cc (thread_routine): Call t11.
16245 * configure.ac: Check for OpenMP support.
16246 * configure, config.in, Makefile.in: Rebuild.
16247 * testsuite/Makefile.in: Rebuild.
16248
edfbb029
CC
162492008-04-16 Cary Coutant <ccoutant@google.com>
16250
16251 * i386.cc (Target_i386::define_tls_base_symbol): New function.
16252 (Target_i386::tls_base_symbol_defined_): New field.
16253 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16254 (Target_i386::Scan::global): Likewise.
16255 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
16256 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
16257 (Target_x86_64::tls_base_symbol_defined_): New field.
16258 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16259 (Target_x86_64::Scan::global): Likewise.
16260
f3c69fca
CC
162612008-04-16 Cary Coutant <ccoutant@google.com>
16262
16263 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
16264 (Symbol::needs_plt_entry): Allow weak undefined symbols.
16265 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
16266 building shared libraries.
16267 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
16268 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
16269 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
16270 * testsuite/Makefile.in: Rebuild.
16271 * testsuite/weak_undef.h: New file.
16272 * testsuite/weak_undef_file1.cc: Add extra test cases.
16273 * testsuite/weak_undef_file2.cc: Likewise.
16274 * testsuite/weak_undef_test.cc: Likewise.
16275
7c414435
DM
162762008-04-16 David S. Miller <davem@davemloft.net>
16277
32b769e1
DM
16278 * sparc.cc (Target_sparc::Scan): Change from struct to class.
16279 Add issued_non_pic_error_ field. Declare check_non_pic.
16280 (Target_sparc::Scan::check_non_pic): New function.
16281 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
16282 (Target_sparc::Scan::global): Likewise.
16283
11936fb1
DM
16284 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
16285 * configure: Rebuild.
16286
7c414435
DM
16287 * options.h (DEFINE_enable): New macro.
16288 (new_dtags): New enable option.
16289 (initfirst, interpose, loadfltr, nodefaultlib,
16290 nodelete, nodlopen, nodump): New -z options.
16291 * layout.cc (Layout:finish_dynamic_section): If new
16292 dtags enabled, emit DT_RUNPATH. Also, emit a
16293 DT_FLAGS_1 containing any specified -z flags.
16294
85c7bf8b
ILT
162952008-04-16 Ian Lance Taylor <iant@google.com>
16296
12c0daef
ILT
16297 * copy-relocs.cc: New file.
16298 * copy-relocs.h: New file.
16299 * reloc.cc: Remove Copy_relocs code.
16300 * reloc.h: Likewise.
16301 * reloc-types.h (struct Reloc_types) [both versions]: Add
16302 get_reloc_addend_noerror.
16303 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
16304 variants of add_global which take an addend which must be zero.
16305 * i386.cc: Include "copy-relocs.h".
16306 (class Target_i386): Change type of copy_relocs_ to variable,
16307 update initializer.
16308 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
16309 Change all callers.
16310 (Target_i386::do_finalize_sections): Change handling of
16311 copy_relocs_.
16312 * sparc.cc: Include "copy-relocs.h".
16313 (class Target_sparc): Change type of copy_relocs_ to variable,
16314 update initializer.
16315 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
16316 Change all callers.
16317 (Target_sparc::do_finalize_sections): Change handling of
16318 copy_relocs_.
16319 * x86_64.cc: Include "copy-relocs.h".
16320 (class Target_x86_64): Change type of copy_relocs_ to variable,
16321 update initializer.
16322 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
16323 class. Change all callers.
16324 (Target_x86_64::do_finalize_sections): Change handling of
16325 copy_relocs_.
16326 * Makefile.am (CCFILES): Add copy-relocs.cc.
16327 (HFILES): Add copy-relocs.h.
16328
4f4995b6
ILT
16329 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
16330
85c7bf8b
ILT
16331 * testsuite/script_test_4.sh: Permit leading zeroes.
16332
4f2a9edd
ILT
163332008-04-15 Ian Lance Taylor <iant@google.com>
16334
e6188289
ILT
16335 * script-sections.cc (Script_sections::create_segments): Use
16336 header_size_adjustment even when there is enough room for the
16337 headers.
16338 * testsuite/script_test_4.sh: New file.
16339 * testsuite/script_test_4.t: New file.
16340 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
16341 (check_DATA): Add script_test_4.stdout.
16342 (MOSTLYCLEANFILES): Likewise.
16343 (script_test_4): New target.
16344 (script_test_4.stdout): New target.
16345 * testsuite/Makefile.in: Rebuild.
16346
4f2a9edd
ILT
16347 * sparc.cc: Add definitions for Output_data_plt_sparc class
16348 constants.
16349
f5314dd5
DM
163502008-04-14 David S. Miller <davem@davemloft.net>
16351
16352 * sparc.cc: New file.
16353 * Makefile.am (TARGETSOURCES): Add sparc.cc
16354 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
16355 * configure.tgt: Document targ_extra_size and
16356 targ_extra_big_endian. Add entries for sparc-* and
16357 sparc64-*.
16358 * configure.ac: Handle targ_extra_size and
16359 targ_extra_big_endian.
16360 * Makefile.in: Rebuild.
16361 * configure: Likewise.
16362 * po/POTFILES.in: Likewise.
16363 * po/gold.pot: Likewise.
16364
154e0e9a
ILT
163652008-04-14 Ian Lance Taylor <iant@google.com>
16366
16367 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
16368 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
16369 in the name/type/flags to section mapping. Don't call
16370 allocate_output_section.
16371 (Layout::choose_output_section): Change parameter from adjust_name
16372 to is_input_section. Don't permit input sections after sections
16373 are attached to segments. Don't call allocate_output_section.
16374 (Layout::layout_eh_frame): Call update_flags_for_input_section,
16375 not write_enable_output_section.
16376 (Layout::make_output_section): Don't push to
16377 unattached_section_list_ nor call attach_to_segment. Call
16378 attach_section_to_segment if sections are attached.
16379 (Layout::attach_sections_to_segments): New function.
16380 (Layout::attach_section_to_segment): New function.
16381 (Layout::attach_allocated_section_to_segment): Rename from
16382 attach_to_segment. Remove flags parameter.
16383 (Layout::allocate_output_section): Remove function.
16384 (Layout::write_enable_output_section): Remove function.
16385 * layout.h (class Layout): Update for above changes. Add new
16386 field sections_are_attached_.
16387 * output.h (Output_section::update_flags_for_input_section): New
16388 function.
16389 * output.cc (Output_section::add_input_section): Call
16390 update_flags_for_input_section.
16391 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
16392
009a67a2
CC
163932008-04-11 Cary Coutant <ccoutant@google.com>
16394
16395 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
16396 thought unnecessary.
16397 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
16398
759b1a24
ILT
163992008-04-11 Ian Lance Taylor <iant@google.com>
16400
16401 * output.h (class Output_section_data): Remove inline definition
16402 of set_addralign.
16403 * output.cc (Output_section_data::set_addralign): New function.
16404
c2b45e22
CC
164052008-04-11 Cary Coutant <ccoutant@google.com>
16406
16407 Add support for TLS descriptors for i386 and x86_64.
16408 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
16409 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
16410 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
16411 GOT_TYPE_TLS_DESC.
16412 (Target_i386::got_mod_index_entry): Remove unnecessary code.
16413 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
16414 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
16415 relocations.
16416 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
16417 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
16418 Fix problem with initial-exec relocations.
16419 (Target_i386::Relocate::relocate_tls): Likewise.
16420 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
16421 relaxation.
16422 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
16423 support for section-plus-offset dynamic table entries.
16424 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
16425 (Output_data_dynamic::Dynamic_entry): Add support for
16426 section-plus-offset dynamic table entries.
16427 (Output_data_dynamic::Classification): Likewise.
16428 (Output_data_dynamic::classification_): Renamed offset_.
16429 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
16430 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
16431 (Target_x86_64::make_plt_section): New function.
16432 (Target_x86_64::reserve_tlsdesc_entries): New function.
16433 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
16434 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
16435 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
16436 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
16437 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
16438 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
16439 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
16440 add extra PLT entry for TLS descriptors.
16441 (Output_data_plt_x86_64::got_): New field.
16442 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
16443 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
16444 fields.
16445 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
16446 descriptors.
16447 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
16448 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
16449 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
16450 R_386_TLS_DESC_CALL relocations.
16451 (Target_x86_64::Scan::global): Likewise.
16452 (Target_x86_64::do_finalize_sections): Add dynamic table entries
16453 for TLS descriptors.
16454 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
16455 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
16456 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
16457 GD-to-IE relaxation.
16458 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
16459 and TLS_DESCRIPTORS.
16460 * Makefile.in: Rebuild.
16461 * configure: Rebuild.
16462 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
16463 (tls_test_shared2.so): New target.
16464 (tls_shared_gd_to_ie_test_SOURCES): New variable.
16465 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
16466 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
16467 (tls_shared_gd_to_ie_test_LDADD): New variable.
16468 (tls_shared_gnu2_gd_to_ie_test): New target.
16469 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
16470 New targets.
16471 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
16472 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
16473 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
16474 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
16475 (tls_shared_gnu2_test): New target.
16476 (tls_test_gnu2_shared.so): New target.
16477 (tls_shared_gnu2_test_SOURCES): New variable.
16478 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
16479 (tls_shared_gnu2_test_LDFLAGS): New variable.
16480 (tls_shared_gnu2_test_LDADD): New variable.
16481 * testsuite/Makefile.in: Rebuild.
16482 * testsuite/Makefile.
16483
83bfb6b7
ILT
164842008-04-11 Ian Lance Taylor <iant@google.com>
16485
16486 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
16487 justsyms.t.
16488 * testsuite/Makefile.in: Rebuild.
16489
16490 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
16491 long.
16492 * testsuite/script_test_2.cc (main): Adjust test.
16493
706e1f5e
ILT
164942008-04-11 David S. Miller <davem@davemloft.net>
16495 Ian Lance Taylor <iant@google.com>
16496
16497 * options.h (General_options): Add entries for '-Y' and
16498 '-relax'.
16499 * options.cc (General_options:finalize): If -Y was used, add those
16500 entries to the library path instead of the default "/lib" and
16501 "/usr/lib".
16502
7c98e6bb
DM
165032008-04-11 David S. Miller <davem@davemloft.net>
16504
16505 * testsuite/justsyms.t: Start at 0x100.
16506 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
16507 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
16508 long.
16509 * testsuite/script_test_2.cc: Adjust string and section length
16510 checks.
7c98e6bb 16511
99a37bfd
ILT
165122008-04-09 Ian Lance Taylor <iant@google.com>
16513
2cefc357
ILT
16514 PR gold/5996
16515 * script-sections.cc (Sections_element::allocate_to_segment): Add
16516 orphan parameter.
16517 (Output_section_definition::allocate_to_segment): Likewise.
16518 (Orphan_output_section::allocate_to_segment): Likewise.
16519 (Script_sections::attach_sections_using_phdrs_clause): Don't
16520 propagate non-PT_LOAD segments to orphan sections.
16521 * testsuite/Makefile.am (script_test_3.stdout): Generate using
16522 readelf rather than objdump.
16523 * testsuite/script_test_3.sh: Adjust accordingly. Test that
16524 .interp section and PT_INTERP segment are the same size.
16525 * testsuite/Makefile.in: Rebuild.
16526
99a37bfd
ILT
16527 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
16528 aliases for symbols defined in the same object.
16529 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
16530 (weak_alias_test_SOURCES): New variable.
16531 (weak_alias_test_DEPENDENCIES): New variable.
16532 (weak_alias_test_LDFLAGS): New variable.
16533 (weak_alias_test_LDADD): New variable.
16534 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
16535 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
16536 (weak_alias_test_3.o): New target.
16537 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
16538 * testsuite/weak_alias_test_main.cc: New file.
16539 * testsuite/weak_alias_test_1.cc: New file.
16540 * testsuite/weak_alias_test_2.cc: New file.
16541 * testsuite/weak_alias_test_3.cc: New file.
16542
780e49c5
ILT
165432008-04-08 Ian Lance Taylor <iant@google.com>
16544
cdb0b8f5
ILT
16545 * options.h (class General_options): Add --noinhibit-exec option.
16546 * main.cc (main): Check --noinhibit-exec.
16547
0864d551
ILT
16548 * options.h (class General_options): Define --wrap as a special
16549 option. Add wrap_symbols_ field.
16550 (General_options::any_wrap_symbols): New function.
16551 (General_options::is_wrap_symbol): New function.
16552 * options.cc (General_options::parse_wrap): New function.
16553 (General_options::General_options): Initialize wrap_symbols_.
16554 * symtab.cc (Symbol_table::wrap_symbol): New function.
16555 (Symbol_table::add_from_object): Handle --wrap.
16556 * symtab.h (class Symbol_table): Declare wrap_symbol.
16557 * target.h (Target::wrap_char): New function.
16558 (Target::Target_info): Add wrap_char field.
16559 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
16560 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
16561 * testsuite/testfile.cc (Target_test::test_target_info):
16562 Likewise.
16563
789aa6de
ILT
16564 * errors.cc (Errors::undefined_symbol): Mention symbol version if
16565 there is one.
16566
2c38906f
ILT
16567 * layout.h (class Layout): Add added_eh_frame_data_ field.
16568 * layout.cc (Layout::Layout): Initialize new field.
16569 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
16570 output section until we find a section we merged successfully.
16571 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
16572 that the size be non-zero.
16573
780e49c5
ILT
16574 * merge.cc (Object_merge_map::get_output_offset): Remove inline
16575 qualifier.
16576
7fcd0256
ILT
165772008-04-08 Craig Silverstein <csilvers@google.com>
16578
16579 * configure.ac: Export new conditional variable HAVE_ZLIB.
16580 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
16581 on HAVE_ZLIB.
16582 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
16583 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16584
6835af53
ILT
165852008-04-07 Ian Lance Taylor <iant@google.com>
16586
e24f324c
ILT
16587 * version.cc (version_string): Set to "1.5".
16588
a036edd8
ILT
16589 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
16590 Add issued_non_pic_error_ field. Declare check_non_pic.
16591 (Target_x86_64::Scan::check_non_pic): New function.
16592 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
16593 (Target_x86_64::Scan::global): Likewise.
16594
624f8810
ILT
16595 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
16596 addend parameter. Change caller. Handle merge sections.
16597 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
16598 Address to Addend. Don't add in the result of
16599 local_section_offset, pass down the addend and use the returned
16600 value.
16601 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
16602 Update declarations of local_section_offset and symbol_value.
16603 * testsuite/two_file_test_1.cc (t18): New function.
16604 * testsuite/two_file_test_2.cc (f18): New function.
16605 * testsuite/two_file_test_main.cc (main): Call t18.
16606 * testsuite/two_file_test.h (t18, f18): Declare.
16607
6835af53
ILT
16608 * configure.ac: Don't test for objdump, c++filt, or readelf.
16609 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
16610 conditionals.
16611 (TEST_READELF): New variable.
16612 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
16613 (check_PROGRAMS): Add two_file_strip_test.
16614 (two_file_strip_test): New target.
16615 (check_PROGRAMS): Add two_file_same_shared_strip_test.
16616 (two_file_same_shared_strip_test_SOURCES): New variable.
16617 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
16618 (two_file_same_shared_strip_test_LDFLAGS): New variable.
16619 (two_file_same_shared_strip_test_LDADD): New variable.
16620 (two_file_shared_strip.so): New target.
16621 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
16622 (ver_test_5.syms, ver_test_7.syms): Likewise.
16623 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
16624 (strip_test_3.stdout): Use TEST_OBJDUMP.
16625 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16626
86925eef
CC
166272008-04-04 Cary Coutant <ccoutant@google.com>
16628
16629 * symtab.h (Symbol::is_weak_undefined): New function.
16630 (Symbol::is_strong_undefined): New function.
16631 (Symbol::is_absolute): New function.
16632 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
16633 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
16634 absolute symbols.
16635 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
16636 (weak_undef_test): New target.
16637 * testsuite/Makefile.in: Rebuild.
16638 * testsuite/weak_undef_file1.cc: New file.
16639 * testsuite/weak_undef_file2.cc: New file.
16640 * testsuite/weak_undef_test.cc: New file.
16641
126f3ece
ILT
166422008-04-03 Craig Silverstein <csilvers@google.com>
16643
16644 * compressed_output.h (class Output_compressed_section): Use
16645 unsigned buffer.
16646 * compressed_output.cc (zlib_compress): Use unsigned buffers,
16647 add zlib header.
16648 (zlib_compressed_suffix): Removed.
16649 (Output_compressed_section::set_final_data_size): Use unsigned
16650 buffers.
16651 * testsuite/Makefile.am (flagstest_compress_debug_sections):
16652 Fix linker invocation.
16653 (flagstest_o_specialfile_and_compress_debug_sections):
16654 Likewise.
16655 * testsuite/Makefile.in: Regenerated.
16656
deae2a14
DM
166572008-04-02 David S. Miller <davem@davemloft.net>
16658
16659 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
16660 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
16661
70752818
ILT
166622008-04-02 Craig Silverstein <csilvers@google.com>
16663
16664 * TODO: New file.
16665
39d0cb0e
ILT
166662008-04-02 Ian Lance Taylor <iant@google.com>
16667
16668 * fileread.cc (File_read::find_view): Add byteshift and vshifted
16669 parameters. Update for new key type to views_. Change all
16670 callers.
16671 (File_read::read): Adjust for byteshift in returned view.
16672 (File_read::add_view): New function, broken out of
16673 find_and_make_view.
16674 (File_read::make_view): New function, broken out of
16675 find_and_make_view.
16676 (File_read::find_or_make_view): Add offset and aligned
16677 parameters. Rewrite accordingly. Change all callers.
16678 (File_read::get_view): Add offset and aligned parameters. Adjust
16679 for byteshift in return value.
16680 (File_read::get_lasting_view): Likewise.
16681 * fileread.h (class File_read): Update declarations.
16682 (class File_read::View): Add byteshift_ field. Add byteshift to
16683 constructor. Add byteshift method.
16684 * archive.h (Archive::clear_uncached_views): New function.
16685 (Archive::get_view): Add aligned parameter. Change all callers.
16686 * object.h (Object::get_view): Add aligned parameter. Change all
16687 callers.
16688 (Object::get_lasting_view): Likewise.
16689
16690 * fileread.cc (File_read::release): Don't call clear_views if
16691 there are multiple objects.
16692 * fileread.h (File_read::clear_uncached_views): New function.
16693 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
16694 on the archive.
16695
a1207466
CC
166962008-03-31 Cary Coutant <ccoutant@google.com>
16697
16698 Add thin archive support.
16699 * archive.cc (Archive::armagt): New const.
16700 (Archive::setup): Remove task parameter and calls to unlock.
16701 (Archive::unlock_nested_archives): New function.
16702 (Archive::read_header): Add nested_off parameter. Change
16703 all callers.
16704 (Archive::interpret_header): Likewise.
16705 (Archive::include_all_members): Change to handle thin
16706 archives.
16707 (Archive::include_member): Likewise.
16708 * archive.h (Archive::Archive): Add new parameters and
16709 initializers.
16710 (Archive::armagt): New const.
16711 (Archive::setup): Remove task parameter.
16712 (Archive::unlock_nested_archives): New function.
16713 (Archive::read_header): Add nested_off parameter.
16714 (Archive::interpret_header): Likewise.
16715 (Archive::Nested_archive_table): New typedef.
16716 (Archive::is_thin_archive_): New field.
16717 (Archive::nested_archives_): New field.
16718 (Archive::options_): New field.
16719 (Archive::dirpath_): New field.
16720 (Archive::task_): New field.
16721 * readsyms.cc (Read_symbols::do_read_symbols): Add check
16722 for thin archives. Pass additional parameters to
16723 Archive::Archive. Unlock the archive file after calling
16724 Archive::setup.
cd536b21 16725
479f6503
ILT
167262008-03-29 Ian Lance Taylor <iant@google.com>
16727
686c8caf
ILT
16728 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
16729 version symbol to be local.
16730 * testsuite/ver_test_4.sh: New file.
16731 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
16732 (check_DATA): Add ver_test_4.syms.
16733 (ver_test_4.syms): New target.
16734 * testsuite/Makefile.in: Rebuild.
16735
ab794b6b
ILT
16736 * output.cc
16737 (Output_section::Input_section_sort_entry::has_priority): New
16738 function.
16739 (Output_section::Input_section_sort_entry::match_file_name): New
16740 function.
16741 (Output_section::Input_section_sort_entry::match_section_name):
16742 Remove.
16743 (Output_section::Input_section_sort_entry::match_section_name_prefix):
16744 Remove.
16745 (Output_section::Input_section_sort_entry::match_section_file):
16746 Remove.
16747 (Output_section::Input_section_sort_compare::operator()): Rewrite
16748 using new Input_section_sort_entry functions. Sort crtbegin and
16749 crtend first. Sort sections with no priority before sections with
16750 a priority.
16751 * testsuite/initpri1.c (d3): Check j != 4.
16752 (cd5): New constructor/destructor function.
16753 (main): Check j != 2.
16754
479f6503
ILT
16755 * symtab.cc (Symbol_table::add_from_object): If we don't use the
16756 new symbol when resolving, don't call set_is_default.
16757 * testsuite/ver_test_7.cc: New file.
16758 * testsuite/ver_test_7.sh: New file.
16759 * testsuite/Makefile.am (ver_test_7.so): New target.
16760 (ver_test_7.o): New target.
16761 (check_SCRIPTS): Add ver_test_7.sh.
16762 (check_DATA): Add ver_test_7.syms.
16763 (ver_test_7.syms): New target.
16764
2fd32231
ILT
167652008-03-28 Ian Lance Taylor <iant@google.com>
16766
16767 * layout.cc (Layout::layout): If we see an input section with a
16768 name that needs sorting, set the must_sort flag for the output
16769 section.
16770 (Layout::make_output_section): If the name of the output section
16771 indicates that it might require sorting, set the may_sort flag.
16772 * output.h (Output_section::may_sort_attached_input_sections): New
16773 function.
16774 (Output_section::set_may_sort_attached_input_sections): New
16775 function.
16776 (Output_section::must_sort_attached_input_sections): New
16777 function.
16778 (Output_section::set_must_sort_attached_input_sections): New
16779 function.
16780 (class Output_section): Declare Input_section_sort_entry. Define
16781 Input_section_sort_compare. Declare
16782 sort_attached_input_sections. Add new fields:
16783 may_sort_attached_input_sections_,
16784 must_sort_attached_input_sections_,
16785 attached_input_sections_are_sorted_.
16786 * output.cc (Output_section::Output_section): Initialize new
16787 fields.
16788 (Output_section::add_input_section): Add an entry to
16789 input_sections_ if may_sort or must_sort are true.
16790 (Output_section::set_final_data_size): Call
16791 sort_attached_input_sections if necessary.
16792 (Output_section::Input_section_sort_entry): Define new class.
16793 (Output_section::Input_section_sort_compare::operator()): New
16794 function.
16795 (Output_section::sort_attached_input_sections): New function.
16796 * configure.ac: Check whether the compiler supports constructor
16797 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
16798 * testsuite/initpri1.c: New file.
16799 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
16800 CONSTRUCTOR_PRIORITY.
16801 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
16802 (initpri1_LDFLAGS): New variable.
16803 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16804
18e6b24e
ILT
168052008-03-27 Ian Lance Taylor <iant@google.com>
16806
49bdd526
ILT
16807 * common.cc (Sort_commons::operator): Correct sorting algorithm.
16808 * testsuite/common_test_1.c: New file.
16809 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
16810 (common_test_1_SOURCES): New variable.
16811 (common_test_1_DEPENDENCIES): New variable.
16812 (common_test_1_LDFLAGS): New variable.
16813
18e6b24e
ILT
16814 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
16815 and commons_ correctly when NAME/VERSION does not override
16816 NAME/NULL.
16817 * testsuite/ver_test_6.c: New file.
16818 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
16819 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
16820 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
16821
04bf7072
ILT
168222008-03-26 Ian Lance Taylor <iant@google.com>
16823
5871526f
ILT
16824 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
16825 of an undefined symbol from a version script.
16826 * testsuite/Makefile.am (ver_test_5.so): New target.
16827 (ver_test_5.o): New target.
16828 (check_SCRIPTS): Add ver_test_5.sh.
16829 (check_DATA): Add ver_test_5.syms.
16830 (ver_test_5.syms): New target.
16831 * testsuite/ver_test_5.cc: New file.
16832 * testsuite/ver_test_5.script: New file.
16833 * testsuite/ver_test_5.sh: New file.
16834 * Makefile.in, testsuite/Makefile.in: Rebuild.
16835
04bf7072
ILT
16836 PR gold/5986
16837 Fix problems building gold with gcc 4.3.0.
16838 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
16839 (gold_error_at_location, gold_warning_at_location): Use it.
16840 * configure.ac: Check whether we can compile and use a template
16841 function with a printf attribute.
16842 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
16843 when jumping over bytes.
16844 * object.cc: Instantiate Object::read_section_data.
16845 * debug.h: Include <cstring>
16846 * dwarf_reader.cc: Include <algorithm>
16847 * main.cc: Include <cstring>.
16848 * options.cc: Include <cstring>.
16849 * output.cc: Include <cstring>.
16850 * script.cc: Include <cstring>.
16851 * script.h: Include <string>.
16852 * symtab.cc: Include <cstring> and <algorithm>.
16853 * target-select.cc: Include <cstring>.
16854 * version.cc: Include <string>.
16855 * testsuite/testmain.cc: Include <cstdlib>.
16856 * configure, config.in: Rebuild.
16857
874c5b28
ILT
168582008-03-25 Ian Lance Taylor <iant@google.com>
16859
819d6c3a
ILT
16860 * options.cc: Include "../bfd/bfdver.h".
16861 (options::help): Print bug reporting address.
16862
f4b2c6f5
ILT
16863 * version.cc (print_version): Adjust output for current value of
16864 BFD_VERSION_STRING.
16865
16866 * NEWS: New file.
16867
e96caa79
ILT
16868 * options.cc (options::help): Print list of supported targets.
16869 * target-select.h: Include <vector>.
16870 (class Target_selector): Make machine_, size_, and is_big_endian_
16871 fields const. Add bfd_name_ and instantiated_target_ fields.
16872 (Target_selector::Target_selector): Add bfd_name parameter.
16873 (Target_selector::recognize): Make non-virtual, call
16874 do_recognize.
16875 (Target_selector::recognize_by_name): Make non-virtual, call
16876 do_recognize_by_name.
16877 (Target_selector::supported_names): New function.
16878 (Target_selector::bfd_name): New function.
16879 (Target_selector::do_instantiate_target): New pure virtual
16880 function.
16881 (Target_selector::do_recognize): New virtual function.
16882 (Target_selector::do_recognize_by_name): New virtual function.
16883 (Target_selector::instantiate_target): New private function.
16884 (supported_target_names): Declare.
16885 * target-select.cc (Target_selector::Target_selector): Update for
16886 new parameter and fields.
16887 (select_target_by_name): Check that the name matches before
16888 calling recognize_by_name.
16889 (supported_target_names): New function.
16890 * i386.cc (class Target_selector_i386): Update Target_selector
16891 constructor call. Remove recognize and recognize_by_name. Add
16892 do_instantiate_target.
16893 * x86_64.cc (class Target_selector_x86_64): Likewise.
16894 * testsuite/testfile.cc (class Target_selector_test): Update for
16895 changes to Target_selector.
16896
874c5b28
ILT
16897 * README: Rewrite, with some notes on unsupported features.
16898
0a65a3a7
CC
168992008-03-24 Cary Coutant <ccoutant@google.com>
16900
16901 * i386.cc (Target_i386::Got_type): New enum declaration.
16902 (Target_i386::Scan::local): Updated callers of Output_data_got
16903 member functions.
16904 (Target_i386::Scan::global): Likewise.
16905 (Target_i386::Relocate::relocate): Likewise.
16906 (Target_i386::Relocate::relocate_tls): Likewise.
16907 * object.h (Got_offset_list): New class.
16908 (Sized_relobj::local_has_got_offset): Added got_type parameter.
16909 (Sized_relobj::local_got_offset): Likewise.
16910 (Sized_relobj::set_local_got_offset): Likewise.
16911 (Sized_relobj::local_has_tls_got_offset): Removed.
16912 (Sized_relobj::local_tls_got_offset): Removed.
16913 (Sized_relobj::set_local_tls_got_offset): Removed.
16914 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
16915 * output.cc (Output_data_got::add_global): Added got_type parameter.
16916 (Output_data_got::add_global_with_rel): Likewise.
16917 (Output_data_got::add_global_with_rela): Likewise.
16918 (Output_data_got::add_global_pair_with_rel): New function.
16919 (Output_data_got::add_global_pair_with_rela): New function.
16920 (Output_data_got::add_local): Added got_type parameter.
16921 (Output_data_got::add_local_with_rel): Likewise.
16922 (Output_data_got::add_local_with_rela): Likewise.
16923 (Output_data_got::add_local_pair_with_rel): New function.
16924 (Output_data_got::add_local_pair_with_rela): New function.
16925 (Output_data_got::add_global_tls): Removed.
16926 (Output_data_got::add_global_tls_with_rel): Removed.
16927 (Output_data_got::add_global_tls_with_rela): Removed.
16928 (Output_data_got::add_local_tls): Removed.
16929 (Output_data_got::add_local_tls_with_rel): Removed.
16930 (Output_data_got::add_local_tls_with_rela): Removed.
16931 * output.h (Output_data_got::add_global): Added got_type parameter.
16932 (Output_data_got::add_global_with_rel): Likewise.
16933 (Output_data_got::add_global_with_rela): Likewise.
16934 (Output_data_got::add_global_pair_with_rel): New function.
16935 (Output_data_got::add_global_pair_with_rela): New function.
16936 (Output_data_got::add_local): Added got_type parameter.
16937 (Output_data_got::add_local_with_rel): Likewise.
16938 (Output_data_got::add_local_with_rela): Likewise.
16939 (Output_data_got::add_local_pair_with_rel): New function.
16940 (Output_data_got::add_local_pair_with_rela): New function.
16941 (Output_data_got::add_global_tls): Removed.
16942 (Output_data_got::add_global_tls_with_rel): Removed.
16943 (Output_data_got::add_global_tls_with_rela): Removed.
16944 (Output_data_got::add_local_tls): Removed.
16945 (Output_data_got::add_local_tls_with_rel): Removed.
16946 (Output_data_got::add_local_tls_with_rela): Removed.
16947 * resolve.cc (Symbol::override_base_with_special): Removed
16948 reference to has_got_offset_ field.
16949 * symtab.cc (Symbol::init_fields): Replaced initialization
16950 of got_offset_ with got_offsets_. Removed initialization
16951 of has_got_offset_
53fcba31 16952 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
16953 (Symbol::got_offset): Likewise.
16954 (Symbol::set_got_offset): Likewise.
16955 (Symbol::has_tls_got_offset): Removed.
16956 (Symbol::tls_got_offset): Removed.
16957 (Symbol::set_tls_got_offset): Removed.
16958 (Symbol::got_offset_): Removed.
16959 (Symbol::tls_mod_got_offset_): Removed.
16960 (Symbol::tls_pair_got_offset_): Removed.
16961 (Symbol::got_offsets_): New field.
16962 (Symbol::has_got_offset): Removed.
16963 (Symbol::has_tls_mod_got_offset): Removed.
16964 (Symbol::has_tls_pair_got_offset): Removed.
16965 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
16966 (Target_x86_64::Scan::local): Updated callers of Output_data_got
16967 member functions.
16968 (Target_x86_64::Scan::global): Likewise.
16969 (Target_x86_64::Relocate::relocate): Likewise.
16970 (Target_x86_64::Relocate::relocate_tls): Likewise.
16971
bd52eafb
BE
169722008-03-25 Ben Elliston <bje@au.ibm.com>
16973
16974 * yyscript.y: Fix spelling error in comment.
16975
8b105e34
ILT
169762008-03-24 Ian Lance Taylor <iant@google.com>
16977
8ed814a9
ILT
16978 * options.h (class General_options): Define build_id option.
16979 * layout.h (class Layout): Declare write_build_id, create_note,
16980 create_build_id. Add build_id_note_ member.
16981 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
16982 "libiberty.h", "md5.h", "sha1.h".
16983 (Layout::Layout): Initialize eh_frame_data_,
16984 eh_frame_hdr_section_, and build_id_note_.
16985 (Layout::finalize): Call create_build_id.
16986 (Layout::create_note): New function, broken out of
16987 Layout::create_gold_note.
16988 (Layout::create_gold_note): Call create_note.
16989 (Layout::create_build_id): New function.
16990 (Layout::write_build_id): New function.
16991 (Close_task_runner::run): Call write_build_id.
16992
8b105e34
ILT
16993 * x86_64.cc: Correct license to GPLv3.
16994
086a1841
ILT
169952008-03-23 Ian Lance Taylor <iant@google.com>
16996
16997 * options.cc: Include "demangle.h".
16998 (parse_optional_string): New function.
16999 (parse_long_option): Handle takes_optional_argument.
17000 (parse_short_option): Update dash_z initializer. Handle
17001 takes_optional_argument.
17002 (General_options::General_options): Initialize do_demangle_.
17003 (General_options::finalize): Set do_demangle_. Handle demangling
17004 style.
17005 * options.h (parse_optional_string): Declare.
17006 (struct One_option): Add optional_arg field. Update constructor.
17007 Update call constructor calls. Add takes_optional_argument
17008 function.
17009 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
17010 (DEFINE_optional_string): Define.
17011 (General_options::demangle): Change from DEFINE_bool to
17012 DEFINE_optional_string.
17013 (General_options::no_demangle): New function.
17014 (General_options::do_demangle): New function.
17015 (General_options::set_do_demangle): New function.
17016 (General_options::execstack_status_): Move definition to end of
17017 class definition.
17018 (General_options::static_): Likewise.
17019 (General_options::do_demangle_): New field.
17020 * object.cc (big_endian>::get_symbol_location_info): Call
17021 Options::do_demangle, not Options::demangle.
17022 * symtab.cc (demangle): Likewise.
17023
cbb93e63
ILT
170242008-03-22 Ian Lance Taylor <iant@google.com>
17025
17026 * gold.h: Include <cstddef> and <sys/types.h>
17027 * options.h: Include <cstring>.
17028
ec531623
ILT
170292008-03-21 Ian Lance Taylor <iant@google.com>
17030
17031 * Added source code to GNU binutils.
752937aa 17032\f
b90efa5b 17033Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
17034
17035Copying and distribution of this file, with or without modification,
17036are permitted in any medium without royalty provided the copyright
17037notice and this notice are preserved.
17038
17039Local Variables:
17040mode: change-log
17041left-margin: 8
17042fill-column: 74
17043version-control: never
17044End:
This page took 1.094928 seconds and 4 git commands to generate.