Avoid a copy constructor call.
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
9dbb4b02
RÁE
12015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
2
3 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
4 constructor call.
5
1fa29f10
IT
62015-04-06 Ilya Tocar <ilya.tocar@intel.com>
7
8 PR gold/17641
9 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
10 (Target_x86_64::Scan::local): Don't create GOT entry, when we
11 can convert mov to lea.
12 (Target_x86_64::Scan::global): Ditto.
13 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
14 %reg to lea foo(%rip), %reg if possible.
15 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
16 * testsuite/x86_64_mov_to_lea1.s: New.
17 * testsuite/x86_64_mov_to_lea2.s: Ditto.
18 * testsuite/x86_64_mov_to_lea3.s: Ditto.
19 * testsuite/x86_64_mov_to_lea4.s: Ditto.
20 * testsuite/x86_64_mov_to_lea.sh: Ditto.
21
39f3de7c
L
222015-04-02 H.J. Lu <hongjiu.lu@intel.com>
23
24 * configure: Regenerated.
25
c4fc4724
IT
262015-04-01 Ilya Tocar <ilya.tocar@intel.com>
27
28 PR gold/17640
29 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
30 (Target_i386::Scan::local): Don't create GOT entry, when we
31 can convert GOT to GOTOFF.
32 (Target_i386::Scan::global): Ditto.
33 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
34 lea foo@GOTOFF(%reg), %reg if possible.
35 * testsuite/Makefile.am (i386_mov_to_lea): New test.
36 * testsuite/i386_mov_to_lea1.s: New.
37 * testsuite/i386_mov_to_lea2.s: Ditto.
38 * testsuite/i386_mov_to_lea3.s: Ditto.
39 * testsuite/i386_mov_to_lea4.s: Ditto.
40 * testsuite/i386_mov_to_lea5.s: Ditto.
41 * testsuite/i386_mov_to_lea.sh: Ditto.
42
918357b9
L
432015-04-01 H.J. Lu <hongjiu.lu@intel.com>
44
45 * Makefile.am (ZLIB): New.
46 (ZLIBINC): Likewise.
47 (AM_CFLAGS): Add $(ZLIBINC).
48 (AM_CXXFLAGS): Likewise.
49 (ldadd_varldadd_var): Add $(ZLIB).
50 (incremental_dump_LDADD): Likewise.
51 (dwp_LDADD): Likewise.
52 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
53 <zlib.h>.
54 (zlib_compress): Don't check HAVE_ZLIB_H.
55 (zlib_decompress): Likewise.
56 * options.h (compress_debug_sections): Likewise.
57 * configure.ac (AM_CONDITIONAL): Removed.
58 * testsuite/Makefile.am (ZLIB): New.
59 (LDADD): Add $(ZLIB).
60 Don't check HAVE_ZLIB.
61 * Makefile.in: Regenerated.
62 * config.in: Likewise.
63 * configure: Likewise.
64 * testsuite/Makefile.in: Likewise.
65
6b0ad2eb
JY
662015-03-30 Jing Yu <jingyu@google.com>
67
68 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
69 TLSLD_ADD_DTPREL_LO12_NC.
70 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
71 _TLS_MODULE_BASE_ point to the start of tls segment.
72 (Target_aarch64::optimize_tls_reloc): Add cases for
73 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
74 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
75 (Target_aarch64::Scan::local): Likewise.
76 (Target_aarch64::Scan::global): Likewise.
77 (Target_aarch64::Relocate::relocate): Likewise.
78 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
79 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
80 relocations.
81
0916f9e7
RÁE
822015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
83
84 * merge.cc (Object_merge_map::add_mapping): call
85 Object_merge_map::Input_merge_map::add_mapping.
86 (Object_merge_map::Input_merge_map::add_mapping): New.
87 (Output_merge_data::do_add_input_section): Call
88 get_or_make_input_merge_map before a loop.
89 (Output_merge_string<Char_type>::finalize_merged_data): Call
90 get_or_make_input_merge_map before a loop.
91 * merge.h (Object_merge_map): Make Input_merge_map public.
92 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
93 (Relobj::get_or_create_merge_map): New.
94 * object.h (Relobj::get_or_create_merge_map): New.
95
282c9750
AM
962015-03-24 Alan Modra <amodra@gmail.com>
97
98 PR 18147
99 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
100 relocation errors for branches to strong undefined symbols.
101
67f95b96
RÁE
1022015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
103
104 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
105 (Object_merge_map::is_merge_section_for): Remove.
106 (Object_merge_map::find_merge_section): New.
107 * merge.h (Object_merge_map::is_merge_section_for): Remove.
108 (Object_merge_map::find_merge_section): New.
109 (Object_merge_map::get_input_merge_map): Add a const version.
110 * object.cc (Relobj::is_merge_section_for): Remove.
111 (Relobj::find_merge_section): New.
112 * object.h (Relobj::is_merge_section_for): Remove.
113 (Relobj::find_merge_section): New.
114 * output.cc
115 (Output_section::Input_section::is_merge_section_for): Remove.
116 (Output_section::add_merge_input_section): Don't call
117 add_merge_input_section.
118 (Output_section::find_merge_section): Return const. Use
119 object->find_merge_section.
120 (Output_section::build_lookup_maps): Don't build a map for
121 merge sections.
122 (Output_section::is_input_address_mapped): Return false if
123 section is not found.
124 (Output_section::find_starting_output_address): Use
125 find_merge_section instead of is_merge_section_for.
126 (Output_section::add_script_input_section): Don't build a map for
127 merge sections.
128 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
129 (Output_section_lookup_maps::find_merge_section): Remove.
130 (Output_section_lookup_maps::add_merge_input_section) Remove.
131 (Output_section::find_merge_section): Return const.
132
152f7024
CC
1332015-03-22 Cary Coutant <cary@google.com>
134
135 PR gold/18106
136 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
137 non-SIB form of lea, with nop after the call.
138
bccffdfd
CC
1392015-03-21 Cary Coutant <cary@google.com>
140
141 PR gold/14217
142 * output.cc (Output_segment::is_first_section_relro): Don't ignore
143 .tdata section.
144 (Output_segment::set_section_addresses): Don't align size of relro
145 segment for .tbss.
146
1c582fe7
CC
1472015-03-21 Cary Coutant <cary@google.com>
148
149 PR gold/18010
150 * stringpool.cc (Stringpool_template): Don't optimize if section
151 alignment is greater than sizeof(char).
152
410da591
CC
1532015-03-21 Cary Coutant <cary@google.com>
154
155 PR gold/18048
156 * script-c.h (script_include_directive): Add first_token parameter.
157 * script.cc (script_include_directive): Add first_token parameter, and
158 pass it to read_script_file.
159 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
160 (PARSING_MEMORY_DEF): New tokens.
161 (top): Add new productions for INCLUDE files.
162 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
163 Pass PARSING_LINKER_SCRIPT to script_include_directive.
164 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
165 (section_cmd): Pass PARSING_SECTION_CMDS.
166 (file_or_sections_cmd): Remove.
167 (memory_def): Pass PARSING_MEMORY_DEF.
168 * testsuite/Makefile.am (memory_test_2): New test.
169 * testsuite/Makefile.in: Regenerate.
170 * testsuite/memory_test_inc.t: New script file.
171 * testsuite/memory_test_inc_1.t.src: New script file.
172 * testsuite/memory_test_inc_2.t.src: New script file.
173 * testsuite/memory_test_inc_3.t.src: New script file.
174
0d5bbdb0
CC
1752015-03-21 Cary Coutant <cary@google.com>
176
177 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
178 (Sized_relobj_dwo::setup): Build compressed section map.
179 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
180 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
181 section map.
182 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
183 compressed_sections_ field.
184 (build_compressed_section_map): Take Object instead of
185 Sized_relobj_file parameter; add decompress_if_needed parameter.
186 (Sized_relobj_file::do_find_special_sections): Store compressed
187 section map in parent Object.
188 (Sized_relobj_file::do_decompressed_section_contents): Move
189 implementation to Object::decompressed_section_contents.
190 (Sized_relobj_file::do_discard_decompressed_sections): Move
191 implementation to Object::discard_decompressed_sections.
192 * object.h (build_compressed_section_map): Declare.
193 (Object::Object): Add compressed_sections_ field.
194 (Object::section_is_compressed): Move implementation here.
195 (Object::decompressed_section_contents): De-virtualize.
196 (Object::discard_decompressed_sections): De-virtualize.
197 (Object::do_section_is_compressed): Delete.
198 (Object::do_decompressed_section_contents): Delete.
199 (Object::set_compressed_sections): New method.
200 (Object::compressed_sections): New method.
201 (Object::compressed_sections_): New data member.
202 (Compressed_section_info, Compressed_section_map): Move to top of file.
203 (Sized_relobj_file::do_section_is_compressed): Delete.
204 (Sized_relobj_file::do_decompressed_section_contents): Delete.
205 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
206 (Sized_relobj_file::compressed_sections_): Move to Object class.
207
bd9e0d46
CC
2082015-03-21 Cary Coutant <ccoutant@google.com>
209
210 PR gold/18152
211 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
212 deferred objects.
213
943c8b43
CC
2142015-03-11 Cary Coutant <ccoutant@google.com>
215
216 * options.cc (General_options::finalize): Don't allow -z relro
217 with incremental linking.
218 * testsuite/Makefile.am (incremental_test): Add -z norelro.
219 (incremental_test_2): Likewise.
220 (incremental_test_3): Likewise.
221 (incremental_test_4): Likewise.
222 (incremental_test_5): Likewise.
223 (incremental_test_6): Likewise.
224 (incremental_copy_test): Likewise.
225 (incremental_common_test_1): Likewise.
226 (incremental_comdat_test_1): Likewise.
227 * testsuite/Makefile.in: Regenerate.
228
e1663197
CC
2292015-03-09 Cary Coutant <ccoutant@google.com>
230
231 PR gold/14675
232 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
233 return enum indicating whether .eh_frame section is empty, optimizable,
234 unrecognized, or an end marker. Adjust explicit instantiations.
235 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
236 (Eh_frame::add_ehframe_input_section): Change return type.
237 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
238 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
239 to the .eh_frame output section until we see the end marker.
240 (Layout::finalize_eh_frame_section): New.
241 * layout.h: (Layout::finalize_eh_frame_section): New.
242
beb8418f
L
2432015-03-05 H.J. Lu <hongjiu.lu@intel.com>
244
245 * output.cc (Relobj::initialize_input_to_output_map<size>):
246 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
247
48c73428
CC
2482015-03-04 Cary Coutant <ccoutant@google.com>
249
250 * parameters.cc (Parameters::set_target_once): Call
251 Target::select_as_default_target just once from here...
252 (set_parameters_target): ...instead of from here.
253
2542015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
dbe40a88
RÁE
255
256 * ehframe.cc (Cie::set_output_offset): Pass in and use a
257 Output_section_data instead of a Merge_map.
258 (Eh_frame::Eh_frame): Don't initialize merge_map_.
259 (Eh_frame::read_cie): Use add_merge_mapping instead of
260 Merge_map::add_mapping.
261 (Eh_frame::read_fde): Ditto.
262 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
263 (Eh_frame::do_output_offset): Use merge_output_offset istead of
264 merge_map_->get_output_offset.
265 (Eh_frame::do_is_merge_section_for): Delete.
266 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
267 instead of a Merge_map.
268 (Cie::set_output_offset): Pass in a Output_section_data instead of a
269 Merge_map.
270 (Eh_frame::do_is_merge_section_for): Delete.
271 (Eh_frame::merge_map_): Delete.
272 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
273 and use a Output_section_data instead of a Merge_map.
274 (Object_merge_map::add_mapping): Ditto.
275 (Object_merge_map::get_output_offset): Remove the merge_map argument.
276 (Object_merge_map::is_merge_section_for): Pass in and use a
277 Output_section_data instead of a Merge_map.
278 (Merge_map): Delete.
279 (Output_merge_base::do_output_offset): Use merge_output_offset instead
280 of merge_map_.get_output_offset.
281 (Output_merge_base::do_is_merge_section_for): Delete.
282 (Output_merge_data::do_add_input_section): Use
283 object->add_merge_mapping instead of add_mapping.
284 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
285 * merge.h (Merge_map): Delete forward declaration.
286 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
287 instead of a Merge_map.
288 (Object_merge_map::get_output_offset): Remove the merge_map argument.
289 (Object_merge_map::is_merge_section_for): Pass in and use a
290 Output_section_data instead of a Merge_map.
291 (Input_merge_map::Object_merge_map::merge_map): Replace with
292 output_data.
293 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
294 Output_section_data instead of a Merge_map.
295 (Merge_map): Delete.
296 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
297 (Output_merge_base::do_is_merge_section_for): Delete.
298 (Output_merge_base::add_mapping): Delete.
299 (Output_merge_base::merge_map_): Delete.
300 * object.cc (Relobj::initialize_input_to_output_map): New.
301 (Relobj::initialize_input_to_output_map): New.
302 (Relobj::merge_output_offset): New.
303 (Relobj::is_merge_section_for): New.
304 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
305 bits.
306 * object.h (Relobj::merge_map): Delete.
307 (initialize_input_to_output_map): New.
308 (set_merge_map): Delete.
309 (add_merge_mapping): New.
310 (merge_output_offset): New.
311 (is_merge_section_for): New.
312 * output.cc (Output_section::Input_section::is_merge_section_for):
313 Use object->is_merge_section_for.
314 * output.h (Output_section_data::is_merge_section_for): Delete.
315 (Output_section_data::do_is_merge_section_for): Delete.
316 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
317 Use object->initialize_input_to_output_map.
318 (Merged_symbol_value<size>::value_from_output_section): Use
319 object->merge_output_offset.
320
48c73428 3212015-03-02 Peter Collingbourne <pcc@google.com>
2c7b626c
CC
322 Cary Coutant <ccoutant@google.com>
323
324 * output.cc (Output_section::add_merge_input_section): Do not
325 attempt to merge sections with an entsize of 0.
326
48c73428 3272015-03-02 Khem Raj <raj.khem@gmail.com>
5b07cd84
CC
328
329 * attributes.h (class Output_attributes_section_data ): Add
330 do_print_to_mapfile function.
331
ec86f434
AM
3322015-02-24 Alan Modra <amodra@gmail.com>
333
334 PR 18010
335 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
336 complain if value is not a multiple of four.
337 (Target_powerpc::Relocate::relocate): Correct handling of
338 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
339
be66981e
L
3402015-02-21 H.J. Lu <hongjiu.lu@intel.com>
341
342 * configure.ac (default_size): Set to 32 for x32.
343 * configure: Regenerated.
344
e3ee8ed4
AM
3452015-02-18 Alan Modra <amodra@gmail.com>
346
347 PR 17954
348 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
349 visibility.
350
3a935c6c
RÁE
3512015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
352
353 * gc.h (Garbage_collection::add_reference): Don't use find.
354
e0a1e121
RÁE
3552015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
356
357 * object.cc (write_local_symbols): avoid std::vector copy.
358
45a4fb1a
RÁE
3592015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
360
361 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
362
2d9afefe
MW
3632015-02-09 Mark Wielaard <mjw@redhat.com>
364
365 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
366 DW_LANG_Fortran03 and DW_LANG_Fortran08.
367
e9c1bdad
CC
3682015-02-16 Cary Coutant <ccoutant@google.com>
369
370 PR gold/13577
371 PR gold/16992
372 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
373 DF_SYMBOLIC if --dynamic-list option is used.
374 * options.cc (General_options::finalize): --dynamic-list is not
375 mutually exclusive with -Bsymbolic.
376 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
377 listed in --dynamic-list.
378 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
379 -Bsymbolic-functions.
380 * testsuite/Makefile.in: Regenerate.
381
0ed4b0bf
CC
3822015-02-16 Cary Coutant <ccoutant@google.com>
383
384 PR gold/17971
385 * incremental.cc: Remove redundant include of "output.h".
386
1a920511
JY
3872015-02-12 Jing Yu <jingyu@google.com>
388
389 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
390 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
391 New relocation.
392 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
393 TLSLE_MOVW_* relocations.
394 (Target_aarch64::Scan::global): Likewise.
395 (Target_aarch64::Relocate::relocate): Likewise.
396 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
397 for new TLSLE_MOVW_* relocations.
398
07f107f3
WN
3992015-02-11 Will Newton <will.newton@linaro.org>
400
401 PR gold/13321
402 * arm.cc (Target_arm::make_plt_section): Create an ARM
403 state mapping symbol at the start of the PLT.
404
e051a5b5
L
4052015-02-09 H.J. Lu <hongjiu.lu@intel.com>
406
407 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
408 Replace two_file_shared_2.so with two_file_shared_1.so.
409 * testsuite/Makefile.in: Regenerated.
410
dddcc5b9
AM
4112015-02-09 Alan Modra <amodra@gmail.com>
412
413 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
414 plugin_test_thin.a and defsym_test.
415 * testsuite/Makefile.in: Regenerate.
416
b39b8b9d
RÁE
4172015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
418
419 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
420 body.
421
b66d1c52
CC
4222015-02-04 Peter Collingbourne <pcc@google.com>
423
424 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
425 forwarding symbols when computing symbol resolution info for plugins.
426 * plugin.h (Plugin_manager::symtab): New method.
427 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
428
23081de0
CC
4292015-02-03 Cary Coutant <ccoutant@google.com>
430 Peter Collingbourne <pcc@google.com>
431
432 PR gold/15660
433 * archive.cc (Thin_archive_object_unlocker): New class.
434 (Archive::include_member): Unlock external members of thin archives.
435 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
436 (plugin_test_2): Likewise.
437 (plugin_test_3): Likewise.
438 (plugin_test_4): Likewise.
439 (plugin_test_5): Likewise.
440 (plugin_test_6): Likewise.
441 (plugin_test_7): Likewise.
442 (plugin_test_8): Likewise.
443 (plugin_test_9): Likewise.
444 (plugin_test_10): Likewise.
445 (plugin_test_11): New test case.
446 * testsuite/Makefile.in: Regenerate.
447 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
448 file to decide whether to claim file.
449 (all_symbols_read_hook): Likewise.
450 * testsuite/plugin_test_1.sh: Adjust expected output.
451 * testsuite/plugin_test_2.sh: Likewise.
452 * testsuite/plugin_test_3.sh: Likewise.
453 * testsuite/plugin_test_6.sh: Likewise.
454 * testsuite/plugin_test_tls.sh: Likewise.
455 * testsuite/plugin_test_11.sh: New testcase.
456
4572015-02-03 Cary Coutant <ccoutant@google.com>
458
459 * descriptors.cc (Descriptors::open): Set artificially-low limit for
460 file descriptors when debugging enabled. Add debug output.
461 (Descriptors::release): Add debug output.
462 (Descriptors::close_some_descriptor): Likewise.
463 (Descriptors::close_all): Likewise.
464 * fileread.cc (File_read::lock): Likewise.
465 (File_read::unlock): Likewise.
466
24dd5808
CC
4672015-02-02 Cary Coutant <ccoutant@google.com>
468
469 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
470 executable output file.
471
fa89cc82
HS
4722015-01-22 Han Shen <shenhan@google.com>
473
474 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
475 (Target_arm::do_plt_address_for_global): New method.
476 (Target_arm::do_plt_address_for_local): New method.
477 (Target_arm::rel_irelative_section): New method.
478 (Target_arm::make_data_plt): Add more parameters for plt ctor.
479 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
480 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
481 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
482 (Target_arm::Scan::check_non_pic): Add ifunc support.
483 (Target_arm::Scan::local): Add ifunc support.
484 (Target_arm::Scan::global): Add ifunc support.
485 (Target_arm::make_plt_section): New method.
486 (Target_arm::make_plt_entry): Change to call to make_plt_section.
487 (Target_arm::make_local_ifunc_plt_entry): New method.
488 (Target_arm::got_irelative_): New member.
489 (Target_arm::rel_irelative_): New member.
490 (Target_arm::got_section): Add creation for got_irelative_.
491 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
492 (Target_arm::Relocate::relocate): Properly set local ifunc address.
493 (Target_arm::do_dynsym_value): Properly set global ifunc address.
494 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
495 (Output_data_plt_arm::IRelative_data): New type.
496 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
497 (Output_data_plt_arm::add_entry): Add more parameters.
498 (Output_data_plt_arm::add_relocation): New method.
499 (Output_data_plt_arm::add_local_ifunc_entry): New method.
500 (Output_data_plt_arm::rel_irelative): New method.
501 (Output_data_plt_arm::entry_count): Modified.
502 (Output_data_plt_arm::address_for_global): New method.
503 (Output_data_plt_arm::address_for_local): New method.
23081de0 504gold/
fa89cc82
HS
505 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
506 (Output_data_plt_arm::insert_irelative_data): New method.
507 (Output_data_plt_arm::irelative_rel_): New member.
508 (Output_data_plt_arm::got_): New member.
509 (Output_data_plt_arm::got_irelative_): New member.
510 (Output_data_plt_arm::irelative_count_): New member.
511 (Output_data_plt_arm::IRelative_data_vec): New typedef.
512 (Output_data_plt_arm::irelative_data_vec_): New member.
513 (Output_data_plt_arm::do_write): Write out irelative entries.
514 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
515 more parameters to ctor.
516 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
517 more parameters to ctor.
518 * output.h (Output_data_reloc::add_local_relative): New method.
519 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
520
0f81d3f0
AM
5212015-01-29 Alan Modra <amodra@gmail.com>
522
523 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
524 and GOT_TLSGD to LE optimization.
525
65d92137
CC
5262015-01-28 Cary Coutant <ccoutant@google.com>
527
528 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
529 for undef TLS symbols.
530 (Target_x86_64::Relocate::relocate_tls): Likewise.
531 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
532
5485698a
CC
5332015-01-25 Cary Coutant <ccoutant@google.com>
534
535 * output.cc (Output_segment::set_section_addresses): Fix calculation
536 of size of relro segment.
537
b01a4b04
AM
5382015-01-22 Alan Modra <amodra@gmail.com>
539
540 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
541 condition for need of ifunc plt entry.
542 (Target_powerpc::Scan::global <got relocs>): Likewise.
543
3d0064a9
CC
5442015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
545
546 * mips.cc (reloc_high): Add r_sym.
547 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
548 reloc_high constructor.
549 (Mips_relocate_functions::relgot16_local): Likewise.
550 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
551 r_type to decide whether LO16 matches HI16.
552 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
553 rello16 and relgot16_local.
554
a5cd8f05
CC
5552015-01-09 Cary Coutant <ccoutant@google.com>
556
557 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
558 unless alignment is larger than page size.
559
4fc1b9d4
L
5602015-01-06 H.J. Lu <hongjiu.lu@intel.com>
561 Cary Coutant <ccoutant@google.com>
562
563 PR gold/17729
564 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
565 (DEFAULT_TARGET_X32): Set for x32.
566 * x86_64.cc (cmp_insn_32): New.
567 (lea_r10_insn_32): Likewise.
568 (lea_r11_insn_32): Likewise.
569 (cmp_insn_64): Likewise.
570 (lea_r10_insn_64): Likewise.
571 (lea_r11_insn_64): Likewise.
572 (Target_x86_64<size>::do_calls_non_split): Handle x32.
573 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
574 (check_DATA): Add split_x32 files.
575 (split_x32_[1234n].o): New targets.
576 (split_x32_[124]): New targets.
577 (split_x32_[1234r].stdout): New targets.
578 * testsuite/split_x32.sh: New file.
579 * testsuite/split_x32_1.s: Likewise.
580 * testsuite/split_x32_2.s: Likewise.
581 * testsuite/split_x32_3.s: Likewise.
582 * testsuite/split_x32_4.s: Likewise.
583 * testsuite/split_x32_n.s: Likewise.
584 * configure: Regenerated.
585 * testsuite/Makefile.in: Likewise.
586
e749cab8
L
5872015-01-06 H.J. Lu <hongjiu.lu@intel.com>
588
589 PR gold/17809
590 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
591 x32.
592
af759df0
AM
5932015-01-02 Alan Modra <amodra@gmail.com>
594
595 * version.cc (print_version): Just print current year.
596 * dwp.cc (print_version): Likewise.
597
b90efa5b
AM
5982015-01-01 Alan Modra <amodra@gmail.com>
599
600 Update year range in copyright notice of all files.
601
f12d1e8a
AM
6022014-12-25 Alan Modra <amodra@gmail.com>
603
604 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
605 new enums.
606 (Target_arm::merge_object_attributes, ): Likewise.
607
5c294fee
TG
6082014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
609
610 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
611 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
612 AEABI_VFP_args_vfp to check that.
613 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
614 value and replace hardcoded values by enum values.
615
e30880c2
CC
6162014-12-22 Cary Coutant <ccoutant@google.com>
617
618 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
619
bd040da1
L
6202014-12-20 H.J. Lu <hongjiu.lu@intel.com>
621
622 PR gold/14608
623 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
624 to "return i * i * 3;".
625
e02a4046
CC
6262014-12-16 Cary Coutant <ccoutant@google.com>
627
628 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
629 (Mapfile::print_output_data): Use current_data_size() to avoid
630 assert for sections requiring postprocessing; if address is not valid,
631 print 0.
632 (Mapfile::print_output_section): Use current_data_size(); print note
633 that addresses and sizes are before compression.
634
add6016b
L
6352014-12-14 H.J. Lu <hongjiu.lu@intel.com>
636
637 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
638 Cast current_group_size to unsigned long when reporting error.
639
0bf32ea9
JY
6402014-12-10 Jing Yu <jingyu@google.com>
641
642 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
643 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
644 Update error message.
645 (Target_aarch64::do_relax): Use absolute value of option
646 stub_group_size. Replace local variable with class member
647 stub_group_size_.
648
cbcb23fa
AM
6492014-12-04 Alan Modra <amodra@gmail.com>
650
651 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
652 addend of PLTREL24 reloc when not generating a plt stub. Make
653 max_branch_offset an "Address".
fbad6518 654 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
655 (Target_powerpc::Relocate::relocate): Likewise.
656
1611bc4a
AM
6572014-12-04 Alan Modra <amodra@gmail.com>
658
659 PR 17670
660 * symtab.cc (Symbol::set_undefined): Remove assertion.
661 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
662 on symbols defined in discarded sections, instead return false.
663 Rearrange params, update all callers.
664 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
665 branches to syms in discarded sections.
666 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
667 undefined and flag as discarded.
668 (Target_powerpc::Relocate::relocate): Localize variable.
669
4759c34e
L
6702014-12-03 H.J. Lu <hongjiu.lu@intel.com>
671
672 PR gold/17675
673 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
674 * testsuite/Makefile.in: Regenerated.
675
1f98a074
AM
6762014-12-03 Alan Modra <amodra@gmail.com>
677
678 PR 17566
679 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
680 when adding dynamic relocations against section symbols.
681
fb257835
DI
6822014-12-01 Dimitry Ivanov <dimitry@google.com>
683
684 * layout.cc (Layout::finish_dynamic_section): When '-z global'
685 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
686 * options.h (General_options): New -z option (global).
687
d8e60314
CC
6882014-12-01 Cary Coutant <ccoutant@google.com>
689
690 PR gold/17578
691 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
692 is given.
693 (Layout::create_executable_stack_info): Warn when -z noexecstack is
694 given but some inputs require executable stack.
695
982bbd97
CC
6962014-11-26 Cary Coutant <ccoutant@google.com>
697
698 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
699 .debug_str_offsets; strip .debug_gnu_pubnames and
700 .debug_gnu_pubtypes.
701 (lines_only_debug_sections): Strip all four new sections.
702
bb779192
HS
7032014-11-26 Jing Yu <jingyu@google.com>
704
705 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
706 register to be x0 when to relax TLSDESC_LD64_LO12.
707
a3e60ddb
AM
7082014-11-26 Alan Modra <amodra@gmail.com>
709
710 * powerpc.cc (struct Stub_table_owner): New.
711 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
712 unsigned int vector. Update all references.
713 (powerpc_relobj::set_stub_table): Take an unsigned int param
714 rather than a Stub_table. Update callers.
715 (Powerpc_relobj::clear_stub_table): New function.
716 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
717 stub_group_size_ vars.
718 (Target_powerpc::new_stub_table): Delete.
719 (max_branch_delta): New function, extracted from..
720 (Target_powerpc::Relocate::relocate): ..here..
721 (Target_powerpc::Branch_info::make_stub): ..and here. Return
722 status on whether stub created successfully.
723 (Stub_control::Stub_control): Add "no_size_errors" param. Move
724 default sizing to..
725 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
726 reduce on relax failure.
727 (Target_powerpc::group_sections): Add "no_size_errors" param.
728 Use stub_group_size_. Set up group info in a temp vector,
729 before building Stub_table vector. Account for input sections
730 possibly already converted to relaxed sections.
731 (Stub_table::init): Delete. Merge into..
732 (Stub_table::Stub_table): ..here.
733 (Stub_table::can_reach_stub): New function.
734 (Stub_table::add_plt_call_entry): Add "from" parameter and
735 return true iff stub could be reached.
736 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
737 param too.
738 (Stub_table::clear_stubs): Add "all" param.
739
a20605cf
AM
7402014-11-26 Alan Modra <amodra@gmail.com>
741
742 * powerpc.cc (Stub_control::set_output_and_owner): New function.
743 (Target_powerpc::group_sections): Use it.
744
43b64deb
CC
7452014-11-25 Cary Coutant <ccoutant@google.com>
746
747 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
748 (Binary_to_elf::write_symbol): Add st_size parameter.
749 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
750
c924eb67
CC
7512014-11-25 Cary Coutant <ccoutant@google.com>
752
753 PR gold/17639
754 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
755 (Sized_relobj_file::do_layout): Handle deferred sections properly
756 during GC pass 1. Don't add reloc sections to deferred list twice.
757 * object.h (Sized_relobj_file::is_deferred_layout): New function.
758 (Sized_relobj_file::is_deferred_layout_): New data member.
759
9d585188
L
7602014-11-21 H.J. Lu <hongjiu.lu@intel.com>
761
762 PR gold/17619
763 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
764 Check PC-relative offset overflow in PLT entry.
765
3ffaac20
AM
7662014-11-21 Alan Modra <amodra@gmail.com>
767
768 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
769 for undefined weaks.
770
0cfb0717
AM
7712014-11-20 Alan Modra <amodra@gmail.com>
772
773 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
774 from --stub-group-size parameter divided by 1024.
775 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
776 template parameter. Update all uses.
777 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
778 has_stub_value. Set for long branches. Don't report overflow for
779 branch to undefined weak symbols. Print info message on
780 overflowing branch to stub.
781
f9dffbf0
AM
7822014-11-20 Alan Modra <amodra@gmail.com>
783
784 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
785
e88ba8d5
L
7862014-11-13 H.J. Lu <hongjiu.lu@intel.com>
787
788 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
789 entry for R_X86_64_GOTPLT64.
790 (Target_x86_64<size>::Relocate::relocate): Update comments for
791 R_X86_64_GOTPLT64.
792
d37ffe25
ED
7932014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
794
795 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
796 * plugin.h: add lock definition
797
9726c3c1
HS
7982014-10-29 Han Shen <shenhan@google.com>
799 Jing Yu <jingyu@google.com>
800
801 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
802 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
803 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
804 Symbol::TLS_REF.
805 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
806 method.
807 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
808 (Target_aarch64::tls_ld_to_le): New method.
809 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
810 for 64bit targets.
811 (Output_data_plt_aarch64::irelative_rel_): New data member.
812 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
813 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
814 (Output_data_plt_aarch64::add_relocation): New method.
815 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
816 offset. Add got_irelative size to got size.
817 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
818 type string with the new typename.
819 (AArch64_relocate_functions::update_adr): Replace parameter x with
820 immed.
821 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
822 (AArch64_relocate_functions::reloc_common): New method.
823 (AArch64_relocate_funcsions::rela_general): Extract common part out
824 into reloc_common method.
825 (AArch64_relocate_functions::rela_general): Likewise.
826 (AArch64_relocate_functions::pcrela_general): Likewise.
827 (AArch64_relocate_functions::adr): New method.
828 (AArch64_relocate_functions::adrp): Calculate immed before calling
829 update_adr.
830 (AArch64_relocate_functions::adrp): Likewise.
831 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
832 comparing x to 0. Calculate immed from ~x when x < 0.
833 (Target_aarch64::optimize_tls_reloc): Add new cases for
834 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
835 TLSLD_MOVW_DTPREL_G0_NC.
836 (Target_aarch64::possible_function_pointer_reloc): Implement this
837 method.
838 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
839 comment.
840 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
841 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
842 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
843 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
844 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
845 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
846 (Target_aarch64::make_plt_entry): Call add_entry with two more
847 parameters.
848 (Target_aarch64::make_local_ifunc_plt_entry): New method.
849 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
850 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
851 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
852 (Target_aarch64::Relocate::relocate_tls): Add cases for
853 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
854 TLSLD_MOVW_DTPREL_G0_NC.
855 * testsuite/icf_safe_so_test.cc: Correct test comment.
856 * testsuite/icf_safe_test.sh: Add AArch64 arch.
857
80272b8c
AM
8582014-10-22 Alan Modra <amodra@gmail.com>
859
860 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
861 thread_starter.
862
998a69f4
AS
8632014-10-18 Andreas Schwab <schwab@linux-m68k.org>
864
865 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
866
aed56ec5
CC
8672014-10-17 Cary Coutant <ccoutant@google.com>
868
869 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
870 Add "typename" keyword.
871
bb779192 8722014-10-15 Han Shen <shenhan@google.com>
83a01957
HS
873 Jing Yu <jingyu@google.com>
874
875 Patch for gold aarch64 backend to support relaxation.
876 * aarch64-reloc.def: Change format.
877 * aarch64.cc (class Reloc_stub): New class.
878 (class Stub_table): New class.
879 (class AArch64_relobj): New class.
880 (class AArch64_input_section): New class.
881 (class AArch64_output_section): New class.
882 (Target_aarch64::new_stub_table): New method.
883 (Target_aarch64::new_aarch64_input_section): New method.
884 (Target_aarch64::find_aarch64_input_section): New method.
885 (Target_aarch64::scan_section_for_stubs): New method.
886 (Target_aarch64::scan_reloc_section_for_stubs): New method.
887 (Target_aarch64::relocate_stub): New method.
888 (Target_aarch64::current_target): New method.
889 (Target_aarch64::do_make_elf_object): New method.
890 (Target_aarch64::do_may_relax): New method.
891 (Target_aarch64::do_relax): New method.
892 (Target_aarch64::group_sections): New method.
893 (Target_aarch64::scan_reloc_for_stub): New method.
894 (Target_aarch64::do_make_output_section): New method.
895 (Target_aarch64::stub_tables_): New data member.
896 (Target_aarch64::aarch64_input_section_map_): New data member.
897 (AArch64_relocate_functions::maybe_apply_stub): New method.
898
db4c9594
CC
8992014-09-30 Cary Coutant <ccoutant@google.com>
900
901 PR gold/17432
902 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
903
cd6da036
KC
9042014-09-30 Kito Cheng <kito@0xlab.org>
905
906 PR gold/13597
907 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
908 hash table before sysv-style hash table.
909
5f772412
ST
9102014-09-29 Sriraman Tallam <tmsriram@google.com>
911
912 * options.h (--pic-executable): Add negative to alias to -no-pie.
913
5efeedf6
CC
9142014-09-26 Cary Coutant <ccoutant@google.com>
915
916 PR gold/16773
917 * object.cc (Sized_relobj_file): Compute value of section symbols
918 for TLS sections the same as TLS symbols.
919
1707f183
CC
9202014-09-25 Cary Coutant <ccoutant@google.com>
921
922 PR gold/17432
923 * resolve.cc (Symbol_table::resolve): Override common placeholder
924 symbols, but adjust sizes.
925 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
926 symbols to common lists.
927
00cac886
AM
9282014-09-24 Alan Modra <amodra@gmail.com>
929
930 * po/POTFILES.in: Regenerate.
931
635aa30e
CC
9322014-09-23 Taiju Tsuiki <tzik@google.com>
933 Cary Coutant <ccoutant@google.com>
934
71b9b91b 935 PR gold/14860
635aa30e
CC
936 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
937 on input_sections_blocker.
938 * layout.cc (Write_sections_task::locks): Unblock
939 input_sections_blocker_.
940 * layout.h (Write_sections_task::Write_sections_task): Add
941 input_sections_blocker.
942 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
943 to DEPENDENCIES.
944 * testsuite/Makefile.in: Regenerate.
945
c0c71592
RÁE
9462014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
947
948 * testsuite/Makefile.am (plugin_test_10): New test.
949 * testsuite/Makefile.in: Regenerate
950 * testsuite/plugin_common_test_2.c (c1): Align to 8.
951 * testsuite/plugin_test_10.sh: New file.
952
6168c2a1
RÁE
9532014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
954
955 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
956 * resolve.cc (Symbol_table::resolve): Don't override common symbols
957 during the replacement phase.
958
3a531937
JY
9592014-09-17 Han Shen <shenhan@google.com>
960 Jing Yu <jingyu@google.com>
961
962 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
963 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
964 * aarch64.cc (Target_aarch64): Add data members
965 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
966 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
967 constructor.
968 (Target_aarch64::do_reloc_symbol_index): New method.
969 (Target_aarch64::do_reloc_addend): New method.
970 (Target_aarch64::add_tlsdesc_info): New method.
971 (Target_aarch64::do_dynsym_value): New method.
972 (Target_aarch64::do_make_data_plt): Add new parameters: got,
973 got_irelative. Pass them to Output_data_plt_aarch64_standard.
974 (Target_aarch64::make_data_plt): Add new parameters: got,
975 got_irelative. Pass them to do_make_data_plt.
976 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
977 (Target_aarch64::Relocate:tls_gd_to_le): New method.
978 (Target_aarch64::Relocate:tls_ie_to_le): New method.
979 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
980 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
981 (Target_aarch64::got_tlsdesc_section): New method.
982 (Target_aarch64::make_local_ifunc_plt_entry): New method.
983 (Target_aarch64::define_tls_base_symbol): New method.
984 (Target_aarch64::reserve_tlsdesc_entries): New method.
985 (Target_aarch64::got_mod_index_entry): New method.
986 (Target_aarch64::rela_tlsdesc_section): New method.
987 (Target_aarch64::rela_irelative_section): New method.
988 (Target_aarch64::Tlsdesc_info): New struct.
989 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
990 relocations and tlsdesc relocations.
991 (Target_aarch64::optimize_tls_reloc): Implement method.
992 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
993 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
994 in constructor.
995 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
996 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
997 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
998 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
999 (Output_data_plt_aarch64::rela_tlsdesc): New method.
1000 (Output_data_plt_aarch64::rela_irelative): New method.
1001 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
1002 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
1003 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
1004 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
1005 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
1006 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
1007 (Output_data_plt_aarch64_standard): New member variables:
1008 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
1009 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
1010 New parameter: got, got_irelative.
1011 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
1012 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
1013 (Output_data_plt_aarch64::do_write): Replace got_address with
1014 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
1015 (AArch64_relocate_functions::update_movnz): New method.
1016 (AArch64_relocate_functions): Correct format.
1017 (AArch64_relocate_functions::movnz): New method.
1018 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
1019 before the switch. Add new cases to switch.
00cac886 1020 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
1021 tlsgd tlsdesc cases.
1022 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
1023 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
1024 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
1025 Call reloc_name_in_error_message to print unsupported reloc.
1026 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
1027 make_data_plt.
1028 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
1029 relocs. Fill in some more dynamic tags.
1030 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
1031 Skip call tls_get_addr when tlsgd is relaxed.
1032 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
1033 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
1034 tlsdesc->ie relaxation.
1035
62661c93
SS
10362014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1037
1038 * mips.cc (Target_mips_nacl): New class.
1039 (Target_selector_mips_nacl): New class.
1040 (target_selector_mips32): Rename from target_selector_mips32be and use
1041 Target_selector_mips_nacl instead of Target_selector_mips.
1042 (target_selector_mips32el): Rename from target_selector_mips32 and use
1043 Target_selector_mips_nacl instead of Target_selector_mips.
1044 (target_selector_mips64): Rename from target_selector_mips64be and use
1045 Target_selector_mips_nacl instead of Target_selector_mips.
1046 (target_selector_mips64el): Rename from target_selector_mips64 and use
1047 Target_selector_mips_nacl instead of Target_selector_mips.
1048 (Target_mips::mips_info): Add const attribute.
1049
54674d38
CC
10502014-09-02 Cary Coutant <ccoutant@google.com>
1051
1052 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
1053 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
1054 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
1055 (Sized_incr_dynobj::do_section_name): Likewise.
1056 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
1057 (Sized_incr_dynobj::do_section_name): Likewise.
1058 * object.h (Object::section_name): Likewise.
1059 (Object::do_section_name): Likewise.
1060 (Sized_relobj_file::do_section_name): Likewise.
1061 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
1062 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
1063
9860cbcf
CC
10642014-09-02 Cary Coutant <ccoutant@google.com>
1065
1066 PR gold/17005
1067 * ehframe.cc (Fde::write): Add output_offset parameter.
1068 (Cie::write): Likewise.
1069 (Eh_frame::set_final_data_size): Account for offset within output
1070 section.
1071 (Eh_frame::do_sized_write): Likewise.
1072 * ehframe.h (Fde::write): Add output_offset parameter.
1073 (Cie::write): Likewise.
1074 * output.cc (Output_section::Input_section_sort_entry): Remove
1075 section_has_name_; add output_section_name parameter. Use
1076 output section name for non-input sections.
1077 (Output_section::Input_section_sort_entry::section_has_name): Remove.
1078 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
1079 (Output_section::Input_section_sort_compare): Remove logic for
1080 sections without names.
1081 (Output_section::Input_section_sort_init_fini_compare): Likewise.
1082 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
1083 Likewise.
1084 (Output_section::Input_section_sort_section_name_compare): Likewise.
1085
8e33481e
HS
10862014-08-29 Han Shen <shenhan@google.com>
1087 Jing Yu <jingyu@google.com>
1088
1089 * aarch64-reloc-property.cc
1090 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
1091 reference reloc property in the table.
1092 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
1093 3 other entries.
1094 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
1095 2 new overloaded methods.
1096 (Output_data_got_aarch64::do_write): Add code to write out
1097 static relocs.
1098 (class Output_data_got_aarch64::Static_reloc): New class to wrap
1099 static relocs.
1100 (Output_data_got_aarch64::static_relocs): New vector to
1101 hold static relocs.
1102 (Target_aarch64::TCB_SIZE): New const static memeber.
1103 (Target_aarch64::tcb_size): New method.
1104 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
1105 (Target_aarch64::Relocate::relocate_tls): New method.
1106 (Target_aarch64::Scan::local): Add code handling new reloc types.
1107 (Target_aarch64::Scan::global): Add code handling new reloc types.
1108
81233653
ST
11092014-08-13 Sriraman Tallam <tmsriram@google.com>
1110
1111 * options.h (-no-pie): Add option.
1112
9363c7c3
JY
11132014-08-08 Jing Yu <jingyu@google.com>
1114 Han Shen <shenhan@google.com>
1115
1116 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
1117 (DEFFILES): add aarch64-reloc.def.
1118 (TARGETSOURCES): Add aarch64-reloc-property.cc.
1119 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
1120 * Makefile.in: Regenerate.
1121 * aarch64-reloc-property.cc: New file.
1122 * aarch64-reloc-property.h: New file.
1123 * aarch64-reloc.def: New file.
1124 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
1125 with tab to make the format consistent.
1126 (Output_data_got_aarch64::symbol_table_): New method.
1127 (Target_aarch64::do_plt_address_for_global): New method.
1128 (Target_aarch64::do_plt_address_for_local): New method.
1129 (Target_aarch64::do_select_as_default_target): New method.
1130 (Target_aarch64::do_make_data_plt): New method.
1131 (Target_aarch64::make_data_plt): New method.
1132 (Output_data_plt_aarch64::has_irelative_section): New method.
1133 (Output_data_plt_aarch64::address_for_global): New method.
1134 (Output_data_plt_aarch64::address_for_local): New method.
1135 (Output_data_plt_aarch64::irelative_rel_): New parameter.
1136 (Output_data_plt_aarch64::add_entry): Implement contents.
1137 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
1138 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
1139 the got_pov entry to plt0.
1140 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
1141 Implement contents.
1142 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
1143 (AArch64_howto): New struct.
1144 (aarch64_howto[]): New static const array.
1145 (AArch64_relocate_functions): New class.
1146 (Target_aarch64::Scan::get_reference_flags): Remove method.
1147 (Target_aarch64::Scan::local): Implement to support a few relocations.
1148 (Target_aarch64::Scan::global): Implement to support a few relocations.
1149 (Target_aarch64::make_plt_section): Implement contents.
1150 (Target_aarch64::make_plt_entry): Implement contents.
1151 (Target_aarch64::do_finalize_sections): Implement contents.
1152 (Target_aarch64::Relocate::relocate): Implement a few relocations.
1153 (Target_aarch64::relocate_section): Implement contents.
1154
ad9fe6c1
AM
11552014-08-06 Alan Modra <amodra@gmail.com>
1156
1157 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
1158
7cd4e5b7
AM
11592014-08-06 Alan Modra <amodra@gmail.com>
1160
1161 PR 13227
1162 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
1163
5ad9b0a7
ST
11642014-07-21 Sriraman Tallam <tmsriram@google.com>
1165
1166 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 1167 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 1168
e051745c
CC
11692014-07-08 Cary Coutant <ccoutant@google.com>
1170
1171 * expression.cc (struct Expression::Expression_eval_info): Add
1172 new fields type_pointer, vis_pointer, and nonvis_pointer.
1173 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
1174 nonvis_pointer parameters. Adjust all calls.
1175 (Symbol_expression::value): Update type, visibility, and nonvis bits
1176 in caller.
1177 * script.cc (Symbol_assignment::sized_finalize): Update type,
1178 visibility, and remaining st_other bits for new symbol.
1179 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
1180 vis_pointer, and nonvis_pointer parameters.
1181 * symtab.h (Symbol::set_type): New method.
1182
1183 * testsuite/Makefile.am (defsym_test): New test.
1184 * testsuite/Makefile.in: Regenerate.
1185 * testsuite/defsym_test.c: New file.
1186 * testsuite/defsym_test.sh: New file.
1187
f35c4853
CC
11882014-07-08 Cary Coutant <ccoutant@google.com>
1189
1190 PR gold/15639
1191 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
1192 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
1193 (Sized_dynobj::base_read_symbols): ...new method.
1194 * object.h (Sized_relobj_file::base_read_symbols): New method.
1195 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
1196 (Sized_relobj_file::base_read_symbols): ...new method.
1197 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
1198 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
1199 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
1200
2900af2d
AM
12012014-07-04 Alan Modra <amodra@gmail.com>
1202
1203 * po/POTFILES.in: Regenerate.
1204
053a4d68
JY
12052014-07-02 Jing Yu <jingyu@google.com>
1206
1207 * aarch64.cc: New file
1208 * Makefile.am (TARGETSOURCES): Add aarch64.cc
1209 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
1210 * Makefile.in: Regenerate.
1211 * configure.tgt: Add entries for aarch64*.
1212 * configure.ac: Likewise.
1213 * configure: Likewise.
1214
7b549045
AM
12152014-06-27 Alan Modra <amodra@gmail.com>
1216
1217 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
1218
cb818dbf
CC
12192014-06-24 Cary Coutant <ccoutant@google.com>
1220
1221 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
1222 sections.
1223 (Dwo_file::sized_read_unit_index): Likewise.
1224
9810d34d
SS
12252014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1226
1227 * mips.cc: New file.
1228 * Makefile.am (TARGETSOURCES): Add mips.cc
1229 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
1230 * configure.tgt: Add entries for mips*.
1231 * configure.ac: Likewise.
1232 * Makefile.in: Regenerate.
1233 * configure: Likewise.
1234
9baa787b
CC
12352014-06-09 Cary Coutant <ccoutant@google.com>
1236
1237 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
1238 unit_length is within section bounds.
1239
8f89af0a
CC
12402014-06-09 Cary Coutant <ccoutant@google.com>
1241
1242 PR gold/16980
1243 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
1244 map.
1245
a47622ac
AM
12462014-06-07 Alan Modra <amodra@gmail.com>
1247
1248 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
1249
4320c691
CC
12502014-06-06 Cary Coutant <ccoutant@google.com>
1251
1252 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
1253 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
1254 (Dwarf_pubnames_table::read_header): Likewise.
1255 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
1256 .debug_gnu_pubtypes.
1257
270c9937
JB
12582014-06-05 Joel Brobecker <brobecker@adacore.com>
1259
1260 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
1261 * Makefile.in, configure: Regenerate.
1262
397998fc
AM
12632014-06-03 Alan Modra <amodra@gmail.com>
1264
1265 * powerpc.cc (addis_12_2): Define.
1266 (Stub_table::do_write): Support fusion on ELFv2 stubs.
1267
61f5c66f
AM
12682014-06-03 Alan Modra <amodra@gmail.com>
1269
1270 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
1271 st_other output.
1272
f6971787
AM
12732014-06-02 Alan Modra <amodra@gmail.com>
1274
1275 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
1276 Only ignore relocs on ELFv1.
1277 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
1278
f6fb8322
CC
12792014-05-30 Cary Coutant <ccoutant@google.com>
1280
1281 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
1282 * testsuite/Makefile.in: Regenerate.
1283 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
1284
c23dd342
L
12852014-05-27 H.J. Lu <hongjiu.lu@intel.com>
1286
1287 PR gold/16945
1288 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
1289 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
1290
5fe7ffdc
AM
12912014-05-15 Alan Modra <amodra@gmail.com>
1292
1293 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
1294 Compare FDE contents with DW_CFA_nop rather than 0.
1295
a82bef93
ST
12962014-05-13 Sriraman Tallam <tmsriram@google.com>
1297
1298 * symtab.h (may_need_copy_reloc): Remove check for position independent
1299 code.
1300 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
1301 position independence before pc absolute may_need_copy_reloc call.
1302 Add check for executable output befor pc relative may_need_copy_reloc
1303 call.
1304 * i386.cc: Ditto.
1305 * arm.cc: Ditto.
1306 * sparc.cc: Ditto.
1307 * tilegx.cc: Ditto.
1308 * powerpc.cc: Add check for no position independence before
1309 may_need_copy_reloc calls.
1310 * testsuite/pie_copyrelocs_test.cc: New file.
1311 * testsuite/pie_copyrelocs_shared_test.cc: New file.
1312 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 1313 * Makefile.in: Regenerate.
a82bef93 1314
53c66605
ML
13152014-05-08 Martin Liška <mliska@suse.cz>
1316
1317 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
1318
57b2284c
CC
13192014-05-06 Cary Coutant <ccoutant@google.com>
1320
1321 PR gold/16900
1322 * i386.cc (Output_data_got_plt_i386): New class.
1323 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
1324 parameter. Change all callers.
1325 (Output_data_plt_i386::layout_): Remove.
1326 (Output_data_plt_i386::got_plt_): Change type.
1327 (Target_i386::got_plt_): Change type. Change all references.
1328 (Target_i386::got_section): Create instance of new class.
1329 (Output_data_got_plt_i386::do_write): New function.
1330 * x86_64.cc (Output_data_got_plt_x86_64): New class.
1331 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
1332 parameter. Change all callers.
1333 (Output_data_plt_x86_64::layout_): Remove.
1334 (Output_data_plt_x86_64::got_plt_): Change type.
1335 (Target_x86_64::got_plt_): Change type. Change all references.
1336 (Target_x86_64::got_section): Create instance of new class.
1337 (Output_data_got_plt_x86_64::do_write): New function.
1338 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
1339 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
1340 class.
1341
6b97515d 13422014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 1343
6b97515d
CC
1344 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
1345 if we have pubnames/pubtypes.
1346
d1bddd3c
CC
13472014-05-02 Cary Coutant <ccoutant@google.com>
1348
5fe7ffdc
AM
1349 * defstd.cc (in_segment): Define __ehdr_start here...
1350 * layout.cc (Layout::finalize): ...Instead of here. Set the
1351 output segment when known.
1352 * resolve.cc (Symbol::override_base_with_special): Remember
1353 the original binding.
1354 * symtab.cc (Symbol::set_output_segment): New function.
1355 (Symbol::set_undefined): New function.
1356 * symtab.h (Symbol::is_weak_undefined): Check original undef
1357 binding.
1358 (Symbol::is_strong_undefined): New function.
1359 (Symbol::set_output_segment): New function.
1360 (Symbol::set_undefined): New function.
1361 * target-reloc.h (is_strong_undefined): Remove.
1362 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
1363 Check for hidden undefs.
1364 (relocate_section): Call Symbol::is_strong_undefined.
1365
1366 * testsuite/Makefile.am (ehdr_start_test_1)
1367 (ehdr_start_test_2, ehdr_start_test_3)
1368 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
1369 * testsuite/Makefile.in: Regenerate.
1370 * testsuite/ehdr_start_def.cc: New source file.
1371 * testsuite/ehdr_start_test.cc: New source file.
1372 * testsuite/ehdr_start_test.t: New linker script.
1373 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 1374
7849f6d8
CC
13752014-04-23 Cary Coutant <ccoutant@google.com>
1376
bf2cc635 1377 PR gold/16870
7849f6d8
CC
1378 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
1379
99fd8cff
CC
13802014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1381
1382 * layout.cc (Layout::include_section): Allow a target to decide
1383 whether to include a section.
1384 * target.h (Target::should_include_section): New function.
1385 (Target::do_should_include_section): New function.
1386
91f43acd
CC
13872014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1388
1389 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
1390 inline into ...
1391 (Copy_relocs::emit): ... here.
1392 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
1393 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
1394 (Copy_reloc_entry::entries_): Change from private to protected.
1395
c4eb27e1
ST
13962014-04-02 Sriraman Tallam <tmsriram@google.com>
1397
1398 * icf.cc (get_section_contents): Replace copies of reloc
1399 vectors with const references.
1400
ae447ddd
CC
14012014-04-02 Cary Coutant <ccoutant@google.com>
1402
1403 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
1404 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
1405 * configure: Regenerate.
1406 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
1407 -fno-use-linker-plugin.
1408 (LINK1, CXXLINK1): Add it to the link command.
1409 * testsuite/Makefile.in: Regenerate.
1410
fa47fa92
AM
14112014-03-12 Alan Modra <amodra@gmail.com>
1412
1413 * Makefile.in: Regenerate.
1414
9b12c500
CC
14152014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1416
1417 * symtab.h (Symbol::set_nonvis): New function.
1418
beacaa96
CC
14192014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1420
1421 * symtab.cc (Sized_symbol<32>::init_output_data):
1422 Instantiate the template.
1423 (Sized_symbol<64>::init_output_data): Likewise.
1424
800d9823
CC
14252014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1426
1427 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
1428 adjust dynamic symbol value.
1429 * target.h (Target::adjust_dyn_symbol): New function.
1430 (Target::do_adjust_dyn_symbol): New function.
1431
918fc1f8 14322014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 1433
918fc1f8
CC
1434 * output.cc (Output_data_dynamic::Dynamic_entry::write):
1435 Get the value of DYNAMIC_CUSTOM dynamic entry.
1436 * output.h (Output_data_dynamic::add_custom): New function.
1437 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
1438 dynamic entry.
1439 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
1440 * target.h (Target::dynamic_tag_custom_value): New function.
1441 (Target::do_dynamic_tag_custom_value): New function.
1442
98ff9231
CC
14432014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1444
1445 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
1446 dynsym indexes.
1447 * target.h (Target::has_custom_set_dynsym_indexes): New function.
1448 (Target::do_has_custom_set_dynsym_indexes): New function.
1449 (Target::set_dynsym_indexes): New function.
1450 (Target::do_set_dynsym_indexes): New function.
1451
b80eed39
AM
14522014-03-07 Alan Modra <amodra@gmail.com>
1453
1454 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
1455 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
1456 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
1457 (Powerpc_relocate_functions::has_overflow_bitfield,
1458 overflowed): Use the above.
1459 (Target_powerpc::Relocate::relocate): Correct overflow checking
1460 for a number of relocations. Modify overflow test for 16-bit
1461 fields in instructions to signed/unsigned according to whether
1462 the field takes a signed or unsigned value.
1463
4b95cf5c
AM
14642014-03-05 Alan Modra <amodra@gmail.com>
1465
1466 Update copyright years.
1467
45965137
AM
14682014-03-05 Alan Modra <amodra@gmail.com>
1469
1470 * powerpc.cc (Target_powerpc::Scan::local, global): Support
1471 R_PPC64_ADDR64_LOCAL.
1472 (Target_powerpc::Relocate::relocate): Likewise.
1473
2c80b753
AM
14742014-03-03 Alan Modra <amodra@gmail.com>
1475
1476 * dwp.cc (print_version): Update copyright year to current.
1477
c1c69e83
AM
14782014-02-10 Alan Modra <amodra@gmail.com>
1479
1480 * po/gold.pot: Regenerate.
1481
dd0c4e70
CC
14822014-02-06 Cary Coutant <ccoutant@google.com>
1483
1484 Fix problem where -u is ignored when a weak undef is seen.
1485
1486 * archive.cc (Library_base::should_include_member): Reorder
1487 code to check for -u option if a weak undef has already been seen.
1488 * testsuite/Makefile.am (weak_undef_test_2): New test case.
1489 * testsuite/Makefile.in: Regenerate.
1490 * testsuite/weak_undef_file3.cc: New file.
1491 * testsuite/weak_undef_file4.cc: New file.
1492 * testsuite/weak_undef_test_2.cc: New file.
1493
1a221d3d
CC
14942014-02-05 Cary Coutant <ccoutant@google.com>
1495
1496 Fix issues with gold undefined symbol diagnostics.
1497
1498 PR binutils/15435
1499 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
1500 check to here.
1501 * target-reloc.h (is_strong_undefined): New function.
1502 (relocate_section): Move undef vtable symbol check from here.
1503 Check for is_strong_undefined.
1504
e889f0a4 15052014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 1506
e889f0a4
CC
1507 Fix problems with the --dynamic-list option.
1508
1509 PR gold/13577
1510 * options.cc (General_options::parse_dynamic_list):
1511 Set have_dynamic_list_.
1512 (General_options::General_options): Initialize have_dynamic_list_.
1513 (General_options::finalize): Turn off -Bsymbolic and
1514 -Bsymbolic-functions if --dynamic-list provided.
1515 * options.h (General_options::have_dynamic_list): New function.
1516 (General_options::have_dynamic_list_): New data member.
1517 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
1518 correctly.
5fe7ffdc 1519
e889f0a4
CC
1520 PR gold/16530
1521 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
1522 in --dynamic-list, mark it.
5fe7ffdc 1523
e889f0a4
CC
1524 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
1525 (dynamic_list_2): New test case.
1526 * testsuite/Makefile.in: Regenerate.
1527 * testsuite/dynamic_list_2.cc: New file.
1528 * testsuite/dynamic_list_2.t: New file.
1529 * testsuite/dynamic_list_lib1.cc: New file.
1530 * testsuite/dynamic_list_lib2.cc: New file.
1531 * testsuite/gc_dynamic_list_test.c: New file.
1532 * testsuite/gc_dynamic_list_test.sh: New file.
1533 * testsuite/gc_dynamic_list_test.t: New file.
1534
ec673e64
CC
15352014-01-28 Cary Coutant <ccoutant@google.com>
1536
1537 Add .gdb_index version 7 support.
1538
1539 * gold/dwarf_reader.cc: include <utility> (for make_pair).
1540 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
1541 debug sections.
1542 (Dwarf_ranges_table::read_ranges_table): Likewise.
1543 (Dwarf_pubnames_table::read_section): Check for GNU-style
1544 sections, and for compressed debug sections.
1545 (Dwarf_pubnames_table::read_header): Compute end address of table.
1546 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
1547 for end of list by offset, not by offset == 0.
1548 (Dwarf_info_reader::do_read_string_table): Check for compressed
1549 debug sections.
1550 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1551 Initialize new data members.
1552 (Dwarf_pubnames_table::next_name): return flag_byte.
1553 (Dwarf_pubnames_table::end_of_table_): New data member.
1554 (Dwarf_pubnames_table::is_gnu_style_): New data member.
1555 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
1556 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
1557 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
1558 read skeleton type unit DIEs.
1559 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
1560 (Gdb_index::do_write): Write flag_byte.
1561 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
1562 (Gdb_index::Cu_vector): Store flags along with cu indexes.
1563 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
1564 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
1565
221fd5d5
L
15662014-01-08 H.J. Lu <hongjiu.lu@intel.com>
1567
1568 * version.cc (print_version): Update copyright year to 2014.
1569
6c09fb0b
ILT
15702013-12-19 Dimitry Andric <dimitry@andric.com>
1571
1572 * stringpool.cc (Stringpool_template::reserve): Add
1573 HAVE_UNORDERED_MAP case.
1574 * stringpool.cc (Stringpool_template::print_stats): Likewise.
1575
8356f2d0
CC
15762013-12-18 Cary Coutant <ccoutant@google.com>
1577
1578 * configure.ac: Check for <unordered_set> and <unordered_map>.
1579 * config.in: Regenerate.
1580 * configure: Regenerate.
1581 * system.h: Use <unordered_set> and <unordered_map> if available.
1582
f2c7d7ee
RM
15832013-12-10 Roland McGrath <mcgrathr@google.com>
1584
1585 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
1586 with $(INSTALL_PROGRAM_ENV).
1587 * Makefile.in: Regenerate.
1588
6632e8cc
CC
15892013-11-22 Cary Coutant <ccoutant@google.com>
1590
1591 * configure.ac: Add check for which library is needed for
1592 dlopen.
1593 * configure: Regenerate.
1594
0c075858
CC
15952013-11-22 Cary Coutant <ccoutant@google.com>
1596
1597 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
1598 assembler.
1599 * testsuite/Makefile.in: Regenerate.
1600
f49fe902
L
16012013-11-17 H.J. Lu <hongjiu.lu@intel.com>
1602
1603 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
1604 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
1605 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
1606 (Target_x86_64<size>::Scan::local): Likewise.
1607 (Target_x86_64<size>::Scan::global): Likewise.
1608 (Target_x86_64<size>::Relocate::relocate): Likewise.
1609 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
1610 Likewise.
1611 (Target_x86_64<size>::Scan::check_non_pic(): Handle
1612 R_X86_64_PC32_BND.
1613
1614 * testsuite/Makefile.am (check_PROGRAMS): Add
1615 exception_x86_64_bnd_test.
1616 (exception_x86_64_bnd_test_SOURCES): New macro.
1617 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
1618 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
1619 (exception_x86_64_bnd_test_LDADD): Likewise.
1620 (exception_x86_64_bnd_1.o): New rule.
1621 (exception_x86_64_bnd_2.o): Likewise.
1622 * testsuite/Makefile.in: Regenerated.
1623
9055360d
AM
16242013-11-15 Alan Modra <amodra@gmail.com>
1625
1626 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
1627 accessor.
1628 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
1629 Only call ppc64_local_entry_offset for 64-bit. Restrict
1630 symval_for_branch lookup to ELFv1.
1631 (Stub_table::add_plt_call_entry): Use unsigned int off.
1632 (Output_data_glink::Address, invalid_address): New.
1633 (Output_data_glink::add_eh_frame): Move out of line. Add
1634 support for ELFv2.
1635 (Output_data_glink::add_global_entry, find_global_entry,
1636 global_entry_address): New functions.
1637 (Output_data_glink::global_entry_stubs_, end_branch_table_,
1638 ge_size): New variables.
1639 (Output_data_glink::set_final_data_size): Add global entry
1640 stub sizing.
1641 (Output_data_glink::do_write): Write global entry stubs.
1642 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
1643 parameter. Return true for ELFv2. Adjust callers.
1644 (Target_powerpc::Scan::local, global): Restrict opd lookup to
1645 ELFv1. Similarly for ifunc and dynamic relocation processing
1646 specific to ELFv1. Recognize that symbols are defined on
1647 their plt entries for ELFv2.
1648 (Target_powerpc::symval_for_branch): Assert if called for
1649 ELFv2 or ppc32.
1650 (Target_powerpc::Relocate::relocate): Use global entry plt
1651 stub for symbol value if such exists on ELFv2.
1652 (Target_powerpc::Relocate::relocate): Don't call
1653 symval_for_branch when ELFv2. Do adjust for local entry
1654 offset when ELFv2.
1655 (Target_powerpc::do_dynsym_value): Set symbols to global entry
1656 plt stub for ELFv2.
1657 (Target_powerpc::do_plt_address_for_global): Similarly.
1658
cafdd569
CC
16592013-11-14 Cary Coutant <ccoutant@google.com>
1660
1661 Revert patch -- this did not fix the problem, and there is
1662 no race there.
1663
1664 2013-11-14 Cary Coutant <ccoutant@google.com>
1665
1666 PR gold/14860
1667 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1668 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1669 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1670 updating fde_offsets_.
1671 (Eh_frame_hdr::lock_): New data member.
1672
94e49e16
CC
16732013-11-14 Cary Coutant <ccoutant@google.com>
1674
1675 * dwp.cc (Dwo_file_entry): New type.
1676 (File_list): Use Dwo_file_entry.
1677 (Dwo_file::verify): New function.
1678 (Dwo_file::verify_dwo_list): New function.
1679 (Dwo_file::sized_verify_dwo_list): New function.
1680 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
1681 list.
1682 (Dwp_options): New enum type.
1683 (dwp_options): Add --verify-only.
1684 (usage): Likewise.
1685 (main): Likewise.
1686 * dwp.h (gold_info): Add declaration.
1687
7cdd7d57
CC
16882013-11-14 Cary Coutant <ccoutant@google.com>
1689
1690 PR gold/14860
1691 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1692 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1693 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1694 updating fde_offsets_.
1695 (Eh_frame_hdr::lock_): New data member.
1696
1d946cb3
CC
16972013-11-06 Cary Coutant <ccoutant@google.com>
1698
1699 PR gold/15758
1700 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
1701 before reloc sections.
1702
4f65b40e
AM
17032013-11-04 Alan Modra <amodra@gmail.com>
1704
1705 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
1706 (Symbol::needs_dynamic_reloc): Test new flag.
1707 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
1708 (Target_powerpc::Scan::get_reference_flags): Add target param.
1709 Return FUNC_DESC_ABI for 64-bit ELFv1.
1710 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
1711 call.
1712 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
1713 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
1714
908794a9
CC
17152013-10-31 Cary Coutant <ccoutant@google.com>
1716
1717 Restore support for dwp v2 DWARF package file format.
1718
1719 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1720 tu_length parameter. Adjust all callers.
1721 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1722 * dwp.cc: Include dwarf.h.
1723 (Section_bounds): New struct type.
1724 (Unit_set): New struct type.
1725 (Dwo_file::Dwo_file): Initialize new data member.
1726 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1727 Combine and rename to...
1728 (Dwo_file::read_unit_index): ...this.
1729 (Dwo_file::sized_read_compunit_index)
1730 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1731 (Dwo_file::sized_read_unit_index): ...this.
1732 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1733 parameters; add section_id parameter.
1734 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1735 (Dwo_file::add_unit_set): ...this.
1736 (Dwo_file::shndx_map_): Remove.
1737 (Dwo_file::sect_offsets_): New data member.
1738 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1739 (Dwp_output_file::add_section): Rename to...
1740 (Dwp_output_file::add_contribution): ...this.
1741 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1742 (Dwp_output_file::add_tu_set): Likewise.
1743 (Dwp_output_file::Contribution): New type.
1744 (Dwp_output_file::Section::contributions): New data member.
1745 (Dwp_output_file::Cu_or_tu_set): Remove.
1746 (Dwp_output_file::Section::Section): New ctor.
1747 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1748 (Dwp_output_file::Dwp_index::Section_table): New type.
1749 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1750 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1751 parameter.
1752 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1753 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1754 (Dwp_output_file::Dwp_index::section_table): New member function.
1755 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1756 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1757 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1758 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1759 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1760 (Dwp_output_file::Dwp_index::section_table_): New data member.
1761 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1762 (Dwp_output_file::add_output_section): New member function.
1763 (Dwp_output_file::write_new_section): New member function.
1764 (Dwp_output_file::write_contributions): New member function.
1765 (Dwp_output_file::section_id_map_): New data member.
1766 (class Dwo_id_info_reader): Remove.
1767 (class Unit_reader): New class.
1768 (get_dwarf_section_name): New function.
1769 (Dwo_file::read_executable): Adjust initializations of class data.
1770 (Dwo_file::read): Add support for v2 package file format.
1771 (Dwo_file::read_unit_index): Likewise.
1772 (Dwo_file::sized_read_unit_index): Likewise.
1773 (Dwo_file::copy_section): Likewise.
1774 (Dwo_file::add_unit_set): Likewise.
1775 (Dwp_output_file::add_output_section): Likewise.
1776 (Dwp_output_file::add_contribution): Likewise.
1777 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1778 for empty slot.
1779 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1780 file format.
1781 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1782 slot.
1783 (Dwp_output_file::initialize): Remove unused function.
1784 (Dwp_output_file::finalize): Add support for v2 package file format.
1785 (Dwp_output_file::write_index): Likewise.
1786 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1787 function prototype.
1788
2500c017
CC
17892013-10-31 Cary Coutant <ccoutant@google.com>
1790
1791 * configure.ac: Fix check for -fmerge-constants.
1792 * configure.ac: Regenerate.
1793
dd0845d7
RM
17942013-10-30 Roland McGrath <mcgrathr@google.com>
1795
1796 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
1797 Correct 9-byte nop sequence to match what the assembler generates.
1798
b4f7960d
AM
17992013-10-30 Alan Modra <amodra@gmail.com>
1800
1801 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
1802 ppc64_local_entry_offset, ppc64_local_entry_offset,
1803 do_read_symbols): New functions.
1804 (Powerpc_relobj::e_flags_, st_other_): New vars.
1805 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
1806 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
1807 (Powerpc_relobj::e_flags_): New var.
1808 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
1809 and adjust for ELFv2.
1810 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
1811 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
1812 (Powerpc_dynobj::do_find_special_sections): Likewise.
1813 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
1814 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
1815 to ELFv2 local entry.
1816 (Target_powerpc::do_relax): No thread safe barriers needed for
1817 ELFv2.
1818 (Output_data_plt_powerpc::initial_plt_entry_size_,
1819 plt_entry_size): Delete. Replace all uses with
1820 first_plt_entry_offset() and plt_entry_size().
1821 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
1822 reserved_size parm. Update callers.
1823 (Output_data_plt_powerpc::entry_count): Update.
1824 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
1825 and use Target_powerpc::first_plt_entry_offset().
1826 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
1827 rename to plt_entry_size.
1828 (Output_data_plt_powerpc::add_ifunc_entry,
1829 add_local_ifunc_entry): Adjust reloc for ELFv2.
1830 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
1831 (glink_eh_frame_fde_64v2): New.
1832 (Stub_table::plt_call_size): Support ELFv2 sizing.
1833 (Output_data_glink::add_eh_frame): Use the new FDE.
1834 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
1835 (Stub_table::do_write): Write ELFv2 stubs and glink.
1836 (Target_powerpc::Relocate::relocate): Replaces nop after call
1837 with ld 2,24(1) and adjust local offset destination for ELFv2.
1838
f9c6b907
AM
18392013-10-30 Alan Modra <amodra@gmail.com>
1840
1841 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
1842 (Target_powerpc::Scan::global, local): Likewise.
1843 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
1844 on all ppc64 @h and @ha relocs.
1845
e84fe78f
AM
18462013-10-14 Alan Modra <amodra@gmail.com>
1847
1848 * output.h (Output_data_got::add_constant): Tidy.
1849 (Output_data_got::add_constant_pair): New function.
1850 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
1851 methods used so as to first call reserve_ent().
1852
679e4abf
RM
18532013-10-11 Roland McGrath <mcgrathr@google.com>
1854
44dcb735
RM
1855 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
1856 add_got_entry and add_got_entry_pair.
1857
13323c49
RM
1858 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
1859 (HAVE_PUBNAMES): Likewise.
1860 * configure: Regenerate.
1861
1496b446
RM
1862 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
1863 * testsuite/Makefile.in: Regenerate.
1864
cc84c10b
RM
1865 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
1866 Remove const from declaration.
1867 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
1868 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
1869 * output.h (Output_file_header): Remove const from member target_
1870 and corresponding constructor argument.
1871 * output.cc (Output_file_header::Output_file_header): Update prototype.
1872 (Output_file_header::do_sized_write): Use this->target_ in place
1873 of parameters()->target().
1874
52f66a2c
RM
1875 * testsuite/undef_symbol.cc (Foo::get_a): New method.
1876
2b64b551
RM
1877 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
1878 * configure: Regenerate.
1879 * Makefile.in: Regenerate.
1880 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
1881 * testsuite/merge_string_literals_2.c: Likewise.
1882 * testsuite/Makefile.am
1883 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
1884 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
1885 literal -fmerge-constants.
1886 * testsuite/Makefile.in: Regenerate.
1887
43819297
RM
1888 * i386.cc (Target_i386): Remove unused member dynbss_.
1889 * arm.cc (Target_arm): Likewise.
1890 * powerpc.cc (Target_powerpc): Likewise.
1891 * sparc.cc (Target_sparc): Likewise.
1892 * tilegx.cc (Target_tilegx): Likewise.
1893 * x86_64.cc (Target_x86_64): Likewise.
1894 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
1895 type_signature_, type_offset_.
1896 * plugin.h (Plugin_hook): Remove unused member layout_.
1897 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
1898 mapfile_.
1899 (Read_member): Remove unused members input_objects_, symtab_,
1900 mapfile_, layout_.
1901 (Check_library): Remove unused member symtab_.
1902 * archive.h (Lib_group): Remove unused member lib_.
1903 * archive.cc (Lib_group::Lib_group): Update initializer.
1904 * incremental.h (Incremental_binary): Remove unused member target_.
1905 (Incremental_script_entry): Removed unused member script_.
1906 * layout.h (Write_symbols_task): Remove unused member input_objects_.
1907 * icf.h (Icf): Remove unused member num_tracked_relocs.
1908
39d9ead7
RM
1909 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
1910 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
1911 its only use.
1912 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
1913
679e4abf
RM
1914 * archive.h: Use struct rather than class for forward declaration
1915 of Read_symbols_data.
1916
54de2ea6
CC
19172013-10-07 Cary Coutant <ccoutant@google.com>
1918
1919 PR gold/16010
1920 * testsuite/Makefile.am (icf_test): Fix dependencies.
1921 (icf_safe_test): Likewise.
1922 (icf_safe_so_test): Likewise.
1923 (large_symbol_alignment): Add empty _LDADD rule.
1924 * testsuite/Makefile.in: Regenerate.
1925
b14016f0
L
19262013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
1927
1928 PR gold/15927
1929 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
1930 relocation for R_X86_64_32 on x32.
1931
eb426534
RM
19322013-08-27 Roland McGrath <mcgrathr@google.com>
1933
1934 * output.cc (Output_segment::set_section_addresses): Take new
1935 Target* argument. If target->isolate_execinstr() and the segment
1936 is executable and starts at a target->abi_pagesize() boundary,
1937 pad its end out to a target->abi_pagesize() boundary with code fill.
1938 * output.h (Output_segment::set_section_addresses): Update decl.
1939 * layout.h (Layout::check_output_data_for_reset_values): Take new
1940 argument RELAX_OUTPUTS.
1941 (Layout): New member relax_output_list_.
1942 (Layout::add_relax_output): New method.
1943 * layout.cc (Layout::Layout): Update constructor.
1944 (Layout::reset_relax_output): New method.
1945 (Layout::clean_up_after_relaxation): Call it.
1946 (Layout::prepare_for_relaxation): Update caller.
1947 (Layout::set_segment_offsets): Update callers of set_section_addresses.
1948 Call reset_relax_output before re-processing segments for
1949 isolate_execinstr case.
1950 (Layout::write_data): Handle relax_output_list_.
1951 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
1952 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
1953
9aff4b7a
NC
19542013-08-23 Yuri Chornoivan <yurchor@ukr.net>
1955
1956 PR binutils/15834
1957 * object.h: Fix typos.
1958
93f8221c
RM
19592013-08-16 Roland McGrath <mcgrathr@google.com>
1960
1961 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
1962 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
1963
e44c3715
CC
19642013-08-07 Cary Coutant <ccoutant@google.com>
1965
1966 Revert support for v2 DWP files:
1967
1968 2013-03-01 Cary Coutant <ccoutant@google.com>
1969
1970 Add dwp support for v2 DWARF package file format.
1971 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1972 tu_length parameter. Adjust all callers.
1973 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1974 * dwp.cc: Include dwarf.h.
1975 (Section_bounds): New struct type.
1976 (Unit_set): New struct type.
1977 (Dwo_file::Dwo_file): Initialize new data member.
1978 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1979 Combine and rename to...
1980 (Dwo_file::read_unit_index): ...this.
1981 (Dwo_file::sized_read_compunit_index)
1982 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1983 (Dwo_file::sized_read_unit_index): ...this.
1984 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1985 parameters; add section_id parameter.
1986 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1987 (Dwo_file::add_unit_set): ...this.
1988 (Dwo_file::shndx_map_): Remove.
1989 (Dwo_file::sect_offsets_): New data member.
1990 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1991 (Dwp_output_file::add_section): Rename to...
1992 (Dwp_output_file::add_contribution): ...this.
1993 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1994 (Dwp_output_file::add_tu_set): Likewise.
1995 (Dwp_output_file::Contribution): New type.
1996 (Dwp_output_file::Section::contributions): New data member.
1997 (Dwp_output_file::Cu_or_tu_set): Remove.
1998 (Dwp_output_file::Section::Section): New ctor.
1999 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2000 (Dwp_output_file::Dwp_index::Section_table): New type.
2001 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2002 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2003 parameter.
2004 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2005 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2006 (Dwp_output_file::Dwp_index::section_table): New member function.
2007 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2008 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2009 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2010 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2011 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2012 (Dwp_output_file::Dwp_index::section_table_): New data member.
2013 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2014 (Dwp_output_file::add_output_section): New member function.
2015 (Dwp_output_file::write_new_section): New member function.
2016 (Dwp_output_file::write_contributions): New member function.
2017 (Dwp_output_file::section_id_map_): New data member.
2018 (class Dwo_id_info_reader): Remove.
2019 (class Unit_reader): New class.
2020 (get_dwarf_section_name): New function.
2021 (Dwo_file::read_executable): Adjust initializations of class data.
2022 (Dwo_file::read): Add support for v2 package file format.
2023 (Dwo_file::read_unit_index): Likewise.
2024 (Dwo_file::sized_read_unit_index): Likewise.
2025 (Dwo_file::copy_section): Likewise.
2026 (Dwo_file::add_unit_set): Likewise.
2027 (Dwp_output_file::add_output_section): Likewise.
2028 (Dwp_output_file::add_contribution): Likewise.
2029 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2030 for empty slot.
2031 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2032 file format.
2033 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2034 slot.
2035 (Dwp_output_file::initialize): Remove unused function.
2036 (Dwp_output_file::finalize): Add support for v2 package file format.
2037 (Dwp_output_file::write_index): Likewise.
2038 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2039 function prototype.
2040
c6905c28
CC
20412013-07-31 Cary Coutant <ccoutant@google.com>
2042
2043 * object.cc (Sized_relobj::do_output_section_address): New function.
2044 (Sized_relobj): Instantiate explicitly.
2045 * object.h (Object::output_section_address): New function.
2046 (Object::do_output_section_address): New function.
2047 (Sized_relobj::do_output_section_address): New function.
2048 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
2049
20502013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 2051 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
2052
2053 * parameters.cc (Parameters::entry): Return target-specific entry
2054 symbol name.
2055 * target.h (Target::entry_symbol_name): New function.
2056 (Target_info::entry_symbol_name): New data member.
2057
2058 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
2059 * i386.cc (Target_i386::i386_info): Likewise.
2060 (Target_i386_nacl::i386_nacl_info): Likewise.
2061 * sparc.cc (Target_sparc::sparc_info): Likewise.
2062 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
2063 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
2064 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
2065 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2066
234d4ab8
SA
20672013-07-22 Sterling Augustine <saugustine@google.com>
2068
2069 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
2070 Convert parameter shndx to local variable. Add parameters symtab
2071 and symtab_size. Scan over section names. Find relocation
2072 section corresponding to current section. Create and initialize
2073 reloc_mapper_ and reloc_type_.
2074 (Dwarf_pubnames_table::read_header): Add assertion. Change
2075 unit_length to off_t. Initialize member unit_length_. Fill in field
2076 cu_offset_.
2077 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2078 Initialize new fields unit_length_ and cu_offset_.
2079 (Dwarf_pubnames_table::read_section): Update prototype.
2080 (Dwarf_pubnames_table::cu_offset): New member function.
2081 (Dwarf_pubnames_table::subsection_size): Likewise.
2082 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
2083 New fields.
2084 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
2085 member functions public.
2086 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
2087 Update comment. Rework logic. Move repeated parts to...
2088 (Gdb_index_info_reader::read_pubtable): ...here. New function.
2089 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
2090 pubtypes_table_, and stmt_list_offset.
2091 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2092 Gdb_index::find_pubtype_offset,
2093 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
2094 (Gdb_index::pubnames_read): Update prototype and rework logic.
2095 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
2096 Forward declare.
2097 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2098 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
2099 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
2100 Gdb_index::map_pubtable_to_dies):
2101 Declare functions.
2102 (Gdb_index::pubnames_read): Update declaration.
2103 (Gdb_index::Pubname_offset_map): New type.
2104 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
2105 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
2106 Gdb_index::stmt_list_offset): Declare.
2107 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
2108 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
2109 Gdb_index::pubtypes_offset_): Remove.
2110
a3ed37d8
RM
21112013-07-19 Roland McGrath <mcgrathr@google.com>
2112
2113 * options.h (General_options): Add -Trodata-segment option.
2114 * parameters.cc (Parameters::check_rodata_segment): New function.
2115 (Parameters::set_target_once): Call it.
2116 * parameters.h (Parameters): Declare it (private member function).
2117 * layout.cc (load_seg_unusable_for_headers): New function, broken
2118 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
2119 then validate rodata segment rather than text segment.
2120 (relaxation_loop_body): Call that.
2121 (is_text_segment): New function. Don't admit a non-executable
2122 segment if TARGET->isolate_execinstr().
2123 (set_segment_offsets): Call it. Honor -Trodata-segment option.
2124
eb5b4ded
CC
21252013-07-15 Shawn Landden <shawnlandden@gmail.com>
2126
2127 PR gold/15070
2128 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
2129 * nacl.h (Sniff_file::View::View): Request aligned view.
2130
4d5effb9
CC
21312013-07-11 Cary Coutant <ccoutant@google.com>
2132
2133 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
2134 correct BRLT entry size.
2135
ba8ca3e7
AM
21362013-07-03 Alan Modra <amodra@gmail.com>
2137
2138 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
2139 comment.
2140
267257d2
CC
21412013-07-01 Cary Coutant <ccoutant@google.com>
2142
2143 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
2144 reloc_type_.
2145 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
2146 (Dwarf_ranges_table::lookup_reloc): New function.
2147 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
2148 reloc_type_.
2149 (Dwarf_ranges_table::lookup_reloc): New function.
2150 (Dwarf_ranges_table::reloc_type_): New data member.
2151
06f30c9d
CC
21522013-06-27 Jing Yu <jingyu@google.com>
2153
2154 PR gold/15662
2155 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
2156 function.
2157 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
2158 (Target_powerpc::do_relax): Call the above.
2159
a2d7bf59
AM
21602013-06-27 Cary Coutant <ccoutant@google.com>
2161
2162 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
2163 on garbage collected .opd section.
2164
21652013-06-27 Alan Modra <amodra@gmail.com>
2166
2167 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
2168 is non-zero.
2169 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
2170 (Target_powerpc::do_function_location): Likewise for loc->shndx.
2171
32364e50
CC
21722013-06-14 Cary Coutant <ccoutant@google.com>
2173
2174 * resolve.cc (Symbol::override_base): Don't override st_type
2175 from plugin placeholder symbols.
2176 (Symbol_table::resolve): Likewise.
2177 (Symbol_table::should_override): Don't complain about TLS mismatch
2178 if the TO symbol is a plugin placeholder.
2179 * testsuite/Makefile.am (plugin_test_tls): New test.
2180 * testsuite/Makefile.in: Regenerate.
2181 * testsuite/plugin_test_tls.sh: New test script.
2182 * testsuite/two_file_test_2_tls.cc: New test source.
2183 * testsuite/two_file_test_tls.cc: New test source.
2184
7fb47cc9
CC
21852013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
2186
2187 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
2188 the maximum segment alignment is larger than the page size.
2189 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
2190 correctly aligns the symbols with large alignemnt.
2191 * testsuite/Makefile.in: Regenerate.
2192 * testsuite/large_symbol_alignment.cc: New file.
2193
6934001a
CC
21942013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
2195 Sriraman Tallam <tmsriram@google.com>
2196
2197 * options.h (sort_section): New option.
2198 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
2199 Rename from Input_section_sort_section_name_special_ordering_compare.
2200 (Input_section_sort_section_name_compare): New struct.
2201 * output.cc (Output_section::Input_section_sort_section_name_compare::
2202 operator()): New function.
2203 (Output_section::sort_attached_input_sections): Use new sort function
2204 for .text if --sort-section=name is specified.
2205 * layout.cc (Layout::make_output_section):
2206 Add sorting by name when --sort-section=name is specified.
2207 * testsuite/Makefile.am (text_section_grouping): Test option
2208 --sort-section=name.
2209 * testsuite/Makefile.in: Regenerate.
2210 * testsuite/section_sorting_name.cc: New file.
2211 * testsuite/section_sorting_name.sh: New file.
2212
93acabad
CC
22132013-05-21 Cary Coutant <ccoutant@google.com>
2214
2215 * symtab.h (Symbol::is_cxx_vtable): New function.
2216 * target-reloc.h (relocate_section): Check for vtable symbol.
2217 * testsuite/Makefile.am (missing_key_func.sh): New test case.
2218 * testsuite/Makefile.in: Regenerate.
2219 * testsuite/missing_key_func.cc: New test source.
2220 * testsuite/missing_key_func.sh: New test script.
2221
60e8b3fc
CC
22222013-05-21 Cary Coutant <ccoutant@google.com>
2223
2b64b551
RM
2224 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
2225 type of enclosing symbol.
2226 (Relocate_info::location): Check symbol type when describing symbol.
2227 * object.h (Symbol_location_info): Remove unused line_number;
2228 add enclosing_symbol_type.
2229 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 2230
9df9de2c
CC
22312013-05-13 Cary Coutant <ccoutant@google.com>
2232
2b64b551
RM
2233 * configure.ac: Export DEFAULT_TARGET.
2234 * configure: Regenerate.
2235 * Makefile.in: Regenerate.
2236 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
2237 * testsuite/Makefile.in: Regenerate.
2238 * testsuite/debug_msg.sh: Delete duplicate tests.
2239 Don't check undef_int error message match for powerpc where the
2240 source file and line number aren't available.
9df9de2c 2241
bbc5ae17
RM
22422013-05-10 Roland McGrath <mcgrathr@google.com>
2243
2244 * options.h (General_options): Add --rosegment-gap option.
2245 * options.cc (finalize): --rosegment-gap implies --rosegment.
2246 * layout.cc (set_segment_offsets): Let user option override
2247 target->rosegment_gap().
2248
0c6e6c39
RM
22492013-05-10 Roland McGrath <mcgrathr@google.com>
2250
2251 * options.h (General_options): Remove leading space from help
2252 messages for -nostdlib and --rosegment.
2253
cde7cb01
MR
22542013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
2255
2256 PR ld/15365
2257 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
2258
f31ae5b8
AM
22592013-05-03 Alan Modra <amodra@gmail.com>
2260
2261 * merge.cc (Output_merge_string::do_add_input_section): Correct
2262 scan for number of strings. Rename vars to avoid shadowing.
2263 Include missing terminator in input_size_.
2264
d3a7cd45
L
22652013-05-01 H.J. Lu <hongjiu.lu@intel.com>
2266
2267 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
2268 Restore empty string handling.
2269
6ad3daba
CC
22702013-05-01 Cary Coutant <ccoutant@google.com>
2271
2272 * stringpool.cc (Stringpool_template::new_key_offset): Fix
2273 uninitialized warning.
2274
e31908b6
CC
22752013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
2276
2277 * output.cc (Output_section::add_merge_input_section): Allow
2278 to merge sections if the alignment is more than character size.
2279 * merge.h (Output_merge_string::Output_merge_string): Remove
2280 assert.
2281 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
2282 only not-null strings. Check the alignment of strings.
2283 * stringpool.h
2284 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
2285 alignment as the argument.
2286 (Stringpool_template<Stringpool_char>::addralign_): New class member.
2287 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
2288 Align non-zero length strings according to the addralign_.
2289 (Stringpool_template<Stringpool_char>::set_string_offsets):
2290 Updating offsets according to the given alignment.
2291 * testsuite/Makefile.am (text_section_grouping): Test if string
2292 literals are getting merged.
2293 * testsuite/Makefile.in: Regenerate.
2294 * testsuite/merge_string_literals_1.c: New file.
2295 * testsuite/merge_string_literals_2.c: Ditto.
2296 * testsuite/merge_string_literals.sh: Ditto.
2297
0e804863
ILT
22982013-04-26 Ian Lance Taylor <iant@google.com>
2299
2300 * target-reloc.h (relocate_section): If the reloc offset is out of
2301 range, pass VIEW as NULL to relocate.relocate.
2302 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
2303 * i386.cc (Target_i386::Relocate::relocate): Likewise.
2304 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
2305 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
2306 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
2307 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
2308
e7c5ea40
CC
23092013-04-26 Geoff Pike <gpike@chromium.org>
2310
2311 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
2312 * layout.cc (Hash_task): New class.
2313 (Layout::queue_build_id_tasks): New function.
2314 (Layout::write_build_id): Handle single-thread portion of build ID
2315 computation. (In some cases, all of it is single-threaded.) Replace
2316 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
2317 functionality in fewer lines of code.
2318 * layout.h (Layout::queue_build_id_tasks): New function declaration.
2319 * options.h (General_options): make "--build-id" default to tree
2320 rather than sha1. Add two new options related to --build-id=tree:
2321 --build-id-chunk-size-for-treehash and
2322 --build-id-min-file-size-for-treehash.
2323 * Makefile.am: add testing of --build-id=tree and related new options
2324 (these tests will be invoked by "make check").
2325 * Makefile.in: Regenerate.
2326
49926cd0
AM
23272013-04-25 Alan Modra <amodra@gmail.com>
2328
2329 * configure.tgt: Add powerpcle and powerpc64le.
2330
a4034750
AM
23312013-04-22 Alan Modra <amodra@gmail.com>
2332
2333 PR gold/15355
2334 * layout.cc (Layout::segment_precedes): Allow more than one
2335 segment with the same type and flags.
2336
e79c84aa
CC
23372013-04-15 Cary Coutant <ccoutant@google.com>
2338
2339 * layout.cc (Layout::set_relocatable_section_offsets): Don't
2340 allocate space in file for BSS sections.
2341
2199fbe7
CC
23422013-04-15 Cary Coutant <ccoutant@google.com>
2343
2344 * script-sections.cc (Orphan_output_section): Reset address
2345 to zero after each orphaned section for relocatable links.
2346
502e8a84
CC
23472013-04-15 Cary Coutant <ccoutant@google.com>
2348
a4034750
AM
2349 * symtab.cc (Symbol_table::sized_write_globals): Subtract
2350 section starting address for relocatable link.
2351 * testsuite/Makefile.am (script_test_11): New test.
2352 * testsuite/Makefile.in: Regenerate.
2353 * testsuite/script_test_11.c: New source file.
2354 * testsuite/script_test_11.t: New linker script.
502e8a84 2355
0cfdc767
AM
23562013-04-13 Alan Modra <amodra@gmail.com>
2357
2358 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
2359 owner when sections are not adjacent and exceed group size.
2360 (Target_powerpc::group_sections): Handle corner case.
2361 (Target_powerpc::Branch_info::make_stub): Handle case where
2362 stub table doesn't exist due to branches in non-exec sections.
2363 (Target_powerpc::Relocate::relocate): Likewise.
2364
6830ee24
AM
23652013-04-11 Alan Modra <amodra@gmail.com>
2366
2367 PR gold/15354
2368 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
2369 .branch_lt to match bfd ld. Adjust comments throughout file.
2370
54a3d865
ILT
23712013-04-04 Ian Lance Taylor <iant@google.com>
2372
2373 GCC PR c++/56840
2374 * object.cc (do_layout_deferred_sections): Handle .eh_frame
2375 sections before checking whether they are included in the link.
2376
9993ba11
ST
23772013-03-29 Sriraman Tallam <tmsriram@google.com>
2378
2379 * archive.cc (Archive::get_elf_object_for_member): Create the elf
2380 object before calling the plugin claim_file handler. Pass the elf
2381 object of the archive to the plugin. Delete the elf object if the
2382 plugin claims the file.
2383
ebacd51e
AM
23842013-03-21 Alan Modra <amodra@gmail.com>
2385
2386 * layout.cc (Layout::set_segment_offsets): Accept writable .text
2387 segment when omagic.
2388
117be58f
AM
23892013-03-21 Alan Modra <amodra@gmail.com>
2390
2391 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
2392 comparison warning.
2393 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
2394 uninitialized" warning.
2395
32e2b61d
AM
23962013-03-20 Alan Modra <amodra@gmail.com>
2397
2398 * symtab.h (Symbol::clear_version): New function.
2399 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
2400 is_needed by weak references. Clear version for symbols defined
2401 in as-needed objects that are not needed.
2402
b3ccdeb5
AM
24032013-03-15 Alan Modra <amodra@gmail.com>
2404
2405 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
2406 static and public. Add report_err param. Return false for data refs.
2407 (Target_powerpc::rela_dyn_section): New overloaded function.
2408 (Target_powerpc::plt_, iplt_): Elucidate.
2409 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
2410 (Output_data_plt_powerpc::do_write): Don't write .iplt.
2411 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
2412 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
2413 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
2414 push_branch and make_plt_entry for ifunc syms when
2415 reloc_needs_plt_for_ifunc.
2416 (Target_powerpc::Relocate::relocate): Don't use plt entry value
2417 for ifunc unless reloc_needs_plt_for_ifunc.
2418
ad3d8a2f
AM
24192013-03-15 Alan Modra <amodra@gmail.com>
2420
2421 * gc.h (gc_process_relocs): Don't look through function descriptors.
2422 * icf.cc (get_section_contents): Do so here instead.
2423
4d9aa155
AM
24242013-03-13 Alan Modra <amodra@gmail.com>
2425
2426 * powerpc.cc (is_branch_reloc): Forward declare.
2427 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
2428 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
2429 false for 64-bit, true for 32-bit non-branch relocs.
2430 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
2431 * testsuite/Makefile.am (icf_test): Use linker map file instead of
2432 nm output.
2433 (icf_safe_test): Generate linker map file as well as nm output.
2434 (icf_safe_so_test): Likewise.
2435 * testsuite/Makefile.in: Regenerate.
2436 * testsuite/icf_test.sh: Parse linker map file to determine
2437 section folding.
2438 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
2439 * testsuite/icf_safe_so_test.sh: Likewise.
2440 (X86_32_or_ARM_specific_safe_fold): Merge into..
2441 (arch_specific_safe_fold): ..this.
2442 (X86_64_specific_safe_fold): Delete unused function.
2443
57420c20
AM
24442013-03-12 Alan Modra <amodra@gmail.com>
2445
2446 * gc.h (gc_process_relocs): Look through function descriptors
2447 to determine shndx, symvalue and addend used by ICF. Tidy
2448 variable duplication.
2449
dc3714f3
AM
24502013-03-11 Alan Modra <amodra@gmail.com>
2451
2452 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
2453 * layout.cc (Layout_task_runner::run): ..to here.
2454 * symtab.h (struct Symbol_location): Extract from..
2455 (class Symbol_table): ..here.
2456 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
2457 * target.h (class Target): Add function_location and
2458 do_function_location functions.
2459 (class Sized_target): Add do_function_location.
2460 * object.h (class Sized_relobj_file): Move find_shdr..
2461 (class Object): ..to here.
2462 * object.cc: Likewise. Update to suit. Instantiate.
2463 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
2464 * powerpc.cc (class Powerpc_dynobj): New.
2465 (Target_powerpc::do_function_location): New function.
2466 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
2467 (Powerpc_dynobj::do_read_symbols): New function.
2468 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
2469
956b03bb
ILT
24702013-03-08 Ian Lance Taylor <iant@google.com>
2471
2472 * options.cc (General_options::string_to_object_format): Accept
2473 "default".
2474
4bead2d5
AM
24752013-03-08 Alan Modra <amodra@gmail.com>
2476
2477 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
2478 pointer to Post_fde.
2479 (struct Post_fde): Move definition to here..
2480 * ehframe.cc (struct Post_fde): ..from here.
2481 (Cie::write): Don't alloc Post_fde.
2482 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
2483
02e60bf7
AM
24842013-03-07 Alan Modra <amodra@gmail.com>
2485
2486 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
2487 relocation referencing .LC0.
2488 * testsuite/discard_locals_test.sh: Remove FIXMEs.
2489
8343f03a
AM
24902013-03-07 Alan Modra <amodra@gmail.com>
2491
2492 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
2493 always_inline. Add assembly for powerpc to avoid GOT.
2494
3366d57c
AM
24952013-03-07 Alan Modra <amodra@gmail.com>
2496
2497 * testsuite/script_test_10.sh: Don't test .bss section
2498 header number.
2499
6c77229c
AM
25002013-03-06 Alan Modra <amodra@gmail.com>
2501
2502 * powerpc.cc (class Powerpc_relobj): Move some member functions.
2503 (Target_powerpc::symval_for_branch): Add symtab param. Update
2504 all callers. Handle folded sections.
2505 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
2506 to Powerpc_relobj.
2507 (Global_symbol_visitor_opd::operator()): Likewise.
2508
a39e4af6
AM
25092013-03-04 Alan Modra <amodra@gmail.com>
2510
2511 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
2512 * testsuite/Makefile.in: Regenerate.
2513
d5834edb
CC
25142013-03-01 Cary Coutant <ccoutant@google.com>
2515
2516 Add dwp support for v2 DWARF package file format.
2517 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2518 tu_length parameter. Adjust all callers.
2519 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2520 * dwp.cc: Include dwarf.h.
2521 (Section_bounds): New struct type.
2522 (Unit_set): New struct type.
2523 (Dwo_file::Dwo_file): Initialize new data member.
2524 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2525 Combine and rename to...
2526 (Dwo_file::read_unit_index): ...this.
2527 (Dwo_file::sized_read_compunit_index)
2528 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2529 (Dwo_file::sized_read_unit_index): ...this.
2530 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2531 parameters; add section_id parameter.
2532 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2533 (Dwo_file::add_unit_set): ...this.
2534 (Dwo_file::shndx_map_): Remove.
2535 (Dwo_file::sect_offsets_): New data member.
2536 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2537 (Dwp_output_file::add_section): Rename to...
2538 (Dwp_output_file::add_contribution): ...this.
2539 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2540 (Dwp_output_file::add_tu_set): Likewise.
2541 (Dwp_output_file::Contribution): New type.
2542 (Dwp_output_file::Section::contributions): New data member.
2543 (Dwp_output_file::Cu_or_tu_set): Remove.
2544 (Dwp_output_file::Section::Section): New ctor.
2545 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2546 (Dwp_output_file::Dwp_index::Section_table): New type.
2547 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2548 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2549 parameter.
2550 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2551 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2552 (Dwp_output_file::Dwp_index::section_table): New member function.
2553 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2554 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2555 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2556 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2557 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2558 (Dwp_output_file::Dwp_index::section_table_): New data member.
2559 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2560 (Dwp_output_file::add_output_section): New member function.
2561 (Dwp_output_file::write_new_section): New member function.
2562 (Dwp_output_file::write_contributions): New member function.
2563 (Dwp_output_file::section_id_map_): New data member.
2564 (class Dwo_id_info_reader): Remove.
2565 (class Unit_reader): New class.
2566 (get_dwarf_section_name): New function.
2567 (Dwo_file::read_executable): Adjust initializations of class data.
2568 (Dwo_file::read): Add support for v2 package file format.
2569 (Dwo_file::read_unit_index): Likewise.
2570 (Dwo_file::sized_read_unit_index): Likewise.
2571 (Dwo_file::copy_section): Likewise.
2572 (Dwo_file::add_unit_set): Likewise.
2573 (Dwp_output_file::add_output_section): Likewise.
2574 (Dwp_output_file::add_contribution): Likewise.
2575 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2576 for empty slot.
2577 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2578 file format.
2579 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2580 slot.
2581 (Dwp_output_file::initialize): Remove unused function.
2582 (Dwp_output_file::finalize): Add support for v2 package file format.
2583 (Dwp_output_file::write_index): Likewise.
2584 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2585 function prototype.
2586
a68a081d
CC
25872013-03-01 Cary Coutant <ccoutant@google.com>
2588
2589 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
2590 function into class definition in header file.
2591 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
2592 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
2593 New function.
2594 (Dwarf_info_reader::check_buffer): Move here from .cc file.
2595
9d5781f8
AM
25962013-02-28 Alan Modra <amodra@gmail.com>
2597
2598 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
2599 * target.cc (Target::do_plt_fde_location): New function.
2600 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
2601 accessor function, and constructor param.
2602 (struct Post_fde, Post_fdes): Declare.
2603 (Cie::write): Add post_fdes param.
2604 * ehframe.cc (Fde::write): Use plt_fde_location.
2605 (struct Post_fde): Define.
2606 (Cie::write): Stash FDEs added post merge mapping.
2607 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
2608 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
2609 (Eh_frame::do_sized_write): Arrange to write post map FDES after
2610 other FDEs.
2611 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
2612 (Target_powerpc::has_glink): New function.
2613 (Target_powerpc::do_relax): Add eh_frame info for stubs.
2614 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
2615 glink_eh_frame_fde_32, default_fde): New data.
2616 (Stub_table::eh_frame_added_): New var.
2617 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
2618 Make const.
2619 (Stub_table::add_eh_frame): New function.
2620 (Output_data_glink::add_eh_frame): New function.
2621 (Target_powerpc::make_glink_section): Call add_eh_frame.
2622
214383dd
ILT
26232013-02-15 Ian Lance Taylor <iant@google.com>
2624
2625 * options.h (DEFINE_uint64_alias): Define.
2626 (class General_options): Add -Ttext-segment as an alias for
2627 -Ttext.
2628
91c2b899
AM
26292013-02-15 Alan Modra <amodra@gmail.com>
2630
2631 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
2632 (Stub_table::do_write): ..here, two places.
2633 (Stub_table::plt_call_size): Use it here too.
2634
20e2a8aa
ILT
26352013-02-11 Ian Lance Taylor <iant@google.com>
2636
2637 * descriptors.cc (Descriptors::close_all): New function.
2638 * descriptors.h (class Descriptors): Declare close_all.
2639 (close_all_descriptors): New inline function.
2640 * plugin.cc: Include "descriptors.h".
2641 (Plugin_manager::cleanup): Call close_all_descriptors.
2642
8952bc69
AM
26432013-02-06 Alan Modra <amodra@gmail.com>
2644
2645 * README: Update coding style link.
2646
29bd8b6b
CC
26472013-01-28 Cary Coutant <ccoutant@google.com>
2648
a4034750
AM
2649 * dwp.cc (File_list): New typedef.
2650 (Dwo_name_info_reader): New class.
2651 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
2652 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
2653 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
2654 (Dwo_file::read_executable): New function.
2655 (Dwo_file::read): Move common setup code to ...
2656 (Dwo_file::make_object): ... here.
2657 (dwp_options): Add --exec/-e.
2658 (usage): Likewise.
2659 (main): Likewise.
29bd8b6b 2660
c6ac678d
ST
26612013-01-24 Sriraman Tallam <tmsriram@google.com>
2662
2663 * layout.cc (Layout::layout): Check for option text_reorder.
2664 (Layout::make_output_section): Ditto.
2665 * options.h (text_reorder): New option.
2666 * output.cc (Input_section_sort_compare): Remove special ordering
2667 of section names.
2668 (Output_section::
2669 Input_section_sort_section_name_special_ordering_compare::
2670 operator()): New function.
2671 (Output_section::sort_attached_input_sections): Use new sort function
2672 for .text.
2673 * output.h (Input_section_sort_section_name_special_ordering_compare):
2674 New struct.
2675 * testsuite/Makefile.am (text_section_grouping): Test option
2676 --no-text-reorder
2677 * testsuite/Makefile.in: Regenerate.
2678 * testsuite/text_section_grouping.sh: Check order of functions without
2679 default text reordering.
2680
50701cc1
MF
26812013-01-18 Mike Frysinger <vapier@gentoo.org>
2682
2683 * options.h (General_options): Change default to true for new_dtags.
2684
b1b00fcc
MF
26852013-01-18 Mike Frysinger <vapier@gentoo.org>
2686
2687 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
2688 when enable_new_dtags is false. Only add DT_RUNPATH when
2689 enable_new_dtags is true.
2690
ec5b8187
AM
26912013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
2692
2693 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
2694 used in declaration and definition consistent.
2695 (Target_powerpc::symval_for_branch): Ditto.
2696
a880d4c4
ST
26972013-01-16 Sriraman Tallam <tmsriram@google.com>
2698
2699 * testsuite/plugin_final_layout.cc: Fix comment.
2700
7c381248
ST
27012013-01-16 Sriraman Tallam <tmsriram@google.com>
2702
2703 * layout.cc (Layout::layout): Do not do default sorting for
2704 text sections when section ordering is specified.
2705 (make_output_section): Ditto.
2706 * testsuite/plugin_final_layout.cc: Name the function sections
2707 to catch reordering issues.
2708
e2458743
AM
27092013-01-15 Alan Modra <amodra@gmail.com>
2710
2711 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
2712 plt-thread-safe.
2713
431ed302
AM
27142013-01-15 Alan Modra <amodra@gmail.com>
2715
2716 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
2717 * testsuite/Makefile.in: Regenerate.
2718
0ec6429b
AM
27192013-01-14 Alan Modra <amodra@gmail.com>
2720
2721 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
2722 * testsuite/Makefile.in: Regenerate.
2723
0bf402d5
ILT
27242013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
2725
36af3926 2726 PR bfd/14430
0bf402d5
ILT
2727 Fix mingw gold build with plugins enabled
2728 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
2729 * configure.ac: Export DLOPEN_LIBS and add headers check.
2730 * plugin.cc: Handle non-dlfcn case.
2731 * Makefile.in: Regenerate.
2732 * config.in: Regenerate.
2733 * configure: Regenerate.
2734 * testsuite/Makefile.in: Regenerate.
2735
9e9143bc
ST
27362013-01-09 Sriraman Tallam <tmsriram@google.com>
2737
2738 * output.h (sort_attached_input_sections): Change to be public.
2739 * script-sections.cc
2740 (Output_section_definition::set_section_addresses): Sort
2741 attached input sections according to section order before linker
2742 script assigns section addresses.
2743 (Orphan_output_section::set_section_addresses): Sort
2744 attached input sections according to section order before linker
2745 script assigns section addresses.
2746 * Makefile.am (final_layout.sh): Use a simple linker script to
2747 check if section ordering still works.
2748 * Makefile.in: Regenerate.
2749
679af368
ILT
27502013-01-09 Ben Cheng <bccheng@google.com>
2751
2752 * arm.cc (Target_arm::attributes_accept_div): New function.
2753 (Target_arm::attributes_forbid_div): New function.
2754 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
2755 attribute using the same new functions as what bfd/elf32_arm.c
2756 does.
2757
3136a00e
CC
27582013-01-07 Cary Coutant <ccoutant@google.com>
2759
2760 PR gold/14993
2761 * output.cc (Output_section::add_input_section): For incremental
2762 updates, don't track input sections that are allocated from patch
2763 space.
2764
f2a6224b
L
27652013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2766 Ian Lance Taylor <iant@google.com>
2767
2768 PR gold/14897
2769 * configure.ac (--enable-ld): Removed.
2770 (install_as_default): Set to yes only for --enable-gold=default
2771 or --disable-ld.
2772 * configure: Regenerated.
2773
4f46f626
L
27742013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2775
2776 * options.h (General_options): Add -fuse-ld= for GCC linker
2777 option compatibility.
2778
26e4ef59
CC
27792013-01-04 Cary Coutant <ccoutant@google.com>
2780
2781 * configure.ac: Fix typo restoring CXXFLAGS.
2782 * configure: Regenerate.
2783
3d587466
CC
27842013-01-04 Cary Coutant <ccoutant@google.com>
2785
4f46f626
L
2786 * testsuite/Makefile.am (CXXLINK_S): New macro.
2787 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
2788 * testsuite/Makefile.in: Regenerate.
3d587466 2789
44db6695
L
27902013-01-02 H.J. Lu <hongjiu.lu@intel.com>
2791
2792 * version.cc (print_version): Update copyright year to 2013.
2793
edcac0c1
ILT
27942012-12-20 Ian Lance Taylor <iant@google.com>
2795
2796 * layout.cc (Layout::special_ordering_of_input_section): New
2797 function.
2798 (Layout::layout): If input section requires special ordering, must
2799 sort input sections.
2800 (Layout::make_output_section): May sort .text input sections.
2801 (Layout::is_section_name_prefix_grouped): Remove.
2802 * layout.h (class Layout): Declare
2803 special_ordering_of_input_section. Don't declare
2804 is_section_name_prefix_grouped.
2805 * output.cc (Output_section::add_input_section): Revert last
2806 change.
2807 (Output_section::Input_section_sort::match_file_name): Don't crash
2808 if called on output section data.
2809 (Output_section::Input_section_sort_compare): Sort based on
2810 special ordering.
2811 (Output_section::Input_section_sort_section_order_index_compare):
2812 Revert last patch.
2813 (Output_section::sort_attached_input_sections): Likewise.
2814
28f2a4ac
ST
28152012-12-18 Sriraman Tallam <tmsriram@google.com>
2816
edcac0c1 2817 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
2818 * layout.h (Layout::is_section_name_prefix_grouped): New function.
2819 * output.cc (Output_section::add_input_section): Check if section
2820 name contains special prefix. Keep input sections to sort such
2821 sections.
2822 (Output_section::Input_section_sort_section_order_index_compare
2823 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
2824 (Output_section::sort_attached_input_sections): Add condition to
2825 Input_section_entry constructor call.
28f2a4ac
ST
2826 * testsuite/Makefile.am (text_section_grouping): New test.
2827 * testsuite/Makefile.in: Regenerate.
2828 * testsuite/text_section_grouping.cc: New file.
2829 * testsuite/text_section_grouping.sh: New file.
2830
5bf135a7
NC
28312012-12-17 Nick Clifton <nickc@redhat.com>
2832
2833 * Makefile.am: Add copyright notice.
2834 * NEWS: Likewise.
2835 * README: Likewise.
2836 * configure.ac: Likewise.
2837 * ftruncate.c: Likewise.
2838 * Makefile.in: Regenerate.
2839
59965708
CC
28402012-12-14 Cary Coutant <ccoutant@google.com>
2841
a4034750
AM
2842 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
2843 --no-as-needed flag.
2844 (exception_separate_shared_12_test): Likewise.
2845 (incremental_copy_test): Likewise.
2846 * testsuite/Makefile.in: Regenerate.
59965708 2847
2a77e2ab
CC
28482012-12-14 Cary Coutant <ccoutant@google.com>
2849
2850 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
2851 (Dwp_output_file::Dwp_index::enter_set): Add assert.
2852
e3deeb9c
AM
28532012-12-12 Alan Modra <amodra@gmail.com>
2854
2855 * powerpc.cc (class Track_tls): New.
2856 (class Relocate, class Scan): Inherit Track_tls.
2857 (Target_powerpc::Scan::local, global): Track tls optimization
2858 and avoid creating plt entry for __tls_get_addr if all uses
2859 are optimized away.
2860 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
2861
d8f5a274
AM
28622012-12-12 Alan Modra <amodra@gmail.com>
2863
2864 * options.h (General_options): Add --toc-sort/--no-toc-sort.
2865 Replace no_toc_optimize with toc_optimize.
2866 * output.h (Output_section::input_sections): Provide non-const variant.
2867 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
2868 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
2869 accessors.
2870 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
2871 (class Sort_toc_sections): New.
2872 (Target_powerpc::do_finalize_sections): Sort toc sections.
2873 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
2874
4c8a1de1
RM
28752012-12-10 Roland McGrath <mcgrathr@google.com>
2876
2877 * testsuite/binary_unittest.cc (read_all): New function.
2878 (Sized_binary_test): Use it instead of ::read.
2879 * fileread.cc (do_read): Don't assume pread always reads the whole
2880 amount in a single call.
2881
edc27beb
AM
28822012-12-10 Alan Modra <amodra@gmail.com>
2883
2884 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
2885 Set EM_PPC64 or EM_PPC here.
2886 (Target_selector_powerpc::do_recognize): Delete.
2887
906b9150
AM
28882012-12-10 Alan Modra <amodra@gmail.com>
2889
2890 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
2891 stub_table_.
2892 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
2893
418c15ae
RM
28942012-12-07 Roland McGrath <mcgrathr@google.com>
2895
2896 * testsuite/binary_unittest.cc (Sized_binary_test):
2897 Use open_descriptor rather than ::open.
2898
decdd3bc
AM
28992012-12-07 Alan Modra <amodra@gmail.com>
2900
2901 * powerpc.cc (Stub_table::do_write): Delete redundant Address
2902 typedef and invalid_address constant.
2903 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
2904 instantiate constants.
2905
db399005
ILT
29062012-12-06 Roland McGrath <mcgrathr@google.com>
2907
2908 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
2909 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
2910 * aclocal.m4: Regenerate.
2911 * configure: Regenerate.
2912 * Makefile.in: Regenerate.
2913 * testsuite/Makefile.in: Regenerate.
2914
aba6bc71
AM
29152012-12-07 Alan Modra <amodra@gmail.com>
2916
2917 * options.h (General_options): Add no_toc_optimize.
2918 * powerpc.cc (ok_lo_toc_insn): New function.
2919 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
2920
9e69ed50
AM
29212012-12-06 Alan Modra <amodra@gmail.com>
2922
2923 * options.h (General_options): Add plt_align, plt_static_chain,
2924 plt_thread_safe. Update stub_group_size help text.
2925 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
2926 for new plt_thread_safe_ var.
2927 (use_plt_offset): Correct comments.
2928 (Target_powerpc::do_relax): Look for thread creation symbols to
2929 determine default plt_thread_safe value. Clear plt call stubs
2930 as well as branch stubs each iteration.
2931 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
2932 insn constants.
2933 (l, hi, ha, write_insn): Move earlier.
2934 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
2935 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
2936 plt stubs too.
2937 (Stub_table::update_size): Adjust.
2938 (Stub_table::prev_size, set_prev_size): Delete.
2939 (Stub_table::stub_align): Let --plt-align affect result.
2940 (Stub_table::plt_call_size): Calculate sizes for various stubs.
2941 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
2942 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
2943 (Stub_table::do_write): Support more stub variants.
2944
f43ba157
AM
29452012-12-04 Alan Modra <amodra@gmail.com>
2946
2947 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
2948 (Target_powerpc::do_define_standard_symbols): New function.
2949
34171bc5
AM
29502012-12-03 Alan Modra <amodra@gmail.com>
2951
2952 * output.h: Formatting, whitespace.
2953
dc9589e9 29542012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
2955
2956 * layout.h (Layout::get_executable_sections): Declare.
2957 * layout.cc (Layout::get_executable_sections): New function.
2958 * arm.cc (Target_arm::group_sections): Use it.
2959 (Arm_output_section::group_sections): Delete now redundant test.
2960 * output.cc (Output_reloc::Output_reloc): Add is_relative.
2961 param to handle relative relocs.
2962 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
2963 (Output_data_reloc::add_absolute): Adjust.
2964 (Output_data_reloc::add_relative): New function.
2965 (Output_data::reset_data_size): New function.
2966 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
2967 (Output_section::set_addralign): New function.
2968 (Output_section::checkpoint_set_addralign): New function.
2969 (Output_section::clear_section_offsets_need_adjustment): New function.
2970 (Output_section::input_sections): Make public.
2971 * powerpc.cc (class Output_data_brlt_powerpc): New.
2972 (class Stub_table, class Stub_control): New.
2973 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
2974 stub_table_, set_stub_table, stub_table): New vectors and accessor
2975 functions.
2976 (Target_powerpc::do_may_relax, do_relax, push_branch,
2977 new_stub_table, stub_tables, brlt_section, group_sections,
2978 add_branch_lookup_table, find_branch_lookup_table,
2979 write_branch_lookup_table, make_brlt_section): New functions.
2980 (Target_powerpc::struct Sort_sections, class Branch_info): New.
2981 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
2982 branch_info_): New vars.
2983 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
2984 make call stubs here.
2985 (Output_data_glink): Remove all call stub handling from this class.
2986 (Target_powerpc::Scan::local, global): Save interesting branch
2987 relocs and relocs for ifunc. Adjust calls to plt entry functions.
2988 (Target_powerpc::do_finalize_sections): Only make reg save/restore
2989 functions on final link.
2990 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
2991 Handle long branch destinations too.
2992 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
2993 do_plt_address_for_local): Adjust lookup of plt call stubs.
2994
627b30b7
AM
29952012-11-30 Alan Modra <amodra@gmail.com>
2996
2997 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
2998 relocs against protected symbols when building 32-bit shared libs.
2999
40b469d7
AM
30002012-11-30 Alan Modra <amodra@gmail.com>
3001
3002 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
3003 param. Call got_section() to make .got. Update all callers
3004 and their callers and so on.
3005
bb66a627
AM
30062012-11-30 Alan Modra <amodra@gmail.com>
3007
3008 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
3009 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
3010 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
3011 value if it already exists.
3012
d2cf1c6c
L
30132012-11-19 H.J. Lu <hongjiu.lu@intel.com>
3014
3015 PR gold/14858
3016 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
3017
edccdf7c
RM
30182012-11-14 Roland McGrath <mcgrathr@google.com>
3019
3020 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
3021 than bfc instruction for data sandboxing.
3022
6febeb74
AM
30232012-11-08 Alan Modra <amodra@gmail.com>
3024
3025 * po/POTFILES.in: Regenerate.
3026
0a6f1bf2
AM
30272012-11-05 Alan Modra <amodra@gmail.com>
3028
3029 * configure.ac: Apply 2012-09-10 change to config.in here.
3030 * configure: Regenerate.
3031
26a4e9cb
AM
30322012-11-05 Alan Modra <amodra@gmail.com>
3033
3034 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
3035 (struct Opd_ent): Use "Address" rather than "Offset".
3036 (Output_data_got_powerpc::got_base_offset): Return Valtype.
3037 (Target_powerpc::got_section): Make public.
3038 (Target_powerpc::scan_relocs): Move code setting symbols..
3039 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
3040 Create _SDA_BASE_ only when referenced.
3041
cc928013
RM
30422012-11-02 Roland McGrath <mcgrathr@google.com>
3043
3044 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
3045 from last change.
3046
50ed5eb1
RM
30472012-11-01 Roland McGrath <mcgrathr@google.com>
3048
62fe925a
RM
3049 * target.h (Sized_target::relocate_relocs): Use Elf_Off
3050 for offset_in_output_section parameter.
3051 (Sized_target::relocate_special_relocatable): Likewise.
3052 * arm.cc (Target_arm::relocate_relocs): Likewise.
3053 (Target_arm::relocate_special_relocatable): Likewise.
3054 * i386.cc (Target_i386::relocate_relocs): Likewise.
3055 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
3056 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
3057 * target-reloc.h (relocate_relocs): Likewise.
3058 * testsuite/testfile.cc (Target_test): Likewise.
3059 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
3060 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
3061
3062 * system.h: Move inclusion of <clocale> to after <libintl.h> in
3063 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
3064
3065 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
3066 parameter, which is unused in the [!F_SETFD] case.
3067
50ed5eb1
RM
3068 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
3069 SYMNDX to off_t before comparing it to this->data_size().
3070 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
3071 * incremental.cc (Output_section_incremental_inputs::do_write):
3072 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
3073
2cadc0bf
RM
3074 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
3075
3bfcb652
NC
30762012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
3077
3078 * gold.cc (Target_arm::do_adjust_elf_header): Add the
3079 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
3080 in EABI_VER5.
3081
c1a8d56e
CC
30822012-10-29 Cary Coutant <ccoutant@google.com>
3083
3084 * dwp.cc (usage): Add file and exit status parameters;
3085 add --help and --version options.
3086 (print_version): New function.
3087 (main): Add --help and --version options.
3088
b2490a7b
L
30892012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3090
3091 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
3092 final_layout_sequence.txt.
3093 * testsuite/Makefile.in: Regenerated.
3094
aa543512
L
30952012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3096
3097 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
3098 COMPILE generated by automake.
3099 (LINK1): Likewise.
3100 (CXXCOMPILE1): Likewise.
3101 (CXXLINK1): Likewise.
3102 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
3103 (LINK): Likewise.
3104 (CXXCOMPILE): Likewise.
3105 (CXXLINK): Likewise.
3106 * testsuite/Makefile.in: Regenerated.
3107
d361fafb
L
31082012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3109
3110 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
3111 on bad fwrite return.
3112
598c7410
L
31132012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3114
3115 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
3116 on val.
3117
35c813e2
CC
31182012-10-23 Cary Coutant <ccoutant@google.com>
3119
3120 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
3121 * testsuite/Makefile.in: Regenerate.
3122 * testsuite/dwp_test.h: New source file.
3123 * testsuite/dwp_test_1.cc: New source file.
3124 * testsuite/dwp_test_1.s: New source file.
3125 * testsuite/dwp_test_1.sh: New source file.
3126 * testsuite/dwp_test_1b.cc: New source file.
3127 * testsuite/dwp_test_1b.s: New source file.
3128 * testsuite/dwp_test_2.cc: New source file.
3129 * testsuite/dwp_test_2.s: New source file.
3130 * testsuite/dwp_test_2.sh: New source file.
3131 * testsuite/dwp_test_main.cc: New source file.
3132 * testsuite/dwp_test_main.s: New source file.
3133
77429909
CC
31342012-10-23 Cary Coutant <ccoutant@google.com>
3135
3136 * dwp.h: New header file.
3137 * dwp.cc: New source file.
3138 * gold.h: Move shared declarations to system.h.
3139 * system.h: New header file.
3140 * Makefile.am: Add dwp.
3141 * Makefile.in: Regenerate.
3142
ed5d6712
CC
31432012-10-23 Cary Coutant <ccoutant@google.com>
3144
3145 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
3146 Dwarf_info_reader::read_from_pointer.
3147 (Dwarf_pubnames_table::read_header): Likewise.
3148 (Dwarf_pubnames_table::next_name): Likewise.
3149 (Dwarf_die::read_attributes): Likewise.
3150 (Dwarf_die::skip_attributes): Likewise.
3151 (Dwarf_info_reader::read_from_pointer): New function template.
3152 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
3153 (Dwarf_pubnames_table): Likewise.
3154 (Dwarf_info_reader::read_from_pointer): New function template.
3155 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
3156 Dwarf_pubnames_table ctor.
3157
8787852d
CC
31582012-10-23 Cary Coutant <ccoutant@google.com>
3159
3160 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
3161 abbrev_shndx.
3162 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
3163 abbrev_shndx_.
3164 (Dwarf_info_reader::set_abbrev_shndx): New method.
3165 (Dwarf_info_reader::abbrev_shndx_): New data member.
3166
9fc236f3
CC
31672012-10-23 Cary Coutant <ccoutant@google.com>
3168
3169 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
3170 from object, not parameters.
3171 (Dwarf_info_reader::parse): Likewise.
3172 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
3173 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
3174 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
3175 methods.
3176
effe8365
CC
31772012-10-23 Cary Coutant <ccoutant@google.com>
3178
3179 * fileread.cc (Input_file::Input_file): New constructor.
3180 * fileread.h (class Input_file): Add new constructor.
3181
1698990d
AM
31822012-10-18 Alan Modra <amodra@gmail.com>
3183
3184 PR gold/14727
3185 * object.cc (Relobj::is_section_name_included): Also match
3186 .sdata personality section.
3187
168a4726
AM
31882012-10-18 Alan Modra <amodra@gmail.com>
3189
3190 * target-reloc.h (class Default_comdat_behavior): New, package up..
3191 (get_comdat_behaviour): ..this.
3192 (relocate_section): Add Relocate_comdat_behavior template arg,
3193 adjust code to suit.
3194 * arm.cc (Target_arm::relocate_section): Adjust to suit.
3195 (Target_arm::scan_reloc_section): Likewise.
3196 * i386.cc (Target_i386::relocate_section): Likewise.
3197 * sparc.cc (Target_sparc::relocate_section): Likewise.
3198 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
3199 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
3200 * powerpc.cc (class Relocate_comdat_behavior): New.
3201 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
3202 gold::relocate_section with new template arg.
3203
acc276d8
AM
32042012-10-18 Alan Modra <amodra@gmail.com>
3205
3206 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
3207 dynamic relocs for GOT_TPREL got entries, without symbol if
3208 resolving locally.
3209 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
3210 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
3211 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
3212
e10f9870
AM
32132012-10-17 Alan Modra <amodra@gmail.com>
3214
3215 PR gold/14726
3216 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
3217
ae034989
ST
32182012-10-16 Sriraman Tallam <tmsriram@google.com>
3219
3220 * layout.cc (Layout::include_section): Keep sections marked
3221 SHF_EXCLUDE when doing relocatable links.
3222
f3a0ed29
AM
32232012-10-16 Alan Modra <amodra@gmail.com>
3224
3225 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
3226 (Target_powerpc::do_finalize_sections): Call it.
3227 (Output_data_save_res): New class and supporting functions.
3228 (Target_powerpc::symval_for_branch): Only look up .opd entry for
3229 normal symbols defined in object files.
3230
c6de8ed4
AM
32312012-10-12 Alan Modra <amodra@gmail.com>
3232
3233 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
3234 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
3235 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
3236 section if scan_opd_relocs not yet called.
3237 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
3238
03e25981
AM
32392012-10-12 Alan Modra <amodra@gmail.com>
3240
3241 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3242 add_local_ifunc_entry): Revert last change.
3243 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
3244
c9824451
AM
32452012-10-05 Alan Modra <amodra@gmail.com>
3246
3247 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
3248 do_plt_address_for_global): New functions.
3249 (Output_data_got_powerpc::do_write): Don't segfault when linking
3250 statically.
3251 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3252 add_local_ifunc_entry): Return true on adding entry..
3253 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
3254 glink->add_entry call. Remove unused symtab param. Adjust calls.
3255 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
3256 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
3257 set up symbols here.
3258 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
3259 syms here. Do so even when no .iplt. Don't segfault when linking
3260 statically.
3261 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
3262 new variants without reloc param.
3263 (Glink_sym_ent::Glink_sym_ent): Likewise.
3264 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
3265 reloc when refs will resolve to plt call stub.
3266 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
3267 R_PPC_PLTREL24 to resolve locally.
3268 (Target_powerpc::Scan::global): Correct ifunc handling.
3269 (Target_powerpc::Relocate::relocate): Correct local sym glink
3270 lookup. Don't destroy "value" when we have a plt call stub,
3271 and when checking plt call validity.
3272 (Target_powerpc::do_dynsym_value): Simplify.
3273
19fec8c1
AM
32742012-10-05 Alan Modra <amodra@gmail.com>
3275
3276 * i386.cc (Output_data_plt_i386::address_for_global,
3277 address_for_local): Add plt offset to returned value. Adjust uses.
3278 * sparc.cc (Output_data_plt_sparc::address_for_global,
3279 address_for_local): Likewise.
3280 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
3281 address_for_local): Likewise.
3282 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
3283 address_for_local): Likewise.
3284 * target.h (Target::plt_address_for_global, plt_address_for_local):
3285 Update comment.
3286 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
3287 (Output_data_got::Got_entry::write): Nor here.
3288 * output.h: Comment fix.
3289
e867b647
WL
32902012-10-02 Jiong Wang <jiwang@tilera.com>
3291
3292 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
3293 global_offset_table_ value for larget got.
3294 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
3295
e5d5f5ed
AM
32962012-09-29 Alan Modra <amodra@gmail.com>
3297
3298 * powerpc.cc (Target_powerpc::iplt_): New output section.
3299 (Target_powerpc::iplt_section, make_iplt_section,
3300 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
3301 (Target_powerpc::make_plt_entry): Handle ifunc syms.
3302 Target_powerpc::plt_entry_count): Count iplt entries too.
3303 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
3304 reloc section in constructor. New params.
3305 (Target_powerpc::make_plt_section): Create reloc section here instead.
3306 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
3307 functions.
3308 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
3309 (Output_data_glink::add_entry, find_entry): New functions to
3310 deal with local syms.
3311 (Glink_sym_ent): Add support for local syms.
3312 (Output_data_glink::do_write): Handle ifunc plt entries.
3313 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3314 (Target_powerpc::Scan::local, global): Handle ifunc syms.
3315 (Target_powerpc::Relocate::relocate): Likewise.
3316 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
3317
ec4dbad3
AM
33182012-09-25 Alan Modra <amodra@gmail.com>
3319
3320 * object.h (Sized_relobj_file::adjust_local_symbol,
3321 do_adjust_local_symbol): New functions.
3322 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
3323 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
3324 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
3325 and irregular opd entry spacing.
3326 (Powerpc_relobj::do_read_relocs): Add opd size checks.
3327 (Global_symbol_visitor_opd): New functor.
3328 (Target_powerpc::do_finalize_sections): Omit global symbols defined
3329 on deleted opd entries.
3330
5c0b3823
WL
33312012-09-15 Jiong Wang <jiwang@tilera.com>
3332
3333 * tilegx.cc: New file.
3334 * Makefile.am (TARGETSOURCES): Add tilegx.cc
3335 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
3336 * configure.tgt: Add entries for tilegx*.
3337 * configure.ac: Likewise.
3338 * Makefile.in: Rebuild.
3339 * configure: Likewise.
3340 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
3341 tilegx.
3342
bfdfa4cd
AM
33432012-09-13 Alan Modra <amodra@gmail.com>
3344
3345 * target-reloc.h (scan_relocs): Call scan.local for relocs
3346 against symbols in discarded sections. Pass is_discarded
3347 param.
3348 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
3349 Add is_discarded param.
3350 * powerpc (Target_powerpc::Scan::local): Likewise. Use
3351 is_discarded to flag opd entry as discarded. Don't emit dyn
3352 relocs on such entries.
3353 (Target_powerpc::Scan::global): Similarly detect and handle
3354 such opd entries.
3355 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
3356 opd_ent_. Update all uses.
3357 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
3358 (Target_powerpc::relocate_section): Zero out discarded opd
3359 entry relocs.
3360
d77a0555
ILT
33612012-09-12 Ian Lance Taylor <iant@google.com>
3362
3363 PR gold/14570
3364 * output.cc: Rename Output_data_got template parameter from size
3365 to got_size for all functions. Compile all variants of
3366 Output_data_got.
3367 (Output_data_got::Got_entry::write): Correct use of size for
3368 symbol value. Use local_is_tls rather than casting to
3369 Sized_relobj_file.
3370 * object.h (class Object): Add local_is_tls and do_local_is_tls.
3371 (class Sized_relobj_file): Add do_local_is_tls.
3372 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
3373
815a1205
AM
33742012-09-11 Alan Modra <amodra@gmail.com>
3375
3376 PR gold/14566
3377 * layout.cc (Layout::set_segment_offsets): When using
3378 common-page-size alignment, ensure we are on a new max-page-size
3379 page.
3380 * output.cc (Output_segment::set_section_addresses): Use
3381 abi_pagesize, not common_pagesize for relro boundary.
3382 (Output_segment::set_offset): Likewise.
3383
bd73a62d
AM
33842012-09-11 Alan Modra <amodra@gmail.com>
3385
3386 * output.h (Output_data_got::add_global_tls, add_local_tls,
3387 add_local_tls_pair): New functions.
3388 (Output_data_got::add_local_pair_with_rel): Remove second
3389 reloc param. Expand comment.
3390 (Output_data_got::Got_entry): Rename use_plt_offset_ to
3391 use_plt_or_tls_offset_, similarly for constructor param.
3392 (Output_data_got::Got_entry::write): Add got_index param.
3393 * output.cc (Output_data_got::add_global_tls, add_local_tls,
3394 add_local_tls_pair): New functions.
3395 (Output_data_got::Got_entry::write): Handle tls symbols
3396 with use_plt_or_tls_offset_ set specially.
3397 (Output_data_got::add_local_pair_with_rel): Only one reloc.
3398 (Output_data_got::do_write): Replace iterator with index, pass
3399 index to entry write function.
3400 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
3401 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
3402 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
3403 call.
3404 * i386.cc (Target_i386::Scan::local): Likewise.
3405 * sparc.cc (Target_sparc::Scan::local): Likewise.
3406 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
3407 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
3408 do_tls_offset_for_global): New functions.
3409 (Target_powerpc::Scan::local): Correct TLS relocations and got
3410 entry values.
3411 (Target_powerpc::Scan::global): Don't emit unnecessary
3412 dynamic relocations on TLS GOT entries.
3413
00716ab1
AM
34142012-09-10 Matthias Klose <doko@ubuntu.com>
3415
3416 * config.in: Disable sanity check for kfreebsd.
3417
c891b3f9
SA
34182012-09-10 Sterling Augustine <saugustine@google.com>
3419
3420 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
3421 (Gdb_index::pubtypes_read): New parameter.
3422 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
3423 to calls.
3424 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
3425 pubtypes_object_.
3426
e81fea4d
AM
34272012-09-09 Alan Modra <amodra@gmail.com>
3428
3429 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
3430 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
3431 * gc.h (gc_process_relocs): Call target gc_add_reference.
3432 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
3433 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
3434 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
3435 unnecessary cast.
3436 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
3437 to cater for when we don't need code offset. Update use.
3438 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
3439 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
3440 set_opd_valid): New functions.
3441 (Target_powerpc::do_gc_add_reference): New function.
3442 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
3443 stashed refs.
3444 (Target_powerpc::do_gc_mark_symbol): New function.
3445
d2d60eef
CC
34462012-09-06 Cary Coutant <ccoutant@google.com>
3447
3448 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
3449 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
3450 (Dwarf_die::skip_attributes): Likewise.
3451 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
3452 * testsuite/gdb_index_test.cc (inline_func_1): New function.
3453 (main): Call it.
3454 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
3455
32ed4573
L
34562012-09-05 H.J. Lu <hongjiu.lu@intel.com>
3457
3458 * testsuite/script_test_3.t: Add .got.plt output section
3459 statement.
3460 * testsuite/script_test_4.t: Likewise.
3461
f4baf0d4
AM
34622012-09-05 Alan Modra <amodra@gmail.com>
3463
3464 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
3465 update all uses and lose "enum" when using type.
3466
864a1b56
AM
34672012-09-05 Alan Modra <amodra@gmail.com>
3468
3469 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
3470 * configure: Regenerate.
3471 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
3472 (plugin_final_layout.stdout): Likewise.
3473 (memory_test): Set page sizes to 0x1000.
3474 * testsuite/Makefile.in: Regenerate.
3475 * testsuite/discard_locals_test.sh: Add FIXME comment.
3476 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
3477 * testsuite/pr14265.t: Add .got output section statement.
3478 * testsuite/script_test_2.t: Likewise.
3479 * testsuite/script_test_3.t: Likewise.
3480 * testsuite/script_test_4.t: Likewise.
3481 * testsuite/script_test_5.t: Likewise.
3482 * testsuite/script_test_6.t: Likewise.
3483 * testsuite/script_test_7.t: Likewise.
3484 * testsuite/script_test_9.t: Likewise.
3485
3ea0a085
AM
34862012-09-05 Alan Modra <amodra@gmail.com>
3487
3488 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
3489 (Powerpc_relocate_functions::Status): New typedef.
3490 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3491 (Target_powerpc::Scan::local): Handle REL64.
3492 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
3493 for REL32 and REL64.
3494 (Target_powerpc::symval_for_branch): New function, extracted from..
3495 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
3496 checks. Report overflow errors.
3497
7404fe1b
AM
34982012-09-05 Alan Modra <amodra@gmail.com>
3499
3500 * object.h (Sized_relobj_file::emit_relocs): Delete.
3501 (Sized_relobj_file::emit_relocs_reltype): Delete.
3502 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
3503 relocate_relocs for --emit-relocs.
3504 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
3505 * output.h: Update comment.
3506 (Output_segment::first_section): New function.
3507 (Output_segment::first_section_load_address): Use first_section.
3508 * output.cc (Output_segment::first_section): New function extracted..
3509 (Output_segment::first_section_load_address): ..from here. Delete.
3510 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
3511 * target.h (Sized_target::relocate_for_relocatable): Likewise.
3512 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
3513 adjust call to target.h function.
3514 * i386.cc (Target_i386): Likewise.
3515 * sparc.cc (Target_sparc): Likewise.
3516 * x86_64.cc (Target_x86_64): Likewise.
3517 * powerpc.cc (Target_powerpc): Likewise.
3518 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
3519 first tls section has section symbol for optimised local dynamic
3520 output relocs.
3521 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
3522 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
3523 optimised tls code.
3524 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
3525 Rename to relocate_relocs. Update error message.
3526
957564c9
AS
35272012-09-04 Andreas Schwab <schwab@linux-m68k.org>
3528
3529 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
3530 --just-symbols.
3531
dd93cd0a
AM
35322012-08-31 Alan Modra <amodra@gmail.com>
3533
3534 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
3535 (Powerpc_relobj::toc_base_offset): New stub function.
3536 (Target_powerpc): Add tp_offset, dtp_offset. Rename
3537 got_mod_index_offset to tlsld_got_offset. Update all refs.
3538 (Target_powerpc::Relocate::enum skip_tls): New.
3539 (Target_powerpc::call_tls_get_addr_): New var.
3540 (Target_powerpc::is_branch_reloc): Move to file scope.
3541 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
3542 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
3543 New functions.
3544 (Target_powerpc::enum Got_type): Delete old values, add new ones.
3545 (powerpc_info): Correct common_pagesize for ppc64.
3546 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
3547 (Powerpc_relocate_functions): Add overflow check enums and functions.
3548 Add non-shift version of rela, rela_ua. Delete all rel public
3549 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
3550 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
3551 addr16_ha3, addr14 functions.
3552 (Output_data_got_powerpc::add_constant_pair): New function.
3553 (Output_data_got_powerpc::got_base_offset): Likewise.
3554 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
3555 (instruction constants): Sort, add some more.
3556 (Output_data_glink::do_write): Add and use Address typedef. Use
3557 object->toc_base_offset() stub for 64-bit.
3558 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
3559 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3560 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
3561 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
3562 Always treat .opd relocs as against locally defined symbol.
3563 Correct condition for RELATIVE relocs.
3564 (Target_powerpc::do_finalize_sections): Test for NULL sections.
3565 (Target_powerpc::Relocate::relocate): Use plt call stub as value
3566 for 32-bit syms with a plt entry. Correct ppc64 toc base
3567 calculations. Handle TLS relocs, and more. Add overflow
3568 checking and adjust for Powerpc_relocate_functions changes.
3569 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
3570 Reinstate --emit-relocs code with FIXME.
3571
a1373b60
AM
35722012-08-30 Alan Modra <amodra@gmail.com>
3573
3574 * layout.cc (Layout::set_segment_offsets): Set p_align to
3575 abi_pagesize, not common_pagesize.
3576 (Layout::relaxation_loop_body): Similarly use abi_pagesize
3577 to determine whether file header can go in segment.
3578
703d02da
AM
35792012-08-30 Alan Modra <amodra@gmail.com>
3580
3581 * output.h (Output_reloc::Output_reloc <output section>): Add
3582 is_relative param. Adjust calls.
3583 (Output_reloc::add_output_section_relative): New functions.
3584 * output.cc (Output_reloc::Output_reloc <output section>): Handle
3585 is_relative.
3586 (Output_reloc::symbol_value): Handle SECTION_CODE.
3587
16164a6b
ST
35882012-08-24 Sriraman Tallam <tmsriram@google.com>
3589
3590 * gold.cc (queue_middle_tasks): Call layout again when unique
3591 segments for sections is desired.
3592 * layout.cc (Layout::Layout): Initialize new members.
3593 (Layout::get_output_section_flags): New function.
3594 (Layout::choose_output_section): Call get_output_section_flags.
3595 (Layout::layout): Make output section for mapping to a unique segment.
3596 (Layout::insert_section_segment_map): New function.
3597 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 3598 output sections marked so.
16164a6b
ST
3599 (Layout::segment_precedes): Check for unique segments when sorting.
3600 * layout.h (Layout::Unique_segment_info): New struct.
3601 (Layout::Section_segment_map): New typedef.
3602 (Layout::insert_section_segment_map): New function.
3603 (Layout::get_output_section_flags): New function.
3604 (Layout::is_unique_segment_for_sections_specified): New function.
3605 (Layout::set_unique_segment_for_sections_specified): New function.
3606 (Layout::unique_segment_for_sections_specified_): New member.
3607 (Layout::section_segment_map_): New member.
3608 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
3609 Rename is_gc_pass_one to is_pass_one.
3610 Rename is_gc_pass_two to is_pass_two.
3611 Rename is_gc_or_icf to is_two_pass.
3612 Check for which pass based on whether symbols data is present.
3613 Make it two pass when unique segments for sections is desired.
3614 * output.cc (Output_section::Output_section): Initialize new
3615 members.
3616 * output.h (Output_section::is_unique_segment): New function.
3617 (Output_section::set_is_unique_segment): New function.
3618 (Output_section::is_unique_segment_): New member.
3619 (Output_section::extra_segment_flags): New function.
3620 (Output_section::set_extra_segment_flags): New function.
3621 (Output_section::extra_segment_flags_): New member.
3622 (Output_section::segment_alignment): New function.
3623 (Output_section::set_segment_alignment): New function.
3624 (Output_section::segment_alignment_): New member.
3625 (Output_segment::Output_segment): Initialize is_unique_segment_.
3626 (Output_segment::is_unique_segment): New function.
3627 (Output_segment::set_is_unique_segment): New function.
3628 (Output_segment::is_unique_segment_): New member.
3629 * plugin.cc (allow_unique_segment_for_sections): New function.
3630 (unique_segment_for_sections): New function.
3631 (Plugin::load): Add new functions to transfer vector.
3632 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
3633 * Makefile.in: Regenerate.
3634 * testsuite/plugin_final_layout.sh: Check if unique segment
3635 functionality works.
3636 * testsuite/plugin_section_order.c (onload): Check if new interfaces
3637 are available.
3638 (allow_unique_segment_for_sections): New global.
3639 (unique_segment_for_sections): New global.
3640 (claim_file_hook): Call allow_unique_segment_for_sections.
3641 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 3642
1e2bee4f
CC
36432012-08-22 Cary Coutant <ccoutant@google.com>
3644
3645 * layout.cc (Layout::include_section): Don't assert on GROUP
3646 sections with --emit-relocs.
3647
1d5dfe78
CC
36482012-08-21 Cary Coutant <ccoutant@google.com>
3649
3650 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
3651 if --export-dynamic-symbol names an undef symbol.
3652
c9269dff
AM
36532012-08-18 Alan Modra <amodra@gmail.com>
3654
3655 * powerpc.cc: Formatting and white space.
3656 (Powerpc_relobj): Rename got2_section_ to special_.
3657 Add opd_ent_shndx_ and opd_ent_off_ vectors.
3658 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
3659 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
3660 (Target_powerpc): Add Address typedef and invalid_address. Use
3661 throughout.
3662 (Target_powerpc::is_branch_reloc): New function.
3663 (Powerpc_relocate_functions): Add Address typedef, use throughout.
3664 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
3665 for dst_mask, value and addend.
3666 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
3667 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
3668 (Output_data_glink::do_write): Correct toc base. Don't try to use
3669 uint16_t for 24-bit offset. Use get_output_section_offset and
3670 check return.
3671 (Target_powerpc::Scan::local): Handle more relocs.
3672 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
3673 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
3674 Plug in toc restoring insn after plt calls. Translate branches
3675 to function descriptor symbols to corresponding entry point.
3676 (Target_powerpc::relocate_for_relocatable): Check return from
3677 get_output_section_offset.
3678 * symtab.h: Comment typo.
3679
b1759dce
ILT
36802012-08-14 Ian Lance Taylor <iant@google.com>
3681
3682 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
3683 unsupported_relocal_local to call unsupported_reloc_global.
3684
b9b2ae8b
NC
36852012-08-14 Nick Clifton <nickc@redhat.com>
3686
3687 PR ld/14265
3688 * script-sections.cc (Sections_element::output_section_name): Add
3689 keep return parameter.
3690 (Output_section_element::match_name): Add keep return parameter.
3691 Return the value of the keep_ member.
3692 * script-sections.h (class Output_section): Update
3693 output_section_name prototype.
3694 * layout.cc (Layout::keep_input_section): New public member
3695 function.
3696 (Layout::choose_output_section): Pass keep parameter to
3697 output_section_name.
3698 * layout.h (class Layout): Add keep_input_section.
3699 * object.cc (Sized_relobj_file::do_layout): Check for kept input
3700 sections.
3701 * testsuite/Makefile.am: Add a test.
3702 * testsuite/Makefile.in: Regenerate.
3703 * testsuite/pr14265.c: Source file for the test.
3704 * testsuite/pr14265.t: Linker script for the test.
3705 * testsuite/pr14265.sh: Shell script for the test.
3706
921b5322
AM
37072012-08-14 Alan Modra <amodra@gmail.com>
3708
3709 * target.h (Target::output_section_name): New function.
3710 (Target::do_output_section_name): New function.
3711 * layout.cc (Layout::choose_output_section): Call the above.
3712 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
3713
6ce78956
AM
37142012-08-14 Alan Modra <amodra@gmail.com>
3715
3716 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
3717 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
3718 for replace_constant call.
3719 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
3720 (Output_data_glink::do_print_to_mapfile): New function.
3721 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
3722 (Target_powerpc::Relocate::relocate): Likewise.
3723
d1a8cabd
AM
37242012-08-14 Alan Modra <amodra@gmail.com>
3725
3726 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
3727 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
3728 (Output_data_glink::add_entry,find_entry): Remove shndx param.
3729 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
3730 all references to shndx_. Handle special case for R_PPC_PLTREL24
3731 here.
3732 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
3733 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
3734 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
3735 here.
3736 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
3737 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
3738
d83ce4e3
AM
37392012-08-12 Alan Modra <amodra@gmail.com>
3740
3741 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
3742 (glink insn constants): Use uint32_t.
3743 (Output_data_glink::add_entry): Use insert, not [] operator.
3744
cf43a2fe
AM
37452012-08-11 Alan Modra <amodra@gmail.com>
3746
3747 * object.h (Sized_relobj_file::find_shdr): New function.
3748 (Sized_relobj_file::find_special_sections): New function.
3749 * object.cc (Sized_relobj_file::find_shdr): New function.
3750 (Sized_relobj_file::find_eh_frame): Use find_shdr.
3751 (Sized_relobj_file::find_special_sections): New function, split out..
3752 (Sized_relobj_file::do_read_symbols): ..from here.
3753 * output.h (Output_data_got::replace_constant): New function.
3754 (Output_data_got::num_entries): New function.
3755 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
3756 (Output_data_got::got_offset): Protected rather than private.
3757 (Output_data_got::replace_got_entry): New function.
3758 * output.cc (Output_data_got::replace_got_entry): New function.
3759 * powerpc.cc (class Powerpc_relobj): New.
3760 (class Powerpc_relocate_functions): Delete all psymval variants or
3761 convert to value,addend type. Delete pcrela, pcrela_unaligned.
3762 Implement _ha functions using corresponding _hi function.
3763 (Powerpc_relobj::find_special_sections): New function.
3764 (Target_powerpc::do_make_elf_object): New function.
3765 (class Output_data_got_powerpc): New.
3766 (class Output_data_glink): New.
3767 (class Powerpc_scan_relocatable_reloc): New.
3768 Many more changes througout file.
3769
3c892704
NC
37702012-08-09 Nick Clifton <nickc@redhat.com>
3771
3772 * po/vi.po: Updated Vietnamese translation.
3773
82435b3b
ILT
37742012-08-07 Ian Lance Taylor <iant@google.com>
3775
3776 * layout.cc (Layout::add_target_dynamic_tags): If
3777 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
3778 plt_rel.
3779
a6dc81d2
NC
37802012-07-30 Nick Clifton <nickc@redhat.com>
3781
3782 * po/gold.pot: Updated template.
3783 * po/es.po: Updated Spanish translation.
3784
f1415016
CC
37852012-07-18 Cary Coutant <ccoutant@google.com>
3786
3787 PR gold/14344
3788 * configure.ac: Add check for -gpubnames support.
3789 * configure: Regenerate.
3790 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
3791 support; force -gno-pubnames.
3792 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
3793 support.
3794 (gdb_index_test_4): New test.
3795 * testsuite/Makefile.in: Regenerate.
3796 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
3797 * testsuite/gdb_index_test_2.sh: Likewise.
3798 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
3799 * testsuite/gdb_index_test_4.sh: New script.
3800 * testsuite/gdb_index_test_comm.sh: New script with common code;
3801 don't look for space after colon.
3802
b7fd7c37
ST
38032012-07-16 Sriraman Tallam <tmsriram@google.com>
3804
3805 * gold.cc (queue_middle_tasks): Update function order only after
3806 deferred objects due to plugins are processed.
3807
1f3212db
ILT
38082012-07-11 Ian Lance Taylor <iant@google.com>
3809
3810 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
3811 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
3812 (Target_arm::scan_reloc_for_stub): Likewise.
3813 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
3814 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
3815 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
3816 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
3817 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
3818
81c82a68
ILT
38192012-07-10 Dodji Seketeli <dodji@redhat.com>
3820 Ian Lance Taylor <iant@google.com>
3821
3822 PR gold/14309
3823 * configure.ac: Test whether std::tr1::hash<off_t> works.
3824 * gold.h: Add a specialization for std::tr1::hash<off_t> if
3825 needed.
3826 * output.h (class Output_fill): Add virtual destructor.
3827 * configure, config.in: Rebuild.
3828
eabc84f4
RM
38292012-06-22 Roland McGrath <mcgrathr@google.com>
3830
3831 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
3832
370e30b6
RÁE
38332012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
3834
3835 * plugin.cc (Plugin::load): Handle position independent executables.
3836
fb1b895d
CC
38372012-06-06 Cary Coutant <ccoutant@google.com>
3838
3839 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
3840 add .debug_macro.
3841 (lines_only_debug_sections): Likewise.
3842 (gdb_fast_lookup_sections): New static array.
3843 (is_gdb_debug_section): Rename formal parameter.
3844 (is_lines_only_debug_section): Likewise.
3845 (is_gdb_fast_lookup_section): New function.
3846 (Layout::include_section): Check for ".zdebug_" prefix; pass
3847 section name suffix to is_gdb_debug_section, et al.; check for
3848 fast-lookup sections when building .gdb_index.
3849 * options.h (--strip-debug-gdb): Update GDB version number.
3850
7c0640fa
CC
38512012-06-06 Cary Coutant <ccoutant@google.com>
3852
3853 * configure.ac: Add check for fallocate.
3854 * configure: Regenerate.
3855 * config.in: Regenerate.
3856
3857 * options.h (class General_options): Add --mmap-output-file and
3858 --posix-fallocate options.
3859 * output.cc: (posix_fallocate): Remove; replace with...
3860 (gold_fallocate): New function.
3861 (Output_file::map_no_anonymous): Call gold_fallocate.
3862 (Output_file::map): Check --mmap-output-file option.
3863
2a49eb69
DK
38642012-06-05 Jing Yu <jingyu@google.com>
3865
3866 * gold.h (textdomain): Add do {} to empty while(0).
3867 (bindtextdomain): Likewise.
3868
fad072ac
CC
38692012-06-04 Cary Coutant <ccoutant@google.com>
3870
3871 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
3872 has_dynsym_index.
3873
8cc69fb6
ST
38742012-05-25 Sriraman Tallam <tmsriram@google.com>
3875
3876 * symtab.cc (Symbol_table::define_special_symbol):
3877 Initialize *poldsym to prevent uninitialized variable errors.
3878
1be75daa
CC
38792012-05-23 Cary Coutant <ccoutant@google.com>
3880
3881 * layout.cc (Layout::section_name_mapping): Add rules to handle
3882 exact match on .data.rel.ro.local or .data.rel.ro.
3883 (Layout::output_section_name): Check for exact matches.
3884
9b689de0
CC
38852012-05-23 Cary Coutant <ccoutant@google.com>
3886
3887 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
3888 more carefully.
3889
b24fdbf5
CC
38902012-05-22 Cary Coutant <ccoutant@google.com>
3891
3892 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
3893 object before exporting symbol.
3894
e550e1a2
L
38952012-05-21 H.J. Lu <hongjiu.lu@intel.com>
3896
3897 * testsuite/tls_test.cc: Include "config.h" first.
3898 * testsuite/tls_test_c.c: Likewise.
3899
df7b86aa
NC
39002012-05-17 Daniel Richard G. <skunk@iskunk.org>
3901 Nick Clifton <nickc@redhat.com>
3902
3903 PR 14072
3904 * configure.in: Add check that sysdep.h has been included before
3905 any system header files.
3906 * configure: Regenerate.
3907 * config.in: Regenerate.
3908
1007b503
CC
39092012-05-14 Cary Coutant <ccoutant@google.com>
3910
3911 * layout.cc (Layout::make_output_section): Mark .tdata section
3912 as RELRO.
3913 * testsuite/relro_test.cc: Add a TLS variable.
3914
fd885f3a
L
39152012-05-10 H.J. Lu <hongjiu.lu@intel.com>
3916
3917 PR gold/14091
3918 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
3919 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
3920 R_X86_64_64.
3921
80f5885c
CC
39222012-05-08 Cary Coutant <ccoutant@google.com>
3923
3924 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
3925 (lines_only_debug_sections): Likewise.
3926
2e702c99
RM
39272012-05-02 Roland McGrath <mcgrathr@google.com>
3928
3929 * nacl.cc: New file.
3930 * nacl.h: New file.
3931 * Makefile.am (CCFILES, HFILES): Add them.
3932 * Makefile.in: Regenerate.
3933 * i386.cc (Output_data_plt_i386_nacl): New class.
3934 (Output_data_plt_i386_nacl_exec): New class.
3935 (Output_data_plt_i386_nacl_dyn): New class.
3936 (Target_i386_nacl): New class.
3937 (Target_selector_i386_nacl): New class.
3938 (target_selector_i386): Use it instead of Target_selector_i386.
3939 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
3940 (Target_x86_64_nacl): New class.
3941 (Target_selector_x86_64_nacl): New class.
3942 (target_selector_x86_64, target_selector_x32): Use it instead of
3943 Target_selector_x86_64.
3944 * arm.cc (Output_data_plt_arm_nacl): New class.
3945 (Target_arm_nacl): New class.
3946 (Target_selector_arm_nacl): New class.
3947 (target_selector_arm, target_selector_armbe): Use it instead of
3948 Target_selector_arm.
3949
3950 * target-select.cc (select_target): Take new Input_file* and off_t
3951 arguments, pass them on to recognize method of selector.
3952 * object.cc (make_elf_sized_object): Update caller.
3953 * parameters.cc (parameters_force_valid_target): Likewise.
3954 * incremental.cc (make_sized_incremental_binary): Likewise.
3955 * target-select.h: Update decl.
3956 (Target_selector::recognize): Take new Input_file* argument,
3957 pass it on to do_recognize.
3958 (Target_selector::do_recognize): Take new Input_file* argument.
3959 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
3960 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
3961 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
3962 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
3963
3964 * target.h (Target::Target_info): New members isolate_execinstr
3965 and rosegment_gap.
3966 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
3967 * arm.cc (Target_arm::arm_info): Update initializer.
3968 * i386.cc (Target_i386::i386_info): Likewise.
3969 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
3970 * sparc.cc (Target_sparc::sparc_info): Likewise.
3971 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
3972 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3973 * layout.cc (Layout::attach_allocated_section_to_segment):
3974 Take new const Target* argument. If target->isolate_execinstr(), act
3975 like --rosegment.
3976 (Layout::find_first_load_seg): Take new const Target* argument;
3977 if target->isolate_execinstr(), reject PF_X segments.
3978 (Layout::relaxation_loop_body): Update caller.
3979 (Layout::set_segment_offsets): If target->isolate_execinstr(),
3980 reset file offset to zero when we hit LOAD_SEG, and then do a second
3981 loop over the segments before LOAD_SEG to reassign offsets after
3982 addresses have been determined. Handle target->rosegment_gap().
3983 (Layout::attach_section_to_segment): Take new const Target* argument;
3984 pass it to attach_allocated_section_to_segment.
3985 (Layout::make_output_section): Update caller.
3986 (Layout::attach_sections_to_segments): Take new const Target* argument;
3987 pass it to attach_section_to_segment.
3988 * gold.cc (queue_middle_tasks): Update caller.
3989 * layout.h (Layout): Update method decls with new arguments.
3990
3991 * arm.cc (Target_arm::Target_arm): Take optional argument for the
3992 Target_info pointer to use.
3993 (Target_arm::do_make_data_plt): New virtual method.
3994 (Target_arm::make_data_plt): New method that calls it.
3995 (Target_arm::make_plt_entry): Use it.
3996 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
3997 for the section alignment.
3998 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
3999 method.
4000 (Output_data_plt_arm::first_plt_entry_offset): Call it.
4001 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
4002 method.
4003 (Output_data_plt_arm::get_plt_entry_size): Call it.
4004 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
4005 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
4006 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
4007 method.
4008 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
4009 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
4010 method instead of sizeof(plt_entry).
4011 (Output_data_plt_arm::add_entry): Likewise.
4012 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
4013 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
4014 than static method.
4015 (Target_arm::plt_entry_size): Likewise.
4016 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
4017 Move to ...
4018 (Output_data_plt_arm_standard): ... here, new class.
4019 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
4020 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
4021 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
4022
4023 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4024 Take additional argument for the PLT entry size.
4025 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
4026 Use get_plt_entry_size method rather than plt_entry_size variable.
4027 (Output_data_plt_x86_64::reserve_slot): Likewise.
4028 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
4029 (Output_data_plt_x86_64::add_entry): Likewise.
4030 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
4031 (Output_data_plt_x86_64::address_for_global): Likewise.
4032 (Output_data_plt_x86_64::address_for_local): Likewise.
4033 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4034 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
4035 Make method non-static.
4036 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
4037 method.
4038 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
4039 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
4040 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
4041 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
4042 virtual method.
4043 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
4044 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
4045 virtual method.
4046 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
4047 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
4048 virtual method.
4049 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
4050 (Output_data_plt_x86_64::plt_entry_size)
4051 (Output_data_plt_x86_64::first_plt_entry)
4052 (Output_data_plt_x86_64::plt_entry)
4053 (Output_data_plt_x86_64::tlsdesc_plt_entry)
4054 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
4055 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
4056 (Output_data_plt_x86_64_standard): ... here, new class.
4057 (Target_x86_64::Target_x86_64): Take optional argument for the
4058 Target_info pointer to use.
4059 (Target_x86_64::do_make_data_plt): New virtual method.
4060 (Target_x86_64::make_data_plt): New method to call it.
4061 (Target_x86_64::init_got_plt_for_update): Use that.
4062 Call this->plt_->add_eh_frame method here.
4063 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
4064 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
4065 rather than static method.
4066 (Target_x86_64::plt_entry_size): Likewise.
4067 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
4068 rather than plt_entry_size variable. Move guts of PLT filling to...
4069 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
4070 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
4071 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
4072
4073 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
4074 additional argument for the section alignment.
4075 Don't do add_eh_frame_for_plt here.
4076 (Output_data_plt_i386::first_plt_entry_offset): Make the method
4077 non-static. Use get_plt_entry_size method rather than plt_entry_size
4078 variable.
4079 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
4080 method.
4081 (Output_data_plt_i386::get_plt_entry_size): Call it.
4082 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
4083 (Output_data_plt_i386::add_eh_frame): New method to call it.
4084 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
4085 method.
4086 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
4087 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
4088 method.
4089 (Output_data_plt_i386::fill_plt_entry): New method to call it.
4090 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
4091 method instead of plt_entry_size.
4092 (Output_data_plt_i386::plt_entry_size)
4093 (Output_data_plt_i386::plt_eh_frame_fde_size)
4094 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
4095 (Output_data_plt_i386_standard): ... here, new class.
4096 (Output_data_plt_i386_exec): New class.
4097 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
4098 (Output_data_plt_i386_exec::first_plt_entry): ... here.
4099 (Output_data_plt_i386::exec_plt_entry): Move to ...
4100 (Output_data_plt_i386_exec::plt_entry): ... here.
4101 (Output_data_plt_i386_dyn): New class.
4102 (Output_data_plt_i386::first_plt_entry): Move to ...
4103 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
4104 (Output_data_plt_i386::dyn_plt_entry): Move to ...
4105 (Output_data_plt_i386_dyn::plt_entry): ... here.
4106 (Target_i386::Target_i386): Take optional argument for the Target_info
4107 pointer to use.
4108 (Target_i386::do_make_data_plt): New virtual method.
4109 (Target_i386::make_data_plt): New method to call it.
4110 (Target_i386::make_plt_section): Use that.
4111 Call this->plt_->add_eh_frame method here.
4112 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
4113 rather than plt_entry_size variable.
4114 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
4115 (Output_data_plt_i386::address_for_local): Likewise.
4116 (Output_data_plt_i386::do_write): Likewise.
4117 Move guts of PLT filling to...
4118 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
4119 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
4120 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
4121 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
4122
b9b9f2ee
CC
41232012-05-01 Cary Coutant <ccoutant@google.com>
4124
4125 * dwarf_reader.cc (Dwarf_die::read_attributes)
4126 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
4127 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
4128 * reduced_debug_output.cc
4129 (Output_reduced_debug_info_section::get_die_end): Remove
4130 DW_FORM_GNU_ref_index. Add default case.
4131
57923f48
MW
41322012-04-26 Mark Wielaard <mjw@redhat.com>
4133
4134 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
4135 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
4136 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
4137 DW_AT_high_pc as offset from DW_AT_low_pc.
4138
4139 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
4140 * testsuite/Makefile.in: Regenerate.
4141 * testsuite/gdb_index_test_3.c: New test source file.
4142 * testsuite/gdb_index_test_3.sh: New test source file.
4143
2c54b4f4
ILT
41442012-04-25 Ian Lance Taylor <iant@google.com>
4145
4146 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
4147 pointer.
4148 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
4149 as a class, not a struct.
4150 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
4151 (Target_arm::apply_cortex_a8_workaround): Likewise.
4152 * gc.h: Declare Reloc_types as a struct, not a class.
4153 * object.h: Declare Symbols_data as a struct.
4154 * reloc.h: Declare Read_relocs_data as a struct.
4155 * target.h: Declare Relocate_info as a struct.
4156
a5a5f7a3
DM
41572012-04-24 David S. Miller <davem@davemloft.net>
4158
4159 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
4160 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
4161 and R_SPARC_WPLT30.
4162
f038d496
CC
41632012-04-24 Cary Coutant <ccoutant@google.com>
4164
4165 * incremental-dump.cc (find_input_containing_global): Replace
4166 magic number with symbolic constant.
4167 (dump_incremental_inputs): Update version number.
4168 * incremental.cc (Output_section_incremental_inputs): Update version
4169 number; import symbolic constants from Incremental_inputs_reader.
4170 (Incremental_inputs::create_data_sections): Align relocations
4171 section correctly for 64-bit targets.
4172 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
4173 constants; add padding.
4174 (Output_section_incremental_inputs::write_header): Add assert for
4175 header_size.
4176 (Output_section_incremental_inputs::write_input_files): Add assert
4177 for input_entry_size.
4178 (Output_section_incremental_inputs::write_info_blocks): Add padding;
4179 add assert for object_info_size, input_section_entry_size,
4180 global_sym_entry_size.
4181 * incremental.h (Incremental_inputs_reader): Add symbolic constants
4182 for data structure sizes; use them.
4183 (Incremental_input_entry_reader): Import symbolic constants from
4184 Incremental_inputs_reader; use them.
4185
a4d85145
DM
41862012-04-23 David S. Miller <davem@davemloft.net>
4187
4188 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
4189 and elf_flags_set_.
4190 (Target_sparc::Target_sparc): Initialize new fields.
4191 (Target_sparc::do_make_elf_object): New function.
4192 (Target_sparc::do_adjust_elf_header): New function.
4193
1d509098
CC
41942012-04-23 Cary Coutant <ccoutant@google.com>
4195
4196 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
4197 CU range table of gdb index.
4198
7ebeff7f
DM
41992012-04-20 David S. Miller <davem@davemloft.net>
4200
4201 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
4202 instead of false.
4203
13cf9988
DM
42042012-04-16 David S. Miller <davem@davemloft.net>
4205
2a1079e8
DM
4206 * sparc.cc (Target_sparc::got_address): New function.
4207 (Sparc_relocate_functions::gdop_hix22): New function.
4208 (Sparc_relocate_functions::gdop_lox10): New function.
4209 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
4210 relocs.
4211 (Target_sparc::Scan::local): Likewise if the global symbol is not
4212 preemptible and is not IFUNC.
4213 (Target_sparc::Relocate::relocate): Perform GOTDATA code
4214 transformations for local and non-preemptible non-IFUNC global
4215 symbols.
4216
0bc964fc
DM
4217 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
4218 writing out 64-bit part of ranges.
4219
661d7a80
DM
4220 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
4221 -fpic and -fpie respectively.
4222 * Makefile.in: Regenerate.
4223
8c2bf391
DM
4224 * sparc.cc (class Target_sparc): Add rela_ifunc_.
4225 (Target_sparc::Target_sparc): Initialize new field.
4226 (Target_sparc::do_plt_section_for_global): New function.
4227 (Target_sparc::do_plt_section_for_local): New function.
4228 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
4229 (Target_sparc::make_plt_section): New function, broken out of
4230 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
4231 (Target_sparc::make_plt_entry): Call make_plt_section.
4232 (Target_sparc::make_local_ifunc_plt_entry): New function.
4233 (Target_sparc::rela_ifunc_section): New function.
4234 (Target_sparc::plt_section): Remove const.
4235 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
4236 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
4237 and ifunc_count_ fields.
4238 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
4239 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
4240 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
4241 (Output_data_plt_sparc::rela_ifunc): New function.
4242 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
4243 (Output_data_plt_sparc::has_ifunc_section): New function.
4244 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
4245 (Output_data_plt_sparc::address_for_global): New function.
4246 (Output_data_plt_sparc::address_for_local): New function.
4247 (Output_data_plt_sparc::plt_index_to_offset): New function.
4248 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
4249 and entry_count.
4250 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
4251 entry_count.
4252 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
4253 R_SPARC_JMP_IREL to switch.
4254 (Target_sparc::Scan::check_non_pic): Likewise.
4255 (Target_sparc::Scan::local): Handle IFUNC symbols.
4256 (Target_sparc::Scan::local): Likewise.
4257 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
4258 and plt_address_for_local.
4259 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
4260 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
4261
13cf9988
DM
4262 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
4263 (class Output_data_reloc): Adjust calls to Output_reloc_type.
4264 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
4265 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
4266 global relocs too.
4267 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
4268 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
4269 calls.
4270 * sparc.cc (Target_sparc::Scan::global): Likewise.
4271 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4272
31821be0
CC
42732012-04-16 Cary Coutant <ccoutant@google.com>
4274
4275 * archive.cc (Library_base::should_include_member): Check for
4276 --export-dynamic-symbol.
4277 * options.h (class General_options): Add --export-dynamic-symbol.
4278 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
4279 --export-dynamic-symbol.
4280 (Symbol_table::gc_mark_undef_symbols): Likewise.
4281 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
4282
2615994e
DM
42832012-04-12 David S. Miller <davem@davemloft.net>
4284
4285 * sparc.cc (Reloc::wdisp10): New relocation method.
4286 (Reloc::h34): Likewise.
4287 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
4288 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
4289 R_SPARC_WDISP10.
4290 (Target_sparc::Scan::local): Likewise.
4291 (Target_sparc::Scan::global): Likewise.
4292 (Target_sparc::Relocate::relocate): Likewise.
4293
6782735d
CC
42942012-04-09 Cary Coutant <ccoutant@google.com>
4295
4296 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
4297 low_pc == 0.
4298
8c7a0b00
ILT
42992012-04-06 Ian Lance Taylor <iant@google.com>
4300
4301 * timer.cc: #include <unistd.h>.
4302
58797674
RM
43032012-04-06 Roland McGrath <mcgrathr@google.com>
4304
4305 * configure.in (AC_CHECK_HEADERS): Add locale.h.
4306 * config.in: Regenerate.
4307 * configure: Regenerate.
4308
44350750
NC
43092012-04-05 Nick Clifton <nickc@redhat.com>
4310
4311 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
4312 (AM_LC_MESSAGES): Add.
4313 * aclocal.m4: Regenerate.
4314 * config.in: Regenerate.
4315 * configure: Regenerate.
4316
c1027032
CC
43172012-03-21 Cary Coutant <ccoutant@google.com>
4318
4319 * Makefile.am: Add gdb-index.cc, gdb-index.h.
4320 * Makefile.in: Regenerate.
4321 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
4322 (Sized_elf_reloc_mapper::symbol_section): New function.
4323 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
4324 (make_elf_reloc_mapper): New function.
4325 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
4326 (Dwarf_abbrev_table::do_read_abbrevs): New function.
4327 (Dwarf_abbrev_table::do_get_abbrev): New function.
4328 (Dwarf_ranges_table::read_ranges_table): New function.
4329 (Dwarf_ranges_table::read_range_list): New function.
4330 (Dwarf_pubnames_table::read_section): New function.
4331 (Dwarf_pubnames_table::read_header): New function.
4332 (Dwarf_pubnames_table::next_name): New function.
4333 (Dwarf_die::Dwarf_die): New function.
4334 (Dwarf_die::read_attributes): New function.
4335 (Dwarf_die::skip_attributes): New function.
4336 (Dwarf_die::set_name): New function.
4337 (Dwarf_die::set_linkage_name): New function.
4338 (Dwarf_die::attribute): New function.
4339 (Dwarf_die::string_attribute): New function.
4340 (Dwarf_die::int_attribute): New function.
4341 (Dwarf_die::uint_attribute): New function.
4342 (Dwarf_die::ref_attribute): New function.
4343 (Dwarf_die::child_offset): New function.
4344 (Dwarf_die::sibling_offset): New function.
4345 (Dwarf_info_reader::check_buffer): New function.
4346 (Dwarf_info_reader::parse): New function.
4347 (Dwarf_info_reader::do_parse): New function.
4348 (Dwarf_info_reader::do_read_string_table): New function.
4349 (Dwarf_info_reader::lookup_reloc): New function.
4350 (Dwarf_info_reader::get_string): New function.
4351 (Dwarf_info_reader::visit_compilation_unit): New function.
4352 (Dwarf_info_reader::visit_type_unit): New function.
4353 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
4354 Sized_elf_reloc_mapper.
4355 (Sized_dwarf_line_info::symbol_section): Remove function.
4356 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
4357 (Sized_dwarf_line_info::read_line_mappings): Remove object
4358 parameter, adjust callers.
4359 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
4360 * dwarf_reader.h: Include <sys/types.h>.
4361 (class Track_relocs): Remove forward declaration.
4362 (class Elf_reloc_mapper): New class.
4363 (class Sized_elf_reloc_mapper): New class.
4364 (class Dwarf_abbrev_table): New class.
4365 (class Dwarf_range_list): New class.
4366 (class Dwarf_ranges_table): New class.
4367 (class Dwarf_pubnames_table): New class.
4368 (class Dwarf_die): New class.
4369 (class Dwarf_info_reader): New class.
4370 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
4371 (Sized_dwarf_line_info::symbol_section): Remove member function.
4372 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
4373 base class.
4374 * gdb-index.cc: New source file.
4375 * gdb-index.h: New source file.
4376 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
4377 and .debug_types sections, call Layout::add_to_gdb_index.
4378 (Sized_relobj_incr::do_section_name): Implement.
4379 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
4380 return type; Implement.
4381 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
4382 return type.
4383 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
4384 parameter list and return type.
4385 (Sized_incr_dynobj::do_section_contents): Likewise.
4386 * layout.cc: Include gdb-index.h.
4387 (Layout::Layout): Initialize gdb_index_data_.
4388 (Layout::init_fixed_output_section): Check for .gdb_index section.
4389 (Layout::add_to_gdb_index): New function. Instantiate.
4390 * layout.h: Add forward declaration for class Gdb_index.
4391 (Layout::add_to_gdb_index): New member function.
4392 (Layout::gdb_index_data_): New data member.
4393 * main.cc: Include gdb-index.h.
4394 (main): Print statistics for gdb index.
4395 * object.cc (Object::section_contents): Move code into
4396 do_section_contents.
4397 (need_decompressed_section): Check for sections needed when building
4398 gdb index.
4399 (build_compressed_section_map): Likewise.
4400 (Sized_relobj_file::do_read_symbols): Need local symbols when building
4401 gdb index.
4402 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
4403 sections; call Layout::add_to_gdb_index.
4404 (Sized_relobj_file::do_decompressed_section_contents): Call
4405 do_section_contents directly.
4406 * object.h (Object::do_section_contents): Adjust parameter list and
4407 return type.
4408 (Object::do_decompressed_section_contents): Call do_section_contents
4409 directly.
4410 (Sized_relobj_file::do_section_contents): Adjust parameter list and
4411 return type.
4412 * options.h (class General_options): Add --gdb-index option.
4413 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
4414 list and return type.
4415 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
4416 * reloc.h (Track_relocs::checkpoint): New function.
4417 (Track_relocs::reset): New function.
4418
4419 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
4420 New test cases.
4421 * testsuite/Makefile.in: Regenerate.
4422 * testsuite/gdb_index_test.cc: New test source file.
4423 * testsuite/gdb_index_test_1.sh: New test source file.
4424 * testsuite/gdb_index_test_2.sh: New test source file.
4425
647f1574
DK
44262012-03-19 Doug Kwan <dougkwan@google.com>
4427
4428 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 4429 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
4430 __exidx_start and __exidx_end. Make symbol table parameter
4431 anonymous as it is not used.
4432 * gold.cc (queue_middle_tasks): Call target hook to define any
4433 target-specific symbols.
4434 * target.h (Target::define_standard_symbols): New method.
4435 (Target::do_define_standard_symbols): Same.
4436 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
4437 * testsuite/Makefile.in: Regenerate.
4438 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
4439 and __exidx_end.
4440 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
4441 relocations are generated for __exidx_start and __exidx_end.
4442
7c6109da
DK
44432012-03-16 Doug Kwan <dougkwan@google.com>
4444
4445 * testsuite/Makefile.am: Disable test initpri3b.
4446 * testsuite/Makefile.in: Regenerate.
4447
7b8957f8
DK
44482012-03-15 Doug Kwan <dougkwan@google.com>
4449
4450 * arm.cc (Target_arm::got_section): Make .got section read-only
4451 if -z now is given.
4452
14dc9ef7
ILT
44532012-03-15 Ian Lance Taylor <iant@google.com>
4454
4455 PR gold/13850
4456 * layout.cc (Layout::make_output_section): Correctly mark
4457 SHT_INIT_ARRAY, et. al., as relro.
4458
fa40b62a
DK
44592012-03-14 Doug Kwan <dougkwan@google.com>
4460
4461 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
4462 dynamic relocations for protected symbols in shared objects.
4463
fd325007
ILT
44642012-03-13 Ian Lance Taylor <iant@google.com>
4465
4466 * resolve.cc (Symbol_table::resolve): When merging common symbols,
4467 keep the larger alignment.
4468
e8dd54e1
CC
44692012-03-12 Cary Coutant <ccoutant@google.com>
4470
4471 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
4472 handling of DW_LNE_define_file.
4473
feb5f3b0
CC
44742012-03-12 Cary Coutant <ccoutant@google.com>
4475
4476 * reduced_debug_output.cc
4477 (Output_reduced_debug_info_section::get_die_end): Add new FORM
4478 codes to switch.
4479
a1fb4256
CC
44802012-02-29 Cary Coutant <ccoutant@google.com>
4481
4482 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
4483
5dd8762a
CC
44842012-02-29 Cary Coutant <ccoutant@google.com>
4485
4486 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4487 Call Object::decompressed_section_contents.
4488 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
4489 New dtor.
4490 (Sized_dwarf_line_info::buffer_start_): New data member.
4491 * merge.cc (Output_merge_data::do_add_input_section): Call
4492 Object::decompressed_section_contents.
4493 (Output_merge_string::do_add_input_section): Likewise.
4494 * object.cc (need_decompressed_section): New function.
4495 (build_compressed_section_map): Decompress sections needed later.
4496 (Sized_relobj_file::do_decompressed_section_contents): New function.
4497 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4498 * object.h (Object::decompressed_section_contents): New function.
4499 (Object::discard_decompressed_sections): New function.
4500 (Object::do_decompressed_section_contents): New function.
4501 (Object::do_discard_decompressed_sections): New function.
4502 (Compressed_section_info): New type.
4503 (Compressed_section_map): Include decompressed section contents.
4504 (Sized_relobj_file::do_decompressed_section_contents): New function.
4505 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4506
7b5de7ee
CC
45072012-02-16 Cary Coutant <ccoutant@google.com>
4508
4509 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
4510 * testsuite/Makefile.in: Regenerate.
4511
f9fa4a63
CC
45122012-02-14 Cary Coutant <ccoutant@google.com>
4513
4514 * options.cc (General_options::finalize): Disallow -pie and -static.
4515
2c175ebc
DK
45162012-02-03 Doug Kwan <dougkwan@google.com>
4517
4518 * arm.cc (Arm_relocate_functions::abs8,
4519 Arm_relocate_functions::abs16): Use
4520 Bits::has_signed_unsigned_overflow32.
4521 (Arm_relocate_functions::thm_abs8): Correct range of
4522 overflow check.
4523 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
4524 in assertions.
4525
90cff06f
DK
45262012-02-02 Doug Kwan <dougkwan@google.com>
4527
4528 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
4529 position independent outputs, not just shared objects.
4530
63887f3d
L
45312012-01-30 H.J. Lu <hongjiu.lu@intel.com>
4532
4533 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
4534 * configure: Regenerated.
4535
bef2b434
ILT
45362012-01-27 Ian Lance Taylor <iant@google.com>
4537
4538 * reloc.h (Bits): New class with static functions, copied from
4539 namespace utils in arm.cc.
4540 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
4541 instead.
4542
c335b55d
L
45432012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4544
4545 * incremental.cc (write_info_blocks): Correct relocation offset.
4546
41194d9f
L
45472012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4548
4549 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
4550 (Relocate::tls_gd_to_le): Likewise.
4551
1bae613c
L
45522012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4553
4554 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
4555
24482ca0
L
45562012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4557
4558 * configure.ac: Check if -mcmodel=medium works.
4559 * configure: Regenerated.
4560
c2c7840a
CC
45612012-01-24 Cary Coutant <ccoutant@google.com>
4562
4563 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
4564 definition and ...
4565 (read_unsigned_LEB_128_x): ... this new function.
4566 (read_signed_LEB_128): Replaced with inline definition and ...
4567 (read_signed_LEB_128_x): ... this new function.
4568 * int_encoding.h (read_unsigned_LEB_128_x): New function.
4569 (read_unsigned_LEB_128): Add inline definition.
4570 (read_signed_LEB_128_x): New function.
4571 (read_signed_LEB_128): Add inline definition.
4572 * testsuite/Makefile.am (leb128_unittest): New unit test.
4573 * testsuite/Makefile.in: Regenerate.
4574 * testsuite/leb128_unittest.cc: New unit test.
4575
833de760 45762012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
4577
4578 PR gold/13617
4579 * i386.cc (Target_i386::do_code_fill): When using a jmp
4580 instruction, pad with nop instructions.
4581 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4582
618d6666
L
45832012-01-22 H.J. Lu <hongjiu.lu@intel.com>
4584
4585 * x86_64.cc (gc_process_relocs): Add typename on types used in
4586 template.
4587 (scan_relocs): Likewise.
4588 (relocate_section): Likewise.
4589 (apply_relocation): Likewise.
4590
3660ff06
L
45912012-01-10 H.J. Lu <hongjiu.lu@intel.com>
4592
4593 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
4594 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
4595 under x32.
4596
fc51264f
L
45972012-01-09 H.J. Lu <hongjiu.lu@intel.com>
4598
4599 * x86_64.cc: Initial support for x32.
4600
dd74ae06
CC
46012012-01-03 Cary Coutant <ccoutant@google.com>
4602
4603 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
4604 Use abstract base class for GOT.
4605 * gold/output.h (class Output_data_got_base): New abstract base class.
4606 (class Output_data_got): Derive from new base class, adjust ctors.
4607 (Output_data_got::reserve_slot): Make virtual; rename to
4608 do_reserve_slot; Adjust callers.
4609 * gold/target.h (Sized_target::init_got_plt_for_update): Return
4610 pointer to abstract base class.
4611 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
4612
83896202
ILT
46132011-12-18 Ian Lance Taylor <iant@google.com>
4614
4615 * object.h (Relobj::local_symbol_value): New function.
4616 (Relobj::local_plt_offset): New function.
4617 (Relobj::local_has_got_offset): New function.
4618 (Relobj::local_got_offset): New function.
4619 (Relobj::set_local_got_offset): New function.
4620 (Relobj::do_local_symbol_value): New pure virtual function.
4621 (Relobj::do_local_plt_offset): Likewise.
4622 (Relobj::do_local_has_got_offset): Likewise.
4623 (Relobj::do_local_got_offset): Likewise.
4624 (Relobj::do_set_local_got_offset): Likewise.
4625 (Sized_relobj::do_local_has_got_offset): Rename from
4626 local_has_got_offset.
4627 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
4628 (Sized_relobj::do_set_local_got_offset): Rename from
4629 set_local_got_offset.
4630 (Sized_relobj_file::do_local_plt_offset): Rename from
4631 local_plt_offset.
4632 (Sized_relobj_file::do_local_symbol_value): New function.
4633 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
4634 local_plt_offset.
4635 * output.cc (Output_data_got::Got_entry::write): Change object to
4636 Relobj. Use local_symbol_value.
4637 (Output_data_got::add_global_with_rel): Change rel_dyn to
4638 Output_data_reloc_generic*. Use add_global_generic.
4639 (Output_data_got::add_global_with_rela): Remove. Change all
4640 callers to use add_global_with_rel.
4641 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
4642 Output_data_reloc_generic*. Use add_global_generic.
4643 (Output_data_got::add_global_pair_with_rela): Remove. Change all
4644 callers to use add_global_pair_with_rel.
4645 (Output_data_got::add_local): Change object to Relobj*.
4646 (Output_data_got::add_local_plt): Likewise.
4647 (Output_data_got::add_local_with_rel): Change object to Relobj*,
4648 change rel_dyn to Output_data_reloc_generic*. Use
4649 add_local_generic.
4650 (Output_data_got::add_local_with_rela): Remove. Change all
4651 callers to use all_local_with_rel.
4652 (Output_data_got::add_local_pair_with_rel): Change object to
4653 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
4654 add_output_section_generic.
4655 (Output_data_got::add_local_pair_with_rela): Remove. Change all
4656 callers to use add_local_pair_with_rel.
4657 (Output_data_got::reserve_local): Change object to Relobj*.
4658 * output.h: (class Output_data_reloc_generic): Add pure virtual
4659 declarations for add_global_generic, add_local_generic,
4660 add_output_section_generic.
4661 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
4662 functions for Output_data_reloc_generic. Update declarations for
4663 changes listed in output.cc.
4664 (class Output_data_got): Change template parameter to got_size.
4665 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
4666 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
4667 function.
4668 (Sized_relobj_incr::do_local_plt_offset): New function.
4669 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
4670 add_global_generic.
4671
76677ad0
CC
46722011-12-17 Cary Coutant <ccoutant@google.com>
4673
4674 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
4675 * resolve.cc (Symbol_table::resolve): Likewise.
4676 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
4677 arrays.
4678 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4679
8b8dd8d5
ILT
46802011-12-16 Ian Lance Taylor <iant@google.com>
4681
4682 * output.h (Output_data_reloc_generic::add): Only call
4683 add_dynamic_reloc if this is a dynamic reloc section.
4684
d55525b9
L
46852011-12-15 H.J. Lu <hongjiu.lu@intel.com>
4686
4687 PR gold/13505
4688 * target-reloc.h (apply_relocation): Replace <64, false> with
4689 <size, big_endian>.
4690
ff81c7c1
NC
46912011-11-25 Nick Clifton <nickc@redhat.com>
4692
4693 * po/it.po: New Italian translation.
4694
628f39be
SA
46952011-11-17 Sterling Augustine <saugustine@google.com>
4696
4697 * script.cc (script_include_directive): Implement.
4698 (read_script_file): New local variables name and search_path. Update
4699 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
4700 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
4701 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
4702
98ef3ea4
SA
47032011-11-11 Sterling Augustine <saugustine@google.com>
4704
4705 * yyscript.y (section_cmd): Add support for INCLUDE directive.
4706 (file_or_sections_cmd): Likewise.
4707
f4a8b6d7
DK
47082011-11-11 Doug Kwan <dougkwan@google.com>
4709
4710 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
4711 if --just-symbols is given.
4712
29ab395d
DK
47132011-11-10 Doug Kwan <dougkwan@google.com>
4714
4715 PR gold/13362
4716 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
4717 when processing data relocs.
4718 * reloc.h (Relocate_functions::rel_unaligned): New method.
4719 (Relocate_functions::pcrel_unaligned): Ditto.
4720 (Relocate_functions::rel32_unaligned): Ditto.
4721 (Relocate_functions::pcrel32_unaligned): Ditto.
4722
2c339f71
DK
47232011-11-09 Doug Kwan <dougkwan@google.com>
4724
4725 PR gold/13362
4726 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
4727 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
4728 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
4729 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4730 (Relocate_functions::rel_unaligned): New.
4731 (Relocate_functions::rel32_unaligned): New.
4732 * target-reloc.h (relocate_for_relocatable): Add code to handle
4733 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4734 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
4735 arm_unaligned_reloc_r): New targets.
4736 * testsuite/Makefile.in: Regenerate.
4737 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
4738 linking.
4739
3f3cddf1
ILT
47402011-11-02 Ian Lance Taylor <iant@google.com>
4741
4742 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
4743 NATIVE_LINKER.
4744 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
4745 * options.cc (General_options::finalize): Use library search path
4746 from configure script if specified. If not native and no sysroot,
4747 only search TOOLLIBDIR.
4748 * options.h (Search_directory::Search_directory): Change name to
4749 const std::string&.
4750 (General_options::add_to_library_path_with_sysroot): Change arg to
4751 const std::string&.
4752 * configure, Makefile.in, config.in: Rebuild.
4753
a8e2273b
ILT
47542011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4755
4756 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
4757 we are working around the ARM1176 Erratum.
4758 * options.h (General_options::fix_arm1176): Add option.
4759 * testsuite/Makefile.am: Add testcases, and keep current ones
4760 working.
4761 * testsuite/Makefile.in: Regenerate.
4762 * testsuite/arm_fix_1176.s: New file.
4763 * testsuite/arm_fix_1176.sh: Likewise.
4764
cd6eab1c
ILT
47652011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4766
4767 * arm.cc (Target_arm::Target_arm): Remove initialisation of
4768 may_use_blx_.
4769 (Target_arm::may_use_blx): Remove method.
4770 (Target_arm::set_may_use_blx): Likewise.
4771 (Target_arm::may_use_v4t_interworking): New method.
4772 (Target_arm::may_use_v5t_interworking): Likewise.
4773 (Target_arm::may_use_blx_): Remove member variable.
4774 (Arm_relocate_functions::arm_branch_common): Check for v5T
4775 interworking.
4776 (Arm_relocate_functions::thumb_branch_common): Likewise.
4777 (Reloc_stub::stub_type_for_reloc): Likewise.
4778 (Target_arm::do_finalize_sections): Correct interworking checks.
4779 * testsuite/Makefile.am: Add new tests.
4780 * testsuite/Makefile.in: Regenerate.
4781 * testsuite/arm_farcall_arm_arm.s: New test.
4782 * testsuite/arm_farcall_arm_arm.sh: Likewise.
4783 * testsuite/arm_farcall_arm_thumb.s: Likewise.
4784 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
4785 * testsuite/arm_farcall_thumb_arm.s: Likewise.
4786 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
4787 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
4788 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
4789
286adcf4
CC
47902011-10-31 Cary Coutant <ccoutant@google.com>
4791
4792 PR gold/13023
4793 * expression.cc (Expression::eval_with_dot): Add
4794 is_section_dot_assignment parameter.
4795 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
4796 absolute and assigning to dot within a section.
4797 * script-sections.cc
4798 (Output_section_element_assignment::set_section_addresses): Pass
4799 dot_section to set_if_absolute.
4800 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
4801 as is_section_dot_assignment flag to eval_with_dot.
4802 (Output_section_element_dot_assignment::set_section_addresses):
4803 Likewise.
4804 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
4805 parameter. Also set value if relative to dot_section; set the
4806 symbol's output_section.
4807 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
4808 parameter. Adjust all callers.
4809 (Expression::eval_maybe_dot): Likewise.
4810 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
4811 Adjust all callers.
4812 * testsuite/script_test_2.t: Test assignment of an absolute value
4813 to dot within an output section element.
4814
9634ed06
CC
48152011-10-31 Cary Coutant <ccoutant@google.com>
4816
4817 * options.h (class General_options): Add --[no-]gnu-unique options.
4818 * symtab.cc (Symbol_table::sized_write_globals): Convert
4819 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
4820
de4101c7
CC
48212011-10-31 Cary Coutant <ccoutant@google.com>
4822
4823 PR gold/13359
4824 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
4825 unnecessary assertion.
4826 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
4827
7257cc92
ST
48282011-10-31 Sriraman Tallam <tmsriram@google.com>
4829
4830 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4831 gc_mark_symbol.
4832 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4833 gc_mark_symbol.
4834 Change to just keep the section associated with symbol.
4835 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
4836 they are externally visible and --export-dynamic is turned on.
4837 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
4838
bfc34b3f
ILT
48392011-10-19 Ian Lance Taylor <iant@google.com>
4840
4841 PR gold/13163
4842 * script-sections.cc
4843 (Output_section_element_dot_assignment::needs_output_section): New
4844 function.
4845
ea0d8c47
ILT
48462011-10-19 Ian Lance Taylor <iant@google.com>
4847
4848 PR gold/13204
4849 * layout.cc (Layout::segment_precedes): Don't assert failure if a
4850 --section-start option was seen.
4851 * options.h (General_options::any_section_start): New function.
4852
abd242a9
DM
48532011-10-18 David S. Miller <davem@davemloft.net>
4854
4855 PR binutils/13301
4856 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
4857 member to track relocation locations that have moved during TLS
4858 reloc optimizations.
4859 (Target_sparc::Relocate::Relocate): Initialize to NULL.
4860 (Target_sparc::Relocate::relocate): Adjust view down by 4
4861 bytes if it matches reloc_adjust_addr_.
4862 (Target_sparc::Relocate::relocate_tls): Always move the
4863 __tls_get_addr call delay slot instruction forward 4 bytes when
4864 performing relaxation.
4865
bab9090f
CC
48662011-10-18 Cary Coutant <ccoutant@google.com>
4867
4868 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
4869 (Output_file::map_no_anonymous): Check for non-zero
4870 return code from posix_fallocate.
4871
f7c5b166
CC
48722011-10-17 Cary Coutant <ccoutant@google.com>
4873
4874 PR gold/13245
4875 * plugin.cc (is_visible_from_outside): Check for symbols
4876 referenced from dynamic objects.
4877 * resolve.cc (Symbol_table::resolve): Don't count references
4878 from dynamic objects as references from real ELF files.
4879 * testsuite/plugin_test_2.sh: Adjust expected result.
4880
b490c0bb
CC
48812011-10-17 Cary Coutant <ccoutant@google.com>
4882
4883 * gold.cc: Include timer.h.
4884 (queue_middle_tasks): Stamp time.
4885 (queue_final_tasks): Likewise.
4886 * main.cc (main): Store timer in parameters. Print timers
4887 for each pass.
4888 * parameters.cc (Parameters::Parameters): Initialize timer_.
4889 (Parameters::set_timer): New function.
4890 (set_parameters_timer): New function.
4891 * parameters.h (Parameters::set_timer): New function.
4892 (Parameters::timer): New function.
4893 (Parameters::timer_): New data member.
4894 (set_parameters_timer): New function.
4895 * timer.cc (Timer::stamp): New function.
4896 (Timer::get_pass_time): New function.
4897 * timer.h (Timer::stamp): New function.
4898 (Timer::get_pass_time): New function.
4899 (Timer::pass_times_): New data member.
4900
f475cf7b
CC
49012011-10-17 Cary Coutant <ccoutant@google.com>
4902
4903 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
4904 task for members of lib groups.
4905
cdd7e244
CC
49062011-10-17 Cary Coutant <ccoutant@google.com>
4907
4908 PR gold/13288
4f95c8b4 4909 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
4910 (File_read::make_view): Move bounds check (replace with assert)...
4911 (File_read::find_or_make_view): ... to here.
4912
dfb45471
CC
49132011-10-12 Cary Coutant <ccoutant@google.com>
4914
4f95c8b4 4915 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
4916 ::read returns less than requested size.
4917
53bbcc1b
CC
49182011-10-10 Cary Coutant <ccoutant@google.com>
4919
4f95c8b4 4920 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
4921 Initialize defined_count_.
4922 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
4923 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
4924 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
4925 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
4926 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 4927 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
4928 member.
4929 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 4930 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
4931 Return zeroes instead of internal error.
4932
397b129b
CC
49332011-10-10 Cary Coutant <ccoutant@google.com>
4934
4935 PR gold/13249
4f95c8b4 4936 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 4937 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 4938 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
4939 (Output_reloc::type_): Adjust size of bit field.
4940 (Output_reloc::use_plt_offset_): New bit field.
4941 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
4942 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
4943 flag. Adjust all callers.
4f95c8b4 4944 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
4945 creating RELATIVE relocations.
4946
d5698657
NC
49472011-10-10 Nick Clifton <nickc@redhat.com>
4948
4949 * po/es.po: Updated Spanish translation.
4950 * po/fi.po: Updated Finnish translation.
4951
6a59a5c2
DN
49522011-10-03 Diego Novillo <dnovillo@google.com>
4953
4954 * options.cc (parse_uint): Fix dereference of RETVAL.
4955
f0558624
ST
49562011-09-29 Sriraman Tallam <tmsriram@google.com>
4957
4958 * layout.h (section_order_map_): New member.
4959 (get_section_order_map): New member function.
4960 * output.cc (Output_section::add_input_section): Check for patterns
4961 only when --section-ordering-file is specified.
4962 * gold.cc (queue_middle_tasks): Delay updating order of sections till
4963 output_sections have been formed.
4964 * layout.cc (Layout_Layout): Initialize section_order_map_.
4965 * plugin.cc (update_section_order): Store order in order_map. Do not
4966 update the order.
4967 * testsuite/Makefile.am: Add test case for plugin_final_layout.
4968 * testsuite/Makefile.in: Regenerate.
4969 * testsuite/plugin_section_order.c: New file.
4970 * testsuite/plugin_final_layout.cc: New file.
4971 * testsuite/plugin_final_layout.sh: New file.
4972
a7dac153
CC
49732011-09-29 Cary Coutant <ccoutant@google.com>
4974
4f95c8b4 4975 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 4976 Check for NULL.
4f95c8b4 4977 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
4978 symbols during incremental update.
4979 (Symbol_table::add_from_dynobj): Likewise.
4980
eebd87a5
ILT
49812011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4982 Ian Lance Taylor <iant@google.com>
4983
4984 * symtab.cc (Symbol_table::define_special_symbol): Always
4985 canonicalize version string.
4986
403a3331
CC
49872011-09-26 Cary Coutant <ccoutant@google.com>
4988
4f95c8b4
CC
4989 * gold.cc (queue_initial_tasks): Move option checks ...
4990 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
4991 some options; make others fatal.
4992
235061c2
CC
49932011-09-26 Cary Coutant <ccoutant@google.com>
4994
4995 gcc PR lto/47247
4996 * plugin.cc (get_symbols_v2): New function.
4997 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
4998 (is_referenced_from_outside): New function.
4999 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
5000 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
5001 (get_symbols): Pass version parameter.
5002 (get_symbols_v2): New function.
5003 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
5004 parameter.
5005 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
5006 (onload): Add LDPT_GET_SYMBOLS_V2.
5007 (all_symbols_read_hook): Use get_symbols_v2; check for
5008 LDPR_PREVAILING_DEF_IRONLY_EXP.
5009 * testsuite/plugin_test_3.sh: Update expected results.
5010
dc87f620
ILT
50112011-09-23 Simon Baldwin <simonb@google.com>
5012
5013 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
5014 configuration options.
5015 * configure: Regenerate.
5016 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
5017 * Makefile.in: Regenerate.
5018 * testsuite/Makefile.in: Regenerate.
5019
a8279f82
ST
50202011-09-19 Sriraman Tallam <tmsriram@google.com>
5021
5022 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
5023
0c9350c8
CC
50242011-09-19 Cary Coutant <ccoutant@google.com>
5025
5026 * incremental.cc (can_incremental_update): Fix typo in comment.
5027 * incremental.h (can_incremental_update): Likewise.
5028
aa06ae28
CC
50292011-09-18 Cary Coutant <ccoutant@google.com>
5030
5031 * incremental.cc (can_incremental_update): New function.
5032 * incremental.h (can_incremental_update): New function.
5033 * layout.cc (Layout::init_fixed_output_section): Call it.
5034 (Layout::make_output_section): Don't allow patch space in .eh_frame.
5035 * object.cc (Sized_relobj_file::do_layout): Call
5036 can_incremental_update.
5037
ebb300b2
CC
50382011-09-13 Cary Coutant <ccoutant@google.com>
5039
5040 * configure.ac: Check for glibc support for gnu_indirect_function
5041 support with static linking, setting automake conditional
5042 IFUNC_STATIC.
5043 * Makefile.in: Regenerate.
5044 * configure: Regenerate.
5045
5046 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
5047 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
5048 for IFUNC_STATIC.
5049 * testsuite/Makefile.in: Regenerate.
5050
1206d0d5
CC
50512011-09-13 Cary Coutant <ccoutant@google.com>
5052
5053 * incremental.cc (Sized_relobj_incr::do_layout): Call
5054 report_comdat_group for kept comdat sections.
5055 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
5056 * testsuite/Makefile.in: Regenerate.
5057 * testsuite/incr_comdat_test_1.cc: New source file.
5058 * testsuite/incr_comdat_test_2_v1.cc: New source file.
5059 * testsuite/incr_comdat_test_2_v2.cc: New source file.
5060 * testsuite/incr_comdat_test_2_v3.cc: New source file.
5061
40b29874
ILT
50622011-09-13 Ian Lance Taylor <iant@google.com>
5063
5064 * object.cc (Sized_relobj_file::do_layout): Remove unused local
5065 variable external_symbols_offset.
5066
1b045aac
ILT
50672011-09-12 Ian Lance Taylor <iant@google.com>
5068
5069 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
5070 triggered if object has no symbols.
5071
24c6c55a
DM
50722011-09-09 David S. Miller <davem@davemloft.net>
5073
5074 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
5075 (Output_fill_debug_line::do_write): Likewise.
5076
66570254
CC
50772011-08-29 Cary Coutant <ccoutant@google.com>
5078
5079 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
5080 casts to match formatting specs.
5081 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
5082
8ea8cd50
CC
50832011-08-26 Cary Coutant <ccoutant@google.com>
5084
5085 * layout.cc (Free_list::allocate): Provide guarantee of minimum
5086 remaining hole size when allocating.
5087 (Layout::make_output_section): Set fill methods for debug sections.
5088 * layout.h (Free_list::Free_list_node): Move from private to
5089 public.
5090 (Free_list::set_min_hole_size): New function.
5091 (Free_list::begin, Free_list::end): New functions.
5092 (Free_list::min_hole_): New data member.
5093 * output.cc: Include dwarf.h.
5094 (Output_fill_debug_info::do_minimum_hole_size): New function.
5095 (Output_fill_debug_info::do_write): New function.
5096 (Output_fill_debug_line::do_minimum_hole_size): New function.
5097 (Output_fill_debug_line::do_write): New function.
5098 (Output_section::Output_section): Initialize new data member.
5099 (Output_section::set_final_data_size): Ensure patch space is larger
5100 than minimum hole size.
5101 (Output_section::do_write): Fill holes in debug sections.
5102 * output.h (Output_fill): New class.
5103 (Output_fill_debug_info): New class.
5104 (Output_fill_debug_line): New class.
5105 (Output_section::set_free_space_fill): New function.
5106 (Output_section::free_space_fill_): New data member.
5107 * testsuite/Makefile.am (incremental_test_3): Add
5108 --incremental-patch option.
5109 (incremental_test_4): Likewise.
5110 (incremental_test_5): Likewise.
5111 (incremental_test_6): Likewise.
5112 (incremental_copy_test): Likewise.
5113 (incremental_common_test_1): Likewise.
5114 * testsuite/Makefile.in: Regenerate.
5115
7cf80422
NC
51162011-08-26 Nick Clifton <nickc@redhat.com>
5117
5118 * po/es.po: Updated Spanish translation.
5119
c3f7b0e5
CC
51202011-08-01 Cary Coutant <ccoutant@google.com>
5121
5122 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
5123 * gold/testsuite/Makefile.in: Regenerate.
5124 * gold/testsuite/justsyms_exec.c: New source file.
5125 * gold/testsuite/justsyms_lib.c: New source file.
5126
9590bf25
CC
51272011-08-01 Cary Coutant <ccoutant@google.com>
5128
5129 * layout.cc (Layout::set_segment_offsets): Don't realign text
5130 segment if -Ttext was specified.
5131 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
5132 file type.
5133 * object.h (Sized_relobj_file::e_type): New function.
5134 (Sized_relobj_file::e_type_): New data member.
5135 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
5136 base address for ET_EXEC files.
5137 * target.cc (Target::do_make_elf_object_implementation): Allow
5138 ET_EXEC files with --just-symbols option.
5139
dcd8d12e
CC
51402011-07-28 Cary Coutant <ccoutant@google.com>
5141
5142 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
5143 Add thread_number parameter.
5144 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
5145 * workqueue-threads.cc
5146 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
5147 current thread if its thread number is greater than desired thread
5148 count.
5149 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
5150 Add thread_number parameter.
5151 (Workqueue::should_cancel_thread): Likewise.
5152 (Workqueue::find_runnable_or_wait): Pass thread_number to
5153 should_cancel_thread.
5154 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
5155 parameter.
5156
804eb480
ST
51572011-07-22 Sriraman Tallam <tmsriram@google.com>
5158
5159 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
5160 only after checking if it cannot be forced local.
5161 * symtab.h (is_externally_visible): Check if the symbol is not forced
5162 local.
5163
f1ddb600
ILT
51642011-07-15 Ian Lance Taylor <iant@google.com>
5165
5166 * options.h (class General_options): Add --print-output-format.
5167 Move -EL next to -EB, for better --help output.
5168 * target-select.cc: Include <cstdio>, "options.h", and
5169 "parameters.h".
5170 (Target_selector::do_target_bfd_name): New function.
5171 (print_output_format): New function.
5172 * target-select.h (class Target_selector): Update declarations.
5173 (Target_selector::target_bfd_name): New function.
5174 (print_output_format): Declare.
5175 * main.cc: Include "target-select.h".
5176 (main): Handle --print-output-format.
5177 * gold.cc: Include "target-select.h".
5178 (queue_initial_tasks): Handle --print-output-format when there are
5179 no input files.
5180 * parameters.cc (parameters_force_valid_target): Give a better
5181 error message if -EB/-EL does not match target.
5182 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
5183 function.
5184
7d172687
ILT
51852011-07-15 Ian Lance Taylor <iant@google.com>
5186
5187 * i386.cc (class Output_data_plt_i386): Add layout_ field.
5188 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
5189 (Output_data_plt_i386::do_write): Write address of .dynamic
5190 section to first entry in .got.plt section.
5191 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
5192 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5193 Initialize layout_.
5194 (Output_data_plt_x86_64::do_write): Write address of .dynamic
5195 section to first entry in .got.plt section.
5196 * layout.h (Layout::dynamic_section): New function.
5197
e9552f7e
ST
51982011-07-13 Sriraman Tallam <tmsriram@google.com>
5199
5200 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
5201 to claim_file call.
5202 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
5203 input_section_position_, and input_section_glob_.
5204 (read_layout_from_file): Call function section_ordering_specified.
5205 * layout.h (is_section_ordering_specified): New function.
5206 (section_ordering_specified): New function.
5207 (section_ordering_specified_): New boolean member.
5208 * main.cc(main): Call load_plugins after layout object is defined.
5209 * output.cc (Output_section::add_input_section): Use
5210 function section_ordering_specified to check if section ordering is
5211 needed.
5212 * output.cc (Output_section::add_relaxed_input_section): Use
5213 function section_ordering_specified to check if section ordering is
5214 needed.
5215 (Output_section::update_section_layout): New function.
5216 (Output_section::sort_attached_input_sections): Check if input section
5217 must be reordered.
5218 * output.h (Output_section::update_section_layout): New function.
5219 * plugin.cc (get_section_count): New function.
5220 (get_section_type): New function.
5221 (get_section_name): New function.
5222 (get_section_contents): New function.
5223 (update_section_order): New function.
58797674 5224 (allow_section_ordering): New function.
e9552f7e
ST
5225 (Plugin::load): Add the new interfaces to the transfer vector.
5226 (Plugin_manager::load_plugins): New parameter.
5227 (Plugin_manager::all_symbols_read): New parameter.
5228 (Plugin_manager::claim_file): New parameter. Save the elf object for
5229 unclaimed objects.
5230 (Plugin_manager::get_elf_object): New function.
5231 (Plugin_manager::get_view): Change to directly use the bool to check
5232 if get_view is called from claim_file_hook.
5233 * plugin.h (input_objects): New function
5234 (Plugin__manager::load_plugins): New parameter.
5235 (Plugin_manager::claim_file): New parameter.
5236 (Plugin_manager::get_elf_object): New function.
5237 (Plugin_manager::in_claim_file_handler): New function.
5238 (Plugin_manager::in_claim_file_handler_): New member.
5239 (layout): New function.
5240 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
5241 handler with an extra parameter. Make the elf object before calling
5242 claim_file handler.
5243 * testsuite/plugin_test.c (get_section_count): New function pointer.
5244 (get_section_type): New function pointer.
5245 (get_section_name): New function pointer.
5246 (get_section_contents): New function pointer.
5247 (update_section_order): New function pointer.
5248 (allow_section_ordering): New function pointer.
5249 (onload): Check if the new interfaces exist.
5250
9446efde
ILT
52512011-07-13 Ian Lance Taylor <iant@google.com>
5252
5253 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
5254 relro section.
5255 * x86_64.cc (Target_x86_64::got_section): Likewise.
5256 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
5257 (relro_now_test_SOURCES): New variable.
5258 (relro_now_test_DEPENDENCIES): New variable.
5259 (relro_now_test_LDFLAGS): New variable.
5260 (relro_now_test_LDADD): New variable.
5261 (relro_now_test.so): New target.
5262 * testsuite/Makefile.in: Rebuild.
5263
07aa62f2
ILT
52642011-07-12 Ian Lance Taylor <iant@google.com>
5265
5266 PR gold/12980
5267 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
5268 GLOB_DAT relocation rather than a RELATIVE relocation for a
5269 protected symbol when creating a shared library.
5270 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5271 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
5272 * testsuite/protected_main_1.cc (main): Test that protected
5273 function has same address.
5274
e2153196
ILT
52752011-07-11 Ian Lance Taylor <iant@google.com>
5276
5277 PR gold/12979
5278 * options.h (class General_options): Add -Bgroup.
5279 * options.cc (General_options::finalize): If -Bgroup is set,
5280 default to --unresolved-symbols=report-all.
5281 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
5282 * target-reloc.h (issue_undefined_symbol_error): Handle
5283 --unresolved-symbols=report-all.
5284
6daf5215
ILT
52852011-07-08 Ian Lance Taylor <iant@google.com>
5286
5287 PR gold/11985
5288 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
5289 if linker script discards key sections.
5290 (Layout::create_dynamic_symtab): Likewise.
5291 (Layout::assign_local_dynsym_offsets): Likewise.
5292 (Layout::sized_create_version_sections): Likewise.
5293 (Layout::create_interp): Likewise.
5294 (Layout::finish_dynamic_section): Likewise.
5295 (Layout::set_dynamic_symbol_size): Likewise.
5296
beabb2c6
ILT
52972011-07-08 Ian Lance Taylor <iant@google.com>
5298
5299 PR gold/12386
5300 * options.h (class General_options): Add --unresolved-symbols.
5301 * target-reloc.h (issue_undefined_symbol_error): Check
5302 --unresolved-symbols. Add comments.
5303
9c16daf1
ILT
53042011-07-08 Ian Lance Taylor <iant@google.com>
5305
5306 * testsuite/odr_violation2.cc (Ordering::operator()): Make
5307 expression more complex.
5308
191f1a2d
ILT
53092011-07-08 Ian Lance Taylor <iant@google.com>
5310
5311 PR gold/11317
5312 * target-reloc.h (issue_undefined_symbol_error): New inline
5313 function, broken out of relocate_section.
5314 (relocate_section): Call issue_undefined_symbol_error.
5315 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5316 there is no TLS segment if we are about to issue an undefined
5317 symbol error.
5318 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5319
62855347
ILT
53202011-07-08 Ian Lance Taylor <iant@google.com>
5321
5322 PR gold/12279
5323 * resolve.cc (Symbol_table::should_override): Add fromtype
5324 parameter. Change all callers. Give error when linking together
5325 TLS and non-TLS symbol.
5326 (Symbol_table::should_override_with_special): Add fromtype
5327 parameter. Change all callers.
5328 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5329 there is no TLS segment if we have reported some errors.
5330 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5331
67181c72
ILT
53322011-07-08 Ian Lance Taylor <iant@google.com>
5333
5334 PR gold/12372
5335 * target.h (Target::plt_address_for_global): New function.
5336 (Target::plt_address_for_local): New function.
5337 (Target::plt_section_for_global): Remove.
5338 (Target::plt_section_for_local): Remove.
5339 (Target::do_plt_address_for_global): New virtual function.
5340 (Target::do_plt_address_for_local): New virtual function.
5341 (Target::do_plt_section_for_global): Remove.
5342 (Target::do_plt_section_for_local): Remove.
5343 (Target::register_global_plt_entry): Add Symbol_table and Layout
5344 parameters.
5345 * output.cc (Output_data_got::Got_entry::write): Use
5346 plt_address_for_global and plt_address_for_local.
5347 * layout.cc (Layout::add_target_dynamic_tags): Use size and
5348 address of output section.
5349 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
5350 got_irelative_, and irelative_count_ fields. Update
5351 declarations.
5352 (Output_data_plt_i386::has_irelative_section): New function.
5353 (Output_data_plt_i386::entry_count): Add irelative_count_.
5354 (Output_data_plt_i386::set_final_data_size): Likewise.
5355 (class Target_i386): Add got_irelative_ and rel_irelative_
5356 fields. Update declarations.
5357 (Target_i386::Target_i386): Initialize new fields.
5358 (Target_i386::do_plt_address_for_global): New function replacing
5359 do_plt_section_for_global.
5360 (Target_i386::do_plt_address_for_local): New function replacing
5361 do_plt_section_for_local.
5362 (Target_i386::got_section): Create got_irelative_.
5363 (Target_i386::rel_irelative_section): New function.
5364 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
5365 fields. Don't define __rel_iplt_{start,end}.
5366 (Output_data_plt_i386::add_entry): Add symtab and layout
5367 parameters. Change all callers. Use different PLT and GOT for
5368 IFUNC symbols.
5369 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
5370 layout parameters. Change all callers. Use different PLT and
5371 GOT.
5372 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
5373 (Output_data_plt_i386::rel_irelative): New function.
5374 (Output_data_plt_i386::address_for_global): New function.
5375 (Output_data_plt_i386::address_for_local): New function.
5376 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
5377 IRELATIVE GOT when changing IFUNC GOT entries.
5378 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
5379 reloc.
5380 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
5381 if we didn't create an IRELATIVE GOT.
5382 (Target_i386::Relocate::relocate): Use plt_address_for_global and
5383 plt_address_for_local.
5384 (Target_i386::do_dynsym_value): Use plt_address_for_global.
5385 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
5386 got_irelative_, and irelative_count_ fields. Update
5387 declarations.
5388 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5389 Initialize new fields. Remove symtab parameter. Change all
5390 callers.
5391 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
5392 irelative_count_.
5393 (Output_data_plt_x86_64::has_irelative_section): New function.
5394 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
5395 (class Target_x86_64): Add got_irelative_ and rel_irelative_
5396 fields. Update declarations.
5397 (Target_x86_64::Target_x86_64): Initialize new fields.
5398 (Target_x86_64::do_plt_address_for_global): New function replacing
5399 do_plt_section_for_global.
5400 (Target_x86_64::do_plt_address_for_local): New function replacing
5401 do_plt_section_for_local.
5402 (Target_x86_64::got_section): Create got_irelative_.
5403 (Target_x86_64::rela_irelative_section): New function.
5404 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
5405 all callers. Don't create __rel_iplt_{start,end}.
5406 (Output_data_plt_x86_64::add_entry): Add symtab and layout
5407 parameters. Change all callers. Use different PLT and GOT for
5408 IFUNC symbols.
5409 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
5410 layout parameters. Change all callers. Use different PLT and
5411 GOT.
5412 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
5413 parameters. Change all callers. Use different PLT and GOT for
5414 IFUNC symbols.
5415 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
5416 (Output_data_plt_x86_64::rela_irelative): New function.
5417 (Output_data_plt_x86_64::address_for_global): New function.
5418 (Output_data_plt_x86_64::address_for_local): New function.
5419 (Output_data_plt_x86_64::set_final_data_size): Likewise.
5420 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
5421 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
5422 (Target_x86_64::register_global_plt_entry): Add symtab and layout
5423 parameters.
5424 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
5425 reloc.
5426 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
5427 symbols if we didn't create an IRELATIVE GOT.
5428 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
5429 plt_address_for_local.
5430 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
5431 * testsuite/ifuncvar1.c: New test file.
5432 * testsuite/ifuncvar2.c: New test file.
5433 * testsuite/ifuncvar3.c: New test file.
5434 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
5435 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
5436 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
5437 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
5438 * testsuite/Makefile.in: Rebuild.
5439
33c15b45
CC
54402011-07-07 Cary Coutant <ccoutant@google.com>
5441
5442 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
5443 (two_file_test_1_ndebug.o): Likewise.
5444 (two_file_test_1b_ndebug.o): Likewise.
5445 (two_file_test_2_ndebug.o): Likewise.
5446 (two_file_test_main_ndebug.o): Likewise.
5447 (incremental_test_2): Link with no-debug versions.
5448
f48b5fb7
CC
54492011-07-06 Cary Coutant <ccoutant@google.com>
5450
5451 * gold/incremental.cc
5452 (Output_section_incremental_inputs::write_info_blocks): Check for
5453 hidden and internal symbols.
5454
221597a5
CC
54552011-07-06 Cary Coutant <ccoutant@google.com>
5456
5457 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
5458 Check disposition for startup file.
5459 (Incremental_inputs::report_command_line): Ignore
5460 --incremental-startup-unchanged option.
5461 * options.cc (General_options::parse_incremental_startup_unchanged):
5462 New function.
5463 (General_options::General_options): Initialize new data member.
5464 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
5465 (General_options): Add --incremental-startup-unchanged option.
5466 (General_options::incremental_startup_disposition): New function.
5467 (General_options::incremental_startup_disposition_): New data member.
5468
e24719f6
CC
54692011-07-06 Cary Coutant <ccoutant@google.com>
5470
5471 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
5472 input file index to Script_info ctor.
5473 (Sized_incremental_binary::do_file_has_changed): Find the
5474 command-line argument for files named in scripts.
5475 * incremental.h (Script_info::Script_info): New ctor
5476 with input file index.
5477 (Script_info::input_file_index): New function.
5478 (Script_info::input_file_index_): New data member.
5479 (Incremental_binary::get_library): Add const.
5480 (Incremental_binary::get_script_info): Add const.
5481 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
5482 * testsuite/Makefile.am (incremental_test_5): New test case.
5483 (incremental_test_6): New test case.
5484 * testsuite/Makefile.in: Regenerate.
5485
8f7c81e8
CC
54862011-07-06 Cary Coutant <ccoutant@google.com>
5487
5488 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
5489 debug output when command lines differ.
5490
9fbd3822
CC
54912011-07-06 Cary Coutant <ccoutant@google.com>
5492
5493 * incremental.cc (Incremental_inputs::report_command_line): Ignore
5494 --incremental-patch option.
5495 * layout.cc (Free_list::allocate): Extend allocation beyond original
5496 end if enabled.
5497 (Layout::make_output_section): Mark sections that should get
5498 patch space.
5499 * options.cc (parse_percent): New function.
5500 * options.h (parse_percent): New function.
5501 (DEFINE_percent): New macro.
5502 (General_options): Add --incremental-patch option.
5503 * output.cc (Output_section::Output_section): Initialize new data
5504 members.
5505 (Output_section::add_input_section): Print section name when out
5506 of patch space.
5507 (Output_section::add_output_section_data): Likewise.
5508 (Output_section::set_final_data_size): Add patch space when
5509 doing --incremental-full.
5510 (Output_section::do_reset_address_and_file_offset): Remove patch
5511 space.
5512 (Output_segment::set_section_list_addresses): Print debug output
5513 only if --incremental-update.
5514 * output.h (Output_section::set_is_patch_space_allowed): New function.
5515 (Output_section::is_patch_space_allowed_): New data member.
5516 (Output_section::patch_space_): New data member.
5517 * parameters.cc (Parameters::incremental_full): New function.
5518 * parameters.h (Parameters::incremental_full): New function
5519 * testsuite/Makefile.am (incremental_test_2): Add test for
5520 --incremental-patch option.
5521 * testsuite/Makefile.in: Regenerate.
5522 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
5523 (t18): Remove function body.
5524
f6cccc2c
DK
55252011-07-05 Doug Kwan <dougkwan@google.com>
5526
5527 PR gold/12771
5528 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
5529 Arm_Address type for relocation result.
5530 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
5531 overflow check.
5532 (Arm_relocate_functions::abs32): Use unaligned access.
5533 (Arm_relocate_functions::rel32): Ditto.
5534 (Arm_relocate_functions::prel31): Ditto.
5535 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
5536 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
5537 static data relocations.
5538 * testsuite/Makefile.in: Regnerate.
5539 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
5540
28a13fec
ILT
55412011-07-05 Ian Lance Taylor <iant@google.com>
5542
5543 PR gold/12392
5544 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
5545 symbols if necessary.
5546 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5547
24d47b34
ILT
55482011-07-05 Ian Lance Taylor <iant@google.com>
5549
5550 PR gold/12952
5551 * resolve.cc (Symbol::override_base_with_special): Simply override
5552 version with special symbol version, ignoring previous version.
5553
41f9cbbe
ILT
55542011-07-05 Ian Lance Taylor <iant@google.com>
5555
5556 * object.cc (Sized_relobj_file::include_section_group): Add
5557 information to comment about signature location.
5558
886288f1
ILT
55592011-07-02 Ian Lance Taylor <iant@google.com>
5560
5561 PR gold/12957
5562 * options.h (class General_options): Add -f and -F.
5563 * options.cc (General_options::finalize): Fatal error if -f/-F
5564 are used without -shared.
5565 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
5566
ae3a6d4f
ILT
55672011-07-02 Ian Lance Taylor <iant@google.com>
5568
5569 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
5570
21131061
ILT
55712011-07-01 Ian Lance Taylor <iant@google.com>
5572
5573 PR gold/12525
5574 PR gold/12952
5575 * resolve.cc (Symbol::override_base_with_special): Don't override
5576 the version if the overriding symbol has a different name.
5577 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
5578 all callers. If we give an error about an undefined version,
5579 define the base version if necessary.
5580 * dynobj.h (class Versions): Update declaration.
5581 * testsuite/weak_alias_test_5.cc: New file.
5582 * testsuite/weak_alias_test.script: New file.
5583 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
5584 and versioned_alias have the right value, and call t2.
5585 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
5586 weak_alias_test_5.so.
5587 (weak_alias_test_LDADD): Likewise.
5588 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
5589 * testsuite/Makefile.in: Rebuild.
5590
611062c0
ILT
55912011-07-01 Ian Lance Taylor <iant@google.com>
5592
5593 PR gold/12525
5594 * options.h (class General_options): Support -z notext.
5595 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
5596 -Wl,-z,notext.
5597 (two_file_shared_nonpic.so): Likewise.
5598 (two_file_shared_mixed.so): Likewise.
5599 (two_file_shared_mixed_1.so): Likewise.
5600 (weak_undef_lib_nonpic.so): Likewise.
5601 (alt/weak_undef_lib_nonpic.so): Likewise.
5602 (tls_test_shared_nonpic.so): Likewise.
5603 * testsuite/Makefile.in: Rebuild.
5604
328c7c2f
ILT
56052011-07-01 Ian Lance Taylor <iant@google.com>
5606
5607 PR gold/12525
5608 * configure.ac: Test whether static linking works, setting
5609 the automake conditional HAVE_STATIC.
5610 * testsuite/Makefile.am: Disable tests using -static if
5611 HAVE_STATIC is not true.
5612 * configure, testsuite/Makefile.in: Rebuild.
5613
02d7cd44
ILT
56142011-07-01 Ian Lance Taylor <iant@google.com>
5615
5616 PR gold/12525
5617 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
5618 Assert if we see DW_EH_PE_indirect.
5619 * target.h (Target::ehframe_datarel_base): New function.
5620 (Target::do_ehframe_datarel_base): New target function.
5621 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
5622 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
5623 function.
5624
07a60597
ILT
56252011-07-01 Ian Lance Taylor <iant@google.com>
5626
5627 PR gold/12571
5628 * options.h (class General_options): Add
5629 --ld-generated-unwind-info.
5630 * ehframe.cc (Fde::write): Add address parameter. Change all
5631 callers. If associated with PLT, fill in address and size.
5632 (Cie::set_output_offset): Only add merge mapping if there is an
5633 object.
5634 (Cie::write): Add address parameter. Change all callers.
5635 (Eh_frame::add_ehframe_for_plt): New function.
5636 * ehframe.h (class Fde): Update declarations. Move shndx_ and
5637 input_offset_ fields into union u_, with new plt field.
5638 (Fde::Fde): Adjust for new union field.
5639 (Fde::Fde) [Output_data version]: New constructor.
5640 (Fde::add_mapping): Only add merge mapping if there is an object.
5641 (class Cie): Update declarations.
5642 (class Eh_frame): Declare add_ehframe_for_plt.
5643 * layout.cc (Layout::layout_eh_frame): Break out code into
5644 make_eh_frame_section, and call it.
5645 (Layout::make_eh_frame_section): New function.
5646 (Layout::add_eh_frame_for_plt): New function.
5647 * layout.h (class Layout): Update declarations.
5648 * merge.cc (Merge_map::add_mapping): Add assertion.
5649 * i386.cc: Include "dwarf.h".
5650 (class Output_data_plt_i386): Make first_plt_entry,
5651 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
5652 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5653 and plt_eh_frame_fde.
5654 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
5655 boundary. Call add_eh_frame_for_plt if appropriate.
5656 * x86_64.cc: Include "dwarf.h".
5657 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
5658 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
5659 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5660 and plt_eh_frame_fde.
5661 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
5662 appropriate.
5663
14788a3f
ILT
56642011-06-29 Ian Lance Taylor <iant@google.com>
5665
5666 PR gold/12629
5667 * object.cc (Sized_relobj_file::layout_section): Change shdr
5668 parameter to be const.
5669 (Sized_relobj_file::layout_eh_frame_section): New function, broken
5670 out of do_layout.
5671 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
5672 appropriate. Call layout_eh_frame_section.
5673 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
5674 sections.
5675 * object.h (class Sized_relobj_file): Update declarations.
5676
6c21fce1
ILT
56772011-06-29 Ian Lance Taylor <iant@google.com>
5678
37e41b03 5679 PR gold/12652
6c21fce1
ILT
5680 * script.cc (Token::integer_value): Accept trailing M/m/K/k
5681 modifier.
5682 (Lex::gather_token): Accept trailing M/m/K/k for integers.
5683
4d5e4e62
ILT
56842011-06-29 Ian Lance Taylor <iant@google.com>
5685
5686 PR gold/12675
5687 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
5688 SHT_X86_64_UNWIND.
5689 * layout.cc (Layout::layout_eh_frame): Likewise.
5690
886f533a
ILT
56912011-06-29 Ian Lance Taylor <iant@google.com>
5692
5693 PR gold/12695
5694 * layout.cc (Layout::symtab_section_shndx): New function.
5695 * layout.h (class Layout): Declare symtab_section_shndx.
5696 * output.cc (Output_section::write_header): Call it.
5697
f3ae1b28
ILT
56982011-06-29 Ian Lance Taylor <iant@google.com>
5699
5700 PR gold/12818
5701 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
5702 symbols which are not used in a relocation.
5703
aecf301f
ILT
57042011-06-28 Ian Lance Taylor <iant@google.com>
5705
5706 PR gold/12898
5707 * layout.cc (Layout::segment_precedes): Don't crash if a linker
5708 script create indistinguishable segments.
5709 (Layout::set_segment_offsets): Use stable_sort when sorting
5710 segments. Pass this to Compare_segments constructor.
5711 * layout.h (class Layout): Make segment_precedes non-static.
5712 (class Compare_segments): Change from struct to class. Add
5713 layout_ field. Add constructor.
5714 * script-sections.cc
5715 (Script_sections::attach_sections_using_phdrs_clause): Rename
5716 local orphan to is_orphan. Don't report failure to put empty
5717 section in segment. On attachment failure, report name of
5718 section, and attach to first PT_LOAD segment.
5719
03ef7571
ILT
57202011-06-28 Ian Lance Taylor <iant@google.com>
5721
5722 PR gold/12934
5723 * target-select.cc (Target_selector::Target_selector): Add
5724 emulation parameter. Change all callers.
5725 (select_target_by_bfd_name): Rename from select_target_by_name.
5726 Change all callers.
5727 (select_target_by_emulation): New function.
5728 (supported_emulation_names): New function.
5729 * target-select.h (class Target_selector): Add emulation_ field.
5730 Update declarations.
5731 (Target_selector::recognize_by_bfd_name): Rename from
5732 recognize_by_name. Change all callers.
5733 (Target_selector::supported_bfd_names): Rename from
5734 supported_names. Change all callers.
5735 (Target_selector::recognize_by_emulation): New function.
5736 (Target_selector::supported_emulations): New function.
5737 (Target_selector::emulation): New function.
5738 (Target_selector::do_recognize_by_bfd_name): Rename from
5739 do_recognize_by_name. Change all callers.
5740 (Target_selector::do_supported_bfd_names): Rename from
5741 do_supported_names. Change all callers.
5742 (Target_selector::do_recognize_by_emulation): New function.
5743 (Target_selector::do_supported_emulations): New function.
5744 (select_target_by_bfd_name): Change name in declaration.
5745 (select_target_by_emulation): Declare.
5746 (supported_emulation_names): Declare.
5747 * parameters.cc (parameters_force_valid_target): Try to find
5748 target based on emulation from -m option.
5749 * options.h (class General_options): Change doc string for -m.
5750 * options.cc (help): Print emulations.
5751 (General_options::parse_V): Likewise.
5752 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
5753 Add emulation parameter. Change all callers.
5754
200b2bb9
ILT
57552011-06-28 Ian Lance Taylor <iant@google.com>
5756
5757 * target.h (class Target): Add osabi_ field.
5758 (Target::osabi): New function.
5759 (Target::set_osabi): New function.
5760 (Target::Target): Initialize osabi_.
5761 (Target::do_adjust_elf_header): Make pure virtual.
5762 (Sized_target::do_adjust_elf_header): Declare.
5763 * target.cc (Sized_target::do_adjust_elf_header): New function.
5764 (class Sized_target): Instantiate all versions.
5765 * freebsd.h (class Target_freebsd): Remove.
5766 (Target_selector_freebsd::do_recognize): Call set_osabi on
5767 Target.
5768 (Target_selector_freebsd::do_recognize_by_name): Likewise.
5769 (Target_selector_freebsd::set_osabi): Remove.
5770 * i386.cc (class Target_i386): Inherit from Sized_target rather
5771 than Target_freebsd.
5772 * x86_64.cc (class Target_x86_64): Likewise.
5773
b3ce541e
ILT
57742011-06-28 Ian Lance Taylor <iant@google.com>
5775
5776 * target.h (Target::can_check_for_function_pointers): Rewrite.
5777 Make non-virtual.
5778 (Target::can_icf_inline_merge_sections): Likewise.
5779 (Target::section_may_have_icf_unsafe_poineters): Likewise.
5780 (Target::Target_info): Add can_icf_inline_merge_sections field.
5781 (Target::do_can_check_for_function_pointers): New virtual
5782 function.
5783 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
5784 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
5785 from can_check_for_function_pointers, move in file.
5786 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
5787 section_may_have_icf_unsafe_poineters, move in file.
5788 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
5789 * i386.cc (Target_i386::do_can_check_for_function_pointers):
5790 Rename from can_check_for_function_pointers, move in file.
5791 (Target_i386::can_icf_inline_merge_sections): Remove.
5792 (Target_i386::i386_info): Initialize
5793 can_icf_inline_merge_sections.
5794 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
5795 Initialize can_icf_inline_merge_sections.
5796 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
5797 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
5798 Rename from can_check_for_function_pointers, move in file.
5799 (Target_x86_64::can_icf_inline_merge_sections): Remove.
5800 (Target_x86_64::x86_64_info): Initialize
5801 can_icf_inline_merge_sections.
5802 * testsuite/testfile.cc (Target_test::test_target_info):
5803 Likewise.
5804 * icf.cc (get_section_contents): Correct formatting.
5805
6d1c4efb
ILT
58062011-06-27 Ian Lance Taylor <iant@google.com>
5807
5808 * symtab.cc (Symbol::versioned_name): New function.
5809 (Symbol_table::add_to_final_symtab): Use versioned_name when
5810 appropriate.
5811 (Symbol_table::sized_write_symbol): Likewise.
5812 * symtab.h (class Symbol): Declare versioned_name.
5813 * stringpool.h (class Stringpool_template): Add variant of add
5814 which takes a std::basic_string.
5815 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
5816 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
5817 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
5818 (ver_test_12.o): New target.
5819 * testsuite/Makefile.in: Rebuild.
5820
57eb9b50
DK
58212011-06-27 Doug Kwan <dougkwan@google.com>
5822
5823 * arm.cc (Arm_relocate_functions::thm_jump8,
5824 Arm_relocate_functions::thm_jump11): Use a wider signed
5825 type to compute offset.
5826 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
5827 arm_thm_jump8.
5828 * testsuite/Makefile.in: Regenerate.
5829 * testsuite/arm_branch_in_range.sh: Check test results of
5830 arm_thm_jump11 and arm_thm_jump8.
5831 * testsuite/arm_thm_jump11.s: New test source file.
5832 * testsuite/arm_thm_jump11.t: New linker script.
5833 * testsuite/arm_thm_jump8.s: New test source file.
5834 * testsuite/arm_thm_jump8.t: New linker script.
5835
487b39df
ILT
58362011-06-24 Ian Lance Taylor <iant@google.com>
5837
5838 * layout.cc: Include "object.h".
5839 (ctors_sections_in_init_array): New static variable.
5840 (Layout::is_ctors_in_init_array): New function.
5841 (Layout::layout): Add entry to ctors_sections_in_init_array if
5842 appropriate.
5843 * layout.h (class Layout): Declare is_ctors_in_init_array.
5844 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
5845 is_ctors_reverse_view is set.
5846 (Sized_relobj_file::write_sections): Add layout parameter. Change
5847 all callers. Set is_ctors_reverse_view field of View_size.
5848 (Sized_relobj_file::reverse_words): New function.
5849 * object.h (Sized_relobj_file::View_size): Add
5850 is_ctors_reverse_view field.
5851 (class Sized_relobj_file): Update declarations.
5852 * testsuite/initpri3.c: New test.
5853 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
5854 initpri3b.
5855 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
5856 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
5857 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
5858 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
5859 * testsuite/Makefile.in: Rebuild.
5860
472076e4
CC
58612011-06-24 Cary Coutant <ccoutant@google.com>
5862
5863 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
5864 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
5865 (debug_msg_cdebug.err): New targets.
5866 * testsuite/Makefile.in: Regenerate.
5867 * testsuite/debug_msg.sh: Check output of link with compressed debug.
5868 Fix checks for link with shared library.
5869
a60af0db
DK
58702011-06-24 Doug Kwan <dougkwan@google.com>
5871
5872 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
5873 skip empty text sections.
5874 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
5875
5393d741
ILT
58762011-06-22 Ian Lance Taylor <iant@google.com>
5877
5878 PR gold/12910
5879 * options.h (class General_options): Add --ctors-in-init-array.
5880 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
5881 friends as SHT_PROGBITS for merging sections.
5882 (Layout::layout): Remove special handling of .init_array and
5883 friends. Don't sort if doing relocatable link. Sort for .ctors
5884 and .dtors if ctors_in_init_array.
5885 (Layout::make_output_section): Force correct section types for
5886 .init_array and friends. Don't sort if doing relocatable link,
5887 Don't sort .ctors and .dtors if ctors_in_init_array.
5888 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
5889 (Layout::output_section_name): Add relobj parameter. Change all
5890 callers. Handle .ctors. and .dtors. in code rather than table.
5891 Handle .ctors and .dtors if ctors_in_init_array.
5892 (Layout::match_file_name): New function, moved from output.cc.
5893 * layout.h (class Layout): Update declarations.
5894 * output.cc: Include "layout.h".
5895 (Input_section_sort_entry::get_priority): New function.
5896 (Input_section_sort_entry::match_file_name): Just call
5897 Layout::match_file_name.
5898 (Output_section::Input_section_sort_init_fini_compare::operator()):
5899 Handle .ctors and .dtors. Sort by explicit priority rather than
5900 by name.
5901 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
5902 * testsuite/initpri2.c: New test.
5903 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
5904 (check_PROGRAMS): Add initpri2.
5905 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
5906 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
5907 * configure, testsuite/Makefile.in: Rebuild.
5908
e1f74f98
ILT
59092011-06-19 Ian Lance Taylor <iant@google.com>
5910
5911 PR gold/12880
5912 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
5913 .interp section to a PT_INTERP segment even if we have seen a
5914 --dynamic-linker option. Don't do it if we have seen a PHDRS
5915 clause in a linker script.
5916 (Layout::finalize): Don't create a .interp section if we've
5917 already create a PT_INTERP segment.
5918 (Layout::create_interp): Always call choose_output_section (revert
5919 patch of 2011-06-17). Don't create PT_INTERP segment.
5920 * script-sections.cc
5921 (Script_sections::create_note_and_tls_segments): Add a .interp
5922 section to a PT_INTERP segment even if we have seen a
5923 --dynamic-linker option.
5924
766f91bb
ILT
59252011-06-18 Ian Lance Taylor <iant@google.com>
5926
5927 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
5928 merely because a non-PT_LOAD segment has a dynamic reloc.
5929
0d212c3a
ILT
59302011-06-18 Ian Lance Taylor <iant@google.com>
5931
5932 * layout.cc (Layout::finish_dynamic_section): Don't create
5933 DT_FLAGS entry if not needed.
5934
911a5072
ILT
59352011-06-18 Ian Lance Taylor <iant@google.com>
5936
5937 PR gold/12745
5938 * layout.cc (Layout::layout_eh_frame): Correct handling of
5939 writable .eh_frame section.
5940
534b4e5f
ILT
59412011-06-17 Ian Lance Taylor <iant@google.com>
5942
5943 PR gold/12893
5944 * resolve.cc (Symbol_table::resolve): Don't give an error if a
5945 symbol is redefined with the exact same object and value.
5946
10b4f102
ILT
59472011-06-17 Ian Lance Taylor <iant@google.com>
5948
5949 PR gold/12880
5950 * layout.h (class Layout): Add interp_segment_ field.
5951 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
5952 (Layout::attach_allocated_section_to_segment): If making shared
5953 library, put .interp section in PT_INTERP segment.
5954 (Layout::finalize): Also call create_interp if -dynamic-linker
5955 option was used.
5956 (Layout::create_interp): Assert that there is no PT_INTERP
5957 segment. If not using a SECTIONS clause, use make_output_section.
5958 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
5959 * script-sections.cc
5960 (Script_sections::create_note_and_tls_segments): If making shared
5961 library, put .interp section in PT_INTERP segment.
5962
a29b0dad
ILT
59632011-06-17 Ian Lance Taylor <iant@google.com>
5964
e588ea8d
ILT
5965 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
5966 when making a shared library.
5967
59682011-06-17 Ian Lance Taylor <iant@google.com>
5969
5970 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
5971 parameter. Change all callers. Don't issue warning about PC32
5972 against locally defined symbol.
a29b0dad 5973
9d3b0698
ILT
59742011-06-16 Ian Lance Taylor <iant@google.com>
5975
5976 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
5977 occurs in same object.
5978
85b0f90c
AM
59792011-06-14 Alan Modra <amodra@gmail.com>
5980
5981 * po/POTFILES.in: Regenerate.
5982
a94907d9
ILT
59832011-06-09 Ian Lance Taylor <iant@google.com>
5984
5985 * script-sections.cc
5986 (Orphan_output_section::set_section_addresses): For a relocatable
5987 link set address to 0.
5988
4fb3a1c3
CC
59892011-06-09 Cary Coutant <ccoutant@google.com>
5990
5991 PR gold/12804
5992 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
5993 used with --compress-debug-sections.
5994 * gold/object.cc (Sized_relobj_file::do_layout): Report
5995 uncompressed size of compressed input sections.
5996
61220854
CC
59972011-06-08 Cary Coutant <ccoutant@google.com>
5998
5999 PR gold/12804
6000 * testsuite/two_file_test_2_v1.cc: Change initialization of
6001 v2 to keep it in .data.
6002
e6455dfb
CC
60032011-06-07 Cary Coutant <ccoutant@google.com>
6004
6005 * common.cc (Symbol_table::do_allocate_commons_list): Call
6006 gold_fallback.
6007 * errors.cc (Errors::fatal): Adjust call to gold_exit.
6008 (Errors::fallback): New function.
6009 (gold_fallback): New function.
6010 * errors.h (Errors::fallback): New function.
6011 * gold.cc (gold_exit): Change status parameter to enum; adjust
6012 all callers.
6013 (queue_initial_tasks): Call gold_fallback.
6014 * gold.h: Include cstdlib.
6015 (Exit_status): New enum type.
6016 (gold_exit): Change status parameter to enum.
6017 (gold_fallback): New function.
6018 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
6019 (Layout::create_symtab_sections): Likewise.
6020 (Layout::create_shdrs): Likewise.
6021 * main.cc (main): Adjust call to gold_exit.
6022 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
6023 (Output_data_got::add_got_entry_pair): Likewise.
6024 (Output_section::add_input_section): Likewise.
6025 (Output_section::add_output_section_data): Likewise.
6026 (Output_segment::set_section_list_addresses): Likewise.
6027 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
6028
fb0e076f
CC
60292011-06-07 Cary Coutant <ccoutant@google.com>
6030
6031 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
6032 for incremental links.
6033 * output.cc (Output_segment::set_section_list_addresses): Remove
6034 FIXME and test for TLS or BSS.
6035
a5ee4d5d
CC
60362011-06-07 Cary Coutant <ccoutant@google.com>
6037
6038 * testsuite/Makefile.am: Add incremental_copy_test,
6039 incremental_common_test_1.
6040 * testsuite/Makefile.in: Regenerate.
6041 * testsuite/common_test_1_v1.c: New source file.
6042 * testsuite/common_test_1_v2.c: New source file.
6043 * testsuite/copy_test_v1.cc: New source file.
6044
5146f448
CC
60452011-06-07 Cary Coutant <ccoutant@google.com>
6046
6047 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
6048 update, allocate common from bss section's free list.
6049 * incremental-dump.cc (dump_incremental_inputs): Print flag for
6050 linker-defined symbols.
6051 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
6052 Skip GOT and PLT entries that are no longer referenced.
6053 (Output_section_incremental_inputs::write_info_blocks): Mark
6054 linker-defined symbols.
6055 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
6056 * output.cc (Output_section::allocate): New function.
6057 * output.h (Output_section::allocate): New function.
6058 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
6059 linker-defined symbols.
6060 (Symbol::override_base_with_special): Copy is_predefined_ flag.
6061 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
6062 (Symbol::init_base_output_data): Likewise.
6063 (Symbol::init_base_output_segment): Likewise.
6064 (Symbol::init_base_constant): Likewise.
6065 (Sized_symbol::init_output_data): Likewise.
6066 (Sized_symbol::init_output_segment): Likewise.
6067 (Sized_symbol::init_constant): Likewise.
6068 (Symbol_table::do_define_in_output_data): Likewise.
6069 (Symbol_table::do_define_in_output_segment): Likewise.
6070 (Symbol_table::do_define_as_constant): Likewise.
6071 * symtab.h (Symbol::is_predefined): New function.
6072 (Symbol::init_base_output_data): Add is_predefined parameter.
6073 (Symbol::init_base_output_segment): Likewise.
6074 (Symbol::init_base_constant): Likewise.
6075 (Symbol::is_predefined_): New data member.
6076 (Sized_symbol::init_output_data): Add is_predefined parameter.
6077 (Sized_symbol::init_output_segment): Likewise.
6078 (Sized_symbol::init_constant): Likewise.
6079 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
6080
26d3c67d
CC
60812011-06-07 Cary Coutant <ccoutant@google.com>
6082
6083 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
6084 instead of emit_copy_reloc.
6085 (Copy_relocs::emit_copy_reloc): Refactor.
6086 (Copy_relocs::make_copy_reloc): New function.
6087 (Copy_relocs::add_copy_reloc): Remove.
6088 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
6089 section.
6090 (Copy_relocs::make_copy_reloc): New function.
6091 (Copy_relocs::add_copy_reloc): Remove.
6092 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
6093 unchanged input files.
6094 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
6095 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
6096 Reserve BSS space for COPY relocations.
6097 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6098 (Output_section_incremental_inputs::write_info_blocks): Record
6099 whether a symbol is copied from a shared object.
6100 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
6101 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
6102 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
6103 (Incremental_input_entry_reader::get_output_symbol_index): Add
6104 is_copy parameter.
6105 (Incremental_binary::emit_copy_relocs): New function.
6106 (Incremental_binary::do_emit_copy_relocs): New function.
6107 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6108 new data member.
6109 (Sized_incremental_binary::add_copy_reloc): New function.
6110 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6111 (Sized_incremental_binary::Copy_reloc): New struct.
6112 (Sized_incremental_binary::Copy_relocs): New typedef.
6113 (Sized_incremental_binary::copy_relocs_): New data member.
6114 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
6115 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
6116 * target.h (Sized_target::emit_copy_reloc): New function.
6117 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
6118
7cdb37d9
CC
61192011-06-02 Cary Coutant <ccoutant@google.com>
6120
6121 PR gold/12163
6122 * gold/archive.cc (Archive::Archive): Initialize new data member.
6123 (Archive::include_all_members): Return if archive has already been
6124 included.
6125 * gold/archive.h (Archive::include_all_members_): New data member.
6126
cc643b88
NC
61272011-06-02 Nick Clifton <nickc@redhat.com>
6128
6129 * dynobj.h: Fix spelling mistake in comment.
6130 * output.cc: Likewise.
6131
f62a3ca7 61322011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 6133 Asier Llano
f62a3ca7
DK
6134
6135 PR gold/12826
cc643b88 6136 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
6137 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
6138 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
6139 redundant arm_exidx_test.so.
6140 * testsuite/Makefile.in: Regenerate.
6141 (check_SCRIPTS): Add pr12826.sh
6142 (check_DATA): Add pr12826.stdout
6143 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
6144 * testsuite/pr12826.sh: New file.
6145 * testsuite/pr12826_1.s: Ditto.
6146 * testsuite/pr12826_1.s: Ditto.
6147
8dbe1edc
ILT
61482011-05-30 Ian Lance Taylor <iant@google.com>
6149
6150 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
6151 sections.
6152
c49875be
ILT
61532011-05-29 Ian Lance Taylor <iant@google.com>
6154
6155 PR gold/12804
6156 * testsuite/Makefile.am: Use different file name for two_file_test
6157 temporary file for each incremental test.
6158 * testsuite/Makefile.in: Rebuild.
6159
69d53f7a
ILT
61602011-05-29 Ian Lance Taylor <iant@google.com>
6161
6162 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
6163 binary input file is empty.
6164
41d0ab5f
ILT
61652011-05-27 Ian Lance Taylor <iant@google.com>
6166
6167 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
6168 (ver_test_9.so): Likewise.
6169 * testsuite/Makefile.in: Rebuild.
6170
89d8a36b
CC
61712011-05-26 Cary Coutant <ccoutant@google.com>
6172
6173 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
6174 * incremental.cc (Incremental_inputs::report_input_section): Fix
6175 comment, indentation.
6176 (Incremental_inputs::report_comdat_group): New function.
6177 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6178 of data for incremental input file entry.
6179 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
6180 group count, COMDAT group signatures.
6181 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
6182 an unchanged input file.
6183 * incremental.h (Incremental_object_entry::Incremental_object_entry):
6184 Initialize new data member.
6185 (Incremental_object_entry::add_comdat_group): New function.
6186 (Incremental_object_entry::get_comdat_group_count): New function.
6187 (Incremental_object_entry::get_comdat_signature_key): New function.
6188 (Incremental_object_entry::groups_): New data member.
6189 (Incremental_inputs::report_comdat_group): New function.
6190 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
6191 data for incremental input file entry.
6192 (Incremental_input_entry_reader::get_comdat_group_count): New function.
6193 (Incremental_input_entry_reader::get_input_section): Adjust size of
6194 data for incremental input file entry.
6195 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
6196 (Incremental_input_entry_reader::get_comdat_group_signature): New
6197 function.
6198 * object.cc (Sized_relobj::include_section_group): Report kept
6199 COMDAT groups for incremental links.
6200
1706a06f
ILT
62012011-05-24 David Meyer <pdox@google.com>
6202
6203 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
6204 with name parameter. Add found_name parameter.
6205 * fileread.cc (Input_file::find_file): Adjust code accordingly.
6206 * dirsearch.h (class Dirsearch): Update declaration.
6207
a10ae760
ILT
62082011-05-24 Ian Lance Taylor <iant@google.com>
6209
6210 * archive.cc (Library_base::should_include_member): Pull in object
6211 from archive if it defines the entry symbol.
6212 * parameters.cc (Parameters::entry): New function.
6213 * parameters.h (class Parameters): Declare entry.
6214 * output.h (class Output_file_header): Remove entry_ field.
6215 * output.cc (Output_file_header::Output_file_header): Remove entry
6216 parameter. Change all callers.
6217 (Output_file_header::entry): Use parameters->entry.
6218 * gold.cc (queue_middle_tasks): Likewise.
6219 * plugin.cc (Plugin_hook::run): Likewise.
6220
aa92d6ed
CC
62212011-05-24 Cary Coutant <ccoutant@google.com>
6222
6223 * gold.cc (queue_initial_tasks): Pass incremental base filename
6224 to Output_file::open_base_file; don't print error message.
6225 * incremental-dump.cc (main): Adjust call to
6226 Output_file::open_for_modification.
6227 * incremental-dump.cc (main): Likewise.
6228 * incremental.cc (Incremental_inputs::report_command_line):
6229 Ignore --incremental-base option when comparing command lines.
6230 Ignore parameter when given as separate argument.
6231 * options.h (class General_options): Add --incremental-base.
6232 * output.cc (Output_file::Output_file):
6233 (Output_file::open_base_file): Add base_name and writable parameters;
6234 read base file into new file; print error message here.
6235 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6236 callers.
6237 * output.h (Output_file::open_for_modification): Rename to...
6238 (Output_file::open_base_file): ...this; add base_name and
6239 writable parameters; adjust all callers.
6240 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6241 callers.
6242 * testsuite/Makefile.am (incremental_test_4): Test
6243 --incremental-base.
6244 * testsuite/Makefile.in: Regenerate.
6245
2eedd706
CC
62462011-05-24 Cary Coutant <ccoutant@google.com>
6247
6248 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
6249 incremental_test_4.
6250 * testsuite/Makefile.in: Regenerate.
6251 * testsuite/two_file_test_1_v1.cc: New test source file.
6252 * testsuite/two_file_test_1b_v1.cc: New test source file.
6253 * testsuite/two_file_test_2_v1.cc: New test source file.
6254
0f1c85a6
CC
62552011-05-24 Cary Coutant <ccoutant@google.com>
6256
6257 * dynobj.h (Dynobj::do_dynobj): New function.
6258 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
6259 flag and soname for shared objects.
6260 * incremental.cc (Incremental_inputs::report_object): Make
6261 either Incremental_object_entry or Incremental_dynobj_entry; add
6262 soname to string table.
6263 (Incremental_inputs::report_input_section): Add assertion.
6264 (Output_section_incremental_inputs::set_final_data_size): Adjust
6265 type of input file entry for shared libraries; adjust size of
6266 shared library info entry.
6267 (Output_section_incremental_inputs::write_input_files): Write
6268 as_needed flag for shared libraries.
6269 (Output_section_incremental_inputs::write_info_blocks): Adjust type
6270 of input file entry for shared libraries; write soname.
6271 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
6272 soname from incremental info.
6273 * incremental.h (enum Incremental_input_flags): Add
6274 INCREMENTAL_INPUT_AS_NEEDED.
6275 (Incremental_input_entry::Incremental_input_entry): Initialize new
6276 data member.
6277 (Incremental_input_entry::set_as_needed): New function.
6278 (Incremental_input_entry::as_needed): New function.
6279 (Incremental_input_entry::do_dynobj_entry): New function.
6280 (Incremental_input_entry::as_needed_): New data member.
6281 (Incremental_object_entry::Incremental_object_entry): Don't check
6282 for shared library.
6283 (Incremental_object_entry::do_type): Likewise.
6284 (class Incremental_dynobj_entry): New class.
6285 (Incremental_input_entry_reader::as_needed): New function.
6286 (Incremental_input_entry_reader::get_soname): New function.
6287 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
6288 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
6289 size of shared library info entry.
58797674 6290 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
6291 incremental link when adding DT_NEEDED entries.
6292 * object.h (Object::Object): Initialize new data member.
6293 (Object::dynobj): New function.
6294 (Object::set_as_needed): New function.
6295 (Object::as_needed): New function.
6296 (Object::do_dynobj): New function.
6297 (Object::as_needed_): New data member.
6298
6fa2a40b
CC
62992011-05-24 Cary Coutant <ccoutant@google.com>
6300
6301 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
6302 info; adjust display of GOT entries.
6303 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6304 vector of input objects; remove file_status_.
6305 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
6306 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
6307 got_plt reader; call target hooks to reserve GOT entries.
6308 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6309 of input file info header and GOT info entry.
6310 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
6311 relocation info.
6312 (Got_plt_view_info::got_descriptor): Remove.
6313 (Got_plt_view_info::sym_index): New data member.
6314 (Got_plt_view_info::input_index): New data member.
6315 (Local_got_offset_visitor::visit): Write input file index.
6316 (Global_got_offset_visitor::visit): Write 0 for input file index.
6317 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
6318 with sym_index and input_index.
6319 (Output_section_incremental_inputs::write_got_plt): Adjust size of
6320 incremental info GOT entry; replace got_descriptor with input_index.
6321 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
6322 map from input file index to object.
6323 (Sized_relobj_incr::do_layout): Replace direct data member reference
6324 with accessor function.
6325 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
6326 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
6327 Adjust size of input file info header.
6328 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
6329 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
6330 (Incremental_input_entry_reader::get_input_section): Adjust size of
6331 input file info header.
6332 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
6333 of incremental info GOT entry.
6334 (Incremental_got_plt_reader::get_got_desc): Remove.
6335 (Incremental_got_plt_reader::get_got_symndx): New function.
6336 (Incremental_got_plt_reader::get_got_input_index): New function.
6337 (Sized_incremental_binary::Sized_incremental_binary): Remove
6338 file_status_; add input_objects_.
6339 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
6340 (Sized_incremental_binary::set_file_is_unchanged): Remove.
6341 (Sized_incremental_binary::file_is_unchanged): Remove.
6342 (Sized_incremental_binary::set_input_object): New function.
6343 (Sized_incremental_binary::input_object): New function.
6344 (Sized_incremental_binary::file_status_): Remove.
6345 (Sized_incremental_binary::input_objects_): New data member.
6346 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
6347 references.
6348 (Sized_relobj_incr::invalid_address): Move to base class.
6349 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
6350 class.
6351 (Sized_relobj_incr::do_output_section_offset): Likewise.
6352 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
6353 (Sized_relobj_incr::section_offsets_): Likewise.
6354 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
6355 function.
6356 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
6357 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
6358 with accessor function.
6359 (Sized_relobj_file::do_layout): Likewise.
6360 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
6361 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
6362 (Sized_relobj_file::compute_final_local_value): Replace refs to
6363 section_offsets_ with accessor function.
6364 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
6365 * object.h (Relobj::Relobj): Initialize new data members.
6366 (Relobj::add_dyn_reloc): New function.
6367 (Relobj::first_dyn_reloc): New function.
6368 (Relobj::dyn_reloc_count): New function.
6369 (Relobj::first_dyn_reloc_): New data member.
6370 (Relobj::dyn_reloc_count_): New data member.
6371 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
6372 references.
6373 (Sized_relobj::Address): New typedef.
6374 (Sized_relobj::invalid_address): Move here from child class.
6375 (Sized_relobj::Sized_relobj): Initialize new data members.
6376 (Sized_relobj::sized_relobj): New function.
6377 (Sized_relobj::is_output_section_offset_invalid): Move here from
6378 child class.
6379 (Sized_relobj::get_output_section_offset): Likewise.
6380 (Sized_relobj::local_has_got_offset): Likewise.
6381 (Sized_relobj::local_got_offset): Likewise.
6382 (Sized_relobj::set_local_got_offset): Likewise.
6383 (Sized_relobj::do_for_all_local_got_entries): Likewise.
6384 (Sized_relobj::clear_got_offsets): New function.
6385 (Sized_relobj::section_offsets): Move here from child class.
6386 (Sized_relobj::do_output_section_offset): Likewise.
6387 (Sized_relobj::do_set_section_offset): Likewise.
6388 (Sized_relobj::Local_got_offsets): Likewise.
6389 (Sized_relobj::local_got_offsets_): Likewise.
6390 (Sized_relobj::section_offsets_): Likewise.
6391 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
6392 references.
6393 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
6394 class.
6395 (Sized_relobj_file::sized_relobj): New function
6396 (Sized_relobj_file::local_has_got_offset): Move to base class.
6397 (Sized_relobj_file::local_got_offset): Likewise.
6398 (Sized_relobj_file::set_local_got_offset): Likewise.
6399 (Sized_relobj_file::get_output_section_offset): Likewise.
6400 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
6401 (Sized_relobj_file::do_output_section_offset): Likewise.
6402 (Sized_relobj_file::do_set_section_offset): Likewise.
6403 (Sized_relobj_file::Local_got_offsets): Likewise.
6404 (Sized_relobj_file::local_got_offsets_): Likewise.
6405 (Sized_relobj_file::section_offsets_): Likewise.
6406 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
6407 (all constructors).
6408 (set_needs_dynsym_index): Convert relobj to derived class pointer.
6409 (Output_reloc::get_symbol_index): Likewise.
6410 (Output_reloc::local_section_offset): Likewise.
6411 (Output_reloc::get_address): Likewise.
6412 (Output_reloc::symbol_value): Likewise.
6413 (Output_data_got::reserve_slot): Move to class definition.
6414 (Output_data_got::reserve_local): New function.
6415 (Output_data_got::reserve_slot_for_global): Remove.
6416 (Output_data_got::reserve_global): New function.
6417 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
6418 (all constructors, two instantiations).
6419 (Output_reloc::get_relobj): New function (two instantiations).
6420 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
6421 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
6422 (Output_data_reloc::add_global): Adjust type of relobj.
6423 (Output_data_reloc::add_global_relative): Likewise.
6424 (Output_data_reloc::add_symbolless_global_addend): Likewise.
6425 (Output_data_reloc::add_local): Likewise.
6426 (Output_data_reloc::add_local_relative): Likewise.
6427 (Output_data_reloc::add_symbolless_local_addend): Likewise.
6428 (Output_data_reloc::add_local_section): Likewise.
6429 (Output_data_reloc::add_output_section): Likewise.
6430 (Output_data_reloc::add_absolute): Likewise.
6431 (Output_data_reloc::add_target_specific): Likewise.
6432 (Output_data_got::reserve_slot): Move definition here.
6433 (Output_data_got::reserve_local): New function.
6434 (Output_data_got::reserve_global): New function.
6435 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
6436 section_offsets_ with accessor function.
6437 (Sized_relobj_file::write_sections): Likewise.
6438 (Sized_relobj_file::do_relocate_sections): Likewise.
6439 * target.h (Sized_target::reserve_local_got_entry): New function.
6440 (Sized_target::reserve_global_got_entry): New function.
6441 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
6442 (Target_x86_64::reserve_global_got_entry): New function.
6443 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
6444
4829d394
CC
64452011-05-23 Cary Coutant <ccoutant@google.com>
6446
6447 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
6448 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
6449 bit when checking got_type.
6450 * incremental.cc (Sized_incremental_binary::setup_readers):
6451 Store symbol table and string table locations; initialize bit vector
6452 of file status flags.
6453 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
6454 unchanged files.
6455 (Sized_incremental_binary::do_process_got_plt): New function.
6456 (Sized_incremental_binary::get_symtab_view): Use stored locations.
6457 (Output_section_incremental_inputs::set_final_data_size): Record
6458 file index for each input file.
6459 (Output_section_incremental_inputs::write_got_plt): Store file index
6460 instead of input entry offset for each GOT entry.
6461 * incremental.h
6462 (Incremental_input_entry::Incremental_input_entry): Initialize new
6463 data member.
6464 (Incremental_input_entry::set_offset): Store file index.
6465 (Incremental_input_entry::get_file_index): New function.
6466 (Incremental_input_entry::file_index_): New data member.
6467 (Incremental_binary::process_got_plt): New function.
6468 (Incremental_binary::do_process_got_plt): New function.
6469 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6470 data members.
6471 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
6472 (Sized_incremental_binary::set_file_is_unchanged): New function.
6473 (Sized_incremental_binary::file_is_unchanged): New function.
6474 (Sized_incremental_binary::do_process_got_plt): New function.
6475 (Sized_incremental_binary::file_status_): New data member.
6476 (Sized_incremental_binary::main_symtab_loc_): New data member.
6477 (Sized_incremental_binary::main_strtab_loc_): New data member.
6478 * output.cc (Output_data_got::Got_entry::write): Add case
6479 RESERVED_CODE.
6480 (Output_data_got::add_global): Call add_got_entry.
6481 (Output_data_got::add_global_plt): Likewise.
6482 (Output_data_got::add_global_with_rel): Likewise.
6483 (Output_data_got::add_global_with_rela): Likewise.
6484 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
6485 (Output_data_got::add_global_pair_with_rela): Likewise.
6486 (Output_data_got::add_local): Call add_got_entry.
6487 (Output_data_got::add_local_plt): Likewise.
6488 (Output_data_got::add_local_with_rel): Likewise.
6489 (Output_data_got::add_local_with_rela): Likewise.
6490 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
6491 (Output_data_got::add_local_pair_with_rela): Likewise.
6492 (Output_data_got::reserve_slot): New function.
6493 (Output_data_got::reserve_slot_for_global): New function.
6494 (Output_data_got::add_got_entry): New function.
6495 (Output_data_got::add_got_entry_pair): New function.
6496 (Output_section::add_output_section_data): Edit FIXME.
6497 * output.h
6498 (Output_section_data_build::Output_section_data_build): New
6499 constructor with size parameter.
6500 (Output_data_space::Output_data_space): Likewise.
6501 (Output_data_got::Output_data_got): Initialize new data member; new
6502 constructor with size parameter.
6503 (Output_data_got::add_constant): Call add_got_entry.
6504 (Output_data_got::reserve_slot): New function.
6505 (Output_data_got::reserve_slot_for_global): New function.
6506 (class Output_data_got::Got_entry): Add RESERVED_CODE.
6507 (Output_data_got::add_got_entry): New function.
6508 (Output_data_got::add_got_entry_pair): New function.
6509 (Output_data_got::free_list_): New data member.
6510 * target.h (Sized_target::init_got_plt_for_update): New function.
6511 (Sized_target::register_global_plt_entry): New function.
6512 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
6513 Initialize new data member; call init; add constructor with PLT count.
6514 (Output_data_plt_x86_64::init): New function.
6515 (Output_data_plt_x86_64::add_relocation): New function.
6516 (Output_data_plt_x86_64::reserve_slot): New function.
6517 (Output_data_plt_x86_64::free_list_): New data member.
6518 (Target_x86_64::init_got_plt_for_update): New function.
6519 (Target_x86_64::register_global_plt_entry): New function.
6520 (Output_data_plt_x86_64::add_entry): Allocate from free list for
6521 incremental updates.
6522 (Output_data_plt_x86_64::add_relocation): New function.
6523 * testsuite/object_unittest.cc (Object_test): Set default options.
6524
ec69d6da
ILT
65252011-05-16 Ian Lance Taylor <iant@google.com>
6526
6527 * options.h (class General_options): Make -i a synonym for -r.
6528
732e31de
ILT
65292011-05-16 Ian Lance Taylor <iant@google.com>
6530
6531 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
6532
403676b5
CC
65332011-05-10 Cary Coutant <ccoutant@google.com>
6534
6535 * object.cc (Sized_relobj::do_count_local_symbols): Check for
6536 strip_all (-s).
6537
5b7b7d6e
ILT
65382011-05-06 Ian Lance Taylor <iant@google.com>
6539
6540 * layout.cc (Layout::layout): If the output section flags change,
6541 update the ordering.
6542
f0f9babf
CC
65432011-04-25 Cary Coutant <ccoutant@google.com>
6544
6545 * incremental-dump.cc (dump_incremental_inputs): Print local
6546 symbol info for each input file.
6547 * incremental.cc
6548 (Output_section_incremental_inputs::set_final_data_size): Add local
6549 symbol info to input file entries in incremental info.
6550 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6551 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
6552 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
6553 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
6554 implementation.
6555 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
6556 (Sized_incr_relobj::do_relocate): Write the local symbols.
6557 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
6558 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
6559 Adjust size of input file header.
6560 (Incremental_inputs_reader::get_local_symbol_offset): New function.
6561 (Incremental_inputs_reader::get_local_symbol_count): New function.
6562 (Incremental_inputs_reader::get_input_section): Adjust size of input
6563 file header.
6564 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
6565 (Sized_incr_relobj::This): New typedef.
6566 (Sized_incr_relobj::sym_size): New const data member.
6567 (Sized_incr_relobj::Local_symbol): New struct.
6568 (Sized_incr_relobj::do_output_local_symbol_count): New function.
6569 (Sized_incr_relobj::do_local_symbol_offset): New function.
6570 (Sized_incr_relobj::local_symbol_count_): New data member.
6571 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
6572 (Sized_incr_relobj::local_symbol_index_): New data member.
6573 (Sized_incr_relobj::local_symbol_offset_): New data member.
6574 (Sized_incr_relobj::local_dynsym_offset_): New data member.
6575 (Sized_incr_relobj::local_symbols_): New data member.
6576 * object.h (Relobj::output_local_symbol_count): New function.
6577 (Relobj::local_symbol_offset): New function.
6578 (Relobj::do_output_local_symbol_count): New function.
6579 (Relobj::do_local_symbol_offset): New function.
6580 (Sized_relobj::do_output_local_symbol_count): New function.
6581 (Sized_relobj::do_local_symbol_offset): New function.
6582
d0a9ace3
ILT
65832011-04-22 Vladimir Simonov <sv@sw.ru>
6584
6585 * descriptors.cc (set_close_on_exec): New function.
6586 (Descriptors::open): Use set_close_on_exec.
6587 * output.cc (S_ISLNK): Define if not defined.
6588
94a3fc8b
CC
65892011-04-22 Cary Coutant <ccoutant@google.com>
6590
6591 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6592 global symbol map.
6593 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6594 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
6595 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
6596 relocations.
6597 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
6598 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
6599 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
6600 * incremental.h
6601 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
6602 function.
6603 (Incremental_binary::apply_incremental_relocs): New function.
6604 (Incremental_binary::do_apply_incremental_relocs): New function.
6605 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6606 data member.
6607 (Sized_incremental_binary::add_global_symbol): New function.
6608 (Sized_incremental_binary::global_symbol): New function.
6609 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6610 (Sized_incremental_binary::symbol_map_): New data member.
6611 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
6612 * target.h (Sized_target::apply_relocation): New function.
6613 * target-reloc.h (apply_relocation): New function.
6614 * x86_64.cc (Target_x86_64::apply_relocation): New function.
6615
c87e4302
DK
66162011-04-22 Doug Kwan <dougkwan@google.com>
6617
6618 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
6619 flag of a SHT_ARM_EXIDX section.
2e702c99 6620 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
6621 * testsuite/Makefile.in: Regenerate.
6622 * testsuite/arm_exidx_test.s: New file.
6623 * testsuite/arm_exidx_test.sh: Same.
6624
e7782cf6
CC
66252011-04-20 Cary Coutant <ccoutant@google.com>
6626
6627 PR gold/12689
6628 * archive.h (Incremental_archive_entry::Archive_member):
6629 Initialize arg_serial_ (second constructor).
6630
308ecdc7
ILT
66312011-04-17 Ian Lance Taylor <iant@google.com>
6632
6633 * object.cc (Relocate_info::location): Simplify location string.
6634 * errors.cc (Errors::error_at_location): Don't print program
6635 name.
6636 (Errors::warning_at_location): Likewise.
6637 (Errors::undefined_symbol): Likewise.
6638 * testsuite/debug_msg.sh: Update accordingly.
6639
bec5b579
CC
66402011-04-14 Cary Coutant <ccoutant@google.com>
6641
6642 * gold/layout.cc (Layout::symtab_section_offset): New function.
6643 * gold/layout.h (Layout::symtab_section_offset): New function.
6644 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
6645
88597d34
ILT
66462011-04-12 Ian Lance Taylor <iant@google.com>
6647
6648 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
6649 with MREMAP_MAYMOVE.
6650 * output.h (class Output_file): Add map_is_allocated_ field.
6651 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
6652 not available, provide stubs. If mremap is not available, #define
6653 it to gold_mremap.
6654 (MREMAP_MAYMOVE): Define if not defined.
6655 (Output_file::Output_file): Initialize map_is_allocated_.
6656 (Output_file::resize): Check map_is_allocated_.
6657 (Output_file::map_anonymous): If mmap fails, use malloc.
6658 (Output_file::unmap): Don't do anything for an anonymous map.
6659 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
6660 is not available, provide stubs.
6661 (File_read::View::~View): Use free rather than delete[].
6662 (File_read::make_view): Use malloc rather than new[]. If mmap
6663 fails, use malloc.
6664 (File_read::find_or_make_view): Use malloc rather than new[].
6665 * gold.h: Remove HAVE_REMAP code.
6666 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
6667 exists. Rename mremap to gold_mremap. If mmap is not available
6668 don't do anything.
6669 * configure, config.in: Rebuild.
6670
11e361bc
ILT
66712011-04-11 Ian Lance Taylor <iant@google.com>
6672
6673 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
6674 initialize local variable v.
6675
cdc29364
CC
66762011-04-11 Cary Coutant <ccoutant@google.com>
6677
6678 * archive.cc (Archive::include_member): Adjust call to
6679 report_object.
6680 (Add_archive_symbols::run): Track argument serial numbers.
6681 (Lib_group::include_member): Likewise.
6682 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
6683 * archive.h (Incremental_archive_entry::Archive_member):
6684 Initialize arg_serial_.
6685 (Archive_member::arg_serial_): New data member.
6686 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
6687 (Sized_dynobj::do_add_symbols): Track symbols when doing an
6688 incremental link.
6689 (Sized_dynobj::do_for_all_local_got_entries): New function.
6690 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
6691 function.
6692 * fileread.cc (get_mtime): New function.
6693 * fileread.h (get_mtime): New function.
6694 * gold.cc (queue_initial_tasks): Check for incremental update.
6695 (process_incremental_input): New function.
6696 (queue_middle_tasks): Don't force valid target for incremental
6697 update.
6698 * incremental-dump.cc (find_input_containing_global): Adjust
6699 size of symbol info entry.
6700 (dump_incremental_inputs): Dump argument serial number and
6701 in_system_directory flag; bias shndx by 1; print symbol names
6702 when dumping per-file symbol lists; use new symbol info readers.
6703 * incremental.cc
6704 (Output_section_incremental_inputs:update_data_size): New function.
6705 (Sized_incremental_binary::setup_readers): Setup input readers
6706 for each input file; build maps for files added from libraries
6707 and scripts.
6708 (Sized_incremental_binary::check_input_args): New function.
6709 (Sized_incremental_binary::do_check_inputs): Build map of argument
6710 serial numbers to input arguments.
6711 (Sized_incremental_binary::do_file_has_changed): Rename
6712 do_file_is_unchanged to this; compare file modification times.
6713 (Sized_incremental_binary::do_init_layout): New function.
6714 (Sized_incremental_binary::do_reserve_layout): New function.
6715 (Sized_incremental_binary::do_get_input_reader): Remove.
6716 (Sized_incremental_binary::get_symtab_view): New function.
6717 (Incremental_checker::can_incrementally_link_output_file): Remove.
6718 (Incremental_inputs::report_command_line): Exclude --debug options.
6719 (Incremental_inputs::report_archive_begin): Add parameter; track
6720 argument serial numbers; don't put input file entry for archive
6721 before archive members.
6722 (Incremental_inputs::report_archive_end): Put input file entry
6723 for archive after archive members.
6724 (Incremental_inputs::report_object): Add parameter; track argument
6725 serial numbers and in_system_directory flag.
6726 (Incremental_inputs::report_script): Add parameter; track argument
6727 serial numbers.
6728 (Output_section_incremental_inputs::set_final_data_size): Adjust
6729 size of symbol info entry; check for forwarding symbols.
6730 (Output_section_incremental_inputs::write_input_files): Write
6731 in_system_directory flag and argument serial number.
6732 (Output_section_incremental_inputs::write_info_blocks): Map section
6733 indices between incremental info and original input file; store
6734 input section index for each symbol.
6735 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
6736 change operator() to visit().
6737 (class Global_got_offset_visitor): Likewise.
6738 (class Global_symbol_visitor_got_plt):
6739 (Output_section_incremental_inputs::write_got_plt): Use new visitor
6740 classes.
6741 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
6742 (Sized_incr_relobj::do_read_symbols): New function.
6743 (Sized_incr_relobj::do_layout): New function.
6744 (Sized_incr_relobj::do_layout_deferred_sections): New function.
6745 (Sized_incr_relobj::do_add_symbols): New function.
6746 (Sized_incr_relobj::do_should_include_member): New function.
6747 (Sized_incr_relobj::do_for_all_global_symbols): New function.
6748 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
6749 (Sized_incr_relobj::do_section_size): New function.
6750 (Sized_incr_relobj::do_section_name): New function.
6751 (Sized_incr_relobj::do_section_contents): New function.
6752 (Sized_incr_relobj::do_section_flags): New function.
6753 (Sized_incr_relobj::do_section_entsize): New function.
6754 (Sized_incr_relobj::do_section_address): New function.
6755 (Sized_incr_relobj::do_section_type): New function.
6756 (Sized_incr_relobj::do_section_link): New function.
6757 (Sized_incr_relobj::do_section_info): New function.
6758 (Sized_incr_relobj::do_section_addralign): New function.
6759 (Sized_incr_relobj::do_initialize_xindex): New function.
6760 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
6761 (Sized_incr_relobj::do_read_relocs): New function.
6762 (Sized_incr_relobj::do_gc_process_relocs): New function.
6763 (Sized_incr_relobj::do_scan_relocs): New function.
6764 (Sized_incr_relobj::do_count_local_symbols): New function.
6765 (Sized_incr_relobj::do_finalize_local_symbols): New function.
6766 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
6767 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
6768 (Sized_incr_relobj::do_relocate): New function.
6769 (Sized_incr_relobj::do_set_section_offset): New function.
6770 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
6771 (Sized_incr_dynobj::do_read_symbols): New function.
6772 (Sized_incr_dynobj::do_layout): New function.
6773 (Sized_incr_dynobj::do_add_symbols): New function.
6774 (Sized_incr_dynobj::do_should_include_member): New function.
6775 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
6776 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
6777 (Sized_incr_dynobj::do_section_size): New function.
6778 (Sized_incr_dynobj::do_section_name): New function.
6779 (Sized_incr_dynobj::do_section_contents): New function.
6780 (Sized_incr_dynobj::do_section_flags): New function.
6781 (Sized_incr_dynobj::do_section_entsize): New function.
6782 (Sized_incr_dynobj::do_section_address): New function.
6783 (Sized_incr_dynobj::do_section_type): New function.
6784 (Sized_incr_dynobj::do_section_link): New function.
6785 (Sized_incr_dynobj::do_section_info): New function.
6786 (Sized_incr_dynobj::do_section_addralign): New function.
6787 (Sized_incr_dynobj::do_initialize_xindex): New function.
6788 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
6789 (make_sized_incremental_object): New function.
6790 (Incremental_library::copy_unused_symbols): New function.
6791 (Incremental_library::do_for_all_unused_symbols): New function.
6792 * incremental.h (enum Incremental_input_flags): New type.
6793 (class Incremental_checker): Remove.
6794 (Incremental_input_entry::Incremental_input_entry): Add argument
6795 serial number.
6796 (Incremental_input_entry::arg_serial): New function.
6797 (Incremental_input_entry::set_is_in_system_directory): New function.
6798 (Incremental_input_entry::is_in_system_directory): New function.
6799 (Incremental_input_entry::arg_serial_): New data member.
6800 (Incremental_input_entry::is_in_system_directory_): New data member.
6801 (class Script_info): Move here from script.h.
6802 (Script_info::Script_info): Add filename parameter.
6803 (Script_info::filename): New function.
6804 (Script_info::filename_): New data member.
6805 (Incremental_script_entry::Incremental_script_entry): Add argument
6806 serial number.
6807 (Incremental_object_entry::Incremental_object_entry): Likewise.
6808 (Incremental_object_entry::add_input_section): Build list of input
6809 sections with map to original shndx.
6810 (Incremental_object_entry::get_input_section_index): New function.
6811 (Incremental_object_entry::shndx_): New data member.
6812 (Incremental_object_entry::name_key_): Rename; adjust all refs.
6813 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
6814 (Incremental_archive_entry::Incremental_archive_entry): Add argument
6815 serial number.
6816 (Incremental_inputs::report_archive_begin): Likewise.
6817 (Incremental_inputs::report_object): Likewise.
6818 (Incremental_inputs::report_script): Likewise.
6819 (class Incremental_global_symbol_reader): New class.
6820 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
6821 and store flags and input file type.
6822 (Incremental_input_entry_reader::arg_serial): New function.
6823 (Incremental_input_entry_reader::type): Extract type from flags.
6824 (Incremental_input_entry_reader::is_in_system_directory): New function.
6825 (Incremental_input_entry_reader::get_input_section_count): Call
6826 accessor function for type.
6827 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
6828 function for type; adjust size of global symbol entry.
6829 (Incremental_input_entry_reader::get_global_symbol_count): Call
6830 accessor function for type.
6831 (Incremental_input_entry_reader::get_object_count): Likewise.
6832 (Incremental_input_entry_reader::get_object_offset): Likewise.
6833 (Incremental_input_entry_reader::get_member_count): Likewise.
6834 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
6835 (Incremental_input_entry_reader::get_member_offset): Likewise.
6836 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
6837 (Incremental_input_entry_reader::Global_symbol_info): Remove.
6838 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
6839 (Incremental_input_entry_reader::get_global_symbol_reader): New
6840 function.
6841 (Incremental_input_entry_reader::get_output_symbol_index): New
6842 function.
6843 (Incremental_input_entry_reader::type_): Remove.
6844 (Incremental_input_entry_reader::flags_): New data member.
6845 (Incremental_inputs_reader::input_file_offset): New function.
6846 (Incremental_inputs_reader::input_file_index): New function.
6847 (Incremental_inputs_reader::input_file): Call input_file_offset.
6848 (Incremental_inputs_reader::input_file_at_offset): New function.
6849 (Incremental_relocs_reader::get_r_type): Reformat.
6850 (Incremental_relocs_reader::get_r_shndx): Reformat.
6851 (Incremental_relocs_reader::get_r_offset): Reformat.
6852 (Incremental_relocs_reader::data): New function.
6853 (Incremental_binary::Incremental_binary): Initialize new data members.
6854 (Incremental_binary::check_inputs): Add cmdline parameter.
6855 (Incremental_binary::file_is_unchanged): Remove.
6856 (Input_reader::arg_serial): New function.
6857 (Input_reader::get_unused_symbol_count): New function.
6858 (Input_reader::get_unused_symbol): New function.
6859 (Input_reader::do_arg_serial): New function.
6860 (Input_reader::do_get_unused_symbol_count): New function.
6861 (Input_reader::do_get_unused_symbol): New function.
6862 (Incremental_binary::input_file_count): New function.
6863 (Incremental_binary::get_input_reader): Change signature to use
6864 index instead of filename.
6865 (Incremental_binary::file_has_changed): New function.
6866 (Incremental_binary::get_input_argument): New function.
6867 (Incremental_binary::get_library): New function.
6868 (Incremental_binary::get_script_info): New function.
6869 (Incremental_binary::init_layout): New function.
6870 (Incremental_binary::reserve_layout): New function.
6871 (Incremental_binary::output_file): New function.
6872 (Incremental_binary::do_check_inputs): New function.
6873 (Incremental_binary::do_file_is_unchanged): Remove.
6874 (Incremental_binary::do_file_has_changed): New function.
6875 (Incremental_binary::do_init_layout): New function.
6876 (Incremental_binary::do_reserve_layout): New function.
6877 (Incremental_binary::do_input_file_count): New function.
6878 (Incremental_binary::do_get_input_reader): Change signature.
6879 (Incremental_binary::input_args_map_): New data member.
6880 (Incremental_binary::library_map_): New data member.
6881 (Incremental_binary::script_map_): New data member.
6882 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6883 new data members.
6884 (Sized_incremental_binary::output_section): New function.
6885 (Sized_incremental_binary::inputs_reader): Add const.
6886 (Sized_incremental_binary::symtab_reader): Add const.
6887 (Sized_incremental_binary::relocs_reader): Add const.
6888 (Sized_incremental_binary::got_plt_reader): Add const.
6889 (Sized_incremental_binary::get_symtab_view): New function.
6890 (Sized_incremental_binary::Inputs_reader): New typedef.
6891 (Sized_incremental_binary::Input_entry_reader): New typedef.
6892 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
6893 (Sized_incremental_binary::do_file_is_unchanged): Remove.
6894 (Sized_incremental_binary::do_file_has_changed): New function.
6895 (Sized_incremental_binary::do_init_layout): New function.
6896 (Sized_incremental_binary::do_reserve_layout): New function.
6897 (Sized_input_reader::Inputs_reader): Remove.
6898 (Sized_input_reader::Input_entry_reader): Remove.
6899 (Sized_input_reader::do_arg_serial): New function.
6900 (Sized_input_reader::do_get_unused_symbol_count): New function.
6901 (Sized_input_reader::do_get_unused_symbol): New function.
6902 (Sized_incremental_binary::do_input_file_count): New function.
6903 (Sized_incremental_binary::do_get_input_reader): Change signature;
6904 use index instead of filename.
6905 (Sized_incremental_binary::section_map_): New data member.
6906 (Sized_incremental_binary::input_entry_readers_): New data member.
6907 (class Sized_incr_relobj): New class.
6908 (class Sized_incr_dynobj): New class.
6909 (make_sized_incremental_object): New function.
6910 (class Incremental_library): New class.
6911 * layout.cc (Free_list::num_lists): New static data member.
6912 (Free_list::num_nodes): New static data member.
6913 (Free_list::num_removes): New static data member.
6914 (Free_list::num_remove_visits): New static data member.
6915 (Free_list::num_allocates): New static data member.
6916 (Free_list::num_allocate_visits): New static data member.
6917 (Free_list::init): New function.
6918 (Free_list::remove): New function.
6919 (Free_list::allocate): New function.
6920 (Free_list::dump): New function.
6921 (Free_list::print_stats): New function.
6922 (Layout_task_runner::run): Resize output file for incremental updates.
6923 (Layout::Layout): Initialize new data members.
6924 (Layout::set_incremental_base): New function.
6925 (Layout::init_fixed_output_section): New function.
6926 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
6927 incremental updates.
6928 (Layout::create_gold_note): Do not create gold note section for
6929 incremental updates.
6930 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
6931 for incremental updates.
6932 (Layout::set_section_offsets): For incremental updates, allocate space
6933 from free list.
6934 (Layout::create_symtab_sections): Layout with offsets relative to
6935 start of section; for incremental updates, allocate space from free
6936 list.
6937 (Layout::create_shdrs): For incremental updates, allocate space from
6938 free list.
6939 (Layout::finish_dynamic_section): For incremental updates, do not
6940 check --as-needed (fixed in subsequent patch).
6941 * layout.h (class Free_list): New class.
6942 (Layout::set_incremental_base): New function.
6943 (Layout::incremental_base): New function.
6944 (Layout::init_fixed_output_section): New function.
6945 (Layout::allocate): New function.
6946 (Layout::incremental_base_): New data member.
6947 (Layout::free_list_): New data member.
6948 * main.cc (main): Print Free_list statistics.
6949 * object.cc (Relobj::finalize_incremental_relocs): Add
6950 clear_counts parameter; clear counts only when clear_counts is set.
6951 (Sized_relobj::Sized_relobj): Initialize new base class.
6952 (Sized_relobj::do_layout): Don't report special sections.
6953 (Sized_relobj::do_for_all_local_got_entries): New function.
6954 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
6955 symtab_off to all symbol table offsets.
6956 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
6957 * object.h (class Got_offset_list): Move to top of file.
6958 (Object::Object): Allow case where input_file == NULL.
6959 (Object::~Object): Likewise.
6960 (Object::input_file): Assert that input_file != NULL.
6961 (Object::lock): Allow case where input_file == NULL.
6962 (Object::unlock): Likewise.
6963 (Object::is_locked): Likewise.
6964 (Object::token): Likewise.
6965 (Object::release): Likewise.
6966 (Object::is_incremental): New function.
6967 (Object::get_mtime): New function.
6968 (Object::for_all_local_got_entries): New function.
6969 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
6970 (Object::set_is_in_system_directory): New function.
6971 (Object::is_in_system_directory): New function.
6972 (Object::do_is_incremental): New function.
6973 (Object::do_get_mtime): New function.
6974 (Object::do_for_all_local_got_entries): New function.
6975 (Object::is_in_system_directory_): New data member.
6976 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
6977 (class Sized_relobj_base): New class.
6978 (class Sized_relobj): Derive from Sized_relobj_base.
6979 (class Sized_relobj::Symbols): Redeclare from base class.
6980 (class Sized_relobj::local_got_offset_list): Remove.
6981 (class Sized_relobj::Output_sections): Redeclare from base class.
6982 (class Sized_relobj::do_for_all_local_got_entries): New function.
6983 (class Sized_relobj::write_local_symbols): Add offset parameter.
6984 (class Sized_relobj::local_symbol_offset_): Update comment.
6985 (class Sized_relobj::local_dynsym_offset_): Update comment.
6986 * options.cc (Input_arguments::add_file): Remove const.
6987 * options.h (Input_file_argument::Input_file_argument):
6988 Initialize arg_serial_ (all constructors).
6989 (Input_file_argument::set_arg_serial): New function.
6990 (Input_file_argument::arg_serial): New function.
6991 (Input_file_argument::arg_serial_): New data member.
6992 (Input_arguments::Input_arguments): Initialize file_count_.
6993 (Input_arguments::add_file): Remove const.
6994 (Input_arguments::number_of_input_files): New function.
6995 (Input_arguments::file_count_): New data member.
6996 (Command_line::number_of_input_files): Call
6997 Input_arguments::number_of_input_files.
6998 * output.cc (Output_segment_headers::Output_segment_headers):
6999 Set current size.
7000 (Output_section::Input_section::current_data_size): New function.
7001 (Output_section::Output_section): Initialize new data members.
7002 (Output_section::add_input_section): Don't do merge sections for
7003 an incremental link; allocate space from free list for an
7004 incremental update.
7005 (Output_section::add_output_section_data): Allocate space from
7006 free list for an incremental update.
7007 (Output_section::update_data_size): New function.
7008 (Output_section::set_fixed_layout): New function.
7009 (Output_section::reserve): New function.
7010 (Output_segment::set_section_addresses): Remove const.
7011 (Output_segment::set_section_list_addresses): Remove const; allocate
7012 space from free list for an incremental update.
7013 (Output_segment::set_offset): Adjust size of RELRO segment for an
7014 incremental update.
7015 * output.h (Output_data::current_data_size): Move here from
7016 child classes.
7017 (Output_data::pre_finalize_data_size): New function.
7018 (Output_data::update_data_size): New function.
7019 (Output_section_headers::update_data_size): new function.
7020 (Output_section_data_build::current_data_size): Move to Output_data.
7021 (Output_data_strtab::update_data_size): New function.
7022 (Output_section::current_data_size): Move to Output_data.
7023 (Output_section::set_fixed_layout): New function.
7024 (Output_section::has_fixed_layout): New function.
7025 (Output_section::reserve): New function.
7026 (Output_section::update_data_size): New function.
7027 (Output_section::has_fixed_layout_): New data member.
7028 (Output_section::free_list_): New data member.
7029 (Output_segment::set_section_addresses): Remove const.
7030 (Output_segment::set_section_list_addresses): Remove const.
7031 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
7032 New function.
7033 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
7034 New function.
7035 * readsyms.cc (Read_symbols::do_read_symbols): Add library
7036 parameter when calling Add_symbols constructor; store argument
7037 serial number for members of a lib group.
7038 (Add_symbols::locks): Allow case where token == NULL.
7039 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
7040 (Read_member::~Read_member): New function.
7041 (Read_member::is_runnable): New function.
7042 (Read_member::locks): New function.
7043 (Read_member::run): New function.
7044 (Check_script::~Check_script): New function.
7045 (Check_script::is_runnable): New function.
7046 (Check_script::locks): New function.
7047 (Check_script::run): New function.
7048 (Check_library::~Check_library): New function.
7049 (Check_library::is_runnable): New function.
7050 (Check_library::locks): New function.
7051 (Check_library::run): New function.
7052 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
7053 (Add_symbols::library_): New data member.
7054 (class Read_member): New class.
7055 (class Check_script): New class.
7056 (class Check_library): New class.
7057 * reloc.cc (Read_relocs::is_runnable): Allow case where
7058 token == NULL.
7059 (Read_relocs::locks): Likewise.
7060 (Scan_relocs::locks): Likewise.
7061 (Relocate_task::locks): Likewise.
7062 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
7063 to clear counters.
7064 (Sized_relobj::incremental_relocs_scan): Fix comment.
7065 (Sized_relobj::do_relocate): Pass output file offset to
7066 write_local_symbols.
7067 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
7068 from class declaration.
7069 * script.cc (read_input_script): Allocate Script_info; pass
7070 argument serial number to report_script.
7071 * script.h (class Script_info): Move to incremental.h.
7072 * symtab.cc (Symbol_table::add_from_incrobj): New function.
7073 * symtab.h (Symbol_table::add_from_incrobj): New function.
7074 (Symbol_table::set_file_offset): New function.
7075
b961d0d7
CC
70762011-04-05 Cary Coutant <ccoutant@google.com>
7077
7078 * incremental-dump.cc (dump_incremental_inputs): Change signature
7079 to take a Sized_incremental_binary; change caller. Use readers
7080 in Sized_incremental_binary.
7081 * incremental.cc
7082 (Sized_incremental_binary::find_incremental_inputs_sections):
7083 Rename do_find_incremental_inputs_sections to this.
7084 (Sized_incremental_binary::setup_readers): New function.
7085 (Sized_incremental_binary::do_check_inputs): Check
7086 has_incremental_info_ flag; move setup code to setup_readers;
7087 use input readers.
7088 (Sized_incremental_binary::do_file_is_unchanged): New function.
7089 (Sized_incremental_binary::do_get_input_reader): New function.
7090 * incremental.h (class Incremental_binary): Move to end of file.
7091 (Incremental_binary::file_is_unchanged): New function.
7092 (Incremental_binary::do_file_is_unchanged): New function.
7093 (Incremental_binary::Input_reader): New class.
7094 (Incremental_binary::get_input_reader): New function.
7095 (class Sized_incremental_binary): Move to end of file.
7096 (Sized_incremental_binary::Sized_incremental_binary): Setup the
7097 input section reader classes.
7098 (Sized_incremental_binary::has_incremental_info): New function.
7099 (Sized_incremental_binary::inputs_reader): New function.
7100 (Sized_incremental_binary::symtab_reader): New function.
7101 (Sized_incremental_binary::relocs_reader): New function.
7102 (Sized_incremental_binary::got_plt_reader): New function.
7103 (Sized_incremental_binary::do_file_is_unchanged): New function.
7104 (Sized_incremental_binary::Sized_input_reader): New class.
7105 (Sized_incremental_binary::get_input_reader): New function.
7106 (Sized_incremental_binary::find_incremental_inputs_sections):
7107 Rename do_find_incremental_inputs_sections to this.
7108 (Sized_incremental_binary::setup_readers): New function.
7109 (Sized_incremental_binary::has_incremental_info_): New data member.
7110 (Sized_incremental_binary::inputs_reader_): New data member.
7111 (Sized_incremental_binary::symtab_reader_): New data member.
7112 (Sized_incremental_binary::relocs_reader_): New data member.
7113 (Sized_incremental_binary::got_plt_reader_): New data member.
7114 (Sized_incremental_binary::current_input_file_): New data member.
7115
a869183f
PP
71162011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
7117
7118 PR gold/12640
7119 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
7120 violation.
7121
71222011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
7123
7124 * archive.cc (Archive::include_member): Adjust call to report_object.
7125 (Add_archive_symbols::run): Add script_info to call to
7126 report_archive_begin.
7127 (Lib_group::include_member): Adjust call to report_object.
7128 (Add_lib_group_symbols::run): Adjust call to report_object.
7129 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
7130 blocks. Add object count for script input files.
7131 * incremental.cc (Incremental_inputs::report_archive_begin): Add
7132 script_info parameter; change all callers.
7133 (Incremental_inputs::report_object): Add script_info parameter;
7134 change all callers.
7135 (Incremental_inputs::report_script): Store backpointer to
7136 incremental info entry.
7137 (Output_section_incremental_inputs::set_final_data_size): Record
7138 additional information for scripts.
7139 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7140 * incremental.h (Incremental_script_entry::add_object): New function.
7141 (Incremental_script_entry::get_object_count): New function.
7142 (Incremental_script_entry::get_object): New function.
7143 (Incremental_script_entry::objects_): New data member; adjust
7144 constructor.
7145 (Incremental_inputs::report_archive_begin): Add script_info parameter.
7146 (Incremental_inputs::report_object): Add script_info parameter.
7147 (Incremental_inputs_reader::get_object_count): New function.
7148 (Incremental_inputs_reader::get_object_offset): New function.
7149 * options.cc (Input_arguments::add_file): Return reference to
7150 new input argument.
7151 * options.h (Input_argument::set_script_info): New function.
7152 (Input_argument::script_info): New function.
7153 (Input_argument::script_info_): New data member; adjust all
7154 constructors.
7155 (Input_file_group::add_file): Return reference to new input argument.
7156 (Input_file_lib::add_file): Likewise.
7157 (Input_arguments::add_file): Likewise.
7158 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
7159 * script.cc (Parser_closure::Parser_closure): Add script_info
7160 parameter; adjust all callers.
7161 (Parser_closure::script_info): New function.
7162 (Parser_closure::script_info_): New data member.
7163 (read_input_script): Report scripts earlier to incremental info.
7164 (script_add_file): Set script_info in Input_argument.
7165 (script_add_library): Likewise.
7166 * script.h (Script_options::Script_info): Rewrite class.
7167
a869183f 71682011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
7169
7170 * archive.cc (Library_base::should_include_member): Move
7171 method here from class Archive.
7172 (Archive::Archive): Initialize base class.
7173 (Archive::should_include_member): Move to base class.
7174 (Archive::do_for_all_unused_symbols): New function.
7175 (Add_archive_symbols::run): Remove redundant access to
7176 incremental_inputs.
7177 (Lib_group::Lib_group): Initialize base class.
7178 (Lib_group::do_filename): New function.
7179 (Lib_group::include_member): Pass pointer to Lib_group to
7180 report_object.
7181 (Lib_group::do_for_all_unused_symbols): New function.
7182 (Add_lib_group_symbols::run): Report archive information for
7183 incremental links.
7184 * archive.h (class Library_base): New base class.
7185 (class Archive): Derive from Library_base.
7186 (Archive::filename): Move to base class.
7187 (Archive::set_incremental_info): Likewise.
7188 (Archive::incremental_info): Likewise.
7189 (Archive::Should_include): Likewise.
7190 (Archive::should_include_member): Likewise.
7191 (Archive::Armap_entry): Remove.
7192 (Archive::Unused_symbol_iterator): Remove.
7193 (Archive::unused_symbols_begin): Remove.
7194 (Archive::unused_symbols_end): Remove.
7195 (Archive::do_filename): New function.
7196 (Archive::do_get_mtime): New function.
7197 (Archive::do_for_all_unused_symbols): New function.
7198 (Archive::task_): Move to base class.
7199 (Archive::incremental_info_): Likewise.
7200 (class Lib_group): Derive from Library_base.
7201 (Lib_group::do_filename): New function.
7202 (Lib_group::do_get_mtime): New function.
7203 (Lib_group::do_for_all_unused_symbols): New function.
7204 (Lib_group::task_): Move to base class.
7205 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
7206 function.
7207 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
7208 function.
7209 * incremental.cc (Incremental_inputs::report_archive_begin):
7210 Use Library_base; call library's get_mtime; add incremental inputs
7211 entry before members.
7212 (class Unused_symbol_visitor): New class.
7213 (Incremental_inputs::report_archive_end): Use Library_base; use
7214 visitor class to record unused symbols; don't add incremental inputs
7215 entry after members.
7216 (Incremental_inputs::report_object): Use Library_base.
7217 * incremental.h
7218 (Incremental_archive_entry::Incremental_archive_entry): Remove
7219 unused Archive parameter.
7220 (Incremental_inputs::report_archive_begin): Use Library_base.
7221 (Incremental_inputs::report_archive_end): Likewise.
7222 (Incremental_inputs::report_object): Likewise.
7223 * object.cc (Sized_relobj::do_for_all_global_symbols): New
7224 function.
7225 * object.h (Object::for_all_global_symbols): New function.
7226 (Object::do_for_all_global_symbols): New function.
7227 (Sized_relobj::do_for_all_global_symbols): New function.
7228 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
7229 function.
7230 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
7231 function.
7232
61ab3e40
ILT
72332011-03-27 Ian Lance Taylor <iant@google.com>
7234
7235 * archive.cc (Archive::interpret_header): Return -1 if something
7236 goes wrong. Change callers accordingly.
7237
30e1f9e6
CC
72382011-03-25 Cary Coutant <ccoutant@google.com>
7239
7240 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
7241 * testsuite/Makefile.in: Regenerate.
7242
9370ce59 72432011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
7244
7245 * plugin.cc (get_view): New.
7246 (Plugin::load): Pass get_view to the plugin.
7247 (Plugin_manager::get_view): New.
7248
9312bb0a
ILT
72492011-03-21 Ian Lance Taylor <iant@google.com>
7250
7251 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 7252 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 7253
7e12ba9e
ST
72542011-03-21 Sriraman Tallam <tmsriram@google.com>
7255
7256 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
7257 Change == to -eq.
7258 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
7259 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
7260 Change == to -eq.
7261 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
7262 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
7263
fd7a005d
ILT
72642011-03-14 Ian Lance Taylor <iant@google.com>
7265
7266 * script-sections.cc (Sort_output_sections::script_compare):
7267 Rename from is_before, change return type.
7268 (Sort_output_sections::operator()): Adjust accordingly.
7269
ed16fd1b
ILT
72702011-03-11 Jeffrey Yasskin <jyasskin@google.com>
7271
7272 PR gold/12572
7273 * testsuite/odr_violation2.cc: Add comment to make all error line
7274 numbers double digits.
7275 * testsuite/debug_msg.sh: Adjust expected errors.
7276
71ff8986
ILT
72772011-03-09 Jeffrey Yasskin <jyasskin@google.com>
7278
7279 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
7280 but mark earlier ones as non-canonical
7281 (offset_to_iterator): Update search target and example
7282 (do_addr2line): Return extra lines in a vector*
7283 (format_file_lineno): Extract from do_addr2line
7284 (one_addr2line): Add vector* out-param
7285 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
7286 when a lineno entry appeared last for its instruction
7287 (Dwarf_line_info): Add vector* out-param
7288 * object.cc (Relocate_info): Pass NULL for the vector* out-param
7289 * symtab.cc (Odr_violation_compare): Include the lineno in the
7290 comparison again.
7291 (linenos_from_loc): New. Combine the canonical line for an
7292 address with its other lines.
7293 (True_if_intersect): New. Helper functor to make
7294 std::set_intersection a query.
7295 (detect_odr_violations): Compare sets of lines instead of just
7296 one line for each function. This became less deterministic, but
7297 has fewer false positives.
7298 * symtab.h: Declarations.
7299 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
7300 mix an optimized and non-optimized object in the same binary
7301 (odr_violation2.so): Same.
7302 * testsuite/Makefile.in: Regenerate from Makefile.am.
7303 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
7304 * testsuite/debug_msg.sh: Update line numbers and add
7305 assertions.
7306 * testsuite/odr_violation1.cc: Use OdrDerived, in a
7307 non-optimized context.
7308 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
7309 isn't inlined, and use OdrDerived in an optimized context.
7310 * testsuite/odr_header1.h: Defines OdrDerived, where
7311 optimization will change the
7312 first-instruction-in-the-destructor's file and line number.
7313 * testsuite/odr_header2.h: Defines OdrBase.
7314
a19fefdc
ILT
73152011-03-09 Ian Lance Taylor <iant@google.com>
7316
7317 * fileread.cc (File_read::clear_views): Don't delete the whole
7318 file view.
7319
ecb351e9
ILT
73202011-03-08 Ian Lance Taylor <iant@google.com>
7321
7322 PR gold/12525
7323 * fileread.cc: #include <climits>.
7324 (GOLD_IOV_MAX): Define.
7325 (File_read::read_multiple): Limit number of entries by iov_max.
7326 * fileread.h (class File_read): Always set max_readv_entries to
7327 128.
7328
b821d13c
ILT
73292011-03-07 Ian Lance Taylor <iant@google.com>
7330
7331 PR gold/12525
7332 * options.h (class General_options): Add -dy and -dn.
7333
89243142
CC
73342011-03-02 Cary Coutant <ccoutant@google.com>
7335
7336 * testsuite/script_test_9.t: Add TLS segment.
7337
d0773f31
ILT
73382011-03-02 Simon Baldwin <simonb@google.com>
7339
7340 * configure.ac: Add check for gnu_indirect_function support in
7341 the toolchain building binutils.
7342 * configure: Rebuild.
7343
9370ce59 73442011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
7345
7346 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
7347 plugin only symbols.
7348 (Symbol_table::sized_finalize_symbol) Mark symbol only present
7349 in plugin files as not needed in the symbol table.
7350
4cf7a849
ST
73512011-02-11 Sriraman Tallam <tmsriram@google.com>
7352
7353 * output.cc (Output_section::add_input_section): Delay fill
7354 generation for section ordering.
7355
b578bd7d
ILT
73562011-02-09 Ian Lance Taylor <iant@google.com>
7357
7358 PR gold/12316
7359 * object.h (class Sized_relobj): Remove clear_local_symbols.
7360 * reloc.cc (Sized_relobj::do_relocate): Don't call
7361 clear_local_symbols.
7362
9370ce59 73632011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
7364
7365 * plugin.cc (is_visible_from_outside): Return true for symbols
7366 in the -u option.
7367
55382fb7
ILT
73682011-02-04 Jeffrey Yasskin <jyasskin@google.com>
7369
7370 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
7371 filename.
7372
4e271fff
ST
73732011-02-02 Sriraman Tallam <tmsriram@google.com>
7374
7375 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 7376 to std::string.
4e271fff 7377 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 7378 section_name to be std::string.
4e271fff
ST
7379 (is_function_ctor_or_dtor): Change type of parameter to std::string.
7380
d433c3ac
ILT
73812011-01-25 Ian Lance Taylor <iant@google.com>
7382
7383 * script.cc (script_add_extern): Rewrite to use
7384 add_symbol_reference.
7385
880473a6
DK
73862011-01-25 Doug Kwan <dougkwan@google.com>
7387
d433c3ac 7388 * icf.cc (get_section_contents): Always lock section's object.
880473a6 7389
f30f86fa
ILT
73902011-01-24 Ian Lance Taylor <iant@google.com>
7391
7392 * options.h (class General_options): Accept
7393 --no-detect-odr-violations.
7394
8e51a0b9
ILT
73952011-01-24 Ian Lance Taylor <iant@google.com>
7396
7397 * version.cc (version_string): Bump to 1.11.
7398
0f3b89d8
ILT
73992011-01-24 Ian Lance Taylor <iant@google.com>
7400
7401 * plugin.cc (class Plugin_rescan): Define new class.
7402 (Plugin_manager::claim_file): Set any_claimed_.
7403 (Plugin_manager::save_archive): New function.
7404 (Plugin_manager::save_input_group): New function.
7405 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
7406 necessary.
7407 (Plugin_manager::new_undefined_symbol): New function.
7408 (Plugin_manager::rescan): New function.
7409 (Plugin_manager::rescannable_defines): New function.
7410 (Plugin_manager::add_input_file): Set any_added_.
7411 * plugin.h (class Plugin_manager): define new fields rescannable_,
7412 undefined_symbols_, any_claimed_, and any_added_. Declare
7413 Plugin_rescan as friend. Declare new functions.
7414 (Plugin_manager::Rescannable): Define type.
7415 (Plugin_manager::Rescannable_list): Define type.
7416 (Plugin_manager::Undefined_symbol_list): Define type.
7417 (Plugin_manager::Plugin_manager): Initialize new fields.
7418 * archive.cc (Archive::defines_symbol): New function.
7419 (Add_archive_symbols::run): Pass archive to plugins if any.
7420 * archive.h (class Archive): Declare defines_symbol.
7421 * readsyms.cc (Input_group::~Input_group): New function.
7422 (Finish_group::run): Pass input_group to plugins if any.
7423 * readsyms.h (class Input_group): Declare destructor.
7424 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
7425 any.
7426
3bb951e5
ILT
74272011-01-10 Ian Lance Taylor <iant@google.com>
7428
7429 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
7430 section as relro.
7431 (Layout::set_segment_offsets): Reset increase_relro before calling
7432 set_section_addresses a second time.
7433
0aa45fac
CC
74342011-01-04 Cary Coutant <ccoutant@google.com>
7435
7436 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
7437 sections before NOBITS sections.
7438
0db46eb4
L
74392011-01-01 H.J. Lu <hongjiu.lu@intel.com>
7440
7441 * version.cc (print_version): Update copyright to 2011.
7442
829c9745
CC
74432010-12-23 Cary Coutant <ccoutant@google.com>
7444
7445 * output.h (Output_data_reloc::add_output_section): Pass OD instead
7446 of OS to this->add. Add OD parameter to second form of the function.
7447
7500420b
ILT
74482010-12-20 Ian Lance Taylor <iant@google.com>
7449
7450 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
7451 second of two consecutive entries with same offset.
7452
f8e9a930
RW
74532010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7454
7455 * testsuite/Makefile.am (ifuncmain2static_LDADD)
7456 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
7457 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
7458 to avoid unneeded links against $(LDADD).
7459 * testsuite/Makefile.in: Regenerate.
7460
2fbb4320
ILT
74612010-12-15 Ian Lance Taylor <iant@google.com>
7462
7463 PR gold/12324
7464 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
7465 for R_X86_64_32 and R_X86_64_PC32.
7466 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
7467 ver_matching_def_pic.o.
7468 (ver_matching_def_pic.o): New target.
7469
fedb228d
RW
74702010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7471
7472 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
7473 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
7474 Move definition before File_read::View member definitions.
7475 (File_read::View::~View): Initialize and hold lock before
7476 updating current_mapped_bytes.
7477
9b547ce6
RW
74782010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7479
7480 * dwarf_reader.cc: Remove outdated comment.
7481 * gold-threads.cc: Fix typo in error message.
7482 * archive.cc: Fix typos in comments.
7483 * archive.h: Likewise.
7484 * arm-reloc-property.cc: Likewise.
7485 * arm-reloc-property.h: Likewise.
7486 * arm-reloc.def: Likewise.
7487 * arm.cc: Likewise.
7488 * attributes.h: Likewise.
7489 * cref.cc: Likewise.
7490 * ehframe.cc: Likewise.
7491 * fileread.h: Likewise.
7492 * gold.h: Likewise.
7493 * i386.cc: Likewise.
7494 * icf.cc: Likewise.
7495 * incremental.h: Likewise.
7496 * int_encoding.cc: Likewise.
7497 * layout.h: Likewise.
7498 * main.cc: Likewise.
7499 * merge.h: Likewise.
7500 * object.cc: Likewise.
7501 * object.h: Likewise.
7502 * options.cc: Likewise.
7503 * readsyms.cc: Likewise.
7504 * reduced_debug_output.cc: Likewise.
7505 * reloc.cc: Likewise.
7506 * script-sections.cc: Likewise.
7507 * sparc.cc: Likewise.
7508 * symtab.h: Likewise.
7509 * target-reloc.h: Likewise.
7510 * target.cc: Likewise.
7511 * target.h: Likewise.
7512 * timer.cc: Likewise.
7513 * timer.h: Likewise.
7514 * x86_64.cc: Likewise.
7515
83e17bd5
CC
75162010-12-09 Cary Coutant <ccoutant@google.com>
7517
7518 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
7519 stack.
7520 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
7521 parameter; change all callers.
7522 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
7523 * options.h (warn_execstack): New option.
7524
017257f8
DK
75252010-12-07 Doug Kwan <dougkwan@google.com>
7526
7527 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
7528 like function call relocations.
7529
c20cbc06
ILT
75302010-12-07 Ian Lance Taylor <iant@google.com>
7531
7532 * archive.cc (Archive::get_elf_object_for_member): Permit
7533 punconfigured to be NULL.
7534 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
7535 (Archive::include_member): Pass NULL to get_elf_object_for_member
7536 if we searched for the archive and this is the first included
7537 object.
7538
4dbfafcc
ILT
75392010-12-01 Ian Lance Taylor <iant@google.com>
7540
7541 * dwarf_reader.h (class Sized_dwarf_line_info): Add
7542 track_relocs_type_ field.
7543 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7544 Set track_relocs_type_.
7545 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
7546 contents when using RELA relocs.
7547 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
7548 reloc_map_.
7549 * reloc.cc (Track_relocs::next_addend): New function.
7550 * reloc.h (class Track_relocs): Declare next_addend.
7551
e5e19edd
ILT
75522010-12-01 Ian Lance Taylor <iant@google.com>
7553
7554 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
7555 virtual destructor.
7556
9a5ce24c
ILT
75572010-12-01 Ian Lance Taylor <iant@google.com>
7558
7559 * README: Update compilers known to work and fail.
7560
c7791212
NC
75612010-11-23 Matthias Klose <doko@ubuntu.com>
7562
7563 * configure.in: For --enable-gold, handle value `default' instead of
7564 `both*'. Always install ld as ld.bfd, install as ld if gold is
7565 not the default.
7566 * configure: Regenerate.
7567
0ad220c9
DK
75682010-11-18 Doug Kwan <dougkwan@google.com>
7569
7570 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
7571 and right_alignment to be zero. Store result alignment only if it is
7572 greater than existing alignment.
7573
ab8056e0
CC
75742010-11-16 Cary Coutant <ccoutant@google.com>
7575
7576 PR gold/12220
7577 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7578 Check for ".zdebug_line".
7579
fd064a5b
CC
75802010-11-16 Doug Kwan <dougkwan@google.com>
7581 Cary Coutant <ccoutant@google.com>
7582
7583 * output.h (Output_segment::set_section_addresses): Pass increase_relro
7584 by reference; adjust all callers.
7585 * output.cc (Output_segment::set_section_addresses): Adjust references
7586 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
7587 list is empty.
7588 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
7589 end at page boundary.
7590
6fc6ea19
CC
75912010-11-16 Cary Coutant <ccoutant@google.com>
7592
7593 PR gold/12220
7594 * layout.cc (Layout::choose_output_section): Transform names of
7595 compressed sections even when using a script with a SECTIONS clause.
7596 (Layout::output_section_name): Remove code to transform
7597 compressed debug section names.
7598 * output.cc (Output_section::add_input_section): Use uncompressed
7599 section size when tracking input sections.
7600
95a2c8d6
RS
76012010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
7602
7603 * symtab.h (Symbol::NON_PIC_REF): Remove.
7604 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
7605 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
7606 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
7607 (Symbol::use_plt_offset): Take a flags argument and pass it
7608 directly to needs_dynamic_reloc. Restrict check for undefined
7609 weak symbols to function calls.
7610 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
7611 (Target_arm::Scan::global): Use it.
7612 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
7613 (Target_arm::Relocate::relocate): Likewise.
7614 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
7615 parameter with an r_type parameter. Use get_reference_flags
7616 to get the flags.
7617 (Target_arm::Relocate::relocate): Update accordingly.
7618 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
7619 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
7620 (Target_i386::Scan::global): Likewise.
7621 (Target_i386::Relocate::relocate): Likewise.
7622 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
7623 parameter with an r_type parameter. Use get_reference_flags
7624 to get the flags.
7625 (Target_i386::Relocate::relocate): Update accordingly.
7626 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
7627 (Target_powerpc::Scan::global): Use it.
7628 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
7629 (Target_powerpc::Relocate::relocate): Likewise.
7630 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
7631 (Target_sparc::Scan::global): Use it.
7632 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
7633 (Target_sparc::Relocate::relocate): Likewise.
7634 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
7635 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
7636 (Target_x86_64::Scan::global): Likewise.
7637 (Target_x86_64::Relocate::relocate): Likewise.
7638
f625ae50
DK
76392010-11-08 Doug Kwan <dougkwan@google.com>
7640 Cary Coutant <ccoutant@google.com>
7641
7642 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
7643 (Arm_exidx_merge_section::section_contents_): New data member.
7644 (Arm_input_section::Arm_input_section): Initialize original_contents_.
7645 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 7646 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
7647 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
7648 in parameters instead of calling Object::section_contents without
7649 locking.
7650 (Arm_output_section::group_section): New parameter TASK. Pass it
7651 to callees that need locking objects.
7652 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
7653 to lock EXIDX input sections. Fix a formatting issue. Call
7654 Arm_exidx_merged_section::build_contents to create merged section
7655 contents.
7656 (Arm_output_section::create_stub_group): New parameter TASK. Use it
7657 to lock object of stub table owner.
7658 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
7659 TEXT_SIZE to initialize data member TEXT_SIZE_.
7660 (Arm_exidx_input_section::addralign): Fix typo in comment.
7661 (Arm_exidx_input_section::text_size): New method.
7662 (Target_arm::do_relax): New parameter TASK. Pass it to callees
7663 that require locking objects. Lock objects before scanning for stubs
7664 and updating local symbols.
7665 (Arm_input_section<big_endian>::init): Copy contents of original
7666 input section.
2e702c99 7667 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
7668 original input section instead of calling Object::section_contents
7669 without locking.
7670 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
7671 size without calling Object::section_size().
7672 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
7673 for size. Allocate a buffer for merged EXIDX entries.
7674 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 7675 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
7676 building code to Arm_exidx_merged_section::build_contetns. Write
7677 out contetns in buffer instead of building it on the fly.
7678 (Arm_relobj::make_exidx_input_section): Also pass text section size
7679 to Arm_exidx_input_section constructor.
7680 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
7681 (Arm_dynobj::do_read_symbols): Fix memory leak.
7682 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
7683 * target.h: (class Task): Add forward declaration.
7684 (Target::relax): Add new parameter TASK and pass it to
7685 Target::do_relax().
7686 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
7687
5f9bcf58
CC
76882010-11-05 Cary Coutant <ccoutant@google.com>
7689
7690 PR gold/10708
7691 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
7692 object when reading from the file.
7693 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
7694 second layout pass.
7695 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
7696 when reading section contents.
7697 (get_section_contents): Likewise.
7698 (icf::find_identical_sections): Likewise.
7699 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
7700 object when reading from the file.
7701 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
7702 the object when doing deferred section layout.
7703
e597fa08
NC
77042010-11-03 Nick Clifton <nickc@redhat.com>
7705
7706 PR gold/12001
7707 * script.h (class Symbol_assignment: name): New member. Returns
7708 the name of the symbol.
7709 * scrfipt.cc (Script_options::is_pending_assignment): New member.
7710 Returns true if the given symbol name is on the list of
7711 assignments wating to be processed.
7712 * archive.cc (should_incldue_member): If the symbol is undefined,
7713 check to see if it is on the list of symbols pending assignment.
7714
3f9a3278
ILT
77152010-11-03 Ryan Mansfield <rmansfield@qnx.com>
7716
7717 * script-sections.cc (Script_sections::find_memory_region): Check
7718 for a NULL output section pointer.
7719
d06fb4d1
DK
77202010-10-29 Doug Kwan <dougkwan@google.com>
7721
7722 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
7723 Output_section::add_relaxed_input_section.
7724 * output.cc (Output_section::add_relaxed_input_section): Add new
7725 arguments LAYOUT and NAME. Set section order index.
7726 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7727 Copy section order index.
7728 * output.h (Output_section::add_relaxed_input_section): Add new
7729 arguments LAYOUT and NAME.
7730
90e24de5
ILT
77312010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7732
7733 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 7734 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
7735 * testsuite/Makefile.in: Regenerate.
7736
c9484ea5
DK
77372010-10-20 Doug Kwan <dougkwan@google.com>
7738
7739 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
7740 without SHF_LINK_ORDER flags.
7741 * layout.cc (Layout::choose_output_section): Do not filter
7742 SHF_LINK_ORDER flag in a relocatable link.
7743
5bc2f5be
CC
77442010-10-17 Cary Coutant <ccoutant@google.com>
7745
7746 * output.h (Output_segment::set_section_addresses): Change function
7747 signature. Update all callers.
7748 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
7749 sections.
7750 (Output_segment::set_section_addresses): Align after last TLS
7751 section. Add padding before last relro section instead of after.
7752
0c91cf04
DK
77532010-10-17 Doug Kwan <dougkwan@google.com>
7754
7755 * gold/arm.cc (Target_arm::got_section): Use correct order and set
7756 GOT output section to be writable.
7757
8c21d9d3
CC
77582010-10-14 Cary Coutant <ccoutant@google.com>
7759
7760 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
7761 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
7762 * gold.cc (queue_initial_tasks): Check parameters for incremental link
7763 mode.
7764 * incremental.cc (report_command_line): Ignore all forms of
7765 --incremental.
7766 * layout.cc (Layout::Layout): Check parameters for incremental link
7767 mode.
7768 * options.cc (General_options::parse_incremental): New function.
7769 (General_options::parse_no_incremental): New function.
7770 (General_options::parse_incremental_full): New function.
7771 (General_options::parse_incremental_update): New function.
7772 (General_options::incremental_mode_): New data member.
7773 (General_options::finalize): Check incremental_mode_.
7774 * options.h (General_options): Update help text for --incremental.
7775 Add --no-incremental, --incremental-full, --incremental-update.
7776 (General_options::Incremental_mode): New enum type.
7777 (General_options::incremental_mode): New function.
7778 (General_options::incremental_mode_): New data member.
7779 * parameters.cc (Parameters::incremental_mode_): New data member.
7780 (Parameters::set_options): Set incremental_mode_.
7781 (Parameters::set_incremental_full): New function.
7782 (Parameters::incremental): New function.
7783 (Parameters::incremental_update): New function.
7784 (set_parameters_incremental_full): New function.
7785 * parameters.h (Parameters::set_incremental_full): New function.
7786 (Parameters::incremental): New function.
7787 (Parameters::incremental_update): New function.
7788 (Parameters::incremental_mode_): New data member.
7789 (set_parameters_incremental_full): New function.
7790 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
7791 incremental link mode.
7792 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
7793 (Sized_relobj::do_relocate_sections): Likewise.
7794 * testsuite/Makefile.am (incremental_test): Use --incremental-full
7795 option.
7796 * testsuite/Makefile.in: Regenerate.
7797 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 7798
bb32aa18 77992010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
7800
7801 * script-sections.h (class Script_sections): Make
7802 Sections_elements typedef public.
7803 * script-sections.cc (class Sort_output_sections): Add elements_
7804 field. Add constructor which sets it; change all callers.
7805 (Sort_output_sections::is_before): New function.
7806 (Sort_output_sections::operator()): Call is_before.
7807 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
7808 conditional.
7809 * testsuite/script_test_10.sh: New test. Test script section
7810 order.
7811 * testsuite/script_test_10.t: Likewise.
7812 * testsuite/script_test_10.s: Likewise.
7813 * testsuite/Makefile.am: Wrap the cross linker tests and the
7814 common tests into NATIVE_OR_CROSS_LINKER.
7815 (check_SCRIPTS): Add script_test_10.sh.
7816 (check_DATA): Add script_test_10.stdout.
7817 (script_test_10.o, script_test_10): New targets.
7818 (script_test_10.stdout): New target.
7819 * configure, testsuite/Makefile.in: Regenerate.
7820
3cef7179
ILT
78212010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7822
7823 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
7824 error for the deprecated relocations.
7825 (Target_arm::Scan::global): Likewise.
7826 (Target_arm::Relocate::relocate): Likewise.
7827
7411e9a8
RS
78282010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
7829
7830 * fileread.cc (Input_file::find_file): Initialize *found_name
7831 and *namep when using the fallback search for case 4.
7832
6a9da32a
CC
78332010-10-11 Cary Coutant <ccoutant@google.com>
7834
7835 * options.h (class General_options): Redefine -z lazy as an alias for
7836 the negation of -z now.
7837
ac897c20
ILT
78382010-10-11 Ian Lance Taylor <iant@google.com>
7839
7840 * resolve.cc (symbol_to_bits): Report the value of the unsupported
7841 binding.
7842
ea5cae92
NC
78432010-10-06 Nick Clifton <nickc@redhat.com>
7844
7845 * script-sections.cc(class Memory_region): Remove
7846 current_lma_offset_ field. Rename current_vma_offset_ to
7847 current_offset_. Add last_section_ field.
7848 (Memory_region::get_current_vma_address): Rename to
7849 get_current_address.
7850 (Memory_region::get_current_lma_address): Delete.
7851 (Memory_region::increment_vma_offset): Rename to
7852 increment_offset.
7853 (Memory_region::increment_lma_offset): Delete.
7854 (Memory_region::attributes_compatible): New method. Returns
7855 true if the provided section is compatible with the region.
7856 (Memory_region::get_last_section): New method. Returns the last
7857 section to use the region.
7858 (Memory_region::set_last_section): New method. Stores the last
7859 section to use the region.
7860 (Script_sections::block_in_region): New method. Returns true if
7861 a block of memory is contained within a region.
7862 (Script_sections::find_memory_region): New method. Locates a
7863 memory region to be used to set a VMA or LMA address.
7864 (Output_section_definition::set_section_addresses): Add code to
7865 check for addresses set by memory regions.
7866 (Output_segment::set_section_addresses): Remove memory region
7867 walking code.
7868 (Script_sections::create_segment): Add a warning if a header
7869 segment is created outside of any region.
7870 * script-sections.h (class Script_sections): Add prototypes for
7871 find_memory_region and block_in_region methods.
7872 * testsuite/memory_test.s: Use .long instead of .word.
7873 * testsuite/memory_test.t: Add some more output sections.
7874 * testsuite/memory_test.sh: Update expected output.
7875
a9bfd952
DK
78762010-10-02 Doug Kwan <dougkwan@google.com>
7877
7878 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
7879 defintion to symtab.h
7880 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
7881 declaration to defintion.
7882
bacff3ab
NC
78832010-10-01 Nick Clifton <nickc@redhat.com>
7884
7885 * expression.cc (eval): Replace dummy argument with NULL.
7886 (eval_maybe_dot): Check for a NULL result section pointer.
7887 (Symbol_expression::value): Likewise.
7888 (Dot_expression::value): Likewise.
7889 (BINARY_EXPRESSION): Likewise.
7890 (Max_expression::value): Likewise.
7891 (Min_expression::value): Likewise.
7892 (Absolute_expression::value): Likewise.
7893 (Addr_expression::value_from_output_section): Likewise.
7894 (Loaddddr_expression::value_from_output_section): Likewise.
7895 (Segment_start_expression::value): Likewise.
7896 * script-sections.cc
7897 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
7898 argument with NULL.
7899 (Sections_elememt_dot_assignment::set_section_addresses):
7900 Likewise.
7901 (Output_data_expression::do_write_to_buffer): Likewise.
7902 (Output_section_definition::finalize_symbols): Likewise.
7903 (Output_section_definition::set_section_addresses): Likewise.
7904
f81bc8b5
DK
79052010-09-30 Doug Kwan <dougkwan@google.com>
7906
7907 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
7908
c95e9f27
ST
79092010-09-28 Sriraman Tallam <tmsriram@google.com>
7910
7911 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 7912 function.
c95e9f27
ST
7913 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
7914 virtual function.
7915 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
7916 virtual function.
7917 * icf.cc (get_section_contents): Inline merge sections only when
7918 target allows it.
7919
3cac54d2
RW
79202010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7921
7922 * configure: Regenerate.
7923
2904037a
ILT
79242010-09-17 Ian Lance Taylor <iant@google.com>
7925
7926 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
7927 * testsuite/Makefile.am (memory_test.o): New target.
7928 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
7929 memory_test.t.
7930 * testsuite/Makefile.in: Rebuild.
2904037a 7931
bca7fb63
DK
79322010-09-17 Doug Kwan <dougkwan@google.com>
7933
7934 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
7935 defintion if relocation uses GOT entries of the symbol.
7936 * testsuite/icf_safe_test.sh: Fix test.
7937 * testsuite/icf_safe_so_test.sh: Fix test.
7938
4ef28648
CC
79392010-09-16 Cary Coutant <ccoutant@google.com>
7940
7941 * script_sections.cc (class Memory_region): Remove "NULL" from
7942 vector initializations.
7943
793990de
CC
79442010-09-15 Cary Coutant <ccoutant@google.com>
7945
7946 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
7947 Resolve forwarding symbols.
7948
81e015e2
DK
79492010-09-15 Doug Kwan <dougkwan@google.com>
7950
7951 * gold/testsuite/script_test_3.t: Add ARM special sections.
7952 * gold/testsuite/script_test_4.t: Same.
7953 * gold/testsuite/script_test_5.t: Same.
7954 * gold/testsuite/script_test_6.t: Same.
7955 * gold/testsuite/script_test_7.t: Same.
7956 * gold/testsuite/script_test_7.t: Same.
7957 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
7958
36171d64
CC
79592010-09-14 Cary Coutant <ccoutant@google.com>
7960
7961 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
7962 (Target_x86_64::Relocate::relocate_tls): Replace check for
7963 saw_tls_block_reloc_ with test for executable section.
7964
d89051bd
CC
79652010-09-12 Cary Coutant <ccoutant@google.com>
7966
7967 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
7968 position-independent executables to shared libraries need dynamic
7969 relocations.
7970 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
7971 position-independent executables.
7972 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
7973 * testsuite/Makefile.in: Regenerate.
7974
fca41f0f
NC
79752010-09-10 Nick Clifton <nickc@redhat.com>
7976
7977 PR gold/11997
7978 * testsuite/memory_test.t: Discard any sections that are not
7979 needed.
7980
6695e4b3
L
79812010-09-09 H.J. Lu <hongjiu.lu@intel.com>
7982
7983 PR gold/11996
7984 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
7985 "This::" to work around a bug in gcc 4.2.
7986
7987 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
7988
0f72bf6f
RÁE
79892010-09-09 Rafael Espindola <espindola@google.com>
7990
7991 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
7992 sections with different PF_X flags in the same segment.
7993 (Layout::find_first_load_seg): Search all segments to find the first
7994 one.
7995 * options.h (rosegment): New.
7996
79972010-09-08 Rafael Espindola <espindola@google.com>
a6577478 7998
05a79166 7999 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 8000
aa98ff75
DK
80012010-09-08 Doug Kwan <dougkwan@google.com>
8002
8003 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
8004 (Arm_relobj::do_relocate_sections): Add new parameter for output
8005 file to match the parent.
8006 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
8007 of local symbols instead of input values. Update code to track
8008 changes in gold::relocate_section.
8009 * object.cc (Sized_relobj::compute_final_local_value): New methods.
8010 (Sized_relobj::compute_final_local_value_internal): New methods.
8011 (Sized_relobj::do_finalize_local_symbols): Move code from loop
8012 body into private version of Sized_relobj::compute_final_local_value.
8013 Call the inline method.
8014 * object.h (Symbol_value::Symbol_value): Define destructor. Free
8015 merged symbol value if there is one.
8016 (Symbol_value::has_output_value): New method defintiion.
8017 (Sized_relobj::Compute_final_local_value_status): New enum type.
8018 (Sized_relobj::compute_final_local_value): New methods.
8019 (Sized_relobj::compute_final_local_value_internal): New methods.
8020 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
8021 and arm_cortex_a8.sh.
8022 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
8023 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
8024 New tests.
8025 * Makefile.in: Regenerate.
8026 * testsuite/arm_bl_out_of_range.s: Update test.
8027 * testsuite/thumb_bl_out_of_range.s: Ditto.
8028 * testsuite/thumb_blx_out_of_range.s: Ditto.
8029 * testsuite/arm_branch_out_of_range.sh: New file.
8030 * testsuite/arm_cortex_a8.sh: Ditto.
8031 * testsuite/arm_cortex_a8_b.s: Ditto.
8032 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
8033 * testsuite/arm_cortex_a8_b_local.s: Ditto.
8034 * testsuite/arm_cortex_a8_bl.s: Ditto.
8035 * testsuite/arm_cortex_a8_blx.s: Ditto.
8036 * testsuite/arm_cortex_a8_local.s: Ditto.
8037 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
8038 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
8039
05a79166
L
80402010-09-08 Rafael Espindola <espindola@google.com>
8041
8042 * Makefile.am (memory_test.stdout): Run readelf with -W.
8043 * Makefile.in: Regenerate.
8044 * testsuite/memory_test.sh: Make the regexps accept both 32 and
8045 64 bit output.
8046
33dbc701
RÁE
80472010-09-08 Rafael Espindola <espindola@google.com>
8048
8049 * script-sections.cc (Script_sections::add_memory_region): Convert
8050 field precision to int.
8051 * script.cc (script_set_section_region, script_set_section_region):
8052 Convert field precision to int.
8053
731ca54a
RÁE
80542010-09-08 Rafael Espindola <espindola@google.com>
8055
8056 * arm.cc (do_finalize_sections): Create the __exidx_start and
8057 __exdix_end symbols even when the section is missing.
8058
7f8cd844
NC
80592010-09-08 Nick Clifton <nickc@redhat.com>
8060
8061 * README: Remove claim that MEMORY is not supported.
8062 * expression.cc (script_exp_function_origin)
8063 (script_exp_function_length): Move from here to ...
8064 * script.cc: ... here.
8065 (script_set_section_region, script_add_memory)
8066 (script_parse_memory_attr, script_include_directive): New
8067 functions.
8068 * script-sections.cc
8069 (class Memory_region): New class.
8070 (class Output_section_definition): Add set_memory_region,
8071 set_section_vma, set_section_lma and get_section_name methods.
8072 (class Script_Sections): Add add_memory_region,
8073 find_memory_region, find_memory_region_origin,
8074 find_memory_region_length and set_memory_region methods.
8075 Have set_section_addresses method walk the list of set memory
8076 regions.
8077 Extend the print methos to display memory regions.
8078 * script-sections.h: Add prototypes for new methods.
8079 Add enum for MEMORY region attributes.
8080 * yyscript.y: Add support for parsing MEMORY regions.
8081 * script-c.h: Add prototypes for new functions.
8082 * testsuite/Makefile.am: Add test of MEMORY region functionality.
8083 * testsuite/Makefile.in: Regenerate.
8084 * testsuite/memory_test.sh: New script.
8085 * testsuite/memory_test.s: New assembler source file.
8086 * testsuite/memory_test.t: New linker script.
8087
a4649286
DK
80882010-08-27 Doug Kwan <dougkwan@google.com>
8089
8090 * gold/resolve.cc (Symbol_table::should_override): Let a weak
8091 reference override an existing dynamic weak reference.
8092 * testsuite/Makefile.am: Add new test dyn_weak_ref.
8093 * testsuite/Makefile.in: Regenerate.
8094 * testsuite/dyn_weak_ref.sh: New file.
8095 * testsuite/dyn_weak_ref_1.c: Ditto.
8096 * testsuite/dyn_weak_ref_2.c: Ditto.
8097
b56648ad
ILT
80982010-08-27 Ian Lance Taylor <iant@google.com>
8099
8100 * incremental.h (class Incremental_input_entry): Add virtual
8101 destructor.
8102
809313cb
ILT
81032010-08-27 Ian Lance Taylor <iant@google.com>
8104
8105 * testsuite/start_lib_test_3.c: Mark t3 as used.
8106
11e32464
NC
81072010-08-27 Nick Clifton <nickc@redhat.com>
8108
8109 * options.cc (version_script): Fix small typo in previous
8110 whitespace tidyup.
8111
ca09d69a
NC
81122010-08-25 Nick Clifton <nickc@redhat.com>
8113
8114 * archive.cc: Formatting fixes: Remove whitespace between
8115 typename and following asterisk. Remove whitespace between
8116 function name and opening parenthesis.
8117 * archive.h: Likewise.
8118 * arm.cc: Likewise.
8119 * attributes.cc: Likewise.
8120 * attributes.h: Likewise.
8121 * common.cc: Likewise.
8122 * copy-relocs.cc: Likewise.
8123 * dirsearch.h: Likewise.
8124 * dynobj.cc: Likewise.
8125 * ehframe.cc: Likewise.
8126 * ehframe.h: Likewise.
8127 * expression.cc: Likewise.
8128 * fileread.cc: Likewise.
8129 * fileread.h: Likewise.
8130 * gc.h: Likewise.
8131 * gold-threads.cc: Likewise.
8132 * gold.cc: Likewise.
8133 * i386.cc: Likewise.
8134 * icf.h: Likewise.
8135 * incremental-dump.cc: Likewise.
8136 * incremental.cc: Likewise.
8137 * layout.cc: Likewise.
8138 * layout.h: Likewise.
8139 * main.cc: Likewise.
8140 * merge.cc: Likewise.
8141 * merge.h: Likewise.
8142 * object.cc: Likewise.
8143 * object.h: Likewise.
8144 * options.cc: Likewise.
8145 * options.h: Likewise.
8146 * output.cc: Likewise.
8147 * output.h: Likewise.
8148 * plugin.cc: Likewise.
8149 * plugin.h: Likewise.
8150 * powerpc.cc: Likewise.
8151 * reloc.cc: Likewise.
8152 * script-c.h: Likewise.
8153 * script-sections.cc: Likewise.
8154 * script.cc: Likewise.
8155 * stringpool.cc: Likewise.
8156 * symtab.cc: Likewise.
8157 * symtab.h: Likewise.
8158 * target.cc: Likewise.
8159 * timer.cc: Likewise.
8160 * timer.h: Likewise.
8161 * version.cc: Likewise.
8162 * x86_64.cc: Likewise.
8163
b8fa8750
NC
81642010-08-24 Nick Clifton <nickc@redhat.com>
8165
8166 PR 11899
8167 * layout.cc (segment_precedes): Sort segments by their physical
8168 addresses, if they have been set.
8169
9919d93b
CC
81702010-08-23 Cary Coutant <ccoutant@google.com>
8171
8172 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
8173 symbols data.
8174 (Lib_group::include_member): Unlock object after deleting its
8175 symbols data.
8176 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
8177 the bug fixed here.
8178
97b4be1c
CC
81792010-08-19 Neil Vachharajani <nvachhar@google.com>
8180 Cary Coutant <ccoutant@google.com>
8181
8182 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
8183 constructor, and set_blocker.
8184 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
8185 readsyms_blocker_.
8186 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
8187 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
8188 * testsuite/Makefile.am (start_lib_test): New test case.
8189 * testsuite/Makefile.in: Regenerate.
8190 * testsuite/start_lib_test_main.c: New file.
8191 * testsuite/start_lib_test_1.c: New file.
8192 * testsuite/start_lib_test_2.c: New file.
8193 * testsuite/start_lib_test_3.c: New file.
8194
dd0b1884
ILT
81952010-08-19 Ian Lance Taylor <iant@google.com>
8196
8197 * Makefile.in: Rebuild with automake 1.11.1.
8198 * aclocal.m4: Likewise.
8199 * testsuite/Makefile.in: Likewise.
8200
7223e9ca
ILT
82012010-08-19 Ian Lance Taylor <iant@google.com>
8202
8203 PR 10893
8204 * i386.cc (class Output_data_plt_i386): Update declarations.
8205 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
8206 local_ifuncs_ fields.
8207 (Target_i386::do_plt_section_for_global): New function.
8208 (Target_i386::do_plt_section_for_local): New function.
8209 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
8210 parameter; change all callers. Initialize global_ifuncs_ and
8211 local_ifuncs_. If doing a static link define __rel_iplt_start and
8212 __rel_iplt_end.
8213 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
8214 (Output_data_plt_i386::add_local_ifunc_entry): New function.
8215 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
8216 symbols.
8217 (Target_i386::make_plt_section): New function, broken out of
8218 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
8219 (Target_i386::make_plt_entry): Call make_plt_section.
8220 (Target_i386::make_local_ifunc_plt_entry): New function.
8221 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
8222 (Target_i386::Scan::local): Handle IFUNC symbols. Add
8223 R_386_IRELATIVE to switch.
8224 (Target_i386::Scan::global): Likewise.
8225 (Target_i386::Relocate::relocate): Likewise.
8226 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
8227 switch.
8228 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
8229 (Target_x86_64::do_plt_section_for_global): New function.
8230 (Target_x86_64::do_plt_section_for_local): New function.
8231 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
8232 parameter; change all callers. If doing a static link define
8233 __rela_iplt_start and __rela_iplt_end.
8234 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
8235 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
8236 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
8237 to point to .plt.
8238 (Target_x86_64::make_local_ifunc_plt_entry): New function.
8239 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
8240 switch.
8241 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
8242 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
8243 R_X86_64_IRELATIVE to switch.
8244 (Target_x86_64::Scan::global): Likewise.
8245 (Target_x86_64::Relocate::relocate): Likewise.
8246 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
8247 switch.
8248 * target.h (class Target): Add plt_section_for_global and
8249 plt_section_for_local functions. Add do_plt_section_for_global
8250 and do_plt_section_for_local virtual functions.
8251 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
8252 clarifying comments.
8253 (Symbol::use_plt_offset): Handle IFUNC symbol.
8254 * object.cc (Sized_relobj::Sized_relobj): Initialize
8255 local_plt_offsets_.
8256 (Sized_relobj::local_has_plt_offset): New function.
8257 (Sized_relobj::local_plt_offset): New function.
8258 (Sized_relobj::set_local_plt_offset): New function.
8259 (Sized_relobj::do_count): Handle IFUNC symbol.
8260 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
8261 a bit away from input_shndx_ field. Add set_is_func_symbol and
8262 is_ifunc_symbol functions.
8263 (class Sized_relobj): Update declarations. Remove Tls_got_entry
8264 and Local_tls_got_offsets. Define Local_plt_offsets. Add
8265 local_plt_offsets_ field.
8266 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
8267 * output.h (class Output_section_data): Add non-const
8268 output_section function.
8269 (class Output_data_got): Update declarations.
8270 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
8271 Add use_plt_offset parameter to global and local constructors.
8272 Change all callers. Change local_sym_index_ field to 31 bits.
8273 Change GSYM_CODE and CONSTANT_CODE accordingly.
8274 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
8275 doing a static link don't set sh_link field.
8276 (Output_data_got::Got_entry::write): Use PLT offset if
8277 appropriate.
8278 (Output_data_got::add_global_plt): New function.
8279 (Output_data_got::add_local_plt): New function.
8280 * target-reloc.h (relocate_section): Handle IFUNC symbol.
8281 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
8282 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
8283 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
8284 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
8285 IFUNC conditional.
8286 * testsuite/ifunc-sel.h: New file.
8287 * testsuite/ifuncmain1.c: New file.
8288 * testsuite/ifuncmain1vis.c: New file.
8289 * testsuite/ifuncmod1.c: New file.
8290 * testsuite/ifuncdep2.c: New file.
8291 * testsuite/ifuncmain2.c: New file.
8292 * testsuite/ifuncmain3.c: New file.
8293 * testsuite/ifuncmod3.c: New file.
8294 * testsuite/ifuncmain4.c: New file.
8295 * testsuite/ifuncmain5.c: New file.
8296 * testsuite/ifuncmod5.c: New file.
8297 * testsuite/ifuncmain6pie.c: New file.
8298 * testsuite/ifuncmod6.c: New file.
8299 * testsuite/ifuncmain7.c: New file.
8300 * configure, testsuite/Makefile.in: Rebuild.
8301
56f75c03
ILT
83022010-08-18 Ian Lance Taylor <iant@google.com>
8303
8304 * incremental.cc
8305 (Output_section_incremental_inputs::write_input_files): Add cast
8306 to avoid signed/unsigned comparison warning.
8307 (Output_section_incremental_inputs::write_info_blocks): Likewise.
8308
55455f89
CC
83092010-08-12 Cary Coutant <ccoutant@google.com>
8310
8311 * common.cc (Sort_commons::operator()): Remove unnecessary code.
8312
e2054bcb
ILT
83132010-08-13 Ian Lance Taylor <iant@google.com>
8314
8315 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
8316
74f67560
DK
83172010-08-12 Cary Coutant <ccoutant@google.com>
8318 Doug Kwan <dougkwan@google.com>
8319
8320 * resolve.cc (Symbol_table::should_override): When a weak dynamic
8321 defintion overrides non-weak undef, remember that the original undef
8322 is not weak.
8323 * symtab.cc (Symbol_table::sized_write_global): For undef without
8324 an original weak binding, set binding to global in output.
8325 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
8326 * testsuite/Makefile.in: Regenerate.
8327 * testsuite/strong_ref_weak_def.sh: New file.
8328 * testsuite/strong_ref_weak_def_1.c: Ditto.
8329 * testsuite/strong_ref_weak_def_2.c: Ditto.
8330
d1238d12
CC
83312010-08-12 Cary Coutant <ccoutant@google.com>
8332
8333 * testsuite/incremental_test.sh: Rewrite.
8334 * testsuite/incremental_test_1.c: Rewrite.
8335 * testsuite/incremental_test_2.c: Rewrite.
8336
0e70b911
CC
83372010-08-12 Cary Coutant <ccoutant@google.com>
8338
8339 * arm.cc (Target_arm::got_size): Add const.
8340 (Target_arm::got_entry_count): New function.
8341 (Target_arm::plt_entry_count): New function.
8342 (Target_arm::first_plt_entry_offset): New function.
8343 (Target_arm::plt_entry_size): New function.
8344 (Output_data_plt_arm::entry_count): New function.
8345 (Output_data_plt_arm::first_plt_entry_offset): New function.
8346 (Output_data_plt_arm::get_plt_entry_size): New function.
8347 * i386.cc (Target_i386::got_size): Add const.
8348 (Target_i386::got_entry_count): New function.
8349 (Target_i386::plt_entry_count): New function.
8350 (Target_i386::first_plt_entry_offset): New function.
8351 (Target_i386::plt_entry_size): New function.
8352 (Output_data_plt_i386::entry_count): New function.
8353 (Output_data_plt_i386::first_plt_entry_offset): New function.
8354 (Output_data_plt_i386::get_plt_entry_size): New function.
8355 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
8356 find_incremental_inputs_sections. Dump incremental_got_plt section.
8357 * incremental.cc: Include target.h.
8358 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
8359 parameter. Adjust all callers. Find incremental_got_plt section.
8360 (Incremental_inputs::create_data_sections): Create incremental_got_plt
8361 section.
8362 (Output_section_incremental_inputs::set_final_data_size): Calculate
8363 size of incremental_got_plt section.
8364 (Output_section_incremental_inputs::do_write): Write the
8365 incremental_got_plt section.
8366 (Got_plt_view_info): New struct.
8367 (Local_got_offset_visitor): New class.
8368 (Global_got_offset_visitor): New class.
8369 (Global_symbol_visitor_got_plt): New class.
8370 (Output_section_incremental_inputs::write_got_plt): New function.
8371 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
8372 Add parameter. Adjust all callers.
8373 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8374 (Incremental_inputs::got_plt_section): New function.
8375 (Incremental_inputs::got_plt_section_): New data member.
8376 (Incremental_got_plt_reader): New class.
8377 * layout.cc (Layout::create_incremental_info_sections): Add the
8378 incremental_got_plt section.
8379 * object.h (Got_offset_list::get_list): New function.
8380 (Got offset_list::for_all_got_offsets): New function.
8381 (Sized_relobj::local_got_offset_list): New function.
8382 * powerpc.cc (Target_powerpc::got_size): Add const.
8383 (Target_powerpc::got_entry_count): New function.
8384 (Target_powerpc::plt_entry_count): New function.
8385 (Target_powerpc::first_plt_entry_offset): New function.
8386 (Target_powerpc::plt_entry_size): New function.
8387 (Output_data_plt_powerpc::entry_count): New function.
8388 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
8389 (Output_data_plt_powerpc::get_plt_entry_size): New function.
8390 * sparc.cc (Target_sparc::got_size): Add const.
8391 (Target_sparc::got_entry_count): New function.
8392 (Target_sparc::plt_entry_count): New function.
8393 (Target_sparc::first_plt_entry_offset): New function.
8394 (Target_sparc::plt_entry_size): New function.
8395 (Output_data_plt_sparc::entry_count): New function.
8396 (Output_data_plt_sparc::first_plt_entry_offset): New function.
8397 (Output_data_plt_sparc::get_plt_entry_size): New function.
8398 * symtab.h (Symbol::got_offset_list): New function.
8399 (Symbol_table::for_all_symbols): New function.
8400 * target.h (Sized_target::got_entry_count): New function.
8401 (Sized_target::plt_entry_count): New function.
8402 (Sized_target::plt_entry_size): New function.
8403 * x86_64.cc (Target_x86_64::got_size): Add const.
8404 (Target_x86_64::got_entry_count): New function.
8405 (Target_x86_64::plt_entry_count): New function.
8406 (Target_x86_64::first_plt_entry_offset): New function.
8407 (Target_x86_64::plt_entry_size): New function.
8408 (Output_data_plt_x86_64::entry_count): New function.
8409 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
8410 (Output_data_plt_x86_64::get_plt_entry_size): New function.
8411
09ec0418
CC
84122010-08-12 Cary Coutant <ccoutant@google.com>
8413
8414 * archive.cc: Include incremental.h.
8415 (Archive::Archive): Initialize incremental_info_.
8416 (Archive::include_member): Record archive members in incremental info.
8417 (Add_archive_symbols::run): Record begin and end of an archive in
8418 incremental info.
8419 (Lib_group::include_member): Record objects in incremental info.
8420 * archive.h (Incremental_archive_entry): Forward declaration.
8421 (Archive::set_incremental_info): New member function.
8422 (Archive::incremental_info): New member function.
8423 (Archive::Unused_symbol_iterator): New class.
8424 (Archive::unused_symbols_begin): New member function.
8425 (Archive::unused_symbols_end): New member function.
8426 (Archive::incremental_info_): New data member.
8427 * incremental-dump.cc (find_input_containing_global): New function.
8428 (dump_incremental_inputs): Dump new incremental info sections.
8429 * incremental.cc: Include symtab.h.
8430 (Output_section_incremental_inputs): New class.
8431 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
8432 new incremental info sections.
8433 (Sized_incremental_binary::do_check_inputs): Likewise.
8434 (Incremental_inputs::report_archive): Remove.
8435 (Incremental_inputs::report_archive_begin): New function.
8436 (Incremental_inputs::report_archive_end): New function.
8437 (Incremental_inputs::report_object): New function.
8438 (Incremental_inputs::finalize_inputs): Remove.
8439 (Incremental_inputs::report_input_section): New function.
8440 (Incremental_inputs::report_script): Rewrite.
8441 (Incremental_inputs::finalize): Do nothing but finalize string table.
8442 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8443 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8444 (Incremental_inputs::create_data_sections): New function.
8445 (Incremental_inputs::relocs_entsize): New function.
8446 (Output_section_incremental_inputs::set_final_data_size): New function.
8447 (Output_section_incremental_inputs::do_write): New function.
8448 (Output_section_incremental_inputs::write_header): New function.
8449 (Output_section_incremental_inputs::write_input_files): New function.
8450 (Output_section_incremental_inputs::write_info_blocks): New function.
8451 (Output_section_incremental_inputs::write_symtab): New function.
8452 * incremental.h (Incremental_script_entry): Forward declaration.
8453 (Incremental_object_entry): Forward declaration.
8454 (Incremental_archive_entry): Forward declaration.
8455 (Incremental_inputs): Forward declaration.
8456 (Incremental_inputs_header_data): Remove.
8457 (Incremental_inputs_header): Remove.
8458 (Incremental_inputs_header_write): Remove.
8459 (Incremental_inputs_entry_data): Remove.
8460 (Incremental_inputs_entry): Remove.
8461 (Incremental_inputs_entry_write): Remove.
8462 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
8463 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
8464 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8465 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
8466 Likewise.
8467 (Incremental_input_entry): New class.
8468 (Incremental_script_entry): New class.
8469 (Incremental_object_entry): New class.
8470 (Incremental_archive_entry): New class.
8471 (Incremental_inputs::Incremental_inputs): Initialize new data members.
8472 (Incremental_inputs::report_inputs): Remove.
8473 (Incremental_inputs::report_archive): Remove.
8474 (Incremental_inputs::report_archive_begin): New function.
8475 (Incremental_inputs::report_archive_end): New function.
8476 (Incremental_inputs::report_object): Change prototype.
8477 (Incremental_inputs::report_input_section): New function.
8478 (Incremental_inputs::report_script): Change prototype.
8479 (Incremental_inputs::get_reloc_count): New function.
8480 (Incremental_inputs::set_reloc_count): New function.
8481 (Incremental_inputs::create_data_sections): New function.
8482 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8483 (Incremental_inputs::inputs_section): New function.
8484 (Incremental_inputs::symtab_section): New function.
8485 (Incremental_inputs::relocs_section): New function.
8486 (Incremental_inputs::get_stringpool): Add const.
8487 (Incremental_inputs::command_line): Add const.
8488 (Incremental_inputs::inputs): Remove.
8489 (Incremental_inputs::command_line_key): New function.
8490 (Incremental_inputs::input_file_count): New function.
8491 (Incremental_inputs::input_files): New function.
8492 (Incremental_inputs::relocs_entsize): New function.
8493 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8494 (Incremental_inputs::finalize_inputs): Remove.
8495 (Incremental_inputs::Input_info): Remove.
8496 (Incremental_inputs::lock_): Remove.
8497 (Incremental_inputs::inputs_): Change type.
8498 (Incremental_inputs::inputs_map_): Remove.
8499 (Incremental_inputs::current_object_entry_): New data member.
8500 (Incremental_inputs::inputs_section_): New data member.
8501 (Incremental_inputs::symtab_section_): New data member.
8502 (Incremental_inputs::relocs_section_): New data member.
8503 (Incremental_inputs::reloc_count_): New data member.
8504 (Incremental_inputs_reader): New class.
8505 (Incremental_symtab_reader): New class.
8506 (Incremental_relocs_reader): New class.
8507 * layout.cc (Layout::finalize): Move finalization of incremental info
8508 and creation of incremental info sections to follow finalization of
8509 symbol table. Set offsets for postprocessing sections.
8510 (Layout::create_incremental_info_sections): Call
8511 Incremental_inputs::create_data_sections. Add incremental symtab
8512 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
8513 sections to layout after input sections.
8514 * layout.h (struct Timespec): Forward declaration.
8515 (Layout::incremental_inputs): Add const.
8516 (Layout::create_incremental_info_sections): Add parameter.
8517 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
8518 * object.cc: Include incremental.h.
8519 (Relobj::finalize_incremental_relocs): New function.
8520 (Sized_relobj::do_layout): Record input sections in incremental info.
8521 * object.h (Object::output_section): New function.
8522 (Object::output_section_offset): Moved from Relobj.
8523 (Object::get_incremental_reloc_base): New function.
8524 (Object::get_incremental_reloc_count): New function.
8525 (Object::do_output_section): New function.
8526 (Object::do_output_section_offset): Moved from Relobj.
8527 (Object::do_get_incremental_reloc_base): New function.
8528 (Object::do_get_incremental_reloc_count): New function.
8529 (Object::Object): Initialize new data members.
8530 (Relobj::output_section): Renamed do_output_section and moved to
8531 protected.
8532 (Relobj::output_section_offset): Moved to Object.
8533 (Relobj::do_get_incremental_reloc_base): New function.
8534 (Relobj::do_get_incremental_reloc_count): New function.
8535 (Relobj::allocate_incremental_reloc_counts): New function.
8536 (Relobj::count_incremental_reloc): New function.
8537 (Relobj::finalize_incremental_relocs): New function.
8538 (Relobj::next_incremental_reloc_index): New function.
8539 (Relobj::reloc_counts_): New data member.
8540 (Relobj::reloc_bases_): New data member.
8541 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
8542 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
8543 (Sized_relobj::incremental_relocs_scan): New function.
8544 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8545 (Sized_relobj::incremental_relocs_write): New function.
8546 (Sized_relobj::incremental_relocs_write_reltype): New function.
8547 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
8548 incremental link.
8549 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
8550 archives and object files elsewhere.
8551 (Add_symbols::run): Report object files here.
8552 (Finish_group::run): Report end of archive at end of group.
8553 * reloc.cc: Include layout.h, incremental.h.
8554 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
8555 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
8556 (Sized_relobj::incremental_relocs_scan): New function.
8557 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8558 (Sized_relobj::do_relocate_sections): Write incremental relocations.
8559 (Sized_relobj::incremental_relocs_write): New function.
8560 (Sized_relobj::incremental_relocs_write_reltype): New function.
8561 * script.cc (read_input_script): Rewrite test for incremental link.
8562 Change call to Incremental_inputs::report_script.
8563 * symtab.h (Symbol_table::first_global_index): New function.
8564 (Symbol_table::output_count): New function.
8565
ce0d1972
DK
85662010-08-12 Doug Kwan <dougkwan@google.com>
8567
8568 * arm.cc (Target_arm::merge_object_attributes): Check command line
8569 options --no-wchar-size-warning and --no-enum-size-warning.
8570 * options.h (General_options): Add ld-compatible options
8571 --no-enum-size-warning and --no-wchar-size-warning.
8572
6e5710ce
ILT
85732010-08-04 Ian Lance Taylor <iant@google.com>
8574
8575 * x86_64.cc (Target_x86_64::Scan::local): Use
8576 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
8577 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
8578 (Target_x86_64::Scan::global): Likewise.
8579 (Target_x86_64::Relocate::relocate): Likewise.
8580 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
8581 Likewise.
8582
fef830db
CC
85832010-08-03 Cary Coutant <ccoutant@google.com>
8584
8585 * merge.cc (Output_merge_string::do_add_input_section): Count strings
8586 to reserve space in merged_strings vector. Keep total input size
8587 for stats.
8588 (Output_merge_string::do_print_merge_stats): Print total input size.
8589 * merge.h (Output_merge_string): Add input_size_ field.
8590 * stringpool.cc (Stringpool_template::string_length): Move
8591 implementations out of Stringpool_template class and place in
8592 stringpool.h.
8593 * stringpool.h (string_length): Move out of Stringpool_template.
8594
1e3811b0
ILT
85952010-08-03 Ian Lance Taylor <iant@google.com>
8596
8597 PR 11712
8598 * layout.cc (relaxation_loop_body): If address of load segment is
8599 set, adjust address to include headers if possible.
8600
7af0c620
ILT
86012010-08-03 Ian Lance Taylor <iant@google.com>
8602
8603 * version.cc (version_string): Bump to 1.10.
8604
22f0da72
ILT
86052010-08-03 Ian Lance Taylor <iant@google.com>
8606
8607 PR 11805
8608 * layout.h (enum Output_section_order): Define.
8609 (class Layout): Update declarations.
8610 * layout.cc (Layout::get_output_section): Add order parameter.
8611 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
8612 is_first_non_relro parameters. Change all callers.
8613 (Layout::choose_output_section): Likewise.
8614 (Layout::add_output_section_data): Likewise.
8615 (Layout::make_output_section): Likewise. Set order.
8616 (Layout::default_section_order): New function.
8617 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
8618 * output.cc (Output_section::Output_section): Initialize order_.
8619 Don't initialize deleted fields.
8620 (Output_segment::Output_segment): Don't initialize deleted
8621 fields.
8622 (Output_segment::add_output_section_to_load): New function
8623 replacing add_output_section. Change all callers to call this or
8624 add_output_section_to_nonload.
8625 (Output_segment::add_output_section_to_nonload): New function.
8626 (Output_segment::remove_output_section): Rewrite.
8627 (Output_segment::add_initial_output_data): Likewise.
8628 (Output_segment::has_any_data_sections): Likewise.
8629 (Output_segment::is_first_section_relro): Likewise.
8630 (Output_segment::maximum_alignment): Likewise.
8631 (Output_segment::has_dynamic_reloc): New function replacing
8632 dynamic_reloc_count. Change all callers.
8633 (Output_segment::has_dynamic_reloc_list): New function replacing
8634 dynamic_reloc_count_list. Change all callers.
8635 (Output_segment::set_section_addresses): Rewrite.
8636 (Output_segment::set_offset): Rewrite.
8637 (Output_segment::find_first_and_last_list): Remove.
8638 (Output_segment::set_tls_offsets): Rewrite.
8639 (Output_segment::first_section_load_address): Likewise.
8640 (Output_segment::output_section_count): Likewise.
8641 (Output_segment::section_with_lowest_load_address): Likewise.
8642 (Output_segment::write_section_headers): Likewise.
8643 (Output_segment::print_sections_to_map): Likewise.
8644 * output.h (class Output_data): Remove dynamic_reloc_count_
8645 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
8646 (Output_data::add_dynamic_reloc): Rewrite.
8647 (Output_data::has_dynamic_reloc): New function.
8648 (Output_data::dynamic_reloc_count): Remove.
8649 (class Output_section): Add order_ field. Remvoe is_relro_local_,
8650 is_last_relro_, is_first_non_relro_, is_interp_,
8651 is_dynamic_linker_section_ fields. Add order and set_order
8652 functions. Remove is_relro_local, set_is_relro_local,
8653 is_last_relro, set_is_last_relro, is_first_non_relro,
8654 set_is_first_non_relro functions, is_interp, set_is_interp,
8655 is_dynamic_linker_section, and set_is_dynamic_linker_section
8656 functions.
8657 (class Output_segment): Change Output_data_list from std::list to
8658 std:;vector. Add output_lists_ field. Remove output_data_ and
8659 output_bss_ fields. Update declarations.
8660
3ff2ccb0
ILT
86612010-08-02 Ian Lance Taylor <iant@google.com>
8662
8663 * arm.cc (Target_arm::gc_process_relocs): Use typename.
8664 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
8665 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
8666
88a4108b
ILT
86672010-08-02 Ian Lance Taylor <iant@google.com>
8668
8669 PR 11855
8670 * script.cc (Script_options::Script_options): Initialize
8671 symbol_definitions_ and symbol_references_.
8672 (Script_options::add_symbol_assignment): Update
8673 symbol_definitions_ and symbol_references_.
8674 (Script_options::add_symbol_reference): New function.
8675 (script_symbol): New function.
8676 * script.h (class Script_options): Add symbol_definitions_ and
8677 symbol_references_ fields.
8678 (Script_options::referenced_const_iterator): New type.
8679 (Script_options::referenced_begin): New function.
8680 (Script_options::referenced_end): New function.
8681 (Script_options::is_referenced): New function.
8682 (Script_options::any_unreferenced): New function.
8683 * script-c.h (script_symbol): Declare.
8684 * yyscript.y (exp): Call script_symbol.
8685 * symtab.cc: Include "script.h".
8686 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
8687 Change all callers. Check symbols referenced by scripts.
8688 (Symbol_table::add_undefined_symbols_from_command_line): Add
8689 layout parameter. Change all callers.
8690 (Symbol_table::do_add_undefined_symbols_from_command_line):
8691 Likewise. Break out loop body. Check symbols referenced by
8692 scripts.
8693 (Symbol_table::add_undefined_symbol_from_command_line): New
8694 function broken out of
8695 do_add_undefined_symbols_from_command_line.
8696 * symtab.h (class Symbol_table): Update declarations.
8697 * archive.cc: Include "layout.h".
8698 (Archive::should_include_member): Add layout parameter. Change
8699 all callers. Check for symbol mentioned in expression.
8700 * archive.h (class Archive): Update declaration.
8701 * object.cc (Sized_relobj::do_should_include_member): Add layout
8702 parameter.
8703 * object.h (Object::should_include_member): Add layout parameter.
8704 Change all callers.
8705 (Object::do_should_include_member): Add layout parameter.
8706 (class Sized_relobj): Update declaration.
8707 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
8708 parameter.
8709 * dynobj.h (class Sized_dynobj): Update declaration.
8710 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
8711 layout parameter.
8712 * plugin.h (class Sized_pluginobj): Update declaration.
8713
5f1ab67a
ILT
87142010-08-02 Ian Lance Taylor <iant@google.com>
8715
8716 PR 11866
8717 * output.cc (Output_segment::set_offset): Search for the first and
8718 last sections rather than assuming that the list is in order.
8719 (Output_segment::find_first_and_last_list): New function.
8720 * output.h (class Output_segment): Update declarations.
8721 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
8722 (relro_strip_test_SOURCES): New variable.
8723 (relro_strip_test_DEPENDENCIES): New variable.
8724 (relro_strip_test_LDFLAGS): New variable.
8725 (relro_strip_test_LDADD): New variable.
8726 (relro_strip_test.so): New target.
8727
a8df5856
ILT
87282010-08-02 Ian Lance Taylor <iant@google.com>
8729
8730 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
8731 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
8732 (Target_i386::got_tlsdesc_section): New function.
8733 (Target_i386::got_section): Create space for GOT entries for
8734 TLSDESC relocations.
8735 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
8736 R_386_TLS_GOTDESC.
8737 (Target_i386::Scan::global): Likewise.
8738 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
8739 using TLSDESC GOT.
8740 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
8741 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
8742 (Target_x86_64::got_tlsdesc_section): New function.
8743 (Target_x86_64::got_section): Create space for GOT entries for
8744 TLSDESC relocations.
8745 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
8746 R_386_TLS_GOTDESC.
8747 (Target_x86_64::Scan::global): Likewise.
8748 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
8749 using TLSDESC GOT.
8750
0c10a0a6
ILT
87512010-08-02 Ian Lance Taylor <iant@google.com>
8752
8753 * testsuite/final_layout.sh: Use dc to convert from hex to
8754 decimal.
8755
41cbeecc
ST
87562010-07-29 Sriraman Tallam <tmsriram@google.com>
8757
8758 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
8759 paramter to the call to gold::gc_process_relocs.
8760 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
8761 paramter to the call to gold::gc_process_relocs.
8762 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
8763 parameter to the call to gold::gc_process_relocs.
8764 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
8765 template parameter to the call to gold::gc_process_relocs.
8766 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
8767 paramter to the call to gold::gc_process_relocs.
8768 * gc.h (get_embedded_addend_size): New function.
8769 (gc_process_relocs): Save the size of the reloc for use by ICF.
8770 * icf.cc (get_section_contents): Get the addend from the text section
8771 for SHT_REL relocation sections.
8772 * icf.h (Icf::Reloc_addend_size_info): New typedef.
8773 (Icf::Reloc_info): Add new member reloc_addend_size_info.
8774 * int_encoding.h (read_from_pointer): New overloaded function.
8775 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
8776 * testsuite/icf_sht_rel_addend_test.sh: New file.
8777 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
8778 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
8779
6ea55b82
RW
87802010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8781
8782 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
8783 * Makefile.in: Regenerate.
8784 * testsuite/Makefile.in: Regenerate.
8785
9691462b
ILT
87862010-07-27 Jeffrey Yasskin <jyasskin@google.com>
8787
8788 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
8789 * gold/testsuite/debug_msg.cc: Likewise.
8790 * gold/testsuite/odr_violation1.cc
8791 * gold/testsuite/odr_violation2.cc
8792
76897331
CC
87932010-07-21 Cary Coutant <ccoutant@google.com>
8794
8795 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
8796 string, and length fields.
8797 (Output_merge_string::Merged_strings_list): New type.
8798 (Output_merge_string::Merged_strings_lists): New typedef.
8799 (Output_merge_string): Replace merged_strings_ with
8800 merged_strings_lists_.
8801 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
8802 Merged_strings_list per input object and section. Don't store pointer
8803 to the string. Don't store length with each merged string entry.
8804 (Output_merge_string::finalize_merged_data): Loop over list of merged
8805 strings lists. Recompute length of each merged string.
8806
78384e8f
CC
88072010-07-15 Cary Coutant <ccoutant@google.com>
8808
8809 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
8810 here.
8811
783659f9
ILT
88122010-07-14 Ian Lance Taylor <iant@google.com>
8813
8814 * descriptors.cc (Descriptors::open): Report correct name in error
8815 message.
8816
131687b4
DK
88172010-07-13 Doug Kwan <dougkwan@google.com>
8818
8819 * arm.cc (Arm_input_section::Arm_input_section): For a
8820 SHT_ARM_EXIDX section, always keeps the input sections.
8821 (Arm_input_section::set_exidx_section_link): New method.
8822 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
8823 has_errors_ to false.
8824 (Arm_exidx_input_section::has_errors,
8825 Arm_exidx_input_section::set_has_errors): New methods.
8826 (Arm_exidx_input_section::has_errors_): New data member.
8827 (Arm_relobj::get_exidx_shndx_list): New method.
8828 (Arm_output_section::append_text_sections_to_list): Do not skip
8829 section without SHF_EXECINSTR.
8830 (Arm_output_section::fix_exidx_coverage): Skip input sections with
8831 errors.
2e702c99 8832 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
8833 section header. Make error messages more verbose. Check for
8834 a non-executable section linked to an EXIDX section.
8835 (Arm_relobj::do_read_symbols): Remove error checking, which has been
8836 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
8837 check that there is no deferred EXIDX section if we exit early.
8838 Instead of not making an EXIDX section in case of an error, make one
8839 and set the has_errors flag of it.
8840 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
8841 in a relocatable link.
8842 (Target_arm::do_relax): Look for the EXIDX output section instead of
8843 assuming that it is called .ARM.exidx.
2e702c99 8844 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
8845 section list. Do not check for SHF_EXECINSTR section flags but
8846 skip any input section with errors.
8847 * output.cc (Output_section::Output_section): Initialize
8848 always_keeps_input_sections_ to false.
8849 (Output_section::add_input_section): Check for
8850 always_keeps_input_sections_.
8851 * output.h (Output_section::always_keeps_input_sections,
8852 Output_section::set_always_keeps_input_sections): New methods.
8853 (Output_section::always_keeps_input_sections): New data member.
8854
69517287
RÁE
88552010-07-13 Rafael Espindola <espindola@google.com>
8856
8857 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
8858 * fileread.h (Input_file): Add try_extra_search_path and find_file.
8859
82742395
ILT
88602010-07-13 Philip Herron <herron.philip@googlemail.com>
8861 Ian Lance Taylor <iant@google.com>
8862
8863 * output.h (Output_section_lookup_maps::add_merge_section):
8864 Correct check of whether value was inserted.
8865 (Output_section_lookup_maps::add_merge_input_section): Likewise.
8866 (Output_section_lookup_maps::add_relaxed_input_section):
8867 Likewise.
8868 * arm.cc (Target_arm::got_section): Remove used local os.
8869 * i386.cc (Target_i386::got_section): Likewise.
8870 * x86_64.cc (Target_x86_64::got_section): Likewise.
8871 * sparc.cc (Target_sparc::got_section): Likewise.
8872 (Target_sparc::relocate): Remove unused local have_got_offset.
8873 * powerpc.cc (Target_powerpc::relocate): Likewise.
8874
f2d707b5
ILT
88752010-07-13 Ian Lance Taylor <iant@google.com>
8876
241531d6
ILT
8877 * compressed_output.cc (zlib_decompress): Fix signature in
8878 !HAVE_ZLIB_H case.
8879
f2d707b5
ILT
8880 * archive.cc (Archive::include_member): Unlock an external member
8881 of a thin archive. Don't bother to delete an object we know is
8882 NULL.
8883
a2e47362
CC
88842010-07-12 Cary Coutant <ccoutant@google.com>
8885
8886 * compressed_output.cc (zlib_decompress): New function.
8887 (get_uncompressed_size): New function.
8888 (decompress_input_section): New function.
8889 * compressed_output.h (get_uncompressed_size): New function.
8890 (decompress_input_section): New function.
8891 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
8892 Handle compressed debug sections.
8893 * layout.cc (is_compressed_debug_section): New function.
8894 (Layout::output_section_name): Map compressed section names to
8895 canonical names.
8896 * layout.h (is_compressed_debug_section): New function.
8897 (is_debug_info_section): Recognize compressed debug sections.
8898 * merge.cc: Include compressed_output.h.
8899 (Output_merge_data::do_add_input_section): Handle compressed
8900 debug sections.
8901 (Output_merge_string::do_add_input_section): Handle compressed
8902 debug sections.
8903 * object.cc: Include compressed_output.h.
8904 (Sized_relobj::Sized_relobj): Initialize new data members.
8905 (build_compressed_section_map): New function.
8906 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
8907 * object.h (Object::section_is_compressed): New method.
8908 (Object::do_section_is_compressed): New method.
8909 (Sized_relobj::Compressed_section_map): New type.
8910 (Sized_relobj::do_section_is_compressed): New method.
8911 (Sized_relobj::compressed_sections_): New data member.
8912 * output.cc (Output_section::add_input_section): Handle compressed
8913 debug sections.
8914 * reloc.cc: Include compressed_output.h.
8915 (Sized_relobj::write_sections): Handle compressed debug sections.
8916
ce279a62
CC
89172010-07-08 Cary Coutant <ccoutant@google.com>
8918
8919 * resolve.cc (Symbol_table::resolve): Remember whether undef was
8920 weak when resolving to a dynamic def.
8921 (Symbol_table::should_override): Add adjust_dyndef flag; set it
8922 for weak undef/dynamic def cases. Adjust callers.
8923 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
8924 undef_binding_weak_.
8925 (Symbol_table::sized_write_globals): Adjust symbol binding.
8926 (Symbol_table::sized_write_symbol): Add binding parameter.
8927 * symtab.h (Symbol::set_undef_binding): New method.
8928 (Symbol::is_undef_binding_weak): New method.
8929 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
8930 (Symbol_table::should_override): Add new parameter.
8931 (Symbol_table::sized_write_symbol): Add new parameter.
8932
8933 * testsuite/weak_undef_file1.cc: Add new test case.
8934 * testsuite/weak_undef_file2.cc: Fix header comment.
8935 * testsuite/weak_undef_test.cc: Add new test case.
8936
b2286c10
DK
89372010-06-29 Doug Kwan <dougkwan@google.com>
8938
8939 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
8940 Initialize USE_SYMBOL_.
8941 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
8942 definition.
8943 (Arm_reloc_property::uses_symbol_): New data member declaration.
8944 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
8945 uses symbol value and symbol is undefined but not weakly undefined.
8946
4802450a
RÁE
89472010-06-28 Rafael Espindola <espindola@google.com>
8948
8949 * plugin.cc (Plugin::load): Use dlerror.
8950
e5ca47ba
ILT
89512010-06-26 Jeffrey Yaskin <jyasskin@google.com>
8952
8953 * symtab.cc (detect_odr_violations): When reporting an ODR
8954 violation, report an object where the symbol is defined.
8955
8a75a161
DK
89562010-06-25 Doug Kwan <dougkwan@google.com>
8957
8958 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
8959 (Target_arm::section_may_have_icf_unsafe_pointers): New method
8960 definition.
8961 (Target_arm::Scan::local_reloc_may_be_function_pointer,
8962 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
8963 target hook to detect function points.
8964 (Target_arm::Scan::possible_function_pointer_reloc): New method.
8965 * icf.h (Icf::check_section_for_function_pointers): Change type of
8966 parameter SECTION_NAME to const reference to std::string. Use
8967 target hook to determine if section may have unsafe pointers.
8968 * target.h (Target::section_may_have_icf_unsafe_pointers): New
8969 method definition.
8970
42218b9f
RÁE
89712010-06-21 Rafael Espindola <espindola@google.com>
8972
8973 * fileread.cc (Input_file::find_fie): New
8974 (Input_file::open): Use Input_file::find_fie.
8975 * fileread.h (Input_file::find_fie): New
8976 * plugin.cc (set_extra_library_path): New.
8977 (Plugin::load): Add set_extra_library_path to the transfer vector.
8978 (Plugin_manager::set_extra_library_path): New.
8979 (Plugin_manager::add_input_file): Use the extra search path if set.
8980 (set_extra_library_path(): New.
8981 * plugin.h (Plugin_manager): Add set_extra_library_path and
8982 extra_search_path_.
8983
a0506cca
CC
89842010-06-19 Cary Coutant <ccoutant@google.com>
8985
8986 * layout.cc (gdb_sections): Add .debug_types.
8987 (lines_only_debug_sections): Likewise.
8988
6508b958
RÁE
89892010-06-18 Rafael Espindola <espindola@google.com>
8990
8991 * plugin.cc (add_input_file,add_input_library)
8992 (Plugin_manager::add_input_file): Make filename arguments const.
8993 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
8994 const.
8995
3e235302
DK
89962010-06-16 Doug Kwan <dougkwan@google.com>
8997
8998 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
8999 .ARM.attributes section if we have not merged any input
9000 attributes sections.
9001
106e8a6c
DK
90022010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9003
9004 * arm.cc: Allow combining objects with no EABI version
9005 information.
9006
91ff43fe
RÁE
90072010-06-15 Rafael Espindola <espindola@google.com>
9008
9009 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
9010
68ed838c
ILT
90112010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9012
9013 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
9014 (struct iovec): Correct !HAVE_READV definition.
9015
f3a2388f
CC
90162010-06-10 Cary Coutant <ccoutant@google.com>
9017
9018 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
9019 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
9020 reloc sections.
9021 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
9022
9023 PR 11683
9024 * symtab.h (Symbol::is_placeholder): New member function.
9025 * target-reloc.h (relocate_section): Check for placeholder symbols.
9026
9027 * testsuite/Makefile.am (plugin_test_8): New test.
9028 (plugin_test_9): New test.
9029 * testsuite/Makefile.in: Regenerate.
9030
e1df38aa
NC
90312010-06-09 Nick Clifton <nickc@redhat.com>
9032
9033 * yyscript.y (input_list_element): Allow strings prefixed with
9034 the '-' character. Treat these as libraries.
9035 * script.cc (script_add_library): New function. Adds a library
9036 specified by "-l<name>" found in an input script.
9037 * script-c.h: Add prototype for script_add_library.
9038
25bbe950
DK
90392010-06-07 Doug Kwan <dougkwan@google.com>
9040
9041 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
9042 Restrict stub-group size to be within long conditional branch
9043 range when working around cortex-A8 erratum.
9044
0f32ea4c
ILT
90452010-06-07 Damien Diederen <dd@crosstwine.com>
9046
9047 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
9048 #ifdef typo.
9049
8fe2a369
ST
90502010-06-03 Sriraman Tallam <tmsriram@google.com>
9051
9052 PR gold/11658
9053 * output.cc
9054 (Output_section::Input_section_sort_entry::compare_section_ordering):
9055 Change to return non-zero correctly.
9056 (Output_section::Input_section_sort_section_order_index_compare
9057 ::operator()): Change to fix ambiguity in comparisons.
9058
6e9ba2ca
ST
90592010-06-01 Sriraman Tallam <tmsriram@google.com>
9060
9061 * gold.h (is_wildcard_string): New function.
9062 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
9063 (Layout::layout_eh_frame): Ditto.
9064 (Layout::find_section_order_index): New method.
9065 (Layout::read_layout_from_file): New method.
9066 * layout.h (Layout::find_section_order_index): New method.
9067 (Layout::read_layout_from_file): New method.
9068 (Layout::input_section_position_): New private member.
9069 (Layout::input_section_glob_): New private member.
9070 * main.cc (main): Call read_layout_from_file here.
9071 * options.h (--section-ordering-file): New option.
9072 * output.cc (Output_section::input_section_order_specified_): New
9073 member.
9074 (Output_section::Output_section): Initialize new member.
9075 (Output_section::add_input_section): Add new parameter.
9076 Keep input sections when --section-ordering-file is used.
9077 (Output_section::set_final_data_size): Sort input sections when
9078 section ordering file is specified.
9079 (Output_section::Input_section_sort_entry): Add new parameter.
9080 Check sorting type.
9081 (Output_section::Input_section_sort_entry::compare_section_ordering):
9082 New method.
9083 (Output_section::Input_section_sort_compare::operator()): Change to
9084 consider section_order_index.
9085 (Output_section::Input_section_sort_init_fini_compare::operator()):
9086 Change to consider section_order_index.
9087 (Output_section::Input_section_sort_section_order_index_compare
9088 ::operator()): New method.
9089 (Output_section::sort_attached_input_sections): Change to sort
9090 according to section order when specified.
e1df38aa
NC
9091 (Output_section::add_input_section<32, true>): Add new parameter.
9092 (Output_section::add_input_section<64, true>): Add new parameter.
9093 (Output_section::add_input_section<32, false>): Add new parameter.
9094 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
9095 * output.h (Output_section::add_input_section): Add new parameter.
9096 (Output_section::input_section_order_specified): New
9097 method.
9098 (Output_section::set_input_section_order_specified): New method.
9099 (Input_section::Input_section): Initialize section_order_index_.
9100 (Input_section::section_order_index): New method.
9101 (Input_section::set_section_order_index): New method.
9102 (Input_section::section_order_index_): New member.
9103 (Input_section::Input_section_sort_section_order_index_compare): New
9104 struct.
9105 (Output_section::input_section_order_specified_): New member.
9106 * script-sections.cc (is_wildcard_string): Delete and move modified
9107 method to gold.h.
9108 (Output_section_element_input::Output_section_element_input): Modify
9109 call to is_wildcard_string.
9110 (Output_section_element_input::Input_section_pattern
9111 ::Input_section_pattern): Ditto.
9112 (Output_section_element_input::Output_section_element_input): Ditto.
9113 * testsuite/Makefile.am (final_layout): New test case.
9114 * testsuite/Makefile.in: Regenerate.
9115 * testsuite/final_layout.cc: New file.
9116 * testsuite/final_layout.sh: New file.
9117
3537c84b
RÁE
91182010-06-01 Rafael Espindola <espindola@google.com>
9119
9120 * plugin.cc (Plugin::load): Pass the output name to the plugin.
9121
105b6afd
RÁE
91222010-06-01 Rafael Espindola <espindola@google.com>
9123
9124 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
9125 visibility of symbols.
9126
29e11421
DK
91272010-05-27 Doug Kwan <dougkwan@google.com>
9128
9129 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
9130 from start of output section instead of address for a local symbol
9131 in a merged or relaxed section when doing a relocatable link.
9132
5e0f337e
RÁE
91332010-05-26 Rafael Espindola <espindola@google.com>
9134
703d02da 9135 PR 11604
5e0f337e
RÁE
9136 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
9137 adding sections the garbage collector removed.
9138 * gold/testsuite/Makefile.am: Add test.
9139 * gold/testsuite/Makefile.in: Regenerate.
9140 * gold/testsuite/plugin_test_7.sh: New.
9141 * gold/testsuite/plugin_test_7_1.c: New.
9142 * gold/testsuite/plugin_test_7_2.c: New.
9143
f4187277
RÁE
91442010-05-26 Rafael Espindola <espindola@google.com>
9145
9146 * script-sections.cc (Output_section_definition::set_section_addresses):
9147 Check for --section-start.
9148
5c388529
DK
91492010-05-26 Doug Kwan <dougkwan@google.com>
9150
9151 * arm.cc (Arm_scan_relocatable_relocs): New class.
9152 (Target_arm::relocate_special_relocatable): New method.
9153 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
9154 (Arm_relocate_functions::thumb_branch_common): Same.
9155 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
9156 instead of Default_scan_relocatable_relocs.
9157 * target-reloc.h (relocate_for_relocatable): Let target handle
9158 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
9159 * target.h (Sized_target::relocate_special_relocatable): New method.
9160
bca1c3ae
ILT
91612010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9162
9163 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
9164
0439c796
DK
91652010-05-23 Doug Kwan <dougkwan@google.com>
9166
9167 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
9168 instead of a cast.
9169 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
9170 with a direct branch, not a conditional branch, to a stub.
9171 * merge.cc (Output_merge_base::record_input_section): New method
9172 defintion.
9173 (Output_merge_data::do_add_input_section): Record input section if
9174 keeps-input-sections flag is set.
9175 (Output_merge_string::do_add_input_section): Ditto.
9176 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
9177 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
9178 INPUT_SECTIONS_.
9179 (Output_merge_base::keeps_input_sections,
9180 Output_merge_base::set_keeps_input_sections,
9181 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
9182 method definitions.
9183 (Output_merge_base::Input_sections): New type declaration.
9184 (Output_merge_base::input_sections_begin,
9185 Output_merge_base::input_sections_end,
9186 Output_merge_base::do_set_keeps_input_sections): New method definitions.
9187 (Output_merge_base::bool keeps_input_sections_,
9188 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
9189 Output_merge_base::input_sections_): New data members.
9190 (Output_merge_data::do_set_keeps_input_sections): New method
9191 defintion.
9192 (Output_merge_string::do_set_keeps_input_sections): Ditto.
9193 * output.cc (Output_section::Input_section::relobj): Move method
9194 defintion from class declaration to here and handle merge sections.
9195 (Output_section::Input_section::shndx): Ditto.
9196 (Output_section::Output_section): Remove initializations of removed
9197 data members and initialize new data member LOOKUP_MAPS_.
9198 (Output_section::add_input_section): Set keeps-input-sections flag
9199 for a newly created merge output section as appropriate. Adjust code
9200 to use Output_section_lookup_maps class.
9201 (Output_section::add_relaxed_input_section): Adjst code for lookup
9202 maps code refactoring.
2e702c99 9203 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
9204 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
9205 class. If adding input section to a newly created merge output
9206 section fails, remove the new merge section.
9207 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 9208 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 9209 (Output_section::find_merge_section): Ditto.
0439c796 9210 (Output_section::build_lookup_maps): New method defintion.
2e702c99 9211 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
9212 Output_section_lookup_maps class.
9213 (Output_section::get_input_sections): Export merge sections. Adjust
9214 code to use Output_section_lookup_maps class.
9215 (Output_section:::add_script_input_section): Adjust code to use
9216 Output_section_lookup_maps class. Update lookup maps for merge
9217 sections also.
9218 (Output_section::discard_states): Use Output_section_lookup_maps.
9219 (Output_section::restore_states): Same.
9220 * output.h (Merge_section_properties): Move class defintion out of
9221 Output_section.
9222 (Output_section_lookup_maps): New class.
9223 (Output_section::Input_section::is_merge_section): New method
9224 defintion.
9225 (Output_section::Input_section::relobj): Move defintion out of class
9226 defintion. Declare method only.
9227 (Output_section::Input_section::shndx): Ditto.
9228 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 9229 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
9230 (Output_section::Merge_section_by_properties_map,
9231 Output_section::Output_section_data_by_input_section_map,
9232 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
9233 Remove types.
2e702c99 9234 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
9235 KEEPS_INPUT_SECTIONS.
9236 (Output_section::build_lookup_maps): New method declaration.
9237 (Output_section::merge_section_map_,
9238 Output_section::merge_section_by_properties_map_,
9239 Output_section::relaxed_input_section_map_,
9240 Output_section::is_relaxed_input_section_map_valid_): Remove data
9241 members.
9242 (Output_section::lookup_maps_): New data member.
9243
76295588
L
92442010-05-21 Doug Kwan <dougkwan@google.com>
9245
9246 PR gold/11619
9247 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
9248 avoid a compilation error.
9249
d103a984
RÁE
92502010-05-19 Rafael Espindola <espindola@google.com>
9251
9252 * script-sections.cc (Output_section_definition::allocate_to_segment):
9253 Update the phdrs_list even when the output section is NULL.
9254 * testsuite/Makefile.am: Add test.
9255 * testsuite/Makefile.in: Regenerate.
9256 * testsuite/script_test_9.cc: New.
9257 * testsuite/script_test_9.sh: New.
9258 * testsuite/script_test_9.t: New.
9259
6625d24e
DK
92602010-05-19 Doug Kwan <dougkwan@google.com>
9261
9262 * arm.cc (Arm_input_section::original_size): New method.
9263 (Arm_input_section::do_addralign): Add a cast.
9264 (Arm_input_section::do_output_offset): Remove static cast.
9265 (Arm_input_section::original_addralign,
9266 Arm_input_section::original_size_): Change type to uint32_t.
9267 (Arm_input_section::init): Add safe casts for section alignment
9268 and size.
9269 (Arm_input_section::set_final_data_size): Do not set address and
9270 offset of stub table.
9271 (Arm_output_section::fix_exidx_coverage): Change use of of
9272 Output_section::Simple_input_section to that of
9273 Output_section::Input_section.
9274 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
9275 except for the first pass.
9276 * output.cc (Output_section::get_input_sections): Change type of
9277 input_sections to std::list<Input_section>.
9278 (Output_section::add_script_input_section): Rename from
9279 Output_section::add_simple_input_section. Change type of SIS
9280 parameter from Simple_input_section to Input_section.
9281 * output.h (Output_section::Simple_input_section): Remove class.
9282 (Output_section::Input_section): Change class visibility to public.
9283 (Output_section::Input_section::addralign): Use stored alignments
9284 for special input sections if set.
9285 (Output_section::Input_section::set_addralign): New method.
9286 (Output_section::get_input_sections): Change parameter type from
9287 list of Simple_input_section to list of Input_section.
9288 (Output_section::add_script_input_section): Rename from
9289 Output_section::add_simple_input_section. Change first parameter's
9290 type from Simple_input_section to Input_section and remove the
9291 second and third parameters.
9292 * script-sections.cc (Input_section::Input_section_list): Change
9293 type to list of Output_section::Input_section/
9294 (Input_section_info::Input_section_info): Change parameter type of
9295 INPUT_SECTION to Output_section::Input_section.
9296 (Input_section_info::input_section): Change return type.
9297 (Input_section_info::input_section_): Change type to
9298 Output_section::Input_section.
9299 (Output_section_element_input::set_section_addresses): Adjust code
9300 to use Output_section::Input_section instead of
9301 Output_section::Simple_input_section. Adjust code for renaming
9302 of Output_section::add_simple_input_section.
9303 (Orphan_output_section::set_section_addresses): Ditto.
9304
e1e82ea4
RW
93052010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9306
9307 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
9308 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
9309
91e75c8a
RÁE
93102010-05-18 Rafael Espindola <espindola@google.com>
9311
9312 * options.cc (General_options::finalize): Handle -nostdlib.
9313 * options.h (nostdlib): New option.
9314 * script.cc (script_add_search_dir): Handle -nostdlib.
9315
da59ad79
DK
93162010-05-12 Doug Kwan <dougkwan@google.com>
9317
9318 * arm.cc (Target_arm::do_finalize_sections): Create an empty
9319 attributes section only if there no attributes section after merging.
9320 (Target_arm::merge_object_attributes): Move value of
e1df38aa 9321 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
9322 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
9323 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
9324 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
9325 and arm_attr_merge_7.stdout.
9326 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
9327 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
9328 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
9329 arm_attr_merge_7b.o): New rules.
9330 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
9331 arm_attr_merge_7
9332 * testsuite/Makefile.in: Regenerate.
9333 * testsuite/arm_attr_merge.sh: New file.
9334 * testsuite/arm_attr_merge_[67][ab].s: Same.
9335
3e01a7fd
NC
93362010-05-05 Nick Clifton <nickc@redhat.com>
9337
9338 * po/es.po: Updated Spanish translation.
9339
7ad2014a
L
93402010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9341
9342 * Makefile.am (install-exec-local): Properly install gold as
9343 default cross linker.
9344 * Makefile.in: Regenerated.
9345
4fda8867
NC
93462010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9347 Nick Clifton <nickc@redhat.com>
9348
9349 * configure.ac (install_as_default): Define and set to false
9350 unless --enable-gold or --enable-gold=both/gold has been
9351 specified.
9352 * configure: Regenerate.
9353
9354 * Makefile.am (install-exec-local): Install the executable as
9355 'ld.gold'. If install_as_default is true then also install it as
9356 'ld'.
9357 * Makefile.in: Regenerated.
9358
bd288ea2
ILT
93592010-04-24 Ian Lance Taylor <iant@google.com>
9360
9361 * layout.cc (Layout::layout_reloc): In relocatable link don't
9362 combine reloc sections for grouped sections.
9363
ef38fd8a
ST
93642010-04-23 Sriraman Tallam <tmsriram@google.com>
9365
9366 * gc.h (gc_process_relocs): Pass information on relocs pointing to
9367 sections that are not ordinary to icf.
9368 * icf.cc (get_section_contents): Handle relocation pointing to section
9369 with no object or shndx information.
9370 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
9371 * testsuite/Makefile.in: Regenerate.
9372 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
9373 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
9374
f6973bdc
ILT
93752010-04-22 Ian Lance Taylor <iant@google.com>
9376
9377 * expression.cc (Expression::Expression_eval_info): Add
9378 result_alignment_pointer field.
9379 (Expression::eval_with_dot): Add result_alignment_pointer
9380 parameter. Change all callers.
9381 (Expression::eval_maybe_dot): Likewise.
9382 (class Binary_expression): Add alignment_pointer parameter to
9383 left_value and right_value. Change all callers.
9384 (BINARY_EXPRESSION): Set result alignment.
9385 (class Trinary_expression): Add alignment_pointer parameter to
9386 arg2_value and arg3_value. Change all callers.
9387 (Trinary_cond::value): Set result alignment.
9388 (Max_expression::value, Min_expression::value): Likewise.
9389 (Align_expression::value): Likewise.
9390 * script-sections.cc (class Sections_element): Add dot_alignment
9391 parameter to set_section_addresses virtual function. Update
9392 instantiations.
9393 (class Output_section_element): Likewise.
9394 (Script_sections::create_segments): Add dot_alignment parameter.
9395 Change all callers.
9396 (Script_sections::create_segments_from_phdrs_clause): Likewise.
9397 (Script_sections::set_phdrs_clause_addresses): Likewise.
9398 * script-sections.h: Update declarations.
9399 * script.h: Update declarations.
9400 * output.h (Output_segment::set_minimum_p_align): Don't decrease
9401 min_p_align.
9402 * testsuite/script_test_3.t: Set large alignment.
9403 * testsuite/script_test_3.sh: Make sure that at least one LOAD
9404 segment has expected alignment.
9405
9c9c98a5
NC
94062010-04-22 Nick Clifton <nickc@redhat.com>
9407
9408 * po/gold.pot: Updated by the Translation project.
9409 * po/vi.po: Updated Vietnamese translation.
9410
2253bfba
L
94112010-04-22 H.J. Lu <hongjiu.lu@intel.com>
9412
9413 * testsuite/Makefile.am (check_PROGRAMS): Add
9414 icf_virtual_function_folding_test.
9415 * testsuite/Makefile.in: Regenerated.
9416
85fdf906
AH
94172010-04-15 Andrew Haley <aph@redhat.com>
9418
9419 * options.h (merge_exidx_entries): New option.
9420 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
9421 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
9422 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
9423 (Target_arm::merge_exidx_entries): New function.
9424 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
9425 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
9426 to Arm_exidx_fixup constructor.
9427 Add new arg, merge_exidx_entries.
9428 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
9429 Arm_output_section::fix_exidx_coverage.
9430
ce97fa81
ST
94312010-04-18 Sriraman Tallam <tmsriram@google.com>
9432
9433 * icf.cc (get_section_contents): Check for preemptible functions.
9434 Ignore addend when appropriate.
9435 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
9436 section folded.
9437 (add_from_relobj): Check for section folded.
9438 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
9439 * symtab.h (should_add_dynsym_entry): Add new parameter.
9440 * target-reloc.h (scan_relocs): Check for section folded.
9441 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
9442 Check reloc types for function pointers in shared objects.
9443 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
9444 case.
9445 (icf_preemptible_functions_test): New test case.
9446 (icf_string_merge_test): New test case.
9447 * testsuite.Makefile.in: Regenerate.
9448 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
9449 bar_glob. Refactor code.
9450 * testsuite/icf_preemptible_functions_test.cc: New file.
9451 * testsuite/icf_preemptible_functions_test.sh: New file.
9452 * testsuite/icf_string_merge_test.cc: New file.
9453 * testsuite/icf_string_merge_test.sh: New file.
9454 * testsuite/icf_virtual_function_folding_test.cc: New file.
9455 * testsuite/icf_virtual_function_folding_test.sh: New file.
9456
04ceb17c
DK
94572010-04-14 Doug Kwan <dougkwan@google.com>
9458
9459 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
9460 for local symbol recounting if we remove a section due to ICF.
9461 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
9462 there are no regular objects in input.
9463
153e7da4
DK
94642010-04-13 Doug Kwan <dougkwan@google.com>
9465
9466 * arm.cc (Arm_input_section::set_final_data_size): Compute
9467 accurate final data size instead of using current data size.
9468
4dbd9faf
DK
94692010-04-09 Doug Kwan <dougkwan@google.com>
9470
9471 * layout.cc (Layout::choose_output_section): Handle script section
9472 types.
9473 (Layout::make_output_section_for_script): Add section type parameter.
9474 Handle script section types.
9475 * layout.h (Layout::make_output_section_for_script): Add section
9476 type parameter.
9477 * output.cc (Output_section::Output_section): Initialize data member
9478 is_noload_.
9479 (Output_section::do_reset_address_and_file_offset): Do not set address
9480 to 0 if section is a NOLOAD section.
9481 * output.h (Output_section::is_noload): New method.
9482 (Output_section::set_is_noload): Ditto.
9483 (Output_section::is_noload_): New data member.
9484 * script-c.h (Script_section_type): New enum type.
9485 (struct Parser_output_section_header): Add new file section_type.
9486 * script-sections.cc (Sections_element::output_section_name): Add
9487 parameter for returning script section type.
9488 (Output_section_definition::output_section_name): Ditto.
9489 (Output_section_definition::section_type)P; New method.
9490 (Output_section_definiton::script_section_type_name): Ditto.
9491 (Output_section_definition::script_section_type_): New data member.
9492 (Output_section_definition::Output_section_definition): Initialize
9493 data member Output_section_definition::script_section_type_.
9494 (Output_section_definition::create_sections): Pass script section type
9495 to Layout::make_output_section_for_script.
9496 (Output_section_definition::output_section_name): Return script
9497 section type to caller.
9498 (Output_section_definition::set_section_address): Do not advance
9499 dot value and load address if section type is NOLOAD. Set address
9500 of NOLOAD sections regardless of section flags.
9501 (Output_section_definition::print): Print section type if it is
9502 not SCRIPT_SECTION_TYPE_NONE.
9503 (Output_section_definition::section_type): New method.
9504 (Output_section_definition::script_section_type_name): Ditto.
9505 (Script_sections::output_section_name): Add new parameter
9506 PSECTION_TYPE for returning script section type. Pass it to
9507 section elements. Handle discard sections.
9508 (Sort_output_sections::operator()): Handle NOLOAD sections.
9509 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 9510 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
9511 returning script section type.
9512 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
9513 INFO and NOLOAD.
9514 * yyscript.y (union): Add new field SECTION_TYPE.
9515 (COPY, DSECT, INFO, NOLOAD): New tokens.
9516 (opt_address_and_section_type): Change type to output_section_header.
9517 (section_type): New non-terminal
9518 (section_header): Handle section type.
2253bfba 9519 (opt_address_and_section_type): Return section type value.
4dbd9faf 9520
721ea635
L
95212010-04-09 H.J. Lu <hongjiu.lu@intel.com>
9522
9523 * testsuite/plugin_common_test_1.c (foo): Add prototype.
9524 * testsuite/plugin_common_test_2.c (foo): Likewise.
9525
6bf924b0
DK
95262010-04-08 Doug Kwan <dougkwan@google.com>
9527
9528 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
9529 Output_merge_data.
9530 * output.cc (Output_section::add_merge_input_section): Simplify
9531 code and return status of Output_merge_base::add_input_section.
e1df38aa 9532 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
9533 returns true.
9534
24af6f92
DK
95352010-04-07 Doug Kwan <dougkwan@google.com>
9536
9537 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
9538 if section is marked as containing instructions but has no mapping
9539 symbols.
9540 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
9541 correct section index.
9542 (Arm_relobj::find_linked_text_section): Ditto.
9543
00698fc5
CC
95442010-04-07 Cary Coutant <ccoutant@google.com>
9545
9546 * archive.cc (include_member): Destroy Read_symbols_data object before
9547 releasing file.
9548 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
9549 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
9550 (Read_symbols_data::~Read_symbols_data) New destructor.
9551 (Section_relocs::Section_relocs) New constructor.
9552 (Section_relocs::~Section_relocs) New destructor.
9553 (Read_relocs_data::Read_relocs_data) New constructor.
9554 (Read_relocs_data::~Read_relocs_data) New destructor.
9555 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
9556 pointers to NULL after deleting.
9557
7296d933
DK
95582010-04-07 Doug Kwan <dougkwan@google.com>
9559
9560 * arm.cc: Replace "endianity" with "endianness" in comments.
9561 (Arm_exidx_cantunwind): Ditto.
9562 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
9563 (Arm_relobj::merge_flags_and_attributes): New method.
9564 (Arm_relobj::merge_flags_and_attributes_): New data member.
9565 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
9566 (Arm_relobj::scan_sections_for_stubs): Ditto.
9567 (Arm_relobj::do_read_symbols): Check to see if we really want to
9568 merge processor-specific flags and attributes. Exit early if
9569 an object is empty except for section names and the undefined symbol.
9570 (Target_arm::do_finalize_sections): Move check for ELF format to
9571 Arm_relobj::do_read_symbols. Merge processor specific flags and
9572 attributes from a regular object only when we have determined that
9573 it is aapropriate. Do not create an .ARM.attributes section in
9574 output if there is no regular input object.
9575 (Target_arm::merge_processor_specific_flags): Check
9576 --warn-mismatch before printing any error.
9577 (Target_arm::merge_object_attributes): Ditto.
9578 * gold.cc (queue_middle_tasks): Handle the case in which there is
9579 no regular object in input.
9580 * options.cc (General_options::parse_EB): New method.
9581 (General_options::parse_EL): Same.
9582 (General_options::General_options): Initialize endianness_.
9583 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
9584 New options.
9585 (General_options::Endianness): New enum.
9586 (General_options::endianness): New method.
9587 (General_options::endianness_): New data member.
9588 * parameters.cc (Parameters::set_options): Check target endianness.
9589 (Parameters::set_target_once): Ditto.
9590 (Parameters::check_target_endianness): New method.
9591 (parameters_force_valid_target): If either -EL or -EB is specified,
9592 use it to define endianness of default target.
9593 * parameters.h (Parameters::check_target_endianness): New method
9594 declaration.
9595 * target.h (class Target): Change "endianity" to "endianness"
9596 in comments.
9597
efc8d4f2
RW
95982010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9599
9600 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
9601 * configure: Regenerate.
9602 * Makefile.in: Regenerate.
9603 * testsuite/Makefile.in: Regenerate.
9604
be234d88
CC
96052010-04-06 Cary Coutant <ccoutant@google.com>
9606
9607 gcc PR lto/42757
9608 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
9609 prevailing definitions of common symbols.
9610 * testsuite/plugin_test_6.sh: New test case.
9611 * testsuite/plugin_common_test_1.c: New test case.
9612 * testsuite/plugin_common_test_2.c: New test case.
9613 * testsuite/Makefile.am (plugin_test_6): New test case.
9614 * testsuite/Makefile.in: Regenerate.
9615
bd32c6bd
NC
96162010-04-06 Nick Clifton <nickc@redhat.com>
9617
9618 * po/vi.po: New Vietnamese translation.
9619
323c532f
DK
96202010-03-30 Doug Kwan <dougkwan@google.com>
9621
9622 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
9623
4fcd97eb
DK
96242010-03-25 Doug Kwan <dougkwan@google.com>
9625
9626 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
9627 to avoid a conversion warning on a 32-bit host.
9628
4ebf39db
ILT
96292010-03-24 Ian Lance Taylor <iant@google.com>
9630
9631 * testsuite/script_test_3.t: Add a TLS segment.
9632 * testsuite/Makefile.am (check_PROGRAMS): Add
9633 tls_phdrs_script_test.
9634 (tls_phdrs_script_test_SOURCES): Define.
9635 (tls_phdrs_script_test_DEPENDENCIES): Define.
9636 (tls_phdrs_script_test_LDFLAGS): Define.
9637 (tls_phdrs_script_test_LDADD): Define.
9638 * testsuite/Makefile.in: Rebuild.
9639
4a599bdd
CC
96402010-03-23 Cary Coutant <ccoutant@google.com>
9641
9642 * fileread.cc (find_or_make_view): Fix comment.
9643
6c93b22c
ILT
96442010-03-23 Ian Lance Taylor <iant@google.com>
9645
9646 * script-sections.cc (class Orphan_section_placement): Define
9647 PLACE_TLS and PLACE_TLS_BSS.
9648 (Orphan_section_placement::Orphan_section_placement): Initialize
9649 new places.
9650 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
9651 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
9652 (tls_script_test_SOURCES): Define.
9653 (tls_script_test_DEPENDENCIES): Define.
9654 (tls_script_test_LDFLAGS): Define.
9655 (tls_script_test_LDADD): Define.
9656 * testsuite/Makefile.in: Rebuild.
9657
a2c7281b
DK
96582010-03-22 Doug Kwan <dougkwan@google.com>
9659
9660 * arm.cc (Arm_relocate_functions::abs8,
9661 Arm_relocate_functions::abs16): Use correct check for overflow
9662 specified in the ARM ELF specs.
9663 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
9664 target of a BLX instruction specially.
9665 (Reloc_stub::stub_type_for_reloc): Ditto.
9666 (Relocate::relocate): Use symbolic names instead of numeric relocation
9667 codes to report error.
9668 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
9669 workaround.
9670 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
9671 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
9672 thumb2_blx_out_of_range.stdout
9673 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
9674 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
9675 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
9676 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
9677 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
9678 thumb2_blx_in_range, thumb2_blx_in_range.o,
9679 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
9680 thumb2_blx_out_of_range.o): New rules.
2e702c99 9681 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
9682 thumb2_blx_in_range and thumb2_blx_out_of_range.
9683 * testsuite/Makefile.in: Regenerate.
9684 * arm_branch_in_range.sh: Add tests for THUMB BLX.
9685 * testsuite/thumb_blx_in_range.s: New file.
9686 * testsuite/thumb_blx_out_of_range.s: New file.
9687
b0193076
RÁE
96882010-03-22 Rafael Espindola <espindola@google.com>
9689
9690 * archive.cc (Should_include): Move to archive.h.
9691 (should_include_member): Make it a member of Archive.
9692 (Lib_group): New.
9693 (Add_lib_group_symbols): New.
9694 * archive.h: Include options.h.
9695 (Archive_member): Moved from Archive.
9696 (Should_include): Moved from archive.cc.
9697 (Lib_group): New.
9698 (Add_lib_group_symbols): New.
9699 * dynobj.cc (do_should_include_member): New.
9700 * dynobj.h (do_should_include_member): New.
9701 * gold.cc (queue_initial_tasks): Update call to queue.
9702 * main.cc (main): Print lib group stats.
9703 * object.cc (do_should_include_member): New.
9704 * object.h: Include archive.h.
9705 (Object::should_include_member): New.
9706 (Object::do_should_include_member): New.
9707 (Sized_relobj::do_should_include_member): New.
9708 * options.cc (General_options::parse_start_lib): New.
9709 (General_options::parse_end_lib): New.
9710 (Input_arguments::add_file): Handle lib groups.
9711 (Input_arguments::start_group): Check we are not in a lib.
9712 (Input_arguments::start_lib): New.
9713 (Input_arguments::end_lib): New.
9714 * options.h (General_options): Add start_lib and end_lib.
9715 (Input_argument::lib_): New.
9716 (Input_argument::lib): New.
9717 (Input_argument::is_lib): New.
9718 (Input_file_lib): New.
9719 (Input_arguments::in_lib_): New.
9720 (Input_arguments::in_lib): New.
9721 (Input_arguments::start_lib): New.
9722 (Input_arguments::end_lib_): New.
9723 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
9724 in unused members as preempted.
9725 (Sized_pluginobj::do_should_include_member): New.
9726 * plugin.h (Sized_pluginobj::do_should_include_member): New.
9727 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
9728 return the blocker.
9729 (Read_symbols::do_whole_lib_group): New.
9730 (Read_symbols::do_lib_group): New.
9731 (Read_symbols::do_read_symbols): Handle lib groups.
9732 (Read_symbols::get_name): Handle lib groups.
9733 * readsyms.h (Read_symbols): Add an archive member pointer.
9734 (Read_symbols::do_whole_lib_group): New.
9735 (Read_symbols::do_lib_group): New.
9736 (Read_symbols::member_): New.
9737 * script.cc (read_input_script): Update call to queue_soon.
9738
d099120c
DK
97392010-03-19 Doug Kwan <dougkwan@google.com>
9740
9741 * arm.cc (Stub_table::Stub_table): Initialize new data members
9742 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9743 (Stub_table::add_reloc_stub): Assign stub offset and update
9744 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9745 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
9746 New data members.
2e702c99 9747 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
9748 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
9749 instead of going over all reloc stubs.
2e702c99 9750 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
9751 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9752 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 9753 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
9754 Stringpool_template::offset_.
9755 * stringpool.h (Stringpool_template::set_no_zero_null): Set
9756 Stringpool_template::offset_ to zero.
9757
1aa37384
DK
97582010-03-15 Doug Kwan <dougkwan@google.com>
9759
9760 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9761 offset_.
9762 (Stringpool_template::new_key_offset): New method.
9763 (Stringpool_template::add_string): Assign offsets when adding new
9764 strings.
9765 (Stringpool_template::set_string_offsets): Do not set string offsets
9766 when not optimizing.
9767 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
9768 member size_.
2e702c99
RM
9769 (Chunked_vector::clear): Clear size_.
9770 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
9771 (Chunked_vector::size): Return size_.
9772 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 9773 (Chunked_vector::size_): New data member.
1aa37384
DK
9774 (Stringpool_template::set_no_zero_null): Assert string set is empty.
9775 (Stringpool_template::new_key_offset): New method declaration.
9776 (Stringpool_template::offset_): New data member.
9777
b672b057
RÁE
97782010-03-15 Rafael Espindola <espindola@google.com>
9779
9780 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
9781 Add_symbols' constructor.
9782 * readsyms.h (Add_symbols): Remove the input_group member.
9783
b6848d3c
ILT
97842010-03-10 Ian Lance Taylor <iant@google.com>
9785
9786 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
9787 target to ask whether a reference to a symbol requires a stack
9788 split.
9789 * target.h (Target::is_call_to_non_split): New function.
9790 (Target::do_is_call_to_non_split): Declare virtual function.
9791 * target.cc: Include "symtab.h".
9792 (Target::do_is_call_to_non_split): New function.
9793 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
9794
a2a5469e
CC
97952010-03-10 Cary Coutant <ccoutant@google.com>
9796
9797 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
9798 (File_read::open[1]): Remove initial mapping of whole_file_view_.
9799 (File_read::open[2]): Add whole_file_view_ to list of views.
9800 (File_read::make_view): Remove test of whole_file_view_.
9801 (File_read::find_or_make_view): Create whole_file_view_ if
9802 necessary.
9803 (File_read::clear_views): Replace bool parameter with enum;
9804 adjust all callers. Don't delete views with permanent data;
9805 do delete cached views and views from archives if
9806 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
9807 if clearing the corresponding view.
9808 * fileread.h (File_read::Clear_views_mode): New enum.
9809 (File_read::View::is_permanent_view): New method.
9810 (File_read::clear_views): Replace bool parameter
9811 with enum; adjust all callers.
9812 * options.h (General_options): Change keep_files_mapped option;
9813 add map_whole_files.
9814 * readsyms.cc (Add_symbols::run): Delete sd_ object before
9815 releasing the file.
9816 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
9817 the file.
9818
8861f32b
DM
98192010-03-10 David S. Miller <davem@davemloft.net>
9820
9821 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
9822
d62d0f5f
ST
98232010-03-09 Sriraman Tallam <tmsriram@google.com>
9824
9825 * icf.cc (get_section_contents): Add '@' marker after processing the
9826 merge reloc.
9827
9177756d
DK
98282010-03-08 Doug Kwan <dougkwan@google.com>
9829
9830 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
9831 due to a conversion warning.
9832 (Arm_relobj::update_output_local_symbol_count): Check for local
9833 symbol with unset output index.
9834
9e9e071b
ILT
98352010-03-05 Ian Lance Taylor <iant@google.com>
9836
9837 * options.h (class General_options): Add --spare-dynamic-tags.
9838 * output.cc (Output_data_dynamic::set_final_data_size): Implement
9839 --spare-dynamic-tags.
9840
a81ee015
ILT
98412010-03-05 Ian Lance Taylor <iant@google.com>
9842
9843 * incremental.cc: Include "libiberty.h".
9844
44ec90b9
RO
98452010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
9846
9847 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
9848 function, is_info_ member.
9849 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
9850 (Versions::Versions): Update caller.
9851 (Versions::define_base_version): Likewise.
9852 (Versions::add_def): Likewise.
9853
0897ed3b
ST
98542010-03-03 Sriraman Tallam <tmsriram@google.com>
9855
9856 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
9857 (Scan::possible_function_pointer_reloc): New function.
9858 (Scan::local_reloc_may_be_function_pointer): Change to call
9859 possible_function_pointer_reloc.
9860 (Scan::global_reloc_may_be_function_pointer): Ditto.
9861 * icf.h (Icf::check_section_for_function_pointers): Change to reject
9862 relocations in ".data.rel.ro._ZTV" section.
9863 * testsuite/icf_safe_so_test.sh: Change to pass i386.
9864 * testsuite/icf_safe_so_test.cc: Ditto.
9865 * testsuite/icf_safe_test.cc: Ditto.
9866 * testsuite/icf_safe_test.sh: Ditto.
9867
d3bbad62
ILT
98682010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9869 Ian Lance Taylor <iant@google.com>
9870
9871 * target-reloc.h (relocate_section): Check the symbol table index
9872 for -1U before setting the local symbol index.
9873 (scan_relocatable_relocs): If copying the relocation, record that
9874 the local symbol is required.
9875 * object.h (Symbol_value::is_output_symtab_index_set): New
9876 function.
9877 (Symbol_value::may_be_discarded_from_output_symtab): New
9878 function.
9879 (Symbol_value::has_output_symtab_entry): New function.
9880 (Symbol_value::needs_output_symtab_entry): Remove.
9881 (Symbol_value::output_symtab_index): Make sure the symbol index is
9882 set.
9883 (Symbol_value::set_output_symtab_index): Make sure the symbol
9884 index is not set. Make sure the new index is valid.
9885 (Symbol_value::set_must_have_output_symtab_entry): New function.
9886 (Symbol_value::has_output_dynsym_entry): New function.
9887 (Symbol_value::set_output_dynsym_index): Make sure the new index
9888 is valid.
9889 (Sized_relobj::set_must_have_output_symtab_entry): New function.
9890 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
9891 local symbol if permitted.
9892 (Sized_relobj::do_finalize_local_symbols): Call
9893 is_output_symtab_index_set rather than needs_output_symtab_entry.
9894 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
9895 rather than needs_output_symtab_entry. Call
9896 has_output_dynsym_entry rather than needs_output_dynsym_entry.
9897 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
9898 is_output_symtab_index_set rather than needs_output_symtab_entry.
9899 * testsuite/discard_locals_relocatable_test.c: New file.
9900 * testsuite/discard_locals_test.sh: Test -r.
9901 * testsuite/Makefile.am (check_DATA): Add
9902 discard_locals_relocatable_test1.syms,
9903 discard_local_relocatable_test2.syms.
9904 (MOSTLYCLEANFILES): Likewise. Also add
9905 discard_locals_relocatable_test1.lout and
9906 discard_locals_relocatable_test2.out.
9907 (discard_locals_relocatable_test1.syms): New target.
9908 (discard_locals_relocatable_test.o): New target.
9909 (discard_locals_relocatable_test1.out): New target.
9910 (discard_locals_relocatable_test2.syms): New target.
9911 (discard_locals_relocatable_test2.out): New target.
9912 (various): Add missing ../ld-new dependencies.
9913 * testsuite/Makefile.in: Rebuild.
9914
7e8ccf26
NC
99152010-03-03 Nick Clifton <nickc@redhat.com>
9916
9917 * po/fi.po: New Finnish translation.
9918
2a0ff005
DK
99192010-03-01 Doug Kwan <dougkwan@google.com>
9920
9921 * layout.cc (Layout::Layout): Force section types of .init_array*,
9922 .preinit_array* and .fini_array* sections.
9923 * output.cc (Output_section::Input_section_sort_entry::has_priority):
9924 Fix check of return value of std::string::find.().
9925 (Output_section::Input_section_sort_compare::operator()): Remove
9926 comment about .init_array.
9927 (Output_section::Input_section_sort_init_fini_compare::operator()):
9928 New method.
9929 (Output_section::sort_attached_input_sections): Handle .init_array
9930 and .fini_array specially.
9931 * output.h (Output_section::Inut_section_sort_compare): Update
9932 comment.
9933 (Output_section::Input_section_sort_init_fini_compare): New struct.
9934
c3e4ae29
DK
99352010-02-26 Doug Kwan <dougkwan@google.com>
9936
9937 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
9938 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
9939 * testsuite/debug_msg.sh: Avoid matching source line number for
9940 use of global variable undef_int.
9941
2fd9ae7a
DK
99422010-02-26 Doug Kwan <dougkwan@google.com>
9943
9944 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
9945 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
9946 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
9947 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
9948 * options.cc (General_options::General_options): Initialize member
9949 fix_v4bx_.
9950 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
9951 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
9952 and rm_no_fix_v4bx.stdout
9953 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
9954 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
9955 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
9956 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
9957 and arm_no_fix_v4bx.
9958 * Makefile.in: Regenerate.
9959 * testsuite/arm_fix_v4bx.s: New file.
9960 * testsuite/arm_fix_v4bx.sh: Ditto.
9961
67ec7d0b
DK
99622010-02-24 Doug Kwan <dougkwan@google.com>
9963
9964 * arm.cc (Target_arm::got_section): Make the .got section the first
9965 non RELRO section in the data segment.
9966 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
9967 suffixes of section names.
9968
10165461
DK
99692010-02-24 Doug Kwan <dougkwan@google.com>
9970
9971 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
9972 flags and attributes merging if an input file is a binary file.
9973 * fileread.cc (Input_file::open): Record format of original file.
9974 * fileread.h (Input_file::Format): New enum type.
2e702c99 9975 (Input_file::Input_file): Initialize data member format_.
10165461
DK
9976 (Input_file::format): New method definition.
9977 (Input_file::format_):: New data member.
9978
4a54abbb
DK
99792010-02-24 Doug Kwan <dougkwan@google.com>
9980
9981 * arm.cc (Arm_output_data_got): New class.
9982 (ARM_TCB_SIZE): New constant
9983 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
9984 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
9985 If user uses a script with a SECTIONS clause, issue only a warning
9986 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 9987 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
9988 garbage collection.
9989 (Target_arm::got_mode_index_entry): Handle static linking.
9990 (Target_arm::Scan::local): Ditto.
9991 (Target_arm::Scan::global): Ditto.
9992 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
9993 all incorrectly implemented relocations.
e1df38aa 9994 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
9995 Arm_output_section::fix_exidx_coverage.
9996 * layout.cc (Layout::section_name_mapping): Remove trailing dots
9997 from ".ARM.exidx." and ".ARM.extab.".
9998
ca419a6f
ILT
99992010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10000
10001 * arm.cc (Target_arm::do_finalize_sections): Create attribute
10002 section if it does not already exist.
10003 * attributes.cc (Attributes_section_data::Attributes_section_data):
10004 Don't crash if size is zero.
10005
135b9c78
ILT
100062010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10007 Ian Lance Taylor <iant@google.com>
10008
10009 * gold.cc (queue_middle_tasks): If no input files were opened,
10010 exit.
10011 * workqueue.h (Task_function::Task_function): Assert that there is
10012 a blocker.
10013
bb0bfe4f
DK
100142010-02-22 Doug Kwan <dougkwan@google.com>
10015
10016 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
10017 * icf.cc (get_section_contents): Cast snprintf arguments to long long
10018 types to avoid warnings due to different uint64_t implementations
10019 on different hosts.
10020
2a2b6d42
DK
100212010-02-21 Doug Kwan <dougkwan@google.com>
10022
10023 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
10024 handling of the maximum backward branch offset.
2e702c99 10025 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
10026 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
10027 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 10028 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
10029 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
10030 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
10031 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
10032 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
10033 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
10034 thumb_bl_out_of_range thumb_bl_out_of_range.o,
10035 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
10036 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
10037 thumb2_bl_out_of_range.o): New rules.
10038 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
10039 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
10040 thumb2_bl_out_of_range
10041 * testsuite/Makefile.in: Regenerate.
10042 * testsuite/arm_bl_in_range.s: New file.
10043 * testsuite/arm_bl_out_of_range.s: Ditto.
10044 * testsuite/arm_branch_in_range.sh: Ditto.
10045 * testsuite/arm_branch_range.t: Ditto.
10046 * testsuite/thumb2_branch_range.t: Ditto.
10047 * testsuite/thumb_bl_in_range.s: Ditto.
10048 * testsuite/thumb_bl_out_of_range.s: Ditto.
10049 * testsuite/thumb_branch_range.t: Ditto.
10050
b487ad64
ST
100512010-02-20 Sriraman Tallam <tmsriram@google.com>
10052
10053 * gc.h (gc_process_relocs): Change vectors to point to the new list.
10054 Add reloc offset information.
10055 * icf.cc (get_section_contents): Change iterators to point to the new
10056 vectors. Add reloc offset information to the contents.
10057 * icf.h (Icf::Sections_reachable_info): New typedef.
10058 (Icf::Sections_reachable_list): New typedef.
10059 (Icf::Offset_info): New typedef.
10060 (Icf::Reloc_info): New struct typedef.
10061 (Icf::Reloc_info_list): New typedef.
10062 (Icf::symbol_reloc_list): Delete method.
10063 (Icf::addend_reloc_list): Delete method.
10064 (Icf::section_reloc_list): Delete method.
10065 (Icf::reloc_info_list): New method.
10066 (Icf::reloc_info_list_): New member.
10067
f96accdf
DK
100682010-02-19 Doug Kwan <dougkwan@google.com>
10069
10070 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
10071 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
10072 * arm.cc (Arm_relocation_functions): New forward declaration.
10073 (Target_arm::Target_arm): Initialize new data members
10074 got_mod_index_offset_ and tls_base_symbol_defined_.
10075 (Target_arm::Relocate::relocate_tls): New method.
10076 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
10077 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
10078 New methods.
2e702c99 10079 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
10080 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
10081 (Target_arm::got_mod_index_offset_,
10082 Target_arm::tls_base_symbol_defined_): New data members.
10083 (Target_arm::Scan::local, Target::Scan::global,
10084 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
10085 relocations.
10086
c8761b9a
DK
100872010-02-18 Doug Kwan <dougkwan@google.com>
10088
10089 * arm.cc (Arm_relobj::find_linked_text_section): New method.
10090 (Arm_relobj::make_exidx_input_section): Pass section index of linked
10091 text section as a parameter becuase some broken tools may not set
10092 the link in section header.
10093 (Target_arm::has_got_section): New method.
10094 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
10095 without any mapping symbol as data only. Remove warning.
10096 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
10097 link in its section header, try to discover the link by inspecting the
10098 REL31 relocation at the beginning of the section.
10099 (Target_arm::Scan::check_non_pic): Report name of offending relocation
10100 in error message.
10101 (Target_arm::Scan::global): Treat any reference to the symbol
10102 _GLOBAL_OFFSET_TABLE_ as a GOT access.
10103
21bb3914
ST
101042010-02-12 Sriraman Tallam <tmsriram@google.com>
10105
10106 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
10107 (Scan::global_reloc_may_be_function_pointer): New function.
10108 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10109 (Scan::global_reloc_may_be_function_pointer): New function.
10110 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10111 (Scan::global_reloc_may_be_function_pointer): New function.
10112 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
10113 (Scan::global_reloc_may_be_function_pointer): New function.
10114 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
10115 (Scan::global_reloc_may_be_function_pointer): New function.
10116 (Scan::possible_function_pointer_reloc): New function.
10117 (Target_x86_64::can_check_for_function_pointers): New function.
10118 * gc.h (gc_process_relocs): Scan relocation types to determine if
10119 function pointers were taken for targets that support it.
10120 * icf.cc (Icf::find_identical_sections): Include functions for
10121 folding in safe ICF whose pointer is not taken.
10122 * icf.h (Secn_fptr_taken_set): New typedef.
10123 (fptr_section_id_): New member.
10124 (section_has_function_pointers): New function.
10125 (set_section_has_function_pointers): New function.
10126 (check_section_for_function_pointers): New function.
10127 * options.h: Fix comment for safe ICF option.
10128 * target.h (can_check_for_function_pointers): New function.
10129 * testsuite/Makefile.am: Add icf_safe_so_test test case.
10130 Modify icf_safe_test for X86-64.
10131 * testsuite/Makefile.in: Regenerate.
10132 * testsuite/icf_safe_so_test.cc: New file.
10133 * testsuite/icf_safe_so_test.sh: New file.
10134 * testsuite/icf_safe_test.cc (kept_func_3): New function.
10135 (main): Change to take pointer to function kept_func_3.
10136 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
10137 folding is done correctly for X86-64.
10138
0da6fa6c
DM
101392010-02-12 David S. Miller <davem@davemloft.net>
10140
10141 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
10142 is_symbolless parameter.
10143 (Output_reloc<SHT_REL>::is_symbolless): New.
10144 (Output_reloc<SHT_REL>::is_symbolless_): New.
10145 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
10146 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
10147 (Output_reloc<SHT_RELA>::is_symbolless): New.
10148 (Output_data_reloc::add_global): Handle is_symbolless.
10149 (Output_data_reloc::add_global_relative): Likewise.
10150 (Output_data_reloc::add_local): Likewise.
10151 (Output_data_reloc::add_local_relative): Likewise.
10152 (Output_data_reloc::add_symbolless_global_addend): New.
10153 (Output_data_reloc::add_symbolless_local_addend): New.
10154 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
10155 is_symbolless.
10156 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
10157 instead of ->is_relative_
10158 (Output_reloc::write): Likewise.
10159 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
10160 (Output_reloc::write_rel): Simplify.
10161
10162 * sparc.cc (Target_sparc::Scan::local): Use
10163 ->add_symbolless_local_addend as needed.
10164 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
10165 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
10166 based upon relocation offset.
10167
e4782e83
DK
101682010-02-11 Doug Kwan <dougkwan@google.com>
10169
10170 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
10171 (Target_arm::Scan::global): Ditto. Also remove a comment before the
10172 beginning of function.
10173 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
10174 and MOVT_ABS relocations. Those are non issued in scanning. Fix
10175 parameter is_32bit in calls to should_apply_static_reloc.
10176 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
10177 (check_DATA): Add arm_abs_global.stdout.
10178 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
10179 arm_abs_global.stdout): New rules.
10180 (MOSTLLYCLEANFILES): Add arm_abs_global
10181 * Makefile.in: Regenerate.
10182 * testsuite/arm_abs_global.s: New file.
10183 * testsuite/arm_abs_global.sh: Ditto.
10184 * testsuite/arm_abs_lib.s: Ditto.
10185
93ceb764
ILT
101862010-02-11 Ian Lance Taylor <iant@google.com>
10187
10188 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
10189 Read_relocs task.
10190 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
10191 Allocate_commons_task first.
10192 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
10193 task, rather than symtab_lock_.
10194 (Gc_process_relocs::~Gc_process_relocs): New function.
10195 (Gc_process_relocs::is_runnable): Check this_blocker_.
10196 (Gc_process_relocs::locks): Use next_blocker_ rather than
10197 blocker_.
10198 (Scan_relocs::~Scan_relocs): New function.
10199 (Scan_relocs::is_runnable): Check this_blocker_ rather than
10200 symtab_lock_.
10201 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
10202 next_blocker_.
10203 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
10204 fields. Add this_blocker_ and next_blocker_ fields. Adjust
10205 constructor accordingly.
10206 (class Gc_process_relocs): Likewise.
10207 (class Scan_relocs): Likewise.
10208 * common.h (class Allocate_commons_task): Remove symtab_lock_
10209 field, and corresponding constructor parameter.
10210 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
10211 symtab_lock_.
10212 (Allocate_commons_task::locks): Likewise.
10213
114dfbe1
ILT
102142010-02-11 Ian Lance Taylor <iant@google.com>
10215
10216 * gold-threads.h (class Once): Define.
10217 (class Initialize_lock): Rewrite as child of Once.
10218 * gold-threads.cc (class Once_initialize): Define.
10219 (once_pointer_control): New static variable.
10220 (once_pointer, once_arg): New static variables.
10221 (c_run_once): New static function.
10222 (Once::Once, Once::run_once, Once::internal_run): New functions.
10223 (class Initialize_lock_once): Remove.
10224 (initialize_lock_control): Remove.
10225 (initialize_lock_pointer): Remove.
10226 (initialize_lock_once): Remove.
10227 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
10228 (Initialize_lock::initialize): Rewrite.
10229 (Initialize_lock::do_run_once): New function.
10230 * archive.cc (Archive::interpret_header): Only clear name if it is
10231 not already empty.
10232 * fileread.cc: Include "gold-threads.h"
10233 (file_counts_lock): New static variable.
10234 (file_counts_initialize_lock): Likewise.
10235 (File_read::release): Only increment counts when using --stats.
10236 Use a lock around the increment.
10237 * parameters.cc (class Set_parameters_target_once): Define.
10238 (set_parameters_target_once): New static variable.
10239 (Parameters::Parameters): Move here from parameters.h.
10240 (Parameters::set_target): Rewrite.
10241 (Parameters::set_target_once): New function.
10242 (Parameters::clear_target): Move here and rewrite.
10243 * parameters.h (class Parameters): Update declarations. Add
10244 set_parameters_target_once_ field.
10245 (Parameters::Parameters): Move to parameters.cc.
10246 (Parameters::clear_target): Likewise.
10247 * readsyms.cc (Read_symbols::do_group): Create a Start_group
10248 task.
10249 (Start_group::~Start_group): New function.
10250 (Start_group::is_runnable): New function.
10251 (Start_group::locks, Start_group::run): New functions.
10252 (Finish_group::run): Change saw_undefined to size_t.
10253 * readsyms.h (class Start_group): Define.
10254 (class Finish_group): Change saw_undefined_ field to size_t.
10255 (Finish_group::Finish_group): Remove saw_undefined and
10256 this_blocker parameters. Change all callers.
10257 (Finish_group::set_saw_undefined): New function.
10258 (Finish_group::set_blocker): New function.
10259 * symtab.h (class Symbol_table): Change saw_undefined to return
10260 size_t. Change saw_undefined_ field to size_t.
10261 * target-select.cc (Set_target_once::do_run_once): New function.
10262 (Target_selector::Target_selector): Initialize set_target_once_
10263 field. Don't initialize lock_ and initialize_lock_ fields.
10264 (Target_selector::instantiate_target): Rewrite.
10265 (Target_selector::set_target): New function.
10266 * target-select.h (class Set_target_once): Define.
10267 (class Target_selector): Update declarations. Make
10268 Set_target_once a friend. Remove lock_ and initialize_lock_
10269 fields. Add set_target_once_ field.
10270
fa17a3f4
ILT
102712010-02-10 Ian Lance Taylor <iant@google.com>
10272
10273 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
10274 queueing any tasks.
10275 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
10276 (queue_middle_tasks): Add all blockers before queueing any tasks.
10277 (queue_final_tasks): Likewise.
10278 * token.h (Task_token::add_blockers): New function.
10279 * object.h (Input_objects::number_of_relobjs): New function.
10280
c7177d31
ILT
102812010-02-10 Ian Lance Taylor <iant@google.com>
10282
5de0e392
ILT
10283 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
10284 shared, not if not position independent.
10285 * x86_64.cc (Relocate::relocate_tls): Likewise.
10286 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
10287 (tls_pie_pic_test): New target.
10288 * testsuite/Makefile.in: Rebuild.
10289
c7177d31
ILT
10290 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
10291 (tls_test_main_pie.o, tls_test_pie.o): New targets.
10292 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
10293 * testsuite/Makefile.in: Rebuild.
10294
684b268a
DM
102952010-02-09 David S. Miller <davem@davemloft.net>
10296
10297 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
10298 R_SPARC_RELATIVE using ->add_local_relative().
10299 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
10300
612a8d3d
DM
10301 * output.h (Output_data_dynamic::add_section_size): New method
10302 that takes two Output_data objects.
10303 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
10304 entry param. Handle it in initializers.
10305 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
10306 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
10307 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
10308 arg.
10309 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
10310 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
10311 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
10312 for dynrel_includes_plt.
10313 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10314 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10315 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
10316 before .rela.plt
10317 (Target_sparc::do_finalize_sections): Update to pass true for
10318 dynrel_includes_plt.
10319 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
10320 output before .rela.plt
10321 (Target_powerpc::do_finalize_sections): Update to pass true for
10322 dynrel_includes_plt when 32-bit.
10323
cb1be87e
DK
103242010-02-08 Doug Kwan <dougkwan@google.com>
10325
10326 * arm.cc (Arm_relobj::simple_input_section_output_address): New
10327 method.
10328 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
10329 Arm_relobj::scan_section_for_cortex_a8_stubs,
10330 Arm_relobj::do_relocation_section): Instead of calling
10331 Output_section::output_address, use faster
10332 Arm_relobj::simple_input_section_output_address.
10333
705b5121
DM
103342010-02-08 David S. Miller <davem@davemloft.net>
10335
10336 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
10337 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
10338 relocation helper function.
10339
024c4466
DM
10340 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
10341 just like R_SPARC_GOT{10,13,22}.
10342 (Target_sparc::Scan::local): Likewise.
10343 (Target_sparc::Relocate:relocate): Likewise.
10344
9109c078
ILT
103452010-02-06 Ian Lance Taylor <iant@google.com>
10346
10347 * configure.ac: Rewrite targetobjs duplicate removal code to use
10348 only shell constructs.
10349 * configure: Rebuild.
10350
cf846138
DK
103512010-02-05 Doug Kwan <dougkwan@google.com>
10352
10353 PR 11247
10354 * arm.cc (Arm_relobj::section_is_scannable): New method.
10355 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
10356 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
10357
6cfaf60b
DK
103582010-02-04 Doug Kwan <dougkwan@google.com>
10359
10360 PR 11247
10361 * arm-reloc-property.cc (cstdio): Include.
10362 * configure.ac (targetobjs): Remove duplicates.
10363 * configure: Regenerate.
10364 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
10365 big and little endian version for a given address size.
10366
5c57f1be
DK
103672010-02-03 Doug Kwan <dougkwan@google.com>
10368
10369 * arm-reloc-property.cc
10370 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10371 definition.
10372 * arm-reloc-property.h
10373 (Arm_reloc_property_table::get_implemented_static_reloc_property):
10374 New method definition.
10375 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10376 declaration.
10377 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
10378 overflow to N.
10379 (GOT_PREL): Change implemented to Y.
10380 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
10381 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
10382 (Arm_relocate_functions::movw_abs_nc): Remove method.
10383 (Arm_relocate_functions::movt_abs): Ditto.
10384 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
10385 (Arm_relocate_functions::thm_movt_abs): Ditto.
10386 (Arm_relocate_functions::movw_rel_nc): Ditto.
10387 (Arm_relocate_functions::movw_rel): Ditto.
10388 (Arm_relocate_functions::movt_rel): Ditto.
10389 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
10390 (Arm_relocate_functions:thm_movw_rel): Ditto.
10391 (Arm_relocate_functions:thm_movt_rel): Ditto.
10392 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
10393 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
10394 New method definitions.
10395 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
10396 (Arm_relocation_functions::arm_grp_ldr): Ditto.
10397 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
10398 (Arm_relocation_functions::arm_grp_ldc): Ditto.
10399 (Target_arm::Relocate::relocate): Check for non-static or
10400 unimplemented relocation code and exit early. Change calls to
10401 Target_arm::reloc_uses_thumb_bit and
10402 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
10403 instead. Refactor code to handle similar relocations to increase
10404 code sharing. Remove check for unsupported relocation code in switch
10405 statement.
10406 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
10407 relocation property table to find out size. Change error message to
10408 print out the name of a relocation code instead of the numeric value.
10409 (Target_arm::scan_reloc_for_stub): Use relocation property table
10410 instead of calling Target_arm::reloc_uses_thumb_bit().
10411
218c5831
DK
104122010-02-02 Doug Kwan <dougkwan@google.com>
10413
10414 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
10415 types of relaxed input section.
10416
0d31c79d
DK
104172010-02-02 Doug Kwan <dougkwan@google.com>
10418
10419 * Makefile.am (HFILES): Add arm-reloc-property.h.
10420 (DEFFILES): New.
2e702c99
RM
10421 (TARGETSOURCES): Add arm-reloc-property.cc
10422 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
10423 (libgold_a_SOURCES): $(DEFFILES)
10424 * Makefile.in: Regenerate.
10425 * arm-reloc-property.cc: New file.
10426 * arm-reloc-property.h: New file.
10427 * arm-reloc.def: New file.
10428 * arm.cc: Update comments.
10429 (arm-reloc-property.h): New included header.
10430 (arm_reloc_property_table): New global variable.
10431 (Target_arm::do_select_as_default_target): New method definition.
10432 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
10433 arm-reloc-property to targ_extra_obj.
10434 * parameters.cc (set_parameters_target): Call
10435 Target::select_as_default_target().
10436 * target.h (Target::select_as_default_target): New method definition.
10437 (Target::do_select_as_default_target): Same.
10438
546c7457
DK
104392010-02-01 Doug Kwan <dougkwan@google.com>
10440
10441 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
10442 first_output_text_section_.
10443 (Arm_exidx_fixup::first_output_text_section): New method definition.
10444 (Arm_exidx_fixup::first_output_text_section_): New data member.
10445 (Arm_exidx_fixup::process_exidx_section): Record the first text
10446 output section seen.
10447 (Arm_output_section::fix_exidx_coverage): Set correct linked section
10448 and entsize in output section header.
10449
11b861d5
DK
104502010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10451
10452 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
10453 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
10454 (Arm_relocate_functions::thm_alu11): New Method.
10455 (Arm_relocate_functions::thm_pc8): New Method.
10456 (Arm_relocate_functions::thm_pc12): New Method.
10457 (Target_arm::Scan::local): Handle the relocations.
10458 (Target_arm::Scan::global): Likewise.
10459 (Target_arm::Relocate::relocate): Likewise.
10460 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10461
c9a2c125
DK
104622010-01-29 Doug Kwan <dougkwan@google.com>
10463
10464 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
10465 of relocation types as ld.
10466
1521477a
DK
104672010-01-29 Doug Kwan <dougkwan@google.com>
10468
10469 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
10470 to public.
10471 (Arm_relocate_functions::thumb_branch_common): Ditto.
10472 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
10473 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
10474 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
10475 Arm_relocate_functions::jump24): Remove.
10476 (Target_arm::Relocate::relocate): Adjust code to call
10477 Arm_relocation_functions::arm_branch_common and
10478 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 10479 wrappers. Merge switch-cases together to reduce source code size.
1521477a 10480
e7eca48c
DK
104812010-01-29 Doug Kwan <dougkwan@google.com>
10482
10483 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
10484 output_local_symbol_count_needs_update_.
10485 (Arm_relobj::output_local_symbol_count_needs_update,
10486 Arm_relobj::set_output_local_symbol_count_needs_update,
10487 Arm_relobj::update_output_local_symbol_count): New methods.
10488 (Arm_relobj::output_local_symbol_count_needs_update_): New data
10489 member.
10490 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
10491 of pointed function as in a R_ARM_PREL31 relocation.
10492 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
10493 for output local symbol count updating.
10494 (Target_arm::do_relax): Update output local symbol counts in objects
10495 if necessary.
10496 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
10497
02961d7e
ILT
104982010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10499
10500 * arm.cc: Added support for the ARM relocations:
10501 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
10502 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
10503 (Arm_relocate_functions::movw_rel_nc): Renamed (was
10504 movw_prel_nc).
10505 (Arm_relocate_functions::movw_rel): New method.
10506 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
10507 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
10508 thm_movw_prel_nc).
10509 (Arm_relocate_functions::thm_movw_rel): New method.
10510 (Arm_relocate_functions::thm_movt_rel): Renamed (was
10511 thm_movt_prel).
10512 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
10513 relocations.
10514 (Target_arm::Scan::global): Likewise.
10515 (Target_arm::Relocate::relocate): Likewise.
10516 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10517 Likewise.
10518
b10d2873
ILT
105192010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10520
10521 * arm.cc: Added support for ARM group relocations.
10522 (Target_arm::reloc_needs_sym_origin): New method.
10523 (Arm_relocate_functions::calc_grp_kn): New method.
10524 (Arm_relocate_functions::calc_grp_residual): New method.
10525 (Arm_relocate_functions::calc_grp_gn): New method.
10526 (Arm_relocate_functions::arm_grp_alu): New Method.
10527 (Arm_relocate_functions::arm_grp_ldr): New Method.
10528 (Arm_relocate_functions::arm_grp_ldrs): New Method.
10529 (Arm_relocate_functions::arm_grp_ldc): New Method.
10530 (Target_arm::Scan::local): Handle the ARM group relocations.
10531 (Target_arm::Scan::global): Likewise.
10532 (Target_arm::Relocate::relocate): Likewise.
10533 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10534 Likewise.
10535
2b328d4e
DK
105362010-01-26 Doug Kwan <dougkwan@google.com>
10537
10538 * arm.cc (set): Include.
10539 (class Arm_exidx_fixup): Change type of last_input_section_ to const
10540 pointer type.
2e702c99 10541 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
10542 (Arm_output_section::append_text_sections_to_list): New method.
10543 (Arm_output_section::fix_exidx_coverage): Ditto.
10544 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 10545 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
10546 Relobj::set_section_offset() instead of
10547 Sized_relobj::invalidate_section_offset().
2e702c99 10548 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
10549 parameter for section headers. Ignore relocation sections for
10550 unallocated sections and EXIDX sections.
10551 (Target_arm::fix_exidx_coverage): New method.
10552 (Target_arm::output_section_address_less_than): New type.
10553 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
10554 linked text section instead of the EXIDX section.
10555 (Arm_output_section::create_stub_group): Add an assertion to check
10556 that this is not an EXIDX output section.
10557 (Arm_output_section::append_text_sections_to_list): New method.
10558 (Arm_output_section::fix_exidx_coverage): Ditto.
10559 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 10560 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
10561 (Target_arm::do_relax): Fix EXIDX output section coverage in the
10562 first pass.
10563 (Target_arm::fix_exidx_coverage): New method.
10564 * object.h (Relobj::set_output_section): New method.
10565 (Sized_relobj::invalidate_section_offset): Remove method.
10566 (Sized_relobj::do_invalidate_section_offset): Remove method.
10567 (Sized_relobj::do_set_section_offset): Handle offset value -1.
10568
c7f3c371
DK
105692010-01-25 Doug Kwan <dougkwan@google.com>
10570
10571 * arm.cc (Arm_exidx_merged_section::do_output_offset):
10572 Fix warning due to signed and unsigned comparison on a 32-bit host.
10573
8923b24c
DK
105742010-01-22 Doug Kwan <dougkwan@google.com>
10575
10576 * arm.cc (Target_arm::do_relax): Record an output section for section
10577 offset adjustment it contains any stub table that has changed.
10578 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
10579 offsets in an output section if necessary.
10580 * output.cc (Output_section::Output_section): Initialize
10581 section_offsets_need_adjustments_.
10582 (Output_section::add_input_section_for_script): Renamed to
10583 Output_section::add_simple_input_section.
10584 (Output_section::save_states): Add a comment.
10585 (Output_section::discard_states): New method defintion.
10586 (Output_section::adjust_section_offsets): Same.
10587 * output.h (Output_section::add_input_section_for_script): Renamed to
10588 Output_section::add_simple_input_section.
10589 (Output_section::discard_states): New method declaration.
10590 (Output_section::adjust_section_offsets): Same.
10591 (Output_section::section_offsets_need_adjustment,
10592 Output_section::set_section_offsets_need_adjustment): New method
10593 definitions.
10594 (Output_section::section_offsets_need_adjustment_): New data member.
10595 * script-sections.cc
10596 (Output_section_element_input::set_section_address): Adjust code for
10597 renaming of Output_section::add_input_section_for_script.
10598 (Orphan_output_section::set_section_address): Same.
10599
9b2fd367
DK
106002010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10601
10602 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
10603 Fix_v4bx enum values .
10604 * gold/options.h (General_options): New option definitions.
10605 (General_options::fix_v4bx): New method.
10606 (General_options::Fix_v4bx): New enum.
10607 * gold/options.cc (General_options::parse_fix_v4bx): New method.
10608 (General_options::parse_fix_v4bx_interworking): New method.
10609
80d0d023
DK
106102010-01-22 Doug Kwan <dougkwan@google.com>
10611
10612 * arm.cc (Arm_exidx_fixup): New class.
10613
af2cdeae
DK
106142010-01-21 Doug Kwan <dougkwan@google.com>
10615
10616 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
10617 classes.
10618 (Arm_exidx_section_offset_map): New type.
10619
993d07c1
DK
106202010-01-21 Doug Kwan <dougkwan@google.com>
10621
10622 * arm.cc (Arm_exidx_input_section): New class.
10623 (Arm_relobj::exidx_input_section_by_link,
10624 Arm_relobj::exidx_input_section_by_shndx,
10625 Arm_relobj::make_exidx_input_section): New methods.
10626 (read_arm_attributes_section): Remove.
10627 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
10628 information about them.
10629 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
10630 to here.
10631
5ac169d4
DK
106322010-01-20 Doug Kwan <dougkwan@google.com>
10633
10634 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
10635 Input_section_specifier to Section_id.
10636 (Target_arm::new_arm_input_section: Adjust code for change of key
10637 type.
10638 (Target_arm::find_arm_input_section): Ditto.
10639 * gc.h (object.h): Include for Section_id nand Section_id_hash.
10640 (Section_id): Remove.
10641 (Garbage_collection::Section_id_hash): Remove.
10642 * icf.h (object.h): Include for Section_id nand Section_id_hash.
10643 (Section_id): Remove.
10644 (Icf::Section_id_hash): Remove.
10645 * object.h (Section_id, Const_section_id, Section_id_hash,
10646 Const_section_id_hash): New type definitions.
10647 * output.cc (Output_section::add_relaxed_input_section): Change to
10648 use Const_section_id instead of Input_section_specifier as key type.
10649 (Output_section::add_merge_input_section): Ditto.
10650 (Output_section::build_relaxation_map): Change to use Section_id
10651 instead of Input_section_specifier as key type.
2e702c99 10652 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
10653 Ditto.
10654 (Output_section::convert_input_sections_to_relaxed_sections): Change
10655 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 10656 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
10657 (Output_section::find_relaxed_input_section): Ditto.
10658 * output.h (Input_section_specifier): Remove class.
10659 (Output_section::Output_section_data_by_input_section_map): Change
10660 key type to Const_section_id.
10661 (Output_section::Output_relaxed_input_section_by_input_section_map):
10662 Ditto.
10663 (Output_section::Relaxation_map): Change key type to Section_id.
10664
a2162063
ILT
106652010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10666
10667 * gold/arm.cc: Added support for R_ARM_V4BX relocation
10668 (class Arm_v4bx_stub): New class.
10669 (DEF_STUBS): Updated definition to support v4_veneer_bx.
10670 (Stub_factory::make_arm_v4bx_stub): New method.
10671 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
10672 (Stub_table::empty): Handle v4bx stubs.
10673 (Stub_table::add_arm_v4bx_stub): New method.
10674 (Stub_table::find_arm_v4bx_stub): New method.
10675 (Arm_relocate_functions::v4bx): New method.
10676 (Target_arm::fix_v4bx): New method.
10677 (Target_arm::Target_arm): Handle R_ARM_V4BX.
10678 (Stub_table::relocate_stubs): Likewise.
10679 (Stub_table::do_write): Likewise.
10680 (Stub_table::update_data_size_and_addralign): Likewise.
10681 (Stub_table::finalize_stubs): Likewise.
10682 (Target_arm::Scan::local): Likewise.
10683 (Target_arm::Scan::global): Likewise.
10684 (Target_arm::do_finalize_sections): Likewise.
10685 (Target_arm::Relocate::relocate): Likewise.
10686 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10687 Likewise.
10688 (Target_arm::scan_reloc_for_stub): Likewise.
10689 (Target_arm::scan_reloc_section_for_stubs): Likewise.
10690
5696ab0b
ILT
106912010-01-19 Ian Lance Taylor <iant@google.com>
10692
10693 * output.cc (Output_section_headers::do_sized_write): Write large
10694 segment count to sh_info field.
10695 (Output_file_header::do_sized_write): For large segment count,
10696 write PN_XNUM to e_phnum field.
10697
800d0f56
ILT
106982010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10699
10700 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
10701 (Arm_relocate_functions::thm_jump8): New function.
10702 (Arm_relocate_functions::thm_jump11): New function.
10703 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
10704 R_ARM_THM_JUMP11.
10705 (Target_arm::Scan::global): Likewise.
10706 (Target_arm::Relocate::relocate): Likewise.
10707 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10708 Likewise.
10709
41263c05
DK
107102010-01-14 Doug Kwan <dougkwan@google.com>
10711
10712 * arm.cc (map, utility): Include headers.
10713 (Target_arm::apply_cortex_a8_workaround): New method.
10714 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
10715 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
10716 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
10717 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
10718 the --[no-]fix-cortex-a8 command line options.
10719 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
10720 (Target_arm::relocate_stub): Use addend in instruction template.
10721 * options.h (DEFINE_bool): Set the user-set flag.
10722 (General_options): Add --[no-]-fix-cortex options.
10723 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 10724 : Update fast look-up map after conversion.
41263c05 10725
459e9b03
ST
107262010-01-14 Sriraman Tallam <tmsriram@google.com>
10727
10728 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
10729 in the first pass of do_layout.
10730
b521dfe4
DK
107312010-01-13 Doug Kwan <dougkwan@google.com>
10732
10733 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10734 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
10735 apparent compiler problem of not folding static constant integral
10736 data members of elfcpp::Elf_sizes<32>.
10737
44272192
DK
107382010-01-13 Doug Kwan <dougkwan@google.com>
10739
10740 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10741 Arm_relobj::section_needs_cortex_a8_stub_scanning,
10742 Arm_relobj::scan_section_for_cortex_a8_erratum,
10743 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
10744 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
10745 sections to scan for relocation stubs into a new method
10746 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
10747 relocation and Cortex-A8 stub scanning.
10748 (Target_arm::do_relax): Force stubs to be after stubbed sections
10749 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 10750 the beginning of a new relaxation pass. Update a comment.
44272192
DK
10751 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
10752
44b71ece
ILT
107532010-01-12 Ian Lance Taylor <iant@google.com>
10754
10755 * target-reloc.h (visibility_error): New inline function.
10756 (relocate_section): Call visibility_error.
10757 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
10758 (MOSTLYCLEANFILES): Likewise.
10759 (protected_4_pic.o, protected_3.err): New targets.
10760 * testsuite/protected_4.cc: New file.
10761
a120bc7f
DK
107622010-01-12 Doug Kwan <dougkwan@google.com>
10763
10764 * arm.cc (Cortex_a8_reloc): New class.
10765 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
10766 and cortex_a8_relocs_info_.
10767 (Target_arm::fix_cortex_a8): New method definition.
10768 (Target_arm::Cortex_a8_relocs_info): New type.
10769 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
10770 New data member declarations.
10771 (Target_arm::scan_reloc_for_stub): Record information about
10772 relocations for THUMB branches that might be exempted from the
10773 Cortex-A8 workaround.
10774 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
10775 at the beginning of a relaxation pass.
10776
20138696
DK
107772010-01-12 Doug Kwan <dougkwan@google.com>
10778
10779 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
10780 (Arm_relobj::Mapping_symbol_position,
10781 Arm_reloj::Mapping_symbol_position_less,
10782 Arm_relobj::Mapping_symbols_info): New types.
10783 (Target_arm::is_mapping_symbol_name): New method definition.
10784 (Arm_relobj::do_count_local_symbols): Save information about mapping
10785 symbols.
10786
089d69dc
DK
107872010-01-11 Doug Kwan <dougkwan@google.com>
10788
10789 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
10790 Arm_relocate_functions::thumb32_branch_upper,
10791 Arm_relocate_functions::thumb32_branch_lower,
10792 Arm_relocate_functions::thumb32_cond_branch_offset,
10793 Arm_relocate_functions::thumb32_cond_branch_upper,
10794 Arm_relocate_functions::thumb32_cond_branch_lower,
10795 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
10796 branch offset encoding.
10797 (Arm_relocate_functions::thumb_branch_common): Use new branch
10798 offset encoding methods to avoid code duplication.
10799 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
10800 (Stub_addend_reader::operator()): Use new branch encoding method
10801 to avoid code duplication.
10802
99e5bff2
DK
108032010-01-11 Doug Kwan <dougkwan@google.com>
10804
10805 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
10806 (Target_arm::do_finalize_sections): Define special EXIDX section
10807 symbols only if referenced.
10808 * gc.h (Garbage_collection::add_reference): New method.
10809 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
10810 code duplication.
10811
98e090bd
ILT
108122010-01-11 Ian Lance Taylor <iant@google.com>
10813
d0a91bd8
ILT
10814 * script.cc (Version_script_info::build_expression_list_lookup):
10815 Change complaing about duplicate wildcard match from error to
10816 warning.
10817
98e090bd
ILT
10818 * script.cc (class Lazy_demangler): Recreate--revert part of patch
10819 of 2009-12-30.
10820 (Version_script_info::Version_script_info): Initialize globs_,
10821 default_version_, default_is_global_, and exact_. Don't
10822 initialize globals_ or locals_.
10823 (Version_script_info::build_lookup_tables): Build local symbols
10824 first.
10825 (Version_script_info::unquote): New function.
10826 (Version_script_info::add_exact_match): New function.
10827 (Version_script_info::build_expression_list_lookup): Remove lookup
10828 parameter. Add is_global parameter. Change all callers. Handle
10829 wildcard pattern specially. Unquote pattern. Call
10830 add_exact_match.
10831 (Version_script_info::get_name_to_match): New function.
10832 (Version_script_info::get_symbol_version): New function.
10833 (Version_script_info::get_symbol_version_helper): Remove.
10834 (Version_script_info::check_unmatched_names): Call unquote.
10835 * script.h (class Version_script_info): Change get_symbol_version
10836 to be non-inline and add is_global parameter; change all callers.
10837 Rewrite symbol_is_local. Update declarations. Define struct
10838 Version_tree_match, Exact, Globs. Don't define struct Lookup.
10839 Remove globals_ and locals_ members. Add exact_, globs_,
10840 default_version_, is_global_.
10841 (Version_script_info::Glob): Remove pattern, add expression and
10842 is_global. Update constructor. Change all callers.
10843 * dynobj.cc (Versions::finalize): Mark the version symbol as the
10844 default version.
10845 (Versions::symbol_section_contents): If a symbol is undefined, or
10846 defined in a dynamic object, set the version index to
10847 VER_NDX_LOCAL.
10848 * symtab.cc (Symbol_table::add_from_relobj): Don't call
10849 symbol_is_local.
10850 (Symbol_table::add_from_pluginobj): Likewise.
10851 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
10852
d56962d3
DK
108532010-01-11 Doug Kwan <dougkwan@google.com>
10854
10855 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
10856 (incremental_dump_LDADD): Add linking option for libintl.
10857 * Makefile.in: Regenerate.
10858
94e6ee91
L
108592010-01-11 H.J. Lu <hongjiu.lu@intel.com>
10860
10861 PR gold/11144
10862 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
10863 instead of -Ds.
10864 * testsuite/Makefile.in: Regenerated.
10865
e96c574b
DK
108662010-01-10 Doug Kwan <dougkwan@google.com>
10867
10868 * options.h (DEFINE_var): Use parentheses around argument varname__
10869 in macro body to avoid any unintended subsequent substitutions.
10870
7198066b
ILT
108712010-01-10 Ian Lance Taylor <iant@google.com>
10872
ba4d53bf
ILT
10873 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
10874 candidates before doing symbol resolution.
10875
7198066b
ILT
10876 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
10877 ODR candidates if only one is weak.
10878
a2beed37
ILT
108792010-01-08 Ian Lance Taylor <iant@google.com>
10880
10881 * script.cc (Version_script_info::build_expression_list_lookup):
10882 Don't warn about ambiguous version, just record the ambiguity.
10883 (Version_script_info::get_symbol_version_helper): Give error if
10884 version is ambiguous.
10885
2fb7225c
DK
108862010-01-08 Doug Kwan <dougkwan@google.com>
10887
10888 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
10889 prev_data_size_ and prev_addralign_. Remove initializer for
10890 deleted data member has_been_changed_.
10891 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
10892 to determine if the table is empty.
10893 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
10894 Remove.
10895 (Stub_table::add_reloc_stub): Define method in class definition
10896 instead of just declaring it there.
10897 (Stub_table::add_cortex_a8_stub): New method definition.
10898 (Stub_table::update_data_size_and_addralign): Ditto.
10899 (Stub_table::finalize_stubs): Ditto.
10900 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
10901 (Stub_table::do_addralign_): Return address alignment in the
10902 (Stub_table::do_reset_address_and_file_offset): Define method in
10903 class definition instead of declaring it there. Set current data
10904 size to be the data size of the previous pass.
10905 (Stub_table::set_final_data_size): Use current data size as the
10906 final data size.
10907 (Stub_table::relocate_stub): Change parameter type of stub from
10908 Reloc_stub pointer to Stub pointer.
10909 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
10910 (Stub_table::Cortex_a8_stub_list): New typedef.
10911 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
10912 Stub_table::prev_addralign_): New data member.
10913 (Arm_relobj::Arm_relobj): Initialize data member
10914 section_has_cortex_a8_workaround_.
10915 (Arm_relobj::section_has_cortex_a8_workaround,
10916 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
10917 definitions.
10918 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
10919 declarations.
10920 (Target_arm::relocate_stub): Change parameter type of stub from
10921 Reloc_stub pointer to Stub pointer.
10922 (Insn_template::size, Insn_template::alignment): Handle
10923 THUMB16_SPECIAL_TYPE.
10924 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
10925 Stub_table::update_data_size_and_addralign,
10926 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
10927 definitions.
10928 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
10929 (Stub_table::do_write): Ditto.
10930 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 10931
880cd20d
ILT
109322010-01-08 Ian Lance Taylor <iant@google.com>
10933
10934 PR 11108
10935 * symtab.h (class Symbol): Remove fields is_target_special_ and
10936 has_plt_offset_. Add field is_defined_in_discarded_section_.
10937 (Symbol::is_defined_in_discarded_section): New function.
10938 (Symbol::set_is_defined_in_discarded_section): New function.
10939 (Symbol::has_plt_offset): Rewrite.
10940 (Symbol::set_plt_offset): Verify that new offset is not -1U.
10941 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
10942 Don't initialize is_target_special_ or has_plt_offset_.
10943 Initialize is_defined_in_discarded_section_.
10944 (Symbol_table::add_from_relobj): If appropriate, set
10945 is_defined_in_discarded_section.
10946 * resolve.cc (Symbol::override_base_with_special): Don't test
10947 is_target_special_. Change has_plt_offset_ to has_plt_offset().
10948 * target-reloc.h (relocate_section): Do special handling for
10949 symbols defined in discarded sections for global symbols as well
10950 as local symbols.
10951
2703e3eb
ILT
109522010-01-08 Ian Lance Taylor <iant@google.com>
10953
10954 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
10955 the SHT_SYMTAB case.
10956
339d40a3
ILT
109572010-01-08 Ian Lance Taylor <iant@google.com>
10958
10959 * object.cc (Sized_relobj::do_layout): Don't get confused if
10960 layout_eh_frame returns NULL.
10961
abecea76
ILT
109622010-01-08 Ian Lance Taylor <iant@google.com>
10963
10964 PR 11084
10965 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
10966 dynamic symbol table, use the normal symbol table.
10967 (Sized_dynobj::do_read_symbols): Remove assertion about type of
10968 symbol table.
10969
6b7dd3f3
ILT
109702010-01-08 Ian Lance Taylor <iant@google.com>
10971
10972 PR 11072
10973 * layout.cc (Layout::include_section): Remove .gnu_debuglink
10974 sections.
10975
36c50e63
L
109762010-01-08 H.J. Lu <hongjiu.lu@intel.com>
10977
10978 * version.cc (print_version): Change to "Copyright 2010".
10979
e291e7b9
ILT
109802010-01-08 Ian Lance Taylor <iant@google.com>
10981
10982 PR 10287
10983 PR 11063
10984 * i386.cc (class Target_i386): Change return type of plt_section
10985 to be non-const.
10986 (class Output_data_plt_i386): Add tls_desc_rel_ field.
10987 (Output_data_plt_i386::Output_data_plt_i386): Initialize
10988 tls_desc_rel_ field.
10989 (Output_data_plt_i386::rel_tls_desc): New function.
10990 (Target_i386::rel_tls_desc_section): New function.
10991 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
10992 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
10993 R_386_TLS_DESC reloc in rel_tls_desc_section.
10994 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
10995 Define struct Tlsdesc_info.
10996 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
10997 (Target_x86_64::do_reloc_symbol_index): New function.
10998 (Target_x86_64::add_tlsdesc_info): New function.
10999 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
11000 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
11001 tlsdesc_rel_ field.
11002 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
11003 all callers.
11004 (Output_data_plt_x86_64::rela_tlsdesc): New function.
11005 (Target_x86_64::rela_tlsdesc_section): New function.
11006 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
11007 handling.
11008 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
11009 (Target_x86_64::do_reloc_addend): New function.
11010 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
11011 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
11012 declarations. Define TARGET_CODE. Add arg field to u1_ union.
11013 (Output_reloc::type): New function.
11014 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
11015 (Output_reloc::is_target_specific): New function.
11016 (Output_reloc::target_arg): New function.
11017 (class Output_reloc) [SHT_RELA]: Add four new constructors for
11018 absolute relocs and target specific relocs.
11019 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
11020 add_target_specific.
11021 (class Output_data_reloc) [SHT_RELA]: Likewise.
11022 * output.cc (Output_reloc::Output_reloc): Add four new versions
11023 for absolute relocs and target specific relocs.
11024 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
11025 (Output_reloc::get_symbol_index): Likewise.
11026 (Output_reloc::local_section_offset): Check that local_sym_index_
11027 is not TARGET_CODE or 0.
11028 (Output_reloc::symbol_value): Likewise.
11029 (Output_reloc::write) [SHT_RELA]: Call target for target specific
11030 reloc.
11031 * target.h (class Target): Add reloc_symbol_index and reloc_addend
11032 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
11033 functions.
11034 * layout.cc (add_target_dynamic_tags): Use output section for
11035 DT_PLTRELSZ and DT_JMPREL.
11036
3a44184e
ILT
110372010-01-07 Ian Lance Taylor <iant@google.com>
11038
11039 PR 11061
11040 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
11041 function.
11042 (class Output_data_reloc_generic): Define.
11043 (class Output_data_reloc_base): Change base class to
11044 Output_data_reloc_generic. Change add() method to call
11045 bump_relative_reloc_count for a relative reloc. Remove
11046 sort_relocs_ field.
11047 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
11048 to sort_relocs().
11049 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
11050 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
11051 appropriate.
11052 * layout.h (class Layout): Update declaration.
11053
ea715a34
ILT
110542010-01-07 Ian Lance Taylor <iant@google.com>
11055
11056 * output.h (class Output_data): Add const version of
11057 output_section and do_output_section.
11058 (class Output_section_data): Add const version of
11059 do_output_section.
11060 (class Output_section): Likewise.
11061 * layout.cc (Layout::add_target_dynamic_tags): New function.
11062 * layout.h (class Layout): Update declarations.
11063 * arm.cc (Target_arm::do_finalize_sections): Use
11064 add_target_dynamic_tags.
11065 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11066 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11067 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11068 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11069
659948a4
ILT
110702010-01-07 Ian Lance Taylor <iant@google.com>
11071
11072 PR 11042
11073 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
11074 object as needed.
11075
9d3b86f6
ILT
110762010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
11077 Ian Lance Taylor <iant@google.com>
11078
11079 PR 11019
11080 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
11081 Xindex::read_symtab_xindex.
11082
bb0d3eb0
DK
110832010-01-07 Doug Kwan <dougkwan@google.com>
11084
11085 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
11086 (Insn_template::thumb16_bcond_insn): New method declaration.
11087 (Insn_template): Fix spelling.
11088 (Stub::thumb16_special): New method declaration.
11089 (Stub::do_write): Define virtual method which was previously pure
11090 virtual.
11091 (Stub::do_thumb16_special): New method declaration.
11092 (Stub::do_fixed_endian_write): New template member.
11093 (Reloc_stub::do_write): Remove.
11094 (Reloc_stub::do_fixed_endian_write): Remove.
11095 (Cortex_a8_stub): New class definition.
11096 (Stub_factory::make_cortex_a8_stub): New method definition.
11097 (Stub_factory::Stub_factory): Add missing static storage class
11098 qualifier for elf32_arm_stub_a8_veneer_blx.
11099
ffeef7df
ILT
111002010-01-07 Ian Lance Taylor <iant@google.com>
11101
dc3f80fe
ILT
11102 PR 10980
11103 * options.h (class General_options): Add --warn-unresolved-symbols
11104 and --error-unresolved-symbols.
11105 * errors.cc (Errors::undefined_symbol): Implement
11106 --warn-unresolved-symbols.
11107
ffeef7df
ILT
11108 * options.h (class General_options): Add -z text and -z textoff.
11109 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
11110
f1ec9ded
ST
111112010-01-06 Sriraman Tallam <tmsriram@google.com>
11112
11113 * gc.h (Garbage_collection::Cident_section_map): New typedef.
11114 (Garbage_collection::cident_sections): New function.
11115 (Garbage_collection::add_cident_section): New function.
11116 (Garbage_collection::cident_sections_): New member.
11117 (gc_process_relocs): Add references to sections whose names are C
11118 identifiers.
11119 * gold.h (cident_section_start_prefix): New constant.
11120 (cident_section_stop_prefix): New constant.
11121 (is_cident): New function.
11122 * layout.cc (Layout::define_section_symbols): Replace string constants
11123 with the newly defined constants.
11124 * object.cc (Sized_relobj::do_layout): Track sections whose names are
11125 C identifiers.
11126 * testsuite/Makefile.am: Add gc_orphan_section_test.
11127 * testsuite/Makefile.in: Regenerate.
11128 * testsuite/gc_orphan_section_test.cc: New file.
11129 * testsuite/gc_orphan_section_test.sh: New file.
11130
6eda8c29
ILT
111312010-01-06 Ian Lance Taylor <iant@google.com>
11132
b9674e17
ILT
11133 PR 10980
11134 * options.h (class General_options): Add --warn-shared-textrel.
11135 * layout.cc (Layout::finish_dynamic_section): Implement
11136 --warn-shared-textrel.
11137
6eda8c29
ILT
11138 PR 10980
11139 * options.h (class General_options): Add --warn-multiple-gp.
11140
32dcd44e
ILT
111412010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11142
11143 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
11144 $(THREADSLIB) and $(LIBDL).
11145 * Makefile.in: Rebuild.
11146
a192ba05
ILT
111472010-01-06 Ian Lance Taylor <iant@google.com>
11148
11149 PR 10980
11150 * options.cc (General_options::parse_section_start): New function.
11151 (General_options::section_start): New function.
11152 (General_options::General_options): Initialize all members.
11153 * options.h: Include <map>
11154 (class General_options): Add --section-start. Add section_starts_
11155 member.
11156 * layout.cc (Layout::attach_allocated_section_to_segment): If
11157 --section-start was used, set the address of the segment. Remove
11158 local sort_sections.
11159 (Layout::relaxation_loop_body): If the address of the load segment
11160 has been set by --section-start, don't use it.
11161 * output.h (Output_segment::update_flags_for_output_section): New
11162 function.
11163 * output.cc (Output_segment::add_output_section): Call
11164 update_flags_for_output_section.
11165
dde3f402
ILT
111662010-01-05 Ian Lance Taylor <iant@google.com>
11167
62dfdd4d
ILT
11168 PR 10980
11169 * options.h (class General_options): Add --undefined-version.
11170 * script.cc (struct Version_expression): Add was_matched_by_symbol
11171 field.
11172 (Version_script_info::matched_symbol): New function.
11173 (Version_script_info::get_symbol_version_helper): Call
11174 matched_symbol.
11175 (Version_script_info::check_unmatched_names): New function.
11176 * script.h (class Version_script_info): Update declarations.
11177 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
11178
9c4ae156
ILT
11179 * options.h (class General_options): Use DEFINE_bool_alias for
11180 allow_multiple_definition.
11181 * resolve.cc (Symbol_table::should_override): Don't test
11182 allow_multiple_definition.
11183
dde3f402
ILT
11184 PR 10980
11185 * options.h (class General_options): Add --cref.
11186 * main.cc (main): Print cref table if --cref. Don't close mapfile
11187 until after printing cref table.
11188 * cref.cc: Include "symtab.h".
11189 (class Cref_inputs): Define Cref_table_compare and Cref_table.
11190 (Cref_table_compare::operator()): New function.
11191 (Cref_inputs::gather_cref): New function.
11192 (filecol): New static const.
11193 (Cref_inputs::print_cref): New function.
11194 (Cref::print_cref): New function.
11195 * cref.h: Include <cstdio>.
11196 (class Cref): Update declarations.
11197 * mapfile.h (Mapfile::file): New function.
11198 * object.h (class Object): Define Symbols. Declare virtual
11199 do_get_global_symbols.
11200 (Object::get_global_symbols): New function.
11201 * object.cc (Input_objects::add_object): Pass object to cref_ if
11202 --cref.
11203 (Input_objects::archive_start): Likewise.
11204 (Input_objects::archive_stop): Likewise.
11205 (Input_objects::print_cref): New function.
11206 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
11207 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
11208 --cref.
11209 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
11210 function.
11211 * plugin.h (class Sized_pluginobj): Update declarations.
11212
8781f709
ILT
112132010-01-05 Ian Lance Taylor <iant@google.com>
11214
11215 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
11216 to is_default_version. Rename insdef to insdefault.
11217 (Symbol_table::add_from_relobj): Rename def to is_default_version
11218 and local to is_forced_local.
11219 (Symbol_table::add_from_pluginobj): Likewise.
11220 (Symbol_table::add_from_dynobj): Likewise.
11221 (Symbol_table::define_special_symbol): Rename insdef to
11222 insdefault.
11223
fe35d28d
ILT
112242010-01-04 Ian Lance Taylor <iant@google.com>
11225
30bc8c46
ILT
11226 PR 10980
11227 * options.h (class General_options): Add
11228 --allow-multiple-definition and -z muldefs.
11229 * resolve.cc (Symbol_table::should_override): Don't warn about a
11230 multiple symbol definition if --allow-multiple-definition or -z
11231 muldefs.
11232
7eaea549
ILT
11233 PR 10980
11234 * options.h (class General_options): Add --add-needed and
11235 --copy-dt-needed-entries. Tweak --as-needed help entry.
11236 * object.cc (Input_objects::check_dynamic_dependencies): Give an
11237 error if --copy-dt-needed-entries aka --add-needed is used and
11238 would cause a change in behaviour.
11239
fe35d28d
ILT
11240 PR 10980
11241 * options.h (class General_options): Add -G as a short version of
11242 --shared. Add no-op options -assert, -g, and -i.
11243
55a2bb35
ST
112442010-01-04 Sriraman Tallam <tmsriram@google.com>
11245
11246 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
11247 check for .text or .gnu.linkonce.t sections.
11248 * icf.cc (Icf::find_identical_sections): Ditto.
11249 Change the detection for mangled function name within the section
11250 name.
11251 * icf.h (is_section_foldable_candidate): New function.
11252
719328e1
ILT
112532009-12-30 Ian Lance Taylor <iant@google.com>
11254
11255 PR 10980
11256 * options.h (class General_options): Permit two dashes with
11257 --retain-symbols-file.
11258
d7bb5745
ILT
112592009-12-30 Ian Lance Taylor <iant@google.com>
11260
403a15dd
ILT
11261 PR 10979
11262 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
11263 don't put the file header and segment headers in the text
11264 segment.
11265
eda294df
ILT
11266 PR 10979
11267 * common.cc (Sort_commons::operator()): Stabilize sort when both
11268 entries are NULL.
11269 (Symbol_table::do_allocate_commons_list): When allocating common
11270 symbols, skip a symbol which is no longer common.
11271 * symtab.h (Symbol::is_common): Test whether the symbol comes from
11272 an object before checking its type.
11273 * testsuite/common_test_2.c: New file.
11274 * testsuite/common_test_3.c: New file.
11275 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
11276 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
11277 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
11278 (common_test_2_pic.o, common_test_2.so): New targets.
11279 (common_test_3_pic.o, common_test_3.so): New targets.
11280 * testsuite/Makefile.in: Rebuild.
11281
d7bb5745
ILT
11282 PR 10979
11283 * script.cc (read_input_script): If we see a new SECTIONS clause,
11284 and we have added an input section, give an error.
11285 * layout.h (class Layout): Add have_added_input_section function.
11286 Add have_added_input_section_ field.
11287 * layout.cc (Layout::Layout): Initialize
11288 have_added_input_section_.
11289 (Layout::layout): Set have_added_input_section_.
11290 (Layout::layout_eh_frame): Likewise.
11291
fc59c572
ILT
112922009-12-30 Ian Lance Taylor <iant@google.com>
11293
11294 PR 10931
11295 * options.h (class General_options): Add --sort-common option.
11296 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
11297 * common.cc (Sort_common): Add sort_order parameter to
11298 constructor. Add sort_order_ field.
11299 (Sort_commons::operator): Check sort_order_.
11300 (Symbol_table::allocate_commons): Determine the sort order.
11301 (Symbol_table::do_allocate_commons): Add sort_order parameter.
11302 Change all callers.
11303 (Symbol_table::do_allocate_commons_list): Likewise.
11304
1c74fab0
ILT
113052009-12-30 Ian Lance Taylor <iant@google.com>
11306
11307 PR 10916
11308 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
11309 symbols from this object, don't change the visibility of an
11310 undefined symbol.
11311 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
11312
6affe781
ILT
113132009-12-30 Ian Lance Taylor <iant@google.com>
11314
11315 PR 10861
11316 * script.h (class Version_script_info): Define Language enum.
11317 Update declarations. Define Glob, Exact, and Lookup types. Add
11318 new fields globals_, locals_, and is_finalized_.
11319 * script.cc: Various formatting fixes.
11320 (class Parser_closure): Change language_stack_ from a vector of
11321 std::string to one of Version_script_info::Language. Adjust all
11322 uses accordingly.
11323 (class Lazy_demangler): Remove.
11324 (struct Version_expression): Change language from std::string to
11325 Version_script_info::Language.
11326 (Version_script_info::Version_script_info): New function.
11327 (Version_script_info::~Version_script_info): Don't call clear.
11328 (Version_script_info::finalize): New function.
11329 (Version_script_info::build_lookup_tables): New function.
11330 (Version_script_info::build_expression_list_lookup): New
11331 function.
11332 (Version_script_info::get_symbol_version_helper): Rewrite to use
11333 lookup tables.
11334 (Version_script_info::print_expression_list): Adjust to use
11335 Version_script_info::Language.
11336 (script_push_lex_into_version_mode): Check that the version script
11337 has not been finalized.
11338 (version_script_push_lang): Change language string to
11339 Version_script_info::Language.
11340 * options.cc (Command_line::version_script): New function.
11341 * options.h (class General_options): Add finalize_dynamic_list
11342 function. Change version_script from declaration to definition.
11343 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
11344 * testsuite/version_script.map: Remove duplicate def of foo.
11345 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
11346 version_script.map.
11347 * testsuite/Makefile.in: Rebuild.
11348
818bf354
ILT
113492009-12-30 Ian Lance Taylor <iant@google.com>
11350
11351 PR 10843
11352 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
11353 if the input symbol index is 0, make the output symbol index 0.
11354
ebcc8304
ILT
113552009-12-30 Ian Lance Taylor <iant@google.com>
11356
11357 PR 10670
11358 * options.h (class General_options): Add -x/--discard-all.
11359 * object.cc (Sized_relobj::do_count_local_symbols): Handle
11360 --discard-all. If the local symbol needs a dynamic entry, check
11361 that before handling --discard-locals.
11362
176fe33f
ILT
113632009-12-30 Ian Lance Taylor <iant@google.com>
11364
bb321bb1
ILT
11365 PR 10450
11366 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
11367 flags to PF_R.
11368 (Output_segment::add_output_section): Don't change the flags if
11369 the type is PT_TLS.
11370
176fe33f
ILT
11371 PR 10450
11372 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
11373 GNU hash table if they need a dynamic value. Otherwise, don't add
11374 them if they are defined in a dynamic object or are forced local.
11375
e8cd95c7
ILT
113762009-12-29 Ian Lance Taylor <iant@google.com>
11377
1b81fb71
ILT
11378 PR 10450
11379 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
11380 .gnu.hash table for a 32-bit target.
11381
8d6d383d
ILT
11382 PR 10450
11383 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
11384 regular and a dynamic object only needs a dynamic symbol table
11385 entry if it is externally visible.
11386
e785ec03
ILT
11387 PR 10450
11388 * i386.cc (class Target_i386): Initialize global_offset_table_ in
11389 constructor. Add global_offset_table_ field.
11390 (Target_i386::got_section): Set global_offset_table_.
11391 (Target_i386::do_finalize_sections): Set global_offset_table_
11392 size.
11393 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
11394 in constructor. Add global_offset_table_ field.
11395 (Target_x86_64::got_section): Set global_offset_table_.
11396 (Target_x86_64::do_finalize_sections): Set global_offset_table_
11397 size.
11398
1a2dff53
ILT
11399 * layout.cc (Layout::Layout): Initialize increase_relro_.
11400 (Layout::get_output_section): Add is_relro, is_last_relro, and
11401 is_first_non_relro parameters. Change all callers.
11402 (Layout::choose_output_section): Likewise.
11403 (Layout::add_output_section_data): Likewise.
11404 (Layout::make_output_section): Likewise.
11405 (Layout::set_segment_offsets): Clear increase_relro when using a
11406 linker script.
11407 * layout.h (class Layout): Add increase_relro method. Add
11408 increase_relro_ field. Update declarations.
11409 * output.cc (Output_section::Output_section): Initialize
11410 is_last_relro_ and is_first_non_relro_.
11411 (Output_segment::add_output_section): Group relro sections is
11412 do_sort is true. Handle is_last_relro and is_first_non_relro.
11413 (Output_segment::maximum_alignment): Remove relro handling.
11414 (Output_segment::set_section_addresses): Add increase_relro
11415 parameter. Change all callers. Add initial alignment to align
11416 relro sections on separate page. Remove old relro handling.
11417 (Output_segment::set_section_list_addresses): Remove in_relro
11418 parameter. Change all callers.
11419 (Output_segment::set_offset): Add increase parameter. Change all
11420 callers. Remove old relro handling.
11421 * output.h (class Output_section): Add new methods: is_last_relro,
11422 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
11423 Add is_last_relro_ and is_first_non_relro_ fields.
11424 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
11425 Create separate .got.plt section. Call increase_relro.
11426 * x86_64.cc (Target_x86_64::got_section): Likewise.
11427 * testsuite/relro_script_test.t: Add .got.plt.
11428
f0ba79e2
ILT
11429 PR 10450
11430 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
11431 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
11432 (Layout::finalize): Call set_dynamic_symbol_size.
11433 (Layout::set_dynamic_symbol_size): New function.
11434 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
11435 set_dynamic_symbol_size.
11436
e8cd95c7
ILT
11437 PR 10450
11438 * output.h (class Output_section): Add is_entsize_zero_ field.
11439 * output.cc (Output_section::Output_section): Initialize
11440 is_entsize_zero_.
11441 (Output_section::set_entsize): If two different entsizes are
11442 requested, force it to zero.
11443 (Output_section::add_input_section): Set flags for .debug_str
11444 before updating section flags. Set entsize.
11445 (Output_section::update_flags_for_input_section): Set SHF_MERGE
11446 and SHF_STRING if all input sections have those flags.
11447
3e1b9a8a
RÁE
114482009-12-29 Rafael Espindola <espindola@google.com>
11449
11450 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
11451 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
11452 reporting.
3e1b9a8a 11453
3dcad376
ST
114542009-12-29 Sriraman Tallam <tmsriram@google.com>
11455
11456 * options.cc (General_options::parse_version): Allow -v to exit
11457 without an error if there is nothing to link.
11458
084e2665
ILT
114592009-12-29 Ian Lance Taylor <iant@google.com>
11460
11461 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
11462 using a version of gcc before 4.1.
11463 * configure: Rebuild.
11464
250acde3
CD
114652009-12-28 Chris Demetriou <cgd@google.com>
11466
11467 * attributes.cc (Output_attributes_section_data::do_write): Use
11468 std::vector::front rather than std::vector::data.
11469
99fff23b
ILT
114702009-12-28 Ian Lance Taylor <iant@google.com>
11471
11472 * symtab.h (class Symbol_table): Add enum Defined.
11473 * resolve.cc (Symbol_table::should_override): Add defined
11474 parameter. Change all callers. Test whether object is NULL
11475 before calling a method on it.
11476 (Symbol_table::report_resolve_problem): Add defined parameter.
11477 Change all callers.
11478 (Symbol_table::should_override_with_special): Likewise.
11479 * symtab.cc (Symbol_table::define_in_output_data): Add defined
11480 parameter. Change all callers.
11481 (Symbol_table::do_define_in_output_data): Likewise.
11482 (Symbol_table::define_in_output_segment): Likewise.
11483 (Symbol_table::do_define_in_output_segment): Likewise.
11484 (Symbol_table::define_as_constant): Likewise.
11485 (Symbol_table::do_define_as_constant): Likewise.
11486 * script.h (class Symbol_assignment): Add is_defsym parameter to
11487 constructor; change all callers.
11488 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
11489 parameter. Change all callers. Add is_defsym_ field.
11490 (class Parser_closure): Add parsing_defsym parameter to
11491 constructor; change all callers. Add parsing_defsym accessor
11492 function. Add parsing_defsym_ field.
11493
556bd683
ILT
114942009-12-28 Ian Lance Taylor <iant@google.com>
11495
11496 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 11497 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 11498
1782c879
ILT
114992009-12-23 Ian Lance Taylor <iant@google.com>
11500
11501 * i386.cc (Target_i386::do_calls_non_split): Recognize
11502 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
11503 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
11504 -fsplit-stack prologue when using %r11.
1782c879 11505
329ca2b1
ST
115062009-12-21 Sriraman Tallam <tmsriram@google.com>
11507
11508 * options.cc (General_options::parse_version): Make -v continue and do
11509 the link like GNU ld does.
11510
d675ff46
RÁE
115112009-12-17 Rafael Avila de Espindola <espindola@google.com>
11512
11513 * Makefile.am (CCFILES): Add timer.cc.
11514 (HFILES): Add timer.h.
11515 * configure.ac: Check for sysconf and times.
11516 * main.cc: include timer.h.
11517 (main): Use Timer instead of get_run_time.
11518 * timer.cc: New.
11519 * timer.h: New.
11520 * workqueue.cc: include timer.h.
11521 (Workqueue::find_and_run_task):
11522 Report user, sys and wall time.
11523 * Makefile.in: Regenerate.
11524 * config.in: Regenerate.
11525 * configure: Regenerate.
11526
d6344fb5
DK
115272009-12-16 Doug Kwan <dougkwan@google.com>
11528
11529 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
11530 sections.
11531 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
11532 relaxed input sections.
11533 * output.cc (Output_section::find_relaxed_input_section): Change
11534 return type to Output_relaxed_input_section pointer. Adjust code
11535 for new type of relaxed_input_section_map_.
11536 * output.h (Output_section::find_relaxed_input_section): Change
11537 return type to Output_relaxed_input_section pointer.
11538 (Output_section::Output_relaxed_input_section_by_input_section_map):
11539 New type.
11540 (Output_section::relaxed_input_section_map_): Change type to
11541 Output_section::Output_relaxed_input_section_by_input_section_map.
11542 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
11543 input section.
11544
0e0d5469
ILT
115452009-12-15 Ian Lance Taylor <iant@google.com>
11546
11547 * layout.cc (Layout::create_shstrtab): Only write out after input
11548 sections if we are compressing debug sections.
11549
0649a889
ILT
115502009-12-15 Ian Lance Taylor <iant@google.com>
11551
11552 * archive.cc (Archive::add_symbols): Only look up a symbol without
11553 a version if there is, in fact, a version.
11554
2ea97941
ILT
115552009-12-14 Ian Lance Taylor <iant@google.com>
11556
11557 Revert -Wshadow changes, all changes from:
11558 2009-12-11 Doug Kwan <dougkwan@google.com>
11559 2009-12-11 Nick Clifton <nickc@redhat.com>
11560 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
11561
b0eec2cc
DK
115622009-12-11 Doug Kwan <dougkwan@google.com>
11563
11564 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
11565 due to -Wshadow.
11566 * attributes.cc (Object_attribute::size): Ditto.
11567 (Attributes_section_data::size): Ditto.
11568 (Attributes_section_data::Attributes_section_data): Ditto.
11569 (Output_attributes_section_data::do_write): Ditto.
11570 * attributes.h (Object_attribute::set_type): Ditto.
11571 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
11572
91d6fa6a
NC
115732009-12-11 Nick Clifton <nickc@redhat.com>
11574
11575 * archive.cc: Fix shadowed variable warnings.
11576 * arm.cc: Likewise.
11577 * compressed_output.cc: Likewise.
11578 * compressed_output.h: Likewise.
11579 * configure: Likewise.
11580 * dwarf_reader.cc: Likewise.
11581 * dynobj.cc: Likewise.
11582 * dynobj.h: Likewise.
11583 * ehframe.cc: Likewise.
11584 * ehframe.h: Likewise.
11585 * errors.cc: Likewise.
11586 * expression.cc: Likewise.
11587 * fileread.cc: Likewise.
11588 * fileread.h: Likewise.
11589 * freebsd.h: Likewise.
11590 * i386.cc: Likewise.
11591 * icf.cc: Likewise.
11592 * incremental.h: Likewise.
11593 * layout.cc: Likewise.
11594 * layout.h: Likewise.
11595 * mapfile.cc: Likewise.
11596 * merge.cc: Likewise.
11597 * merge.h: Likewise.
11598 * object.cc: Likewise.
11599 * object.h: Likewise.
11600 * options.h: Likewise.
11601 * output.cc: Likewise.
11602 * output.h: Likewise.
11603 * parameters.cc: Likewise.
11604 * plugin.cc: Likewise.
11605 * powerpc.cc: Likewise.
11606 * reduced_debug_output.cc: Likewise.
11607 * reduced_debug_output.h: Likewise.
11608 * reloc.cc: Likewise.
11609 * reloc.h: Likewise.
11610 * resolve.cc: Likewise.
11611 * script-sections.cc: Likewise.
11612 * script.cc: Likewise.
11613 * script.h: Likewise.
11614 * sparc.cc: Likewise.
11615 * symtab.cc: Likewise.
11616 * symtab.h: Likewise.
11617 * target-select.cc: Likewise.
11618 * target-select.h: Likewise.
11619 * token.h: Likewise.
11620 * workqueue.cc: Likewise.
11621 * workqueue.h: Likewise.
11622 * x86_64.cc: Likewise.
11623
a0351a69
DK
116242009-12-10 Doug Kwan <dougkwan@google.com>
11625
11626 * arm.cc (attributes.h): New include.
11627 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
11628 (Arm_relobj::~Arm_relobj): Delete object pointed by
11629 attributes_section_data_.
11630 (Arm_relobj::attributes_section_data): New method definition.
11631 (Arm_relobj::attributes_section_data_): New data member declaration.
11632 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
11633 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
11634 attributes_section_data_.
11635 (Arm_dynobj::attributes_section_data): New method definition.
11636 (Arm_dynobj::attributes_section_data_): New data member declaration.
11637 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
11638 initialization value of may_use_blx_ to false.
2e702c99 11639 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
11640 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
11641 object attributes to compute results instead of hard-coding.
11642 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
11643 Target_arm::get_secondary_compatible_arch,
11644 Target_arm::set_secondary_compatible_arch
11645 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11646 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
11647 New method declarations.
11648 (Target_arm::get_aeabi_object_attribute): New method definition.
11649 (Target_arm::attributes_section_data_): New data member declaration.
11650 (read_arm_attributes_section): New template definition.
11651 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
11652 (Arm_dynobj::do_read_symbols): Ditto.
11653 (Target_arm::do_finalize_sections): Merge attributes sections from
11654 input. Check for BLX use after attributes section merging.
11655 Fix __exidx_start and __exidx_end visibility. Create an
11656 .ARM.attributes section if necessary.
11657 (Target_arm::get_secondary_compatible_arch,
11658 Target_arm::set_secondary_compatible_arch,
11659 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11660 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 11661 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
11662 New method definitions.
11663
b59befec
ILT
116642009-12-09 Ian Lance Taylor <iant@google.com>
11665
11666 * plugin.cc (Plugin::load): Don't cast from void* to a function
11667 pointer.
11668
1276bc89
ILT
116692009-12-09 Ian Lance Taylor <iant@google.com>
11670
11671 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
11672 information fields.
11673
2f2de248
L
116742009-12-09 H.J. Lu <hongjiu.lu@intel.com>
11675
11676 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
11677 Replace two_file_shared_1.so with two_file_shared_2.so.
11678 * testsuite/Makefile.in: Regenerated.
11679
4f787271
DK
116802009-12-08 Doug Kwan <dougkwan@google.com>
11681
11682 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
11683 (HFILES): Add attributes.h and int_encoding.h.
11684 * Makefile.in: Regenerate.
11685 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
11686 function definitions to int_encoding.cc
11687 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
11688 prototypes to int_encoding.h
11689 * reduced_debug_output.cc (int_encoding.h): New include.
11690 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
11691 function definitions to int_encoding.cc
11692 (insert_into_vector, read_from_pointer): Move template definitions to
11693 int_encoding.h
11694 * attributes.cc: New file.
11695 * attributes.h: New file.
11696 * int_encoding.cc: New file.
11697 * int_encoding.h: New file.
11698
20b52f1a
RÁE
116992009-12-07 Rafael Avila de Espindola <espindola@google.com>
11700
11701 PR gold/11055
11702 * incremental-dump.cc (dump_incremental_inputs): New.
11703 (main): Use dump_incremental_inputs.
11704
53d7974c
L
117052009-12-07 H.J. Lu <hongjiu.lu@intel.com>
11706
11707 PR gold/10893
11708 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
11709 checking elfcpp::STT_FUNC.
11710 (Target_i386::Relocate::relocate): Likewise.
11711 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
11712
11713 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
11714 symbols from shared libraries into normal FUNC symbols.
11715
11716 * symtab.h (Symbol): Add is_func and use it.
11717
05a352e6
DK
117182009-12-05 Doug Kwan <dougkwan@google.com>
11719
11720 * arm.cc (Target_arm::arm_info): Initialize new fields
11721 attributes_section and attributes_vendor.
11722 * i386.cc (Target_i386::i386_info): Same.
11723 * object.cc (Sized_relobj::do_layout): Skip attribute section.
11724 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
11725 fields attributes_section and attributes_vendor.
53d7974c 11726 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
11727 * target.h (Target::attributes_section, Target::attributes_vendor,
11728 Target::is_attributes_section, Target::attribute_arg_type,
11729 Target::attributes_order): New method definitions.
11730 (Target::Target_info::attributes_section,
11731 Target::Target_info::attributes_vendor): New fields.
11732 (Target::do_attribute_arg_type, Target::do_attributes_order): New
11733 virtual method definitions.
11734 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
11735 attributes_section and attributes_vendor.
11736 * testsuite/testfile.cc (Target_test::test_target_info): Same.
11737
f4e5969c
DK
117382009-12-05 Doug Kwan <dougkwan@google.com>
11739
11740 * arm.cc: Update comments about interworking and stub generation.
11741 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
11742 considered as non-PIC.
11743 (Arm_relocate_functions::base_abs): Fix formatting.
11744 (Arm_relocate_functions::got_prel): Fix comment. Change interface
11745 of function to use GOT entry address instead of offset.
11746 (Target_arm::Scan::global): Issue an error if a symbol would need a
11747 PLT does not get one because it is untyped. Remove code to create
11748 dynamic symbols for relative branches.
11749 (Target_arm::Relocate::relocate: Use 0 instead of false since function
11750 takes unsigned integer instead of boolean.
11751
1abce4a6
L
117522009-12-05 H.J. Lu <hongjiu.lu@intel.com>
11753
11754 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
11755 (two_file_test_LDADD): Likewise.
11756 (common_test_1_LDADD): Likewise.
11757 (exception_test_LDADD) Likewise.
11758 (weak_test_LDADD): Likewise.
11759 (many_sections_test_LDADD): Likewise.
11760 (initpri1_LDADD): Likewise.
11761 (script_test_1_LDADD): Likewise.
11762 (script_test_2_LDADD): Likewise.
11763 (justsyms_LDADD): Likewise.
11764 (binary_test_LDADD): Likewise.
11765 (large_LDADD): Likewise.
11766 * testsuite/Makefile.in: Regenerated.
11767
adcf2816 117682009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 11769
adcf2816
L
11770 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
11771 (Symbol_table::override_with_special): Likewise.
11772 (Symbol_table::add_from_object): Likewise.
11773
28e67f5d
RÁE
117742009-12-04 Rafael Avila de Espindola <espindola@google.com>
11775
11776 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11777 Don't set the data_offset twice.
11778
ae10a101
RÁE
117792009-12-04 Rafael Avila de Espindola <espindola@google.com>
11780
11781 * testsuite/Makefile.in: Regenerate.
11782
f59f41f3
DK
117832009-12-03 Doug Kwan <dougkwan@google.com>
11784
11785 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
11786 (Target_arm::do_finalize_sections): Add parameter for symbol table
11787 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
11788 * i386.cc (Target_i386::do_finalize_sections): Add an additional
11789 parameter for symbol table pointer.
11790 * layout.cc (Layout::finalize): Call Target::finalize_sections with
11791 an additional parameter for a pointer to symbol table.
11792 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
11793 parameter for a symbol table pointer.
11794 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
11795 * target.h (Target::finalize_sections, Target::do_finalize_sections):
11796 Ditto.
11797 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
11798 parameter for a symbol table pointer.
11799
ca55d848
RÁE
118002009-12-03 Rafael Avila de Espindola <espindola@google.com>
11801
11802 * incremental.cc (Incremental_inputs_header)
11803 (Incremental_inputs_header_write, Incremental_inputs_entry)
11804 (Incremental_inputs_entry_write): Move ...
11805 * incremental.h (Incremental_inputs_header)
11806 (Incremental_inputs_header_write, Incremental_inputs_entry)
11807 (Incremental_inputs_entry_write): here.
11808
3aec4f9c
RÁE
118092009-12-02 Rafael Avila de Espindola <espindola@google.com>
11810
11811 * incremental.cc (make_sized_incremental_binary): Set the target.
11812 Error if it is incompatible.
11813 * output.h (Output_file): Add filename method.
11814
9c0ae74d
RÁE
118152009-12-02 Rafael Avila de Espindola <espindola@google.com>
11816
11817 * incremental.cc (Incremental_inputs_entry): Remove unused argument
11818 from the get_* methods.
11819
a45500ae
RÁE
118202009-12-02 Rafael Avila de Espindola <espindola@google.com>
11821
11822 * incremental-dump.cc (main): Check that the offeset of a script is 0.
11823 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11824 Write 0 for the data_offset of scripts.
11825
325e6408
RÁE
118262009-12-02 Rafael Avila de Espindola <espindola@google.com>
11827
11828 * testsuite/Makefile.am: Add the incremental_test.sh test.
11829 * testsuite/incremental_test.sh: New.
11830 * testsuite/incremental_test_1.c: New.
11831 * testsuite/incremental_test_2.c: New.
11832
954c3e2e
RÁE
118332009-12-01 Rafael Avila de Espindola <espindola@google.com>
11834
703d02da 11835 * incremental-dump.cc (main): Fix typos.
954c3e2e 11836
f8086623
RÁE
118372009-11-27 Rafael Avila de Espindola <espindola@google.com>
11838
11839 PR gold/11025
11840 * incremental-dump.cc (main): Use llu to print 64 bit values.
11841
3b0dd6ac
L
118422009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
11843 H.J. Lu <hongjiu.lu@intel.com>
11844
11845 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
11846 $(LIBDL).
11847 (incremental_dump_LDADD): Likewise.
11848 * Makefile.in: Regenerated.
11849
a6d1ef57 118502009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 11851
a6d1ef57
DK
11852 Revert:
11853
11854 2009-11-25 Doug Kwan <dougkwan@google.com>
11855
11856 * arm.cc (Target_arm::Target_arm): Move method definition
11857 outside of class definition. Add code to handle
11858 --target1-rel, --target1-abs and --target2= options.
11859 (Target_arm::get_reloc_reloc_type): Change method to be
11860 non-static and const.
11861 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
11862 New data member declaration.
11863 (Target_arm::Scan::local, Target_arm::Scan::global,
11864 Target_arm::Relocate::relocate,
11865 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11866 Adjust call to Target_arm::get_real_reloc_type.
11867 (Target_arm::get_real_reloc_type): Use command line options
11868 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11869 * options.h (--target1-rel, --target1-abs, --target2): New
11870 ARM-only options.
11871
50aeb7d4
DK
118722009-11-25 Doug Kwan <dougkwan@google.com>
11873
11874 * arm.cc (Target_arm::Target_arm): Move method definition outside of
11875 class definition. Add code to handle --target1-rel, --target1-abs
11876 and --target2= options.
11877 (Target_arm::get_reloc_reloc_type): Change method to be non-static
11878 and const.
11879 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
11880 member declaration.
11881 (Target_arm::Scan::local, Target_arm::Scan::global,
11882 Target_arm::Relocate::relocate,
11883 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
11884 call to Target_arm::get_real_reloc_type.
11885 (Target_arm::get_real_reloc_type): Use command line options to
11886 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11887 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
11888 options.
11889
51938283
DK
118902009-11-25 Doug Kwan <dougkwan@google.com>
11891
11892 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
11893 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
11894 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
11895 formatting.
11896 (Arm_relocate_functions::thm_call): Replace body with a call to
11897 Arm_relocate_functions::thumb_branch_common.
11898 (Arm_relocate_functions::thm_jump24,
11899 Arm_relocate_functions::thm_xpc22): New method definitions.
11900 (Arm_relocate_functions::thumb_branch_common): New method definition.
11901 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
11902 operator.
11903 (Target_arm::Relocate::relocate): Adjust call to thm_call.
11904 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
11905
e2b8f3c4
RÁE
119062009-11-24 Rafael Avila de Espindola <espindola@google.com>
11907
11908 * Makefile.am: Build incremental-dump
11909 * Makefile.in: Regenerate.
11910 * incremental-dump.cc: New.
11911 * incremental.cc (Incremental_inputs_header_data,
11912 Incremental_inputs_entry_data): Move to incremental.h
11913 * incremental.h: (Incremental_inputs_header_data,
11914 Incremental_inputs_entry_data): Move from incremental.cc
11915
bcba9aec
RÁE
119162009-11-24 Rafael Avila de Espindola <espindola@google.com>
11917
11918 * incremental.cc (Incremental_inputs_header,
11919 Incremental_inputs_header_write, Incremental_inputs_entry,
11920 Incremental_inputs_entry_write): Add a typedef with the data type.
11921
7c3afe08
RÁE
119222009-11-24 Rafael Avila de Espindola <espindola@google.com>
11923
11924 * incremental.cc (Incremental_inputs_header,
11925 Incremental_inputs_header_write, Incremental_inputs_entry,
11926 Incremental_inputs_entry_write): Update comment about which
11927 type has the filed descriptions.
11928
d204b6e9
DK
119292009-11-15 Doug Kwan <dougkwan@google.com>
11930
11931 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
11932 (Arm_relocate_functions::arm_branch_common): Change method defintion
11933 in class definition to a method declaration and update list of formal
11934 parameters.
11935 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
11936 Arm_relocation_functions::jump24): Adjust call to
11937 Arm_relocate_functions::arm_branch_common. Update list of formal
11938 parameters.
11939 (Arm_relocate_functions::xpc25): New method definition.
11940 (Arm_relocate_functions::arm_branch_common): Move method defintion
11941 out from class definition. Use stubs for mode-switching and extending
11942 branch ranges.
11943 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
11944 specially. Change code to enable use of stubs in ARM branches.
11945
43d12afe
DK
119462009-11-10 Doug Kwan <dougkwan@google.com>
11947
11948 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
11949 in method declaration.
11950 (Target_arm::relocate_stub): New method declaration.
11951 (Target_arm::default_target): Change to return a pointer instead of
11952 a const reference.
11953 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
11954 Target_arm::default_target.
11955 (Arm_Relobj::do_relocate_sections): Remove options paramater in
11956 method definition.
11957 (Target_arm::relocate_section): Adjust view.
11958 (Target_arm::relocate_stub): New method definition.
11959
ac33a407
DK
119602009-11-10 Doug Kwan <dougkwan@google.com>
11961
11962 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
11963 a format warning.
11964 * incremental.cc (open_incremental_binary): Initialized local
11965 variables to avoid warnings.
11966 * object.cc (make_elf_object): Ditto.
11967 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
11968 a format warning.
e1df38aa 11969
88ee28e9
L
11970009-11-09 H.J. Lu <hongjiu.lu@intel.com>
11971
11972 PR gold/10930
11973 * testsuite/plugin_test.c: Include "config.h".
11974
2daedcd6
DK
119752009-11-09 Doug Kwan <dougkwan@google.com>
11976
11977 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
11978 (arm_symbol_value): Remove.
11979 (Arm_relocate_functions::arm_branch_common,
11980 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
11981 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
11982 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
11983 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
11984 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
11985 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
11986 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
11987 Arm_relocate_functions::thm_mobw_abs_nc,
11988 Arm_relocate_functions::thm_mov_abs,
11989 Arm_relocate_functions::movw_prel_nc,
11990 Arm_relocate_functions::thm_movt_abs,
11991 Arm_relocate_functions::movt_prel,
11992 Arm_relocate_functions::thm_movw_prel_nc,
11993 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
11994 (Target_arm::Relocate::relocate): Only decompose address into two
11995 parts if relocation type uses the thumb-bit and pass the actual
11996 bit instead of a flag indicating that the thumb-bit is used. Adjust
11997 calls to methods in Arm_relocate_functions for this change.
11998
1276bc89 119992009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
12000
12001 PR 10925
12002 * reloc.cc: Instantiate
12003 Sized_relobj::initialize_input_to_output_maps and
12004 Sized_relobj:free_input_to_output_maps.
12005
e53ad1b5
ILT
120062009-11-06 Ian Lance Taylor <iant@google.com>
12007
12008 PR 10876
12009 * defstd.cc (in_segment): Set only_if_ref true for "end".
12010
eb44217c
DK
120112009-11-06 Doug Kwan <dougkwan@google.com>
12012
12013 * arm.cc (class Reloc_stub): Correct a comment.
12014 (Target_arm::Target_arm): Initialize arm_input_section_map_.
12015 (Target_arm::scan_section_for_stubs): New method declaration.
12016 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
12017 Change methods from private to protected.
12018 (Target_arm::do_may_relax): New method definition.
12019 (Target_arm::do_relax, Target_arm::group_sections,
12020 Target_arm::scan_reloc_for_stub,
12021 Target_arm::scan_reloc_section_for_stubs): New method declarations.
12022 (Target_arm::arm_input_section_map_): New data member declaration.
12023 (Target_arm::scan_reloc_for_stub,
12024 Target_arm::scan_reloc_section_for_stubs,
12025 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
12026 Target_arm::do_relax): New method definitions.
12027
5d329b7d
ILT
120282009-11-06 Mikolaj Zalewski <mikolaj@google.com>
12029
12030 * configure.ac: Check for (struct stat)::st_mtim
12031 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
12032 * config.in: Regenerate.
12033 * configure: Regenerate.
12034
96a0d71b
ILT
120352009-11-05 Ian Lance Taylor <iant@google.com>
12036
12037 PR 10910
12038 * output.cc (Output_segment::add_output_section): Add missing
12039 return statement.
12040
594c8e5e
ILT
120412009-11-04 Ian Lance Taylor <iant@google.com>
12042
12043 PR 10880
12044 * object.h (class Object): Add is_needed and set_is_needed
12045 methods. Add is_needed_ field. Make bool fields into bitfields.
12046 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
12047 defined in a dynamic object and referenced by a regular object,
12048 set is_needed for the dynamic object.
12049 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
12050 if the file is marked with as_needed and it is not needed.
12051
22b127cc
ILT
120522009-11-04 Ian Lance Taylor <iant@google.com>
12053
12054 PR 10887
12055 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
12056 tags if data is discarded by linker script.
12057 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12058 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12059 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12060 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12061
f5c870d2
ILT
120622009-11-04 Ian Lance Taylor <iant@google.com>
12063
12064 * layout.cc (Layout::get_output_section): Add is_interp and
12065 is_dynamic_linker_section parameters. Change all callers.
12066 (Layout::choose_output_section): Likewise.
12067 (Layout::make_output_section): Likewise.
12068 (Layout::add_output_section_data): Add is_dynamic_linker_section
12069 parameter. Change all callers.
12070 * layout.h (class Layout): Update declarations.
12071 * output.h (class Output_section): Add is_interp, set_is_interp,
12072 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
12073 Add is_interp_, is_dynamic_linker_section_ fields. Change
12074 generate_code_fills_at_write_ to a bitfield.
12075 * output.cc (Output_section::Output_sections): Initialize new
12076 fields.
12077 (Output_segment::add_output_section): Add do_sort parameter.
12078 Change all callers.
12079
1ae4d23b
ILT
120802009-11-03 Ian Lance Taylor <iant@google.com>
12081
12082 PR 10860
12083 * options.h (class General_options): Add --warn-common.
12084 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
12085 merging two common symbols.
12086 (Symbol_table::should_override): Handle --warn-common when merging
12087 a common symbol with a defined symbol. Use report_resolve_problem
12088 for multiple definitions.
12089 (Symbol_table::report_resolve_problem): New function.
12090 * symtab.h (class Symbol_table): Declare report_resolve_problem.
12091
55da9579
DK
120922009-11-03 Doug Kwan <dougkwan@google.com>
12093
12094 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
12095 stub_factory_.
12096 (Target_arm::stub_factory): New method definition.
12097 (Target_arm::new_arm_input_section,
12098 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
12099 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 12100 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
12101 New type definitions.
12102 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
12103 member declarations.
12104 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
12105 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
12106 New method definitions.
12107
37a9ac43
ILT
121082009-11-03 Ian Lance Taylor <iant@google.com>
12109
12110 * options.h (class General_options): Add --warn_constructors.
12111
b3d6a3d4
ILT
121122009-11-03 Ian Lance Taylor <iant@google.com>
12113
12114 PR 10893
12115 * defstd.cc (in_section): Add entries for __rel_iplt_start,
12116 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
12117
934b01dd
ILT
121182009-11-03 Ian Lance Taylor <iant@google.com>
12119
12120 PR 10895
12121 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
12122 --msgid-bugs-address.
12123 (install-pdf): New target.
12124 (install-data_yes): Look up one directory to find mkinstalldirs.
12125
03c1939b
L
121262009-11-03 H.J. Lu <hongjiu.lu@intel.com>
12127
12128 * po/Make-in (.po.gmo): Don't generate .gmo files in source
12129 tree.
12130
ebd95253
DK
121312009-10-30 Doug Kwan <dougkwan@google.com>
12132
12133 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
12134
e9bbb538
DK
121352009-10-30 Doug Kwan <dougkwan@google.com>
12136
12137 * arm.cc (Stub_addend_reader): New struct template definition
12138 and partial specializations.
12139 (Stub_addend_reader::operator()): New method definition for a
12140 partially specialized template.
12141
d5b40221
DK
121422009-10-30 Doug Kwan <dougkwan@google.com>
12143
12144 * arm.cc (Arm_relobj::processor_specific_flags): New method
12145 definition.
12146 (Arm_relobj::do_read_symbols): New method declaration.
12147 (Arm_relobj::processor_specific_flags_): New data member declaration.
12148 (Arm_dynobj): New class definition.
12149 (Target_arm::do_finalize_sections): Add input_objects parameter.
12150 (Target_arm::do_adjust_elf_header): New method declaration.
12151 (Target_arm::are_eabi_versions_compatible,
12152 (Target_arm::merge_processor_specific_flags): New method declaration.
12153 (Target_arm::do_make_elf_object): New overloaded method definitions
12154 and declaration.
12155 (Arm_relobj::do_read_symbols): New method definition.
12156 (Arm_dynobj::do_read_symbols): Ditto.
12157 (Target_arm::do_finalize_sections): Add input_objects parameters.
12158 Merge processor-specific flags from all input objects.
12159 (Target_arm::are_eabi_versions_compatible,
12160 Target_arm::merge_processor_specific_flags,
12161 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
12162 New method definitions.
12163 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
12164 Input_objects pointer type parameter.
12165 * layout.cc (Layout::finalize): Pass input objects to target's.
12166 finalize_sections function.
12167 * output.cc (Output_file_header::do_sized_write): Set ELF file
12168 header's processor-specific flags.
12169 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
12170 Input_objects pointer type parameter.
12171 * sparc.cc (Target_sparc::do_finalize_sections): Same.
12172 * target.h (Input_objects): New forward class declaration.
12173 (Target::processor_specific_flags,
12174 Target::are_processor_specific_flags_sect): New method definitions.
12175 (Target::finalize_sections): Add input_objects parameter.
12176 (Target::Target): Initialize processor_specific_flags_ and
12177 are_processor_specific_flags_set_.
12178 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
12179 parameter.
12180 (Target::set_processor_specific_flags): New method definition.
12181 (Target::processor_specific_flags_,
12182 Target::are_processor_specific_flags_set_): New data member
12183 declarations.
12184 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
12185 Input_objects pointer type parameter.
12186
ebabffbd
DK
121872009-10-30 Doug Kwan <dougkwan@google.com>
12188
12189 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
12190
ad0f2072
ILT
121912009-10-28 Ian Lance Taylor <iant@google.com>
12192
12193 * object.h (class Relobj): Drop options parameter from
12194 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
12195 do_scan_relocs, do_relocate. Change all callers.
12196 (class Sized_relobj): Drop options parameters from
12197 do_gc_process_relocs, do_scan_relocs, do_relocate,
12198 do_relocate_sections, relocate_sections, emit_relocs_scan,
12199 emit_relocs_scan_reltype. Change all callers.
12200 (struct Relocate_info): Remove options field and all references to
12201 it.
12202 * reloc.h (class Read_relocs): Remove options constructor
12203 parameter and options_ field. Change all callers.
12204 (class Gc_process_relocs, class Scan_relocs): Likewise.
12205 (class Relocate_task): Likewise.
12206 * target-reloc.h (scan_relocs): Remove options parameter. Change
12207 all callers.
12208 (scan_relocatable_relocs): Likewise.
12209 * target.h (class Sized_target): Remove options parameter from
12210 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
12211 all callers.
12212 * gc.h (gc_process_relocs): Remove options parameter. Change all
12213 callers.
12214 * arm.cc: Update functions to remove options parameters.
12215 * i386.cc: Likewise.
12216 * powerpc.cc: Likewise.
12217 * sparc.cc: Likewise.
12218 * x86_64.cc: Likewise.
12219 * testsuite/testfile.cc: Likewise.
12220
8ffa3667
DK
122212009-10-28 Doug Kwan <dougkwan@google.com>
12222
12223 * arm.cc (Arm_relobj): New class definition.
e1df38aa 12224 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
12225 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
12226 New method definitions.
12227
40f36857
CC
122282009-10-28 Cary Coutant <ccoutant@google.com>
12229
12230 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
12231 (Plugin::cleanup_done_): New member.
12232 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
12233 (Plugin_manager::cleanup_done_): Remove.
12234 (Plugin_manager::add_input_file): Edit error message.
12235 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
12236 (Plugin_manager::cleanup): Remove use of cleanup_done_.
12237
2c849493
ILT
122382009-10-27 Mikolaj Zalewski <mikolajz@google.com>
12239
12240 * fileread.cc: (File_read::View::~View): Use the new
12241 data_ownership_ filed.
12242 (File_read::~File_read): Dispose the new whole_file_view_.
12243 (File_read::open): Mmap the whole file if needed.
12244 (File_read::open): Use whole_file_view_ instead of contents_.
12245 (File_read::find_view): Use whole_file_view_ if applicable.
12246 (File_read::do_read): Use whole_file_view_ instead of contents_.
12247 (File_read::make_view): Use whole_file_view_ instead of contents_,
12248 update File_read::View::View call.
12249 (File_read::find_or_make_view): Update File_read::View::View
12250 call.
12251 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
12252 remove contents_
12253 (File_read::View::Data_ownership): New enum.
12254 (File_read::View::View): Replace bool mapped_ with Data_ownership
12255 argument.
12256 (File_read::View::mapped_): Remove (replaced by data_ownership_).
12257 (File_read::View::data_ownership_): New field.
12258 (File_read::contents_): Remove (replaced by whole_file_view_).
12259 (File_read::whole_file_view_): New field.
12260 * options.h (class General_options): Add --keep-files-mapped.
12261
24998053
CC
122622009-10-27 Cary Coutant <ccoutant@google.com>
12263
12264 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
12265 * testsuite/Makefile.am (plugin_test_5): New test case.
12266 * testsuite/Makefile.in: Regenerate.
12267
72adc4fa
DK
122682009-10-25 Doug Kwan <dougkwan@google.com>
12269
12270 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
12271 from private to protected to allow access by child class.
12272 (Sized_relobj::do_relocate_sections): New method declaration.
12273 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 12274 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
12275 Sized_relobj::relocate_sections. Instantiate template explicitly
12276 for different target sizes and endianity.
12277
07f508a2
DK
122782009-10-24 Doug Kwan <dougkwan@google.com>
12279
12280 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
12281 (Arm_input_section::as_arm_input_section): New method.
12282 (Arm_output_section): New class definition.
12283 (Arm_output_section::create_stub_group,
12284 Arm_output_section::group_sections): New method definitions.
12285
10ad9fe5
DK
122862009-10-22 Doug Kwan <dougkwan@google.com>
12287
12288 * arm.cc (Arm_input_section): New class definition.
12289 (Arm_input_section::init, Arm_input_section:do_write,
12290 Arm_input_section::set_final_data_size,
12291 Arm_input_section::do_reset_address_and_file_offset): New method
12292 definitions.
12293
56ee5e00
DK
122942009-10-21 Doug Kwan <dougkwan@google.com>
12295
12296 * arm.cc (Stub_table, Arm_input_section): New forward class
12297 declarations.
12298 (Stub_table): New class defintion.
12299 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
12300 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
12301 New method definition.
12302
b569affa
DK
123032009-10-21 Doug Kwan <dougkwan@google.com>
12304
12305 * arm.cc: Update copyright comments.
12306 (Target_arm): New forward class template declaration.
12307 (Arm_address): New type.
12308 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
12309 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
12310 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
12311 constants.
12312 (Insn_template): Same.
12313 (DEF_STUBS): New macro.
12314 (Stub_type): New enum type.
12315 (Stub_template): New class definition.
12316 (Stub): Same.
12317 (Reloc_stub): Same.
12318 (Stub_factory): Same.
12319 (Target_arm::Target_arm): Initialize may_use_blx_ and
12320 should_force_pic_veneer_.
12321 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
12322 Target_arm::should_force_pic_veneer,
12323 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
12324 Target_arm::using_thumb_only, Target_arm:;default_target): New
12325 method defintions.
12326 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
12327 New data member declarations.
12328 (Insn_template::size, Insn_template::alignment): New method defintions.
12329 (Stub_template::Stub_template): New method definition.
12330 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
12331 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
12332 (Stub_factory::Stub_factory): New method definition.
12333 * gold.h (string_hash): New template.
12334 * output.h (Input_section_specifier::hash_value): Use
12335 gold::string_hash.
12336 (Input_section_specifier::string_hash): Remove.
12337 * stringpool.cc (Stringpool_template::string_hash): Use
12338 gold::string_hash.
12339
6c172549
DK
123402009-10-20 Doug Kwan <dougkwan@google.com>
12341
12342 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
12343 symbols of relaxed input sections.
12344 * output.h (Output_section::find_relaxed_input_section): Make
12345 method public.
12346
c5617f2f
DK
123472009-10-16 Doug Kwan <dougkwan@google.com>
12348
12349 * dynobj.cc (Versions::Versions): Initialize version_script_.
12350 Only insert base version symbol definition for a shared object
12351 if version script defines any version versions.
12352 (Versions::define_base_version): New method definition.
12353 (Versions::add_def): Check that base version is not needed.
12354 (Versions::add_need): Define base version lazily.
12355 * dynobj.h (Versions::define_base_version): New method declaration.
12356 (Versions::needs_base_version_): New data member declaration.
12357 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
12358 (check_DATA): Add no_version_test.stdout.
12359 (libno_version_test.so, no_version_test.o no_version_test.stdout):
12360 New make rules.
12361 * testsuite/Makefile.in: Regenerate.
12362 * testsuite/no_version_test.c: New file.
12363 * testsuite/no_version_test.sh: Ditto.
12364
3c12dcdb
DK
123652009-10-16 Doug Kwan <dougkwan@google.com>
12366
12367 * expression.cc (class Segment_start_expression): New class definition.
12368 (Segment_start_expression::value): New method definition.
12369 (script_exp_function_segment_start): Return a new
12370 Segment_start_expression.
12371 * gold/script-c.h (script_saw_segment_start_expression): New function
12372 prototype.
12373 * script-sections.cc (Script_sections::Script_sections): Initialize
12374 SAW_SEGMENT_START_EXPRESSION_ to false.
12375 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
12376 and -Tbbs options to specify section addresses if given in
12377 command line and no SEGMENT_START expression is seen in a script.
12378 * script-sections.h (Script_sections::saw_segment_start_expression,
12379 Script_sections::set_saw_segment_start_expression): New method
12380 definition.
12381 (Script_sections::saw_segment_start_expression_): New data member
12382 declaration.
12383 * script.cc (script_saw_segment_start_expression): New function.
12384 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
12385 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
12386 script_test_7.sh and script_test_8.sh.
12387 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
12388 script_test_8.stdout.
12389 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
12390 (script_test_6, script_test_6.stdout, script_test_7,
12391 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
12392 * Makefile.in: Regenerate.
12393 * testsuite/script_test_6.sh: New file.
12394 * testsuite/script_test_6.t: Same.
12395 * testsuite/script_test_7.sh: Same.
12396 * testsuite/script_test_7.t: Same.
12397 * testsuite/script_test_8.sh: Same.
12398
64b1ae37
DK
123992009-10-16 Doug Kwan <dougkwan@google.com>
12400
12401 * output.cc (Output_segment::set_section_list_address): Cast
12402 expressions to unsigned long long type to avoid format warnings.
12403
661be1e2
ILT
124042009-10-15 Ian Lance Taylor <iant@google.com>
12405
12edd763 12406 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 12407 dot assignment to script_sections_.
12edd763
ILT
12408 * script-sections.cc (Script_sections::add_dot_assignment):
12409 Initialize if necessary.
12410
68b6574b
ILT
12411 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
12412 program headers with no load segment if there is a linker script.
12413
661be1e2
ILT
12414 * layout.cc (Layout::set_segment_offsets): Align the file offset
12415 to the segment aligment for -N or -n with no load segment.
12416 * output.cc (Output_segment::add_output_section): Don't crash if
12417 the first section is a TLS section.
12418 (Output_segment::set_section_list_addresses): Print an error
12419 message if the address moves backward in a linker script.
12420 * script-sections.cc
12421 (Output_section_element_input::set_section_addresses): Don't
12422 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
12423 (Orphan_output_section::set_section_addresses): Likewise.
12424
f15f61a7
DK
124252009-10-15 Doug Kwan <dougkwan@google.com>
12426
12427 * layout.cc (Layout::finish_dynamic_section): Generate tags
12428 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
12429 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
12430 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
12431
82bb573a
ILT
124322009-10-14 Ian Lance Taylor <iant@google.com>
12433
12434 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
12435 fields.
12436 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
12437 data_shdr fields of relinfo.
12438 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
12439 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
12440 R_386_TLS_LDO_32, adjust based on section flags.
12441 (Target_i386::Relocate::fix_up_ldo): Remove.
12442
374ad285
ILT
124432009-10-13 Ian Lance Taylor <iant@google.com>
12444
12445 Add support for -pie.
12446 * options.h (class General_options): Add -pie and
12447 --pic-executable.
12448 (General_options::output_is_position_independent): Test -pie.
12449 (General_options::output_is_executable): Return true if not shared
12450 and not relocatable.
12451 (General_options::output_is_pie): Remove.
12452 * options.cc (General_options::finalize): Reject incompatible uses
12453 of -pie.
12454 * gold.cc (queue_middle_tasks): A -pie link is not static.
12455 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
12456 * symtab.cc (Symbol::final_value_is_known): Return false if
12457 output_is_position_independent.
12458 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
12459 output_is_position_independent.
12460 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
12461 output_is_position_independent.
12462 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
12463 output_is_position_independent.
12464 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
12465 two_file_pie_test.
12466 (basic_pie_test.o, basic_pie_test): New targets.
12467 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
12468 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
12469 (two_file_pie_test): New target.
12470 * testsuite/Makefile.in: Rebuild.
12471 * README: Remove note saying that -pie is not supported.
12472
c6585162
ILT
124732009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
12474
12475 * options.h (class General_options): Add -init and -fini.
12476 * layout.cc (Layout::finish_dynamic_section): Emit
12477 given init and fini functions.
12478
032ce4e9
ST
124792009-10-13 Sriraman Tallam <tmsriram@google.com>
12480
12481 * gc.h (gc_process_relocs): Check if icf is enabled using new
12482 function.
12483 * gold.cc (queue_initial_tasks): Likewise.
12484 (queue_middle_tasks): Likewise.
12485 * object.cc (do_layout): Likewise.
12486 * symtab.cc (is_section_folded): Likewise.
12487 * main.cc (main): Likewise.
12488 * reloc.cc (Read_relocs::run): Likewise.
12489 (Sized_relobj::do_scan_relocs): Likewise.
12490 * icf.cc (is_function_ctor_or_dtor): New function.
12491 (Icf::find_identical_sections): Check if function is ctor or dtor when
12492 safe icf is chosen.
12493 * options.h (General_options::icf): Change option to be an enum.
12494 (Icf_status): New enum.
12495 (icf_enabled): New method.
12496 (icf_safe_folding): New method.
12497 (set_icf_status): New method.
12498 (icf_status_): New variable.
12499 * (options.cc) (General_options::finalize): Set icf_status_.
12500 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
12501 icf_test and icf_keep_unique_test to use the --icf enum flag.
12502 * testsuite/icf_safe_test.sh: New file.
e1df38aa 12503 * testsuite/icf_safe_test.cc: New file.
032ce4e9 12504
f345227a
ST
125052009-10-12 Sriraman Tallam <tmsriram@google.com>
12506
12507 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
12508 includes to gc.h and icf.h.
12509 * arm.cc: Include gc.h.
12510 * gold.cc: Likewise.
12511 * i386.cc: Likewise.
12512 * powerpc.cc: Likewise.
12513 * sparc.cc: Likewise.
12514 * x86_64.cc: Likewise.
12515 * gc.h: Include icf.h.
12516
1c7814ed
ILT
125172009-10-11 Ian Lance Taylor <iant@google.com>
12518
12519 * plugin.cc: Include "gold.h" before other header files.
12520
ae3b5189
CD
125212009-10-10 Chris Demetriou <cgd@google.com>
12522
12523 * options.h (Input_file_argument::Input_file_type): New enum.
12524 (Input_file_argument::is_lib_): Replace with...
12525 (Input_file_argument::type_): New member.
12526 (Input_file_argument::Input_file_argument): Take Input_file_type
12527 'type' rather than boolean 'is_lib' as second argument.
12528 (Input_file_argument::is_lib): Use type_.
12529 (Input_file_argument::is_searched_file): New function.
12530 (Input_file_argument::may_need_search): Handle is_searched_file.
12531 * options.cc (General_options::parse_library): Support -l:filename.
12532 (General_options::parse_just_symbols): Update for Input_file_argument
12533 changes.
12534 (Command_line::process): Likewise.
12535 * archive.cc (Archive::get_file_and_offset): Likewise.
12536 * plugin.cc (Plugin_manager::release_input_file): Likewise.
12537 * script.cc (read_script_file, script_add_file): Likewise.
12538 * fileread.cc (Input_file::Input_file): Likewise.
12539 (Input_file::will_search_for): Handle is_searched_file.
12540 (Input_file::open): Likewise.
12541 * readsyms.cc (Read_symbols::get_name): Likewise.
12542 * testsuite/Makefile.am (searched_file_test): New test.
12543 * testsuite/Makefile.in: Regenerate.
12544 * testsuite/searched_file_test.cc: New file.
12545 * testsuite/searched_file_test_lib.cc: New file.
12546
f3048a1d
ILT
125472009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12548 Ian Lance Taylor <iant@google.com>
12549
12550 * descriptor.cc: Include <cstdio> and "binary-io.h".
12551 (Descriptors::open): Open the files in binary mode always.
12552 * script.cc (Lex::get_token): Treat \r as whitespace.
12553
d4780e57
ILT
125542009-10-09 Ian Lance Taylor <iant@google.com>
12555
12556 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
12557
d9a893b8
ILT
125582009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12559 Ian Lance Taylor <iant@google.com>
12560
12561 * configure.ac: Check for readv function also.
12562 * fileread.cc (readv): Define if not HAVE_READV.
12563 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
12564 does not exist.
12565 * config.in: Regenerate.
12566 * configure: Regenerate.
12567
c0a62865
DK
125682009-10-09 Doug Kwan <dougkwan@google.com>
12569
12570 * layout.cc (Layout::make_output_section): Call target hook to make
12571 ordinary output section.
12572 (Layout::finalize): Adjust parameter list of call the
12573 Target::may_relax().
12574 * layout.h (class Layout::section_list): New method.
12575 * merge.h (Output_merge_base::entsize): Change visibility to public.
12576 (Output_merge_base::is_string, Output_merge_base::do_is_string):
12577 New methods.
12578 (Output_merge_string::do_is_string): New method.
12579 * object.cc (Sized_relobj::do_setup): renamed from
12580 Sized_relobj::set_up.
12581 * object.h (Sized_relobj::adjust_shndx,
12582 Sized_relobj::initializ_input_to_output_maps,
12583 Sized_relobj::free_input_to_output_maps): Change visibilities to
12584 protected.
12585 (Sized_relobj::setup): Virtualize.
12586 (Sized_relobj::do_setup): New method declaration.
12587 (Sized_relobj::invalidate_section_offset,
12588 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
12589 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
12590 * options.cc (parse_int): New function.
12591 * options.h (parse_int): New declaration.
12592 (DEFINE_int): New macro.
12593 (stub_group_size): New option.
12594 * output.cc (Output_section::Output_section): Initialize memebers
12595 merge_section_map_, merge_section_by_properties_map_,
12596 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
12597 (Output_section::add_input_section): Handled deferred code-fill
12598 generation and remove an old comment.
12599 (Output_section::add_relaxed_input_section): New method definition.
12600 (Output_section::add_merge_input_section): Use merge section by
12601 properties map to speed to search. Update merge section maps
12602 as appropriate.
12603 (Output_section::build_relaxation_map): New method definition.
12604 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
12605 Same.
12606 (Output_section::relax_input_section): Renamed to
12607 Output_section::convert_input_sections_to_relaxed_sections and change
12608 interface to take a vector of pointers to relaxed sections.
12609 (Output_section::find_merge_section,
12610 Output_section::find_relaxed_input_section): New method definitions.
12611 (Output_section::is_input_address_mapped,
12612 Output_section::output_offset, Output_section::output_address):
12613 Use output section data maps to speed up searching.
12614 (Output_section::find_starting_output_address): Add comments.
12615 (Output_section::do_write,
12616 Output_section::write_to_postprocessing_buffer): Do code-fill
12617 generation as appropriate.
12618 (Output_section::get_input_sections): Invalidate relaxed input section
12619 map.
12620 (Output_section::restore_states): Adjust type of checkpoint .
12621 Invalidate relaxed input section map.
12622 * output.h (Output_merge_base): New class declaration.
12623 (Input_section_specifier): New class defintion.
12624 (class Output_relaxed_input_section) Change base class to
12625 Output_section_data_build.
12626 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
12627 base class initializer.
12628 (Output_section::add_relaxed_input_section): New method declaration.
12629 (Output_section::Input_section): Change visibility to protected.
2e702c99 12630 (Output_section::Input_section::relobj,
c0a62865
DK
12631 Output_section::Input_section::shndx): Handle relaxed input sections.
12632 Output_section::input_sections) Change visibility to protected. Also
12633 define overload to return a non-const pointer.
12634 (Output_section::Merge_section_properties): New class defintion.
12635 (Output_section::Merge_section_by_properties_map,
12636 Output_section::Output_section_data_by_input_section_map,
12637 Output_section::Relaxation_map): New types.
12638 (Output_section::relax_input_section): Rename method to
12639 Output_section::convert_input_sections_to_relaxed_sections and change
12640 interface to take a vector of relaxed section pointers.
12641 (Output_section::find_merge_section,
12642 Output_section::find_relaxed_input_section,
12643 Output_section::build_relaxation_map,
12644 Output_section::convert_input_sections_in_list_to_relaxed_sections):
12645 New method declarations.
12646 (Output_section::merge_section_map_
12647 Output_section::merge_section_by_properties_map_,
12648 Output_section::relaxed_input_section_map_,
12649 Output_section::is_relaxed_input_section_map_valid_,
12650 Output_section::generate_code_fills_at_write_): New data members.
12651 * script-sections.cc
12652 (Output_section_element_input::set_section_addresses): Call
12653 current_data_size and addralign methods of relaxed input sections.
12654 (Orphan_output_section::set_section_addresses): Call current_data_size
12655 and addralign methods of relaxed input sections.
12656 * symtab.cc (Symbol_table::compute_final_value): Extract template
12657 from the body of Symbol_table::sized_finalize_symbol.
12658 (Symbol_table::sized_finalized_symbol): Call
12659 Symbol_table::compute_final_value.
12660 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
12661 (Symbol_table::compute_final_value): New templated method declaration.
12662 * target.cc (Target::do_make_output_section): New method defintion.
12663 * target.h (Target::make_output_section): New method declaration.
12664 (Target::relax): Add more parameters for input objects, symbol table
12665 and layout. Adjust call to do_relax.
12666 (Target::do_make_output_section): New method declaration.
12667 (Target::do_relax): Add parameters for input objects, symbol table
12668 and layout.
12669
d446d6c4
ILT
126702009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12671
12672 * pread.c: Include stdio.h.
12673
bc06c745
ILT
126742009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12675
12676 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
12677 defined.
12678
75aea3d0
ILT
126792009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12680
12681 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
12682 Change read_shndx type to unsigned int.
12683 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12684 int.
12685 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12686 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
12687 Change read_shndx type to unsigned int.
12688 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12689 int.
12690 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12691 * layout.cc (Layout::create_symtab_sections): Cast the result of
12692 local_symcount * symsize to off_t in the gold_assert.
12693
be8fcb75
ILT
126942009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12695
12696 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
12697 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
12698 R_ARM_BASE_ABS.
12699 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
12700 (Arm_relocate_functions::thm_abs5): New function.
12701 (Arm_relocate_functions::abs12): New function.
12702 (Arm_relocate_functions::abs16): New function.
12703 (Arm_relocate_functions::base_abs): New function.
12704 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
12705 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
12706 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
12707 R_ARM_BASE_ABS.
12708 (Scan::global): Likewise.
12709 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
12710 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
12711 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
12712 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
12713 R_ARM_BASE_ABS.
12714
c2a122b6
ILT
127152009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12716
12717 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
12718 (Arm_relocate_functions::movt_prel): New function.
12719 (Arm_relocate_functions::thm_movw_prel_nc): New function.
12720 (Arm_relocate_functions::thm_movt_prel): New function.
12721 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
12722 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
12723 (Scan::global, Relocate::relocate): Likewise.
12724 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12725
c4aa1e2d
ILT
127262009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12727
12728 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
12729 Incremental_checker.
12730 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
12731 unsigned int.
12732 (class Incremental_inputs_header): New class.
12733 (Incremental_inputs_header_writer): Edit comment.
12734 (Incremental_inputs_entry): New class.
12735 (Incremental_inputs_entry_writer): Edit comment.
12736 (Sized_incremental_binary::do_find_incremental_inputs_section):
12737 Add *strtab_shndx parameter, fill it.
12738 (Sized_incremental_binary::do_check_inputs): New method.
12739 (Incremental_checker::can_incrementally_link_output_file): Use
12740 Sized_incremental_binary::check_inputs.
12741 (Incremental_inputs::report_command_line): Save command line in
12742 command_line_.
12743 * incremental.h:
12744 (Incremental_binary::find_incremental_inputs_section): New
12745 method.
12746 (Incremental_binary::do_find_incremental_inputs_section): Add
12747 strtab_shndx parameter.
12748 (Incremental_binary::do_check_inputs): New pure virtual method.
12749 (Sized_incremental_binary::do_check_inputs): Declare.
12750 (Incremental_checker::Incremental_checker): Add incremental_inputs
12751 parameter, use it to initialize incremental_inputs_.
12752 (Incremental_checker::incremental_inputs_): New field.
12753 (Incremental_checker::command_line): New method.
12754 (Incremental_checker::inputs): New method.
12755 (Incremental_checker::command_line_): New field.
12756
c549a694
ILT
127572009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12758
12759 * incremental.cc: Include <cstdarg> and "target-select.h".
12760 (vexplain_no_incremental): New function.
12761 (explain_no_incremental): New function.
12762 (Incremental_binary::error): New method.
12763 (Sized_incremental_binary::do_find_incremental_inputs_section): New
12764 method.
12765 (make_sized_incremental_binary): New function.
12766 (open_incremental_binary): New function.
12767 (can_incrementally_link_file): Add checks if output is ELF and has
12768 inputs section.
12769 * incremental.h: Include "elfcpp_file.h" and "output.h".
12770 (Incremental_binary): New class.
12771 (Sized_incremental_binary): New class.
12772 (open_incremental_binary): Declare.
12773 * object.cc (is_elf_object): Use
12774 elfcpp::Elf_recognizer::is_elf_file.
12775 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
12776 * output.h (Output_file::filesize): New method.
12777
fd3c5f0b
ILT
127782009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12779
12780 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
12781 New function.
12782 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
12783 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
12784 function.
12785 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
12786 function.
12787 (Arm_relocate_functions::movw_abs_nc): New function.
12788 (Arm_relocate_functions::movt_abs): New function.
12789 (Arm_relocate_functions::thm_movw_abs_nc): New function.
12790 (Arm_relocate_functions::thm_movt_abs): New function.
12791 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
12792 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
12793 (Scan::global): Likewise.
12794 (Relocate::relocate): Likewise.
12795 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12796
7f5309a5
ILT
127972009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12798
12799 * arm.cc (Arm_relocate_functions::got_prel) New function.
12800 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
12801 (Relocate::relocate): Likewise.
12802 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12803
364c7fa5
ILT
128042009-10-06 Ian Lance Taylor <iant@google.com>
12805
12806 * options.h (class General_options): Define
12807 split_stack_adjust_size parameter.
12808 * object.h (class Object): Add uses_split_stack_ and
12809 has_no_split_stack_ fields. Add uses_split_stack and
12810 has_no_split_stack accessor functions. Declare
12811 handle_split_stack_section.
12812 (class Reloc_symbol_changes): Define.
12813 (class Sized_relobj): Define Function_offsets. Declare
12814 split_stack_adjust, split_stack_adjust_reltype, and
12815 find_functions.
12816 * object.cc (Object::handle_split_stack_section): New function.
12817 (Sized_relobj::do_layout): Call handle_split_stack_section.
12818 * dynobj.cc (Sized_dynobj::do_layout): Call
12819 handle_split_stack_section.
12820 * reloc.cc (Sized_relobj::relocate_sections): Call
12821 split_stack_adjust for executable sections in split_stack
12822 objects. Pass reloc_map to relocate_section.
12823 (Sized_relobj::split_stack_adjust): New function.
12824 (Sized_relobj::split_stack_adjust_reltype): New function.
12825 (Sized_relobj::find_functions): New function.
12826 * target-reloc.h: Include "object.h".
12827 (relocate_section): Add reloc_symbol_changes parameter. Change
12828 all callers.
12829 * target.h (class Target): Add calls_non_split method. Declare
12830 do_calls_non_split virtual method. Declare match_view and
12831 set_view_to_nop.
12832 * target.cc: Include "elfcpp.h".
12833 (Target::do_calls_non_split): New function.
12834 (Target::match_view): New function.
12835 (Target::set_view_to_nop): New function.
12836 * gold.cc (queue_middle_tasks): Give an error if mixing
12837 split-stack and non-split-stack objects with -r.
12838 * i386.cc (Target_i386::relocate_section): Add
12839 reloc_symbol_changes parameter.
12840 (Target_i386::do_calls_non_split): New function.
12841 * x86_64.cc (Target_x86_64::relocate_section): Add
12842 reloc_symbol_changes parameter.
12843 (Target_x86_64::do_calls_non_split): New function.
12844 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
12845 parameter.
12846 * powerpc.cc (Target_powerpc::relocate_section): Add
12847 reloc_symbol_changes parameter.
12848 * sparc.cc (Target_sparc::relocate_section): Add
12849 reloc_symbol_changes parameter.
12850 * configure.ac: Call AM_CONDITIONAL for the default target.
12851 * configure: Rebuild.
12852 * testsuite/Makefile.am (TEST_AS): New variable.
12853 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
12854 (check_DATA): Add split_i386 and split_x86_64 files.
12855 (SPLIT_DEFSYMS): Define.
12856 (split_i386_[1234n].o): New targets.
12857 (split_i386_[124]): New targets.
12858 (split_i386_[1234r].stdout): New targets.
12859 (split_x86_64_[1234n].o): New targets.
12860 (split_x86_64_[124]): New targets.
12861 (split_x86_64_[1234r].stdout): New targets.
12862 (MOSTLYCLEANFILES): Add new executables.
12863 * testsuite/split_i386.sh: New file.
12864 * testsuite/split_x86_64.sh: New file.
12865 * testsuite/split_i386_1.s: New file.
12866 * testsuite/split_i386_2.s: New file.
12867 * testsuite/split_i386_3.s: New file.
12868 * testsuite/split_i386_4.s: New file.
12869 * testsuite/split_i386_n.s: New file.
12870 * testsuite/split_x86_64_1.s: New file.
12871 * testsuite/split_x86_64_2.s: New file.
12872 * testsuite/split_x86_64_3.s: New file.
12873 * testsuite/split_x86_64_4.s: New file.
12874 * testsuite/split_x86_64_n.s: New file.
12875 * testsuite/testfile.cc (Target_test): Update relocation_section
12876 function.
12877 * testsuite/Makefile.in: Rebuild.
12878
e8a9fcda
ILT
128792009-10-06 Ian Lance Taylor <iant@google.com>
12880
12881 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
12882 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
12883 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
12884 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
12885 the address on ldo_addrs_.
12886 (Target_i386::Relocate::fix_up_ldo): New function.
12887
e99daf92
ILT
128882009-10-06 Rafael Espindola <espindola@google.com>
12889
12890 * plugin.cc (add_input_library): New.
12891 (Plugin::load): Add add_input_library to tv.
12892 (Plugin_manager::add_input_file): Add the is_lib argument.
12893 (add_input_file): Update call to Plugin_manager::add_input_file.
12894 (add_input_library): New.
12895 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
12896
966d4097
DK
128972009-09-30 Doug Kwan <dougkwan@google.com>
12898
12899 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
12900 symbol and call Symbol::may_need_copy_reloc to determine if
12901 a copy reloc is needed.
12902 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
12903 nocopyreloc is given in command line.
12904 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
12905 given in command line.
12906 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
12907 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
12908 of the removed Target_i386::may_need_copy_reloc.
12909 * options.h (copyreloc): New option with default value false.
12910 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12911 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
12912 instead of the removed Target_powerpc::may_need_copy_reloc.
12913 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12914 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
12915 instead of the removed Target_sparc::may_need_copy_reloc.
12916 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
12917 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
12918 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
12919 instead of the removed Target_x86_64::may_need_copy_reloc.
12920
029ba973
ILT
129212009-09-30 Ian Lance Taylor <iant@google.com>
12922
12923 * object.h (class Object): Remove target_ field, and target,
12924 sized_target, and set_target methods.
12925 (Object::sized_target): Remove.
12926 (class Sized_relobj): Update declarations. Remove sized_target.
12927 * object.cc (Sized_relobj::setup): Remove target parameter.
12928 Change all callers.
12929 (Input_objects::add_object): Don't do anything with the target.
12930 (make_elf_sized_object): Add punconfigured parameter. Change all
12931 callers. Set or test parameter target.
12932 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
12933 Change all callers.
12934 * parameters.cc (Parameters::set_target): Change parameter type to
12935 be non-const.
12936 (Parameters::default_target): Remove.
12937 (set_parameters_target): Change parameter type to be non-const.
12938 (parameters_force_valid_target): New function.
12939 (parameters_clear_target): New function.
12940 * parameters.h (class Parameters): Update declarations. Remove
12941 default_target method. Add sized_target and clear_target
12942 methods. Change target_ to be non-const.
12943 (set_parameters_target): Update declaration.
12944 (parameters_force_valid_target): Declare.
12945 (parameters_clear_target): Declare.
12946 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
12947 as NULL if we aren't searching.
12948 (Add_symbols::run): Don't check for compatible target.
12949 * fileread.cc (Input_file::open_binary): Call
12950 parameters_force_valid_target.
12951 * gold.cc (queue_middle_tasks): Likewise.
12952 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
12953 set_target on object.
12954 * dynobj.h (class Sized_dynobj): Update declarations.
12955 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
12956 make_elf_object returns NULL.
12957 (Archive::include_member): Don't check whether object target is
12958 compatible.
12959 * output.cc (Output_section::add_input_section): Get target from
12960 parameters.
12961 (Output_section::relax_input_section): Likewise.
12962 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
12963 parameters.
12964 (Sized_relobj::do_scan_relocs): Likewise.
12965 (Sized_relobj::relocate_sections): Likewise.
12966 * resolve.cc (Symbol_table::resolve): Likewise.
12967 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
12968 parameter. Change all callers.
12969 (Symbol_table::add_from_object): Get target from parameters.
12970 (Symbol_table::add_from_relobj): Don't check object target.
12971 (Symbol_table::add_from_dynobj): Likewise.
12972 (Symbol_table::define_special_symbol): Get target from
12973 parameters.
12974 * symtab.h (class Symbol_table): Update declaration.
12975 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
12976 parameter. Change all callers. Clear parameter target.
12977 (Binary_test): Test target here.
12978 * testsuite/object_unittest.cc (gold_testsuite): Remove
12979 target_test_pointer parameter. Change all callers.
12980 (Object_test): Test target here.
12981
a6a22b83
ILT
129822009-09-26 Ian Lance Taylor <iant@google.com>
12983
12984 * testsuite/initpri1.c: Don't try to use constructor priorities if
12985 compiling with gcc before 4.3.
12986
6a8f49fe
ILT
129872009-09-22 Mikolaj Zalewski <mikolajz@google.com>
12988
12989 * testsuite/retain_symbols_file_test.sh (check_present): Change
12990 output file name to retain_symbols_file_test.stdout.
12991 (check_absent): Likewise.
12992
8c604651
CS
129932009-09-18 Craig Silverstein <csilvers@google.com>
12994
12995 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
12996 * options.cc: Include <cerrno> and <fstream>.
12997 (General_options::finalize): Parse -retain-symbols-file tag.
12998 * options.h: New flag.
12999 (General_options): New method should_retain_symbol, new
13000 variable symbols_to_retain.
13001 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
13002 should_retain_symbol map.
13003 * testsuite/Makefile.am (retain_symbols_file_test): New test.
13004 * testsuite/Makefile.in: Regenerate.
13005 * testsuite/retain_symbols_file_test.sh: New file.
13006
ca58b19f
NC
130072009-09-18 Nick Clifton <nickc@redhat.com>
13008
13009 * po/es.po: Updated Spanish translation.
13010
20e6d0d6
DK
130112009-09-17 Doug Kwan <dougkwan@google.com>
13012
13013 * debug.h (DEBUG_RELAXATION): New constant.
13014 (DEBUG_ALL): Add DEBUG_RELAXATION.
13015 (debug_string_to_enum): Add relaxation debug option.
13016 * layout.cc
13017 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
13018 Layout::Relaxation_debug_check::read_sections,
13019 Layout::Relaxation_debug_check::read_sections): New method definitions.
13020 (Layout::Layout): Initialize data members
13021 record_output_section_data_from_scrips_,
13022 script_output_section_data_list_ and relaxation_debug_check_.
13023 (Layout::save_segments, Layout::restore_segments,
13024 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13025 Layout::relaxation_loop_body): New method definitions.
13026 (Layout::finalize): Support relaxation. Move section layout code to
13027 Layout::relaxation_loop_body.
13028 (Layout::set_asection_address_from_script): Move code for orphan
13029 section placement out.
13030 (Layout::place_orphan_sections_in_script): New method definition.
13031 * layout.h (Output_segment_headers, Output_file_header):
13032 New forward class declarations.
13033 (Layout::~Layout): Define.
13034 (Layout::new_output_section_data_from_script): New method definition.
13035 (Layout::place_orphan_sections_in_script): New method declaration.
13036 (Layout::Segment_states): New type declaration.
13037 (Layout::save_segments, Layout::restore_segments,
13038 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13039 Layout::relaxation_loop_body): New method declarations.
13040 (Layout::Output_section_data_list): New type declaration.
13041 (Layout::Relaxation_debug_check): New class definition.
13042 (Layout::record_output_section_data_from_script_,
13043 Layout::script_output_section_data_list_, Layout::segment_states_,
13044 Layout::relaxation_debug_check_): New data members.
13045 * output.cc: (Output_section_headers::do_size): New method definition.
13046 (Output_section_headers::Output_section_headers): Move size
13047 computation to Output_section_headers::do_size.
13048 (Output_segment_headers::do_size): New method definition.
e1df38aa 13049 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
13050 Output_file_header::do_size and call it.
13051 (Output_file_header::do_size): New method definition.
13052 (Output_data_group::Output_data_group): Adjust call to
13053 Output_section_data.
13054 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
13055 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 13056 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
13057 RELAXED_INPUT_SECTION_CODE.
13058 (Output_section::Output_section): Initialize data member checkpoint_.
13059 (Output_section::~Output_section): Delete checkpoint object pointed
13060 by checkpoint_.
13061 (Output_section::add_input_section): Always add an Input_section if
13062 relaxing.
13063 (Output_section::add_merge_input_section): Add assert.
13064 (Output_section::relax_input_section): New method definition.
13065 (Output_section::set_final_data_size): Set load address to zero for
13066 an unallocated section.
13067 (Output_section::do_address_and_file_offset_have_reset_values):
13068 New method definition.
13069 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
13070 Handle relaxed input section.
13071 (Output_section::sort_attached_input_sections): Checkpoint input
13072 section list lazily.
13073 (Output_section::get_input_sections): Change type of input_sections to
13074 list of Simple_input_section pointers. Checkpoint input section list
13075 lazily. Also handle relaxed input sections.
13076 (Output_section::add_input_section_for_script): Take a reference to
13077 a Simple_input_section object instead of Relobj pointer and section
13078 index as parameter. Handle relaxed input sections.
13079 (Output_section::save_states, Output_section::restore_states): New
13080 method definitions.
13081 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
13082 (Output_data::is_data_size_fixed): New method definition.
13083 (Output_data::reset_addresss_and_file_offset): Do not reset data size
13084 if it is fixed.
13085 (Output_data::address_and_file_offset_have_reset_values): New method
13086 definition.
13087 (Output_data::do_address_and_file_offset_have_reset_values): New method
13088 definition.
13089 (Output_data::set_data_size): Check that data size is not fixed.
13090 (Output_data::fix_data_size): New method definition.
13091 (Output_data::is_data_size_fixed_): New data member.
13092 (Output_section_headers::set_final_data_size): New method definition.
13093 (Output_section_headers::do_size): New method declaration.
13094 (Output_segment_headers::set_final_data_size): New method definition.
13095 (Output_segment_headers::do_size): New method declaration.
13096 (Output_file_header::set_final_data_size)::New method definition.
13097 (Output_file_header::do_size)::New method declaration.
13098 (Output_section_data::Output_section_data): Add new parameter
13099 is_data_size_fixed and use it to fix data size.
13100 (Output_data_const::Output_data_const): Adjust call to base class
13101 constructor and fix data size.
13102 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
13103 base class constructor and fix data size.
13104 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
13105 base class constructor and fix data size.
13106 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
13107 class constructor and fix data size.
13108 (Output_data_group::set_final_data_size): New method definition.
13109 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
13110 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
13111 class constructor and fix data size.
13112 (Output_relaxed_input_section): New class definition.
13113 (Output_section::Simple_input_section): New class definition.
13114 (Output_section::get_input_sections): Adjust parameter list.
13115 (Output_section::add_input_section_for_script): Same.
13116 (Output_section::save_states, Output_section::restore_states,
13117 Output_section::do_address_and_file_offset_have_reset_values,
13118 (Output_section::Input_section::Input_section): Handle
13119 RELAXED_INPUT_SECTION_CODE. Add new overload for
13120 Output_relaxed_input_section.
13121 (Output_section::Input_section::is_input_section,
13122 Output_section::Input_section::set_output_section): Handle relaxed
13123 input section.
13124 (Output_section::Input_section::is_relaxed_input_section,
13125 Output_section::Input_section::output_section_data,
13126 Output_section::Input_section::relaxed_input_section): New method
13127 definitions.
13128 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
13129 value.
13130 (Output_section::Input_section::u1_): Update comments.
13131 (Output_section::Input_section::u2_): Add new union member poris.
13132 (Output_section::Checkpoint_output_section): New classs definition.
13133 (Output_section::relax_input_section): New method declaration.
13134 (Output_section::checkpoint_): New data member.
13135 (Output_segment): Update comments.
13136 (Output_segment::Output_segment): Un-privatize copy constructor.
13137 (Output_segment::operator=): Un-privatize.
13138 * script-sections.cc (Output_section_element::Input_section_list):
13139 Change element type to Output_section::Simple_input_section.
13140 (Output_section_element_dot_assignment::set_section_addresses):
13141 Register output section data for relaxation clean up.
13142 (Output_data_exression::Output_data_expression): Adjust call to base
13143 constructor to fix data size.
13144 (Output_section_element_data::set_section_addresses): Register
13145 Output_data_expression object for relaxation clean up.
13146 (struct Input_section_info): Replace Relobj pointer and section index
13147 pair with Output_section::Simple_input_section and Convert struct to a
13148 class.
13149 (Input_section_sorter::operator()): Adjust access to
e1df38aa 13150 Input_section_info data member to use accessors.
20e6d0d6
DK
13151 (Output_section_element_input::set_section_addresses): Use layout
13152 parameter. Adjust code to use Output_section::Simple_input_section
13153 and Input_secction_info classes. Register filler for relaxation
13154 clean up.
13155 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
13156 and section index pair with Output_section::Simple_input_section
13157 class. Adjust code accordingly.
13158 (Phdrs_element::release_segment): New method definition.
13159 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
13160 segment list.
13161 (Script_sections::release_segments): New method definition.
13162 * gold/script-sections.h (Script_sections::release_segments): New
13163 method declaration.
13164 * gold/target.h (Target::may_relax, Target::relax,
13165 Target::do_may_relax, Target::do_relax): New method definitions.
13166
5e445df6
ILT
131672009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13168
13169 * arm.cc (has_signed_unsigned_overflow): New function.
13170 (Arm_relocate_functions::abs8): New function.
13171 (Target_arm::Scan::local): Handle R_ARM_ABS8.
13172 (Target_arm::Scan::global): Likewise.
13173 (Target_arm::relocate::relocate): Likewise.
13174 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
13175 Likewise.
13176
8c604651 131772009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
13178
13179 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
13180 * testsuite/Makefile.in: Regenerate.
13181
1e9cc1c2
NC
131822009-09-11 Nick Clifton <nickc@redhat.com>
13183
13184 * po/gold.pot: Updated by the Translation project.
13185
6a89f575
CC
131862009-09-08 Cary Coutant <ccoutant@google.com>
13187
13188 * output.cc (Output_file::open): Add execute permission to empty file.
13189 * testsuite/Makefile.am (permission_test): New test.
13190 * testsuite/Makefile.in: Regenerate.
13191
fdcac5af
ILT
131922009-09-02 Ian Lance Taylor <iant@google.com>
13193
13194 * output.cc (Output_file::resize): Call map_no_anonymous rather
13195 than map.
13196
44453f85
ILT
131972009-09-01 Mikolaj Zalewski <mikolajz@google.com>
13198
13199 * gold.cc: Include "incremental.h".
13200 (queue_initial_tasks): Call Incremental_checker methods.
13201 * incremental.cc: Include "output.h".
13202 (Incremental_checker::can_incrementally_link_output_file): New
13203 method.
13204 * incremental.h (Incremental_checker): New class.
13205
13206 * output.cc (Output_file::open_for_modification): New method.
13207 (Output_file::map_anonymous): Changed return type to bool. Record
13208 map in base_ field.
13209 (Output_file::map_no_anonymous): New method, broken out of map.
13210 (Output_file::map): Use map_no_anonymous and map_anonymous.
13211 * output.h (class Output_file): Update declarations.
13212
293c1386
CC
132132009-08-24 Cary Coutant <ccoutant@google.com>
13214
13215 * options.h (Command_line::Pre_options): New class.
13216 (Command_line::pre_options): New member.
13217 * options.cc (gold::options::ready_to_register): New variable.
13218 (One_option::register_option): Do nothing if not registering options.
13219 Assert if same short option registered twice.
13220 (General_options::General_options): Turn off option registration when
13221 done constructing.
13222 (Command_line::Pre_options::Pre_options): New constructor.
13223
f773f3d2
CC
132242009-08-24 Cary Coutant <ccoutant@google.com>
13225
06a73cfe
CC
13226 * options.h (General_options::no_keep_memory): Remove incorrect
13227 short option.
f773f3d2 13228
a15af8e2
RW
132292009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13230
13231 * Makefile.am (am__skiplex, am__skipyacc): New.
13232 * Makefile.in: Regenerate.
13233
c462b41b
RW
132342009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13235
14ec8efd
RW
13236 * Makefile.am (AM_CPPFLAGS): Renamed from ...
13237 (INCLUDES): ... this.
13238 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
13239 (AM_CPPFLAGS): Renamed from ...
13240 (INCLUDE): ... this.
13241 * Makefile.in, testsuite/Makefile.in: Regenerate.
13242
81ecdfbb
RW
13243 * Makefile.in: Regenerate.
13244 * aclocal.m4: Likewise.
13245 * config.in: Likewise.
13246 * configure: Likewise.
13247 * testsuite/Makefile.in: Likewise.
13248
c462b41b
RW
13249 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13250 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13251 * Makefile.in: Regenerate.
13252 * testsuite/Makefile.in: Regenerate.
13253
2da73f13
CC
132542009-08-19 Cary Coutant <ccoutant@google.com>
13255
13256 * resolve.cc (Symbol_table::resolve): Don't complain about defined
13257 symbols in shared libraries overridden by hidden or internal symbols
13258 in the main program.
13259
2db70501
CD
132602009-08-19 Chris Demetriou <cgd@google.com>
13261
13262 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
13263 checking source file names in error messages.
13264
f733487b
DK
132652009-08-18 Doug Kwan <dougkwan@google.com>
13266
13267 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
13268 an elcpp::Ehdr as parameter. Adjust call to set_target.
13269 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
13270 an elfcpp::Ehdr as parameter.
13271 * object.cc (Object::set_target): Remove the version that looks up
13272 a target and sets it.
13273 (Sized_relobj::setup): Take a Target object instead of
13274 an elfcpp::Ehdr as parameter. Adjust call to set_target.
13275 (make_elf_sized_object): Find target and ask target to
13276 make an ELF object.
13277 * object.h: (Object::set_target): Remove the version that looks up
13278 a target and sets it.
13279 (Sized_relobj::setup): Take a Target object instead of
13280 an elfcpp:Ehdr as parameter.
13281 * target.cc: Include dynobj.h.
13282 (Target::do_make_elf_object_implementation): New.
2e702c99 13283 (Target::do_make_elf_object): New.
f733487b
DK
13284 * target.h (Target::make_elf_object): New template declaration.
13285 (Target::do_make_elf_object): New method declarations.
13286 (Target::do_make_elf_object_implementation): New template declaration.
13287
cc70f101
ILT
132882009-08-14 Ian Lance Taylor <iant@google.com>
13289
13290 * gold.h (FUNCTION_NAME): Define.
13291 (gold_unreachable): Use FUNCTION_NAME.
13292
ef5e0cb1
ST
132932009-08-12 Sriraman Tallam <tmsriram@google.com>
13294
13295 * icf.cc (Icf::find_identical_sections): Issue a warning when a
13296 symbol in the --keep-unique list is not found.
13297
48c187ce
ST
132982009-08-12 Sriraman Tallam <tmsriram@google.com>
13299
13300 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
13301 been maked as --keep-unique.
13302 (Icf::unfold_section): New function.
13303 * icf.h (Icf::unfold_section): New function.
13304 * options.h (General_options::keep_unique): New option.
13305 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
13306 * testsuite/Makefile.in: Regenerate.
13307 * testsuite/icf_keep_unique_test.sh: New file.
13308 * testsuite/icf_keep_unique_test.cc: New file.
13309
645afe0c
CC
133102009-08-12 Cary Coutant <ccoutant@google.com>
13311
13312 PR 10471
13313 * resolve.cc (Symbol_table::resolve): Check for references from
13314 dynamic objects to hidden and internal symbols.
13315 * testsuite/Makefile.am (hidden_test.sh): New test.
13316 * testsuite/Makefile.in: Regenerate.
13317 * testsuite/hidden_test.sh: New script.
13318 * testsuite/hidden_test_1.c: New test source.
13319 * testsuite/hidden_test_main.c: New test source.
13320
11af873f
DK
133212009-08-11 Doug Kwan <dougkwan@google.com>
13322
13323 * arm.cc: Update comments.
13324 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
13325 segment to locate the .ARM.exidx section if present.
13326
b9f7d72d
DK
133272009-08-09 Doug Kwan <dougkwan@google.com>
13328
13329 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
13330 patch.
13331
ddd3c53c
ST
133322009-08-07 Sriraman Tallam <tmsriram@google.com>
13333 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
13334 compiler warnings.
13335
27721062
ST
133362009-08-06 Sriraman Tallam <tmsriram@google.com>
13337
13338 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
13339 valid tls_segment only for non-debug-section relocations.
13340 * testsuite/Makefile.am: Add gc_tls_test.
13341 * testsuite/Makefile.in: Regenerate.
13342 * testsuite/gc_tls_test.cc: New file.
13343 * testsuite/gc_tls_test.sh: New file.
13344
ef15dade 133452009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 13346
ef15dade
ST
13347 * icf.cc: New file.
13348 * icf.h: New file.
13349 * Makefile.am (CCFILES): Add icf.cc.
13350 (HFILES): Add icf.h
13351 * Makefile.in: Regenerate.
13352 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
13353 * gc.h (gc_process_relocs): Populate lists used by icf to contain
13354 section, symbol and addend information for the relocs.
13355 * gold.cc (queue_middle_tasks): Call identical code folding.
13356 * gold.h: Add defines for multimap.
13357 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
13358 to the call of finalize_local_symbols.
13359 * main.cc (main): Create object of class Icf.
13360 * object.cc (Sized_relobj::do_layout): Allow this function to be
13361 called twice during icf.
13362 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
13363 to sections marked as identical by icf.
13364 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
13365 when available.
13366 (Sized_relobj::do_section_entsize): New function.
13367 * object.h (Object::section_entsize): New function.
13368 (Object::do_section_entsize): New pure virtual function.
13369 (Relobj::finalize_local_symbols): Add new parameter.
13370 (Relobj::do_section_entsize): New function.
13371 * options.h (General_options::icf): New option.
13372 (General_options::icf_iterations): New option.
13373 (General_options::print_icf_sections): New option.
13374 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
13375 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
13376 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
13377 icf.
13378 * symtab.cc (Symbol_table::is_section_folded): New function.
13379 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
13380 to sections marked as identical by icf.
13381 * symtab.h (Symbol_table::set_icf): New function.
13382 (Symbol_table::icf): New function.
13383 (Symbol_table::is_section_folded): New function.
13384 (Symbol_table::icf_): New data member.
13385 * target-reloc.h (relocate_section): Ignore sections folded by icf.
13386 * testsuite/Makefile.am: Add commands to build icf_test.
13387 * testsuite/Makefile.in: Regenerate.
13388 * testsuite/icf_test.sh: New file.
13389 * testsuite/icf_test.cc: New file.
13390
c3b65ac4
CD
133912009-07-24 Chris Demetriou <cgd@google.com>
13392
13393 * layout.cc (is_compressible_debug_section): Fix incorrect
13394 comment about compressed section names.
13395
1caf2c51
ILT
133962009-07-20 Ian Lance Taylor <ian@airs.com>
13397
13398 PR 10419
13399 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
13400
1ef4d87f
ILT
134012009-07-16 Ian Lance Taylor <iant@google.com>
13402
13403 PR 10400
13404 * layout.h: #include <map>.
13405 (class Kept_section): Change from struct to class. Add accessors
13406 and setters. Add section size to Comdat_group mapping. Change
13407 Comdat_group to std::map. Add is_comdat_ field. Add
13408 linkonce_size field in union.
13409 (class Layout): Update declaration of find_or_add_kept_section.
13410 Don't declare find_kept_object.
13411 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
13412 parameter. Add object, shndx, is_comdat, and is_group_name
13413 parameters. Change all callers. Adjust for new Kept_section.
13414 (Layout::find_kept_object): Remove.
13415 * object.cc (Sized_relobj::include_section_group): Update use of
13416 Kept_section. Rename secnum to shndx. Only record
13417 Kept_comdat_section if sections are the same size.
13418 (Sized_relobj::include_linkonce_section): Update use of
13419 Kept_section. Only record Kept_comdat_section if sections are the
13420 same size. Set size of linkonce section.
13421 (Sized_relobj::map_to_kept_section): Update call to
13422 get_kept_comdat_section.
13423 * object.h (class Sized_relobj): Rename fields in
13424 Kept_comdat_section to drop trailing underscores; change object
13425 field to Relobj*. Change Kept_comdat_section_table to store
13426 struct rather than pointer.
13427 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
13428 Add kept_object and kept_shndx parameters. Change all callers.
13429 (Sized_relobj::get_kept_comdat_section): Change return type to
13430 bool. Add kept_object and kept_shndx parameters. Change all
13431 callers.
13432 * plugin.cc (Pluginobj::include_comdat_group): Update call to
13433 Layout::find_or_add_kept_section.
13434
37c3b7b0
ILT
134352009-07-09 Ian Lance Taylor <iant@google.com>
13436
13437 * merge.cc (Object_merge_map::initialize_input_to_output_map):
13438 Reserve space in the hash table.
13439
98fa85cb
ILT
134402009-07-06 Mikolaj Zalewski <mikolajz@google.com>
13441
13442 * fileread.cc (File_read::get_mtime): New method.
13443 * fileread.h (Timespec): New structure.
13444 (File_read::get_mtime): New method.
13445 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
13446 Renamed from timestamp_nsec.
13447 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
13448 Elf_Xword.
e1df38aa 13449 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 13450 timestamp_nsec.
e1df38aa 13451 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
13452 (Incremental_inputs::report_obejct): Save mtime; style fix.
13453 (Incremental_inputs::report_script): Save mtime; style fix.
13454 (Incremental_inputs::finalize_inputs): Style fix.
13455 (Incremental_inputs::finalize): Style fix.
13456 (Incremental_inputs::create_input_section_data): Store inputs
13457 mtime.
13458 * incremental.h (Incremental_inputs::report_script): Add mtime
13459 argument.
13460 (Incremental_inputs::Input_info::Input_info): Intialize only one
13461 union member.
13462 (Incremental_inputs::Input_info::archive): Move to nameless
13463 union.
13464 (Incremental_inputs::Input_info::obejct): Move to nameless union.
13465 (Incremental_inputs::Input_info::script): Move to nameless union.
13466 (Incremental_inputs::mtime): New field.
13467 * script.cc (read_input_script): Pass file mtime to
13468 Incremental_input.
13469 * script.h (Script_info::inputs): Style fix.
13470
c9d70757
ILT
134712009-07-01 Ian Lance Taylor <ian@airs.com>
13472
13473 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
13474 instead of 32.
13475
9c547ec3
ILT
134762009-06-24 Ian Lance Taylor <iant@google.com>
13477
13478 PR 10156
13479 * layout.cc (Layout::choose_output_section): If we find an
13480 existing section, update the flags.
13481 (Layout::create_notes): New function, broken out of
13482 Layout::finalize.
13483 (Layout::finalize): Don't create note sections.
13484 (Layout::create_note): Don't crash if linker script discards
13485 section.
13486 (Layout::create_gold_note): Likewise.
13487 (Layout::create_build_id): Likewise. Don't set
13488 after_input_sections on the section.
13489 (Layout::create_executable_stack_info): Remove target parameter.
13490 Change caller.
13491 * layout.h (class Layout): Declare create_notes. Update
13492 declaration of create_executable_stack_info.
13493 * gold.cc (queue_middle_tasks): Call create_notes.
13494 * output.cc (Output_section::update_flags_for_input_section): Move
13495 here from output.h. If SHF_ALLOC flag is newly set, mark address
13496 invalid.
13497 * output.h (Output_data::mark_address_invalid): New function.
13498 (class Output_section): Only declare, not define,
13499 update_flags_for_input_section. Remove set_flags.
13500
55458500
ILT
135012009-06-24 Ian Lance Taylor <iant@google.com>
13502
13503 * script-sections.cc (Output_section_definition::
13504 set_section_addresses): Rename shadowing local load_address to
13505 laddr.
13506
1307d6cd
ILT
135072009-06-24 Ian Lance Taylor <iant@google.com>
13508
13509 PR 10244
13510 * reloc.cc (relocate_sections): Skip empty relocation sections.
13511
ec3f783e
ILT
135122009-06-23 Ian Lance Taylor <iant@google.com>
13513
13514 PR 10156
13515 * layout.cc (Layout::create_note): Use choose_output_section
13516 rather than make_output_section.
13517
459c9f1c
ILT
135182009-06-23 Ian Lance Taylor <iant@google.com>
13519
13520 PR 10237
13521 * options.cc (General_options::parse_V): Set printed_version_.
13522 (General_options::General_options): Initialize printed_version_.
13523 * options.h (class General_options): Add printed_version_ field.
13524 * gold.cc (queue_initial_tasks): If there are no input files,
13525 don't give a fatal error if we printed the version information.
13526 (queue_middle_tasks): If using -r with a shared object, give a
13527 fatal error rather than an ordinary error.
13528
1518dc8f
ILT
135292009-06-23 Ian Lance Taylor <iant@google.com>
13530
13531 PR 10219
13532 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
13533 (Layout::make_output_section): Set have_stabstr_section_ if we see
13534 a .stab*str section.
13535 (Layout::finalize): Call link_stabs_sections.
13536 (Layout::link_stabs_sections): New file.
13537 * layout.h (class Layout): Add have_stabstr_section_ field.
13538 Declare link_stabs_sections.
13539
3d857b98
DK
135402009-06-23 Doug Kwan <dougkwan@google.com>
13541
13542 * Makefile.am (libgold_a_LIBADD): New.
13543 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 13544 * Makefile.in: Regenerate.
3d857b98
DK
13545 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
13546 * configure: Regenerate.
13547 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
13548 * fileread.cc: Include sys/state.h
13549 * gold.h: Declare memmem and strndup if found missing.
13550 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
13551
0639a6f6
ILT
135522009-06-23 Ian Lance Taylor <iant@google.com>
13553
13554 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
13555 * configure: Rebuild.
13556
8d63875c
ILT
135572009-06-23 Ian Lance Taylor <iant@google.com>
13558
13559 PR 10147
13560 * object.cc (Object::section_contents): Don't try to get a view if
13561 the section has length zero.
13562 (Object::handle_gnu_warning_section): If the section is empty, use
13563 the name of the section as the warning.
13564
f7c8a183
ILT
135652009-06-23 Ian Lance Taylor <iant@google.com>
13566
13567 PR 10133
13568 * stringpool.h (class Stringpool_template): Add optimize_ field.
13569 (Stringpool_template::set_optimize): New function.
13570 * stringpool.cc (Stringpool_template::Stringpool_template):
13571 Initialize optimize_ field.
13572 (Stringpool_template::set_string_offsets): Test local optimize
13573 fild rather than parameter.
13574 * layout.cc (Layout::Layout): Call set_optimize on the section
13575 name stringpool.
13576
e6a307ba
ILT
135772009-06-22 Ian Lance Taylor <iant@google.com>
13578
13579 PR 10030
13580 * yyscript.y: Parse TARGET.
13581 * script.cc (script_set_target): New function.
13582 * script-c.h (script_set_target): Declare.
13583 * options.cc (General_options::string_to_object_format): Rename
13584 from string_to_object_format in anonymous namespace. Change
13585 callers.
13586 * options.h (class General_options): Declare
13587 string_to_object_format.
13588
3ee173de
ILT
135892009-06-22 Ian Lance Taylor <iant@google.com>
13590
13591 * script-sections.cc (Script_sections::create_segments): Don't put
13592 program headers in a PT_LOAD segment if -n or -N.
13593
135942009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
13595
13596 PR 10141
13597 * options.h (class General_options): Add -z lazy and -z now. Sort
13598 -z options into alphabetical order.
13599 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
13600
cd6739a1 136012009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
13602
13603 * layout.cc (Layout::make_output_section): Call
13604 Target::new_output_section.
13605 (Layout::attach_allocated_section_to_segment): Put large section
13606 sections in a separate load segment with the large segment flag
13607 set.
13608 (Layout::segment_precedes): Sort large data segments after other
13609 load segments.
13610 (align_file_offset): New static function.
13611 (Layout::set_segment_offsets): Use align_file_offset.
13612 * output.h (class Output_section): Add is_small_section_ and
13613 is_large_section_ fields.
13614 (Output_section::is_small_section): New function.
13615 (Output_section::set_is_small_section): New function.
13616 (Output_section::is_large_section): New function.
13617 (Output_section::set_is_large_section): New function.
13618 (Output_section::is_large_data_section): New function.
13619 (class Output_segment): Add is_large_data_segment_ field.
13620 (Output_segment::is_large_data_segment): New function.
13621 (Output_segment::set_is_large_data_segment): New function.
13622 * output.cc (Output_section::Output_section): Initialize new
13623 fields.
13624 (Output_segment::Output_segment): Likewise.
13625 (Output_segment::add_output_section): Add assertion that large
13626 data sections always go in large data segments. Force small data
13627 sections to the end of the list of data sections. Force small BSS
13628 sections to the start of the list of BSS sections. For large BSS
13629 sections to the end of the list of BSS sections.
13630 * symtab.h (class Symbol): Declare is_common_shndx.
13631 (Symbol::is_defined): Check Symbol::is_common_shndx.
13632 (Symbol::is_common): Likewise.
13633 (class Symbol_table): Define enum Commons_section_type. Update
13634 declarations. Add small_commons_ and large_commons_ fields.
13635 * symtab.cc (Symbol::is_common_shndx): New function.
13636 (Symbol_table::Symbol_table): Initialize new fields.
13637 (Symbol_table::add_from_object): Put small and large common
13638 symbols in the right list.
13639 (Symbol_table::sized_finalized_symbol): Check
13640 Symbol::is_common_shndx.
13641 (Symbol_table::sized_write_globals): Likewise.
13642 * common.cc (Symbol_table::do_allocate_commons): Allocate new
13643 common symbol lists. Don't call do_allocate_commons_list if the
13644 list is empty.
13645 (Symbol_table::do_allocate_commons_list): Remove is_tls
13646 parameter. Add comons_section_type parameter. Change all
13647 callers. Handle small and large common symbols.
13648 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
13649 Symbol::is_common_shndx.
13650 * resolve.cc (symbol_to_bits): Likewise.
13651 * target.h (Target::small_common_shndx): New function.
13652 (Target::small_common_section_flags): New function.
13653 (Target::large_common_shndx): New function.
13654 (Target::large_common_section_flags): New function.
13655 (Target::new_output_section): New function.
13656 (Target::Target_info): Add small_common_shndx, large_common_shndx,
13657 small_common_section_flags, and large_common_section_flags
13658 fields.
13659 (Target::do_new_output_section): New virtual function.
13660 * arm.cc (Target_arm::arm_info): Initialize new fields.
13661 * i386.cc (Target_i386::i386_info): Likewise.
13662 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
13663 Likewise.
13664 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
13665 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13666 (Target_x86_64::do_new_output_section): New function.
13667 * configure.ac: Define conditional MCMODEL_MEDIUM.
13668 * testsuite/Makefile.am (check_PROGRAMS): Add large.
13669 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
13670 (large_LDFLAGS): Define.
13671 * testsuite/large.c: New file.
13672 * testsuite/testfile.cc (Target_test::test_target_info):
13673 Initialize new fields.
13674 * configure, testsuite/Makefile.in: Rebuild.
13675
bb04269c
DK
136762009-06-05 Doug Kwan <dougkwan@google.com>
13677
13678 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 13679 * Makefile.in: Regenerate.
bb04269c
DK
13680 * i386.cc (class Target_i386): Define new virtual method to
13681 override do_is_local_label_name in parent.
13682 * object.cc (Sized_relobj::do_count_local_symbols): Discard
13683 local symbols if --discard-locals or -X is given.
13684 * options.h (class General_options): Declare new options
13685 '--discard-locals' and '-X' for discarding locals.
13686 * target.h (class Target): Define new methods is_local_label_name.
13687 Declare new virtual method do_is_local_label_name.
13688 * target.cc: New file.
13689 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
13690 (check_SCRIPTS): Add discard_locals_test.sh.
13691 (check_DATA): Add discard_local_tests.syms.
13692 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
13693 (discard_local_tests.syms, discard_locals_test.o): New make rules.
13694 * testsuite/Makefile.in: Regenerate.
13695 * testsuite/discard_locals_test.c: New file.
13696 * testsuite/discard_locals_test.sh: Same.
13697
805bb01c
DK
136982009-06-05 Doug Kwan <dougkwan@google.com>
13699
13700 * object.cc (Sized_relobj::Sized_relobj): Initialize
13701 discarded_eh_frame_shndx_ to -1U.
13702 (Sized_relobj::do_layout): Record index of a discard .eh_frame
13703 section.
13704 (Sized_relobj::do_count_local_symbols): Skip local symbols in
13705 a discarded .eh_frame section.
13706 (Sized_relobj::do_finalize_local_symbols): Ditto.
13707 * object.h (class Sized_relobj): Declare new member
13708 discarded_eh_frame_shndx_.
13709 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
13710 (local_labels_test.o, local_labels_test): New rules.
13711 * testsuite/Makefile.in: Regenerate.
13712
1dcd334d
DK
137132009-06-04 Doug Kwan <dougkwan@google.com>
13714
13715 * layout.cc (Layout::section_name_mapping): Add mapping for
13716 special ARM sections.
13717
96d49306
DK
137182009-06-03 Doug Kwan <dougkwan@google.com>
13719
13720 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
13721 (utils::has_overflow): Same.
13722
dff16297
ILT
137232009-06-03 Ian Lance Taylor <iant@google.com>
13724
13725 * layout.cc (Layout::section_name_mapping): New array, replacing
13726 Layout::linkonce_mapping.
13727 (Layout::section_name_mapping_count): New variable, replacing
13728 Layout::linkonce_mapping_count.
13729 (Layout::linkonce_output_name): Remove.
13730 (Layout::output_section_name): Rewrite.
13731 * layout.h (class Layout): Rename Linkonce_mapping to
13732 Section_name_mapping, linkonce_mapping to section_name_mapping,
13733 linkonce_mapping_count to section_name_mapping_count. Don't
13734 declare linkonce_output_name.
13735
c121c671
DK
137362009-06-03 Doug Kwan <dougkwan@google.com>
13737
13738 * gold/arm.cc (namespace utils): New.
13739 (Target_arm::reloc_is_non_pic): Define new method.
13740 (class Arm_relocate_functions): New.
13741 (Target_arm::Relocate::relocate): Handle relocation types used by
13742 Android.
13743
07800fab
ILT
137442009-06-03 Ian Lance Taylor <iant@google.com>
13745
13746 * arm.cc (Target_arm::scan::global): Use || instead of |.
13747
c121c671
DK
137482009-06-02 Doug Kwan <dougkwan@google.com>
13749
13750 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
13751 issued_non_pic_error_.
13752 (class Target_arm::Scan): Declare new method check_non_pic.
13753 Define new method symbol_needs_plt_entry.
13754 Declare new data member issued_non_pic_error_.
13755 (class Target_arm::Relocate): Declare new method
13756 should_apply_static_reloc.
13757 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
13758 (Target_arm::Scan::check_non_pic): Define new method.
13759 (Target_arm::Scan::local): Handle a small subset of reloc types used
13760 by Android.
13761 (Target_arm::Scan::local): Same.
13762 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
13763
b19b0c6d
ILT
137642009-05-31 Mikolaj Zalewski <mikolajz@google.com>
13765
13766 * incremental.cc (Incremental_inputs::report_command_line): Filter
13767 out --incremental-* options.
13768
94cdfcff
DK
137692009-05-29 Doug Kwan <dougkwan@google.com>
13770
13771 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
13772 template class.
13773 (class Target_arm): Update comment.
13774 (Target_arm::Target_arm): Initialize new data members GOT_,
13775 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
13776 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
13777 and Target_arm::rel_dyn_section.
13778 Declare new_enum Target_arm::Got_type.
13779 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
13780 and DYNBSS_.
13781 Update commments for member do_dynsym_value.
13782 (Target_arm::got_size, Target_arm::plt_section,
13783 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
13784 new methods inside class defintion.
13785 (Target_arm::got_section): Define new method.
13786 (Target_arm::rel_dyn_section): Same.
13787 (Output_data_plt_arm): New template class.
13788 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
13789 (Output_data_plt_arm:do_adjust_output_section): Define new method.
13790 (Output_data_plt_arm::add_entry): Same.
13791 (Output_data_plt_arm::first_plt_entry): Define new
13792 static data member for PLT instruction template.
13793 (Output_data_plt_arm::plt_entry): Same.
13794 (Output_data_plt_arm::do_write): Define new method.
13795 (Target_arm::make_plt_entry): Same.
13796 (Target_arm::do_finalize_sections): Same.
13797 (Target_arm::do_dynsym_value): Same.
13798
4a657b0d
DK
137992009-05-28 Doug Kwan <dougkwan@google.com>
13800
13801 * Makefile.am (TARGETSOURCES): Add arm.cc.
13802 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
13803 * Makefile.in: Regenerate.
13804 * arm.cc: New file.
13805 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
13806
e7ae8c36
DK
138072009-05-26 Doug Kwan <dougkwan@google.com>
13808
13809 * options.cc (General_options::parse_exclude_libs). Fix a comment.
13810 (General_options::check_excluded_libs): Strip off directories in
13811 archive name before matching like GNU ld does.
13812 * testsuite/Makefile.am (MOSTLYCLEANFILES,
13813 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
13814 (exclude_libs_test_LDFLAGS): Add linker option
13815 -Wl,--exclude-libs,libexclude_libs_test_3
13816 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
13817 an explicit archive without using -l.
13818 (alt/libexclude_libs_test_3.a): New make rule.
13819 * testsuite/Makefile.in: Regenerate.
13820 * testsuite/exclude_libs_test.c : Declare lib3_default().
13821 (main): Call it.
13822 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
13823 * exclude_libs_test_3.c: New file.
13824
f12e7348
NC
138252009-05-26 Nick Clifton <nickc@redhat.com>
13826
13827 * po/id.po: New Indonesian translation.
13828 * po/gold.pot: Updated template file.
13829
4daadc0d
ST
138302009-05-22 Sriraman Tallam <tmsriram@google.com>
13831
e1df38aa 13832 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
13833 gc_comdat_test files. Add -Wl,--gc-sections to build
13834 gc_comdat_test.
13835 * testsuite/Makefile.in: Regenerate.
13836 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
13837
531813ad
ST
138382009-05-21 Sriraman Tallam <tmsriram@google.com>
13839
13840 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
13841 kept comdat section was garbage collected.
13842 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
13843 * testsuite/Makefile.in: Regenerate.
13844 * testsuite/gc_comdat_test.sh: New file.
13845 * testsuite/gc_comdat_test_1.cc: New file.
13846 * testsuite/gc_comdat_test_2.cc: New file.
13847
65514900
CC
138482009-05-19 Doug Kwan <dougkwan@google.com>
13849
13850 * archive.cc (Archive::Archive): Move constructor from archive.h
13851 to here. Initialize no_export_.
13852 (Archive::get_elf_object_for_member): Set no_export flag of object.
13853 * archive.h (Archive::Archive): Move constructor body to
13854 archive.cc.
13855 (Archive::no_export): New method.
13856 (Archive::no_export_): New field.
13857 * object.h (Object::Object): Initialize no_export_ to false.
13858 (Object::no_export, Object::set_no_export): New methods.
13859 (Object::no_export_): New field.
13860 * options.cc (General_options::parse_exclude_libs): New method.
13861 (General_options::check_excluded_libs) Same.
13862 * options.h (exclude_libs): New option.
13863 (General_options::check_excluded_libs): New method declaration.
13864 (General_options::excluded_libs_): New field.
13865 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
13866 default or protected visibility if an object has no-export flag set.
13867 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
13868 (check_SCRIPTS): Add exclude_libs_test.sh.
13869 (check_DATA): Add exclude_libs_test.syms.
13870 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
13871 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
13872 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
13873 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
13874 (exclude_libs_test.syms, libexclude_libs_test_1.a,
13875 libexclude_libs_test_2.a): New rules.
13876 * testsuite/Makefile.in: Regenerate.
13877 * testsuite/exclude_libs_test.c: New file.
13878 * testsuite/exclude_libs_test.sh: Ditto.
13879 * testsuite/exclude_libs_test_1.c: Ditto.
13880 * testsuite/exclude_libs_test_2.c: Ditto.
13881
1b77ea50
ILT
138822009-05-15 Ian Lance Taylor <iant@google.com>
13883
13884 * configure.ac: Check for declarations for cases where libiberty.h
13885 checks HAVE_DECL_xxx.
13886 * configure, config.in: Rebuild.
13887
072fe7ce
ILT
138882009-05-15 Mikolaj Zalewski <mikolajz@google.com>
13889
13890 * gold.h (Incremental_argument_list): Remove (invalid) forward
13891 declaration.
13892 * incremental.cc (Incremental_inputs::report_achive): New method.
13893 (Incremental_inputs::report_object): New method.
13894 (Incremental_inputs::report_script): New method.
13895 (Incremental_inputs::finalize_inputs): New method.
13896 (Incremental_inputs::finalize): Call finalize_inputs().
13897 (Incremental_inputs::sized_create_incremental_inputs_section_data):
13898 Create inputs entries.
13899 * incremental.h (Incremental_input_type): New enum.
13900 (Incremental_inputs::Incremental_input): Initialize new fields.
13901 (Incremental_inputs::report_inputs): New method.
13902 (Incremental_inputs::report_achive): New method.
13903 (Incremental_inputs::report_object): New method.
13904 (Incremental_inputs::report_script): New method.
13905 (Incremental_inputs::finalize_inputs): New method.
13906 (Incremental_inputs::Input_info): New struct.
13907 (Incremental_inputs::Input_info_map): New typedef.
13908 (Incremental_inputs::lock_): New field.
13909 (Incremental_inputs::Inputs_): New field.
13910 (Incremental_inputs::Inputs_map): New field.
13911 * main.cc (main): Call Incremental_input::report_inputs.
13912 * options.h (Input_argument_list): Typedef moved from
13913 Input_arguments.
13914 (Input_file_group::Files): Remove, use ::Input_argument_list.
13915 (Input_file_group::Input_argument_list): Remove, use
13916 ::Input_argument_list.
13917 * plugin.cc (Plugin_manager::add_input_file): Add error in
13918 incremental build.
13919 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
13920 functions.
13921 * script.cc (read_input_script): Call
13922 Incremental_input::report_script.
13923 * script.h (Script_info): New class.
13924
b0481b0b
ILT
139252009-04-27 Ian Lance Taylor <iant@google.com>
13926
13927 * x86_64.cc (do_adjust_output_section): Set entsize to
13928 plt_entry_size.
13929
b22a5a41 139302009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
13931
13932 * output.cc (Output_file::close): After short writes, continue
13933 writing from the correct offset in the buffer being written.
13934
40fde488
CD
139352009-04-23 Chris Demetriou <cgd@google.com>
13936
13937 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
13938 * configure: Regenerate.
13939 * config.in: Regenerate.
13940 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
13941 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
13942
3ce2c28e
ILT
139432009-04-21 Mikolaj Zalewski <mikolajz@google.com>
13944
13945 * incremental.cc (Incremental_inputs_header_data): Renamed from
13946 Incremental_input_header_data.
13947 (Incremental_inputs_header_data::data_size): New field.
13948 (Incremental_inputs_header_data::put_input_file_count): Renamed
13949 from input_file_count.
13950 (Incremental_inputs_header_data::put_command_line_offset): Renamed
13951 from command_line_offset.
13952 (Incremental_inputs_header_data::put_reserved): Renamed from
13953 put_reserved.
13954 (Incremental_inputs_entry_data): Renamed from
13955 Incremental_input_entry_data.
13956 (Incremental_inputs_entry_data::data_size): New field.
13957 (Incremental_inputs::report_command_line): New method.
13958 (Incremental_inputs::finalize): New method.
13959 (Incremental_inputs::create_incremental_inputs_data): New method.
13960 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
13961 * incremental.h: New file.
13962 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 13963 (Layout::finalize): Create incremental inputs section in
3ce2c28e 13964 incremental builds.
703d02da 13965 (Layout::create_incremental_info_sections): New method.
3ce2c28e 13966 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
13967 (Layout::create_incremental_info_sections): New method.
13968 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
13969 * main.cc (main): Notify Incremental_input of the command line.
13970
e55bde5e
ILT
139712009-04-01 Ian Lance Taylor <iant@google.com>
13972 Mikolaj Zalewski <mikolajz@google.com>
13973
13974 * gold.h (reserve_unordered_map): Define, three versions, one for
13975 each version of Unordered_map.
13976 * layout.cc (Layout::Layout): Remove options parameter. Add
13977 number_of_input_files parameter. Don't initialize options_.
13978 Initialize number_of_input_files_ and resized_signatures_. Move
13979 sections_are_attached_.
13980 (Layout::layout_group): Reserve space for group_signatures_.
13981 (Layout::find_or_add_kept_section): Change name parameter to be a
13982 reference. Resize signatures_ map when it gets large enough.
13983 (Layout::layout_eh_frame): Use parameters->options() instead of
13984 this->options_.
13985 (Layout::make_output_section): Likewise.
13986 (Layout::attach_allocated_section_to_segment): Likewise.
13987 (Layout::finalize, Layout::create_executable_stack): Likewise.
13988 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
13989 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
13990 * layout.h (class Layout): Update declarations. Remove options_
13991 field. Add number_of_input_files_ and resized_signatures_
13992 fields. Move sections_are_attached_ field.
13993 * main.cc (main): Pass number of input files to Layout
13994 constructor. Don't pass options.
13995
154b857c
ILT
139962009-03-30 Ian Lance Taylor <iant@google.com>
13997
13998 * ffsll.c (ffsll): Correct implementation.
13999
2f35ab9b
ILT
140002009-03-27 Ian Lance Taylor <iant@google.com>
14001
fd03461a
ILT
14002 * ffsll.c: New file.
14003 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
14004 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
14005 * ftruncate.c (ftruncate): Declare before definition.
14006 * mremap.c (mremap): Likewise.
14007 * pread.c (pread): Likewise.
14008 * configure, Makefile.in, config.in: Rebuild.
14009
2f35ab9b
ILT
14010 * mremap.c: New file.
14011 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
14012 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
14013 (mremap): Declare if HAVE_MREMAP is not defined.
14014 * configure, Makefile.in, config.in: Rebuild.
14015
33aea2fd
CC
140162009-03-27 Cary Coutant <ccoutant@google.com>
14017
14018 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
14019 position independent.
14020 * sparc.cc (Target_sparc::check_non_pic): Likewise.
14021 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
14022
6d479619
CC
140232009-03-24 Cary Coutant <ccoutant@google.com>
14024
14025 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
14026 an executable.
14027 (needs_dynamic_reloc): Likewise.
14028
afc06bb8
ILT
140292009-03-24 Ian Lance Taylor <iant@google.com>
14030
14031 * yyscript.y (file_cmd): Recognize EXTERN.
14032 (extern_name_list, extern_name_list_body): New nonterminals.
14033 * script.cc (script_add_extern): Define.
14034 * script-c.h (script_add_extern): Declare.
14035
f6060a4d
ILT
140362009-03-24 Rafael Avila de Espindola <espindola@google.com>
14037
14038 * object.cc (is_elf_object): Define.
14039 * object.h (is_elf_object): Declare.
14040 * archive.cc (Archive::get_elf_object_for_member): Call
14041 is_elf_object.
33aea2fd 14042 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 14043
26736d8e
ILT
140442009-03-24 Elliott Hughes <enh@google.com>
14045
14046 * output.cc (Output_file::map_anonymous): Define.
14047 (Output_file::map): Use map_anonymous. If the regular mmap fails,
14048 try an anonymous one. Report the size if the mmap fails.
14049 * output.h (class Output_file): Declare map_anonymous.
14050
22fd9730
ILT
140512009-03-24 Ian Lance Taylor <iant@google.com>
14052
14053 * target-select.cc (instantiate_target): Don't acquire the lock if
14054 the instantiated_target_ field has already been set.
14055
cb010894
ILT
140562009-03-23 Ian Lance Taylor <iant@google.com>
14057
7f055c20
ILT
14058 * gold-threads.h (class Initialize_lock): Define.
14059 * gold-threads.cc (class Initialize_lock_once): Define.
14060 (initialize_lock_control): New static variable.
14061 (initialize_lock_pointer): New static variable.
14062 (initialize_lock_once): New static function.
14063 (Initialize_lock::Initialize_lock): Define.
14064 (Initialize_lock::initialize): Define.
14065 * target-select.h: Include "gold-threads.h".
14066 (class Target_selector): Add lock_ and initialize_lock_ fields.
14067 Don't define instantiate_target, just declare it.
14068 * target-select.cc (Target_selector::Target_selector): Initialize
14069 new fields.
14070 (Target_selector::instantiate_target): Define.
14071 * descriptors.h: Include "gold-threads.h".
14072 (class Descriptors): Add initialize_lock_ field.
14073 * descriptors.cc (Descriptors::Descriptors): Initialize new
14074 field.
14075 (Descriptors::open): Use initialize_lock_ field
14076 * errors.h (class Errors): Add initialize_lock_ field.
14077 * errors.cc (Errors::Errors): Initialize new field.
14078 (Errors::initialize_lock): Use initialize_lock_ field.
14079 * powerpc.cc (class Target_selector_powerpc): Remove
14080 instantiated_target_ field. In do_recognize call
14081 instantiate_target rather than do_instantiate_target. In
14082 do_instantiate_target just allocate a new target.
14083 * sparc.cc (class Target_selector_sparc): Likewise.
14084
36959681
ILT
14085 * freebsd.h: New file.
14086 * i386.cc: Include "freebsd.h".
14087 (Target_i386): Derive from Target_freebsd rather than
14088 Sized_target.
14089 (Target_selector_i386): Derive from Target_selector_freebsd rather
14090 than Target_selector.
14091 * x86_64.cc: Include "freebsd.h".
14092 (Target_x86_64): Derive from Target_freebsd rather than
14093 Sized_target.
14094 (Target_selector_x86_64): Derive from Target_selector_freebsd
14095 rather than Target_selector.
14096 * target.h (class Target): Add adjust_elf_header and
14097 do_adjust_elf_header.
14098 * output.cc (Output_file_header:: do_sized_write): Call target
14099 adjust_elf_header routine.
14100 * configure.tgt: Set targ_osabi.
14101 * configure.ac: Define GOLD_DEFAULT_OSABI.
14102 * parameters.cc (Parameters::default_target): Pass
14103 GOLD_DEFAULT_OSABI to select_target.
14104 * target-select.h (class Target_selector): Make instantiate_target
14105 protected rather than private.
14106 * Makefile.am (HFILES): Add freebsd.h.
14107 * configure, Makefile.in, config.in: Rebuild.
14108
cb010894
ILT
14109 * merge.cc (do_add_input_section): Correct pend value. Change
14110 message about last entry not being null terminated from error to
14111 warning.
14112
0e879927
ILT
141132009-03-20 Mikolaj Zalewski <mikolajz@google.com>
14114
14115 * incremental.cc: New file.
14116 * Makefile.am (CCFILES): Add incremental.cc.
14117 * Makefile.in: Rebuild.
14118
41105937
PP
141192009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
14120
14121 * layout.cc (Layout::output_section_name): Preserve names
14122 of '.note.' sections.
e1df38aa 14123
60439920
ILT
141242009-03-19 Ian Lance Taylor <iant@google.com>
14125
14126 * descriptors.cc (Descriptors::open): Check that the options are
14127 valid before using them.
14128
0d371ad3
ILT
141292009-03-18 Ian Lance Taylor <iant@google.com>
14130
14131 * script-sections.h: Include <list>.
14132 (class Script_sections): Change Sections_elements from std::vector
14133 to std::list. Typedef public Elements_iterator. Add
14134 orphan_section_placement_, data_segment_align_start_, and
14135 saw_data_segment_align_ fields. Remove data_segment_align_index_
14136 field.
14137 * script-sections.cc (class Orphan_section_placement): New class.
14138 (class Sections_element): Add virtual functions is_relro and
14139 orphan_section_init. Remove virtual function place_orphan_here.
14140 (class Output_section_definition): Add is_relro and
14141 orphan_section_init. Remove place_orphan_here.
14142 (class Orphan_output_section): Likewise.
14143 (Script_sections::Script_sections): Update for field changes.
14144 (Script_sections::data_segment_align): Set saw_data_segment_align_
14145 and data_segment_align_start_, not data_segment_align_index.
14146 (Script_sections::data_segment_relro_end): Check
14147 saw_data_segment_align_. Use data_segment_align_start_ rather
14148 than data_segment_align_index_.
14149 (Script_sections::place_orphan): Rewrite to use
14150 Orphan_section_placement.
14151
9201d894
ILT
141522009-03-17 Ian Lance Taylor <iant@google.com>
14153
9c5b8369
ILT
14154 * archive.cc (Archive::add_symbols): Check for a version attached
14155 to the symbol name in the archive map.
14156 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
14157 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
14158 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
14159 (ver_test_11.a): New target.
14160 * testsuite/Makefile.in: Rebuild.
14161
9201d894
ILT
14162 * configure.ac: Check for chsize and posix_fallocate. Replace
14163 ftruncate.
14164 * ftruncate.c: New file, from gnulib.
14165 * output.cc (posix_fallocate): Define dummy version if not
14166 HAVE_POSIX_FALLOCATE.
14167 (Output_file::map): Call posix_fallocate rather than lseek and
14168 write.
14169 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
14170 * configure, Makefile.in, config.in: Rebuild.
14171
ef4ab7a8 141722009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 14173
ef4ab7a8
PP
14174 * layout.h (Layout::create_note): Add section_name parameter.
14175 * layout.cc (Layout::create_note): Likewise.
14176 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 14177
8c500701
ILT
141782009-03-17 Ian Lance Taylor <iant@google.com>
14179
e85b18e1
ILT
14180 * descriptors.cc: Include "options.h".
14181 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
14182 (Descriptors::open): Always use O_CLOEXEC when opening a new
14183 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
14184 then set FD_CLOEXEC.
14185
9efe6174
ILT
14186 * sparc.cc (class Target_sparc): Add has_got_section.
14187 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
14188 make sure we have a GOT section.
14189
14190 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
14191 (Target_sparc::Scan::local): Likewise.
14192 (Target_sparc::Scan::global): Likewise.
14193 (Target_sparc::Relocate::relocate): Likewise.
14194 (Target_sparc::Relocate::relocate_tls): Likewise.
14195
8c500701
ILT
14196 * symtab.cc (Symbol_table::define_default_version): New function,
14197 broken out of add_from_object.
14198 (Symbol_table::add_from_object): Call define_default_version.
14199 (Symbol_table::define_special_symbol): Add resolve_oldsym
14200 parameter. Change all callers. If the version for a symbol comes
14201 from a version script, resolve it with the symbol with the same
14202 name with no version. Also add the symbol without a version if
14203 appropriate.
14204 (do_define_in_output_data): If resolving with oldsym, don't delete
14205 sym.
14206 (do_define_in_output_segment): Likewise.
14207 (do_define_as_constant): Likewise.
14208 * symtab.h (class Symbol_table): Update declarations.
14209
f1ed28fb
ILT
142102009-03-13 Ian Lance Taylor <iant@google.com>
14211
15f8229b
ILT
14212 * readsyms.cc (Read_symbols::incompatible_warning): New function.
14213 (Read_symbols::requeue): New function.
14214 (Read_symbols::do_read_symbols): If make_elf_object fails because
14215 the target type is not configured, and the file was searched for,
14216 issue a warning and retry with the next directory.
14217 (Add_symbols::run): If the file has an incompatible format, and
14218 it was searched for, requeue the Read_symbols task. On error,
14219 release the object.
14220 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
14221 dirindex parameter to constructor. Change all callers. Declare
14222 incompatible_warning and requeue.
14223 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
14224 input_argument_ and input_group_ fields. Add them to
14225 constructor. Change all callers.
14226 (class Read_script): Add dirindex_ field. Add it to constructor.
14227 Change all callers.
14228 * archive.cc (Archive::setup): Remove input_objects parameter.
14229 Change all callers.
14230 (Archive::get_file_and_offset): Likewise.
14231 (Archive::read_all_symbols): Likewise.
14232 (Archive::read_symbols): Likewise.
14233 (Archive::get_elf_object_for_member): Remove input_objects
14234 parameter. Add punconfigured parameter. Change all callers.
14235 (Archive::add_symbols): Change return type to bool. Check return
14236 value of include_member.
14237 (Archive::include_all_members): Likewise.
14238 (Archive::include_member): Change return type to bool. Return
14239 false if first included object has incompatible target. Set
14240 included_member_ field.
14241 (Add_archive_symbols::run): If add_symbols returns false, requeue
14242 Read_symbols task.
14243 * archive.h (class Archive): Add included_member_ field.
14244 Initialize it in constructor. Add input_file and searched_for
14245 methods. Update declarations.
14246 (class Add_archive_symbols): Add dirpath_, dirindex_, and
14247 input_argument_ fields. Add them to constructor. Change all
14248 callers.
14249 * script.cc: Include "target-select.h".
14250 (class Parser_closure): Add skip_on_incompatible_target_ and
14251 found_incompatible_target_ fields. Add
14252 skip_on_incompatible_target parameter to constructor. Change all
14253 callers. Add methods skip_on_incompatible_target,
14254 clear_skip_on_incompatible_target, found_incompatible_target, and
14255 set_found_incompatible_target.
14256 (read_input_script): Add dirindex parameter. Change all callers.
14257 If parser finds an incompatible target, requeue Read_symbols
14258 task.
14259 (script_set_symbol): Clear skip_on_incompatible_target in
14260 closure.
14261 (script_add_assertion, script_parse_option): Likewise.
14262 (script_start_sections, script_add_phdr): Likewise.
14263 (script_check_output_format): New function.
14264 * script.h (read_input_script): Update declaration.
14265 * script-c.h (script_check_output_format): Declare.
14266 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
14267 (ignore_cmd): Remove OUTPUT_FORMAT.
14268 * fileread.cc (Input_file::Input_file): Add explicit this.
14269 (Input_file::will_search_for): New function.
14270 (Input_file::open): Add pindex parameter. Change all callers.
14271 * fileread.h (class Input_file): Add input_file_argument method.
14272 Declare will_search_for. Update declarations.
14273 * object.cc (make_elf_object): Add punconfigured parameter.
14274 Change all callers.
14275 * object.h (class Object): Make input_file public. Add
14276 searched_for method.
14277 (make_elf_object): Update declaration.
14278 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
14279 restart search.
14280 * dirsearch.h (class Dirsearch): Update declaration.
14281 * options.h (class General_options): Add --warn-search-mismatch.
14282 * parameters.cc (Parameters::is_compatible_target): New function.
14283 * parameters.h (class Parameters): Declare is_compatible_target.
14284 * workqueue.cc (Workqueue::add_blocker): New function.
14285 * workqueue.h (class Workqueue): Declare add_blocker.
14286
f1ed28fb
ILT
14287 * fileread.cc (Input_file::open): Remove options parameter.
14288 Change all callers.
14289 (Input_file::open_binary): Likewise.
14290 * script.cc (read_input_script): Likewise.
14291 * readsyms.h (class Read_symbols): Remove options_ field. Remove
14292 options parameter from constructor. Change all callers.
14293 (class Read_script): Likewise.
14294 * fileread.h (class Input_file): Update declarations.
14295 * script.h (read_input_script): Update declaration.
14296
34dd024a
NC
142972009-03-10 Nick Clifton <nickc@redhat.com>
14298
14299 * po/es.po: New Spanish translation.
14300
6d71b17c
CC
143012009-03-06 Cary Coutant <ccoutant@google.com>
14302
14303 * options.cc (parse_short_option): Keep dash_z from registering itself.
14304
031cdbed
ILT
143052009-03-03 Ian Lance Taylor <iant@google.com>
14306
14307 PR 9918
14308 * target-reloc.h (relocate_section): Pass output_section to
14309 relocate.
14310 * i386.cc (Target_i386::should_apply_static_reloc): Add
14311 output_section parameter. Change all callers.
14312 (Target_i386::Relocate::relocate): Add output_section parameter.
14313 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14314 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
14315 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
14316 * testsuite/two_file_shared.sh: New script.
14317 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
14318 (check_DATA): Add two_file_shared.dbg.
14319 (two_file_shared.dbg): New target.
14320 * testsuite/Makefile.in: Rebuild.
14321
15d5fa16
ILT
143222009-03-01 Ian Lance Taylor <iant@google.com>
14323
14324 * configure.ac: Check for byteswap.h.
14325 * configure: Rebuild.
14326 * config.in: Rebuild.
14327
8a4c0b0d
ILT
143282009-03-01 Mikolaj Zalewski <mikolajz@google.com>
14329
14330 * layout.cc (Layout::find_or_add_kept_section): New function.
14331 (Layout::add_comdat): Removed.
14332 * layout.h (struct Kept_section): Move out of class Layout.
14333 Remove trailing underscores from field names. Add group_sections
14334 field. Rename group_ field to is_group. Change all uses.
14335 (class Layout): Declare find_or_add_kept_section, not add_comdat.
14336 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
14337 comdat_groups_ field.
14338 (Sized_relobj::include_section_group): Use
14339 find_or_add_kept_section and Kept_section::group_sections.
14340 (Sized_relobj::include_linkonce_section): Likewise.
14341 * object.cc (class Sized_relobj): Don't define Comdat_group or
14342 Comdat_group_table. Remove find_comdat_group and
14343 add_comdat_group. Remove comdat_groups_ field.
14344 * plugin.cc (include_comdat_group): Use
14345 Layout::find_or_add_kept_section.
14346
b4ecf66b
ILT
143472009-02-28 Ian Lance Taylor <iant@google.com>
14348
14359ca0
ILT
14349 * README: --gc-sections and map files are now supported. Document
14350 some build requirements.
14351
b4ecf66b
ILT
14352 PR 6992
14353 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
14354 relocatable link set the value of the section symbol to zero.
14355 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
14356 relocatable link don't include the section address in the local
14357 symbol value.
14358
0602e05a
ILT
143592009-02-27 Ian Lance Taylor <iant@google.com>
14360
fd9d194f
ILT
14361 PR 6811
14362 * options.h (class Search_directory): Add is_system_directory.
14363 (class General_options): Declare is_in_system_directory.
14364 * options.cc (get_relative_sysroot): Make static.
14365 (get_default_sysroot): Make static.
14366 (General_optoins::is_in_system_directory): New function.
14367 * fileread.cc (Input_file::is_in_system_directory): New function.
14368 * fileread.h (class Input_file): Declare is_in_system_directory.
14369 * object.h (class Object): Add is_in_system_directory.
14370 (class Input_objects): Remove system_library_directory_ field.
14371 * object.cc (Input_objects::add_object): Don't set
14372 system_library_directory_.
14373 (input_objects::found_in_system_library_directory): Remove.
14374 * symtab.cc (Symbol_table::write_globals): Remove input_objects
14375 parameter. Change all callers.
14376 (Symbol_table::sized_write_globals): Likewise.
14377 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
14378 Call Object::is_in_system_directory.
14379 * symtab.h (class Symbol_table): Update declarations.
14380
61edd21f
ILT
14381 PR 5990
14382 * descriptors.h (Open_descriptor): Add is_on_stack field.
14383 * descriptors.cc (Descriptors::open): If the descriptor is on the
14384 top of the stack, remove it. Initialize is_on_stack field.
14385 (Descriptors::release): Only add pod to stack if it is not on the
14386 stack already.
14387 (Descriptors::close_some_descriptor): Clear stack_next and
14388 is_on_stack fields.
14389
e29e076a
ILT
14390 PR 7091
14391 * output.cc (Output_section::find_starting_output_address): Rename
14392 from starting_output_address; add PADDR parameter; change return
14393 type.
14394 * output.h (class Output_section): Declare
14395 find_starting_output_address instead of starting_output_address.
14396 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
14397 section symbol for which we can't find a merge section.
14398
0602e05a
ILT
14399 PR 9836
14400 * symtab.cc (Symbol_table::add_from_object): If the visibility is
14401 hidden or internal, force the symbol to be local.
14402 * resolve.cc (Symbol::override_visibility): Define.
14403 (Symbol::override_base): Use override_visibility.
14404 (Symbol_table::resolve): Likewise.
14405 (Symbol::override_base_with_special): Likewise.
14406 (Symbol_table::override_with_special): If the visibility is hidden
14407 or internal, force the symbol to be local.
14408 * symtab.h (class Symbol): Add set_visibility and
14409 override_visibility.
14410 * testsuite/ver_test_1.sh: New file.
14411 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
14412 (check_DATA): Add ver_test_1.syms.
14413 (ver_test_1.syms): New target.
14414 * testsuite/Makefile.in: Rebuild.
14415
401a9a73
CC
144162009-02-25 Cary Coutant <ccoutant@google.com>
14417
14418 * layout.cc (Layout::choose_output_section): Don't rename sections
14419 when using a linker script that has a SECTIONS clause.
14420 * Makefile.in: Regenerate.
14421
14422 * testsuite/Makefile.am (script_test_5.sh): New test case.
14423 * testsuite/Makefile.in: Regenerate.
14424 * testsuite/script_test_5.cc: New file.
14425 * testsuite/script_test_5.sh: New file.
14426 * testsuite/script_test_5.t: New file.
14427
f488e4b0
CC
144282009-02-13 Rafael Avila de Espindola <espindola@google.com>
14429
14430 * archive.cc (Archive::include_member): Update calls to add_symbols.
14431 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
14432 the Layout argument.
14433 * dynobj.h (do_add_symbols): Add the Layout argument.
14434 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
14435 Layout argument.
14436 * object.h (Object::add_symbols): Add the Layout argument.
14437 (Object::do_add_symbols): Add the Layout argument.
14438 (Sized_relobj::do_add_symbols): Add the Layout argument.
14439 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
14440 Unify the two versions.
14441 (Add_plugin_symbols): Remove.
14442 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
14443 (Sized_pluginobj::do_add_symbols): Unify the two versions.
14444 (Add_plugin_symbols): Remove.
14445 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
14446 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
14447 (Add_symbols::run): Make it work with Pulginobj.
14448
89dd1680
ILT
144492009-02-06 Ian Lance Taylor <iant@google.com>
14450
14451 * object.cc (Sized_relobj::do_layout): Make info message start
14452 with lower case letter.
14453
266d0a74
ILT
144542009-02-06 Mikolaj Zalewski <mikolajz@google.com>
14455
602b464e
ILT
14456 * binary.cc: Fix file comment.
14457
266d0a74
ILT
14458 * options.h (enum Incremental_disposition): Define.
14459 (class General_options): Add new options: --incremental,
14460 --incremental_changed, --incremental_unchanged,
14461 --incremental_unknown. Add incremental_disposition_ and
14462 implicit_incremental_ fields.
14463 (General_options::incremental_disposition): New function.
14464 (class Position_dependent_options): Add incremental_disposition
14465 option.
14466 (Position_dependent_options::copy_from_options): Set incremental
14467 dispositions.
14468 * options.cc (General_options::parse_incremental_changed): New
14469 function.
2e702c99
RM
14470 (General_options::parse_incremental_unchanged): New function.
14471 (General_options::parse_incremental_unknown): New function.
14472 (General_options::General_options): Initialize new fields
266d0a74 14473 incremental_disposition_ and implicit_incremental_.
2e702c99 14474 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
14475 without --incremental.
14476
f073bbf7
CD
144772009-02-06 Chris Demetriou <cgd@google.com>
14478
14479 * gold.h (gold_undefined_symbol): Change to take only a Symbol
14480 pointer and to report location as the file name associated with
14481 the symbol.
14482 (gold_undefined_symbol_at_location): New function to replace the
14483 old gold_undefined_symbol functionality.
14484 * target-reloc.h (relocate_section): Update to use
14485 gold_undefined_symbol_at_location.
14486 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14487 Call gold_undefined_symbol function rather than gold_error.
14488 * errors.h (Errors::undefined_symbol): Take location as a
14489 string, rather than calculating it from a relocation.
14490 * errors.cc (Errors::fatal): Print "fatal error:" before the
14491 formatted message.
14492 (Errors::error, Errors::error_at_location): Print "error: "
14493 before the formatted message.
14494 (Errors::undefined_symbol): Take location as a string, rather
14495 than calculating it from a relocation.
14496 (gold_undefined_symbol_at_location): New function akin to
14497 old gold_undefined_symbol, calculates location from relocation.
14498 (gold_undefined_symbol): Change to take only a Symbol pointer
14499 and to report location as the file name associated with the symbol.
14500 * testsuite/debug_msg.sh: Update for changed error messages.
14501 * testsuite/undef_symbol.sh: Likewise.
14502
8e94a90c
ILT
145032009-02-04 Duncan Sands <baldrick@free.fr>
14504
14505 PR 9812
14506 * reduced_debug_output.h
14507 (Output_reduced_debug_abbrev_section::failed): Use format for
14508 gold_warning.
14509 (Output_reduced_debug_info_section::faild): Likewise.
14510
88a0e15b
ILT
145112009-01-31 Mikolaj Zalewski <mikolajz@google.com>
14512
14513 * script.cc (Lazy_demangler): New class.
2e702c99 14514 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
14515 symbol only once.
14516
5efc7cd2
CC
145172009-01-29 Cary Coutant <ccoutant@google.com>
14518
14519 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
14520 to __tls_get_addr.
14521 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14522
e0ebcf42
ILT
145232009-01-28 Ian Lance Taylor <iant@google.com>
14524
5efc7cd2 14525 * version.cc (version_string): Bump to 1.9.
75fe7426 14526
e0ebcf42
ILT
14527 * gold.h: Include <cstring> and <stdint.h>.
14528 * version.cc: Include <cstdio>.
14529 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
14530 warning.
14531 * reduced_debug_output.cc (insert_into_vector): Rename from
14532 Insert_into_vector; change all callers. Use Swap_unaligned to
14533 avoid aliasing issue; remove union since it is unnecessary.
14534
8e2813be 145352009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
14536
14537 * Makefile.am (CCFILES): Add gc.cc.
14538 (HFILES): Add gc.h.
14539 * Makefile.in: Regenerate.
14540 * gold.cc (Gc_runner): New class.
14541 (queue_initial_tasks): Call garbage collection related tasks
14542 when corresponding options are invoked.
14543 (queue_middle_gc_tasks): New function.
14544 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
14545 processed early before laying out sections during garbage collection.
14546 * gold.h (queue_middle_gc_tasks): New function.
14547 (is_prefix_of): Move from "layout.cc".
14548 * i386.cc (Target_i386::gc_process_relocs): New function.
14549 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
14550 * main.cc (main): Create object of class "Garbage_collection".
14551 * object.cc (Relobj::copy_symbols_data): New function.
14552 (Relobj::is_section_name_included): New function.
e1df38aa
NC
14553 (Sized_relobj::do_layout): Allow this function to be called twice
14554 during garbage collection and defer layout of section during the
6d03d481
ST
14555 first call.
14556 * object.h (Relobj::get_symbols_data): New function.
14557 (Relobj::is_section_name_included): New function.
14558 (Relobj::copy_symbols_data): New function.
14559 (Relobj::set_symbols_data): New function.
14560 (Relobj::get_relocs_data): New function.
14561 (Relobj::set_relocs_data): New function.
14562 (Relobj::is_output_section_offset_invalid): New pure virtual function.
14563 (Relobj::gc_process_relocs): New function.
14564 (Relobj::do_gc_process_relocs): New pure virtual function.
14565 (Relobj::sd_): New data member.
14566 (Sized_relobj::is_output_section_offset_invalid): New function.
14567 (Sized_relobj::do_gc_process_relocs): New function.
14568 * options.h (General_options::gc_sections): Modify to not be a no-op.
14569 (General_options::print_gc_sections): New option.
14570 * plugin.cc (Plugin_finish::run): Remove function call to
14571 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
14572 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
14573 * reloc.cc (Read_relocs::run): Add task to process relocs and
14574 determine unreferenced sections when doing garbage collection.
14575 (Gc_process_relocs): New class.
14576 (Sized_relobj::do_gc_process_relocs): New function.
14577 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
14578 sections that are garbage collected.
14579 * reloc.h (Gc_process_relocs): New class.
14580 * sparc.cc (Target_sparc::gc_process_relocs): New function.
14581 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
14582 symbols whose corresponding sections are garbage collected.
14583 (Symbol_table::Symbol_table): Add new parameter for the garbage
14584 collection object.
14585 (Symbol_table::gc_mark_undef_symbols): New function.
14586 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14587 (Symbol_table::gc_mark_dyn_syms): New function.
14588 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
14589 as garbage.
14590 (Symbol_table::add_from_object): Likewise.
14591 (Symbol_table::add_from_relobj): When building shared objects, do not
14592 treat externally visible symbols as garbage.
14593 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
14594 table information for static and relocatable links.
14595 * symtab.h (Symbol_table::set_gc): New function.
14596 (Symbol_table::gc): New function.
14597 (Symbol_table::gc_mark_undef_symbols): New function.
14598 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14599 (Symbol_table::gc_mark_dyn_syms): New function.
14600 (Symbol_table::gc_): New data member.
e1df38aa 14601 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
14602 function.
14603 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
14604 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
14605
3b293544
CF
146062009-01-20 Chris Faylor <me.sourceware@sourceware.org>
14607
14608 * options.h (General_options::gc_sections): Define as a no-op for now.
14609 (General_options::no_keep_memory): Ditto.
14610 (General_options::Bshareable): Define.
14611 * options.cc (General_options::finalize): Honor -Bshareable.
14612
83d22aa8
AS
146132009-01-20 Andreas Schwab <schwab@suse.de>
14614
14615 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
14616 read the value in the contents, since we don't use it. Use the
14617 template endianness when writing.
14618 (Relocate::relocate): Use it for R_PPC_REL16_HA.
14619
cd536b21
AS
146202009-01-19 Andreas Schwab <schwab@suse.de>
14621
14622 * configure.tgt (powerpc64-*): Fix targ_obj.
14623
99e9a495
ILT
146242009-01-15 Ian Lance Taylor <iant@google.com>
14625
14626 * object.cc (Sized_relobj::write_local_symbols): Don't write out
14627 local symbols when stripping all symbols.
14628
bbbfea06
CC
146292009-01-14 Cary Coutant <ccoutant@google.com>
14630
99e9a495 14631 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 14632
0f7c0701
CC
146332009-01-14 Cary Coutant <ccoutant@google.com>
14634
14635 * archive.cc (Archive::get_elf_object_for_member): Remove call
14636 to File_read::claim_for_plugin.
14637 * descriptors.cc (Descriptors::open): Remove reference to
14638 is_claimed.
14639 (Descriptors::claim_for_plugin): Remove.
14640 * descriptors.h (Descriptors::claim_for_plugin): Remove.
14641 (Descriptors::is_claimed): Remove.
14642 (claim_descriptor_for_plugin): Remove.
14643 * fileread.cc (File_read::claim_for_plugin): Remove.
14644 * fileread.h (File_read::claim_for_plugin): Remove.
14645 (File_read::descriptor): Reopen descriptor if necessary.
14646 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
14647 (Plugin_manager::all_symbols_read): Add task parameter. Change
14648 all callers.
14649 (Plugin_manager::get_input_file): New function.
14650 (Plugin_manager::release_input_file): New function.
14651 (Pluginobj::Pluginobj): Add filesize parameter and initialize
14652 corresponding data member.
14653 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
14654 and pass to base constructor. Change all callers.
14655 (get_input_file, release_input_file): New functions.
14656 (make_sized_plugin_object): Add filesize parameter. Change all callers.
14657 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
14658 (Plugin_manager::all_symbols_read): Add task parameter.
14659 (Plugin_manager::get_input_file): New function.
14660 (Plugin_manager::release_input_file): New function.
14661 (Plugin_manager::task_): New data member.
14662 (Pluginobj::Pluginobj): Add filesize parameter.
14663 (Pluginobj::filename): New function.
14664 (Pluginobj::descriptor): New function.
14665 (Pluginobj::filesize): New function.
14666 (Pluginobj::filesize_): New data member.
14667 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
14668 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
14669 File_read::claim_for_plugin; use Object::unlock to unlock the file.
14670
14671 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
14672 with archive libraries.
14673 * testsuite/Makefile.in: Regenerate.
14674 * testsuite/plugin_test.c (struct sym_info): New type.
14675 (get_input_file, release_input_file): New static variables.
14676 (onload): Capture new transfer vector entries.
14677 (claim_file_hook): Stop reading at end of file according to filesize.
14678 Factor out parsing of readelf output into separate function.
14679 (all_symbols_read_hook): Exercise get_input_file and release_input_file
14680 APIs and get the source file name from the symbol table. Convert
14681 source file name to corresponding object file name. Print info
14682 message when adding new input files.
14683 (parse_readelf_line): New function.
14684 * testsuite/plugin_test_1.sh: Add checks for new info messages.
14685 * testsuite/plugin_test_2.sh: Likewise.
14686 * testsuite/plugin_test_3.sh: Likewise.
14687 * testsuite/plugin_test_4.sh: New test case.
14688
62a6d109
ILT
146892009-01-07 Ian Lance Taylor <iant@google.com>
14690
14691 * version.cc (version_string): Bump to 1.8.
14692
483620e8
CC
146932008-12-23 Cary Coutant <ccoutant@google.com>
14694
14695 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
14696 * plugin.cc (Plugin_manager::finish): Rename as
14697 layout_deferred_objects. Move cleanup to separate function.
14698 (Plugin_manager::cleanup): New function.
14699 (Plugin_finish::run): Call layout_deferred_objects and cleanup
14700 separately.
14701 * plugin.h (Plugin_manager::finish): Rename as
14702 layout_deferred_objects.
14703 (Plugin_manager::cleanup): New function.
14704 (Plugin_manager::cleanup_done): New field.
14705
d66a9eb3
CC
147062008-12-23 Cary Coutant <ccoutant@google.com>
14707
14708 * plugin.cc (is_visible_from_outside): New function.
14709 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
14710 so we don't return "IR only" status for exported symbols or -r links.
14711
14712 * testsuite/Makefile.am (plugin_test_3): New test case.
14713 * testsuite/Makefile.in: Regenerate.
14714 * testsuite/plugin_test_3.sh: New file.
14715
5995b570
CC
147162008-12-22 Cary Coutant <ccoutant@google.com>
14717
14718 * object.cc (Sized_relobj::layout_section): New function.
14719 (Sized_relobj::do_layout): Defer layout of input sections until after
14720 plugin has provided replacement files.
14721 (Sized_relobj::do_layout_deferred_sections): New function.
14722 * object.h (Relobj::set_section_offset): Remove virtual keyword.
14723 (Relobj::layout_deferred_sections): New function.
14724 (Relobj::do_layout_deferred_sections): New function.
14725 (Sized_relobj::do_layout_deferred_sections): New function.
14726 (Sized_relobj::layout_section): New function.
14727 (Sized_relobj::Deferred_layout): New structure.
14728 (Sized_relobj::deferred_layout_): New field.
14729 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
14730 Change all callers. Layout deferred sections.
14731 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
14732 references.
14733 (Plugin_hook::run): Move code from do_plugin_hook inline.
14734 (Plugin_hook::do_plugin_hook): Remove.
14735 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
14736 (Plugin_manager::finish): Renamed, was cleanup.
14737 (Plugin_manager::should_defer_layout): New function.
14738 (Plugin_manager::add_deferred_layout_object): New function.
14739 (Plugin_manager::Deferred_layout_list): New type.
14740 (Plugin_manager::deferred_layout_objects_): New field.
14741 (Plugin_hook::do_plugin_hook): Remove.
14742
ee769c88
ILT
147432008-12-17 Ian Lance Taylor <iant@google.com>
14744
14745 * options.h (class General_options): Add --no case for
14746 --export-dynamic.
14747
abc8dcba
CC
147482008-12-16 Cary Coutant <ccoutant@google.com>
14749
14750 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
14751 vector.
14752 (Plugin_manager::claim_file): Create plugin object even if
14753 plugin did not call the add_symbols callback.
14754 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
14755 asking for more symbols than were added.
14756 * testsuite/Makefile.am (plugin_test_1): Add test case with
14757 no global symbols.
14758 (empty.syms): New target.
14759 * testsuite/Makefile.in: Regenerate.
14760 * testsuite/plugin_test.c (claim_file_hook): Add new debug
14761 message. Don't call add_symbols if no globals.
14762 (all_symbols_read_hook): Don't provide replacement for empty
14763 claimed file.
14764
b0074644
ILT
147652008-12-12 Ian Lance Taylor <iant@google.com>
14766
68943102
ILT
14767 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
14768 r_type == 0 for a local symbol with r_sym == 0.
14769 (scan_relocatable_relocs): Pass r_sym to
14770 local_non_section_strategy.
14771 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
14772 r_sym parameter.
14773
b0074644
ILT
14774 * configure.ac: Update test for TLS descriptors: they are
14775 supported as of glibc 2.9.
14776 * configure: Rebuild.
14777
c2508178
ILT
147782008-12-11 Ian Lance Taylor <iant@google.com>
14779
14780 PR 7091
14781 * target-reloc.h (Default_scan_relocatable_relocs): For each
14782 function, map r_type == 0 to RELOC_DISCARD.
14783
2756a258
CC
147842008-12-10 Cary Coutant <ccoutant@google.com>
14785
14786 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
14787 object to override a kept COMDAT group from a plugin object.
14788
bb6f53d3
ILT
147892008-12-09 Ian Lance Taylor <iant@google.com>
14790
fbc558e1
ILT
14791 PR 7088
14792 * yyscript.y (file_cmd): Handle INPUT.
14793
bb6f53d3
ILT
14794 * testsuite/initpri1.c: Change all declarations to be full
14795 prototypes by adding void, to avoid compiler warnings.
14796
4674ecfc
CC
147972008-12-05 Rafael Avila de Espindola <espindola@google.com>
14798
14799 * options.cc (General_options::parse_plugin_opt): New.
14800 (General_options::add_plugin): The argument now is just the filename.
14801 (General_options::add_plugin_option): New.
14802 * options.h (plugin_opt): New.
14803 (add_plugin): Change argument name.
14804 (add_plugin_option): New.
14805 * plugin.cc (Plugin::load): Don't parse the plugin option.
14806 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
14807 (Plugin::add_option): New.
14808 (Plugin::args_): Change type.
14809 (Plugin::filename_): New.
14810 (Plugin_manager::add_plugin_option): New.
14811 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
14812 * testsuite/Makefile.in: Regenerate.
14813
fd06b4aa
CC
148142008-12-05 Cary Coutant <ccoutant@google.com>
14815
14816 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
14817 Handle --strip-lto-sections option.
14818 * options.h (strip_lto_sections): New option.
14819
6c52134c
CC
148202008-12-01 Cary Coutant <ccoutant@google.com>
14821
14822 * plugin.cc (ld_plugin_message): Change format parameter to const.
14823 Fix mismatch between new[] and delete.
14824
a45248e0
CC
148252008-11-14 Cary Coutant <ccoutant@google.com>
14826
14827 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
14828 instead of -1U.
14829
c82fbeee
CS
148302008-11-05 Craig Silverstein <csilvers@google.com>
14831
14832 * options.cc (General_options::parse_dynamic_list): New function.
14833 * options.h (General_options): New flags dynamic_list,
14834 dynamic_list_data, dynamic_list_cpp_new, and
14835 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
14836 (General_options::in_dynamic_list): New function.
14837 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
14838 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
14839 (Lex::can_continue_name): Likewise.
14840 (yylex): Likewise.
14841 (read_script_file): New parameter script_options.
14842 (read_dynamic_list): New function.
14843 (Script_options::define_dynamic_list): New function.
14844 (dynamic_list_keyword_parsecodes): New variable.
14845 (dynamic_list_keywords): New variable.
14846 * script.h (Script_options::define_dynamic_list): New function
14847 prototype.
14848 (read_dynamic_list): New function prototype.
14849 * symtab.cc (strprefix): New macro.
14850 (Symbol::should_add_dynsym_entry): Support dynamic_list,
14851 dynamic_list_data, dynamic_list_cpp_new, and
14852 dynamic_list_cpp_typeinfo.
14853 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
14854 (dynamic_list_expr): New rule.
14855 (dynamic_list_nodes): Likewise.
14856 (dynamic_list_node): Likewise.
14857 * testsuite/Makefile.am (dynamic_list): New test.
14858 * testsuite/Makefile.in: Regenerated.
14859 * testsuite/dynamic_list.t: New file.
14860 * testsuite/dynamic_list.sh: New file.
14861
e0bb29a5
CS
148622008-11-05 Craig Silverstein <csilvers@google.com>
14863
14864 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
14865 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
14866 (t11_last): Likewise.
14867 * testsuite/ver_test_6.c (main): Likewise.
14868
4e1e25e0
CC
148692008-10-07 Cary Coutant <ccoutant@google.com>
14870
14871 * options.c (General_options::finalize): Add check for -static and
14872 -shared.
14873 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
14874 is not empty.
14875
92f03fcb
CC
148762008-10-02 Cary Coutant <ccoutant@google.com>
14877
14878 * plugin.cc (make_sized_plugin_object): Fix conditional
14879 compilation to work when not all targets are enabled.
14880
fbd8a257
CC
148812008-09-29 Cary Coutant <ccoutant@google.com>
14882
14883 * archive.cc (Archive::get_file_and_offset): Use filename instead
14884 of name to get library path.
14885 (Archive::include_member): Unlock external member of a thin archive.
14886
14887 * testsuite/Makefile.am (TEST_AR): New variable.
14888 (thin_archive_test_1): New test.
14889 (thin_archive_test_2): New test.
81636b3f
CC
14890 * testsuite/Makefile.in: Regenerate.
14891 * testsuite/thin_archive_main.cc: New file.
14892 * testsuite/thin_archive_test_1.cc: New file.
14893 * testsuite/thin_archive_test_2.cc: New file.
14894 * testsuite/thin_archive_test_3.cc: New file.
14895 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 14896
eff45813
CC
148972008-09-29 Cary Coutant <ccoutant@google.com>
14898
14899 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
14900 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
14901 instead of -1U.
14902 (Sized_relobj::do_finalize_local_symbols): Likewise.
14903 (Sized_relobj::map_to_kept_section): Likewise.
14904 * object.h (Sized_relobj::invalid_address): New constant.
14905 (Sized_relobj::do_output_section_offset): Check for invalid_address
14906 and return -1ULL.
14907 * output.cc (Output_reloc::local_section_offset): Use constant
14908 invalid_address instead of -1U.
14909 (Output_reloc::get_address): Likewise.
14910 (Output_section::output_address): Change -1U to -1ULL.
14911 * output.h (Output_reloc::invalid_address): New constant.
14912 * reloc.cc (Sized_relobj::write_sections): Use constant
14913 invalid_address instead of -1U.
14914 (Sized_relobj::relocate_sections): Likewise.
14915 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
14916 values for merge sections.
14917 * target-reloc.h (relocate_for_relocatable): Use constant
14918 invalid_address instead of -1U.
14919
89fc3421
CC
149202008-09-19 Cary Coutant <ccoutant@google.com>
14921
14922 Add plugin functionality for link-time optimization (LTO).
14923 * configure.ac (plugins): Add --enable-plugins option.
14924 * configure: Regenerate.
14925 * config.in: Regenerate.
14926 * Makefile.am (LIBDL): New variable.
14927 (CCFILES): Add plugin.cc.
14928 (HFILES): Add plugin.h.
14929 (ldadd_var): Add LIBDL.
14930 * Makefile.in: Regenerate.
14931
14932 * archive.cc: Include "plugin.h".
14933 (Archive::setup): Don't preread archive symbols when using a plugin.
14934 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
14935 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
14936 files.
14937 (Archive::include_member): Add symbols from plugin objects.
14938 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
14939 * descriptors.cc (Descriptors::open): Check for file descriptors
14940 abandoned by plugins.
14941 (Descriptors::claim_for_plugin): New function.
14942 * descriptors.h (Descriptors::claim_for_plugin): New function.
14943 (Open_descriptor::is_claimed): New field.
14944 (claim_descriptor_for_plugin): New function.
14945 * fileread.cc (File_read::claim_for_plugin): New function.
14946 * fileread.h (File_read::claim_for_plugin): New function.
14947 (File_read::descriptor): New function.
14948 * gold.cc: Include "plugin.h".
14949 (queue_initial_tasks): Add task to call plugin hooks for generating
14950 new object files.
14951 * main.cc: Include "plugin.h".
14952 (main): Load plugin libraries.
14953 * object.h (Pluginobj): Declare.
14954 (Object::pluginobj): New function.
14955 (Object::do_pluginobj): New function.
14956 (Object::set_target): New function.
14957 * options.cc: Include "plugin.h".
14958 (General_options::parse_plugin): New function.
14959 (General_options::General_options): Initialize plugins_ field.
14960 (General_options::add_plugin): New function.
14961 * options.h (Plugin_manager): Declare.
14962 (General_options): Add --plugin option.
14963 (General_options::has_plugins): New function.
14964 (General_options::plugins): New function.
14965 (General_options::add_plugin): New function.
14966 (General_options::plugins_): New field.
14967 * plugin.cc: New file.
14968 * plugin.h: New file.
14969 * readsyms.cc: Include "plugin.h".
14970 (Read_symbols::do_read_symbols): Check for archive before checking
14971 for ELF file. Call plugin hooks to claim files.
14972 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
14973 from a real object file; force override when processing replacement
14974 files.
14975 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
14976 (Symbol::init_base_object): Likewise.
14977 (Symbol::init_base_output_data): Likewise.
14978 (Symbol::init_base_output_segment): Likewise.
14979 (Symbol::init_base_constant): Likewise.
14980 (Symbol::init_base_undefined): Likewise.
14981 (Symbol::output_section): Assert that object is not a plugin.
14982 (Symbol_table::add_from_pluginobj): New function.
14983 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
14984 undefined.
14985 (Symbol_table::sized_write_globals): Likewise.
14986 (Symbol_table::add_from_pluginobj): Instantiate template.
14987 * symtab.h (Sized_pluginobj): Declare.
14988 (Symbol::in_real_elf): New function.
14989 (Symbol::set_in_real_elf): New function.
14990 (Symbol::in_real_elf_): New field.
14991 (Symbol_table::add_from_pluginobj): New function.
14992
14993 * testsuite/Makefile.am (AM_CFLAGS): New variable.
14994 (LIBDL): New variable.
14995 (LDADD): Add LIBDL.
14996 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
14997 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
14998 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
14999 (MOSTLYCLEANFILES): Likewise.
15000 * testsuite/Makefile.in: Regenerate.
15001 * testsuite/plugin_test.c: New file.
15002 * testsuite/plugin_test_1.sh: New file.
15003 * testsuite/plugin_test_2.sh: New file.
15004
de31bda5
ILT
150052008-09-16 Ian Lance Taylor <iant@google.com>
15006
9c2d0ef9
ILT
15007 * target-reloc.h (relocate_section): Check whether a symbol is
15008 defined by the ABI before reporting an undefined symbol error.
15009 * target.h (Target::is_defined_by_abi): Make parameter const.
15010 (Target::do_is_defined_by_abi): Likewise.
15011 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
15012 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
15013 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
15014 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
15015 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
15016 * testsuite/Makefile.in: Rebuild.
15017
de31bda5
ILT
15018 * fileread.cc (make_view): Add casts to avoid warning.
15019
9fa33bee
AO
150202008-09-16 Alexandre Oliva <aoliva@redhat.com>
15021
15022 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
15023 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15024
183fd0e3
AO
150252008-09-16 Alexandre Oliva <aoliva@redhat.com>
15026
15027 * options.h (General_options::output_is_executable): New.
15028 (General_options::output_is_pie): New.
15029 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
15030 for shared libraries.
15031 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15032
7be8330a
CD
150332008-09-11 Chris Demetriou <cgd@google.com>
15034
15035 * options.h (origin): New -z option.
15036 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
15037 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
15038 in DT_FLAGS_1.
15039
a9caad02
CC
150402008-09-05 Cary Coutant <ccoutant@google.com>
15041
15042 * fileread.cc (File_read::make_view): Add check for attempt to map
15043 beyond end of file.
15044
ae6dce4d
CC
150452008-09-05 Cary Coutant <ccoutant@google.com>
15046
15047 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
15048 explicit instantiations.
15049
d7ab2a47
KVH
150502008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
15051
15052 PR gold/6858
15053 * options.cc (General_options::finalize): Allow undefined symbols
15054 in shlibs if linking -shared.
15055
15056 PR gold/6859
15057 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
15058 symbols as not needing a dynsym entry.
15059
1e52a9c1
CS
150602008-08-20 Craig Silverstein <csilvers@google.com>
15061
15062 * fileread.cc (File_read::open): Do not lock the file unless it
15063 was successfully opened.
15064
d85c80a3
CC
150652008-08-14 Cary Coutant <ccoutant@google.com>
15066
15067 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
15068 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
15069 * testsuite/tls_test.cc (struct int128): 128-bit struct
15070 for testing TLS relocs with non-zero addend.
15071 (v12): New TLS variable.
15072 (t12): New test.
15073 (t_last): Add check for v12.
15074 * testsuite/tls_test.h (t12): New function.
15075 * testsuite/tls_test_main.cc (thread_routine): Call new test.
15076
2d924fd9
ILT
150772008-08-13 Ian Lance Taylor <iant@google.com>
15078
15079 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
15080 set tls_segment_ or relro_segment_.
15081 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
15082 when appropriate.
15083 * output.h (Output_section::clear_is_relro): New function.
15084 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
15085 sections specially even when output_data_ is empty.
15086 (Output_segment::maximum_alignment): When first section is relro,
15087 only force alignment for PT_LOAD segments.
15088 * script.cc (script_data_segment_align): New function.
15089 (script_data_segment_relro_end): New function.
15090 * script-c.h (script_data_segment_align): Declare.
15091 (script_data_segment_relro_end): Declare.
15092 * script-sections.h (class Script_sections): Declare
15093 data_segment_align and data_segment_relro_end. Add fields
15094 segment_align_index_ and saw_relro_end_.
15095 * script-sections.cc (class Sections_element): Add set_is_relro
15096 virtual function. Add new bool* parameter to place_orphan_here.
15097 Add get_output_section virtual function.
15098 (class Output_section_definition): Add set_is_relro. Add new
15099 bool* parameter to place_orphan_here. Add get_output_section.
15100 Add is_relro_ field.
15101 (Output_section_definition::Output_section_definition): Initialize
15102 evaluated_address_, evaluated_load_address, evaluated_addralign_,
15103 and is_relro_ fields.
15104 (Output_section_definition::place_orphan_here): Add is_relro
15105 parameter.
15106 (Output_section_definition::set_section_addresses): Set relro for
15107 output section.
15108 (Output_section_definition::alternate_constraint): Likewise.
15109 (class Orphan_output_section): Add new bool* parameter to
15110 place_orphan_here. Add get_output_section.
15111 (Orphan_output_section::place_orphan_here): Add is_relro
15112 parameter.
15113 (Script_sections::Script_sections): Initialize
15114 data_segment_align_index_ and saw_relro_end_.
15115 (Script_sections::data_segment_align): New function.
15116 (Script_sections::data_segment_relro_end): New function.
15117 (Script_sections::place_orphan): Set or clear is_relro.
15118 (Script_sections::set_section_addresses): Force alignment of first
15119 TLS section.
15120 * yyscript.y (exp): Call script_data_segment_align and
15121 script_data_segment_relro_end.
15122 * testsuite/relro_script_test.t: New file.
15123 * testsuite/relro_test.cc (using_script): Declare.
15124 (t1, t2): Test using_script.
15125 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
15126 (relro_script_test_SOURCES): Define.
15127 (relro_script_test_DEPENDENCIES): Define.
15128 (relro_script_test_LDFLAGS): Define.
15129 (relro_script_test_LDADD): Define.
15130 (relro_script_test.so): New target.
15131 * testsuite/Makefile.in: Rebuild.
15132
f827c9a9
CC
151332008-08-06 Cary Coutant <ccoutant@google.com>
15134
15135 * archive.cc (Archive::total_archives, Archive::total_members)
15136 (Archive::total_members_loaded): New variables.
15137 (Archive::setup): Add parameter. Add option to preread
15138 archive symbols.
15139 (Archive::read_armap): Add counter.
15140 (Archive::get_file_and_offset): New function.
15141 (Archive::get_elf_object_for_member): New function.
15142 (Archive::read_all_symbols): New function.
15143 (Archive::read_symbols): New function.
15144 (Archive::add_symbols): Add counters.
15145 (Archive::include_all_members): Use armap to find members if it's
15146 already built.
15147 (Archive::include_member): Skip reading symbols if already read.
15148 Factored code into Archive::get_file_and_offset and
15149 Archive::get_elf_object_for_member. Changed call to
15150 Mapfile::report_include_archive_member.
15151 (Archive::print_stats): New function.
15152 * archive.h: Declare Object and Read_symbols_data classes.
15153 (Archive::Archive): Add initializers for new members.
15154 (Archive::setup): Add parameter.
15155 (Archive::print_stats): New function.
15156 (Archive::total_archives, Archive::total_members)
15157 (Archive::total_members_loaded): New variables.
15158 (Archive::get_file_and_offset): New function.
15159 (Archive::get_elf_object_for_member): New function.
15160 (Archive::read_all_symbols): New function.
15161 (Archive::read_symbols): New function.
15162 (Archive::Archive_member): New class.
15163 (Archive::members_): New member.
15164 (Archive::num_members_): New member.
15165 * main.cc: Include archive.h.
15166 (main): Call Archive::print_stats.
15167 * mapfile.cc (Mapfile::report_include_archive_member): Delete
15168 archive parameter; member_name is now the fully-decorated name.
15169 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
15170 * options.h: (General_options): Add --preread-archive-symbols option.
15171 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
15172 Archive::setup.
15173
de4c45bd
ILT
151742008-08-04 Ian Lance Taylor <iant@google.com>
15175
15176 * symtab.h (Symbol::use_plt_offset): New function.
15177 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
15178 * powerpc.cc (Relocate::relocate): Likewise.
15179 * sparc.cc (Relocate::relocate): Likewise.
15180 * x86_64.cc (Relocate::relocate): Likewise.
15181 * testsuite/weak_plt.sh: New test.
15182 * testsuite/weak_plt_main.cc: New test.
15183 * testsuite/weak_plt_shared.cc: New test.
15184 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
15185 (check_PROGRAMS): Add weak_plt.
15186 (check_DATA): Add weak_plt_shared.so.
15187 (weak_plt_main_pic.o, weak_plt): New targets.
15188 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
15189 * testsuite/Makefile.in: Rebuild.
15190
15191 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
15192 gcctestdir/ld.
15193 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
15194 * testsuite/Makefile.in: Rebuild.
15195
323ee3f4
AM
151962008-08-04 Alan Modra <amodra@bigpond.net.au>
15197
15198 * Makefile.am (POTFILES.in): Set LC_ALL=C.
15199 * Makefile.in: Regenerate.
15200 * po/POTFILES.in: Regenerate.
15201
7c07ecec
ILT
152022008-07-29 Ian Lance Taylor <iant@google.com>
15203
15204 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
15205 symbols before other symbols.
15206 * testsuite/script_test_2.cc (test_addr): Declare.
15207 (test_addr_alias): Declare.
15208 (main): Check that test_addr and test_addr_alias have the right
cd536b21 15209 values.
7c07ecec
ILT
15210 * testsuite/script_test_2.t: Define test_addr_alias and
15211 test_addr.
15212
5778530e
ILT
152132008-07-24 Ian Lance Taylor <iant@google.com>
15214
2a00e4fb
ILT
15215 PR 5990
15216 * descriptors.cc: New file.
15217 * descriptors.h: New file.
15218 * gold-threads.h (class Hold_optional_lock): New class.
15219 * fileread.cc: Include "descriptors.h".
15220 (File_read::~File_read): Release descriptor rather than closing
15221 it.
15222 (File_read::open) [file]: Call open_descriptor rather than open.
15223 Set is_descriptor_opened_.
15224 (File_read::open) [memory]: Assert that descriptor is not open.
15225 (File_read::reopen_descriptor): New function.
15226 (File_read::release): Release descriptor.
15227 (File_read::do_read): Make non-const. Reopen descriptor.
15228 (File_read::read): Make non-const.
15229 (File_read::make_view): Reopen descriptor.
15230 (File_read::do_readv): Likewise.
15231 * fileread.h (class File_read): Add is_descriptor_opened_ field.
15232 Update declarations.
15233 * layout.cc: Include "descriptors.h".
15234 (Layout::create_build_id): Use open_descriptor rather than open.
15235 * output.cc: Include "descriptors.h".
15236 (Output_file::open): Use open_descriptor rather than open.
15237 * archive.cc (Archive::const_iterator): Change Archive to be
15238 non-const.
15239 (Archive::begin, Archive::end): Make non-const.
15240 (Archive::count_members): Likewise.
15241 * archive.h (class Archive): Update declarations.
15242 * object.h (Object::read): Make non-const.
15243 * Makefile.am (CCFILES): Add descriptors.cc.
15244 (HFILES): Add descriptors.h.
15245 * Makefile.in: Rebuild.
15246
801647d1
ILT
15247 PR 6716
15248 * gold.h: Always include <clocale>. Add Solaris workarounds
15249 following code in binutils/sysdep.h.
15250
5edd166e
ILT
15251 PR 6048
15252 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
15253 this->eh_frame_hdr_ is NULL before using it.
15254
c89ad728
ILT
15255 * dynobj.cc (Versions::Versions): Update comment.
15256
aa86f06b
ILT
15257 * dynobj.cc (Versions::Versions): If there is an soname, use it as
15258 the base version name.
15259
5778530e
ILT
15260 * stringpool.cc (Stringpool_template::add_with_length): Set key to
15261 array size plus one.
15262 (Stringpool_template::set_string_offsets): Subtract one from key
15263 before using it as an array index.
15264 (Stringpool_template::get_offset_with_length): Likewise.
15265 (Stringpool_template::write_to_buffer): Likewise.
15266 * stringpool.h (Stringpool_template::get_offset_from_key):
15267 Likewise.
15268
057ead22
ILT
152692008-07-23 Ian Lance Taylor <iant@google.com>
15270
7f649c59
ILT
15271 PR 6658
15272 * object.h (Merged_symbol_value::value): Do our best to handle a
15273 negative addend.
15274
057ead22
ILT
15275 PR 6647
15276 * script.cc (Version_script_info::get_versions): Don't add empty
15277 version tag to return value.
15278 (Version_script_info::get_symbol_version_helper): Change return
15279 type to bool. Add pversion parameter. Change all callers.
15280 (script_register_vers_node): Don't require a non-NULL tag.
15281 * script.h (class Version_script_info): Update declarations.
15282 (Version_script_info::get_symbol_version): Change return type to
15283 bool. Add version parameter. Change all callers.
15284 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
15285 handling. Handle an empty version from a version script.
15286 (Symbol_table::define_special_symbol): Likewise.
15287 * testsuite/ver_test_10.script: New file.
15288 * testsuite/ver_test_10.sh: New file.
15289 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
15290 (check_DATA): Add ver_test_10.syms.
15291 (ver_test_10.syms, ver_test_10.so): New target.
15292 * testsuite/Makefile.in: Rebuild.
15293
58e54ac2
CD
152942008-07-23 Simon Baldwin <simonb@google.com>
15295
15296 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
15297 to zero for undefined symbols from dynamic libraries.
15298
95d14cd3
ILT
152992008-07-23 Ian Lance Taylor <iant@google.com>
15300
15301 * symtab.cc (Symbol_table::resolve): Remove version parameter.
15302 Change all callers.
15303 * symtab.h (class Symbol_table): Update declaration.
15304 * testsuite/ver_test_9.cc: New file.
15305 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
15306 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
15307 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
15308 (ver_test_9.so, ver_test_9.o): New targets.
15309 * testsuite/Makefile.in: Rebuild.
15310
92de84a6
ILT
153112008-07-22 Ian Lance Taylor <iant@google.com>
15312
34810851
ILT
15313 * options.h (class General_options): Define --check-sections.
15314 * layout.cc (Layout::set_segment_offsets): Handle
15315 --check-sections.
15316
af6156ef
ILT
15317 * options.h (class General_options): Define -n/--nmagic and
15318 -N/--omagic.
15319 * options.cc (General_options::finalize): For -n/--nmagic or
15320 -N/--omagic, set -static.
15321 * layout.cc (Layout::attach_allocated_section_to_segment): If
15322 -N/--omagic, don't put read-only and read-write sections in
15323 different segments.
15324 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
15325 finding a read-only segment.
15326 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
15327 don't set the minimum segment alignment to the common page size,
15328 and don't set the file offset to the address modulo the page size.
15329 * script-sections.cc (Script_sections::create_segments): If
15330 -n/--omagic, don't put read-only and read-write sections in
15331 different segments.
15332
92de84a6
ILT
15333 * cref.cc: New file.
15334 * cref.h: New file.
15335 * options.h (class General_options): Add --print-symbol-counts.
15336 * main.cc (main): Issue defined symbol report if requested.
15337 * archive.cc (Archive::interpret_header): Make into a const member
15338 function.
15339 (Archive::add_symbols): Call Input_objects::archive_start and
15340 archive_stop.
15341 (Archive::const_iterator): Define new class.
15342 (Archive::begin, Archive::end): New functions.
15343 (Archive::include_all_members): Rewrite to use iterator.
15344 (Archive::count_members): New function.
15345 * archive.h (class Archive): Update declarations.
15346 (Archive::filename): New function.
15347 * object.cc: Include "cref.h".
15348 (Sized_relobj::Sized_relobj): Initialize defined_count_.
15349 (Sized_relobj::do_get_global_symbol_counts): New function.
15350 (Input_objects::add_object): Add object to cross-referencer.
15351 (Input_objects::archive_start): New function.
15352 (Input_objects::archive_stop): New function.
15353 (Input_objects::print_symbol_counts): New function.
15354 * object.h: Declare Cref and Archive.
15355 (Object::get_global_symbol_counts): New function.
15356 (Object::do_get_global_symbol_counts): New pure virtual function.
15357 (class Sized_relobj): Add defined_count_ field. Update
15358 declarations.
15359 (class Input_objects): Add cref_ field. Update constructor.
15360 Update declarations.
15361 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
15362 defined_count_.
15363 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
15364 symbol counts.
15365 (Sized_dynobj::do_get_global_symbol_counts): New function.
15366 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
15367 defined_count_. Update declarations. Define Symbols typedef.
15368 * symtab.cc (Symbol_table::add_from_relobj): Add defined
15369 parameter. Change all callers.
15370 (Symbol_table::add_from_dynobj): Add sympointers and defined
15371 parameters. Change all callers.
15372 * symtab.h (class Symbol_table): Update declarations.
15373 * Makefile.am (CCFILES): Add cref.cc.
15374 (HFILES): Add cref.h.
15375 * Makefile.in: Rebuild.
15376
3f7c5e1d
CD
153772008-07-22 Simon Baldwin <simonb@google.com>
15378
15379 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
15380 to zero when writing undefined symbols.
15381
e0b64032
ILT
153822008-07-22 Ian Lance Taylor <iant@google.com>
15383
15384 * output.cc (Output_section::add_input_section): Don't try to
15385 merge empty merge sections.
15386
096b02cf
CS
153872008-07-21 Craig Silverstein <csilvers@google.com>
15388
15389 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15390 Include symbol version in error message.
cd536b21 15391
1d1f116d
CD
153922008-07-20 Chris Demetriou <cgd@google.com>
15393
cd536b21 15394 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
15395 (RANDOM_SEED_CFLAGS): New substituted variable.
15396 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
15397 * configure: Rebuild.
15398 * Makefile.in: Likewise.
15399 * testsuite/Makefile.in: Likewise.
15400
a18f591e
ILT
154012008-07-18 Ian Lance Taylor <iant@google.com>
15402
15403 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
15404 where we see NAME/NULL and NAME/VERSION as separate symbols.
15405 * testsuite/ver_test_main.cc (main): Call t4.
15406 (t4, t4_2a): Define.
15407 * testsuite/ver_test_2.cc (t4_2): Define.
15408 * testsuite/ver_test_2.script: Put t4_2a in VER2.
15409 * testsuite/ver_test_4.cc (t4_2a): Define.
15410 * testsuite/ver_test_4.script: Put t4_2a in VER2.
15411 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
15412
c6e3f6ed
ILT
154132008-07-17 Ian Lance Taylor <iant@google.com>
15414
15415 * dynobj.cc (Versions::add_def): If we give an error about a
15416 missing version, go ahead and create the version anyhow.
15417
ef9beddf
ILT
154182008-07-10 Ian Lance Taylor <iant@google.com>
15419
15420 Handle output sections with more than 0x7fffffff bytes.
15421 * object.h (class Relobj): Change map_to_output_ to
15422 output_sections_, and just keep a section pointer. Change all
15423 uses. Move comdat group support to Sized_relobj.
15424 (Relobj::is_section_specially_mapped): Remove.
15425 (Relobj::output_section): Remove poff parameter. Change all
15426 callers.
15427 (Relobj::output_section_offset): New function.
15428 (Relobj::set_section_offset): Rewrite.
15429 (Relobj::map_to_output): Remove.
15430 (Relobj::output_sections): New function.
15431 (Relobj::do_output_section_offset): New pure virtual function.
15432 (Relobj::do_set_section_offset): Likewise.
15433 (class Sized_relobj): Add section_offsets_ field. Add comdat
15434 group support from Relobj. Update declarations.
15435 (Sized_relobj::get_output_section_offset): New function.
15436 (Sized_relobj::do_output_section_offset): New function.
15437 (Sized_relobj::do_set_section_offset): New function.
15438 * object.cc (Relobj::output_section_address): Remove.
15439 (Sized_relobj::Sized_relobj): Initialize new fields.
15440 (Sized_relobj::include_section_group): Cast find_kept_object to
15441 Sized_relobj.
15442 (Sized_relobj::include_linkonce_section): Likewise.
15443 (Sized_relobj::do_layout): Use separate arrays for output section
15444 and output offset.
15445 (Sized_relobj::do_count_local_symbols): Change map_to_output to
15446 output_sections.
15447 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
15448 output_sections and section_offsets.
15449 (Sized_relobj::write_local_symbols): Likewise.
15450 (map_to_kept_section): Compute output address directly.
15451 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
15452 output_sections and section_offsets.
15453 (Sized_relobj::write_sections): Likewise.
15454 (Sized_relobj::relocate_sections): Likewise.
15455 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
15456 * output.h (class Output_reloc): Update declarations. Change
15457 u2_.relobj to Sized_relobj*.
15458 (class Output_data_reloc): Change add functions to use
15459 Sized_relobj*.
15460 * output.cc (Output_reloc::Output_reloc): Change relobj to
15461 Sized_relobj*.
15462 (Output_reloc::local_section_offset): Change return type to
15463 Elf_Addr. Use get_output_section_offset.
15464 (Output_reloc::get_address): Likewise.
15465 (Output_section::is_input_address_mapped): Don't call
15466 is_section_specially_mapped.
15467 (Output_section::output_offset): Likewise.
15468 (Output_section::output_address): Likewise.
15469 (Output_section::starting_output_address): Likewise.
15470 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
15471 parameter to Sized_relobj*.
15472 (Copy_relocs::need_copy_reloc): Likewise.
15473 (Copy_relocs::save): Likewise.
15474 * copy-relocs.h (class Copy_relocs): Update declarations.
15475 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
15476 Sized_relobj*. Change relobj_ field to Sized_relobj*.
15477 * target-reloc.h (relocate_for_relocatable): Change
15478 offset_in_output_section type to Elf_Addr. Change code that uses
15479 it as well.
15480 * layout.cc (Layout::layout): Always set *off.
15481 * mapfile.cc (Mapfile::print_input_section): Use
15482 output_section_offset.
15483 * i386.cc (Target_i386::copy_reloc): Change object parameter to
15484 Sized_relobj*.
15485 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
15486 * sparc.cc (Target_sparc::copy_reloc): Likewise.
15487 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
15488
5cb66f97
ILT
154892008-07-03 Ian Lance Taylor <iant@google.com>
15490
15491 * layout.cc (Layout::include_section): Do not discard unrecognized
15492 SHT_STRTAB sections.
15493
afe47622
CS
154942008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
15495
15496 * script.cc (Lex::can_continue_name): Make '?' allowable in
15497 version-script names.
15498 * testsuite/version_script.map: Change glob pattern to use '?'
15499
5adf9721
ILT
155002008-06-30 Manish Singh <yosh@gimp.org>
15501
15502 PR 6585
15503 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
15504 Correct typo.
15505
e6fde208
ILT
155062008-06-30 Ian Lance Taylor <iant@google.com>
15507
15508 PR 6660
15509 PR 6682
15510 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
15511 versions]: Don't try to read the value in the contents, since we
15512 don't use it. Use the template endianness when writing.
15513
3f2e6a2d
CC
155142008-06-25 Cary Coutant <ccoutant@google.com>
15515
15516 * fileread.cc (File_read::make_view): Assert on zero-length view.
15517 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
15518 symbol table when there are no symbols to read.
15519
c43d3a48
CS
155202008-06-23 Craig Silverstein <csilvers@google.com>
15521
15522 * version.cc (version_string): Bump to 1.7
15523
5f494ea0
CS
155242008-06-18 Craig Silverstein <csilvers@google.com>
15525
15526 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
15527 constant 0xFFFF to type Valtype.
15528 (Powerpc_relocate_functions::rel16_ha): Likewise.
15529
c42e122e
ILT
155302008-06-17 Ian Lance Taylor <iant@google.com>
15531
f34787f8
ILT
15532 * output.h (Output_section::Input_section): Initialize p2align_ to
15533 zero for Output_section_data constructors.
15534 (Output_section::Input_section::addralign): If not an input
15535 section, return the alignment of the Output_section_data.
15536 * testsuite/copy_test.cc: New file.
15537 * testsuite/copy_test_1.cc: New file.
15538 * testsuite/copy_test_2.cc: New file.
15539 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
15540 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
15541 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
15542 (copy_test_1_pic.o, copy_test_1.so): New targets.
15543 (copy_test_2_pic.o, copy_test_2.so): New targets.
15544 * testsuite/Makefile.in: Rebuild.
15545
c42e122e
ILT
15546 * script-sections.cc (Script_sections::place_orphan): Initialize
15547 local variable exact.
15548
ce3ac18a
DE
155492008-06-13 David Edelsohn <edelsohn@gnu.org>
15550
15551 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
15552
42cacb20
DE
155532008-06-12 David Edelsohn <edelsohn@gnu.org>
15554 David S. Miller <davem@davemloft.net>
15555
15556 * powerpc.cc: New file.
15557 * Makefile.am (TARGETSOURCES): Add powerpc.cc
15558 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
15559 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
15560 * Makefile.in: Rebuild.
15561
7b308235
ILT
155622008-06-09 Ian Lance Taylor <iant@google.com>
15563
15564 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
15565 <exception>.
15566 (throwing, orig_terminate): New static variables.
15567 (terminate_handler): New static function.
15568 (t2): Set terminate handler.
15569
f0b886e3
ILT
155702008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
15571
15572 PR 6584
cd536b21 15573 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
15574 alignment.
15575
3e90f135
CC
155762008-05-30 Cary Coutant <ccoutant@google.com>
15577
15578 * archive.cc (Archive::include_all_members) Correct to step
15579 over symbol table and extended name table in thin archives.
15580
e09ad04a
ILT
155812008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
15582
15583 PR 6407
15584 * target-reloc.h (relocate_for_relocatable): Fix new_offset
15585 calculation.
15586
62b01cb5
ILT
155872008-05-28 Caleb Howe <cshowe@google.com>
15588
15589 * reduced_debug_output.cc: New file.
15590 * reduced_debug_output.h: New file.
92de84a6 15591 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
15592 * options.cc (General_options::finalize): Add strip_debug_non_line
15593 to the strip heirarchy.
15594 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
15595 fields.
15596 * layout.cc: Include "reduced_debug_output.h".
15597 (Layout::Layout): Initialize new fields.
15598 (line_only_debug_sections): New static array.
15599 (is_lines_only_debug_sections): New static inline function.
15600 (Layout::include_section): Handle --strip-debug-non-line.
15601 (Layout::make_output_section): If --strip-debug-non-line, build
15602 new output sections for .debug_abbrev and .debug_info.
15603 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
15604 gold. Warn about possible overflow.
15605 (read_signed_LEB_128): Likewise.
15606 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
15607 (read_signed_LEB_128): Declare.
15608 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
15609 (HFILES): Add reduced_debug_output.h.
15610 * Makefile.in: Rebuild.
15611
7d9e3d98
ILT
156122008-05-21 Ian Lance Taylor <iant@google.com>
15613
15614 * mapfile.cc: New file.
15615 * mapfile.h: New file.
15616 * options.h (class General_options): Add -M/--print-map and -Map.
15617 * options.cc (General_options::finalize): Make -M equivalent to
15618 -Map -.
15619 * main.cc: Include <cstdio> and "mapfile.h".
15620 (main): Open mapfile if requested.
15621 * gold.cc (class Middle_runner): Add mapfile_ field. Update
15622 constructor. Change caller.
15623 (queue_initial_tasks): Add mapfile parameter. Change caller.
15624 (queue_middle_tasks): Likewise.
15625 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
15626 declarations.
15627 * archive.cc: Include "mapfile.h".
15628 (Archive::add_symbols): Add mapfile parameter. Change all
15629 callers. Pass mapfile, symbol, and reason to include_member.
15630 (Archive::include_all_members): Add mapfile parameter. Change all
15631 callers.
15632 (Archive::include_member): Add mapfile, sym, and why parameters.
15633 Change all callers. Report inclusion to map file.
15634 * archive.h: Include "fileread.h".
15635 (class Archive): Update declarations.
15636 (Archive::file): New const method.
15637 (class Add_archive_symbols): Add mapfile_ field. Update
15638 constructor. Change all callers.
15639 * readsyms.h (class Read_symbols): Likewise.
15640 (class Finish_group): Likewise.
15641 (class Read_script): Likewise.
15642 * common.cc: Include "mapfile.h".
15643 (Symbol_table::allocate_commons): Add mapfile parameter. Change
15644 all callers.
15645 (Symbol_table::do_allocate_commons): Likewise.
15646 (Symbol_table::do_allocate_commons_list): Likewise. Report common
15647 symbol allocation to mapfile.
15648 * common.h (class Allocate_commons_task): Add mapfile_ field.
15649 Update constructor. Change all callers.
15650 * symtab.h (class Symbol_table): Update declarations.
15651 * layout.cc: Include "mapfile.h".
15652 (Layout_task_runner::run): Print information to mapfile.
15653 (Layout::create_gold_note): Change Output_data_fixed_space to
15654 Output_data_zero_fill.
15655 (Layout::create_build_id): Likewise.
15656 (Layout::print_to_mapfile): New function.
15657 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
15658 constructor. Change caller.
15659 (class Layout): Declare print_to_mapfile.
15660 * output.cc (Output_section::Input_section::print_to_mapfile): New
15661 function.
15662 (Output_section::add_input_section): If producing a map, always
15663 add to input_sections_ list.
15664 (Output_section::do_print_to_mapfile): New function.
15665 (Output_segment::print_sections_to_mapfile): New function.
15666 (Output_segment::print_section_list_to_mapfile): New function.
15667 * output.h: Include "mapfile.h".
15668 (Output_data::print_to_mapfile): New function.
15669 (Output_data::do_print_to_mapfile): New virtual function.
15670 (Output_segment_headers::do_print_to_mapfile): New function.
15671 (Output_file_header::do_print_to_mapfile): New function.
15672 (Output_data_const::do_print_to_mapfile): New function.
15673 (class Output_data_const_buffer): Add map_name_ field. Update
15674 constructor. Change all callers. Add do_print_to_mapfile
15675 function.
15676 (class Output_data_fixed_space): Likewise.
15677 (class Output_data_space): Likewise.
15678 (class Output_data_zero_fill): New class.
15679 (Output_data_strtab::do_print_to_mapfile): New function.
15680 (Output_data_reloc_base::do_print_to_mapfile): New function.
15681 (Output_relocatable_relocs::do_print_to_mapfile): New function.
15682 (Output_data_group::do_print_to_mapfile): New function.
15683 (Output_data_got::do_print_to_mapfile): New function.
15684 (Output_data_dynamic::do_print_to_mapfile): New function.
15685 (Output_symtab_xindex::do_print_to_mapfile): New function.
15686 (class Output_section): Declare do_print_to_mapflie. Declare
15687 print_to_mapfile in Input_section.
15688 (class Output_segment): Declare new functions.
15689 * object.h (Sized_relobj::symbol_count): New function.
15690 * script-sections.cc
15691 (Output_section_element_dot_assignment::set_section_addresses):
15692 Change Output_data_fixed_space to Output_data_zero_fill.
15693 (Output_data_expression::do_print_to_mapfile): New function.
15694 * script.cc (read_input_script): Add mapfile parameter. Change
15695 all callers.
15696 * script.h (read_input_script): Update declaration.
15697 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
15698 (Eh_frame::do_print_to_mapfile): New function.
15699 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
15700 (Output_merge_string::do_print_to_mapfile): New function.
15701 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
15702 function.
15703 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
15704 function.
15705 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
15706 function.
15707 * Makefile.am (CCFILES): Add mapfile.cc.
15708 (HFILES): Add mapfile.h.
15709 * Makefile.in: Rebuild.
15710
9f1d377b
ILT
157112008-05-19 Ian Lance Taylor <iant@google.com>
15712
15713 * options.h (class General_options): Add -z relro.
15714 * layout.cc (Layout::Layout): Initialize relro_segment_.
15715 (Layout::add_output_section_data): Return the output section.
15716 (Layout::make_output_section): Rcognize relro sections and mark
15717 them appropriately.
15718 (Layout::attach_allocated_section_to_segment): Put relro sections
15719 in a PT_GNU_RELRO segment.
15720 (Layout::create_initial_dynamic_sections): Mark the .dynamic
15721 section as relro.
15722 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
15723 PT_TLS segments.
15724 (Layout::linkonce_mapping): Map d.rel.ro.local to
15725 .data.rel.ro.local.
15726 (Layout::output_section_name): Us .data.rel.ro.local for any
15727 section which begins with that.
15728 * layout.h (class Layout): Update add_output_section_data
15729 declaration. Add relro_segment_ field.
15730 * output.cc (Output_section::Output_section): Initialize is_relro_
15731 and is_relro_local_ fields.
15732 (Output_segment::add_output_section): Group relro sections.
15733 (Output_segment::is_first_section_relro): New function.
15734 (Output_segment::maximum_alignment): If there is a relro section,
15735 align the segment to the common page size.
15736 (Output_segment::set_section_addresses): Track whether we are
15737 looking at relro sections. If the last section is a relro
15738 section, align to the common page size.
15739 (Output_segment::set_section_list_addresses): Add in_relro
15740 parameter. Change all callers. Align to the page size when
15741 moving from relro to non-relro section.
15742 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
15743 segment.
15744 * output.h (class Output_section): Add is_relro_ and
15745 is_relro_local_ fields.
15746 (Output_section::is_relro): New function.
15747 (Output_section::set_is_relro): New function.
15748 (Output_section::is_relro_local): New function.
15749 (Output_section::set_is_relro_local): New function.
15750 (class Output_segment): Update declarations.
15751 * i386.cc (Target_i386::got_section): Mark .got section as relro.
15752 * sparc.cc (Target_sparc::got_section): Likewise.
15753 * x86_64.cc (Target_x86_64::got_section): Likewise.
15754 * testsuite/relro_test_main.cc: New file.
15755 * testsuite/relro_test.cc: New file.
15756 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
15757 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
15758 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
15759 (relro_test.so, relro_test_pic.o): New targets.
15760 * testsuite/Makefile.in: Rebuild.
15761
a984ee1d
ILT
157622008-05-16 Ian Lance Taylor <iant@google.com>
15763
01676dcd
ILT
15764 * output.cc (Output_segment::add_output_section): Remove front
15765 parameter.
15766 * output.h (class Output_segment): Remove
15767 add_initial_output_section and overloaded add_output_section.
15768 Update declaration of remaining add_output_section.
15769 * layout.cc (Layout::create_interp): Call add_output_section
15770 rather than add_initial_output_section.
15771 (Layout::finish_dynamic_section): Likewise.
15772
497897f9
ILT
15773 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
15774 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
15775 know the dynamic type.
15776 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
15777 field. Initialize it in constructor.
15778 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
15779 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
15780 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
15781 reloc.
15782
a984ee1d
ILT
15783 * output.cc (Output_reloc::get_address): Change return type to
15784 Elf_Addr.
15785 * output.h (class Output_reloc): Update get_address declaration.
15786 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
15787 for section addresses.
15788
55ba0940
ILT
157892008-05-09 Ian Lance Taylor <iant@google.com>
15790
15791 PR 6493
15792 * gold.cc (gold_nomem): Use return value of write.
15793
75517b77
ILT
157942008-05-08 Ian Lance Taylor <iant@google.com>
15795
15796 * symtab.c (Symbol::init_base_output_data): Add version
15797 parameter. Change all callers.
15798 (Symbol::init_base_output_segment): Likewise.
15799 (Symbol::init_base_constant): Likewise.
15800 (Symbol::init_base_undefined): Likewise.
15801 (Sized_symbol::init_output_data): Likewise.
15802 (Sized_symbol::init_output_segment): Likewise.
15803 (Sized_symbol::init_constant): Likewise.
15804 (Sized_symbol::init_undefined): Likewise.
15805 (Symbol_table::do_define_in_output_data): If the new symbol has a
15806 version, mark it as the default.
15807 (Symbol_table::do_define_in_output_segment): Likewise.
15808 (Symbol_table::do_define_as_constant): Likewise.
15809 * symtab.h (class Symbol): Update declarations.
15810 (class Sized_symbol): Likewise.
15811 * resolve.cc (Symbol::override_version): New function.
c42e122e 15812 (Symbol::override_base): Call override_version.
75517b77
ILT
15813 (Symbol::override_base_with_special): Likewise.
15814 * testsuite/ver_script_8.script: New file.
15815 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
15816 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
15817 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
15818 (ver_test_8_1.so, ver_test_8_2.so): New targets.
15819
f1f70eae
ILT
158202008-05-06 Ian Lance Taylor <iant@google.com>
15821
f3e9c5c5
ILT
15822 PR 6049
15823 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
15824 functions.
15825 (class General_options): Remove existing --undefined, and add
15826 --no-undefined instead. Add new --undefined as synonym for -u.
15827 * archive.cc (Archive::add_symbols): Check whether symbol was
15828 named with -u.
15829 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
15830 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
15831 all uses. Add IS_UNDEFINED. Update declarations to split
15832 different versions of init_base. Declare init_base_undefined.
15833 (Symbol::is_defined): Handle IS_UNDEFINED.
15834 (Symbol::is_undefined): Likewise.
15835 (Symbol::is_weak_undefined): Call is_undefined.
15836 (Symbol::is_absolute): Handle IS_CONSTANT.
15837 (class Sized_symbol): Update declarations to split different
15838 versions of init. Declare init_undefined.
15839 (class Symbol_table): Declare new functions.
15840 * symtab.cc (Symbol::init_base_object): Rename from init_base.
15841 Change all callers.
15842 (Symbol::init_base_output_data): Likewise.
15843 (Symbol::init_base_output_segment): Likewise.
15844 (Symbol::init_base_constant): Likewise.
15845 (Symbol::init_base_undefined): New function.
15846 (Sized_symbol::init_object): Rename from init. Change all
15847 callers.
15848 (Sized_symbol::init_output_data): Likewise.
15849 (Sized_symbol::init_output_segment): Likewise.
15850 (Sized_symbol::init_constant): Likewise.
15851 (Sized_symbol::init_undefined): New function.
15852 (Symbol_table::add_undefined_symbols_from_command_line): New
15853 function.
15854 (Symbol_table::do_add_undefined_symbols_from_command_line): New
15855 function.
15856 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
15857 (Symbol::output_section): Likewise.
15858 (Symbol::set_output_section): Likewise.
15859 (Symbol_table::sized_finalize_symbol): Likewise.
15860 (Symbol_table::sized_write_globals): Likewise.
15861 * resolve.cc (Symbol_table::should_override): Likewise.
15862 (Symbol::override_base_with_special): Likewise.
15863
8bdcdf2c
ILT
15864 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
15865 symbol, change it to have default visibility.
15866 * testsuite/protected_1.cc: New file.
15867 * testsuite/protected_2.cc: New file.
15868 * testsuite/protected_3.cc: New file.
15869 * testsuite/protected_main_1.cc: New file.
15870 * testsuite/protected_main_2.cc: New file.
15871 * testsuite/protected_main_3.cc: New file.
15872 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
15873 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
15874 (protected_1_LDFLAGS, protected_1_LDADD): Define.
15875 (protected_1.so): New target.
15876 (protected_1_pic.o, protected_2_pic.o): New targets.
15877 (protected_3_pic.o): New target.
15878 (check_PROGRAMS): Add protected_2.
15879 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
15880 (protected_2_LDFLAGS, protected_2_LDADD): Define.
15881 * testsuite/Makefile.in: Rebuild.
15882
2b706932
ILT
15883 * options.h (DEFINE_var): Add set_user_set_##varname__.
15884 (DEFINE_bool_alias): New macro.
15885 (class General_options): Define -Bstatic using DEFINE_bool_alias
15886 rather than DEFINE_special. Add --undefined as an alias for -z
15887 defs.
15888 * options.cc (General_options::parse_Bstatic): Remove.
15889
d82a5bcc
ILT
15890 * options.h (class General_options): Add --fatal-warnings.
15891 * main.cc (main): Implement --fatal-warnings.
15892 * errors.h (Errors::warning_count): New function.
15893
f1f70eae
ILT
15894 * options.h (class General_options): Add -Bsymbolic-functions.
15895 * symtab.h (Symbol::is_preemptible): Check for
15896 -Bsymbolic-functions.
15897
8825ac63
ILT
158982008-05-05 Ian Lance Taylor <iant@google.com>
15899
d98bc257
ILT
15900 * options.h (DEFINE_bool): For DASH_Z, create the negative option
15901 as noVARNAME rather than no-VARNAME.
15902 (class General_options): Add option -z combreloc.
15903 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
15904 get_address.
15905 (Output_reloc::sort_before) [SHT_REL]: New function.
15906 (Output_reloc::sort_before) [SHT_RELA]: New function.
15907 (class Output_data_reloc_base): Add sort_relocs_ field. Define
15908 Sort_relocs_comparison.
15909 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
15910 parameter. Change all callers.
15911 (Output_data_reloc::Output_data_reloc) [both versions]: Add
15912 sort_relocs parameter. Change all callers.
15913 * output.cc (Output_reloc::get_address): New function, broken out
15914 of write_rel.
15915 (Output_reloc::write_rel): Call it.
15916 (Output_reloc::compare): New function.
15917 (Output_data_reloc_base::do_write): Optionally sort relocs.
15918
60b2b4e7
ILT
15919 * configure.ac: If targ_extra_obj is set, link it in.
15920 * configure.tgt: Initialize all variables.
15921 (x86_64*): Set targ_extra_obj and targ_extra_size.
15922 * configure: Rebuild.
15923
8825ac63
ILT
15924 * object.cc (Sized_relobj::include_section_group): Adjust section
15925 indexes read from group data. Build vector to pass to
15926 layout_group.
15927 * layout.cc (Layout::layout_group): Add flags and shndxes
15928 parameters. Remove contents parameter. Change caller. Update
15929 explicit instantiations.
15930 * layout.h (class Layout): Update layout_group declaration.
15931 * output.cc (Output_data_group::Output_data_group): Add flags and
15932 input_shndxes parameters. Remove contents parameter. Change
15933 caller.
15934 (Output_data_group::do_write): Change input_sections_ to
15935 input_shndxes_.
15936 * output.h (class Output_data_group): Update constructor
15937 declaration. Rename input_sections_ to input_shndxes_.
15938 * testsuite/many_sections_test.cc: Add template.
15939
e94cf127
CC
159402008-04-30 Cary Coutant <ccoutant@google.com>
15941
4418b2d5
CC
15942 * target-reloc.h (relocate_section): Fix dead-pointer bug.
15943
e94cf127
CC
15944 * layout.cc (Layout::include_section): Refactored check for debug
15945 info section.
15946 (Layout::add_comdat): Add new parameters. Change type
15947 of signature parameter. Add object and shndx to signatures table.
15948 (Layout::find_kept_object): New function.
15949 * layout.h: Include <cstring>.
15950 (Layout::is_debug_info_section): New function.
15951 (Layout::add_comdat): Add new parameters.
15952 (Layout::find_kept_object): New function.
15953 (Layout::Kept_section): New struct.
15954 (Layout::Signatures): Change type of map range.
15955 * object.cc (Relobj::output_section_address): New function.
15956 (Sized_relobj::include_section_group): Add new parameters. Change
15957 calls to Layout::add_comdat. Change to build table of kept comdat
15958 groups and table mapping discarded sections to kept sections.
15959 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
15960 (Sized_relobj::do_layout): Change calls to include_section_group and
15961 include_linkonce_section.
15962 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
15963 value to zero when section is discarded.
15964 (Sized_relobj::map_to_kept_section): New function.
15965 * object.h (Relobj::output_section_address): New function.
15966 (Relobj::Comdat_group): New type.
15967 (Relobj::find_comdat_group): New function.
15968 (Relobj::Comdat_group_table): New type.
15969 (Relobj::Kept_comdat_section): New type.
15970 (Relobj::Kept_comdat_section_table): New type.
15971 (Relobj::add_comdat_group): New function.
15972 (Relobj::set_kept_comdat_section): New function.
15973 (Relobj::get_kept_comdat_section): New function.
15974 (Relobj::comdat_groups_): New field.
15975 (Relobj::kept_comdat_sections_): New field.
15976 (Symbol_value::input_value): Update comment.
15977 (Sized_relobj::map_to_kept_section) New function.
15978 (Sized_relobj::include_linkonce_section): Add new parameter.
15979 * target-reloc.h (Comdat_behavior): New type.
15980 (get_comdat_behavior): New function.
15981 (relocate_section): Add code to map a discarded section to the
15982 corresponding kept section when applying a relocation.
15983
e4e5049b
CS
159842008-04-30 Craig Silverstein <csilvers@google.com>
15985
15986 * dwarf_reader.cc (next_generation_count): New static var.
15987 (Addr2line_cache_entry): New struct.
15988 (addr2line_cache): New static var.
15989 (Dwarf_line_info::one_addr2line): Added caching.
15990 (Dwarf_line_info::clear_addr2line_cache): New function.
15991 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
15992 cache-size parameter.
15993 (Dwarf_line_info::one_addr2line_cache): New function.
15994 * symtab.cc (Symbol_table::detect_odr_violations): Pass
15995 new cache-size argument to one_addr2line(), and clear cache.
15996
d09e9154
CC
159972008-04-28 Cary Coutant <ccoutant@google.com>
15998
15999 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
16000 R_386_PC8 relocations.
16001
7ef73768
ILT
160022008-04-23 Ian Lance Taylor <iant@google.com>
16003
55438702
ILT
16004 * object.cc (Sized_relobj::include_section_group): Check for
16005 invalid section group.
16006
c165fb93
ILT
16007 * object.cc (make_elf_object): Correct test for 64-bit ELF file
16008 header size.
16009
7ef73768
ILT
16010 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
16011 than read for file header.
16012 * archive.cc (Archive::include_member): Likewise.
16013
6194aaab
L
160142008-04-23 Paolo Bonzini <bonzini@gnu.org>
16015
16016 * aclocal.m4: Regenerate.
16017 * configure: Regenerate.
16018
d491d34e
ILT
160192008-04-19 Ian Lance Taylor <iant@google.com>
16020
5ea2bac6
ILT
16021 * version.cc (version_string): Bump to 1.6.
16022
7bc3e21a
ILT
16023 * testsuite/Makefile.am (many_sections_r_test): New target.
16024 (many_sections_r_test_SOURCES): Remove.
16025 (many_sections_r_test_DEPENDENCIES): Remove.
16026 (many_sections_r_test_LDFLAGS): Remove.
16027 (many_sections_r_test_LDADD): Remove.
16028
7fcd3aa9
ILT
16029 * object.cc (Sized_relobj::do_add_symbols): Always pass
16030 local_symbol_count_ to add_from_relobj.
16031
4c94d6ae
ILT
16032 * testsuite/Makefile.am (many_sections_check.h): Only check one in
16033 every thousand variables.
16034 * testsuite/Makefile.in: Rebuild.
16035
d491d34e
ILT
16036 * object.cc (Xindex::initialize_symtab_xindex): New function.
16037 (Xindex::read_symtab_xindex): New function.
16038 (Xindex::sym_xindex_to_shndx): New function.
16039 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
16040 available.
16041 (Sized_relobj::do_initialize_xindex): New function.
16042 (Sized_relobj::do_read_symbols): Adjust section links.
16043 (Sized_relobj::symbol_section_and_value): Add is_ordinary
16044 parameter. Change all callers.
16045 (Sized_relobj::include_section_group): Adjust section links and
16046 symbol section indexes.
16047 (Sized_relobj::do_layout): Adjust section links.
16048 (Sized_relobj::do_count_local_symbols): Adjust section links and
16049 symbol section indexes.
16050 (Sized_relobj::do_finalize_local_symbols): Distinguish between
16051 ordinary and special symbols.
16052 (Sized_relobj::write_local_symbols): Add symtab_xindex and
16053 dynsym_xindex parameters. Change all callers. Adjust section
16054 links. Use SHN_XINDEX when needed.
16055 (Sized_relobj::get_symbol_location_info): Adjust section links.
16056 Don't get fooled by special symbols.
16057 * object.h (class Xindex): Define.
16058 (class Object): Add xindex_ parameter. Declare virtual functoin
16059 do_initialize_xindex.
16060 (Object::adjust_sym_shndx): New function.
16061 (Object::set_xindex): New protected function.
16062 (class Symbol_value): Add is_ordinary_shndx_ field.
16063 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
16064 (Symbol_value::value): Assert ordinary section.
16065 (Symbol_value::initialize_input_to_output_map): Likewise.
16066 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
16067 Change all callers.
16068 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
16069 all callers.
16070 (class Sized_relobj): Update declarations.
16071 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
16072 parameter. Change all callers.
16073 (Sized_relobj::adjust_shndx): New function.
16074 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
16075 field.
16076 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
16077 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
16078 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
16079 (Sized_dynobj::read_dynsym_section): Adjust section links.
16080 (Sized_dynobj::read_dynamic): Likewise.
16081 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
16082 section links.
16083 (Sized_dynobj::do_initialize_xindex): New function.
16084 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
16085 do_initialize_xindex.
16086 (Sized_dynobj::adjust_shndx): New function.
16087 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
16088 dynsym_xindex_ fields.
16089 (Layout::finalize): Add a call to set_section_indexes before
16090 creating the symtab sections.
16091 (Layout::set_section_indexes): Don't do anything if the section
16092 already has a section index.
16093 (Layout::create_symtab_sections): Add shnum parameter. Change
16094 caller. Create .symtab_shndx section if needed.
16095 (Layout::create_shdrs): Add shstrtab_section parameter. Change
16096 caller.
16097 (Layout::allocated_output_section_count): New function.
16098 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
16099 needed.
16100 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
16101 fields. Update declarations.
16102 (Layout::symtab_xindex): New function.
16103 (Layout::dynsym_xindex): New function.
16104 (class Write_symbols_task): Add layout_ field.
16105 (Write_symbols_task::Write_symbols_task): Add layout parameter.
16106 Change caller.
16107 * output.cc (Output_section_headers::Output_section_headers): Add
16108 shstrtab_section parameter. Change all callers.
16109 (Output_section_headers::do_sized_write): Store overflow values
16110 for section count and section string table section index in
16111 section header zero.
16112 (Output_file_header::do_sized_write): Check for overflow of
16113 section count and section string table section index.
16114 (Output_symtab_xindex::do_write): New function.
16115 (Output_symtab_xindex::endian_do_write): New function.
16116 * output.h (class Output_section_headers): Add shstrtab_section_.
16117 Update declarations.
16118 (class Output_symtab_xindex): Define.
16119 (Output_section::has_out_shndx): New function.
16120 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
16121 field.
16122 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
16123 Change all callers.
16124 (Sized_symbol::init): Likewise.
16125 (Symbol::output_section): Check for ordinary symbol.
16126 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
16127 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
16128 callers.
16129 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
16130 Change all callers. Simplify handling of symbols from sections
16131 not included in the link.
16132 (Symbol_table::add_from_dynobj): Handle ordinary symbol
16133 distinction.
16134 (Weak_alias_sorter::operator()): Assert that symbols are
16135 ordinary.
16136 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
16137 distinction.
16138 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
16139 parameters. Change all callers.
16140 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
16141 symbol distinction. Use SHN_XINDEX when needed.
16142 (Symbol_table::write_section_symbol): Add symtab_xindex
16143 parameter. Change all callers.
16144 (Symbol_table::sized_write_section_symbol): Likewise. Use
16145 SHN_XINDEX when needed.
16146 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
16147 declarations.
16148 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
16149 (Symbol::is_defined): Check is_ordinary.
16150 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
16151 (Symbol::is_absolute, Symbol::is_common): Likewise.
16152 (class Sized_symbol): Update declarations.
16153 (class Symbol_table): Update declarations.
16154 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
16155 parameters. Change all callers.
16156 (Sized_symbol::override): Likewise.
16157 (Symbol_table::override): Likewise.
16158 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
16159 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
16160 is_ordinary, and orig_st_shndx parameters. Change all callers.
16161 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
16162 to be in an ordinary section.
16163 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
16164 object and is_ordinary parameters. Change all callers.
16165 (Sized_dwarf_line_info::read_relocs): Add object parameter.
16166 Change all callers. Don't add undefined or non-ordinary symbols
16167 to reloc_map_.
16168 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
16169 Change all callers.
16170 * dwarf_reader.h (class Sized_dwarf_line_info): Update
16171 declarations.
16172 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
16173 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
16174 (Sized_relobj::relocate_sections): Likewise.
16175 * target-reloc.h (scan_relocs): Adjust section symbol index.
16176 (scan_relocatable_relocs): Likewise.
16177 * i386.cc (Scan::local): Check for ordinary symbols.
16178 * sparc.cc (Scan::local): Likewise.
16179 * x86_64.cc (Scan::local): Likewise.
16180 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
16181 to symbol_section_and_value.
16182 * testsuite/many_sections_test.cc: New file.
16183 * testsuite/Makefile.am (BUILT_SOURCES): Define.
16184 (check_PROGRAMS): Add many_sections_test.
16185 (many_sections_test_SOURCES): Define.
16186 (many_sections_test_DEPENDENCIES): Define.
16187 (many_sections_test_LDFLAGS): Define.
16188 (BUILT_SOURCES): Add many_sections_define.h.
16189 (many_sections_define.h): New target.
16190 (BUILT_SOURCES): Add many_sections_check.h.
16191 (many_sections_check.h): New target.
16192 (check_PROGRAMS): Add many_sections_r_test.
16193 (many_sections_r_test_SOURCES): Define.
16194 (many_sections_r_test_DEPENDENCIES): Define.
16195 (many_sections_r_test_LDFLAGS): Define.
16196 (many_sections_r_test_LDADD): Define.
16197 (many_sections_r_test.o): New target.
16198 * testsuite/Makefile.in: Rebuild.
16199
c5818ff1
CC
162002008-04-17 Cary Coutant <ccoutant@google.com>
16201
16202 * errors.cc (Errors::info): New function.
16203 (gold_info): New function.
16204 * errors.h (Errors::info): New function.
16205 * gold.h (gold_info): New function.
16206 * object.cc (Input_objects::add_object): Print trace output.
16207 * options.cc (options::parse_set): New function.
16208 (General_options::parse_wrap): Deleted.
16209 (General_options::General_options): Deleted initializer.
16210 * options.h (options::String_set): New typedef.
16211 (options::parse_set): New function.
16212 (DEFINE_set): New macro.
16213 (General_options::wrap): Changed to use DEFINE_set. Changed
16214 callers of any_wrap_symbols and is_wrap_symbol.
16215 (General_options::trace, General_options::trace_symbol):
16216 New options.
16217 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
16218 (General_options::wrap_symbols_): Deleted.
16219 * symtab.cc (Symbol_table::add_from_object): Print trace output.
16220
b5be4a7c
DM
162212008-04-17 David S. Miller <davem@davemloft.net>
16222
16223 * options.cc (General_options::parse_V): New function.
16224 * options.h: Add entries for -V and -Qy.
16225
155a0dd7
ILT
162262008-04-17 Ian Lance Taylor <iant@google.com>
16227
16228 * common.cc (Symbol_table::allocate_commons): Remove options
16229 parameter. Change caller.
16230 (Symbol_table::do_allocate_commons): Remove options parameter.
16231 Change caller. Just call do_allocate_commons_list twice.
16232 (Symbol_table::do_allocate_commons_list): New function, broken out
16233 of do_allocate_commons.
16234 * common.h (class Allocate_commons_task): Remove options_ field.
16235 Update constructor.
16236 * symtab.cc (Symbol_table::Symbol_table): Initialize
16237 tls_commons_.
16238 (Symbol_table::add_from_object): Put TLS common symbols on
16239 tls_commons_ list.
16240 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
16241 which are IN_OUTPUT_DATA.
16242 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
16243 allocate_commons and do_allocate_commons declarations. Declare
16244 do_allocate_commons_list.
16245 * gold.cc (queue_middle_tasks): Update creation of
16246 Allocate_commons_task to not pass options.
16247 * testsuite/Makefile.am (INCLUDES): Add -I.. .
16248 (TLS_TEST_C_FLAGS): New variable.
16249 (tls_test_c_pic.o): New target.
16250 (tls_test_shared.so): Link in tls_test_c_pic.o.
16251 (tls_test_c_pic_ie.o): New target.
16252 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
16253 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
16254 (tls_test_c.o): New target.
16255 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
16256 (tls_pic_test_LDADD): Likewise.
16257 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
16258 (tls_shared_gd_to_ie_test_LDADD): Likewise.
16259 (tls_test_c_gnu2.o): New target.
16260 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
16261 tls_test_c_gnu2.o.
16262 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
16263 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
16264 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
16265 * testsuite/tls_test.cc: Include "config.h".
16266 (t_last): Call t11_last.
16267 * testsuite/tls_test.h (t11, t11_last): Declare.
16268 * testsuite/tls_test_c.c: New file.
16269 * testsuite/tls_test_main.cc (thread_routine): Call t11.
16270 * configure.ac: Check for OpenMP support.
16271 * configure, config.in, Makefile.in: Rebuild.
16272 * testsuite/Makefile.in: Rebuild.
16273
edfbb029
CC
162742008-04-16 Cary Coutant <ccoutant@google.com>
16275
16276 * i386.cc (Target_i386::define_tls_base_symbol): New function.
16277 (Target_i386::tls_base_symbol_defined_): New field.
16278 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16279 (Target_i386::Scan::global): Likewise.
16280 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
16281 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
16282 (Target_x86_64::tls_base_symbol_defined_): New field.
16283 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16284 (Target_x86_64::Scan::global): Likewise.
16285
f3c69fca
CC
162862008-04-16 Cary Coutant <ccoutant@google.com>
16287
16288 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
16289 (Symbol::needs_plt_entry): Allow weak undefined symbols.
16290 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
16291 building shared libraries.
16292 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
16293 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
16294 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
16295 * testsuite/Makefile.in: Rebuild.
16296 * testsuite/weak_undef.h: New file.
16297 * testsuite/weak_undef_file1.cc: Add extra test cases.
16298 * testsuite/weak_undef_file2.cc: Likewise.
16299 * testsuite/weak_undef_test.cc: Likewise.
16300
7c414435
DM
163012008-04-16 David S. Miller <davem@davemloft.net>
16302
32b769e1
DM
16303 * sparc.cc (Target_sparc::Scan): Change from struct to class.
16304 Add issued_non_pic_error_ field. Declare check_non_pic.
16305 (Target_sparc::Scan::check_non_pic): New function.
16306 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
16307 (Target_sparc::Scan::global): Likewise.
16308
11936fb1
DM
16309 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
16310 * configure: Rebuild.
16311
7c414435
DM
16312 * options.h (DEFINE_enable): New macro.
16313 (new_dtags): New enable option.
16314 (initfirst, interpose, loadfltr, nodefaultlib,
16315 nodelete, nodlopen, nodump): New -z options.
16316 * layout.cc (Layout:finish_dynamic_section): If new
16317 dtags enabled, emit DT_RUNPATH. Also, emit a
16318 DT_FLAGS_1 containing any specified -z flags.
16319
85c7bf8b
ILT
163202008-04-16 Ian Lance Taylor <iant@google.com>
16321
12c0daef
ILT
16322 * copy-relocs.cc: New file.
16323 * copy-relocs.h: New file.
16324 * reloc.cc: Remove Copy_relocs code.
16325 * reloc.h: Likewise.
16326 * reloc-types.h (struct Reloc_types) [both versions]: Add
16327 get_reloc_addend_noerror.
16328 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
16329 variants of add_global which take an addend which must be zero.
16330 * i386.cc: Include "copy-relocs.h".
16331 (class Target_i386): Change type of copy_relocs_ to variable,
16332 update initializer.
16333 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
16334 Change all callers.
16335 (Target_i386::do_finalize_sections): Change handling of
16336 copy_relocs_.
16337 * sparc.cc: Include "copy-relocs.h".
16338 (class Target_sparc): Change type of copy_relocs_ to variable,
16339 update initializer.
16340 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
16341 Change all callers.
16342 (Target_sparc::do_finalize_sections): Change handling of
16343 copy_relocs_.
16344 * x86_64.cc: Include "copy-relocs.h".
16345 (class Target_x86_64): Change type of copy_relocs_ to variable,
16346 update initializer.
16347 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
16348 class. Change all callers.
16349 (Target_x86_64::do_finalize_sections): Change handling of
16350 copy_relocs_.
16351 * Makefile.am (CCFILES): Add copy-relocs.cc.
16352 (HFILES): Add copy-relocs.h.
16353
4f4995b6
ILT
16354 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
16355
85c7bf8b
ILT
16356 * testsuite/script_test_4.sh: Permit leading zeroes.
16357
4f2a9edd
ILT
163582008-04-15 Ian Lance Taylor <iant@google.com>
16359
e6188289
ILT
16360 * script-sections.cc (Script_sections::create_segments): Use
16361 header_size_adjustment even when there is enough room for the
16362 headers.
16363 * testsuite/script_test_4.sh: New file.
16364 * testsuite/script_test_4.t: New file.
16365 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
16366 (check_DATA): Add script_test_4.stdout.
16367 (MOSTLYCLEANFILES): Likewise.
16368 (script_test_4): New target.
16369 (script_test_4.stdout): New target.
16370 * testsuite/Makefile.in: Rebuild.
16371
4f2a9edd
ILT
16372 * sparc.cc: Add definitions for Output_data_plt_sparc class
16373 constants.
16374
f5314dd5
DM
163752008-04-14 David S. Miller <davem@davemloft.net>
16376
16377 * sparc.cc: New file.
16378 * Makefile.am (TARGETSOURCES): Add sparc.cc
16379 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
16380 * configure.tgt: Document targ_extra_size and
16381 targ_extra_big_endian. Add entries for sparc-* and
16382 sparc64-*.
16383 * configure.ac: Handle targ_extra_size and
16384 targ_extra_big_endian.
16385 * Makefile.in: Rebuild.
16386 * configure: Likewise.
16387 * po/POTFILES.in: Likewise.
16388 * po/gold.pot: Likewise.
16389
154e0e9a
ILT
163902008-04-14 Ian Lance Taylor <iant@google.com>
16391
16392 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
16393 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
16394 in the name/type/flags to section mapping. Don't call
16395 allocate_output_section.
16396 (Layout::choose_output_section): Change parameter from adjust_name
16397 to is_input_section. Don't permit input sections after sections
16398 are attached to segments. Don't call allocate_output_section.
16399 (Layout::layout_eh_frame): Call update_flags_for_input_section,
16400 not write_enable_output_section.
16401 (Layout::make_output_section): Don't push to
16402 unattached_section_list_ nor call attach_to_segment. Call
16403 attach_section_to_segment if sections are attached.
16404 (Layout::attach_sections_to_segments): New function.
16405 (Layout::attach_section_to_segment): New function.
16406 (Layout::attach_allocated_section_to_segment): Rename from
16407 attach_to_segment. Remove flags parameter.
16408 (Layout::allocate_output_section): Remove function.
16409 (Layout::write_enable_output_section): Remove function.
16410 * layout.h (class Layout): Update for above changes. Add new
16411 field sections_are_attached_.
16412 * output.h (Output_section::update_flags_for_input_section): New
16413 function.
16414 * output.cc (Output_section::add_input_section): Call
16415 update_flags_for_input_section.
16416 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
16417
009a67a2
CC
164182008-04-11 Cary Coutant <ccoutant@google.com>
16419
16420 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
16421 thought unnecessary.
16422 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
16423
759b1a24
ILT
164242008-04-11 Ian Lance Taylor <iant@google.com>
16425
16426 * output.h (class Output_section_data): Remove inline definition
16427 of set_addralign.
16428 * output.cc (Output_section_data::set_addralign): New function.
16429
c2b45e22
CC
164302008-04-11 Cary Coutant <ccoutant@google.com>
16431
16432 Add support for TLS descriptors for i386 and x86_64.
16433 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
16434 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
16435 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
16436 GOT_TYPE_TLS_DESC.
16437 (Target_i386::got_mod_index_entry): Remove unnecessary code.
16438 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
16439 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
16440 relocations.
16441 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
16442 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
16443 Fix problem with initial-exec relocations.
16444 (Target_i386::Relocate::relocate_tls): Likewise.
16445 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
16446 relaxation.
16447 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
16448 support for section-plus-offset dynamic table entries.
16449 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
16450 (Output_data_dynamic::Dynamic_entry): Add support for
16451 section-plus-offset dynamic table entries.
16452 (Output_data_dynamic::Classification): Likewise.
16453 (Output_data_dynamic::classification_): Renamed offset_.
16454 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
16455 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
16456 (Target_x86_64::make_plt_section): New function.
16457 (Target_x86_64::reserve_tlsdesc_entries): New function.
16458 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
16459 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
16460 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
16461 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
16462 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
16463 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
16464 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
16465 add extra PLT entry for TLS descriptors.
16466 (Output_data_plt_x86_64::got_): New field.
16467 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
16468 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
16469 fields.
16470 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
16471 descriptors.
16472 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
16473 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
16474 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
16475 R_386_TLS_DESC_CALL relocations.
16476 (Target_x86_64::Scan::global): Likewise.
16477 (Target_x86_64::do_finalize_sections): Add dynamic table entries
16478 for TLS descriptors.
16479 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
16480 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
16481 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
16482 GD-to-IE relaxation.
16483 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
16484 and TLS_DESCRIPTORS.
16485 * Makefile.in: Rebuild.
16486 * configure: Rebuild.
16487 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
16488 (tls_test_shared2.so): New target.
16489 (tls_shared_gd_to_ie_test_SOURCES): New variable.
16490 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
16491 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
16492 (tls_shared_gd_to_ie_test_LDADD): New variable.
16493 (tls_shared_gnu2_gd_to_ie_test): New target.
16494 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
16495 New targets.
16496 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
16497 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
16498 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
16499 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
16500 (tls_shared_gnu2_test): New target.
16501 (tls_test_gnu2_shared.so): New target.
16502 (tls_shared_gnu2_test_SOURCES): New variable.
16503 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
16504 (tls_shared_gnu2_test_LDFLAGS): New variable.
16505 (tls_shared_gnu2_test_LDADD): New variable.
16506 * testsuite/Makefile.in: Rebuild.
16507 * testsuite/Makefile.
16508
83bfb6b7
ILT
165092008-04-11 Ian Lance Taylor <iant@google.com>
16510
16511 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
16512 justsyms.t.
16513 * testsuite/Makefile.in: Rebuild.
16514
16515 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
16516 long.
16517 * testsuite/script_test_2.cc (main): Adjust test.
16518
706e1f5e
ILT
165192008-04-11 David S. Miller <davem@davemloft.net>
16520 Ian Lance Taylor <iant@google.com>
16521
16522 * options.h (General_options): Add entries for '-Y' and
16523 '-relax'.
16524 * options.cc (General_options:finalize): If -Y was used, add those
16525 entries to the library path instead of the default "/lib" and
16526 "/usr/lib".
16527
7c98e6bb
DM
165282008-04-11 David S. Miller <davem@davemloft.net>
16529
16530 * testsuite/justsyms.t: Start at 0x100.
16531 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
16532 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
16533 long.
16534 * testsuite/script_test_2.cc: Adjust string and section length
16535 checks.
7c98e6bb 16536
99a37bfd
ILT
165372008-04-09 Ian Lance Taylor <iant@google.com>
16538
2cefc357
ILT
16539 PR gold/5996
16540 * script-sections.cc (Sections_element::allocate_to_segment): Add
16541 orphan parameter.
16542 (Output_section_definition::allocate_to_segment): Likewise.
16543 (Orphan_output_section::allocate_to_segment): Likewise.
16544 (Script_sections::attach_sections_using_phdrs_clause): Don't
16545 propagate non-PT_LOAD segments to orphan sections.
16546 * testsuite/Makefile.am (script_test_3.stdout): Generate using
16547 readelf rather than objdump.
16548 * testsuite/script_test_3.sh: Adjust accordingly. Test that
16549 .interp section and PT_INTERP segment are the same size.
16550 * testsuite/Makefile.in: Rebuild.
16551
99a37bfd
ILT
16552 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
16553 aliases for symbols defined in the same object.
16554 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
16555 (weak_alias_test_SOURCES): New variable.
16556 (weak_alias_test_DEPENDENCIES): New variable.
16557 (weak_alias_test_LDFLAGS): New variable.
16558 (weak_alias_test_LDADD): New variable.
16559 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
16560 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
16561 (weak_alias_test_3.o): New target.
16562 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
16563 * testsuite/weak_alias_test_main.cc: New file.
16564 * testsuite/weak_alias_test_1.cc: New file.
16565 * testsuite/weak_alias_test_2.cc: New file.
16566 * testsuite/weak_alias_test_3.cc: New file.
16567
780e49c5
ILT
165682008-04-08 Ian Lance Taylor <iant@google.com>
16569
cdb0b8f5
ILT
16570 * options.h (class General_options): Add --noinhibit-exec option.
16571 * main.cc (main): Check --noinhibit-exec.
16572
0864d551
ILT
16573 * options.h (class General_options): Define --wrap as a special
16574 option. Add wrap_symbols_ field.
16575 (General_options::any_wrap_symbols): New function.
16576 (General_options::is_wrap_symbol): New function.
16577 * options.cc (General_options::parse_wrap): New function.
16578 (General_options::General_options): Initialize wrap_symbols_.
16579 * symtab.cc (Symbol_table::wrap_symbol): New function.
16580 (Symbol_table::add_from_object): Handle --wrap.
16581 * symtab.h (class Symbol_table): Declare wrap_symbol.
16582 * target.h (Target::wrap_char): New function.
16583 (Target::Target_info): Add wrap_char field.
16584 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
16585 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
16586 * testsuite/testfile.cc (Target_test::test_target_info):
16587 Likewise.
16588
789aa6de
ILT
16589 * errors.cc (Errors::undefined_symbol): Mention symbol version if
16590 there is one.
16591
2c38906f
ILT
16592 * layout.h (class Layout): Add added_eh_frame_data_ field.
16593 * layout.cc (Layout::Layout): Initialize new field.
16594 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
16595 output section until we find a section we merged successfully.
16596 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
16597 that the size be non-zero.
16598
780e49c5
ILT
16599 * merge.cc (Object_merge_map::get_output_offset): Remove inline
16600 qualifier.
16601
7fcd0256
ILT
166022008-04-08 Craig Silverstein <csilvers@google.com>
16603
16604 * configure.ac: Export new conditional variable HAVE_ZLIB.
16605 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
16606 on HAVE_ZLIB.
16607 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
16608 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16609
6835af53
ILT
166102008-04-07 Ian Lance Taylor <iant@google.com>
16611
e24f324c
ILT
16612 * version.cc (version_string): Set to "1.5".
16613
a036edd8
ILT
16614 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
16615 Add issued_non_pic_error_ field. Declare check_non_pic.
16616 (Target_x86_64::Scan::check_non_pic): New function.
16617 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
16618 (Target_x86_64::Scan::global): Likewise.
16619
624f8810
ILT
16620 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
16621 addend parameter. Change caller. Handle merge sections.
16622 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
16623 Address to Addend. Don't add in the result of
16624 local_section_offset, pass down the addend and use the returned
16625 value.
16626 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
16627 Update declarations of local_section_offset and symbol_value.
16628 * testsuite/two_file_test_1.cc (t18): New function.
16629 * testsuite/two_file_test_2.cc (f18): New function.
16630 * testsuite/two_file_test_main.cc (main): Call t18.
16631 * testsuite/two_file_test.h (t18, f18): Declare.
16632
6835af53
ILT
16633 * configure.ac: Don't test for objdump, c++filt, or readelf.
16634 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
16635 conditionals.
16636 (TEST_READELF): New variable.
16637 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
16638 (check_PROGRAMS): Add two_file_strip_test.
16639 (two_file_strip_test): New target.
16640 (check_PROGRAMS): Add two_file_same_shared_strip_test.
16641 (two_file_same_shared_strip_test_SOURCES): New variable.
16642 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
16643 (two_file_same_shared_strip_test_LDFLAGS): New variable.
16644 (two_file_same_shared_strip_test_LDADD): New variable.
16645 (two_file_shared_strip.so): New target.
16646 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
16647 (ver_test_5.syms, ver_test_7.syms): Likewise.
16648 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
16649 (strip_test_3.stdout): Use TEST_OBJDUMP.
16650 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16651
86925eef
CC
166522008-04-04 Cary Coutant <ccoutant@google.com>
16653
16654 * symtab.h (Symbol::is_weak_undefined): New function.
16655 (Symbol::is_strong_undefined): New function.
16656 (Symbol::is_absolute): New function.
16657 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
16658 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
16659 absolute symbols.
16660 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
16661 (weak_undef_test): New target.
16662 * testsuite/Makefile.in: Rebuild.
16663 * testsuite/weak_undef_file1.cc: New file.
16664 * testsuite/weak_undef_file2.cc: New file.
16665 * testsuite/weak_undef_test.cc: New file.
16666
126f3ece
ILT
166672008-04-03 Craig Silverstein <csilvers@google.com>
16668
16669 * compressed_output.h (class Output_compressed_section): Use
16670 unsigned buffer.
16671 * compressed_output.cc (zlib_compress): Use unsigned buffers,
16672 add zlib header.
16673 (zlib_compressed_suffix): Removed.
16674 (Output_compressed_section::set_final_data_size): Use unsigned
16675 buffers.
16676 * testsuite/Makefile.am (flagstest_compress_debug_sections):
16677 Fix linker invocation.
16678 (flagstest_o_specialfile_and_compress_debug_sections):
16679 Likewise.
16680 * testsuite/Makefile.in: Regenerated.
16681
deae2a14
DM
166822008-04-02 David S. Miller <davem@davemloft.net>
16683
16684 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
16685 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
16686
70752818
ILT
166872008-04-02 Craig Silverstein <csilvers@google.com>
16688
16689 * TODO: New file.
16690
39d0cb0e
ILT
166912008-04-02 Ian Lance Taylor <iant@google.com>
16692
16693 * fileread.cc (File_read::find_view): Add byteshift and vshifted
16694 parameters. Update for new key type to views_. Change all
16695 callers.
16696 (File_read::read): Adjust for byteshift in returned view.
16697 (File_read::add_view): New function, broken out of
16698 find_and_make_view.
16699 (File_read::make_view): New function, broken out of
16700 find_and_make_view.
16701 (File_read::find_or_make_view): Add offset and aligned
16702 parameters. Rewrite accordingly. Change all callers.
16703 (File_read::get_view): Add offset and aligned parameters. Adjust
16704 for byteshift in return value.
16705 (File_read::get_lasting_view): Likewise.
16706 * fileread.h (class File_read): Update declarations.
16707 (class File_read::View): Add byteshift_ field. Add byteshift to
16708 constructor. Add byteshift method.
16709 * archive.h (Archive::clear_uncached_views): New function.
16710 (Archive::get_view): Add aligned parameter. Change all callers.
16711 * object.h (Object::get_view): Add aligned parameter. Change all
16712 callers.
16713 (Object::get_lasting_view): Likewise.
16714
16715 * fileread.cc (File_read::release): Don't call clear_views if
16716 there are multiple objects.
16717 * fileread.h (File_read::clear_uncached_views): New function.
16718 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
16719 on the archive.
16720
a1207466
CC
167212008-03-31 Cary Coutant <ccoutant@google.com>
16722
16723 Add thin archive support.
16724 * archive.cc (Archive::armagt): New const.
16725 (Archive::setup): Remove task parameter and calls to unlock.
16726 (Archive::unlock_nested_archives): New function.
16727 (Archive::read_header): Add nested_off parameter. Change
16728 all callers.
16729 (Archive::interpret_header): Likewise.
16730 (Archive::include_all_members): Change to handle thin
16731 archives.
16732 (Archive::include_member): Likewise.
16733 * archive.h (Archive::Archive): Add new parameters and
16734 initializers.
16735 (Archive::armagt): New const.
16736 (Archive::setup): Remove task parameter.
16737 (Archive::unlock_nested_archives): New function.
16738 (Archive::read_header): Add nested_off parameter.
16739 (Archive::interpret_header): Likewise.
16740 (Archive::Nested_archive_table): New typedef.
16741 (Archive::is_thin_archive_): New field.
16742 (Archive::nested_archives_): New field.
16743 (Archive::options_): New field.
16744 (Archive::dirpath_): New field.
16745 (Archive::task_): New field.
16746 * readsyms.cc (Read_symbols::do_read_symbols): Add check
16747 for thin archives. Pass additional parameters to
16748 Archive::Archive. Unlock the archive file after calling
16749 Archive::setup.
cd536b21 16750
479f6503
ILT
167512008-03-29 Ian Lance Taylor <iant@google.com>
16752
686c8caf
ILT
16753 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
16754 version symbol to be local.
16755 * testsuite/ver_test_4.sh: New file.
16756 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
16757 (check_DATA): Add ver_test_4.syms.
16758 (ver_test_4.syms): New target.
16759 * testsuite/Makefile.in: Rebuild.
16760
ab794b6b
ILT
16761 * output.cc
16762 (Output_section::Input_section_sort_entry::has_priority): New
16763 function.
16764 (Output_section::Input_section_sort_entry::match_file_name): New
16765 function.
16766 (Output_section::Input_section_sort_entry::match_section_name):
16767 Remove.
16768 (Output_section::Input_section_sort_entry::match_section_name_prefix):
16769 Remove.
16770 (Output_section::Input_section_sort_entry::match_section_file):
16771 Remove.
16772 (Output_section::Input_section_sort_compare::operator()): Rewrite
16773 using new Input_section_sort_entry functions. Sort crtbegin and
16774 crtend first. Sort sections with no priority before sections with
16775 a priority.
16776 * testsuite/initpri1.c (d3): Check j != 4.
16777 (cd5): New constructor/destructor function.
16778 (main): Check j != 2.
16779
479f6503
ILT
16780 * symtab.cc (Symbol_table::add_from_object): If we don't use the
16781 new symbol when resolving, don't call set_is_default.
16782 * testsuite/ver_test_7.cc: New file.
16783 * testsuite/ver_test_7.sh: New file.
16784 * testsuite/Makefile.am (ver_test_7.so): New target.
16785 (ver_test_7.o): New target.
16786 (check_SCRIPTS): Add ver_test_7.sh.
16787 (check_DATA): Add ver_test_7.syms.
16788 (ver_test_7.syms): New target.
16789
2fd32231
ILT
167902008-03-28 Ian Lance Taylor <iant@google.com>
16791
16792 * layout.cc (Layout::layout): If we see an input section with a
16793 name that needs sorting, set the must_sort flag for the output
16794 section.
16795 (Layout::make_output_section): If the name of the output section
16796 indicates that it might require sorting, set the may_sort flag.
16797 * output.h (Output_section::may_sort_attached_input_sections): New
16798 function.
16799 (Output_section::set_may_sort_attached_input_sections): New
16800 function.
16801 (Output_section::must_sort_attached_input_sections): New
16802 function.
16803 (Output_section::set_must_sort_attached_input_sections): New
16804 function.
16805 (class Output_section): Declare Input_section_sort_entry. Define
16806 Input_section_sort_compare. Declare
16807 sort_attached_input_sections. Add new fields:
16808 may_sort_attached_input_sections_,
16809 must_sort_attached_input_sections_,
16810 attached_input_sections_are_sorted_.
16811 * output.cc (Output_section::Output_section): Initialize new
16812 fields.
16813 (Output_section::add_input_section): Add an entry to
16814 input_sections_ if may_sort or must_sort are true.
16815 (Output_section::set_final_data_size): Call
16816 sort_attached_input_sections if necessary.
16817 (Output_section::Input_section_sort_entry): Define new class.
16818 (Output_section::Input_section_sort_compare::operator()): New
16819 function.
16820 (Output_section::sort_attached_input_sections): New function.
16821 * configure.ac: Check whether the compiler supports constructor
16822 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
16823 * testsuite/initpri1.c: New file.
16824 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
16825 CONSTRUCTOR_PRIORITY.
16826 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
16827 (initpri1_LDFLAGS): New variable.
16828 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16829
18e6b24e
ILT
168302008-03-27 Ian Lance Taylor <iant@google.com>
16831
49bdd526
ILT
16832 * common.cc (Sort_commons::operator): Correct sorting algorithm.
16833 * testsuite/common_test_1.c: New file.
16834 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
16835 (common_test_1_SOURCES): New variable.
16836 (common_test_1_DEPENDENCIES): New variable.
16837 (common_test_1_LDFLAGS): New variable.
16838
18e6b24e
ILT
16839 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
16840 and commons_ correctly when NAME/VERSION does not override
16841 NAME/NULL.
16842 * testsuite/ver_test_6.c: New file.
16843 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
16844 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
16845 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
16846
04bf7072
ILT
168472008-03-26 Ian Lance Taylor <iant@google.com>
16848
5871526f
ILT
16849 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
16850 of an undefined symbol from a version script.
16851 * testsuite/Makefile.am (ver_test_5.so): New target.
16852 (ver_test_5.o): New target.
16853 (check_SCRIPTS): Add ver_test_5.sh.
16854 (check_DATA): Add ver_test_5.syms.
16855 (ver_test_5.syms): New target.
16856 * testsuite/ver_test_5.cc: New file.
16857 * testsuite/ver_test_5.script: New file.
16858 * testsuite/ver_test_5.sh: New file.
16859 * Makefile.in, testsuite/Makefile.in: Rebuild.
16860
04bf7072
ILT
16861 PR gold/5986
16862 Fix problems building gold with gcc 4.3.0.
16863 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
16864 (gold_error_at_location, gold_warning_at_location): Use it.
16865 * configure.ac: Check whether we can compile and use a template
16866 function with a printf attribute.
16867 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
16868 when jumping over bytes.
16869 * object.cc: Instantiate Object::read_section_data.
16870 * debug.h: Include <cstring>
16871 * dwarf_reader.cc: Include <algorithm>
16872 * main.cc: Include <cstring>.
16873 * options.cc: Include <cstring>.
16874 * output.cc: Include <cstring>.
16875 * script.cc: Include <cstring>.
16876 * script.h: Include <string>.
16877 * symtab.cc: Include <cstring> and <algorithm>.
16878 * target-select.cc: Include <cstring>.
16879 * version.cc: Include <string>.
16880 * testsuite/testmain.cc: Include <cstdlib>.
16881 * configure, config.in: Rebuild.
16882
874c5b28
ILT
168832008-03-25 Ian Lance Taylor <iant@google.com>
16884
819d6c3a
ILT
16885 * options.cc: Include "../bfd/bfdver.h".
16886 (options::help): Print bug reporting address.
16887
f4b2c6f5
ILT
16888 * version.cc (print_version): Adjust output for current value of
16889 BFD_VERSION_STRING.
16890
16891 * NEWS: New file.
16892
e96caa79
ILT
16893 * options.cc (options::help): Print list of supported targets.
16894 * target-select.h: Include <vector>.
16895 (class Target_selector): Make machine_, size_, and is_big_endian_
16896 fields const. Add bfd_name_ and instantiated_target_ fields.
16897 (Target_selector::Target_selector): Add bfd_name parameter.
16898 (Target_selector::recognize): Make non-virtual, call
16899 do_recognize.
16900 (Target_selector::recognize_by_name): Make non-virtual, call
16901 do_recognize_by_name.
16902 (Target_selector::supported_names): New function.
16903 (Target_selector::bfd_name): New function.
16904 (Target_selector::do_instantiate_target): New pure virtual
16905 function.
16906 (Target_selector::do_recognize): New virtual function.
16907 (Target_selector::do_recognize_by_name): New virtual function.
16908 (Target_selector::instantiate_target): New private function.
16909 (supported_target_names): Declare.
16910 * target-select.cc (Target_selector::Target_selector): Update for
16911 new parameter and fields.
16912 (select_target_by_name): Check that the name matches before
16913 calling recognize_by_name.
16914 (supported_target_names): New function.
16915 * i386.cc (class Target_selector_i386): Update Target_selector
16916 constructor call. Remove recognize and recognize_by_name. Add
16917 do_instantiate_target.
16918 * x86_64.cc (class Target_selector_x86_64): Likewise.
16919 * testsuite/testfile.cc (class Target_selector_test): Update for
16920 changes to Target_selector.
16921
874c5b28
ILT
16922 * README: Rewrite, with some notes on unsupported features.
16923
0a65a3a7
CC
169242008-03-24 Cary Coutant <ccoutant@google.com>
16925
16926 * i386.cc (Target_i386::Got_type): New enum declaration.
16927 (Target_i386::Scan::local): Updated callers of Output_data_got
16928 member functions.
16929 (Target_i386::Scan::global): Likewise.
16930 (Target_i386::Relocate::relocate): Likewise.
16931 (Target_i386::Relocate::relocate_tls): Likewise.
16932 * object.h (Got_offset_list): New class.
16933 (Sized_relobj::local_has_got_offset): Added got_type parameter.
16934 (Sized_relobj::local_got_offset): Likewise.
16935 (Sized_relobj::set_local_got_offset): Likewise.
16936 (Sized_relobj::local_has_tls_got_offset): Removed.
16937 (Sized_relobj::local_tls_got_offset): Removed.
16938 (Sized_relobj::set_local_tls_got_offset): Removed.
16939 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
16940 * output.cc (Output_data_got::add_global): Added got_type parameter.
16941 (Output_data_got::add_global_with_rel): Likewise.
16942 (Output_data_got::add_global_with_rela): Likewise.
16943 (Output_data_got::add_global_pair_with_rel): New function.
16944 (Output_data_got::add_global_pair_with_rela): New function.
16945 (Output_data_got::add_local): Added got_type parameter.
16946 (Output_data_got::add_local_with_rel): Likewise.
16947 (Output_data_got::add_local_with_rela): Likewise.
16948 (Output_data_got::add_local_pair_with_rel): New function.
16949 (Output_data_got::add_local_pair_with_rela): New function.
16950 (Output_data_got::add_global_tls): Removed.
16951 (Output_data_got::add_global_tls_with_rel): Removed.
16952 (Output_data_got::add_global_tls_with_rela): Removed.
16953 (Output_data_got::add_local_tls): Removed.
16954 (Output_data_got::add_local_tls_with_rel): Removed.
16955 (Output_data_got::add_local_tls_with_rela): Removed.
16956 * output.h (Output_data_got::add_global): Added got_type parameter.
16957 (Output_data_got::add_global_with_rel): Likewise.
16958 (Output_data_got::add_global_with_rela): Likewise.
16959 (Output_data_got::add_global_pair_with_rel): New function.
16960 (Output_data_got::add_global_pair_with_rela): New function.
16961 (Output_data_got::add_local): Added got_type parameter.
16962 (Output_data_got::add_local_with_rel): Likewise.
16963 (Output_data_got::add_local_with_rela): Likewise.
16964 (Output_data_got::add_local_pair_with_rel): New function.
16965 (Output_data_got::add_local_pair_with_rela): New function.
16966 (Output_data_got::add_global_tls): Removed.
16967 (Output_data_got::add_global_tls_with_rel): Removed.
16968 (Output_data_got::add_global_tls_with_rela): Removed.
16969 (Output_data_got::add_local_tls): Removed.
16970 (Output_data_got::add_local_tls_with_rel): Removed.
16971 (Output_data_got::add_local_tls_with_rela): Removed.
16972 * resolve.cc (Symbol::override_base_with_special): Removed
16973 reference to has_got_offset_ field.
16974 * symtab.cc (Symbol::init_fields): Replaced initialization
16975 of got_offset_ with got_offsets_. Removed initialization
16976 of has_got_offset_
53fcba31 16977 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
16978 (Symbol::got_offset): Likewise.
16979 (Symbol::set_got_offset): Likewise.
16980 (Symbol::has_tls_got_offset): Removed.
16981 (Symbol::tls_got_offset): Removed.
16982 (Symbol::set_tls_got_offset): Removed.
16983 (Symbol::got_offset_): Removed.
16984 (Symbol::tls_mod_got_offset_): Removed.
16985 (Symbol::tls_pair_got_offset_): Removed.
16986 (Symbol::got_offsets_): New field.
16987 (Symbol::has_got_offset): Removed.
16988 (Symbol::has_tls_mod_got_offset): Removed.
16989 (Symbol::has_tls_pair_got_offset): Removed.
16990 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
16991 (Target_x86_64::Scan::local): Updated callers of Output_data_got
16992 member functions.
16993 (Target_x86_64::Scan::global): Likewise.
16994 (Target_x86_64::Relocate::relocate): Likewise.
16995 (Target_x86_64::Relocate::relocate_tls): Likewise.
16996
bd52eafb
BE
169972008-03-25 Ben Elliston <bje@au.ibm.com>
16998
16999 * yyscript.y: Fix spelling error in comment.
17000
8b105e34
ILT
170012008-03-24 Ian Lance Taylor <iant@google.com>
17002
8ed814a9
ILT
17003 * options.h (class General_options): Define build_id option.
17004 * layout.h (class Layout): Declare write_build_id, create_note,
17005 create_build_id. Add build_id_note_ member.
17006 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
17007 "libiberty.h", "md5.h", "sha1.h".
17008 (Layout::Layout): Initialize eh_frame_data_,
17009 eh_frame_hdr_section_, and build_id_note_.
17010 (Layout::finalize): Call create_build_id.
17011 (Layout::create_note): New function, broken out of
17012 Layout::create_gold_note.
17013 (Layout::create_gold_note): Call create_note.
17014 (Layout::create_build_id): New function.
17015 (Layout::write_build_id): New function.
17016 (Close_task_runner::run): Call write_build_id.
17017
8b105e34
ILT
17018 * x86_64.cc: Correct license to GPLv3.
17019
086a1841
ILT
170202008-03-23 Ian Lance Taylor <iant@google.com>
17021
17022 * options.cc: Include "demangle.h".
17023 (parse_optional_string): New function.
17024 (parse_long_option): Handle takes_optional_argument.
17025 (parse_short_option): Update dash_z initializer. Handle
17026 takes_optional_argument.
17027 (General_options::General_options): Initialize do_demangle_.
17028 (General_options::finalize): Set do_demangle_. Handle demangling
17029 style.
17030 * options.h (parse_optional_string): Declare.
17031 (struct One_option): Add optional_arg field. Update constructor.
17032 Update call constructor calls. Add takes_optional_argument
17033 function.
17034 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
17035 (DEFINE_optional_string): Define.
17036 (General_options::demangle): Change from DEFINE_bool to
17037 DEFINE_optional_string.
17038 (General_options::no_demangle): New function.
17039 (General_options::do_demangle): New function.
17040 (General_options::set_do_demangle): New function.
17041 (General_options::execstack_status_): Move definition to end of
17042 class definition.
17043 (General_options::static_): Likewise.
17044 (General_options::do_demangle_): New field.
17045 * object.cc (big_endian>::get_symbol_location_info): Call
17046 Options::do_demangle, not Options::demangle.
17047 * symtab.cc (demangle): Likewise.
17048
cbb93e63
ILT
170492008-03-22 Ian Lance Taylor <iant@google.com>
17050
17051 * gold.h: Include <cstddef> and <sys/types.h>
17052 * options.h: Include <cstring>.
17053
ec531623
ILT
170542008-03-21 Ian Lance Taylor <iant@google.com>
17055
17056 * Added source code to GNU binutils.
752937aa 17057\f
b90efa5b 17058Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
17059
17060Copying and distribution of this file, with or without modification,
17061are permitted in any medium without royalty provided the copyright
17062notice and this notice are preserved.
17063
17064Local Variables:
17065mode: change-log
17066left-margin: 8
17067fill-column: 74
17068version-control: never
17069End:
This page took 1.161693 seconds and 4 git commands to generate.