Remove is_zlib_supported
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
1fa29f10
IT
12015-04-06 Ilya Tocar <ilya.tocar@intel.com>
2
3 PR gold/17641
4 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
5 (Target_x86_64::Scan::local): Don't create GOT entry, when we
6 can convert mov to lea.
7 (Target_x86_64::Scan::global): Ditto.
8 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
9 %reg to lea foo(%rip), %reg if possible.
10 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
11 * testsuite/x86_64_mov_to_lea1.s: New.
12 * testsuite/x86_64_mov_to_lea2.s: Ditto.
13 * testsuite/x86_64_mov_to_lea3.s: Ditto.
14 * testsuite/x86_64_mov_to_lea4.s: Ditto.
15 * testsuite/x86_64_mov_to_lea.sh: Ditto.
16
39f3de7c
L
172015-04-02 H.J. Lu <hongjiu.lu@intel.com>
18
19 * configure: Regenerated.
20
c4fc4724
IT
212015-04-01 Ilya Tocar <ilya.tocar@intel.com>
22
23 PR gold/17640
24 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
25 (Target_i386::Scan::local): Don't create GOT entry, when we
26 can convert GOT to GOTOFF.
27 (Target_i386::Scan::global): Ditto.
28 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
29 lea foo@GOTOFF(%reg), %reg if possible.
30 * testsuite/Makefile.am (i386_mov_to_lea): New test.
31 * testsuite/i386_mov_to_lea1.s: New.
32 * testsuite/i386_mov_to_lea2.s: Ditto.
33 * testsuite/i386_mov_to_lea3.s: Ditto.
34 * testsuite/i386_mov_to_lea4.s: Ditto.
35 * testsuite/i386_mov_to_lea5.s: Ditto.
36 * testsuite/i386_mov_to_lea.sh: Ditto.
37
918357b9
L
382015-04-01 H.J. Lu <hongjiu.lu@intel.com>
39
40 * Makefile.am (ZLIB): New.
41 (ZLIBINC): Likewise.
42 (AM_CFLAGS): Add $(ZLIBINC).
43 (AM_CXXFLAGS): Likewise.
44 (ldadd_varldadd_var): Add $(ZLIB).
45 (incremental_dump_LDADD): Likewise.
46 (dwp_LDADD): Likewise.
47 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
48 <zlib.h>.
49 (zlib_compress): Don't check HAVE_ZLIB_H.
50 (zlib_decompress): Likewise.
51 * options.h (compress_debug_sections): Likewise.
52 * configure.ac (AM_CONDITIONAL): Removed.
53 * testsuite/Makefile.am (ZLIB): New.
54 (LDADD): Add $(ZLIB).
55 Don't check HAVE_ZLIB.
56 * Makefile.in: Regenerated.
57 * config.in: Likewise.
58 * configure: Likewise.
59 * testsuite/Makefile.in: Likewise.
60
6b0ad2eb
JY
612015-03-30 Jing Yu <jingyu@google.com>
62
63 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
64 TLSLD_ADD_DTPREL_LO12_NC.
65 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
66 _TLS_MODULE_BASE_ point to the start of tls segment.
67 (Target_aarch64::optimize_tls_reloc): Add cases for
68 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
69 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
70 (Target_aarch64::Scan::local): Likewise.
71 (Target_aarch64::Scan::global): Likewise.
72 (Target_aarch64::Relocate::relocate): Likewise.
73 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
74 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
75 relocations.
76
0916f9e7
RÁE
772015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
78
79 * merge.cc (Object_merge_map::add_mapping): call
80 Object_merge_map::Input_merge_map::add_mapping.
81 (Object_merge_map::Input_merge_map::add_mapping): New.
82 (Output_merge_data::do_add_input_section): Call
83 get_or_make_input_merge_map before a loop.
84 (Output_merge_string<Char_type>::finalize_merged_data): Call
85 get_or_make_input_merge_map before a loop.
86 * merge.h (Object_merge_map): Make Input_merge_map public.
87 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
88 (Relobj::get_or_create_merge_map): New.
89 * object.h (Relobj::get_or_create_merge_map): New.
90
282c9750
AM
912015-03-24 Alan Modra <amodra@gmail.com>
92
93 PR 18147
94 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
95 relocation errors for branches to strong undefined symbols.
96
67f95b96
RÁE
972015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
98
99 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
100 (Object_merge_map::is_merge_section_for): Remove.
101 (Object_merge_map::find_merge_section): New.
102 * merge.h (Object_merge_map::is_merge_section_for): Remove.
103 (Object_merge_map::find_merge_section): New.
104 (Object_merge_map::get_input_merge_map): Add a const version.
105 * object.cc (Relobj::is_merge_section_for): Remove.
106 (Relobj::find_merge_section): New.
107 * object.h (Relobj::is_merge_section_for): Remove.
108 (Relobj::find_merge_section): New.
109 * output.cc
110 (Output_section::Input_section::is_merge_section_for): Remove.
111 (Output_section::add_merge_input_section): Don't call
112 add_merge_input_section.
113 (Output_section::find_merge_section): Return const. Use
114 object->find_merge_section.
115 (Output_section::build_lookup_maps): Don't build a map for
116 merge sections.
117 (Output_section::is_input_address_mapped): Return false if
118 section is not found.
119 (Output_section::find_starting_output_address): Use
120 find_merge_section instead of is_merge_section_for.
121 (Output_section::add_script_input_section): Don't build a map for
122 merge sections.
123 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
124 (Output_section_lookup_maps::find_merge_section): Remove.
125 (Output_section_lookup_maps::add_merge_input_section) Remove.
126 (Output_section::find_merge_section): Return const.
127
152f7024
CC
1282015-03-22 Cary Coutant <cary@google.com>
129
130 PR gold/18106
131 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
132 non-SIB form of lea, with nop after the call.
133
bccffdfd
CC
1342015-03-21 Cary Coutant <cary@google.com>
135
136 PR gold/14217
137 * output.cc (Output_segment::is_first_section_relro): Don't ignore
138 .tdata section.
139 (Output_segment::set_section_addresses): Don't align size of relro
140 segment for .tbss.
141
1c582fe7
CC
1422015-03-21 Cary Coutant <cary@google.com>
143
144 PR gold/18010
145 * stringpool.cc (Stringpool_template): Don't optimize if section
146 alignment is greater than sizeof(char).
147
410da591
CC
1482015-03-21 Cary Coutant <cary@google.com>
149
150 PR gold/18048
151 * script-c.h (script_include_directive): Add first_token parameter.
152 * script.cc (script_include_directive): Add first_token parameter, and
153 pass it to read_script_file.
154 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
155 (PARSING_MEMORY_DEF): New tokens.
156 (top): Add new productions for INCLUDE files.
157 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
158 Pass PARSING_LINKER_SCRIPT to script_include_directive.
159 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
160 (section_cmd): Pass PARSING_SECTION_CMDS.
161 (file_or_sections_cmd): Remove.
162 (memory_def): Pass PARSING_MEMORY_DEF.
163 * testsuite/Makefile.am (memory_test_2): New test.
164 * testsuite/Makefile.in: Regenerate.
165 * testsuite/memory_test_inc.t: New script file.
166 * testsuite/memory_test_inc_1.t.src: New script file.
167 * testsuite/memory_test_inc_2.t.src: New script file.
168 * testsuite/memory_test_inc_3.t.src: New script file.
169
0d5bbdb0
CC
1702015-03-21 Cary Coutant <cary@google.com>
171
172 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
173 (Sized_relobj_dwo::setup): Build compressed section map.
174 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
175 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
176 section map.
177 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
178 compressed_sections_ field.
179 (build_compressed_section_map): Take Object instead of
180 Sized_relobj_file parameter; add decompress_if_needed parameter.
181 (Sized_relobj_file::do_find_special_sections): Store compressed
182 section map in parent Object.
183 (Sized_relobj_file::do_decompressed_section_contents): Move
184 implementation to Object::decompressed_section_contents.
185 (Sized_relobj_file::do_discard_decompressed_sections): Move
186 implementation to Object::discard_decompressed_sections.
187 * object.h (build_compressed_section_map): Declare.
188 (Object::Object): Add compressed_sections_ field.
189 (Object::section_is_compressed): Move implementation here.
190 (Object::decompressed_section_contents): De-virtualize.
191 (Object::discard_decompressed_sections): De-virtualize.
192 (Object::do_section_is_compressed): Delete.
193 (Object::do_decompressed_section_contents): Delete.
194 (Object::set_compressed_sections): New method.
195 (Object::compressed_sections): New method.
196 (Object::compressed_sections_): New data member.
197 (Compressed_section_info, Compressed_section_map): Move to top of file.
198 (Sized_relobj_file::do_section_is_compressed): Delete.
199 (Sized_relobj_file::do_decompressed_section_contents): Delete.
200 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
201 (Sized_relobj_file::compressed_sections_): Move to Object class.
202
bd9e0d46
CC
2032015-03-21 Cary Coutant <ccoutant@google.com>
204
205 PR gold/18152
206 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
207 deferred objects.
208
943c8b43
CC
2092015-03-11 Cary Coutant <ccoutant@google.com>
210
211 * options.cc (General_options::finalize): Don't allow -z relro
212 with incremental linking.
213 * testsuite/Makefile.am (incremental_test): Add -z norelro.
214 (incremental_test_2): Likewise.
215 (incremental_test_3): Likewise.
216 (incremental_test_4): Likewise.
217 (incremental_test_5): Likewise.
218 (incremental_test_6): Likewise.
219 (incremental_copy_test): Likewise.
220 (incremental_common_test_1): Likewise.
221 (incremental_comdat_test_1): Likewise.
222 * testsuite/Makefile.in: Regenerate.
223
e1663197
CC
2242015-03-09 Cary Coutant <ccoutant@google.com>
225
226 PR gold/14675
227 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
228 return enum indicating whether .eh_frame section is empty, optimizable,
229 unrecognized, or an end marker. Adjust explicit instantiations.
230 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
231 (Eh_frame::add_ehframe_input_section): Change return type.
232 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
233 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
234 to the .eh_frame output section until we see the end marker.
235 (Layout::finalize_eh_frame_section): New.
236 * layout.h: (Layout::finalize_eh_frame_section): New.
237
beb8418f
L
2382015-03-05 H.J. Lu <hongjiu.lu@intel.com>
239
240 * output.cc (Relobj::initialize_input_to_output_map<size>):
241 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
242
48c73428
CC
2432015-03-04 Cary Coutant <ccoutant@google.com>
244
245 * parameters.cc (Parameters::set_target_once): Call
246 Target::select_as_default_target just once from here...
247 (set_parameters_target): ...instead of from here.
248
2492015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
dbe40a88
RÁE
250
251 * ehframe.cc (Cie::set_output_offset): Pass in and use a
252 Output_section_data instead of a Merge_map.
253 (Eh_frame::Eh_frame): Don't initialize merge_map_.
254 (Eh_frame::read_cie): Use add_merge_mapping instead of
255 Merge_map::add_mapping.
256 (Eh_frame::read_fde): Ditto.
257 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
258 (Eh_frame::do_output_offset): Use merge_output_offset istead of
259 merge_map_->get_output_offset.
260 (Eh_frame::do_is_merge_section_for): Delete.
261 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
262 instead of a Merge_map.
263 (Cie::set_output_offset): Pass in a Output_section_data instead of a
264 Merge_map.
265 (Eh_frame::do_is_merge_section_for): Delete.
266 (Eh_frame::merge_map_): Delete.
267 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
268 and use a Output_section_data instead of a Merge_map.
269 (Object_merge_map::add_mapping): Ditto.
270 (Object_merge_map::get_output_offset): Remove the merge_map argument.
271 (Object_merge_map::is_merge_section_for): Pass in and use a
272 Output_section_data instead of a Merge_map.
273 (Merge_map): Delete.
274 (Output_merge_base::do_output_offset): Use merge_output_offset instead
275 of merge_map_.get_output_offset.
276 (Output_merge_base::do_is_merge_section_for): Delete.
277 (Output_merge_data::do_add_input_section): Use
278 object->add_merge_mapping instead of add_mapping.
279 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
280 * merge.h (Merge_map): Delete forward declaration.
281 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
282 instead of a Merge_map.
283 (Object_merge_map::get_output_offset): Remove the merge_map argument.
284 (Object_merge_map::is_merge_section_for): Pass in and use a
285 Output_section_data instead of a Merge_map.
286 (Input_merge_map::Object_merge_map::merge_map): Replace with
287 output_data.
288 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
289 Output_section_data instead of a Merge_map.
290 (Merge_map): Delete.
291 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
292 (Output_merge_base::do_is_merge_section_for): Delete.
293 (Output_merge_base::add_mapping): Delete.
294 (Output_merge_base::merge_map_): Delete.
295 * object.cc (Relobj::initialize_input_to_output_map): New.
296 (Relobj::initialize_input_to_output_map): New.
297 (Relobj::merge_output_offset): New.
298 (Relobj::is_merge_section_for): New.
299 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
300 bits.
301 * object.h (Relobj::merge_map): Delete.
302 (initialize_input_to_output_map): New.
303 (set_merge_map): Delete.
304 (add_merge_mapping): New.
305 (merge_output_offset): New.
306 (is_merge_section_for): New.
307 * output.cc (Output_section::Input_section::is_merge_section_for):
308 Use object->is_merge_section_for.
309 * output.h (Output_section_data::is_merge_section_for): Delete.
310 (Output_section_data::do_is_merge_section_for): Delete.
311 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
312 Use object->initialize_input_to_output_map.
313 (Merged_symbol_value<size>::value_from_output_section): Use
314 object->merge_output_offset.
315
48c73428 3162015-03-02 Peter Collingbourne <pcc@google.com>
2c7b626c
CC
317 Cary Coutant <ccoutant@google.com>
318
319 * output.cc (Output_section::add_merge_input_section): Do not
320 attempt to merge sections with an entsize of 0.
321
48c73428 3222015-03-02 Khem Raj <raj.khem@gmail.com>
5b07cd84
CC
323
324 * attributes.h (class Output_attributes_section_data ): Add
325 do_print_to_mapfile function.
326
ec86f434
AM
3272015-02-24 Alan Modra <amodra@gmail.com>
328
329 PR 18010
330 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
331 complain if value is not a multiple of four.
332 (Target_powerpc::Relocate::relocate): Correct handling of
333 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
334
be66981e
L
3352015-02-21 H.J. Lu <hongjiu.lu@intel.com>
336
337 * configure.ac (default_size): Set to 32 for x32.
338 * configure: Regenerated.
339
e3ee8ed4
AM
3402015-02-18 Alan Modra <amodra@gmail.com>
341
342 PR 17954
343 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
344 visibility.
345
3a935c6c
RÁE
3462015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
347
348 * gc.h (Garbage_collection::add_reference): Don't use find.
349
e0a1e121
RÁE
3502015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
351
352 * object.cc (write_local_symbols): avoid std::vector copy.
353
45a4fb1a
RÁE
3542015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
355
356 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
357
2d9afefe
MW
3582015-02-09 Mark Wielaard <mjw@redhat.com>
359
360 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
361 DW_LANG_Fortran03 and DW_LANG_Fortran08.
362
e9c1bdad
CC
3632015-02-16 Cary Coutant <ccoutant@google.com>
364
365 PR gold/13577
366 PR gold/16992
367 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
368 DF_SYMBOLIC if --dynamic-list option is used.
369 * options.cc (General_options::finalize): --dynamic-list is not
370 mutually exclusive with -Bsymbolic.
371 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
372 listed in --dynamic-list.
373 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
374 -Bsymbolic-functions.
375 * testsuite/Makefile.in: Regenerate.
376
0ed4b0bf
CC
3772015-02-16 Cary Coutant <ccoutant@google.com>
378
379 PR gold/17971
380 * incremental.cc: Remove redundant include of "output.h".
381
1a920511
JY
3822015-02-12 Jing Yu <jingyu@google.com>
383
384 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
385 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
386 New relocation.
387 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
388 TLSLE_MOVW_* relocations.
389 (Target_aarch64::Scan::global): Likewise.
390 (Target_aarch64::Relocate::relocate): Likewise.
391 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
392 for new TLSLE_MOVW_* relocations.
393
07f107f3
WN
3942015-02-11 Will Newton <will.newton@linaro.org>
395
396 PR gold/13321
397 * arm.cc (Target_arm::make_plt_section): Create an ARM
398 state mapping symbol at the start of the PLT.
399
e051a5b5
L
4002015-02-09 H.J. Lu <hongjiu.lu@intel.com>
401
402 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
403 Replace two_file_shared_2.so with two_file_shared_1.so.
404 * testsuite/Makefile.in: Regenerated.
405
dddcc5b9
AM
4062015-02-09 Alan Modra <amodra@gmail.com>
407
408 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
409 plugin_test_thin.a and defsym_test.
410 * testsuite/Makefile.in: Regenerate.
411
b39b8b9d
RÁE
4122015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
413
414 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
415 body.
416
b66d1c52
CC
4172015-02-04 Peter Collingbourne <pcc@google.com>
418
419 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
420 forwarding symbols when computing symbol resolution info for plugins.
421 * plugin.h (Plugin_manager::symtab): New method.
422 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
423
23081de0
CC
4242015-02-03 Cary Coutant <ccoutant@google.com>
425 Peter Collingbourne <pcc@google.com>
426
427 PR gold/15660
428 * archive.cc (Thin_archive_object_unlocker): New class.
429 (Archive::include_member): Unlock external members of thin archives.
430 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
431 (plugin_test_2): Likewise.
432 (plugin_test_3): Likewise.
433 (plugin_test_4): Likewise.
434 (plugin_test_5): Likewise.
435 (plugin_test_6): Likewise.
436 (plugin_test_7): Likewise.
437 (plugin_test_8): Likewise.
438 (plugin_test_9): Likewise.
439 (plugin_test_10): Likewise.
440 (plugin_test_11): New test case.
441 * testsuite/Makefile.in: Regenerate.
442 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
443 file to decide whether to claim file.
444 (all_symbols_read_hook): Likewise.
445 * testsuite/plugin_test_1.sh: Adjust expected output.
446 * testsuite/plugin_test_2.sh: Likewise.
447 * testsuite/plugin_test_3.sh: Likewise.
448 * testsuite/plugin_test_6.sh: Likewise.
449 * testsuite/plugin_test_tls.sh: Likewise.
450 * testsuite/plugin_test_11.sh: New testcase.
451
4522015-02-03 Cary Coutant <ccoutant@google.com>
453
454 * descriptors.cc (Descriptors::open): Set artificially-low limit for
455 file descriptors when debugging enabled. Add debug output.
456 (Descriptors::release): Add debug output.
457 (Descriptors::close_some_descriptor): Likewise.
458 (Descriptors::close_all): Likewise.
459 * fileread.cc (File_read::lock): Likewise.
460 (File_read::unlock): Likewise.
461
24dd5808
CC
4622015-02-02 Cary Coutant <ccoutant@google.com>
463
464 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
465 executable output file.
466
fa89cc82
HS
4672015-01-22 Han Shen <shenhan@google.com>
468
469 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
470 (Target_arm::do_plt_address_for_global): New method.
471 (Target_arm::do_plt_address_for_local): New method.
472 (Target_arm::rel_irelative_section): New method.
473 (Target_arm::make_data_plt): Add more parameters for plt ctor.
474 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
475 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
476 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
477 (Target_arm::Scan::check_non_pic): Add ifunc support.
478 (Target_arm::Scan::local): Add ifunc support.
479 (Target_arm::Scan::global): Add ifunc support.
480 (Target_arm::make_plt_section): New method.
481 (Target_arm::make_plt_entry): Change to call to make_plt_section.
482 (Target_arm::make_local_ifunc_plt_entry): New method.
483 (Target_arm::got_irelative_): New member.
484 (Target_arm::rel_irelative_): New member.
485 (Target_arm::got_section): Add creation for got_irelative_.
486 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
487 (Target_arm::Relocate::relocate): Properly set local ifunc address.
488 (Target_arm::do_dynsym_value): Properly set global ifunc address.
489 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
490 (Output_data_plt_arm::IRelative_data): New type.
491 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
492 (Output_data_plt_arm::add_entry): Add more parameters.
493 (Output_data_plt_arm::add_relocation): New method.
494 (Output_data_plt_arm::add_local_ifunc_entry): New method.
495 (Output_data_plt_arm::rel_irelative): New method.
496 (Output_data_plt_arm::entry_count): Modified.
497 (Output_data_plt_arm::address_for_global): New method.
498 (Output_data_plt_arm::address_for_local): New method.
23081de0 499gold/
fa89cc82
HS
500 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
501 (Output_data_plt_arm::insert_irelative_data): New method.
502 (Output_data_plt_arm::irelative_rel_): New member.
503 (Output_data_plt_arm::got_): New member.
504 (Output_data_plt_arm::got_irelative_): New member.
505 (Output_data_plt_arm::irelative_count_): New member.
506 (Output_data_plt_arm::IRelative_data_vec): New typedef.
507 (Output_data_plt_arm::irelative_data_vec_): New member.
508 (Output_data_plt_arm::do_write): Write out irelative entries.
509 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
510 more parameters to ctor.
511 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
512 more parameters to ctor.
513 * output.h (Output_data_reloc::add_local_relative): New method.
514 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
515
0f81d3f0
AM
5162015-01-29 Alan Modra <amodra@gmail.com>
517
518 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
519 and GOT_TLSGD to LE optimization.
520
65d92137
CC
5212015-01-28 Cary Coutant <ccoutant@google.com>
522
523 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
524 for undef TLS symbols.
525 (Target_x86_64::Relocate::relocate_tls): Likewise.
526 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
527
5485698a
CC
5282015-01-25 Cary Coutant <ccoutant@google.com>
529
530 * output.cc (Output_segment::set_section_addresses): Fix calculation
531 of size of relro segment.
532
b01a4b04
AM
5332015-01-22 Alan Modra <amodra@gmail.com>
534
535 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
536 condition for need of ifunc plt entry.
537 (Target_powerpc::Scan::global <got relocs>): Likewise.
538
3d0064a9
CC
5392015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
540
541 * mips.cc (reloc_high): Add r_sym.
542 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
543 reloc_high constructor.
544 (Mips_relocate_functions::relgot16_local): Likewise.
545 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
546 r_type to decide whether LO16 matches HI16.
547 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
548 rello16 and relgot16_local.
549
a5cd8f05
CC
5502015-01-09 Cary Coutant <ccoutant@google.com>
551
552 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
553 unless alignment is larger than page size.
554
4fc1b9d4
L
5552015-01-06 H.J. Lu <hongjiu.lu@intel.com>
556 Cary Coutant <ccoutant@google.com>
557
558 PR gold/17729
559 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
560 (DEFAULT_TARGET_X32): Set for x32.
561 * x86_64.cc (cmp_insn_32): New.
562 (lea_r10_insn_32): Likewise.
563 (lea_r11_insn_32): Likewise.
564 (cmp_insn_64): Likewise.
565 (lea_r10_insn_64): Likewise.
566 (lea_r11_insn_64): Likewise.
567 (Target_x86_64<size>::do_calls_non_split): Handle x32.
568 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
569 (check_DATA): Add split_x32 files.
570 (split_x32_[1234n].o): New targets.
571 (split_x32_[124]): New targets.
572 (split_x32_[1234r].stdout): New targets.
573 * testsuite/split_x32.sh: New file.
574 * testsuite/split_x32_1.s: Likewise.
575 * testsuite/split_x32_2.s: Likewise.
576 * testsuite/split_x32_3.s: Likewise.
577 * testsuite/split_x32_4.s: Likewise.
578 * testsuite/split_x32_n.s: Likewise.
579 * configure: Regenerated.
580 * testsuite/Makefile.in: Likewise.
581
e749cab8
L
5822015-01-06 H.J. Lu <hongjiu.lu@intel.com>
583
584 PR gold/17809
585 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
586 x32.
587
af759df0
AM
5882015-01-02 Alan Modra <amodra@gmail.com>
589
590 * version.cc (print_version): Just print current year.
591 * dwp.cc (print_version): Likewise.
592
b90efa5b
AM
5932015-01-01 Alan Modra <amodra@gmail.com>
594
595 Update year range in copyright notice of all files.
596
f12d1e8a
AM
5972014-12-25 Alan Modra <amodra@gmail.com>
598
599 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
600 new enums.
601 (Target_arm::merge_object_attributes, ): Likewise.
602
5c294fee
TG
6032014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
604
605 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
606 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
607 AEABI_VFP_args_vfp to check that.
608 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
609 value and replace hardcoded values by enum values.
610
e30880c2
CC
6112014-12-22 Cary Coutant <ccoutant@google.com>
612
613 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
614
bd040da1
L
6152014-12-20 H.J. Lu <hongjiu.lu@intel.com>
616
617 PR gold/14608
618 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
619 to "return i * i * 3;".
620
e02a4046
CC
6212014-12-16 Cary Coutant <ccoutant@google.com>
622
623 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
624 (Mapfile::print_output_data): Use current_data_size() to avoid
625 assert for sections requiring postprocessing; if address is not valid,
626 print 0.
627 (Mapfile::print_output_section): Use current_data_size(); print note
628 that addresses and sizes are before compression.
629
add6016b
L
6302014-12-14 H.J. Lu <hongjiu.lu@intel.com>
631
632 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
633 Cast current_group_size to unsigned long when reporting error.
634
0bf32ea9
JY
6352014-12-10 Jing Yu <jingyu@google.com>
636
637 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
638 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
639 Update error message.
640 (Target_aarch64::do_relax): Use absolute value of option
641 stub_group_size. Replace local variable with class member
642 stub_group_size_.
643
cbcb23fa
AM
6442014-12-04 Alan Modra <amodra@gmail.com>
645
646 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
647 addend of PLTREL24 reloc when not generating a plt stub. Make
648 max_branch_offset an "Address".
fbad6518 649 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
650 (Target_powerpc::Relocate::relocate): Likewise.
651
1611bc4a
AM
6522014-12-04 Alan Modra <amodra@gmail.com>
653
654 PR 17670
655 * symtab.cc (Symbol::set_undefined): Remove assertion.
656 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
657 on symbols defined in discarded sections, instead return false.
658 Rearrange params, update all callers.
659 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
660 branches to syms in discarded sections.
661 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
662 undefined and flag as discarded.
663 (Target_powerpc::Relocate::relocate): Localize variable.
664
4759c34e
L
6652014-12-03 H.J. Lu <hongjiu.lu@intel.com>
666
667 PR gold/17675
668 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
669 * testsuite/Makefile.in: Regenerated.
670
1f98a074
AM
6712014-12-03 Alan Modra <amodra@gmail.com>
672
673 PR 17566
674 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
675 when adding dynamic relocations against section symbols.
676
fb257835
DI
6772014-12-01 Dimitry Ivanov <dimitry@google.com>
678
679 * layout.cc (Layout::finish_dynamic_section): When '-z global'
680 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
681 * options.h (General_options): New -z option (global).
682
d8e60314
CC
6832014-12-01 Cary Coutant <ccoutant@google.com>
684
685 PR gold/17578
686 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
687 is given.
688 (Layout::create_executable_stack_info): Warn when -z noexecstack is
689 given but some inputs require executable stack.
690
982bbd97
CC
6912014-11-26 Cary Coutant <ccoutant@google.com>
692
693 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
694 .debug_str_offsets; strip .debug_gnu_pubnames and
695 .debug_gnu_pubtypes.
696 (lines_only_debug_sections): Strip all four new sections.
697
bb779192
HS
6982014-11-26 Jing Yu <jingyu@google.com>
699
700 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
701 register to be x0 when to relax TLSDESC_LD64_LO12.
702
a3e60ddb
AM
7032014-11-26 Alan Modra <amodra@gmail.com>
704
705 * powerpc.cc (struct Stub_table_owner): New.
706 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
707 unsigned int vector. Update all references.
708 (powerpc_relobj::set_stub_table): Take an unsigned int param
709 rather than a Stub_table. Update callers.
710 (Powerpc_relobj::clear_stub_table): New function.
711 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
712 stub_group_size_ vars.
713 (Target_powerpc::new_stub_table): Delete.
714 (max_branch_delta): New function, extracted from..
715 (Target_powerpc::Relocate::relocate): ..here..
716 (Target_powerpc::Branch_info::make_stub): ..and here. Return
717 status on whether stub created successfully.
718 (Stub_control::Stub_control): Add "no_size_errors" param. Move
719 default sizing to..
720 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
721 reduce on relax failure.
722 (Target_powerpc::group_sections): Add "no_size_errors" param.
723 Use stub_group_size_. Set up group info in a temp vector,
724 before building Stub_table vector. Account for input sections
725 possibly already converted to relaxed sections.
726 (Stub_table::init): Delete. Merge into..
727 (Stub_table::Stub_table): ..here.
728 (Stub_table::can_reach_stub): New function.
729 (Stub_table::add_plt_call_entry): Add "from" parameter and
730 return true iff stub could be reached.
731 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
732 param too.
733 (Stub_table::clear_stubs): Add "all" param.
734
a20605cf
AM
7352014-11-26 Alan Modra <amodra@gmail.com>
736
737 * powerpc.cc (Stub_control::set_output_and_owner): New function.
738 (Target_powerpc::group_sections): Use it.
739
43b64deb
CC
7402014-11-25 Cary Coutant <ccoutant@google.com>
741
742 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
743 (Binary_to_elf::write_symbol): Add st_size parameter.
744 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
745
c924eb67
CC
7462014-11-25 Cary Coutant <ccoutant@google.com>
747
748 PR gold/17639
749 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
750 (Sized_relobj_file::do_layout): Handle deferred sections properly
751 during GC pass 1. Don't add reloc sections to deferred list twice.
752 * object.h (Sized_relobj_file::is_deferred_layout): New function.
753 (Sized_relobj_file::is_deferred_layout_): New data member.
754
9d585188
L
7552014-11-21 H.J. Lu <hongjiu.lu@intel.com>
756
757 PR gold/17619
758 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
759 Check PC-relative offset overflow in PLT entry.
760
3ffaac20
AM
7612014-11-21 Alan Modra <amodra@gmail.com>
762
763 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
764 for undefined weaks.
765
0cfb0717
AM
7662014-11-20 Alan Modra <amodra@gmail.com>
767
768 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
769 from --stub-group-size parameter divided by 1024.
770 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
771 template parameter. Update all uses.
772 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
773 has_stub_value. Set for long branches. Don't report overflow for
774 branch to undefined weak symbols. Print info message on
775 overflowing branch to stub.
776
f9dffbf0
AM
7772014-11-20 Alan Modra <amodra@gmail.com>
778
779 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
780
e88ba8d5
L
7812014-11-13 H.J. Lu <hongjiu.lu@intel.com>
782
783 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
784 entry for R_X86_64_GOTPLT64.
785 (Target_x86_64<size>::Relocate::relocate): Update comments for
786 R_X86_64_GOTPLT64.
787
d37ffe25
ED
7882014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
789
790 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
791 * plugin.h: add lock definition
792
9726c3c1
HS
7932014-10-29 Han Shen <shenhan@google.com>
794 Jing Yu <jingyu@google.com>
795
796 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
797 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
798 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
799 Symbol::TLS_REF.
800 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
801 method.
802 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
803 (Target_aarch64::tls_ld_to_le): New method.
804 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
805 for 64bit targets.
806 (Output_data_plt_aarch64::irelative_rel_): New data member.
807 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
808 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
809 (Output_data_plt_aarch64::add_relocation): New method.
810 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
811 offset. Add got_irelative size to got size.
812 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
813 type string with the new typename.
814 (AArch64_relocate_functions::update_adr): Replace parameter x with
815 immed.
816 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
817 (AArch64_relocate_functions::reloc_common): New method.
818 (AArch64_relocate_funcsions::rela_general): Extract common part out
819 into reloc_common method.
820 (AArch64_relocate_functions::rela_general): Likewise.
821 (AArch64_relocate_functions::pcrela_general): Likewise.
822 (AArch64_relocate_functions::adr): New method.
823 (AArch64_relocate_functions::adrp): Calculate immed before calling
824 update_adr.
825 (AArch64_relocate_functions::adrp): Likewise.
826 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
827 comparing x to 0. Calculate immed from ~x when x < 0.
828 (Target_aarch64::optimize_tls_reloc): Add new cases for
829 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
830 TLSLD_MOVW_DTPREL_G0_NC.
831 (Target_aarch64::possible_function_pointer_reloc): Implement this
832 method.
833 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
834 comment.
835 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
836 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
837 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
838 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
839 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
840 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
841 (Target_aarch64::make_plt_entry): Call add_entry with two more
842 parameters.
843 (Target_aarch64::make_local_ifunc_plt_entry): New method.
844 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
845 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
846 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
847 (Target_aarch64::Relocate::relocate_tls): Add cases for
848 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
849 TLSLD_MOVW_DTPREL_G0_NC.
850 * testsuite/icf_safe_so_test.cc: Correct test comment.
851 * testsuite/icf_safe_test.sh: Add AArch64 arch.
852
80272b8c
AM
8532014-10-22 Alan Modra <amodra@gmail.com>
854
855 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
856 thread_starter.
857
998a69f4
AS
8582014-10-18 Andreas Schwab <schwab@linux-m68k.org>
859
860 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
861
aed56ec5
CC
8622014-10-17 Cary Coutant <ccoutant@google.com>
863
864 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
865 Add "typename" keyword.
866
bb779192 8672014-10-15 Han Shen <shenhan@google.com>
83a01957
HS
868 Jing Yu <jingyu@google.com>
869
870 Patch for gold aarch64 backend to support relaxation.
871 * aarch64-reloc.def: Change format.
872 * aarch64.cc (class Reloc_stub): New class.
873 (class Stub_table): New class.
874 (class AArch64_relobj): New class.
875 (class AArch64_input_section): New class.
876 (class AArch64_output_section): New class.
877 (Target_aarch64::new_stub_table): New method.
878 (Target_aarch64::new_aarch64_input_section): New method.
879 (Target_aarch64::find_aarch64_input_section): New method.
880 (Target_aarch64::scan_section_for_stubs): New method.
881 (Target_aarch64::scan_reloc_section_for_stubs): New method.
882 (Target_aarch64::relocate_stub): New method.
883 (Target_aarch64::current_target): New method.
884 (Target_aarch64::do_make_elf_object): New method.
885 (Target_aarch64::do_may_relax): New method.
886 (Target_aarch64::do_relax): New method.
887 (Target_aarch64::group_sections): New method.
888 (Target_aarch64::scan_reloc_for_stub): New method.
889 (Target_aarch64::do_make_output_section): New method.
890 (Target_aarch64::stub_tables_): New data member.
891 (Target_aarch64::aarch64_input_section_map_): New data member.
892 (AArch64_relocate_functions::maybe_apply_stub): New method.
893
db4c9594
CC
8942014-09-30 Cary Coutant <ccoutant@google.com>
895
896 PR gold/17432
897 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
898
cd6da036
KC
8992014-09-30 Kito Cheng <kito@0xlab.org>
900
901 PR gold/13597
902 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
903 hash table before sysv-style hash table.
904
5f772412
ST
9052014-09-29 Sriraman Tallam <tmsriram@google.com>
906
907 * options.h (--pic-executable): Add negative to alias to -no-pie.
908
5efeedf6
CC
9092014-09-26 Cary Coutant <ccoutant@google.com>
910
911 PR gold/16773
912 * object.cc (Sized_relobj_file): Compute value of section symbols
913 for TLS sections the same as TLS symbols.
914
1707f183
CC
9152014-09-25 Cary Coutant <ccoutant@google.com>
916
917 PR gold/17432
918 * resolve.cc (Symbol_table::resolve): Override common placeholder
919 symbols, but adjust sizes.
920 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
921 symbols to common lists.
922
00cac886
AM
9232014-09-24 Alan Modra <amodra@gmail.com>
924
925 * po/POTFILES.in: Regenerate.
926
635aa30e
CC
9272014-09-23 Taiju Tsuiki <tzik@google.com>
928 Cary Coutant <ccoutant@google.com>
929
71b9b91b 930 PR gold/14860
635aa30e
CC
931 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
932 on input_sections_blocker.
933 * layout.cc (Write_sections_task::locks): Unblock
934 input_sections_blocker_.
935 * layout.h (Write_sections_task::Write_sections_task): Add
936 input_sections_blocker.
937 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
938 to DEPENDENCIES.
939 * testsuite/Makefile.in: Regenerate.
940
c0c71592
RÁE
9412014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
942
943 * testsuite/Makefile.am (plugin_test_10): New test.
944 * testsuite/Makefile.in: Regenerate
945 * testsuite/plugin_common_test_2.c (c1): Align to 8.
946 * testsuite/plugin_test_10.sh: New file.
947
6168c2a1
RÁE
9482014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
949
950 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
951 * resolve.cc (Symbol_table::resolve): Don't override common symbols
952 during the replacement phase.
953
3a531937
JY
9542014-09-17 Han Shen <shenhan@google.com>
955 Jing Yu <jingyu@google.com>
956
957 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
958 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
959 * aarch64.cc (Target_aarch64): Add data members
960 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
961 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
962 constructor.
963 (Target_aarch64::do_reloc_symbol_index): New method.
964 (Target_aarch64::do_reloc_addend): New method.
965 (Target_aarch64::add_tlsdesc_info): New method.
966 (Target_aarch64::do_dynsym_value): New method.
967 (Target_aarch64::do_make_data_plt): Add new parameters: got,
968 got_irelative. Pass them to Output_data_plt_aarch64_standard.
969 (Target_aarch64::make_data_plt): Add new parameters: got,
970 got_irelative. Pass them to do_make_data_plt.
971 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
972 (Target_aarch64::Relocate:tls_gd_to_le): New method.
973 (Target_aarch64::Relocate:tls_ie_to_le): New method.
974 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
975 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
976 (Target_aarch64::got_tlsdesc_section): New method.
977 (Target_aarch64::make_local_ifunc_plt_entry): New method.
978 (Target_aarch64::define_tls_base_symbol): New method.
979 (Target_aarch64::reserve_tlsdesc_entries): New method.
980 (Target_aarch64::got_mod_index_entry): New method.
981 (Target_aarch64::rela_tlsdesc_section): New method.
982 (Target_aarch64::rela_irelative_section): New method.
983 (Target_aarch64::Tlsdesc_info): New struct.
984 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
985 relocations and tlsdesc relocations.
986 (Target_aarch64::optimize_tls_reloc): Implement method.
987 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
988 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
989 in constructor.
990 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
991 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
992 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
993 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
994 (Output_data_plt_aarch64::rela_tlsdesc): New method.
995 (Output_data_plt_aarch64::rela_irelative): New method.
996 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
997 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
998 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
999 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
1000 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
1001 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
1002 (Output_data_plt_aarch64_standard): New member variables:
1003 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
1004 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
1005 New parameter: got, got_irelative.
1006 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
1007 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
1008 (Output_data_plt_aarch64::do_write): Replace got_address with
1009 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
1010 (AArch64_relocate_functions::update_movnz): New method.
1011 (AArch64_relocate_functions): Correct format.
1012 (AArch64_relocate_functions::movnz): New method.
1013 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
1014 before the switch. Add new cases to switch.
00cac886 1015 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
1016 tlsgd tlsdesc cases.
1017 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
1018 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
1019 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
1020 Call reloc_name_in_error_message to print unsupported reloc.
1021 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
1022 make_data_plt.
1023 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
1024 relocs. Fill in some more dynamic tags.
1025 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
1026 Skip call tls_get_addr when tlsgd is relaxed.
1027 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
1028 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
1029 tlsdesc->ie relaxation.
1030
62661c93
SS
10312014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1032
1033 * mips.cc (Target_mips_nacl): New class.
1034 (Target_selector_mips_nacl): New class.
1035 (target_selector_mips32): Rename from target_selector_mips32be and use
1036 Target_selector_mips_nacl instead of Target_selector_mips.
1037 (target_selector_mips32el): Rename from target_selector_mips32 and use
1038 Target_selector_mips_nacl instead of Target_selector_mips.
1039 (target_selector_mips64): Rename from target_selector_mips64be and use
1040 Target_selector_mips_nacl instead of Target_selector_mips.
1041 (target_selector_mips64el): Rename from target_selector_mips64 and use
1042 Target_selector_mips_nacl instead of Target_selector_mips.
1043 (Target_mips::mips_info): Add const attribute.
1044
54674d38
CC
10452014-09-02 Cary Coutant <ccoutant@google.com>
1046
1047 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
1048 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
1049 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
1050 (Sized_incr_dynobj::do_section_name): Likewise.
1051 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
1052 (Sized_incr_dynobj::do_section_name): Likewise.
1053 * object.h (Object::section_name): Likewise.
1054 (Object::do_section_name): Likewise.
1055 (Sized_relobj_file::do_section_name): Likewise.
1056 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
1057 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
1058
9860cbcf
CC
10592014-09-02 Cary Coutant <ccoutant@google.com>
1060
1061 PR gold/17005
1062 * ehframe.cc (Fde::write): Add output_offset parameter.
1063 (Cie::write): Likewise.
1064 (Eh_frame::set_final_data_size): Account for offset within output
1065 section.
1066 (Eh_frame::do_sized_write): Likewise.
1067 * ehframe.h (Fde::write): Add output_offset parameter.
1068 (Cie::write): Likewise.
1069 * output.cc (Output_section::Input_section_sort_entry): Remove
1070 section_has_name_; add output_section_name parameter. Use
1071 output section name for non-input sections.
1072 (Output_section::Input_section_sort_entry::section_has_name): Remove.
1073 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
1074 (Output_section::Input_section_sort_compare): Remove logic for
1075 sections without names.
1076 (Output_section::Input_section_sort_init_fini_compare): Likewise.
1077 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
1078 Likewise.
1079 (Output_section::Input_section_sort_section_name_compare): Likewise.
1080
8e33481e
HS
10812014-08-29 Han Shen <shenhan@google.com>
1082 Jing Yu <jingyu@google.com>
1083
1084 * aarch64-reloc-property.cc
1085 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
1086 reference reloc property in the table.
1087 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
1088 3 other entries.
1089 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
1090 2 new overloaded methods.
1091 (Output_data_got_aarch64::do_write): Add code to write out
1092 static relocs.
1093 (class Output_data_got_aarch64::Static_reloc): New class to wrap
1094 static relocs.
1095 (Output_data_got_aarch64::static_relocs): New vector to
1096 hold static relocs.
1097 (Target_aarch64::TCB_SIZE): New const static memeber.
1098 (Target_aarch64::tcb_size): New method.
1099 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
1100 (Target_aarch64::Relocate::relocate_tls): New method.
1101 (Target_aarch64::Scan::local): Add code handling new reloc types.
1102 (Target_aarch64::Scan::global): Add code handling new reloc types.
1103
81233653
ST
11042014-08-13 Sriraman Tallam <tmsriram@google.com>
1105
1106 * options.h (-no-pie): Add option.
1107
9363c7c3
JY
11082014-08-08 Jing Yu <jingyu@google.com>
1109 Han Shen <shenhan@google.com>
1110
1111 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
1112 (DEFFILES): add aarch64-reloc.def.
1113 (TARGETSOURCES): Add aarch64-reloc-property.cc.
1114 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
1115 * Makefile.in: Regenerate.
1116 * aarch64-reloc-property.cc: New file.
1117 * aarch64-reloc-property.h: New file.
1118 * aarch64-reloc.def: New file.
1119 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
1120 with tab to make the format consistent.
1121 (Output_data_got_aarch64::symbol_table_): New method.
1122 (Target_aarch64::do_plt_address_for_global): New method.
1123 (Target_aarch64::do_plt_address_for_local): New method.
1124 (Target_aarch64::do_select_as_default_target): New method.
1125 (Target_aarch64::do_make_data_plt): New method.
1126 (Target_aarch64::make_data_plt): New method.
1127 (Output_data_plt_aarch64::has_irelative_section): New method.
1128 (Output_data_plt_aarch64::address_for_global): New method.
1129 (Output_data_plt_aarch64::address_for_local): New method.
1130 (Output_data_plt_aarch64::irelative_rel_): New parameter.
1131 (Output_data_plt_aarch64::add_entry): Implement contents.
1132 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
1133 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
1134 the got_pov entry to plt0.
1135 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
1136 Implement contents.
1137 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
1138 (AArch64_howto): New struct.
1139 (aarch64_howto[]): New static const array.
1140 (AArch64_relocate_functions): New class.
1141 (Target_aarch64::Scan::get_reference_flags): Remove method.
1142 (Target_aarch64::Scan::local): Implement to support a few relocations.
1143 (Target_aarch64::Scan::global): Implement to support a few relocations.
1144 (Target_aarch64::make_plt_section): Implement contents.
1145 (Target_aarch64::make_plt_entry): Implement contents.
1146 (Target_aarch64::do_finalize_sections): Implement contents.
1147 (Target_aarch64::Relocate::relocate): Implement a few relocations.
1148 (Target_aarch64::relocate_section): Implement contents.
1149
ad9fe6c1
AM
11502014-08-06 Alan Modra <amodra@gmail.com>
1151
1152 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
1153
7cd4e5b7
AM
11542014-08-06 Alan Modra <amodra@gmail.com>
1155
1156 PR 13227
1157 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
1158
5ad9b0a7
ST
11592014-07-21 Sriraman Tallam <tmsriram@google.com>
1160
1161 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 1162 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 1163
e051745c
CC
11642014-07-08 Cary Coutant <ccoutant@google.com>
1165
1166 * expression.cc (struct Expression::Expression_eval_info): Add
1167 new fields type_pointer, vis_pointer, and nonvis_pointer.
1168 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
1169 nonvis_pointer parameters. Adjust all calls.
1170 (Symbol_expression::value): Update type, visibility, and nonvis bits
1171 in caller.
1172 * script.cc (Symbol_assignment::sized_finalize): Update type,
1173 visibility, and remaining st_other bits for new symbol.
1174 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
1175 vis_pointer, and nonvis_pointer parameters.
1176 * symtab.h (Symbol::set_type): New method.
1177
1178 * testsuite/Makefile.am (defsym_test): New test.
1179 * testsuite/Makefile.in: Regenerate.
1180 * testsuite/defsym_test.c: New file.
1181 * testsuite/defsym_test.sh: New file.
1182
f35c4853
CC
11832014-07-08 Cary Coutant <ccoutant@google.com>
1184
1185 PR gold/15639
1186 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
1187 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
1188 (Sized_dynobj::base_read_symbols): ...new method.
1189 * object.h (Sized_relobj_file::base_read_symbols): New method.
1190 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
1191 (Sized_relobj_file::base_read_symbols): ...new method.
1192 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
1193 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
1194 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
1195
2900af2d
AM
11962014-07-04 Alan Modra <amodra@gmail.com>
1197
1198 * po/POTFILES.in: Regenerate.
1199
053a4d68
JY
12002014-07-02 Jing Yu <jingyu@google.com>
1201
1202 * aarch64.cc: New file
1203 * Makefile.am (TARGETSOURCES): Add aarch64.cc
1204 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
1205 * Makefile.in: Regenerate.
1206 * configure.tgt: Add entries for aarch64*.
1207 * configure.ac: Likewise.
1208 * configure: Likewise.
1209
7b549045
AM
12102014-06-27 Alan Modra <amodra@gmail.com>
1211
1212 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
1213
cb818dbf
CC
12142014-06-24 Cary Coutant <ccoutant@google.com>
1215
1216 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
1217 sections.
1218 (Dwo_file::sized_read_unit_index): Likewise.
1219
9810d34d
SS
12202014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1221
1222 * mips.cc: New file.
1223 * Makefile.am (TARGETSOURCES): Add mips.cc
1224 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
1225 * configure.tgt: Add entries for mips*.
1226 * configure.ac: Likewise.
1227 * Makefile.in: Regenerate.
1228 * configure: Likewise.
1229
9baa787b
CC
12302014-06-09 Cary Coutant <ccoutant@google.com>
1231
1232 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
1233 unit_length is within section bounds.
1234
8f89af0a
CC
12352014-06-09 Cary Coutant <ccoutant@google.com>
1236
1237 PR gold/16980
1238 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
1239 map.
1240
a47622ac
AM
12412014-06-07 Alan Modra <amodra@gmail.com>
1242
1243 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
1244
4320c691
CC
12452014-06-06 Cary Coutant <ccoutant@google.com>
1246
1247 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
1248 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
1249 (Dwarf_pubnames_table::read_header): Likewise.
1250 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
1251 .debug_gnu_pubtypes.
1252
270c9937
JB
12532014-06-05 Joel Brobecker <brobecker@adacore.com>
1254
1255 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
1256 * Makefile.in, configure: Regenerate.
1257
397998fc
AM
12582014-06-03 Alan Modra <amodra@gmail.com>
1259
1260 * powerpc.cc (addis_12_2): Define.
1261 (Stub_table::do_write): Support fusion on ELFv2 stubs.
1262
61f5c66f
AM
12632014-06-03 Alan Modra <amodra@gmail.com>
1264
1265 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
1266 st_other output.
1267
f6971787
AM
12682014-06-02 Alan Modra <amodra@gmail.com>
1269
1270 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
1271 Only ignore relocs on ELFv1.
1272 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
1273
f6fb8322
CC
12742014-05-30 Cary Coutant <ccoutant@google.com>
1275
1276 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
1277 * testsuite/Makefile.in: Regenerate.
1278 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
1279
c23dd342
L
12802014-05-27 H.J. Lu <hongjiu.lu@intel.com>
1281
1282 PR gold/16945
1283 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
1284 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
1285
5fe7ffdc
AM
12862014-05-15 Alan Modra <amodra@gmail.com>
1287
1288 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
1289 Compare FDE contents with DW_CFA_nop rather than 0.
1290
a82bef93
ST
12912014-05-13 Sriraman Tallam <tmsriram@google.com>
1292
1293 * symtab.h (may_need_copy_reloc): Remove check for position independent
1294 code.
1295 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
1296 position independence before pc absolute may_need_copy_reloc call.
1297 Add check for executable output befor pc relative may_need_copy_reloc
1298 call.
1299 * i386.cc: Ditto.
1300 * arm.cc: Ditto.
1301 * sparc.cc: Ditto.
1302 * tilegx.cc: Ditto.
1303 * powerpc.cc: Add check for no position independence before
1304 may_need_copy_reloc calls.
1305 * testsuite/pie_copyrelocs_test.cc: New file.
1306 * testsuite/pie_copyrelocs_shared_test.cc: New file.
1307 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 1308 * Makefile.in: Regenerate.
a82bef93 1309
53c66605
ML
13102014-05-08 Martin Liška <mliska@suse.cz>
1311
1312 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
1313
57b2284c
CC
13142014-05-06 Cary Coutant <ccoutant@google.com>
1315
1316 PR gold/16900
1317 * i386.cc (Output_data_got_plt_i386): New class.
1318 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
1319 parameter. Change all callers.
1320 (Output_data_plt_i386::layout_): Remove.
1321 (Output_data_plt_i386::got_plt_): Change type.
1322 (Target_i386::got_plt_): Change type. Change all references.
1323 (Target_i386::got_section): Create instance of new class.
1324 (Output_data_got_plt_i386::do_write): New function.
1325 * x86_64.cc (Output_data_got_plt_x86_64): New class.
1326 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
1327 parameter. Change all callers.
1328 (Output_data_plt_x86_64::layout_): Remove.
1329 (Output_data_plt_x86_64::got_plt_): Change type.
1330 (Target_x86_64::got_plt_): Change type. Change all references.
1331 (Target_x86_64::got_section): Create instance of new class.
1332 (Output_data_got_plt_x86_64::do_write): New function.
1333 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
1334 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
1335 class.
1336
6b97515d 13372014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 1338
6b97515d
CC
1339 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
1340 if we have pubnames/pubtypes.
1341
d1bddd3c
CC
13422014-05-02 Cary Coutant <ccoutant@google.com>
1343
5fe7ffdc
AM
1344 * defstd.cc (in_segment): Define __ehdr_start here...
1345 * layout.cc (Layout::finalize): ...Instead of here. Set the
1346 output segment when known.
1347 * resolve.cc (Symbol::override_base_with_special): Remember
1348 the original binding.
1349 * symtab.cc (Symbol::set_output_segment): New function.
1350 (Symbol::set_undefined): New function.
1351 * symtab.h (Symbol::is_weak_undefined): Check original undef
1352 binding.
1353 (Symbol::is_strong_undefined): New function.
1354 (Symbol::set_output_segment): New function.
1355 (Symbol::set_undefined): New function.
1356 * target-reloc.h (is_strong_undefined): Remove.
1357 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
1358 Check for hidden undefs.
1359 (relocate_section): Call Symbol::is_strong_undefined.
1360
1361 * testsuite/Makefile.am (ehdr_start_test_1)
1362 (ehdr_start_test_2, ehdr_start_test_3)
1363 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
1364 * testsuite/Makefile.in: Regenerate.
1365 * testsuite/ehdr_start_def.cc: New source file.
1366 * testsuite/ehdr_start_test.cc: New source file.
1367 * testsuite/ehdr_start_test.t: New linker script.
1368 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 1369
7849f6d8
CC
13702014-04-23 Cary Coutant <ccoutant@google.com>
1371
bf2cc635 1372 PR gold/16870
7849f6d8
CC
1373 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
1374
99fd8cff
CC
13752014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1376
1377 * layout.cc (Layout::include_section): Allow a target to decide
1378 whether to include a section.
1379 * target.h (Target::should_include_section): New function.
1380 (Target::do_should_include_section): New function.
1381
91f43acd
CC
13822014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1383
1384 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
1385 inline into ...
1386 (Copy_relocs::emit): ... here.
1387 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
1388 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
1389 (Copy_reloc_entry::entries_): Change from private to protected.
1390
c4eb27e1
ST
13912014-04-02 Sriraman Tallam <tmsriram@google.com>
1392
1393 * icf.cc (get_section_contents): Replace copies of reloc
1394 vectors with const references.
1395
ae447ddd
CC
13962014-04-02 Cary Coutant <ccoutant@google.com>
1397
1398 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
1399 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
1400 * configure: Regenerate.
1401 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
1402 -fno-use-linker-plugin.
1403 (LINK1, CXXLINK1): Add it to the link command.
1404 * testsuite/Makefile.in: Regenerate.
1405
fa47fa92
AM
14062014-03-12 Alan Modra <amodra@gmail.com>
1407
1408 * Makefile.in: Regenerate.
1409
9b12c500
CC
14102014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1411
1412 * symtab.h (Symbol::set_nonvis): New function.
1413
beacaa96
CC
14142014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1415
1416 * symtab.cc (Sized_symbol<32>::init_output_data):
1417 Instantiate the template.
1418 (Sized_symbol<64>::init_output_data): Likewise.
1419
800d9823
CC
14202014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1421
1422 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
1423 adjust dynamic symbol value.
1424 * target.h (Target::adjust_dyn_symbol): New function.
1425 (Target::do_adjust_dyn_symbol): New function.
1426
918fc1f8 14272014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 1428
918fc1f8
CC
1429 * output.cc (Output_data_dynamic::Dynamic_entry::write):
1430 Get the value of DYNAMIC_CUSTOM dynamic entry.
1431 * output.h (Output_data_dynamic::add_custom): New function.
1432 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
1433 dynamic entry.
1434 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
1435 * target.h (Target::dynamic_tag_custom_value): New function.
1436 (Target::do_dynamic_tag_custom_value): New function.
1437
98ff9231
CC
14382014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1439
1440 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
1441 dynsym indexes.
1442 * target.h (Target::has_custom_set_dynsym_indexes): New function.
1443 (Target::do_has_custom_set_dynsym_indexes): New function.
1444 (Target::set_dynsym_indexes): New function.
1445 (Target::do_set_dynsym_indexes): New function.
1446
b80eed39
AM
14472014-03-07 Alan Modra <amodra@gmail.com>
1448
1449 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
1450 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
1451 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
1452 (Powerpc_relocate_functions::has_overflow_bitfield,
1453 overflowed): Use the above.
1454 (Target_powerpc::Relocate::relocate): Correct overflow checking
1455 for a number of relocations. Modify overflow test for 16-bit
1456 fields in instructions to signed/unsigned according to whether
1457 the field takes a signed or unsigned value.
1458
4b95cf5c
AM
14592014-03-05 Alan Modra <amodra@gmail.com>
1460
1461 Update copyright years.
1462
45965137
AM
14632014-03-05 Alan Modra <amodra@gmail.com>
1464
1465 * powerpc.cc (Target_powerpc::Scan::local, global): Support
1466 R_PPC64_ADDR64_LOCAL.
1467 (Target_powerpc::Relocate::relocate): Likewise.
1468
2c80b753
AM
14692014-03-03 Alan Modra <amodra@gmail.com>
1470
1471 * dwp.cc (print_version): Update copyright year to current.
1472
c1c69e83
AM
14732014-02-10 Alan Modra <amodra@gmail.com>
1474
1475 * po/gold.pot: Regenerate.
1476
dd0c4e70
CC
14772014-02-06 Cary Coutant <ccoutant@google.com>
1478
1479 Fix problem where -u is ignored when a weak undef is seen.
1480
1481 * archive.cc (Library_base::should_include_member): Reorder
1482 code to check for -u option if a weak undef has already been seen.
1483 * testsuite/Makefile.am (weak_undef_test_2): New test case.
1484 * testsuite/Makefile.in: Regenerate.
1485 * testsuite/weak_undef_file3.cc: New file.
1486 * testsuite/weak_undef_file4.cc: New file.
1487 * testsuite/weak_undef_test_2.cc: New file.
1488
1a221d3d
CC
14892014-02-05 Cary Coutant <ccoutant@google.com>
1490
1491 Fix issues with gold undefined symbol diagnostics.
1492
1493 PR binutils/15435
1494 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
1495 check to here.
1496 * target-reloc.h (is_strong_undefined): New function.
1497 (relocate_section): Move undef vtable symbol check from here.
1498 Check for is_strong_undefined.
1499
e889f0a4 15002014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 1501
e889f0a4
CC
1502 Fix problems with the --dynamic-list option.
1503
1504 PR gold/13577
1505 * options.cc (General_options::parse_dynamic_list):
1506 Set have_dynamic_list_.
1507 (General_options::General_options): Initialize have_dynamic_list_.
1508 (General_options::finalize): Turn off -Bsymbolic and
1509 -Bsymbolic-functions if --dynamic-list provided.
1510 * options.h (General_options::have_dynamic_list): New function.
1511 (General_options::have_dynamic_list_): New data member.
1512 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
1513 correctly.
5fe7ffdc 1514
e889f0a4
CC
1515 PR gold/16530
1516 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
1517 in --dynamic-list, mark it.
5fe7ffdc 1518
e889f0a4
CC
1519 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
1520 (dynamic_list_2): New test case.
1521 * testsuite/Makefile.in: Regenerate.
1522 * testsuite/dynamic_list_2.cc: New file.
1523 * testsuite/dynamic_list_2.t: New file.
1524 * testsuite/dynamic_list_lib1.cc: New file.
1525 * testsuite/dynamic_list_lib2.cc: New file.
1526 * testsuite/gc_dynamic_list_test.c: New file.
1527 * testsuite/gc_dynamic_list_test.sh: New file.
1528 * testsuite/gc_dynamic_list_test.t: New file.
1529
ec673e64
CC
15302014-01-28 Cary Coutant <ccoutant@google.com>
1531
1532 Add .gdb_index version 7 support.
1533
1534 * gold/dwarf_reader.cc: include <utility> (for make_pair).
1535 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
1536 debug sections.
1537 (Dwarf_ranges_table::read_ranges_table): Likewise.
1538 (Dwarf_pubnames_table::read_section): Check for GNU-style
1539 sections, and for compressed debug sections.
1540 (Dwarf_pubnames_table::read_header): Compute end address of table.
1541 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
1542 for end of list by offset, not by offset == 0.
1543 (Dwarf_info_reader::do_read_string_table): Check for compressed
1544 debug sections.
1545 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1546 Initialize new data members.
1547 (Dwarf_pubnames_table::next_name): return flag_byte.
1548 (Dwarf_pubnames_table::end_of_table_): New data member.
1549 (Dwarf_pubnames_table::is_gnu_style_): New data member.
1550 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
1551 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
1552 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
1553 read skeleton type unit DIEs.
1554 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
1555 (Gdb_index::do_write): Write flag_byte.
1556 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
1557 (Gdb_index::Cu_vector): Store flags along with cu indexes.
1558 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
1559 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
1560
221fd5d5
L
15612014-01-08 H.J. Lu <hongjiu.lu@intel.com>
1562
1563 * version.cc (print_version): Update copyright year to 2014.
1564
6c09fb0b
ILT
15652013-12-19 Dimitry Andric <dimitry@andric.com>
1566
1567 * stringpool.cc (Stringpool_template::reserve): Add
1568 HAVE_UNORDERED_MAP case.
1569 * stringpool.cc (Stringpool_template::print_stats): Likewise.
1570
8356f2d0
CC
15712013-12-18 Cary Coutant <ccoutant@google.com>
1572
1573 * configure.ac: Check for <unordered_set> and <unordered_map>.
1574 * config.in: Regenerate.
1575 * configure: Regenerate.
1576 * system.h: Use <unordered_set> and <unordered_map> if available.
1577
f2c7d7ee
RM
15782013-12-10 Roland McGrath <mcgrathr@google.com>
1579
1580 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
1581 with $(INSTALL_PROGRAM_ENV).
1582 * Makefile.in: Regenerate.
1583
6632e8cc
CC
15842013-11-22 Cary Coutant <ccoutant@google.com>
1585
1586 * configure.ac: Add check for which library is needed for
1587 dlopen.
1588 * configure: Regenerate.
1589
0c075858
CC
15902013-11-22 Cary Coutant <ccoutant@google.com>
1591
1592 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
1593 assembler.
1594 * testsuite/Makefile.in: Regenerate.
1595
f49fe902
L
15962013-11-17 H.J. Lu <hongjiu.lu@intel.com>
1597
1598 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
1599 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
1600 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
1601 (Target_x86_64<size>::Scan::local): Likewise.
1602 (Target_x86_64<size>::Scan::global): Likewise.
1603 (Target_x86_64<size>::Relocate::relocate): Likewise.
1604 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
1605 Likewise.
1606 (Target_x86_64<size>::Scan::check_non_pic(): Handle
1607 R_X86_64_PC32_BND.
1608
1609 * testsuite/Makefile.am (check_PROGRAMS): Add
1610 exception_x86_64_bnd_test.
1611 (exception_x86_64_bnd_test_SOURCES): New macro.
1612 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
1613 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
1614 (exception_x86_64_bnd_test_LDADD): Likewise.
1615 (exception_x86_64_bnd_1.o): New rule.
1616 (exception_x86_64_bnd_2.o): Likewise.
1617 * testsuite/Makefile.in: Regenerated.
1618
9055360d
AM
16192013-11-15 Alan Modra <amodra@gmail.com>
1620
1621 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
1622 accessor.
1623 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
1624 Only call ppc64_local_entry_offset for 64-bit. Restrict
1625 symval_for_branch lookup to ELFv1.
1626 (Stub_table::add_plt_call_entry): Use unsigned int off.
1627 (Output_data_glink::Address, invalid_address): New.
1628 (Output_data_glink::add_eh_frame): Move out of line. Add
1629 support for ELFv2.
1630 (Output_data_glink::add_global_entry, find_global_entry,
1631 global_entry_address): New functions.
1632 (Output_data_glink::global_entry_stubs_, end_branch_table_,
1633 ge_size): New variables.
1634 (Output_data_glink::set_final_data_size): Add global entry
1635 stub sizing.
1636 (Output_data_glink::do_write): Write global entry stubs.
1637 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
1638 parameter. Return true for ELFv2. Adjust callers.
1639 (Target_powerpc::Scan::local, global): Restrict opd lookup to
1640 ELFv1. Similarly for ifunc and dynamic relocation processing
1641 specific to ELFv1. Recognize that symbols are defined on
1642 their plt entries for ELFv2.
1643 (Target_powerpc::symval_for_branch): Assert if called for
1644 ELFv2 or ppc32.
1645 (Target_powerpc::Relocate::relocate): Use global entry plt
1646 stub for symbol value if such exists on ELFv2.
1647 (Target_powerpc::Relocate::relocate): Don't call
1648 symval_for_branch when ELFv2. Do adjust for local entry
1649 offset when ELFv2.
1650 (Target_powerpc::do_dynsym_value): Set symbols to global entry
1651 plt stub for ELFv2.
1652 (Target_powerpc::do_plt_address_for_global): Similarly.
1653
cafdd569
CC
16542013-11-14 Cary Coutant <ccoutant@google.com>
1655
1656 Revert patch -- this did not fix the problem, and there is
1657 no race there.
1658
1659 2013-11-14 Cary Coutant <ccoutant@google.com>
1660
1661 PR gold/14860
1662 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1663 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1664 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1665 updating fde_offsets_.
1666 (Eh_frame_hdr::lock_): New data member.
1667
94e49e16
CC
16682013-11-14 Cary Coutant <ccoutant@google.com>
1669
1670 * dwp.cc (Dwo_file_entry): New type.
1671 (File_list): Use Dwo_file_entry.
1672 (Dwo_file::verify): New function.
1673 (Dwo_file::verify_dwo_list): New function.
1674 (Dwo_file::sized_verify_dwo_list): New function.
1675 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
1676 list.
1677 (Dwp_options): New enum type.
1678 (dwp_options): Add --verify-only.
1679 (usage): Likewise.
1680 (main): Likewise.
1681 * dwp.h (gold_info): Add declaration.
1682
7cdd7d57
CC
16832013-11-14 Cary Coutant <ccoutant@google.com>
1684
1685 PR gold/14860
1686 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1687 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1688 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1689 updating fde_offsets_.
1690 (Eh_frame_hdr::lock_): New data member.
1691
1d946cb3
CC
16922013-11-06 Cary Coutant <ccoutant@google.com>
1693
1694 PR gold/15758
1695 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
1696 before reloc sections.
1697
4f65b40e
AM
16982013-11-04 Alan Modra <amodra@gmail.com>
1699
1700 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
1701 (Symbol::needs_dynamic_reloc): Test new flag.
1702 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
1703 (Target_powerpc::Scan::get_reference_flags): Add target param.
1704 Return FUNC_DESC_ABI for 64-bit ELFv1.
1705 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
1706 call.
1707 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
1708 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
1709
908794a9
CC
17102013-10-31 Cary Coutant <ccoutant@google.com>
1711
1712 Restore support for dwp v2 DWARF package file format.
1713
1714 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1715 tu_length parameter. Adjust all callers.
1716 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1717 * dwp.cc: Include dwarf.h.
1718 (Section_bounds): New struct type.
1719 (Unit_set): New struct type.
1720 (Dwo_file::Dwo_file): Initialize new data member.
1721 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1722 Combine and rename to...
1723 (Dwo_file::read_unit_index): ...this.
1724 (Dwo_file::sized_read_compunit_index)
1725 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1726 (Dwo_file::sized_read_unit_index): ...this.
1727 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1728 parameters; add section_id parameter.
1729 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1730 (Dwo_file::add_unit_set): ...this.
1731 (Dwo_file::shndx_map_): Remove.
1732 (Dwo_file::sect_offsets_): New data member.
1733 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1734 (Dwp_output_file::add_section): Rename to...
1735 (Dwp_output_file::add_contribution): ...this.
1736 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1737 (Dwp_output_file::add_tu_set): Likewise.
1738 (Dwp_output_file::Contribution): New type.
1739 (Dwp_output_file::Section::contributions): New data member.
1740 (Dwp_output_file::Cu_or_tu_set): Remove.
1741 (Dwp_output_file::Section::Section): New ctor.
1742 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1743 (Dwp_output_file::Dwp_index::Section_table): New type.
1744 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1745 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1746 parameter.
1747 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1748 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1749 (Dwp_output_file::Dwp_index::section_table): New member function.
1750 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1751 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1752 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1753 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1754 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1755 (Dwp_output_file::Dwp_index::section_table_): New data member.
1756 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1757 (Dwp_output_file::add_output_section): New member function.
1758 (Dwp_output_file::write_new_section): New member function.
1759 (Dwp_output_file::write_contributions): New member function.
1760 (Dwp_output_file::section_id_map_): New data member.
1761 (class Dwo_id_info_reader): Remove.
1762 (class Unit_reader): New class.
1763 (get_dwarf_section_name): New function.
1764 (Dwo_file::read_executable): Adjust initializations of class data.
1765 (Dwo_file::read): Add support for v2 package file format.
1766 (Dwo_file::read_unit_index): Likewise.
1767 (Dwo_file::sized_read_unit_index): Likewise.
1768 (Dwo_file::copy_section): Likewise.
1769 (Dwo_file::add_unit_set): Likewise.
1770 (Dwp_output_file::add_output_section): Likewise.
1771 (Dwp_output_file::add_contribution): Likewise.
1772 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1773 for empty slot.
1774 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1775 file format.
1776 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1777 slot.
1778 (Dwp_output_file::initialize): Remove unused function.
1779 (Dwp_output_file::finalize): Add support for v2 package file format.
1780 (Dwp_output_file::write_index): Likewise.
1781 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1782 function prototype.
1783
2500c017
CC
17842013-10-31 Cary Coutant <ccoutant@google.com>
1785
1786 * configure.ac: Fix check for -fmerge-constants.
1787 * configure.ac: Regenerate.
1788
dd0845d7
RM
17892013-10-30 Roland McGrath <mcgrathr@google.com>
1790
1791 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
1792 Correct 9-byte nop sequence to match what the assembler generates.
1793
b4f7960d
AM
17942013-10-30 Alan Modra <amodra@gmail.com>
1795
1796 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
1797 ppc64_local_entry_offset, ppc64_local_entry_offset,
1798 do_read_symbols): New functions.
1799 (Powerpc_relobj::e_flags_, st_other_): New vars.
1800 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
1801 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
1802 (Powerpc_relobj::e_flags_): New var.
1803 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
1804 and adjust for ELFv2.
1805 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
1806 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
1807 (Powerpc_dynobj::do_find_special_sections): Likewise.
1808 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
1809 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
1810 to ELFv2 local entry.
1811 (Target_powerpc::do_relax): No thread safe barriers needed for
1812 ELFv2.
1813 (Output_data_plt_powerpc::initial_plt_entry_size_,
1814 plt_entry_size): Delete. Replace all uses with
1815 first_plt_entry_offset() and plt_entry_size().
1816 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
1817 reserved_size parm. Update callers.
1818 (Output_data_plt_powerpc::entry_count): Update.
1819 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
1820 and use Target_powerpc::first_plt_entry_offset().
1821 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
1822 rename to plt_entry_size.
1823 (Output_data_plt_powerpc::add_ifunc_entry,
1824 add_local_ifunc_entry): Adjust reloc for ELFv2.
1825 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
1826 (glink_eh_frame_fde_64v2): New.
1827 (Stub_table::plt_call_size): Support ELFv2 sizing.
1828 (Output_data_glink::add_eh_frame): Use the new FDE.
1829 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
1830 (Stub_table::do_write): Write ELFv2 stubs and glink.
1831 (Target_powerpc::Relocate::relocate): Replaces nop after call
1832 with ld 2,24(1) and adjust local offset destination for ELFv2.
1833
f9c6b907
AM
18342013-10-30 Alan Modra <amodra@gmail.com>
1835
1836 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
1837 (Target_powerpc::Scan::global, local): Likewise.
1838 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
1839 on all ppc64 @h and @ha relocs.
1840
e84fe78f
AM
18412013-10-14 Alan Modra <amodra@gmail.com>
1842
1843 * output.h (Output_data_got::add_constant): Tidy.
1844 (Output_data_got::add_constant_pair): New function.
1845 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
1846 methods used so as to first call reserve_ent().
1847
679e4abf
RM
18482013-10-11 Roland McGrath <mcgrathr@google.com>
1849
44dcb735
RM
1850 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
1851 add_got_entry and add_got_entry_pair.
1852
13323c49
RM
1853 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
1854 (HAVE_PUBNAMES): Likewise.
1855 * configure: Regenerate.
1856
1496b446
RM
1857 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
1858 * testsuite/Makefile.in: Regenerate.
1859
cc84c10b
RM
1860 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
1861 Remove const from declaration.
1862 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
1863 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
1864 * output.h (Output_file_header): Remove const from member target_
1865 and corresponding constructor argument.
1866 * output.cc (Output_file_header::Output_file_header): Update prototype.
1867 (Output_file_header::do_sized_write): Use this->target_ in place
1868 of parameters()->target().
1869
52f66a2c
RM
1870 * testsuite/undef_symbol.cc (Foo::get_a): New method.
1871
2b64b551
RM
1872 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
1873 * configure: Regenerate.
1874 * Makefile.in: Regenerate.
1875 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
1876 * testsuite/merge_string_literals_2.c: Likewise.
1877 * testsuite/Makefile.am
1878 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
1879 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
1880 literal -fmerge-constants.
1881 * testsuite/Makefile.in: Regenerate.
1882
43819297
RM
1883 * i386.cc (Target_i386): Remove unused member dynbss_.
1884 * arm.cc (Target_arm): Likewise.
1885 * powerpc.cc (Target_powerpc): Likewise.
1886 * sparc.cc (Target_sparc): Likewise.
1887 * tilegx.cc (Target_tilegx): Likewise.
1888 * x86_64.cc (Target_x86_64): Likewise.
1889 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
1890 type_signature_, type_offset_.
1891 * plugin.h (Plugin_hook): Remove unused member layout_.
1892 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
1893 mapfile_.
1894 (Read_member): Remove unused members input_objects_, symtab_,
1895 mapfile_, layout_.
1896 (Check_library): Remove unused member symtab_.
1897 * archive.h (Lib_group): Remove unused member lib_.
1898 * archive.cc (Lib_group::Lib_group): Update initializer.
1899 * incremental.h (Incremental_binary): Remove unused member target_.
1900 (Incremental_script_entry): Removed unused member script_.
1901 * layout.h (Write_symbols_task): Remove unused member input_objects_.
1902 * icf.h (Icf): Remove unused member num_tracked_relocs.
1903
39d9ead7
RM
1904 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
1905 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
1906 its only use.
1907 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
1908
679e4abf
RM
1909 * archive.h: Use struct rather than class for forward declaration
1910 of Read_symbols_data.
1911
54de2ea6
CC
19122013-10-07 Cary Coutant <ccoutant@google.com>
1913
1914 PR gold/16010
1915 * testsuite/Makefile.am (icf_test): Fix dependencies.
1916 (icf_safe_test): Likewise.
1917 (icf_safe_so_test): Likewise.
1918 (large_symbol_alignment): Add empty _LDADD rule.
1919 * testsuite/Makefile.in: Regenerate.
1920
b14016f0
L
19212013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
1922
1923 PR gold/15927
1924 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
1925 relocation for R_X86_64_32 on x32.
1926
eb426534
RM
19272013-08-27 Roland McGrath <mcgrathr@google.com>
1928
1929 * output.cc (Output_segment::set_section_addresses): Take new
1930 Target* argument. If target->isolate_execinstr() and the segment
1931 is executable and starts at a target->abi_pagesize() boundary,
1932 pad its end out to a target->abi_pagesize() boundary with code fill.
1933 * output.h (Output_segment::set_section_addresses): Update decl.
1934 * layout.h (Layout::check_output_data_for_reset_values): Take new
1935 argument RELAX_OUTPUTS.
1936 (Layout): New member relax_output_list_.
1937 (Layout::add_relax_output): New method.
1938 * layout.cc (Layout::Layout): Update constructor.
1939 (Layout::reset_relax_output): New method.
1940 (Layout::clean_up_after_relaxation): Call it.
1941 (Layout::prepare_for_relaxation): Update caller.
1942 (Layout::set_segment_offsets): Update callers of set_section_addresses.
1943 Call reset_relax_output before re-processing segments for
1944 isolate_execinstr case.
1945 (Layout::write_data): Handle relax_output_list_.
1946 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
1947 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
1948
9aff4b7a
NC
19492013-08-23 Yuri Chornoivan <yurchor@ukr.net>
1950
1951 PR binutils/15834
1952 * object.h: Fix typos.
1953
93f8221c
RM
19542013-08-16 Roland McGrath <mcgrathr@google.com>
1955
1956 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
1957 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
1958
e44c3715
CC
19592013-08-07 Cary Coutant <ccoutant@google.com>
1960
1961 Revert support for v2 DWP files:
1962
1963 2013-03-01 Cary Coutant <ccoutant@google.com>
1964
1965 Add dwp support for v2 DWARF package file format.
1966 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1967 tu_length parameter. Adjust all callers.
1968 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1969 * dwp.cc: Include dwarf.h.
1970 (Section_bounds): New struct type.
1971 (Unit_set): New struct type.
1972 (Dwo_file::Dwo_file): Initialize new data member.
1973 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1974 Combine and rename to...
1975 (Dwo_file::read_unit_index): ...this.
1976 (Dwo_file::sized_read_compunit_index)
1977 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1978 (Dwo_file::sized_read_unit_index): ...this.
1979 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1980 parameters; add section_id parameter.
1981 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1982 (Dwo_file::add_unit_set): ...this.
1983 (Dwo_file::shndx_map_): Remove.
1984 (Dwo_file::sect_offsets_): New data member.
1985 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1986 (Dwp_output_file::add_section): Rename to...
1987 (Dwp_output_file::add_contribution): ...this.
1988 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1989 (Dwp_output_file::add_tu_set): Likewise.
1990 (Dwp_output_file::Contribution): New type.
1991 (Dwp_output_file::Section::contributions): New data member.
1992 (Dwp_output_file::Cu_or_tu_set): Remove.
1993 (Dwp_output_file::Section::Section): New ctor.
1994 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1995 (Dwp_output_file::Dwp_index::Section_table): New type.
1996 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1997 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1998 parameter.
1999 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2000 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2001 (Dwp_output_file::Dwp_index::section_table): New member function.
2002 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2003 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2004 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2005 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2006 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2007 (Dwp_output_file::Dwp_index::section_table_): New data member.
2008 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2009 (Dwp_output_file::add_output_section): New member function.
2010 (Dwp_output_file::write_new_section): New member function.
2011 (Dwp_output_file::write_contributions): New member function.
2012 (Dwp_output_file::section_id_map_): New data member.
2013 (class Dwo_id_info_reader): Remove.
2014 (class Unit_reader): New class.
2015 (get_dwarf_section_name): New function.
2016 (Dwo_file::read_executable): Adjust initializations of class data.
2017 (Dwo_file::read): Add support for v2 package file format.
2018 (Dwo_file::read_unit_index): Likewise.
2019 (Dwo_file::sized_read_unit_index): Likewise.
2020 (Dwo_file::copy_section): Likewise.
2021 (Dwo_file::add_unit_set): Likewise.
2022 (Dwp_output_file::add_output_section): Likewise.
2023 (Dwp_output_file::add_contribution): Likewise.
2024 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2025 for empty slot.
2026 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2027 file format.
2028 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2029 slot.
2030 (Dwp_output_file::initialize): Remove unused function.
2031 (Dwp_output_file::finalize): Add support for v2 package file format.
2032 (Dwp_output_file::write_index): Likewise.
2033 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2034 function prototype.
2035
c6905c28
CC
20362013-07-31 Cary Coutant <ccoutant@google.com>
2037
2038 * object.cc (Sized_relobj::do_output_section_address): New function.
2039 (Sized_relobj): Instantiate explicitly.
2040 * object.h (Object::output_section_address): New function.
2041 (Object::do_output_section_address): New function.
2042 (Sized_relobj::do_output_section_address): New function.
2043 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
2044
20452013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 2046 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
2047
2048 * parameters.cc (Parameters::entry): Return target-specific entry
2049 symbol name.
2050 * target.h (Target::entry_symbol_name): New function.
2051 (Target_info::entry_symbol_name): New data member.
2052
2053 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
2054 * i386.cc (Target_i386::i386_info): Likewise.
2055 (Target_i386_nacl::i386_nacl_info): Likewise.
2056 * sparc.cc (Target_sparc::sparc_info): Likewise.
2057 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
2058 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
2059 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
2060 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2061
234d4ab8
SA
20622013-07-22 Sterling Augustine <saugustine@google.com>
2063
2064 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
2065 Convert parameter shndx to local variable. Add parameters symtab
2066 and symtab_size. Scan over section names. Find relocation
2067 section corresponding to current section. Create and initialize
2068 reloc_mapper_ and reloc_type_.
2069 (Dwarf_pubnames_table::read_header): Add assertion. Change
2070 unit_length to off_t. Initialize member unit_length_. Fill in field
2071 cu_offset_.
2072 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2073 Initialize new fields unit_length_ and cu_offset_.
2074 (Dwarf_pubnames_table::read_section): Update prototype.
2075 (Dwarf_pubnames_table::cu_offset): New member function.
2076 (Dwarf_pubnames_table::subsection_size): Likewise.
2077 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
2078 New fields.
2079 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
2080 member functions public.
2081 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
2082 Update comment. Rework logic. Move repeated parts to...
2083 (Gdb_index_info_reader::read_pubtable): ...here. New function.
2084 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
2085 pubtypes_table_, and stmt_list_offset.
2086 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2087 Gdb_index::find_pubtype_offset,
2088 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
2089 (Gdb_index::pubnames_read): Update prototype and rework logic.
2090 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
2091 Forward declare.
2092 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2093 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
2094 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
2095 Gdb_index::map_pubtable_to_dies):
2096 Declare functions.
2097 (Gdb_index::pubnames_read): Update declaration.
2098 (Gdb_index::Pubname_offset_map): New type.
2099 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
2100 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
2101 Gdb_index::stmt_list_offset): Declare.
2102 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
2103 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
2104 Gdb_index::pubtypes_offset_): Remove.
2105
a3ed37d8
RM
21062013-07-19 Roland McGrath <mcgrathr@google.com>
2107
2108 * options.h (General_options): Add -Trodata-segment option.
2109 * parameters.cc (Parameters::check_rodata_segment): New function.
2110 (Parameters::set_target_once): Call it.
2111 * parameters.h (Parameters): Declare it (private member function).
2112 * layout.cc (load_seg_unusable_for_headers): New function, broken
2113 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
2114 then validate rodata segment rather than text segment.
2115 (relaxation_loop_body): Call that.
2116 (is_text_segment): New function. Don't admit a non-executable
2117 segment if TARGET->isolate_execinstr().
2118 (set_segment_offsets): Call it. Honor -Trodata-segment option.
2119
eb5b4ded
CC
21202013-07-15 Shawn Landden <shawnlandden@gmail.com>
2121
2122 PR gold/15070
2123 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
2124 * nacl.h (Sniff_file::View::View): Request aligned view.
2125
4d5effb9
CC
21262013-07-11 Cary Coutant <ccoutant@google.com>
2127
2128 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
2129 correct BRLT entry size.
2130
ba8ca3e7
AM
21312013-07-03 Alan Modra <amodra@gmail.com>
2132
2133 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
2134 comment.
2135
267257d2
CC
21362013-07-01 Cary Coutant <ccoutant@google.com>
2137
2138 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
2139 reloc_type_.
2140 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
2141 (Dwarf_ranges_table::lookup_reloc): New function.
2142 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
2143 reloc_type_.
2144 (Dwarf_ranges_table::lookup_reloc): New function.
2145 (Dwarf_ranges_table::reloc_type_): New data member.
2146
06f30c9d
CC
21472013-06-27 Jing Yu <jingyu@google.com>
2148
2149 PR gold/15662
2150 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
2151 function.
2152 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
2153 (Target_powerpc::do_relax): Call the above.
2154
a2d7bf59
AM
21552013-06-27 Cary Coutant <ccoutant@google.com>
2156
2157 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
2158 on garbage collected .opd section.
2159
21602013-06-27 Alan Modra <amodra@gmail.com>
2161
2162 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
2163 is non-zero.
2164 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
2165 (Target_powerpc::do_function_location): Likewise for loc->shndx.
2166
32364e50
CC
21672013-06-14 Cary Coutant <ccoutant@google.com>
2168
2169 * resolve.cc (Symbol::override_base): Don't override st_type
2170 from plugin placeholder symbols.
2171 (Symbol_table::resolve): Likewise.
2172 (Symbol_table::should_override): Don't complain about TLS mismatch
2173 if the TO symbol is a plugin placeholder.
2174 * testsuite/Makefile.am (plugin_test_tls): New test.
2175 * testsuite/Makefile.in: Regenerate.
2176 * testsuite/plugin_test_tls.sh: New test script.
2177 * testsuite/two_file_test_2_tls.cc: New test source.
2178 * testsuite/two_file_test_tls.cc: New test source.
2179
7fb47cc9
CC
21802013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
2181
2182 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
2183 the maximum segment alignment is larger than the page size.
2184 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
2185 correctly aligns the symbols with large alignemnt.
2186 * testsuite/Makefile.in: Regenerate.
2187 * testsuite/large_symbol_alignment.cc: New file.
2188
6934001a
CC
21892013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
2190 Sriraman Tallam <tmsriram@google.com>
2191
2192 * options.h (sort_section): New option.
2193 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
2194 Rename from Input_section_sort_section_name_special_ordering_compare.
2195 (Input_section_sort_section_name_compare): New struct.
2196 * output.cc (Output_section::Input_section_sort_section_name_compare::
2197 operator()): New function.
2198 (Output_section::sort_attached_input_sections): Use new sort function
2199 for .text if --sort-section=name is specified.
2200 * layout.cc (Layout::make_output_section):
2201 Add sorting by name when --sort-section=name is specified.
2202 * testsuite/Makefile.am (text_section_grouping): Test option
2203 --sort-section=name.
2204 * testsuite/Makefile.in: Regenerate.
2205 * testsuite/section_sorting_name.cc: New file.
2206 * testsuite/section_sorting_name.sh: New file.
2207
93acabad
CC
22082013-05-21 Cary Coutant <ccoutant@google.com>
2209
2210 * symtab.h (Symbol::is_cxx_vtable): New function.
2211 * target-reloc.h (relocate_section): Check for vtable symbol.
2212 * testsuite/Makefile.am (missing_key_func.sh): New test case.
2213 * testsuite/Makefile.in: Regenerate.
2214 * testsuite/missing_key_func.cc: New test source.
2215 * testsuite/missing_key_func.sh: New test script.
2216
60e8b3fc
CC
22172013-05-21 Cary Coutant <ccoutant@google.com>
2218
2b64b551
RM
2219 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
2220 type of enclosing symbol.
2221 (Relocate_info::location): Check symbol type when describing symbol.
2222 * object.h (Symbol_location_info): Remove unused line_number;
2223 add enclosing_symbol_type.
2224 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 2225
9df9de2c
CC
22262013-05-13 Cary Coutant <ccoutant@google.com>
2227
2b64b551
RM
2228 * configure.ac: Export DEFAULT_TARGET.
2229 * configure: Regenerate.
2230 * Makefile.in: Regenerate.
2231 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
2232 * testsuite/Makefile.in: Regenerate.
2233 * testsuite/debug_msg.sh: Delete duplicate tests.
2234 Don't check undef_int error message match for powerpc where the
2235 source file and line number aren't available.
9df9de2c 2236
bbc5ae17
RM
22372013-05-10 Roland McGrath <mcgrathr@google.com>
2238
2239 * options.h (General_options): Add --rosegment-gap option.
2240 * options.cc (finalize): --rosegment-gap implies --rosegment.
2241 * layout.cc (set_segment_offsets): Let user option override
2242 target->rosegment_gap().
2243
0c6e6c39
RM
22442013-05-10 Roland McGrath <mcgrathr@google.com>
2245
2246 * options.h (General_options): Remove leading space from help
2247 messages for -nostdlib and --rosegment.
2248
cde7cb01
MR
22492013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
2250
2251 PR ld/15365
2252 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
2253
f31ae5b8
AM
22542013-05-03 Alan Modra <amodra@gmail.com>
2255
2256 * merge.cc (Output_merge_string::do_add_input_section): Correct
2257 scan for number of strings. Rename vars to avoid shadowing.
2258 Include missing terminator in input_size_.
2259
d3a7cd45
L
22602013-05-01 H.J. Lu <hongjiu.lu@intel.com>
2261
2262 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
2263 Restore empty string handling.
2264
6ad3daba
CC
22652013-05-01 Cary Coutant <ccoutant@google.com>
2266
2267 * stringpool.cc (Stringpool_template::new_key_offset): Fix
2268 uninitialized warning.
2269
e31908b6
CC
22702013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
2271
2272 * output.cc (Output_section::add_merge_input_section): Allow
2273 to merge sections if the alignment is more than character size.
2274 * merge.h (Output_merge_string::Output_merge_string): Remove
2275 assert.
2276 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
2277 only not-null strings. Check the alignment of strings.
2278 * stringpool.h
2279 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
2280 alignment as the argument.
2281 (Stringpool_template<Stringpool_char>::addralign_): New class member.
2282 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
2283 Align non-zero length strings according to the addralign_.
2284 (Stringpool_template<Stringpool_char>::set_string_offsets):
2285 Updating offsets according to the given alignment.
2286 * testsuite/Makefile.am (text_section_grouping): Test if string
2287 literals are getting merged.
2288 * testsuite/Makefile.in: Regenerate.
2289 * testsuite/merge_string_literals_1.c: New file.
2290 * testsuite/merge_string_literals_2.c: Ditto.
2291 * testsuite/merge_string_literals.sh: Ditto.
2292
0e804863
ILT
22932013-04-26 Ian Lance Taylor <iant@google.com>
2294
2295 * target-reloc.h (relocate_section): If the reloc offset is out of
2296 range, pass VIEW as NULL to relocate.relocate.
2297 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
2298 * i386.cc (Target_i386::Relocate::relocate): Likewise.
2299 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
2300 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
2301 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
2302 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
2303
e7c5ea40
CC
23042013-04-26 Geoff Pike <gpike@chromium.org>
2305
2306 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
2307 * layout.cc (Hash_task): New class.
2308 (Layout::queue_build_id_tasks): New function.
2309 (Layout::write_build_id): Handle single-thread portion of build ID
2310 computation. (In some cases, all of it is single-threaded.) Replace
2311 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
2312 functionality in fewer lines of code.
2313 * layout.h (Layout::queue_build_id_tasks): New function declaration.
2314 * options.h (General_options): make "--build-id" default to tree
2315 rather than sha1. Add two new options related to --build-id=tree:
2316 --build-id-chunk-size-for-treehash and
2317 --build-id-min-file-size-for-treehash.
2318 * Makefile.am: add testing of --build-id=tree and related new options
2319 (these tests will be invoked by "make check").
2320 * Makefile.in: Regenerate.
2321
49926cd0
AM
23222013-04-25 Alan Modra <amodra@gmail.com>
2323
2324 * configure.tgt: Add powerpcle and powerpc64le.
2325
a4034750
AM
23262013-04-22 Alan Modra <amodra@gmail.com>
2327
2328 PR gold/15355
2329 * layout.cc (Layout::segment_precedes): Allow more than one
2330 segment with the same type and flags.
2331
e79c84aa
CC
23322013-04-15 Cary Coutant <ccoutant@google.com>
2333
2334 * layout.cc (Layout::set_relocatable_section_offsets): Don't
2335 allocate space in file for BSS sections.
2336
2199fbe7
CC
23372013-04-15 Cary Coutant <ccoutant@google.com>
2338
2339 * script-sections.cc (Orphan_output_section): Reset address
2340 to zero after each orphaned section for relocatable links.
2341
502e8a84
CC
23422013-04-15 Cary Coutant <ccoutant@google.com>
2343
a4034750
AM
2344 * symtab.cc (Symbol_table::sized_write_globals): Subtract
2345 section starting address for relocatable link.
2346 * testsuite/Makefile.am (script_test_11): New test.
2347 * testsuite/Makefile.in: Regenerate.
2348 * testsuite/script_test_11.c: New source file.
2349 * testsuite/script_test_11.t: New linker script.
502e8a84 2350
0cfdc767
AM
23512013-04-13 Alan Modra <amodra@gmail.com>
2352
2353 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
2354 owner when sections are not adjacent and exceed group size.
2355 (Target_powerpc::group_sections): Handle corner case.
2356 (Target_powerpc::Branch_info::make_stub): Handle case where
2357 stub table doesn't exist due to branches in non-exec sections.
2358 (Target_powerpc::Relocate::relocate): Likewise.
2359
6830ee24
AM
23602013-04-11 Alan Modra <amodra@gmail.com>
2361
2362 PR gold/15354
2363 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
2364 .branch_lt to match bfd ld. Adjust comments throughout file.
2365
54a3d865
ILT
23662013-04-04 Ian Lance Taylor <iant@google.com>
2367
2368 GCC PR c++/56840
2369 * object.cc (do_layout_deferred_sections): Handle .eh_frame
2370 sections before checking whether they are included in the link.
2371
9993ba11
ST
23722013-03-29 Sriraman Tallam <tmsriram@google.com>
2373
2374 * archive.cc (Archive::get_elf_object_for_member): Create the elf
2375 object before calling the plugin claim_file handler. Pass the elf
2376 object of the archive to the plugin. Delete the elf object if the
2377 plugin claims the file.
2378
ebacd51e
AM
23792013-03-21 Alan Modra <amodra@gmail.com>
2380
2381 * layout.cc (Layout::set_segment_offsets): Accept writable .text
2382 segment when omagic.
2383
117be58f
AM
23842013-03-21 Alan Modra <amodra@gmail.com>
2385
2386 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
2387 comparison warning.
2388 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
2389 uninitialized" warning.
2390
32e2b61d
AM
23912013-03-20 Alan Modra <amodra@gmail.com>
2392
2393 * symtab.h (Symbol::clear_version): New function.
2394 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
2395 is_needed by weak references. Clear version for symbols defined
2396 in as-needed objects that are not needed.
2397
b3ccdeb5
AM
23982013-03-15 Alan Modra <amodra@gmail.com>
2399
2400 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
2401 static and public. Add report_err param. Return false for data refs.
2402 (Target_powerpc::rela_dyn_section): New overloaded function.
2403 (Target_powerpc::plt_, iplt_): Elucidate.
2404 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
2405 (Output_data_plt_powerpc::do_write): Don't write .iplt.
2406 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
2407 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
2408 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
2409 push_branch and make_plt_entry for ifunc syms when
2410 reloc_needs_plt_for_ifunc.
2411 (Target_powerpc::Relocate::relocate): Don't use plt entry value
2412 for ifunc unless reloc_needs_plt_for_ifunc.
2413
ad3d8a2f
AM
24142013-03-15 Alan Modra <amodra@gmail.com>
2415
2416 * gc.h (gc_process_relocs): Don't look through function descriptors.
2417 * icf.cc (get_section_contents): Do so here instead.
2418
4d9aa155
AM
24192013-03-13 Alan Modra <amodra@gmail.com>
2420
2421 * powerpc.cc (is_branch_reloc): Forward declare.
2422 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
2423 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
2424 false for 64-bit, true for 32-bit non-branch relocs.
2425 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
2426 * testsuite/Makefile.am (icf_test): Use linker map file instead of
2427 nm output.
2428 (icf_safe_test): Generate linker map file as well as nm output.
2429 (icf_safe_so_test): Likewise.
2430 * testsuite/Makefile.in: Regenerate.
2431 * testsuite/icf_test.sh: Parse linker map file to determine
2432 section folding.
2433 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
2434 * testsuite/icf_safe_so_test.sh: Likewise.
2435 (X86_32_or_ARM_specific_safe_fold): Merge into..
2436 (arch_specific_safe_fold): ..this.
2437 (X86_64_specific_safe_fold): Delete unused function.
2438
57420c20
AM
24392013-03-12 Alan Modra <amodra@gmail.com>
2440
2441 * gc.h (gc_process_relocs): Look through function descriptors
2442 to determine shndx, symvalue and addend used by ICF. Tidy
2443 variable duplication.
2444
dc3714f3
AM
24452013-03-11 Alan Modra <amodra@gmail.com>
2446
2447 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
2448 * layout.cc (Layout_task_runner::run): ..to here.
2449 * symtab.h (struct Symbol_location): Extract from..
2450 (class Symbol_table): ..here.
2451 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
2452 * target.h (class Target): Add function_location and
2453 do_function_location functions.
2454 (class Sized_target): Add do_function_location.
2455 * object.h (class Sized_relobj_file): Move find_shdr..
2456 (class Object): ..to here.
2457 * object.cc: Likewise. Update to suit. Instantiate.
2458 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
2459 * powerpc.cc (class Powerpc_dynobj): New.
2460 (Target_powerpc::do_function_location): New function.
2461 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
2462 (Powerpc_dynobj::do_read_symbols): New function.
2463 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
2464
956b03bb
ILT
24652013-03-08 Ian Lance Taylor <iant@google.com>
2466
2467 * options.cc (General_options::string_to_object_format): Accept
2468 "default".
2469
4bead2d5
AM
24702013-03-08 Alan Modra <amodra@gmail.com>
2471
2472 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
2473 pointer to Post_fde.
2474 (struct Post_fde): Move definition to here..
2475 * ehframe.cc (struct Post_fde): ..from here.
2476 (Cie::write): Don't alloc Post_fde.
2477 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
2478
02e60bf7
AM
24792013-03-07 Alan Modra <amodra@gmail.com>
2480
2481 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
2482 relocation referencing .LC0.
2483 * testsuite/discard_locals_test.sh: Remove FIXMEs.
2484
8343f03a
AM
24852013-03-07 Alan Modra <amodra@gmail.com>
2486
2487 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
2488 always_inline. Add assembly for powerpc to avoid GOT.
2489
3366d57c
AM
24902013-03-07 Alan Modra <amodra@gmail.com>
2491
2492 * testsuite/script_test_10.sh: Don't test .bss section
2493 header number.
2494
6c77229c
AM
24952013-03-06 Alan Modra <amodra@gmail.com>
2496
2497 * powerpc.cc (class Powerpc_relobj): Move some member functions.
2498 (Target_powerpc::symval_for_branch): Add symtab param. Update
2499 all callers. Handle folded sections.
2500 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
2501 to Powerpc_relobj.
2502 (Global_symbol_visitor_opd::operator()): Likewise.
2503
a39e4af6
AM
25042013-03-04 Alan Modra <amodra@gmail.com>
2505
2506 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
2507 * testsuite/Makefile.in: Regenerate.
2508
d5834edb
CC
25092013-03-01 Cary Coutant <ccoutant@google.com>
2510
2511 Add dwp support for v2 DWARF package file format.
2512 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2513 tu_length parameter. Adjust all callers.
2514 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2515 * dwp.cc: Include dwarf.h.
2516 (Section_bounds): New struct type.
2517 (Unit_set): New struct type.
2518 (Dwo_file::Dwo_file): Initialize new data member.
2519 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2520 Combine and rename to...
2521 (Dwo_file::read_unit_index): ...this.
2522 (Dwo_file::sized_read_compunit_index)
2523 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2524 (Dwo_file::sized_read_unit_index): ...this.
2525 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2526 parameters; add section_id parameter.
2527 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2528 (Dwo_file::add_unit_set): ...this.
2529 (Dwo_file::shndx_map_): Remove.
2530 (Dwo_file::sect_offsets_): New data member.
2531 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2532 (Dwp_output_file::add_section): Rename to...
2533 (Dwp_output_file::add_contribution): ...this.
2534 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2535 (Dwp_output_file::add_tu_set): Likewise.
2536 (Dwp_output_file::Contribution): New type.
2537 (Dwp_output_file::Section::contributions): New data member.
2538 (Dwp_output_file::Cu_or_tu_set): Remove.
2539 (Dwp_output_file::Section::Section): New ctor.
2540 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2541 (Dwp_output_file::Dwp_index::Section_table): New type.
2542 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2543 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2544 parameter.
2545 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2546 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2547 (Dwp_output_file::Dwp_index::section_table): New member function.
2548 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2549 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2550 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2551 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2552 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2553 (Dwp_output_file::Dwp_index::section_table_): New data member.
2554 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2555 (Dwp_output_file::add_output_section): New member function.
2556 (Dwp_output_file::write_new_section): New member function.
2557 (Dwp_output_file::write_contributions): New member function.
2558 (Dwp_output_file::section_id_map_): New data member.
2559 (class Dwo_id_info_reader): Remove.
2560 (class Unit_reader): New class.
2561 (get_dwarf_section_name): New function.
2562 (Dwo_file::read_executable): Adjust initializations of class data.
2563 (Dwo_file::read): Add support for v2 package file format.
2564 (Dwo_file::read_unit_index): Likewise.
2565 (Dwo_file::sized_read_unit_index): Likewise.
2566 (Dwo_file::copy_section): Likewise.
2567 (Dwo_file::add_unit_set): Likewise.
2568 (Dwp_output_file::add_output_section): Likewise.
2569 (Dwp_output_file::add_contribution): Likewise.
2570 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2571 for empty slot.
2572 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2573 file format.
2574 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2575 slot.
2576 (Dwp_output_file::initialize): Remove unused function.
2577 (Dwp_output_file::finalize): Add support for v2 package file format.
2578 (Dwp_output_file::write_index): Likewise.
2579 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2580 function prototype.
2581
a68a081d
CC
25822013-03-01 Cary Coutant <ccoutant@google.com>
2583
2584 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
2585 function into class definition in header file.
2586 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
2587 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
2588 New function.
2589 (Dwarf_info_reader::check_buffer): Move here from .cc file.
2590
9d5781f8
AM
25912013-02-28 Alan Modra <amodra@gmail.com>
2592
2593 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
2594 * target.cc (Target::do_plt_fde_location): New function.
2595 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
2596 accessor function, and constructor param.
2597 (struct Post_fde, Post_fdes): Declare.
2598 (Cie::write): Add post_fdes param.
2599 * ehframe.cc (Fde::write): Use plt_fde_location.
2600 (struct Post_fde): Define.
2601 (Cie::write): Stash FDEs added post merge mapping.
2602 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
2603 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
2604 (Eh_frame::do_sized_write): Arrange to write post map FDES after
2605 other FDEs.
2606 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
2607 (Target_powerpc::has_glink): New function.
2608 (Target_powerpc::do_relax): Add eh_frame info for stubs.
2609 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
2610 glink_eh_frame_fde_32, default_fde): New data.
2611 (Stub_table::eh_frame_added_): New var.
2612 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
2613 Make const.
2614 (Stub_table::add_eh_frame): New function.
2615 (Output_data_glink::add_eh_frame): New function.
2616 (Target_powerpc::make_glink_section): Call add_eh_frame.
2617
214383dd
ILT
26182013-02-15 Ian Lance Taylor <iant@google.com>
2619
2620 * options.h (DEFINE_uint64_alias): Define.
2621 (class General_options): Add -Ttext-segment as an alias for
2622 -Ttext.
2623
91c2b899
AM
26242013-02-15 Alan Modra <amodra@gmail.com>
2625
2626 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
2627 (Stub_table::do_write): ..here, two places.
2628 (Stub_table::plt_call_size): Use it here too.
2629
20e2a8aa
ILT
26302013-02-11 Ian Lance Taylor <iant@google.com>
2631
2632 * descriptors.cc (Descriptors::close_all): New function.
2633 * descriptors.h (class Descriptors): Declare close_all.
2634 (close_all_descriptors): New inline function.
2635 * plugin.cc: Include "descriptors.h".
2636 (Plugin_manager::cleanup): Call close_all_descriptors.
2637
8952bc69
AM
26382013-02-06 Alan Modra <amodra@gmail.com>
2639
2640 * README: Update coding style link.
2641
29bd8b6b
CC
26422013-01-28 Cary Coutant <ccoutant@google.com>
2643
a4034750
AM
2644 * dwp.cc (File_list): New typedef.
2645 (Dwo_name_info_reader): New class.
2646 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
2647 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
2648 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
2649 (Dwo_file::read_executable): New function.
2650 (Dwo_file::read): Move common setup code to ...
2651 (Dwo_file::make_object): ... here.
2652 (dwp_options): Add --exec/-e.
2653 (usage): Likewise.
2654 (main): Likewise.
29bd8b6b 2655
c6ac678d
ST
26562013-01-24 Sriraman Tallam <tmsriram@google.com>
2657
2658 * layout.cc (Layout::layout): Check for option text_reorder.
2659 (Layout::make_output_section): Ditto.
2660 * options.h (text_reorder): New option.
2661 * output.cc (Input_section_sort_compare): Remove special ordering
2662 of section names.
2663 (Output_section::
2664 Input_section_sort_section_name_special_ordering_compare::
2665 operator()): New function.
2666 (Output_section::sort_attached_input_sections): Use new sort function
2667 for .text.
2668 * output.h (Input_section_sort_section_name_special_ordering_compare):
2669 New struct.
2670 * testsuite/Makefile.am (text_section_grouping): Test option
2671 --no-text-reorder
2672 * testsuite/Makefile.in: Regenerate.
2673 * testsuite/text_section_grouping.sh: Check order of functions without
2674 default text reordering.
2675
50701cc1
MF
26762013-01-18 Mike Frysinger <vapier@gentoo.org>
2677
2678 * options.h (General_options): Change default to true for new_dtags.
2679
b1b00fcc
MF
26802013-01-18 Mike Frysinger <vapier@gentoo.org>
2681
2682 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
2683 when enable_new_dtags is false. Only add DT_RUNPATH when
2684 enable_new_dtags is true.
2685
ec5b8187
AM
26862013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
2687
2688 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
2689 used in declaration and definition consistent.
2690 (Target_powerpc::symval_for_branch): Ditto.
2691
a880d4c4
ST
26922013-01-16 Sriraman Tallam <tmsriram@google.com>
2693
2694 * testsuite/plugin_final_layout.cc: Fix comment.
2695
7c381248
ST
26962013-01-16 Sriraman Tallam <tmsriram@google.com>
2697
2698 * layout.cc (Layout::layout): Do not do default sorting for
2699 text sections when section ordering is specified.
2700 (make_output_section): Ditto.
2701 * testsuite/plugin_final_layout.cc: Name the function sections
2702 to catch reordering issues.
2703
e2458743
AM
27042013-01-15 Alan Modra <amodra@gmail.com>
2705
2706 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
2707 plt-thread-safe.
2708
431ed302
AM
27092013-01-15 Alan Modra <amodra@gmail.com>
2710
2711 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
2712 * testsuite/Makefile.in: Regenerate.
2713
0ec6429b
AM
27142013-01-14 Alan Modra <amodra@gmail.com>
2715
2716 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
2717 * testsuite/Makefile.in: Regenerate.
2718
0bf402d5
ILT
27192013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
2720
36af3926 2721 PR bfd/14430
0bf402d5
ILT
2722 Fix mingw gold build with plugins enabled
2723 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
2724 * configure.ac: Export DLOPEN_LIBS and add headers check.
2725 * plugin.cc: Handle non-dlfcn case.
2726 * Makefile.in: Regenerate.
2727 * config.in: Regenerate.
2728 * configure: Regenerate.
2729 * testsuite/Makefile.in: Regenerate.
2730
9e9143bc
ST
27312013-01-09 Sriraman Tallam <tmsriram@google.com>
2732
2733 * output.h (sort_attached_input_sections): Change to be public.
2734 * script-sections.cc
2735 (Output_section_definition::set_section_addresses): Sort
2736 attached input sections according to section order before linker
2737 script assigns section addresses.
2738 (Orphan_output_section::set_section_addresses): Sort
2739 attached input sections according to section order before linker
2740 script assigns section addresses.
2741 * Makefile.am (final_layout.sh): Use a simple linker script to
2742 check if section ordering still works.
2743 * Makefile.in: Regenerate.
2744
679af368
ILT
27452013-01-09 Ben Cheng <bccheng@google.com>
2746
2747 * arm.cc (Target_arm::attributes_accept_div): New function.
2748 (Target_arm::attributes_forbid_div): New function.
2749 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
2750 attribute using the same new functions as what bfd/elf32_arm.c
2751 does.
2752
3136a00e
CC
27532013-01-07 Cary Coutant <ccoutant@google.com>
2754
2755 PR gold/14993
2756 * output.cc (Output_section::add_input_section): For incremental
2757 updates, don't track input sections that are allocated from patch
2758 space.
2759
f2a6224b
L
27602013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2761 Ian Lance Taylor <iant@google.com>
2762
2763 PR gold/14897
2764 * configure.ac (--enable-ld): Removed.
2765 (install_as_default): Set to yes only for --enable-gold=default
2766 or --disable-ld.
2767 * configure: Regenerated.
2768
4f46f626
L
27692013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2770
2771 * options.h (General_options): Add -fuse-ld= for GCC linker
2772 option compatibility.
2773
26e4ef59
CC
27742013-01-04 Cary Coutant <ccoutant@google.com>
2775
2776 * configure.ac: Fix typo restoring CXXFLAGS.
2777 * configure: Regenerate.
2778
3d587466
CC
27792013-01-04 Cary Coutant <ccoutant@google.com>
2780
4f46f626
L
2781 * testsuite/Makefile.am (CXXLINK_S): New macro.
2782 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
2783 * testsuite/Makefile.in: Regenerate.
3d587466 2784
44db6695
L
27852013-01-02 H.J. Lu <hongjiu.lu@intel.com>
2786
2787 * version.cc (print_version): Update copyright year to 2013.
2788
edcac0c1
ILT
27892012-12-20 Ian Lance Taylor <iant@google.com>
2790
2791 * layout.cc (Layout::special_ordering_of_input_section): New
2792 function.
2793 (Layout::layout): If input section requires special ordering, must
2794 sort input sections.
2795 (Layout::make_output_section): May sort .text input sections.
2796 (Layout::is_section_name_prefix_grouped): Remove.
2797 * layout.h (class Layout): Declare
2798 special_ordering_of_input_section. Don't declare
2799 is_section_name_prefix_grouped.
2800 * output.cc (Output_section::add_input_section): Revert last
2801 change.
2802 (Output_section::Input_section_sort::match_file_name): Don't crash
2803 if called on output section data.
2804 (Output_section::Input_section_sort_compare): Sort based on
2805 special ordering.
2806 (Output_section::Input_section_sort_section_order_index_compare):
2807 Revert last patch.
2808 (Output_section::sort_attached_input_sections): Likewise.
2809
28f2a4ac
ST
28102012-12-18 Sriraman Tallam <tmsriram@google.com>
2811
edcac0c1 2812 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
2813 * layout.h (Layout::is_section_name_prefix_grouped): New function.
2814 * output.cc (Output_section::add_input_section): Check if section
2815 name contains special prefix. Keep input sections to sort such
2816 sections.
2817 (Output_section::Input_section_sort_section_order_index_compare
2818 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
2819 (Output_section::sort_attached_input_sections): Add condition to
2820 Input_section_entry constructor call.
28f2a4ac
ST
2821 * testsuite/Makefile.am (text_section_grouping): New test.
2822 * testsuite/Makefile.in: Regenerate.
2823 * testsuite/text_section_grouping.cc: New file.
2824 * testsuite/text_section_grouping.sh: New file.
2825
5bf135a7
NC
28262012-12-17 Nick Clifton <nickc@redhat.com>
2827
2828 * Makefile.am: Add copyright notice.
2829 * NEWS: Likewise.
2830 * README: Likewise.
2831 * configure.ac: Likewise.
2832 * ftruncate.c: Likewise.
2833 * Makefile.in: Regenerate.
2834
59965708
CC
28352012-12-14 Cary Coutant <ccoutant@google.com>
2836
a4034750
AM
2837 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
2838 --no-as-needed flag.
2839 (exception_separate_shared_12_test): Likewise.
2840 (incremental_copy_test): Likewise.
2841 * testsuite/Makefile.in: Regenerate.
59965708 2842
2a77e2ab
CC
28432012-12-14 Cary Coutant <ccoutant@google.com>
2844
2845 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
2846 (Dwp_output_file::Dwp_index::enter_set): Add assert.
2847
e3deeb9c
AM
28482012-12-12 Alan Modra <amodra@gmail.com>
2849
2850 * powerpc.cc (class Track_tls): New.
2851 (class Relocate, class Scan): Inherit Track_tls.
2852 (Target_powerpc::Scan::local, global): Track tls optimization
2853 and avoid creating plt entry for __tls_get_addr if all uses
2854 are optimized away.
2855 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
2856
d8f5a274
AM
28572012-12-12 Alan Modra <amodra@gmail.com>
2858
2859 * options.h (General_options): Add --toc-sort/--no-toc-sort.
2860 Replace no_toc_optimize with toc_optimize.
2861 * output.h (Output_section::input_sections): Provide non-const variant.
2862 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
2863 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
2864 accessors.
2865 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
2866 (class Sort_toc_sections): New.
2867 (Target_powerpc::do_finalize_sections): Sort toc sections.
2868 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
2869
4c8a1de1
RM
28702012-12-10 Roland McGrath <mcgrathr@google.com>
2871
2872 * testsuite/binary_unittest.cc (read_all): New function.
2873 (Sized_binary_test): Use it instead of ::read.
2874 * fileread.cc (do_read): Don't assume pread always reads the whole
2875 amount in a single call.
2876
edc27beb
AM
28772012-12-10 Alan Modra <amodra@gmail.com>
2878
2879 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
2880 Set EM_PPC64 or EM_PPC here.
2881 (Target_selector_powerpc::do_recognize): Delete.
2882
906b9150
AM
28832012-12-10 Alan Modra <amodra@gmail.com>
2884
2885 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
2886 stub_table_.
2887 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
2888
418c15ae
RM
28892012-12-07 Roland McGrath <mcgrathr@google.com>
2890
2891 * testsuite/binary_unittest.cc (Sized_binary_test):
2892 Use open_descriptor rather than ::open.
2893
decdd3bc
AM
28942012-12-07 Alan Modra <amodra@gmail.com>
2895
2896 * powerpc.cc (Stub_table::do_write): Delete redundant Address
2897 typedef and invalid_address constant.
2898 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
2899 instantiate constants.
2900
db399005
ILT
29012012-12-06 Roland McGrath <mcgrathr@google.com>
2902
2903 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
2904 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
2905 * aclocal.m4: Regenerate.
2906 * configure: Regenerate.
2907 * Makefile.in: Regenerate.
2908 * testsuite/Makefile.in: Regenerate.
2909
aba6bc71
AM
29102012-12-07 Alan Modra <amodra@gmail.com>
2911
2912 * options.h (General_options): Add no_toc_optimize.
2913 * powerpc.cc (ok_lo_toc_insn): New function.
2914 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
2915
9e69ed50
AM
29162012-12-06 Alan Modra <amodra@gmail.com>
2917
2918 * options.h (General_options): Add plt_align, plt_static_chain,
2919 plt_thread_safe. Update stub_group_size help text.
2920 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
2921 for new plt_thread_safe_ var.
2922 (use_plt_offset): Correct comments.
2923 (Target_powerpc::do_relax): Look for thread creation symbols to
2924 determine default plt_thread_safe value. Clear plt call stubs
2925 as well as branch stubs each iteration.
2926 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
2927 insn constants.
2928 (l, hi, ha, write_insn): Move earlier.
2929 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
2930 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
2931 plt stubs too.
2932 (Stub_table::update_size): Adjust.
2933 (Stub_table::prev_size, set_prev_size): Delete.
2934 (Stub_table::stub_align): Let --plt-align affect result.
2935 (Stub_table::plt_call_size): Calculate sizes for various stubs.
2936 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
2937 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
2938 (Stub_table::do_write): Support more stub variants.
2939
f43ba157
AM
29402012-12-04 Alan Modra <amodra@gmail.com>
2941
2942 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
2943 (Target_powerpc::do_define_standard_symbols): New function.
2944
34171bc5
AM
29452012-12-03 Alan Modra <amodra@gmail.com>
2946
2947 * output.h: Formatting, whitespace.
2948
dc9589e9 29492012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
2950
2951 * layout.h (Layout::get_executable_sections): Declare.
2952 * layout.cc (Layout::get_executable_sections): New function.
2953 * arm.cc (Target_arm::group_sections): Use it.
2954 (Arm_output_section::group_sections): Delete now redundant test.
2955 * output.cc (Output_reloc::Output_reloc): Add is_relative.
2956 param to handle relative relocs.
2957 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
2958 (Output_data_reloc::add_absolute): Adjust.
2959 (Output_data_reloc::add_relative): New function.
2960 (Output_data::reset_data_size): New function.
2961 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
2962 (Output_section::set_addralign): New function.
2963 (Output_section::checkpoint_set_addralign): New function.
2964 (Output_section::clear_section_offsets_need_adjustment): New function.
2965 (Output_section::input_sections): Make public.
2966 * powerpc.cc (class Output_data_brlt_powerpc): New.
2967 (class Stub_table, class Stub_control): New.
2968 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
2969 stub_table_, set_stub_table, stub_table): New vectors and accessor
2970 functions.
2971 (Target_powerpc::do_may_relax, do_relax, push_branch,
2972 new_stub_table, stub_tables, brlt_section, group_sections,
2973 add_branch_lookup_table, find_branch_lookup_table,
2974 write_branch_lookup_table, make_brlt_section): New functions.
2975 (Target_powerpc::struct Sort_sections, class Branch_info): New.
2976 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
2977 branch_info_): New vars.
2978 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
2979 make call stubs here.
2980 (Output_data_glink): Remove all call stub handling from this class.
2981 (Target_powerpc::Scan::local, global): Save interesting branch
2982 relocs and relocs for ifunc. Adjust calls to plt entry functions.
2983 (Target_powerpc::do_finalize_sections): Only make reg save/restore
2984 functions on final link.
2985 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
2986 Handle long branch destinations too.
2987 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
2988 do_plt_address_for_local): Adjust lookup of plt call stubs.
2989
627b30b7
AM
29902012-11-30 Alan Modra <amodra@gmail.com>
2991
2992 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
2993 relocs against protected symbols when building 32-bit shared libs.
2994
40b469d7
AM
29952012-11-30 Alan Modra <amodra@gmail.com>
2996
2997 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
2998 param. Call got_section() to make .got. Update all callers
2999 and their callers and so on.
3000
bb66a627
AM
30012012-11-30 Alan Modra <amodra@gmail.com>
3002
3003 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
3004 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
3005 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
3006 value if it already exists.
3007
d2cf1c6c
L
30082012-11-19 H.J. Lu <hongjiu.lu@intel.com>
3009
3010 PR gold/14858
3011 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
3012
edccdf7c
RM
30132012-11-14 Roland McGrath <mcgrathr@google.com>
3014
3015 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
3016 than bfc instruction for data sandboxing.
3017
6febeb74
AM
30182012-11-08 Alan Modra <amodra@gmail.com>
3019
3020 * po/POTFILES.in: Regenerate.
3021
0a6f1bf2
AM
30222012-11-05 Alan Modra <amodra@gmail.com>
3023
3024 * configure.ac: Apply 2012-09-10 change to config.in here.
3025 * configure: Regenerate.
3026
26a4e9cb
AM
30272012-11-05 Alan Modra <amodra@gmail.com>
3028
3029 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
3030 (struct Opd_ent): Use "Address" rather than "Offset".
3031 (Output_data_got_powerpc::got_base_offset): Return Valtype.
3032 (Target_powerpc::got_section): Make public.
3033 (Target_powerpc::scan_relocs): Move code setting symbols..
3034 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
3035 Create _SDA_BASE_ only when referenced.
3036
cc928013
RM
30372012-11-02 Roland McGrath <mcgrathr@google.com>
3038
3039 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
3040 from last change.
3041
50ed5eb1
RM
30422012-11-01 Roland McGrath <mcgrathr@google.com>
3043
62fe925a
RM
3044 * target.h (Sized_target::relocate_relocs): Use Elf_Off
3045 for offset_in_output_section parameter.
3046 (Sized_target::relocate_special_relocatable): Likewise.
3047 * arm.cc (Target_arm::relocate_relocs): Likewise.
3048 (Target_arm::relocate_special_relocatable): Likewise.
3049 * i386.cc (Target_i386::relocate_relocs): Likewise.
3050 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
3051 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
3052 * target-reloc.h (relocate_relocs): Likewise.
3053 * testsuite/testfile.cc (Target_test): Likewise.
3054 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
3055 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
3056
3057 * system.h: Move inclusion of <clocale> to after <libintl.h> in
3058 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
3059
3060 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
3061 parameter, which is unused in the [!F_SETFD] case.
3062
50ed5eb1
RM
3063 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
3064 SYMNDX to off_t before comparing it to this->data_size().
3065 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
3066 * incremental.cc (Output_section_incremental_inputs::do_write):
3067 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
3068
2cadc0bf
RM
3069 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
3070
3bfcb652
NC
30712012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
3072
3073 * gold.cc (Target_arm::do_adjust_elf_header): Add the
3074 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
3075 in EABI_VER5.
3076
c1a8d56e
CC
30772012-10-29 Cary Coutant <ccoutant@google.com>
3078
3079 * dwp.cc (usage): Add file and exit status parameters;
3080 add --help and --version options.
3081 (print_version): New function.
3082 (main): Add --help and --version options.
3083
b2490a7b
L
30842012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3085
3086 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
3087 final_layout_sequence.txt.
3088 * testsuite/Makefile.in: Regenerated.
3089
aa543512
L
30902012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3091
3092 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
3093 COMPILE generated by automake.
3094 (LINK1): Likewise.
3095 (CXXCOMPILE1): Likewise.
3096 (CXXLINK1): Likewise.
3097 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
3098 (LINK): Likewise.
3099 (CXXCOMPILE): Likewise.
3100 (CXXLINK): Likewise.
3101 * testsuite/Makefile.in: Regenerated.
3102
d361fafb
L
31032012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3104
3105 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
3106 on bad fwrite return.
3107
598c7410
L
31082012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3109
3110 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
3111 on val.
3112
35c813e2
CC
31132012-10-23 Cary Coutant <ccoutant@google.com>
3114
3115 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
3116 * testsuite/Makefile.in: Regenerate.
3117 * testsuite/dwp_test.h: New source file.
3118 * testsuite/dwp_test_1.cc: New source file.
3119 * testsuite/dwp_test_1.s: New source file.
3120 * testsuite/dwp_test_1.sh: New source file.
3121 * testsuite/dwp_test_1b.cc: New source file.
3122 * testsuite/dwp_test_1b.s: New source file.
3123 * testsuite/dwp_test_2.cc: New source file.
3124 * testsuite/dwp_test_2.s: New source file.
3125 * testsuite/dwp_test_2.sh: New source file.
3126 * testsuite/dwp_test_main.cc: New source file.
3127 * testsuite/dwp_test_main.s: New source file.
3128
77429909
CC
31292012-10-23 Cary Coutant <ccoutant@google.com>
3130
3131 * dwp.h: New header file.
3132 * dwp.cc: New source file.
3133 * gold.h: Move shared declarations to system.h.
3134 * system.h: New header file.
3135 * Makefile.am: Add dwp.
3136 * Makefile.in: Regenerate.
3137
ed5d6712
CC
31382012-10-23 Cary Coutant <ccoutant@google.com>
3139
3140 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
3141 Dwarf_info_reader::read_from_pointer.
3142 (Dwarf_pubnames_table::read_header): Likewise.
3143 (Dwarf_pubnames_table::next_name): Likewise.
3144 (Dwarf_die::read_attributes): Likewise.
3145 (Dwarf_die::skip_attributes): Likewise.
3146 (Dwarf_info_reader::read_from_pointer): New function template.
3147 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
3148 (Dwarf_pubnames_table): Likewise.
3149 (Dwarf_info_reader::read_from_pointer): New function template.
3150 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
3151 Dwarf_pubnames_table ctor.
3152
8787852d
CC
31532012-10-23 Cary Coutant <ccoutant@google.com>
3154
3155 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
3156 abbrev_shndx.
3157 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
3158 abbrev_shndx_.
3159 (Dwarf_info_reader::set_abbrev_shndx): New method.
3160 (Dwarf_info_reader::abbrev_shndx_): New data member.
3161
9fc236f3
CC
31622012-10-23 Cary Coutant <ccoutant@google.com>
3163
3164 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
3165 from object, not parameters.
3166 (Dwarf_info_reader::parse): Likewise.
3167 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
3168 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
3169 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
3170 methods.
3171
effe8365
CC
31722012-10-23 Cary Coutant <ccoutant@google.com>
3173
3174 * fileread.cc (Input_file::Input_file): New constructor.
3175 * fileread.h (class Input_file): Add new constructor.
3176
1698990d
AM
31772012-10-18 Alan Modra <amodra@gmail.com>
3178
3179 PR gold/14727
3180 * object.cc (Relobj::is_section_name_included): Also match
3181 .sdata personality section.
3182
168a4726
AM
31832012-10-18 Alan Modra <amodra@gmail.com>
3184
3185 * target-reloc.h (class Default_comdat_behavior): New, package up..
3186 (get_comdat_behaviour): ..this.
3187 (relocate_section): Add Relocate_comdat_behavior template arg,
3188 adjust code to suit.
3189 * arm.cc (Target_arm::relocate_section): Adjust to suit.
3190 (Target_arm::scan_reloc_section): Likewise.
3191 * i386.cc (Target_i386::relocate_section): Likewise.
3192 * sparc.cc (Target_sparc::relocate_section): Likewise.
3193 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
3194 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
3195 * powerpc.cc (class Relocate_comdat_behavior): New.
3196 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
3197 gold::relocate_section with new template arg.
3198
acc276d8
AM
31992012-10-18 Alan Modra <amodra@gmail.com>
3200
3201 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
3202 dynamic relocs for GOT_TPREL got entries, without symbol if
3203 resolving locally.
3204 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
3205 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
3206 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
3207
e10f9870
AM
32082012-10-17 Alan Modra <amodra@gmail.com>
3209
3210 PR gold/14726
3211 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
3212
ae034989
ST
32132012-10-16 Sriraman Tallam <tmsriram@google.com>
3214
3215 * layout.cc (Layout::include_section): Keep sections marked
3216 SHF_EXCLUDE when doing relocatable links.
3217
f3a0ed29
AM
32182012-10-16 Alan Modra <amodra@gmail.com>
3219
3220 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
3221 (Target_powerpc::do_finalize_sections): Call it.
3222 (Output_data_save_res): New class and supporting functions.
3223 (Target_powerpc::symval_for_branch): Only look up .opd entry for
3224 normal symbols defined in object files.
3225
c6de8ed4
AM
32262012-10-12 Alan Modra <amodra@gmail.com>
3227
3228 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
3229 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
3230 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
3231 section if scan_opd_relocs not yet called.
3232 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
3233
03e25981
AM
32342012-10-12 Alan Modra <amodra@gmail.com>
3235
3236 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3237 add_local_ifunc_entry): Revert last change.
3238 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
3239
c9824451
AM
32402012-10-05 Alan Modra <amodra@gmail.com>
3241
3242 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
3243 do_plt_address_for_global): New functions.
3244 (Output_data_got_powerpc::do_write): Don't segfault when linking
3245 statically.
3246 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3247 add_local_ifunc_entry): Return true on adding entry..
3248 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
3249 glink->add_entry call. Remove unused symtab param. Adjust calls.
3250 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
3251 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
3252 set up symbols here.
3253 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
3254 syms here. Do so even when no .iplt. Don't segfault when linking
3255 statically.
3256 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
3257 new variants without reloc param.
3258 (Glink_sym_ent::Glink_sym_ent): Likewise.
3259 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
3260 reloc when refs will resolve to plt call stub.
3261 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
3262 R_PPC_PLTREL24 to resolve locally.
3263 (Target_powerpc::Scan::global): Correct ifunc handling.
3264 (Target_powerpc::Relocate::relocate): Correct local sym glink
3265 lookup. Don't destroy "value" when we have a plt call stub,
3266 and when checking plt call validity.
3267 (Target_powerpc::do_dynsym_value): Simplify.
3268
19fec8c1
AM
32692012-10-05 Alan Modra <amodra@gmail.com>
3270
3271 * i386.cc (Output_data_plt_i386::address_for_global,
3272 address_for_local): Add plt offset to returned value. Adjust uses.
3273 * sparc.cc (Output_data_plt_sparc::address_for_global,
3274 address_for_local): Likewise.
3275 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
3276 address_for_local): Likewise.
3277 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
3278 address_for_local): Likewise.
3279 * target.h (Target::plt_address_for_global, plt_address_for_local):
3280 Update comment.
3281 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
3282 (Output_data_got::Got_entry::write): Nor here.
3283 * output.h: Comment fix.
3284
e867b647
WL
32852012-10-02 Jiong Wang <jiwang@tilera.com>
3286
3287 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
3288 global_offset_table_ value for larget got.
3289 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
3290
e5d5f5ed
AM
32912012-09-29 Alan Modra <amodra@gmail.com>
3292
3293 * powerpc.cc (Target_powerpc::iplt_): New output section.
3294 (Target_powerpc::iplt_section, make_iplt_section,
3295 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
3296 (Target_powerpc::make_plt_entry): Handle ifunc syms.
3297 Target_powerpc::plt_entry_count): Count iplt entries too.
3298 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
3299 reloc section in constructor. New params.
3300 (Target_powerpc::make_plt_section): Create reloc section here instead.
3301 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
3302 functions.
3303 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
3304 (Output_data_glink::add_entry, find_entry): New functions to
3305 deal with local syms.
3306 (Glink_sym_ent): Add support for local syms.
3307 (Output_data_glink::do_write): Handle ifunc plt entries.
3308 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3309 (Target_powerpc::Scan::local, global): Handle ifunc syms.
3310 (Target_powerpc::Relocate::relocate): Likewise.
3311 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
3312
ec4dbad3
AM
33132012-09-25 Alan Modra <amodra@gmail.com>
3314
3315 * object.h (Sized_relobj_file::adjust_local_symbol,
3316 do_adjust_local_symbol): New functions.
3317 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
3318 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
3319 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
3320 and irregular opd entry spacing.
3321 (Powerpc_relobj::do_read_relocs): Add opd size checks.
3322 (Global_symbol_visitor_opd): New functor.
3323 (Target_powerpc::do_finalize_sections): Omit global symbols defined
3324 on deleted opd entries.
3325
5c0b3823
WL
33262012-09-15 Jiong Wang <jiwang@tilera.com>
3327
3328 * tilegx.cc: New file.
3329 * Makefile.am (TARGETSOURCES): Add tilegx.cc
3330 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
3331 * configure.tgt: Add entries for tilegx*.
3332 * configure.ac: Likewise.
3333 * Makefile.in: Rebuild.
3334 * configure: Likewise.
3335 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
3336 tilegx.
3337
bfdfa4cd
AM
33382012-09-13 Alan Modra <amodra@gmail.com>
3339
3340 * target-reloc.h (scan_relocs): Call scan.local for relocs
3341 against symbols in discarded sections. Pass is_discarded
3342 param.
3343 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
3344 Add is_discarded param.
3345 * powerpc (Target_powerpc::Scan::local): Likewise. Use
3346 is_discarded to flag opd entry as discarded. Don't emit dyn
3347 relocs on such entries.
3348 (Target_powerpc::Scan::global): Similarly detect and handle
3349 such opd entries.
3350 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
3351 opd_ent_. Update all uses.
3352 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
3353 (Target_powerpc::relocate_section): Zero out discarded opd
3354 entry relocs.
3355
d77a0555
ILT
33562012-09-12 Ian Lance Taylor <iant@google.com>
3357
3358 PR gold/14570
3359 * output.cc: Rename Output_data_got template parameter from size
3360 to got_size for all functions. Compile all variants of
3361 Output_data_got.
3362 (Output_data_got::Got_entry::write): Correct use of size for
3363 symbol value. Use local_is_tls rather than casting to
3364 Sized_relobj_file.
3365 * object.h (class Object): Add local_is_tls and do_local_is_tls.
3366 (class Sized_relobj_file): Add do_local_is_tls.
3367 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
3368
815a1205
AM
33692012-09-11 Alan Modra <amodra@gmail.com>
3370
3371 PR gold/14566
3372 * layout.cc (Layout::set_segment_offsets): When using
3373 common-page-size alignment, ensure we are on a new max-page-size
3374 page.
3375 * output.cc (Output_segment::set_section_addresses): Use
3376 abi_pagesize, not common_pagesize for relro boundary.
3377 (Output_segment::set_offset): Likewise.
3378
bd73a62d
AM
33792012-09-11 Alan Modra <amodra@gmail.com>
3380
3381 * output.h (Output_data_got::add_global_tls, add_local_tls,
3382 add_local_tls_pair): New functions.
3383 (Output_data_got::add_local_pair_with_rel): Remove second
3384 reloc param. Expand comment.
3385 (Output_data_got::Got_entry): Rename use_plt_offset_ to
3386 use_plt_or_tls_offset_, similarly for constructor param.
3387 (Output_data_got::Got_entry::write): Add got_index param.
3388 * output.cc (Output_data_got::add_global_tls, add_local_tls,
3389 add_local_tls_pair): New functions.
3390 (Output_data_got::Got_entry::write): Handle tls symbols
3391 with use_plt_or_tls_offset_ set specially.
3392 (Output_data_got::add_local_pair_with_rel): Only one reloc.
3393 (Output_data_got::do_write): Replace iterator with index, pass
3394 index to entry write function.
3395 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
3396 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
3397 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
3398 call.
3399 * i386.cc (Target_i386::Scan::local): Likewise.
3400 * sparc.cc (Target_sparc::Scan::local): Likewise.
3401 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
3402 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
3403 do_tls_offset_for_global): New functions.
3404 (Target_powerpc::Scan::local): Correct TLS relocations and got
3405 entry values.
3406 (Target_powerpc::Scan::global): Don't emit unnecessary
3407 dynamic relocations on TLS GOT entries.
3408
00716ab1
AM
34092012-09-10 Matthias Klose <doko@ubuntu.com>
3410
3411 * config.in: Disable sanity check for kfreebsd.
3412
c891b3f9
SA
34132012-09-10 Sterling Augustine <saugustine@google.com>
3414
3415 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
3416 (Gdb_index::pubtypes_read): New parameter.
3417 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
3418 to calls.
3419 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
3420 pubtypes_object_.
3421
e81fea4d
AM
34222012-09-09 Alan Modra <amodra@gmail.com>
3423
3424 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
3425 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
3426 * gc.h (gc_process_relocs): Call target gc_add_reference.
3427 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
3428 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
3429 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
3430 unnecessary cast.
3431 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
3432 to cater for when we don't need code offset. Update use.
3433 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
3434 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
3435 set_opd_valid): New functions.
3436 (Target_powerpc::do_gc_add_reference): New function.
3437 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
3438 stashed refs.
3439 (Target_powerpc::do_gc_mark_symbol): New function.
3440
d2d60eef
CC
34412012-09-06 Cary Coutant <ccoutant@google.com>
3442
3443 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
3444 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
3445 (Dwarf_die::skip_attributes): Likewise.
3446 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
3447 * testsuite/gdb_index_test.cc (inline_func_1): New function.
3448 (main): Call it.
3449 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
3450
32ed4573
L
34512012-09-05 H.J. Lu <hongjiu.lu@intel.com>
3452
3453 * testsuite/script_test_3.t: Add .got.plt output section
3454 statement.
3455 * testsuite/script_test_4.t: Likewise.
3456
f4baf0d4
AM
34572012-09-05 Alan Modra <amodra@gmail.com>
3458
3459 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
3460 update all uses and lose "enum" when using type.
3461
864a1b56
AM
34622012-09-05 Alan Modra <amodra@gmail.com>
3463
3464 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
3465 * configure: Regenerate.
3466 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
3467 (plugin_final_layout.stdout): Likewise.
3468 (memory_test): Set page sizes to 0x1000.
3469 * testsuite/Makefile.in: Regenerate.
3470 * testsuite/discard_locals_test.sh: Add FIXME comment.
3471 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
3472 * testsuite/pr14265.t: Add .got output section statement.
3473 * testsuite/script_test_2.t: Likewise.
3474 * testsuite/script_test_3.t: Likewise.
3475 * testsuite/script_test_4.t: Likewise.
3476 * testsuite/script_test_5.t: Likewise.
3477 * testsuite/script_test_6.t: Likewise.
3478 * testsuite/script_test_7.t: Likewise.
3479 * testsuite/script_test_9.t: Likewise.
3480
3ea0a085
AM
34812012-09-05 Alan Modra <amodra@gmail.com>
3482
3483 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
3484 (Powerpc_relocate_functions::Status): New typedef.
3485 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3486 (Target_powerpc::Scan::local): Handle REL64.
3487 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
3488 for REL32 and REL64.
3489 (Target_powerpc::symval_for_branch): New function, extracted from..
3490 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
3491 checks. Report overflow errors.
3492
7404fe1b
AM
34932012-09-05 Alan Modra <amodra@gmail.com>
3494
3495 * object.h (Sized_relobj_file::emit_relocs): Delete.
3496 (Sized_relobj_file::emit_relocs_reltype): Delete.
3497 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
3498 relocate_relocs for --emit-relocs.
3499 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
3500 * output.h: Update comment.
3501 (Output_segment::first_section): New function.
3502 (Output_segment::first_section_load_address): Use first_section.
3503 * output.cc (Output_segment::first_section): New function extracted..
3504 (Output_segment::first_section_load_address): ..from here. Delete.
3505 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
3506 * target.h (Sized_target::relocate_for_relocatable): Likewise.
3507 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
3508 adjust call to target.h function.
3509 * i386.cc (Target_i386): Likewise.
3510 * sparc.cc (Target_sparc): Likewise.
3511 * x86_64.cc (Target_x86_64): Likewise.
3512 * powerpc.cc (Target_powerpc): Likewise.
3513 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
3514 first tls section has section symbol for optimised local dynamic
3515 output relocs.
3516 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
3517 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
3518 optimised tls code.
3519 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
3520 Rename to relocate_relocs. Update error message.
3521
957564c9
AS
35222012-09-04 Andreas Schwab <schwab@linux-m68k.org>
3523
3524 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
3525 --just-symbols.
3526
dd93cd0a
AM
35272012-08-31 Alan Modra <amodra@gmail.com>
3528
3529 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
3530 (Powerpc_relobj::toc_base_offset): New stub function.
3531 (Target_powerpc): Add tp_offset, dtp_offset. Rename
3532 got_mod_index_offset to tlsld_got_offset. Update all refs.
3533 (Target_powerpc::Relocate::enum skip_tls): New.
3534 (Target_powerpc::call_tls_get_addr_): New var.
3535 (Target_powerpc::is_branch_reloc): Move to file scope.
3536 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
3537 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
3538 New functions.
3539 (Target_powerpc::enum Got_type): Delete old values, add new ones.
3540 (powerpc_info): Correct common_pagesize for ppc64.
3541 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
3542 (Powerpc_relocate_functions): Add overflow check enums and functions.
3543 Add non-shift version of rela, rela_ua. Delete all rel public
3544 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
3545 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
3546 addr16_ha3, addr14 functions.
3547 (Output_data_got_powerpc::add_constant_pair): New function.
3548 (Output_data_got_powerpc::got_base_offset): Likewise.
3549 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
3550 (instruction constants): Sort, add some more.
3551 (Output_data_glink::do_write): Add and use Address typedef. Use
3552 object->toc_base_offset() stub for 64-bit.
3553 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
3554 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3555 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
3556 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
3557 Always treat .opd relocs as against locally defined symbol.
3558 Correct condition for RELATIVE relocs.
3559 (Target_powerpc::do_finalize_sections): Test for NULL sections.
3560 (Target_powerpc::Relocate::relocate): Use plt call stub as value
3561 for 32-bit syms with a plt entry. Correct ppc64 toc base
3562 calculations. Handle TLS relocs, and more. Add overflow
3563 checking and adjust for Powerpc_relocate_functions changes.
3564 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
3565 Reinstate --emit-relocs code with FIXME.
3566
a1373b60
AM
35672012-08-30 Alan Modra <amodra@gmail.com>
3568
3569 * layout.cc (Layout::set_segment_offsets): Set p_align to
3570 abi_pagesize, not common_pagesize.
3571 (Layout::relaxation_loop_body): Similarly use abi_pagesize
3572 to determine whether file header can go in segment.
3573
703d02da
AM
35742012-08-30 Alan Modra <amodra@gmail.com>
3575
3576 * output.h (Output_reloc::Output_reloc <output section>): Add
3577 is_relative param. Adjust calls.
3578 (Output_reloc::add_output_section_relative): New functions.
3579 * output.cc (Output_reloc::Output_reloc <output section>): Handle
3580 is_relative.
3581 (Output_reloc::symbol_value): Handle SECTION_CODE.
3582
16164a6b
ST
35832012-08-24 Sriraman Tallam <tmsriram@google.com>
3584
3585 * gold.cc (queue_middle_tasks): Call layout again when unique
3586 segments for sections is desired.
3587 * layout.cc (Layout::Layout): Initialize new members.
3588 (Layout::get_output_section_flags): New function.
3589 (Layout::choose_output_section): Call get_output_section_flags.
3590 (Layout::layout): Make output section for mapping to a unique segment.
3591 (Layout::insert_section_segment_map): New function.
3592 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 3593 output sections marked so.
16164a6b
ST
3594 (Layout::segment_precedes): Check for unique segments when sorting.
3595 * layout.h (Layout::Unique_segment_info): New struct.
3596 (Layout::Section_segment_map): New typedef.
3597 (Layout::insert_section_segment_map): New function.
3598 (Layout::get_output_section_flags): New function.
3599 (Layout::is_unique_segment_for_sections_specified): New function.
3600 (Layout::set_unique_segment_for_sections_specified): New function.
3601 (Layout::unique_segment_for_sections_specified_): New member.
3602 (Layout::section_segment_map_): New member.
3603 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
3604 Rename is_gc_pass_one to is_pass_one.
3605 Rename is_gc_pass_two to is_pass_two.
3606 Rename is_gc_or_icf to is_two_pass.
3607 Check for which pass based on whether symbols data is present.
3608 Make it two pass when unique segments for sections is desired.
3609 * output.cc (Output_section::Output_section): Initialize new
3610 members.
3611 * output.h (Output_section::is_unique_segment): New function.
3612 (Output_section::set_is_unique_segment): New function.
3613 (Output_section::is_unique_segment_): New member.
3614 (Output_section::extra_segment_flags): New function.
3615 (Output_section::set_extra_segment_flags): New function.
3616 (Output_section::extra_segment_flags_): New member.
3617 (Output_section::segment_alignment): New function.
3618 (Output_section::set_segment_alignment): New function.
3619 (Output_section::segment_alignment_): New member.
3620 (Output_segment::Output_segment): Initialize is_unique_segment_.
3621 (Output_segment::is_unique_segment): New function.
3622 (Output_segment::set_is_unique_segment): New function.
3623 (Output_segment::is_unique_segment_): New member.
3624 * plugin.cc (allow_unique_segment_for_sections): New function.
3625 (unique_segment_for_sections): New function.
3626 (Plugin::load): Add new functions to transfer vector.
3627 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
3628 * Makefile.in: Regenerate.
3629 * testsuite/plugin_final_layout.sh: Check if unique segment
3630 functionality works.
3631 * testsuite/plugin_section_order.c (onload): Check if new interfaces
3632 are available.
3633 (allow_unique_segment_for_sections): New global.
3634 (unique_segment_for_sections): New global.
3635 (claim_file_hook): Call allow_unique_segment_for_sections.
3636 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 3637
1e2bee4f
CC
36382012-08-22 Cary Coutant <ccoutant@google.com>
3639
3640 * layout.cc (Layout::include_section): Don't assert on GROUP
3641 sections with --emit-relocs.
3642
1d5dfe78
CC
36432012-08-21 Cary Coutant <ccoutant@google.com>
3644
3645 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
3646 if --export-dynamic-symbol names an undef symbol.
3647
c9269dff
AM
36482012-08-18 Alan Modra <amodra@gmail.com>
3649
3650 * powerpc.cc: Formatting and white space.
3651 (Powerpc_relobj): Rename got2_section_ to special_.
3652 Add opd_ent_shndx_ and opd_ent_off_ vectors.
3653 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
3654 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
3655 (Target_powerpc): Add Address typedef and invalid_address. Use
3656 throughout.
3657 (Target_powerpc::is_branch_reloc): New function.
3658 (Powerpc_relocate_functions): Add Address typedef, use throughout.
3659 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
3660 for dst_mask, value and addend.
3661 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
3662 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
3663 (Output_data_glink::do_write): Correct toc base. Don't try to use
3664 uint16_t for 24-bit offset. Use get_output_section_offset and
3665 check return.
3666 (Target_powerpc::Scan::local): Handle more relocs.
3667 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
3668 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
3669 Plug in toc restoring insn after plt calls. Translate branches
3670 to function descriptor symbols to corresponding entry point.
3671 (Target_powerpc::relocate_for_relocatable): Check return from
3672 get_output_section_offset.
3673 * symtab.h: Comment typo.
3674
b1759dce
ILT
36752012-08-14 Ian Lance Taylor <iant@google.com>
3676
3677 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
3678 unsupported_relocal_local to call unsupported_reloc_global.
3679
b9b2ae8b
NC
36802012-08-14 Nick Clifton <nickc@redhat.com>
3681
3682 PR ld/14265
3683 * script-sections.cc (Sections_element::output_section_name): Add
3684 keep return parameter.
3685 (Output_section_element::match_name): Add keep return parameter.
3686 Return the value of the keep_ member.
3687 * script-sections.h (class Output_section): Update
3688 output_section_name prototype.
3689 * layout.cc (Layout::keep_input_section): New public member
3690 function.
3691 (Layout::choose_output_section): Pass keep parameter to
3692 output_section_name.
3693 * layout.h (class Layout): Add keep_input_section.
3694 * object.cc (Sized_relobj_file::do_layout): Check for kept input
3695 sections.
3696 * testsuite/Makefile.am: Add a test.
3697 * testsuite/Makefile.in: Regenerate.
3698 * testsuite/pr14265.c: Source file for the test.
3699 * testsuite/pr14265.t: Linker script for the test.
3700 * testsuite/pr14265.sh: Shell script for the test.
3701
921b5322
AM
37022012-08-14 Alan Modra <amodra@gmail.com>
3703
3704 * target.h (Target::output_section_name): New function.
3705 (Target::do_output_section_name): New function.
3706 * layout.cc (Layout::choose_output_section): Call the above.
3707 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
3708
6ce78956
AM
37092012-08-14 Alan Modra <amodra@gmail.com>
3710
3711 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
3712 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
3713 for replace_constant call.
3714 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
3715 (Output_data_glink::do_print_to_mapfile): New function.
3716 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
3717 (Target_powerpc::Relocate::relocate): Likewise.
3718
d1a8cabd
AM
37192012-08-14 Alan Modra <amodra@gmail.com>
3720
3721 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
3722 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
3723 (Output_data_glink::add_entry,find_entry): Remove shndx param.
3724 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
3725 all references to shndx_. Handle special case for R_PPC_PLTREL24
3726 here.
3727 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
3728 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
3729 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
3730 here.
3731 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
3732 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
3733
d83ce4e3
AM
37342012-08-12 Alan Modra <amodra@gmail.com>
3735
3736 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
3737 (glink insn constants): Use uint32_t.
3738 (Output_data_glink::add_entry): Use insert, not [] operator.
3739
cf43a2fe
AM
37402012-08-11 Alan Modra <amodra@gmail.com>
3741
3742 * object.h (Sized_relobj_file::find_shdr): New function.
3743 (Sized_relobj_file::find_special_sections): New function.
3744 * object.cc (Sized_relobj_file::find_shdr): New function.
3745 (Sized_relobj_file::find_eh_frame): Use find_shdr.
3746 (Sized_relobj_file::find_special_sections): New function, split out..
3747 (Sized_relobj_file::do_read_symbols): ..from here.
3748 * output.h (Output_data_got::replace_constant): New function.
3749 (Output_data_got::num_entries): New function.
3750 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
3751 (Output_data_got::got_offset): Protected rather than private.
3752 (Output_data_got::replace_got_entry): New function.
3753 * output.cc (Output_data_got::replace_got_entry): New function.
3754 * powerpc.cc (class Powerpc_relobj): New.
3755 (class Powerpc_relocate_functions): Delete all psymval variants or
3756 convert to value,addend type. Delete pcrela, pcrela_unaligned.
3757 Implement _ha functions using corresponding _hi function.
3758 (Powerpc_relobj::find_special_sections): New function.
3759 (Target_powerpc::do_make_elf_object): New function.
3760 (class Output_data_got_powerpc): New.
3761 (class Output_data_glink): New.
3762 (class Powerpc_scan_relocatable_reloc): New.
3763 Many more changes througout file.
3764
3c892704
NC
37652012-08-09 Nick Clifton <nickc@redhat.com>
3766
3767 * po/vi.po: Updated Vietnamese translation.
3768
82435b3b
ILT
37692012-08-07 Ian Lance Taylor <iant@google.com>
3770
3771 * layout.cc (Layout::add_target_dynamic_tags): If
3772 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
3773 plt_rel.
3774
a6dc81d2
NC
37752012-07-30 Nick Clifton <nickc@redhat.com>
3776
3777 * po/gold.pot: Updated template.
3778 * po/es.po: Updated Spanish translation.
3779
f1415016
CC
37802012-07-18 Cary Coutant <ccoutant@google.com>
3781
3782 PR gold/14344
3783 * configure.ac: Add check for -gpubnames support.
3784 * configure: Regenerate.
3785 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
3786 support; force -gno-pubnames.
3787 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
3788 support.
3789 (gdb_index_test_4): New test.
3790 * testsuite/Makefile.in: Regenerate.
3791 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
3792 * testsuite/gdb_index_test_2.sh: Likewise.
3793 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
3794 * testsuite/gdb_index_test_4.sh: New script.
3795 * testsuite/gdb_index_test_comm.sh: New script with common code;
3796 don't look for space after colon.
3797
b7fd7c37
ST
37982012-07-16 Sriraman Tallam <tmsriram@google.com>
3799
3800 * gold.cc (queue_middle_tasks): Update function order only after
3801 deferred objects due to plugins are processed.
3802
1f3212db
ILT
38032012-07-11 Ian Lance Taylor <iant@google.com>
3804
3805 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
3806 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
3807 (Target_arm::scan_reloc_for_stub): Likewise.
3808 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
3809 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
3810 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
3811 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
3812 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
3813
81c82a68
ILT
38142012-07-10 Dodji Seketeli <dodji@redhat.com>
3815 Ian Lance Taylor <iant@google.com>
3816
3817 PR gold/14309
3818 * configure.ac: Test whether std::tr1::hash<off_t> works.
3819 * gold.h: Add a specialization for std::tr1::hash<off_t> if
3820 needed.
3821 * output.h (class Output_fill): Add virtual destructor.
3822 * configure, config.in: Rebuild.
3823
eabc84f4
RM
38242012-06-22 Roland McGrath <mcgrathr@google.com>
3825
3826 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
3827
370e30b6
RÁE
38282012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
3829
3830 * plugin.cc (Plugin::load): Handle position independent executables.
3831
fb1b895d
CC
38322012-06-06 Cary Coutant <ccoutant@google.com>
3833
3834 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
3835 add .debug_macro.
3836 (lines_only_debug_sections): Likewise.
3837 (gdb_fast_lookup_sections): New static array.
3838 (is_gdb_debug_section): Rename formal parameter.
3839 (is_lines_only_debug_section): Likewise.
3840 (is_gdb_fast_lookup_section): New function.
3841 (Layout::include_section): Check for ".zdebug_" prefix; pass
3842 section name suffix to is_gdb_debug_section, et al.; check for
3843 fast-lookup sections when building .gdb_index.
3844 * options.h (--strip-debug-gdb): Update GDB version number.
3845
7c0640fa
CC
38462012-06-06 Cary Coutant <ccoutant@google.com>
3847
3848 * configure.ac: Add check for fallocate.
3849 * configure: Regenerate.
3850 * config.in: Regenerate.
3851
3852 * options.h (class General_options): Add --mmap-output-file and
3853 --posix-fallocate options.
3854 * output.cc: (posix_fallocate): Remove; replace with...
3855 (gold_fallocate): New function.
3856 (Output_file::map_no_anonymous): Call gold_fallocate.
3857 (Output_file::map): Check --mmap-output-file option.
3858
2a49eb69
DK
38592012-06-05 Jing Yu <jingyu@google.com>
3860
3861 * gold.h (textdomain): Add do {} to empty while(0).
3862 (bindtextdomain): Likewise.
3863
fad072ac
CC
38642012-06-04 Cary Coutant <ccoutant@google.com>
3865
3866 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
3867 has_dynsym_index.
3868
8cc69fb6
ST
38692012-05-25 Sriraman Tallam <tmsriram@google.com>
3870
3871 * symtab.cc (Symbol_table::define_special_symbol):
3872 Initialize *poldsym to prevent uninitialized variable errors.
3873
1be75daa
CC
38742012-05-23 Cary Coutant <ccoutant@google.com>
3875
3876 * layout.cc (Layout::section_name_mapping): Add rules to handle
3877 exact match on .data.rel.ro.local or .data.rel.ro.
3878 (Layout::output_section_name): Check for exact matches.
3879
9b689de0
CC
38802012-05-23 Cary Coutant <ccoutant@google.com>
3881
3882 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
3883 more carefully.
3884
b24fdbf5
CC
38852012-05-22 Cary Coutant <ccoutant@google.com>
3886
3887 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
3888 object before exporting symbol.
3889
e550e1a2
L
38902012-05-21 H.J. Lu <hongjiu.lu@intel.com>
3891
3892 * testsuite/tls_test.cc: Include "config.h" first.
3893 * testsuite/tls_test_c.c: Likewise.
3894
df7b86aa
NC
38952012-05-17 Daniel Richard G. <skunk@iskunk.org>
3896 Nick Clifton <nickc@redhat.com>
3897
3898 PR 14072
3899 * configure.in: Add check that sysdep.h has been included before
3900 any system header files.
3901 * configure: Regenerate.
3902 * config.in: Regenerate.
3903
1007b503
CC
39042012-05-14 Cary Coutant <ccoutant@google.com>
3905
3906 * layout.cc (Layout::make_output_section): Mark .tdata section
3907 as RELRO.
3908 * testsuite/relro_test.cc: Add a TLS variable.
3909
fd885f3a
L
39102012-05-10 H.J. Lu <hongjiu.lu@intel.com>
3911
3912 PR gold/14091
3913 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
3914 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
3915 R_X86_64_64.
3916
80f5885c
CC
39172012-05-08 Cary Coutant <ccoutant@google.com>
3918
3919 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
3920 (lines_only_debug_sections): Likewise.
3921
2e702c99
RM
39222012-05-02 Roland McGrath <mcgrathr@google.com>
3923
3924 * nacl.cc: New file.
3925 * nacl.h: New file.
3926 * Makefile.am (CCFILES, HFILES): Add them.
3927 * Makefile.in: Regenerate.
3928 * i386.cc (Output_data_plt_i386_nacl): New class.
3929 (Output_data_plt_i386_nacl_exec): New class.
3930 (Output_data_plt_i386_nacl_dyn): New class.
3931 (Target_i386_nacl): New class.
3932 (Target_selector_i386_nacl): New class.
3933 (target_selector_i386): Use it instead of Target_selector_i386.
3934 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
3935 (Target_x86_64_nacl): New class.
3936 (Target_selector_x86_64_nacl): New class.
3937 (target_selector_x86_64, target_selector_x32): Use it instead of
3938 Target_selector_x86_64.
3939 * arm.cc (Output_data_plt_arm_nacl): New class.
3940 (Target_arm_nacl): New class.
3941 (Target_selector_arm_nacl): New class.
3942 (target_selector_arm, target_selector_armbe): Use it instead of
3943 Target_selector_arm.
3944
3945 * target-select.cc (select_target): Take new Input_file* and off_t
3946 arguments, pass them on to recognize method of selector.
3947 * object.cc (make_elf_sized_object): Update caller.
3948 * parameters.cc (parameters_force_valid_target): Likewise.
3949 * incremental.cc (make_sized_incremental_binary): Likewise.
3950 * target-select.h: Update decl.
3951 (Target_selector::recognize): Take new Input_file* argument,
3952 pass it on to do_recognize.
3953 (Target_selector::do_recognize): Take new Input_file* argument.
3954 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
3955 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
3956 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
3957 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
3958
3959 * target.h (Target::Target_info): New members isolate_execinstr
3960 and rosegment_gap.
3961 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
3962 * arm.cc (Target_arm::arm_info): Update initializer.
3963 * i386.cc (Target_i386::i386_info): Likewise.
3964 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
3965 * sparc.cc (Target_sparc::sparc_info): Likewise.
3966 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
3967 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3968 * layout.cc (Layout::attach_allocated_section_to_segment):
3969 Take new const Target* argument. If target->isolate_execinstr(), act
3970 like --rosegment.
3971 (Layout::find_first_load_seg): Take new const Target* argument;
3972 if target->isolate_execinstr(), reject PF_X segments.
3973 (Layout::relaxation_loop_body): Update caller.
3974 (Layout::set_segment_offsets): If target->isolate_execinstr(),
3975 reset file offset to zero when we hit LOAD_SEG, and then do a second
3976 loop over the segments before LOAD_SEG to reassign offsets after
3977 addresses have been determined. Handle target->rosegment_gap().
3978 (Layout::attach_section_to_segment): Take new const Target* argument;
3979 pass it to attach_allocated_section_to_segment.
3980 (Layout::make_output_section): Update caller.
3981 (Layout::attach_sections_to_segments): Take new const Target* argument;
3982 pass it to attach_section_to_segment.
3983 * gold.cc (queue_middle_tasks): Update caller.
3984 * layout.h (Layout): Update method decls with new arguments.
3985
3986 * arm.cc (Target_arm::Target_arm): Take optional argument for the
3987 Target_info pointer to use.
3988 (Target_arm::do_make_data_plt): New virtual method.
3989 (Target_arm::make_data_plt): New method that calls it.
3990 (Target_arm::make_plt_entry): Use it.
3991 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
3992 for the section alignment.
3993 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
3994 method.
3995 (Output_data_plt_arm::first_plt_entry_offset): Call it.
3996 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
3997 method.
3998 (Output_data_plt_arm::get_plt_entry_size): Call it.
3999 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
4000 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
4001 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
4002 method.
4003 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
4004 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
4005 method instead of sizeof(plt_entry).
4006 (Output_data_plt_arm::add_entry): Likewise.
4007 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
4008 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
4009 than static method.
4010 (Target_arm::plt_entry_size): Likewise.
4011 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
4012 Move to ...
4013 (Output_data_plt_arm_standard): ... here, new class.
4014 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
4015 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
4016 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
4017
4018 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4019 Take additional argument for the PLT entry size.
4020 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
4021 Use get_plt_entry_size method rather than plt_entry_size variable.
4022 (Output_data_plt_x86_64::reserve_slot): Likewise.
4023 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
4024 (Output_data_plt_x86_64::add_entry): Likewise.
4025 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
4026 (Output_data_plt_x86_64::address_for_global): Likewise.
4027 (Output_data_plt_x86_64::address_for_local): Likewise.
4028 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4029 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
4030 Make method non-static.
4031 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
4032 method.
4033 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
4034 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
4035 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
4036 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
4037 virtual method.
4038 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
4039 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
4040 virtual method.
4041 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
4042 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
4043 virtual method.
4044 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
4045 (Output_data_plt_x86_64::plt_entry_size)
4046 (Output_data_plt_x86_64::first_plt_entry)
4047 (Output_data_plt_x86_64::plt_entry)
4048 (Output_data_plt_x86_64::tlsdesc_plt_entry)
4049 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
4050 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
4051 (Output_data_plt_x86_64_standard): ... here, new class.
4052 (Target_x86_64::Target_x86_64): Take optional argument for the
4053 Target_info pointer to use.
4054 (Target_x86_64::do_make_data_plt): New virtual method.
4055 (Target_x86_64::make_data_plt): New method to call it.
4056 (Target_x86_64::init_got_plt_for_update): Use that.
4057 Call this->plt_->add_eh_frame method here.
4058 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
4059 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
4060 rather than static method.
4061 (Target_x86_64::plt_entry_size): Likewise.
4062 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
4063 rather than plt_entry_size variable. Move guts of PLT filling to...
4064 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
4065 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
4066 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
4067
4068 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
4069 additional argument for the section alignment.
4070 Don't do add_eh_frame_for_plt here.
4071 (Output_data_plt_i386::first_plt_entry_offset): Make the method
4072 non-static. Use get_plt_entry_size method rather than plt_entry_size
4073 variable.
4074 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
4075 method.
4076 (Output_data_plt_i386::get_plt_entry_size): Call it.
4077 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
4078 (Output_data_plt_i386::add_eh_frame): New method to call it.
4079 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
4080 method.
4081 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
4082 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
4083 method.
4084 (Output_data_plt_i386::fill_plt_entry): New method to call it.
4085 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
4086 method instead of plt_entry_size.
4087 (Output_data_plt_i386::plt_entry_size)
4088 (Output_data_plt_i386::plt_eh_frame_fde_size)
4089 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
4090 (Output_data_plt_i386_standard): ... here, new class.
4091 (Output_data_plt_i386_exec): New class.
4092 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
4093 (Output_data_plt_i386_exec::first_plt_entry): ... here.
4094 (Output_data_plt_i386::exec_plt_entry): Move to ...
4095 (Output_data_plt_i386_exec::plt_entry): ... here.
4096 (Output_data_plt_i386_dyn): New class.
4097 (Output_data_plt_i386::first_plt_entry): Move to ...
4098 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
4099 (Output_data_plt_i386::dyn_plt_entry): Move to ...
4100 (Output_data_plt_i386_dyn::plt_entry): ... here.
4101 (Target_i386::Target_i386): Take optional argument for the Target_info
4102 pointer to use.
4103 (Target_i386::do_make_data_plt): New virtual method.
4104 (Target_i386::make_data_plt): New method to call it.
4105 (Target_i386::make_plt_section): Use that.
4106 Call this->plt_->add_eh_frame method here.
4107 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
4108 rather than plt_entry_size variable.
4109 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
4110 (Output_data_plt_i386::address_for_local): Likewise.
4111 (Output_data_plt_i386::do_write): Likewise.
4112 Move guts of PLT filling to...
4113 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
4114 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
4115 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
4116 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
4117
b9b9f2ee
CC
41182012-05-01 Cary Coutant <ccoutant@google.com>
4119
4120 * dwarf_reader.cc (Dwarf_die::read_attributes)
4121 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
4122 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
4123 * reduced_debug_output.cc
4124 (Output_reduced_debug_info_section::get_die_end): Remove
4125 DW_FORM_GNU_ref_index. Add default case.
4126
57923f48
MW
41272012-04-26 Mark Wielaard <mjw@redhat.com>
4128
4129 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
4130 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
4131 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
4132 DW_AT_high_pc as offset from DW_AT_low_pc.
4133
4134 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
4135 * testsuite/Makefile.in: Regenerate.
4136 * testsuite/gdb_index_test_3.c: New test source file.
4137 * testsuite/gdb_index_test_3.sh: New test source file.
4138
2c54b4f4
ILT
41392012-04-25 Ian Lance Taylor <iant@google.com>
4140
4141 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
4142 pointer.
4143 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
4144 as a class, not a struct.
4145 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
4146 (Target_arm::apply_cortex_a8_workaround): Likewise.
4147 * gc.h: Declare Reloc_types as a struct, not a class.
4148 * object.h: Declare Symbols_data as a struct.
4149 * reloc.h: Declare Read_relocs_data as a struct.
4150 * target.h: Declare Relocate_info as a struct.
4151
a5a5f7a3
DM
41522012-04-24 David S. Miller <davem@davemloft.net>
4153
4154 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
4155 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
4156 and R_SPARC_WPLT30.
4157
f038d496
CC
41582012-04-24 Cary Coutant <ccoutant@google.com>
4159
4160 * incremental-dump.cc (find_input_containing_global): Replace
4161 magic number with symbolic constant.
4162 (dump_incremental_inputs): Update version number.
4163 * incremental.cc (Output_section_incremental_inputs): Update version
4164 number; import symbolic constants from Incremental_inputs_reader.
4165 (Incremental_inputs::create_data_sections): Align relocations
4166 section correctly for 64-bit targets.
4167 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
4168 constants; add padding.
4169 (Output_section_incremental_inputs::write_header): Add assert for
4170 header_size.
4171 (Output_section_incremental_inputs::write_input_files): Add assert
4172 for input_entry_size.
4173 (Output_section_incremental_inputs::write_info_blocks): Add padding;
4174 add assert for object_info_size, input_section_entry_size,
4175 global_sym_entry_size.
4176 * incremental.h (Incremental_inputs_reader): Add symbolic constants
4177 for data structure sizes; use them.
4178 (Incremental_input_entry_reader): Import symbolic constants from
4179 Incremental_inputs_reader; use them.
4180
a4d85145
DM
41812012-04-23 David S. Miller <davem@davemloft.net>
4182
4183 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
4184 and elf_flags_set_.
4185 (Target_sparc::Target_sparc): Initialize new fields.
4186 (Target_sparc::do_make_elf_object): New function.
4187 (Target_sparc::do_adjust_elf_header): New function.
4188
1d509098
CC
41892012-04-23 Cary Coutant <ccoutant@google.com>
4190
4191 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
4192 CU range table of gdb index.
4193
7ebeff7f
DM
41942012-04-20 David S. Miller <davem@davemloft.net>
4195
4196 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
4197 instead of false.
4198
13cf9988
DM
41992012-04-16 David S. Miller <davem@davemloft.net>
4200
2a1079e8
DM
4201 * sparc.cc (Target_sparc::got_address): New function.
4202 (Sparc_relocate_functions::gdop_hix22): New function.
4203 (Sparc_relocate_functions::gdop_lox10): New function.
4204 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
4205 relocs.
4206 (Target_sparc::Scan::local): Likewise if the global symbol is not
4207 preemptible and is not IFUNC.
4208 (Target_sparc::Relocate::relocate): Perform GOTDATA code
4209 transformations for local and non-preemptible non-IFUNC global
4210 symbols.
4211
0bc964fc
DM
4212 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
4213 writing out 64-bit part of ranges.
4214
661d7a80
DM
4215 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
4216 -fpic and -fpie respectively.
4217 * Makefile.in: Regenerate.
4218
8c2bf391
DM
4219 * sparc.cc (class Target_sparc): Add rela_ifunc_.
4220 (Target_sparc::Target_sparc): Initialize new field.
4221 (Target_sparc::do_plt_section_for_global): New function.
4222 (Target_sparc::do_plt_section_for_local): New function.
4223 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
4224 (Target_sparc::make_plt_section): New function, broken out of
4225 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
4226 (Target_sparc::make_plt_entry): Call make_plt_section.
4227 (Target_sparc::make_local_ifunc_plt_entry): New function.
4228 (Target_sparc::rela_ifunc_section): New function.
4229 (Target_sparc::plt_section): Remove const.
4230 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
4231 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
4232 and ifunc_count_ fields.
4233 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
4234 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
4235 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
4236 (Output_data_plt_sparc::rela_ifunc): New function.
4237 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
4238 (Output_data_plt_sparc::has_ifunc_section): New function.
4239 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
4240 (Output_data_plt_sparc::address_for_global): New function.
4241 (Output_data_plt_sparc::address_for_local): New function.
4242 (Output_data_plt_sparc::plt_index_to_offset): New function.
4243 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
4244 and entry_count.
4245 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
4246 entry_count.
4247 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
4248 R_SPARC_JMP_IREL to switch.
4249 (Target_sparc::Scan::check_non_pic): Likewise.
4250 (Target_sparc::Scan::local): Handle IFUNC symbols.
4251 (Target_sparc::Scan::local): Likewise.
4252 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
4253 and plt_address_for_local.
4254 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
4255 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
4256
13cf9988
DM
4257 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
4258 (class Output_data_reloc): Adjust calls to Output_reloc_type.
4259 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
4260 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
4261 global relocs too.
4262 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
4263 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
4264 calls.
4265 * sparc.cc (Target_sparc::Scan::global): Likewise.
4266 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4267
31821be0
CC
42682012-04-16 Cary Coutant <ccoutant@google.com>
4269
4270 * archive.cc (Library_base::should_include_member): Check for
4271 --export-dynamic-symbol.
4272 * options.h (class General_options): Add --export-dynamic-symbol.
4273 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
4274 --export-dynamic-symbol.
4275 (Symbol_table::gc_mark_undef_symbols): Likewise.
4276 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
4277
2615994e
DM
42782012-04-12 David S. Miller <davem@davemloft.net>
4279
4280 * sparc.cc (Reloc::wdisp10): New relocation method.
4281 (Reloc::h34): Likewise.
4282 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
4283 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
4284 R_SPARC_WDISP10.
4285 (Target_sparc::Scan::local): Likewise.
4286 (Target_sparc::Scan::global): Likewise.
4287 (Target_sparc::Relocate::relocate): Likewise.
4288
6782735d
CC
42892012-04-09 Cary Coutant <ccoutant@google.com>
4290
4291 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
4292 low_pc == 0.
4293
8c7a0b00
ILT
42942012-04-06 Ian Lance Taylor <iant@google.com>
4295
4296 * timer.cc: #include <unistd.h>.
4297
58797674
RM
42982012-04-06 Roland McGrath <mcgrathr@google.com>
4299
4300 * configure.in (AC_CHECK_HEADERS): Add locale.h.
4301 * config.in: Regenerate.
4302 * configure: Regenerate.
4303
44350750
NC
43042012-04-05 Nick Clifton <nickc@redhat.com>
4305
4306 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
4307 (AM_LC_MESSAGES): Add.
4308 * aclocal.m4: Regenerate.
4309 * config.in: Regenerate.
4310 * configure: Regenerate.
4311
c1027032
CC
43122012-03-21 Cary Coutant <ccoutant@google.com>
4313
4314 * Makefile.am: Add gdb-index.cc, gdb-index.h.
4315 * Makefile.in: Regenerate.
4316 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
4317 (Sized_elf_reloc_mapper::symbol_section): New function.
4318 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
4319 (make_elf_reloc_mapper): New function.
4320 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
4321 (Dwarf_abbrev_table::do_read_abbrevs): New function.
4322 (Dwarf_abbrev_table::do_get_abbrev): New function.
4323 (Dwarf_ranges_table::read_ranges_table): New function.
4324 (Dwarf_ranges_table::read_range_list): New function.
4325 (Dwarf_pubnames_table::read_section): New function.
4326 (Dwarf_pubnames_table::read_header): New function.
4327 (Dwarf_pubnames_table::next_name): New function.
4328 (Dwarf_die::Dwarf_die): New function.
4329 (Dwarf_die::read_attributes): New function.
4330 (Dwarf_die::skip_attributes): New function.
4331 (Dwarf_die::set_name): New function.
4332 (Dwarf_die::set_linkage_name): New function.
4333 (Dwarf_die::attribute): New function.
4334 (Dwarf_die::string_attribute): New function.
4335 (Dwarf_die::int_attribute): New function.
4336 (Dwarf_die::uint_attribute): New function.
4337 (Dwarf_die::ref_attribute): New function.
4338 (Dwarf_die::child_offset): New function.
4339 (Dwarf_die::sibling_offset): New function.
4340 (Dwarf_info_reader::check_buffer): New function.
4341 (Dwarf_info_reader::parse): New function.
4342 (Dwarf_info_reader::do_parse): New function.
4343 (Dwarf_info_reader::do_read_string_table): New function.
4344 (Dwarf_info_reader::lookup_reloc): New function.
4345 (Dwarf_info_reader::get_string): New function.
4346 (Dwarf_info_reader::visit_compilation_unit): New function.
4347 (Dwarf_info_reader::visit_type_unit): New function.
4348 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
4349 Sized_elf_reloc_mapper.
4350 (Sized_dwarf_line_info::symbol_section): Remove function.
4351 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
4352 (Sized_dwarf_line_info::read_line_mappings): Remove object
4353 parameter, adjust callers.
4354 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
4355 * dwarf_reader.h: Include <sys/types.h>.
4356 (class Track_relocs): Remove forward declaration.
4357 (class Elf_reloc_mapper): New class.
4358 (class Sized_elf_reloc_mapper): New class.
4359 (class Dwarf_abbrev_table): New class.
4360 (class Dwarf_range_list): New class.
4361 (class Dwarf_ranges_table): New class.
4362 (class Dwarf_pubnames_table): New class.
4363 (class Dwarf_die): New class.
4364 (class Dwarf_info_reader): New class.
4365 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
4366 (Sized_dwarf_line_info::symbol_section): Remove member function.
4367 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
4368 base class.
4369 * gdb-index.cc: New source file.
4370 * gdb-index.h: New source file.
4371 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
4372 and .debug_types sections, call Layout::add_to_gdb_index.
4373 (Sized_relobj_incr::do_section_name): Implement.
4374 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
4375 return type; Implement.
4376 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
4377 return type.
4378 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
4379 parameter list and return type.
4380 (Sized_incr_dynobj::do_section_contents): Likewise.
4381 * layout.cc: Include gdb-index.h.
4382 (Layout::Layout): Initialize gdb_index_data_.
4383 (Layout::init_fixed_output_section): Check for .gdb_index section.
4384 (Layout::add_to_gdb_index): New function. Instantiate.
4385 * layout.h: Add forward declaration for class Gdb_index.
4386 (Layout::add_to_gdb_index): New member function.
4387 (Layout::gdb_index_data_): New data member.
4388 * main.cc: Include gdb-index.h.
4389 (main): Print statistics for gdb index.
4390 * object.cc (Object::section_contents): Move code into
4391 do_section_contents.
4392 (need_decompressed_section): Check for sections needed when building
4393 gdb index.
4394 (build_compressed_section_map): Likewise.
4395 (Sized_relobj_file::do_read_symbols): Need local symbols when building
4396 gdb index.
4397 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
4398 sections; call Layout::add_to_gdb_index.
4399 (Sized_relobj_file::do_decompressed_section_contents): Call
4400 do_section_contents directly.
4401 * object.h (Object::do_section_contents): Adjust parameter list and
4402 return type.
4403 (Object::do_decompressed_section_contents): Call do_section_contents
4404 directly.
4405 (Sized_relobj_file::do_section_contents): Adjust parameter list and
4406 return type.
4407 * options.h (class General_options): Add --gdb-index option.
4408 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
4409 list and return type.
4410 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
4411 * reloc.h (Track_relocs::checkpoint): New function.
4412 (Track_relocs::reset): New function.
4413
4414 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
4415 New test cases.
4416 * testsuite/Makefile.in: Regenerate.
4417 * testsuite/gdb_index_test.cc: New test source file.
4418 * testsuite/gdb_index_test_1.sh: New test source file.
4419 * testsuite/gdb_index_test_2.sh: New test source file.
4420
647f1574
DK
44212012-03-19 Doug Kwan <dougkwan@google.com>
4422
4423 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 4424 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
4425 __exidx_start and __exidx_end. Make symbol table parameter
4426 anonymous as it is not used.
4427 * gold.cc (queue_middle_tasks): Call target hook to define any
4428 target-specific symbols.
4429 * target.h (Target::define_standard_symbols): New method.
4430 (Target::do_define_standard_symbols): Same.
4431 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
4432 * testsuite/Makefile.in: Regenerate.
4433 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
4434 and __exidx_end.
4435 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
4436 relocations are generated for __exidx_start and __exidx_end.
4437
7c6109da
DK
44382012-03-16 Doug Kwan <dougkwan@google.com>
4439
4440 * testsuite/Makefile.am: Disable test initpri3b.
4441 * testsuite/Makefile.in: Regenerate.
4442
7b8957f8
DK
44432012-03-15 Doug Kwan <dougkwan@google.com>
4444
4445 * arm.cc (Target_arm::got_section): Make .got section read-only
4446 if -z now is given.
4447
14dc9ef7
ILT
44482012-03-15 Ian Lance Taylor <iant@google.com>
4449
4450 PR gold/13850
4451 * layout.cc (Layout::make_output_section): Correctly mark
4452 SHT_INIT_ARRAY, et. al., as relro.
4453
fa40b62a
DK
44542012-03-14 Doug Kwan <dougkwan@google.com>
4455
4456 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
4457 dynamic relocations for protected symbols in shared objects.
4458
fd325007
ILT
44592012-03-13 Ian Lance Taylor <iant@google.com>
4460
4461 * resolve.cc (Symbol_table::resolve): When merging common symbols,
4462 keep the larger alignment.
4463
e8dd54e1
CC
44642012-03-12 Cary Coutant <ccoutant@google.com>
4465
4466 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
4467 handling of DW_LNE_define_file.
4468
feb5f3b0
CC
44692012-03-12 Cary Coutant <ccoutant@google.com>
4470
4471 * reduced_debug_output.cc
4472 (Output_reduced_debug_info_section::get_die_end): Add new FORM
4473 codes to switch.
4474
a1fb4256
CC
44752012-02-29 Cary Coutant <ccoutant@google.com>
4476
4477 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
4478
5dd8762a
CC
44792012-02-29 Cary Coutant <ccoutant@google.com>
4480
4481 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4482 Call Object::decompressed_section_contents.
4483 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
4484 New dtor.
4485 (Sized_dwarf_line_info::buffer_start_): New data member.
4486 * merge.cc (Output_merge_data::do_add_input_section): Call
4487 Object::decompressed_section_contents.
4488 (Output_merge_string::do_add_input_section): Likewise.
4489 * object.cc (need_decompressed_section): New function.
4490 (build_compressed_section_map): Decompress sections needed later.
4491 (Sized_relobj_file::do_decompressed_section_contents): New function.
4492 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4493 * object.h (Object::decompressed_section_contents): New function.
4494 (Object::discard_decompressed_sections): New function.
4495 (Object::do_decompressed_section_contents): New function.
4496 (Object::do_discard_decompressed_sections): New function.
4497 (Compressed_section_info): New type.
4498 (Compressed_section_map): Include decompressed section contents.
4499 (Sized_relobj_file::do_decompressed_section_contents): New function.
4500 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4501
7b5de7ee
CC
45022012-02-16 Cary Coutant <ccoutant@google.com>
4503
4504 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
4505 * testsuite/Makefile.in: Regenerate.
4506
f9fa4a63
CC
45072012-02-14 Cary Coutant <ccoutant@google.com>
4508
4509 * options.cc (General_options::finalize): Disallow -pie and -static.
4510
2c175ebc
DK
45112012-02-03 Doug Kwan <dougkwan@google.com>
4512
4513 * arm.cc (Arm_relocate_functions::abs8,
4514 Arm_relocate_functions::abs16): Use
4515 Bits::has_signed_unsigned_overflow32.
4516 (Arm_relocate_functions::thm_abs8): Correct range of
4517 overflow check.
4518 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
4519 in assertions.
4520
90cff06f
DK
45212012-02-02 Doug Kwan <dougkwan@google.com>
4522
4523 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
4524 position independent outputs, not just shared objects.
4525
63887f3d
L
45262012-01-30 H.J. Lu <hongjiu.lu@intel.com>
4527
4528 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
4529 * configure: Regenerated.
4530
bef2b434
ILT
45312012-01-27 Ian Lance Taylor <iant@google.com>
4532
4533 * reloc.h (Bits): New class with static functions, copied from
4534 namespace utils in arm.cc.
4535 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
4536 instead.
4537
c335b55d
L
45382012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4539
4540 * incremental.cc (write_info_blocks): Correct relocation offset.
4541
41194d9f
L
45422012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4543
4544 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
4545 (Relocate::tls_gd_to_le): Likewise.
4546
1bae613c
L
45472012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4548
4549 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
4550
24482ca0
L
45512012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4552
4553 * configure.ac: Check if -mcmodel=medium works.
4554 * configure: Regenerated.
4555
c2c7840a
CC
45562012-01-24 Cary Coutant <ccoutant@google.com>
4557
4558 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
4559 definition and ...
4560 (read_unsigned_LEB_128_x): ... this new function.
4561 (read_signed_LEB_128): Replaced with inline definition and ...
4562 (read_signed_LEB_128_x): ... this new function.
4563 * int_encoding.h (read_unsigned_LEB_128_x): New function.
4564 (read_unsigned_LEB_128): Add inline definition.
4565 (read_signed_LEB_128_x): New function.
4566 (read_signed_LEB_128): Add inline definition.
4567 * testsuite/Makefile.am (leb128_unittest): New unit test.
4568 * testsuite/Makefile.in: Regenerate.
4569 * testsuite/leb128_unittest.cc: New unit test.
4570
833de760 45712012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
4572
4573 PR gold/13617
4574 * i386.cc (Target_i386::do_code_fill): When using a jmp
4575 instruction, pad with nop instructions.
4576 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4577
618d6666
L
45782012-01-22 H.J. Lu <hongjiu.lu@intel.com>
4579
4580 * x86_64.cc (gc_process_relocs): Add typename on types used in
4581 template.
4582 (scan_relocs): Likewise.
4583 (relocate_section): Likewise.
4584 (apply_relocation): Likewise.
4585
3660ff06
L
45862012-01-10 H.J. Lu <hongjiu.lu@intel.com>
4587
4588 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
4589 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
4590 under x32.
4591
fc51264f
L
45922012-01-09 H.J. Lu <hongjiu.lu@intel.com>
4593
4594 * x86_64.cc: Initial support for x32.
4595
dd74ae06
CC
45962012-01-03 Cary Coutant <ccoutant@google.com>
4597
4598 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
4599 Use abstract base class for GOT.
4600 * gold/output.h (class Output_data_got_base): New abstract base class.
4601 (class Output_data_got): Derive from new base class, adjust ctors.
4602 (Output_data_got::reserve_slot): Make virtual; rename to
4603 do_reserve_slot; Adjust callers.
4604 * gold/target.h (Sized_target::init_got_plt_for_update): Return
4605 pointer to abstract base class.
4606 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
4607
83896202
ILT
46082011-12-18 Ian Lance Taylor <iant@google.com>
4609
4610 * object.h (Relobj::local_symbol_value): New function.
4611 (Relobj::local_plt_offset): New function.
4612 (Relobj::local_has_got_offset): New function.
4613 (Relobj::local_got_offset): New function.
4614 (Relobj::set_local_got_offset): New function.
4615 (Relobj::do_local_symbol_value): New pure virtual function.
4616 (Relobj::do_local_plt_offset): Likewise.
4617 (Relobj::do_local_has_got_offset): Likewise.
4618 (Relobj::do_local_got_offset): Likewise.
4619 (Relobj::do_set_local_got_offset): Likewise.
4620 (Sized_relobj::do_local_has_got_offset): Rename from
4621 local_has_got_offset.
4622 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
4623 (Sized_relobj::do_set_local_got_offset): Rename from
4624 set_local_got_offset.
4625 (Sized_relobj_file::do_local_plt_offset): Rename from
4626 local_plt_offset.
4627 (Sized_relobj_file::do_local_symbol_value): New function.
4628 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
4629 local_plt_offset.
4630 * output.cc (Output_data_got::Got_entry::write): Change object to
4631 Relobj. Use local_symbol_value.
4632 (Output_data_got::add_global_with_rel): Change rel_dyn to
4633 Output_data_reloc_generic*. Use add_global_generic.
4634 (Output_data_got::add_global_with_rela): Remove. Change all
4635 callers to use add_global_with_rel.
4636 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
4637 Output_data_reloc_generic*. Use add_global_generic.
4638 (Output_data_got::add_global_pair_with_rela): Remove. Change all
4639 callers to use add_global_pair_with_rel.
4640 (Output_data_got::add_local): Change object to Relobj*.
4641 (Output_data_got::add_local_plt): Likewise.
4642 (Output_data_got::add_local_with_rel): Change object to Relobj*,
4643 change rel_dyn to Output_data_reloc_generic*. Use
4644 add_local_generic.
4645 (Output_data_got::add_local_with_rela): Remove. Change all
4646 callers to use all_local_with_rel.
4647 (Output_data_got::add_local_pair_with_rel): Change object to
4648 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
4649 add_output_section_generic.
4650 (Output_data_got::add_local_pair_with_rela): Remove. Change all
4651 callers to use add_local_pair_with_rel.
4652 (Output_data_got::reserve_local): Change object to Relobj*.
4653 * output.h: (class Output_data_reloc_generic): Add pure virtual
4654 declarations for add_global_generic, add_local_generic,
4655 add_output_section_generic.
4656 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
4657 functions for Output_data_reloc_generic. Update declarations for
4658 changes listed in output.cc.
4659 (class Output_data_got): Change template parameter to got_size.
4660 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
4661 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
4662 function.
4663 (Sized_relobj_incr::do_local_plt_offset): New function.
4664 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
4665 add_global_generic.
4666
76677ad0
CC
46672011-12-17 Cary Coutant <ccoutant@google.com>
4668
4669 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
4670 * resolve.cc (Symbol_table::resolve): Likewise.
4671 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
4672 arrays.
4673 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4674
8b8dd8d5
ILT
46752011-12-16 Ian Lance Taylor <iant@google.com>
4676
4677 * output.h (Output_data_reloc_generic::add): Only call
4678 add_dynamic_reloc if this is a dynamic reloc section.
4679
d55525b9
L
46802011-12-15 H.J. Lu <hongjiu.lu@intel.com>
4681
4682 PR gold/13505
4683 * target-reloc.h (apply_relocation): Replace <64, false> with
4684 <size, big_endian>.
4685
ff81c7c1
NC
46862011-11-25 Nick Clifton <nickc@redhat.com>
4687
4688 * po/it.po: New Italian translation.
4689
628f39be
SA
46902011-11-17 Sterling Augustine <saugustine@google.com>
4691
4692 * script.cc (script_include_directive): Implement.
4693 (read_script_file): New local variables name and search_path. Update
4694 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
4695 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
4696 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
4697
98ef3ea4
SA
46982011-11-11 Sterling Augustine <saugustine@google.com>
4699
4700 * yyscript.y (section_cmd): Add support for INCLUDE directive.
4701 (file_or_sections_cmd): Likewise.
4702
f4a8b6d7
DK
47032011-11-11 Doug Kwan <dougkwan@google.com>
4704
4705 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
4706 if --just-symbols is given.
4707
29ab395d
DK
47082011-11-10 Doug Kwan <dougkwan@google.com>
4709
4710 PR gold/13362
4711 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
4712 when processing data relocs.
4713 * reloc.h (Relocate_functions::rel_unaligned): New method.
4714 (Relocate_functions::pcrel_unaligned): Ditto.
4715 (Relocate_functions::rel32_unaligned): Ditto.
4716 (Relocate_functions::pcrel32_unaligned): Ditto.
4717
2c339f71
DK
47182011-11-09 Doug Kwan <dougkwan@google.com>
4719
4720 PR gold/13362
4721 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
4722 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
4723 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
4724 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4725 (Relocate_functions::rel_unaligned): New.
4726 (Relocate_functions::rel32_unaligned): New.
4727 * target-reloc.h (relocate_for_relocatable): Add code to handle
4728 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4729 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
4730 arm_unaligned_reloc_r): New targets.
4731 * testsuite/Makefile.in: Regenerate.
4732 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
4733 linking.
4734
3f3cddf1
ILT
47352011-11-02 Ian Lance Taylor <iant@google.com>
4736
4737 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
4738 NATIVE_LINKER.
4739 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
4740 * options.cc (General_options::finalize): Use library search path
4741 from configure script if specified. If not native and no sysroot,
4742 only search TOOLLIBDIR.
4743 * options.h (Search_directory::Search_directory): Change name to
4744 const std::string&.
4745 (General_options::add_to_library_path_with_sysroot): Change arg to
4746 const std::string&.
4747 * configure, Makefile.in, config.in: Rebuild.
4748
a8e2273b
ILT
47492011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4750
4751 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
4752 we are working around the ARM1176 Erratum.
4753 * options.h (General_options::fix_arm1176): Add option.
4754 * testsuite/Makefile.am: Add testcases, and keep current ones
4755 working.
4756 * testsuite/Makefile.in: Regenerate.
4757 * testsuite/arm_fix_1176.s: New file.
4758 * testsuite/arm_fix_1176.sh: Likewise.
4759
cd6eab1c
ILT
47602011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4761
4762 * arm.cc (Target_arm::Target_arm): Remove initialisation of
4763 may_use_blx_.
4764 (Target_arm::may_use_blx): Remove method.
4765 (Target_arm::set_may_use_blx): Likewise.
4766 (Target_arm::may_use_v4t_interworking): New method.
4767 (Target_arm::may_use_v5t_interworking): Likewise.
4768 (Target_arm::may_use_blx_): Remove member variable.
4769 (Arm_relocate_functions::arm_branch_common): Check for v5T
4770 interworking.
4771 (Arm_relocate_functions::thumb_branch_common): Likewise.
4772 (Reloc_stub::stub_type_for_reloc): Likewise.
4773 (Target_arm::do_finalize_sections): Correct interworking checks.
4774 * testsuite/Makefile.am: Add new tests.
4775 * testsuite/Makefile.in: Regenerate.
4776 * testsuite/arm_farcall_arm_arm.s: New test.
4777 * testsuite/arm_farcall_arm_arm.sh: Likewise.
4778 * testsuite/arm_farcall_arm_thumb.s: Likewise.
4779 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
4780 * testsuite/arm_farcall_thumb_arm.s: Likewise.
4781 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
4782 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
4783 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
4784
286adcf4
CC
47852011-10-31 Cary Coutant <ccoutant@google.com>
4786
4787 PR gold/13023
4788 * expression.cc (Expression::eval_with_dot): Add
4789 is_section_dot_assignment parameter.
4790 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
4791 absolute and assigning to dot within a section.
4792 * script-sections.cc
4793 (Output_section_element_assignment::set_section_addresses): Pass
4794 dot_section to set_if_absolute.
4795 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
4796 as is_section_dot_assignment flag to eval_with_dot.
4797 (Output_section_element_dot_assignment::set_section_addresses):
4798 Likewise.
4799 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
4800 parameter. Also set value if relative to dot_section; set the
4801 symbol's output_section.
4802 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
4803 parameter. Adjust all callers.
4804 (Expression::eval_maybe_dot): Likewise.
4805 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
4806 Adjust all callers.
4807 * testsuite/script_test_2.t: Test assignment of an absolute value
4808 to dot within an output section element.
4809
9634ed06
CC
48102011-10-31 Cary Coutant <ccoutant@google.com>
4811
4812 * options.h (class General_options): Add --[no-]gnu-unique options.
4813 * symtab.cc (Symbol_table::sized_write_globals): Convert
4814 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
4815
de4101c7
CC
48162011-10-31 Cary Coutant <ccoutant@google.com>
4817
4818 PR gold/13359
4819 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
4820 unnecessary assertion.
4821 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
4822
7257cc92
ST
48232011-10-31 Sriraman Tallam <tmsriram@google.com>
4824
4825 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4826 gc_mark_symbol.
4827 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4828 gc_mark_symbol.
4829 Change to just keep the section associated with symbol.
4830 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
4831 they are externally visible and --export-dynamic is turned on.
4832 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
4833
bfc34b3f
ILT
48342011-10-19 Ian Lance Taylor <iant@google.com>
4835
4836 PR gold/13163
4837 * script-sections.cc
4838 (Output_section_element_dot_assignment::needs_output_section): New
4839 function.
4840
ea0d8c47
ILT
48412011-10-19 Ian Lance Taylor <iant@google.com>
4842
4843 PR gold/13204
4844 * layout.cc (Layout::segment_precedes): Don't assert failure if a
4845 --section-start option was seen.
4846 * options.h (General_options::any_section_start): New function.
4847
abd242a9
DM
48482011-10-18 David S. Miller <davem@davemloft.net>
4849
4850 PR binutils/13301
4851 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
4852 member to track relocation locations that have moved during TLS
4853 reloc optimizations.
4854 (Target_sparc::Relocate::Relocate): Initialize to NULL.
4855 (Target_sparc::Relocate::relocate): Adjust view down by 4
4856 bytes if it matches reloc_adjust_addr_.
4857 (Target_sparc::Relocate::relocate_tls): Always move the
4858 __tls_get_addr call delay slot instruction forward 4 bytes when
4859 performing relaxation.
4860
bab9090f
CC
48612011-10-18 Cary Coutant <ccoutant@google.com>
4862
4863 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
4864 (Output_file::map_no_anonymous): Check for non-zero
4865 return code from posix_fallocate.
4866
f7c5b166
CC
48672011-10-17 Cary Coutant <ccoutant@google.com>
4868
4869 PR gold/13245
4870 * plugin.cc (is_visible_from_outside): Check for symbols
4871 referenced from dynamic objects.
4872 * resolve.cc (Symbol_table::resolve): Don't count references
4873 from dynamic objects as references from real ELF files.
4874 * testsuite/plugin_test_2.sh: Adjust expected result.
4875
b490c0bb
CC
48762011-10-17 Cary Coutant <ccoutant@google.com>
4877
4878 * gold.cc: Include timer.h.
4879 (queue_middle_tasks): Stamp time.
4880 (queue_final_tasks): Likewise.
4881 * main.cc (main): Store timer in parameters. Print timers
4882 for each pass.
4883 * parameters.cc (Parameters::Parameters): Initialize timer_.
4884 (Parameters::set_timer): New function.
4885 (set_parameters_timer): New function.
4886 * parameters.h (Parameters::set_timer): New function.
4887 (Parameters::timer): New function.
4888 (Parameters::timer_): New data member.
4889 (set_parameters_timer): New function.
4890 * timer.cc (Timer::stamp): New function.
4891 (Timer::get_pass_time): New function.
4892 * timer.h (Timer::stamp): New function.
4893 (Timer::get_pass_time): New function.
4894 (Timer::pass_times_): New data member.
4895
f475cf7b
CC
48962011-10-17 Cary Coutant <ccoutant@google.com>
4897
4898 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
4899 task for members of lib groups.
4900
cdd7e244
CC
49012011-10-17 Cary Coutant <ccoutant@google.com>
4902
4903 PR gold/13288
4f95c8b4 4904 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
4905 (File_read::make_view): Move bounds check (replace with assert)...
4906 (File_read::find_or_make_view): ... to here.
4907
dfb45471
CC
49082011-10-12 Cary Coutant <ccoutant@google.com>
4909
4f95c8b4 4910 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
4911 ::read returns less than requested size.
4912
53bbcc1b
CC
49132011-10-10 Cary Coutant <ccoutant@google.com>
4914
4f95c8b4 4915 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
4916 Initialize defined_count_.
4917 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
4918 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
4919 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
4920 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
4921 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 4922 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
4923 member.
4924 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 4925 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
4926 Return zeroes instead of internal error.
4927
397b129b
CC
49282011-10-10 Cary Coutant <ccoutant@google.com>
4929
4930 PR gold/13249
4f95c8b4 4931 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 4932 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 4933 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
4934 (Output_reloc::type_): Adjust size of bit field.
4935 (Output_reloc::use_plt_offset_): New bit field.
4936 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
4937 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
4938 flag. Adjust all callers.
4f95c8b4 4939 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
4940 creating RELATIVE relocations.
4941
d5698657
NC
49422011-10-10 Nick Clifton <nickc@redhat.com>
4943
4944 * po/es.po: Updated Spanish translation.
4945 * po/fi.po: Updated Finnish translation.
4946
6a59a5c2
DN
49472011-10-03 Diego Novillo <dnovillo@google.com>
4948
4949 * options.cc (parse_uint): Fix dereference of RETVAL.
4950
f0558624
ST
49512011-09-29 Sriraman Tallam <tmsriram@google.com>
4952
4953 * layout.h (section_order_map_): New member.
4954 (get_section_order_map): New member function.
4955 * output.cc (Output_section::add_input_section): Check for patterns
4956 only when --section-ordering-file is specified.
4957 * gold.cc (queue_middle_tasks): Delay updating order of sections till
4958 output_sections have been formed.
4959 * layout.cc (Layout_Layout): Initialize section_order_map_.
4960 * plugin.cc (update_section_order): Store order in order_map. Do not
4961 update the order.
4962 * testsuite/Makefile.am: Add test case for plugin_final_layout.
4963 * testsuite/Makefile.in: Regenerate.
4964 * testsuite/plugin_section_order.c: New file.
4965 * testsuite/plugin_final_layout.cc: New file.
4966 * testsuite/plugin_final_layout.sh: New file.
4967
a7dac153
CC
49682011-09-29 Cary Coutant <ccoutant@google.com>
4969
4f95c8b4 4970 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 4971 Check for NULL.
4f95c8b4 4972 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
4973 symbols during incremental update.
4974 (Symbol_table::add_from_dynobj): Likewise.
4975
eebd87a5
ILT
49762011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4977 Ian Lance Taylor <iant@google.com>
4978
4979 * symtab.cc (Symbol_table::define_special_symbol): Always
4980 canonicalize version string.
4981
403a3331
CC
49822011-09-26 Cary Coutant <ccoutant@google.com>
4983
4f95c8b4
CC
4984 * gold.cc (queue_initial_tasks): Move option checks ...
4985 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
4986 some options; make others fatal.
4987
235061c2
CC
49882011-09-26 Cary Coutant <ccoutant@google.com>
4989
4990 gcc PR lto/47247
4991 * plugin.cc (get_symbols_v2): New function.
4992 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
4993 (is_referenced_from_outside): New function.
4994 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
4995 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
4996 (get_symbols): Pass version parameter.
4997 (get_symbols_v2): New function.
4998 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
4999 parameter.
5000 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
5001 (onload): Add LDPT_GET_SYMBOLS_V2.
5002 (all_symbols_read_hook): Use get_symbols_v2; check for
5003 LDPR_PREVAILING_DEF_IRONLY_EXP.
5004 * testsuite/plugin_test_3.sh: Update expected results.
5005
dc87f620
ILT
50062011-09-23 Simon Baldwin <simonb@google.com>
5007
5008 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
5009 configuration options.
5010 * configure: Regenerate.
5011 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
5012 * Makefile.in: Regenerate.
5013 * testsuite/Makefile.in: Regenerate.
5014
a8279f82
ST
50152011-09-19 Sriraman Tallam <tmsriram@google.com>
5016
5017 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
5018
0c9350c8
CC
50192011-09-19 Cary Coutant <ccoutant@google.com>
5020
5021 * incremental.cc (can_incremental_update): Fix typo in comment.
5022 * incremental.h (can_incremental_update): Likewise.
5023
aa06ae28
CC
50242011-09-18 Cary Coutant <ccoutant@google.com>
5025
5026 * incremental.cc (can_incremental_update): New function.
5027 * incremental.h (can_incremental_update): New function.
5028 * layout.cc (Layout::init_fixed_output_section): Call it.
5029 (Layout::make_output_section): Don't allow patch space in .eh_frame.
5030 * object.cc (Sized_relobj_file::do_layout): Call
5031 can_incremental_update.
5032
ebb300b2
CC
50332011-09-13 Cary Coutant <ccoutant@google.com>
5034
5035 * configure.ac: Check for glibc support for gnu_indirect_function
5036 support with static linking, setting automake conditional
5037 IFUNC_STATIC.
5038 * Makefile.in: Regenerate.
5039 * configure: Regenerate.
5040
5041 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
5042 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
5043 for IFUNC_STATIC.
5044 * testsuite/Makefile.in: Regenerate.
5045
1206d0d5
CC
50462011-09-13 Cary Coutant <ccoutant@google.com>
5047
5048 * incremental.cc (Sized_relobj_incr::do_layout): Call
5049 report_comdat_group for kept comdat sections.
5050 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
5051 * testsuite/Makefile.in: Regenerate.
5052 * testsuite/incr_comdat_test_1.cc: New source file.
5053 * testsuite/incr_comdat_test_2_v1.cc: New source file.
5054 * testsuite/incr_comdat_test_2_v2.cc: New source file.
5055 * testsuite/incr_comdat_test_2_v3.cc: New source file.
5056
40b29874
ILT
50572011-09-13 Ian Lance Taylor <iant@google.com>
5058
5059 * object.cc (Sized_relobj_file::do_layout): Remove unused local
5060 variable external_symbols_offset.
5061
1b045aac
ILT
50622011-09-12 Ian Lance Taylor <iant@google.com>
5063
5064 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
5065 triggered if object has no symbols.
5066
24c6c55a
DM
50672011-09-09 David S. Miller <davem@davemloft.net>
5068
5069 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
5070 (Output_fill_debug_line::do_write): Likewise.
5071
66570254
CC
50722011-08-29 Cary Coutant <ccoutant@google.com>
5073
5074 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
5075 casts to match formatting specs.
5076 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
5077
8ea8cd50
CC
50782011-08-26 Cary Coutant <ccoutant@google.com>
5079
5080 * layout.cc (Free_list::allocate): Provide guarantee of minimum
5081 remaining hole size when allocating.
5082 (Layout::make_output_section): Set fill methods for debug sections.
5083 * layout.h (Free_list::Free_list_node): Move from private to
5084 public.
5085 (Free_list::set_min_hole_size): New function.
5086 (Free_list::begin, Free_list::end): New functions.
5087 (Free_list::min_hole_): New data member.
5088 * output.cc: Include dwarf.h.
5089 (Output_fill_debug_info::do_minimum_hole_size): New function.
5090 (Output_fill_debug_info::do_write): New function.
5091 (Output_fill_debug_line::do_minimum_hole_size): New function.
5092 (Output_fill_debug_line::do_write): New function.
5093 (Output_section::Output_section): Initialize new data member.
5094 (Output_section::set_final_data_size): Ensure patch space is larger
5095 than minimum hole size.
5096 (Output_section::do_write): Fill holes in debug sections.
5097 * output.h (Output_fill): New class.
5098 (Output_fill_debug_info): New class.
5099 (Output_fill_debug_line): New class.
5100 (Output_section::set_free_space_fill): New function.
5101 (Output_section::free_space_fill_): New data member.
5102 * testsuite/Makefile.am (incremental_test_3): Add
5103 --incremental-patch option.
5104 (incremental_test_4): Likewise.
5105 (incremental_test_5): Likewise.
5106 (incremental_test_6): Likewise.
5107 (incremental_copy_test): Likewise.
5108 (incremental_common_test_1): Likewise.
5109 * testsuite/Makefile.in: Regenerate.
5110
7cf80422
NC
51112011-08-26 Nick Clifton <nickc@redhat.com>
5112
5113 * po/es.po: Updated Spanish translation.
5114
c3f7b0e5
CC
51152011-08-01 Cary Coutant <ccoutant@google.com>
5116
5117 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
5118 * gold/testsuite/Makefile.in: Regenerate.
5119 * gold/testsuite/justsyms_exec.c: New source file.
5120 * gold/testsuite/justsyms_lib.c: New source file.
5121
9590bf25
CC
51222011-08-01 Cary Coutant <ccoutant@google.com>
5123
5124 * layout.cc (Layout::set_segment_offsets): Don't realign text
5125 segment if -Ttext was specified.
5126 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
5127 file type.
5128 * object.h (Sized_relobj_file::e_type): New function.
5129 (Sized_relobj_file::e_type_): New data member.
5130 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
5131 base address for ET_EXEC files.
5132 * target.cc (Target::do_make_elf_object_implementation): Allow
5133 ET_EXEC files with --just-symbols option.
5134
dcd8d12e
CC
51352011-07-28 Cary Coutant <ccoutant@google.com>
5136
5137 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
5138 Add thread_number parameter.
5139 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
5140 * workqueue-threads.cc
5141 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
5142 current thread if its thread number is greater than desired thread
5143 count.
5144 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
5145 Add thread_number parameter.
5146 (Workqueue::should_cancel_thread): Likewise.
5147 (Workqueue::find_runnable_or_wait): Pass thread_number to
5148 should_cancel_thread.
5149 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
5150 parameter.
5151
804eb480
ST
51522011-07-22 Sriraman Tallam <tmsriram@google.com>
5153
5154 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
5155 only after checking if it cannot be forced local.
5156 * symtab.h (is_externally_visible): Check if the symbol is not forced
5157 local.
5158
f1ddb600
ILT
51592011-07-15 Ian Lance Taylor <iant@google.com>
5160
5161 * options.h (class General_options): Add --print-output-format.
5162 Move -EL next to -EB, for better --help output.
5163 * target-select.cc: Include <cstdio>, "options.h", and
5164 "parameters.h".
5165 (Target_selector::do_target_bfd_name): New function.
5166 (print_output_format): New function.
5167 * target-select.h (class Target_selector): Update declarations.
5168 (Target_selector::target_bfd_name): New function.
5169 (print_output_format): Declare.
5170 * main.cc: Include "target-select.h".
5171 (main): Handle --print-output-format.
5172 * gold.cc: Include "target-select.h".
5173 (queue_initial_tasks): Handle --print-output-format when there are
5174 no input files.
5175 * parameters.cc (parameters_force_valid_target): Give a better
5176 error message if -EB/-EL does not match target.
5177 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
5178 function.
5179
7d172687
ILT
51802011-07-15 Ian Lance Taylor <iant@google.com>
5181
5182 * i386.cc (class Output_data_plt_i386): Add layout_ field.
5183 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
5184 (Output_data_plt_i386::do_write): Write address of .dynamic
5185 section to first entry in .got.plt section.
5186 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
5187 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5188 Initialize layout_.
5189 (Output_data_plt_x86_64::do_write): Write address of .dynamic
5190 section to first entry in .got.plt section.
5191 * layout.h (Layout::dynamic_section): New function.
5192
e9552f7e
ST
51932011-07-13 Sriraman Tallam <tmsriram@google.com>
5194
5195 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
5196 to claim_file call.
5197 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
5198 input_section_position_, and input_section_glob_.
5199 (read_layout_from_file): Call function section_ordering_specified.
5200 * layout.h (is_section_ordering_specified): New function.
5201 (section_ordering_specified): New function.
5202 (section_ordering_specified_): New boolean member.
5203 * main.cc(main): Call load_plugins after layout object is defined.
5204 * output.cc (Output_section::add_input_section): Use
5205 function section_ordering_specified to check if section ordering is
5206 needed.
5207 * output.cc (Output_section::add_relaxed_input_section): Use
5208 function section_ordering_specified to check if section ordering is
5209 needed.
5210 (Output_section::update_section_layout): New function.
5211 (Output_section::sort_attached_input_sections): Check if input section
5212 must be reordered.
5213 * output.h (Output_section::update_section_layout): New function.
5214 * plugin.cc (get_section_count): New function.
5215 (get_section_type): New function.
5216 (get_section_name): New function.
5217 (get_section_contents): New function.
5218 (update_section_order): New function.
58797674 5219 (allow_section_ordering): New function.
e9552f7e
ST
5220 (Plugin::load): Add the new interfaces to the transfer vector.
5221 (Plugin_manager::load_plugins): New parameter.
5222 (Plugin_manager::all_symbols_read): New parameter.
5223 (Plugin_manager::claim_file): New parameter. Save the elf object for
5224 unclaimed objects.
5225 (Plugin_manager::get_elf_object): New function.
5226 (Plugin_manager::get_view): Change to directly use the bool to check
5227 if get_view is called from claim_file_hook.
5228 * plugin.h (input_objects): New function
5229 (Plugin__manager::load_plugins): New parameter.
5230 (Plugin_manager::claim_file): New parameter.
5231 (Plugin_manager::get_elf_object): New function.
5232 (Plugin_manager::in_claim_file_handler): New function.
5233 (Plugin_manager::in_claim_file_handler_): New member.
5234 (layout): New function.
5235 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
5236 handler with an extra parameter. Make the elf object before calling
5237 claim_file handler.
5238 * testsuite/plugin_test.c (get_section_count): New function pointer.
5239 (get_section_type): New function pointer.
5240 (get_section_name): New function pointer.
5241 (get_section_contents): New function pointer.
5242 (update_section_order): New function pointer.
5243 (allow_section_ordering): New function pointer.
5244 (onload): Check if the new interfaces exist.
5245
9446efde
ILT
52462011-07-13 Ian Lance Taylor <iant@google.com>
5247
5248 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
5249 relro section.
5250 * x86_64.cc (Target_x86_64::got_section): Likewise.
5251 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
5252 (relro_now_test_SOURCES): New variable.
5253 (relro_now_test_DEPENDENCIES): New variable.
5254 (relro_now_test_LDFLAGS): New variable.
5255 (relro_now_test_LDADD): New variable.
5256 (relro_now_test.so): New target.
5257 * testsuite/Makefile.in: Rebuild.
5258
07aa62f2
ILT
52592011-07-12 Ian Lance Taylor <iant@google.com>
5260
5261 PR gold/12980
5262 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
5263 GLOB_DAT relocation rather than a RELATIVE relocation for a
5264 protected symbol when creating a shared library.
5265 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5266 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
5267 * testsuite/protected_main_1.cc (main): Test that protected
5268 function has same address.
5269
e2153196
ILT
52702011-07-11 Ian Lance Taylor <iant@google.com>
5271
5272 PR gold/12979
5273 * options.h (class General_options): Add -Bgroup.
5274 * options.cc (General_options::finalize): If -Bgroup is set,
5275 default to --unresolved-symbols=report-all.
5276 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
5277 * target-reloc.h (issue_undefined_symbol_error): Handle
5278 --unresolved-symbols=report-all.
5279
6daf5215
ILT
52802011-07-08 Ian Lance Taylor <iant@google.com>
5281
5282 PR gold/11985
5283 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
5284 if linker script discards key sections.
5285 (Layout::create_dynamic_symtab): Likewise.
5286 (Layout::assign_local_dynsym_offsets): Likewise.
5287 (Layout::sized_create_version_sections): Likewise.
5288 (Layout::create_interp): Likewise.
5289 (Layout::finish_dynamic_section): Likewise.
5290 (Layout::set_dynamic_symbol_size): Likewise.
5291
beabb2c6
ILT
52922011-07-08 Ian Lance Taylor <iant@google.com>
5293
5294 PR gold/12386
5295 * options.h (class General_options): Add --unresolved-symbols.
5296 * target-reloc.h (issue_undefined_symbol_error): Check
5297 --unresolved-symbols. Add comments.
5298
9c16daf1
ILT
52992011-07-08 Ian Lance Taylor <iant@google.com>
5300
5301 * testsuite/odr_violation2.cc (Ordering::operator()): Make
5302 expression more complex.
5303
191f1a2d
ILT
53042011-07-08 Ian Lance Taylor <iant@google.com>
5305
5306 PR gold/11317
5307 * target-reloc.h (issue_undefined_symbol_error): New inline
5308 function, broken out of relocate_section.
5309 (relocate_section): Call issue_undefined_symbol_error.
5310 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5311 there is no TLS segment if we are about to issue an undefined
5312 symbol error.
5313 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5314
62855347
ILT
53152011-07-08 Ian Lance Taylor <iant@google.com>
5316
5317 PR gold/12279
5318 * resolve.cc (Symbol_table::should_override): Add fromtype
5319 parameter. Change all callers. Give error when linking together
5320 TLS and non-TLS symbol.
5321 (Symbol_table::should_override_with_special): Add fromtype
5322 parameter. Change all callers.
5323 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5324 there is no TLS segment if we have reported some errors.
5325 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5326
67181c72
ILT
53272011-07-08 Ian Lance Taylor <iant@google.com>
5328
5329 PR gold/12372
5330 * target.h (Target::plt_address_for_global): New function.
5331 (Target::plt_address_for_local): New function.
5332 (Target::plt_section_for_global): Remove.
5333 (Target::plt_section_for_local): Remove.
5334 (Target::do_plt_address_for_global): New virtual function.
5335 (Target::do_plt_address_for_local): New virtual function.
5336 (Target::do_plt_section_for_global): Remove.
5337 (Target::do_plt_section_for_local): Remove.
5338 (Target::register_global_plt_entry): Add Symbol_table and Layout
5339 parameters.
5340 * output.cc (Output_data_got::Got_entry::write): Use
5341 plt_address_for_global and plt_address_for_local.
5342 * layout.cc (Layout::add_target_dynamic_tags): Use size and
5343 address of output section.
5344 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
5345 got_irelative_, and irelative_count_ fields. Update
5346 declarations.
5347 (Output_data_plt_i386::has_irelative_section): New function.
5348 (Output_data_plt_i386::entry_count): Add irelative_count_.
5349 (Output_data_plt_i386::set_final_data_size): Likewise.
5350 (class Target_i386): Add got_irelative_ and rel_irelative_
5351 fields. Update declarations.
5352 (Target_i386::Target_i386): Initialize new fields.
5353 (Target_i386::do_plt_address_for_global): New function replacing
5354 do_plt_section_for_global.
5355 (Target_i386::do_plt_address_for_local): New function replacing
5356 do_plt_section_for_local.
5357 (Target_i386::got_section): Create got_irelative_.
5358 (Target_i386::rel_irelative_section): New function.
5359 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
5360 fields. Don't define __rel_iplt_{start,end}.
5361 (Output_data_plt_i386::add_entry): Add symtab and layout
5362 parameters. Change all callers. Use different PLT and GOT for
5363 IFUNC symbols.
5364 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
5365 layout parameters. Change all callers. Use different PLT and
5366 GOT.
5367 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
5368 (Output_data_plt_i386::rel_irelative): New function.
5369 (Output_data_plt_i386::address_for_global): New function.
5370 (Output_data_plt_i386::address_for_local): New function.
5371 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
5372 IRELATIVE GOT when changing IFUNC GOT entries.
5373 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
5374 reloc.
5375 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
5376 if we didn't create an IRELATIVE GOT.
5377 (Target_i386::Relocate::relocate): Use plt_address_for_global and
5378 plt_address_for_local.
5379 (Target_i386::do_dynsym_value): Use plt_address_for_global.
5380 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
5381 got_irelative_, and irelative_count_ fields. Update
5382 declarations.
5383 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5384 Initialize new fields. Remove symtab parameter. Change all
5385 callers.
5386 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
5387 irelative_count_.
5388 (Output_data_plt_x86_64::has_irelative_section): New function.
5389 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
5390 (class Target_x86_64): Add got_irelative_ and rel_irelative_
5391 fields. Update declarations.
5392 (Target_x86_64::Target_x86_64): Initialize new fields.
5393 (Target_x86_64::do_plt_address_for_global): New function replacing
5394 do_plt_section_for_global.
5395 (Target_x86_64::do_plt_address_for_local): New function replacing
5396 do_plt_section_for_local.
5397 (Target_x86_64::got_section): Create got_irelative_.
5398 (Target_x86_64::rela_irelative_section): New function.
5399 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
5400 all callers. Don't create __rel_iplt_{start,end}.
5401 (Output_data_plt_x86_64::add_entry): Add symtab and layout
5402 parameters. Change all callers. Use different PLT and GOT for
5403 IFUNC symbols.
5404 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
5405 layout parameters. Change all callers. Use different PLT and
5406 GOT.
5407 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
5408 parameters. Change all callers. Use different PLT and GOT for
5409 IFUNC symbols.
5410 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
5411 (Output_data_plt_x86_64::rela_irelative): New function.
5412 (Output_data_plt_x86_64::address_for_global): New function.
5413 (Output_data_plt_x86_64::address_for_local): New function.
5414 (Output_data_plt_x86_64::set_final_data_size): Likewise.
5415 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
5416 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
5417 (Target_x86_64::register_global_plt_entry): Add symtab and layout
5418 parameters.
5419 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
5420 reloc.
5421 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
5422 symbols if we didn't create an IRELATIVE GOT.
5423 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
5424 plt_address_for_local.
5425 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
5426 * testsuite/ifuncvar1.c: New test file.
5427 * testsuite/ifuncvar2.c: New test file.
5428 * testsuite/ifuncvar3.c: New test file.
5429 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
5430 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
5431 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
5432 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
5433 * testsuite/Makefile.in: Rebuild.
5434
33c15b45
CC
54352011-07-07 Cary Coutant <ccoutant@google.com>
5436
5437 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
5438 (two_file_test_1_ndebug.o): Likewise.
5439 (two_file_test_1b_ndebug.o): Likewise.
5440 (two_file_test_2_ndebug.o): Likewise.
5441 (two_file_test_main_ndebug.o): Likewise.
5442 (incremental_test_2): Link with no-debug versions.
5443
f48b5fb7
CC
54442011-07-06 Cary Coutant <ccoutant@google.com>
5445
5446 * gold/incremental.cc
5447 (Output_section_incremental_inputs::write_info_blocks): Check for
5448 hidden and internal symbols.
5449
221597a5
CC
54502011-07-06 Cary Coutant <ccoutant@google.com>
5451
5452 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
5453 Check disposition for startup file.
5454 (Incremental_inputs::report_command_line): Ignore
5455 --incremental-startup-unchanged option.
5456 * options.cc (General_options::parse_incremental_startup_unchanged):
5457 New function.
5458 (General_options::General_options): Initialize new data member.
5459 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
5460 (General_options): Add --incremental-startup-unchanged option.
5461 (General_options::incremental_startup_disposition): New function.
5462 (General_options::incremental_startup_disposition_): New data member.
5463
e24719f6
CC
54642011-07-06 Cary Coutant <ccoutant@google.com>
5465
5466 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
5467 input file index to Script_info ctor.
5468 (Sized_incremental_binary::do_file_has_changed): Find the
5469 command-line argument for files named in scripts.
5470 * incremental.h (Script_info::Script_info): New ctor
5471 with input file index.
5472 (Script_info::input_file_index): New function.
5473 (Script_info::input_file_index_): New data member.
5474 (Incremental_binary::get_library): Add const.
5475 (Incremental_binary::get_script_info): Add const.
5476 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
5477 * testsuite/Makefile.am (incremental_test_5): New test case.
5478 (incremental_test_6): New test case.
5479 * testsuite/Makefile.in: Regenerate.
5480
8f7c81e8
CC
54812011-07-06 Cary Coutant <ccoutant@google.com>
5482
5483 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
5484 debug output when command lines differ.
5485
9fbd3822
CC
54862011-07-06 Cary Coutant <ccoutant@google.com>
5487
5488 * incremental.cc (Incremental_inputs::report_command_line): Ignore
5489 --incremental-patch option.
5490 * layout.cc (Free_list::allocate): Extend allocation beyond original
5491 end if enabled.
5492 (Layout::make_output_section): Mark sections that should get
5493 patch space.
5494 * options.cc (parse_percent): New function.
5495 * options.h (parse_percent): New function.
5496 (DEFINE_percent): New macro.
5497 (General_options): Add --incremental-patch option.
5498 * output.cc (Output_section::Output_section): Initialize new data
5499 members.
5500 (Output_section::add_input_section): Print section name when out
5501 of patch space.
5502 (Output_section::add_output_section_data): Likewise.
5503 (Output_section::set_final_data_size): Add patch space when
5504 doing --incremental-full.
5505 (Output_section::do_reset_address_and_file_offset): Remove patch
5506 space.
5507 (Output_segment::set_section_list_addresses): Print debug output
5508 only if --incremental-update.
5509 * output.h (Output_section::set_is_patch_space_allowed): New function.
5510 (Output_section::is_patch_space_allowed_): New data member.
5511 (Output_section::patch_space_): New data member.
5512 * parameters.cc (Parameters::incremental_full): New function.
5513 * parameters.h (Parameters::incremental_full): New function
5514 * testsuite/Makefile.am (incremental_test_2): Add test for
5515 --incremental-patch option.
5516 * testsuite/Makefile.in: Regenerate.
5517 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
5518 (t18): Remove function body.
5519
f6cccc2c
DK
55202011-07-05 Doug Kwan <dougkwan@google.com>
5521
5522 PR gold/12771
5523 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
5524 Arm_Address type for relocation result.
5525 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
5526 overflow check.
5527 (Arm_relocate_functions::abs32): Use unaligned access.
5528 (Arm_relocate_functions::rel32): Ditto.
5529 (Arm_relocate_functions::prel31): Ditto.
5530 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
5531 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
5532 static data relocations.
5533 * testsuite/Makefile.in: Regnerate.
5534 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
5535
28a13fec
ILT
55362011-07-05 Ian Lance Taylor <iant@google.com>
5537
5538 PR gold/12392
5539 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
5540 symbols if necessary.
5541 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5542
24d47b34
ILT
55432011-07-05 Ian Lance Taylor <iant@google.com>
5544
5545 PR gold/12952
5546 * resolve.cc (Symbol::override_base_with_special): Simply override
5547 version with special symbol version, ignoring previous version.
5548
41f9cbbe
ILT
55492011-07-05 Ian Lance Taylor <iant@google.com>
5550
5551 * object.cc (Sized_relobj_file::include_section_group): Add
5552 information to comment about signature location.
5553
886288f1
ILT
55542011-07-02 Ian Lance Taylor <iant@google.com>
5555
5556 PR gold/12957
5557 * options.h (class General_options): Add -f and -F.
5558 * options.cc (General_options::finalize): Fatal error if -f/-F
5559 are used without -shared.
5560 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
5561
ae3a6d4f
ILT
55622011-07-02 Ian Lance Taylor <iant@google.com>
5563
5564 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
5565
21131061
ILT
55662011-07-01 Ian Lance Taylor <iant@google.com>
5567
5568 PR gold/12525
5569 PR gold/12952
5570 * resolve.cc (Symbol::override_base_with_special): Don't override
5571 the version if the overriding symbol has a different name.
5572 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
5573 all callers. If we give an error about an undefined version,
5574 define the base version if necessary.
5575 * dynobj.h (class Versions): Update declaration.
5576 * testsuite/weak_alias_test_5.cc: New file.
5577 * testsuite/weak_alias_test.script: New file.
5578 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
5579 and versioned_alias have the right value, and call t2.
5580 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
5581 weak_alias_test_5.so.
5582 (weak_alias_test_LDADD): Likewise.
5583 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
5584 * testsuite/Makefile.in: Rebuild.
5585
611062c0
ILT
55862011-07-01 Ian Lance Taylor <iant@google.com>
5587
5588 PR gold/12525
5589 * options.h (class General_options): Support -z notext.
5590 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
5591 -Wl,-z,notext.
5592 (two_file_shared_nonpic.so): Likewise.
5593 (two_file_shared_mixed.so): Likewise.
5594 (two_file_shared_mixed_1.so): Likewise.
5595 (weak_undef_lib_nonpic.so): Likewise.
5596 (alt/weak_undef_lib_nonpic.so): Likewise.
5597 (tls_test_shared_nonpic.so): Likewise.
5598 * testsuite/Makefile.in: Rebuild.
5599
328c7c2f
ILT
56002011-07-01 Ian Lance Taylor <iant@google.com>
5601
5602 PR gold/12525
5603 * configure.ac: Test whether static linking works, setting
5604 the automake conditional HAVE_STATIC.
5605 * testsuite/Makefile.am: Disable tests using -static if
5606 HAVE_STATIC is not true.
5607 * configure, testsuite/Makefile.in: Rebuild.
5608
02d7cd44
ILT
56092011-07-01 Ian Lance Taylor <iant@google.com>
5610
5611 PR gold/12525
5612 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
5613 Assert if we see DW_EH_PE_indirect.
5614 * target.h (Target::ehframe_datarel_base): New function.
5615 (Target::do_ehframe_datarel_base): New target function.
5616 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
5617 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
5618 function.
5619
07a60597
ILT
56202011-07-01 Ian Lance Taylor <iant@google.com>
5621
5622 PR gold/12571
5623 * options.h (class General_options): Add
5624 --ld-generated-unwind-info.
5625 * ehframe.cc (Fde::write): Add address parameter. Change all
5626 callers. If associated with PLT, fill in address and size.
5627 (Cie::set_output_offset): Only add merge mapping if there is an
5628 object.
5629 (Cie::write): Add address parameter. Change all callers.
5630 (Eh_frame::add_ehframe_for_plt): New function.
5631 * ehframe.h (class Fde): Update declarations. Move shndx_ and
5632 input_offset_ fields into union u_, with new plt field.
5633 (Fde::Fde): Adjust for new union field.
5634 (Fde::Fde) [Output_data version]: New constructor.
5635 (Fde::add_mapping): Only add merge mapping if there is an object.
5636 (class Cie): Update declarations.
5637 (class Eh_frame): Declare add_ehframe_for_plt.
5638 * layout.cc (Layout::layout_eh_frame): Break out code into
5639 make_eh_frame_section, and call it.
5640 (Layout::make_eh_frame_section): New function.
5641 (Layout::add_eh_frame_for_plt): New function.
5642 * layout.h (class Layout): Update declarations.
5643 * merge.cc (Merge_map::add_mapping): Add assertion.
5644 * i386.cc: Include "dwarf.h".
5645 (class Output_data_plt_i386): Make first_plt_entry,
5646 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
5647 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5648 and plt_eh_frame_fde.
5649 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
5650 boundary. Call add_eh_frame_for_plt if appropriate.
5651 * x86_64.cc: Include "dwarf.h".
5652 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
5653 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
5654 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5655 and plt_eh_frame_fde.
5656 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
5657 appropriate.
5658
14788a3f
ILT
56592011-06-29 Ian Lance Taylor <iant@google.com>
5660
5661 PR gold/12629
5662 * object.cc (Sized_relobj_file::layout_section): Change shdr
5663 parameter to be const.
5664 (Sized_relobj_file::layout_eh_frame_section): New function, broken
5665 out of do_layout.
5666 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
5667 appropriate. Call layout_eh_frame_section.
5668 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
5669 sections.
5670 * object.h (class Sized_relobj_file): Update declarations.
5671
6c21fce1
ILT
56722011-06-29 Ian Lance Taylor <iant@google.com>
5673
37e41b03 5674 PR gold/12652
6c21fce1
ILT
5675 * script.cc (Token::integer_value): Accept trailing M/m/K/k
5676 modifier.
5677 (Lex::gather_token): Accept trailing M/m/K/k for integers.
5678
4d5e4e62
ILT
56792011-06-29 Ian Lance Taylor <iant@google.com>
5680
5681 PR gold/12675
5682 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
5683 SHT_X86_64_UNWIND.
5684 * layout.cc (Layout::layout_eh_frame): Likewise.
5685
886f533a
ILT
56862011-06-29 Ian Lance Taylor <iant@google.com>
5687
5688 PR gold/12695
5689 * layout.cc (Layout::symtab_section_shndx): New function.
5690 * layout.h (class Layout): Declare symtab_section_shndx.
5691 * output.cc (Output_section::write_header): Call it.
5692
f3ae1b28
ILT
56932011-06-29 Ian Lance Taylor <iant@google.com>
5694
5695 PR gold/12818
5696 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
5697 symbols which are not used in a relocation.
5698
aecf301f
ILT
56992011-06-28 Ian Lance Taylor <iant@google.com>
5700
5701 PR gold/12898
5702 * layout.cc (Layout::segment_precedes): Don't crash if a linker
5703 script create indistinguishable segments.
5704 (Layout::set_segment_offsets): Use stable_sort when sorting
5705 segments. Pass this to Compare_segments constructor.
5706 * layout.h (class Layout): Make segment_precedes non-static.
5707 (class Compare_segments): Change from struct to class. Add
5708 layout_ field. Add constructor.
5709 * script-sections.cc
5710 (Script_sections::attach_sections_using_phdrs_clause): Rename
5711 local orphan to is_orphan. Don't report failure to put empty
5712 section in segment. On attachment failure, report name of
5713 section, and attach to first PT_LOAD segment.
5714
03ef7571
ILT
57152011-06-28 Ian Lance Taylor <iant@google.com>
5716
5717 PR gold/12934
5718 * target-select.cc (Target_selector::Target_selector): Add
5719 emulation parameter. Change all callers.
5720 (select_target_by_bfd_name): Rename from select_target_by_name.
5721 Change all callers.
5722 (select_target_by_emulation): New function.
5723 (supported_emulation_names): New function.
5724 * target-select.h (class Target_selector): Add emulation_ field.
5725 Update declarations.
5726 (Target_selector::recognize_by_bfd_name): Rename from
5727 recognize_by_name. Change all callers.
5728 (Target_selector::supported_bfd_names): Rename from
5729 supported_names. Change all callers.
5730 (Target_selector::recognize_by_emulation): New function.
5731 (Target_selector::supported_emulations): New function.
5732 (Target_selector::emulation): New function.
5733 (Target_selector::do_recognize_by_bfd_name): Rename from
5734 do_recognize_by_name. Change all callers.
5735 (Target_selector::do_supported_bfd_names): Rename from
5736 do_supported_names. Change all callers.
5737 (Target_selector::do_recognize_by_emulation): New function.
5738 (Target_selector::do_supported_emulations): New function.
5739 (select_target_by_bfd_name): Change name in declaration.
5740 (select_target_by_emulation): Declare.
5741 (supported_emulation_names): Declare.
5742 * parameters.cc (parameters_force_valid_target): Try to find
5743 target based on emulation from -m option.
5744 * options.h (class General_options): Change doc string for -m.
5745 * options.cc (help): Print emulations.
5746 (General_options::parse_V): Likewise.
5747 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
5748 Add emulation parameter. Change all callers.
5749
200b2bb9
ILT
57502011-06-28 Ian Lance Taylor <iant@google.com>
5751
5752 * target.h (class Target): Add osabi_ field.
5753 (Target::osabi): New function.
5754 (Target::set_osabi): New function.
5755 (Target::Target): Initialize osabi_.
5756 (Target::do_adjust_elf_header): Make pure virtual.
5757 (Sized_target::do_adjust_elf_header): Declare.
5758 * target.cc (Sized_target::do_adjust_elf_header): New function.
5759 (class Sized_target): Instantiate all versions.
5760 * freebsd.h (class Target_freebsd): Remove.
5761 (Target_selector_freebsd::do_recognize): Call set_osabi on
5762 Target.
5763 (Target_selector_freebsd::do_recognize_by_name): Likewise.
5764 (Target_selector_freebsd::set_osabi): Remove.
5765 * i386.cc (class Target_i386): Inherit from Sized_target rather
5766 than Target_freebsd.
5767 * x86_64.cc (class Target_x86_64): Likewise.
5768
b3ce541e
ILT
57692011-06-28 Ian Lance Taylor <iant@google.com>
5770
5771 * target.h (Target::can_check_for_function_pointers): Rewrite.
5772 Make non-virtual.
5773 (Target::can_icf_inline_merge_sections): Likewise.
5774 (Target::section_may_have_icf_unsafe_poineters): Likewise.
5775 (Target::Target_info): Add can_icf_inline_merge_sections field.
5776 (Target::do_can_check_for_function_pointers): New virtual
5777 function.
5778 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
5779 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
5780 from can_check_for_function_pointers, move in file.
5781 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
5782 section_may_have_icf_unsafe_poineters, move in file.
5783 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
5784 * i386.cc (Target_i386::do_can_check_for_function_pointers):
5785 Rename from can_check_for_function_pointers, move in file.
5786 (Target_i386::can_icf_inline_merge_sections): Remove.
5787 (Target_i386::i386_info): Initialize
5788 can_icf_inline_merge_sections.
5789 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
5790 Initialize can_icf_inline_merge_sections.
5791 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
5792 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
5793 Rename from can_check_for_function_pointers, move in file.
5794 (Target_x86_64::can_icf_inline_merge_sections): Remove.
5795 (Target_x86_64::x86_64_info): Initialize
5796 can_icf_inline_merge_sections.
5797 * testsuite/testfile.cc (Target_test::test_target_info):
5798 Likewise.
5799 * icf.cc (get_section_contents): Correct formatting.
5800
6d1c4efb
ILT
58012011-06-27 Ian Lance Taylor <iant@google.com>
5802
5803 * symtab.cc (Symbol::versioned_name): New function.
5804 (Symbol_table::add_to_final_symtab): Use versioned_name when
5805 appropriate.
5806 (Symbol_table::sized_write_symbol): Likewise.
5807 * symtab.h (class Symbol): Declare versioned_name.
5808 * stringpool.h (class Stringpool_template): Add variant of add
5809 which takes a std::basic_string.
5810 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
5811 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
5812 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
5813 (ver_test_12.o): New target.
5814 * testsuite/Makefile.in: Rebuild.
5815
57eb9b50
DK
58162011-06-27 Doug Kwan <dougkwan@google.com>
5817
5818 * arm.cc (Arm_relocate_functions::thm_jump8,
5819 Arm_relocate_functions::thm_jump11): Use a wider signed
5820 type to compute offset.
5821 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
5822 arm_thm_jump8.
5823 * testsuite/Makefile.in: Regenerate.
5824 * testsuite/arm_branch_in_range.sh: Check test results of
5825 arm_thm_jump11 and arm_thm_jump8.
5826 * testsuite/arm_thm_jump11.s: New test source file.
5827 * testsuite/arm_thm_jump11.t: New linker script.
5828 * testsuite/arm_thm_jump8.s: New test source file.
5829 * testsuite/arm_thm_jump8.t: New linker script.
5830
487b39df
ILT
58312011-06-24 Ian Lance Taylor <iant@google.com>
5832
5833 * layout.cc: Include "object.h".
5834 (ctors_sections_in_init_array): New static variable.
5835 (Layout::is_ctors_in_init_array): New function.
5836 (Layout::layout): Add entry to ctors_sections_in_init_array if
5837 appropriate.
5838 * layout.h (class Layout): Declare is_ctors_in_init_array.
5839 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
5840 is_ctors_reverse_view is set.
5841 (Sized_relobj_file::write_sections): Add layout parameter. Change
5842 all callers. Set is_ctors_reverse_view field of View_size.
5843 (Sized_relobj_file::reverse_words): New function.
5844 * object.h (Sized_relobj_file::View_size): Add
5845 is_ctors_reverse_view field.
5846 (class Sized_relobj_file): Update declarations.
5847 * testsuite/initpri3.c: New test.
5848 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
5849 initpri3b.
5850 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
5851 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
5852 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
5853 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
5854 * testsuite/Makefile.in: Rebuild.
5855
472076e4
CC
58562011-06-24 Cary Coutant <ccoutant@google.com>
5857
5858 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
5859 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
5860 (debug_msg_cdebug.err): New targets.
5861 * testsuite/Makefile.in: Regenerate.
5862 * testsuite/debug_msg.sh: Check output of link with compressed debug.
5863 Fix checks for link with shared library.
5864
a60af0db
DK
58652011-06-24 Doug Kwan <dougkwan@google.com>
5866
5867 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
5868 skip empty text sections.
5869 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
5870
5393d741
ILT
58712011-06-22 Ian Lance Taylor <iant@google.com>
5872
5873 PR gold/12910
5874 * options.h (class General_options): Add --ctors-in-init-array.
5875 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
5876 friends as SHT_PROGBITS for merging sections.
5877 (Layout::layout): Remove special handling of .init_array and
5878 friends. Don't sort if doing relocatable link. Sort for .ctors
5879 and .dtors if ctors_in_init_array.
5880 (Layout::make_output_section): Force correct section types for
5881 .init_array and friends. Don't sort if doing relocatable link,
5882 Don't sort .ctors and .dtors if ctors_in_init_array.
5883 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
5884 (Layout::output_section_name): Add relobj parameter. Change all
5885 callers. Handle .ctors. and .dtors. in code rather than table.
5886 Handle .ctors and .dtors if ctors_in_init_array.
5887 (Layout::match_file_name): New function, moved from output.cc.
5888 * layout.h (class Layout): Update declarations.
5889 * output.cc: Include "layout.h".
5890 (Input_section_sort_entry::get_priority): New function.
5891 (Input_section_sort_entry::match_file_name): Just call
5892 Layout::match_file_name.
5893 (Output_section::Input_section_sort_init_fini_compare::operator()):
5894 Handle .ctors and .dtors. Sort by explicit priority rather than
5895 by name.
5896 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
5897 * testsuite/initpri2.c: New test.
5898 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
5899 (check_PROGRAMS): Add initpri2.
5900 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
5901 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
5902 * configure, testsuite/Makefile.in: Rebuild.
5903
e1f74f98
ILT
59042011-06-19 Ian Lance Taylor <iant@google.com>
5905
5906 PR gold/12880
5907 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
5908 .interp section to a PT_INTERP segment even if we have seen a
5909 --dynamic-linker option. Don't do it if we have seen a PHDRS
5910 clause in a linker script.
5911 (Layout::finalize): Don't create a .interp section if we've
5912 already create a PT_INTERP segment.
5913 (Layout::create_interp): Always call choose_output_section (revert
5914 patch of 2011-06-17). Don't create PT_INTERP segment.
5915 * script-sections.cc
5916 (Script_sections::create_note_and_tls_segments): Add a .interp
5917 section to a PT_INTERP segment even if we have seen a
5918 --dynamic-linker option.
5919
766f91bb
ILT
59202011-06-18 Ian Lance Taylor <iant@google.com>
5921
5922 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
5923 merely because a non-PT_LOAD segment has a dynamic reloc.
5924
0d212c3a
ILT
59252011-06-18 Ian Lance Taylor <iant@google.com>
5926
5927 * layout.cc (Layout::finish_dynamic_section): Don't create
5928 DT_FLAGS entry if not needed.
5929
911a5072
ILT
59302011-06-18 Ian Lance Taylor <iant@google.com>
5931
5932 PR gold/12745
5933 * layout.cc (Layout::layout_eh_frame): Correct handling of
5934 writable .eh_frame section.
5935
534b4e5f
ILT
59362011-06-17 Ian Lance Taylor <iant@google.com>
5937
5938 PR gold/12893
5939 * resolve.cc (Symbol_table::resolve): Don't give an error if a
5940 symbol is redefined with the exact same object and value.
5941
10b4f102
ILT
59422011-06-17 Ian Lance Taylor <iant@google.com>
5943
5944 PR gold/12880
5945 * layout.h (class Layout): Add interp_segment_ field.
5946 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
5947 (Layout::attach_allocated_section_to_segment): If making shared
5948 library, put .interp section in PT_INTERP segment.
5949 (Layout::finalize): Also call create_interp if -dynamic-linker
5950 option was used.
5951 (Layout::create_interp): Assert that there is no PT_INTERP
5952 segment. If not using a SECTIONS clause, use make_output_section.
5953 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
5954 * script-sections.cc
5955 (Script_sections::create_note_and_tls_segments): If making shared
5956 library, put .interp section in PT_INTERP segment.
5957
a29b0dad
ILT
59582011-06-17 Ian Lance Taylor <iant@google.com>
5959
e588ea8d
ILT
5960 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
5961 when making a shared library.
5962
59632011-06-17 Ian Lance Taylor <iant@google.com>
5964
5965 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
5966 parameter. Change all callers. Don't issue warning about PC32
5967 against locally defined symbol.
a29b0dad 5968
9d3b0698
ILT
59692011-06-16 Ian Lance Taylor <iant@google.com>
5970
5971 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
5972 occurs in same object.
5973
85b0f90c
AM
59742011-06-14 Alan Modra <amodra@gmail.com>
5975
5976 * po/POTFILES.in: Regenerate.
5977
a94907d9
ILT
59782011-06-09 Ian Lance Taylor <iant@google.com>
5979
5980 * script-sections.cc
5981 (Orphan_output_section::set_section_addresses): For a relocatable
5982 link set address to 0.
5983
4fb3a1c3
CC
59842011-06-09 Cary Coutant <ccoutant@google.com>
5985
5986 PR gold/12804
5987 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
5988 used with --compress-debug-sections.
5989 * gold/object.cc (Sized_relobj_file::do_layout): Report
5990 uncompressed size of compressed input sections.
5991
61220854
CC
59922011-06-08 Cary Coutant <ccoutant@google.com>
5993
5994 PR gold/12804
5995 * testsuite/two_file_test_2_v1.cc: Change initialization of
5996 v2 to keep it in .data.
5997
e6455dfb
CC
59982011-06-07 Cary Coutant <ccoutant@google.com>
5999
6000 * common.cc (Symbol_table::do_allocate_commons_list): Call
6001 gold_fallback.
6002 * errors.cc (Errors::fatal): Adjust call to gold_exit.
6003 (Errors::fallback): New function.
6004 (gold_fallback): New function.
6005 * errors.h (Errors::fallback): New function.
6006 * gold.cc (gold_exit): Change status parameter to enum; adjust
6007 all callers.
6008 (queue_initial_tasks): Call gold_fallback.
6009 * gold.h: Include cstdlib.
6010 (Exit_status): New enum type.
6011 (gold_exit): Change status parameter to enum.
6012 (gold_fallback): New function.
6013 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
6014 (Layout::create_symtab_sections): Likewise.
6015 (Layout::create_shdrs): Likewise.
6016 * main.cc (main): Adjust call to gold_exit.
6017 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
6018 (Output_data_got::add_got_entry_pair): Likewise.
6019 (Output_section::add_input_section): Likewise.
6020 (Output_section::add_output_section_data): Likewise.
6021 (Output_segment::set_section_list_addresses): Likewise.
6022 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
6023
fb0e076f
CC
60242011-06-07 Cary Coutant <ccoutant@google.com>
6025
6026 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
6027 for incremental links.
6028 * output.cc (Output_segment::set_section_list_addresses): Remove
6029 FIXME and test for TLS or BSS.
6030
a5ee4d5d
CC
60312011-06-07 Cary Coutant <ccoutant@google.com>
6032
6033 * testsuite/Makefile.am: Add incremental_copy_test,
6034 incremental_common_test_1.
6035 * testsuite/Makefile.in: Regenerate.
6036 * testsuite/common_test_1_v1.c: New source file.
6037 * testsuite/common_test_1_v2.c: New source file.
6038 * testsuite/copy_test_v1.cc: New source file.
6039
5146f448
CC
60402011-06-07 Cary Coutant <ccoutant@google.com>
6041
6042 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
6043 update, allocate common from bss section's free list.
6044 * incremental-dump.cc (dump_incremental_inputs): Print flag for
6045 linker-defined symbols.
6046 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
6047 Skip GOT and PLT entries that are no longer referenced.
6048 (Output_section_incremental_inputs::write_info_blocks): Mark
6049 linker-defined symbols.
6050 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
6051 * output.cc (Output_section::allocate): New function.
6052 * output.h (Output_section::allocate): New function.
6053 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
6054 linker-defined symbols.
6055 (Symbol::override_base_with_special): Copy is_predefined_ flag.
6056 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
6057 (Symbol::init_base_output_data): Likewise.
6058 (Symbol::init_base_output_segment): Likewise.
6059 (Symbol::init_base_constant): Likewise.
6060 (Sized_symbol::init_output_data): Likewise.
6061 (Sized_symbol::init_output_segment): Likewise.
6062 (Sized_symbol::init_constant): Likewise.
6063 (Symbol_table::do_define_in_output_data): Likewise.
6064 (Symbol_table::do_define_in_output_segment): Likewise.
6065 (Symbol_table::do_define_as_constant): Likewise.
6066 * symtab.h (Symbol::is_predefined): New function.
6067 (Symbol::init_base_output_data): Add is_predefined parameter.
6068 (Symbol::init_base_output_segment): Likewise.
6069 (Symbol::init_base_constant): Likewise.
6070 (Symbol::is_predefined_): New data member.
6071 (Sized_symbol::init_output_data): Add is_predefined parameter.
6072 (Sized_symbol::init_output_segment): Likewise.
6073 (Sized_symbol::init_constant): Likewise.
6074 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
6075
26d3c67d
CC
60762011-06-07 Cary Coutant <ccoutant@google.com>
6077
6078 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
6079 instead of emit_copy_reloc.
6080 (Copy_relocs::emit_copy_reloc): Refactor.
6081 (Copy_relocs::make_copy_reloc): New function.
6082 (Copy_relocs::add_copy_reloc): Remove.
6083 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
6084 section.
6085 (Copy_relocs::make_copy_reloc): New function.
6086 (Copy_relocs::add_copy_reloc): Remove.
6087 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
6088 unchanged input files.
6089 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
6090 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
6091 Reserve BSS space for COPY relocations.
6092 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6093 (Output_section_incremental_inputs::write_info_blocks): Record
6094 whether a symbol is copied from a shared object.
6095 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
6096 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
6097 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
6098 (Incremental_input_entry_reader::get_output_symbol_index): Add
6099 is_copy parameter.
6100 (Incremental_binary::emit_copy_relocs): New function.
6101 (Incremental_binary::do_emit_copy_relocs): New function.
6102 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6103 new data member.
6104 (Sized_incremental_binary::add_copy_reloc): New function.
6105 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6106 (Sized_incremental_binary::Copy_reloc): New struct.
6107 (Sized_incremental_binary::Copy_relocs): New typedef.
6108 (Sized_incremental_binary::copy_relocs_): New data member.
6109 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
6110 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
6111 * target.h (Sized_target::emit_copy_reloc): New function.
6112 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
6113
7cdb37d9
CC
61142011-06-02 Cary Coutant <ccoutant@google.com>
6115
6116 PR gold/12163
6117 * gold/archive.cc (Archive::Archive): Initialize new data member.
6118 (Archive::include_all_members): Return if archive has already been
6119 included.
6120 * gold/archive.h (Archive::include_all_members_): New data member.
6121
cc643b88
NC
61222011-06-02 Nick Clifton <nickc@redhat.com>
6123
6124 * dynobj.h: Fix spelling mistake in comment.
6125 * output.cc: Likewise.
6126
f62a3ca7 61272011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 6128 Asier Llano
f62a3ca7
DK
6129
6130 PR gold/12826
cc643b88 6131 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
6132 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
6133 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
6134 redundant arm_exidx_test.so.
6135 * testsuite/Makefile.in: Regenerate.
6136 (check_SCRIPTS): Add pr12826.sh
6137 (check_DATA): Add pr12826.stdout
6138 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
6139 * testsuite/pr12826.sh: New file.
6140 * testsuite/pr12826_1.s: Ditto.
6141 * testsuite/pr12826_1.s: Ditto.
6142
8dbe1edc
ILT
61432011-05-30 Ian Lance Taylor <iant@google.com>
6144
6145 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
6146 sections.
6147
c49875be
ILT
61482011-05-29 Ian Lance Taylor <iant@google.com>
6149
6150 PR gold/12804
6151 * testsuite/Makefile.am: Use different file name for two_file_test
6152 temporary file for each incremental test.
6153 * testsuite/Makefile.in: Rebuild.
6154
69d53f7a
ILT
61552011-05-29 Ian Lance Taylor <iant@google.com>
6156
6157 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
6158 binary input file is empty.
6159
41d0ab5f
ILT
61602011-05-27 Ian Lance Taylor <iant@google.com>
6161
6162 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
6163 (ver_test_9.so): Likewise.
6164 * testsuite/Makefile.in: Rebuild.
6165
89d8a36b
CC
61662011-05-26 Cary Coutant <ccoutant@google.com>
6167
6168 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
6169 * incremental.cc (Incremental_inputs::report_input_section): Fix
6170 comment, indentation.
6171 (Incremental_inputs::report_comdat_group): New function.
6172 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6173 of data for incremental input file entry.
6174 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
6175 group count, COMDAT group signatures.
6176 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
6177 an unchanged input file.
6178 * incremental.h (Incremental_object_entry::Incremental_object_entry):
6179 Initialize new data member.
6180 (Incremental_object_entry::add_comdat_group): New function.
6181 (Incremental_object_entry::get_comdat_group_count): New function.
6182 (Incremental_object_entry::get_comdat_signature_key): New function.
6183 (Incremental_object_entry::groups_): New data member.
6184 (Incremental_inputs::report_comdat_group): New function.
6185 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
6186 data for incremental input file entry.
6187 (Incremental_input_entry_reader::get_comdat_group_count): New function.
6188 (Incremental_input_entry_reader::get_input_section): Adjust size of
6189 data for incremental input file entry.
6190 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
6191 (Incremental_input_entry_reader::get_comdat_group_signature): New
6192 function.
6193 * object.cc (Sized_relobj::include_section_group): Report kept
6194 COMDAT groups for incremental links.
6195
1706a06f
ILT
61962011-05-24 David Meyer <pdox@google.com>
6197
6198 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
6199 with name parameter. Add found_name parameter.
6200 * fileread.cc (Input_file::find_file): Adjust code accordingly.
6201 * dirsearch.h (class Dirsearch): Update declaration.
6202
a10ae760
ILT
62032011-05-24 Ian Lance Taylor <iant@google.com>
6204
6205 * archive.cc (Library_base::should_include_member): Pull in object
6206 from archive if it defines the entry symbol.
6207 * parameters.cc (Parameters::entry): New function.
6208 * parameters.h (class Parameters): Declare entry.
6209 * output.h (class Output_file_header): Remove entry_ field.
6210 * output.cc (Output_file_header::Output_file_header): Remove entry
6211 parameter. Change all callers.
6212 (Output_file_header::entry): Use parameters->entry.
6213 * gold.cc (queue_middle_tasks): Likewise.
6214 * plugin.cc (Plugin_hook::run): Likewise.
6215
aa92d6ed
CC
62162011-05-24 Cary Coutant <ccoutant@google.com>
6217
6218 * gold.cc (queue_initial_tasks): Pass incremental base filename
6219 to Output_file::open_base_file; don't print error message.
6220 * incremental-dump.cc (main): Adjust call to
6221 Output_file::open_for_modification.
6222 * incremental-dump.cc (main): Likewise.
6223 * incremental.cc (Incremental_inputs::report_command_line):
6224 Ignore --incremental-base option when comparing command lines.
6225 Ignore parameter when given as separate argument.
6226 * options.h (class General_options): Add --incremental-base.
6227 * output.cc (Output_file::Output_file):
6228 (Output_file::open_base_file): Add base_name and writable parameters;
6229 read base file into new file; print error message here.
6230 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6231 callers.
6232 * output.h (Output_file::open_for_modification): Rename to...
6233 (Output_file::open_base_file): ...this; add base_name and
6234 writable parameters; adjust all callers.
6235 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6236 callers.
6237 * testsuite/Makefile.am (incremental_test_4): Test
6238 --incremental-base.
6239 * testsuite/Makefile.in: Regenerate.
6240
2eedd706
CC
62412011-05-24 Cary Coutant <ccoutant@google.com>
6242
6243 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
6244 incremental_test_4.
6245 * testsuite/Makefile.in: Regenerate.
6246 * testsuite/two_file_test_1_v1.cc: New test source file.
6247 * testsuite/two_file_test_1b_v1.cc: New test source file.
6248 * testsuite/two_file_test_2_v1.cc: New test source file.
6249
0f1c85a6
CC
62502011-05-24 Cary Coutant <ccoutant@google.com>
6251
6252 * dynobj.h (Dynobj::do_dynobj): New function.
6253 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
6254 flag and soname for shared objects.
6255 * incremental.cc (Incremental_inputs::report_object): Make
6256 either Incremental_object_entry or Incremental_dynobj_entry; add
6257 soname to string table.
6258 (Incremental_inputs::report_input_section): Add assertion.
6259 (Output_section_incremental_inputs::set_final_data_size): Adjust
6260 type of input file entry for shared libraries; adjust size of
6261 shared library info entry.
6262 (Output_section_incremental_inputs::write_input_files): Write
6263 as_needed flag for shared libraries.
6264 (Output_section_incremental_inputs::write_info_blocks): Adjust type
6265 of input file entry for shared libraries; write soname.
6266 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
6267 soname from incremental info.
6268 * incremental.h (enum Incremental_input_flags): Add
6269 INCREMENTAL_INPUT_AS_NEEDED.
6270 (Incremental_input_entry::Incremental_input_entry): Initialize new
6271 data member.
6272 (Incremental_input_entry::set_as_needed): New function.
6273 (Incremental_input_entry::as_needed): New function.
6274 (Incremental_input_entry::do_dynobj_entry): New function.
6275 (Incremental_input_entry::as_needed_): New data member.
6276 (Incremental_object_entry::Incremental_object_entry): Don't check
6277 for shared library.
6278 (Incremental_object_entry::do_type): Likewise.
6279 (class Incremental_dynobj_entry): New class.
6280 (Incremental_input_entry_reader::as_needed): New function.
6281 (Incremental_input_entry_reader::get_soname): New function.
6282 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
6283 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
6284 size of shared library info entry.
58797674 6285 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
6286 incremental link when adding DT_NEEDED entries.
6287 * object.h (Object::Object): Initialize new data member.
6288 (Object::dynobj): New function.
6289 (Object::set_as_needed): New function.
6290 (Object::as_needed): New function.
6291 (Object::do_dynobj): New function.
6292 (Object::as_needed_): New data member.
6293
6fa2a40b
CC
62942011-05-24 Cary Coutant <ccoutant@google.com>
6295
6296 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
6297 info; adjust display of GOT entries.
6298 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6299 vector of input objects; remove file_status_.
6300 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
6301 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
6302 got_plt reader; call target hooks to reserve GOT entries.
6303 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6304 of input file info header and GOT info entry.
6305 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
6306 relocation info.
6307 (Got_plt_view_info::got_descriptor): Remove.
6308 (Got_plt_view_info::sym_index): New data member.
6309 (Got_plt_view_info::input_index): New data member.
6310 (Local_got_offset_visitor::visit): Write input file index.
6311 (Global_got_offset_visitor::visit): Write 0 for input file index.
6312 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
6313 with sym_index and input_index.
6314 (Output_section_incremental_inputs::write_got_plt): Adjust size of
6315 incremental info GOT entry; replace got_descriptor with input_index.
6316 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
6317 map from input file index to object.
6318 (Sized_relobj_incr::do_layout): Replace direct data member reference
6319 with accessor function.
6320 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
6321 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
6322 Adjust size of input file info header.
6323 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
6324 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
6325 (Incremental_input_entry_reader::get_input_section): Adjust size of
6326 input file info header.
6327 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
6328 of incremental info GOT entry.
6329 (Incremental_got_plt_reader::get_got_desc): Remove.
6330 (Incremental_got_plt_reader::get_got_symndx): New function.
6331 (Incremental_got_plt_reader::get_got_input_index): New function.
6332 (Sized_incremental_binary::Sized_incremental_binary): Remove
6333 file_status_; add input_objects_.
6334 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
6335 (Sized_incremental_binary::set_file_is_unchanged): Remove.
6336 (Sized_incremental_binary::file_is_unchanged): Remove.
6337 (Sized_incremental_binary::set_input_object): New function.
6338 (Sized_incremental_binary::input_object): New function.
6339 (Sized_incremental_binary::file_status_): Remove.
6340 (Sized_incremental_binary::input_objects_): New data member.
6341 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
6342 references.
6343 (Sized_relobj_incr::invalid_address): Move to base class.
6344 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
6345 class.
6346 (Sized_relobj_incr::do_output_section_offset): Likewise.
6347 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
6348 (Sized_relobj_incr::section_offsets_): Likewise.
6349 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
6350 function.
6351 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
6352 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
6353 with accessor function.
6354 (Sized_relobj_file::do_layout): Likewise.
6355 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
6356 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
6357 (Sized_relobj_file::compute_final_local_value): Replace refs to
6358 section_offsets_ with accessor function.
6359 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
6360 * object.h (Relobj::Relobj): Initialize new data members.
6361 (Relobj::add_dyn_reloc): New function.
6362 (Relobj::first_dyn_reloc): New function.
6363 (Relobj::dyn_reloc_count): New function.
6364 (Relobj::first_dyn_reloc_): New data member.
6365 (Relobj::dyn_reloc_count_): New data member.
6366 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
6367 references.
6368 (Sized_relobj::Address): New typedef.
6369 (Sized_relobj::invalid_address): Move here from child class.
6370 (Sized_relobj::Sized_relobj): Initialize new data members.
6371 (Sized_relobj::sized_relobj): New function.
6372 (Sized_relobj::is_output_section_offset_invalid): Move here from
6373 child class.
6374 (Sized_relobj::get_output_section_offset): Likewise.
6375 (Sized_relobj::local_has_got_offset): Likewise.
6376 (Sized_relobj::local_got_offset): Likewise.
6377 (Sized_relobj::set_local_got_offset): Likewise.
6378 (Sized_relobj::do_for_all_local_got_entries): Likewise.
6379 (Sized_relobj::clear_got_offsets): New function.
6380 (Sized_relobj::section_offsets): Move here from child class.
6381 (Sized_relobj::do_output_section_offset): Likewise.
6382 (Sized_relobj::do_set_section_offset): Likewise.
6383 (Sized_relobj::Local_got_offsets): Likewise.
6384 (Sized_relobj::local_got_offsets_): Likewise.
6385 (Sized_relobj::section_offsets_): Likewise.
6386 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
6387 references.
6388 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
6389 class.
6390 (Sized_relobj_file::sized_relobj): New function
6391 (Sized_relobj_file::local_has_got_offset): Move to base class.
6392 (Sized_relobj_file::local_got_offset): Likewise.
6393 (Sized_relobj_file::set_local_got_offset): Likewise.
6394 (Sized_relobj_file::get_output_section_offset): Likewise.
6395 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
6396 (Sized_relobj_file::do_output_section_offset): Likewise.
6397 (Sized_relobj_file::do_set_section_offset): Likewise.
6398 (Sized_relobj_file::Local_got_offsets): Likewise.
6399 (Sized_relobj_file::local_got_offsets_): Likewise.
6400 (Sized_relobj_file::section_offsets_): Likewise.
6401 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
6402 (all constructors).
6403 (set_needs_dynsym_index): Convert relobj to derived class pointer.
6404 (Output_reloc::get_symbol_index): Likewise.
6405 (Output_reloc::local_section_offset): Likewise.
6406 (Output_reloc::get_address): Likewise.
6407 (Output_reloc::symbol_value): Likewise.
6408 (Output_data_got::reserve_slot): Move to class definition.
6409 (Output_data_got::reserve_local): New function.
6410 (Output_data_got::reserve_slot_for_global): Remove.
6411 (Output_data_got::reserve_global): New function.
6412 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
6413 (all constructors, two instantiations).
6414 (Output_reloc::get_relobj): New function (two instantiations).
6415 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
6416 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
6417 (Output_data_reloc::add_global): Adjust type of relobj.
6418 (Output_data_reloc::add_global_relative): Likewise.
6419 (Output_data_reloc::add_symbolless_global_addend): Likewise.
6420 (Output_data_reloc::add_local): Likewise.
6421 (Output_data_reloc::add_local_relative): Likewise.
6422 (Output_data_reloc::add_symbolless_local_addend): Likewise.
6423 (Output_data_reloc::add_local_section): Likewise.
6424 (Output_data_reloc::add_output_section): Likewise.
6425 (Output_data_reloc::add_absolute): Likewise.
6426 (Output_data_reloc::add_target_specific): Likewise.
6427 (Output_data_got::reserve_slot): Move definition here.
6428 (Output_data_got::reserve_local): New function.
6429 (Output_data_got::reserve_global): New function.
6430 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
6431 section_offsets_ with accessor function.
6432 (Sized_relobj_file::write_sections): Likewise.
6433 (Sized_relobj_file::do_relocate_sections): Likewise.
6434 * target.h (Sized_target::reserve_local_got_entry): New function.
6435 (Sized_target::reserve_global_got_entry): New function.
6436 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
6437 (Target_x86_64::reserve_global_got_entry): New function.
6438 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
6439
4829d394
CC
64402011-05-23 Cary Coutant <ccoutant@google.com>
6441
6442 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
6443 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
6444 bit when checking got_type.
6445 * incremental.cc (Sized_incremental_binary::setup_readers):
6446 Store symbol table and string table locations; initialize bit vector
6447 of file status flags.
6448 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
6449 unchanged files.
6450 (Sized_incremental_binary::do_process_got_plt): New function.
6451 (Sized_incremental_binary::get_symtab_view): Use stored locations.
6452 (Output_section_incremental_inputs::set_final_data_size): Record
6453 file index for each input file.
6454 (Output_section_incremental_inputs::write_got_plt): Store file index
6455 instead of input entry offset for each GOT entry.
6456 * incremental.h
6457 (Incremental_input_entry::Incremental_input_entry): Initialize new
6458 data member.
6459 (Incremental_input_entry::set_offset): Store file index.
6460 (Incremental_input_entry::get_file_index): New function.
6461 (Incremental_input_entry::file_index_): New data member.
6462 (Incremental_binary::process_got_plt): New function.
6463 (Incremental_binary::do_process_got_plt): New function.
6464 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6465 data members.
6466 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
6467 (Sized_incremental_binary::set_file_is_unchanged): New function.
6468 (Sized_incremental_binary::file_is_unchanged): New function.
6469 (Sized_incremental_binary::do_process_got_plt): New function.
6470 (Sized_incremental_binary::file_status_): New data member.
6471 (Sized_incremental_binary::main_symtab_loc_): New data member.
6472 (Sized_incremental_binary::main_strtab_loc_): New data member.
6473 * output.cc (Output_data_got::Got_entry::write): Add case
6474 RESERVED_CODE.
6475 (Output_data_got::add_global): Call add_got_entry.
6476 (Output_data_got::add_global_plt): Likewise.
6477 (Output_data_got::add_global_with_rel): Likewise.
6478 (Output_data_got::add_global_with_rela): Likewise.
6479 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
6480 (Output_data_got::add_global_pair_with_rela): Likewise.
6481 (Output_data_got::add_local): Call add_got_entry.
6482 (Output_data_got::add_local_plt): Likewise.
6483 (Output_data_got::add_local_with_rel): Likewise.
6484 (Output_data_got::add_local_with_rela): Likewise.
6485 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
6486 (Output_data_got::add_local_pair_with_rela): Likewise.
6487 (Output_data_got::reserve_slot): New function.
6488 (Output_data_got::reserve_slot_for_global): New function.
6489 (Output_data_got::add_got_entry): New function.
6490 (Output_data_got::add_got_entry_pair): New function.
6491 (Output_section::add_output_section_data): Edit FIXME.
6492 * output.h
6493 (Output_section_data_build::Output_section_data_build): New
6494 constructor with size parameter.
6495 (Output_data_space::Output_data_space): Likewise.
6496 (Output_data_got::Output_data_got): Initialize new data member; new
6497 constructor with size parameter.
6498 (Output_data_got::add_constant): Call add_got_entry.
6499 (Output_data_got::reserve_slot): New function.
6500 (Output_data_got::reserve_slot_for_global): New function.
6501 (class Output_data_got::Got_entry): Add RESERVED_CODE.
6502 (Output_data_got::add_got_entry): New function.
6503 (Output_data_got::add_got_entry_pair): New function.
6504 (Output_data_got::free_list_): New data member.
6505 * target.h (Sized_target::init_got_plt_for_update): New function.
6506 (Sized_target::register_global_plt_entry): New function.
6507 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
6508 Initialize new data member; call init; add constructor with PLT count.
6509 (Output_data_plt_x86_64::init): New function.
6510 (Output_data_plt_x86_64::add_relocation): New function.
6511 (Output_data_plt_x86_64::reserve_slot): New function.
6512 (Output_data_plt_x86_64::free_list_): New data member.
6513 (Target_x86_64::init_got_plt_for_update): New function.
6514 (Target_x86_64::register_global_plt_entry): New function.
6515 (Output_data_plt_x86_64::add_entry): Allocate from free list for
6516 incremental updates.
6517 (Output_data_plt_x86_64::add_relocation): New function.
6518 * testsuite/object_unittest.cc (Object_test): Set default options.
6519
ec69d6da
ILT
65202011-05-16 Ian Lance Taylor <iant@google.com>
6521
6522 * options.h (class General_options): Make -i a synonym for -r.
6523
732e31de
ILT
65242011-05-16 Ian Lance Taylor <iant@google.com>
6525
6526 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
6527
403676b5
CC
65282011-05-10 Cary Coutant <ccoutant@google.com>
6529
6530 * object.cc (Sized_relobj::do_count_local_symbols): Check for
6531 strip_all (-s).
6532
5b7b7d6e
ILT
65332011-05-06 Ian Lance Taylor <iant@google.com>
6534
6535 * layout.cc (Layout::layout): If the output section flags change,
6536 update the ordering.
6537
f0f9babf
CC
65382011-04-25 Cary Coutant <ccoutant@google.com>
6539
6540 * incremental-dump.cc (dump_incremental_inputs): Print local
6541 symbol info for each input file.
6542 * incremental.cc
6543 (Output_section_incremental_inputs::set_final_data_size): Add local
6544 symbol info to input file entries in incremental info.
6545 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6546 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
6547 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
6548 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
6549 implementation.
6550 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
6551 (Sized_incr_relobj::do_relocate): Write the local symbols.
6552 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
6553 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
6554 Adjust size of input file header.
6555 (Incremental_inputs_reader::get_local_symbol_offset): New function.
6556 (Incremental_inputs_reader::get_local_symbol_count): New function.
6557 (Incremental_inputs_reader::get_input_section): Adjust size of input
6558 file header.
6559 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
6560 (Sized_incr_relobj::This): New typedef.
6561 (Sized_incr_relobj::sym_size): New const data member.
6562 (Sized_incr_relobj::Local_symbol): New struct.
6563 (Sized_incr_relobj::do_output_local_symbol_count): New function.
6564 (Sized_incr_relobj::do_local_symbol_offset): New function.
6565 (Sized_incr_relobj::local_symbol_count_): New data member.
6566 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
6567 (Sized_incr_relobj::local_symbol_index_): New data member.
6568 (Sized_incr_relobj::local_symbol_offset_): New data member.
6569 (Sized_incr_relobj::local_dynsym_offset_): New data member.
6570 (Sized_incr_relobj::local_symbols_): New data member.
6571 * object.h (Relobj::output_local_symbol_count): New function.
6572 (Relobj::local_symbol_offset): New function.
6573 (Relobj::do_output_local_symbol_count): New function.
6574 (Relobj::do_local_symbol_offset): New function.
6575 (Sized_relobj::do_output_local_symbol_count): New function.
6576 (Sized_relobj::do_local_symbol_offset): New function.
6577
d0a9ace3
ILT
65782011-04-22 Vladimir Simonov <sv@sw.ru>
6579
6580 * descriptors.cc (set_close_on_exec): New function.
6581 (Descriptors::open): Use set_close_on_exec.
6582 * output.cc (S_ISLNK): Define if not defined.
6583
94a3fc8b
CC
65842011-04-22 Cary Coutant <ccoutant@google.com>
6585
6586 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6587 global symbol map.
6588 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6589 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
6590 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
6591 relocations.
6592 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
6593 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
6594 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
6595 * incremental.h
6596 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
6597 function.
6598 (Incremental_binary::apply_incremental_relocs): New function.
6599 (Incremental_binary::do_apply_incremental_relocs): New function.
6600 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6601 data member.
6602 (Sized_incremental_binary::add_global_symbol): New function.
6603 (Sized_incremental_binary::global_symbol): New function.
6604 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6605 (Sized_incremental_binary::symbol_map_): New data member.
6606 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
6607 * target.h (Sized_target::apply_relocation): New function.
6608 * target-reloc.h (apply_relocation): New function.
6609 * x86_64.cc (Target_x86_64::apply_relocation): New function.
6610
c87e4302
DK
66112011-04-22 Doug Kwan <dougkwan@google.com>
6612
6613 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
6614 flag of a SHT_ARM_EXIDX section.
2e702c99 6615 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
6616 * testsuite/Makefile.in: Regenerate.
6617 * testsuite/arm_exidx_test.s: New file.
6618 * testsuite/arm_exidx_test.sh: Same.
6619
e7782cf6
CC
66202011-04-20 Cary Coutant <ccoutant@google.com>
6621
6622 PR gold/12689
6623 * archive.h (Incremental_archive_entry::Archive_member):
6624 Initialize arg_serial_ (second constructor).
6625
308ecdc7
ILT
66262011-04-17 Ian Lance Taylor <iant@google.com>
6627
6628 * object.cc (Relocate_info::location): Simplify location string.
6629 * errors.cc (Errors::error_at_location): Don't print program
6630 name.
6631 (Errors::warning_at_location): Likewise.
6632 (Errors::undefined_symbol): Likewise.
6633 * testsuite/debug_msg.sh: Update accordingly.
6634
bec5b579
CC
66352011-04-14 Cary Coutant <ccoutant@google.com>
6636
6637 * gold/layout.cc (Layout::symtab_section_offset): New function.
6638 * gold/layout.h (Layout::symtab_section_offset): New function.
6639 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
6640
88597d34
ILT
66412011-04-12 Ian Lance Taylor <iant@google.com>
6642
6643 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
6644 with MREMAP_MAYMOVE.
6645 * output.h (class Output_file): Add map_is_allocated_ field.
6646 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
6647 not available, provide stubs. If mremap is not available, #define
6648 it to gold_mremap.
6649 (MREMAP_MAYMOVE): Define if not defined.
6650 (Output_file::Output_file): Initialize map_is_allocated_.
6651 (Output_file::resize): Check map_is_allocated_.
6652 (Output_file::map_anonymous): If mmap fails, use malloc.
6653 (Output_file::unmap): Don't do anything for an anonymous map.
6654 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
6655 is not available, provide stubs.
6656 (File_read::View::~View): Use free rather than delete[].
6657 (File_read::make_view): Use malloc rather than new[]. If mmap
6658 fails, use malloc.
6659 (File_read::find_or_make_view): Use malloc rather than new[].
6660 * gold.h: Remove HAVE_REMAP code.
6661 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
6662 exists. Rename mremap to gold_mremap. If mmap is not available
6663 don't do anything.
6664 * configure, config.in: Rebuild.
6665
11e361bc
ILT
66662011-04-11 Ian Lance Taylor <iant@google.com>
6667
6668 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
6669 initialize local variable v.
6670
cdc29364
CC
66712011-04-11 Cary Coutant <ccoutant@google.com>
6672
6673 * archive.cc (Archive::include_member): Adjust call to
6674 report_object.
6675 (Add_archive_symbols::run): Track argument serial numbers.
6676 (Lib_group::include_member): Likewise.
6677 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
6678 * archive.h (Incremental_archive_entry::Archive_member):
6679 Initialize arg_serial_.
6680 (Archive_member::arg_serial_): New data member.
6681 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
6682 (Sized_dynobj::do_add_symbols): Track symbols when doing an
6683 incremental link.
6684 (Sized_dynobj::do_for_all_local_got_entries): New function.
6685 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
6686 function.
6687 * fileread.cc (get_mtime): New function.
6688 * fileread.h (get_mtime): New function.
6689 * gold.cc (queue_initial_tasks): Check for incremental update.
6690 (process_incremental_input): New function.
6691 (queue_middle_tasks): Don't force valid target for incremental
6692 update.
6693 * incremental-dump.cc (find_input_containing_global): Adjust
6694 size of symbol info entry.
6695 (dump_incremental_inputs): Dump argument serial number and
6696 in_system_directory flag; bias shndx by 1; print symbol names
6697 when dumping per-file symbol lists; use new symbol info readers.
6698 * incremental.cc
6699 (Output_section_incremental_inputs:update_data_size): New function.
6700 (Sized_incremental_binary::setup_readers): Setup input readers
6701 for each input file; build maps for files added from libraries
6702 and scripts.
6703 (Sized_incremental_binary::check_input_args): New function.
6704 (Sized_incremental_binary::do_check_inputs): Build map of argument
6705 serial numbers to input arguments.
6706 (Sized_incremental_binary::do_file_has_changed): Rename
6707 do_file_is_unchanged to this; compare file modification times.
6708 (Sized_incremental_binary::do_init_layout): New function.
6709 (Sized_incremental_binary::do_reserve_layout): New function.
6710 (Sized_incremental_binary::do_get_input_reader): Remove.
6711 (Sized_incremental_binary::get_symtab_view): New function.
6712 (Incremental_checker::can_incrementally_link_output_file): Remove.
6713 (Incremental_inputs::report_command_line): Exclude --debug options.
6714 (Incremental_inputs::report_archive_begin): Add parameter; track
6715 argument serial numbers; don't put input file entry for archive
6716 before archive members.
6717 (Incremental_inputs::report_archive_end): Put input file entry
6718 for archive after archive members.
6719 (Incremental_inputs::report_object): Add parameter; track argument
6720 serial numbers and in_system_directory flag.
6721 (Incremental_inputs::report_script): Add parameter; track argument
6722 serial numbers.
6723 (Output_section_incremental_inputs::set_final_data_size): Adjust
6724 size of symbol info entry; check for forwarding symbols.
6725 (Output_section_incremental_inputs::write_input_files): Write
6726 in_system_directory flag and argument serial number.
6727 (Output_section_incremental_inputs::write_info_blocks): Map section
6728 indices between incremental info and original input file; store
6729 input section index for each symbol.
6730 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
6731 change operator() to visit().
6732 (class Global_got_offset_visitor): Likewise.
6733 (class Global_symbol_visitor_got_plt):
6734 (Output_section_incremental_inputs::write_got_plt): Use new visitor
6735 classes.
6736 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
6737 (Sized_incr_relobj::do_read_symbols): New function.
6738 (Sized_incr_relobj::do_layout): New function.
6739 (Sized_incr_relobj::do_layout_deferred_sections): New function.
6740 (Sized_incr_relobj::do_add_symbols): New function.
6741 (Sized_incr_relobj::do_should_include_member): New function.
6742 (Sized_incr_relobj::do_for_all_global_symbols): New function.
6743 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
6744 (Sized_incr_relobj::do_section_size): New function.
6745 (Sized_incr_relobj::do_section_name): New function.
6746 (Sized_incr_relobj::do_section_contents): New function.
6747 (Sized_incr_relobj::do_section_flags): New function.
6748 (Sized_incr_relobj::do_section_entsize): New function.
6749 (Sized_incr_relobj::do_section_address): New function.
6750 (Sized_incr_relobj::do_section_type): New function.
6751 (Sized_incr_relobj::do_section_link): New function.
6752 (Sized_incr_relobj::do_section_info): New function.
6753 (Sized_incr_relobj::do_section_addralign): New function.
6754 (Sized_incr_relobj::do_initialize_xindex): New function.
6755 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
6756 (Sized_incr_relobj::do_read_relocs): New function.
6757 (Sized_incr_relobj::do_gc_process_relocs): New function.
6758 (Sized_incr_relobj::do_scan_relocs): New function.
6759 (Sized_incr_relobj::do_count_local_symbols): New function.
6760 (Sized_incr_relobj::do_finalize_local_symbols): New function.
6761 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
6762 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
6763 (Sized_incr_relobj::do_relocate): New function.
6764 (Sized_incr_relobj::do_set_section_offset): New function.
6765 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
6766 (Sized_incr_dynobj::do_read_symbols): New function.
6767 (Sized_incr_dynobj::do_layout): New function.
6768 (Sized_incr_dynobj::do_add_symbols): New function.
6769 (Sized_incr_dynobj::do_should_include_member): New function.
6770 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
6771 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
6772 (Sized_incr_dynobj::do_section_size): New function.
6773 (Sized_incr_dynobj::do_section_name): New function.
6774 (Sized_incr_dynobj::do_section_contents): New function.
6775 (Sized_incr_dynobj::do_section_flags): New function.
6776 (Sized_incr_dynobj::do_section_entsize): New function.
6777 (Sized_incr_dynobj::do_section_address): New function.
6778 (Sized_incr_dynobj::do_section_type): New function.
6779 (Sized_incr_dynobj::do_section_link): New function.
6780 (Sized_incr_dynobj::do_section_info): New function.
6781 (Sized_incr_dynobj::do_section_addralign): New function.
6782 (Sized_incr_dynobj::do_initialize_xindex): New function.
6783 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
6784 (make_sized_incremental_object): New function.
6785 (Incremental_library::copy_unused_symbols): New function.
6786 (Incremental_library::do_for_all_unused_symbols): New function.
6787 * incremental.h (enum Incremental_input_flags): New type.
6788 (class Incremental_checker): Remove.
6789 (Incremental_input_entry::Incremental_input_entry): Add argument
6790 serial number.
6791 (Incremental_input_entry::arg_serial): New function.
6792 (Incremental_input_entry::set_is_in_system_directory): New function.
6793 (Incremental_input_entry::is_in_system_directory): New function.
6794 (Incremental_input_entry::arg_serial_): New data member.
6795 (Incremental_input_entry::is_in_system_directory_): New data member.
6796 (class Script_info): Move here from script.h.
6797 (Script_info::Script_info): Add filename parameter.
6798 (Script_info::filename): New function.
6799 (Script_info::filename_): New data member.
6800 (Incremental_script_entry::Incremental_script_entry): Add argument
6801 serial number.
6802 (Incremental_object_entry::Incremental_object_entry): Likewise.
6803 (Incremental_object_entry::add_input_section): Build list of input
6804 sections with map to original shndx.
6805 (Incremental_object_entry::get_input_section_index): New function.
6806 (Incremental_object_entry::shndx_): New data member.
6807 (Incremental_object_entry::name_key_): Rename; adjust all refs.
6808 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
6809 (Incremental_archive_entry::Incremental_archive_entry): Add argument
6810 serial number.
6811 (Incremental_inputs::report_archive_begin): Likewise.
6812 (Incremental_inputs::report_object): Likewise.
6813 (Incremental_inputs::report_script): Likewise.
6814 (class Incremental_global_symbol_reader): New class.
6815 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
6816 and store flags and input file type.
6817 (Incremental_input_entry_reader::arg_serial): New function.
6818 (Incremental_input_entry_reader::type): Extract type from flags.
6819 (Incremental_input_entry_reader::is_in_system_directory): New function.
6820 (Incremental_input_entry_reader::get_input_section_count): Call
6821 accessor function for type.
6822 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
6823 function for type; adjust size of global symbol entry.
6824 (Incremental_input_entry_reader::get_global_symbol_count): Call
6825 accessor function for type.
6826 (Incremental_input_entry_reader::get_object_count): Likewise.
6827 (Incremental_input_entry_reader::get_object_offset): Likewise.
6828 (Incremental_input_entry_reader::get_member_count): Likewise.
6829 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
6830 (Incremental_input_entry_reader::get_member_offset): Likewise.
6831 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
6832 (Incremental_input_entry_reader::Global_symbol_info): Remove.
6833 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
6834 (Incremental_input_entry_reader::get_global_symbol_reader): New
6835 function.
6836 (Incremental_input_entry_reader::get_output_symbol_index): New
6837 function.
6838 (Incremental_input_entry_reader::type_): Remove.
6839 (Incremental_input_entry_reader::flags_): New data member.
6840 (Incremental_inputs_reader::input_file_offset): New function.
6841 (Incremental_inputs_reader::input_file_index): New function.
6842 (Incremental_inputs_reader::input_file): Call input_file_offset.
6843 (Incremental_inputs_reader::input_file_at_offset): New function.
6844 (Incremental_relocs_reader::get_r_type): Reformat.
6845 (Incremental_relocs_reader::get_r_shndx): Reformat.
6846 (Incremental_relocs_reader::get_r_offset): Reformat.
6847 (Incremental_relocs_reader::data): New function.
6848 (Incremental_binary::Incremental_binary): Initialize new data members.
6849 (Incremental_binary::check_inputs): Add cmdline parameter.
6850 (Incremental_binary::file_is_unchanged): Remove.
6851 (Input_reader::arg_serial): New function.
6852 (Input_reader::get_unused_symbol_count): New function.
6853 (Input_reader::get_unused_symbol): New function.
6854 (Input_reader::do_arg_serial): New function.
6855 (Input_reader::do_get_unused_symbol_count): New function.
6856 (Input_reader::do_get_unused_symbol): New function.
6857 (Incremental_binary::input_file_count): New function.
6858 (Incremental_binary::get_input_reader): Change signature to use
6859 index instead of filename.
6860 (Incremental_binary::file_has_changed): New function.
6861 (Incremental_binary::get_input_argument): New function.
6862 (Incremental_binary::get_library): New function.
6863 (Incremental_binary::get_script_info): New function.
6864 (Incremental_binary::init_layout): New function.
6865 (Incremental_binary::reserve_layout): New function.
6866 (Incremental_binary::output_file): New function.
6867 (Incremental_binary::do_check_inputs): New function.
6868 (Incremental_binary::do_file_is_unchanged): Remove.
6869 (Incremental_binary::do_file_has_changed): New function.
6870 (Incremental_binary::do_init_layout): New function.
6871 (Incremental_binary::do_reserve_layout): New function.
6872 (Incremental_binary::do_input_file_count): New function.
6873 (Incremental_binary::do_get_input_reader): Change signature.
6874 (Incremental_binary::input_args_map_): New data member.
6875 (Incremental_binary::library_map_): New data member.
6876 (Incremental_binary::script_map_): New data member.
6877 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6878 new data members.
6879 (Sized_incremental_binary::output_section): New function.
6880 (Sized_incremental_binary::inputs_reader): Add const.
6881 (Sized_incremental_binary::symtab_reader): Add const.
6882 (Sized_incremental_binary::relocs_reader): Add const.
6883 (Sized_incremental_binary::got_plt_reader): Add const.
6884 (Sized_incremental_binary::get_symtab_view): New function.
6885 (Sized_incremental_binary::Inputs_reader): New typedef.
6886 (Sized_incremental_binary::Input_entry_reader): New typedef.
6887 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
6888 (Sized_incremental_binary::do_file_is_unchanged): Remove.
6889 (Sized_incremental_binary::do_file_has_changed): New function.
6890 (Sized_incremental_binary::do_init_layout): New function.
6891 (Sized_incremental_binary::do_reserve_layout): New function.
6892 (Sized_input_reader::Inputs_reader): Remove.
6893 (Sized_input_reader::Input_entry_reader): Remove.
6894 (Sized_input_reader::do_arg_serial): New function.
6895 (Sized_input_reader::do_get_unused_symbol_count): New function.
6896 (Sized_input_reader::do_get_unused_symbol): New function.
6897 (Sized_incremental_binary::do_input_file_count): New function.
6898 (Sized_incremental_binary::do_get_input_reader): Change signature;
6899 use index instead of filename.
6900 (Sized_incremental_binary::section_map_): New data member.
6901 (Sized_incremental_binary::input_entry_readers_): New data member.
6902 (class Sized_incr_relobj): New class.
6903 (class Sized_incr_dynobj): New class.
6904 (make_sized_incremental_object): New function.
6905 (class Incremental_library): New class.
6906 * layout.cc (Free_list::num_lists): New static data member.
6907 (Free_list::num_nodes): New static data member.
6908 (Free_list::num_removes): New static data member.
6909 (Free_list::num_remove_visits): New static data member.
6910 (Free_list::num_allocates): New static data member.
6911 (Free_list::num_allocate_visits): New static data member.
6912 (Free_list::init): New function.
6913 (Free_list::remove): New function.
6914 (Free_list::allocate): New function.
6915 (Free_list::dump): New function.
6916 (Free_list::print_stats): New function.
6917 (Layout_task_runner::run): Resize output file for incremental updates.
6918 (Layout::Layout): Initialize new data members.
6919 (Layout::set_incremental_base): New function.
6920 (Layout::init_fixed_output_section): New function.
6921 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
6922 incremental updates.
6923 (Layout::create_gold_note): Do not create gold note section for
6924 incremental updates.
6925 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
6926 for incremental updates.
6927 (Layout::set_section_offsets): For incremental updates, allocate space
6928 from free list.
6929 (Layout::create_symtab_sections): Layout with offsets relative to
6930 start of section; for incremental updates, allocate space from free
6931 list.
6932 (Layout::create_shdrs): For incremental updates, allocate space from
6933 free list.
6934 (Layout::finish_dynamic_section): For incremental updates, do not
6935 check --as-needed (fixed in subsequent patch).
6936 * layout.h (class Free_list): New class.
6937 (Layout::set_incremental_base): New function.
6938 (Layout::incremental_base): New function.
6939 (Layout::init_fixed_output_section): New function.
6940 (Layout::allocate): New function.
6941 (Layout::incremental_base_): New data member.
6942 (Layout::free_list_): New data member.
6943 * main.cc (main): Print Free_list statistics.
6944 * object.cc (Relobj::finalize_incremental_relocs): Add
6945 clear_counts parameter; clear counts only when clear_counts is set.
6946 (Sized_relobj::Sized_relobj): Initialize new base class.
6947 (Sized_relobj::do_layout): Don't report special sections.
6948 (Sized_relobj::do_for_all_local_got_entries): New function.
6949 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
6950 symtab_off to all symbol table offsets.
6951 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
6952 * object.h (class Got_offset_list): Move to top of file.
6953 (Object::Object): Allow case where input_file == NULL.
6954 (Object::~Object): Likewise.
6955 (Object::input_file): Assert that input_file != NULL.
6956 (Object::lock): Allow case where input_file == NULL.
6957 (Object::unlock): Likewise.
6958 (Object::is_locked): Likewise.
6959 (Object::token): Likewise.
6960 (Object::release): Likewise.
6961 (Object::is_incremental): New function.
6962 (Object::get_mtime): New function.
6963 (Object::for_all_local_got_entries): New function.
6964 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
6965 (Object::set_is_in_system_directory): New function.
6966 (Object::is_in_system_directory): New function.
6967 (Object::do_is_incremental): New function.
6968 (Object::do_get_mtime): New function.
6969 (Object::do_for_all_local_got_entries): New function.
6970 (Object::is_in_system_directory_): New data member.
6971 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
6972 (class Sized_relobj_base): New class.
6973 (class Sized_relobj): Derive from Sized_relobj_base.
6974 (class Sized_relobj::Symbols): Redeclare from base class.
6975 (class Sized_relobj::local_got_offset_list): Remove.
6976 (class Sized_relobj::Output_sections): Redeclare from base class.
6977 (class Sized_relobj::do_for_all_local_got_entries): New function.
6978 (class Sized_relobj::write_local_symbols): Add offset parameter.
6979 (class Sized_relobj::local_symbol_offset_): Update comment.
6980 (class Sized_relobj::local_dynsym_offset_): Update comment.
6981 * options.cc (Input_arguments::add_file): Remove const.
6982 * options.h (Input_file_argument::Input_file_argument):
6983 Initialize arg_serial_ (all constructors).
6984 (Input_file_argument::set_arg_serial): New function.
6985 (Input_file_argument::arg_serial): New function.
6986 (Input_file_argument::arg_serial_): New data member.
6987 (Input_arguments::Input_arguments): Initialize file_count_.
6988 (Input_arguments::add_file): Remove const.
6989 (Input_arguments::number_of_input_files): New function.
6990 (Input_arguments::file_count_): New data member.
6991 (Command_line::number_of_input_files): Call
6992 Input_arguments::number_of_input_files.
6993 * output.cc (Output_segment_headers::Output_segment_headers):
6994 Set current size.
6995 (Output_section::Input_section::current_data_size): New function.
6996 (Output_section::Output_section): Initialize new data members.
6997 (Output_section::add_input_section): Don't do merge sections for
6998 an incremental link; allocate space from free list for an
6999 incremental update.
7000 (Output_section::add_output_section_data): Allocate space from
7001 free list for an incremental update.
7002 (Output_section::update_data_size): New function.
7003 (Output_section::set_fixed_layout): New function.
7004 (Output_section::reserve): New function.
7005 (Output_segment::set_section_addresses): Remove const.
7006 (Output_segment::set_section_list_addresses): Remove const; allocate
7007 space from free list for an incremental update.
7008 (Output_segment::set_offset): Adjust size of RELRO segment for an
7009 incremental update.
7010 * output.h (Output_data::current_data_size): Move here from
7011 child classes.
7012 (Output_data::pre_finalize_data_size): New function.
7013 (Output_data::update_data_size): New function.
7014 (Output_section_headers::update_data_size): new function.
7015 (Output_section_data_build::current_data_size): Move to Output_data.
7016 (Output_data_strtab::update_data_size): New function.
7017 (Output_section::current_data_size): Move to Output_data.
7018 (Output_section::set_fixed_layout): New function.
7019 (Output_section::has_fixed_layout): New function.
7020 (Output_section::reserve): New function.
7021 (Output_section::update_data_size): New function.
7022 (Output_section::has_fixed_layout_): New data member.
7023 (Output_section::free_list_): New data member.
7024 (Output_segment::set_section_addresses): Remove const.
7025 (Output_segment::set_section_list_addresses): Remove const.
7026 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
7027 New function.
7028 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
7029 New function.
7030 * readsyms.cc (Read_symbols::do_read_symbols): Add library
7031 parameter when calling Add_symbols constructor; store argument
7032 serial number for members of a lib group.
7033 (Add_symbols::locks): Allow case where token == NULL.
7034 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
7035 (Read_member::~Read_member): New function.
7036 (Read_member::is_runnable): New function.
7037 (Read_member::locks): New function.
7038 (Read_member::run): New function.
7039 (Check_script::~Check_script): New function.
7040 (Check_script::is_runnable): New function.
7041 (Check_script::locks): New function.
7042 (Check_script::run): New function.
7043 (Check_library::~Check_library): New function.
7044 (Check_library::is_runnable): New function.
7045 (Check_library::locks): New function.
7046 (Check_library::run): New function.
7047 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
7048 (Add_symbols::library_): New data member.
7049 (class Read_member): New class.
7050 (class Check_script): New class.
7051 (class Check_library): New class.
7052 * reloc.cc (Read_relocs::is_runnable): Allow case where
7053 token == NULL.
7054 (Read_relocs::locks): Likewise.
7055 (Scan_relocs::locks): Likewise.
7056 (Relocate_task::locks): Likewise.
7057 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
7058 to clear counters.
7059 (Sized_relobj::incremental_relocs_scan): Fix comment.
7060 (Sized_relobj::do_relocate): Pass output file offset to
7061 write_local_symbols.
7062 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
7063 from class declaration.
7064 * script.cc (read_input_script): Allocate Script_info; pass
7065 argument serial number to report_script.
7066 * script.h (class Script_info): Move to incremental.h.
7067 * symtab.cc (Symbol_table::add_from_incrobj): New function.
7068 * symtab.h (Symbol_table::add_from_incrobj): New function.
7069 (Symbol_table::set_file_offset): New function.
7070
b961d0d7
CC
70712011-04-05 Cary Coutant <ccoutant@google.com>
7072
7073 * incremental-dump.cc (dump_incremental_inputs): Change signature
7074 to take a Sized_incremental_binary; change caller. Use readers
7075 in Sized_incremental_binary.
7076 * incremental.cc
7077 (Sized_incremental_binary::find_incremental_inputs_sections):
7078 Rename do_find_incremental_inputs_sections to this.
7079 (Sized_incremental_binary::setup_readers): New function.
7080 (Sized_incremental_binary::do_check_inputs): Check
7081 has_incremental_info_ flag; move setup code to setup_readers;
7082 use input readers.
7083 (Sized_incremental_binary::do_file_is_unchanged): New function.
7084 (Sized_incremental_binary::do_get_input_reader): New function.
7085 * incremental.h (class Incremental_binary): Move to end of file.
7086 (Incremental_binary::file_is_unchanged): New function.
7087 (Incremental_binary::do_file_is_unchanged): New function.
7088 (Incremental_binary::Input_reader): New class.
7089 (Incremental_binary::get_input_reader): New function.
7090 (class Sized_incremental_binary): Move to end of file.
7091 (Sized_incremental_binary::Sized_incremental_binary): Setup the
7092 input section reader classes.
7093 (Sized_incremental_binary::has_incremental_info): New function.
7094 (Sized_incremental_binary::inputs_reader): New function.
7095 (Sized_incremental_binary::symtab_reader): New function.
7096 (Sized_incremental_binary::relocs_reader): New function.
7097 (Sized_incremental_binary::got_plt_reader): New function.
7098 (Sized_incremental_binary::do_file_is_unchanged): New function.
7099 (Sized_incremental_binary::Sized_input_reader): New class.
7100 (Sized_incremental_binary::get_input_reader): New function.
7101 (Sized_incremental_binary::find_incremental_inputs_sections):
7102 Rename do_find_incremental_inputs_sections to this.
7103 (Sized_incremental_binary::setup_readers): New function.
7104 (Sized_incremental_binary::has_incremental_info_): New data member.
7105 (Sized_incremental_binary::inputs_reader_): New data member.
7106 (Sized_incremental_binary::symtab_reader_): New data member.
7107 (Sized_incremental_binary::relocs_reader_): New data member.
7108 (Sized_incremental_binary::got_plt_reader_): New data member.
7109 (Sized_incremental_binary::current_input_file_): New data member.
7110
a869183f
PP
71112011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
7112
7113 PR gold/12640
7114 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
7115 violation.
7116
71172011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
7118
7119 * archive.cc (Archive::include_member): Adjust call to report_object.
7120 (Add_archive_symbols::run): Add script_info to call to
7121 report_archive_begin.
7122 (Lib_group::include_member): Adjust call to report_object.
7123 (Add_lib_group_symbols::run): Adjust call to report_object.
7124 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
7125 blocks. Add object count for script input files.
7126 * incremental.cc (Incremental_inputs::report_archive_begin): Add
7127 script_info parameter; change all callers.
7128 (Incremental_inputs::report_object): Add script_info parameter;
7129 change all callers.
7130 (Incremental_inputs::report_script): Store backpointer to
7131 incremental info entry.
7132 (Output_section_incremental_inputs::set_final_data_size): Record
7133 additional information for scripts.
7134 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7135 * incremental.h (Incremental_script_entry::add_object): New function.
7136 (Incremental_script_entry::get_object_count): New function.
7137 (Incremental_script_entry::get_object): New function.
7138 (Incremental_script_entry::objects_): New data member; adjust
7139 constructor.
7140 (Incremental_inputs::report_archive_begin): Add script_info parameter.
7141 (Incremental_inputs::report_object): Add script_info parameter.
7142 (Incremental_inputs_reader::get_object_count): New function.
7143 (Incremental_inputs_reader::get_object_offset): New function.
7144 * options.cc (Input_arguments::add_file): Return reference to
7145 new input argument.
7146 * options.h (Input_argument::set_script_info): New function.
7147 (Input_argument::script_info): New function.
7148 (Input_argument::script_info_): New data member; adjust all
7149 constructors.
7150 (Input_file_group::add_file): Return reference to new input argument.
7151 (Input_file_lib::add_file): Likewise.
7152 (Input_arguments::add_file): Likewise.
7153 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
7154 * script.cc (Parser_closure::Parser_closure): Add script_info
7155 parameter; adjust all callers.
7156 (Parser_closure::script_info): New function.
7157 (Parser_closure::script_info_): New data member.
7158 (read_input_script): Report scripts earlier to incremental info.
7159 (script_add_file): Set script_info in Input_argument.
7160 (script_add_library): Likewise.
7161 * script.h (Script_options::Script_info): Rewrite class.
7162
a869183f 71632011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
7164
7165 * archive.cc (Library_base::should_include_member): Move
7166 method here from class Archive.
7167 (Archive::Archive): Initialize base class.
7168 (Archive::should_include_member): Move to base class.
7169 (Archive::do_for_all_unused_symbols): New function.
7170 (Add_archive_symbols::run): Remove redundant access to
7171 incremental_inputs.
7172 (Lib_group::Lib_group): Initialize base class.
7173 (Lib_group::do_filename): New function.
7174 (Lib_group::include_member): Pass pointer to Lib_group to
7175 report_object.
7176 (Lib_group::do_for_all_unused_symbols): New function.
7177 (Add_lib_group_symbols::run): Report archive information for
7178 incremental links.
7179 * archive.h (class Library_base): New base class.
7180 (class Archive): Derive from Library_base.
7181 (Archive::filename): Move to base class.
7182 (Archive::set_incremental_info): Likewise.
7183 (Archive::incremental_info): Likewise.
7184 (Archive::Should_include): Likewise.
7185 (Archive::should_include_member): Likewise.
7186 (Archive::Armap_entry): Remove.
7187 (Archive::Unused_symbol_iterator): Remove.
7188 (Archive::unused_symbols_begin): Remove.
7189 (Archive::unused_symbols_end): Remove.
7190 (Archive::do_filename): New function.
7191 (Archive::do_get_mtime): New function.
7192 (Archive::do_for_all_unused_symbols): New function.
7193 (Archive::task_): Move to base class.
7194 (Archive::incremental_info_): Likewise.
7195 (class Lib_group): Derive from Library_base.
7196 (Lib_group::do_filename): New function.
7197 (Lib_group::do_get_mtime): New function.
7198 (Lib_group::do_for_all_unused_symbols): New function.
7199 (Lib_group::task_): Move to base class.
7200 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
7201 function.
7202 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
7203 function.
7204 * incremental.cc (Incremental_inputs::report_archive_begin):
7205 Use Library_base; call library's get_mtime; add incremental inputs
7206 entry before members.
7207 (class Unused_symbol_visitor): New class.
7208 (Incremental_inputs::report_archive_end): Use Library_base; use
7209 visitor class to record unused symbols; don't add incremental inputs
7210 entry after members.
7211 (Incremental_inputs::report_object): Use Library_base.
7212 * incremental.h
7213 (Incremental_archive_entry::Incremental_archive_entry): Remove
7214 unused Archive parameter.
7215 (Incremental_inputs::report_archive_begin): Use Library_base.
7216 (Incremental_inputs::report_archive_end): Likewise.
7217 (Incremental_inputs::report_object): Likewise.
7218 * object.cc (Sized_relobj::do_for_all_global_symbols): New
7219 function.
7220 * object.h (Object::for_all_global_symbols): New function.
7221 (Object::do_for_all_global_symbols): New function.
7222 (Sized_relobj::do_for_all_global_symbols): New function.
7223 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
7224 function.
7225 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
7226 function.
7227
61ab3e40
ILT
72282011-03-27 Ian Lance Taylor <iant@google.com>
7229
7230 * archive.cc (Archive::interpret_header): Return -1 if something
7231 goes wrong. Change callers accordingly.
7232
30e1f9e6
CC
72332011-03-25 Cary Coutant <ccoutant@google.com>
7234
7235 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
7236 * testsuite/Makefile.in: Regenerate.
7237
9370ce59 72382011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
7239
7240 * plugin.cc (get_view): New.
7241 (Plugin::load): Pass get_view to the plugin.
7242 (Plugin_manager::get_view): New.
7243
9312bb0a
ILT
72442011-03-21 Ian Lance Taylor <iant@google.com>
7245
7246 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 7247 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 7248
7e12ba9e
ST
72492011-03-21 Sriraman Tallam <tmsriram@google.com>
7250
7251 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
7252 Change == to -eq.
7253 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
7254 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
7255 Change == to -eq.
7256 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
7257 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
7258
fd7a005d
ILT
72592011-03-14 Ian Lance Taylor <iant@google.com>
7260
7261 * script-sections.cc (Sort_output_sections::script_compare):
7262 Rename from is_before, change return type.
7263 (Sort_output_sections::operator()): Adjust accordingly.
7264
ed16fd1b
ILT
72652011-03-11 Jeffrey Yasskin <jyasskin@google.com>
7266
7267 PR gold/12572
7268 * testsuite/odr_violation2.cc: Add comment to make all error line
7269 numbers double digits.
7270 * testsuite/debug_msg.sh: Adjust expected errors.
7271
71ff8986
ILT
72722011-03-09 Jeffrey Yasskin <jyasskin@google.com>
7273
7274 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
7275 but mark earlier ones as non-canonical
7276 (offset_to_iterator): Update search target and example
7277 (do_addr2line): Return extra lines in a vector*
7278 (format_file_lineno): Extract from do_addr2line
7279 (one_addr2line): Add vector* out-param
7280 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
7281 when a lineno entry appeared last for its instruction
7282 (Dwarf_line_info): Add vector* out-param
7283 * object.cc (Relocate_info): Pass NULL for the vector* out-param
7284 * symtab.cc (Odr_violation_compare): Include the lineno in the
7285 comparison again.
7286 (linenos_from_loc): New. Combine the canonical line for an
7287 address with its other lines.
7288 (True_if_intersect): New. Helper functor to make
7289 std::set_intersection a query.
7290 (detect_odr_violations): Compare sets of lines instead of just
7291 one line for each function. This became less deterministic, but
7292 has fewer false positives.
7293 * symtab.h: Declarations.
7294 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
7295 mix an optimized and non-optimized object in the same binary
7296 (odr_violation2.so): Same.
7297 * testsuite/Makefile.in: Regenerate from Makefile.am.
7298 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
7299 * testsuite/debug_msg.sh: Update line numbers and add
7300 assertions.
7301 * testsuite/odr_violation1.cc: Use OdrDerived, in a
7302 non-optimized context.
7303 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
7304 isn't inlined, and use OdrDerived in an optimized context.
7305 * testsuite/odr_header1.h: Defines OdrDerived, where
7306 optimization will change the
7307 first-instruction-in-the-destructor's file and line number.
7308 * testsuite/odr_header2.h: Defines OdrBase.
7309
a19fefdc
ILT
73102011-03-09 Ian Lance Taylor <iant@google.com>
7311
7312 * fileread.cc (File_read::clear_views): Don't delete the whole
7313 file view.
7314
ecb351e9
ILT
73152011-03-08 Ian Lance Taylor <iant@google.com>
7316
7317 PR gold/12525
7318 * fileread.cc: #include <climits>.
7319 (GOLD_IOV_MAX): Define.
7320 (File_read::read_multiple): Limit number of entries by iov_max.
7321 * fileread.h (class File_read): Always set max_readv_entries to
7322 128.
7323
b821d13c
ILT
73242011-03-07 Ian Lance Taylor <iant@google.com>
7325
7326 PR gold/12525
7327 * options.h (class General_options): Add -dy and -dn.
7328
89243142
CC
73292011-03-02 Cary Coutant <ccoutant@google.com>
7330
7331 * testsuite/script_test_9.t: Add TLS segment.
7332
d0773f31
ILT
73332011-03-02 Simon Baldwin <simonb@google.com>
7334
7335 * configure.ac: Add check for gnu_indirect_function support in
7336 the toolchain building binutils.
7337 * configure: Rebuild.
7338
9370ce59 73392011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
7340
7341 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
7342 plugin only symbols.
7343 (Symbol_table::sized_finalize_symbol) Mark symbol only present
7344 in plugin files as not needed in the symbol table.
7345
4cf7a849
ST
73462011-02-11 Sriraman Tallam <tmsriram@google.com>
7347
7348 * output.cc (Output_section::add_input_section): Delay fill
7349 generation for section ordering.
7350
b578bd7d
ILT
73512011-02-09 Ian Lance Taylor <iant@google.com>
7352
7353 PR gold/12316
7354 * object.h (class Sized_relobj): Remove clear_local_symbols.
7355 * reloc.cc (Sized_relobj::do_relocate): Don't call
7356 clear_local_symbols.
7357
9370ce59 73582011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
7359
7360 * plugin.cc (is_visible_from_outside): Return true for symbols
7361 in the -u option.
7362
55382fb7
ILT
73632011-02-04 Jeffrey Yasskin <jyasskin@google.com>
7364
7365 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
7366 filename.
7367
4e271fff
ST
73682011-02-02 Sriraman Tallam <tmsriram@google.com>
7369
7370 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 7371 to std::string.
4e271fff 7372 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 7373 section_name to be std::string.
4e271fff
ST
7374 (is_function_ctor_or_dtor): Change type of parameter to std::string.
7375
d433c3ac
ILT
73762011-01-25 Ian Lance Taylor <iant@google.com>
7377
7378 * script.cc (script_add_extern): Rewrite to use
7379 add_symbol_reference.
7380
880473a6
DK
73812011-01-25 Doug Kwan <dougkwan@google.com>
7382
d433c3ac 7383 * icf.cc (get_section_contents): Always lock section's object.
880473a6 7384
f30f86fa
ILT
73852011-01-24 Ian Lance Taylor <iant@google.com>
7386
7387 * options.h (class General_options): Accept
7388 --no-detect-odr-violations.
7389
8e51a0b9
ILT
73902011-01-24 Ian Lance Taylor <iant@google.com>
7391
7392 * version.cc (version_string): Bump to 1.11.
7393
0f3b89d8
ILT
73942011-01-24 Ian Lance Taylor <iant@google.com>
7395
7396 * plugin.cc (class Plugin_rescan): Define new class.
7397 (Plugin_manager::claim_file): Set any_claimed_.
7398 (Plugin_manager::save_archive): New function.
7399 (Plugin_manager::save_input_group): New function.
7400 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
7401 necessary.
7402 (Plugin_manager::new_undefined_symbol): New function.
7403 (Plugin_manager::rescan): New function.
7404 (Plugin_manager::rescannable_defines): New function.
7405 (Plugin_manager::add_input_file): Set any_added_.
7406 * plugin.h (class Plugin_manager): define new fields rescannable_,
7407 undefined_symbols_, any_claimed_, and any_added_. Declare
7408 Plugin_rescan as friend. Declare new functions.
7409 (Plugin_manager::Rescannable): Define type.
7410 (Plugin_manager::Rescannable_list): Define type.
7411 (Plugin_manager::Undefined_symbol_list): Define type.
7412 (Plugin_manager::Plugin_manager): Initialize new fields.
7413 * archive.cc (Archive::defines_symbol): New function.
7414 (Add_archive_symbols::run): Pass archive to plugins if any.
7415 * archive.h (class Archive): Declare defines_symbol.
7416 * readsyms.cc (Input_group::~Input_group): New function.
7417 (Finish_group::run): Pass input_group to plugins if any.
7418 * readsyms.h (class Input_group): Declare destructor.
7419 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
7420 any.
7421
3bb951e5
ILT
74222011-01-10 Ian Lance Taylor <iant@google.com>
7423
7424 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
7425 section as relro.
7426 (Layout::set_segment_offsets): Reset increase_relro before calling
7427 set_section_addresses a second time.
7428
0aa45fac
CC
74292011-01-04 Cary Coutant <ccoutant@google.com>
7430
7431 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
7432 sections before NOBITS sections.
7433
0db46eb4
L
74342011-01-01 H.J. Lu <hongjiu.lu@intel.com>
7435
7436 * version.cc (print_version): Update copyright to 2011.
7437
829c9745
CC
74382010-12-23 Cary Coutant <ccoutant@google.com>
7439
7440 * output.h (Output_data_reloc::add_output_section): Pass OD instead
7441 of OS to this->add. Add OD parameter to second form of the function.
7442
7500420b
ILT
74432010-12-20 Ian Lance Taylor <iant@google.com>
7444
7445 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
7446 second of two consecutive entries with same offset.
7447
f8e9a930
RW
74482010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7449
7450 * testsuite/Makefile.am (ifuncmain2static_LDADD)
7451 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
7452 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
7453 to avoid unneeded links against $(LDADD).
7454 * testsuite/Makefile.in: Regenerate.
7455
2fbb4320
ILT
74562010-12-15 Ian Lance Taylor <iant@google.com>
7457
7458 PR gold/12324
7459 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
7460 for R_X86_64_32 and R_X86_64_PC32.
7461 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
7462 ver_matching_def_pic.o.
7463 (ver_matching_def_pic.o): New target.
7464
fedb228d
RW
74652010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7466
7467 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
7468 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
7469 Move definition before File_read::View member definitions.
7470 (File_read::View::~View): Initialize and hold lock before
7471 updating current_mapped_bytes.
7472
9b547ce6
RW
74732010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7474
7475 * dwarf_reader.cc: Remove outdated comment.
7476 * gold-threads.cc: Fix typo in error message.
7477 * archive.cc: Fix typos in comments.
7478 * archive.h: Likewise.
7479 * arm-reloc-property.cc: Likewise.
7480 * arm-reloc-property.h: Likewise.
7481 * arm-reloc.def: Likewise.
7482 * arm.cc: Likewise.
7483 * attributes.h: Likewise.
7484 * cref.cc: Likewise.
7485 * ehframe.cc: Likewise.
7486 * fileread.h: Likewise.
7487 * gold.h: Likewise.
7488 * i386.cc: Likewise.
7489 * icf.cc: Likewise.
7490 * incremental.h: Likewise.
7491 * int_encoding.cc: Likewise.
7492 * layout.h: Likewise.
7493 * main.cc: Likewise.
7494 * merge.h: Likewise.
7495 * object.cc: Likewise.
7496 * object.h: Likewise.
7497 * options.cc: Likewise.
7498 * readsyms.cc: Likewise.
7499 * reduced_debug_output.cc: Likewise.
7500 * reloc.cc: Likewise.
7501 * script-sections.cc: Likewise.
7502 * sparc.cc: Likewise.
7503 * symtab.h: Likewise.
7504 * target-reloc.h: Likewise.
7505 * target.cc: Likewise.
7506 * target.h: Likewise.
7507 * timer.cc: Likewise.
7508 * timer.h: Likewise.
7509 * x86_64.cc: Likewise.
7510
83e17bd5
CC
75112010-12-09 Cary Coutant <ccoutant@google.com>
7512
7513 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
7514 stack.
7515 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
7516 parameter; change all callers.
7517 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
7518 * options.h (warn_execstack): New option.
7519
017257f8
DK
75202010-12-07 Doug Kwan <dougkwan@google.com>
7521
7522 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
7523 like function call relocations.
7524
c20cbc06
ILT
75252010-12-07 Ian Lance Taylor <iant@google.com>
7526
7527 * archive.cc (Archive::get_elf_object_for_member): Permit
7528 punconfigured to be NULL.
7529 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
7530 (Archive::include_member): Pass NULL to get_elf_object_for_member
7531 if we searched for the archive and this is the first included
7532 object.
7533
4dbfafcc
ILT
75342010-12-01 Ian Lance Taylor <iant@google.com>
7535
7536 * dwarf_reader.h (class Sized_dwarf_line_info): Add
7537 track_relocs_type_ field.
7538 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7539 Set track_relocs_type_.
7540 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
7541 contents when using RELA relocs.
7542 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
7543 reloc_map_.
7544 * reloc.cc (Track_relocs::next_addend): New function.
7545 * reloc.h (class Track_relocs): Declare next_addend.
7546
e5e19edd
ILT
75472010-12-01 Ian Lance Taylor <iant@google.com>
7548
7549 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
7550 virtual destructor.
7551
9a5ce24c
ILT
75522010-12-01 Ian Lance Taylor <iant@google.com>
7553
7554 * README: Update compilers known to work and fail.
7555
c7791212
NC
75562010-11-23 Matthias Klose <doko@ubuntu.com>
7557
7558 * configure.in: For --enable-gold, handle value `default' instead of
7559 `both*'. Always install ld as ld.bfd, install as ld if gold is
7560 not the default.
7561 * configure: Regenerate.
7562
0ad220c9
DK
75632010-11-18 Doug Kwan <dougkwan@google.com>
7564
7565 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
7566 and right_alignment to be zero. Store result alignment only if it is
7567 greater than existing alignment.
7568
ab8056e0
CC
75692010-11-16 Cary Coutant <ccoutant@google.com>
7570
7571 PR gold/12220
7572 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7573 Check for ".zdebug_line".
7574
fd064a5b
CC
75752010-11-16 Doug Kwan <dougkwan@google.com>
7576 Cary Coutant <ccoutant@google.com>
7577
7578 * output.h (Output_segment::set_section_addresses): Pass increase_relro
7579 by reference; adjust all callers.
7580 * output.cc (Output_segment::set_section_addresses): Adjust references
7581 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
7582 list is empty.
7583 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
7584 end at page boundary.
7585
6fc6ea19
CC
75862010-11-16 Cary Coutant <ccoutant@google.com>
7587
7588 PR gold/12220
7589 * layout.cc (Layout::choose_output_section): Transform names of
7590 compressed sections even when using a script with a SECTIONS clause.
7591 (Layout::output_section_name): Remove code to transform
7592 compressed debug section names.
7593 * output.cc (Output_section::add_input_section): Use uncompressed
7594 section size when tracking input sections.
7595
95a2c8d6
RS
75962010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
7597
7598 * symtab.h (Symbol::NON_PIC_REF): Remove.
7599 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
7600 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
7601 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
7602 (Symbol::use_plt_offset): Take a flags argument and pass it
7603 directly to needs_dynamic_reloc. Restrict check for undefined
7604 weak symbols to function calls.
7605 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
7606 (Target_arm::Scan::global): Use it.
7607 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
7608 (Target_arm::Relocate::relocate): Likewise.
7609 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
7610 parameter with an r_type parameter. Use get_reference_flags
7611 to get the flags.
7612 (Target_arm::Relocate::relocate): Update accordingly.
7613 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
7614 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
7615 (Target_i386::Scan::global): Likewise.
7616 (Target_i386::Relocate::relocate): Likewise.
7617 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
7618 parameter with an r_type parameter. Use get_reference_flags
7619 to get the flags.
7620 (Target_i386::Relocate::relocate): Update accordingly.
7621 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
7622 (Target_powerpc::Scan::global): Use it.
7623 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
7624 (Target_powerpc::Relocate::relocate): Likewise.
7625 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
7626 (Target_sparc::Scan::global): Use it.
7627 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
7628 (Target_sparc::Relocate::relocate): Likewise.
7629 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
7630 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
7631 (Target_x86_64::Scan::global): Likewise.
7632 (Target_x86_64::Relocate::relocate): Likewise.
7633
f625ae50
DK
76342010-11-08 Doug Kwan <dougkwan@google.com>
7635 Cary Coutant <ccoutant@google.com>
7636
7637 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
7638 (Arm_exidx_merge_section::section_contents_): New data member.
7639 (Arm_input_section::Arm_input_section): Initialize original_contents_.
7640 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 7641 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
7642 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
7643 in parameters instead of calling Object::section_contents without
7644 locking.
7645 (Arm_output_section::group_section): New parameter TASK. Pass it
7646 to callees that need locking objects.
7647 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
7648 to lock EXIDX input sections. Fix a formatting issue. Call
7649 Arm_exidx_merged_section::build_contents to create merged section
7650 contents.
7651 (Arm_output_section::create_stub_group): New parameter TASK. Use it
7652 to lock object of stub table owner.
7653 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
7654 TEXT_SIZE to initialize data member TEXT_SIZE_.
7655 (Arm_exidx_input_section::addralign): Fix typo in comment.
7656 (Arm_exidx_input_section::text_size): New method.
7657 (Target_arm::do_relax): New parameter TASK. Pass it to callees
7658 that require locking objects. Lock objects before scanning for stubs
7659 and updating local symbols.
7660 (Arm_input_section<big_endian>::init): Copy contents of original
7661 input section.
2e702c99 7662 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
7663 original input section instead of calling Object::section_contents
7664 without locking.
7665 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
7666 size without calling Object::section_size().
7667 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
7668 for size. Allocate a buffer for merged EXIDX entries.
7669 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 7670 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
7671 building code to Arm_exidx_merged_section::build_contetns. Write
7672 out contetns in buffer instead of building it on the fly.
7673 (Arm_relobj::make_exidx_input_section): Also pass text section size
7674 to Arm_exidx_input_section constructor.
7675 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
7676 (Arm_dynobj::do_read_symbols): Fix memory leak.
7677 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
7678 * target.h: (class Task): Add forward declaration.
7679 (Target::relax): Add new parameter TASK and pass it to
7680 Target::do_relax().
7681 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
7682
5f9bcf58
CC
76832010-11-05 Cary Coutant <ccoutant@google.com>
7684
7685 PR gold/10708
7686 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
7687 object when reading from the file.
7688 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
7689 second layout pass.
7690 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
7691 when reading section contents.
7692 (get_section_contents): Likewise.
7693 (icf::find_identical_sections): Likewise.
7694 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
7695 object when reading from the file.
7696 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
7697 the object when doing deferred section layout.
7698
e597fa08
NC
76992010-11-03 Nick Clifton <nickc@redhat.com>
7700
7701 PR gold/12001
7702 * script.h (class Symbol_assignment: name): New member. Returns
7703 the name of the symbol.
7704 * scrfipt.cc (Script_options::is_pending_assignment): New member.
7705 Returns true if the given symbol name is on the list of
7706 assignments wating to be processed.
7707 * archive.cc (should_incldue_member): If the symbol is undefined,
7708 check to see if it is on the list of symbols pending assignment.
7709
3f9a3278
ILT
77102010-11-03 Ryan Mansfield <rmansfield@qnx.com>
7711
7712 * script-sections.cc (Script_sections::find_memory_region): Check
7713 for a NULL output section pointer.
7714
d06fb4d1
DK
77152010-10-29 Doug Kwan <dougkwan@google.com>
7716
7717 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
7718 Output_section::add_relaxed_input_section.
7719 * output.cc (Output_section::add_relaxed_input_section): Add new
7720 arguments LAYOUT and NAME. Set section order index.
7721 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7722 Copy section order index.
7723 * output.h (Output_section::add_relaxed_input_section): Add new
7724 arguments LAYOUT and NAME.
7725
90e24de5
ILT
77262010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7727
7728 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 7729 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
7730 * testsuite/Makefile.in: Regenerate.
7731
c9484ea5
DK
77322010-10-20 Doug Kwan <dougkwan@google.com>
7733
7734 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
7735 without SHF_LINK_ORDER flags.
7736 * layout.cc (Layout::choose_output_section): Do not filter
7737 SHF_LINK_ORDER flag in a relocatable link.
7738
5bc2f5be
CC
77392010-10-17 Cary Coutant <ccoutant@google.com>
7740
7741 * output.h (Output_segment::set_section_addresses): Change function
7742 signature. Update all callers.
7743 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
7744 sections.
7745 (Output_segment::set_section_addresses): Align after last TLS
7746 section. Add padding before last relro section instead of after.
7747
0c91cf04
DK
77482010-10-17 Doug Kwan <dougkwan@google.com>
7749
7750 * gold/arm.cc (Target_arm::got_section): Use correct order and set
7751 GOT output section to be writable.
7752
8c21d9d3
CC
77532010-10-14 Cary Coutant <ccoutant@google.com>
7754
7755 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
7756 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
7757 * gold.cc (queue_initial_tasks): Check parameters for incremental link
7758 mode.
7759 * incremental.cc (report_command_line): Ignore all forms of
7760 --incremental.
7761 * layout.cc (Layout::Layout): Check parameters for incremental link
7762 mode.
7763 * options.cc (General_options::parse_incremental): New function.
7764 (General_options::parse_no_incremental): New function.
7765 (General_options::parse_incremental_full): New function.
7766 (General_options::parse_incremental_update): New function.
7767 (General_options::incremental_mode_): New data member.
7768 (General_options::finalize): Check incremental_mode_.
7769 * options.h (General_options): Update help text for --incremental.
7770 Add --no-incremental, --incremental-full, --incremental-update.
7771 (General_options::Incremental_mode): New enum type.
7772 (General_options::incremental_mode): New function.
7773 (General_options::incremental_mode_): New data member.
7774 * parameters.cc (Parameters::incremental_mode_): New data member.
7775 (Parameters::set_options): Set incremental_mode_.
7776 (Parameters::set_incremental_full): New function.
7777 (Parameters::incremental): New function.
7778 (Parameters::incremental_update): New function.
7779 (set_parameters_incremental_full): New function.
7780 * parameters.h (Parameters::set_incremental_full): New function.
7781 (Parameters::incremental): New function.
7782 (Parameters::incremental_update): New function.
7783 (Parameters::incremental_mode_): New data member.
7784 (set_parameters_incremental_full): New function.
7785 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
7786 incremental link mode.
7787 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
7788 (Sized_relobj::do_relocate_sections): Likewise.
7789 * testsuite/Makefile.am (incremental_test): Use --incremental-full
7790 option.
7791 * testsuite/Makefile.in: Regenerate.
7792 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 7793
bb32aa18 77942010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
7795
7796 * script-sections.h (class Script_sections): Make
7797 Sections_elements typedef public.
7798 * script-sections.cc (class Sort_output_sections): Add elements_
7799 field. Add constructor which sets it; change all callers.
7800 (Sort_output_sections::is_before): New function.
7801 (Sort_output_sections::operator()): Call is_before.
7802 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
7803 conditional.
7804 * testsuite/script_test_10.sh: New test. Test script section
7805 order.
7806 * testsuite/script_test_10.t: Likewise.
7807 * testsuite/script_test_10.s: Likewise.
7808 * testsuite/Makefile.am: Wrap the cross linker tests and the
7809 common tests into NATIVE_OR_CROSS_LINKER.
7810 (check_SCRIPTS): Add script_test_10.sh.
7811 (check_DATA): Add script_test_10.stdout.
7812 (script_test_10.o, script_test_10): New targets.
7813 (script_test_10.stdout): New target.
7814 * configure, testsuite/Makefile.in: Regenerate.
7815
3cef7179
ILT
78162010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7817
7818 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
7819 error for the deprecated relocations.
7820 (Target_arm::Scan::global): Likewise.
7821 (Target_arm::Relocate::relocate): Likewise.
7822
7411e9a8
RS
78232010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
7824
7825 * fileread.cc (Input_file::find_file): Initialize *found_name
7826 and *namep when using the fallback search for case 4.
7827
6a9da32a
CC
78282010-10-11 Cary Coutant <ccoutant@google.com>
7829
7830 * options.h (class General_options): Redefine -z lazy as an alias for
7831 the negation of -z now.
7832
ac897c20
ILT
78332010-10-11 Ian Lance Taylor <iant@google.com>
7834
7835 * resolve.cc (symbol_to_bits): Report the value of the unsupported
7836 binding.
7837
ea5cae92
NC
78382010-10-06 Nick Clifton <nickc@redhat.com>
7839
7840 * script-sections.cc(class Memory_region): Remove
7841 current_lma_offset_ field. Rename current_vma_offset_ to
7842 current_offset_. Add last_section_ field.
7843 (Memory_region::get_current_vma_address): Rename to
7844 get_current_address.
7845 (Memory_region::get_current_lma_address): Delete.
7846 (Memory_region::increment_vma_offset): Rename to
7847 increment_offset.
7848 (Memory_region::increment_lma_offset): Delete.
7849 (Memory_region::attributes_compatible): New method. Returns
7850 true if the provided section is compatible with the region.
7851 (Memory_region::get_last_section): New method. Returns the last
7852 section to use the region.
7853 (Memory_region::set_last_section): New method. Stores the last
7854 section to use the region.
7855 (Script_sections::block_in_region): New method. Returns true if
7856 a block of memory is contained within a region.
7857 (Script_sections::find_memory_region): New method. Locates a
7858 memory region to be used to set a VMA or LMA address.
7859 (Output_section_definition::set_section_addresses): Add code to
7860 check for addresses set by memory regions.
7861 (Output_segment::set_section_addresses): Remove memory region
7862 walking code.
7863 (Script_sections::create_segment): Add a warning if a header
7864 segment is created outside of any region.
7865 * script-sections.h (class Script_sections): Add prototypes for
7866 find_memory_region and block_in_region methods.
7867 * testsuite/memory_test.s: Use .long instead of .word.
7868 * testsuite/memory_test.t: Add some more output sections.
7869 * testsuite/memory_test.sh: Update expected output.
7870
a9bfd952
DK
78712010-10-02 Doug Kwan <dougkwan@google.com>
7872
7873 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
7874 defintion to symtab.h
7875 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
7876 declaration to defintion.
7877
bacff3ab
NC
78782010-10-01 Nick Clifton <nickc@redhat.com>
7879
7880 * expression.cc (eval): Replace dummy argument with NULL.
7881 (eval_maybe_dot): Check for a NULL result section pointer.
7882 (Symbol_expression::value): Likewise.
7883 (Dot_expression::value): Likewise.
7884 (BINARY_EXPRESSION): Likewise.
7885 (Max_expression::value): Likewise.
7886 (Min_expression::value): Likewise.
7887 (Absolute_expression::value): Likewise.
7888 (Addr_expression::value_from_output_section): Likewise.
7889 (Loaddddr_expression::value_from_output_section): Likewise.
7890 (Segment_start_expression::value): Likewise.
7891 * script-sections.cc
7892 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
7893 argument with NULL.
7894 (Sections_elememt_dot_assignment::set_section_addresses):
7895 Likewise.
7896 (Output_data_expression::do_write_to_buffer): Likewise.
7897 (Output_section_definition::finalize_symbols): Likewise.
7898 (Output_section_definition::set_section_addresses): Likewise.
7899
f81bc8b5
DK
79002010-09-30 Doug Kwan <dougkwan@google.com>
7901
7902 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
7903
c95e9f27
ST
79042010-09-28 Sriraman Tallam <tmsriram@google.com>
7905
7906 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 7907 function.
c95e9f27
ST
7908 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
7909 virtual function.
7910 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
7911 virtual function.
7912 * icf.cc (get_section_contents): Inline merge sections only when
7913 target allows it.
7914
3cac54d2
RW
79152010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7916
7917 * configure: Regenerate.
7918
2904037a
ILT
79192010-09-17 Ian Lance Taylor <iant@google.com>
7920
7921 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
7922 * testsuite/Makefile.am (memory_test.o): New target.
7923 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
7924 memory_test.t.
7925 * testsuite/Makefile.in: Rebuild.
2904037a 7926
bca7fb63
DK
79272010-09-17 Doug Kwan <dougkwan@google.com>
7928
7929 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
7930 defintion if relocation uses GOT entries of the symbol.
7931 * testsuite/icf_safe_test.sh: Fix test.
7932 * testsuite/icf_safe_so_test.sh: Fix test.
7933
4ef28648
CC
79342010-09-16 Cary Coutant <ccoutant@google.com>
7935
7936 * script_sections.cc (class Memory_region): Remove "NULL" from
7937 vector initializations.
7938
793990de
CC
79392010-09-15 Cary Coutant <ccoutant@google.com>
7940
7941 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
7942 Resolve forwarding symbols.
7943
81e015e2
DK
79442010-09-15 Doug Kwan <dougkwan@google.com>
7945
7946 * gold/testsuite/script_test_3.t: Add ARM special sections.
7947 * gold/testsuite/script_test_4.t: Same.
7948 * gold/testsuite/script_test_5.t: Same.
7949 * gold/testsuite/script_test_6.t: Same.
7950 * gold/testsuite/script_test_7.t: Same.
7951 * gold/testsuite/script_test_7.t: Same.
7952 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
7953
36171d64
CC
79542010-09-14 Cary Coutant <ccoutant@google.com>
7955
7956 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
7957 (Target_x86_64::Relocate::relocate_tls): Replace check for
7958 saw_tls_block_reloc_ with test for executable section.
7959
d89051bd
CC
79602010-09-12 Cary Coutant <ccoutant@google.com>
7961
7962 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
7963 position-independent executables to shared libraries need dynamic
7964 relocations.
7965 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
7966 position-independent executables.
7967 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
7968 * testsuite/Makefile.in: Regenerate.
7969
fca41f0f
NC
79702010-09-10 Nick Clifton <nickc@redhat.com>
7971
7972 PR gold/11997
7973 * testsuite/memory_test.t: Discard any sections that are not
7974 needed.
7975
6695e4b3
L
79762010-09-09 H.J. Lu <hongjiu.lu@intel.com>
7977
7978 PR gold/11996
7979 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
7980 "This::" to work around a bug in gcc 4.2.
7981
7982 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
7983
0f72bf6f
RÁE
79842010-09-09 Rafael Espindola <espindola@google.com>
7985
7986 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
7987 sections with different PF_X flags in the same segment.
7988 (Layout::find_first_load_seg): Search all segments to find the first
7989 one.
7990 * options.h (rosegment): New.
7991
79922010-09-08 Rafael Espindola <espindola@google.com>
a6577478 7993
05a79166 7994 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 7995
aa98ff75
DK
79962010-09-08 Doug Kwan <dougkwan@google.com>
7997
7998 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
7999 (Arm_relobj::do_relocate_sections): Add new parameter for output
8000 file to match the parent.
8001 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
8002 of local symbols instead of input values. Update code to track
8003 changes in gold::relocate_section.
8004 * object.cc (Sized_relobj::compute_final_local_value): New methods.
8005 (Sized_relobj::compute_final_local_value_internal): New methods.
8006 (Sized_relobj::do_finalize_local_symbols): Move code from loop
8007 body into private version of Sized_relobj::compute_final_local_value.
8008 Call the inline method.
8009 * object.h (Symbol_value::Symbol_value): Define destructor. Free
8010 merged symbol value if there is one.
8011 (Symbol_value::has_output_value): New method defintiion.
8012 (Sized_relobj::Compute_final_local_value_status): New enum type.
8013 (Sized_relobj::compute_final_local_value): New methods.
8014 (Sized_relobj::compute_final_local_value_internal): New methods.
8015 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
8016 and arm_cortex_a8.sh.
8017 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
8018 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
8019 New tests.
8020 * Makefile.in: Regenerate.
8021 * testsuite/arm_bl_out_of_range.s: Update test.
8022 * testsuite/thumb_bl_out_of_range.s: Ditto.
8023 * testsuite/thumb_blx_out_of_range.s: Ditto.
8024 * testsuite/arm_branch_out_of_range.sh: New file.
8025 * testsuite/arm_cortex_a8.sh: Ditto.
8026 * testsuite/arm_cortex_a8_b.s: Ditto.
8027 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
8028 * testsuite/arm_cortex_a8_b_local.s: Ditto.
8029 * testsuite/arm_cortex_a8_bl.s: Ditto.
8030 * testsuite/arm_cortex_a8_blx.s: Ditto.
8031 * testsuite/arm_cortex_a8_local.s: Ditto.
8032 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
8033 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
8034
05a79166
L
80352010-09-08 Rafael Espindola <espindola@google.com>
8036
8037 * Makefile.am (memory_test.stdout): Run readelf with -W.
8038 * Makefile.in: Regenerate.
8039 * testsuite/memory_test.sh: Make the regexps accept both 32 and
8040 64 bit output.
8041
33dbc701
RÁE
80422010-09-08 Rafael Espindola <espindola@google.com>
8043
8044 * script-sections.cc (Script_sections::add_memory_region): Convert
8045 field precision to int.
8046 * script.cc (script_set_section_region, script_set_section_region):
8047 Convert field precision to int.
8048
731ca54a
RÁE
80492010-09-08 Rafael Espindola <espindola@google.com>
8050
8051 * arm.cc (do_finalize_sections): Create the __exidx_start and
8052 __exdix_end symbols even when the section is missing.
8053
7f8cd844
NC
80542010-09-08 Nick Clifton <nickc@redhat.com>
8055
8056 * README: Remove claim that MEMORY is not supported.
8057 * expression.cc (script_exp_function_origin)
8058 (script_exp_function_length): Move from here to ...
8059 * script.cc: ... here.
8060 (script_set_section_region, script_add_memory)
8061 (script_parse_memory_attr, script_include_directive): New
8062 functions.
8063 * script-sections.cc
8064 (class Memory_region): New class.
8065 (class Output_section_definition): Add set_memory_region,
8066 set_section_vma, set_section_lma and get_section_name methods.
8067 (class Script_Sections): Add add_memory_region,
8068 find_memory_region, find_memory_region_origin,
8069 find_memory_region_length and set_memory_region methods.
8070 Have set_section_addresses method walk the list of set memory
8071 regions.
8072 Extend the print methos to display memory regions.
8073 * script-sections.h: Add prototypes for new methods.
8074 Add enum for MEMORY region attributes.
8075 * yyscript.y: Add support for parsing MEMORY regions.
8076 * script-c.h: Add prototypes for new functions.
8077 * testsuite/Makefile.am: Add test of MEMORY region functionality.
8078 * testsuite/Makefile.in: Regenerate.
8079 * testsuite/memory_test.sh: New script.
8080 * testsuite/memory_test.s: New assembler source file.
8081 * testsuite/memory_test.t: New linker script.
8082
a4649286
DK
80832010-08-27 Doug Kwan <dougkwan@google.com>
8084
8085 * gold/resolve.cc (Symbol_table::should_override): Let a weak
8086 reference override an existing dynamic weak reference.
8087 * testsuite/Makefile.am: Add new test dyn_weak_ref.
8088 * testsuite/Makefile.in: Regenerate.
8089 * testsuite/dyn_weak_ref.sh: New file.
8090 * testsuite/dyn_weak_ref_1.c: Ditto.
8091 * testsuite/dyn_weak_ref_2.c: Ditto.
8092
b56648ad
ILT
80932010-08-27 Ian Lance Taylor <iant@google.com>
8094
8095 * incremental.h (class Incremental_input_entry): Add virtual
8096 destructor.
8097
809313cb
ILT
80982010-08-27 Ian Lance Taylor <iant@google.com>
8099
8100 * testsuite/start_lib_test_3.c: Mark t3 as used.
8101
11e32464
NC
81022010-08-27 Nick Clifton <nickc@redhat.com>
8103
8104 * options.cc (version_script): Fix small typo in previous
8105 whitespace tidyup.
8106
ca09d69a
NC
81072010-08-25 Nick Clifton <nickc@redhat.com>
8108
8109 * archive.cc: Formatting fixes: Remove whitespace between
8110 typename and following asterisk. Remove whitespace between
8111 function name and opening parenthesis.
8112 * archive.h: Likewise.
8113 * arm.cc: Likewise.
8114 * attributes.cc: Likewise.
8115 * attributes.h: Likewise.
8116 * common.cc: Likewise.
8117 * copy-relocs.cc: Likewise.
8118 * dirsearch.h: Likewise.
8119 * dynobj.cc: Likewise.
8120 * ehframe.cc: Likewise.
8121 * ehframe.h: Likewise.
8122 * expression.cc: Likewise.
8123 * fileread.cc: Likewise.
8124 * fileread.h: Likewise.
8125 * gc.h: Likewise.
8126 * gold-threads.cc: Likewise.
8127 * gold.cc: Likewise.
8128 * i386.cc: Likewise.
8129 * icf.h: Likewise.
8130 * incremental-dump.cc: Likewise.
8131 * incremental.cc: Likewise.
8132 * layout.cc: Likewise.
8133 * layout.h: Likewise.
8134 * main.cc: Likewise.
8135 * merge.cc: Likewise.
8136 * merge.h: Likewise.
8137 * object.cc: Likewise.
8138 * object.h: Likewise.
8139 * options.cc: Likewise.
8140 * options.h: Likewise.
8141 * output.cc: Likewise.
8142 * output.h: Likewise.
8143 * plugin.cc: Likewise.
8144 * plugin.h: Likewise.
8145 * powerpc.cc: Likewise.
8146 * reloc.cc: Likewise.
8147 * script-c.h: Likewise.
8148 * script-sections.cc: Likewise.
8149 * script.cc: Likewise.
8150 * stringpool.cc: Likewise.
8151 * symtab.cc: Likewise.
8152 * symtab.h: Likewise.
8153 * target.cc: Likewise.
8154 * timer.cc: Likewise.
8155 * timer.h: Likewise.
8156 * version.cc: Likewise.
8157 * x86_64.cc: Likewise.
8158
b8fa8750
NC
81592010-08-24 Nick Clifton <nickc@redhat.com>
8160
8161 PR 11899
8162 * layout.cc (segment_precedes): Sort segments by their physical
8163 addresses, if they have been set.
8164
9919d93b
CC
81652010-08-23 Cary Coutant <ccoutant@google.com>
8166
8167 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
8168 symbols data.
8169 (Lib_group::include_member): Unlock object after deleting its
8170 symbols data.
8171 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
8172 the bug fixed here.
8173
97b4be1c
CC
81742010-08-19 Neil Vachharajani <nvachhar@google.com>
8175 Cary Coutant <ccoutant@google.com>
8176
8177 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
8178 constructor, and set_blocker.
8179 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
8180 readsyms_blocker_.
8181 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
8182 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
8183 * testsuite/Makefile.am (start_lib_test): New test case.
8184 * testsuite/Makefile.in: Regenerate.
8185 * testsuite/start_lib_test_main.c: New file.
8186 * testsuite/start_lib_test_1.c: New file.
8187 * testsuite/start_lib_test_2.c: New file.
8188 * testsuite/start_lib_test_3.c: New file.
8189
dd0b1884
ILT
81902010-08-19 Ian Lance Taylor <iant@google.com>
8191
8192 * Makefile.in: Rebuild with automake 1.11.1.
8193 * aclocal.m4: Likewise.
8194 * testsuite/Makefile.in: Likewise.
8195
7223e9ca
ILT
81962010-08-19 Ian Lance Taylor <iant@google.com>
8197
8198 PR 10893
8199 * i386.cc (class Output_data_plt_i386): Update declarations.
8200 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
8201 local_ifuncs_ fields.
8202 (Target_i386::do_plt_section_for_global): New function.
8203 (Target_i386::do_plt_section_for_local): New function.
8204 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
8205 parameter; change all callers. Initialize global_ifuncs_ and
8206 local_ifuncs_. If doing a static link define __rel_iplt_start and
8207 __rel_iplt_end.
8208 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
8209 (Output_data_plt_i386::add_local_ifunc_entry): New function.
8210 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
8211 symbols.
8212 (Target_i386::make_plt_section): New function, broken out of
8213 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
8214 (Target_i386::make_plt_entry): Call make_plt_section.
8215 (Target_i386::make_local_ifunc_plt_entry): New function.
8216 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
8217 (Target_i386::Scan::local): Handle IFUNC symbols. Add
8218 R_386_IRELATIVE to switch.
8219 (Target_i386::Scan::global): Likewise.
8220 (Target_i386::Relocate::relocate): Likewise.
8221 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
8222 switch.
8223 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
8224 (Target_x86_64::do_plt_section_for_global): New function.
8225 (Target_x86_64::do_plt_section_for_local): New function.
8226 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
8227 parameter; change all callers. If doing a static link define
8228 __rela_iplt_start and __rela_iplt_end.
8229 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
8230 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
8231 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
8232 to point to .plt.
8233 (Target_x86_64::make_local_ifunc_plt_entry): New function.
8234 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
8235 switch.
8236 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
8237 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
8238 R_X86_64_IRELATIVE to switch.
8239 (Target_x86_64::Scan::global): Likewise.
8240 (Target_x86_64::Relocate::relocate): Likewise.
8241 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
8242 switch.
8243 * target.h (class Target): Add plt_section_for_global and
8244 plt_section_for_local functions. Add do_plt_section_for_global
8245 and do_plt_section_for_local virtual functions.
8246 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
8247 clarifying comments.
8248 (Symbol::use_plt_offset): Handle IFUNC symbol.
8249 * object.cc (Sized_relobj::Sized_relobj): Initialize
8250 local_plt_offsets_.
8251 (Sized_relobj::local_has_plt_offset): New function.
8252 (Sized_relobj::local_plt_offset): New function.
8253 (Sized_relobj::set_local_plt_offset): New function.
8254 (Sized_relobj::do_count): Handle IFUNC symbol.
8255 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
8256 a bit away from input_shndx_ field. Add set_is_func_symbol and
8257 is_ifunc_symbol functions.
8258 (class Sized_relobj): Update declarations. Remove Tls_got_entry
8259 and Local_tls_got_offsets. Define Local_plt_offsets. Add
8260 local_plt_offsets_ field.
8261 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
8262 * output.h (class Output_section_data): Add non-const
8263 output_section function.
8264 (class Output_data_got): Update declarations.
8265 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
8266 Add use_plt_offset parameter to global and local constructors.
8267 Change all callers. Change local_sym_index_ field to 31 bits.
8268 Change GSYM_CODE and CONSTANT_CODE accordingly.
8269 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
8270 doing a static link don't set sh_link field.
8271 (Output_data_got::Got_entry::write): Use PLT offset if
8272 appropriate.
8273 (Output_data_got::add_global_plt): New function.
8274 (Output_data_got::add_local_plt): New function.
8275 * target-reloc.h (relocate_section): Handle IFUNC symbol.
8276 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
8277 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
8278 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
8279 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
8280 IFUNC conditional.
8281 * testsuite/ifunc-sel.h: New file.
8282 * testsuite/ifuncmain1.c: New file.
8283 * testsuite/ifuncmain1vis.c: New file.
8284 * testsuite/ifuncmod1.c: New file.
8285 * testsuite/ifuncdep2.c: New file.
8286 * testsuite/ifuncmain2.c: New file.
8287 * testsuite/ifuncmain3.c: New file.
8288 * testsuite/ifuncmod3.c: New file.
8289 * testsuite/ifuncmain4.c: New file.
8290 * testsuite/ifuncmain5.c: New file.
8291 * testsuite/ifuncmod5.c: New file.
8292 * testsuite/ifuncmain6pie.c: New file.
8293 * testsuite/ifuncmod6.c: New file.
8294 * testsuite/ifuncmain7.c: New file.
8295 * configure, testsuite/Makefile.in: Rebuild.
8296
56f75c03
ILT
82972010-08-18 Ian Lance Taylor <iant@google.com>
8298
8299 * incremental.cc
8300 (Output_section_incremental_inputs::write_input_files): Add cast
8301 to avoid signed/unsigned comparison warning.
8302 (Output_section_incremental_inputs::write_info_blocks): Likewise.
8303
55455f89
CC
83042010-08-12 Cary Coutant <ccoutant@google.com>
8305
8306 * common.cc (Sort_commons::operator()): Remove unnecessary code.
8307
e2054bcb
ILT
83082010-08-13 Ian Lance Taylor <iant@google.com>
8309
8310 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
8311
74f67560
DK
83122010-08-12 Cary Coutant <ccoutant@google.com>
8313 Doug Kwan <dougkwan@google.com>
8314
8315 * resolve.cc (Symbol_table::should_override): When a weak dynamic
8316 defintion overrides non-weak undef, remember that the original undef
8317 is not weak.
8318 * symtab.cc (Symbol_table::sized_write_global): For undef without
8319 an original weak binding, set binding to global in output.
8320 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
8321 * testsuite/Makefile.in: Regenerate.
8322 * testsuite/strong_ref_weak_def.sh: New file.
8323 * testsuite/strong_ref_weak_def_1.c: Ditto.
8324 * testsuite/strong_ref_weak_def_2.c: Ditto.
8325
d1238d12
CC
83262010-08-12 Cary Coutant <ccoutant@google.com>
8327
8328 * testsuite/incremental_test.sh: Rewrite.
8329 * testsuite/incremental_test_1.c: Rewrite.
8330 * testsuite/incremental_test_2.c: Rewrite.
8331
0e70b911
CC
83322010-08-12 Cary Coutant <ccoutant@google.com>
8333
8334 * arm.cc (Target_arm::got_size): Add const.
8335 (Target_arm::got_entry_count): New function.
8336 (Target_arm::plt_entry_count): New function.
8337 (Target_arm::first_plt_entry_offset): New function.
8338 (Target_arm::plt_entry_size): New function.
8339 (Output_data_plt_arm::entry_count): New function.
8340 (Output_data_plt_arm::first_plt_entry_offset): New function.
8341 (Output_data_plt_arm::get_plt_entry_size): New function.
8342 * i386.cc (Target_i386::got_size): Add const.
8343 (Target_i386::got_entry_count): New function.
8344 (Target_i386::plt_entry_count): New function.
8345 (Target_i386::first_plt_entry_offset): New function.
8346 (Target_i386::plt_entry_size): New function.
8347 (Output_data_plt_i386::entry_count): New function.
8348 (Output_data_plt_i386::first_plt_entry_offset): New function.
8349 (Output_data_plt_i386::get_plt_entry_size): New function.
8350 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
8351 find_incremental_inputs_sections. Dump incremental_got_plt section.
8352 * incremental.cc: Include target.h.
8353 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
8354 parameter. Adjust all callers. Find incremental_got_plt section.
8355 (Incremental_inputs::create_data_sections): Create incremental_got_plt
8356 section.
8357 (Output_section_incremental_inputs::set_final_data_size): Calculate
8358 size of incremental_got_plt section.
8359 (Output_section_incremental_inputs::do_write): Write the
8360 incremental_got_plt section.
8361 (Got_plt_view_info): New struct.
8362 (Local_got_offset_visitor): New class.
8363 (Global_got_offset_visitor): New class.
8364 (Global_symbol_visitor_got_plt): New class.
8365 (Output_section_incremental_inputs::write_got_plt): New function.
8366 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
8367 Add parameter. Adjust all callers.
8368 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8369 (Incremental_inputs::got_plt_section): New function.
8370 (Incremental_inputs::got_plt_section_): New data member.
8371 (Incremental_got_plt_reader): New class.
8372 * layout.cc (Layout::create_incremental_info_sections): Add the
8373 incremental_got_plt section.
8374 * object.h (Got_offset_list::get_list): New function.
8375 (Got offset_list::for_all_got_offsets): New function.
8376 (Sized_relobj::local_got_offset_list): New function.
8377 * powerpc.cc (Target_powerpc::got_size): Add const.
8378 (Target_powerpc::got_entry_count): New function.
8379 (Target_powerpc::plt_entry_count): New function.
8380 (Target_powerpc::first_plt_entry_offset): New function.
8381 (Target_powerpc::plt_entry_size): New function.
8382 (Output_data_plt_powerpc::entry_count): New function.
8383 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
8384 (Output_data_plt_powerpc::get_plt_entry_size): New function.
8385 * sparc.cc (Target_sparc::got_size): Add const.
8386 (Target_sparc::got_entry_count): New function.
8387 (Target_sparc::plt_entry_count): New function.
8388 (Target_sparc::first_plt_entry_offset): New function.
8389 (Target_sparc::plt_entry_size): New function.
8390 (Output_data_plt_sparc::entry_count): New function.
8391 (Output_data_plt_sparc::first_plt_entry_offset): New function.
8392 (Output_data_plt_sparc::get_plt_entry_size): New function.
8393 * symtab.h (Symbol::got_offset_list): New function.
8394 (Symbol_table::for_all_symbols): New function.
8395 * target.h (Sized_target::got_entry_count): New function.
8396 (Sized_target::plt_entry_count): New function.
8397 (Sized_target::plt_entry_size): New function.
8398 * x86_64.cc (Target_x86_64::got_size): Add const.
8399 (Target_x86_64::got_entry_count): New function.
8400 (Target_x86_64::plt_entry_count): New function.
8401 (Target_x86_64::first_plt_entry_offset): New function.
8402 (Target_x86_64::plt_entry_size): New function.
8403 (Output_data_plt_x86_64::entry_count): New function.
8404 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
8405 (Output_data_plt_x86_64::get_plt_entry_size): New function.
8406
09ec0418
CC
84072010-08-12 Cary Coutant <ccoutant@google.com>
8408
8409 * archive.cc: Include incremental.h.
8410 (Archive::Archive): Initialize incremental_info_.
8411 (Archive::include_member): Record archive members in incremental info.
8412 (Add_archive_symbols::run): Record begin and end of an archive in
8413 incremental info.
8414 (Lib_group::include_member): Record objects in incremental info.
8415 * archive.h (Incremental_archive_entry): Forward declaration.
8416 (Archive::set_incremental_info): New member function.
8417 (Archive::incremental_info): New member function.
8418 (Archive::Unused_symbol_iterator): New class.
8419 (Archive::unused_symbols_begin): New member function.
8420 (Archive::unused_symbols_end): New member function.
8421 (Archive::incremental_info_): New data member.
8422 * incremental-dump.cc (find_input_containing_global): New function.
8423 (dump_incremental_inputs): Dump new incremental info sections.
8424 * incremental.cc: Include symtab.h.
8425 (Output_section_incremental_inputs): New class.
8426 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
8427 new incremental info sections.
8428 (Sized_incremental_binary::do_check_inputs): Likewise.
8429 (Incremental_inputs::report_archive): Remove.
8430 (Incremental_inputs::report_archive_begin): New function.
8431 (Incremental_inputs::report_archive_end): New function.
8432 (Incremental_inputs::report_object): New function.
8433 (Incremental_inputs::finalize_inputs): Remove.
8434 (Incremental_inputs::report_input_section): New function.
8435 (Incremental_inputs::report_script): Rewrite.
8436 (Incremental_inputs::finalize): Do nothing but finalize string table.
8437 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8438 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8439 (Incremental_inputs::create_data_sections): New function.
8440 (Incremental_inputs::relocs_entsize): New function.
8441 (Output_section_incremental_inputs::set_final_data_size): New function.
8442 (Output_section_incremental_inputs::do_write): New function.
8443 (Output_section_incremental_inputs::write_header): New function.
8444 (Output_section_incremental_inputs::write_input_files): New function.
8445 (Output_section_incremental_inputs::write_info_blocks): New function.
8446 (Output_section_incremental_inputs::write_symtab): New function.
8447 * incremental.h (Incremental_script_entry): Forward declaration.
8448 (Incremental_object_entry): Forward declaration.
8449 (Incremental_archive_entry): Forward declaration.
8450 (Incremental_inputs): Forward declaration.
8451 (Incremental_inputs_header_data): Remove.
8452 (Incremental_inputs_header): Remove.
8453 (Incremental_inputs_header_write): Remove.
8454 (Incremental_inputs_entry_data): Remove.
8455 (Incremental_inputs_entry): Remove.
8456 (Incremental_inputs_entry_write): Remove.
8457 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
8458 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
8459 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8460 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
8461 Likewise.
8462 (Incremental_input_entry): New class.
8463 (Incremental_script_entry): New class.
8464 (Incremental_object_entry): New class.
8465 (Incremental_archive_entry): New class.
8466 (Incremental_inputs::Incremental_inputs): Initialize new data members.
8467 (Incremental_inputs::report_inputs): Remove.
8468 (Incremental_inputs::report_archive): Remove.
8469 (Incremental_inputs::report_archive_begin): New function.
8470 (Incremental_inputs::report_archive_end): New function.
8471 (Incremental_inputs::report_object): Change prototype.
8472 (Incremental_inputs::report_input_section): New function.
8473 (Incremental_inputs::report_script): Change prototype.
8474 (Incremental_inputs::get_reloc_count): New function.
8475 (Incremental_inputs::set_reloc_count): New function.
8476 (Incremental_inputs::create_data_sections): New function.
8477 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8478 (Incremental_inputs::inputs_section): New function.
8479 (Incremental_inputs::symtab_section): New function.
8480 (Incremental_inputs::relocs_section): New function.
8481 (Incremental_inputs::get_stringpool): Add const.
8482 (Incremental_inputs::command_line): Add const.
8483 (Incremental_inputs::inputs): Remove.
8484 (Incremental_inputs::command_line_key): New function.
8485 (Incremental_inputs::input_file_count): New function.
8486 (Incremental_inputs::input_files): New function.
8487 (Incremental_inputs::relocs_entsize): New function.
8488 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8489 (Incremental_inputs::finalize_inputs): Remove.
8490 (Incremental_inputs::Input_info): Remove.
8491 (Incremental_inputs::lock_): Remove.
8492 (Incremental_inputs::inputs_): Change type.
8493 (Incremental_inputs::inputs_map_): Remove.
8494 (Incremental_inputs::current_object_entry_): New data member.
8495 (Incremental_inputs::inputs_section_): New data member.
8496 (Incremental_inputs::symtab_section_): New data member.
8497 (Incremental_inputs::relocs_section_): New data member.
8498 (Incremental_inputs::reloc_count_): New data member.
8499 (Incremental_inputs_reader): New class.
8500 (Incremental_symtab_reader): New class.
8501 (Incremental_relocs_reader): New class.
8502 * layout.cc (Layout::finalize): Move finalization of incremental info
8503 and creation of incremental info sections to follow finalization of
8504 symbol table. Set offsets for postprocessing sections.
8505 (Layout::create_incremental_info_sections): Call
8506 Incremental_inputs::create_data_sections. Add incremental symtab
8507 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
8508 sections to layout after input sections.
8509 * layout.h (struct Timespec): Forward declaration.
8510 (Layout::incremental_inputs): Add const.
8511 (Layout::create_incremental_info_sections): Add parameter.
8512 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
8513 * object.cc: Include incremental.h.
8514 (Relobj::finalize_incremental_relocs): New function.
8515 (Sized_relobj::do_layout): Record input sections in incremental info.
8516 * object.h (Object::output_section): New function.
8517 (Object::output_section_offset): Moved from Relobj.
8518 (Object::get_incremental_reloc_base): New function.
8519 (Object::get_incremental_reloc_count): New function.
8520 (Object::do_output_section): New function.
8521 (Object::do_output_section_offset): Moved from Relobj.
8522 (Object::do_get_incremental_reloc_base): New function.
8523 (Object::do_get_incremental_reloc_count): New function.
8524 (Object::Object): Initialize new data members.
8525 (Relobj::output_section): Renamed do_output_section and moved to
8526 protected.
8527 (Relobj::output_section_offset): Moved to Object.
8528 (Relobj::do_get_incremental_reloc_base): New function.
8529 (Relobj::do_get_incremental_reloc_count): New function.
8530 (Relobj::allocate_incremental_reloc_counts): New function.
8531 (Relobj::count_incremental_reloc): New function.
8532 (Relobj::finalize_incremental_relocs): New function.
8533 (Relobj::next_incremental_reloc_index): New function.
8534 (Relobj::reloc_counts_): New data member.
8535 (Relobj::reloc_bases_): New data member.
8536 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
8537 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
8538 (Sized_relobj::incremental_relocs_scan): New function.
8539 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8540 (Sized_relobj::incremental_relocs_write): New function.
8541 (Sized_relobj::incremental_relocs_write_reltype): New function.
8542 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
8543 incremental link.
8544 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
8545 archives and object files elsewhere.
8546 (Add_symbols::run): Report object files here.
8547 (Finish_group::run): Report end of archive at end of group.
8548 * reloc.cc: Include layout.h, incremental.h.
8549 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
8550 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
8551 (Sized_relobj::incremental_relocs_scan): New function.
8552 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8553 (Sized_relobj::do_relocate_sections): Write incremental relocations.
8554 (Sized_relobj::incremental_relocs_write): New function.
8555 (Sized_relobj::incremental_relocs_write_reltype): New function.
8556 * script.cc (read_input_script): Rewrite test for incremental link.
8557 Change call to Incremental_inputs::report_script.
8558 * symtab.h (Symbol_table::first_global_index): New function.
8559 (Symbol_table::output_count): New function.
8560
ce0d1972
DK
85612010-08-12 Doug Kwan <dougkwan@google.com>
8562
8563 * arm.cc (Target_arm::merge_object_attributes): Check command line
8564 options --no-wchar-size-warning and --no-enum-size-warning.
8565 * options.h (General_options): Add ld-compatible options
8566 --no-enum-size-warning and --no-wchar-size-warning.
8567
6e5710ce
ILT
85682010-08-04 Ian Lance Taylor <iant@google.com>
8569
8570 * x86_64.cc (Target_x86_64::Scan::local): Use
8571 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
8572 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
8573 (Target_x86_64::Scan::global): Likewise.
8574 (Target_x86_64::Relocate::relocate): Likewise.
8575 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
8576 Likewise.
8577
fef830db
CC
85782010-08-03 Cary Coutant <ccoutant@google.com>
8579
8580 * merge.cc (Output_merge_string::do_add_input_section): Count strings
8581 to reserve space in merged_strings vector. Keep total input size
8582 for stats.
8583 (Output_merge_string::do_print_merge_stats): Print total input size.
8584 * merge.h (Output_merge_string): Add input_size_ field.
8585 * stringpool.cc (Stringpool_template::string_length): Move
8586 implementations out of Stringpool_template class and place in
8587 stringpool.h.
8588 * stringpool.h (string_length): Move out of Stringpool_template.
8589
1e3811b0
ILT
85902010-08-03 Ian Lance Taylor <iant@google.com>
8591
8592 PR 11712
8593 * layout.cc (relaxation_loop_body): If address of load segment is
8594 set, adjust address to include headers if possible.
8595
7af0c620
ILT
85962010-08-03 Ian Lance Taylor <iant@google.com>
8597
8598 * version.cc (version_string): Bump to 1.10.
8599
22f0da72
ILT
86002010-08-03 Ian Lance Taylor <iant@google.com>
8601
8602 PR 11805
8603 * layout.h (enum Output_section_order): Define.
8604 (class Layout): Update declarations.
8605 * layout.cc (Layout::get_output_section): Add order parameter.
8606 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
8607 is_first_non_relro parameters. Change all callers.
8608 (Layout::choose_output_section): Likewise.
8609 (Layout::add_output_section_data): Likewise.
8610 (Layout::make_output_section): Likewise. Set order.
8611 (Layout::default_section_order): New function.
8612 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
8613 * output.cc (Output_section::Output_section): Initialize order_.
8614 Don't initialize deleted fields.
8615 (Output_segment::Output_segment): Don't initialize deleted
8616 fields.
8617 (Output_segment::add_output_section_to_load): New function
8618 replacing add_output_section. Change all callers to call this or
8619 add_output_section_to_nonload.
8620 (Output_segment::add_output_section_to_nonload): New function.
8621 (Output_segment::remove_output_section): Rewrite.
8622 (Output_segment::add_initial_output_data): Likewise.
8623 (Output_segment::has_any_data_sections): Likewise.
8624 (Output_segment::is_first_section_relro): Likewise.
8625 (Output_segment::maximum_alignment): Likewise.
8626 (Output_segment::has_dynamic_reloc): New function replacing
8627 dynamic_reloc_count. Change all callers.
8628 (Output_segment::has_dynamic_reloc_list): New function replacing
8629 dynamic_reloc_count_list. Change all callers.
8630 (Output_segment::set_section_addresses): Rewrite.
8631 (Output_segment::set_offset): Rewrite.
8632 (Output_segment::find_first_and_last_list): Remove.
8633 (Output_segment::set_tls_offsets): Rewrite.
8634 (Output_segment::first_section_load_address): Likewise.
8635 (Output_segment::output_section_count): Likewise.
8636 (Output_segment::section_with_lowest_load_address): Likewise.
8637 (Output_segment::write_section_headers): Likewise.
8638 (Output_segment::print_sections_to_map): Likewise.
8639 * output.h (class Output_data): Remove dynamic_reloc_count_
8640 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
8641 (Output_data::add_dynamic_reloc): Rewrite.
8642 (Output_data::has_dynamic_reloc): New function.
8643 (Output_data::dynamic_reloc_count): Remove.
8644 (class Output_section): Add order_ field. Remvoe is_relro_local_,
8645 is_last_relro_, is_first_non_relro_, is_interp_,
8646 is_dynamic_linker_section_ fields. Add order and set_order
8647 functions. Remove is_relro_local, set_is_relro_local,
8648 is_last_relro, set_is_last_relro, is_first_non_relro,
8649 set_is_first_non_relro functions, is_interp, set_is_interp,
8650 is_dynamic_linker_section, and set_is_dynamic_linker_section
8651 functions.
8652 (class Output_segment): Change Output_data_list from std::list to
8653 std:;vector. Add output_lists_ field. Remove output_data_ and
8654 output_bss_ fields. Update declarations.
8655
3ff2ccb0
ILT
86562010-08-02 Ian Lance Taylor <iant@google.com>
8657
8658 * arm.cc (Target_arm::gc_process_relocs): Use typename.
8659 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
8660 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
8661
88a4108b
ILT
86622010-08-02 Ian Lance Taylor <iant@google.com>
8663
8664 PR 11855
8665 * script.cc (Script_options::Script_options): Initialize
8666 symbol_definitions_ and symbol_references_.
8667 (Script_options::add_symbol_assignment): Update
8668 symbol_definitions_ and symbol_references_.
8669 (Script_options::add_symbol_reference): New function.
8670 (script_symbol): New function.
8671 * script.h (class Script_options): Add symbol_definitions_ and
8672 symbol_references_ fields.
8673 (Script_options::referenced_const_iterator): New type.
8674 (Script_options::referenced_begin): New function.
8675 (Script_options::referenced_end): New function.
8676 (Script_options::is_referenced): New function.
8677 (Script_options::any_unreferenced): New function.
8678 * script-c.h (script_symbol): Declare.
8679 * yyscript.y (exp): Call script_symbol.
8680 * symtab.cc: Include "script.h".
8681 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
8682 Change all callers. Check symbols referenced by scripts.
8683 (Symbol_table::add_undefined_symbols_from_command_line): Add
8684 layout parameter. Change all callers.
8685 (Symbol_table::do_add_undefined_symbols_from_command_line):
8686 Likewise. Break out loop body. Check symbols referenced by
8687 scripts.
8688 (Symbol_table::add_undefined_symbol_from_command_line): New
8689 function broken out of
8690 do_add_undefined_symbols_from_command_line.
8691 * symtab.h (class Symbol_table): Update declarations.
8692 * archive.cc: Include "layout.h".
8693 (Archive::should_include_member): Add layout parameter. Change
8694 all callers. Check for symbol mentioned in expression.
8695 * archive.h (class Archive): Update declaration.
8696 * object.cc (Sized_relobj::do_should_include_member): Add layout
8697 parameter.
8698 * object.h (Object::should_include_member): Add layout parameter.
8699 Change all callers.
8700 (Object::do_should_include_member): Add layout parameter.
8701 (class Sized_relobj): Update declaration.
8702 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
8703 parameter.
8704 * dynobj.h (class Sized_dynobj): Update declaration.
8705 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
8706 layout parameter.
8707 * plugin.h (class Sized_pluginobj): Update declaration.
8708
5f1ab67a
ILT
87092010-08-02 Ian Lance Taylor <iant@google.com>
8710
8711 PR 11866
8712 * output.cc (Output_segment::set_offset): Search for the first and
8713 last sections rather than assuming that the list is in order.
8714 (Output_segment::find_first_and_last_list): New function.
8715 * output.h (class Output_segment): Update declarations.
8716 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
8717 (relro_strip_test_SOURCES): New variable.
8718 (relro_strip_test_DEPENDENCIES): New variable.
8719 (relro_strip_test_LDFLAGS): New variable.
8720 (relro_strip_test_LDADD): New variable.
8721 (relro_strip_test.so): New target.
8722
a8df5856
ILT
87232010-08-02 Ian Lance Taylor <iant@google.com>
8724
8725 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
8726 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
8727 (Target_i386::got_tlsdesc_section): New function.
8728 (Target_i386::got_section): Create space for GOT entries for
8729 TLSDESC relocations.
8730 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
8731 R_386_TLS_GOTDESC.
8732 (Target_i386::Scan::global): Likewise.
8733 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
8734 using TLSDESC GOT.
8735 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
8736 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
8737 (Target_x86_64::got_tlsdesc_section): New function.
8738 (Target_x86_64::got_section): Create space for GOT entries for
8739 TLSDESC relocations.
8740 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
8741 R_386_TLS_GOTDESC.
8742 (Target_x86_64::Scan::global): Likewise.
8743 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
8744 using TLSDESC GOT.
8745
0c10a0a6
ILT
87462010-08-02 Ian Lance Taylor <iant@google.com>
8747
8748 * testsuite/final_layout.sh: Use dc to convert from hex to
8749 decimal.
8750
41cbeecc
ST
87512010-07-29 Sriraman Tallam <tmsriram@google.com>
8752
8753 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
8754 paramter to the call to gold::gc_process_relocs.
8755 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
8756 paramter to the call to gold::gc_process_relocs.
8757 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
8758 parameter to the call to gold::gc_process_relocs.
8759 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
8760 template parameter to the call to gold::gc_process_relocs.
8761 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
8762 paramter to the call to gold::gc_process_relocs.
8763 * gc.h (get_embedded_addend_size): New function.
8764 (gc_process_relocs): Save the size of the reloc for use by ICF.
8765 * icf.cc (get_section_contents): Get the addend from the text section
8766 for SHT_REL relocation sections.
8767 * icf.h (Icf::Reloc_addend_size_info): New typedef.
8768 (Icf::Reloc_info): Add new member reloc_addend_size_info.
8769 * int_encoding.h (read_from_pointer): New overloaded function.
8770 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
8771 * testsuite/icf_sht_rel_addend_test.sh: New file.
8772 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
8773 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
8774
6ea55b82
RW
87752010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8776
8777 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
8778 * Makefile.in: Regenerate.
8779 * testsuite/Makefile.in: Regenerate.
8780
9691462b
ILT
87812010-07-27 Jeffrey Yasskin <jyasskin@google.com>
8782
8783 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
8784 * gold/testsuite/debug_msg.cc: Likewise.
8785 * gold/testsuite/odr_violation1.cc
8786 * gold/testsuite/odr_violation2.cc
8787
76897331
CC
87882010-07-21 Cary Coutant <ccoutant@google.com>
8789
8790 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
8791 string, and length fields.
8792 (Output_merge_string::Merged_strings_list): New type.
8793 (Output_merge_string::Merged_strings_lists): New typedef.
8794 (Output_merge_string): Replace merged_strings_ with
8795 merged_strings_lists_.
8796 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
8797 Merged_strings_list per input object and section. Don't store pointer
8798 to the string. Don't store length with each merged string entry.
8799 (Output_merge_string::finalize_merged_data): Loop over list of merged
8800 strings lists. Recompute length of each merged string.
8801
78384e8f
CC
88022010-07-15 Cary Coutant <ccoutant@google.com>
8803
8804 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
8805 here.
8806
783659f9
ILT
88072010-07-14 Ian Lance Taylor <iant@google.com>
8808
8809 * descriptors.cc (Descriptors::open): Report correct name in error
8810 message.
8811
131687b4
DK
88122010-07-13 Doug Kwan <dougkwan@google.com>
8813
8814 * arm.cc (Arm_input_section::Arm_input_section): For a
8815 SHT_ARM_EXIDX section, always keeps the input sections.
8816 (Arm_input_section::set_exidx_section_link): New method.
8817 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
8818 has_errors_ to false.
8819 (Arm_exidx_input_section::has_errors,
8820 Arm_exidx_input_section::set_has_errors): New methods.
8821 (Arm_exidx_input_section::has_errors_): New data member.
8822 (Arm_relobj::get_exidx_shndx_list): New method.
8823 (Arm_output_section::append_text_sections_to_list): Do not skip
8824 section without SHF_EXECINSTR.
8825 (Arm_output_section::fix_exidx_coverage): Skip input sections with
8826 errors.
2e702c99 8827 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
8828 section header. Make error messages more verbose. Check for
8829 a non-executable section linked to an EXIDX section.
8830 (Arm_relobj::do_read_symbols): Remove error checking, which has been
8831 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
8832 check that there is no deferred EXIDX section if we exit early.
8833 Instead of not making an EXIDX section in case of an error, make one
8834 and set the has_errors flag of it.
8835 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
8836 in a relocatable link.
8837 (Target_arm::do_relax): Look for the EXIDX output section instead of
8838 assuming that it is called .ARM.exidx.
2e702c99 8839 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
8840 section list. Do not check for SHF_EXECINSTR section flags but
8841 skip any input section with errors.
8842 * output.cc (Output_section::Output_section): Initialize
8843 always_keeps_input_sections_ to false.
8844 (Output_section::add_input_section): Check for
8845 always_keeps_input_sections_.
8846 * output.h (Output_section::always_keeps_input_sections,
8847 Output_section::set_always_keeps_input_sections): New methods.
8848 (Output_section::always_keeps_input_sections): New data member.
8849
69517287
RÁE
88502010-07-13 Rafael Espindola <espindola@google.com>
8851
8852 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
8853 * fileread.h (Input_file): Add try_extra_search_path and find_file.
8854
82742395
ILT
88552010-07-13 Philip Herron <herron.philip@googlemail.com>
8856 Ian Lance Taylor <iant@google.com>
8857
8858 * output.h (Output_section_lookup_maps::add_merge_section):
8859 Correct check of whether value was inserted.
8860 (Output_section_lookup_maps::add_merge_input_section): Likewise.
8861 (Output_section_lookup_maps::add_relaxed_input_section):
8862 Likewise.
8863 * arm.cc (Target_arm::got_section): Remove used local os.
8864 * i386.cc (Target_i386::got_section): Likewise.
8865 * x86_64.cc (Target_x86_64::got_section): Likewise.
8866 * sparc.cc (Target_sparc::got_section): Likewise.
8867 (Target_sparc::relocate): Remove unused local have_got_offset.
8868 * powerpc.cc (Target_powerpc::relocate): Likewise.
8869
f2d707b5
ILT
88702010-07-13 Ian Lance Taylor <iant@google.com>
8871
241531d6
ILT
8872 * compressed_output.cc (zlib_decompress): Fix signature in
8873 !HAVE_ZLIB_H case.
8874
f2d707b5
ILT
8875 * archive.cc (Archive::include_member): Unlock an external member
8876 of a thin archive. Don't bother to delete an object we know is
8877 NULL.
8878
a2e47362
CC
88792010-07-12 Cary Coutant <ccoutant@google.com>
8880
8881 * compressed_output.cc (zlib_decompress): New function.
8882 (get_uncompressed_size): New function.
8883 (decompress_input_section): New function.
8884 * compressed_output.h (get_uncompressed_size): New function.
8885 (decompress_input_section): New function.
8886 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
8887 Handle compressed debug sections.
8888 * layout.cc (is_compressed_debug_section): New function.
8889 (Layout::output_section_name): Map compressed section names to
8890 canonical names.
8891 * layout.h (is_compressed_debug_section): New function.
8892 (is_debug_info_section): Recognize compressed debug sections.
8893 * merge.cc: Include compressed_output.h.
8894 (Output_merge_data::do_add_input_section): Handle compressed
8895 debug sections.
8896 (Output_merge_string::do_add_input_section): Handle compressed
8897 debug sections.
8898 * object.cc: Include compressed_output.h.
8899 (Sized_relobj::Sized_relobj): Initialize new data members.
8900 (build_compressed_section_map): New function.
8901 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
8902 * object.h (Object::section_is_compressed): New method.
8903 (Object::do_section_is_compressed): New method.
8904 (Sized_relobj::Compressed_section_map): New type.
8905 (Sized_relobj::do_section_is_compressed): New method.
8906 (Sized_relobj::compressed_sections_): New data member.
8907 * output.cc (Output_section::add_input_section): Handle compressed
8908 debug sections.
8909 * reloc.cc: Include compressed_output.h.
8910 (Sized_relobj::write_sections): Handle compressed debug sections.
8911
ce279a62
CC
89122010-07-08 Cary Coutant <ccoutant@google.com>
8913
8914 * resolve.cc (Symbol_table::resolve): Remember whether undef was
8915 weak when resolving to a dynamic def.
8916 (Symbol_table::should_override): Add adjust_dyndef flag; set it
8917 for weak undef/dynamic def cases. Adjust callers.
8918 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
8919 undef_binding_weak_.
8920 (Symbol_table::sized_write_globals): Adjust symbol binding.
8921 (Symbol_table::sized_write_symbol): Add binding parameter.
8922 * symtab.h (Symbol::set_undef_binding): New method.
8923 (Symbol::is_undef_binding_weak): New method.
8924 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
8925 (Symbol_table::should_override): Add new parameter.
8926 (Symbol_table::sized_write_symbol): Add new parameter.
8927
8928 * testsuite/weak_undef_file1.cc: Add new test case.
8929 * testsuite/weak_undef_file2.cc: Fix header comment.
8930 * testsuite/weak_undef_test.cc: Add new test case.
8931
b2286c10
DK
89322010-06-29 Doug Kwan <dougkwan@google.com>
8933
8934 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
8935 Initialize USE_SYMBOL_.
8936 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
8937 definition.
8938 (Arm_reloc_property::uses_symbol_): New data member declaration.
8939 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
8940 uses symbol value and symbol is undefined but not weakly undefined.
8941
4802450a
RÁE
89422010-06-28 Rafael Espindola <espindola@google.com>
8943
8944 * plugin.cc (Plugin::load): Use dlerror.
8945
e5ca47ba
ILT
89462010-06-26 Jeffrey Yaskin <jyasskin@google.com>
8947
8948 * symtab.cc (detect_odr_violations): When reporting an ODR
8949 violation, report an object where the symbol is defined.
8950
8a75a161
DK
89512010-06-25 Doug Kwan <dougkwan@google.com>
8952
8953 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
8954 (Target_arm::section_may_have_icf_unsafe_pointers): New method
8955 definition.
8956 (Target_arm::Scan::local_reloc_may_be_function_pointer,
8957 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
8958 target hook to detect function points.
8959 (Target_arm::Scan::possible_function_pointer_reloc): New method.
8960 * icf.h (Icf::check_section_for_function_pointers): Change type of
8961 parameter SECTION_NAME to const reference to std::string. Use
8962 target hook to determine if section may have unsafe pointers.
8963 * target.h (Target::section_may_have_icf_unsafe_pointers): New
8964 method definition.
8965
42218b9f
RÁE
89662010-06-21 Rafael Espindola <espindola@google.com>
8967
8968 * fileread.cc (Input_file::find_fie): New
8969 (Input_file::open): Use Input_file::find_fie.
8970 * fileread.h (Input_file::find_fie): New
8971 * plugin.cc (set_extra_library_path): New.
8972 (Plugin::load): Add set_extra_library_path to the transfer vector.
8973 (Plugin_manager::set_extra_library_path): New.
8974 (Plugin_manager::add_input_file): Use the extra search path if set.
8975 (set_extra_library_path(): New.
8976 * plugin.h (Plugin_manager): Add set_extra_library_path and
8977 extra_search_path_.
8978
a0506cca
CC
89792010-06-19 Cary Coutant <ccoutant@google.com>
8980
8981 * layout.cc (gdb_sections): Add .debug_types.
8982 (lines_only_debug_sections): Likewise.
8983
6508b958
RÁE
89842010-06-18 Rafael Espindola <espindola@google.com>
8985
8986 * plugin.cc (add_input_file,add_input_library)
8987 (Plugin_manager::add_input_file): Make filename arguments const.
8988 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
8989 const.
8990
3e235302
DK
89912010-06-16 Doug Kwan <dougkwan@google.com>
8992
8993 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
8994 .ARM.attributes section if we have not merged any input
8995 attributes sections.
8996
106e8a6c
DK
89972010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8998
8999 * arm.cc: Allow combining objects with no EABI version
9000 information.
9001
91ff43fe
RÁE
90022010-06-15 Rafael Espindola <espindola@google.com>
9003
9004 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
9005
68ed838c
ILT
90062010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9007
9008 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
9009 (struct iovec): Correct !HAVE_READV definition.
9010
f3a2388f
CC
90112010-06-10 Cary Coutant <ccoutant@google.com>
9012
9013 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
9014 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
9015 reloc sections.
9016 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
9017
9018 PR 11683
9019 * symtab.h (Symbol::is_placeholder): New member function.
9020 * target-reloc.h (relocate_section): Check for placeholder symbols.
9021
9022 * testsuite/Makefile.am (plugin_test_8): New test.
9023 (plugin_test_9): New test.
9024 * testsuite/Makefile.in: Regenerate.
9025
e1df38aa
NC
90262010-06-09 Nick Clifton <nickc@redhat.com>
9027
9028 * yyscript.y (input_list_element): Allow strings prefixed with
9029 the '-' character. Treat these as libraries.
9030 * script.cc (script_add_library): New function. Adds a library
9031 specified by "-l<name>" found in an input script.
9032 * script-c.h: Add prototype for script_add_library.
9033
25bbe950
DK
90342010-06-07 Doug Kwan <dougkwan@google.com>
9035
9036 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
9037 Restrict stub-group size to be within long conditional branch
9038 range when working around cortex-A8 erratum.
9039
0f32ea4c
ILT
90402010-06-07 Damien Diederen <dd@crosstwine.com>
9041
9042 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
9043 #ifdef typo.
9044
8fe2a369
ST
90452010-06-03 Sriraman Tallam <tmsriram@google.com>
9046
9047 PR gold/11658
9048 * output.cc
9049 (Output_section::Input_section_sort_entry::compare_section_ordering):
9050 Change to return non-zero correctly.
9051 (Output_section::Input_section_sort_section_order_index_compare
9052 ::operator()): Change to fix ambiguity in comparisons.
9053
6e9ba2ca
ST
90542010-06-01 Sriraman Tallam <tmsriram@google.com>
9055
9056 * gold.h (is_wildcard_string): New function.
9057 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
9058 (Layout::layout_eh_frame): Ditto.
9059 (Layout::find_section_order_index): New method.
9060 (Layout::read_layout_from_file): New method.
9061 * layout.h (Layout::find_section_order_index): New method.
9062 (Layout::read_layout_from_file): New method.
9063 (Layout::input_section_position_): New private member.
9064 (Layout::input_section_glob_): New private member.
9065 * main.cc (main): Call read_layout_from_file here.
9066 * options.h (--section-ordering-file): New option.
9067 * output.cc (Output_section::input_section_order_specified_): New
9068 member.
9069 (Output_section::Output_section): Initialize new member.
9070 (Output_section::add_input_section): Add new parameter.
9071 Keep input sections when --section-ordering-file is used.
9072 (Output_section::set_final_data_size): Sort input sections when
9073 section ordering file is specified.
9074 (Output_section::Input_section_sort_entry): Add new parameter.
9075 Check sorting type.
9076 (Output_section::Input_section_sort_entry::compare_section_ordering):
9077 New method.
9078 (Output_section::Input_section_sort_compare::operator()): Change to
9079 consider section_order_index.
9080 (Output_section::Input_section_sort_init_fini_compare::operator()):
9081 Change to consider section_order_index.
9082 (Output_section::Input_section_sort_section_order_index_compare
9083 ::operator()): New method.
9084 (Output_section::sort_attached_input_sections): Change to sort
9085 according to section order when specified.
e1df38aa
NC
9086 (Output_section::add_input_section<32, true>): Add new parameter.
9087 (Output_section::add_input_section<64, true>): Add new parameter.
9088 (Output_section::add_input_section<32, false>): Add new parameter.
9089 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
9090 * output.h (Output_section::add_input_section): Add new parameter.
9091 (Output_section::input_section_order_specified): New
9092 method.
9093 (Output_section::set_input_section_order_specified): New method.
9094 (Input_section::Input_section): Initialize section_order_index_.
9095 (Input_section::section_order_index): New method.
9096 (Input_section::set_section_order_index): New method.
9097 (Input_section::section_order_index_): New member.
9098 (Input_section::Input_section_sort_section_order_index_compare): New
9099 struct.
9100 (Output_section::input_section_order_specified_): New member.
9101 * script-sections.cc (is_wildcard_string): Delete and move modified
9102 method to gold.h.
9103 (Output_section_element_input::Output_section_element_input): Modify
9104 call to is_wildcard_string.
9105 (Output_section_element_input::Input_section_pattern
9106 ::Input_section_pattern): Ditto.
9107 (Output_section_element_input::Output_section_element_input): Ditto.
9108 * testsuite/Makefile.am (final_layout): New test case.
9109 * testsuite/Makefile.in: Regenerate.
9110 * testsuite/final_layout.cc: New file.
9111 * testsuite/final_layout.sh: New file.
9112
3537c84b
RÁE
91132010-06-01 Rafael Espindola <espindola@google.com>
9114
9115 * plugin.cc (Plugin::load): Pass the output name to the plugin.
9116
105b6afd
RÁE
91172010-06-01 Rafael Espindola <espindola@google.com>
9118
9119 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
9120 visibility of symbols.
9121
29e11421
DK
91222010-05-27 Doug Kwan <dougkwan@google.com>
9123
9124 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
9125 from start of output section instead of address for a local symbol
9126 in a merged or relaxed section when doing a relocatable link.
9127
5e0f337e
RÁE
91282010-05-26 Rafael Espindola <espindola@google.com>
9129
703d02da 9130 PR 11604
5e0f337e
RÁE
9131 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
9132 adding sections the garbage collector removed.
9133 * gold/testsuite/Makefile.am: Add test.
9134 * gold/testsuite/Makefile.in: Regenerate.
9135 * gold/testsuite/plugin_test_7.sh: New.
9136 * gold/testsuite/plugin_test_7_1.c: New.
9137 * gold/testsuite/plugin_test_7_2.c: New.
9138
f4187277
RÁE
91392010-05-26 Rafael Espindola <espindola@google.com>
9140
9141 * script-sections.cc (Output_section_definition::set_section_addresses):
9142 Check for --section-start.
9143
5c388529
DK
91442010-05-26 Doug Kwan <dougkwan@google.com>
9145
9146 * arm.cc (Arm_scan_relocatable_relocs): New class.
9147 (Target_arm::relocate_special_relocatable): New method.
9148 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
9149 (Arm_relocate_functions::thumb_branch_common): Same.
9150 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
9151 instead of Default_scan_relocatable_relocs.
9152 * target-reloc.h (relocate_for_relocatable): Let target handle
9153 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
9154 * target.h (Sized_target::relocate_special_relocatable): New method.
9155
bca1c3ae
ILT
91562010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9157
9158 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
9159
0439c796
DK
91602010-05-23 Doug Kwan <dougkwan@google.com>
9161
9162 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
9163 instead of a cast.
9164 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
9165 with a direct branch, not a conditional branch, to a stub.
9166 * merge.cc (Output_merge_base::record_input_section): New method
9167 defintion.
9168 (Output_merge_data::do_add_input_section): Record input section if
9169 keeps-input-sections flag is set.
9170 (Output_merge_string::do_add_input_section): Ditto.
9171 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
9172 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
9173 INPUT_SECTIONS_.
9174 (Output_merge_base::keeps_input_sections,
9175 Output_merge_base::set_keeps_input_sections,
9176 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
9177 method definitions.
9178 (Output_merge_base::Input_sections): New type declaration.
9179 (Output_merge_base::input_sections_begin,
9180 Output_merge_base::input_sections_end,
9181 Output_merge_base::do_set_keeps_input_sections): New method definitions.
9182 (Output_merge_base::bool keeps_input_sections_,
9183 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
9184 Output_merge_base::input_sections_): New data members.
9185 (Output_merge_data::do_set_keeps_input_sections): New method
9186 defintion.
9187 (Output_merge_string::do_set_keeps_input_sections): Ditto.
9188 * output.cc (Output_section::Input_section::relobj): Move method
9189 defintion from class declaration to here and handle merge sections.
9190 (Output_section::Input_section::shndx): Ditto.
9191 (Output_section::Output_section): Remove initializations of removed
9192 data members and initialize new data member LOOKUP_MAPS_.
9193 (Output_section::add_input_section): Set keeps-input-sections flag
9194 for a newly created merge output section as appropriate. Adjust code
9195 to use Output_section_lookup_maps class.
9196 (Output_section::add_relaxed_input_section): Adjst code for lookup
9197 maps code refactoring.
2e702c99 9198 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
9199 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
9200 class. If adding input section to a newly created merge output
9201 section fails, remove the new merge section.
9202 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 9203 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 9204 (Output_section::find_merge_section): Ditto.
0439c796 9205 (Output_section::build_lookup_maps): New method defintion.
2e702c99 9206 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
9207 Output_section_lookup_maps class.
9208 (Output_section::get_input_sections): Export merge sections. Adjust
9209 code to use Output_section_lookup_maps class.
9210 (Output_section:::add_script_input_section): Adjust code to use
9211 Output_section_lookup_maps class. Update lookup maps for merge
9212 sections also.
9213 (Output_section::discard_states): Use Output_section_lookup_maps.
9214 (Output_section::restore_states): Same.
9215 * output.h (Merge_section_properties): Move class defintion out of
9216 Output_section.
9217 (Output_section_lookup_maps): New class.
9218 (Output_section::Input_section::is_merge_section): New method
9219 defintion.
9220 (Output_section::Input_section::relobj): Move defintion out of class
9221 defintion. Declare method only.
9222 (Output_section::Input_section::shndx): Ditto.
9223 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 9224 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
9225 (Output_section::Merge_section_by_properties_map,
9226 Output_section::Output_section_data_by_input_section_map,
9227 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
9228 Remove types.
2e702c99 9229 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
9230 KEEPS_INPUT_SECTIONS.
9231 (Output_section::build_lookup_maps): New method declaration.
9232 (Output_section::merge_section_map_,
9233 Output_section::merge_section_by_properties_map_,
9234 Output_section::relaxed_input_section_map_,
9235 Output_section::is_relaxed_input_section_map_valid_): Remove data
9236 members.
9237 (Output_section::lookup_maps_): New data member.
9238
76295588
L
92392010-05-21 Doug Kwan <dougkwan@google.com>
9240
9241 PR gold/11619
9242 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
9243 avoid a compilation error.
9244
d103a984
RÁE
92452010-05-19 Rafael Espindola <espindola@google.com>
9246
9247 * script-sections.cc (Output_section_definition::allocate_to_segment):
9248 Update the phdrs_list even when the output section is NULL.
9249 * testsuite/Makefile.am: Add test.
9250 * testsuite/Makefile.in: Regenerate.
9251 * testsuite/script_test_9.cc: New.
9252 * testsuite/script_test_9.sh: New.
9253 * testsuite/script_test_9.t: New.
9254
6625d24e
DK
92552010-05-19 Doug Kwan <dougkwan@google.com>
9256
9257 * arm.cc (Arm_input_section::original_size): New method.
9258 (Arm_input_section::do_addralign): Add a cast.
9259 (Arm_input_section::do_output_offset): Remove static cast.
9260 (Arm_input_section::original_addralign,
9261 Arm_input_section::original_size_): Change type to uint32_t.
9262 (Arm_input_section::init): Add safe casts for section alignment
9263 and size.
9264 (Arm_input_section::set_final_data_size): Do not set address and
9265 offset of stub table.
9266 (Arm_output_section::fix_exidx_coverage): Change use of of
9267 Output_section::Simple_input_section to that of
9268 Output_section::Input_section.
9269 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
9270 except for the first pass.
9271 * output.cc (Output_section::get_input_sections): Change type of
9272 input_sections to std::list<Input_section>.
9273 (Output_section::add_script_input_section): Rename from
9274 Output_section::add_simple_input_section. Change type of SIS
9275 parameter from Simple_input_section to Input_section.
9276 * output.h (Output_section::Simple_input_section): Remove class.
9277 (Output_section::Input_section): Change class visibility to public.
9278 (Output_section::Input_section::addralign): Use stored alignments
9279 for special input sections if set.
9280 (Output_section::Input_section::set_addralign): New method.
9281 (Output_section::get_input_sections): Change parameter type from
9282 list of Simple_input_section to list of Input_section.
9283 (Output_section::add_script_input_section): Rename from
9284 Output_section::add_simple_input_section. Change first parameter's
9285 type from Simple_input_section to Input_section and remove the
9286 second and third parameters.
9287 * script-sections.cc (Input_section::Input_section_list): Change
9288 type to list of Output_section::Input_section/
9289 (Input_section_info::Input_section_info): Change parameter type of
9290 INPUT_SECTION to Output_section::Input_section.
9291 (Input_section_info::input_section): Change return type.
9292 (Input_section_info::input_section_): Change type to
9293 Output_section::Input_section.
9294 (Output_section_element_input::set_section_addresses): Adjust code
9295 to use Output_section::Input_section instead of
9296 Output_section::Simple_input_section. Adjust code for renaming
9297 of Output_section::add_simple_input_section.
9298 (Orphan_output_section::set_section_addresses): Ditto.
9299
e1e82ea4
RW
93002010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9301
9302 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
9303 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
9304
91e75c8a
RÁE
93052010-05-18 Rafael Espindola <espindola@google.com>
9306
9307 * options.cc (General_options::finalize): Handle -nostdlib.
9308 * options.h (nostdlib): New option.
9309 * script.cc (script_add_search_dir): Handle -nostdlib.
9310
da59ad79
DK
93112010-05-12 Doug Kwan <dougkwan@google.com>
9312
9313 * arm.cc (Target_arm::do_finalize_sections): Create an empty
9314 attributes section only if there no attributes section after merging.
9315 (Target_arm::merge_object_attributes): Move value of
e1df38aa 9316 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
9317 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
9318 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
9319 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
9320 and arm_attr_merge_7.stdout.
9321 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
9322 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
9323 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
9324 arm_attr_merge_7b.o): New rules.
9325 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
9326 arm_attr_merge_7
9327 * testsuite/Makefile.in: Regenerate.
9328 * testsuite/arm_attr_merge.sh: New file.
9329 * testsuite/arm_attr_merge_[67][ab].s: Same.
9330
3e01a7fd
NC
93312010-05-05 Nick Clifton <nickc@redhat.com>
9332
9333 * po/es.po: Updated Spanish translation.
9334
7ad2014a
L
93352010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9336
9337 * Makefile.am (install-exec-local): Properly install gold as
9338 default cross linker.
9339 * Makefile.in: Regenerated.
9340
4fda8867
NC
93412010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9342 Nick Clifton <nickc@redhat.com>
9343
9344 * configure.ac (install_as_default): Define and set to false
9345 unless --enable-gold or --enable-gold=both/gold has been
9346 specified.
9347 * configure: Regenerate.
9348
9349 * Makefile.am (install-exec-local): Install the executable as
9350 'ld.gold'. If install_as_default is true then also install it as
9351 'ld'.
9352 * Makefile.in: Regenerated.
9353
bd288ea2
ILT
93542010-04-24 Ian Lance Taylor <iant@google.com>
9355
9356 * layout.cc (Layout::layout_reloc): In relocatable link don't
9357 combine reloc sections for grouped sections.
9358
ef38fd8a
ST
93592010-04-23 Sriraman Tallam <tmsriram@google.com>
9360
9361 * gc.h (gc_process_relocs): Pass information on relocs pointing to
9362 sections that are not ordinary to icf.
9363 * icf.cc (get_section_contents): Handle relocation pointing to section
9364 with no object or shndx information.
9365 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
9366 * testsuite/Makefile.in: Regenerate.
9367 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
9368 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
9369
f6973bdc
ILT
93702010-04-22 Ian Lance Taylor <iant@google.com>
9371
9372 * expression.cc (Expression::Expression_eval_info): Add
9373 result_alignment_pointer field.
9374 (Expression::eval_with_dot): Add result_alignment_pointer
9375 parameter. Change all callers.
9376 (Expression::eval_maybe_dot): Likewise.
9377 (class Binary_expression): Add alignment_pointer parameter to
9378 left_value and right_value. Change all callers.
9379 (BINARY_EXPRESSION): Set result alignment.
9380 (class Trinary_expression): Add alignment_pointer parameter to
9381 arg2_value and arg3_value. Change all callers.
9382 (Trinary_cond::value): Set result alignment.
9383 (Max_expression::value, Min_expression::value): Likewise.
9384 (Align_expression::value): Likewise.
9385 * script-sections.cc (class Sections_element): Add dot_alignment
9386 parameter to set_section_addresses virtual function. Update
9387 instantiations.
9388 (class Output_section_element): Likewise.
9389 (Script_sections::create_segments): Add dot_alignment parameter.
9390 Change all callers.
9391 (Script_sections::create_segments_from_phdrs_clause): Likewise.
9392 (Script_sections::set_phdrs_clause_addresses): Likewise.
9393 * script-sections.h: Update declarations.
9394 * script.h: Update declarations.
9395 * output.h (Output_segment::set_minimum_p_align): Don't decrease
9396 min_p_align.
9397 * testsuite/script_test_3.t: Set large alignment.
9398 * testsuite/script_test_3.sh: Make sure that at least one LOAD
9399 segment has expected alignment.
9400
9c9c98a5
NC
94012010-04-22 Nick Clifton <nickc@redhat.com>
9402
9403 * po/gold.pot: Updated by the Translation project.
9404 * po/vi.po: Updated Vietnamese translation.
9405
2253bfba
L
94062010-04-22 H.J. Lu <hongjiu.lu@intel.com>
9407
9408 * testsuite/Makefile.am (check_PROGRAMS): Add
9409 icf_virtual_function_folding_test.
9410 * testsuite/Makefile.in: Regenerated.
9411
85fdf906
AH
94122010-04-15 Andrew Haley <aph@redhat.com>
9413
9414 * options.h (merge_exidx_entries): New option.
9415 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
9416 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
9417 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
9418 (Target_arm::merge_exidx_entries): New function.
9419 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
9420 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
9421 to Arm_exidx_fixup constructor.
9422 Add new arg, merge_exidx_entries.
9423 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
9424 Arm_output_section::fix_exidx_coverage.
9425
ce97fa81
ST
94262010-04-18 Sriraman Tallam <tmsriram@google.com>
9427
9428 * icf.cc (get_section_contents): Check for preemptible functions.
9429 Ignore addend when appropriate.
9430 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
9431 section folded.
9432 (add_from_relobj): Check for section folded.
9433 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
9434 * symtab.h (should_add_dynsym_entry): Add new parameter.
9435 * target-reloc.h (scan_relocs): Check for section folded.
9436 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
9437 Check reloc types for function pointers in shared objects.
9438 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
9439 case.
9440 (icf_preemptible_functions_test): New test case.
9441 (icf_string_merge_test): New test case.
9442 * testsuite.Makefile.in: Regenerate.
9443 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
9444 bar_glob. Refactor code.
9445 * testsuite/icf_preemptible_functions_test.cc: New file.
9446 * testsuite/icf_preemptible_functions_test.sh: New file.
9447 * testsuite/icf_string_merge_test.cc: New file.
9448 * testsuite/icf_string_merge_test.sh: New file.
9449 * testsuite/icf_virtual_function_folding_test.cc: New file.
9450 * testsuite/icf_virtual_function_folding_test.sh: New file.
9451
04ceb17c
DK
94522010-04-14 Doug Kwan <dougkwan@google.com>
9453
9454 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
9455 for local symbol recounting if we remove a section due to ICF.
9456 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
9457 there are no regular objects in input.
9458
153e7da4
DK
94592010-04-13 Doug Kwan <dougkwan@google.com>
9460
9461 * arm.cc (Arm_input_section::set_final_data_size): Compute
9462 accurate final data size instead of using current data size.
9463
4dbd9faf
DK
94642010-04-09 Doug Kwan <dougkwan@google.com>
9465
9466 * layout.cc (Layout::choose_output_section): Handle script section
9467 types.
9468 (Layout::make_output_section_for_script): Add section type parameter.
9469 Handle script section types.
9470 * layout.h (Layout::make_output_section_for_script): Add section
9471 type parameter.
9472 * output.cc (Output_section::Output_section): Initialize data member
9473 is_noload_.
9474 (Output_section::do_reset_address_and_file_offset): Do not set address
9475 to 0 if section is a NOLOAD section.
9476 * output.h (Output_section::is_noload): New method.
9477 (Output_section::set_is_noload): Ditto.
9478 (Output_section::is_noload_): New data member.
9479 * script-c.h (Script_section_type): New enum type.
9480 (struct Parser_output_section_header): Add new file section_type.
9481 * script-sections.cc (Sections_element::output_section_name): Add
9482 parameter for returning script section type.
9483 (Output_section_definition::output_section_name): Ditto.
9484 (Output_section_definition::section_type)P; New method.
9485 (Output_section_definiton::script_section_type_name): Ditto.
9486 (Output_section_definition::script_section_type_): New data member.
9487 (Output_section_definition::Output_section_definition): Initialize
9488 data member Output_section_definition::script_section_type_.
9489 (Output_section_definition::create_sections): Pass script section type
9490 to Layout::make_output_section_for_script.
9491 (Output_section_definition::output_section_name): Return script
9492 section type to caller.
9493 (Output_section_definition::set_section_address): Do not advance
9494 dot value and load address if section type is NOLOAD. Set address
9495 of NOLOAD sections regardless of section flags.
9496 (Output_section_definition::print): Print section type if it is
9497 not SCRIPT_SECTION_TYPE_NONE.
9498 (Output_section_definition::section_type): New method.
9499 (Output_section_definition::script_section_type_name): Ditto.
9500 (Script_sections::output_section_name): Add new parameter
9501 PSECTION_TYPE for returning script section type. Pass it to
9502 section elements. Handle discard sections.
9503 (Sort_output_sections::operator()): Handle NOLOAD sections.
9504 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 9505 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
9506 returning script section type.
9507 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
9508 INFO and NOLOAD.
9509 * yyscript.y (union): Add new field SECTION_TYPE.
9510 (COPY, DSECT, INFO, NOLOAD): New tokens.
9511 (opt_address_and_section_type): Change type to output_section_header.
9512 (section_type): New non-terminal
9513 (section_header): Handle section type.
2253bfba 9514 (opt_address_and_section_type): Return section type value.
4dbd9faf 9515
721ea635
L
95162010-04-09 H.J. Lu <hongjiu.lu@intel.com>
9517
9518 * testsuite/plugin_common_test_1.c (foo): Add prototype.
9519 * testsuite/plugin_common_test_2.c (foo): Likewise.
9520
6bf924b0
DK
95212010-04-08 Doug Kwan <dougkwan@google.com>
9522
9523 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
9524 Output_merge_data.
9525 * output.cc (Output_section::add_merge_input_section): Simplify
9526 code and return status of Output_merge_base::add_input_section.
e1df38aa 9527 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
9528 returns true.
9529
24af6f92
DK
95302010-04-07 Doug Kwan <dougkwan@google.com>
9531
9532 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
9533 if section is marked as containing instructions but has no mapping
9534 symbols.
9535 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
9536 correct section index.
9537 (Arm_relobj::find_linked_text_section): Ditto.
9538
00698fc5
CC
95392010-04-07 Cary Coutant <ccoutant@google.com>
9540
9541 * archive.cc (include_member): Destroy Read_symbols_data object before
9542 releasing file.
9543 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
9544 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
9545 (Read_symbols_data::~Read_symbols_data) New destructor.
9546 (Section_relocs::Section_relocs) New constructor.
9547 (Section_relocs::~Section_relocs) New destructor.
9548 (Read_relocs_data::Read_relocs_data) New constructor.
9549 (Read_relocs_data::~Read_relocs_data) New destructor.
9550 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
9551 pointers to NULL after deleting.
9552
7296d933
DK
95532010-04-07 Doug Kwan <dougkwan@google.com>
9554
9555 * arm.cc: Replace "endianity" with "endianness" in comments.
9556 (Arm_exidx_cantunwind): Ditto.
9557 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
9558 (Arm_relobj::merge_flags_and_attributes): New method.
9559 (Arm_relobj::merge_flags_and_attributes_): New data member.
9560 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
9561 (Arm_relobj::scan_sections_for_stubs): Ditto.
9562 (Arm_relobj::do_read_symbols): Check to see if we really want to
9563 merge processor-specific flags and attributes. Exit early if
9564 an object is empty except for section names and the undefined symbol.
9565 (Target_arm::do_finalize_sections): Move check for ELF format to
9566 Arm_relobj::do_read_symbols. Merge processor specific flags and
9567 attributes from a regular object only when we have determined that
9568 it is aapropriate. Do not create an .ARM.attributes section in
9569 output if there is no regular input object.
9570 (Target_arm::merge_processor_specific_flags): Check
9571 --warn-mismatch before printing any error.
9572 (Target_arm::merge_object_attributes): Ditto.
9573 * gold.cc (queue_middle_tasks): Handle the case in which there is
9574 no regular object in input.
9575 * options.cc (General_options::parse_EB): New method.
9576 (General_options::parse_EL): Same.
9577 (General_options::General_options): Initialize endianness_.
9578 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
9579 New options.
9580 (General_options::Endianness): New enum.
9581 (General_options::endianness): New method.
9582 (General_options::endianness_): New data member.
9583 * parameters.cc (Parameters::set_options): Check target endianness.
9584 (Parameters::set_target_once): Ditto.
9585 (Parameters::check_target_endianness): New method.
9586 (parameters_force_valid_target): If either -EL or -EB is specified,
9587 use it to define endianness of default target.
9588 * parameters.h (Parameters::check_target_endianness): New method
9589 declaration.
9590 * target.h (class Target): Change "endianity" to "endianness"
9591 in comments.
9592
efc8d4f2
RW
95932010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9594
9595 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
9596 * configure: Regenerate.
9597 * Makefile.in: Regenerate.
9598 * testsuite/Makefile.in: Regenerate.
9599
be234d88
CC
96002010-04-06 Cary Coutant <ccoutant@google.com>
9601
9602 gcc PR lto/42757
9603 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
9604 prevailing definitions of common symbols.
9605 * testsuite/plugin_test_6.sh: New test case.
9606 * testsuite/plugin_common_test_1.c: New test case.
9607 * testsuite/plugin_common_test_2.c: New test case.
9608 * testsuite/Makefile.am (plugin_test_6): New test case.
9609 * testsuite/Makefile.in: Regenerate.
9610
bd32c6bd
NC
96112010-04-06 Nick Clifton <nickc@redhat.com>
9612
9613 * po/vi.po: New Vietnamese translation.
9614
323c532f
DK
96152010-03-30 Doug Kwan <dougkwan@google.com>
9616
9617 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
9618
4fcd97eb
DK
96192010-03-25 Doug Kwan <dougkwan@google.com>
9620
9621 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
9622 to avoid a conversion warning on a 32-bit host.
9623
4ebf39db
ILT
96242010-03-24 Ian Lance Taylor <iant@google.com>
9625
9626 * testsuite/script_test_3.t: Add a TLS segment.
9627 * testsuite/Makefile.am (check_PROGRAMS): Add
9628 tls_phdrs_script_test.
9629 (tls_phdrs_script_test_SOURCES): Define.
9630 (tls_phdrs_script_test_DEPENDENCIES): Define.
9631 (tls_phdrs_script_test_LDFLAGS): Define.
9632 (tls_phdrs_script_test_LDADD): Define.
9633 * testsuite/Makefile.in: Rebuild.
9634
4a599bdd
CC
96352010-03-23 Cary Coutant <ccoutant@google.com>
9636
9637 * fileread.cc (find_or_make_view): Fix comment.
9638
6c93b22c
ILT
96392010-03-23 Ian Lance Taylor <iant@google.com>
9640
9641 * script-sections.cc (class Orphan_section_placement): Define
9642 PLACE_TLS and PLACE_TLS_BSS.
9643 (Orphan_section_placement::Orphan_section_placement): Initialize
9644 new places.
9645 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
9646 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
9647 (tls_script_test_SOURCES): Define.
9648 (tls_script_test_DEPENDENCIES): Define.
9649 (tls_script_test_LDFLAGS): Define.
9650 (tls_script_test_LDADD): Define.
9651 * testsuite/Makefile.in: Rebuild.
9652
a2c7281b
DK
96532010-03-22 Doug Kwan <dougkwan@google.com>
9654
9655 * arm.cc (Arm_relocate_functions::abs8,
9656 Arm_relocate_functions::abs16): Use correct check for overflow
9657 specified in the ARM ELF specs.
9658 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
9659 target of a BLX instruction specially.
9660 (Reloc_stub::stub_type_for_reloc): Ditto.
9661 (Relocate::relocate): Use symbolic names instead of numeric relocation
9662 codes to report error.
9663 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
9664 workaround.
9665 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
9666 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
9667 thumb2_blx_out_of_range.stdout
9668 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
9669 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
9670 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
9671 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
9672 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
9673 thumb2_blx_in_range, thumb2_blx_in_range.o,
9674 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
9675 thumb2_blx_out_of_range.o): New rules.
2e702c99 9676 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
9677 thumb2_blx_in_range and thumb2_blx_out_of_range.
9678 * testsuite/Makefile.in: Regenerate.
9679 * arm_branch_in_range.sh: Add tests for THUMB BLX.
9680 * testsuite/thumb_blx_in_range.s: New file.
9681 * testsuite/thumb_blx_out_of_range.s: New file.
9682
b0193076
RÁE
96832010-03-22 Rafael Espindola <espindola@google.com>
9684
9685 * archive.cc (Should_include): Move to archive.h.
9686 (should_include_member): Make it a member of Archive.
9687 (Lib_group): New.
9688 (Add_lib_group_symbols): New.
9689 * archive.h: Include options.h.
9690 (Archive_member): Moved from Archive.
9691 (Should_include): Moved from archive.cc.
9692 (Lib_group): New.
9693 (Add_lib_group_symbols): New.
9694 * dynobj.cc (do_should_include_member): New.
9695 * dynobj.h (do_should_include_member): New.
9696 * gold.cc (queue_initial_tasks): Update call to queue.
9697 * main.cc (main): Print lib group stats.
9698 * object.cc (do_should_include_member): New.
9699 * object.h: Include archive.h.
9700 (Object::should_include_member): New.
9701 (Object::do_should_include_member): New.
9702 (Sized_relobj::do_should_include_member): New.
9703 * options.cc (General_options::parse_start_lib): New.
9704 (General_options::parse_end_lib): New.
9705 (Input_arguments::add_file): Handle lib groups.
9706 (Input_arguments::start_group): Check we are not in a lib.
9707 (Input_arguments::start_lib): New.
9708 (Input_arguments::end_lib): New.
9709 * options.h (General_options): Add start_lib and end_lib.
9710 (Input_argument::lib_): New.
9711 (Input_argument::lib): New.
9712 (Input_argument::is_lib): New.
9713 (Input_file_lib): New.
9714 (Input_arguments::in_lib_): New.
9715 (Input_arguments::in_lib): New.
9716 (Input_arguments::start_lib): New.
9717 (Input_arguments::end_lib_): New.
9718 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
9719 in unused members as preempted.
9720 (Sized_pluginobj::do_should_include_member): New.
9721 * plugin.h (Sized_pluginobj::do_should_include_member): New.
9722 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
9723 return the blocker.
9724 (Read_symbols::do_whole_lib_group): New.
9725 (Read_symbols::do_lib_group): New.
9726 (Read_symbols::do_read_symbols): Handle lib groups.
9727 (Read_symbols::get_name): Handle lib groups.
9728 * readsyms.h (Read_symbols): Add an archive member pointer.
9729 (Read_symbols::do_whole_lib_group): New.
9730 (Read_symbols::do_lib_group): New.
9731 (Read_symbols::member_): New.
9732 * script.cc (read_input_script): Update call to queue_soon.
9733
d099120c
DK
97342010-03-19 Doug Kwan <dougkwan@google.com>
9735
9736 * arm.cc (Stub_table::Stub_table): Initialize new data members
9737 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9738 (Stub_table::add_reloc_stub): Assign stub offset and update
9739 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9740 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
9741 New data members.
2e702c99 9742 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
9743 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
9744 instead of going over all reloc stubs.
2e702c99 9745 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
9746 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9747 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 9748 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
9749 Stringpool_template::offset_.
9750 * stringpool.h (Stringpool_template::set_no_zero_null): Set
9751 Stringpool_template::offset_ to zero.
9752
1aa37384
DK
97532010-03-15 Doug Kwan <dougkwan@google.com>
9754
9755 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9756 offset_.
9757 (Stringpool_template::new_key_offset): New method.
9758 (Stringpool_template::add_string): Assign offsets when adding new
9759 strings.
9760 (Stringpool_template::set_string_offsets): Do not set string offsets
9761 when not optimizing.
9762 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
9763 member size_.
2e702c99
RM
9764 (Chunked_vector::clear): Clear size_.
9765 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
9766 (Chunked_vector::size): Return size_.
9767 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 9768 (Chunked_vector::size_): New data member.
1aa37384
DK
9769 (Stringpool_template::set_no_zero_null): Assert string set is empty.
9770 (Stringpool_template::new_key_offset): New method declaration.
9771 (Stringpool_template::offset_): New data member.
9772
b672b057
RÁE
97732010-03-15 Rafael Espindola <espindola@google.com>
9774
9775 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
9776 Add_symbols' constructor.
9777 * readsyms.h (Add_symbols): Remove the input_group member.
9778
b6848d3c
ILT
97792010-03-10 Ian Lance Taylor <iant@google.com>
9780
9781 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
9782 target to ask whether a reference to a symbol requires a stack
9783 split.
9784 * target.h (Target::is_call_to_non_split): New function.
9785 (Target::do_is_call_to_non_split): Declare virtual function.
9786 * target.cc: Include "symtab.h".
9787 (Target::do_is_call_to_non_split): New function.
9788 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
9789
a2a5469e
CC
97902010-03-10 Cary Coutant <ccoutant@google.com>
9791
9792 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
9793 (File_read::open[1]): Remove initial mapping of whole_file_view_.
9794 (File_read::open[2]): Add whole_file_view_ to list of views.
9795 (File_read::make_view): Remove test of whole_file_view_.
9796 (File_read::find_or_make_view): Create whole_file_view_ if
9797 necessary.
9798 (File_read::clear_views): Replace bool parameter with enum;
9799 adjust all callers. Don't delete views with permanent data;
9800 do delete cached views and views from archives if
9801 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
9802 if clearing the corresponding view.
9803 * fileread.h (File_read::Clear_views_mode): New enum.
9804 (File_read::View::is_permanent_view): New method.
9805 (File_read::clear_views): Replace bool parameter
9806 with enum; adjust all callers.
9807 * options.h (General_options): Change keep_files_mapped option;
9808 add map_whole_files.
9809 * readsyms.cc (Add_symbols::run): Delete sd_ object before
9810 releasing the file.
9811 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
9812 the file.
9813
8861f32b
DM
98142010-03-10 David S. Miller <davem@davemloft.net>
9815
9816 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
9817
d62d0f5f
ST
98182010-03-09 Sriraman Tallam <tmsriram@google.com>
9819
9820 * icf.cc (get_section_contents): Add '@' marker after processing the
9821 merge reloc.
9822
9177756d
DK
98232010-03-08 Doug Kwan <dougkwan@google.com>
9824
9825 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
9826 due to a conversion warning.
9827 (Arm_relobj::update_output_local_symbol_count): Check for local
9828 symbol with unset output index.
9829
9e9e071b
ILT
98302010-03-05 Ian Lance Taylor <iant@google.com>
9831
9832 * options.h (class General_options): Add --spare-dynamic-tags.
9833 * output.cc (Output_data_dynamic::set_final_data_size): Implement
9834 --spare-dynamic-tags.
9835
a81ee015
ILT
98362010-03-05 Ian Lance Taylor <iant@google.com>
9837
9838 * incremental.cc: Include "libiberty.h".
9839
44ec90b9
RO
98402010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
9841
9842 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
9843 function, is_info_ member.
9844 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
9845 (Versions::Versions): Update caller.
9846 (Versions::define_base_version): Likewise.
9847 (Versions::add_def): Likewise.
9848
0897ed3b
ST
98492010-03-03 Sriraman Tallam <tmsriram@google.com>
9850
9851 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
9852 (Scan::possible_function_pointer_reloc): New function.
9853 (Scan::local_reloc_may_be_function_pointer): Change to call
9854 possible_function_pointer_reloc.
9855 (Scan::global_reloc_may_be_function_pointer): Ditto.
9856 * icf.h (Icf::check_section_for_function_pointers): Change to reject
9857 relocations in ".data.rel.ro._ZTV" section.
9858 * testsuite/icf_safe_so_test.sh: Change to pass i386.
9859 * testsuite/icf_safe_so_test.cc: Ditto.
9860 * testsuite/icf_safe_test.cc: Ditto.
9861 * testsuite/icf_safe_test.sh: Ditto.
9862
d3bbad62
ILT
98632010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9864 Ian Lance Taylor <iant@google.com>
9865
9866 * target-reloc.h (relocate_section): Check the symbol table index
9867 for -1U before setting the local symbol index.
9868 (scan_relocatable_relocs): If copying the relocation, record that
9869 the local symbol is required.
9870 * object.h (Symbol_value::is_output_symtab_index_set): New
9871 function.
9872 (Symbol_value::may_be_discarded_from_output_symtab): New
9873 function.
9874 (Symbol_value::has_output_symtab_entry): New function.
9875 (Symbol_value::needs_output_symtab_entry): Remove.
9876 (Symbol_value::output_symtab_index): Make sure the symbol index is
9877 set.
9878 (Symbol_value::set_output_symtab_index): Make sure the symbol
9879 index is not set. Make sure the new index is valid.
9880 (Symbol_value::set_must_have_output_symtab_entry): New function.
9881 (Symbol_value::has_output_dynsym_entry): New function.
9882 (Symbol_value::set_output_dynsym_index): Make sure the new index
9883 is valid.
9884 (Sized_relobj::set_must_have_output_symtab_entry): New function.
9885 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
9886 local symbol if permitted.
9887 (Sized_relobj::do_finalize_local_symbols): Call
9888 is_output_symtab_index_set rather than needs_output_symtab_entry.
9889 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
9890 rather than needs_output_symtab_entry. Call
9891 has_output_dynsym_entry rather than needs_output_dynsym_entry.
9892 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
9893 is_output_symtab_index_set rather than needs_output_symtab_entry.
9894 * testsuite/discard_locals_relocatable_test.c: New file.
9895 * testsuite/discard_locals_test.sh: Test -r.
9896 * testsuite/Makefile.am (check_DATA): Add
9897 discard_locals_relocatable_test1.syms,
9898 discard_local_relocatable_test2.syms.
9899 (MOSTLYCLEANFILES): Likewise. Also add
9900 discard_locals_relocatable_test1.lout and
9901 discard_locals_relocatable_test2.out.
9902 (discard_locals_relocatable_test1.syms): New target.
9903 (discard_locals_relocatable_test.o): New target.
9904 (discard_locals_relocatable_test1.out): New target.
9905 (discard_locals_relocatable_test2.syms): New target.
9906 (discard_locals_relocatable_test2.out): New target.
9907 (various): Add missing ../ld-new dependencies.
9908 * testsuite/Makefile.in: Rebuild.
9909
7e8ccf26
NC
99102010-03-03 Nick Clifton <nickc@redhat.com>
9911
9912 * po/fi.po: New Finnish translation.
9913
2a0ff005
DK
99142010-03-01 Doug Kwan <dougkwan@google.com>
9915
9916 * layout.cc (Layout::Layout): Force section types of .init_array*,
9917 .preinit_array* and .fini_array* sections.
9918 * output.cc (Output_section::Input_section_sort_entry::has_priority):
9919 Fix check of return value of std::string::find.().
9920 (Output_section::Input_section_sort_compare::operator()): Remove
9921 comment about .init_array.
9922 (Output_section::Input_section_sort_init_fini_compare::operator()):
9923 New method.
9924 (Output_section::sort_attached_input_sections): Handle .init_array
9925 and .fini_array specially.
9926 * output.h (Output_section::Inut_section_sort_compare): Update
9927 comment.
9928 (Output_section::Input_section_sort_init_fini_compare): New struct.
9929
c3e4ae29
DK
99302010-02-26 Doug Kwan <dougkwan@google.com>
9931
9932 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
9933 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
9934 * testsuite/debug_msg.sh: Avoid matching source line number for
9935 use of global variable undef_int.
9936
2fd9ae7a
DK
99372010-02-26 Doug Kwan <dougkwan@google.com>
9938
9939 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
9940 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
9941 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
9942 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
9943 * options.cc (General_options::General_options): Initialize member
9944 fix_v4bx_.
9945 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
9946 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
9947 and rm_no_fix_v4bx.stdout
9948 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
9949 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
9950 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
9951 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
9952 and arm_no_fix_v4bx.
9953 * Makefile.in: Regenerate.
9954 * testsuite/arm_fix_v4bx.s: New file.
9955 * testsuite/arm_fix_v4bx.sh: Ditto.
9956
67ec7d0b
DK
99572010-02-24 Doug Kwan <dougkwan@google.com>
9958
9959 * arm.cc (Target_arm::got_section): Make the .got section the first
9960 non RELRO section in the data segment.
9961 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
9962 suffixes of section names.
9963
10165461
DK
99642010-02-24 Doug Kwan <dougkwan@google.com>
9965
9966 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
9967 flags and attributes merging if an input file is a binary file.
9968 * fileread.cc (Input_file::open): Record format of original file.
9969 * fileread.h (Input_file::Format): New enum type.
2e702c99 9970 (Input_file::Input_file): Initialize data member format_.
10165461
DK
9971 (Input_file::format): New method definition.
9972 (Input_file::format_):: New data member.
9973
4a54abbb
DK
99742010-02-24 Doug Kwan <dougkwan@google.com>
9975
9976 * arm.cc (Arm_output_data_got): New class.
9977 (ARM_TCB_SIZE): New constant
9978 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
9979 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
9980 If user uses a script with a SECTIONS clause, issue only a warning
9981 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 9982 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
9983 garbage collection.
9984 (Target_arm::got_mode_index_entry): Handle static linking.
9985 (Target_arm::Scan::local): Ditto.
9986 (Target_arm::Scan::global): Ditto.
9987 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
9988 all incorrectly implemented relocations.
e1df38aa 9989 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
9990 Arm_output_section::fix_exidx_coverage.
9991 * layout.cc (Layout::section_name_mapping): Remove trailing dots
9992 from ".ARM.exidx." and ".ARM.extab.".
9993
ca419a6f
ILT
99942010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9995
9996 * arm.cc (Target_arm::do_finalize_sections): Create attribute
9997 section if it does not already exist.
9998 * attributes.cc (Attributes_section_data::Attributes_section_data):
9999 Don't crash if size is zero.
10000
135b9c78
ILT
100012010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10002 Ian Lance Taylor <iant@google.com>
10003
10004 * gold.cc (queue_middle_tasks): If no input files were opened,
10005 exit.
10006 * workqueue.h (Task_function::Task_function): Assert that there is
10007 a blocker.
10008
bb0bfe4f
DK
100092010-02-22 Doug Kwan <dougkwan@google.com>
10010
10011 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
10012 * icf.cc (get_section_contents): Cast snprintf arguments to long long
10013 types to avoid warnings due to different uint64_t implementations
10014 on different hosts.
10015
2a2b6d42
DK
100162010-02-21 Doug Kwan <dougkwan@google.com>
10017
10018 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
10019 handling of the maximum backward branch offset.
2e702c99 10020 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
10021 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
10022 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 10023 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
10024 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
10025 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
10026 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
10027 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
10028 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
10029 thumb_bl_out_of_range thumb_bl_out_of_range.o,
10030 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
10031 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
10032 thumb2_bl_out_of_range.o): New rules.
10033 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
10034 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
10035 thumb2_bl_out_of_range
10036 * testsuite/Makefile.in: Regenerate.
10037 * testsuite/arm_bl_in_range.s: New file.
10038 * testsuite/arm_bl_out_of_range.s: Ditto.
10039 * testsuite/arm_branch_in_range.sh: Ditto.
10040 * testsuite/arm_branch_range.t: Ditto.
10041 * testsuite/thumb2_branch_range.t: Ditto.
10042 * testsuite/thumb_bl_in_range.s: Ditto.
10043 * testsuite/thumb_bl_out_of_range.s: Ditto.
10044 * testsuite/thumb_branch_range.t: Ditto.
10045
b487ad64
ST
100462010-02-20 Sriraman Tallam <tmsriram@google.com>
10047
10048 * gc.h (gc_process_relocs): Change vectors to point to the new list.
10049 Add reloc offset information.
10050 * icf.cc (get_section_contents): Change iterators to point to the new
10051 vectors. Add reloc offset information to the contents.
10052 * icf.h (Icf::Sections_reachable_info): New typedef.
10053 (Icf::Sections_reachable_list): New typedef.
10054 (Icf::Offset_info): New typedef.
10055 (Icf::Reloc_info): New struct typedef.
10056 (Icf::Reloc_info_list): New typedef.
10057 (Icf::symbol_reloc_list): Delete method.
10058 (Icf::addend_reloc_list): Delete method.
10059 (Icf::section_reloc_list): Delete method.
10060 (Icf::reloc_info_list): New method.
10061 (Icf::reloc_info_list_): New member.
10062
f96accdf
DK
100632010-02-19 Doug Kwan <dougkwan@google.com>
10064
10065 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
10066 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
10067 * arm.cc (Arm_relocation_functions): New forward declaration.
10068 (Target_arm::Target_arm): Initialize new data members
10069 got_mod_index_offset_ and tls_base_symbol_defined_.
10070 (Target_arm::Relocate::relocate_tls): New method.
10071 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
10072 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
10073 New methods.
2e702c99 10074 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
10075 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
10076 (Target_arm::got_mod_index_offset_,
10077 Target_arm::tls_base_symbol_defined_): New data members.
10078 (Target_arm::Scan::local, Target::Scan::global,
10079 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
10080 relocations.
10081
c8761b9a
DK
100822010-02-18 Doug Kwan <dougkwan@google.com>
10083
10084 * arm.cc (Arm_relobj::find_linked_text_section): New method.
10085 (Arm_relobj::make_exidx_input_section): Pass section index of linked
10086 text section as a parameter becuase some broken tools may not set
10087 the link in section header.
10088 (Target_arm::has_got_section): New method.
10089 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
10090 without any mapping symbol as data only. Remove warning.
10091 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
10092 link in its section header, try to discover the link by inspecting the
10093 REL31 relocation at the beginning of the section.
10094 (Target_arm::Scan::check_non_pic): Report name of offending relocation
10095 in error message.
10096 (Target_arm::Scan::global): Treat any reference to the symbol
10097 _GLOBAL_OFFSET_TABLE_ as a GOT access.
10098
21bb3914
ST
100992010-02-12 Sriraman Tallam <tmsriram@google.com>
10100
10101 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
10102 (Scan::global_reloc_may_be_function_pointer): New function.
10103 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10104 (Scan::global_reloc_may_be_function_pointer): New function.
10105 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10106 (Scan::global_reloc_may_be_function_pointer): New function.
10107 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
10108 (Scan::global_reloc_may_be_function_pointer): New function.
10109 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
10110 (Scan::global_reloc_may_be_function_pointer): New function.
10111 (Scan::possible_function_pointer_reloc): New function.
10112 (Target_x86_64::can_check_for_function_pointers): New function.
10113 * gc.h (gc_process_relocs): Scan relocation types to determine if
10114 function pointers were taken for targets that support it.
10115 * icf.cc (Icf::find_identical_sections): Include functions for
10116 folding in safe ICF whose pointer is not taken.
10117 * icf.h (Secn_fptr_taken_set): New typedef.
10118 (fptr_section_id_): New member.
10119 (section_has_function_pointers): New function.
10120 (set_section_has_function_pointers): New function.
10121 (check_section_for_function_pointers): New function.
10122 * options.h: Fix comment for safe ICF option.
10123 * target.h (can_check_for_function_pointers): New function.
10124 * testsuite/Makefile.am: Add icf_safe_so_test test case.
10125 Modify icf_safe_test for X86-64.
10126 * testsuite/Makefile.in: Regenerate.
10127 * testsuite/icf_safe_so_test.cc: New file.
10128 * testsuite/icf_safe_so_test.sh: New file.
10129 * testsuite/icf_safe_test.cc (kept_func_3): New function.
10130 (main): Change to take pointer to function kept_func_3.
10131 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
10132 folding is done correctly for X86-64.
10133
0da6fa6c
DM
101342010-02-12 David S. Miller <davem@davemloft.net>
10135
10136 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
10137 is_symbolless parameter.
10138 (Output_reloc<SHT_REL>::is_symbolless): New.
10139 (Output_reloc<SHT_REL>::is_symbolless_): New.
10140 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
10141 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
10142 (Output_reloc<SHT_RELA>::is_symbolless): New.
10143 (Output_data_reloc::add_global): Handle is_symbolless.
10144 (Output_data_reloc::add_global_relative): Likewise.
10145 (Output_data_reloc::add_local): Likewise.
10146 (Output_data_reloc::add_local_relative): Likewise.
10147 (Output_data_reloc::add_symbolless_global_addend): New.
10148 (Output_data_reloc::add_symbolless_local_addend): New.
10149 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
10150 is_symbolless.
10151 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
10152 instead of ->is_relative_
10153 (Output_reloc::write): Likewise.
10154 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
10155 (Output_reloc::write_rel): Simplify.
10156
10157 * sparc.cc (Target_sparc::Scan::local): Use
10158 ->add_symbolless_local_addend as needed.
10159 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
10160 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
10161 based upon relocation offset.
10162
e4782e83
DK
101632010-02-11 Doug Kwan <dougkwan@google.com>
10164
10165 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
10166 (Target_arm::Scan::global): Ditto. Also remove a comment before the
10167 beginning of function.
10168 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
10169 and MOVT_ABS relocations. Those are non issued in scanning. Fix
10170 parameter is_32bit in calls to should_apply_static_reloc.
10171 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
10172 (check_DATA): Add arm_abs_global.stdout.
10173 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
10174 arm_abs_global.stdout): New rules.
10175 (MOSTLLYCLEANFILES): Add arm_abs_global
10176 * Makefile.in: Regenerate.
10177 * testsuite/arm_abs_global.s: New file.
10178 * testsuite/arm_abs_global.sh: Ditto.
10179 * testsuite/arm_abs_lib.s: Ditto.
10180
93ceb764
ILT
101812010-02-11 Ian Lance Taylor <iant@google.com>
10182
10183 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
10184 Read_relocs task.
10185 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
10186 Allocate_commons_task first.
10187 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
10188 task, rather than symtab_lock_.
10189 (Gc_process_relocs::~Gc_process_relocs): New function.
10190 (Gc_process_relocs::is_runnable): Check this_blocker_.
10191 (Gc_process_relocs::locks): Use next_blocker_ rather than
10192 blocker_.
10193 (Scan_relocs::~Scan_relocs): New function.
10194 (Scan_relocs::is_runnable): Check this_blocker_ rather than
10195 symtab_lock_.
10196 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
10197 next_blocker_.
10198 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
10199 fields. Add this_blocker_ and next_blocker_ fields. Adjust
10200 constructor accordingly.
10201 (class Gc_process_relocs): Likewise.
10202 (class Scan_relocs): Likewise.
10203 * common.h (class Allocate_commons_task): Remove symtab_lock_
10204 field, and corresponding constructor parameter.
10205 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
10206 symtab_lock_.
10207 (Allocate_commons_task::locks): Likewise.
10208
114dfbe1
ILT
102092010-02-11 Ian Lance Taylor <iant@google.com>
10210
10211 * gold-threads.h (class Once): Define.
10212 (class Initialize_lock): Rewrite as child of Once.
10213 * gold-threads.cc (class Once_initialize): Define.
10214 (once_pointer_control): New static variable.
10215 (once_pointer, once_arg): New static variables.
10216 (c_run_once): New static function.
10217 (Once::Once, Once::run_once, Once::internal_run): New functions.
10218 (class Initialize_lock_once): Remove.
10219 (initialize_lock_control): Remove.
10220 (initialize_lock_pointer): Remove.
10221 (initialize_lock_once): Remove.
10222 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
10223 (Initialize_lock::initialize): Rewrite.
10224 (Initialize_lock::do_run_once): New function.
10225 * archive.cc (Archive::interpret_header): Only clear name if it is
10226 not already empty.
10227 * fileread.cc: Include "gold-threads.h"
10228 (file_counts_lock): New static variable.
10229 (file_counts_initialize_lock): Likewise.
10230 (File_read::release): Only increment counts when using --stats.
10231 Use a lock around the increment.
10232 * parameters.cc (class Set_parameters_target_once): Define.
10233 (set_parameters_target_once): New static variable.
10234 (Parameters::Parameters): Move here from parameters.h.
10235 (Parameters::set_target): Rewrite.
10236 (Parameters::set_target_once): New function.
10237 (Parameters::clear_target): Move here and rewrite.
10238 * parameters.h (class Parameters): Update declarations. Add
10239 set_parameters_target_once_ field.
10240 (Parameters::Parameters): Move to parameters.cc.
10241 (Parameters::clear_target): Likewise.
10242 * readsyms.cc (Read_symbols::do_group): Create a Start_group
10243 task.
10244 (Start_group::~Start_group): New function.
10245 (Start_group::is_runnable): New function.
10246 (Start_group::locks, Start_group::run): New functions.
10247 (Finish_group::run): Change saw_undefined to size_t.
10248 * readsyms.h (class Start_group): Define.
10249 (class Finish_group): Change saw_undefined_ field to size_t.
10250 (Finish_group::Finish_group): Remove saw_undefined and
10251 this_blocker parameters. Change all callers.
10252 (Finish_group::set_saw_undefined): New function.
10253 (Finish_group::set_blocker): New function.
10254 * symtab.h (class Symbol_table): Change saw_undefined to return
10255 size_t. Change saw_undefined_ field to size_t.
10256 * target-select.cc (Set_target_once::do_run_once): New function.
10257 (Target_selector::Target_selector): Initialize set_target_once_
10258 field. Don't initialize lock_ and initialize_lock_ fields.
10259 (Target_selector::instantiate_target): Rewrite.
10260 (Target_selector::set_target): New function.
10261 * target-select.h (class Set_target_once): Define.
10262 (class Target_selector): Update declarations. Make
10263 Set_target_once a friend. Remove lock_ and initialize_lock_
10264 fields. Add set_target_once_ field.
10265
fa17a3f4
ILT
102662010-02-10 Ian Lance Taylor <iant@google.com>
10267
10268 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
10269 queueing any tasks.
10270 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
10271 (queue_middle_tasks): Add all blockers before queueing any tasks.
10272 (queue_final_tasks): Likewise.
10273 * token.h (Task_token::add_blockers): New function.
10274 * object.h (Input_objects::number_of_relobjs): New function.
10275
c7177d31
ILT
102762010-02-10 Ian Lance Taylor <iant@google.com>
10277
5de0e392
ILT
10278 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
10279 shared, not if not position independent.
10280 * x86_64.cc (Relocate::relocate_tls): Likewise.
10281 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
10282 (tls_pie_pic_test): New target.
10283 * testsuite/Makefile.in: Rebuild.
10284
c7177d31
ILT
10285 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
10286 (tls_test_main_pie.o, tls_test_pie.o): New targets.
10287 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
10288 * testsuite/Makefile.in: Rebuild.
10289
684b268a
DM
102902010-02-09 David S. Miller <davem@davemloft.net>
10291
10292 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
10293 R_SPARC_RELATIVE using ->add_local_relative().
10294 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
10295
612a8d3d
DM
10296 * output.h (Output_data_dynamic::add_section_size): New method
10297 that takes two Output_data objects.
10298 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
10299 entry param. Handle it in initializers.
10300 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
10301 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
10302 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
10303 arg.
10304 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
10305 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
10306 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
10307 for dynrel_includes_plt.
10308 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10309 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10310 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
10311 before .rela.plt
10312 (Target_sparc::do_finalize_sections): Update to pass true for
10313 dynrel_includes_plt.
10314 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
10315 output before .rela.plt
10316 (Target_powerpc::do_finalize_sections): Update to pass true for
10317 dynrel_includes_plt when 32-bit.
10318
cb1be87e
DK
103192010-02-08 Doug Kwan <dougkwan@google.com>
10320
10321 * arm.cc (Arm_relobj::simple_input_section_output_address): New
10322 method.
10323 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
10324 Arm_relobj::scan_section_for_cortex_a8_stubs,
10325 Arm_relobj::do_relocation_section): Instead of calling
10326 Output_section::output_address, use faster
10327 Arm_relobj::simple_input_section_output_address.
10328
705b5121
DM
103292010-02-08 David S. Miller <davem@davemloft.net>
10330
10331 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
10332 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
10333 relocation helper function.
10334
024c4466
DM
10335 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
10336 just like R_SPARC_GOT{10,13,22}.
10337 (Target_sparc::Scan::local): Likewise.
10338 (Target_sparc::Relocate:relocate): Likewise.
10339
9109c078
ILT
103402010-02-06 Ian Lance Taylor <iant@google.com>
10341
10342 * configure.ac: Rewrite targetobjs duplicate removal code to use
10343 only shell constructs.
10344 * configure: Rebuild.
10345
cf846138
DK
103462010-02-05 Doug Kwan <dougkwan@google.com>
10347
10348 PR 11247
10349 * arm.cc (Arm_relobj::section_is_scannable): New method.
10350 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
10351 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
10352
6cfaf60b
DK
103532010-02-04 Doug Kwan <dougkwan@google.com>
10354
10355 PR 11247
10356 * arm-reloc-property.cc (cstdio): Include.
10357 * configure.ac (targetobjs): Remove duplicates.
10358 * configure: Regenerate.
10359 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
10360 big and little endian version for a given address size.
10361
5c57f1be
DK
103622010-02-03 Doug Kwan <dougkwan@google.com>
10363
10364 * arm-reloc-property.cc
10365 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10366 definition.
10367 * arm-reloc-property.h
10368 (Arm_reloc_property_table::get_implemented_static_reloc_property):
10369 New method definition.
10370 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10371 declaration.
10372 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
10373 overflow to N.
10374 (GOT_PREL): Change implemented to Y.
10375 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
10376 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
10377 (Arm_relocate_functions::movw_abs_nc): Remove method.
10378 (Arm_relocate_functions::movt_abs): Ditto.
10379 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
10380 (Arm_relocate_functions::thm_movt_abs): Ditto.
10381 (Arm_relocate_functions::movw_rel_nc): Ditto.
10382 (Arm_relocate_functions::movw_rel): Ditto.
10383 (Arm_relocate_functions::movt_rel): Ditto.
10384 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
10385 (Arm_relocate_functions:thm_movw_rel): Ditto.
10386 (Arm_relocate_functions:thm_movt_rel): Ditto.
10387 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
10388 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
10389 New method definitions.
10390 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
10391 (Arm_relocation_functions::arm_grp_ldr): Ditto.
10392 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
10393 (Arm_relocation_functions::arm_grp_ldc): Ditto.
10394 (Target_arm::Relocate::relocate): Check for non-static or
10395 unimplemented relocation code and exit early. Change calls to
10396 Target_arm::reloc_uses_thumb_bit and
10397 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
10398 instead. Refactor code to handle similar relocations to increase
10399 code sharing. Remove check for unsupported relocation code in switch
10400 statement.
10401 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
10402 relocation property table to find out size. Change error message to
10403 print out the name of a relocation code instead of the numeric value.
10404 (Target_arm::scan_reloc_for_stub): Use relocation property table
10405 instead of calling Target_arm::reloc_uses_thumb_bit().
10406
218c5831
DK
104072010-02-02 Doug Kwan <dougkwan@google.com>
10408
10409 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
10410 types of relaxed input section.
10411
0d31c79d
DK
104122010-02-02 Doug Kwan <dougkwan@google.com>
10413
10414 * Makefile.am (HFILES): Add arm-reloc-property.h.
10415 (DEFFILES): New.
2e702c99
RM
10416 (TARGETSOURCES): Add arm-reloc-property.cc
10417 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
10418 (libgold_a_SOURCES): $(DEFFILES)
10419 * Makefile.in: Regenerate.
10420 * arm-reloc-property.cc: New file.
10421 * arm-reloc-property.h: New file.
10422 * arm-reloc.def: New file.
10423 * arm.cc: Update comments.
10424 (arm-reloc-property.h): New included header.
10425 (arm_reloc_property_table): New global variable.
10426 (Target_arm::do_select_as_default_target): New method definition.
10427 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
10428 arm-reloc-property to targ_extra_obj.
10429 * parameters.cc (set_parameters_target): Call
10430 Target::select_as_default_target().
10431 * target.h (Target::select_as_default_target): New method definition.
10432 (Target::do_select_as_default_target): Same.
10433
546c7457
DK
104342010-02-01 Doug Kwan <dougkwan@google.com>
10435
10436 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
10437 first_output_text_section_.
10438 (Arm_exidx_fixup::first_output_text_section): New method definition.
10439 (Arm_exidx_fixup::first_output_text_section_): New data member.
10440 (Arm_exidx_fixup::process_exidx_section): Record the first text
10441 output section seen.
10442 (Arm_output_section::fix_exidx_coverage): Set correct linked section
10443 and entsize in output section header.
10444
11b861d5
DK
104452010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10446
10447 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
10448 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
10449 (Arm_relocate_functions::thm_alu11): New Method.
10450 (Arm_relocate_functions::thm_pc8): New Method.
10451 (Arm_relocate_functions::thm_pc12): New Method.
10452 (Target_arm::Scan::local): Handle the relocations.
10453 (Target_arm::Scan::global): Likewise.
10454 (Target_arm::Relocate::relocate): Likewise.
10455 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10456
c9a2c125
DK
104572010-01-29 Doug Kwan <dougkwan@google.com>
10458
10459 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
10460 of relocation types as ld.
10461
1521477a
DK
104622010-01-29 Doug Kwan <dougkwan@google.com>
10463
10464 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
10465 to public.
10466 (Arm_relocate_functions::thumb_branch_common): Ditto.
10467 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
10468 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
10469 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
10470 Arm_relocate_functions::jump24): Remove.
10471 (Target_arm::Relocate::relocate): Adjust code to call
10472 Arm_relocation_functions::arm_branch_common and
10473 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 10474 wrappers. Merge switch-cases together to reduce source code size.
1521477a 10475
e7eca48c
DK
104762010-01-29 Doug Kwan <dougkwan@google.com>
10477
10478 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
10479 output_local_symbol_count_needs_update_.
10480 (Arm_relobj::output_local_symbol_count_needs_update,
10481 Arm_relobj::set_output_local_symbol_count_needs_update,
10482 Arm_relobj::update_output_local_symbol_count): New methods.
10483 (Arm_relobj::output_local_symbol_count_needs_update_): New data
10484 member.
10485 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
10486 of pointed function as in a R_ARM_PREL31 relocation.
10487 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
10488 for output local symbol count updating.
10489 (Target_arm::do_relax): Update output local symbol counts in objects
10490 if necessary.
10491 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
10492
02961d7e
ILT
104932010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10494
10495 * arm.cc: Added support for the ARM relocations:
10496 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
10497 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
10498 (Arm_relocate_functions::movw_rel_nc): Renamed (was
10499 movw_prel_nc).
10500 (Arm_relocate_functions::movw_rel): New method.
10501 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
10502 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
10503 thm_movw_prel_nc).
10504 (Arm_relocate_functions::thm_movw_rel): New method.
10505 (Arm_relocate_functions::thm_movt_rel): Renamed (was
10506 thm_movt_prel).
10507 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
10508 relocations.
10509 (Target_arm::Scan::global): Likewise.
10510 (Target_arm::Relocate::relocate): Likewise.
10511 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10512 Likewise.
10513
b10d2873
ILT
105142010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10515
10516 * arm.cc: Added support for ARM group relocations.
10517 (Target_arm::reloc_needs_sym_origin): New method.
10518 (Arm_relocate_functions::calc_grp_kn): New method.
10519 (Arm_relocate_functions::calc_grp_residual): New method.
10520 (Arm_relocate_functions::calc_grp_gn): New method.
10521 (Arm_relocate_functions::arm_grp_alu): New Method.
10522 (Arm_relocate_functions::arm_grp_ldr): New Method.
10523 (Arm_relocate_functions::arm_grp_ldrs): New Method.
10524 (Arm_relocate_functions::arm_grp_ldc): New Method.
10525 (Target_arm::Scan::local): Handle the ARM group relocations.
10526 (Target_arm::Scan::global): Likewise.
10527 (Target_arm::Relocate::relocate): Likewise.
10528 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10529 Likewise.
10530
2b328d4e
DK
105312010-01-26 Doug Kwan <dougkwan@google.com>
10532
10533 * arm.cc (set): Include.
10534 (class Arm_exidx_fixup): Change type of last_input_section_ to const
10535 pointer type.
2e702c99 10536 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
10537 (Arm_output_section::append_text_sections_to_list): New method.
10538 (Arm_output_section::fix_exidx_coverage): Ditto.
10539 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 10540 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
10541 Relobj::set_section_offset() instead of
10542 Sized_relobj::invalidate_section_offset().
2e702c99 10543 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
10544 parameter for section headers. Ignore relocation sections for
10545 unallocated sections and EXIDX sections.
10546 (Target_arm::fix_exidx_coverage): New method.
10547 (Target_arm::output_section_address_less_than): New type.
10548 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
10549 linked text section instead of the EXIDX section.
10550 (Arm_output_section::create_stub_group): Add an assertion to check
10551 that this is not an EXIDX output section.
10552 (Arm_output_section::append_text_sections_to_list): New method.
10553 (Arm_output_section::fix_exidx_coverage): Ditto.
10554 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 10555 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
10556 (Target_arm::do_relax): Fix EXIDX output section coverage in the
10557 first pass.
10558 (Target_arm::fix_exidx_coverage): New method.
10559 * object.h (Relobj::set_output_section): New method.
10560 (Sized_relobj::invalidate_section_offset): Remove method.
10561 (Sized_relobj::do_invalidate_section_offset): Remove method.
10562 (Sized_relobj::do_set_section_offset): Handle offset value -1.
10563
c7f3c371
DK
105642010-01-25 Doug Kwan <dougkwan@google.com>
10565
10566 * arm.cc (Arm_exidx_merged_section::do_output_offset):
10567 Fix warning due to signed and unsigned comparison on a 32-bit host.
10568
8923b24c
DK
105692010-01-22 Doug Kwan <dougkwan@google.com>
10570
10571 * arm.cc (Target_arm::do_relax): Record an output section for section
10572 offset adjustment it contains any stub table that has changed.
10573 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
10574 offsets in an output section if necessary.
10575 * output.cc (Output_section::Output_section): Initialize
10576 section_offsets_need_adjustments_.
10577 (Output_section::add_input_section_for_script): Renamed to
10578 Output_section::add_simple_input_section.
10579 (Output_section::save_states): Add a comment.
10580 (Output_section::discard_states): New method defintion.
10581 (Output_section::adjust_section_offsets): Same.
10582 * output.h (Output_section::add_input_section_for_script): Renamed to
10583 Output_section::add_simple_input_section.
10584 (Output_section::discard_states): New method declaration.
10585 (Output_section::adjust_section_offsets): Same.
10586 (Output_section::section_offsets_need_adjustment,
10587 Output_section::set_section_offsets_need_adjustment): New method
10588 definitions.
10589 (Output_section::section_offsets_need_adjustment_): New data member.
10590 * script-sections.cc
10591 (Output_section_element_input::set_section_address): Adjust code for
10592 renaming of Output_section::add_input_section_for_script.
10593 (Orphan_output_section::set_section_address): Same.
10594
9b2fd367
DK
105952010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10596
10597 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
10598 Fix_v4bx enum values .
10599 * gold/options.h (General_options): New option definitions.
10600 (General_options::fix_v4bx): New method.
10601 (General_options::Fix_v4bx): New enum.
10602 * gold/options.cc (General_options::parse_fix_v4bx): New method.
10603 (General_options::parse_fix_v4bx_interworking): New method.
10604
80d0d023
DK
106052010-01-22 Doug Kwan <dougkwan@google.com>
10606
10607 * arm.cc (Arm_exidx_fixup): New class.
10608
af2cdeae
DK
106092010-01-21 Doug Kwan <dougkwan@google.com>
10610
10611 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
10612 classes.
10613 (Arm_exidx_section_offset_map): New type.
10614
993d07c1
DK
106152010-01-21 Doug Kwan <dougkwan@google.com>
10616
10617 * arm.cc (Arm_exidx_input_section): New class.
10618 (Arm_relobj::exidx_input_section_by_link,
10619 Arm_relobj::exidx_input_section_by_shndx,
10620 Arm_relobj::make_exidx_input_section): New methods.
10621 (read_arm_attributes_section): Remove.
10622 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
10623 information about them.
10624 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
10625 to here.
10626
5ac169d4
DK
106272010-01-20 Doug Kwan <dougkwan@google.com>
10628
10629 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
10630 Input_section_specifier to Section_id.
10631 (Target_arm::new_arm_input_section: Adjust code for change of key
10632 type.
10633 (Target_arm::find_arm_input_section): Ditto.
10634 * gc.h (object.h): Include for Section_id nand Section_id_hash.
10635 (Section_id): Remove.
10636 (Garbage_collection::Section_id_hash): Remove.
10637 * icf.h (object.h): Include for Section_id nand Section_id_hash.
10638 (Section_id): Remove.
10639 (Icf::Section_id_hash): Remove.
10640 * object.h (Section_id, Const_section_id, Section_id_hash,
10641 Const_section_id_hash): New type definitions.
10642 * output.cc (Output_section::add_relaxed_input_section): Change to
10643 use Const_section_id instead of Input_section_specifier as key type.
10644 (Output_section::add_merge_input_section): Ditto.
10645 (Output_section::build_relaxation_map): Change to use Section_id
10646 instead of Input_section_specifier as key type.
2e702c99 10647 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
10648 Ditto.
10649 (Output_section::convert_input_sections_to_relaxed_sections): Change
10650 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 10651 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
10652 (Output_section::find_relaxed_input_section): Ditto.
10653 * output.h (Input_section_specifier): Remove class.
10654 (Output_section::Output_section_data_by_input_section_map): Change
10655 key type to Const_section_id.
10656 (Output_section::Output_relaxed_input_section_by_input_section_map):
10657 Ditto.
10658 (Output_section::Relaxation_map): Change key type to Section_id.
10659
a2162063
ILT
106602010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10661
10662 * gold/arm.cc: Added support for R_ARM_V4BX relocation
10663 (class Arm_v4bx_stub): New class.
10664 (DEF_STUBS): Updated definition to support v4_veneer_bx.
10665 (Stub_factory::make_arm_v4bx_stub): New method.
10666 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
10667 (Stub_table::empty): Handle v4bx stubs.
10668 (Stub_table::add_arm_v4bx_stub): New method.
10669 (Stub_table::find_arm_v4bx_stub): New method.
10670 (Arm_relocate_functions::v4bx): New method.
10671 (Target_arm::fix_v4bx): New method.
10672 (Target_arm::Target_arm): Handle R_ARM_V4BX.
10673 (Stub_table::relocate_stubs): Likewise.
10674 (Stub_table::do_write): Likewise.
10675 (Stub_table::update_data_size_and_addralign): Likewise.
10676 (Stub_table::finalize_stubs): Likewise.
10677 (Target_arm::Scan::local): Likewise.
10678 (Target_arm::Scan::global): Likewise.
10679 (Target_arm::do_finalize_sections): Likewise.
10680 (Target_arm::Relocate::relocate): Likewise.
10681 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10682 Likewise.
10683 (Target_arm::scan_reloc_for_stub): Likewise.
10684 (Target_arm::scan_reloc_section_for_stubs): Likewise.
10685
5696ab0b
ILT
106862010-01-19 Ian Lance Taylor <iant@google.com>
10687
10688 * output.cc (Output_section_headers::do_sized_write): Write large
10689 segment count to sh_info field.
10690 (Output_file_header::do_sized_write): For large segment count,
10691 write PN_XNUM to e_phnum field.
10692
800d0f56
ILT
106932010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10694
10695 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
10696 (Arm_relocate_functions::thm_jump8): New function.
10697 (Arm_relocate_functions::thm_jump11): New function.
10698 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
10699 R_ARM_THM_JUMP11.
10700 (Target_arm::Scan::global): Likewise.
10701 (Target_arm::Relocate::relocate): Likewise.
10702 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10703 Likewise.
10704
41263c05
DK
107052010-01-14 Doug Kwan <dougkwan@google.com>
10706
10707 * arm.cc (map, utility): Include headers.
10708 (Target_arm::apply_cortex_a8_workaround): New method.
10709 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
10710 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
10711 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
10712 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
10713 the --[no-]fix-cortex-a8 command line options.
10714 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
10715 (Target_arm::relocate_stub): Use addend in instruction template.
10716 * options.h (DEFINE_bool): Set the user-set flag.
10717 (General_options): Add --[no-]-fix-cortex options.
10718 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 10719 : Update fast look-up map after conversion.
41263c05 10720
459e9b03
ST
107212010-01-14 Sriraman Tallam <tmsriram@google.com>
10722
10723 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
10724 in the first pass of do_layout.
10725
b521dfe4
DK
107262010-01-13 Doug Kwan <dougkwan@google.com>
10727
10728 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10729 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
10730 apparent compiler problem of not folding static constant integral
10731 data members of elfcpp::Elf_sizes<32>.
10732
44272192
DK
107332010-01-13 Doug Kwan <dougkwan@google.com>
10734
10735 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10736 Arm_relobj::section_needs_cortex_a8_stub_scanning,
10737 Arm_relobj::scan_section_for_cortex_a8_erratum,
10738 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
10739 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
10740 sections to scan for relocation stubs into a new method
10741 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
10742 relocation and Cortex-A8 stub scanning.
10743 (Target_arm::do_relax): Force stubs to be after stubbed sections
10744 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 10745 the beginning of a new relaxation pass. Update a comment.
44272192
DK
10746 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
10747
44b71ece
ILT
107482010-01-12 Ian Lance Taylor <iant@google.com>
10749
10750 * target-reloc.h (visibility_error): New inline function.
10751 (relocate_section): Call visibility_error.
10752 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
10753 (MOSTLYCLEANFILES): Likewise.
10754 (protected_4_pic.o, protected_3.err): New targets.
10755 * testsuite/protected_4.cc: New file.
10756
a120bc7f
DK
107572010-01-12 Doug Kwan <dougkwan@google.com>
10758
10759 * arm.cc (Cortex_a8_reloc): New class.
10760 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
10761 and cortex_a8_relocs_info_.
10762 (Target_arm::fix_cortex_a8): New method definition.
10763 (Target_arm::Cortex_a8_relocs_info): New type.
10764 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
10765 New data member declarations.
10766 (Target_arm::scan_reloc_for_stub): Record information about
10767 relocations for THUMB branches that might be exempted from the
10768 Cortex-A8 workaround.
10769 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
10770 at the beginning of a relaxation pass.
10771
20138696
DK
107722010-01-12 Doug Kwan <dougkwan@google.com>
10773
10774 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
10775 (Arm_relobj::Mapping_symbol_position,
10776 Arm_reloj::Mapping_symbol_position_less,
10777 Arm_relobj::Mapping_symbols_info): New types.
10778 (Target_arm::is_mapping_symbol_name): New method definition.
10779 (Arm_relobj::do_count_local_symbols): Save information about mapping
10780 symbols.
10781
089d69dc
DK
107822010-01-11 Doug Kwan <dougkwan@google.com>
10783
10784 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
10785 Arm_relocate_functions::thumb32_branch_upper,
10786 Arm_relocate_functions::thumb32_branch_lower,
10787 Arm_relocate_functions::thumb32_cond_branch_offset,
10788 Arm_relocate_functions::thumb32_cond_branch_upper,
10789 Arm_relocate_functions::thumb32_cond_branch_lower,
10790 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
10791 branch offset encoding.
10792 (Arm_relocate_functions::thumb_branch_common): Use new branch
10793 offset encoding methods to avoid code duplication.
10794 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
10795 (Stub_addend_reader::operator()): Use new branch encoding method
10796 to avoid code duplication.
10797
99e5bff2
DK
107982010-01-11 Doug Kwan <dougkwan@google.com>
10799
10800 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
10801 (Target_arm::do_finalize_sections): Define special EXIDX section
10802 symbols only if referenced.
10803 * gc.h (Garbage_collection::add_reference): New method.
10804 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
10805 code duplication.
10806
98e090bd
ILT
108072010-01-11 Ian Lance Taylor <iant@google.com>
10808
d0a91bd8
ILT
10809 * script.cc (Version_script_info::build_expression_list_lookup):
10810 Change complaing about duplicate wildcard match from error to
10811 warning.
10812
98e090bd
ILT
10813 * script.cc (class Lazy_demangler): Recreate--revert part of patch
10814 of 2009-12-30.
10815 (Version_script_info::Version_script_info): Initialize globs_,
10816 default_version_, default_is_global_, and exact_. Don't
10817 initialize globals_ or locals_.
10818 (Version_script_info::build_lookup_tables): Build local symbols
10819 first.
10820 (Version_script_info::unquote): New function.
10821 (Version_script_info::add_exact_match): New function.
10822 (Version_script_info::build_expression_list_lookup): Remove lookup
10823 parameter. Add is_global parameter. Change all callers. Handle
10824 wildcard pattern specially. Unquote pattern. Call
10825 add_exact_match.
10826 (Version_script_info::get_name_to_match): New function.
10827 (Version_script_info::get_symbol_version): New function.
10828 (Version_script_info::get_symbol_version_helper): Remove.
10829 (Version_script_info::check_unmatched_names): Call unquote.
10830 * script.h (class Version_script_info): Change get_symbol_version
10831 to be non-inline and add is_global parameter; change all callers.
10832 Rewrite symbol_is_local. Update declarations. Define struct
10833 Version_tree_match, Exact, Globs. Don't define struct Lookup.
10834 Remove globals_ and locals_ members. Add exact_, globs_,
10835 default_version_, is_global_.
10836 (Version_script_info::Glob): Remove pattern, add expression and
10837 is_global. Update constructor. Change all callers.
10838 * dynobj.cc (Versions::finalize): Mark the version symbol as the
10839 default version.
10840 (Versions::symbol_section_contents): If a symbol is undefined, or
10841 defined in a dynamic object, set the version index to
10842 VER_NDX_LOCAL.
10843 * symtab.cc (Symbol_table::add_from_relobj): Don't call
10844 symbol_is_local.
10845 (Symbol_table::add_from_pluginobj): Likewise.
10846 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
10847
d56962d3
DK
108482010-01-11 Doug Kwan <dougkwan@google.com>
10849
10850 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
10851 (incremental_dump_LDADD): Add linking option for libintl.
10852 * Makefile.in: Regenerate.
10853
94e6ee91
L
108542010-01-11 H.J. Lu <hongjiu.lu@intel.com>
10855
10856 PR gold/11144
10857 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
10858 instead of -Ds.
10859 * testsuite/Makefile.in: Regenerated.
10860
e96c574b
DK
108612010-01-10 Doug Kwan <dougkwan@google.com>
10862
10863 * options.h (DEFINE_var): Use parentheses around argument varname__
10864 in macro body to avoid any unintended subsequent substitutions.
10865
7198066b
ILT
108662010-01-10 Ian Lance Taylor <iant@google.com>
10867
ba4d53bf
ILT
10868 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
10869 candidates before doing symbol resolution.
10870
7198066b
ILT
10871 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
10872 ODR candidates if only one is weak.
10873
a2beed37
ILT
108742010-01-08 Ian Lance Taylor <iant@google.com>
10875
10876 * script.cc (Version_script_info::build_expression_list_lookup):
10877 Don't warn about ambiguous version, just record the ambiguity.
10878 (Version_script_info::get_symbol_version_helper): Give error if
10879 version is ambiguous.
10880
2fb7225c
DK
108812010-01-08 Doug Kwan <dougkwan@google.com>
10882
10883 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
10884 prev_data_size_ and prev_addralign_. Remove initializer for
10885 deleted data member has_been_changed_.
10886 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
10887 to determine if the table is empty.
10888 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
10889 Remove.
10890 (Stub_table::add_reloc_stub): Define method in class definition
10891 instead of just declaring it there.
10892 (Stub_table::add_cortex_a8_stub): New method definition.
10893 (Stub_table::update_data_size_and_addralign): Ditto.
10894 (Stub_table::finalize_stubs): Ditto.
10895 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
10896 (Stub_table::do_addralign_): Return address alignment in the
10897 (Stub_table::do_reset_address_and_file_offset): Define method in
10898 class definition instead of declaring it there. Set current data
10899 size to be the data size of the previous pass.
10900 (Stub_table::set_final_data_size): Use current data size as the
10901 final data size.
10902 (Stub_table::relocate_stub): Change parameter type of stub from
10903 Reloc_stub pointer to Stub pointer.
10904 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
10905 (Stub_table::Cortex_a8_stub_list): New typedef.
10906 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
10907 Stub_table::prev_addralign_): New data member.
10908 (Arm_relobj::Arm_relobj): Initialize data member
10909 section_has_cortex_a8_workaround_.
10910 (Arm_relobj::section_has_cortex_a8_workaround,
10911 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
10912 definitions.
10913 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
10914 declarations.
10915 (Target_arm::relocate_stub): Change parameter type of stub from
10916 Reloc_stub pointer to Stub pointer.
10917 (Insn_template::size, Insn_template::alignment): Handle
10918 THUMB16_SPECIAL_TYPE.
10919 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
10920 Stub_table::update_data_size_and_addralign,
10921 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
10922 definitions.
10923 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
10924 (Stub_table::do_write): Ditto.
10925 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 10926
880cd20d
ILT
109272010-01-08 Ian Lance Taylor <iant@google.com>
10928
10929 PR 11108
10930 * symtab.h (class Symbol): Remove fields is_target_special_ and
10931 has_plt_offset_. Add field is_defined_in_discarded_section_.
10932 (Symbol::is_defined_in_discarded_section): New function.
10933 (Symbol::set_is_defined_in_discarded_section): New function.
10934 (Symbol::has_plt_offset): Rewrite.
10935 (Symbol::set_plt_offset): Verify that new offset is not -1U.
10936 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
10937 Don't initialize is_target_special_ or has_plt_offset_.
10938 Initialize is_defined_in_discarded_section_.
10939 (Symbol_table::add_from_relobj): If appropriate, set
10940 is_defined_in_discarded_section.
10941 * resolve.cc (Symbol::override_base_with_special): Don't test
10942 is_target_special_. Change has_plt_offset_ to has_plt_offset().
10943 * target-reloc.h (relocate_section): Do special handling for
10944 symbols defined in discarded sections for global symbols as well
10945 as local symbols.
10946
2703e3eb
ILT
109472010-01-08 Ian Lance Taylor <iant@google.com>
10948
10949 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
10950 the SHT_SYMTAB case.
10951
339d40a3
ILT
109522010-01-08 Ian Lance Taylor <iant@google.com>
10953
10954 * object.cc (Sized_relobj::do_layout): Don't get confused if
10955 layout_eh_frame returns NULL.
10956
abecea76
ILT
109572010-01-08 Ian Lance Taylor <iant@google.com>
10958
10959 PR 11084
10960 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
10961 dynamic symbol table, use the normal symbol table.
10962 (Sized_dynobj::do_read_symbols): Remove assertion about type of
10963 symbol table.
10964
6b7dd3f3
ILT
109652010-01-08 Ian Lance Taylor <iant@google.com>
10966
10967 PR 11072
10968 * layout.cc (Layout::include_section): Remove .gnu_debuglink
10969 sections.
10970
36c50e63
L
109712010-01-08 H.J. Lu <hongjiu.lu@intel.com>
10972
10973 * version.cc (print_version): Change to "Copyright 2010".
10974
e291e7b9
ILT
109752010-01-08 Ian Lance Taylor <iant@google.com>
10976
10977 PR 10287
10978 PR 11063
10979 * i386.cc (class Target_i386): Change return type of plt_section
10980 to be non-const.
10981 (class Output_data_plt_i386): Add tls_desc_rel_ field.
10982 (Output_data_plt_i386::Output_data_plt_i386): Initialize
10983 tls_desc_rel_ field.
10984 (Output_data_plt_i386::rel_tls_desc): New function.
10985 (Target_i386::rel_tls_desc_section): New function.
10986 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
10987 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
10988 R_386_TLS_DESC reloc in rel_tls_desc_section.
10989 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
10990 Define struct Tlsdesc_info.
10991 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
10992 (Target_x86_64::do_reloc_symbol_index): New function.
10993 (Target_x86_64::add_tlsdesc_info): New function.
10994 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
10995 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
10996 tlsdesc_rel_ field.
10997 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
10998 all callers.
10999 (Output_data_plt_x86_64::rela_tlsdesc): New function.
11000 (Target_x86_64::rela_tlsdesc_section): New function.
11001 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
11002 handling.
11003 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
11004 (Target_x86_64::do_reloc_addend): New function.
11005 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
11006 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
11007 declarations. Define TARGET_CODE. Add arg field to u1_ union.
11008 (Output_reloc::type): New function.
11009 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
11010 (Output_reloc::is_target_specific): New function.
11011 (Output_reloc::target_arg): New function.
11012 (class Output_reloc) [SHT_RELA]: Add four new constructors for
11013 absolute relocs and target specific relocs.
11014 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
11015 add_target_specific.
11016 (class Output_data_reloc) [SHT_RELA]: Likewise.
11017 * output.cc (Output_reloc::Output_reloc): Add four new versions
11018 for absolute relocs and target specific relocs.
11019 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
11020 (Output_reloc::get_symbol_index): Likewise.
11021 (Output_reloc::local_section_offset): Check that local_sym_index_
11022 is not TARGET_CODE or 0.
11023 (Output_reloc::symbol_value): Likewise.
11024 (Output_reloc::write) [SHT_RELA]: Call target for target specific
11025 reloc.
11026 * target.h (class Target): Add reloc_symbol_index and reloc_addend
11027 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
11028 functions.
11029 * layout.cc (add_target_dynamic_tags): Use output section for
11030 DT_PLTRELSZ and DT_JMPREL.
11031
3a44184e
ILT
110322010-01-07 Ian Lance Taylor <iant@google.com>
11033
11034 PR 11061
11035 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
11036 function.
11037 (class Output_data_reloc_generic): Define.
11038 (class Output_data_reloc_base): Change base class to
11039 Output_data_reloc_generic. Change add() method to call
11040 bump_relative_reloc_count for a relative reloc. Remove
11041 sort_relocs_ field.
11042 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
11043 to sort_relocs().
11044 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
11045 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
11046 appropriate.
11047 * layout.h (class Layout): Update declaration.
11048
ea715a34
ILT
110492010-01-07 Ian Lance Taylor <iant@google.com>
11050
11051 * output.h (class Output_data): Add const version of
11052 output_section and do_output_section.
11053 (class Output_section_data): Add const version of
11054 do_output_section.
11055 (class Output_section): Likewise.
11056 * layout.cc (Layout::add_target_dynamic_tags): New function.
11057 * layout.h (class Layout): Update declarations.
11058 * arm.cc (Target_arm::do_finalize_sections): Use
11059 add_target_dynamic_tags.
11060 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11061 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11062 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11063 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11064
659948a4
ILT
110652010-01-07 Ian Lance Taylor <iant@google.com>
11066
11067 PR 11042
11068 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
11069 object as needed.
11070
9d3b86f6
ILT
110712010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
11072 Ian Lance Taylor <iant@google.com>
11073
11074 PR 11019
11075 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
11076 Xindex::read_symtab_xindex.
11077
bb0d3eb0
DK
110782010-01-07 Doug Kwan <dougkwan@google.com>
11079
11080 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
11081 (Insn_template::thumb16_bcond_insn): New method declaration.
11082 (Insn_template): Fix spelling.
11083 (Stub::thumb16_special): New method declaration.
11084 (Stub::do_write): Define virtual method which was previously pure
11085 virtual.
11086 (Stub::do_thumb16_special): New method declaration.
11087 (Stub::do_fixed_endian_write): New template member.
11088 (Reloc_stub::do_write): Remove.
11089 (Reloc_stub::do_fixed_endian_write): Remove.
11090 (Cortex_a8_stub): New class definition.
11091 (Stub_factory::make_cortex_a8_stub): New method definition.
11092 (Stub_factory::Stub_factory): Add missing static storage class
11093 qualifier for elf32_arm_stub_a8_veneer_blx.
11094
ffeef7df
ILT
110952010-01-07 Ian Lance Taylor <iant@google.com>
11096
dc3f80fe
ILT
11097 PR 10980
11098 * options.h (class General_options): Add --warn-unresolved-symbols
11099 and --error-unresolved-symbols.
11100 * errors.cc (Errors::undefined_symbol): Implement
11101 --warn-unresolved-symbols.
11102
ffeef7df
ILT
11103 * options.h (class General_options): Add -z text and -z textoff.
11104 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
11105
f1ec9ded
ST
111062010-01-06 Sriraman Tallam <tmsriram@google.com>
11107
11108 * gc.h (Garbage_collection::Cident_section_map): New typedef.
11109 (Garbage_collection::cident_sections): New function.
11110 (Garbage_collection::add_cident_section): New function.
11111 (Garbage_collection::cident_sections_): New member.
11112 (gc_process_relocs): Add references to sections whose names are C
11113 identifiers.
11114 * gold.h (cident_section_start_prefix): New constant.
11115 (cident_section_stop_prefix): New constant.
11116 (is_cident): New function.
11117 * layout.cc (Layout::define_section_symbols): Replace string constants
11118 with the newly defined constants.
11119 * object.cc (Sized_relobj::do_layout): Track sections whose names are
11120 C identifiers.
11121 * testsuite/Makefile.am: Add gc_orphan_section_test.
11122 * testsuite/Makefile.in: Regenerate.
11123 * testsuite/gc_orphan_section_test.cc: New file.
11124 * testsuite/gc_orphan_section_test.sh: New file.
11125
6eda8c29
ILT
111262010-01-06 Ian Lance Taylor <iant@google.com>
11127
b9674e17
ILT
11128 PR 10980
11129 * options.h (class General_options): Add --warn-shared-textrel.
11130 * layout.cc (Layout::finish_dynamic_section): Implement
11131 --warn-shared-textrel.
11132
6eda8c29
ILT
11133 PR 10980
11134 * options.h (class General_options): Add --warn-multiple-gp.
11135
32dcd44e
ILT
111362010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11137
11138 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
11139 $(THREADSLIB) and $(LIBDL).
11140 * Makefile.in: Rebuild.
11141
a192ba05
ILT
111422010-01-06 Ian Lance Taylor <iant@google.com>
11143
11144 PR 10980
11145 * options.cc (General_options::parse_section_start): New function.
11146 (General_options::section_start): New function.
11147 (General_options::General_options): Initialize all members.
11148 * options.h: Include <map>
11149 (class General_options): Add --section-start. Add section_starts_
11150 member.
11151 * layout.cc (Layout::attach_allocated_section_to_segment): If
11152 --section-start was used, set the address of the segment. Remove
11153 local sort_sections.
11154 (Layout::relaxation_loop_body): If the address of the load segment
11155 has been set by --section-start, don't use it.
11156 * output.h (Output_segment::update_flags_for_output_section): New
11157 function.
11158 * output.cc (Output_segment::add_output_section): Call
11159 update_flags_for_output_section.
11160
dde3f402
ILT
111612010-01-05 Ian Lance Taylor <iant@google.com>
11162
62dfdd4d
ILT
11163 PR 10980
11164 * options.h (class General_options): Add --undefined-version.
11165 * script.cc (struct Version_expression): Add was_matched_by_symbol
11166 field.
11167 (Version_script_info::matched_symbol): New function.
11168 (Version_script_info::get_symbol_version_helper): Call
11169 matched_symbol.
11170 (Version_script_info::check_unmatched_names): New function.
11171 * script.h (class Version_script_info): Update declarations.
11172 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
11173
9c4ae156
ILT
11174 * options.h (class General_options): Use DEFINE_bool_alias for
11175 allow_multiple_definition.
11176 * resolve.cc (Symbol_table::should_override): Don't test
11177 allow_multiple_definition.
11178
dde3f402
ILT
11179 PR 10980
11180 * options.h (class General_options): Add --cref.
11181 * main.cc (main): Print cref table if --cref. Don't close mapfile
11182 until after printing cref table.
11183 * cref.cc: Include "symtab.h".
11184 (class Cref_inputs): Define Cref_table_compare and Cref_table.
11185 (Cref_table_compare::operator()): New function.
11186 (Cref_inputs::gather_cref): New function.
11187 (filecol): New static const.
11188 (Cref_inputs::print_cref): New function.
11189 (Cref::print_cref): New function.
11190 * cref.h: Include <cstdio>.
11191 (class Cref): Update declarations.
11192 * mapfile.h (Mapfile::file): New function.
11193 * object.h (class Object): Define Symbols. Declare virtual
11194 do_get_global_symbols.
11195 (Object::get_global_symbols): New function.
11196 * object.cc (Input_objects::add_object): Pass object to cref_ if
11197 --cref.
11198 (Input_objects::archive_start): Likewise.
11199 (Input_objects::archive_stop): Likewise.
11200 (Input_objects::print_cref): New function.
11201 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
11202 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
11203 --cref.
11204 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
11205 function.
11206 * plugin.h (class Sized_pluginobj): Update declarations.
11207
8781f709
ILT
112082010-01-05 Ian Lance Taylor <iant@google.com>
11209
11210 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
11211 to is_default_version. Rename insdef to insdefault.
11212 (Symbol_table::add_from_relobj): Rename def to is_default_version
11213 and local to is_forced_local.
11214 (Symbol_table::add_from_pluginobj): Likewise.
11215 (Symbol_table::add_from_dynobj): Likewise.
11216 (Symbol_table::define_special_symbol): Rename insdef to
11217 insdefault.
11218
fe35d28d
ILT
112192010-01-04 Ian Lance Taylor <iant@google.com>
11220
30bc8c46
ILT
11221 PR 10980
11222 * options.h (class General_options): Add
11223 --allow-multiple-definition and -z muldefs.
11224 * resolve.cc (Symbol_table::should_override): Don't warn about a
11225 multiple symbol definition if --allow-multiple-definition or -z
11226 muldefs.
11227
7eaea549
ILT
11228 PR 10980
11229 * options.h (class General_options): Add --add-needed and
11230 --copy-dt-needed-entries. Tweak --as-needed help entry.
11231 * object.cc (Input_objects::check_dynamic_dependencies): Give an
11232 error if --copy-dt-needed-entries aka --add-needed is used and
11233 would cause a change in behaviour.
11234
fe35d28d
ILT
11235 PR 10980
11236 * options.h (class General_options): Add -G as a short version of
11237 --shared. Add no-op options -assert, -g, and -i.
11238
55a2bb35
ST
112392010-01-04 Sriraman Tallam <tmsriram@google.com>
11240
11241 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
11242 check for .text or .gnu.linkonce.t sections.
11243 * icf.cc (Icf::find_identical_sections): Ditto.
11244 Change the detection for mangled function name within the section
11245 name.
11246 * icf.h (is_section_foldable_candidate): New function.
11247
719328e1
ILT
112482009-12-30 Ian Lance Taylor <iant@google.com>
11249
11250 PR 10980
11251 * options.h (class General_options): Permit two dashes with
11252 --retain-symbols-file.
11253
d7bb5745
ILT
112542009-12-30 Ian Lance Taylor <iant@google.com>
11255
403a15dd
ILT
11256 PR 10979
11257 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
11258 don't put the file header and segment headers in the text
11259 segment.
11260
eda294df
ILT
11261 PR 10979
11262 * common.cc (Sort_commons::operator()): Stabilize sort when both
11263 entries are NULL.
11264 (Symbol_table::do_allocate_commons_list): When allocating common
11265 symbols, skip a symbol which is no longer common.
11266 * symtab.h (Symbol::is_common): Test whether the symbol comes from
11267 an object before checking its type.
11268 * testsuite/common_test_2.c: New file.
11269 * testsuite/common_test_3.c: New file.
11270 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
11271 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
11272 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
11273 (common_test_2_pic.o, common_test_2.so): New targets.
11274 (common_test_3_pic.o, common_test_3.so): New targets.
11275 * testsuite/Makefile.in: Rebuild.
11276
d7bb5745
ILT
11277 PR 10979
11278 * script.cc (read_input_script): If we see a new SECTIONS clause,
11279 and we have added an input section, give an error.
11280 * layout.h (class Layout): Add have_added_input_section function.
11281 Add have_added_input_section_ field.
11282 * layout.cc (Layout::Layout): Initialize
11283 have_added_input_section_.
11284 (Layout::layout): Set have_added_input_section_.
11285 (Layout::layout_eh_frame): Likewise.
11286
fc59c572
ILT
112872009-12-30 Ian Lance Taylor <iant@google.com>
11288
11289 PR 10931
11290 * options.h (class General_options): Add --sort-common option.
11291 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
11292 * common.cc (Sort_common): Add sort_order parameter to
11293 constructor. Add sort_order_ field.
11294 (Sort_commons::operator): Check sort_order_.
11295 (Symbol_table::allocate_commons): Determine the sort order.
11296 (Symbol_table::do_allocate_commons): Add sort_order parameter.
11297 Change all callers.
11298 (Symbol_table::do_allocate_commons_list): Likewise.
11299
1c74fab0
ILT
113002009-12-30 Ian Lance Taylor <iant@google.com>
11301
11302 PR 10916
11303 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
11304 symbols from this object, don't change the visibility of an
11305 undefined symbol.
11306 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
11307
6affe781
ILT
113082009-12-30 Ian Lance Taylor <iant@google.com>
11309
11310 PR 10861
11311 * script.h (class Version_script_info): Define Language enum.
11312 Update declarations. Define Glob, Exact, and Lookup types. Add
11313 new fields globals_, locals_, and is_finalized_.
11314 * script.cc: Various formatting fixes.
11315 (class Parser_closure): Change language_stack_ from a vector of
11316 std::string to one of Version_script_info::Language. Adjust all
11317 uses accordingly.
11318 (class Lazy_demangler): Remove.
11319 (struct Version_expression): Change language from std::string to
11320 Version_script_info::Language.
11321 (Version_script_info::Version_script_info): New function.
11322 (Version_script_info::~Version_script_info): Don't call clear.
11323 (Version_script_info::finalize): New function.
11324 (Version_script_info::build_lookup_tables): New function.
11325 (Version_script_info::build_expression_list_lookup): New
11326 function.
11327 (Version_script_info::get_symbol_version_helper): Rewrite to use
11328 lookup tables.
11329 (Version_script_info::print_expression_list): Adjust to use
11330 Version_script_info::Language.
11331 (script_push_lex_into_version_mode): Check that the version script
11332 has not been finalized.
11333 (version_script_push_lang): Change language string to
11334 Version_script_info::Language.
11335 * options.cc (Command_line::version_script): New function.
11336 * options.h (class General_options): Add finalize_dynamic_list
11337 function. Change version_script from declaration to definition.
11338 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
11339 * testsuite/version_script.map: Remove duplicate def of foo.
11340 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
11341 version_script.map.
11342 * testsuite/Makefile.in: Rebuild.
11343
818bf354
ILT
113442009-12-30 Ian Lance Taylor <iant@google.com>
11345
11346 PR 10843
11347 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
11348 if the input symbol index is 0, make the output symbol index 0.
11349
ebcc8304
ILT
113502009-12-30 Ian Lance Taylor <iant@google.com>
11351
11352 PR 10670
11353 * options.h (class General_options): Add -x/--discard-all.
11354 * object.cc (Sized_relobj::do_count_local_symbols): Handle
11355 --discard-all. If the local symbol needs a dynamic entry, check
11356 that before handling --discard-locals.
11357
176fe33f
ILT
113582009-12-30 Ian Lance Taylor <iant@google.com>
11359
bb321bb1
ILT
11360 PR 10450
11361 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
11362 flags to PF_R.
11363 (Output_segment::add_output_section): Don't change the flags if
11364 the type is PT_TLS.
11365
176fe33f
ILT
11366 PR 10450
11367 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
11368 GNU hash table if they need a dynamic value. Otherwise, don't add
11369 them if they are defined in a dynamic object or are forced local.
11370
e8cd95c7
ILT
113712009-12-29 Ian Lance Taylor <iant@google.com>
11372
1b81fb71
ILT
11373 PR 10450
11374 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
11375 .gnu.hash table for a 32-bit target.
11376
8d6d383d
ILT
11377 PR 10450
11378 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
11379 regular and a dynamic object only needs a dynamic symbol table
11380 entry if it is externally visible.
11381
e785ec03
ILT
11382 PR 10450
11383 * i386.cc (class Target_i386): Initialize global_offset_table_ in
11384 constructor. Add global_offset_table_ field.
11385 (Target_i386::got_section): Set global_offset_table_.
11386 (Target_i386::do_finalize_sections): Set global_offset_table_
11387 size.
11388 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
11389 in constructor. Add global_offset_table_ field.
11390 (Target_x86_64::got_section): Set global_offset_table_.
11391 (Target_x86_64::do_finalize_sections): Set global_offset_table_
11392 size.
11393
1a2dff53
ILT
11394 * layout.cc (Layout::Layout): Initialize increase_relro_.
11395 (Layout::get_output_section): Add is_relro, is_last_relro, and
11396 is_first_non_relro parameters. Change all callers.
11397 (Layout::choose_output_section): Likewise.
11398 (Layout::add_output_section_data): Likewise.
11399 (Layout::make_output_section): Likewise.
11400 (Layout::set_segment_offsets): Clear increase_relro when using a
11401 linker script.
11402 * layout.h (class Layout): Add increase_relro method. Add
11403 increase_relro_ field. Update declarations.
11404 * output.cc (Output_section::Output_section): Initialize
11405 is_last_relro_ and is_first_non_relro_.
11406 (Output_segment::add_output_section): Group relro sections is
11407 do_sort is true. Handle is_last_relro and is_first_non_relro.
11408 (Output_segment::maximum_alignment): Remove relro handling.
11409 (Output_segment::set_section_addresses): Add increase_relro
11410 parameter. Change all callers. Add initial alignment to align
11411 relro sections on separate page. Remove old relro handling.
11412 (Output_segment::set_section_list_addresses): Remove in_relro
11413 parameter. Change all callers.
11414 (Output_segment::set_offset): Add increase parameter. Change all
11415 callers. Remove old relro handling.
11416 * output.h (class Output_section): Add new methods: is_last_relro,
11417 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
11418 Add is_last_relro_ and is_first_non_relro_ fields.
11419 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
11420 Create separate .got.plt section. Call increase_relro.
11421 * x86_64.cc (Target_x86_64::got_section): Likewise.
11422 * testsuite/relro_script_test.t: Add .got.plt.
11423
f0ba79e2
ILT
11424 PR 10450
11425 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
11426 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
11427 (Layout::finalize): Call set_dynamic_symbol_size.
11428 (Layout::set_dynamic_symbol_size): New function.
11429 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
11430 set_dynamic_symbol_size.
11431
e8cd95c7
ILT
11432 PR 10450
11433 * output.h (class Output_section): Add is_entsize_zero_ field.
11434 * output.cc (Output_section::Output_section): Initialize
11435 is_entsize_zero_.
11436 (Output_section::set_entsize): If two different entsizes are
11437 requested, force it to zero.
11438 (Output_section::add_input_section): Set flags for .debug_str
11439 before updating section flags. Set entsize.
11440 (Output_section::update_flags_for_input_section): Set SHF_MERGE
11441 and SHF_STRING if all input sections have those flags.
11442
3e1b9a8a
RÁE
114432009-12-29 Rafael Espindola <espindola@google.com>
11444
11445 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
11446 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
11447 reporting.
3e1b9a8a 11448
3dcad376
ST
114492009-12-29 Sriraman Tallam <tmsriram@google.com>
11450
11451 * options.cc (General_options::parse_version): Allow -v to exit
11452 without an error if there is nothing to link.
11453
084e2665
ILT
114542009-12-29 Ian Lance Taylor <iant@google.com>
11455
11456 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
11457 using a version of gcc before 4.1.
11458 * configure: Rebuild.
11459
250acde3
CD
114602009-12-28 Chris Demetriou <cgd@google.com>
11461
11462 * attributes.cc (Output_attributes_section_data::do_write): Use
11463 std::vector::front rather than std::vector::data.
11464
99fff23b
ILT
114652009-12-28 Ian Lance Taylor <iant@google.com>
11466
11467 * symtab.h (class Symbol_table): Add enum Defined.
11468 * resolve.cc (Symbol_table::should_override): Add defined
11469 parameter. Change all callers. Test whether object is NULL
11470 before calling a method on it.
11471 (Symbol_table::report_resolve_problem): Add defined parameter.
11472 Change all callers.
11473 (Symbol_table::should_override_with_special): Likewise.
11474 * symtab.cc (Symbol_table::define_in_output_data): Add defined
11475 parameter. Change all callers.
11476 (Symbol_table::do_define_in_output_data): Likewise.
11477 (Symbol_table::define_in_output_segment): Likewise.
11478 (Symbol_table::do_define_in_output_segment): Likewise.
11479 (Symbol_table::define_as_constant): Likewise.
11480 (Symbol_table::do_define_as_constant): Likewise.
11481 * script.h (class Symbol_assignment): Add is_defsym parameter to
11482 constructor; change all callers.
11483 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
11484 parameter. Change all callers. Add is_defsym_ field.
11485 (class Parser_closure): Add parsing_defsym parameter to
11486 constructor; change all callers. Add parsing_defsym accessor
11487 function. Add parsing_defsym_ field.
11488
556bd683
ILT
114892009-12-28 Ian Lance Taylor <iant@google.com>
11490
11491 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 11492 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 11493
1782c879
ILT
114942009-12-23 Ian Lance Taylor <iant@google.com>
11495
11496 * i386.cc (Target_i386::do_calls_non_split): Recognize
11497 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
11498 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
11499 -fsplit-stack prologue when using %r11.
1782c879 11500
329ca2b1
ST
115012009-12-21 Sriraman Tallam <tmsriram@google.com>
11502
11503 * options.cc (General_options::parse_version): Make -v continue and do
11504 the link like GNU ld does.
11505
d675ff46
RÁE
115062009-12-17 Rafael Avila de Espindola <espindola@google.com>
11507
11508 * Makefile.am (CCFILES): Add timer.cc.
11509 (HFILES): Add timer.h.
11510 * configure.ac: Check for sysconf and times.
11511 * main.cc: include timer.h.
11512 (main): Use Timer instead of get_run_time.
11513 * timer.cc: New.
11514 * timer.h: New.
11515 * workqueue.cc: include timer.h.
11516 (Workqueue::find_and_run_task):
11517 Report user, sys and wall time.
11518 * Makefile.in: Regenerate.
11519 * config.in: Regenerate.
11520 * configure: Regenerate.
11521
d6344fb5
DK
115222009-12-16 Doug Kwan <dougkwan@google.com>
11523
11524 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
11525 sections.
11526 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
11527 relaxed input sections.
11528 * output.cc (Output_section::find_relaxed_input_section): Change
11529 return type to Output_relaxed_input_section pointer. Adjust code
11530 for new type of relaxed_input_section_map_.
11531 * output.h (Output_section::find_relaxed_input_section): Change
11532 return type to Output_relaxed_input_section pointer.
11533 (Output_section::Output_relaxed_input_section_by_input_section_map):
11534 New type.
11535 (Output_section::relaxed_input_section_map_): Change type to
11536 Output_section::Output_relaxed_input_section_by_input_section_map.
11537 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
11538 input section.
11539
0e0d5469
ILT
115402009-12-15 Ian Lance Taylor <iant@google.com>
11541
11542 * layout.cc (Layout::create_shstrtab): Only write out after input
11543 sections if we are compressing debug sections.
11544
0649a889
ILT
115452009-12-15 Ian Lance Taylor <iant@google.com>
11546
11547 * archive.cc (Archive::add_symbols): Only look up a symbol without
11548 a version if there is, in fact, a version.
11549
2ea97941
ILT
115502009-12-14 Ian Lance Taylor <iant@google.com>
11551
11552 Revert -Wshadow changes, all changes from:
11553 2009-12-11 Doug Kwan <dougkwan@google.com>
11554 2009-12-11 Nick Clifton <nickc@redhat.com>
11555 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
11556
b0eec2cc
DK
115572009-12-11 Doug Kwan <dougkwan@google.com>
11558
11559 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
11560 due to -Wshadow.
11561 * attributes.cc (Object_attribute::size): Ditto.
11562 (Attributes_section_data::size): Ditto.
11563 (Attributes_section_data::Attributes_section_data): Ditto.
11564 (Output_attributes_section_data::do_write): Ditto.
11565 * attributes.h (Object_attribute::set_type): Ditto.
11566 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
11567
91d6fa6a
NC
115682009-12-11 Nick Clifton <nickc@redhat.com>
11569
11570 * archive.cc: Fix shadowed variable warnings.
11571 * arm.cc: Likewise.
11572 * compressed_output.cc: Likewise.
11573 * compressed_output.h: Likewise.
11574 * configure: Likewise.
11575 * dwarf_reader.cc: Likewise.
11576 * dynobj.cc: Likewise.
11577 * dynobj.h: Likewise.
11578 * ehframe.cc: Likewise.
11579 * ehframe.h: Likewise.
11580 * errors.cc: Likewise.
11581 * expression.cc: Likewise.
11582 * fileread.cc: Likewise.
11583 * fileread.h: Likewise.
11584 * freebsd.h: Likewise.
11585 * i386.cc: Likewise.
11586 * icf.cc: Likewise.
11587 * incremental.h: Likewise.
11588 * layout.cc: Likewise.
11589 * layout.h: Likewise.
11590 * mapfile.cc: Likewise.
11591 * merge.cc: Likewise.
11592 * merge.h: Likewise.
11593 * object.cc: Likewise.
11594 * object.h: Likewise.
11595 * options.h: Likewise.
11596 * output.cc: Likewise.
11597 * output.h: Likewise.
11598 * parameters.cc: Likewise.
11599 * plugin.cc: Likewise.
11600 * powerpc.cc: Likewise.
11601 * reduced_debug_output.cc: Likewise.
11602 * reduced_debug_output.h: Likewise.
11603 * reloc.cc: Likewise.
11604 * reloc.h: Likewise.
11605 * resolve.cc: Likewise.
11606 * script-sections.cc: Likewise.
11607 * script.cc: Likewise.
11608 * script.h: Likewise.
11609 * sparc.cc: Likewise.
11610 * symtab.cc: Likewise.
11611 * symtab.h: Likewise.
11612 * target-select.cc: Likewise.
11613 * target-select.h: Likewise.
11614 * token.h: Likewise.
11615 * workqueue.cc: Likewise.
11616 * workqueue.h: Likewise.
11617 * x86_64.cc: Likewise.
11618
a0351a69
DK
116192009-12-10 Doug Kwan <dougkwan@google.com>
11620
11621 * arm.cc (attributes.h): New include.
11622 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
11623 (Arm_relobj::~Arm_relobj): Delete object pointed by
11624 attributes_section_data_.
11625 (Arm_relobj::attributes_section_data): New method definition.
11626 (Arm_relobj::attributes_section_data_): New data member declaration.
11627 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
11628 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
11629 attributes_section_data_.
11630 (Arm_dynobj::attributes_section_data): New method definition.
11631 (Arm_dynobj::attributes_section_data_): New data member declaration.
11632 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
11633 initialization value of may_use_blx_ to false.
2e702c99 11634 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
11635 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
11636 object attributes to compute results instead of hard-coding.
11637 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
11638 Target_arm::get_secondary_compatible_arch,
11639 Target_arm::set_secondary_compatible_arch
11640 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11641 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
11642 New method declarations.
11643 (Target_arm::get_aeabi_object_attribute): New method definition.
11644 (Target_arm::attributes_section_data_): New data member declaration.
11645 (read_arm_attributes_section): New template definition.
11646 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
11647 (Arm_dynobj::do_read_symbols): Ditto.
11648 (Target_arm::do_finalize_sections): Merge attributes sections from
11649 input. Check for BLX use after attributes section merging.
11650 Fix __exidx_start and __exidx_end visibility. Create an
11651 .ARM.attributes section if necessary.
11652 (Target_arm::get_secondary_compatible_arch,
11653 Target_arm::set_secondary_compatible_arch,
11654 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11655 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 11656 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
11657 New method definitions.
11658
b59befec
ILT
116592009-12-09 Ian Lance Taylor <iant@google.com>
11660
11661 * plugin.cc (Plugin::load): Don't cast from void* to a function
11662 pointer.
11663
1276bc89
ILT
116642009-12-09 Ian Lance Taylor <iant@google.com>
11665
11666 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
11667 information fields.
11668
2f2de248
L
116692009-12-09 H.J. Lu <hongjiu.lu@intel.com>
11670
11671 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
11672 Replace two_file_shared_1.so with two_file_shared_2.so.
11673 * testsuite/Makefile.in: Regenerated.
11674
4f787271
DK
116752009-12-08 Doug Kwan <dougkwan@google.com>
11676
11677 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
11678 (HFILES): Add attributes.h and int_encoding.h.
11679 * Makefile.in: Regenerate.
11680 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
11681 function definitions to int_encoding.cc
11682 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
11683 prototypes to int_encoding.h
11684 * reduced_debug_output.cc (int_encoding.h): New include.
11685 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
11686 function definitions to int_encoding.cc
11687 (insert_into_vector, read_from_pointer): Move template definitions to
11688 int_encoding.h
11689 * attributes.cc: New file.
11690 * attributes.h: New file.
11691 * int_encoding.cc: New file.
11692 * int_encoding.h: New file.
11693
20b52f1a
RÁE
116942009-12-07 Rafael Avila de Espindola <espindola@google.com>
11695
11696 PR gold/11055
11697 * incremental-dump.cc (dump_incremental_inputs): New.
11698 (main): Use dump_incremental_inputs.
11699
53d7974c
L
117002009-12-07 H.J. Lu <hongjiu.lu@intel.com>
11701
11702 PR gold/10893
11703 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
11704 checking elfcpp::STT_FUNC.
11705 (Target_i386::Relocate::relocate): Likewise.
11706 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
11707
11708 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
11709 symbols from shared libraries into normal FUNC symbols.
11710
11711 * symtab.h (Symbol): Add is_func and use it.
11712
05a352e6
DK
117132009-12-05 Doug Kwan <dougkwan@google.com>
11714
11715 * arm.cc (Target_arm::arm_info): Initialize new fields
11716 attributes_section and attributes_vendor.
11717 * i386.cc (Target_i386::i386_info): Same.
11718 * object.cc (Sized_relobj::do_layout): Skip attribute section.
11719 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
11720 fields attributes_section and attributes_vendor.
53d7974c 11721 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
11722 * target.h (Target::attributes_section, Target::attributes_vendor,
11723 Target::is_attributes_section, Target::attribute_arg_type,
11724 Target::attributes_order): New method definitions.
11725 (Target::Target_info::attributes_section,
11726 Target::Target_info::attributes_vendor): New fields.
11727 (Target::do_attribute_arg_type, Target::do_attributes_order): New
11728 virtual method definitions.
11729 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
11730 attributes_section and attributes_vendor.
11731 * testsuite/testfile.cc (Target_test::test_target_info): Same.
11732
f4e5969c
DK
117332009-12-05 Doug Kwan <dougkwan@google.com>
11734
11735 * arm.cc: Update comments about interworking and stub generation.
11736 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
11737 considered as non-PIC.
11738 (Arm_relocate_functions::base_abs): Fix formatting.
11739 (Arm_relocate_functions::got_prel): Fix comment. Change interface
11740 of function to use GOT entry address instead of offset.
11741 (Target_arm::Scan::global): Issue an error if a symbol would need a
11742 PLT does not get one because it is untyped. Remove code to create
11743 dynamic symbols for relative branches.
11744 (Target_arm::Relocate::relocate: Use 0 instead of false since function
11745 takes unsigned integer instead of boolean.
11746
1abce4a6
L
117472009-12-05 H.J. Lu <hongjiu.lu@intel.com>
11748
11749 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
11750 (two_file_test_LDADD): Likewise.
11751 (common_test_1_LDADD): Likewise.
11752 (exception_test_LDADD) Likewise.
11753 (weak_test_LDADD): Likewise.
11754 (many_sections_test_LDADD): Likewise.
11755 (initpri1_LDADD): Likewise.
11756 (script_test_1_LDADD): Likewise.
11757 (script_test_2_LDADD): Likewise.
11758 (justsyms_LDADD): Likewise.
11759 (binary_test_LDADD): Likewise.
11760 (large_LDADD): Likewise.
11761 * testsuite/Makefile.in: Regenerated.
11762
adcf2816 117632009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 11764
adcf2816
L
11765 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
11766 (Symbol_table::override_with_special): Likewise.
11767 (Symbol_table::add_from_object): Likewise.
11768
28e67f5d
RÁE
117692009-12-04 Rafael Avila de Espindola <espindola@google.com>
11770
11771 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11772 Don't set the data_offset twice.
11773
ae10a101
RÁE
117742009-12-04 Rafael Avila de Espindola <espindola@google.com>
11775
11776 * testsuite/Makefile.in: Regenerate.
11777
f59f41f3
DK
117782009-12-03 Doug Kwan <dougkwan@google.com>
11779
11780 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
11781 (Target_arm::do_finalize_sections): Add parameter for symbol table
11782 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
11783 * i386.cc (Target_i386::do_finalize_sections): Add an additional
11784 parameter for symbol table pointer.
11785 * layout.cc (Layout::finalize): Call Target::finalize_sections with
11786 an additional parameter for a pointer to symbol table.
11787 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
11788 parameter for a symbol table pointer.
11789 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
11790 * target.h (Target::finalize_sections, Target::do_finalize_sections):
11791 Ditto.
11792 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
11793 parameter for a symbol table pointer.
11794
ca55d848
RÁE
117952009-12-03 Rafael Avila de Espindola <espindola@google.com>
11796
11797 * incremental.cc (Incremental_inputs_header)
11798 (Incremental_inputs_header_write, Incremental_inputs_entry)
11799 (Incremental_inputs_entry_write): Move ...
11800 * incremental.h (Incremental_inputs_header)
11801 (Incremental_inputs_header_write, Incremental_inputs_entry)
11802 (Incremental_inputs_entry_write): here.
11803
3aec4f9c
RÁE
118042009-12-02 Rafael Avila de Espindola <espindola@google.com>
11805
11806 * incremental.cc (make_sized_incremental_binary): Set the target.
11807 Error if it is incompatible.
11808 * output.h (Output_file): Add filename method.
11809
9c0ae74d
RÁE
118102009-12-02 Rafael Avila de Espindola <espindola@google.com>
11811
11812 * incremental.cc (Incremental_inputs_entry): Remove unused argument
11813 from the get_* methods.
11814
a45500ae
RÁE
118152009-12-02 Rafael Avila de Espindola <espindola@google.com>
11816
11817 * incremental-dump.cc (main): Check that the offeset of a script is 0.
11818 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11819 Write 0 for the data_offset of scripts.
11820
325e6408
RÁE
118212009-12-02 Rafael Avila de Espindola <espindola@google.com>
11822
11823 * testsuite/Makefile.am: Add the incremental_test.sh test.
11824 * testsuite/incremental_test.sh: New.
11825 * testsuite/incremental_test_1.c: New.
11826 * testsuite/incremental_test_2.c: New.
11827
954c3e2e
RÁE
118282009-12-01 Rafael Avila de Espindola <espindola@google.com>
11829
703d02da 11830 * incremental-dump.cc (main): Fix typos.
954c3e2e 11831
f8086623
RÁE
118322009-11-27 Rafael Avila de Espindola <espindola@google.com>
11833
11834 PR gold/11025
11835 * incremental-dump.cc (main): Use llu to print 64 bit values.
11836
3b0dd6ac
L
118372009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
11838 H.J. Lu <hongjiu.lu@intel.com>
11839
11840 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
11841 $(LIBDL).
11842 (incremental_dump_LDADD): Likewise.
11843 * Makefile.in: Regenerated.
11844
a6d1ef57 118452009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 11846
a6d1ef57
DK
11847 Revert:
11848
11849 2009-11-25 Doug Kwan <dougkwan@google.com>
11850
11851 * arm.cc (Target_arm::Target_arm): Move method definition
11852 outside of class definition. Add code to handle
11853 --target1-rel, --target1-abs and --target2= options.
11854 (Target_arm::get_reloc_reloc_type): Change method to be
11855 non-static and const.
11856 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
11857 New data member declaration.
11858 (Target_arm::Scan::local, Target_arm::Scan::global,
11859 Target_arm::Relocate::relocate,
11860 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11861 Adjust call to Target_arm::get_real_reloc_type.
11862 (Target_arm::get_real_reloc_type): Use command line options
11863 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11864 * options.h (--target1-rel, --target1-abs, --target2): New
11865 ARM-only options.
11866
50aeb7d4
DK
118672009-11-25 Doug Kwan <dougkwan@google.com>
11868
11869 * arm.cc (Target_arm::Target_arm): Move method definition outside of
11870 class definition. Add code to handle --target1-rel, --target1-abs
11871 and --target2= options.
11872 (Target_arm::get_reloc_reloc_type): Change method to be non-static
11873 and const.
11874 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
11875 member declaration.
11876 (Target_arm::Scan::local, Target_arm::Scan::global,
11877 Target_arm::Relocate::relocate,
11878 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
11879 call to Target_arm::get_real_reloc_type.
11880 (Target_arm::get_real_reloc_type): Use command line options to
11881 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11882 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
11883 options.
11884
51938283
DK
118852009-11-25 Doug Kwan <dougkwan@google.com>
11886
11887 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
11888 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
11889 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
11890 formatting.
11891 (Arm_relocate_functions::thm_call): Replace body with a call to
11892 Arm_relocate_functions::thumb_branch_common.
11893 (Arm_relocate_functions::thm_jump24,
11894 Arm_relocate_functions::thm_xpc22): New method definitions.
11895 (Arm_relocate_functions::thumb_branch_common): New method definition.
11896 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
11897 operator.
11898 (Target_arm::Relocate::relocate): Adjust call to thm_call.
11899 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
11900
e2b8f3c4
RÁE
119012009-11-24 Rafael Avila de Espindola <espindola@google.com>
11902
11903 * Makefile.am: Build incremental-dump
11904 * Makefile.in: Regenerate.
11905 * incremental-dump.cc: New.
11906 * incremental.cc (Incremental_inputs_header_data,
11907 Incremental_inputs_entry_data): Move to incremental.h
11908 * incremental.h: (Incremental_inputs_header_data,
11909 Incremental_inputs_entry_data): Move from incremental.cc
11910
bcba9aec
RÁE
119112009-11-24 Rafael Avila de Espindola <espindola@google.com>
11912
11913 * incremental.cc (Incremental_inputs_header,
11914 Incremental_inputs_header_write, Incremental_inputs_entry,
11915 Incremental_inputs_entry_write): Add a typedef with the data type.
11916
7c3afe08
RÁE
119172009-11-24 Rafael Avila de Espindola <espindola@google.com>
11918
11919 * incremental.cc (Incremental_inputs_header,
11920 Incremental_inputs_header_write, Incremental_inputs_entry,
11921 Incremental_inputs_entry_write): Update comment about which
11922 type has the filed descriptions.
11923
d204b6e9
DK
119242009-11-15 Doug Kwan <dougkwan@google.com>
11925
11926 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
11927 (Arm_relocate_functions::arm_branch_common): Change method defintion
11928 in class definition to a method declaration and update list of formal
11929 parameters.
11930 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
11931 Arm_relocation_functions::jump24): Adjust call to
11932 Arm_relocate_functions::arm_branch_common. Update list of formal
11933 parameters.
11934 (Arm_relocate_functions::xpc25): New method definition.
11935 (Arm_relocate_functions::arm_branch_common): Move method defintion
11936 out from class definition. Use stubs for mode-switching and extending
11937 branch ranges.
11938 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
11939 specially. Change code to enable use of stubs in ARM branches.
11940
43d12afe
DK
119412009-11-10 Doug Kwan <dougkwan@google.com>
11942
11943 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
11944 in method declaration.
11945 (Target_arm::relocate_stub): New method declaration.
11946 (Target_arm::default_target): Change to return a pointer instead of
11947 a const reference.
11948 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
11949 Target_arm::default_target.
11950 (Arm_Relobj::do_relocate_sections): Remove options paramater in
11951 method definition.
11952 (Target_arm::relocate_section): Adjust view.
11953 (Target_arm::relocate_stub): New method definition.
11954
ac33a407
DK
119552009-11-10 Doug Kwan <dougkwan@google.com>
11956
11957 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
11958 a format warning.
11959 * incremental.cc (open_incremental_binary): Initialized local
11960 variables to avoid warnings.
11961 * object.cc (make_elf_object): Ditto.
11962 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
11963 a format warning.
e1df38aa 11964
88ee28e9
L
11965009-11-09 H.J. Lu <hongjiu.lu@intel.com>
11966
11967 PR gold/10930
11968 * testsuite/plugin_test.c: Include "config.h".
11969
2daedcd6
DK
119702009-11-09 Doug Kwan <dougkwan@google.com>
11971
11972 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
11973 (arm_symbol_value): Remove.
11974 (Arm_relocate_functions::arm_branch_common,
11975 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
11976 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
11977 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
11978 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
11979 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
11980 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
11981 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
11982 Arm_relocate_functions::thm_mobw_abs_nc,
11983 Arm_relocate_functions::thm_mov_abs,
11984 Arm_relocate_functions::movw_prel_nc,
11985 Arm_relocate_functions::thm_movt_abs,
11986 Arm_relocate_functions::movt_prel,
11987 Arm_relocate_functions::thm_movw_prel_nc,
11988 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
11989 (Target_arm::Relocate::relocate): Only decompose address into two
11990 parts if relocation type uses the thumb-bit and pass the actual
11991 bit instead of a flag indicating that the thumb-bit is used. Adjust
11992 calls to methods in Arm_relocate_functions for this change.
11993
1276bc89 119942009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
11995
11996 PR 10925
11997 * reloc.cc: Instantiate
11998 Sized_relobj::initialize_input_to_output_maps and
11999 Sized_relobj:free_input_to_output_maps.
12000
e53ad1b5
ILT
120012009-11-06 Ian Lance Taylor <iant@google.com>
12002
12003 PR 10876
12004 * defstd.cc (in_segment): Set only_if_ref true for "end".
12005
eb44217c
DK
120062009-11-06 Doug Kwan <dougkwan@google.com>
12007
12008 * arm.cc (class Reloc_stub): Correct a comment.
12009 (Target_arm::Target_arm): Initialize arm_input_section_map_.
12010 (Target_arm::scan_section_for_stubs): New method declaration.
12011 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
12012 Change methods from private to protected.
12013 (Target_arm::do_may_relax): New method definition.
12014 (Target_arm::do_relax, Target_arm::group_sections,
12015 Target_arm::scan_reloc_for_stub,
12016 Target_arm::scan_reloc_section_for_stubs): New method declarations.
12017 (Target_arm::arm_input_section_map_): New data member declaration.
12018 (Target_arm::scan_reloc_for_stub,
12019 Target_arm::scan_reloc_section_for_stubs,
12020 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
12021 Target_arm::do_relax): New method definitions.
12022
5d329b7d
ILT
120232009-11-06 Mikolaj Zalewski <mikolaj@google.com>
12024
12025 * configure.ac: Check for (struct stat)::st_mtim
12026 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
12027 * config.in: Regenerate.
12028 * configure: Regenerate.
12029
96a0d71b
ILT
120302009-11-05 Ian Lance Taylor <iant@google.com>
12031
12032 PR 10910
12033 * output.cc (Output_segment::add_output_section): Add missing
12034 return statement.
12035
594c8e5e
ILT
120362009-11-04 Ian Lance Taylor <iant@google.com>
12037
12038 PR 10880
12039 * object.h (class Object): Add is_needed and set_is_needed
12040 methods. Add is_needed_ field. Make bool fields into bitfields.
12041 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
12042 defined in a dynamic object and referenced by a regular object,
12043 set is_needed for the dynamic object.
12044 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
12045 if the file is marked with as_needed and it is not needed.
12046
22b127cc
ILT
120472009-11-04 Ian Lance Taylor <iant@google.com>
12048
12049 PR 10887
12050 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
12051 tags if data is discarded by linker script.
12052 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12053 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12054 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12055 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12056
f5c870d2
ILT
120572009-11-04 Ian Lance Taylor <iant@google.com>
12058
12059 * layout.cc (Layout::get_output_section): Add is_interp and
12060 is_dynamic_linker_section parameters. Change all callers.
12061 (Layout::choose_output_section): Likewise.
12062 (Layout::make_output_section): Likewise.
12063 (Layout::add_output_section_data): Add is_dynamic_linker_section
12064 parameter. Change all callers.
12065 * layout.h (class Layout): Update declarations.
12066 * output.h (class Output_section): Add is_interp, set_is_interp,
12067 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
12068 Add is_interp_, is_dynamic_linker_section_ fields. Change
12069 generate_code_fills_at_write_ to a bitfield.
12070 * output.cc (Output_section::Output_sections): Initialize new
12071 fields.
12072 (Output_segment::add_output_section): Add do_sort parameter.
12073 Change all callers.
12074
1ae4d23b
ILT
120752009-11-03 Ian Lance Taylor <iant@google.com>
12076
12077 PR 10860
12078 * options.h (class General_options): Add --warn-common.
12079 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
12080 merging two common symbols.
12081 (Symbol_table::should_override): Handle --warn-common when merging
12082 a common symbol with a defined symbol. Use report_resolve_problem
12083 for multiple definitions.
12084 (Symbol_table::report_resolve_problem): New function.
12085 * symtab.h (class Symbol_table): Declare report_resolve_problem.
12086
55da9579
DK
120872009-11-03 Doug Kwan <dougkwan@google.com>
12088
12089 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
12090 stub_factory_.
12091 (Target_arm::stub_factory): New method definition.
12092 (Target_arm::new_arm_input_section,
12093 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
12094 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 12095 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
12096 New type definitions.
12097 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
12098 member declarations.
12099 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
12100 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
12101 New method definitions.
12102
37a9ac43
ILT
121032009-11-03 Ian Lance Taylor <iant@google.com>
12104
12105 * options.h (class General_options): Add --warn_constructors.
12106
b3d6a3d4
ILT
121072009-11-03 Ian Lance Taylor <iant@google.com>
12108
12109 PR 10893
12110 * defstd.cc (in_section): Add entries for __rel_iplt_start,
12111 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
12112
934b01dd
ILT
121132009-11-03 Ian Lance Taylor <iant@google.com>
12114
12115 PR 10895
12116 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
12117 --msgid-bugs-address.
12118 (install-pdf): New target.
12119 (install-data_yes): Look up one directory to find mkinstalldirs.
12120
03c1939b
L
121212009-11-03 H.J. Lu <hongjiu.lu@intel.com>
12122
12123 * po/Make-in (.po.gmo): Don't generate .gmo files in source
12124 tree.
12125
ebd95253
DK
121262009-10-30 Doug Kwan <dougkwan@google.com>
12127
12128 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
12129
e9bbb538
DK
121302009-10-30 Doug Kwan <dougkwan@google.com>
12131
12132 * arm.cc (Stub_addend_reader): New struct template definition
12133 and partial specializations.
12134 (Stub_addend_reader::operator()): New method definition for a
12135 partially specialized template.
12136
d5b40221
DK
121372009-10-30 Doug Kwan <dougkwan@google.com>
12138
12139 * arm.cc (Arm_relobj::processor_specific_flags): New method
12140 definition.
12141 (Arm_relobj::do_read_symbols): New method declaration.
12142 (Arm_relobj::processor_specific_flags_): New data member declaration.
12143 (Arm_dynobj): New class definition.
12144 (Target_arm::do_finalize_sections): Add input_objects parameter.
12145 (Target_arm::do_adjust_elf_header): New method declaration.
12146 (Target_arm::are_eabi_versions_compatible,
12147 (Target_arm::merge_processor_specific_flags): New method declaration.
12148 (Target_arm::do_make_elf_object): New overloaded method definitions
12149 and declaration.
12150 (Arm_relobj::do_read_symbols): New method definition.
12151 (Arm_dynobj::do_read_symbols): Ditto.
12152 (Target_arm::do_finalize_sections): Add input_objects parameters.
12153 Merge processor-specific flags from all input objects.
12154 (Target_arm::are_eabi_versions_compatible,
12155 Target_arm::merge_processor_specific_flags,
12156 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
12157 New method definitions.
12158 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
12159 Input_objects pointer type parameter.
12160 * layout.cc (Layout::finalize): Pass input objects to target's.
12161 finalize_sections function.
12162 * output.cc (Output_file_header::do_sized_write): Set ELF file
12163 header's processor-specific flags.
12164 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
12165 Input_objects pointer type parameter.
12166 * sparc.cc (Target_sparc::do_finalize_sections): Same.
12167 * target.h (Input_objects): New forward class declaration.
12168 (Target::processor_specific_flags,
12169 Target::are_processor_specific_flags_sect): New method definitions.
12170 (Target::finalize_sections): Add input_objects parameter.
12171 (Target::Target): Initialize processor_specific_flags_ and
12172 are_processor_specific_flags_set_.
12173 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
12174 parameter.
12175 (Target::set_processor_specific_flags): New method definition.
12176 (Target::processor_specific_flags_,
12177 Target::are_processor_specific_flags_set_): New data member
12178 declarations.
12179 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
12180 Input_objects pointer type parameter.
12181
ebabffbd
DK
121822009-10-30 Doug Kwan <dougkwan@google.com>
12183
12184 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
12185
ad0f2072
ILT
121862009-10-28 Ian Lance Taylor <iant@google.com>
12187
12188 * object.h (class Relobj): Drop options parameter from
12189 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
12190 do_scan_relocs, do_relocate. Change all callers.
12191 (class Sized_relobj): Drop options parameters from
12192 do_gc_process_relocs, do_scan_relocs, do_relocate,
12193 do_relocate_sections, relocate_sections, emit_relocs_scan,
12194 emit_relocs_scan_reltype. Change all callers.
12195 (struct Relocate_info): Remove options field and all references to
12196 it.
12197 * reloc.h (class Read_relocs): Remove options constructor
12198 parameter and options_ field. Change all callers.
12199 (class Gc_process_relocs, class Scan_relocs): Likewise.
12200 (class Relocate_task): Likewise.
12201 * target-reloc.h (scan_relocs): Remove options parameter. Change
12202 all callers.
12203 (scan_relocatable_relocs): Likewise.
12204 * target.h (class Sized_target): Remove options parameter from
12205 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
12206 all callers.
12207 * gc.h (gc_process_relocs): Remove options parameter. Change all
12208 callers.
12209 * arm.cc: Update functions to remove options parameters.
12210 * i386.cc: Likewise.
12211 * powerpc.cc: Likewise.
12212 * sparc.cc: Likewise.
12213 * x86_64.cc: Likewise.
12214 * testsuite/testfile.cc: Likewise.
12215
8ffa3667
DK
122162009-10-28 Doug Kwan <dougkwan@google.com>
12217
12218 * arm.cc (Arm_relobj): New class definition.
e1df38aa 12219 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
12220 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
12221 New method definitions.
12222
40f36857
CC
122232009-10-28 Cary Coutant <ccoutant@google.com>
12224
12225 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
12226 (Plugin::cleanup_done_): New member.
12227 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
12228 (Plugin_manager::cleanup_done_): Remove.
12229 (Plugin_manager::add_input_file): Edit error message.
12230 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
12231 (Plugin_manager::cleanup): Remove use of cleanup_done_.
12232
2c849493
ILT
122332009-10-27 Mikolaj Zalewski <mikolajz@google.com>
12234
12235 * fileread.cc: (File_read::View::~View): Use the new
12236 data_ownership_ filed.
12237 (File_read::~File_read): Dispose the new whole_file_view_.
12238 (File_read::open): Mmap the whole file if needed.
12239 (File_read::open): Use whole_file_view_ instead of contents_.
12240 (File_read::find_view): Use whole_file_view_ if applicable.
12241 (File_read::do_read): Use whole_file_view_ instead of contents_.
12242 (File_read::make_view): Use whole_file_view_ instead of contents_,
12243 update File_read::View::View call.
12244 (File_read::find_or_make_view): Update File_read::View::View
12245 call.
12246 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
12247 remove contents_
12248 (File_read::View::Data_ownership): New enum.
12249 (File_read::View::View): Replace bool mapped_ with Data_ownership
12250 argument.
12251 (File_read::View::mapped_): Remove (replaced by data_ownership_).
12252 (File_read::View::data_ownership_): New field.
12253 (File_read::contents_): Remove (replaced by whole_file_view_).
12254 (File_read::whole_file_view_): New field.
12255 * options.h (class General_options): Add --keep-files-mapped.
12256
24998053
CC
122572009-10-27 Cary Coutant <ccoutant@google.com>
12258
12259 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
12260 * testsuite/Makefile.am (plugin_test_5): New test case.
12261 * testsuite/Makefile.in: Regenerate.
12262
72adc4fa
DK
122632009-10-25 Doug Kwan <dougkwan@google.com>
12264
12265 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
12266 from private to protected to allow access by child class.
12267 (Sized_relobj::do_relocate_sections): New method declaration.
12268 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 12269 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
12270 Sized_relobj::relocate_sections. Instantiate template explicitly
12271 for different target sizes and endianity.
12272
07f508a2
DK
122732009-10-24 Doug Kwan <dougkwan@google.com>
12274
12275 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
12276 (Arm_input_section::as_arm_input_section): New method.
12277 (Arm_output_section): New class definition.
12278 (Arm_output_section::create_stub_group,
12279 Arm_output_section::group_sections): New method definitions.
12280
10ad9fe5
DK
122812009-10-22 Doug Kwan <dougkwan@google.com>
12282
12283 * arm.cc (Arm_input_section): New class definition.
12284 (Arm_input_section::init, Arm_input_section:do_write,
12285 Arm_input_section::set_final_data_size,
12286 Arm_input_section::do_reset_address_and_file_offset): New method
12287 definitions.
12288
56ee5e00
DK
122892009-10-21 Doug Kwan <dougkwan@google.com>
12290
12291 * arm.cc (Stub_table, Arm_input_section): New forward class
12292 declarations.
12293 (Stub_table): New class defintion.
12294 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
12295 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
12296 New method definition.
12297
b569affa
DK
122982009-10-21 Doug Kwan <dougkwan@google.com>
12299
12300 * arm.cc: Update copyright comments.
12301 (Target_arm): New forward class template declaration.
12302 (Arm_address): New type.
12303 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
12304 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
12305 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
12306 constants.
12307 (Insn_template): Same.
12308 (DEF_STUBS): New macro.
12309 (Stub_type): New enum type.
12310 (Stub_template): New class definition.
12311 (Stub): Same.
12312 (Reloc_stub): Same.
12313 (Stub_factory): Same.
12314 (Target_arm::Target_arm): Initialize may_use_blx_ and
12315 should_force_pic_veneer_.
12316 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
12317 Target_arm::should_force_pic_veneer,
12318 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
12319 Target_arm::using_thumb_only, Target_arm:;default_target): New
12320 method defintions.
12321 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
12322 New data member declarations.
12323 (Insn_template::size, Insn_template::alignment): New method defintions.
12324 (Stub_template::Stub_template): New method definition.
12325 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
12326 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
12327 (Stub_factory::Stub_factory): New method definition.
12328 * gold.h (string_hash): New template.
12329 * output.h (Input_section_specifier::hash_value): Use
12330 gold::string_hash.
12331 (Input_section_specifier::string_hash): Remove.
12332 * stringpool.cc (Stringpool_template::string_hash): Use
12333 gold::string_hash.
12334
6c172549
DK
123352009-10-20 Doug Kwan <dougkwan@google.com>
12336
12337 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
12338 symbols of relaxed input sections.
12339 * output.h (Output_section::find_relaxed_input_section): Make
12340 method public.
12341
c5617f2f
DK
123422009-10-16 Doug Kwan <dougkwan@google.com>
12343
12344 * dynobj.cc (Versions::Versions): Initialize version_script_.
12345 Only insert base version symbol definition for a shared object
12346 if version script defines any version versions.
12347 (Versions::define_base_version): New method definition.
12348 (Versions::add_def): Check that base version is not needed.
12349 (Versions::add_need): Define base version lazily.
12350 * dynobj.h (Versions::define_base_version): New method declaration.
12351 (Versions::needs_base_version_): New data member declaration.
12352 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
12353 (check_DATA): Add no_version_test.stdout.
12354 (libno_version_test.so, no_version_test.o no_version_test.stdout):
12355 New make rules.
12356 * testsuite/Makefile.in: Regenerate.
12357 * testsuite/no_version_test.c: New file.
12358 * testsuite/no_version_test.sh: Ditto.
12359
3c12dcdb
DK
123602009-10-16 Doug Kwan <dougkwan@google.com>
12361
12362 * expression.cc (class Segment_start_expression): New class definition.
12363 (Segment_start_expression::value): New method definition.
12364 (script_exp_function_segment_start): Return a new
12365 Segment_start_expression.
12366 * gold/script-c.h (script_saw_segment_start_expression): New function
12367 prototype.
12368 * script-sections.cc (Script_sections::Script_sections): Initialize
12369 SAW_SEGMENT_START_EXPRESSION_ to false.
12370 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
12371 and -Tbbs options to specify section addresses if given in
12372 command line and no SEGMENT_START expression is seen in a script.
12373 * script-sections.h (Script_sections::saw_segment_start_expression,
12374 Script_sections::set_saw_segment_start_expression): New method
12375 definition.
12376 (Script_sections::saw_segment_start_expression_): New data member
12377 declaration.
12378 * script.cc (script_saw_segment_start_expression): New function.
12379 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
12380 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
12381 script_test_7.sh and script_test_8.sh.
12382 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
12383 script_test_8.stdout.
12384 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
12385 (script_test_6, script_test_6.stdout, script_test_7,
12386 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
12387 * Makefile.in: Regenerate.
12388 * testsuite/script_test_6.sh: New file.
12389 * testsuite/script_test_6.t: Same.
12390 * testsuite/script_test_7.sh: Same.
12391 * testsuite/script_test_7.t: Same.
12392 * testsuite/script_test_8.sh: Same.
12393
64b1ae37
DK
123942009-10-16 Doug Kwan <dougkwan@google.com>
12395
12396 * output.cc (Output_segment::set_section_list_address): Cast
12397 expressions to unsigned long long type to avoid format warnings.
12398
661be1e2
ILT
123992009-10-15 Ian Lance Taylor <iant@google.com>
12400
12edd763 12401 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 12402 dot assignment to script_sections_.
12edd763
ILT
12403 * script-sections.cc (Script_sections::add_dot_assignment):
12404 Initialize if necessary.
12405
68b6574b
ILT
12406 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
12407 program headers with no load segment if there is a linker script.
12408
661be1e2
ILT
12409 * layout.cc (Layout::set_segment_offsets): Align the file offset
12410 to the segment aligment for -N or -n with no load segment.
12411 * output.cc (Output_segment::add_output_section): Don't crash if
12412 the first section is a TLS section.
12413 (Output_segment::set_section_list_addresses): Print an error
12414 message if the address moves backward in a linker script.
12415 * script-sections.cc
12416 (Output_section_element_input::set_section_addresses): Don't
12417 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
12418 (Orphan_output_section::set_section_addresses): Likewise.
12419
f15f61a7
DK
124202009-10-15 Doug Kwan <dougkwan@google.com>
12421
12422 * layout.cc (Layout::finish_dynamic_section): Generate tags
12423 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
12424 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
12425 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
12426
82bb573a
ILT
124272009-10-14 Ian Lance Taylor <iant@google.com>
12428
12429 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
12430 fields.
12431 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
12432 data_shdr fields of relinfo.
12433 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
12434 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
12435 R_386_TLS_LDO_32, adjust based on section flags.
12436 (Target_i386::Relocate::fix_up_ldo): Remove.
12437
374ad285
ILT
124382009-10-13 Ian Lance Taylor <iant@google.com>
12439
12440 Add support for -pie.
12441 * options.h (class General_options): Add -pie and
12442 --pic-executable.
12443 (General_options::output_is_position_independent): Test -pie.
12444 (General_options::output_is_executable): Return true if not shared
12445 and not relocatable.
12446 (General_options::output_is_pie): Remove.
12447 * options.cc (General_options::finalize): Reject incompatible uses
12448 of -pie.
12449 * gold.cc (queue_middle_tasks): A -pie link is not static.
12450 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
12451 * symtab.cc (Symbol::final_value_is_known): Return false if
12452 output_is_position_independent.
12453 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
12454 output_is_position_independent.
12455 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
12456 output_is_position_independent.
12457 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
12458 output_is_position_independent.
12459 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
12460 two_file_pie_test.
12461 (basic_pie_test.o, basic_pie_test): New targets.
12462 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
12463 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
12464 (two_file_pie_test): New target.
12465 * testsuite/Makefile.in: Rebuild.
12466 * README: Remove note saying that -pie is not supported.
12467
c6585162
ILT
124682009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
12469
12470 * options.h (class General_options): Add -init and -fini.
12471 * layout.cc (Layout::finish_dynamic_section): Emit
12472 given init and fini functions.
12473
032ce4e9
ST
124742009-10-13 Sriraman Tallam <tmsriram@google.com>
12475
12476 * gc.h (gc_process_relocs): Check if icf is enabled using new
12477 function.
12478 * gold.cc (queue_initial_tasks): Likewise.
12479 (queue_middle_tasks): Likewise.
12480 * object.cc (do_layout): Likewise.
12481 * symtab.cc (is_section_folded): Likewise.
12482 * main.cc (main): Likewise.
12483 * reloc.cc (Read_relocs::run): Likewise.
12484 (Sized_relobj::do_scan_relocs): Likewise.
12485 * icf.cc (is_function_ctor_or_dtor): New function.
12486 (Icf::find_identical_sections): Check if function is ctor or dtor when
12487 safe icf is chosen.
12488 * options.h (General_options::icf): Change option to be an enum.
12489 (Icf_status): New enum.
12490 (icf_enabled): New method.
12491 (icf_safe_folding): New method.
12492 (set_icf_status): New method.
12493 (icf_status_): New variable.
12494 * (options.cc) (General_options::finalize): Set icf_status_.
12495 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
12496 icf_test and icf_keep_unique_test to use the --icf enum flag.
12497 * testsuite/icf_safe_test.sh: New file.
e1df38aa 12498 * testsuite/icf_safe_test.cc: New file.
032ce4e9 12499
f345227a
ST
125002009-10-12 Sriraman Tallam <tmsriram@google.com>
12501
12502 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
12503 includes to gc.h and icf.h.
12504 * arm.cc: Include gc.h.
12505 * gold.cc: Likewise.
12506 * i386.cc: Likewise.
12507 * powerpc.cc: Likewise.
12508 * sparc.cc: Likewise.
12509 * x86_64.cc: Likewise.
12510 * gc.h: Include icf.h.
12511
1c7814ed
ILT
125122009-10-11 Ian Lance Taylor <iant@google.com>
12513
12514 * plugin.cc: Include "gold.h" before other header files.
12515
ae3b5189
CD
125162009-10-10 Chris Demetriou <cgd@google.com>
12517
12518 * options.h (Input_file_argument::Input_file_type): New enum.
12519 (Input_file_argument::is_lib_): Replace with...
12520 (Input_file_argument::type_): New member.
12521 (Input_file_argument::Input_file_argument): Take Input_file_type
12522 'type' rather than boolean 'is_lib' as second argument.
12523 (Input_file_argument::is_lib): Use type_.
12524 (Input_file_argument::is_searched_file): New function.
12525 (Input_file_argument::may_need_search): Handle is_searched_file.
12526 * options.cc (General_options::parse_library): Support -l:filename.
12527 (General_options::parse_just_symbols): Update for Input_file_argument
12528 changes.
12529 (Command_line::process): Likewise.
12530 * archive.cc (Archive::get_file_and_offset): Likewise.
12531 * plugin.cc (Plugin_manager::release_input_file): Likewise.
12532 * script.cc (read_script_file, script_add_file): Likewise.
12533 * fileread.cc (Input_file::Input_file): Likewise.
12534 (Input_file::will_search_for): Handle is_searched_file.
12535 (Input_file::open): Likewise.
12536 * readsyms.cc (Read_symbols::get_name): Likewise.
12537 * testsuite/Makefile.am (searched_file_test): New test.
12538 * testsuite/Makefile.in: Regenerate.
12539 * testsuite/searched_file_test.cc: New file.
12540 * testsuite/searched_file_test_lib.cc: New file.
12541
f3048a1d
ILT
125422009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12543 Ian Lance Taylor <iant@google.com>
12544
12545 * descriptor.cc: Include <cstdio> and "binary-io.h".
12546 (Descriptors::open): Open the files in binary mode always.
12547 * script.cc (Lex::get_token): Treat \r as whitespace.
12548
d4780e57
ILT
125492009-10-09 Ian Lance Taylor <iant@google.com>
12550
12551 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
12552
d9a893b8
ILT
125532009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12554 Ian Lance Taylor <iant@google.com>
12555
12556 * configure.ac: Check for readv function also.
12557 * fileread.cc (readv): Define if not HAVE_READV.
12558 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
12559 does not exist.
12560 * config.in: Regenerate.
12561 * configure: Regenerate.
12562
c0a62865
DK
125632009-10-09 Doug Kwan <dougkwan@google.com>
12564
12565 * layout.cc (Layout::make_output_section): Call target hook to make
12566 ordinary output section.
12567 (Layout::finalize): Adjust parameter list of call the
12568 Target::may_relax().
12569 * layout.h (class Layout::section_list): New method.
12570 * merge.h (Output_merge_base::entsize): Change visibility to public.
12571 (Output_merge_base::is_string, Output_merge_base::do_is_string):
12572 New methods.
12573 (Output_merge_string::do_is_string): New method.
12574 * object.cc (Sized_relobj::do_setup): renamed from
12575 Sized_relobj::set_up.
12576 * object.h (Sized_relobj::adjust_shndx,
12577 Sized_relobj::initializ_input_to_output_maps,
12578 Sized_relobj::free_input_to_output_maps): Change visibilities to
12579 protected.
12580 (Sized_relobj::setup): Virtualize.
12581 (Sized_relobj::do_setup): New method declaration.
12582 (Sized_relobj::invalidate_section_offset,
12583 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
12584 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
12585 * options.cc (parse_int): New function.
12586 * options.h (parse_int): New declaration.
12587 (DEFINE_int): New macro.
12588 (stub_group_size): New option.
12589 * output.cc (Output_section::Output_section): Initialize memebers
12590 merge_section_map_, merge_section_by_properties_map_,
12591 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
12592 (Output_section::add_input_section): Handled deferred code-fill
12593 generation and remove an old comment.
12594 (Output_section::add_relaxed_input_section): New method definition.
12595 (Output_section::add_merge_input_section): Use merge section by
12596 properties map to speed to search. Update merge section maps
12597 as appropriate.
12598 (Output_section::build_relaxation_map): New method definition.
12599 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
12600 Same.
12601 (Output_section::relax_input_section): Renamed to
12602 Output_section::convert_input_sections_to_relaxed_sections and change
12603 interface to take a vector of pointers to relaxed sections.
12604 (Output_section::find_merge_section,
12605 Output_section::find_relaxed_input_section): New method definitions.
12606 (Output_section::is_input_address_mapped,
12607 Output_section::output_offset, Output_section::output_address):
12608 Use output section data maps to speed up searching.
12609 (Output_section::find_starting_output_address): Add comments.
12610 (Output_section::do_write,
12611 Output_section::write_to_postprocessing_buffer): Do code-fill
12612 generation as appropriate.
12613 (Output_section::get_input_sections): Invalidate relaxed input section
12614 map.
12615 (Output_section::restore_states): Adjust type of checkpoint .
12616 Invalidate relaxed input section map.
12617 * output.h (Output_merge_base): New class declaration.
12618 (Input_section_specifier): New class defintion.
12619 (class Output_relaxed_input_section) Change base class to
12620 Output_section_data_build.
12621 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
12622 base class initializer.
12623 (Output_section::add_relaxed_input_section): New method declaration.
12624 (Output_section::Input_section): Change visibility to protected.
2e702c99 12625 (Output_section::Input_section::relobj,
c0a62865
DK
12626 Output_section::Input_section::shndx): Handle relaxed input sections.
12627 Output_section::input_sections) Change visibility to protected. Also
12628 define overload to return a non-const pointer.
12629 (Output_section::Merge_section_properties): New class defintion.
12630 (Output_section::Merge_section_by_properties_map,
12631 Output_section::Output_section_data_by_input_section_map,
12632 Output_section::Relaxation_map): New types.
12633 (Output_section::relax_input_section): Rename method to
12634 Output_section::convert_input_sections_to_relaxed_sections and change
12635 interface to take a vector of relaxed section pointers.
12636 (Output_section::find_merge_section,
12637 Output_section::find_relaxed_input_section,
12638 Output_section::build_relaxation_map,
12639 Output_section::convert_input_sections_in_list_to_relaxed_sections):
12640 New method declarations.
12641 (Output_section::merge_section_map_
12642 Output_section::merge_section_by_properties_map_,
12643 Output_section::relaxed_input_section_map_,
12644 Output_section::is_relaxed_input_section_map_valid_,
12645 Output_section::generate_code_fills_at_write_): New data members.
12646 * script-sections.cc
12647 (Output_section_element_input::set_section_addresses): Call
12648 current_data_size and addralign methods of relaxed input sections.
12649 (Orphan_output_section::set_section_addresses): Call current_data_size
12650 and addralign methods of relaxed input sections.
12651 * symtab.cc (Symbol_table::compute_final_value): Extract template
12652 from the body of Symbol_table::sized_finalize_symbol.
12653 (Symbol_table::sized_finalized_symbol): Call
12654 Symbol_table::compute_final_value.
12655 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
12656 (Symbol_table::compute_final_value): New templated method declaration.
12657 * target.cc (Target::do_make_output_section): New method defintion.
12658 * target.h (Target::make_output_section): New method declaration.
12659 (Target::relax): Add more parameters for input objects, symbol table
12660 and layout. Adjust call to do_relax.
12661 (Target::do_make_output_section): New method declaration.
12662 (Target::do_relax): Add parameters for input objects, symbol table
12663 and layout.
12664
d446d6c4
ILT
126652009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12666
12667 * pread.c: Include stdio.h.
12668
bc06c745
ILT
126692009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12670
12671 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
12672 defined.
12673
75aea3d0
ILT
126742009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12675
12676 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
12677 Change read_shndx type to unsigned int.
12678 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12679 int.
12680 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12681 * dwarf_reader.h (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 * layout.cc (Layout::create_symtab_sections): Cast the result of
12687 local_symcount * symsize to off_t in the gold_assert.
12688
be8fcb75
ILT
126892009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12690
12691 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
12692 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
12693 R_ARM_BASE_ABS.
12694 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
12695 (Arm_relocate_functions::thm_abs5): New function.
12696 (Arm_relocate_functions::abs12): New function.
12697 (Arm_relocate_functions::abs16): New function.
12698 (Arm_relocate_functions::base_abs): New function.
12699 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
12700 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
12701 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
12702 R_ARM_BASE_ABS.
12703 (Scan::global): Likewise.
12704 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
12705 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
12706 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
12707 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
12708 R_ARM_BASE_ABS.
12709
c2a122b6
ILT
127102009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12711
12712 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
12713 (Arm_relocate_functions::movt_prel): New function.
12714 (Arm_relocate_functions::thm_movw_prel_nc): New function.
12715 (Arm_relocate_functions::thm_movt_prel): New function.
12716 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
12717 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
12718 (Scan::global, Relocate::relocate): Likewise.
12719 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12720
c4aa1e2d
ILT
127212009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12722
12723 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
12724 Incremental_checker.
12725 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
12726 unsigned int.
12727 (class Incremental_inputs_header): New class.
12728 (Incremental_inputs_header_writer): Edit comment.
12729 (Incremental_inputs_entry): New class.
12730 (Incremental_inputs_entry_writer): Edit comment.
12731 (Sized_incremental_binary::do_find_incremental_inputs_section):
12732 Add *strtab_shndx parameter, fill it.
12733 (Sized_incremental_binary::do_check_inputs): New method.
12734 (Incremental_checker::can_incrementally_link_output_file): Use
12735 Sized_incremental_binary::check_inputs.
12736 (Incremental_inputs::report_command_line): Save command line in
12737 command_line_.
12738 * incremental.h:
12739 (Incremental_binary::find_incremental_inputs_section): New
12740 method.
12741 (Incremental_binary::do_find_incremental_inputs_section): Add
12742 strtab_shndx parameter.
12743 (Incremental_binary::do_check_inputs): New pure virtual method.
12744 (Sized_incremental_binary::do_check_inputs): Declare.
12745 (Incremental_checker::Incremental_checker): Add incremental_inputs
12746 parameter, use it to initialize incremental_inputs_.
12747 (Incremental_checker::incremental_inputs_): New field.
12748 (Incremental_checker::command_line): New method.
12749 (Incremental_checker::inputs): New method.
12750 (Incremental_checker::command_line_): New field.
12751
c549a694
ILT
127522009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12753
12754 * incremental.cc: Include <cstdarg> and "target-select.h".
12755 (vexplain_no_incremental): New function.
12756 (explain_no_incremental): New function.
12757 (Incremental_binary::error): New method.
12758 (Sized_incremental_binary::do_find_incremental_inputs_section): New
12759 method.
12760 (make_sized_incremental_binary): New function.
12761 (open_incremental_binary): New function.
12762 (can_incrementally_link_file): Add checks if output is ELF and has
12763 inputs section.
12764 * incremental.h: Include "elfcpp_file.h" and "output.h".
12765 (Incremental_binary): New class.
12766 (Sized_incremental_binary): New class.
12767 (open_incremental_binary): Declare.
12768 * object.cc (is_elf_object): Use
12769 elfcpp::Elf_recognizer::is_elf_file.
12770 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
12771 * output.h (Output_file::filesize): New method.
12772
fd3c5f0b
ILT
127732009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12774
12775 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
12776 New function.
12777 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
12778 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
12779 function.
12780 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
12781 function.
12782 (Arm_relocate_functions::movw_abs_nc): New function.
12783 (Arm_relocate_functions::movt_abs): New function.
12784 (Arm_relocate_functions::thm_movw_abs_nc): New function.
12785 (Arm_relocate_functions::thm_movt_abs): New function.
12786 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
12787 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
12788 (Scan::global): Likewise.
12789 (Relocate::relocate): Likewise.
12790 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12791
7f5309a5
ILT
127922009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12793
12794 * arm.cc (Arm_relocate_functions::got_prel) New function.
12795 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
12796 (Relocate::relocate): Likewise.
12797 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12798
364c7fa5
ILT
127992009-10-06 Ian Lance Taylor <iant@google.com>
12800
12801 * options.h (class General_options): Define
12802 split_stack_adjust_size parameter.
12803 * object.h (class Object): Add uses_split_stack_ and
12804 has_no_split_stack_ fields. Add uses_split_stack and
12805 has_no_split_stack accessor functions. Declare
12806 handle_split_stack_section.
12807 (class Reloc_symbol_changes): Define.
12808 (class Sized_relobj): Define Function_offsets. Declare
12809 split_stack_adjust, split_stack_adjust_reltype, and
12810 find_functions.
12811 * object.cc (Object::handle_split_stack_section): New function.
12812 (Sized_relobj::do_layout): Call handle_split_stack_section.
12813 * dynobj.cc (Sized_dynobj::do_layout): Call
12814 handle_split_stack_section.
12815 * reloc.cc (Sized_relobj::relocate_sections): Call
12816 split_stack_adjust for executable sections in split_stack
12817 objects. Pass reloc_map to relocate_section.
12818 (Sized_relobj::split_stack_adjust): New function.
12819 (Sized_relobj::split_stack_adjust_reltype): New function.
12820 (Sized_relobj::find_functions): New function.
12821 * target-reloc.h: Include "object.h".
12822 (relocate_section): Add reloc_symbol_changes parameter. Change
12823 all callers.
12824 * target.h (class Target): Add calls_non_split method. Declare
12825 do_calls_non_split virtual method. Declare match_view and
12826 set_view_to_nop.
12827 * target.cc: Include "elfcpp.h".
12828 (Target::do_calls_non_split): New function.
12829 (Target::match_view): New function.
12830 (Target::set_view_to_nop): New function.
12831 * gold.cc (queue_middle_tasks): Give an error if mixing
12832 split-stack and non-split-stack objects with -r.
12833 * i386.cc (Target_i386::relocate_section): Add
12834 reloc_symbol_changes parameter.
12835 (Target_i386::do_calls_non_split): New function.
12836 * x86_64.cc (Target_x86_64::relocate_section): Add
12837 reloc_symbol_changes parameter.
12838 (Target_x86_64::do_calls_non_split): New function.
12839 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
12840 parameter.
12841 * powerpc.cc (Target_powerpc::relocate_section): Add
12842 reloc_symbol_changes parameter.
12843 * sparc.cc (Target_sparc::relocate_section): Add
12844 reloc_symbol_changes parameter.
12845 * configure.ac: Call AM_CONDITIONAL for the default target.
12846 * configure: Rebuild.
12847 * testsuite/Makefile.am (TEST_AS): New variable.
12848 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
12849 (check_DATA): Add split_i386 and split_x86_64 files.
12850 (SPLIT_DEFSYMS): Define.
12851 (split_i386_[1234n].o): New targets.
12852 (split_i386_[124]): New targets.
12853 (split_i386_[1234r].stdout): New targets.
12854 (split_x86_64_[1234n].o): New targets.
12855 (split_x86_64_[124]): New targets.
12856 (split_x86_64_[1234r].stdout): New targets.
12857 (MOSTLYCLEANFILES): Add new executables.
12858 * testsuite/split_i386.sh: New file.
12859 * testsuite/split_x86_64.sh: New file.
12860 * testsuite/split_i386_1.s: New file.
12861 * testsuite/split_i386_2.s: New file.
12862 * testsuite/split_i386_3.s: New file.
12863 * testsuite/split_i386_4.s: New file.
12864 * testsuite/split_i386_n.s: New file.
12865 * testsuite/split_x86_64_1.s: New file.
12866 * testsuite/split_x86_64_2.s: New file.
12867 * testsuite/split_x86_64_3.s: New file.
12868 * testsuite/split_x86_64_4.s: New file.
12869 * testsuite/split_x86_64_n.s: New file.
12870 * testsuite/testfile.cc (Target_test): Update relocation_section
12871 function.
12872 * testsuite/Makefile.in: Rebuild.
12873
e8a9fcda
ILT
128742009-10-06 Ian Lance Taylor <iant@google.com>
12875
12876 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
12877 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
12878 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
12879 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
12880 the address on ldo_addrs_.
12881 (Target_i386::Relocate::fix_up_ldo): New function.
12882
e99daf92
ILT
128832009-10-06 Rafael Espindola <espindola@google.com>
12884
12885 * plugin.cc (add_input_library): New.
12886 (Plugin::load): Add add_input_library to tv.
12887 (Plugin_manager::add_input_file): Add the is_lib argument.
12888 (add_input_file): Update call to Plugin_manager::add_input_file.
12889 (add_input_library): New.
12890 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
12891
966d4097
DK
128922009-09-30 Doug Kwan <dougkwan@google.com>
12893
12894 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
12895 symbol and call Symbol::may_need_copy_reloc to determine if
12896 a copy reloc is needed.
12897 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
12898 nocopyreloc is given in command line.
12899 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
12900 given in command line.
12901 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
12902 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
12903 of the removed Target_i386::may_need_copy_reloc.
12904 * options.h (copyreloc): New option with default value false.
12905 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12906 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
12907 instead of the removed Target_powerpc::may_need_copy_reloc.
12908 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12909 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
12910 instead of the removed Target_sparc::may_need_copy_reloc.
12911 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
12912 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
12913 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
12914 instead of the removed Target_x86_64::may_need_copy_reloc.
12915
029ba973
ILT
129162009-09-30 Ian Lance Taylor <iant@google.com>
12917
12918 * object.h (class Object): Remove target_ field, and target,
12919 sized_target, and set_target methods.
12920 (Object::sized_target): Remove.
12921 (class Sized_relobj): Update declarations. Remove sized_target.
12922 * object.cc (Sized_relobj::setup): Remove target parameter.
12923 Change all callers.
12924 (Input_objects::add_object): Don't do anything with the target.
12925 (make_elf_sized_object): Add punconfigured parameter. Change all
12926 callers. Set or test parameter target.
12927 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
12928 Change all callers.
12929 * parameters.cc (Parameters::set_target): Change parameter type to
12930 be non-const.
12931 (Parameters::default_target): Remove.
12932 (set_parameters_target): Change parameter type to be non-const.
12933 (parameters_force_valid_target): New function.
12934 (parameters_clear_target): New function.
12935 * parameters.h (class Parameters): Update declarations. Remove
12936 default_target method. Add sized_target and clear_target
12937 methods. Change target_ to be non-const.
12938 (set_parameters_target): Update declaration.
12939 (parameters_force_valid_target): Declare.
12940 (parameters_clear_target): Declare.
12941 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
12942 as NULL if we aren't searching.
12943 (Add_symbols::run): Don't check for compatible target.
12944 * fileread.cc (Input_file::open_binary): Call
12945 parameters_force_valid_target.
12946 * gold.cc (queue_middle_tasks): Likewise.
12947 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
12948 set_target on object.
12949 * dynobj.h (class Sized_dynobj): Update declarations.
12950 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
12951 make_elf_object returns NULL.
12952 (Archive::include_member): Don't check whether object target is
12953 compatible.
12954 * output.cc (Output_section::add_input_section): Get target from
12955 parameters.
12956 (Output_section::relax_input_section): Likewise.
12957 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
12958 parameters.
12959 (Sized_relobj::do_scan_relocs): Likewise.
12960 (Sized_relobj::relocate_sections): Likewise.
12961 * resolve.cc (Symbol_table::resolve): Likewise.
12962 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
12963 parameter. Change all callers.
12964 (Symbol_table::add_from_object): Get target from parameters.
12965 (Symbol_table::add_from_relobj): Don't check object target.
12966 (Symbol_table::add_from_dynobj): Likewise.
12967 (Symbol_table::define_special_symbol): Get target from
12968 parameters.
12969 * symtab.h (class Symbol_table): Update declaration.
12970 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
12971 parameter. Change all callers. Clear parameter target.
12972 (Binary_test): Test target here.
12973 * testsuite/object_unittest.cc (gold_testsuite): Remove
12974 target_test_pointer parameter. Change all callers.
12975 (Object_test): Test target here.
12976
a6a22b83
ILT
129772009-09-26 Ian Lance Taylor <iant@google.com>
12978
12979 * testsuite/initpri1.c: Don't try to use constructor priorities if
12980 compiling with gcc before 4.3.
12981
6a8f49fe
ILT
129822009-09-22 Mikolaj Zalewski <mikolajz@google.com>
12983
12984 * testsuite/retain_symbols_file_test.sh (check_present): Change
12985 output file name to retain_symbols_file_test.stdout.
12986 (check_absent): Likewise.
12987
8c604651
CS
129882009-09-18 Craig Silverstein <csilvers@google.com>
12989
12990 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
12991 * options.cc: Include <cerrno> and <fstream>.
12992 (General_options::finalize): Parse -retain-symbols-file tag.
12993 * options.h: New flag.
12994 (General_options): New method should_retain_symbol, new
12995 variable symbols_to_retain.
12996 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
12997 should_retain_symbol map.
12998 * testsuite/Makefile.am (retain_symbols_file_test): New test.
12999 * testsuite/Makefile.in: Regenerate.
13000 * testsuite/retain_symbols_file_test.sh: New file.
13001
ca58b19f
NC
130022009-09-18 Nick Clifton <nickc@redhat.com>
13003
13004 * po/es.po: Updated Spanish translation.
13005
20e6d0d6
DK
130062009-09-17 Doug Kwan <dougkwan@google.com>
13007
13008 * debug.h (DEBUG_RELAXATION): New constant.
13009 (DEBUG_ALL): Add DEBUG_RELAXATION.
13010 (debug_string_to_enum): Add relaxation debug option.
13011 * layout.cc
13012 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
13013 Layout::Relaxation_debug_check::read_sections,
13014 Layout::Relaxation_debug_check::read_sections): New method definitions.
13015 (Layout::Layout): Initialize data members
13016 record_output_section_data_from_scrips_,
13017 script_output_section_data_list_ and relaxation_debug_check_.
13018 (Layout::save_segments, Layout::restore_segments,
13019 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13020 Layout::relaxation_loop_body): New method definitions.
13021 (Layout::finalize): Support relaxation. Move section layout code to
13022 Layout::relaxation_loop_body.
13023 (Layout::set_asection_address_from_script): Move code for orphan
13024 section placement out.
13025 (Layout::place_orphan_sections_in_script): New method definition.
13026 * layout.h (Output_segment_headers, Output_file_header):
13027 New forward class declarations.
13028 (Layout::~Layout): Define.
13029 (Layout::new_output_section_data_from_script): New method definition.
13030 (Layout::place_orphan_sections_in_script): New method declaration.
13031 (Layout::Segment_states): New type declaration.
13032 (Layout::save_segments, Layout::restore_segments,
13033 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13034 Layout::relaxation_loop_body): New method declarations.
13035 (Layout::Output_section_data_list): New type declaration.
13036 (Layout::Relaxation_debug_check): New class definition.
13037 (Layout::record_output_section_data_from_script_,
13038 Layout::script_output_section_data_list_, Layout::segment_states_,
13039 Layout::relaxation_debug_check_): New data members.
13040 * output.cc: (Output_section_headers::do_size): New method definition.
13041 (Output_section_headers::Output_section_headers): Move size
13042 computation to Output_section_headers::do_size.
13043 (Output_segment_headers::do_size): New method definition.
e1df38aa 13044 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
13045 Output_file_header::do_size and call it.
13046 (Output_file_header::do_size): New method definition.
13047 (Output_data_group::Output_data_group): Adjust call to
13048 Output_section_data.
13049 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
13050 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 13051 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
13052 RELAXED_INPUT_SECTION_CODE.
13053 (Output_section::Output_section): Initialize data member checkpoint_.
13054 (Output_section::~Output_section): Delete checkpoint object pointed
13055 by checkpoint_.
13056 (Output_section::add_input_section): Always add an Input_section if
13057 relaxing.
13058 (Output_section::add_merge_input_section): Add assert.
13059 (Output_section::relax_input_section): New method definition.
13060 (Output_section::set_final_data_size): Set load address to zero for
13061 an unallocated section.
13062 (Output_section::do_address_and_file_offset_have_reset_values):
13063 New method definition.
13064 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
13065 Handle relaxed input section.
13066 (Output_section::sort_attached_input_sections): Checkpoint input
13067 section list lazily.
13068 (Output_section::get_input_sections): Change type of input_sections to
13069 list of Simple_input_section pointers. Checkpoint input section list
13070 lazily. Also handle relaxed input sections.
13071 (Output_section::add_input_section_for_script): Take a reference to
13072 a Simple_input_section object instead of Relobj pointer and section
13073 index as parameter. Handle relaxed input sections.
13074 (Output_section::save_states, Output_section::restore_states): New
13075 method definitions.
13076 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
13077 (Output_data::is_data_size_fixed): New method definition.
13078 (Output_data::reset_addresss_and_file_offset): Do not reset data size
13079 if it is fixed.
13080 (Output_data::address_and_file_offset_have_reset_values): New method
13081 definition.
13082 (Output_data::do_address_and_file_offset_have_reset_values): New method
13083 definition.
13084 (Output_data::set_data_size): Check that data size is not fixed.
13085 (Output_data::fix_data_size): New method definition.
13086 (Output_data::is_data_size_fixed_): New data member.
13087 (Output_section_headers::set_final_data_size): New method definition.
13088 (Output_section_headers::do_size): New method declaration.
13089 (Output_segment_headers::set_final_data_size): New method definition.
13090 (Output_segment_headers::do_size): New method declaration.
13091 (Output_file_header::set_final_data_size)::New method definition.
13092 (Output_file_header::do_size)::New method declaration.
13093 (Output_section_data::Output_section_data): Add new parameter
13094 is_data_size_fixed and use it to fix data size.
13095 (Output_data_const::Output_data_const): Adjust call to base class
13096 constructor and fix data size.
13097 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
13098 base class constructor and fix data size.
13099 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
13100 base class constructor and fix data size.
13101 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
13102 class constructor and fix data size.
13103 (Output_data_group::set_final_data_size): New method definition.
13104 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
13105 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
13106 class constructor and fix data size.
13107 (Output_relaxed_input_section): New class definition.
13108 (Output_section::Simple_input_section): New class definition.
13109 (Output_section::get_input_sections): Adjust parameter list.
13110 (Output_section::add_input_section_for_script): Same.
13111 (Output_section::save_states, Output_section::restore_states,
13112 Output_section::do_address_and_file_offset_have_reset_values,
13113 (Output_section::Input_section::Input_section): Handle
13114 RELAXED_INPUT_SECTION_CODE. Add new overload for
13115 Output_relaxed_input_section.
13116 (Output_section::Input_section::is_input_section,
13117 Output_section::Input_section::set_output_section): Handle relaxed
13118 input section.
13119 (Output_section::Input_section::is_relaxed_input_section,
13120 Output_section::Input_section::output_section_data,
13121 Output_section::Input_section::relaxed_input_section): New method
13122 definitions.
13123 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
13124 value.
13125 (Output_section::Input_section::u1_): Update comments.
13126 (Output_section::Input_section::u2_): Add new union member poris.
13127 (Output_section::Checkpoint_output_section): New classs definition.
13128 (Output_section::relax_input_section): New method declaration.
13129 (Output_section::checkpoint_): New data member.
13130 (Output_segment): Update comments.
13131 (Output_segment::Output_segment): Un-privatize copy constructor.
13132 (Output_segment::operator=): Un-privatize.
13133 * script-sections.cc (Output_section_element::Input_section_list):
13134 Change element type to Output_section::Simple_input_section.
13135 (Output_section_element_dot_assignment::set_section_addresses):
13136 Register output section data for relaxation clean up.
13137 (Output_data_exression::Output_data_expression): Adjust call to base
13138 constructor to fix data size.
13139 (Output_section_element_data::set_section_addresses): Register
13140 Output_data_expression object for relaxation clean up.
13141 (struct Input_section_info): Replace Relobj pointer and section index
13142 pair with Output_section::Simple_input_section and Convert struct to a
13143 class.
13144 (Input_section_sorter::operator()): Adjust access to
e1df38aa 13145 Input_section_info data member to use accessors.
20e6d0d6
DK
13146 (Output_section_element_input::set_section_addresses): Use layout
13147 parameter. Adjust code to use Output_section::Simple_input_section
13148 and Input_secction_info classes. Register filler for relaxation
13149 clean up.
13150 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
13151 and section index pair with Output_section::Simple_input_section
13152 class. Adjust code accordingly.
13153 (Phdrs_element::release_segment): New method definition.
13154 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
13155 segment list.
13156 (Script_sections::release_segments): New method definition.
13157 * gold/script-sections.h (Script_sections::release_segments): New
13158 method declaration.
13159 * gold/target.h (Target::may_relax, Target::relax,
13160 Target::do_may_relax, Target::do_relax): New method definitions.
13161
5e445df6
ILT
131622009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13163
13164 * arm.cc (has_signed_unsigned_overflow): New function.
13165 (Arm_relocate_functions::abs8): New function.
13166 (Target_arm::Scan::local): Handle R_ARM_ABS8.
13167 (Target_arm::Scan::global): Likewise.
13168 (Target_arm::relocate::relocate): Likewise.
13169 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
13170 Likewise.
13171
8c604651 131722009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
13173
13174 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
13175 * testsuite/Makefile.in: Regenerate.
13176
1e9cc1c2
NC
131772009-09-11 Nick Clifton <nickc@redhat.com>
13178
13179 * po/gold.pot: Updated by the Translation project.
13180
6a89f575
CC
131812009-09-08 Cary Coutant <ccoutant@google.com>
13182
13183 * output.cc (Output_file::open): Add execute permission to empty file.
13184 * testsuite/Makefile.am (permission_test): New test.
13185 * testsuite/Makefile.in: Regenerate.
13186
fdcac5af
ILT
131872009-09-02 Ian Lance Taylor <iant@google.com>
13188
13189 * output.cc (Output_file::resize): Call map_no_anonymous rather
13190 than map.
13191
44453f85
ILT
131922009-09-01 Mikolaj Zalewski <mikolajz@google.com>
13193
13194 * gold.cc: Include "incremental.h".
13195 (queue_initial_tasks): Call Incremental_checker methods.
13196 * incremental.cc: Include "output.h".
13197 (Incremental_checker::can_incrementally_link_output_file): New
13198 method.
13199 * incremental.h (Incremental_checker): New class.
13200
13201 * output.cc (Output_file::open_for_modification): New method.
13202 (Output_file::map_anonymous): Changed return type to bool. Record
13203 map in base_ field.
13204 (Output_file::map_no_anonymous): New method, broken out of map.
13205 (Output_file::map): Use map_no_anonymous and map_anonymous.
13206 * output.h (class Output_file): Update declarations.
13207
293c1386
CC
132082009-08-24 Cary Coutant <ccoutant@google.com>
13209
13210 * options.h (Command_line::Pre_options): New class.
13211 (Command_line::pre_options): New member.
13212 * options.cc (gold::options::ready_to_register): New variable.
13213 (One_option::register_option): Do nothing if not registering options.
13214 Assert if same short option registered twice.
13215 (General_options::General_options): Turn off option registration when
13216 done constructing.
13217 (Command_line::Pre_options::Pre_options): New constructor.
13218
f773f3d2
CC
132192009-08-24 Cary Coutant <ccoutant@google.com>
13220
06a73cfe
CC
13221 * options.h (General_options::no_keep_memory): Remove incorrect
13222 short option.
f773f3d2 13223
a15af8e2
RW
132242009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13225
13226 * Makefile.am (am__skiplex, am__skipyacc): New.
13227 * Makefile.in: Regenerate.
13228
c462b41b
RW
132292009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13230
14ec8efd
RW
13231 * Makefile.am (AM_CPPFLAGS): Renamed from ...
13232 (INCLUDES): ... this.
13233 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
13234 (AM_CPPFLAGS): Renamed from ...
13235 (INCLUDE): ... this.
13236 * Makefile.in, testsuite/Makefile.in: Regenerate.
13237
81ecdfbb
RW
13238 * Makefile.in: Regenerate.
13239 * aclocal.m4: Likewise.
13240 * config.in: Likewise.
13241 * configure: Likewise.
13242 * testsuite/Makefile.in: Likewise.
13243
c462b41b
RW
13244 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13245 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13246 * Makefile.in: Regenerate.
13247 * testsuite/Makefile.in: Regenerate.
13248
2da73f13
CC
132492009-08-19 Cary Coutant <ccoutant@google.com>
13250
13251 * resolve.cc (Symbol_table::resolve): Don't complain about defined
13252 symbols in shared libraries overridden by hidden or internal symbols
13253 in the main program.
13254
2db70501
CD
132552009-08-19 Chris Demetriou <cgd@google.com>
13256
13257 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
13258 checking source file names in error messages.
13259
f733487b
DK
132602009-08-18 Doug Kwan <dougkwan@google.com>
13261
13262 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
13263 an elcpp::Ehdr as parameter. Adjust call to set_target.
13264 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
13265 an elfcpp::Ehdr as parameter.
13266 * object.cc (Object::set_target): Remove the version that looks up
13267 a target and sets it.
13268 (Sized_relobj::setup): Take a Target object instead of
13269 an elfcpp::Ehdr as parameter. Adjust call to set_target.
13270 (make_elf_sized_object): Find target and ask target to
13271 make an ELF object.
13272 * object.h: (Object::set_target): Remove the version that looks up
13273 a target and sets it.
13274 (Sized_relobj::setup): Take a Target object instead of
13275 an elfcpp:Ehdr as parameter.
13276 * target.cc: Include dynobj.h.
13277 (Target::do_make_elf_object_implementation): New.
2e702c99 13278 (Target::do_make_elf_object): New.
f733487b
DK
13279 * target.h (Target::make_elf_object): New template declaration.
13280 (Target::do_make_elf_object): New method declarations.
13281 (Target::do_make_elf_object_implementation): New template declaration.
13282
cc70f101
ILT
132832009-08-14 Ian Lance Taylor <iant@google.com>
13284
13285 * gold.h (FUNCTION_NAME): Define.
13286 (gold_unreachable): Use FUNCTION_NAME.
13287
ef5e0cb1
ST
132882009-08-12 Sriraman Tallam <tmsriram@google.com>
13289
13290 * icf.cc (Icf::find_identical_sections): Issue a warning when a
13291 symbol in the --keep-unique list is not found.
13292
48c187ce
ST
132932009-08-12 Sriraman Tallam <tmsriram@google.com>
13294
13295 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
13296 been maked as --keep-unique.
13297 (Icf::unfold_section): New function.
13298 * icf.h (Icf::unfold_section): New function.
13299 * options.h (General_options::keep_unique): New option.
13300 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
13301 * testsuite/Makefile.in: Regenerate.
13302 * testsuite/icf_keep_unique_test.sh: New file.
13303 * testsuite/icf_keep_unique_test.cc: New file.
13304
645afe0c
CC
133052009-08-12 Cary Coutant <ccoutant@google.com>
13306
13307 PR 10471
13308 * resolve.cc (Symbol_table::resolve): Check for references from
13309 dynamic objects to hidden and internal symbols.
13310 * testsuite/Makefile.am (hidden_test.sh): New test.
13311 * testsuite/Makefile.in: Regenerate.
13312 * testsuite/hidden_test.sh: New script.
13313 * testsuite/hidden_test_1.c: New test source.
13314 * testsuite/hidden_test_main.c: New test source.
13315
11af873f
DK
133162009-08-11 Doug Kwan <dougkwan@google.com>
13317
13318 * arm.cc: Update comments.
13319 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
13320 segment to locate the .ARM.exidx section if present.
13321
b9f7d72d
DK
133222009-08-09 Doug Kwan <dougkwan@google.com>
13323
13324 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
13325 patch.
13326
ddd3c53c
ST
133272009-08-07 Sriraman Tallam <tmsriram@google.com>
13328 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
13329 compiler warnings.
13330
27721062
ST
133312009-08-06 Sriraman Tallam <tmsriram@google.com>
13332
13333 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
13334 valid tls_segment only for non-debug-section relocations.
13335 * testsuite/Makefile.am: Add gc_tls_test.
13336 * testsuite/Makefile.in: Regenerate.
13337 * testsuite/gc_tls_test.cc: New file.
13338 * testsuite/gc_tls_test.sh: New file.
13339
ef15dade 133402009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 13341
ef15dade
ST
13342 * icf.cc: New file.
13343 * icf.h: New file.
13344 * Makefile.am (CCFILES): Add icf.cc.
13345 (HFILES): Add icf.h
13346 * Makefile.in: Regenerate.
13347 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
13348 * gc.h (gc_process_relocs): Populate lists used by icf to contain
13349 section, symbol and addend information for the relocs.
13350 * gold.cc (queue_middle_tasks): Call identical code folding.
13351 * gold.h: Add defines for multimap.
13352 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
13353 to the call of finalize_local_symbols.
13354 * main.cc (main): Create object of class Icf.
13355 * object.cc (Sized_relobj::do_layout): Allow this function to be
13356 called twice during icf.
13357 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
13358 to sections marked as identical by icf.
13359 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
13360 when available.
13361 (Sized_relobj::do_section_entsize): New function.
13362 * object.h (Object::section_entsize): New function.
13363 (Object::do_section_entsize): New pure virtual function.
13364 (Relobj::finalize_local_symbols): Add new parameter.
13365 (Relobj::do_section_entsize): New function.
13366 * options.h (General_options::icf): New option.
13367 (General_options::icf_iterations): New option.
13368 (General_options::print_icf_sections): New option.
13369 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
13370 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
13371 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
13372 icf.
13373 * symtab.cc (Symbol_table::is_section_folded): New function.
13374 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
13375 to sections marked as identical by icf.
13376 * symtab.h (Symbol_table::set_icf): New function.
13377 (Symbol_table::icf): New function.
13378 (Symbol_table::is_section_folded): New function.
13379 (Symbol_table::icf_): New data member.
13380 * target-reloc.h (relocate_section): Ignore sections folded by icf.
13381 * testsuite/Makefile.am: Add commands to build icf_test.
13382 * testsuite/Makefile.in: Regenerate.
13383 * testsuite/icf_test.sh: New file.
13384 * testsuite/icf_test.cc: New file.
13385
c3b65ac4
CD
133862009-07-24 Chris Demetriou <cgd@google.com>
13387
13388 * layout.cc (is_compressible_debug_section): Fix incorrect
13389 comment about compressed section names.
13390
1caf2c51
ILT
133912009-07-20 Ian Lance Taylor <ian@airs.com>
13392
13393 PR 10419
13394 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
13395
1ef4d87f
ILT
133962009-07-16 Ian Lance Taylor <iant@google.com>
13397
13398 PR 10400
13399 * layout.h: #include <map>.
13400 (class Kept_section): Change from struct to class. Add accessors
13401 and setters. Add section size to Comdat_group mapping. Change
13402 Comdat_group to std::map. Add is_comdat_ field. Add
13403 linkonce_size field in union.
13404 (class Layout): Update declaration of find_or_add_kept_section.
13405 Don't declare find_kept_object.
13406 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
13407 parameter. Add object, shndx, is_comdat, and is_group_name
13408 parameters. Change all callers. Adjust for new Kept_section.
13409 (Layout::find_kept_object): Remove.
13410 * object.cc (Sized_relobj::include_section_group): Update use of
13411 Kept_section. Rename secnum to shndx. Only record
13412 Kept_comdat_section if sections are the same size.
13413 (Sized_relobj::include_linkonce_section): Update use of
13414 Kept_section. Only record Kept_comdat_section if sections are the
13415 same size. Set size of linkonce section.
13416 (Sized_relobj::map_to_kept_section): Update call to
13417 get_kept_comdat_section.
13418 * object.h (class Sized_relobj): Rename fields in
13419 Kept_comdat_section to drop trailing underscores; change object
13420 field to Relobj*. Change Kept_comdat_section_table to store
13421 struct rather than pointer.
13422 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
13423 Add kept_object and kept_shndx parameters. Change all callers.
13424 (Sized_relobj::get_kept_comdat_section): Change return type to
13425 bool. Add kept_object and kept_shndx parameters. Change all
13426 callers.
13427 * plugin.cc (Pluginobj::include_comdat_group): Update call to
13428 Layout::find_or_add_kept_section.
13429
37c3b7b0
ILT
134302009-07-09 Ian Lance Taylor <iant@google.com>
13431
13432 * merge.cc (Object_merge_map::initialize_input_to_output_map):
13433 Reserve space in the hash table.
13434
98fa85cb
ILT
134352009-07-06 Mikolaj Zalewski <mikolajz@google.com>
13436
13437 * fileread.cc (File_read::get_mtime): New method.
13438 * fileread.h (Timespec): New structure.
13439 (File_read::get_mtime): New method.
13440 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
13441 Renamed from timestamp_nsec.
13442 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
13443 Elf_Xword.
e1df38aa 13444 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 13445 timestamp_nsec.
e1df38aa 13446 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
13447 (Incremental_inputs::report_obejct): Save mtime; style fix.
13448 (Incremental_inputs::report_script): Save mtime; style fix.
13449 (Incremental_inputs::finalize_inputs): Style fix.
13450 (Incremental_inputs::finalize): Style fix.
13451 (Incremental_inputs::create_input_section_data): Store inputs
13452 mtime.
13453 * incremental.h (Incremental_inputs::report_script): Add mtime
13454 argument.
13455 (Incremental_inputs::Input_info::Input_info): Intialize only one
13456 union member.
13457 (Incremental_inputs::Input_info::archive): Move to nameless
13458 union.
13459 (Incremental_inputs::Input_info::obejct): Move to nameless union.
13460 (Incremental_inputs::Input_info::script): Move to nameless union.
13461 (Incremental_inputs::mtime): New field.
13462 * script.cc (read_input_script): Pass file mtime to
13463 Incremental_input.
13464 * script.h (Script_info::inputs): Style fix.
13465
c9d70757
ILT
134662009-07-01 Ian Lance Taylor <ian@airs.com>
13467
13468 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
13469 instead of 32.
13470
9c547ec3
ILT
134712009-06-24 Ian Lance Taylor <iant@google.com>
13472
13473 PR 10156
13474 * layout.cc (Layout::choose_output_section): If we find an
13475 existing section, update the flags.
13476 (Layout::create_notes): New function, broken out of
13477 Layout::finalize.
13478 (Layout::finalize): Don't create note sections.
13479 (Layout::create_note): Don't crash if linker script discards
13480 section.
13481 (Layout::create_gold_note): Likewise.
13482 (Layout::create_build_id): Likewise. Don't set
13483 after_input_sections on the section.
13484 (Layout::create_executable_stack_info): Remove target parameter.
13485 Change caller.
13486 * layout.h (class Layout): Declare create_notes. Update
13487 declaration of create_executable_stack_info.
13488 * gold.cc (queue_middle_tasks): Call create_notes.
13489 * output.cc (Output_section::update_flags_for_input_section): Move
13490 here from output.h. If SHF_ALLOC flag is newly set, mark address
13491 invalid.
13492 * output.h (Output_data::mark_address_invalid): New function.
13493 (class Output_section): Only declare, not define,
13494 update_flags_for_input_section. Remove set_flags.
13495
55458500
ILT
134962009-06-24 Ian Lance Taylor <iant@google.com>
13497
13498 * script-sections.cc (Output_section_definition::
13499 set_section_addresses): Rename shadowing local load_address to
13500 laddr.
13501
1307d6cd
ILT
135022009-06-24 Ian Lance Taylor <iant@google.com>
13503
13504 PR 10244
13505 * reloc.cc (relocate_sections): Skip empty relocation sections.
13506
ec3f783e
ILT
135072009-06-23 Ian Lance Taylor <iant@google.com>
13508
13509 PR 10156
13510 * layout.cc (Layout::create_note): Use choose_output_section
13511 rather than make_output_section.
13512
459c9f1c
ILT
135132009-06-23 Ian Lance Taylor <iant@google.com>
13514
13515 PR 10237
13516 * options.cc (General_options::parse_V): Set printed_version_.
13517 (General_options::General_options): Initialize printed_version_.
13518 * options.h (class General_options): Add printed_version_ field.
13519 * gold.cc (queue_initial_tasks): If there are no input files,
13520 don't give a fatal error if we printed the version information.
13521 (queue_middle_tasks): If using -r with a shared object, give a
13522 fatal error rather than an ordinary error.
13523
1518dc8f
ILT
135242009-06-23 Ian Lance Taylor <iant@google.com>
13525
13526 PR 10219
13527 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
13528 (Layout::make_output_section): Set have_stabstr_section_ if we see
13529 a .stab*str section.
13530 (Layout::finalize): Call link_stabs_sections.
13531 (Layout::link_stabs_sections): New file.
13532 * layout.h (class Layout): Add have_stabstr_section_ field.
13533 Declare link_stabs_sections.
13534
3d857b98
DK
135352009-06-23 Doug Kwan <dougkwan@google.com>
13536
13537 * Makefile.am (libgold_a_LIBADD): New.
13538 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 13539 * Makefile.in: Regenerate.
3d857b98
DK
13540 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
13541 * configure: Regenerate.
13542 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
13543 * fileread.cc: Include sys/state.h
13544 * gold.h: Declare memmem and strndup if found missing.
13545 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
13546
0639a6f6
ILT
135472009-06-23 Ian Lance Taylor <iant@google.com>
13548
13549 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
13550 * configure: Rebuild.
13551
8d63875c
ILT
135522009-06-23 Ian Lance Taylor <iant@google.com>
13553
13554 PR 10147
13555 * object.cc (Object::section_contents): Don't try to get a view if
13556 the section has length zero.
13557 (Object::handle_gnu_warning_section): If the section is empty, use
13558 the name of the section as the warning.
13559
f7c8a183
ILT
135602009-06-23 Ian Lance Taylor <iant@google.com>
13561
13562 PR 10133
13563 * stringpool.h (class Stringpool_template): Add optimize_ field.
13564 (Stringpool_template::set_optimize): New function.
13565 * stringpool.cc (Stringpool_template::Stringpool_template):
13566 Initialize optimize_ field.
13567 (Stringpool_template::set_string_offsets): Test local optimize
13568 fild rather than parameter.
13569 * layout.cc (Layout::Layout): Call set_optimize on the section
13570 name stringpool.
13571
e6a307ba
ILT
135722009-06-22 Ian Lance Taylor <iant@google.com>
13573
13574 PR 10030
13575 * yyscript.y: Parse TARGET.
13576 * script.cc (script_set_target): New function.
13577 * script-c.h (script_set_target): Declare.
13578 * options.cc (General_options::string_to_object_format): Rename
13579 from string_to_object_format in anonymous namespace. Change
13580 callers.
13581 * options.h (class General_options): Declare
13582 string_to_object_format.
13583
3ee173de
ILT
135842009-06-22 Ian Lance Taylor <iant@google.com>
13585
13586 * script-sections.cc (Script_sections::create_segments): Don't put
13587 program headers in a PT_LOAD segment if -n or -N.
13588
135892009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
13590
13591 PR 10141
13592 * options.h (class General_options): Add -z lazy and -z now. Sort
13593 -z options into alphabetical order.
13594 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
13595
cd6739a1 135962009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
13597
13598 * layout.cc (Layout::make_output_section): Call
13599 Target::new_output_section.
13600 (Layout::attach_allocated_section_to_segment): Put large section
13601 sections in a separate load segment with the large segment flag
13602 set.
13603 (Layout::segment_precedes): Sort large data segments after other
13604 load segments.
13605 (align_file_offset): New static function.
13606 (Layout::set_segment_offsets): Use align_file_offset.
13607 * output.h (class Output_section): Add is_small_section_ and
13608 is_large_section_ fields.
13609 (Output_section::is_small_section): New function.
13610 (Output_section::set_is_small_section): New function.
13611 (Output_section::is_large_section): New function.
13612 (Output_section::set_is_large_section): New function.
13613 (Output_section::is_large_data_section): New function.
13614 (class Output_segment): Add is_large_data_segment_ field.
13615 (Output_segment::is_large_data_segment): New function.
13616 (Output_segment::set_is_large_data_segment): New function.
13617 * output.cc (Output_section::Output_section): Initialize new
13618 fields.
13619 (Output_segment::Output_segment): Likewise.
13620 (Output_segment::add_output_section): Add assertion that large
13621 data sections always go in large data segments. Force small data
13622 sections to the end of the list of data sections. Force small BSS
13623 sections to the start of the list of BSS sections. For large BSS
13624 sections to the end of the list of BSS sections.
13625 * symtab.h (class Symbol): Declare is_common_shndx.
13626 (Symbol::is_defined): Check Symbol::is_common_shndx.
13627 (Symbol::is_common): Likewise.
13628 (class Symbol_table): Define enum Commons_section_type. Update
13629 declarations. Add small_commons_ and large_commons_ fields.
13630 * symtab.cc (Symbol::is_common_shndx): New function.
13631 (Symbol_table::Symbol_table): Initialize new fields.
13632 (Symbol_table::add_from_object): Put small and large common
13633 symbols in the right list.
13634 (Symbol_table::sized_finalized_symbol): Check
13635 Symbol::is_common_shndx.
13636 (Symbol_table::sized_write_globals): Likewise.
13637 * common.cc (Symbol_table::do_allocate_commons): Allocate new
13638 common symbol lists. Don't call do_allocate_commons_list if the
13639 list is empty.
13640 (Symbol_table::do_allocate_commons_list): Remove is_tls
13641 parameter. Add comons_section_type parameter. Change all
13642 callers. Handle small and large common symbols.
13643 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
13644 Symbol::is_common_shndx.
13645 * resolve.cc (symbol_to_bits): Likewise.
13646 * target.h (Target::small_common_shndx): New function.
13647 (Target::small_common_section_flags): New function.
13648 (Target::large_common_shndx): New function.
13649 (Target::large_common_section_flags): New function.
13650 (Target::new_output_section): New function.
13651 (Target::Target_info): Add small_common_shndx, large_common_shndx,
13652 small_common_section_flags, and large_common_section_flags
13653 fields.
13654 (Target::do_new_output_section): New virtual function.
13655 * arm.cc (Target_arm::arm_info): Initialize new fields.
13656 * i386.cc (Target_i386::i386_info): Likewise.
13657 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
13658 Likewise.
13659 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
13660 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13661 (Target_x86_64::do_new_output_section): New function.
13662 * configure.ac: Define conditional MCMODEL_MEDIUM.
13663 * testsuite/Makefile.am (check_PROGRAMS): Add large.
13664 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
13665 (large_LDFLAGS): Define.
13666 * testsuite/large.c: New file.
13667 * testsuite/testfile.cc (Target_test::test_target_info):
13668 Initialize new fields.
13669 * configure, testsuite/Makefile.in: Rebuild.
13670
bb04269c
DK
136712009-06-05 Doug Kwan <dougkwan@google.com>
13672
13673 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 13674 * Makefile.in: Regenerate.
bb04269c
DK
13675 * i386.cc (class Target_i386): Define new virtual method to
13676 override do_is_local_label_name in parent.
13677 * object.cc (Sized_relobj::do_count_local_symbols): Discard
13678 local symbols if --discard-locals or -X is given.
13679 * options.h (class General_options): Declare new options
13680 '--discard-locals' and '-X' for discarding locals.
13681 * target.h (class Target): Define new methods is_local_label_name.
13682 Declare new virtual method do_is_local_label_name.
13683 * target.cc: New file.
13684 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
13685 (check_SCRIPTS): Add discard_locals_test.sh.
13686 (check_DATA): Add discard_local_tests.syms.
13687 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
13688 (discard_local_tests.syms, discard_locals_test.o): New make rules.
13689 * testsuite/Makefile.in: Regenerate.
13690 * testsuite/discard_locals_test.c: New file.
13691 * testsuite/discard_locals_test.sh: Same.
13692
805bb01c
DK
136932009-06-05 Doug Kwan <dougkwan@google.com>
13694
13695 * object.cc (Sized_relobj::Sized_relobj): Initialize
13696 discarded_eh_frame_shndx_ to -1U.
13697 (Sized_relobj::do_layout): Record index of a discard .eh_frame
13698 section.
13699 (Sized_relobj::do_count_local_symbols): Skip local symbols in
13700 a discarded .eh_frame section.
13701 (Sized_relobj::do_finalize_local_symbols): Ditto.
13702 * object.h (class Sized_relobj): Declare new member
13703 discarded_eh_frame_shndx_.
13704 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
13705 (local_labels_test.o, local_labels_test): New rules.
13706 * testsuite/Makefile.in: Regenerate.
13707
1dcd334d
DK
137082009-06-04 Doug Kwan <dougkwan@google.com>
13709
13710 * layout.cc (Layout::section_name_mapping): Add mapping for
13711 special ARM sections.
13712
96d49306
DK
137132009-06-03 Doug Kwan <dougkwan@google.com>
13714
13715 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
13716 (utils::has_overflow): Same.
13717
dff16297
ILT
137182009-06-03 Ian Lance Taylor <iant@google.com>
13719
13720 * layout.cc (Layout::section_name_mapping): New array, replacing
13721 Layout::linkonce_mapping.
13722 (Layout::section_name_mapping_count): New variable, replacing
13723 Layout::linkonce_mapping_count.
13724 (Layout::linkonce_output_name): Remove.
13725 (Layout::output_section_name): Rewrite.
13726 * layout.h (class Layout): Rename Linkonce_mapping to
13727 Section_name_mapping, linkonce_mapping to section_name_mapping,
13728 linkonce_mapping_count to section_name_mapping_count. Don't
13729 declare linkonce_output_name.
13730
c121c671
DK
137312009-06-03 Doug Kwan <dougkwan@google.com>
13732
13733 * gold/arm.cc (namespace utils): New.
13734 (Target_arm::reloc_is_non_pic): Define new method.
13735 (class Arm_relocate_functions): New.
13736 (Target_arm::Relocate::relocate): Handle relocation types used by
13737 Android.
13738
07800fab
ILT
137392009-06-03 Ian Lance Taylor <iant@google.com>
13740
13741 * arm.cc (Target_arm::scan::global): Use || instead of |.
13742
c121c671
DK
137432009-06-02 Doug Kwan <dougkwan@google.com>
13744
13745 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
13746 issued_non_pic_error_.
13747 (class Target_arm::Scan): Declare new method check_non_pic.
13748 Define new method symbol_needs_plt_entry.
13749 Declare new data member issued_non_pic_error_.
13750 (class Target_arm::Relocate): Declare new method
13751 should_apply_static_reloc.
13752 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
13753 (Target_arm::Scan::check_non_pic): Define new method.
13754 (Target_arm::Scan::local): Handle a small subset of reloc types used
13755 by Android.
13756 (Target_arm::Scan::local): Same.
13757 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
13758
b19b0c6d
ILT
137592009-05-31 Mikolaj Zalewski <mikolajz@google.com>
13760
13761 * incremental.cc (Incremental_inputs::report_command_line): Filter
13762 out --incremental-* options.
13763
94cdfcff
DK
137642009-05-29 Doug Kwan <dougkwan@google.com>
13765
13766 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
13767 template class.
13768 (class Target_arm): Update comment.
13769 (Target_arm::Target_arm): Initialize new data members GOT_,
13770 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
13771 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
13772 and Target_arm::rel_dyn_section.
13773 Declare new_enum Target_arm::Got_type.
13774 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
13775 and DYNBSS_.
13776 Update commments for member do_dynsym_value.
13777 (Target_arm::got_size, Target_arm::plt_section,
13778 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
13779 new methods inside class defintion.
13780 (Target_arm::got_section): Define new method.
13781 (Target_arm::rel_dyn_section): Same.
13782 (Output_data_plt_arm): New template class.
13783 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
13784 (Output_data_plt_arm:do_adjust_output_section): Define new method.
13785 (Output_data_plt_arm::add_entry): Same.
13786 (Output_data_plt_arm::first_plt_entry): Define new
13787 static data member for PLT instruction template.
13788 (Output_data_plt_arm::plt_entry): Same.
13789 (Output_data_plt_arm::do_write): Define new method.
13790 (Target_arm::make_plt_entry): Same.
13791 (Target_arm::do_finalize_sections): Same.
13792 (Target_arm::do_dynsym_value): Same.
13793
4a657b0d
DK
137942009-05-28 Doug Kwan <dougkwan@google.com>
13795
13796 * Makefile.am (TARGETSOURCES): Add arm.cc.
13797 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
13798 * Makefile.in: Regenerate.
13799 * arm.cc: New file.
13800 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
13801
e7ae8c36
DK
138022009-05-26 Doug Kwan <dougkwan@google.com>
13803
13804 * options.cc (General_options::parse_exclude_libs). Fix a comment.
13805 (General_options::check_excluded_libs): Strip off directories in
13806 archive name before matching like GNU ld does.
13807 * testsuite/Makefile.am (MOSTLYCLEANFILES,
13808 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
13809 (exclude_libs_test_LDFLAGS): Add linker option
13810 -Wl,--exclude-libs,libexclude_libs_test_3
13811 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
13812 an explicit archive without using -l.
13813 (alt/libexclude_libs_test_3.a): New make rule.
13814 * testsuite/Makefile.in: Regenerate.
13815 * testsuite/exclude_libs_test.c : Declare lib3_default().
13816 (main): Call it.
13817 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
13818 * exclude_libs_test_3.c: New file.
13819
f12e7348
NC
138202009-05-26 Nick Clifton <nickc@redhat.com>
13821
13822 * po/id.po: New Indonesian translation.
13823 * po/gold.pot: Updated template file.
13824
4daadc0d
ST
138252009-05-22 Sriraman Tallam <tmsriram@google.com>
13826
e1df38aa 13827 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
13828 gc_comdat_test files. Add -Wl,--gc-sections to build
13829 gc_comdat_test.
13830 * testsuite/Makefile.in: Regenerate.
13831 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
13832
531813ad
ST
138332009-05-21 Sriraman Tallam <tmsriram@google.com>
13834
13835 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
13836 kept comdat section was garbage collected.
13837 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
13838 * testsuite/Makefile.in: Regenerate.
13839 * testsuite/gc_comdat_test.sh: New file.
13840 * testsuite/gc_comdat_test_1.cc: New file.
13841 * testsuite/gc_comdat_test_2.cc: New file.
13842
65514900
CC
138432009-05-19 Doug Kwan <dougkwan@google.com>
13844
13845 * archive.cc (Archive::Archive): Move constructor from archive.h
13846 to here. Initialize no_export_.
13847 (Archive::get_elf_object_for_member): Set no_export flag of object.
13848 * archive.h (Archive::Archive): Move constructor body to
13849 archive.cc.
13850 (Archive::no_export): New method.
13851 (Archive::no_export_): New field.
13852 * object.h (Object::Object): Initialize no_export_ to false.
13853 (Object::no_export, Object::set_no_export): New methods.
13854 (Object::no_export_): New field.
13855 * options.cc (General_options::parse_exclude_libs): New method.
13856 (General_options::check_excluded_libs) Same.
13857 * options.h (exclude_libs): New option.
13858 (General_options::check_excluded_libs): New method declaration.
13859 (General_options::excluded_libs_): New field.
13860 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
13861 default or protected visibility if an object has no-export flag set.
13862 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
13863 (check_SCRIPTS): Add exclude_libs_test.sh.
13864 (check_DATA): Add exclude_libs_test.syms.
13865 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
13866 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
13867 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
13868 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
13869 (exclude_libs_test.syms, libexclude_libs_test_1.a,
13870 libexclude_libs_test_2.a): New rules.
13871 * testsuite/Makefile.in: Regenerate.
13872 * testsuite/exclude_libs_test.c: New file.
13873 * testsuite/exclude_libs_test.sh: Ditto.
13874 * testsuite/exclude_libs_test_1.c: Ditto.
13875 * testsuite/exclude_libs_test_2.c: Ditto.
13876
1b77ea50
ILT
138772009-05-15 Ian Lance Taylor <iant@google.com>
13878
13879 * configure.ac: Check for declarations for cases where libiberty.h
13880 checks HAVE_DECL_xxx.
13881 * configure, config.in: Rebuild.
13882
072fe7ce
ILT
138832009-05-15 Mikolaj Zalewski <mikolajz@google.com>
13884
13885 * gold.h (Incremental_argument_list): Remove (invalid) forward
13886 declaration.
13887 * incremental.cc (Incremental_inputs::report_achive): New method.
13888 (Incremental_inputs::report_object): New method.
13889 (Incremental_inputs::report_script): New method.
13890 (Incremental_inputs::finalize_inputs): New method.
13891 (Incremental_inputs::finalize): Call finalize_inputs().
13892 (Incremental_inputs::sized_create_incremental_inputs_section_data):
13893 Create inputs entries.
13894 * incremental.h (Incremental_input_type): New enum.
13895 (Incremental_inputs::Incremental_input): Initialize new fields.
13896 (Incremental_inputs::report_inputs): New method.
13897 (Incremental_inputs::report_achive): New method.
13898 (Incremental_inputs::report_object): New method.
13899 (Incremental_inputs::report_script): New method.
13900 (Incremental_inputs::finalize_inputs): New method.
13901 (Incremental_inputs::Input_info): New struct.
13902 (Incremental_inputs::Input_info_map): New typedef.
13903 (Incremental_inputs::lock_): New field.
13904 (Incremental_inputs::Inputs_): New field.
13905 (Incremental_inputs::Inputs_map): New field.
13906 * main.cc (main): Call Incremental_input::report_inputs.
13907 * options.h (Input_argument_list): Typedef moved from
13908 Input_arguments.
13909 (Input_file_group::Files): Remove, use ::Input_argument_list.
13910 (Input_file_group::Input_argument_list): Remove, use
13911 ::Input_argument_list.
13912 * plugin.cc (Plugin_manager::add_input_file): Add error in
13913 incremental build.
13914 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
13915 functions.
13916 * script.cc (read_input_script): Call
13917 Incremental_input::report_script.
13918 * script.h (Script_info): New class.
13919
b0481b0b
ILT
139202009-04-27 Ian Lance Taylor <iant@google.com>
13921
13922 * x86_64.cc (do_adjust_output_section): Set entsize to
13923 plt_entry_size.
13924
b22a5a41 139252009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
13926
13927 * output.cc (Output_file::close): After short writes, continue
13928 writing from the correct offset in the buffer being written.
13929
40fde488
CD
139302009-04-23 Chris Demetriou <cgd@google.com>
13931
13932 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
13933 * configure: Regenerate.
13934 * config.in: Regenerate.
13935 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
13936 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
13937
3ce2c28e
ILT
139382009-04-21 Mikolaj Zalewski <mikolajz@google.com>
13939
13940 * incremental.cc (Incremental_inputs_header_data): Renamed from
13941 Incremental_input_header_data.
13942 (Incremental_inputs_header_data::data_size): New field.
13943 (Incremental_inputs_header_data::put_input_file_count): Renamed
13944 from input_file_count.
13945 (Incremental_inputs_header_data::put_command_line_offset): Renamed
13946 from command_line_offset.
13947 (Incremental_inputs_header_data::put_reserved): Renamed from
13948 put_reserved.
13949 (Incremental_inputs_entry_data): Renamed from
13950 Incremental_input_entry_data.
13951 (Incremental_inputs_entry_data::data_size): New field.
13952 (Incremental_inputs::report_command_line): New method.
13953 (Incremental_inputs::finalize): New method.
13954 (Incremental_inputs::create_incremental_inputs_data): New method.
13955 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
13956 * incremental.h: New file.
13957 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 13958 (Layout::finalize): Create incremental inputs section in
3ce2c28e 13959 incremental builds.
703d02da 13960 (Layout::create_incremental_info_sections): New method.
3ce2c28e 13961 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
13962 (Layout::create_incremental_info_sections): New method.
13963 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
13964 * main.cc (main): Notify Incremental_input of the command line.
13965
e55bde5e
ILT
139662009-04-01 Ian Lance Taylor <iant@google.com>
13967 Mikolaj Zalewski <mikolajz@google.com>
13968
13969 * gold.h (reserve_unordered_map): Define, three versions, one for
13970 each version of Unordered_map.
13971 * layout.cc (Layout::Layout): Remove options parameter. Add
13972 number_of_input_files parameter. Don't initialize options_.
13973 Initialize number_of_input_files_ and resized_signatures_. Move
13974 sections_are_attached_.
13975 (Layout::layout_group): Reserve space for group_signatures_.
13976 (Layout::find_or_add_kept_section): Change name parameter to be a
13977 reference. Resize signatures_ map when it gets large enough.
13978 (Layout::layout_eh_frame): Use parameters->options() instead of
13979 this->options_.
13980 (Layout::make_output_section): Likewise.
13981 (Layout::attach_allocated_section_to_segment): Likewise.
13982 (Layout::finalize, Layout::create_executable_stack): Likewise.
13983 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
13984 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
13985 * layout.h (class Layout): Update declarations. Remove options_
13986 field. Add number_of_input_files_ and resized_signatures_
13987 fields. Move sections_are_attached_ field.
13988 * main.cc (main): Pass number of input files to Layout
13989 constructor. Don't pass options.
13990
154b857c
ILT
139912009-03-30 Ian Lance Taylor <iant@google.com>
13992
13993 * ffsll.c (ffsll): Correct implementation.
13994
2f35ab9b
ILT
139952009-03-27 Ian Lance Taylor <iant@google.com>
13996
fd03461a
ILT
13997 * ffsll.c: New file.
13998 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
13999 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
14000 * ftruncate.c (ftruncate): Declare before definition.
14001 * mremap.c (mremap): Likewise.
14002 * pread.c (pread): Likewise.
14003 * configure, Makefile.in, config.in: Rebuild.
14004
2f35ab9b
ILT
14005 * mremap.c: New file.
14006 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
14007 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
14008 (mremap): Declare if HAVE_MREMAP is not defined.
14009 * configure, Makefile.in, config.in: Rebuild.
14010
33aea2fd
CC
140112009-03-27 Cary Coutant <ccoutant@google.com>
14012
14013 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
14014 position independent.
14015 * sparc.cc (Target_sparc::check_non_pic): Likewise.
14016 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
14017
6d479619
CC
140182009-03-24 Cary Coutant <ccoutant@google.com>
14019
14020 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
14021 an executable.
14022 (needs_dynamic_reloc): Likewise.
14023
afc06bb8
ILT
140242009-03-24 Ian Lance Taylor <iant@google.com>
14025
14026 * yyscript.y (file_cmd): Recognize EXTERN.
14027 (extern_name_list, extern_name_list_body): New nonterminals.
14028 * script.cc (script_add_extern): Define.
14029 * script-c.h (script_add_extern): Declare.
14030
f6060a4d
ILT
140312009-03-24 Rafael Avila de Espindola <espindola@google.com>
14032
14033 * object.cc (is_elf_object): Define.
14034 * object.h (is_elf_object): Declare.
14035 * archive.cc (Archive::get_elf_object_for_member): Call
14036 is_elf_object.
33aea2fd 14037 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 14038
26736d8e
ILT
140392009-03-24 Elliott Hughes <enh@google.com>
14040
14041 * output.cc (Output_file::map_anonymous): Define.
14042 (Output_file::map): Use map_anonymous. If the regular mmap fails,
14043 try an anonymous one. Report the size if the mmap fails.
14044 * output.h (class Output_file): Declare map_anonymous.
14045
22fd9730
ILT
140462009-03-24 Ian Lance Taylor <iant@google.com>
14047
14048 * target-select.cc (instantiate_target): Don't acquire the lock if
14049 the instantiated_target_ field has already been set.
14050
cb010894
ILT
140512009-03-23 Ian Lance Taylor <iant@google.com>
14052
7f055c20
ILT
14053 * gold-threads.h (class Initialize_lock): Define.
14054 * gold-threads.cc (class Initialize_lock_once): Define.
14055 (initialize_lock_control): New static variable.
14056 (initialize_lock_pointer): New static variable.
14057 (initialize_lock_once): New static function.
14058 (Initialize_lock::Initialize_lock): Define.
14059 (Initialize_lock::initialize): Define.
14060 * target-select.h: Include "gold-threads.h".
14061 (class Target_selector): Add lock_ and initialize_lock_ fields.
14062 Don't define instantiate_target, just declare it.
14063 * target-select.cc (Target_selector::Target_selector): Initialize
14064 new fields.
14065 (Target_selector::instantiate_target): Define.
14066 * descriptors.h: Include "gold-threads.h".
14067 (class Descriptors): Add initialize_lock_ field.
14068 * descriptors.cc (Descriptors::Descriptors): Initialize new
14069 field.
14070 (Descriptors::open): Use initialize_lock_ field
14071 * errors.h (class Errors): Add initialize_lock_ field.
14072 * errors.cc (Errors::Errors): Initialize new field.
14073 (Errors::initialize_lock): Use initialize_lock_ field.
14074 * powerpc.cc (class Target_selector_powerpc): Remove
14075 instantiated_target_ field. In do_recognize call
14076 instantiate_target rather than do_instantiate_target. In
14077 do_instantiate_target just allocate a new target.
14078 * sparc.cc (class Target_selector_sparc): Likewise.
14079
36959681
ILT
14080 * freebsd.h: New file.
14081 * i386.cc: Include "freebsd.h".
14082 (Target_i386): Derive from Target_freebsd rather than
14083 Sized_target.
14084 (Target_selector_i386): Derive from Target_selector_freebsd rather
14085 than Target_selector.
14086 * x86_64.cc: Include "freebsd.h".
14087 (Target_x86_64): Derive from Target_freebsd rather than
14088 Sized_target.
14089 (Target_selector_x86_64): Derive from Target_selector_freebsd
14090 rather than Target_selector.
14091 * target.h (class Target): Add adjust_elf_header and
14092 do_adjust_elf_header.
14093 * output.cc (Output_file_header:: do_sized_write): Call target
14094 adjust_elf_header routine.
14095 * configure.tgt: Set targ_osabi.
14096 * configure.ac: Define GOLD_DEFAULT_OSABI.
14097 * parameters.cc (Parameters::default_target): Pass
14098 GOLD_DEFAULT_OSABI to select_target.
14099 * target-select.h (class Target_selector): Make instantiate_target
14100 protected rather than private.
14101 * Makefile.am (HFILES): Add freebsd.h.
14102 * configure, Makefile.in, config.in: Rebuild.
14103
cb010894
ILT
14104 * merge.cc (do_add_input_section): Correct pend value. Change
14105 message about last entry not being null terminated from error to
14106 warning.
14107
0e879927
ILT
141082009-03-20 Mikolaj Zalewski <mikolajz@google.com>
14109
14110 * incremental.cc: New file.
14111 * Makefile.am (CCFILES): Add incremental.cc.
14112 * Makefile.in: Rebuild.
14113
41105937
PP
141142009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
14115
14116 * layout.cc (Layout::output_section_name): Preserve names
14117 of '.note.' sections.
e1df38aa 14118
60439920
ILT
141192009-03-19 Ian Lance Taylor <iant@google.com>
14120
14121 * descriptors.cc (Descriptors::open): Check that the options are
14122 valid before using them.
14123
0d371ad3
ILT
141242009-03-18 Ian Lance Taylor <iant@google.com>
14125
14126 * script-sections.h: Include <list>.
14127 (class Script_sections): Change Sections_elements from std::vector
14128 to std::list. Typedef public Elements_iterator. Add
14129 orphan_section_placement_, data_segment_align_start_, and
14130 saw_data_segment_align_ fields. Remove data_segment_align_index_
14131 field.
14132 * script-sections.cc (class Orphan_section_placement): New class.
14133 (class Sections_element): Add virtual functions is_relro and
14134 orphan_section_init. Remove virtual function place_orphan_here.
14135 (class Output_section_definition): Add is_relro and
14136 orphan_section_init. Remove place_orphan_here.
14137 (class Orphan_output_section): Likewise.
14138 (Script_sections::Script_sections): Update for field changes.
14139 (Script_sections::data_segment_align): Set saw_data_segment_align_
14140 and data_segment_align_start_, not data_segment_align_index.
14141 (Script_sections::data_segment_relro_end): Check
14142 saw_data_segment_align_. Use data_segment_align_start_ rather
14143 than data_segment_align_index_.
14144 (Script_sections::place_orphan): Rewrite to use
14145 Orphan_section_placement.
14146
9201d894
ILT
141472009-03-17 Ian Lance Taylor <iant@google.com>
14148
9c5b8369
ILT
14149 * archive.cc (Archive::add_symbols): Check for a version attached
14150 to the symbol name in the archive map.
14151 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
14152 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
14153 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
14154 (ver_test_11.a): New target.
14155 * testsuite/Makefile.in: Rebuild.
14156
9201d894
ILT
14157 * configure.ac: Check for chsize and posix_fallocate. Replace
14158 ftruncate.
14159 * ftruncate.c: New file, from gnulib.
14160 * output.cc (posix_fallocate): Define dummy version if not
14161 HAVE_POSIX_FALLOCATE.
14162 (Output_file::map): Call posix_fallocate rather than lseek and
14163 write.
14164 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
14165 * configure, Makefile.in, config.in: Rebuild.
14166
ef4ab7a8 141672009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 14168
ef4ab7a8
PP
14169 * layout.h (Layout::create_note): Add section_name parameter.
14170 * layout.cc (Layout::create_note): Likewise.
14171 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 14172
8c500701
ILT
141732009-03-17 Ian Lance Taylor <iant@google.com>
14174
e85b18e1
ILT
14175 * descriptors.cc: Include "options.h".
14176 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
14177 (Descriptors::open): Always use O_CLOEXEC when opening a new
14178 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
14179 then set FD_CLOEXEC.
14180
9efe6174
ILT
14181 * sparc.cc (class Target_sparc): Add has_got_section.
14182 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
14183 make sure we have a GOT section.
14184
14185 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
14186 (Target_sparc::Scan::local): Likewise.
14187 (Target_sparc::Scan::global): Likewise.
14188 (Target_sparc::Relocate::relocate): Likewise.
14189 (Target_sparc::Relocate::relocate_tls): Likewise.
14190
8c500701
ILT
14191 * symtab.cc (Symbol_table::define_default_version): New function,
14192 broken out of add_from_object.
14193 (Symbol_table::add_from_object): Call define_default_version.
14194 (Symbol_table::define_special_symbol): Add resolve_oldsym
14195 parameter. Change all callers. If the version for a symbol comes
14196 from a version script, resolve it with the symbol with the same
14197 name with no version. Also add the symbol without a version if
14198 appropriate.
14199 (do_define_in_output_data): If resolving with oldsym, don't delete
14200 sym.
14201 (do_define_in_output_segment): Likewise.
14202 (do_define_as_constant): Likewise.
14203 * symtab.h (class Symbol_table): Update declarations.
14204
f1ed28fb
ILT
142052009-03-13 Ian Lance Taylor <iant@google.com>
14206
15f8229b
ILT
14207 * readsyms.cc (Read_symbols::incompatible_warning): New function.
14208 (Read_symbols::requeue): New function.
14209 (Read_symbols::do_read_symbols): If make_elf_object fails because
14210 the target type is not configured, and the file was searched for,
14211 issue a warning and retry with the next directory.
14212 (Add_symbols::run): If the file has an incompatible format, and
14213 it was searched for, requeue the Read_symbols task. On error,
14214 release the object.
14215 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
14216 dirindex parameter to constructor. Change all callers. Declare
14217 incompatible_warning and requeue.
14218 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
14219 input_argument_ and input_group_ fields. Add them to
14220 constructor. Change all callers.
14221 (class Read_script): Add dirindex_ field. Add it to constructor.
14222 Change all callers.
14223 * archive.cc (Archive::setup): Remove input_objects parameter.
14224 Change all callers.
14225 (Archive::get_file_and_offset): Likewise.
14226 (Archive::read_all_symbols): Likewise.
14227 (Archive::read_symbols): Likewise.
14228 (Archive::get_elf_object_for_member): Remove input_objects
14229 parameter. Add punconfigured parameter. Change all callers.
14230 (Archive::add_symbols): Change return type to bool. Check return
14231 value of include_member.
14232 (Archive::include_all_members): Likewise.
14233 (Archive::include_member): Change return type to bool. Return
14234 false if first included object has incompatible target. Set
14235 included_member_ field.
14236 (Add_archive_symbols::run): If add_symbols returns false, requeue
14237 Read_symbols task.
14238 * archive.h (class Archive): Add included_member_ field.
14239 Initialize it in constructor. Add input_file and searched_for
14240 methods. Update declarations.
14241 (class Add_archive_symbols): Add dirpath_, dirindex_, and
14242 input_argument_ fields. Add them to constructor. Change all
14243 callers.
14244 * script.cc: Include "target-select.h".
14245 (class Parser_closure): Add skip_on_incompatible_target_ and
14246 found_incompatible_target_ fields. Add
14247 skip_on_incompatible_target parameter to constructor. Change all
14248 callers. Add methods skip_on_incompatible_target,
14249 clear_skip_on_incompatible_target, found_incompatible_target, and
14250 set_found_incompatible_target.
14251 (read_input_script): Add dirindex parameter. Change all callers.
14252 If parser finds an incompatible target, requeue Read_symbols
14253 task.
14254 (script_set_symbol): Clear skip_on_incompatible_target in
14255 closure.
14256 (script_add_assertion, script_parse_option): Likewise.
14257 (script_start_sections, script_add_phdr): Likewise.
14258 (script_check_output_format): New function.
14259 * script.h (read_input_script): Update declaration.
14260 * script-c.h (script_check_output_format): Declare.
14261 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
14262 (ignore_cmd): Remove OUTPUT_FORMAT.
14263 * fileread.cc (Input_file::Input_file): Add explicit this.
14264 (Input_file::will_search_for): New function.
14265 (Input_file::open): Add pindex parameter. Change all callers.
14266 * fileread.h (class Input_file): Add input_file_argument method.
14267 Declare will_search_for. Update declarations.
14268 * object.cc (make_elf_object): Add punconfigured parameter.
14269 Change all callers.
14270 * object.h (class Object): Make input_file public. Add
14271 searched_for method.
14272 (make_elf_object): Update declaration.
14273 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
14274 restart search.
14275 * dirsearch.h (class Dirsearch): Update declaration.
14276 * options.h (class General_options): Add --warn-search-mismatch.
14277 * parameters.cc (Parameters::is_compatible_target): New function.
14278 * parameters.h (class Parameters): Declare is_compatible_target.
14279 * workqueue.cc (Workqueue::add_blocker): New function.
14280 * workqueue.h (class Workqueue): Declare add_blocker.
14281
f1ed28fb
ILT
14282 * fileread.cc (Input_file::open): Remove options parameter.
14283 Change all callers.
14284 (Input_file::open_binary): Likewise.
14285 * script.cc (read_input_script): Likewise.
14286 * readsyms.h (class Read_symbols): Remove options_ field. Remove
14287 options parameter from constructor. Change all callers.
14288 (class Read_script): Likewise.
14289 * fileread.h (class Input_file): Update declarations.
14290 * script.h (read_input_script): Update declaration.
14291
34dd024a
NC
142922009-03-10 Nick Clifton <nickc@redhat.com>
14293
14294 * po/es.po: New Spanish translation.
14295
6d71b17c
CC
142962009-03-06 Cary Coutant <ccoutant@google.com>
14297
14298 * options.cc (parse_short_option): Keep dash_z from registering itself.
14299
031cdbed
ILT
143002009-03-03 Ian Lance Taylor <iant@google.com>
14301
14302 PR 9918
14303 * target-reloc.h (relocate_section): Pass output_section to
14304 relocate.
14305 * i386.cc (Target_i386::should_apply_static_reloc): Add
14306 output_section parameter. Change all callers.
14307 (Target_i386::Relocate::relocate): Add output_section parameter.
14308 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14309 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
14310 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
14311 * testsuite/two_file_shared.sh: New script.
14312 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
14313 (check_DATA): Add two_file_shared.dbg.
14314 (two_file_shared.dbg): New target.
14315 * testsuite/Makefile.in: Rebuild.
14316
15d5fa16
ILT
143172009-03-01 Ian Lance Taylor <iant@google.com>
14318
14319 * configure.ac: Check for byteswap.h.
14320 * configure: Rebuild.
14321 * config.in: Rebuild.
14322
8a4c0b0d
ILT
143232009-03-01 Mikolaj Zalewski <mikolajz@google.com>
14324
14325 * layout.cc (Layout::find_or_add_kept_section): New function.
14326 (Layout::add_comdat): Removed.
14327 * layout.h (struct Kept_section): Move out of class Layout.
14328 Remove trailing underscores from field names. Add group_sections
14329 field. Rename group_ field to is_group. Change all uses.
14330 (class Layout): Declare find_or_add_kept_section, not add_comdat.
14331 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
14332 comdat_groups_ field.
14333 (Sized_relobj::include_section_group): Use
14334 find_or_add_kept_section and Kept_section::group_sections.
14335 (Sized_relobj::include_linkonce_section): Likewise.
14336 * object.cc (class Sized_relobj): Don't define Comdat_group or
14337 Comdat_group_table. Remove find_comdat_group and
14338 add_comdat_group. Remove comdat_groups_ field.
14339 * plugin.cc (include_comdat_group): Use
14340 Layout::find_or_add_kept_section.
14341
b4ecf66b
ILT
143422009-02-28 Ian Lance Taylor <iant@google.com>
14343
14359ca0
ILT
14344 * README: --gc-sections and map files are now supported. Document
14345 some build requirements.
14346
b4ecf66b
ILT
14347 PR 6992
14348 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
14349 relocatable link set the value of the section symbol to zero.
14350 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
14351 relocatable link don't include the section address in the local
14352 symbol value.
14353
0602e05a
ILT
143542009-02-27 Ian Lance Taylor <iant@google.com>
14355
fd9d194f
ILT
14356 PR 6811
14357 * options.h (class Search_directory): Add is_system_directory.
14358 (class General_options): Declare is_in_system_directory.
14359 * options.cc (get_relative_sysroot): Make static.
14360 (get_default_sysroot): Make static.
14361 (General_optoins::is_in_system_directory): New function.
14362 * fileread.cc (Input_file::is_in_system_directory): New function.
14363 * fileread.h (class Input_file): Declare is_in_system_directory.
14364 * object.h (class Object): Add is_in_system_directory.
14365 (class Input_objects): Remove system_library_directory_ field.
14366 * object.cc (Input_objects::add_object): Don't set
14367 system_library_directory_.
14368 (input_objects::found_in_system_library_directory): Remove.
14369 * symtab.cc (Symbol_table::write_globals): Remove input_objects
14370 parameter. Change all callers.
14371 (Symbol_table::sized_write_globals): Likewise.
14372 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
14373 Call Object::is_in_system_directory.
14374 * symtab.h (class Symbol_table): Update declarations.
14375
61edd21f
ILT
14376 PR 5990
14377 * descriptors.h (Open_descriptor): Add is_on_stack field.
14378 * descriptors.cc (Descriptors::open): If the descriptor is on the
14379 top of the stack, remove it. Initialize is_on_stack field.
14380 (Descriptors::release): Only add pod to stack if it is not on the
14381 stack already.
14382 (Descriptors::close_some_descriptor): Clear stack_next and
14383 is_on_stack fields.
14384
e29e076a
ILT
14385 PR 7091
14386 * output.cc (Output_section::find_starting_output_address): Rename
14387 from starting_output_address; add PADDR parameter; change return
14388 type.
14389 * output.h (class Output_section): Declare
14390 find_starting_output_address instead of starting_output_address.
14391 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
14392 section symbol for which we can't find a merge section.
14393
0602e05a
ILT
14394 PR 9836
14395 * symtab.cc (Symbol_table::add_from_object): If the visibility is
14396 hidden or internal, force the symbol to be local.
14397 * resolve.cc (Symbol::override_visibility): Define.
14398 (Symbol::override_base): Use override_visibility.
14399 (Symbol_table::resolve): Likewise.
14400 (Symbol::override_base_with_special): Likewise.
14401 (Symbol_table::override_with_special): If the visibility is hidden
14402 or internal, force the symbol to be local.
14403 * symtab.h (class Symbol): Add set_visibility and
14404 override_visibility.
14405 * testsuite/ver_test_1.sh: New file.
14406 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
14407 (check_DATA): Add ver_test_1.syms.
14408 (ver_test_1.syms): New target.
14409 * testsuite/Makefile.in: Rebuild.
14410
401a9a73
CC
144112009-02-25 Cary Coutant <ccoutant@google.com>
14412
14413 * layout.cc (Layout::choose_output_section): Don't rename sections
14414 when using a linker script that has a SECTIONS clause.
14415 * Makefile.in: Regenerate.
14416
14417 * testsuite/Makefile.am (script_test_5.sh): New test case.
14418 * testsuite/Makefile.in: Regenerate.
14419 * testsuite/script_test_5.cc: New file.
14420 * testsuite/script_test_5.sh: New file.
14421 * testsuite/script_test_5.t: New file.
14422
f488e4b0
CC
144232009-02-13 Rafael Avila de Espindola <espindola@google.com>
14424
14425 * archive.cc (Archive::include_member): Update calls to add_symbols.
14426 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
14427 the Layout argument.
14428 * dynobj.h (do_add_symbols): Add the Layout argument.
14429 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
14430 Layout argument.
14431 * object.h (Object::add_symbols): Add the Layout argument.
14432 (Object::do_add_symbols): Add the Layout argument.
14433 (Sized_relobj::do_add_symbols): Add the Layout argument.
14434 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
14435 Unify the two versions.
14436 (Add_plugin_symbols): Remove.
14437 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
14438 (Sized_pluginobj::do_add_symbols): Unify the two versions.
14439 (Add_plugin_symbols): Remove.
14440 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
14441 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
14442 (Add_symbols::run): Make it work with Pulginobj.
14443
89dd1680
ILT
144442009-02-06 Ian Lance Taylor <iant@google.com>
14445
14446 * object.cc (Sized_relobj::do_layout): Make info message start
14447 with lower case letter.
14448
266d0a74
ILT
144492009-02-06 Mikolaj Zalewski <mikolajz@google.com>
14450
602b464e
ILT
14451 * binary.cc: Fix file comment.
14452
266d0a74
ILT
14453 * options.h (enum Incremental_disposition): Define.
14454 (class General_options): Add new options: --incremental,
14455 --incremental_changed, --incremental_unchanged,
14456 --incremental_unknown. Add incremental_disposition_ and
14457 implicit_incremental_ fields.
14458 (General_options::incremental_disposition): New function.
14459 (class Position_dependent_options): Add incremental_disposition
14460 option.
14461 (Position_dependent_options::copy_from_options): Set incremental
14462 dispositions.
14463 * options.cc (General_options::parse_incremental_changed): New
14464 function.
2e702c99
RM
14465 (General_options::parse_incremental_unchanged): New function.
14466 (General_options::parse_incremental_unknown): New function.
14467 (General_options::General_options): Initialize new fields
266d0a74 14468 incremental_disposition_ and implicit_incremental_.
2e702c99 14469 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
14470 without --incremental.
14471
f073bbf7
CD
144722009-02-06 Chris Demetriou <cgd@google.com>
14473
14474 * gold.h (gold_undefined_symbol): Change to take only a Symbol
14475 pointer and to report location as the file name associated with
14476 the symbol.
14477 (gold_undefined_symbol_at_location): New function to replace the
14478 old gold_undefined_symbol functionality.
14479 * target-reloc.h (relocate_section): Update to use
14480 gold_undefined_symbol_at_location.
14481 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14482 Call gold_undefined_symbol function rather than gold_error.
14483 * errors.h (Errors::undefined_symbol): Take location as a
14484 string, rather than calculating it from a relocation.
14485 * errors.cc (Errors::fatal): Print "fatal error:" before the
14486 formatted message.
14487 (Errors::error, Errors::error_at_location): Print "error: "
14488 before the formatted message.
14489 (Errors::undefined_symbol): Take location as a string, rather
14490 than calculating it from a relocation.
14491 (gold_undefined_symbol_at_location): New function akin to
14492 old gold_undefined_symbol, calculates location from relocation.
14493 (gold_undefined_symbol): Change to take only a Symbol pointer
14494 and to report location as the file name associated with the symbol.
14495 * testsuite/debug_msg.sh: Update for changed error messages.
14496 * testsuite/undef_symbol.sh: Likewise.
14497
8e94a90c
ILT
144982009-02-04 Duncan Sands <baldrick@free.fr>
14499
14500 PR 9812
14501 * reduced_debug_output.h
14502 (Output_reduced_debug_abbrev_section::failed): Use format for
14503 gold_warning.
14504 (Output_reduced_debug_info_section::faild): Likewise.
14505
88a0e15b
ILT
145062009-01-31 Mikolaj Zalewski <mikolajz@google.com>
14507
14508 * script.cc (Lazy_demangler): New class.
2e702c99 14509 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
14510 symbol only once.
14511
5efc7cd2
CC
145122009-01-29 Cary Coutant <ccoutant@google.com>
14513
14514 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
14515 to __tls_get_addr.
14516 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14517
e0ebcf42
ILT
145182009-01-28 Ian Lance Taylor <iant@google.com>
14519
5efc7cd2 14520 * version.cc (version_string): Bump to 1.9.
75fe7426 14521
e0ebcf42
ILT
14522 * gold.h: Include <cstring> and <stdint.h>.
14523 * version.cc: Include <cstdio>.
14524 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
14525 warning.
14526 * reduced_debug_output.cc (insert_into_vector): Rename from
14527 Insert_into_vector; change all callers. Use Swap_unaligned to
14528 avoid aliasing issue; remove union since it is unnecessary.
14529
8e2813be 145302009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
14531
14532 * Makefile.am (CCFILES): Add gc.cc.
14533 (HFILES): Add gc.h.
14534 * Makefile.in: Regenerate.
14535 * gold.cc (Gc_runner): New class.
14536 (queue_initial_tasks): Call garbage collection related tasks
14537 when corresponding options are invoked.
14538 (queue_middle_gc_tasks): New function.
14539 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
14540 processed early before laying out sections during garbage collection.
14541 * gold.h (queue_middle_gc_tasks): New function.
14542 (is_prefix_of): Move from "layout.cc".
14543 * i386.cc (Target_i386::gc_process_relocs): New function.
14544 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
14545 * main.cc (main): Create object of class "Garbage_collection".
14546 * object.cc (Relobj::copy_symbols_data): New function.
14547 (Relobj::is_section_name_included): New function.
e1df38aa
NC
14548 (Sized_relobj::do_layout): Allow this function to be called twice
14549 during garbage collection and defer layout of section during the
6d03d481
ST
14550 first call.
14551 * object.h (Relobj::get_symbols_data): New function.
14552 (Relobj::is_section_name_included): New function.
14553 (Relobj::copy_symbols_data): New function.
14554 (Relobj::set_symbols_data): New function.
14555 (Relobj::get_relocs_data): New function.
14556 (Relobj::set_relocs_data): New function.
14557 (Relobj::is_output_section_offset_invalid): New pure virtual function.
14558 (Relobj::gc_process_relocs): New function.
14559 (Relobj::do_gc_process_relocs): New pure virtual function.
14560 (Relobj::sd_): New data member.
14561 (Sized_relobj::is_output_section_offset_invalid): New function.
14562 (Sized_relobj::do_gc_process_relocs): New function.
14563 * options.h (General_options::gc_sections): Modify to not be a no-op.
14564 (General_options::print_gc_sections): New option.
14565 * plugin.cc (Plugin_finish::run): Remove function call to
14566 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
14567 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
14568 * reloc.cc (Read_relocs::run): Add task to process relocs and
14569 determine unreferenced sections when doing garbage collection.
14570 (Gc_process_relocs): New class.
14571 (Sized_relobj::do_gc_process_relocs): New function.
14572 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
14573 sections that are garbage collected.
14574 * reloc.h (Gc_process_relocs): New class.
14575 * sparc.cc (Target_sparc::gc_process_relocs): New function.
14576 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
14577 symbols whose corresponding sections are garbage collected.
14578 (Symbol_table::Symbol_table): Add new parameter for the garbage
14579 collection object.
14580 (Symbol_table::gc_mark_undef_symbols): New function.
14581 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14582 (Symbol_table::gc_mark_dyn_syms): New function.
14583 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
14584 as garbage.
14585 (Symbol_table::add_from_object): Likewise.
14586 (Symbol_table::add_from_relobj): When building shared objects, do not
14587 treat externally visible symbols as garbage.
14588 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
14589 table information for static and relocatable links.
14590 * symtab.h (Symbol_table::set_gc): New function.
14591 (Symbol_table::gc): New function.
14592 (Symbol_table::gc_mark_undef_symbols): New function.
14593 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14594 (Symbol_table::gc_mark_dyn_syms): New function.
14595 (Symbol_table::gc_): New data member.
e1df38aa 14596 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
14597 function.
14598 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
14599 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
14600
3b293544
CF
146012009-01-20 Chris Faylor <me.sourceware@sourceware.org>
14602
14603 * options.h (General_options::gc_sections): Define as a no-op for now.
14604 (General_options::no_keep_memory): Ditto.
14605 (General_options::Bshareable): Define.
14606 * options.cc (General_options::finalize): Honor -Bshareable.
14607
83d22aa8
AS
146082009-01-20 Andreas Schwab <schwab@suse.de>
14609
14610 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
14611 read the value in the contents, since we don't use it. Use the
14612 template endianness when writing.
14613 (Relocate::relocate): Use it for R_PPC_REL16_HA.
14614
cd536b21
AS
146152009-01-19 Andreas Schwab <schwab@suse.de>
14616
14617 * configure.tgt (powerpc64-*): Fix targ_obj.
14618
99e9a495
ILT
146192009-01-15 Ian Lance Taylor <iant@google.com>
14620
14621 * object.cc (Sized_relobj::write_local_symbols): Don't write out
14622 local symbols when stripping all symbols.
14623
bbbfea06
CC
146242009-01-14 Cary Coutant <ccoutant@google.com>
14625
99e9a495 14626 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 14627
0f7c0701
CC
146282009-01-14 Cary Coutant <ccoutant@google.com>
14629
14630 * archive.cc (Archive::get_elf_object_for_member): Remove call
14631 to File_read::claim_for_plugin.
14632 * descriptors.cc (Descriptors::open): Remove reference to
14633 is_claimed.
14634 (Descriptors::claim_for_plugin): Remove.
14635 * descriptors.h (Descriptors::claim_for_plugin): Remove.
14636 (Descriptors::is_claimed): Remove.
14637 (claim_descriptor_for_plugin): Remove.
14638 * fileread.cc (File_read::claim_for_plugin): Remove.
14639 * fileread.h (File_read::claim_for_plugin): Remove.
14640 (File_read::descriptor): Reopen descriptor if necessary.
14641 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
14642 (Plugin_manager::all_symbols_read): Add task parameter. Change
14643 all callers.
14644 (Plugin_manager::get_input_file): New function.
14645 (Plugin_manager::release_input_file): New function.
14646 (Pluginobj::Pluginobj): Add filesize parameter and initialize
14647 corresponding data member.
14648 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
14649 and pass to base constructor. Change all callers.
14650 (get_input_file, release_input_file): New functions.
14651 (make_sized_plugin_object): Add filesize parameter. Change all callers.
14652 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
14653 (Plugin_manager::all_symbols_read): Add task parameter.
14654 (Plugin_manager::get_input_file): New function.
14655 (Plugin_manager::release_input_file): New function.
14656 (Plugin_manager::task_): New data member.
14657 (Pluginobj::Pluginobj): Add filesize parameter.
14658 (Pluginobj::filename): New function.
14659 (Pluginobj::descriptor): New function.
14660 (Pluginobj::filesize): New function.
14661 (Pluginobj::filesize_): New data member.
14662 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
14663 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
14664 File_read::claim_for_plugin; use Object::unlock to unlock the file.
14665
14666 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
14667 with archive libraries.
14668 * testsuite/Makefile.in: Regenerate.
14669 * testsuite/plugin_test.c (struct sym_info): New type.
14670 (get_input_file, release_input_file): New static variables.
14671 (onload): Capture new transfer vector entries.
14672 (claim_file_hook): Stop reading at end of file according to filesize.
14673 Factor out parsing of readelf output into separate function.
14674 (all_symbols_read_hook): Exercise get_input_file and release_input_file
14675 APIs and get the source file name from the symbol table. Convert
14676 source file name to corresponding object file name. Print info
14677 message when adding new input files.
14678 (parse_readelf_line): New function.
14679 * testsuite/plugin_test_1.sh: Add checks for new info messages.
14680 * testsuite/plugin_test_2.sh: Likewise.
14681 * testsuite/plugin_test_3.sh: Likewise.
14682 * testsuite/plugin_test_4.sh: New test case.
14683
62a6d109
ILT
146842009-01-07 Ian Lance Taylor <iant@google.com>
14685
14686 * version.cc (version_string): Bump to 1.8.
14687
483620e8
CC
146882008-12-23 Cary Coutant <ccoutant@google.com>
14689
14690 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
14691 * plugin.cc (Plugin_manager::finish): Rename as
14692 layout_deferred_objects. Move cleanup to separate function.
14693 (Plugin_manager::cleanup): New function.
14694 (Plugin_finish::run): Call layout_deferred_objects and cleanup
14695 separately.
14696 * plugin.h (Plugin_manager::finish): Rename as
14697 layout_deferred_objects.
14698 (Plugin_manager::cleanup): New function.
14699 (Plugin_manager::cleanup_done): New field.
14700
d66a9eb3
CC
147012008-12-23 Cary Coutant <ccoutant@google.com>
14702
14703 * plugin.cc (is_visible_from_outside): New function.
14704 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
14705 so we don't return "IR only" status for exported symbols or -r links.
14706
14707 * testsuite/Makefile.am (plugin_test_3): New test case.
14708 * testsuite/Makefile.in: Regenerate.
14709 * testsuite/plugin_test_3.sh: New file.
14710
5995b570
CC
147112008-12-22 Cary Coutant <ccoutant@google.com>
14712
14713 * object.cc (Sized_relobj::layout_section): New function.
14714 (Sized_relobj::do_layout): Defer layout of input sections until after
14715 plugin has provided replacement files.
14716 (Sized_relobj::do_layout_deferred_sections): New function.
14717 * object.h (Relobj::set_section_offset): Remove virtual keyword.
14718 (Relobj::layout_deferred_sections): New function.
14719 (Relobj::do_layout_deferred_sections): New function.
14720 (Sized_relobj::do_layout_deferred_sections): New function.
14721 (Sized_relobj::layout_section): New function.
14722 (Sized_relobj::Deferred_layout): New structure.
14723 (Sized_relobj::deferred_layout_): New field.
14724 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
14725 Change all callers. Layout deferred sections.
14726 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
14727 references.
14728 (Plugin_hook::run): Move code from do_plugin_hook inline.
14729 (Plugin_hook::do_plugin_hook): Remove.
14730 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
14731 (Plugin_manager::finish): Renamed, was cleanup.
14732 (Plugin_manager::should_defer_layout): New function.
14733 (Plugin_manager::add_deferred_layout_object): New function.
14734 (Plugin_manager::Deferred_layout_list): New type.
14735 (Plugin_manager::deferred_layout_objects_): New field.
14736 (Plugin_hook::do_plugin_hook): Remove.
14737
ee769c88
ILT
147382008-12-17 Ian Lance Taylor <iant@google.com>
14739
14740 * options.h (class General_options): Add --no case for
14741 --export-dynamic.
14742
abc8dcba
CC
147432008-12-16 Cary Coutant <ccoutant@google.com>
14744
14745 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
14746 vector.
14747 (Plugin_manager::claim_file): Create plugin object even if
14748 plugin did not call the add_symbols callback.
14749 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
14750 asking for more symbols than were added.
14751 * testsuite/Makefile.am (plugin_test_1): Add test case with
14752 no global symbols.
14753 (empty.syms): New target.
14754 * testsuite/Makefile.in: Regenerate.
14755 * testsuite/plugin_test.c (claim_file_hook): Add new debug
14756 message. Don't call add_symbols if no globals.
14757 (all_symbols_read_hook): Don't provide replacement for empty
14758 claimed file.
14759
b0074644
ILT
147602008-12-12 Ian Lance Taylor <iant@google.com>
14761
68943102
ILT
14762 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
14763 r_type == 0 for a local symbol with r_sym == 0.
14764 (scan_relocatable_relocs): Pass r_sym to
14765 local_non_section_strategy.
14766 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
14767 r_sym parameter.
14768
b0074644
ILT
14769 * configure.ac: Update test for TLS descriptors: they are
14770 supported as of glibc 2.9.
14771 * configure: Rebuild.
14772
c2508178
ILT
147732008-12-11 Ian Lance Taylor <iant@google.com>
14774
14775 PR 7091
14776 * target-reloc.h (Default_scan_relocatable_relocs): For each
14777 function, map r_type == 0 to RELOC_DISCARD.
14778
2756a258
CC
147792008-12-10 Cary Coutant <ccoutant@google.com>
14780
14781 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
14782 object to override a kept COMDAT group from a plugin object.
14783
bb6f53d3
ILT
147842008-12-09 Ian Lance Taylor <iant@google.com>
14785
fbc558e1
ILT
14786 PR 7088
14787 * yyscript.y (file_cmd): Handle INPUT.
14788
bb6f53d3
ILT
14789 * testsuite/initpri1.c: Change all declarations to be full
14790 prototypes by adding void, to avoid compiler warnings.
14791
4674ecfc
CC
147922008-12-05 Rafael Avila de Espindola <espindola@google.com>
14793
14794 * options.cc (General_options::parse_plugin_opt): New.
14795 (General_options::add_plugin): The argument now is just the filename.
14796 (General_options::add_plugin_option): New.
14797 * options.h (plugin_opt): New.
14798 (add_plugin): Change argument name.
14799 (add_plugin_option): New.
14800 * plugin.cc (Plugin::load): Don't parse the plugin option.
14801 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
14802 (Plugin::add_option): New.
14803 (Plugin::args_): Change type.
14804 (Plugin::filename_): New.
14805 (Plugin_manager::add_plugin_option): New.
14806 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
14807 * testsuite/Makefile.in: Regenerate.
14808
fd06b4aa
CC
148092008-12-05 Cary Coutant <ccoutant@google.com>
14810
14811 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
14812 Handle --strip-lto-sections option.
14813 * options.h (strip_lto_sections): New option.
14814
6c52134c
CC
148152008-12-01 Cary Coutant <ccoutant@google.com>
14816
14817 * plugin.cc (ld_plugin_message): Change format parameter to const.
14818 Fix mismatch between new[] and delete.
14819
a45248e0
CC
148202008-11-14 Cary Coutant <ccoutant@google.com>
14821
14822 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
14823 instead of -1U.
14824
c82fbeee
CS
148252008-11-05 Craig Silverstein <csilvers@google.com>
14826
14827 * options.cc (General_options::parse_dynamic_list): New function.
14828 * options.h (General_options): New flags dynamic_list,
14829 dynamic_list_data, dynamic_list_cpp_new, and
14830 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
14831 (General_options::in_dynamic_list): New function.
14832 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
14833 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
14834 (Lex::can_continue_name): Likewise.
14835 (yylex): Likewise.
14836 (read_script_file): New parameter script_options.
14837 (read_dynamic_list): New function.
14838 (Script_options::define_dynamic_list): New function.
14839 (dynamic_list_keyword_parsecodes): New variable.
14840 (dynamic_list_keywords): New variable.
14841 * script.h (Script_options::define_dynamic_list): New function
14842 prototype.
14843 (read_dynamic_list): New function prototype.
14844 * symtab.cc (strprefix): New macro.
14845 (Symbol::should_add_dynsym_entry): Support dynamic_list,
14846 dynamic_list_data, dynamic_list_cpp_new, and
14847 dynamic_list_cpp_typeinfo.
14848 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
14849 (dynamic_list_expr): New rule.
14850 (dynamic_list_nodes): Likewise.
14851 (dynamic_list_node): Likewise.
14852 * testsuite/Makefile.am (dynamic_list): New test.
14853 * testsuite/Makefile.in: Regenerated.
14854 * testsuite/dynamic_list.t: New file.
14855 * testsuite/dynamic_list.sh: New file.
14856
e0bb29a5
CS
148572008-11-05 Craig Silverstein <csilvers@google.com>
14858
14859 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
14860 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
14861 (t11_last): Likewise.
14862 * testsuite/ver_test_6.c (main): Likewise.
14863
4e1e25e0
CC
148642008-10-07 Cary Coutant <ccoutant@google.com>
14865
14866 * options.c (General_options::finalize): Add check for -static and
14867 -shared.
14868 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
14869 is not empty.
14870
92f03fcb
CC
148712008-10-02 Cary Coutant <ccoutant@google.com>
14872
14873 * plugin.cc (make_sized_plugin_object): Fix conditional
14874 compilation to work when not all targets are enabled.
14875
fbd8a257
CC
148762008-09-29 Cary Coutant <ccoutant@google.com>
14877
14878 * archive.cc (Archive::get_file_and_offset): Use filename instead
14879 of name to get library path.
14880 (Archive::include_member): Unlock external member of a thin archive.
14881
14882 * testsuite/Makefile.am (TEST_AR): New variable.
14883 (thin_archive_test_1): New test.
14884 (thin_archive_test_2): New test.
81636b3f
CC
14885 * testsuite/Makefile.in: Regenerate.
14886 * testsuite/thin_archive_main.cc: New file.
14887 * testsuite/thin_archive_test_1.cc: New file.
14888 * testsuite/thin_archive_test_2.cc: New file.
14889 * testsuite/thin_archive_test_3.cc: New file.
14890 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 14891
eff45813
CC
148922008-09-29 Cary Coutant <ccoutant@google.com>
14893
14894 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
14895 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
14896 instead of -1U.
14897 (Sized_relobj::do_finalize_local_symbols): Likewise.
14898 (Sized_relobj::map_to_kept_section): Likewise.
14899 * object.h (Sized_relobj::invalid_address): New constant.
14900 (Sized_relobj::do_output_section_offset): Check for invalid_address
14901 and return -1ULL.
14902 * output.cc (Output_reloc::local_section_offset): Use constant
14903 invalid_address instead of -1U.
14904 (Output_reloc::get_address): Likewise.
14905 (Output_section::output_address): Change -1U to -1ULL.
14906 * output.h (Output_reloc::invalid_address): New constant.
14907 * reloc.cc (Sized_relobj::write_sections): Use constant
14908 invalid_address instead of -1U.
14909 (Sized_relobj::relocate_sections): Likewise.
14910 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
14911 values for merge sections.
14912 * target-reloc.h (relocate_for_relocatable): Use constant
14913 invalid_address instead of -1U.
14914
89fc3421
CC
149152008-09-19 Cary Coutant <ccoutant@google.com>
14916
14917 Add plugin functionality for link-time optimization (LTO).
14918 * configure.ac (plugins): Add --enable-plugins option.
14919 * configure: Regenerate.
14920 * config.in: Regenerate.
14921 * Makefile.am (LIBDL): New variable.
14922 (CCFILES): Add plugin.cc.
14923 (HFILES): Add plugin.h.
14924 (ldadd_var): Add LIBDL.
14925 * Makefile.in: Regenerate.
14926
14927 * archive.cc: Include "plugin.h".
14928 (Archive::setup): Don't preread archive symbols when using a plugin.
14929 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
14930 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
14931 files.
14932 (Archive::include_member): Add symbols from plugin objects.
14933 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
14934 * descriptors.cc (Descriptors::open): Check for file descriptors
14935 abandoned by plugins.
14936 (Descriptors::claim_for_plugin): New function.
14937 * descriptors.h (Descriptors::claim_for_plugin): New function.
14938 (Open_descriptor::is_claimed): New field.
14939 (claim_descriptor_for_plugin): New function.
14940 * fileread.cc (File_read::claim_for_plugin): New function.
14941 * fileread.h (File_read::claim_for_plugin): New function.
14942 (File_read::descriptor): New function.
14943 * gold.cc: Include "plugin.h".
14944 (queue_initial_tasks): Add task to call plugin hooks for generating
14945 new object files.
14946 * main.cc: Include "plugin.h".
14947 (main): Load plugin libraries.
14948 * object.h (Pluginobj): Declare.
14949 (Object::pluginobj): New function.
14950 (Object::do_pluginobj): New function.
14951 (Object::set_target): New function.
14952 * options.cc: Include "plugin.h".
14953 (General_options::parse_plugin): New function.
14954 (General_options::General_options): Initialize plugins_ field.
14955 (General_options::add_plugin): New function.
14956 * options.h (Plugin_manager): Declare.
14957 (General_options): Add --plugin option.
14958 (General_options::has_plugins): New function.
14959 (General_options::plugins): New function.
14960 (General_options::add_plugin): New function.
14961 (General_options::plugins_): New field.
14962 * plugin.cc: New file.
14963 * plugin.h: New file.
14964 * readsyms.cc: Include "plugin.h".
14965 (Read_symbols::do_read_symbols): Check for archive before checking
14966 for ELF file. Call plugin hooks to claim files.
14967 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
14968 from a real object file; force override when processing replacement
14969 files.
14970 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
14971 (Symbol::init_base_object): Likewise.
14972 (Symbol::init_base_output_data): Likewise.
14973 (Symbol::init_base_output_segment): Likewise.
14974 (Symbol::init_base_constant): Likewise.
14975 (Symbol::init_base_undefined): Likewise.
14976 (Symbol::output_section): Assert that object is not a plugin.
14977 (Symbol_table::add_from_pluginobj): New function.
14978 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
14979 undefined.
14980 (Symbol_table::sized_write_globals): Likewise.
14981 (Symbol_table::add_from_pluginobj): Instantiate template.
14982 * symtab.h (Sized_pluginobj): Declare.
14983 (Symbol::in_real_elf): New function.
14984 (Symbol::set_in_real_elf): New function.
14985 (Symbol::in_real_elf_): New field.
14986 (Symbol_table::add_from_pluginobj): New function.
14987
14988 * testsuite/Makefile.am (AM_CFLAGS): New variable.
14989 (LIBDL): New variable.
14990 (LDADD): Add LIBDL.
14991 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
14992 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
14993 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
14994 (MOSTLYCLEANFILES): Likewise.
14995 * testsuite/Makefile.in: Regenerate.
14996 * testsuite/plugin_test.c: New file.
14997 * testsuite/plugin_test_1.sh: New file.
14998 * testsuite/plugin_test_2.sh: New file.
14999
de31bda5
ILT
150002008-09-16 Ian Lance Taylor <iant@google.com>
15001
9c2d0ef9
ILT
15002 * target-reloc.h (relocate_section): Check whether a symbol is
15003 defined by the ABI before reporting an undefined symbol error.
15004 * target.h (Target::is_defined_by_abi): Make parameter const.
15005 (Target::do_is_defined_by_abi): Likewise.
15006 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
15007 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
15008 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
15009 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
15010 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
15011 * testsuite/Makefile.in: Rebuild.
15012
de31bda5
ILT
15013 * fileread.cc (make_view): Add casts to avoid warning.
15014
9fa33bee
AO
150152008-09-16 Alexandre Oliva <aoliva@redhat.com>
15016
15017 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
15018 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15019
183fd0e3
AO
150202008-09-16 Alexandre Oliva <aoliva@redhat.com>
15021
15022 * options.h (General_options::output_is_executable): New.
15023 (General_options::output_is_pie): New.
15024 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
15025 for shared libraries.
15026 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15027
7be8330a
CD
150282008-09-11 Chris Demetriou <cgd@google.com>
15029
15030 * options.h (origin): New -z option.
15031 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
15032 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
15033 in DT_FLAGS_1.
15034
a9caad02
CC
150352008-09-05 Cary Coutant <ccoutant@google.com>
15036
15037 * fileread.cc (File_read::make_view): Add check for attempt to map
15038 beyond end of file.
15039
ae6dce4d
CC
150402008-09-05 Cary Coutant <ccoutant@google.com>
15041
15042 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
15043 explicit instantiations.
15044
d7ab2a47
KVH
150452008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
15046
15047 PR gold/6858
15048 * options.cc (General_options::finalize): Allow undefined symbols
15049 in shlibs if linking -shared.
15050
15051 PR gold/6859
15052 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
15053 symbols as not needing a dynsym entry.
15054
1e52a9c1
CS
150552008-08-20 Craig Silverstein <csilvers@google.com>
15056
15057 * fileread.cc (File_read::open): Do not lock the file unless it
15058 was successfully opened.
15059
d85c80a3
CC
150602008-08-14 Cary Coutant <ccoutant@google.com>
15061
15062 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
15063 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
15064 * testsuite/tls_test.cc (struct int128): 128-bit struct
15065 for testing TLS relocs with non-zero addend.
15066 (v12): New TLS variable.
15067 (t12): New test.
15068 (t_last): Add check for v12.
15069 * testsuite/tls_test.h (t12): New function.
15070 * testsuite/tls_test_main.cc (thread_routine): Call new test.
15071
2d924fd9
ILT
150722008-08-13 Ian Lance Taylor <iant@google.com>
15073
15074 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
15075 set tls_segment_ or relro_segment_.
15076 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
15077 when appropriate.
15078 * output.h (Output_section::clear_is_relro): New function.
15079 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
15080 sections specially even when output_data_ is empty.
15081 (Output_segment::maximum_alignment): When first section is relro,
15082 only force alignment for PT_LOAD segments.
15083 * script.cc (script_data_segment_align): New function.
15084 (script_data_segment_relro_end): New function.
15085 * script-c.h (script_data_segment_align): Declare.
15086 (script_data_segment_relro_end): Declare.
15087 * script-sections.h (class Script_sections): Declare
15088 data_segment_align and data_segment_relro_end. Add fields
15089 segment_align_index_ and saw_relro_end_.
15090 * script-sections.cc (class Sections_element): Add set_is_relro
15091 virtual function. Add new bool* parameter to place_orphan_here.
15092 Add get_output_section virtual function.
15093 (class Output_section_definition): Add set_is_relro. Add new
15094 bool* parameter to place_orphan_here. Add get_output_section.
15095 Add is_relro_ field.
15096 (Output_section_definition::Output_section_definition): Initialize
15097 evaluated_address_, evaluated_load_address, evaluated_addralign_,
15098 and is_relro_ fields.
15099 (Output_section_definition::place_orphan_here): Add is_relro
15100 parameter.
15101 (Output_section_definition::set_section_addresses): Set relro for
15102 output section.
15103 (Output_section_definition::alternate_constraint): Likewise.
15104 (class Orphan_output_section): Add new bool* parameter to
15105 place_orphan_here. Add get_output_section.
15106 (Orphan_output_section::place_orphan_here): Add is_relro
15107 parameter.
15108 (Script_sections::Script_sections): Initialize
15109 data_segment_align_index_ and saw_relro_end_.
15110 (Script_sections::data_segment_align): New function.
15111 (Script_sections::data_segment_relro_end): New function.
15112 (Script_sections::place_orphan): Set or clear is_relro.
15113 (Script_sections::set_section_addresses): Force alignment of first
15114 TLS section.
15115 * yyscript.y (exp): Call script_data_segment_align and
15116 script_data_segment_relro_end.
15117 * testsuite/relro_script_test.t: New file.
15118 * testsuite/relro_test.cc (using_script): Declare.
15119 (t1, t2): Test using_script.
15120 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
15121 (relro_script_test_SOURCES): Define.
15122 (relro_script_test_DEPENDENCIES): Define.
15123 (relro_script_test_LDFLAGS): Define.
15124 (relro_script_test_LDADD): Define.
15125 (relro_script_test.so): New target.
15126 * testsuite/Makefile.in: Rebuild.
15127
f827c9a9
CC
151282008-08-06 Cary Coutant <ccoutant@google.com>
15129
15130 * archive.cc (Archive::total_archives, Archive::total_members)
15131 (Archive::total_members_loaded): New variables.
15132 (Archive::setup): Add parameter. Add option to preread
15133 archive symbols.
15134 (Archive::read_armap): Add counter.
15135 (Archive::get_file_and_offset): New function.
15136 (Archive::get_elf_object_for_member): New function.
15137 (Archive::read_all_symbols): New function.
15138 (Archive::read_symbols): New function.
15139 (Archive::add_symbols): Add counters.
15140 (Archive::include_all_members): Use armap to find members if it's
15141 already built.
15142 (Archive::include_member): Skip reading symbols if already read.
15143 Factored code into Archive::get_file_and_offset and
15144 Archive::get_elf_object_for_member. Changed call to
15145 Mapfile::report_include_archive_member.
15146 (Archive::print_stats): New function.
15147 * archive.h: Declare Object and Read_symbols_data classes.
15148 (Archive::Archive): Add initializers for new members.
15149 (Archive::setup): Add parameter.
15150 (Archive::print_stats): New function.
15151 (Archive::total_archives, Archive::total_members)
15152 (Archive::total_members_loaded): New variables.
15153 (Archive::get_file_and_offset): New function.
15154 (Archive::get_elf_object_for_member): New function.
15155 (Archive::read_all_symbols): New function.
15156 (Archive::read_symbols): New function.
15157 (Archive::Archive_member): New class.
15158 (Archive::members_): New member.
15159 (Archive::num_members_): New member.
15160 * main.cc: Include archive.h.
15161 (main): Call Archive::print_stats.
15162 * mapfile.cc (Mapfile::report_include_archive_member): Delete
15163 archive parameter; member_name is now the fully-decorated name.
15164 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
15165 * options.h: (General_options): Add --preread-archive-symbols option.
15166 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
15167 Archive::setup.
15168
de4c45bd
ILT
151692008-08-04 Ian Lance Taylor <iant@google.com>
15170
15171 * symtab.h (Symbol::use_plt_offset): New function.
15172 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
15173 * powerpc.cc (Relocate::relocate): Likewise.
15174 * sparc.cc (Relocate::relocate): Likewise.
15175 * x86_64.cc (Relocate::relocate): Likewise.
15176 * testsuite/weak_plt.sh: New test.
15177 * testsuite/weak_plt_main.cc: New test.
15178 * testsuite/weak_plt_shared.cc: New test.
15179 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
15180 (check_PROGRAMS): Add weak_plt.
15181 (check_DATA): Add weak_plt_shared.so.
15182 (weak_plt_main_pic.o, weak_plt): New targets.
15183 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
15184 * testsuite/Makefile.in: Rebuild.
15185
15186 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
15187 gcctestdir/ld.
15188 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
15189 * testsuite/Makefile.in: Rebuild.
15190
323ee3f4
AM
151912008-08-04 Alan Modra <amodra@bigpond.net.au>
15192
15193 * Makefile.am (POTFILES.in): Set LC_ALL=C.
15194 * Makefile.in: Regenerate.
15195 * po/POTFILES.in: Regenerate.
15196
7c07ecec
ILT
151972008-07-29 Ian Lance Taylor <iant@google.com>
15198
15199 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
15200 symbols before other symbols.
15201 * testsuite/script_test_2.cc (test_addr): Declare.
15202 (test_addr_alias): Declare.
15203 (main): Check that test_addr and test_addr_alias have the right
cd536b21 15204 values.
7c07ecec
ILT
15205 * testsuite/script_test_2.t: Define test_addr_alias and
15206 test_addr.
15207
5778530e
ILT
152082008-07-24 Ian Lance Taylor <iant@google.com>
15209
2a00e4fb
ILT
15210 PR 5990
15211 * descriptors.cc: New file.
15212 * descriptors.h: New file.
15213 * gold-threads.h (class Hold_optional_lock): New class.
15214 * fileread.cc: Include "descriptors.h".
15215 (File_read::~File_read): Release descriptor rather than closing
15216 it.
15217 (File_read::open) [file]: Call open_descriptor rather than open.
15218 Set is_descriptor_opened_.
15219 (File_read::open) [memory]: Assert that descriptor is not open.
15220 (File_read::reopen_descriptor): New function.
15221 (File_read::release): Release descriptor.
15222 (File_read::do_read): Make non-const. Reopen descriptor.
15223 (File_read::read): Make non-const.
15224 (File_read::make_view): Reopen descriptor.
15225 (File_read::do_readv): Likewise.
15226 * fileread.h (class File_read): Add is_descriptor_opened_ field.
15227 Update declarations.
15228 * layout.cc: Include "descriptors.h".
15229 (Layout::create_build_id): Use open_descriptor rather than open.
15230 * output.cc: Include "descriptors.h".
15231 (Output_file::open): Use open_descriptor rather than open.
15232 * archive.cc (Archive::const_iterator): Change Archive to be
15233 non-const.
15234 (Archive::begin, Archive::end): Make non-const.
15235 (Archive::count_members): Likewise.
15236 * archive.h (class Archive): Update declarations.
15237 * object.h (Object::read): Make non-const.
15238 * Makefile.am (CCFILES): Add descriptors.cc.
15239 (HFILES): Add descriptors.h.
15240 * Makefile.in: Rebuild.
15241
801647d1
ILT
15242 PR 6716
15243 * gold.h: Always include <clocale>. Add Solaris workarounds
15244 following code in binutils/sysdep.h.
15245
5edd166e
ILT
15246 PR 6048
15247 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
15248 this->eh_frame_hdr_ is NULL before using it.
15249
c89ad728
ILT
15250 * dynobj.cc (Versions::Versions): Update comment.
15251
aa86f06b
ILT
15252 * dynobj.cc (Versions::Versions): If there is an soname, use it as
15253 the base version name.
15254
5778530e
ILT
15255 * stringpool.cc (Stringpool_template::add_with_length): Set key to
15256 array size plus one.
15257 (Stringpool_template::set_string_offsets): Subtract one from key
15258 before using it as an array index.
15259 (Stringpool_template::get_offset_with_length): Likewise.
15260 (Stringpool_template::write_to_buffer): Likewise.
15261 * stringpool.h (Stringpool_template::get_offset_from_key):
15262 Likewise.
15263
057ead22
ILT
152642008-07-23 Ian Lance Taylor <iant@google.com>
15265
7f649c59
ILT
15266 PR 6658
15267 * object.h (Merged_symbol_value::value): Do our best to handle a
15268 negative addend.
15269
057ead22
ILT
15270 PR 6647
15271 * script.cc (Version_script_info::get_versions): Don't add empty
15272 version tag to return value.
15273 (Version_script_info::get_symbol_version_helper): Change return
15274 type to bool. Add pversion parameter. Change all callers.
15275 (script_register_vers_node): Don't require a non-NULL tag.
15276 * script.h (class Version_script_info): Update declarations.
15277 (Version_script_info::get_symbol_version): Change return type to
15278 bool. Add version parameter. Change all callers.
15279 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
15280 handling. Handle an empty version from a version script.
15281 (Symbol_table::define_special_symbol): Likewise.
15282 * testsuite/ver_test_10.script: New file.
15283 * testsuite/ver_test_10.sh: New file.
15284 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
15285 (check_DATA): Add ver_test_10.syms.
15286 (ver_test_10.syms, ver_test_10.so): New target.
15287 * testsuite/Makefile.in: Rebuild.
15288
58e54ac2
CD
152892008-07-23 Simon Baldwin <simonb@google.com>
15290
15291 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
15292 to zero for undefined symbols from dynamic libraries.
15293
95d14cd3
ILT
152942008-07-23 Ian Lance Taylor <iant@google.com>
15295
15296 * symtab.cc (Symbol_table::resolve): Remove version parameter.
15297 Change all callers.
15298 * symtab.h (class Symbol_table): Update declaration.
15299 * testsuite/ver_test_9.cc: New file.
15300 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
15301 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
15302 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
15303 (ver_test_9.so, ver_test_9.o): New targets.
15304 * testsuite/Makefile.in: Rebuild.
15305
92de84a6
ILT
153062008-07-22 Ian Lance Taylor <iant@google.com>
15307
34810851
ILT
15308 * options.h (class General_options): Define --check-sections.
15309 * layout.cc (Layout::set_segment_offsets): Handle
15310 --check-sections.
15311
af6156ef
ILT
15312 * options.h (class General_options): Define -n/--nmagic and
15313 -N/--omagic.
15314 * options.cc (General_options::finalize): For -n/--nmagic or
15315 -N/--omagic, set -static.
15316 * layout.cc (Layout::attach_allocated_section_to_segment): If
15317 -N/--omagic, don't put read-only and read-write sections in
15318 different segments.
15319 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
15320 finding a read-only segment.
15321 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
15322 don't set the minimum segment alignment to the common page size,
15323 and don't set the file offset to the address modulo the page size.
15324 * script-sections.cc (Script_sections::create_segments): If
15325 -n/--omagic, don't put read-only and read-write sections in
15326 different segments.
15327
92de84a6
ILT
15328 * cref.cc: New file.
15329 * cref.h: New file.
15330 * options.h (class General_options): Add --print-symbol-counts.
15331 * main.cc (main): Issue defined symbol report if requested.
15332 * archive.cc (Archive::interpret_header): Make into a const member
15333 function.
15334 (Archive::add_symbols): Call Input_objects::archive_start and
15335 archive_stop.
15336 (Archive::const_iterator): Define new class.
15337 (Archive::begin, Archive::end): New functions.
15338 (Archive::include_all_members): Rewrite to use iterator.
15339 (Archive::count_members): New function.
15340 * archive.h (class Archive): Update declarations.
15341 (Archive::filename): New function.
15342 * object.cc: Include "cref.h".
15343 (Sized_relobj::Sized_relobj): Initialize defined_count_.
15344 (Sized_relobj::do_get_global_symbol_counts): New function.
15345 (Input_objects::add_object): Add object to cross-referencer.
15346 (Input_objects::archive_start): New function.
15347 (Input_objects::archive_stop): New function.
15348 (Input_objects::print_symbol_counts): New function.
15349 * object.h: Declare Cref and Archive.
15350 (Object::get_global_symbol_counts): New function.
15351 (Object::do_get_global_symbol_counts): New pure virtual function.
15352 (class Sized_relobj): Add defined_count_ field. Update
15353 declarations.
15354 (class Input_objects): Add cref_ field. Update constructor.
15355 Update declarations.
15356 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
15357 defined_count_.
15358 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
15359 symbol counts.
15360 (Sized_dynobj::do_get_global_symbol_counts): New function.
15361 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
15362 defined_count_. Update declarations. Define Symbols typedef.
15363 * symtab.cc (Symbol_table::add_from_relobj): Add defined
15364 parameter. Change all callers.
15365 (Symbol_table::add_from_dynobj): Add sympointers and defined
15366 parameters. Change all callers.
15367 * symtab.h (class Symbol_table): Update declarations.
15368 * Makefile.am (CCFILES): Add cref.cc.
15369 (HFILES): Add cref.h.
15370 * Makefile.in: Rebuild.
15371
3f7c5e1d
CD
153722008-07-22 Simon Baldwin <simonb@google.com>
15373
15374 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
15375 to zero when writing undefined symbols.
15376
e0b64032
ILT
153772008-07-22 Ian Lance Taylor <iant@google.com>
15378
15379 * output.cc (Output_section::add_input_section): Don't try to
15380 merge empty merge sections.
15381
096b02cf
CS
153822008-07-21 Craig Silverstein <csilvers@google.com>
15383
15384 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15385 Include symbol version in error message.
cd536b21 15386
1d1f116d
CD
153872008-07-20 Chris Demetriou <cgd@google.com>
15388
cd536b21 15389 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
15390 (RANDOM_SEED_CFLAGS): New substituted variable.
15391 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
15392 * configure: Rebuild.
15393 * Makefile.in: Likewise.
15394 * testsuite/Makefile.in: Likewise.
15395
a18f591e
ILT
153962008-07-18 Ian Lance Taylor <iant@google.com>
15397
15398 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
15399 where we see NAME/NULL and NAME/VERSION as separate symbols.
15400 * testsuite/ver_test_main.cc (main): Call t4.
15401 (t4, t4_2a): Define.
15402 * testsuite/ver_test_2.cc (t4_2): Define.
15403 * testsuite/ver_test_2.script: Put t4_2a in VER2.
15404 * testsuite/ver_test_4.cc (t4_2a): Define.
15405 * testsuite/ver_test_4.script: Put t4_2a in VER2.
15406 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
15407
c6e3f6ed
ILT
154082008-07-17 Ian Lance Taylor <iant@google.com>
15409
15410 * dynobj.cc (Versions::add_def): If we give an error about a
15411 missing version, go ahead and create the version anyhow.
15412
ef9beddf
ILT
154132008-07-10 Ian Lance Taylor <iant@google.com>
15414
15415 Handle output sections with more than 0x7fffffff bytes.
15416 * object.h (class Relobj): Change map_to_output_ to
15417 output_sections_, and just keep a section pointer. Change all
15418 uses. Move comdat group support to Sized_relobj.
15419 (Relobj::is_section_specially_mapped): Remove.
15420 (Relobj::output_section): Remove poff parameter. Change all
15421 callers.
15422 (Relobj::output_section_offset): New function.
15423 (Relobj::set_section_offset): Rewrite.
15424 (Relobj::map_to_output): Remove.
15425 (Relobj::output_sections): New function.
15426 (Relobj::do_output_section_offset): New pure virtual function.
15427 (Relobj::do_set_section_offset): Likewise.
15428 (class Sized_relobj): Add section_offsets_ field. Add comdat
15429 group support from Relobj. Update declarations.
15430 (Sized_relobj::get_output_section_offset): New function.
15431 (Sized_relobj::do_output_section_offset): New function.
15432 (Sized_relobj::do_set_section_offset): New function.
15433 * object.cc (Relobj::output_section_address): Remove.
15434 (Sized_relobj::Sized_relobj): Initialize new fields.
15435 (Sized_relobj::include_section_group): Cast find_kept_object to
15436 Sized_relobj.
15437 (Sized_relobj::include_linkonce_section): Likewise.
15438 (Sized_relobj::do_layout): Use separate arrays for output section
15439 and output offset.
15440 (Sized_relobj::do_count_local_symbols): Change map_to_output to
15441 output_sections.
15442 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
15443 output_sections and section_offsets.
15444 (Sized_relobj::write_local_symbols): Likewise.
15445 (map_to_kept_section): Compute output address directly.
15446 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
15447 output_sections and section_offsets.
15448 (Sized_relobj::write_sections): Likewise.
15449 (Sized_relobj::relocate_sections): Likewise.
15450 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
15451 * output.h (class Output_reloc): Update declarations. Change
15452 u2_.relobj to Sized_relobj*.
15453 (class Output_data_reloc): Change add functions to use
15454 Sized_relobj*.
15455 * output.cc (Output_reloc::Output_reloc): Change relobj to
15456 Sized_relobj*.
15457 (Output_reloc::local_section_offset): Change return type to
15458 Elf_Addr. Use get_output_section_offset.
15459 (Output_reloc::get_address): Likewise.
15460 (Output_section::is_input_address_mapped): Don't call
15461 is_section_specially_mapped.
15462 (Output_section::output_offset): Likewise.
15463 (Output_section::output_address): Likewise.
15464 (Output_section::starting_output_address): Likewise.
15465 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
15466 parameter to Sized_relobj*.
15467 (Copy_relocs::need_copy_reloc): Likewise.
15468 (Copy_relocs::save): Likewise.
15469 * copy-relocs.h (class Copy_relocs): Update declarations.
15470 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
15471 Sized_relobj*. Change relobj_ field to Sized_relobj*.
15472 * target-reloc.h (relocate_for_relocatable): Change
15473 offset_in_output_section type to Elf_Addr. Change code that uses
15474 it as well.
15475 * layout.cc (Layout::layout): Always set *off.
15476 * mapfile.cc (Mapfile::print_input_section): Use
15477 output_section_offset.
15478 * i386.cc (Target_i386::copy_reloc): Change object parameter to
15479 Sized_relobj*.
15480 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
15481 * sparc.cc (Target_sparc::copy_reloc): Likewise.
15482 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
15483
5cb66f97
ILT
154842008-07-03 Ian Lance Taylor <iant@google.com>
15485
15486 * layout.cc (Layout::include_section): Do not discard unrecognized
15487 SHT_STRTAB sections.
15488
afe47622
CS
154892008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
15490
15491 * script.cc (Lex::can_continue_name): Make '?' allowable in
15492 version-script names.
15493 * testsuite/version_script.map: Change glob pattern to use '?'
15494
5adf9721
ILT
154952008-06-30 Manish Singh <yosh@gimp.org>
15496
15497 PR 6585
15498 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
15499 Correct typo.
15500
e6fde208
ILT
155012008-06-30 Ian Lance Taylor <iant@google.com>
15502
15503 PR 6660
15504 PR 6682
15505 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
15506 versions]: Don't try to read the value in the contents, since we
15507 don't use it. Use the template endianness when writing.
15508
3f2e6a2d
CC
155092008-06-25 Cary Coutant <ccoutant@google.com>
15510
15511 * fileread.cc (File_read::make_view): Assert on zero-length view.
15512 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
15513 symbol table when there are no symbols to read.
15514
c43d3a48
CS
155152008-06-23 Craig Silverstein <csilvers@google.com>
15516
15517 * version.cc (version_string): Bump to 1.7
15518
5f494ea0
CS
155192008-06-18 Craig Silverstein <csilvers@google.com>
15520
15521 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
15522 constant 0xFFFF to type Valtype.
15523 (Powerpc_relocate_functions::rel16_ha): Likewise.
15524
c42e122e
ILT
155252008-06-17 Ian Lance Taylor <iant@google.com>
15526
f34787f8
ILT
15527 * output.h (Output_section::Input_section): Initialize p2align_ to
15528 zero for Output_section_data constructors.
15529 (Output_section::Input_section::addralign): If not an input
15530 section, return the alignment of the Output_section_data.
15531 * testsuite/copy_test.cc: New file.
15532 * testsuite/copy_test_1.cc: New file.
15533 * testsuite/copy_test_2.cc: New file.
15534 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
15535 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
15536 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
15537 (copy_test_1_pic.o, copy_test_1.so): New targets.
15538 (copy_test_2_pic.o, copy_test_2.so): New targets.
15539 * testsuite/Makefile.in: Rebuild.
15540
c42e122e
ILT
15541 * script-sections.cc (Script_sections::place_orphan): Initialize
15542 local variable exact.
15543
ce3ac18a
DE
155442008-06-13 David Edelsohn <edelsohn@gnu.org>
15545
15546 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
15547
42cacb20
DE
155482008-06-12 David Edelsohn <edelsohn@gnu.org>
15549 David S. Miller <davem@davemloft.net>
15550
15551 * powerpc.cc: New file.
15552 * Makefile.am (TARGETSOURCES): Add powerpc.cc
15553 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
15554 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
15555 * Makefile.in: Rebuild.
15556
7b308235
ILT
155572008-06-09 Ian Lance Taylor <iant@google.com>
15558
15559 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
15560 <exception>.
15561 (throwing, orig_terminate): New static variables.
15562 (terminate_handler): New static function.
15563 (t2): Set terminate handler.
15564
f0b886e3
ILT
155652008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
15566
15567 PR 6584
cd536b21 15568 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
15569 alignment.
15570
3e90f135
CC
155712008-05-30 Cary Coutant <ccoutant@google.com>
15572
15573 * archive.cc (Archive::include_all_members) Correct to step
15574 over symbol table and extended name table in thin archives.
15575
e09ad04a
ILT
155762008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
15577
15578 PR 6407
15579 * target-reloc.h (relocate_for_relocatable): Fix new_offset
15580 calculation.
15581
62b01cb5
ILT
155822008-05-28 Caleb Howe <cshowe@google.com>
15583
15584 * reduced_debug_output.cc: New file.
15585 * reduced_debug_output.h: New file.
92de84a6 15586 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
15587 * options.cc (General_options::finalize): Add strip_debug_non_line
15588 to the strip heirarchy.
15589 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
15590 fields.
15591 * layout.cc: Include "reduced_debug_output.h".
15592 (Layout::Layout): Initialize new fields.
15593 (line_only_debug_sections): New static array.
15594 (is_lines_only_debug_sections): New static inline function.
15595 (Layout::include_section): Handle --strip-debug-non-line.
15596 (Layout::make_output_section): If --strip-debug-non-line, build
15597 new output sections for .debug_abbrev and .debug_info.
15598 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
15599 gold. Warn about possible overflow.
15600 (read_signed_LEB_128): Likewise.
15601 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
15602 (read_signed_LEB_128): Declare.
15603 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
15604 (HFILES): Add reduced_debug_output.h.
15605 * Makefile.in: Rebuild.
15606
7d9e3d98
ILT
156072008-05-21 Ian Lance Taylor <iant@google.com>
15608
15609 * mapfile.cc: New file.
15610 * mapfile.h: New file.
15611 * options.h (class General_options): Add -M/--print-map and -Map.
15612 * options.cc (General_options::finalize): Make -M equivalent to
15613 -Map -.
15614 * main.cc: Include <cstdio> and "mapfile.h".
15615 (main): Open mapfile if requested.
15616 * gold.cc (class Middle_runner): Add mapfile_ field. Update
15617 constructor. Change caller.
15618 (queue_initial_tasks): Add mapfile parameter. Change caller.
15619 (queue_middle_tasks): Likewise.
15620 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
15621 declarations.
15622 * archive.cc: Include "mapfile.h".
15623 (Archive::add_symbols): Add mapfile parameter. Change all
15624 callers. Pass mapfile, symbol, and reason to include_member.
15625 (Archive::include_all_members): Add mapfile parameter. Change all
15626 callers.
15627 (Archive::include_member): Add mapfile, sym, and why parameters.
15628 Change all callers. Report inclusion to map file.
15629 * archive.h: Include "fileread.h".
15630 (class Archive): Update declarations.
15631 (Archive::file): New const method.
15632 (class Add_archive_symbols): Add mapfile_ field. Update
15633 constructor. Change all callers.
15634 * readsyms.h (class Read_symbols): Likewise.
15635 (class Finish_group): Likewise.
15636 (class Read_script): Likewise.
15637 * common.cc: Include "mapfile.h".
15638 (Symbol_table::allocate_commons): Add mapfile parameter. Change
15639 all callers.
15640 (Symbol_table::do_allocate_commons): Likewise.
15641 (Symbol_table::do_allocate_commons_list): Likewise. Report common
15642 symbol allocation to mapfile.
15643 * common.h (class Allocate_commons_task): Add mapfile_ field.
15644 Update constructor. Change all callers.
15645 * symtab.h (class Symbol_table): Update declarations.
15646 * layout.cc: Include "mapfile.h".
15647 (Layout_task_runner::run): Print information to mapfile.
15648 (Layout::create_gold_note): Change Output_data_fixed_space to
15649 Output_data_zero_fill.
15650 (Layout::create_build_id): Likewise.
15651 (Layout::print_to_mapfile): New function.
15652 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
15653 constructor. Change caller.
15654 (class Layout): Declare print_to_mapfile.
15655 * output.cc (Output_section::Input_section::print_to_mapfile): New
15656 function.
15657 (Output_section::add_input_section): If producing a map, always
15658 add to input_sections_ list.
15659 (Output_section::do_print_to_mapfile): New function.
15660 (Output_segment::print_sections_to_mapfile): New function.
15661 (Output_segment::print_section_list_to_mapfile): New function.
15662 * output.h: Include "mapfile.h".
15663 (Output_data::print_to_mapfile): New function.
15664 (Output_data::do_print_to_mapfile): New virtual function.
15665 (Output_segment_headers::do_print_to_mapfile): New function.
15666 (Output_file_header::do_print_to_mapfile): New function.
15667 (Output_data_const::do_print_to_mapfile): New function.
15668 (class Output_data_const_buffer): Add map_name_ field. Update
15669 constructor. Change all callers. Add do_print_to_mapfile
15670 function.
15671 (class Output_data_fixed_space): Likewise.
15672 (class Output_data_space): Likewise.
15673 (class Output_data_zero_fill): New class.
15674 (Output_data_strtab::do_print_to_mapfile): New function.
15675 (Output_data_reloc_base::do_print_to_mapfile): New function.
15676 (Output_relocatable_relocs::do_print_to_mapfile): New function.
15677 (Output_data_group::do_print_to_mapfile): New function.
15678 (Output_data_got::do_print_to_mapfile): New function.
15679 (Output_data_dynamic::do_print_to_mapfile): New function.
15680 (Output_symtab_xindex::do_print_to_mapfile): New function.
15681 (class Output_section): Declare do_print_to_mapflie. Declare
15682 print_to_mapfile in Input_section.
15683 (class Output_segment): Declare new functions.
15684 * object.h (Sized_relobj::symbol_count): New function.
15685 * script-sections.cc
15686 (Output_section_element_dot_assignment::set_section_addresses):
15687 Change Output_data_fixed_space to Output_data_zero_fill.
15688 (Output_data_expression::do_print_to_mapfile): New function.
15689 * script.cc (read_input_script): Add mapfile parameter. Change
15690 all callers.
15691 * script.h (read_input_script): Update declaration.
15692 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
15693 (Eh_frame::do_print_to_mapfile): New function.
15694 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
15695 (Output_merge_string::do_print_to_mapfile): New function.
15696 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
15697 function.
15698 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
15699 function.
15700 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
15701 function.
15702 * Makefile.am (CCFILES): Add mapfile.cc.
15703 (HFILES): Add mapfile.h.
15704 * Makefile.in: Rebuild.
15705
9f1d377b
ILT
157062008-05-19 Ian Lance Taylor <iant@google.com>
15707
15708 * options.h (class General_options): Add -z relro.
15709 * layout.cc (Layout::Layout): Initialize relro_segment_.
15710 (Layout::add_output_section_data): Return the output section.
15711 (Layout::make_output_section): Rcognize relro sections and mark
15712 them appropriately.
15713 (Layout::attach_allocated_section_to_segment): Put relro sections
15714 in a PT_GNU_RELRO segment.
15715 (Layout::create_initial_dynamic_sections): Mark the .dynamic
15716 section as relro.
15717 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
15718 PT_TLS segments.
15719 (Layout::linkonce_mapping): Map d.rel.ro.local to
15720 .data.rel.ro.local.
15721 (Layout::output_section_name): Us .data.rel.ro.local for any
15722 section which begins with that.
15723 * layout.h (class Layout): Update add_output_section_data
15724 declaration. Add relro_segment_ field.
15725 * output.cc (Output_section::Output_section): Initialize is_relro_
15726 and is_relro_local_ fields.
15727 (Output_segment::add_output_section): Group relro sections.
15728 (Output_segment::is_first_section_relro): New function.
15729 (Output_segment::maximum_alignment): If there is a relro section,
15730 align the segment to the common page size.
15731 (Output_segment::set_section_addresses): Track whether we are
15732 looking at relro sections. If the last section is a relro
15733 section, align to the common page size.
15734 (Output_segment::set_section_list_addresses): Add in_relro
15735 parameter. Change all callers. Align to the page size when
15736 moving from relro to non-relro section.
15737 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
15738 segment.
15739 * output.h (class Output_section): Add is_relro_ and
15740 is_relro_local_ fields.
15741 (Output_section::is_relro): New function.
15742 (Output_section::set_is_relro): New function.
15743 (Output_section::is_relro_local): New function.
15744 (Output_section::set_is_relro_local): New function.
15745 (class Output_segment): Update declarations.
15746 * i386.cc (Target_i386::got_section): Mark .got section as relro.
15747 * sparc.cc (Target_sparc::got_section): Likewise.
15748 * x86_64.cc (Target_x86_64::got_section): Likewise.
15749 * testsuite/relro_test_main.cc: New file.
15750 * testsuite/relro_test.cc: New file.
15751 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
15752 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
15753 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
15754 (relro_test.so, relro_test_pic.o): New targets.
15755 * testsuite/Makefile.in: Rebuild.
15756
a984ee1d
ILT
157572008-05-16 Ian Lance Taylor <iant@google.com>
15758
01676dcd
ILT
15759 * output.cc (Output_segment::add_output_section): Remove front
15760 parameter.
15761 * output.h (class Output_segment): Remove
15762 add_initial_output_section and overloaded add_output_section.
15763 Update declaration of remaining add_output_section.
15764 * layout.cc (Layout::create_interp): Call add_output_section
15765 rather than add_initial_output_section.
15766 (Layout::finish_dynamic_section): Likewise.
15767
497897f9
ILT
15768 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
15769 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
15770 know the dynamic type.
15771 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
15772 field. Initialize it in constructor.
15773 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
15774 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
15775 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
15776 reloc.
15777
a984ee1d
ILT
15778 * output.cc (Output_reloc::get_address): Change return type to
15779 Elf_Addr.
15780 * output.h (class Output_reloc): Update get_address declaration.
15781 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
15782 for section addresses.
15783
55ba0940
ILT
157842008-05-09 Ian Lance Taylor <iant@google.com>
15785
15786 PR 6493
15787 * gold.cc (gold_nomem): Use return value of write.
15788
75517b77
ILT
157892008-05-08 Ian Lance Taylor <iant@google.com>
15790
15791 * symtab.c (Symbol::init_base_output_data): Add version
15792 parameter. Change all callers.
15793 (Symbol::init_base_output_segment): Likewise.
15794 (Symbol::init_base_constant): Likewise.
15795 (Symbol::init_base_undefined): Likewise.
15796 (Sized_symbol::init_output_data): Likewise.
15797 (Sized_symbol::init_output_segment): Likewise.
15798 (Sized_symbol::init_constant): Likewise.
15799 (Sized_symbol::init_undefined): Likewise.
15800 (Symbol_table::do_define_in_output_data): If the new symbol has a
15801 version, mark it as the default.
15802 (Symbol_table::do_define_in_output_segment): Likewise.
15803 (Symbol_table::do_define_as_constant): Likewise.
15804 * symtab.h (class Symbol): Update declarations.
15805 (class Sized_symbol): Likewise.
15806 * resolve.cc (Symbol::override_version): New function.
c42e122e 15807 (Symbol::override_base): Call override_version.
75517b77
ILT
15808 (Symbol::override_base_with_special): Likewise.
15809 * testsuite/ver_script_8.script: New file.
15810 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
15811 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
15812 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
15813 (ver_test_8_1.so, ver_test_8_2.so): New targets.
15814
f1f70eae
ILT
158152008-05-06 Ian Lance Taylor <iant@google.com>
15816
f3e9c5c5
ILT
15817 PR 6049
15818 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
15819 functions.
15820 (class General_options): Remove existing --undefined, and add
15821 --no-undefined instead. Add new --undefined as synonym for -u.
15822 * archive.cc (Archive::add_symbols): Check whether symbol was
15823 named with -u.
15824 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
15825 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
15826 all uses. Add IS_UNDEFINED. Update declarations to split
15827 different versions of init_base. Declare init_base_undefined.
15828 (Symbol::is_defined): Handle IS_UNDEFINED.
15829 (Symbol::is_undefined): Likewise.
15830 (Symbol::is_weak_undefined): Call is_undefined.
15831 (Symbol::is_absolute): Handle IS_CONSTANT.
15832 (class Sized_symbol): Update declarations to split different
15833 versions of init. Declare init_undefined.
15834 (class Symbol_table): Declare new functions.
15835 * symtab.cc (Symbol::init_base_object): Rename from init_base.
15836 Change all callers.
15837 (Symbol::init_base_output_data): Likewise.
15838 (Symbol::init_base_output_segment): Likewise.
15839 (Symbol::init_base_constant): Likewise.
15840 (Symbol::init_base_undefined): New function.
15841 (Sized_symbol::init_object): Rename from init. Change all
15842 callers.
15843 (Sized_symbol::init_output_data): Likewise.
15844 (Sized_symbol::init_output_segment): Likewise.
15845 (Sized_symbol::init_constant): Likewise.
15846 (Sized_symbol::init_undefined): New function.
15847 (Symbol_table::add_undefined_symbols_from_command_line): New
15848 function.
15849 (Symbol_table::do_add_undefined_symbols_from_command_line): New
15850 function.
15851 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
15852 (Symbol::output_section): Likewise.
15853 (Symbol::set_output_section): Likewise.
15854 (Symbol_table::sized_finalize_symbol): Likewise.
15855 (Symbol_table::sized_write_globals): Likewise.
15856 * resolve.cc (Symbol_table::should_override): Likewise.
15857 (Symbol::override_base_with_special): Likewise.
15858
8bdcdf2c
ILT
15859 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
15860 symbol, change it to have default visibility.
15861 * testsuite/protected_1.cc: New file.
15862 * testsuite/protected_2.cc: New file.
15863 * testsuite/protected_3.cc: New file.
15864 * testsuite/protected_main_1.cc: New file.
15865 * testsuite/protected_main_2.cc: New file.
15866 * testsuite/protected_main_3.cc: New file.
15867 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
15868 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
15869 (protected_1_LDFLAGS, protected_1_LDADD): Define.
15870 (protected_1.so): New target.
15871 (protected_1_pic.o, protected_2_pic.o): New targets.
15872 (protected_3_pic.o): New target.
15873 (check_PROGRAMS): Add protected_2.
15874 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
15875 (protected_2_LDFLAGS, protected_2_LDADD): Define.
15876 * testsuite/Makefile.in: Rebuild.
15877
2b706932
ILT
15878 * options.h (DEFINE_var): Add set_user_set_##varname__.
15879 (DEFINE_bool_alias): New macro.
15880 (class General_options): Define -Bstatic using DEFINE_bool_alias
15881 rather than DEFINE_special. Add --undefined as an alias for -z
15882 defs.
15883 * options.cc (General_options::parse_Bstatic): Remove.
15884
d82a5bcc
ILT
15885 * options.h (class General_options): Add --fatal-warnings.
15886 * main.cc (main): Implement --fatal-warnings.
15887 * errors.h (Errors::warning_count): New function.
15888
f1f70eae
ILT
15889 * options.h (class General_options): Add -Bsymbolic-functions.
15890 * symtab.h (Symbol::is_preemptible): Check for
15891 -Bsymbolic-functions.
15892
8825ac63
ILT
158932008-05-05 Ian Lance Taylor <iant@google.com>
15894
d98bc257
ILT
15895 * options.h (DEFINE_bool): For DASH_Z, create the negative option
15896 as noVARNAME rather than no-VARNAME.
15897 (class General_options): Add option -z combreloc.
15898 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
15899 get_address.
15900 (Output_reloc::sort_before) [SHT_REL]: New function.
15901 (Output_reloc::sort_before) [SHT_RELA]: New function.
15902 (class Output_data_reloc_base): Add sort_relocs_ field. Define
15903 Sort_relocs_comparison.
15904 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
15905 parameter. Change all callers.
15906 (Output_data_reloc::Output_data_reloc) [both versions]: Add
15907 sort_relocs parameter. Change all callers.
15908 * output.cc (Output_reloc::get_address): New function, broken out
15909 of write_rel.
15910 (Output_reloc::write_rel): Call it.
15911 (Output_reloc::compare): New function.
15912 (Output_data_reloc_base::do_write): Optionally sort relocs.
15913
60b2b4e7
ILT
15914 * configure.ac: If targ_extra_obj is set, link it in.
15915 * configure.tgt: Initialize all variables.
15916 (x86_64*): Set targ_extra_obj and targ_extra_size.
15917 * configure: Rebuild.
15918
8825ac63
ILT
15919 * object.cc (Sized_relobj::include_section_group): Adjust section
15920 indexes read from group data. Build vector to pass to
15921 layout_group.
15922 * layout.cc (Layout::layout_group): Add flags and shndxes
15923 parameters. Remove contents parameter. Change caller. Update
15924 explicit instantiations.
15925 * layout.h (class Layout): Update layout_group declaration.
15926 * output.cc (Output_data_group::Output_data_group): Add flags and
15927 input_shndxes parameters. Remove contents parameter. Change
15928 caller.
15929 (Output_data_group::do_write): Change input_sections_ to
15930 input_shndxes_.
15931 * output.h (class Output_data_group): Update constructor
15932 declaration. Rename input_sections_ to input_shndxes_.
15933 * testsuite/many_sections_test.cc: Add template.
15934
e94cf127
CC
159352008-04-30 Cary Coutant <ccoutant@google.com>
15936
4418b2d5
CC
15937 * target-reloc.h (relocate_section): Fix dead-pointer bug.
15938
e94cf127
CC
15939 * layout.cc (Layout::include_section): Refactored check for debug
15940 info section.
15941 (Layout::add_comdat): Add new parameters. Change type
15942 of signature parameter. Add object and shndx to signatures table.
15943 (Layout::find_kept_object): New function.
15944 * layout.h: Include <cstring>.
15945 (Layout::is_debug_info_section): New function.
15946 (Layout::add_comdat): Add new parameters.
15947 (Layout::find_kept_object): New function.
15948 (Layout::Kept_section): New struct.
15949 (Layout::Signatures): Change type of map range.
15950 * object.cc (Relobj::output_section_address): New function.
15951 (Sized_relobj::include_section_group): Add new parameters. Change
15952 calls to Layout::add_comdat. Change to build table of kept comdat
15953 groups and table mapping discarded sections to kept sections.
15954 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
15955 (Sized_relobj::do_layout): Change calls to include_section_group and
15956 include_linkonce_section.
15957 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
15958 value to zero when section is discarded.
15959 (Sized_relobj::map_to_kept_section): New function.
15960 * object.h (Relobj::output_section_address): New function.
15961 (Relobj::Comdat_group): New type.
15962 (Relobj::find_comdat_group): New function.
15963 (Relobj::Comdat_group_table): New type.
15964 (Relobj::Kept_comdat_section): New type.
15965 (Relobj::Kept_comdat_section_table): New type.
15966 (Relobj::add_comdat_group): New function.
15967 (Relobj::set_kept_comdat_section): New function.
15968 (Relobj::get_kept_comdat_section): New function.
15969 (Relobj::comdat_groups_): New field.
15970 (Relobj::kept_comdat_sections_): New field.
15971 (Symbol_value::input_value): Update comment.
15972 (Sized_relobj::map_to_kept_section) New function.
15973 (Sized_relobj::include_linkonce_section): Add new parameter.
15974 * target-reloc.h (Comdat_behavior): New type.
15975 (get_comdat_behavior): New function.
15976 (relocate_section): Add code to map a discarded section to the
15977 corresponding kept section when applying a relocation.
15978
e4e5049b
CS
159792008-04-30 Craig Silverstein <csilvers@google.com>
15980
15981 * dwarf_reader.cc (next_generation_count): New static var.
15982 (Addr2line_cache_entry): New struct.
15983 (addr2line_cache): New static var.
15984 (Dwarf_line_info::one_addr2line): Added caching.
15985 (Dwarf_line_info::clear_addr2line_cache): New function.
15986 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
15987 cache-size parameter.
15988 (Dwarf_line_info::one_addr2line_cache): New function.
15989 * symtab.cc (Symbol_table::detect_odr_violations): Pass
15990 new cache-size argument to one_addr2line(), and clear cache.
15991
d09e9154
CC
159922008-04-28 Cary Coutant <ccoutant@google.com>
15993
15994 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
15995 R_386_PC8 relocations.
15996
7ef73768
ILT
159972008-04-23 Ian Lance Taylor <iant@google.com>
15998
55438702
ILT
15999 * object.cc (Sized_relobj::include_section_group): Check for
16000 invalid section group.
16001
c165fb93
ILT
16002 * object.cc (make_elf_object): Correct test for 64-bit ELF file
16003 header size.
16004
7ef73768
ILT
16005 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
16006 than read for file header.
16007 * archive.cc (Archive::include_member): Likewise.
16008
6194aaab
L
160092008-04-23 Paolo Bonzini <bonzini@gnu.org>
16010
16011 * aclocal.m4: Regenerate.
16012 * configure: Regenerate.
16013
d491d34e
ILT
160142008-04-19 Ian Lance Taylor <iant@google.com>
16015
5ea2bac6
ILT
16016 * version.cc (version_string): Bump to 1.6.
16017
7bc3e21a
ILT
16018 * testsuite/Makefile.am (many_sections_r_test): New target.
16019 (many_sections_r_test_SOURCES): Remove.
16020 (many_sections_r_test_DEPENDENCIES): Remove.
16021 (many_sections_r_test_LDFLAGS): Remove.
16022 (many_sections_r_test_LDADD): Remove.
16023
7fcd3aa9
ILT
16024 * object.cc (Sized_relobj::do_add_symbols): Always pass
16025 local_symbol_count_ to add_from_relobj.
16026
4c94d6ae
ILT
16027 * testsuite/Makefile.am (many_sections_check.h): Only check one in
16028 every thousand variables.
16029 * testsuite/Makefile.in: Rebuild.
16030
d491d34e
ILT
16031 * object.cc (Xindex::initialize_symtab_xindex): New function.
16032 (Xindex::read_symtab_xindex): New function.
16033 (Xindex::sym_xindex_to_shndx): New function.
16034 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
16035 available.
16036 (Sized_relobj::do_initialize_xindex): New function.
16037 (Sized_relobj::do_read_symbols): Adjust section links.
16038 (Sized_relobj::symbol_section_and_value): Add is_ordinary
16039 parameter. Change all callers.
16040 (Sized_relobj::include_section_group): Adjust section links and
16041 symbol section indexes.
16042 (Sized_relobj::do_layout): Adjust section links.
16043 (Sized_relobj::do_count_local_symbols): Adjust section links and
16044 symbol section indexes.
16045 (Sized_relobj::do_finalize_local_symbols): Distinguish between
16046 ordinary and special symbols.
16047 (Sized_relobj::write_local_symbols): Add symtab_xindex and
16048 dynsym_xindex parameters. Change all callers. Adjust section
16049 links. Use SHN_XINDEX when needed.
16050 (Sized_relobj::get_symbol_location_info): Adjust section links.
16051 Don't get fooled by special symbols.
16052 * object.h (class Xindex): Define.
16053 (class Object): Add xindex_ parameter. Declare virtual functoin
16054 do_initialize_xindex.
16055 (Object::adjust_sym_shndx): New function.
16056 (Object::set_xindex): New protected function.
16057 (class Symbol_value): Add is_ordinary_shndx_ field.
16058 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
16059 (Symbol_value::value): Assert ordinary section.
16060 (Symbol_value::initialize_input_to_output_map): Likewise.
16061 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
16062 Change all callers.
16063 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
16064 all callers.
16065 (class Sized_relobj): Update declarations.
16066 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
16067 parameter. Change all callers.
16068 (Sized_relobj::adjust_shndx): New function.
16069 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
16070 field.
16071 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
16072 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
16073 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
16074 (Sized_dynobj::read_dynsym_section): Adjust section links.
16075 (Sized_dynobj::read_dynamic): Likewise.
16076 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
16077 section links.
16078 (Sized_dynobj::do_initialize_xindex): New function.
16079 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
16080 do_initialize_xindex.
16081 (Sized_dynobj::adjust_shndx): New function.
16082 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
16083 dynsym_xindex_ fields.
16084 (Layout::finalize): Add a call to set_section_indexes before
16085 creating the symtab sections.
16086 (Layout::set_section_indexes): Don't do anything if the section
16087 already has a section index.
16088 (Layout::create_symtab_sections): Add shnum parameter. Change
16089 caller. Create .symtab_shndx section if needed.
16090 (Layout::create_shdrs): Add shstrtab_section parameter. Change
16091 caller.
16092 (Layout::allocated_output_section_count): New function.
16093 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
16094 needed.
16095 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
16096 fields. Update declarations.
16097 (Layout::symtab_xindex): New function.
16098 (Layout::dynsym_xindex): New function.
16099 (class Write_symbols_task): Add layout_ field.
16100 (Write_symbols_task::Write_symbols_task): Add layout parameter.
16101 Change caller.
16102 * output.cc (Output_section_headers::Output_section_headers): Add
16103 shstrtab_section parameter. Change all callers.
16104 (Output_section_headers::do_sized_write): Store overflow values
16105 for section count and section string table section index in
16106 section header zero.
16107 (Output_file_header::do_sized_write): Check for overflow of
16108 section count and section string table section index.
16109 (Output_symtab_xindex::do_write): New function.
16110 (Output_symtab_xindex::endian_do_write): New function.
16111 * output.h (class Output_section_headers): Add shstrtab_section_.
16112 Update declarations.
16113 (class Output_symtab_xindex): Define.
16114 (Output_section::has_out_shndx): New function.
16115 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
16116 field.
16117 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
16118 Change all callers.
16119 (Sized_symbol::init): Likewise.
16120 (Symbol::output_section): Check for ordinary symbol.
16121 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
16122 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
16123 callers.
16124 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
16125 Change all callers. Simplify handling of symbols from sections
16126 not included in the link.
16127 (Symbol_table::add_from_dynobj): Handle ordinary symbol
16128 distinction.
16129 (Weak_alias_sorter::operator()): Assert that symbols are
16130 ordinary.
16131 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
16132 distinction.
16133 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
16134 parameters. Change all callers.
16135 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
16136 symbol distinction. Use SHN_XINDEX when needed.
16137 (Symbol_table::write_section_symbol): Add symtab_xindex
16138 parameter. Change all callers.
16139 (Symbol_table::sized_write_section_symbol): Likewise. Use
16140 SHN_XINDEX when needed.
16141 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
16142 declarations.
16143 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
16144 (Symbol::is_defined): Check is_ordinary.
16145 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
16146 (Symbol::is_absolute, Symbol::is_common): Likewise.
16147 (class Sized_symbol): Update declarations.
16148 (class Symbol_table): Update declarations.
16149 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
16150 parameters. Change all callers.
16151 (Sized_symbol::override): Likewise.
16152 (Symbol_table::override): Likewise.
16153 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
16154 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
16155 is_ordinary, and orig_st_shndx parameters. Change all callers.
16156 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
16157 to be in an ordinary section.
16158 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
16159 object and is_ordinary parameters. Change all callers.
16160 (Sized_dwarf_line_info::read_relocs): Add object parameter.
16161 Change all callers. Don't add undefined or non-ordinary symbols
16162 to reloc_map_.
16163 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
16164 Change all callers.
16165 * dwarf_reader.h (class Sized_dwarf_line_info): Update
16166 declarations.
16167 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
16168 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
16169 (Sized_relobj::relocate_sections): Likewise.
16170 * target-reloc.h (scan_relocs): Adjust section symbol index.
16171 (scan_relocatable_relocs): Likewise.
16172 * i386.cc (Scan::local): Check for ordinary symbols.
16173 * sparc.cc (Scan::local): Likewise.
16174 * x86_64.cc (Scan::local): Likewise.
16175 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
16176 to symbol_section_and_value.
16177 * testsuite/many_sections_test.cc: New file.
16178 * testsuite/Makefile.am (BUILT_SOURCES): Define.
16179 (check_PROGRAMS): Add many_sections_test.
16180 (many_sections_test_SOURCES): Define.
16181 (many_sections_test_DEPENDENCIES): Define.
16182 (many_sections_test_LDFLAGS): Define.
16183 (BUILT_SOURCES): Add many_sections_define.h.
16184 (many_sections_define.h): New target.
16185 (BUILT_SOURCES): Add many_sections_check.h.
16186 (many_sections_check.h): New target.
16187 (check_PROGRAMS): Add many_sections_r_test.
16188 (many_sections_r_test_SOURCES): Define.
16189 (many_sections_r_test_DEPENDENCIES): Define.
16190 (many_sections_r_test_LDFLAGS): Define.
16191 (many_sections_r_test_LDADD): Define.
16192 (many_sections_r_test.o): New target.
16193 * testsuite/Makefile.in: Rebuild.
16194
c5818ff1
CC
161952008-04-17 Cary Coutant <ccoutant@google.com>
16196
16197 * errors.cc (Errors::info): New function.
16198 (gold_info): New function.
16199 * errors.h (Errors::info): New function.
16200 * gold.h (gold_info): New function.
16201 * object.cc (Input_objects::add_object): Print trace output.
16202 * options.cc (options::parse_set): New function.
16203 (General_options::parse_wrap): Deleted.
16204 (General_options::General_options): Deleted initializer.
16205 * options.h (options::String_set): New typedef.
16206 (options::parse_set): New function.
16207 (DEFINE_set): New macro.
16208 (General_options::wrap): Changed to use DEFINE_set. Changed
16209 callers of any_wrap_symbols and is_wrap_symbol.
16210 (General_options::trace, General_options::trace_symbol):
16211 New options.
16212 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
16213 (General_options::wrap_symbols_): Deleted.
16214 * symtab.cc (Symbol_table::add_from_object): Print trace output.
16215
b5be4a7c
DM
162162008-04-17 David S. Miller <davem@davemloft.net>
16217
16218 * options.cc (General_options::parse_V): New function.
16219 * options.h: Add entries for -V and -Qy.
16220
155a0dd7
ILT
162212008-04-17 Ian Lance Taylor <iant@google.com>
16222
16223 * common.cc (Symbol_table::allocate_commons): Remove options
16224 parameter. Change caller.
16225 (Symbol_table::do_allocate_commons): Remove options parameter.
16226 Change caller. Just call do_allocate_commons_list twice.
16227 (Symbol_table::do_allocate_commons_list): New function, broken out
16228 of do_allocate_commons.
16229 * common.h (class Allocate_commons_task): Remove options_ field.
16230 Update constructor.
16231 * symtab.cc (Symbol_table::Symbol_table): Initialize
16232 tls_commons_.
16233 (Symbol_table::add_from_object): Put TLS common symbols on
16234 tls_commons_ list.
16235 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
16236 which are IN_OUTPUT_DATA.
16237 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
16238 allocate_commons and do_allocate_commons declarations. Declare
16239 do_allocate_commons_list.
16240 * gold.cc (queue_middle_tasks): Update creation of
16241 Allocate_commons_task to not pass options.
16242 * testsuite/Makefile.am (INCLUDES): Add -I.. .
16243 (TLS_TEST_C_FLAGS): New variable.
16244 (tls_test_c_pic.o): New target.
16245 (tls_test_shared.so): Link in tls_test_c_pic.o.
16246 (tls_test_c_pic_ie.o): New target.
16247 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
16248 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
16249 (tls_test_c.o): New target.
16250 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
16251 (tls_pic_test_LDADD): Likewise.
16252 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
16253 (tls_shared_gd_to_ie_test_LDADD): Likewise.
16254 (tls_test_c_gnu2.o): New target.
16255 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
16256 tls_test_c_gnu2.o.
16257 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
16258 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
16259 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
16260 * testsuite/tls_test.cc: Include "config.h".
16261 (t_last): Call t11_last.
16262 * testsuite/tls_test.h (t11, t11_last): Declare.
16263 * testsuite/tls_test_c.c: New file.
16264 * testsuite/tls_test_main.cc (thread_routine): Call t11.
16265 * configure.ac: Check for OpenMP support.
16266 * configure, config.in, Makefile.in: Rebuild.
16267 * testsuite/Makefile.in: Rebuild.
16268
edfbb029
CC
162692008-04-16 Cary Coutant <ccoutant@google.com>
16270
16271 * i386.cc (Target_i386::define_tls_base_symbol): New function.
16272 (Target_i386::tls_base_symbol_defined_): New field.
16273 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16274 (Target_i386::Scan::global): Likewise.
16275 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
16276 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
16277 (Target_x86_64::tls_base_symbol_defined_): New field.
16278 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16279 (Target_x86_64::Scan::global): Likewise.
16280
f3c69fca
CC
162812008-04-16 Cary Coutant <ccoutant@google.com>
16282
16283 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
16284 (Symbol::needs_plt_entry): Allow weak undefined symbols.
16285 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
16286 building shared libraries.
16287 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
16288 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
16289 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
16290 * testsuite/Makefile.in: Rebuild.
16291 * testsuite/weak_undef.h: New file.
16292 * testsuite/weak_undef_file1.cc: Add extra test cases.
16293 * testsuite/weak_undef_file2.cc: Likewise.
16294 * testsuite/weak_undef_test.cc: Likewise.
16295
7c414435
DM
162962008-04-16 David S. Miller <davem@davemloft.net>
16297
32b769e1
DM
16298 * sparc.cc (Target_sparc::Scan): Change from struct to class.
16299 Add issued_non_pic_error_ field. Declare check_non_pic.
16300 (Target_sparc::Scan::check_non_pic): New function.
16301 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
16302 (Target_sparc::Scan::global): Likewise.
16303
11936fb1
DM
16304 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
16305 * configure: Rebuild.
16306
7c414435
DM
16307 * options.h (DEFINE_enable): New macro.
16308 (new_dtags): New enable option.
16309 (initfirst, interpose, loadfltr, nodefaultlib,
16310 nodelete, nodlopen, nodump): New -z options.
16311 * layout.cc (Layout:finish_dynamic_section): If new
16312 dtags enabled, emit DT_RUNPATH. Also, emit a
16313 DT_FLAGS_1 containing any specified -z flags.
16314
85c7bf8b
ILT
163152008-04-16 Ian Lance Taylor <iant@google.com>
16316
12c0daef
ILT
16317 * copy-relocs.cc: New file.
16318 * copy-relocs.h: New file.
16319 * reloc.cc: Remove Copy_relocs code.
16320 * reloc.h: Likewise.
16321 * reloc-types.h (struct Reloc_types) [both versions]: Add
16322 get_reloc_addend_noerror.
16323 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
16324 variants of add_global which take an addend which must be zero.
16325 * i386.cc: Include "copy-relocs.h".
16326 (class Target_i386): Change type of copy_relocs_ to variable,
16327 update initializer.
16328 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
16329 Change all callers.
16330 (Target_i386::do_finalize_sections): Change handling of
16331 copy_relocs_.
16332 * sparc.cc: Include "copy-relocs.h".
16333 (class Target_sparc): Change type of copy_relocs_ to variable,
16334 update initializer.
16335 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
16336 Change all callers.
16337 (Target_sparc::do_finalize_sections): Change handling of
16338 copy_relocs_.
16339 * x86_64.cc: Include "copy-relocs.h".
16340 (class Target_x86_64): Change type of copy_relocs_ to variable,
16341 update initializer.
16342 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
16343 class. Change all callers.
16344 (Target_x86_64::do_finalize_sections): Change handling of
16345 copy_relocs_.
16346 * Makefile.am (CCFILES): Add copy-relocs.cc.
16347 (HFILES): Add copy-relocs.h.
16348
4f4995b6
ILT
16349 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
16350
85c7bf8b
ILT
16351 * testsuite/script_test_4.sh: Permit leading zeroes.
16352
4f2a9edd
ILT
163532008-04-15 Ian Lance Taylor <iant@google.com>
16354
e6188289
ILT
16355 * script-sections.cc (Script_sections::create_segments): Use
16356 header_size_adjustment even when there is enough room for the
16357 headers.
16358 * testsuite/script_test_4.sh: New file.
16359 * testsuite/script_test_4.t: New file.
16360 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
16361 (check_DATA): Add script_test_4.stdout.
16362 (MOSTLYCLEANFILES): Likewise.
16363 (script_test_4): New target.
16364 (script_test_4.stdout): New target.
16365 * testsuite/Makefile.in: Rebuild.
16366
4f2a9edd
ILT
16367 * sparc.cc: Add definitions for Output_data_plt_sparc class
16368 constants.
16369
f5314dd5
DM
163702008-04-14 David S. Miller <davem@davemloft.net>
16371
16372 * sparc.cc: New file.
16373 * Makefile.am (TARGETSOURCES): Add sparc.cc
16374 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
16375 * configure.tgt: Document targ_extra_size and
16376 targ_extra_big_endian. Add entries for sparc-* and
16377 sparc64-*.
16378 * configure.ac: Handle targ_extra_size and
16379 targ_extra_big_endian.
16380 * Makefile.in: Rebuild.
16381 * configure: Likewise.
16382 * po/POTFILES.in: Likewise.
16383 * po/gold.pot: Likewise.
16384
154e0e9a
ILT
163852008-04-14 Ian Lance Taylor <iant@google.com>
16386
16387 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
16388 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
16389 in the name/type/flags to section mapping. Don't call
16390 allocate_output_section.
16391 (Layout::choose_output_section): Change parameter from adjust_name
16392 to is_input_section. Don't permit input sections after sections
16393 are attached to segments. Don't call allocate_output_section.
16394 (Layout::layout_eh_frame): Call update_flags_for_input_section,
16395 not write_enable_output_section.
16396 (Layout::make_output_section): Don't push to
16397 unattached_section_list_ nor call attach_to_segment. Call
16398 attach_section_to_segment if sections are attached.
16399 (Layout::attach_sections_to_segments): New function.
16400 (Layout::attach_section_to_segment): New function.
16401 (Layout::attach_allocated_section_to_segment): Rename from
16402 attach_to_segment. Remove flags parameter.
16403 (Layout::allocate_output_section): Remove function.
16404 (Layout::write_enable_output_section): Remove function.
16405 * layout.h (class Layout): Update for above changes. Add new
16406 field sections_are_attached_.
16407 * output.h (Output_section::update_flags_for_input_section): New
16408 function.
16409 * output.cc (Output_section::add_input_section): Call
16410 update_flags_for_input_section.
16411 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
16412
009a67a2
CC
164132008-04-11 Cary Coutant <ccoutant@google.com>
16414
16415 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
16416 thought unnecessary.
16417 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
16418
759b1a24
ILT
164192008-04-11 Ian Lance Taylor <iant@google.com>
16420
16421 * output.h (class Output_section_data): Remove inline definition
16422 of set_addralign.
16423 * output.cc (Output_section_data::set_addralign): New function.
16424
c2b45e22
CC
164252008-04-11 Cary Coutant <ccoutant@google.com>
16426
16427 Add support for TLS descriptors for i386 and x86_64.
16428 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
16429 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
16430 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
16431 GOT_TYPE_TLS_DESC.
16432 (Target_i386::got_mod_index_entry): Remove unnecessary code.
16433 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
16434 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
16435 relocations.
16436 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
16437 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
16438 Fix problem with initial-exec relocations.
16439 (Target_i386::Relocate::relocate_tls): Likewise.
16440 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
16441 relaxation.
16442 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
16443 support for section-plus-offset dynamic table entries.
16444 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
16445 (Output_data_dynamic::Dynamic_entry): Add support for
16446 section-plus-offset dynamic table entries.
16447 (Output_data_dynamic::Classification): Likewise.
16448 (Output_data_dynamic::classification_): Renamed offset_.
16449 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
16450 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
16451 (Target_x86_64::make_plt_section): New function.
16452 (Target_x86_64::reserve_tlsdesc_entries): New function.
16453 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
16454 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
16455 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
16456 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
16457 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
16458 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
16459 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
16460 add extra PLT entry for TLS descriptors.
16461 (Output_data_plt_x86_64::got_): New field.
16462 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
16463 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
16464 fields.
16465 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
16466 descriptors.
16467 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
16468 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
16469 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
16470 R_386_TLS_DESC_CALL relocations.
16471 (Target_x86_64::Scan::global): Likewise.
16472 (Target_x86_64::do_finalize_sections): Add dynamic table entries
16473 for TLS descriptors.
16474 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
16475 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
16476 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
16477 GD-to-IE relaxation.
16478 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
16479 and TLS_DESCRIPTORS.
16480 * Makefile.in: Rebuild.
16481 * configure: Rebuild.
16482 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
16483 (tls_test_shared2.so): New target.
16484 (tls_shared_gd_to_ie_test_SOURCES): New variable.
16485 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
16486 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
16487 (tls_shared_gd_to_ie_test_LDADD): New variable.
16488 (tls_shared_gnu2_gd_to_ie_test): New target.
16489 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
16490 New targets.
16491 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
16492 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
16493 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
16494 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
16495 (tls_shared_gnu2_test): New target.
16496 (tls_test_gnu2_shared.so): New target.
16497 (tls_shared_gnu2_test_SOURCES): New variable.
16498 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
16499 (tls_shared_gnu2_test_LDFLAGS): New variable.
16500 (tls_shared_gnu2_test_LDADD): New variable.
16501 * testsuite/Makefile.in: Rebuild.
16502 * testsuite/Makefile.
16503
83bfb6b7
ILT
165042008-04-11 Ian Lance Taylor <iant@google.com>
16505
16506 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
16507 justsyms.t.
16508 * testsuite/Makefile.in: Rebuild.
16509
16510 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
16511 long.
16512 * testsuite/script_test_2.cc (main): Adjust test.
16513
706e1f5e
ILT
165142008-04-11 David S. Miller <davem@davemloft.net>
16515 Ian Lance Taylor <iant@google.com>
16516
16517 * options.h (General_options): Add entries for '-Y' and
16518 '-relax'.
16519 * options.cc (General_options:finalize): If -Y was used, add those
16520 entries to the library path instead of the default "/lib" and
16521 "/usr/lib".
16522
7c98e6bb
DM
165232008-04-11 David S. Miller <davem@davemloft.net>
16524
16525 * testsuite/justsyms.t: Start at 0x100.
16526 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
16527 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
16528 long.
16529 * testsuite/script_test_2.cc: Adjust string and section length
16530 checks.
7c98e6bb 16531
99a37bfd
ILT
165322008-04-09 Ian Lance Taylor <iant@google.com>
16533
2cefc357
ILT
16534 PR gold/5996
16535 * script-sections.cc (Sections_element::allocate_to_segment): Add
16536 orphan parameter.
16537 (Output_section_definition::allocate_to_segment): Likewise.
16538 (Orphan_output_section::allocate_to_segment): Likewise.
16539 (Script_sections::attach_sections_using_phdrs_clause): Don't
16540 propagate non-PT_LOAD segments to orphan sections.
16541 * testsuite/Makefile.am (script_test_3.stdout): Generate using
16542 readelf rather than objdump.
16543 * testsuite/script_test_3.sh: Adjust accordingly. Test that
16544 .interp section and PT_INTERP segment are the same size.
16545 * testsuite/Makefile.in: Rebuild.
16546
99a37bfd
ILT
16547 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
16548 aliases for symbols defined in the same object.
16549 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
16550 (weak_alias_test_SOURCES): New variable.
16551 (weak_alias_test_DEPENDENCIES): New variable.
16552 (weak_alias_test_LDFLAGS): New variable.
16553 (weak_alias_test_LDADD): New variable.
16554 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
16555 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
16556 (weak_alias_test_3.o): New target.
16557 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
16558 * testsuite/weak_alias_test_main.cc: New file.
16559 * testsuite/weak_alias_test_1.cc: New file.
16560 * testsuite/weak_alias_test_2.cc: New file.
16561 * testsuite/weak_alias_test_3.cc: New file.
16562
780e49c5
ILT
165632008-04-08 Ian Lance Taylor <iant@google.com>
16564
cdb0b8f5
ILT
16565 * options.h (class General_options): Add --noinhibit-exec option.
16566 * main.cc (main): Check --noinhibit-exec.
16567
0864d551
ILT
16568 * options.h (class General_options): Define --wrap as a special
16569 option. Add wrap_symbols_ field.
16570 (General_options::any_wrap_symbols): New function.
16571 (General_options::is_wrap_symbol): New function.
16572 * options.cc (General_options::parse_wrap): New function.
16573 (General_options::General_options): Initialize wrap_symbols_.
16574 * symtab.cc (Symbol_table::wrap_symbol): New function.
16575 (Symbol_table::add_from_object): Handle --wrap.
16576 * symtab.h (class Symbol_table): Declare wrap_symbol.
16577 * target.h (Target::wrap_char): New function.
16578 (Target::Target_info): Add wrap_char field.
16579 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
16580 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
16581 * testsuite/testfile.cc (Target_test::test_target_info):
16582 Likewise.
16583
789aa6de
ILT
16584 * errors.cc (Errors::undefined_symbol): Mention symbol version if
16585 there is one.
16586
2c38906f
ILT
16587 * layout.h (class Layout): Add added_eh_frame_data_ field.
16588 * layout.cc (Layout::Layout): Initialize new field.
16589 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
16590 output section until we find a section we merged successfully.
16591 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
16592 that the size be non-zero.
16593
780e49c5
ILT
16594 * merge.cc (Object_merge_map::get_output_offset): Remove inline
16595 qualifier.
16596
7fcd0256
ILT
165972008-04-08 Craig Silverstein <csilvers@google.com>
16598
16599 * configure.ac: Export new conditional variable HAVE_ZLIB.
16600 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
16601 on HAVE_ZLIB.
16602 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
16603 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16604
6835af53
ILT
166052008-04-07 Ian Lance Taylor <iant@google.com>
16606
e24f324c
ILT
16607 * version.cc (version_string): Set to "1.5".
16608
a036edd8
ILT
16609 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
16610 Add issued_non_pic_error_ field. Declare check_non_pic.
16611 (Target_x86_64::Scan::check_non_pic): New function.
16612 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
16613 (Target_x86_64::Scan::global): Likewise.
16614
624f8810
ILT
16615 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
16616 addend parameter. Change caller. Handle merge sections.
16617 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
16618 Address to Addend. Don't add in the result of
16619 local_section_offset, pass down the addend and use the returned
16620 value.
16621 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
16622 Update declarations of local_section_offset and symbol_value.
16623 * testsuite/two_file_test_1.cc (t18): New function.
16624 * testsuite/two_file_test_2.cc (f18): New function.
16625 * testsuite/two_file_test_main.cc (main): Call t18.
16626 * testsuite/two_file_test.h (t18, f18): Declare.
16627
6835af53
ILT
16628 * configure.ac: Don't test for objdump, c++filt, or readelf.
16629 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
16630 conditionals.
16631 (TEST_READELF): New variable.
16632 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
16633 (check_PROGRAMS): Add two_file_strip_test.
16634 (two_file_strip_test): New target.
16635 (check_PROGRAMS): Add two_file_same_shared_strip_test.
16636 (two_file_same_shared_strip_test_SOURCES): New variable.
16637 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
16638 (two_file_same_shared_strip_test_LDFLAGS): New variable.
16639 (two_file_same_shared_strip_test_LDADD): New variable.
16640 (two_file_shared_strip.so): New target.
16641 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
16642 (ver_test_5.syms, ver_test_7.syms): Likewise.
16643 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
16644 (strip_test_3.stdout): Use TEST_OBJDUMP.
16645 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16646
86925eef
CC
166472008-04-04 Cary Coutant <ccoutant@google.com>
16648
16649 * symtab.h (Symbol::is_weak_undefined): New function.
16650 (Symbol::is_strong_undefined): New function.
16651 (Symbol::is_absolute): New function.
16652 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
16653 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
16654 absolute symbols.
16655 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
16656 (weak_undef_test): New target.
16657 * testsuite/Makefile.in: Rebuild.
16658 * testsuite/weak_undef_file1.cc: New file.
16659 * testsuite/weak_undef_file2.cc: New file.
16660 * testsuite/weak_undef_test.cc: New file.
16661
126f3ece
ILT
166622008-04-03 Craig Silverstein <csilvers@google.com>
16663
16664 * compressed_output.h (class Output_compressed_section): Use
16665 unsigned buffer.
16666 * compressed_output.cc (zlib_compress): Use unsigned buffers,
16667 add zlib header.
16668 (zlib_compressed_suffix): Removed.
16669 (Output_compressed_section::set_final_data_size): Use unsigned
16670 buffers.
16671 * testsuite/Makefile.am (flagstest_compress_debug_sections):
16672 Fix linker invocation.
16673 (flagstest_o_specialfile_and_compress_debug_sections):
16674 Likewise.
16675 * testsuite/Makefile.in: Regenerated.
16676
deae2a14
DM
166772008-04-02 David S. Miller <davem@davemloft.net>
16678
16679 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
16680 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
16681
70752818
ILT
166822008-04-02 Craig Silverstein <csilvers@google.com>
16683
16684 * TODO: New file.
16685
39d0cb0e
ILT
166862008-04-02 Ian Lance Taylor <iant@google.com>
16687
16688 * fileread.cc (File_read::find_view): Add byteshift and vshifted
16689 parameters. Update for new key type to views_. Change all
16690 callers.
16691 (File_read::read): Adjust for byteshift in returned view.
16692 (File_read::add_view): New function, broken out of
16693 find_and_make_view.
16694 (File_read::make_view): New function, broken out of
16695 find_and_make_view.
16696 (File_read::find_or_make_view): Add offset and aligned
16697 parameters. Rewrite accordingly. Change all callers.
16698 (File_read::get_view): Add offset and aligned parameters. Adjust
16699 for byteshift in return value.
16700 (File_read::get_lasting_view): Likewise.
16701 * fileread.h (class File_read): Update declarations.
16702 (class File_read::View): Add byteshift_ field. Add byteshift to
16703 constructor. Add byteshift method.
16704 * archive.h (Archive::clear_uncached_views): New function.
16705 (Archive::get_view): Add aligned parameter. Change all callers.
16706 * object.h (Object::get_view): Add aligned parameter. Change all
16707 callers.
16708 (Object::get_lasting_view): Likewise.
16709
16710 * fileread.cc (File_read::release): Don't call clear_views if
16711 there are multiple objects.
16712 * fileread.h (File_read::clear_uncached_views): New function.
16713 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
16714 on the archive.
16715
a1207466
CC
167162008-03-31 Cary Coutant <ccoutant@google.com>
16717
16718 Add thin archive support.
16719 * archive.cc (Archive::armagt): New const.
16720 (Archive::setup): Remove task parameter and calls to unlock.
16721 (Archive::unlock_nested_archives): New function.
16722 (Archive::read_header): Add nested_off parameter. Change
16723 all callers.
16724 (Archive::interpret_header): Likewise.
16725 (Archive::include_all_members): Change to handle thin
16726 archives.
16727 (Archive::include_member): Likewise.
16728 * archive.h (Archive::Archive): Add new parameters and
16729 initializers.
16730 (Archive::armagt): New const.
16731 (Archive::setup): Remove task parameter.
16732 (Archive::unlock_nested_archives): New function.
16733 (Archive::read_header): Add nested_off parameter.
16734 (Archive::interpret_header): Likewise.
16735 (Archive::Nested_archive_table): New typedef.
16736 (Archive::is_thin_archive_): New field.
16737 (Archive::nested_archives_): New field.
16738 (Archive::options_): New field.
16739 (Archive::dirpath_): New field.
16740 (Archive::task_): New field.
16741 * readsyms.cc (Read_symbols::do_read_symbols): Add check
16742 for thin archives. Pass additional parameters to
16743 Archive::Archive. Unlock the archive file after calling
16744 Archive::setup.
cd536b21 16745
479f6503
ILT
167462008-03-29 Ian Lance Taylor <iant@google.com>
16747
686c8caf
ILT
16748 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
16749 version symbol to be local.
16750 * testsuite/ver_test_4.sh: New file.
16751 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
16752 (check_DATA): Add ver_test_4.syms.
16753 (ver_test_4.syms): New target.
16754 * testsuite/Makefile.in: Rebuild.
16755
ab794b6b
ILT
16756 * output.cc
16757 (Output_section::Input_section_sort_entry::has_priority): New
16758 function.
16759 (Output_section::Input_section_sort_entry::match_file_name): New
16760 function.
16761 (Output_section::Input_section_sort_entry::match_section_name):
16762 Remove.
16763 (Output_section::Input_section_sort_entry::match_section_name_prefix):
16764 Remove.
16765 (Output_section::Input_section_sort_entry::match_section_file):
16766 Remove.
16767 (Output_section::Input_section_sort_compare::operator()): Rewrite
16768 using new Input_section_sort_entry functions. Sort crtbegin and
16769 crtend first. Sort sections with no priority before sections with
16770 a priority.
16771 * testsuite/initpri1.c (d3): Check j != 4.
16772 (cd5): New constructor/destructor function.
16773 (main): Check j != 2.
16774
479f6503
ILT
16775 * symtab.cc (Symbol_table::add_from_object): If we don't use the
16776 new symbol when resolving, don't call set_is_default.
16777 * testsuite/ver_test_7.cc: New file.
16778 * testsuite/ver_test_7.sh: New file.
16779 * testsuite/Makefile.am (ver_test_7.so): New target.
16780 (ver_test_7.o): New target.
16781 (check_SCRIPTS): Add ver_test_7.sh.
16782 (check_DATA): Add ver_test_7.syms.
16783 (ver_test_7.syms): New target.
16784
2fd32231
ILT
167852008-03-28 Ian Lance Taylor <iant@google.com>
16786
16787 * layout.cc (Layout::layout): If we see an input section with a
16788 name that needs sorting, set the must_sort flag for the output
16789 section.
16790 (Layout::make_output_section): If the name of the output section
16791 indicates that it might require sorting, set the may_sort flag.
16792 * output.h (Output_section::may_sort_attached_input_sections): New
16793 function.
16794 (Output_section::set_may_sort_attached_input_sections): New
16795 function.
16796 (Output_section::must_sort_attached_input_sections): New
16797 function.
16798 (Output_section::set_must_sort_attached_input_sections): New
16799 function.
16800 (class Output_section): Declare Input_section_sort_entry. Define
16801 Input_section_sort_compare. Declare
16802 sort_attached_input_sections. Add new fields:
16803 may_sort_attached_input_sections_,
16804 must_sort_attached_input_sections_,
16805 attached_input_sections_are_sorted_.
16806 * output.cc (Output_section::Output_section): Initialize new
16807 fields.
16808 (Output_section::add_input_section): Add an entry to
16809 input_sections_ if may_sort or must_sort are true.
16810 (Output_section::set_final_data_size): Call
16811 sort_attached_input_sections if necessary.
16812 (Output_section::Input_section_sort_entry): Define new class.
16813 (Output_section::Input_section_sort_compare::operator()): New
16814 function.
16815 (Output_section::sort_attached_input_sections): New function.
16816 * configure.ac: Check whether the compiler supports constructor
16817 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
16818 * testsuite/initpri1.c: New file.
16819 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
16820 CONSTRUCTOR_PRIORITY.
16821 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
16822 (initpri1_LDFLAGS): New variable.
16823 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16824
18e6b24e
ILT
168252008-03-27 Ian Lance Taylor <iant@google.com>
16826
49bdd526
ILT
16827 * common.cc (Sort_commons::operator): Correct sorting algorithm.
16828 * testsuite/common_test_1.c: New file.
16829 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
16830 (common_test_1_SOURCES): New variable.
16831 (common_test_1_DEPENDENCIES): New variable.
16832 (common_test_1_LDFLAGS): New variable.
16833
18e6b24e
ILT
16834 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
16835 and commons_ correctly when NAME/VERSION does not override
16836 NAME/NULL.
16837 * testsuite/ver_test_6.c: New file.
16838 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
16839 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
16840 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
16841
04bf7072
ILT
168422008-03-26 Ian Lance Taylor <iant@google.com>
16843
5871526f
ILT
16844 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
16845 of an undefined symbol from a version script.
16846 * testsuite/Makefile.am (ver_test_5.so): New target.
16847 (ver_test_5.o): New target.
16848 (check_SCRIPTS): Add ver_test_5.sh.
16849 (check_DATA): Add ver_test_5.syms.
16850 (ver_test_5.syms): New target.
16851 * testsuite/ver_test_5.cc: New file.
16852 * testsuite/ver_test_5.script: New file.
16853 * testsuite/ver_test_5.sh: New file.
16854 * Makefile.in, testsuite/Makefile.in: Rebuild.
16855
04bf7072
ILT
16856 PR gold/5986
16857 Fix problems building gold with gcc 4.3.0.
16858 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
16859 (gold_error_at_location, gold_warning_at_location): Use it.
16860 * configure.ac: Check whether we can compile and use a template
16861 function with a printf attribute.
16862 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
16863 when jumping over bytes.
16864 * object.cc: Instantiate Object::read_section_data.
16865 * debug.h: Include <cstring>
16866 * dwarf_reader.cc: Include <algorithm>
16867 * main.cc: Include <cstring>.
16868 * options.cc: Include <cstring>.
16869 * output.cc: Include <cstring>.
16870 * script.cc: Include <cstring>.
16871 * script.h: Include <string>.
16872 * symtab.cc: Include <cstring> and <algorithm>.
16873 * target-select.cc: Include <cstring>.
16874 * version.cc: Include <string>.
16875 * testsuite/testmain.cc: Include <cstdlib>.
16876 * configure, config.in: Rebuild.
16877
874c5b28
ILT
168782008-03-25 Ian Lance Taylor <iant@google.com>
16879
819d6c3a
ILT
16880 * options.cc: Include "../bfd/bfdver.h".
16881 (options::help): Print bug reporting address.
16882
f4b2c6f5
ILT
16883 * version.cc (print_version): Adjust output for current value of
16884 BFD_VERSION_STRING.
16885
16886 * NEWS: New file.
16887
e96caa79
ILT
16888 * options.cc (options::help): Print list of supported targets.
16889 * target-select.h: Include <vector>.
16890 (class Target_selector): Make machine_, size_, and is_big_endian_
16891 fields const. Add bfd_name_ and instantiated_target_ fields.
16892 (Target_selector::Target_selector): Add bfd_name parameter.
16893 (Target_selector::recognize): Make non-virtual, call
16894 do_recognize.
16895 (Target_selector::recognize_by_name): Make non-virtual, call
16896 do_recognize_by_name.
16897 (Target_selector::supported_names): New function.
16898 (Target_selector::bfd_name): New function.
16899 (Target_selector::do_instantiate_target): New pure virtual
16900 function.
16901 (Target_selector::do_recognize): New virtual function.
16902 (Target_selector::do_recognize_by_name): New virtual function.
16903 (Target_selector::instantiate_target): New private function.
16904 (supported_target_names): Declare.
16905 * target-select.cc (Target_selector::Target_selector): Update for
16906 new parameter and fields.
16907 (select_target_by_name): Check that the name matches before
16908 calling recognize_by_name.
16909 (supported_target_names): New function.
16910 * i386.cc (class Target_selector_i386): Update Target_selector
16911 constructor call. Remove recognize and recognize_by_name. Add
16912 do_instantiate_target.
16913 * x86_64.cc (class Target_selector_x86_64): Likewise.
16914 * testsuite/testfile.cc (class Target_selector_test): Update for
16915 changes to Target_selector.
16916
874c5b28
ILT
16917 * README: Rewrite, with some notes on unsupported features.
16918
0a65a3a7
CC
169192008-03-24 Cary Coutant <ccoutant@google.com>
16920
16921 * i386.cc (Target_i386::Got_type): New enum declaration.
16922 (Target_i386::Scan::local): Updated callers of Output_data_got
16923 member functions.
16924 (Target_i386::Scan::global): Likewise.
16925 (Target_i386::Relocate::relocate): Likewise.
16926 (Target_i386::Relocate::relocate_tls): Likewise.
16927 * object.h (Got_offset_list): New class.
16928 (Sized_relobj::local_has_got_offset): Added got_type parameter.
16929 (Sized_relobj::local_got_offset): Likewise.
16930 (Sized_relobj::set_local_got_offset): Likewise.
16931 (Sized_relobj::local_has_tls_got_offset): Removed.
16932 (Sized_relobj::local_tls_got_offset): Removed.
16933 (Sized_relobj::set_local_tls_got_offset): Removed.
16934 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
16935 * output.cc (Output_data_got::add_global): Added got_type parameter.
16936 (Output_data_got::add_global_with_rel): Likewise.
16937 (Output_data_got::add_global_with_rela): Likewise.
16938 (Output_data_got::add_global_pair_with_rel): New function.
16939 (Output_data_got::add_global_pair_with_rela): New function.
16940 (Output_data_got::add_local): Added got_type parameter.
16941 (Output_data_got::add_local_with_rel): Likewise.
16942 (Output_data_got::add_local_with_rela): Likewise.
16943 (Output_data_got::add_local_pair_with_rel): New function.
16944 (Output_data_got::add_local_pair_with_rela): New function.
16945 (Output_data_got::add_global_tls): Removed.
16946 (Output_data_got::add_global_tls_with_rel): Removed.
16947 (Output_data_got::add_global_tls_with_rela): Removed.
16948 (Output_data_got::add_local_tls): Removed.
16949 (Output_data_got::add_local_tls_with_rel): Removed.
16950 (Output_data_got::add_local_tls_with_rela): Removed.
16951 * output.h (Output_data_got::add_global): Added got_type parameter.
16952 (Output_data_got::add_global_with_rel): Likewise.
16953 (Output_data_got::add_global_with_rela): Likewise.
16954 (Output_data_got::add_global_pair_with_rel): New function.
16955 (Output_data_got::add_global_pair_with_rela): New function.
16956 (Output_data_got::add_local): Added got_type parameter.
16957 (Output_data_got::add_local_with_rel): Likewise.
16958 (Output_data_got::add_local_with_rela): Likewise.
16959 (Output_data_got::add_local_pair_with_rel): New function.
16960 (Output_data_got::add_local_pair_with_rela): New function.
16961 (Output_data_got::add_global_tls): Removed.
16962 (Output_data_got::add_global_tls_with_rel): Removed.
16963 (Output_data_got::add_global_tls_with_rela): Removed.
16964 (Output_data_got::add_local_tls): Removed.
16965 (Output_data_got::add_local_tls_with_rel): Removed.
16966 (Output_data_got::add_local_tls_with_rela): Removed.
16967 * resolve.cc (Symbol::override_base_with_special): Removed
16968 reference to has_got_offset_ field.
16969 * symtab.cc (Symbol::init_fields): Replaced initialization
16970 of got_offset_ with got_offsets_. Removed initialization
16971 of has_got_offset_
53fcba31 16972 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
16973 (Symbol::got_offset): Likewise.
16974 (Symbol::set_got_offset): Likewise.
16975 (Symbol::has_tls_got_offset): Removed.
16976 (Symbol::tls_got_offset): Removed.
16977 (Symbol::set_tls_got_offset): Removed.
16978 (Symbol::got_offset_): Removed.
16979 (Symbol::tls_mod_got_offset_): Removed.
16980 (Symbol::tls_pair_got_offset_): Removed.
16981 (Symbol::got_offsets_): New field.
16982 (Symbol::has_got_offset): Removed.
16983 (Symbol::has_tls_mod_got_offset): Removed.
16984 (Symbol::has_tls_pair_got_offset): Removed.
16985 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
16986 (Target_x86_64::Scan::local): Updated callers of Output_data_got
16987 member functions.
16988 (Target_x86_64::Scan::global): Likewise.
16989 (Target_x86_64::Relocate::relocate): Likewise.
16990 (Target_x86_64::Relocate::relocate_tls): Likewise.
16991
bd52eafb
BE
169922008-03-25 Ben Elliston <bje@au.ibm.com>
16993
16994 * yyscript.y: Fix spelling error in comment.
16995
8b105e34
ILT
169962008-03-24 Ian Lance Taylor <iant@google.com>
16997
8ed814a9
ILT
16998 * options.h (class General_options): Define build_id option.
16999 * layout.h (class Layout): Declare write_build_id, create_note,
17000 create_build_id. Add build_id_note_ member.
17001 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
17002 "libiberty.h", "md5.h", "sha1.h".
17003 (Layout::Layout): Initialize eh_frame_data_,
17004 eh_frame_hdr_section_, and build_id_note_.
17005 (Layout::finalize): Call create_build_id.
17006 (Layout::create_note): New function, broken out of
17007 Layout::create_gold_note.
17008 (Layout::create_gold_note): Call create_note.
17009 (Layout::create_build_id): New function.
17010 (Layout::write_build_id): New function.
17011 (Close_task_runner::run): Call write_build_id.
17012
8b105e34
ILT
17013 * x86_64.cc: Correct license to GPLv3.
17014
086a1841
ILT
170152008-03-23 Ian Lance Taylor <iant@google.com>
17016
17017 * options.cc: Include "demangle.h".
17018 (parse_optional_string): New function.
17019 (parse_long_option): Handle takes_optional_argument.
17020 (parse_short_option): Update dash_z initializer. Handle
17021 takes_optional_argument.
17022 (General_options::General_options): Initialize do_demangle_.
17023 (General_options::finalize): Set do_demangle_. Handle demangling
17024 style.
17025 * options.h (parse_optional_string): Declare.
17026 (struct One_option): Add optional_arg field. Update constructor.
17027 Update call constructor calls. Add takes_optional_argument
17028 function.
17029 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
17030 (DEFINE_optional_string): Define.
17031 (General_options::demangle): Change from DEFINE_bool to
17032 DEFINE_optional_string.
17033 (General_options::no_demangle): New function.
17034 (General_options::do_demangle): New function.
17035 (General_options::set_do_demangle): New function.
17036 (General_options::execstack_status_): Move definition to end of
17037 class definition.
17038 (General_options::static_): Likewise.
17039 (General_options::do_demangle_): New field.
17040 * object.cc (big_endian>::get_symbol_location_info): Call
17041 Options::do_demangle, not Options::demangle.
17042 * symtab.cc (demangle): Likewise.
17043
cbb93e63
ILT
170442008-03-22 Ian Lance Taylor <iant@google.com>
17045
17046 * gold.h: Include <cstddef> and <sys/types.h>
17047 * options.h: Include <cstring>.
17048
ec531623
ILT
170492008-03-21 Ian Lance Taylor <iant@google.com>
17050
17051 * Added source code to GNU binutils.
752937aa 17052\f
b90efa5b 17053Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
17054
17055Copying and distribution of this file, with or without modification,
17056are permitted in any medium without royalty provided the copyright
17057notice and this notice are preserved.
17058
17059Local Variables:
17060mode: change-log
17061left-margin: 8
17062fill-column: 74
17063version-control: never
17064End:
This page took 1.115705 seconds and 4 git commands to generate.