Automatic date update in version.in
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
7fa5525f
RÁE
12015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
2
3 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
4
5368dcf2
RÁE
52015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
6
7 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
8 to find by using the return value of insert.
9
9dbb4b02
RÁE
102015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
11
12 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
13 constructor call.
14
1fa29f10
IT
152015-04-06 Ilya Tocar <ilya.tocar@intel.com>
16
17 PR gold/17641
18 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
19 (Target_x86_64::Scan::local): Don't create GOT entry, when we
20 can convert mov to lea.
21 (Target_x86_64::Scan::global): Ditto.
22 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
23 %reg to lea foo(%rip), %reg if possible.
24 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
25 * testsuite/x86_64_mov_to_lea1.s: New.
26 * testsuite/x86_64_mov_to_lea2.s: Ditto.
27 * testsuite/x86_64_mov_to_lea3.s: Ditto.
28 * testsuite/x86_64_mov_to_lea4.s: Ditto.
29 * testsuite/x86_64_mov_to_lea.sh: Ditto.
30
39f3de7c
L
312015-04-02 H.J. Lu <hongjiu.lu@intel.com>
32
33 * configure: Regenerated.
34
c4fc4724
IT
352015-04-01 Ilya Tocar <ilya.tocar@intel.com>
36
37 PR gold/17640
38 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
39 (Target_i386::Scan::local): Don't create GOT entry, when we
40 can convert GOT to GOTOFF.
41 (Target_i386::Scan::global): Ditto.
42 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
43 lea foo@GOTOFF(%reg), %reg if possible.
44 * testsuite/Makefile.am (i386_mov_to_lea): New test.
45 * testsuite/i386_mov_to_lea1.s: New.
46 * testsuite/i386_mov_to_lea2.s: Ditto.
47 * testsuite/i386_mov_to_lea3.s: Ditto.
48 * testsuite/i386_mov_to_lea4.s: Ditto.
49 * testsuite/i386_mov_to_lea5.s: Ditto.
50 * testsuite/i386_mov_to_lea.sh: Ditto.
51
918357b9
L
522015-04-01 H.J. Lu <hongjiu.lu@intel.com>
53
54 * Makefile.am (ZLIB): New.
55 (ZLIBINC): Likewise.
56 (AM_CFLAGS): Add $(ZLIBINC).
57 (AM_CXXFLAGS): Likewise.
58 (ldadd_varldadd_var): Add $(ZLIB).
59 (incremental_dump_LDADD): Likewise.
60 (dwp_LDADD): Likewise.
61 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
62 <zlib.h>.
63 (zlib_compress): Don't check HAVE_ZLIB_H.
64 (zlib_decompress): Likewise.
65 * options.h (compress_debug_sections): Likewise.
66 * configure.ac (AM_CONDITIONAL): Removed.
67 * testsuite/Makefile.am (ZLIB): New.
68 (LDADD): Add $(ZLIB).
69 Don't check HAVE_ZLIB.
70 * Makefile.in: Regenerated.
71 * config.in: Likewise.
72 * configure: Likewise.
73 * testsuite/Makefile.in: Likewise.
74
6b0ad2eb
JY
752015-03-30 Jing Yu <jingyu@google.com>
76
77 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
78 TLSLD_ADD_DTPREL_LO12_NC.
79 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
80 _TLS_MODULE_BASE_ point to the start of tls segment.
81 (Target_aarch64::optimize_tls_reloc): Add cases for
82 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
83 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
84 (Target_aarch64::Scan::local): Likewise.
85 (Target_aarch64::Scan::global): Likewise.
86 (Target_aarch64::Relocate::relocate): Likewise.
87 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
88 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
89 relocations.
90
0916f9e7
RÁE
912015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
92
93 * merge.cc (Object_merge_map::add_mapping): call
94 Object_merge_map::Input_merge_map::add_mapping.
95 (Object_merge_map::Input_merge_map::add_mapping): New.
96 (Output_merge_data::do_add_input_section): Call
97 get_or_make_input_merge_map before a loop.
98 (Output_merge_string<Char_type>::finalize_merged_data): Call
99 get_or_make_input_merge_map before a loop.
100 * merge.h (Object_merge_map): Make Input_merge_map public.
101 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
102 (Relobj::get_or_create_merge_map): New.
103 * object.h (Relobj::get_or_create_merge_map): New.
104
282c9750
AM
1052015-03-24 Alan Modra <amodra@gmail.com>
106
107 PR 18147
108 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
109 relocation errors for branches to strong undefined symbols.
110
67f95b96
RÁE
1112015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
112
113 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
114 (Object_merge_map::is_merge_section_for): Remove.
115 (Object_merge_map::find_merge_section): New.
116 * merge.h (Object_merge_map::is_merge_section_for): Remove.
117 (Object_merge_map::find_merge_section): New.
118 (Object_merge_map::get_input_merge_map): Add a const version.
119 * object.cc (Relobj::is_merge_section_for): Remove.
120 (Relobj::find_merge_section): New.
121 * object.h (Relobj::is_merge_section_for): Remove.
122 (Relobj::find_merge_section): New.
123 * output.cc
124 (Output_section::Input_section::is_merge_section_for): Remove.
125 (Output_section::add_merge_input_section): Don't call
126 add_merge_input_section.
127 (Output_section::find_merge_section): Return const. Use
128 object->find_merge_section.
129 (Output_section::build_lookup_maps): Don't build a map for
130 merge sections.
131 (Output_section::is_input_address_mapped): Return false if
132 section is not found.
133 (Output_section::find_starting_output_address): Use
134 find_merge_section instead of is_merge_section_for.
135 (Output_section::add_script_input_section): Don't build a map for
136 merge sections.
137 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
138 (Output_section_lookup_maps::find_merge_section): Remove.
139 (Output_section_lookup_maps::add_merge_input_section) Remove.
140 (Output_section::find_merge_section): Return const.
141
152f7024
CC
1422015-03-22 Cary Coutant <cary@google.com>
143
144 PR gold/18106
145 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
146 non-SIB form of lea, with nop after the call.
147
bccffdfd
CC
1482015-03-21 Cary Coutant <cary@google.com>
149
150 PR gold/14217
151 * output.cc (Output_segment::is_first_section_relro): Don't ignore
152 .tdata section.
153 (Output_segment::set_section_addresses): Don't align size of relro
154 segment for .tbss.
155
1c582fe7
CC
1562015-03-21 Cary Coutant <cary@google.com>
157
158 PR gold/18010
159 * stringpool.cc (Stringpool_template): Don't optimize if section
160 alignment is greater than sizeof(char).
161
410da591
CC
1622015-03-21 Cary Coutant <cary@google.com>
163
164 PR gold/18048
165 * script-c.h (script_include_directive): Add first_token parameter.
166 * script.cc (script_include_directive): Add first_token parameter, and
167 pass it to read_script_file.
168 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
169 (PARSING_MEMORY_DEF): New tokens.
170 (top): Add new productions for INCLUDE files.
171 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
172 Pass PARSING_LINKER_SCRIPT to script_include_directive.
173 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
174 (section_cmd): Pass PARSING_SECTION_CMDS.
175 (file_or_sections_cmd): Remove.
176 (memory_def): Pass PARSING_MEMORY_DEF.
177 * testsuite/Makefile.am (memory_test_2): New test.
178 * testsuite/Makefile.in: Regenerate.
179 * testsuite/memory_test_inc.t: New script file.
180 * testsuite/memory_test_inc_1.t.src: New script file.
181 * testsuite/memory_test_inc_2.t.src: New script file.
182 * testsuite/memory_test_inc_3.t.src: New script file.
183
0d5bbdb0
CC
1842015-03-21 Cary Coutant <cary@google.com>
185
186 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
187 (Sized_relobj_dwo::setup): Build compressed section map.
188 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
189 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
190 section map.
191 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
192 compressed_sections_ field.
193 (build_compressed_section_map): Take Object instead of
194 Sized_relobj_file parameter; add decompress_if_needed parameter.
195 (Sized_relobj_file::do_find_special_sections): Store compressed
196 section map in parent Object.
197 (Sized_relobj_file::do_decompressed_section_contents): Move
198 implementation to Object::decompressed_section_contents.
199 (Sized_relobj_file::do_discard_decompressed_sections): Move
200 implementation to Object::discard_decompressed_sections.
201 * object.h (build_compressed_section_map): Declare.
202 (Object::Object): Add compressed_sections_ field.
203 (Object::section_is_compressed): Move implementation here.
204 (Object::decompressed_section_contents): De-virtualize.
205 (Object::discard_decompressed_sections): De-virtualize.
206 (Object::do_section_is_compressed): Delete.
207 (Object::do_decompressed_section_contents): Delete.
208 (Object::set_compressed_sections): New method.
209 (Object::compressed_sections): New method.
210 (Object::compressed_sections_): New data member.
211 (Compressed_section_info, Compressed_section_map): Move to top of file.
212 (Sized_relobj_file::do_section_is_compressed): Delete.
213 (Sized_relobj_file::do_decompressed_section_contents): Delete.
214 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
215 (Sized_relobj_file::compressed_sections_): Move to Object class.
216
bd9e0d46
CC
2172015-03-21 Cary Coutant <ccoutant@google.com>
218
219 PR gold/18152
220 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
221 deferred objects.
222
943c8b43
CC
2232015-03-11 Cary Coutant <ccoutant@google.com>
224
225 * options.cc (General_options::finalize): Don't allow -z relro
226 with incremental linking.
227 * testsuite/Makefile.am (incremental_test): Add -z norelro.
228 (incremental_test_2): Likewise.
229 (incremental_test_3): Likewise.
230 (incremental_test_4): Likewise.
231 (incremental_test_5): Likewise.
232 (incremental_test_6): Likewise.
233 (incremental_copy_test): Likewise.
234 (incremental_common_test_1): Likewise.
235 (incremental_comdat_test_1): Likewise.
236 * testsuite/Makefile.in: Regenerate.
237
e1663197
CC
2382015-03-09 Cary Coutant <ccoutant@google.com>
239
240 PR gold/14675
241 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
242 return enum indicating whether .eh_frame section is empty, optimizable,
243 unrecognized, or an end marker. Adjust explicit instantiations.
244 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
245 (Eh_frame::add_ehframe_input_section): Change return type.
246 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
247 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
248 to the .eh_frame output section until we see the end marker.
249 (Layout::finalize_eh_frame_section): New.
250 * layout.h: (Layout::finalize_eh_frame_section): New.
251
beb8418f
L
2522015-03-05 H.J. Lu <hongjiu.lu@intel.com>
253
254 * output.cc (Relobj::initialize_input_to_output_map<size>):
255 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
256
48c73428
CC
2572015-03-04 Cary Coutant <ccoutant@google.com>
258
259 * parameters.cc (Parameters::set_target_once): Call
260 Target::select_as_default_target just once from here...
261 (set_parameters_target): ...instead of from here.
262
2632015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
dbe40a88
RÁE
264
265 * ehframe.cc (Cie::set_output_offset): Pass in and use a
266 Output_section_data instead of a Merge_map.
267 (Eh_frame::Eh_frame): Don't initialize merge_map_.
268 (Eh_frame::read_cie): Use add_merge_mapping instead of
269 Merge_map::add_mapping.
270 (Eh_frame::read_fde): Ditto.
271 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
272 (Eh_frame::do_output_offset): Use merge_output_offset istead of
273 merge_map_->get_output_offset.
274 (Eh_frame::do_is_merge_section_for): Delete.
275 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
276 instead of a Merge_map.
277 (Cie::set_output_offset): Pass in a Output_section_data instead of a
278 Merge_map.
279 (Eh_frame::do_is_merge_section_for): Delete.
280 (Eh_frame::merge_map_): Delete.
281 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
282 and use a Output_section_data instead of a Merge_map.
283 (Object_merge_map::add_mapping): Ditto.
284 (Object_merge_map::get_output_offset): Remove the merge_map argument.
285 (Object_merge_map::is_merge_section_for): Pass in and use a
286 Output_section_data instead of a Merge_map.
287 (Merge_map): Delete.
288 (Output_merge_base::do_output_offset): Use merge_output_offset instead
289 of merge_map_.get_output_offset.
290 (Output_merge_base::do_is_merge_section_for): Delete.
291 (Output_merge_data::do_add_input_section): Use
292 object->add_merge_mapping instead of add_mapping.
293 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
294 * merge.h (Merge_map): Delete forward declaration.
295 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
296 instead of a Merge_map.
297 (Object_merge_map::get_output_offset): Remove the merge_map argument.
298 (Object_merge_map::is_merge_section_for): Pass in and use a
299 Output_section_data instead of a Merge_map.
300 (Input_merge_map::Object_merge_map::merge_map): Replace with
301 output_data.
302 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
303 Output_section_data instead of a Merge_map.
304 (Merge_map): Delete.
305 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
306 (Output_merge_base::do_is_merge_section_for): Delete.
307 (Output_merge_base::add_mapping): Delete.
308 (Output_merge_base::merge_map_): Delete.
309 * object.cc (Relobj::initialize_input_to_output_map): New.
310 (Relobj::initialize_input_to_output_map): New.
311 (Relobj::merge_output_offset): New.
312 (Relobj::is_merge_section_for): New.
313 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
314 bits.
315 * object.h (Relobj::merge_map): Delete.
316 (initialize_input_to_output_map): New.
317 (set_merge_map): Delete.
318 (add_merge_mapping): New.
319 (merge_output_offset): New.
320 (is_merge_section_for): New.
321 * output.cc (Output_section::Input_section::is_merge_section_for):
322 Use object->is_merge_section_for.
323 * output.h (Output_section_data::is_merge_section_for): Delete.
324 (Output_section_data::do_is_merge_section_for): Delete.
325 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
326 Use object->initialize_input_to_output_map.
327 (Merged_symbol_value<size>::value_from_output_section): Use
328 object->merge_output_offset.
329
48c73428 3302015-03-02 Peter Collingbourne <pcc@google.com>
2c7b626c
CC
331 Cary Coutant <ccoutant@google.com>
332
333 * output.cc (Output_section::add_merge_input_section): Do not
334 attempt to merge sections with an entsize of 0.
335
48c73428 3362015-03-02 Khem Raj <raj.khem@gmail.com>
5b07cd84
CC
337
338 * attributes.h (class Output_attributes_section_data ): Add
339 do_print_to_mapfile function.
340
ec86f434
AM
3412015-02-24 Alan Modra <amodra@gmail.com>
342
343 PR 18010
344 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
345 complain if value is not a multiple of four.
346 (Target_powerpc::Relocate::relocate): Correct handling of
347 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
348
be66981e
L
3492015-02-21 H.J. Lu <hongjiu.lu@intel.com>
350
351 * configure.ac (default_size): Set to 32 for x32.
352 * configure: Regenerated.
353
e3ee8ed4
AM
3542015-02-18 Alan Modra <amodra@gmail.com>
355
356 PR 17954
357 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
358 visibility.
359
3a935c6c
RÁE
3602015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
361
362 * gc.h (Garbage_collection::add_reference): Don't use find.
363
e0a1e121
RÁE
3642015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
365
366 * object.cc (write_local_symbols): avoid std::vector copy.
367
45a4fb1a
RÁE
3682015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
369
370 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
371
2d9afefe
MW
3722015-02-09 Mark Wielaard <mjw@redhat.com>
373
374 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
375 DW_LANG_Fortran03 and DW_LANG_Fortran08.
376
e9c1bdad
CC
3772015-02-16 Cary Coutant <ccoutant@google.com>
378
379 PR gold/13577
380 PR gold/16992
381 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
382 DF_SYMBOLIC if --dynamic-list option is used.
383 * options.cc (General_options::finalize): --dynamic-list is not
384 mutually exclusive with -Bsymbolic.
385 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
386 listed in --dynamic-list.
387 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
388 -Bsymbolic-functions.
389 * testsuite/Makefile.in: Regenerate.
390
0ed4b0bf
CC
3912015-02-16 Cary Coutant <ccoutant@google.com>
392
393 PR gold/17971
394 * incremental.cc: Remove redundant include of "output.h".
395
1a920511
JY
3962015-02-12 Jing Yu <jingyu@google.com>
397
398 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
399 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
400 New relocation.
401 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
402 TLSLE_MOVW_* relocations.
403 (Target_aarch64::Scan::global): Likewise.
404 (Target_aarch64::Relocate::relocate): Likewise.
405 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
406 for new TLSLE_MOVW_* relocations.
407
07f107f3
WN
4082015-02-11 Will Newton <will.newton@linaro.org>
409
410 PR gold/13321
411 * arm.cc (Target_arm::make_plt_section): Create an ARM
412 state mapping symbol at the start of the PLT.
413
e051a5b5
L
4142015-02-09 H.J. Lu <hongjiu.lu@intel.com>
415
416 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
417 Replace two_file_shared_2.so with two_file_shared_1.so.
418 * testsuite/Makefile.in: Regenerated.
419
dddcc5b9
AM
4202015-02-09 Alan Modra <amodra@gmail.com>
421
422 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
423 plugin_test_thin.a and defsym_test.
424 * testsuite/Makefile.in: Regenerate.
425
b39b8b9d
RÁE
4262015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
427
428 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
429 body.
430
b66d1c52
CC
4312015-02-04 Peter Collingbourne <pcc@google.com>
432
433 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
434 forwarding symbols when computing symbol resolution info for plugins.
435 * plugin.h (Plugin_manager::symtab): New method.
436 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
437
23081de0
CC
4382015-02-03 Cary Coutant <ccoutant@google.com>
439 Peter Collingbourne <pcc@google.com>
440
441 PR gold/15660
442 * archive.cc (Thin_archive_object_unlocker): New class.
443 (Archive::include_member): Unlock external members of thin archives.
444 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
445 (plugin_test_2): Likewise.
446 (plugin_test_3): Likewise.
447 (plugin_test_4): Likewise.
448 (plugin_test_5): Likewise.
449 (plugin_test_6): Likewise.
450 (plugin_test_7): Likewise.
451 (plugin_test_8): Likewise.
452 (plugin_test_9): Likewise.
453 (plugin_test_10): Likewise.
454 (plugin_test_11): New test case.
455 * testsuite/Makefile.in: Regenerate.
456 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
457 file to decide whether to claim file.
458 (all_symbols_read_hook): Likewise.
459 * testsuite/plugin_test_1.sh: Adjust expected output.
460 * testsuite/plugin_test_2.sh: Likewise.
461 * testsuite/plugin_test_3.sh: Likewise.
462 * testsuite/plugin_test_6.sh: Likewise.
463 * testsuite/plugin_test_tls.sh: Likewise.
464 * testsuite/plugin_test_11.sh: New testcase.
465
4662015-02-03 Cary Coutant <ccoutant@google.com>
467
468 * descriptors.cc (Descriptors::open): Set artificially-low limit for
469 file descriptors when debugging enabled. Add debug output.
470 (Descriptors::release): Add debug output.
471 (Descriptors::close_some_descriptor): Likewise.
472 (Descriptors::close_all): Likewise.
473 * fileread.cc (File_read::lock): Likewise.
474 (File_read::unlock): Likewise.
475
24dd5808
CC
4762015-02-02 Cary Coutant <ccoutant@google.com>
477
478 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
479 executable output file.
480
fa89cc82
HS
4812015-01-22 Han Shen <shenhan@google.com>
482
483 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
484 (Target_arm::do_plt_address_for_global): New method.
485 (Target_arm::do_plt_address_for_local): New method.
486 (Target_arm::rel_irelative_section): New method.
487 (Target_arm::make_data_plt): Add more parameters for plt ctor.
488 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
489 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
490 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
491 (Target_arm::Scan::check_non_pic): Add ifunc support.
492 (Target_arm::Scan::local): Add ifunc support.
493 (Target_arm::Scan::global): Add ifunc support.
494 (Target_arm::make_plt_section): New method.
495 (Target_arm::make_plt_entry): Change to call to make_plt_section.
496 (Target_arm::make_local_ifunc_plt_entry): New method.
497 (Target_arm::got_irelative_): New member.
498 (Target_arm::rel_irelative_): New member.
499 (Target_arm::got_section): Add creation for got_irelative_.
500 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
501 (Target_arm::Relocate::relocate): Properly set local ifunc address.
502 (Target_arm::do_dynsym_value): Properly set global ifunc address.
503 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
504 (Output_data_plt_arm::IRelative_data): New type.
505 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
506 (Output_data_plt_arm::add_entry): Add more parameters.
507 (Output_data_plt_arm::add_relocation): New method.
508 (Output_data_plt_arm::add_local_ifunc_entry): New method.
509 (Output_data_plt_arm::rel_irelative): New method.
510 (Output_data_plt_arm::entry_count): Modified.
511 (Output_data_plt_arm::address_for_global): New method.
512 (Output_data_plt_arm::address_for_local): New method.
23081de0 513gold/
fa89cc82
HS
514 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
515 (Output_data_plt_arm::insert_irelative_data): New method.
516 (Output_data_plt_arm::irelative_rel_): New member.
517 (Output_data_plt_arm::got_): New member.
518 (Output_data_plt_arm::got_irelative_): New member.
519 (Output_data_plt_arm::irelative_count_): New member.
520 (Output_data_plt_arm::IRelative_data_vec): New typedef.
521 (Output_data_plt_arm::irelative_data_vec_): New member.
522 (Output_data_plt_arm::do_write): Write out irelative entries.
523 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
524 more parameters to ctor.
525 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
526 more parameters to ctor.
527 * output.h (Output_data_reloc::add_local_relative): New method.
528 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
529
0f81d3f0
AM
5302015-01-29 Alan Modra <amodra@gmail.com>
531
532 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
533 and GOT_TLSGD to LE optimization.
534
65d92137
CC
5352015-01-28 Cary Coutant <ccoutant@google.com>
536
537 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
538 for undef TLS symbols.
539 (Target_x86_64::Relocate::relocate_tls): Likewise.
540 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
541
5485698a
CC
5422015-01-25 Cary Coutant <ccoutant@google.com>
543
544 * output.cc (Output_segment::set_section_addresses): Fix calculation
545 of size of relro segment.
546
b01a4b04
AM
5472015-01-22 Alan Modra <amodra@gmail.com>
548
549 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
550 condition for need of ifunc plt entry.
551 (Target_powerpc::Scan::global <got relocs>): Likewise.
552
3d0064a9
CC
5532015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
554
555 * mips.cc (reloc_high): Add r_sym.
556 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
557 reloc_high constructor.
558 (Mips_relocate_functions::relgot16_local): Likewise.
559 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
560 r_type to decide whether LO16 matches HI16.
561 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
562 rello16 and relgot16_local.
563
a5cd8f05
CC
5642015-01-09 Cary Coutant <ccoutant@google.com>
565
566 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
567 unless alignment is larger than page size.
568
4fc1b9d4
L
5692015-01-06 H.J. Lu <hongjiu.lu@intel.com>
570 Cary Coutant <ccoutant@google.com>
571
572 PR gold/17729
573 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
574 (DEFAULT_TARGET_X32): Set for x32.
575 * x86_64.cc (cmp_insn_32): New.
576 (lea_r10_insn_32): Likewise.
577 (lea_r11_insn_32): Likewise.
578 (cmp_insn_64): Likewise.
579 (lea_r10_insn_64): Likewise.
580 (lea_r11_insn_64): Likewise.
581 (Target_x86_64<size>::do_calls_non_split): Handle x32.
582 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
583 (check_DATA): Add split_x32 files.
584 (split_x32_[1234n].o): New targets.
585 (split_x32_[124]): New targets.
586 (split_x32_[1234r].stdout): New targets.
587 * testsuite/split_x32.sh: New file.
588 * testsuite/split_x32_1.s: Likewise.
589 * testsuite/split_x32_2.s: Likewise.
590 * testsuite/split_x32_3.s: Likewise.
591 * testsuite/split_x32_4.s: Likewise.
592 * testsuite/split_x32_n.s: Likewise.
593 * configure: Regenerated.
594 * testsuite/Makefile.in: Likewise.
595
e749cab8
L
5962015-01-06 H.J. Lu <hongjiu.lu@intel.com>
597
598 PR gold/17809
599 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
600 x32.
601
af759df0
AM
6022015-01-02 Alan Modra <amodra@gmail.com>
603
604 * version.cc (print_version): Just print current year.
605 * dwp.cc (print_version): Likewise.
606
b90efa5b
AM
6072015-01-01 Alan Modra <amodra@gmail.com>
608
609 Update year range in copyright notice of all files.
610
f12d1e8a
AM
6112014-12-25 Alan Modra <amodra@gmail.com>
612
613 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
614 new enums.
615 (Target_arm::merge_object_attributes, ): Likewise.
616
5c294fee
TG
6172014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
618
619 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
620 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
621 AEABI_VFP_args_vfp to check that.
622 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
623 value and replace hardcoded values by enum values.
624
e30880c2
CC
6252014-12-22 Cary Coutant <ccoutant@google.com>
626
627 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
628
bd040da1
L
6292014-12-20 H.J. Lu <hongjiu.lu@intel.com>
630
631 PR gold/14608
632 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
633 to "return i * i * 3;".
634
e02a4046
CC
6352014-12-16 Cary Coutant <ccoutant@google.com>
636
637 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
638 (Mapfile::print_output_data): Use current_data_size() to avoid
639 assert for sections requiring postprocessing; if address is not valid,
640 print 0.
641 (Mapfile::print_output_section): Use current_data_size(); print note
642 that addresses and sizes are before compression.
643
add6016b
L
6442014-12-14 H.J. Lu <hongjiu.lu@intel.com>
645
646 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
647 Cast current_group_size to unsigned long when reporting error.
648
0bf32ea9
JY
6492014-12-10 Jing Yu <jingyu@google.com>
650
651 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
652 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
653 Update error message.
654 (Target_aarch64::do_relax): Use absolute value of option
655 stub_group_size. Replace local variable with class member
656 stub_group_size_.
657
cbcb23fa
AM
6582014-12-04 Alan Modra <amodra@gmail.com>
659
660 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
661 addend of PLTREL24 reloc when not generating a plt stub. Make
662 max_branch_offset an "Address".
fbad6518 663 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
664 (Target_powerpc::Relocate::relocate): Likewise.
665
1611bc4a
AM
6662014-12-04 Alan Modra <amodra@gmail.com>
667
668 PR 17670
669 * symtab.cc (Symbol::set_undefined): Remove assertion.
670 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
671 on symbols defined in discarded sections, instead return false.
672 Rearrange params, update all callers.
673 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
674 branches to syms in discarded sections.
675 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
676 undefined and flag as discarded.
677 (Target_powerpc::Relocate::relocate): Localize variable.
678
4759c34e
L
6792014-12-03 H.J. Lu <hongjiu.lu@intel.com>
680
681 PR gold/17675
682 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
683 * testsuite/Makefile.in: Regenerated.
684
1f98a074
AM
6852014-12-03 Alan Modra <amodra@gmail.com>
686
687 PR 17566
688 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
689 when adding dynamic relocations against section symbols.
690
fb257835
DI
6912014-12-01 Dimitry Ivanov <dimitry@google.com>
692
693 * layout.cc (Layout::finish_dynamic_section): When '-z global'
694 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
695 * options.h (General_options): New -z option (global).
696
d8e60314
CC
6972014-12-01 Cary Coutant <ccoutant@google.com>
698
699 PR gold/17578
700 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
701 is given.
702 (Layout::create_executable_stack_info): Warn when -z noexecstack is
703 given but some inputs require executable stack.
704
982bbd97
CC
7052014-11-26 Cary Coutant <ccoutant@google.com>
706
707 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
708 .debug_str_offsets; strip .debug_gnu_pubnames and
709 .debug_gnu_pubtypes.
710 (lines_only_debug_sections): Strip all four new sections.
711
bb779192
HS
7122014-11-26 Jing Yu <jingyu@google.com>
713
714 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
715 register to be x0 when to relax TLSDESC_LD64_LO12.
716
a3e60ddb
AM
7172014-11-26 Alan Modra <amodra@gmail.com>
718
719 * powerpc.cc (struct Stub_table_owner): New.
720 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
721 unsigned int vector. Update all references.
722 (powerpc_relobj::set_stub_table): Take an unsigned int param
723 rather than a Stub_table. Update callers.
724 (Powerpc_relobj::clear_stub_table): New function.
725 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
726 stub_group_size_ vars.
727 (Target_powerpc::new_stub_table): Delete.
728 (max_branch_delta): New function, extracted from..
729 (Target_powerpc::Relocate::relocate): ..here..
730 (Target_powerpc::Branch_info::make_stub): ..and here. Return
731 status on whether stub created successfully.
732 (Stub_control::Stub_control): Add "no_size_errors" param. Move
733 default sizing to..
734 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
735 reduce on relax failure.
736 (Target_powerpc::group_sections): Add "no_size_errors" param.
737 Use stub_group_size_. Set up group info in a temp vector,
738 before building Stub_table vector. Account for input sections
739 possibly already converted to relaxed sections.
740 (Stub_table::init): Delete. Merge into..
741 (Stub_table::Stub_table): ..here.
742 (Stub_table::can_reach_stub): New function.
743 (Stub_table::add_plt_call_entry): Add "from" parameter and
744 return true iff stub could be reached.
745 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
746 param too.
747 (Stub_table::clear_stubs): Add "all" param.
748
a20605cf
AM
7492014-11-26 Alan Modra <amodra@gmail.com>
750
751 * powerpc.cc (Stub_control::set_output_and_owner): New function.
752 (Target_powerpc::group_sections): Use it.
753
43b64deb
CC
7542014-11-25 Cary Coutant <ccoutant@google.com>
755
756 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
757 (Binary_to_elf::write_symbol): Add st_size parameter.
758 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
759
c924eb67
CC
7602014-11-25 Cary Coutant <ccoutant@google.com>
761
762 PR gold/17639
763 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
764 (Sized_relobj_file::do_layout): Handle deferred sections properly
765 during GC pass 1. Don't add reloc sections to deferred list twice.
766 * object.h (Sized_relobj_file::is_deferred_layout): New function.
767 (Sized_relobj_file::is_deferred_layout_): New data member.
768
9d585188
L
7692014-11-21 H.J. Lu <hongjiu.lu@intel.com>
770
771 PR gold/17619
772 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
773 Check PC-relative offset overflow in PLT entry.
774
3ffaac20
AM
7752014-11-21 Alan Modra <amodra@gmail.com>
776
777 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
778 for undefined weaks.
779
0cfb0717
AM
7802014-11-20 Alan Modra <amodra@gmail.com>
781
782 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
783 from --stub-group-size parameter divided by 1024.
784 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
785 template parameter. Update all uses.
786 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
787 has_stub_value. Set for long branches. Don't report overflow for
788 branch to undefined weak symbols. Print info message on
789 overflowing branch to stub.
790
f9dffbf0
AM
7912014-11-20 Alan Modra <amodra@gmail.com>
792
793 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
794
e88ba8d5
L
7952014-11-13 H.J. Lu <hongjiu.lu@intel.com>
796
797 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
798 entry for R_X86_64_GOTPLT64.
799 (Target_x86_64<size>::Relocate::relocate): Update comments for
800 R_X86_64_GOTPLT64.
801
d37ffe25
ED
8022014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
803
804 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
805 * plugin.h: add lock definition
806
9726c3c1
HS
8072014-10-29 Han Shen <shenhan@google.com>
808 Jing Yu <jingyu@google.com>
809
810 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
811 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
812 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
813 Symbol::TLS_REF.
814 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
815 method.
816 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
817 (Target_aarch64::tls_ld_to_le): New method.
818 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
819 for 64bit targets.
820 (Output_data_plt_aarch64::irelative_rel_): New data member.
821 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
822 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
823 (Output_data_plt_aarch64::add_relocation): New method.
824 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
825 offset. Add got_irelative size to got size.
826 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
827 type string with the new typename.
828 (AArch64_relocate_functions::update_adr): Replace parameter x with
829 immed.
830 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
831 (AArch64_relocate_functions::reloc_common): New method.
832 (AArch64_relocate_funcsions::rela_general): Extract common part out
833 into reloc_common method.
834 (AArch64_relocate_functions::rela_general): Likewise.
835 (AArch64_relocate_functions::pcrela_general): Likewise.
836 (AArch64_relocate_functions::adr): New method.
837 (AArch64_relocate_functions::adrp): Calculate immed before calling
838 update_adr.
839 (AArch64_relocate_functions::adrp): Likewise.
840 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
841 comparing x to 0. Calculate immed from ~x when x < 0.
842 (Target_aarch64::optimize_tls_reloc): Add new cases for
843 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
844 TLSLD_MOVW_DTPREL_G0_NC.
845 (Target_aarch64::possible_function_pointer_reloc): Implement this
846 method.
847 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
848 comment.
849 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
850 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
851 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
852 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
853 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
854 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
855 (Target_aarch64::make_plt_entry): Call add_entry with two more
856 parameters.
857 (Target_aarch64::make_local_ifunc_plt_entry): New method.
858 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
859 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
860 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
861 (Target_aarch64::Relocate::relocate_tls): Add cases for
862 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
863 TLSLD_MOVW_DTPREL_G0_NC.
864 * testsuite/icf_safe_so_test.cc: Correct test comment.
865 * testsuite/icf_safe_test.sh: Add AArch64 arch.
866
80272b8c
AM
8672014-10-22 Alan Modra <amodra@gmail.com>
868
869 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
870 thread_starter.
871
998a69f4
AS
8722014-10-18 Andreas Schwab <schwab@linux-m68k.org>
873
874 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
875
aed56ec5
CC
8762014-10-17 Cary Coutant <ccoutant@google.com>
877
878 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
879 Add "typename" keyword.
880
bb779192 8812014-10-15 Han Shen <shenhan@google.com>
83a01957
HS
882 Jing Yu <jingyu@google.com>
883
884 Patch for gold aarch64 backend to support relaxation.
885 * aarch64-reloc.def: Change format.
886 * aarch64.cc (class Reloc_stub): New class.
887 (class Stub_table): New class.
888 (class AArch64_relobj): New class.
889 (class AArch64_input_section): New class.
890 (class AArch64_output_section): New class.
891 (Target_aarch64::new_stub_table): New method.
892 (Target_aarch64::new_aarch64_input_section): New method.
893 (Target_aarch64::find_aarch64_input_section): New method.
894 (Target_aarch64::scan_section_for_stubs): New method.
895 (Target_aarch64::scan_reloc_section_for_stubs): New method.
896 (Target_aarch64::relocate_stub): New method.
897 (Target_aarch64::current_target): New method.
898 (Target_aarch64::do_make_elf_object): New method.
899 (Target_aarch64::do_may_relax): New method.
900 (Target_aarch64::do_relax): New method.
901 (Target_aarch64::group_sections): New method.
902 (Target_aarch64::scan_reloc_for_stub): New method.
903 (Target_aarch64::do_make_output_section): New method.
904 (Target_aarch64::stub_tables_): New data member.
905 (Target_aarch64::aarch64_input_section_map_): New data member.
906 (AArch64_relocate_functions::maybe_apply_stub): New method.
907
db4c9594
CC
9082014-09-30 Cary Coutant <ccoutant@google.com>
909
910 PR gold/17432
911 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
912
cd6da036
KC
9132014-09-30 Kito Cheng <kito@0xlab.org>
914
915 PR gold/13597
916 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
917 hash table before sysv-style hash table.
918
5f772412
ST
9192014-09-29 Sriraman Tallam <tmsriram@google.com>
920
921 * options.h (--pic-executable): Add negative to alias to -no-pie.
922
5efeedf6
CC
9232014-09-26 Cary Coutant <ccoutant@google.com>
924
925 PR gold/16773
926 * object.cc (Sized_relobj_file): Compute value of section symbols
927 for TLS sections the same as TLS symbols.
928
1707f183
CC
9292014-09-25 Cary Coutant <ccoutant@google.com>
930
931 PR gold/17432
932 * resolve.cc (Symbol_table::resolve): Override common placeholder
933 symbols, but adjust sizes.
934 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
935 symbols to common lists.
936
00cac886
AM
9372014-09-24 Alan Modra <amodra@gmail.com>
938
939 * po/POTFILES.in: Regenerate.
940
635aa30e
CC
9412014-09-23 Taiju Tsuiki <tzik@google.com>
942 Cary Coutant <ccoutant@google.com>
943
71b9b91b 944 PR gold/14860
635aa30e
CC
945 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
946 on input_sections_blocker.
947 * layout.cc (Write_sections_task::locks): Unblock
948 input_sections_blocker_.
949 * layout.h (Write_sections_task::Write_sections_task): Add
950 input_sections_blocker.
951 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
952 to DEPENDENCIES.
953 * testsuite/Makefile.in: Regenerate.
954
c0c71592
RÁE
9552014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
956
957 * testsuite/Makefile.am (plugin_test_10): New test.
958 * testsuite/Makefile.in: Regenerate
959 * testsuite/plugin_common_test_2.c (c1): Align to 8.
960 * testsuite/plugin_test_10.sh: New file.
961
6168c2a1
RÁE
9622014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
963
964 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
965 * resolve.cc (Symbol_table::resolve): Don't override common symbols
966 during the replacement phase.
967
3a531937
JY
9682014-09-17 Han Shen <shenhan@google.com>
969 Jing Yu <jingyu@google.com>
970
971 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
972 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
973 * aarch64.cc (Target_aarch64): Add data members
974 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
975 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
976 constructor.
977 (Target_aarch64::do_reloc_symbol_index): New method.
978 (Target_aarch64::do_reloc_addend): New method.
979 (Target_aarch64::add_tlsdesc_info): New method.
980 (Target_aarch64::do_dynsym_value): New method.
981 (Target_aarch64::do_make_data_plt): Add new parameters: got,
982 got_irelative. Pass them to Output_data_plt_aarch64_standard.
983 (Target_aarch64::make_data_plt): Add new parameters: got,
984 got_irelative. Pass them to do_make_data_plt.
985 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
986 (Target_aarch64::Relocate:tls_gd_to_le): New method.
987 (Target_aarch64::Relocate:tls_ie_to_le): New method.
988 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
989 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
990 (Target_aarch64::got_tlsdesc_section): New method.
991 (Target_aarch64::make_local_ifunc_plt_entry): New method.
992 (Target_aarch64::define_tls_base_symbol): New method.
993 (Target_aarch64::reserve_tlsdesc_entries): New method.
994 (Target_aarch64::got_mod_index_entry): New method.
995 (Target_aarch64::rela_tlsdesc_section): New method.
996 (Target_aarch64::rela_irelative_section): New method.
997 (Target_aarch64::Tlsdesc_info): New struct.
998 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
999 relocations and tlsdesc relocations.
1000 (Target_aarch64::optimize_tls_reloc): Implement method.
1001 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
1002 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
1003 in constructor.
1004 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
1005 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
1006 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
1007 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
1008 (Output_data_plt_aarch64::rela_tlsdesc): New method.
1009 (Output_data_plt_aarch64::rela_irelative): New method.
1010 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
1011 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
1012 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
1013 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
1014 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
1015 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
1016 (Output_data_plt_aarch64_standard): New member variables:
1017 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
1018 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
1019 New parameter: got, got_irelative.
1020 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
1021 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
1022 (Output_data_plt_aarch64::do_write): Replace got_address with
1023 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
1024 (AArch64_relocate_functions::update_movnz): New method.
1025 (AArch64_relocate_functions): Correct format.
1026 (AArch64_relocate_functions::movnz): New method.
1027 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
1028 before the switch. Add new cases to switch.
00cac886 1029 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
1030 tlsgd tlsdesc cases.
1031 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
1032 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
1033 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
1034 Call reloc_name_in_error_message to print unsupported reloc.
1035 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
1036 make_data_plt.
1037 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
1038 relocs. Fill in some more dynamic tags.
1039 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
1040 Skip call tls_get_addr when tlsgd is relaxed.
1041 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
1042 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
1043 tlsdesc->ie relaxation.
1044
62661c93
SS
10452014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1046
1047 * mips.cc (Target_mips_nacl): New class.
1048 (Target_selector_mips_nacl): New class.
1049 (target_selector_mips32): Rename from target_selector_mips32be and use
1050 Target_selector_mips_nacl instead of Target_selector_mips.
1051 (target_selector_mips32el): Rename from target_selector_mips32 and use
1052 Target_selector_mips_nacl instead of Target_selector_mips.
1053 (target_selector_mips64): Rename from target_selector_mips64be and use
1054 Target_selector_mips_nacl instead of Target_selector_mips.
1055 (target_selector_mips64el): Rename from target_selector_mips64 and use
1056 Target_selector_mips_nacl instead of Target_selector_mips.
1057 (Target_mips::mips_info): Add const attribute.
1058
54674d38
CC
10592014-09-02 Cary Coutant <ccoutant@google.com>
1060
1061 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
1062 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
1063 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
1064 (Sized_incr_dynobj::do_section_name): Likewise.
1065 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
1066 (Sized_incr_dynobj::do_section_name): Likewise.
1067 * object.h (Object::section_name): Likewise.
1068 (Object::do_section_name): Likewise.
1069 (Sized_relobj_file::do_section_name): Likewise.
1070 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
1071 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
1072
9860cbcf
CC
10732014-09-02 Cary Coutant <ccoutant@google.com>
1074
1075 PR gold/17005
1076 * ehframe.cc (Fde::write): Add output_offset parameter.
1077 (Cie::write): Likewise.
1078 (Eh_frame::set_final_data_size): Account for offset within output
1079 section.
1080 (Eh_frame::do_sized_write): Likewise.
1081 * ehframe.h (Fde::write): Add output_offset parameter.
1082 (Cie::write): Likewise.
1083 * output.cc (Output_section::Input_section_sort_entry): Remove
1084 section_has_name_; add output_section_name parameter. Use
1085 output section name for non-input sections.
1086 (Output_section::Input_section_sort_entry::section_has_name): Remove.
1087 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
1088 (Output_section::Input_section_sort_compare): Remove logic for
1089 sections without names.
1090 (Output_section::Input_section_sort_init_fini_compare): Likewise.
1091 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
1092 Likewise.
1093 (Output_section::Input_section_sort_section_name_compare): Likewise.
1094
8e33481e
HS
10952014-08-29 Han Shen <shenhan@google.com>
1096 Jing Yu <jingyu@google.com>
1097
1098 * aarch64-reloc-property.cc
1099 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
1100 reference reloc property in the table.
1101 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
1102 3 other entries.
1103 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
1104 2 new overloaded methods.
1105 (Output_data_got_aarch64::do_write): Add code to write out
1106 static relocs.
1107 (class Output_data_got_aarch64::Static_reloc): New class to wrap
1108 static relocs.
1109 (Output_data_got_aarch64::static_relocs): New vector to
1110 hold static relocs.
1111 (Target_aarch64::TCB_SIZE): New const static memeber.
1112 (Target_aarch64::tcb_size): New method.
1113 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
1114 (Target_aarch64::Relocate::relocate_tls): New method.
1115 (Target_aarch64::Scan::local): Add code handling new reloc types.
1116 (Target_aarch64::Scan::global): Add code handling new reloc types.
1117
81233653
ST
11182014-08-13 Sriraman Tallam <tmsriram@google.com>
1119
1120 * options.h (-no-pie): Add option.
1121
9363c7c3
JY
11222014-08-08 Jing Yu <jingyu@google.com>
1123 Han Shen <shenhan@google.com>
1124
1125 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
1126 (DEFFILES): add aarch64-reloc.def.
1127 (TARGETSOURCES): Add aarch64-reloc-property.cc.
1128 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
1129 * Makefile.in: Regenerate.
1130 * aarch64-reloc-property.cc: New file.
1131 * aarch64-reloc-property.h: New file.
1132 * aarch64-reloc.def: New file.
1133 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
1134 with tab to make the format consistent.
1135 (Output_data_got_aarch64::symbol_table_): New method.
1136 (Target_aarch64::do_plt_address_for_global): New method.
1137 (Target_aarch64::do_plt_address_for_local): New method.
1138 (Target_aarch64::do_select_as_default_target): New method.
1139 (Target_aarch64::do_make_data_plt): New method.
1140 (Target_aarch64::make_data_plt): New method.
1141 (Output_data_plt_aarch64::has_irelative_section): New method.
1142 (Output_data_plt_aarch64::address_for_global): New method.
1143 (Output_data_plt_aarch64::address_for_local): New method.
1144 (Output_data_plt_aarch64::irelative_rel_): New parameter.
1145 (Output_data_plt_aarch64::add_entry): Implement contents.
1146 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
1147 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
1148 the got_pov entry to plt0.
1149 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
1150 Implement contents.
1151 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
1152 (AArch64_howto): New struct.
1153 (aarch64_howto[]): New static const array.
1154 (AArch64_relocate_functions): New class.
1155 (Target_aarch64::Scan::get_reference_flags): Remove method.
1156 (Target_aarch64::Scan::local): Implement to support a few relocations.
1157 (Target_aarch64::Scan::global): Implement to support a few relocations.
1158 (Target_aarch64::make_plt_section): Implement contents.
1159 (Target_aarch64::make_plt_entry): Implement contents.
1160 (Target_aarch64::do_finalize_sections): Implement contents.
1161 (Target_aarch64::Relocate::relocate): Implement a few relocations.
1162 (Target_aarch64::relocate_section): Implement contents.
1163
ad9fe6c1
AM
11642014-08-06 Alan Modra <amodra@gmail.com>
1165
1166 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
1167
7cd4e5b7
AM
11682014-08-06 Alan Modra <amodra@gmail.com>
1169
1170 PR 13227
1171 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
1172
5ad9b0a7
ST
11732014-07-21 Sriraman Tallam <tmsriram@google.com>
1174
1175 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 1176 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 1177
e051745c
CC
11782014-07-08 Cary Coutant <ccoutant@google.com>
1179
1180 * expression.cc (struct Expression::Expression_eval_info): Add
1181 new fields type_pointer, vis_pointer, and nonvis_pointer.
1182 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
1183 nonvis_pointer parameters. Adjust all calls.
1184 (Symbol_expression::value): Update type, visibility, and nonvis bits
1185 in caller.
1186 * script.cc (Symbol_assignment::sized_finalize): Update type,
1187 visibility, and remaining st_other bits for new symbol.
1188 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
1189 vis_pointer, and nonvis_pointer parameters.
1190 * symtab.h (Symbol::set_type): New method.
1191
1192 * testsuite/Makefile.am (defsym_test): New test.
1193 * testsuite/Makefile.in: Regenerate.
1194 * testsuite/defsym_test.c: New file.
1195 * testsuite/defsym_test.sh: New file.
1196
f35c4853
CC
11972014-07-08 Cary Coutant <ccoutant@google.com>
1198
1199 PR gold/15639
1200 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
1201 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
1202 (Sized_dynobj::base_read_symbols): ...new method.
1203 * object.h (Sized_relobj_file::base_read_symbols): New method.
1204 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
1205 (Sized_relobj_file::base_read_symbols): ...new method.
1206 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
1207 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
1208 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
1209
2900af2d
AM
12102014-07-04 Alan Modra <amodra@gmail.com>
1211
1212 * po/POTFILES.in: Regenerate.
1213
053a4d68
JY
12142014-07-02 Jing Yu <jingyu@google.com>
1215
1216 * aarch64.cc: New file
1217 * Makefile.am (TARGETSOURCES): Add aarch64.cc
1218 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
1219 * Makefile.in: Regenerate.
1220 * configure.tgt: Add entries for aarch64*.
1221 * configure.ac: Likewise.
1222 * configure: Likewise.
1223
7b549045
AM
12242014-06-27 Alan Modra <amodra@gmail.com>
1225
1226 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
1227
cb818dbf
CC
12282014-06-24 Cary Coutant <ccoutant@google.com>
1229
1230 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
1231 sections.
1232 (Dwo_file::sized_read_unit_index): Likewise.
1233
9810d34d
SS
12342014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1235
1236 * mips.cc: New file.
1237 * Makefile.am (TARGETSOURCES): Add mips.cc
1238 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
1239 * configure.tgt: Add entries for mips*.
1240 * configure.ac: Likewise.
1241 * Makefile.in: Regenerate.
1242 * configure: Likewise.
1243
9baa787b
CC
12442014-06-09 Cary Coutant <ccoutant@google.com>
1245
1246 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
1247 unit_length is within section bounds.
1248
8f89af0a
CC
12492014-06-09 Cary Coutant <ccoutant@google.com>
1250
1251 PR gold/16980
1252 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
1253 map.
1254
a47622ac
AM
12552014-06-07 Alan Modra <amodra@gmail.com>
1256
1257 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
1258
4320c691
CC
12592014-06-06 Cary Coutant <ccoutant@google.com>
1260
1261 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
1262 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
1263 (Dwarf_pubnames_table::read_header): Likewise.
1264 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
1265 .debug_gnu_pubtypes.
1266
270c9937
JB
12672014-06-05 Joel Brobecker <brobecker@adacore.com>
1268
1269 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
1270 * Makefile.in, configure: Regenerate.
1271
397998fc
AM
12722014-06-03 Alan Modra <amodra@gmail.com>
1273
1274 * powerpc.cc (addis_12_2): Define.
1275 (Stub_table::do_write): Support fusion on ELFv2 stubs.
1276
61f5c66f
AM
12772014-06-03 Alan Modra <amodra@gmail.com>
1278
1279 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
1280 st_other output.
1281
f6971787
AM
12822014-06-02 Alan Modra <amodra@gmail.com>
1283
1284 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
1285 Only ignore relocs on ELFv1.
1286 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
1287
f6fb8322
CC
12882014-05-30 Cary Coutant <ccoutant@google.com>
1289
1290 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
1291 * testsuite/Makefile.in: Regenerate.
1292 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
1293
c23dd342
L
12942014-05-27 H.J. Lu <hongjiu.lu@intel.com>
1295
1296 PR gold/16945
1297 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
1298 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
1299
5fe7ffdc
AM
13002014-05-15 Alan Modra <amodra@gmail.com>
1301
1302 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
1303 Compare FDE contents with DW_CFA_nop rather than 0.
1304
a82bef93
ST
13052014-05-13 Sriraman Tallam <tmsriram@google.com>
1306
1307 * symtab.h (may_need_copy_reloc): Remove check for position independent
1308 code.
1309 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
1310 position independence before pc absolute may_need_copy_reloc call.
1311 Add check for executable output befor pc relative may_need_copy_reloc
1312 call.
1313 * i386.cc: Ditto.
1314 * arm.cc: Ditto.
1315 * sparc.cc: Ditto.
1316 * tilegx.cc: Ditto.
1317 * powerpc.cc: Add check for no position independence before
1318 may_need_copy_reloc calls.
1319 * testsuite/pie_copyrelocs_test.cc: New file.
1320 * testsuite/pie_copyrelocs_shared_test.cc: New file.
1321 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 1322 * Makefile.in: Regenerate.
a82bef93 1323
53c66605
ML
13242014-05-08 Martin Liška <mliska@suse.cz>
1325
1326 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
1327
57b2284c
CC
13282014-05-06 Cary Coutant <ccoutant@google.com>
1329
1330 PR gold/16900
1331 * i386.cc (Output_data_got_plt_i386): New class.
1332 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
1333 parameter. Change all callers.
1334 (Output_data_plt_i386::layout_): Remove.
1335 (Output_data_plt_i386::got_plt_): Change type.
1336 (Target_i386::got_plt_): Change type. Change all references.
1337 (Target_i386::got_section): Create instance of new class.
1338 (Output_data_got_plt_i386::do_write): New function.
1339 * x86_64.cc (Output_data_got_plt_x86_64): New class.
1340 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
1341 parameter. Change all callers.
1342 (Output_data_plt_x86_64::layout_): Remove.
1343 (Output_data_plt_x86_64::got_plt_): Change type.
1344 (Target_x86_64::got_plt_): Change type. Change all references.
1345 (Target_x86_64::got_section): Create instance of new class.
1346 (Output_data_got_plt_x86_64::do_write): New function.
1347 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
1348 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
1349 class.
1350
6b97515d 13512014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 1352
6b97515d
CC
1353 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
1354 if we have pubnames/pubtypes.
1355
d1bddd3c
CC
13562014-05-02 Cary Coutant <ccoutant@google.com>
1357
5fe7ffdc
AM
1358 * defstd.cc (in_segment): Define __ehdr_start here...
1359 * layout.cc (Layout::finalize): ...Instead of here. Set the
1360 output segment when known.
1361 * resolve.cc (Symbol::override_base_with_special): Remember
1362 the original binding.
1363 * symtab.cc (Symbol::set_output_segment): New function.
1364 (Symbol::set_undefined): New function.
1365 * symtab.h (Symbol::is_weak_undefined): Check original undef
1366 binding.
1367 (Symbol::is_strong_undefined): New function.
1368 (Symbol::set_output_segment): New function.
1369 (Symbol::set_undefined): New function.
1370 * target-reloc.h (is_strong_undefined): Remove.
1371 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
1372 Check for hidden undefs.
1373 (relocate_section): Call Symbol::is_strong_undefined.
1374
1375 * testsuite/Makefile.am (ehdr_start_test_1)
1376 (ehdr_start_test_2, ehdr_start_test_3)
1377 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
1378 * testsuite/Makefile.in: Regenerate.
1379 * testsuite/ehdr_start_def.cc: New source file.
1380 * testsuite/ehdr_start_test.cc: New source file.
1381 * testsuite/ehdr_start_test.t: New linker script.
1382 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 1383
7849f6d8
CC
13842014-04-23 Cary Coutant <ccoutant@google.com>
1385
bf2cc635 1386 PR gold/16870
7849f6d8
CC
1387 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
1388
99fd8cff
CC
13892014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1390
1391 * layout.cc (Layout::include_section): Allow a target to decide
1392 whether to include a section.
1393 * target.h (Target::should_include_section): New function.
1394 (Target::do_should_include_section): New function.
1395
91f43acd
CC
13962014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1397
1398 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
1399 inline into ...
1400 (Copy_relocs::emit): ... here.
1401 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
1402 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
1403 (Copy_reloc_entry::entries_): Change from private to protected.
1404
c4eb27e1
ST
14052014-04-02 Sriraman Tallam <tmsriram@google.com>
1406
1407 * icf.cc (get_section_contents): Replace copies of reloc
1408 vectors with const references.
1409
ae447ddd
CC
14102014-04-02 Cary Coutant <ccoutant@google.com>
1411
1412 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
1413 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
1414 * configure: Regenerate.
1415 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
1416 -fno-use-linker-plugin.
1417 (LINK1, CXXLINK1): Add it to the link command.
1418 * testsuite/Makefile.in: Regenerate.
1419
fa47fa92
AM
14202014-03-12 Alan Modra <amodra@gmail.com>
1421
1422 * Makefile.in: Regenerate.
1423
9b12c500
CC
14242014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1425
1426 * symtab.h (Symbol::set_nonvis): New function.
1427
beacaa96
CC
14282014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1429
1430 * symtab.cc (Sized_symbol<32>::init_output_data):
1431 Instantiate the template.
1432 (Sized_symbol<64>::init_output_data): Likewise.
1433
800d9823
CC
14342014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1435
1436 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
1437 adjust dynamic symbol value.
1438 * target.h (Target::adjust_dyn_symbol): New function.
1439 (Target::do_adjust_dyn_symbol): New function.
1440
918fc1f8 14412014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 1442
918fc1f8
CC
1443 * output.cc (Output_data_dynamic::Dynamic_entry::write):
1444 Get the value of DYNAMIC_CUSTOM dynamic entry.
1445 * output.h (Output_data_dynamic::add_custom): New function.
1446 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
1447 dynamic entry.
1448 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
1449 * target.h (Target::dynamic_tag_custom_value): New function.
1450 (Target::do_dynamic_tag_custom_value): New function.
1451
98ff9231
CC
14522014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1453
1454 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
1455 dynsym indexes.
1456 * target.h (Target::has_custom_set_dynsym_indexes): New function.
1457 (Target::do_has_custom_set_dynsym_indexes): New function.
1458 (Target::set_dynsym_indexes): New function.
1459 (Target::do_set_dynsym_indexes): New function.
1460
b80eed39
AM
14612014-03-07 Alan Modra <amodra@gmail.com>
1462
1463 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
1464 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
1465 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
1466 (Powerpc_relocate_functions::has_overflow_bitfield,
1467 overflowed): Use the above.
1468 (Target_powerpc::Relocate::relocate): Correct overflow checking
1469 for a number of relocations. Modify overflow test for 16-bit
1470 fields in instructions to signed/unsigned according to whether
1471 the field takes a signed or unsigned value.
1472
4b95cf5c
AM
14732014-03-05 Alan Modra <amodra@gmail.com>
1474
1475 Update copyright years.
1476
45965137
AM
14772014-03-05 Alan Modra <amodra@gmail.com>
1478
1479 * powerpc.cc (Target_powerpc::Scan::local, global): Support
1480 R_PPC64_ADDR64_LOCAL.
1481 (Target_powerpc::Relocate::relocate): Likewise.
1482
2c80b753
AM
14832014-03-03 Alan Modra <amodra@gmail.com>
1484
1485 * dwp.cc (print_version): Update copyright year to current.
1486
c1c69e83
AM
14872014-02-10 Alan Modra <amodra@gmail.com>
1488
1489 * po/gold.pot: Regenerate.
1490
dd0c4e70
CC
14912014-02-06 Cary Coutant <ccoutant@google.com>
1492
1493 Fix problem where -u is ignored when a weak undef is seen.
1494
1495 * archive.cc (Library_base::should_include_member): Reorder
1496 code to check for -u option if a weak undef has already been seen.
1497 * testsuite/Makefile.am (weak_undef_test_2): New test case.
1498 * testsuite/Makefile.in: Regenerate.
1499 * testsuite/weak_undef_file3.cc: New file.
1500 * testsuite/weak_undef_file4.cc: New file.
1501 * testsuite/weak_undef_test_2.cc: New file.
1502
1a221d3d
CC
15032014-02-05 Cary Coutant <ccoutant@google.com>
1504
1505 Fix issues with gold undefined symbol diagnostics.
1506
1507 PR binutils/15435
1508 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
1509 check to here.
1510 * target-reloc.h (is_strong_undefined): New function.
1511 (relocate_section): Move undef vtable symbol check from here.
1512 Check for is_strong_undefined.
1513
e889f0a4 15142014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 1515
e889f0a4
CC
1516 Fix problems with the --dynamic-list option.
1517
1518 PR gold/13577
1519 * options.cc (General_options::parse_dynamic_list):
1520 Set have_dynamic_list_.
1521 (General_options::General_options): Initialize have_dynamic_list_.
1522 (General_options::finalize): Turn off -Bsymbolic and
1523 -Bsymbolic-functions if --dynamic-list provided.
1524 * options.h (General_options::have_dynamic_list): New function.
1525 (General_options::have_dynamic_list_): New data member.
1526 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
1527 correctly.
5fe7ffdc 1528
e889f0a4
CC
1529 PR gold/16530
1530 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
1531 in --dynamic-list, mark it.
5fe7ffdc 1532
e889f0a4
CC
1533 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
1534 (dynamic_list_2): New test case.
1535 * testsuite/Makefile.in: Regenerate.
1536 * testsuite/dynamic_list_2.cc: New file.
1537 * testsuite/dynamic_list_2.t: New file.
1538 * testsuite/dynamic_list_lib1.cc: New file.
1539 * testsuite/dynamic_list_lib2.cc: New file.
1540 * testsuite/gc_dynamic_list_test.c: New file.
1541 * testsuite/gc_dynamic_list_test.sh: New file.
1542 * testsuite/gc_dynamic_list_test.t: New file.
1543
ec673e64
CC
15442014-01-28 Cary Coutant <ccoutant@google.com>
1545
1546 Add .gdb_index version 7 support.
1547
1548 * gold/dwarf_reader.cc: include <utility> (for make_pair).
1549 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
1550 debug sections.
1551 (Dwarf_ranges_table::read_ranges_table): Likewise.
1552 (Dwarf_pubnames_table::read_section): Check for GNU-style
1553 sections, and for compressed debug sections.
1554 (Dwarf_pubnames_table::read_header): Compute end address of table.
1555 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
1556 for end of list by offset, not by offset == 0.
1557 (Dwarf_info_reader::do_read_string_table): Check for compressed
1558 debug sections.
1559 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1560 Initialize new data members.
1561 (Dwarf_pubnames_table::next_name): return flag_byte.
1562 (Dwarf_pubnames_table::end_of_table_): New data member.
1563 (Dwarf_pubnames_table::is_gnu_style_): New data member.
1564 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
1565 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
1566 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
1567 read skeleton type unit DIEs.
1568 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
1569 (Gdb_index::do_write): Write flag_byte.
1570 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
1571 (Gdb_index::Cu_vector): Store flags along with cu indexes.
1572 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
1573 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
1574
221fd5d5
L
15752014-01-08 H.J. Lu <hongjiu.lu@intel.com>
1576
1577 * version.cc (print_version): Update copyright year to 2014.
1578
6c09fb0b
ILT
15792013-12-19 Dimitry Andric <dimitry@andric.com>
1580
1581 * stringpool.cc (Stringpool_template::reserve): Add
1582 HAVE_UNORDERED_MAP case.
1583 * stringpool.cc (Stringpool_template::print_stats): Likewise.
1584
8356f2d0
CC
15852013-12-18 Cary Coutant <ccoutant@google.com>
1586
1587 * configure.ac: Check for <unordered_set> and <unordered_map>.
1588 * config.in: Regenerate.
1589 * configure: Regenerate.
1590 * system.h: Use <unordered_set> and <unordered_map> if available.
1591
f2c7d7ee
RM
15922013-12-10 Roland McGrath <mcgrathr@google.com>
1593
1594 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
1595 with $(INSTALL_PROGRAM_ENV).
1596 * Makefile.in: Regenerate.
1597
6632e8cc
CC
15982013-11-22 Cary Coutant <ccoutant@google.com>
1599
1600 * configure.ac: Add check for which library is needed for
1601 dlopen.
1602 * configure: Regenerate.
1603
0c075858
CC
16042013-11-22 Cary Coutant <ccoutant@google.com>
1605
1606 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
1607 assembler.
1608 * testsuite/Makefile.in: Regenerate.
1609
f49fe902
L
16102013-11-17 H.J. Lu <hongjiu.lu@intel.com>
1611
1612 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
1613 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
1614 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
1615 (Target_x86_64<size>::Scan::local): Likewise.
1616 (Target_x86_64<size>::Scan::global): Likewise.
1617 (Target_x86_64<size>::Relocate::relocate): Likewise.
1618 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
1619 Likewise.
1620 (Target_x86_64<size>::Scan::check_non_pic(): Handle
1621 R_X86_64_PC32_BND.
1622
1623 * testsuite/Makefile.am (check_PROGRAMS): Add
1624 exception_x86_64_bnd_test.
1625 (exception_x86_64_bnd_test_SOURCES): New macro.
1626 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
1627 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
1628 (exception_x86_64_bnd_test_LDADD): Likewise.
1629 (exception_x86_64_bnd_1.o): New rule.
1630 (exception_x86_64_bnd_2.o): Likewise.
1631 * testsuite/Makefile.in: Regenerated.
1632
9055360d
AM
16332013-11-15 Alan Modra <amodra@gmail.com>
1634
1635 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
1636 accessor.
1637 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
1638 Only call ppc64_local_entry_offset for 64-bit. Restrict
1639 symval_for_branch lookup to ELFv1.
1640 (Stub_table::add_plt_call_entry): Use unsigned int off.
1641 (Output_data_glink::Address, invalid_address): New.
1642 (Output_data_glink::add_eh_frame): Move out of line. Add
1643 support for ELFv2.
1644 (Output_data_glink::add_global_entry, find_global_entry,
1645 global_entry_address): New functions.
1646 (Output_data_glink::global_entry_stubs_, end_branch_table_,
1647 ge_size): New variables.
1648 (Output_data_glink::set_final_data_size): Add global entry
1649 stub sizing.
1650 (Output_data_glink::do_write): Write global entry stubs.
1651 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
1652 parameter. Return true for ELFv2. Adjust callers.
1653 (Target_powerpc::Scan::local, global): Restrict opd lookup to
1654 ELFv1. Similarly for ifunc and dynamic relocation processing
1655 specific to ELFv1. Recognize that symbols are defined on
1656 their plt entries for ELFv2.
1657 (Target_powerpc::symval_for_branch): Assert if called for
1658 ELFv2 or ppc32.
1659 (Target_powerpc::Relocate::relocate): Use global entry plt
1660 stub for symbol value if such exists on ELFv2.
1661 (Target_powerpc::Relocate::relocate): Don't call
1662 symval_for_branch when ELFv2. Do adjust for local entry
1663 offset when ELFv2.
1664 (Target_powerpc::do_dynsym_value): Set symbols to global entry
1665 plt stub for ELFv2.
1666 (Target_powerpc::do_plt_address_for_global): Similarly.
1667
cafdd569
CC
16682013-11-14 Cary Coutant <ccoutant@google.com>
1669
1670 Revert patch -- this did not fix the problem, and there is
1671 no race there.
1672
1673 2013-11-14 Cary Coutant <ccoutant@google.com>
1674
1675 PR gold/14860
1676 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1677 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1678 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1679 updating fde_offsets_.
1680 (Eh_frame_hdr::lock_): New data member.
1681
94e49e16
CC
16822013-11-14 Cary Coutant <ccoutant@google.com>
1683
1684 * dwp.cc (Dwo_file_entry): New type.
1685 (File_list): Use Dwo_file_entry.
1686 (Dwo_file::verify): New function.
1687 (Dwo_file::verify_dwo_list): New function.
1688 (Dwo_file::sized_verify_dwo_list): New function.
1689 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
1690 list.
1691 (Dwp_options): New enum type.
1692 (dwp_options): Add --verify-only.
1693 (usage): Likewise.
1694 (main): Likewise.
1695 * dwp.h (gold_info): Add declaration.
1696
7cdd7d57
CC
16972013-11-14 Cary Coutant <ccoutant@google.com>
1698
1699 PR gold/14860
1700 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1701 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1702 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1703 updating fde_offsets_.
1704 (Eh_frame_hdr::lock_): New data member.
1705
1d946cb3
CC
17062013-11-06 Cary Coutant <ccoutant@google.com>
1707
1708 PR gold/15758
1709 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
1710 before reloc sections.
1711
4f65b40e
AM
17122013-11-04 Alan Modra <amodra@gmail.com>
1713
1714 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
1715 (Symbol::needs_dynamic_reloc): Test new flag.
1716 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
1717 (Target_powerpc::Scan::get_reference_flags): Add target param.
1718 Return FUNC_DESC_ABI for 64-bit ELFv1.
1719 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
1720 call.
1721 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
1722 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
1723
908794a9
CC
17242013-10-31 Cary Coutant <ccoutant@google.com>
1725
1726 Restore support for dwp v2 DWARF package file format.
1727
1728 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1729 tu_length parameter. Adjust all callers.
1730 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1731 * dwp.cc: Include dwarf.h.
1732 (Section_bounds): New struct type.
1733 (Unit_set): New struct type.
1734 (Dwo_file::Dwo_file): Initialize new data member.
1735 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1736 Combine and rename to...
1737 (Dwo_file::read_unit_index): ...this.
1738 (Dwo_file::sized_read_compunit_index)
1739 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1740 (Dwo_file::sized_read_unit_index): ...this.
1741 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1742 parameters; add section_id parameter.
1743 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1744 (Dwo_file::add_unit_set): ...this.
1745 (Dwo_file::shndx_map_): Remove.
1746 (Dwo_file::sect_offsets_): New data member.
1747 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1748 (Dwp_output_file::add_section): Rename to...
1749 (Dwp_output_file::add_contribution): ...this.
1750 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1751 (Dwp_output_file::add_tu_set): Likewise.
1752 (Dwp_output_file::Contribution): New type.
1753 (Dwp_output_file::Section::contributions): New data member.
1754 (Dwp_output_file::Cu_or_tu_set): Remove.
1755 (Dwp_output_file::Section::Section): New ctor.
1756 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1757 (Dwp_output_file::Dwp_index::Section_table): New type.
1758 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1759 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1760 parameter.
1761 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1762 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1763 (Dwp_output_file::Dwp_index::section_table): New member function.
1764 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1765 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1766 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1767 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1768 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1769 (Dwp_output_file::Dwp_index::section_table_): New data member.
1770 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1771 (Dwp_output_file::add_output_section): New member function.
1772 (Dwp_output_file::write_new_section): New member function.
1773 (Dwp_output_file::write_contributions): New member function.
1774 (Dwp_output_file::section_id_map_): New data member.
1775 (class Dwo_id_info_reader): Remove.
1776 (class Unit_reader): New class.
1777 (get_dwarf_section_name): New function.
1778 (Dwo_file::read_executable): Adjust initializations of class data.
1779 (Dwo_file::read): Add support for v2 package file format.
1780 (Dwo_file::read_unit_index): Likewise.
1781 (Dwo_file::sized_read_unit_index): Likewise.
1782 (Dwo_file::copy_section): Likewise.
1783 (Dwo_file::add_unit_set): Likewise.
1784 (Dwp_output_file::add_output_section): Likewise.
1785 (Dwp_output_file::add_contribution): Likewise.
1786 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1787 for empty slot.
1788 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1789 file format.
1790 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1791 slot.
1792 (Dwp_output_file::initialize): Remove unused function.
1793 (Dwp_output_file::finalize): Add support for v2 package file format.
1794 (Dwp_output_file::write_index): Likewise.
1795 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1796 function prototype.
1797
2500c017
CC
17982013-10-31 Cary Coutant <ccoutant@google.com>
1799
1800 * configure.ac: Fix check for -fmerge-constants.
1801 * configure.ac: Regenerate.
1802
dd0845d7
RM
18032013-10-30 Roland McGrath <mcgrathr@google.com>
1804
1805 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
1806 Correct 9-byte nop sequence to match what the assembler generates.
1807
b4f7960d
AM
18082013-10-30 Alan Modra <amodra@gmail.com>
1809
1810 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
1811 ppc64_local_entry_offset, ppc64_local_entry_offset,
1812 do_read_symbols): New functions.
1813 (Powerpc_relobj::e_flags_, st_other_): New vars.
1814 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
1815 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
1816 (Powerpc_relobj::e_flags_): New var.
1817 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
1818 and adjust for ELFv2.
1819 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
1820 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
1821 (Powerpc_dynobj::do_find_special_sections): Likewise.
1822 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
1823 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
1824 to ELFv2 local entry.
1825 (Target_powerpc::do_relax): No thread safe barriers needed for
1826 ELFv2.
1827 (Output_data_plt_powerpc::initial_plt_entry_size_,
1828 plt_entry_size): Delete. Replace all uses with
1829 first_plt_entry_offset() and plt_entry_size().
1830 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
1831 reserved_size parm. Update callers.
1832 (Output_data_plt_powerpc::entry_count): Update.
1833 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
1834 and use Target_powerpc::first_plt_entry_offset().
1835 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
1836 rename to plt_entry_size.
1837 (Output_data_plt_powerpc::add_ifunc_entry,
1838 add_local_ifunc_entry): Adjust reloc for ELFv2.
1839 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
1840 (glink_eh_frame_fde_64v2): New.
1841 (Stub_table::plt_call_size): Support ELFv2 sizing.
1842 (Output_data_glink::add_eh_frame): Use the new FDE.
1843 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
1844 (Stub_table::do_write): Write ELFv2 stubs and glink.
1845 (Target_powerpc::Relocate::relocate): Replaces nop after call
1846 with ld 2,24(1) and adjust local offset destination for ELFv2.
1847
f9c6b907
AM
18482013-10-30 Alan Modra <amodra@gmail.com>
1849
1850 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
1851 (Target_powerpc::Scan::global, local): Likewise.
1852 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
1853 on all ppc64 @h and @ha relocs.
1854
e84fe78f
AM
18552013-10-14 Alan Modra <amodra@gmail.com>
1856
1857 * output.h (Output_data_got::add_constant): Tidy.
1858 (Output_data_got::add_constant_pair): New function.
1859 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
1860 methods used so as to first call reserve_ent().
1861
679e4abf
RM
18622013-10-11 Roland McGrath <mcgrathr@google.com>
1863
44dcb735
RM
1864 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
1865 add_got_entry and add_got_entry_pair.
1866
13323c49
RM
1867 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
1868 (HAVE_PUBNAMES): Likewise.
1869 * configure: Regenerate.
1870
1496b446
RM
1871 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
1872 * testsuite/Makefile.in: Regenerate.
1873
cc84c10b
RM
1874 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
1875 Remove const from declaration.
1876 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
1877 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
1878 * output.h (Output_file_header): Remove const from member target_
1879 and corresponding constructor argument.
1880 * output.cc (Output_file_header::Output_file_header): Update prototype.
1881 (Output_file_header::do_sized_write): Use this->target_ in place
1882 of parameters()->target().
1883
52f66a2c
RM
1884 * testsuite/undef_symbol.cc (Foo::get_a): New method.
1885
2b64b551
RM
1886 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
1887 * configure: Regenerate.
1888 * Makefile.in: Regenerate.
1889 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
1890 * testsuite/merge_string_literals_2.c: Likewise.
1891 * testsuite/Makefile.am
1892 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
1893 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
1894 literal -fmerge-constants.
1895 * testsuite/Makefile.in: Regenerate.
1896
43819297
RM
1897 * i386.cc (Target_i386): Remove unused member dynbss_.
1898 * arm.cc (Target_arm): Likewise.
1899 * powerpc.cc (Target_powerpc): Likewise.
1900 * sparc.cc (Target_sparc): Likewise.
1901 * tilegx.cc (Target_tilegx): Likewise.
1902 * x86_64.cc (Target_x86_64): Likewise.
1903 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
1904 type_signature_, type_offset_.
1905 * plugin.h (Plugin_hook): Remove unused member layout_.
1906 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
1907 mapfile_.
1908 (Read_member): Remove unused members input_objects_, symtab_,
1909 mapfile_, layout_.
1910 (Check_library): Remove unused member symtab_.
1911 * archive.h (Lib_group): Remove unused member lib_.
1912 * archive.cc (Lib_group::Lib_group): Update initializer.
1913 * incremental.h (Incremental_binary): Remove unused member target_.
1914 (Incremental_script_entry): Removed unused member script_.
1915 * layout.h (Write_symbols_task): Remove unused member input_objects_.
1916 * icf.h (Icf): Remove unused member num_tracked_relocs.
1917
39d9ead7
RM
1918 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
1919 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
1920 its only use.
1921 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
1922
679e4abf
RM
1923 * archive.h: Use struct rather than class for forward declaration
1924 of Read_symbols_data.
1925
54de2ea6
CC
19262013-10-07 Cary Coutant <ccoutant@google.com>
1927
1928 PR gold/16010
1929 * testsuite/Makefile.am (icf_test): Fix dependencies.
1930 (icf_safe_test): Likewise.
1931 (icf_safe_so_test): Likewise.
1932 (large_symbol_alignment): Add empty _LDADD rule.
1933 * testsuite/Makefile.in: Regenerate.
1934
b14016f0
L
19352013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
1936
1937 PR gold/15927
1938 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
1939 relocation for R_X86_64_32 on x32.
1940
eb426534
RM
19412013-08-27 Roland McGrath <mcgrathr@google.com>
1942
1943 * output.cc (Output_segment::set_section_addresses): Take new
1944 Target* argument. If target->isolate_execinstr() and the segment
1945 is executable and starts at a target->abi_pagesize() boundary,
1946 pad its end out to a target->abi_pagesize() boundary with code fill.
1947 * output.h (Output_segment::set_section_addresses): Update decl.
1948 * layout.h (Layout::check_output_data_for_reset_values): Take new
1949 argument RELAX_OUTPUTS.
1950 (Layout): New member relax_output_list_.
1951 (Layout::add_relax_output): New method.
1952 * layout.cc (Layout::Layout): Update constructor.
1953 (Layout::reset_relax_output): New method.
1954 (Layout::clean_up_after_relaxation): Call it.
1955 (Layout::prepare_for_relaxation): Update caller.
1956 (Layout::set_segment_offsets): Update callers of set_section_addresses.
1957 Call reset_relax_output before re-processing segments for
1958 isolate_execinstr case.
1959 (Layout::write_data): Handle relax_output_list_.
1960 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
1961 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
1962
9aff4b7a
NC
19632013-08-23 Yuri Chornoivan <yurchor@ukr.net>
1964
1965 PR binutils/15834
1966 * object.h: Fix typos.
1967
93f8221c
RM
19682013-08-16 Roland McGrath <mcgrathr@google.com>
1969
1970 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
1971 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
1972
e44c3715
CC
19732013-08-07 Cary Coutant <ccoutant@google.com>
1974
1975 Revert support for v2 DWP files:
1976
1977 2013-03-01 Cary Coutant <ccoutant@google.com>
1978
1979 Add dwp support for v2 DWARF package file format.
1980 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1981 tu_length parameter. Adjust all callers.
1982 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1983 * dwp.cc: Include dwarf.h.
1984 (Section_bounds): New struct type.
1985 (Unit_set): New struct type.
1986 (Dwo_file::Dwo_file): Initialize new data member.
1987 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1988 Combine and rename to...
1989 (Dwo_file::read_unit_index): ...this.
1990 (Dwo_file::sized_read_compunit_index)
1991 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1992 (Dwo_file::sized_read_unit_index): ...this.
1993 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1994 parameters; add section_id parameter.
1995 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1996 (Dwo_file::add_unit_set): ...this.
1997 (Dwo_file::shndx_map_): Remove.
1998 (Dwo_file::sect_offsets_): New data member.
1999 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2000 (Dwp_output_file::add_section): Rename to...
2001 (Dwp_output_file::add_contribution): ...this.
2002 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2003 (Dwp_output_file::add_tu_set): Likewise.
2004 (Dwp_output_file::Contribution): New type.
2005 (Dwp_output_file::Section::contributions): New data member.
2006 (Dwp_output_file::Cu_or_tu_set): Remove.
2007 (Dwp_output_file::Section::Section): New ctor.
2008 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2009 (Dwp_output_file::Dwp_index::Section_table): New type.
2010 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2011 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2012 parameter.
2013 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2014 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2015 (Dwp_output_file::Dwp_index::section_table): New member function.
2016 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2017 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2018 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2019 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2020 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2021 (Dwp_output_file::Dwp_index::section_table_): New data member.
2022 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2023 (Dwp_output_file::add_output_section): New member function.
2024 (Dwp_output_file::write_new_section): New member function.
2025 (Dwp_output_file::write_contributions): New member function.
2026 (Dwp_output_file::section_id_map_): New data member.
2027 (class Dwo_id_info_reader): Remove.
2028 (class Unit_reader): New class.
2029 (get_dwarf_section_name): New function.
2030 (Dwo_file::read_executable): Adjust initializations of class data.
2031 (Dwo_file::read): Add support for v2 package file format.
2032 (Dwo_file::read_unit_index): Likewise.
2033 (Dwo_file::sized_read_unit_index): Likewise.
2034 (Dwo_file::copy_section): Likewise.
2035 (Dwo_file::add_unit_set): Likewise.
2036 (Dwp_output_file::add_output_section): Likewise.
2037 (Dwp_output_file::add_contribution): Likewise.
2038 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2039 for empty slot.
2040 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2041 file format.
2042 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2043 slot.
2044 (Dwp_output_file::initialize): Remove unused function.
2045 (Dwp_output_file::finalize): Add support for v2 package file format.
2046 (Dwp_output_file::write_index): Likewise.
2047 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2048 function prototype.
2049
c6905c28
CC
20502013-07-31 Cary Coutant <ccoutant@google.com>
2051
2052 * object.cc (Sized_relobj::do_output_section_address): New function.
2053 (Sized_relobj): Instantiate explicitly.
2054 * object.h (Object::output_section_address): New function.
2055 (Object::do_output_section_address): New function.
2056 (Sized_relobj::do_output_section_address): New function.
2057 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
2058
20592013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 2060 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
2061
2062 * parameters.cc (Parameters::entry): Return target-specific entry
2063 symbol name.
2064 * target.h (Target::entry_symbol_name): New function.
2065 (Target_info::entry_symbol_name): New data member.
2066
2067 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
2068 * i386.cc (Target_i386::i386_info): Likewise.
2069 (Target_i386_nacl::i386_nacl_info): Likewise.
2070 * sparc.cc (Target_sparc::sparc_info): Likewise.
2071 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
2072 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
2073 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
2074 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2075
234d4ab8
SA
20762013-07-22 Sterling Augustine <saugustine@google.com>
2077
2078 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
2079 Convert parameter shndx to local variable. Add parameters symtab
2080 and symtab_size. Scan over section names. Find relocation
2081 section corresponding to current section. Create and initialize
2082 reloc_mapper_ and reloc_type_.
2083 (Dwarf_pubnames_table::read_header): Add assertion. Change
2084 unit_length to off_t. Initialize member unit_length_. Fill in field
2085 cu_offset_.
2086 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2087 Initialize new fields unit_length_ and cu_offset_.
2088 (Dwarf_pubnames_table::read_section): Update prototype.
2089 (Dwarf_pubnames_table::cu_offset): New member function.
2090 (Dwarf_pubnames_table::subsection_size): Likewise.
2091 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
2092 New fields.
2093 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
2094 member functions public.
2095 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
2096 Update comment. Rework logic. Move repeated parts to...
2097 (Gdb_index_info_reader::read_pubtable): ...here. New function.
2098 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
2099 pubtypes_table_, and stmt_list_offset.
2100 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2101 Gdb_index::find_pubtype_offset,
2102 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
2103 (Gdb_index::pubnames_read): Update prototype and rework logic.
2104 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
2105 Forward declare.
2106 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2107 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
2108 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
2109 Gdb_index::map_pubtable_to_dies):
2110 Declare functions.
2111 (Gdb_index::pubnames_read): Update declaration.
2112 (Gdb_index::Pubname_offset_map): New type.
2113 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
2114 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
2115 Gdb_index::stmt_list_offset): Declare.
2116 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
2117 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
2118 Gdb_index::pubtypes_offset_): Remove.
2119
a3ed37d8
RM
21202013-07-19 Roland McGrath <mcgrathr@google.com>
2121
2122 * options.h (General_options): Add -Trodata-segment option.
2123 * parameters.cc (Parameters::check_rodata_segment): New function.
2124 (Parameters::set_target_once): Call it.
2125 * parameters.h (Parameters): Declare it (private member function).
2126 * layout.cc (load_seg_unusable_for_headers): New function, broken
2127 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
2128 then validate rodata segment rather than text segment.
2129 (relaxation_loop_body): Call that.
2130 (is_text_segment): New function. Don't admit a non-executable
2131 segment if TARGET->isolate_execinstr().
2132 (set_segment_offsets): Call it. Honor -Trodata-segment option.
2133
eb5b4ded
CC
21342013-07-15 Shawn Landden <shawnlandden@gmail.com>
2135
2136 PR gold/15070
2137 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
2138 * nacl.h (Sniff_file::View::View): Request aligned view.
2139
4d5effb9
CC
21402013-07-11 Cary Coutant <ccoutant@google.com>
2141
2142 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
2143 correct BRLT entry size.
2144
ba8ca3e7
AM
21452013-07-03 Alan Modra <amodra@gmail.com>
2146
2147 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
2148 comment.
2149
267257d2
CC
21502013-07-01 Cary Coutant <ccoutant@google.com>
2151
2152 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
2153 reloc_type_.
2154 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
2155 (Dwarf_ranges_table::lookup_reloc): New function.
2156 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
2157 reloc_type_.
2158 (Dwarf_ranges_table::lookup_reloc): New function.
2159 (Dwarf_ranges_table::reloc_type_): New data member.
2160
06f30c9d
CC
21612013-06-27 Jing Yu <jingyu@google.com>
2162
2163 PR gold/15662
2164 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
2165 function.
2166 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
2167 (Target_powerpc::do_relax): Call the above.
2168
a2d7bf59
AM
21692013-06-27 Cary Coutant <ccoutant@google.com>
2170
2171 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
2172 on garbage collected .opd section.
2173
21742013-06-27 Alan Modra <amodra@gmail.com>
2175
2176 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
2177 is non-zero.
2178 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
2179 (Target_powerpc::do_function_location): Likewise for loc->shndx.
2180
32364e50
CC
21812013-06-14 Cary Coutant <ccoutant@google.com>
2182
2183 * resolve.cc (Symbol::override_base): Don't override st_type
2184 from plugin placeholder symbols.
2185 (Symbol_table::resolve): Likewise.
2186 (Symbol_table::should_override): Don't complain about TLS mismatch
2187 if the TO symbol is a plugin placeholder.
2188 * testsuite/Makefile.am (plugin_test_tls): New test.
2189 * testsuite/Makefile.in: Regenerate.
2190 * testsuite/plugin_test_tls.sh: New test script.
2191 * testsuite/two_file_test_2_tls.cc: New test source.
2192 * testsuite/two_file_test_tls.cc: New test source.
2193
7fb47cc9
CC
21942013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
2195
2196 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
2197 the maximum segment alignment is larger than the page size.
2198 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
2199 correctly aligns the symbols with large alignemnt.
2200 * testsuite/Makefile.in: Regenerate.
2201 * testsuite/large_symbol_alignment.cc: New file.
2202
6934001a
CC
22032013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
2204 Sriraman Tallam <tmsriram@google.com>
2205
2206 * options.h (sort_section): New option.
2207 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
2208 Rename from Input_section_sort_section_name_special_ordering_compare.
2209 (Input_section_sort_section_name_compare): New struct.
2210 * output.cc (Output_section::Input_section_sort_section_name_compare::
2211 operator()): New function.
2212 (Output_section::sort_attached_input_sections): Use new sort function
2213 for .text if --sort-section=name is specified.
2214 * layout.cc (Layout::make_output_section):
2215 Add sorting by name when --sort-section=name is specified.
2216 * testsuite/Makefile.am (text_section_grouping): Test option
2217 --sort-section=name.
2218 * testsuite/Makefile.in: Regenerate.
2219 * testsuite/section_sorting_name.cc: New file.
2220 * testsuite/section_sorting_name.sh: New file.
2221
93acabad
CC
22222013-05-21 Cary Coutant <ccoutant@google.com>
2223
2224 * symtab.h (Symbol::is_cxx_vtable): New function.
2225 * target-reloc.h (relocate_section): Check for vtable symbol.
2226 * testsuite/Makefile.am (missing_key_func.sh): New test case.
2227 * testsuite/Makefile.in: Regenerate.
2228 * testsuite/missing_key_func.cc: New test source.
2229 * testsuite/missing_key_func.sh: New test script.
2230
60e8b3fc
CC
22312013-05-21 Cary Coutant <ccoutant@google.com>
2232
2b64b551
RM
2233 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
2234 type of enclosing symbol.
2235 (Relocate_info::location): Check symbol type when describing symbol.
2236 * object.h (Symbol_location_info): Remove unused line_number;
2237 add enclosing_symbol_type.
2238 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 2239
9df9de2c
CC
22402013-05-13 Cary Coutant <ccoutant@google.com>
2241
2b64b551
RM
2242 * configure.ac: Export DEFAULT_TARGET.
2243 * configure: Regenerate.
2244 * Makefile.in: Regenerate.
2245 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
2246 * testsuite/Makefile.in: Regenerate.
2247 * testsuite/debug_msg.sh: Delete duplicate tests.
2248 Don't check undef_int error message match for powerpc where the
2249 source file and line number aren't available.
9df9de2c 2250
bbc5ae17
RM
22512013-05-10 Roland McGrath <mcgrathr@google.com>
2252
2253 * options.h (General_options): Add --rosegment-gap option.
2254 * options.cc (finalize): --rosegment-gap implies --rosegment.
2255 * layout.cc (set_segment_offsets): Let user option override
2256 target->rosegment_gap().
2257
0c6e6c39
RM
22582013-05-10 Roland McGrath <mcgrathr@google.com>
2259
2260 * options.h (General_options): Remove leading space from help
2261 messages for -nostdlib and --rosegment.
2262
cde7cb01
MR
22632013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
2264
2265 PR ld/15365
2266 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
2267
f31ae5b8
AM
22682013-05-03 Alan Modra <amodra@gmail.com>
2269
2270 * merge.cc (Output_merge_string::do_add_input_section): Correct
2271 scan for number of strings. Rename vars to avoid shadowing.
2272 Include missing terminator in input_size_.
2273
d3a7cd45
L
22742013-05-01 H.J. Lu <hongjiu.lu@intel.com>
2275
2276 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
2277 Restore empty string handling.
2278
6ad3daba
CC
22792013-05-01 Cary Coutant <ccoutant@google.com>
2280
2281 * stringpool.cc (Stringpool_template::new_key_offset): Fix
2282 uninitialized warning.
2283
e31908b6
CC
22842013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
2285
2286 * output.cc (Output_section::add_merge_input_section): Allow
2287 to merge sections if the alignment is more than character size.
2288 * merge.h (Output_merge_string::Output_merge_string): Remove
2289 assert.
2290 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
2291 only not-null strings. Check the alignment of strings.
2292 * stringpool.h
2293 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
2294 alignment as the argument.
2295 (Stringpool_template<Stringpool_char>::addralign_): New class member.
2296 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
2297 Align non-zero length strings according to the addralign_.
2298 (Stringpool_template<Stringpool_char>::set_string_offsets):
2299 Updating offsets according to the given alignment.
2300 * testsuite/Makefile.am (text_section_grouping): Test if string
2301 literals are getting merged.
2302 * testsuite/Makefile.in: Regenerate.
2303 * testsuite/merge_string_literals_1.c: New file.
2304 * testsuite/merge_string_literals_2.c: Ditto.
2305 * testsuite/merge_string_literals.sh: Ditto.
2306
0e804863
ILT
23072013-04-26 Ian Lance Taylor <iant@google.com>
2308
2309 * target-reloc.h (relocate_section): If the reloc offset is out of
2310 range, pass VIEW as NULL to relocate.relocate.
2311 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
2312 * i386.cc (Target_i386::Relocate::relocate): Likewise.
2313 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
2314 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
2315 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
2316 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
2317
e7c5ea40
CC
23182013-04-26 Geoff Pike <gpike@chromium.org>
2319
2320 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
2321 * layout.cc (Hash_task): New class.
2322 (Layout::queue_build_id_tasks): New function.
2323 (Layout::write_build_id): Handle single-thread portion of build ID
2324 computation. (In some cases, all of it is single-threaded.) Replace
2325 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
2326 functionality in fewer lines of code.
2327 * layout.h (Layout::queue_build_id_tasks): New function declaration.
2328 * options.h (General_options): make "--build-id" default to tree
2329 rather than sha1. Add two new options related to --build-id=tree:
2330 --build-id-chunk-size-for-treehash and
2331 --build-id-min-file-size-for-treehash.
2332 * Makefile.am: add testing of --build-id=tree and related new options
2333 (these tests will be invoked by "make check").
2334 * Makefile.in: Regenerate.
2335
49926cd0
AM
23362013-04-25 Alan Modra <amodra@gmail.com>
2337
2338 * configure.tgt: Add powerpcle and powerpc64le.
2339
a4034750
AM
23402013-04-22 Alan Modra <amodra@gmail.com>
2341
2342 PR gold/15355
2343 * layout.cc (Layout::segment_precedes): Allow more than one
2344 segment with the same type and flags.
2345
e79c84aa
CC
23462013-04-15 Cary Coutant <ccoutant@google.com>
2347
2348 * layout.cc (Layout::set_relocatable_section_offsets): Don't
2349 allocate space in file for BSS sections.
2350
2199fbe7
CC
23512013-04-15 Cary Coutant <ccoutant@google.com>
2352
2353 * script-sections.cc (Orphan_output_section): Reset address
2354 to zero after each orphaned section for relocatable links.
2355
502e8a84
CC
23562013-04-15 Cary Coutant <ccoutant@google.com>
2357
a4034750
AM
2358 * symtab.cc (Symbol_table::sized_write_globals): Subtract
2359 section starting address for relocatable link.
2360 * testsuite/Makefile.am (script_test_11): New test.
2361 * testsuite/Makefile.in: Regenerate.
2362 * testsuite/script_test_11.c: New source file.
2363 * testsuite/script_test_11.t: New linker script.
502e8a84 2364
0cfdc767
AM
23652013-04-13 Alan Modra <amodra@gmail.com>
2366
2367 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
2368 owner when sections are not adjacent and exceed group size.
2369 (Target_powerpc::group_sections): Handle corner case.
2370 (Target_powerpc::Branch_info::make_stub): Handle case where
2371 stub table doesn't exist due to branches in non-exec sections.
2372 (Target_powerpc::Relocate::relocate): Likewise.
2373
6830ee24
AM
23742013-04-11 Alan Modra <amodra@gmail.com>
2375
2376 PR gold/15354
2377 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
2378 .branch_lt to match bfd ld. Adjust comments throughout file.
2379
54a3d865
ILT
23802013-04-04 Ian Lance Taylor <iant@google.com>
2381
2382 GCC PR c++/56840
2383 * object.cc (do_layout_deferred_sections): Handle .eh_frame
2384 sections before checking whether they are included in the link.
2385
9993ba11
ST
23862013-03-29 Sriraman Tallam <tmsriram@google.com>
2387
2388 * archive.cc (Archive::get_elf_object_for_member): Create the elf
2389 object before calling the plugin claim_file handler. Pass the elf
2390 object of the archive to the plugin. Delete the elf object if the
2391 plugin claims the file.
2392
ebacd51e
AM
23932013-03-21 Alan Modra <amodra@gmail.com>
2394
2395 * layout.cc (Layout::set_segment_offsets): Accept writable .text
2396 segment when omagic.
2397
117be58f
AM
23982013-03-21 Alan Modra <amodra@gmail.com>
2399
2400 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
2401 comparison warning.
2402 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
2403 uninitialized" warning.
2404
32e2b61d
AM
24052013-03-20 Alan Modra <amodra@gmail.com>
2406
2407 * symtab.h (Symbol::clear_version): New function.
2408 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
2409 is_needed by weak references. Clear version for symbols defined
2410 in as-needed objects that are not needed.
2411
b3ccdeb5
AM
24122013-03-15 Alan Modra <amodra@gmail.com>
2413
2414 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
2415 static and public. Add report_err param. Return false for data refs.
2416 (Target_powerpc::rela_dyn_section): New overloaded function.
2417 (Target_powerpc::plt_, iplt_): Elucidate.
2418 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
2419 (Output_data_plt_powerpc::do_write): Don't write .iplt.
2420 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
2421 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
2422 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
2423 push_branch and make_plt_entry for ifunc syms when
2424 reloc_needs_plt_for_ifunc.
2425 (Target_powerpc::Relocate::relocate): Don't use plt entry value
2426 for ifunc unless reloc_needs_plt_for_ifunc.
2427
ad3d8a2f
AM
24282013-03-15 Alan Modra <amodra@gmail.com>
2429
2430 * gc.h (gc_process_relocs): Don't look through function descriptors.
2431 * icf.cc (get_section_contents): Do so here instead.
2432
4d9aa155
AM
24332013-03-13 Alan Modra <amodra@gmail.com>
2434
2435 * powerpc.cc (is_branch_reloc): Forward declare.
2436 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
2437 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
2438 false for 64-bit, true for 32-bit non-branch relocs.
2439 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
2440 * testsuite/Makefile.am (icf_test): Use linker map file instead of
2441 nm output.
2442 (icf_safe_test): Generate linker map file as well as nm output.
2443 (icf_safe_so_test): Likewise.
2444 * testsuite/Makefile.in: Regenerate.
2445 * testsuite/icf_test.sh: Parse linker map file to determine
2446 section folding.
2447 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
2448 * testsuite/icf_safe_so_test.sh: Likewise.
2449 (X86_32_or_ARM_specific_safe_fold): Merge into..
2450 (arch_specific_safe_fold): ..this.
2451 (X86_64_specific_safe_fold): Delete unused function.
2452
57420c20
AM
24532013-03-12 Alan Modra <amodra@gmail.com>
2454
2455 * gc.h (gc_process_relocs): Look through function descriptors
2456 to determine shndx, symvalue and addend used by ICF. Tidy
2457 variable duplication.
2458
dc3714f3
AM
24592013-03-11 Alan Modra <amodra@gmail.com>
2460
2461 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
2462 * layout.cc (Layout_task_runner::run): ..to here.
2463 * symtab.h (struct Symbol_location): Extract from..
2464 (class Symbol_table): ..here.
2465 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
2466 * target.h (class Target): Add function_location and
2467 do_function_location functions.
2468 (class Sized_target): Add do_function_location.
2469 * object.h (class Sized_relobj_file): Move find_shdr..
2470 (class Object): ..to here.
2471 * object.cc: Likewise. Update to suit. Instantiate.
2472 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
2473 * powerpc.cc (class Powerpc_dynobj): New.
2474 (Target_powerpc::do_function_location): New function.
2475 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
2476 (Powerpc_dynobj::do_read_symbols): New function.
2477 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
2478
956b03bb
ILT
24792013-03-08 Ian Lance Taylor <iant@google.com>
2480
2481 * options.cc (General_options::string_to_object_format): Accept
2482 "default".
2483
4bead2d5
AM
24842013-03-08 Alan Modra <amodra@gmail.com>
2485
2486 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
2487 pointer to Post_fde.
2488 (struct Post_fde): Move definition to here..
2489 * ehframe.cc (struct Post_fde): ..from here.
2490 (Cie::write): Don't alloc Post_fde.
2491 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
2492
02e60bf7
AM
24932013-03-07 Alan Modra <amodra@gmail.com>
2494
2495 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
2496 relocation referencing .LC0.
2497 * testsuite/discard_locals_test.sh: Remove FIXMEs.
2498
8343f03a
AM
24992013-03-07 Alan Modra <amodra@gmail.com>
2500
2501 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
2502 always_inline. Add assembly for powerpc to avoid GOT.
2503
3366d57c
AM
25042013-03-07 Alan Modra <amodra@gmail.com>
2505
2506 * testsuite/script_test_10.sh: Don't test .bss section
2507 header number.
2508
6c77229c
AM
25092013-03-06 Alan Modra <amodra@gmail.com>
2510
2511 * powerpc.cc (class Powerpc_relobj): Move some member functions.
2512 (Target_powerpc::symval_for_branch): Add symtab param. Update
2513 all callers. Handle folded sections.
2514 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
2515 to Powerpc_relobj.
2516 (Global_symbol_visitor_opd::operator()): Likewise.
2517
a39e4af6
AM
25182013-03-04 Alan Modra <amodra@gmail.com>
2519
2520 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
2521 * testsuite/Makefile.in: Regenerate.
2522
d5834edb
CC
25232013-03-01 Cary Coutant <ccoutant@google.com>
2524
2525 Add dwp support for v2 DWARF package file format.
2526 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2527 tu_length parameter. Adjust all callers.
2528 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2529 * dwp.cc: Include dwarf.h.
2530 (Section_bounds): New struct type.
2531 (Unit_set): New struct type.
2532 (Dwo_file::Dwo_file): Initialize new data member.
2533 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2534 Combine and rename to...
2535 (Dwo_file::read_unit_index): ...this.
2536 (Dwo_file::sized_read_compunit_index)
2537 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2538 (Dwo_file::sized_read_unit_index): ...this.
2539 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2540 parameters; add section_id parameter.
2541 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2542 (Dwo_file::add_unit_set): ...this.
2543 (Dwo_file::shndx_map_): Remove.
2544 (Dwo_file::sect_offsets_): New data member.
2545 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2546 (Dwp_output_file::add_section): Rename to...
2547 (Dwp_output_file::add_contribution): ...this.
2548 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2549 (Dwp_output_file::add_tu_set): Likewise.
2550 (Dwp_output_file::Contribution): New type.
2551 (Dwp_output_file::Section::contributions): New data member.
2552 (Dwp_output_file::Cu_or_tu_set): Remove.
2553 (Dwp_output_file::Section::Section): New ctor.
2554 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2555 (Dwp_output_file::Dwp_index::Section_table): New type.
2556 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2557 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2558 parameter.
2559 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2560 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2561 (Dwp_output_file::Dwp_index::section_table): New member function.
2562 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2563 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2564 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2565 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2566 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2567 (Dwp_output_file::Dwp_index::section_table_): New data member.
2568 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2569 (Dwp_output_file::add_output_section): New member function.
2570 (Dwp_output_file::write_new_section): New member function.
2571 (Dwp_output_file::write_contributions): New member function.
2572 (Dwp_output_file::section_id_map_): New data member.
2573 (class Dwo_id_info_reader): Remove.
2574 (class Unit_reader): New class.
2575 (get_dwarf_section_name): New function.
2576 (Dwo_file::read_executable): Adjust initializations of class data.
2577 (Dwo_file::read): Add support for v2 package file format.
2578 (Dwo_file::read_unit_index): Likewise.
2579 (Dwo_file::sized_read_unit_index): Likewise.
2580 (Dwo_file::copy_section): Likewise.
2581 (Dwo_file::add_unit_set): Likewise.
2582 (Dwp_output_file::add_output_section): Likewise.
2583 (Dwp_output_file::add_contribution): Likewise.
2584 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2585 for empty slot.
2586 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2587 file format.
2588 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2589 slot.
2590 (Dwp_output_file::initialize): Remove unused function.
2591 (Dwp_output_file::finalize): Add support for v2 package file format.
2592 (Dwp_output_file::write_index): Likewise.
2593 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2594 function prototype.
2595
a68a081d
CC
25962013-03-01 Cary Coutant <ccoutant@google.com>
2597
2598 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
2599 function into class definition in header file.
2600 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
2601 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
2602 New function.
2603 (Dwarf_info_reader::check_buffer): Move here from .cc file.
2604
9d5781f8
AM
26052013-02-28 Alan Modra <amodra@gmail.com>
2606
2607 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
2608 * target.cc (Target::do_plt_fde_location): New function.
2609 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
2610 accessor function, and constructor param.
2611 (struct Post_fde, Post_fdes): Declare.
2612 (Cie::write): Add post_fdes param.
2613 * ehframe.cc (Fde::write): Use plt_fde_location.
2614 (struct Post_fde): Define.
2615 (Cie::write): Stash FDEs added post merge mapping.
2616 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
2617 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
2618 (Eh_frame::do_sized_write): Arrange to write post map FDES after
2619 other FDEs.
2620 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
2621 (Target_powerpc::has_glink): New function.
2622 (Target_powerpc::do_relax): Add eh_frame info for stubs.
2623 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
2624 glink_eh_frame_fde_32, default_fde): New data.
2625 (Stub_table::eh_frame_added_): New var.
2626 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
2627 Make const.
2628 (Stub_table::add_eh_frame): New function.
2629 (Output_data_glink::add_eh_frame): New function.
2630 (Target_powerpc::make_glink_section): Call add_eh_frame.
2631
214383dd
ILT
26322013-02-15 Ian Lance Taylor <iant@google.com>
2633
2634 * options.h (DEFINE_uint64_alias): Define.
2635 (class General_options): Add -Ttext-segment as an alias for
2636 -Ttext.
2637
91c2b899
AM
26382013-02-15 Alan Modra <amodra@gmail.com>
2639
2640 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
2641 (Stub_table::do_write): ..here, two places.
2642 (Stub_table::plt_call_size): Use it here too.
2643
20e2a8aa
ILT
26442013-02-11 Ian Lance Taylor <iant@google.com>
2645
2646 * descriptors.cc (Descriptors::close_all): New function.
2647 * descriptors.h (class Descriptors): Declare close_all.
2648 (close_all_descriptors): New inline function.
2649 * plugin.cc: Include "descriptors.h".
2650 (Plugin_manager::cleanup): Call close_all_descriptors.
2651
8952bc69
AM
26522013-02-06 Alan Modra <amodra@gmail.com>
2653
2654 * README: Update coding style link.
2655
29bd8b6b
CC
26562013-01-28 Cary Coutant <ccoutant@google.com>
2657
a4034750
AM
2658 * dwp.cc (File_list): New typedef.
2659 (Dwo_name_info_reader): New class.
2660 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
2661 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
2662 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
2663 (Dwo_file::read_executable): New function.
2664 (Dwo_file::read): Move common setup code to ...
2665 (Dwo_file::make_object): ... here.
2666 (dwp_options): Add --exec/-e.
2667 (usage): Likewise.
2668 (main): Likewise.
29bd8b6b 2669
c6ac678d
ST
26702013-01-24 Sriraman Tallam <tmsriram@google.com>
2671
2672 * layout.cc (Layout::layout): Check for option text_reorder.
2673 (Layout::make_output_section): Ditto.
2674 * options.h (text_reorder): New option.
2675 * output.cc (Input_section_sort_compare): Remove special ordering
2676 of section names.
2677 (Output_section::
2678 Input_section_sort_section_name_special_ordering_compare::
2679 operator()): New function.
2680 (Output_section::sort_attached_input_sections): Use new sort function
2681 for .text.
2682 * output.h (Input_section_sort_section_name_special_ordering_compare):
2683 New struct.
2684 * testsuite/Makefile.am (text_section_grouping): Test option
2685 --no-text-reorder
2686 * testsuite/Makefile.in: Regenerate.
2687 * testsuite/text_section_grouping.sh: Check order of functions without
2688 default text reordering.
2689
50701cc1
MF
26902013-01-18 Mike Frysinger <vapier@gentoo.org>
2691
2692 * options.h (General_options): Change default to true for new_dtags.
2693
b1b00fcc
MF
26942013-01-18 Mike Frysinger <vapier@gentoo.org>
2695
2696 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
2697 when enable_new_dtags is false. Only add DT_RUNPATH when
2698 enable_new_dtags is true.
2699
ec5b8187
AM
27002013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
2701
2702 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
2703 used in declaration and definition consistent.
2704 (Target_powerpc::symval_for_branch): Ditto.
2705
a880d4c4
ST
27062013-01-16 Sriraman Tallam <tmsriram@google.com>
2707
2708 * testsuite/plugin_final_layout.cc: Fix comment.
2709
7c381248
ST
27102013-01-16 Sriraman Tallam <tmsriram@google.com>
2711
2712 * layout.cc (Layout::layout): Do not do default sorting for
2713 text sections when section ordering is specified.
2714 (make_output_section): Ditto.
2715 * testsuite/plugin_final_layout.cc: Name the function sections
2716 to catch reordering issues.
2717
e2458743
AM
27182013-01-15 Alan Modra <amodra@gmail.com>
2719
2720 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
2721 plt-thread-safe.
2722
431ed302
AM
27232013-01-15 Alan Modra <amodra@gmail.com>
2724
2725 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
2726 * testsuite/Makefile.in: Regenerate.
2727
0ec6429b
AM
27282013-01-14 Alan Modra <amodra@gmail.com>
2729
2730 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
2731 * testsuite/Makefile.in: Regenerate.
2732
0bf402d5
ILT
27332013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
2734
36af3926 2735 PR bfd/14430
0bf402d5
ILT
2736 Fix mingw gold build with plugins enabled
2737 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
2738 * configure.ac: Export DLOPEN_LIBS and add headers check.
2739 * plugin.cc: Handle non-dlfcn case.
2740 * Makefile.in: Regenerate.
2741 * config.in: Regenerate.
2742 * configure: Regenerate.
2743 * testsuite/Makefile.in: Regenerate.
2744
9e9143bc
ST
27452013-01-09 Sriraman Tallam <tmsriram@google.com>
2746
2747 * output.h (sort_attached_input_sections): Change to be public.
2748 * script-sections.cc
2749 (Output_section_definition::set_section_addresses): Sort
2750 attached input sections according to section order before linker
2751 script assigns section addresses.
2752 (Orphan_output_section::set_section_addresses): Sort
2753 attached input sections according to section order before linker
2754 script assigns section addresses.
2755 * Makefile.am (final_layout.sh): Use a simple linker script to
2756 check if section ordering still works.
2757 * Makefile.in: Regenerate.
2758
679af368
ILT
27592013-01-09 Ben Cheng <bccheng@google.com>
2760
2761 * arm.cc (Target_arm::attributes_accept_div): New function.
2762 (Target_arm::attributes_forbid_div): New function.
2763 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
2764 attribute using the same new functions as what bfd/elf32_arm.c
2765 does.
2766
3136a00e
CC
27672013-01-07 Cary Coutant <ccoutant@google.com>
2768
2769 PR gold/14993
2770 * output.cc (Output_section::add_input_section): For incremental
2771 updates, don't track input sections that are allocated from patch
2772 space.
2773
f2a6224b
L
27742013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2775 Ian Lance Taylor <iant@google.com>
2776
2777 PR gold/14897
2778 * configure.ac (--enable-ld): Removed.
2779 (install_as_default): Set to yes only for --enable-gold=default
2780 or --disable-ld.
2781 * configure: Regenerated.
2782
4f46f626
L
27832013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2784
2785 * options.h (General_options): Add -fuse-ld= for GCC linker
2786 option compatibility.
2787
26e4ef59
CC
27882013-01-04 Cary Coutant <ccoutant@google.com>
2789
2790 * configure.ac: Fix typo restoring CXXFLAGS.
2791 * configure: Regenerate.
2792
3d587466
CC
27932013-01-04 Cary Coutant <ccoutant@google.com>
2794
4f46f626
L
2795 * testsuite/Makefile.am (CXXLINK_S): New macro.
2796 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
2797 * testsuite/Makefile.in: Regenerate.
3d587466 2798
44db6695
L
27992013-01-02 H.J. Lu <hongjiu.lu@intel.com>
2800
2801 * version.cc (print_version): Update copyright year to 2013.
2802
edcac0c1
ILT
28032012-12-20 Ian Lance Taylor <iant@google.com>
2804
2805 * layout.cc (Layout::special_ordering_of_input_section): New
2806 function.
2807 (Layout::layout): If input section requires special ordering, must
2808 sort input sections.
2809 (Layout::make_output_section): May sort .text input sections.
2810 (Layout::is_section_name_prefix_grouped): Remove.
2811 * layout.h (class Layout): Declare
2812 special_ordering_of_input_section. Don't declare
2813 is_section_name_prefix_grouped.
2814 * output.cc (Output_section::add_input_section): Revert last
2815 change.
2816 (Output_section::Input_section_sort::match_file_name): Don't crash
2817 if called on output section data.
2818 (Output_section::Input_section_sort_compare): Sort based on
2819 special ordering.
2820 (Output_section::Input_section_sort_section_order_index_compare):
2821 Revert last patch.
2822 (Output_section::sort_attached_input_sections): Likewise.
2823
28f2a4ac
ST
28242012-12-18 Sriraman Tallam <tmsriram@google.com>
2825
edcac0c1 2826 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
2827 * layout.h (Layout::is_section_name_prefix_grouped): New function.
2828 * output.cc (Output_section::add_input_section): Check if section
2829 name contains special prefix. Keep input sections to sort such
2830 sections.
2831 (Output_section::Input_section_sort_section_order_index_compare
2832 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
2833 (Output_section::sort_attached_input_sections): Add condition to
2834 Input_section_entry constructor call.
28f2a4ac
ST
2835 * testsuite/Makefile.am (text_section_grouping): New test.
2836 * testsuite/Makefile.in: Regenerate.
2837 * testsuite/text_section_grouping.cc: New file.
2838 * testsuite/text_section_grouping.sh: New file.
2839
5bf135a7
NC
28402012-12-17 Nick Clifton <nickc@redhat.com>
2841
2842 * Makefile.am: Add copyright notice.
2843 * NEWS: Likewise.
2844 * README: Likewise.
2845 * configure.ac: Likewise.
2846 * ftruncate.c: Likewise.
2847 * Makefile.in: Regenerate.
2848
59965708
CC
28492012-12-14 Cary Coutant <ccoutant@google.com>
2850
a4034750
AM
2851 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
2852 --no-as-needed flag.
2853 (exception_separate_shared_12_test): Likewise.
2854 (incremental_copy_test): Likewise.
2855 * testsuite/Makefile.in: Regenerate.
59965708 2856
2a77e2ab
CC
28572012-12-14 Cary Coutant <ccoutant@google.com>
2858
2859 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
2860 (Dwp_output_file::Dwp_index::enter_set): Add assert.
2861
e3deeb9c
AM
28622012-12-12 Alan Modra <amodra@gmail.com>
2863
2864 * powerpc.cc (class Track_tls): New.
2865 (class Relocate, class Scan): Inherit Track_tls.
2866 (Target_powerpc::Scan::local, global): Track tls optimization
2867 and avoid creating plt entry for __tls_get_addr if all uses
2868 are optimized away.
2869 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
2870
d8f5a274
AM
28712012-12-12 Alan Modra <amodra@gmail.com>
2872
2873 * options.h (General_options): Add --toc-sort/--no-toc-sort.
2874 Replace no_toc_optimize with toc_optimize.
2875 * output.h (Output_section::input_sections): Provide non-const variant.
2876 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
2877 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
2878 accessors.
2879 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
2880 (class Sort_toc_sections): New.
2881 (Target_powerpc::do_finalize_sections): Sort toc sections.
2882 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
2883
4c8a1de1
RM
28842012-12-10 Roland McGrath <mcgrathr@google.com>
2885
2886 * testsuite/binary_unittest.cc (read_all): New function.
2887 (Sized_binary_test): Use it instead of ::read.
2888 * fileread.cc (do_read): Don't assume pread always reads the whole
2889 amount in a single call.
2890
edc27beb
AM
28912012-12-10 Alan Modra <amodra@gmail.com>
2892
2893 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
2894 Set EM_PPC64 or EM_PPC here.
2895 (Target_selector_powerpc::do_recognize): Delete.
2896
906b9150
AM
28972012-12-10 Alan Modra <amodra@gmail.com>
2898
2899 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
2900 stub_table_.
2901 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
2902
418c15ae
RM
29032012-12-07 Roland McGrath <mcgrathr@google.com>
2904
2905 * testsuite/binary_unittest.cc (Sized_binary_test):
2906 Use open_descriptor rather than ::open.
2907
decdd3bc
AM
29082012-12-07 Alan Modra <amodra@gmail.com>
2909
2910 * powerpc.cc (Stub_table::do_write): Delete redundant Address
2911 typedef and invalid_address constant.
2912 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
2913 instantiate constants.
2914
db399005
ILT
29152012-12-06 Roland McGrath <mcgrathr@google.com>
2916
2917 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
2918 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
2919 * aclocal.m4: Regenerate.
2920 * configure: Regenerate.
2921 * Makefile.in: Regenerate.
2922 * testsuite/Makefile.in: Regenerate.
2923
aba6bc71
AM
29242012-12-07 Alan Modra <amodra@gmail.com>
2925
2926 * options.h (General_options): Add no_toc_optimize.
2927 * powerpc.cc (ok_lo_toc_insn): New function.
2928 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
2929
9e69ed50
AM
29302012-12-06 Alan Modra <amodra@gmail.com>
2931
2932 * options.h (General_options): Add plt_align, plt_static_chain,
2933 plt_thread_safe. Update stub_group_size help text.
2934 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
2935 for new plt_thread_safe_ var.
2936 (use_plt_offset): Correct comments.
2937 (Target_powerpc::do_relax): Look for thread creation symbols to
2938 determine default plt_thread_safe value. Clear plt call stubs
2939 as well as branch stubs each iteration.
2940 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
2941 insn constants.
2942 (l, hi, ha, write_insn): Move earlier.
2943 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
2944 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
2945 plt stubs too.
2946 (Stub_table::update_size): Adjust.
2947 (Stub_table::prev_size, set_prev_size): Delete.
2948 (Stub_table::stub_align): Let --plt-align affect result.
2949 (Stub_table::plt_call_size): Calculate sizes for various stubs.
2950 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
2951 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
2952 (Stub_table::do_write): Support more stub variants.
2953
f43ba157
AM
29542012-12-04 Alan Modra <amodra@gmail.com>
2955
2956 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
2957 (Target_powerpc::do_define_standard_symbols): New function.
2958
34171bc5
AM
29592012-12-03 Alan Modra <amodra@gmail.com>
2960
2961 * output.h: Formatting, whitespace.
2962
dc9589e9 29632012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
2964
2965 * layout.h (Layout::get_executable_sections): Declare.
2966 * layout.cc (Layout::get_executable_sections): New function.
2967 * arm.cc (Target_arm::group_sections): Use it.
2968 (Arm_output_section::group_sections): Delete now redundant test.
2969 * output.cc (Output_reloc::Output_reloc): Add is_relative.
2970 param to handle relative relocs.
2971 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
2972 (Output_data_reloc::add_absolute): Adjust.
2973 (Output_data_reloc::add_relative): New function.
2974 (Output_data::reset_data_size): New function.
2975 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
2976 (Output_section::set_addralign): New function.
2977 (Output_section::checkpoint_set_addralign): New function.
2978 (Output_section::clear_section_offsets_need_adjustment): New function.
2979 (Output_section::input_sections): Make public.
2980 * powerpc.cc (class Output_data_brlt_powerpc): New.
2981 (class Stub_table, class Stub_control): New.
2982 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
2983 stub_table_, set_stub_table, stub_table): New vectors and accessor
2984 functions.
2985 (Target_powerpc::do_may_relax, do_relax, push_branch,
2986 new_stub_table, stub_tables, brlt_section, group_sections,
2987 add_branch_lookup_table, find_branch_lookup_table,
2988 write_branch_lookup_table, make_brlt_section): New functions.
2989 (Target_powerpc::struct Sort_sections, class Branch_info): New.
2990 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
2991 branch_info_): New vars.
2992 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
2993 make call stubs here.
2994 (Output_data_glink): Remove all call stub handling from this class.
2995 (Target_powerpc::Scan::local, global): Save interesting branch
2996 relocs and relocs for ifunc. Adjust calls to plt entry functions.
2997 (Target_powerpc::do_finalize_sections): Only make reg save/restore
2998 functions on final link.
2999 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
3000 Handle long branch destinations too.
3001 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
3002 do_plt_address_for_local): Adjust lookup of plt call stubs.
3003
627b30b7
AM
30042012-11-30 Alan Modra <amodra@gmail.com>
3005
3006 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
3007 relocs against protected symbols when building 32-bit shared libs.
3008
40b469d7
AM
30092012-11-30 Alan Modra <amodra@gmail.com>
3010
3011 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
3012 param. Call got_section() to make .got. Update all callers
3013 and their callers and so on.
3014
bb66a627
AM
30152012-11-30 Alan Modra <amodra@gmail.com>
3016
3017 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
3018 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
3019 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
3020 value if it already exists.
3021
d2cf1c6c
L
30222012-11-19 H.J. Lu <hongjiu.lu@intel.com>
3023
3024 PR gold/14858
3025 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
3026
edccdf7c
RM
30272012-11-14 Roland McGrath <mcgrathr@google.com>
3028
3029 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
3030 than bfc instruction for data sandboxing.
3031
6febeb74
AM
30322012-11-08 Alan Modra <amodra@gmail.com>
3033
3034 * po/POTFILES.in: Regenerate.
3035
0a6f1bf2
AM
30362012-11-05 Alan Modra <amodra@gmail.com>
3037
3038 * configure.ac: Apply 2012-09-10 change to config.in here.
3039 * configure: Regenerate.
3040
26a4e9cb
AM
30412012-11-05 Alan Modra <amodra@gmail.com>
3042
3043 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
3044 (struct Opd_ent): Use "Address" rather than "Offset".
3045 (Output_data_got_powerpc::got_base_offset): Return Valtype.
3046 (Target_powerpc::got_section): Make public.
3047 (Target_powerpc::scan_relocs): Move code setting symbols..
3048 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
3049 Create _SDA_BASE_ only when referenced.
3050
cc928013
RM
30512012-11-02 Roland McGrath <mcgrathr@google.com>
3052
3053 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
3054 from last change.
3055
50ed5eb1
RM
30562012-11-01 Roland McGrath <mcgrathr@google.com>
3057
62fe925a
RM
3058 * target.h (Sized_target::relocate_relocs): Use Elf_Off
3059 for offset_in_output_section parameter.
3060 (Sized_target::relocate_special_relocatable): Likewise.
3061 * arm.cc (Target_arm::relocate_relocs): Likewise.
3062 (Target_arm::relocate_special_relocatable): Likewise.
3063 * i386.cc (Target_i386::relocate_relocs): Likewise.
3064 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
3065 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
3066 * target-reloc.h (relocate_relocs): Likewise.
3067 * testsuite/testfile.cc (Target_test): Likewise.
3068 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
3069 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
3070
3071 * system.h: Move inclusion of <clocale> to after <libintl.h> in
3072 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
3073
3074 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
3075 parameter, which is unused in the [!F_SETFD] case.
3076
50ed5eb1
RM
3077 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
3078 SYMNDX to off_t before comparing it to this->data_size().
3079 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
3080 * incremental.cc (Output_section_incremental_inputs::do_write):
3081 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
3082
2cadc0bf
RM
3083 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
3084
3bfcb652
NC
30852012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
3086
3087 * gold.cc (Target_arm::do_adjust_elf_header): Add the
3088 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
3089 in EABI_VER5.
3090
c1a8d56e
CC
30912012-10-29 Cary Coutant <ccoutant@google.com>
3092
3093 * dwp.cc (usage): Add file and exit status parameters;
3094 add --help and --version options.
3095 (print_version): New function.
3096 (main): Add --help and --version options.
3097
b2490a7b
L
30982012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3099
3100 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
3101 final_layout_sequence.txt.
3102 * testsuite/Makefile.in: Regenerated.
3103
aa543512
L
31042012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3105
3106 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
3107 COMPILE generated by automake.
3108 (LINK1): Likewise.
3109 (CXXCOMPILE1): Likewise.
3110 (CXXLINK1): Likewise.
3111 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
3112 (LINK): Likewise.
3113 (CXXCOMPILE): Likewise.
3114 (CXXLINK): Likewise.
3115 * testsuite/Makefile.in: Regenerated.
3116
d361fafb
L
31172012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3118
3119 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
3120 on bad fwrite return.
3121
598c7410
L
31222012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3123
3124 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
3125 on val.
3126
35c813e2
CC
31272012-10-23 Cary Coutant <ccoutant@google.com>
3128
3129 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
3130 * testsuite/Makefile.in: Regenerate.
3131 * testsuite/dwp_test.h: New source file.
3132 * testsuite/dwp_test_1.cc: New source file.
3133 * testsuite/dwp_test_1.s: New source file.
3134 * testsuite/dwp_test_1.sh: New source file.
3135 * testsuite/dwp_test_1b.cc: New source file.
3136 * testsuite/dwp_test_1b.s: New source file.
3137 * testsuite/dwp_test_2.cc: New source file.
3138 * testsuite/dwp_test_2.s: New source file.
3139 * testsuite/dwp_test_2.sh: New source file.
3140 * testsuite/dwp_test_main.cc: New source file.
3141 * testsuite/dwp_test_main.s: New source file.
3142
77429909
CC
31432012-10-23 Cary Coutant <ccoutant@google.com>
3144
3145 * dwp.h: New header file.
3146 * dwp.cc: New source file.
3147 * gold.h: Move shared declarations to system.h.
3148 * system.h: New header file.
3149 * Makefile.am: Add dwp.
3150 * Makefile.in: Regenerate.
3151
ed5d6712
CC
31522012-10-23 Cary Coutant <ccoutant@google.com>
3153
3154 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
3155 Dwarf_info_reader::read_from_pointer.
3156 (Dwarf_pubnames_table::read_header): Likewise.
3157 (Dwarf_pubnames_table::next_name): Likewise.
3158 (Dwarf_die::read_attributes): Likewise.
3159 (Dwarf_die::skip_attributes): Likewise.
3160 (Dwarf_info_reader::read_from_pointer): New function template.
3161 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
3162 (Dwarf_pubnames_table): Likewise.
3163 (Dwarf_info_reader::read_from_pointer): New function template.
3164 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
3165 Dwarf_pubnames_table ctor.
3166
8787852d
CC
31672012-10-23 Cary Coutant <ccoutant@google.com>
3168
3169 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
3170 abbrev_shndx.
3171 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
3172 abbrev_shndx_.
3173 (Dwarf_info_reader::set_abbrev_shndx): New method.
3174 (Dwarf_info_reader::abbrev_shndx_): New data member.
3175
9fc236f3
CC
31762012-10-23 Cary Coutant <ccoutant@google.com>
3177
3178 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
3179 from object, not parameters.
3180 (Dwarf_info_reader::parse): Likewise.
3181 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
3182 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
3183 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
3184 methods.
3185
effe8365
CC
31862012-10-23 Cary Coutant <ccoutant@google.com>
3187
3188 * fileread.cc (Input_file::Input_file): New constructor.
3189 * fileread.h (class Input_file): Add new constructor.
3190
1698990d
AM
31912012-10-18 Alan Modra <amodra@gmail.com>
3192
3193 PR gold/14727
3194 * object.cc (Relobj::is_section_name_included): Also match
3195 .sdata personality section.
3196
168a4726
AM
31972012-10-18 Alan Modra <amodra@gmail.com>
3198
3199 * target-reloc.h (class Default_comdat_behavior): New, package up..
3200 (get_comdat_behaviour): ..this.
3201 (relocate_section): Add Relocate_comdat_behavior template arg,
3202 adjust code to suit.
3203 * arm.cc (Target_arm::relocate_section): Adjust to suit.
3204 (Target_arm::scan_reloc_section): Likewise.
3205 * i386.cc (Target_i386::relocate_section): Likewise.
3206 * sparc.cc (Target_sparc::relocate_section): Likewise.
3207 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
3208 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
3209 * powerpc.cc (class Relocate_comdat_behavior): New.
3210 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
3211 gold::relocate_section with new template arg.
3212
acc276d8
AM
32132012-10-18 Alan Modra <amodra@gmail.com>
3214
3215 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
3216 dynamic relocs for GOT_TPREL got entries, without symbol if
3217 resolving locally.
3218 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
3219 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
3220 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
3221
e10f9870
AM
32222012-10-17 Alan Modra <amodra@gmail.com>
3223
3224 PR gold/14726
3225 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
3226
ae034989
ST
32272012-10-16 Sriraman Tallam <tmsriram@google.com>
3228
3229 * layout.cc (Layout::include_section): Keep sections marked
3230 SHF_EXCLUDE when doing relocatable links.
3231
f3a0ed29
AM
32322012-10-16 Alan Modra <amodra@gmail.com>
3233
3234 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
3235 (Target_powerpc::do_finalize_sections): Call it.
3236 (Output_data_save_res): New class and supporting functions.
3237 (Target_powerpc::symval_for_branch): Only look up .opd entry for
3238 normal symbols defined in object files.
3239
c6de8ed4
AM
32402012-10-12 Alan Modra <amodra@gmail.com>
3241
3242 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
3243 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
3244 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
3245 section if scan_opd_relocs not yet called.
3246 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
3247
03e25981
AM
32482012-10-12 Alan Modra <amodra@gmail.com>
3249
3250 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3251 add_local_ifunc_entry): Revert last change.
3252 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
3253
c9824451
AM
32542012-10-05 Alan Modra <amodra@gmail.com>
3255
3256 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
3257 do_plt_address_for_global): New functions.
3258 (Output_data_got_powerpc::do_write): Don't segfault when linking
3259 statically.
3260 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3261 add_local_ifunc_entry): Return true on adding entry..
3262 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
3263 glink->add_entry call. Remove unused symtab param. Adjust calls.
3264 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
3265 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
3266 set up symbols here.
3267 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
3268 syms here. Do so even when no .iplt. Don't segfault when linking
3269 statically.
3270 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
3271 new variants without reloc param.
3272 (Glink_sym_ent::Glink_sym_ent): Likewise.
3273 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
3274 reloc when refs will resolve to plt call stub.
3275 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
3276 R_PPC_PLTREL24 to resolve locally.
3277 (Target_powerpc::Scan::global): Correct ifunc handling.
3278 (Target_powerpc::Relocate::relocate): Correct local sym glink
3279 lookup. Don't destroy "value" when we have a plt call stub,
3280 and when checking plt call validity.
3281 (Target_powerpc::do_dynsym_value): Simplify.
3282
19fec8c1
AM
32832012-10-05 Alan Modra <amodra@gmail.com>
3284
3285 * i386.cc (Output_data_plt_i386::address_for_global,
3286 address_for_local): Add plt offset to returned value. Adjust uses.
3287 * sparc.cc (Output_data_plt_sparc::address_for_global,
3288 address_for_local): Likewise.
3289 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
3290 address_for_local): Likewise.
3291 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
3292 address_for_local): Likewise.
3293 * target.h (Target::plt_address_for_global, plt_address_for_local):
3294 Update comment.
3295 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
3296 (Output_data_got::Got_entry::write): Nor here.
3297 * output.h: Comment fix.
3298
e867b647
WL
32992012-10-02 Jiong Wang <jiwang@tilera.com>
3300
3301 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
3302 global_offset_table_ value for larget got.
3303 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
3304
e5d5f5ed
AM
33052012-09-29 Alan Modra <amodra@gmail.com>
3306
3307 * powerpc.cc (Target_powerpc::iplt_): New output section.
3308 (Target_powerpc::iplt_section, make_iplt_section,
3309 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
3310 (Target_powerpc::make_plt_entry): Handle ifunc syms.
3311 Target_powerpc::plt_entry_count): Count iplt entries too.
3312 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
3313 reloc section in constructor. New params.
3314 (Target_powerpc::make_plt_section): Create reloc section here instead.
3315 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
3316 functions.
3317 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
3318 (Output_data_glink::add_entry, find_entry): New functions to
3319 deal with local syms.
3320 (Glink_sym_ent): Add support for local syms.
3321 (Output_data_glink::do_write): Handle ifunc plt entries.
3322 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3323 (Target_powerpc::Scan::local, global): Handle ifunc syms.
3324 (Target_powerpc::Relocate::relocate): Likewise.
3325 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
3326
ec4dbad3
AM
33272012-09-25 Alan Modra <amodra@gmail.com>
3328
3329 * object.h (Sized_relobj_file::adjust_local_symbol,
3330 do_adjust_local_symbol): New functions.
3331 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
3332 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
3333 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
3334 and irregular opd entry spacing.
3335 (Powerpc_relobj::do_read_relocs): Add opd size checks.
3336 (Global_symbol_visitor_opd): New functor.
3337 (Target_powerpc::do_finalize_sections): Omit global symbols defined
3338 on deleted opd entries.
3339
5c0b3823
WL
33402012-09-15 Jiong Wang <jiwang@tilera.com>
3341
3342 * tilegx.cc: New file.
3343 * Makefile.am (TARGETSOURCES): Add tilegx.cc
3344 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
3345 * configure.tgt: Add entries for tilegx*.
3346 * configure.ac: Likewise.
3347 * Makefile.in: Rebuild.
3348 * configure: Likewise.
3349 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
3350 tilegx.
3351
bfdfa4cd
AM
33522012-09-13 Alan Modra <amodra@gmail.com>
3353
3354 * target-reloc.h (scan_relocs): Call scan.local for relocs
3355 against symbols in discarded sections. Pass is_discarded
3356 param.
3357 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
3358 Add is_discarded param.
3359 * powerpc (Target_powerpc::Scan::local): Likewise. Use
3360 is_discarded to flag opd entry as discarded. Don't emit dyn
3361 relocs on such entries.
3362 (Target_powerpc::Scan::global): Similarly detect and handle
3363 such opd entries.
3364 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
3365 opd_ent_. Update all uses.
3366 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
3367 (Target_powerpc::relocate_section): Zero out discarded opd
3368 entry relocs.
3369
d77a0555
ILT
33702012-09-12 Ian Lance Taylor <iant@google.com>
3371
3372 PR gold/14570
3373 * output.cc: Rename Output_data_got template parameter from size
3374 to got_size for all functions. Compile all variants of
3375 Output_data_got.
3376 (Output_data_got::Got_entry::write): Correct use of size for
3377 symbol value. Use local_is_tls rather than casting to
3378 Sized_relobj_file.
3379 * object.h (class Object): Add local_is_tls and do_local_is_tls.
3380 (class Sized_relobj_file): Add do_local_is_tls.
3381 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
3382
815a1205
AM
33832012-09-11 Alan Modra <amodra@gmail.com>
3384
3385 PR gold/14566
3386 * layout.cc (Layout::set_segment_offsets): When using
3387 common-page-size alignment, ensure we are on a new max-page-size
3388 page.
3389 * output.cc (Output_segment::set_section_addresses): Use
3390 abi_pagesize, not common_pagesize for relro boundary.
3391 (Output_segment::set_offset): Likewise.
3392
bd73a62d
AM
33932012-09-11 Alan Modra <amodra@gmail.com>
3394
3395 * output.h (Output_data_got::add_global_tls, add_local_tls,
3396 add_local_tls_pair): New functions.
3397 (Output_data_got::add_local_pair_with_rel): Remove second
3398 reloc param. Expand comment.
3399 (Output_data_got::Got_entry): Rename use_plt_offset_ to
3400 use_plt_or_tls_offset_, similarly for constructor param.
3401 (Output_data_got::Got_entry::write): Add got_index param.
3402 * output.cc (Output_data_got::add_global_tls, add_local_tls,
3403 add_local_tls_pair): New functions.
3404 (Output_data_got::Got_entry::write): Handle tls symbols
3405 with use_plt_or_tls_offset_ set specially.
3406 (Output_data_got::add_local_pair_with_rel): Only one reloc.
3407 (Output_data_got::do_write): Replace iterator with index, pass
3408 index to entry write function.
3409 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
3410 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
3411 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
3412 call.
3413 * i386.cc (Target_i386::Scan::local): Likewise.
3414 * sparc.cc (Target_sparc::Scan::local): Likewise.
3415 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
3416 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
3417 do_tls_offset_for_global): New functions.
3418 (Target_powerpc::Scan::local): Correct TLS relocations and got
3419 entry values.
3420 (Target_powerpc::Scan::global): Don't emit unnecessary
3421 dynamic relocations on TLS GOT entries.
3422
00716ab1
AM
34232012-09-10 Matthias Klose <doko@ubuntu.com>
3424
3425 * config.in: Disable sanity check for kfreebsd.
3426
c891b3f9
SA
34272012-09-10 Sterling Augustine <saugustine@google.com>
3428
3429 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
3430 (Gdb_index::pubtypes_read): New parameter.
3431 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
3432 to calls.
3433 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
3434 pubtypes_object_.
3435
e81fea4d
AM
34362012-09-09 Alan Modra <amodra@gmail.com>
3437
3438 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
3439 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
3440 * gc.h (gc_process_relocs): Call target gc_add_reference.
3441 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
3442 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
3443 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
3444 unnecessary cast.
3445 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
3446 to cater for when we don't need code offset. Update use.
3447 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
3448 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
3449 set_opd_valid): New functions.
3450 (Target_powerpc::do_gc_add_reference): New function.
3451 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
3452 stashed refs.
3453 (Target_powerpc::do_gc_mark_symbol): New function.
3454
d2d60eef
CC
34552012-09-06 Cary Coutant <ccoutant@google.com>
3456
3457 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
3458 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
3459 (Dwarf_die::skip_attributes): Likewise.
3460 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
3461 * testsuite/gdb_index_test.cc (inline_func_1): New function.
3462 (main): Call it.
3463 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
3464
32ed4573
L
34652012-09-05 H.J. Lu <hongjiu.lu@intel.com>
3466
3467 * testsuite/script_test_3.t: Add .got.plt output section
3468 statement.
3469 * testsuite/script_test_4.t: Likewise.
3470
f4baf0d4
AM
34712012-09-05 Alan Modra <amodra@gmail.com>
3472
3473 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
3474 update all uses and lose "enum" when using type.
3475
864a1b56
AM
34762012-09-05 Alan Modra <amodra@gmail.com>
3477
3478 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
3479 * configure: Regenerate.
3480 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
3481 (plugin_final_layout.stdout): Likewise.
3482 (memory_test): Set page sizes to 0x1000.
3483 * testsuite/Makefile.in: Regenerate.
3484 * testsuite/discard_locals_test.sh: Add FIXME comment.
3485 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
3486 * testsuite/pr14265.t: Add .got output section statement.
3487 * testsuite/script_test_2.t: Likewise.
3488 * testsuite/script_test_3.t: Likewise.
3489 * testsuite/script_test_4.t: Likewise.
3490 * testsuite/script_test_5.t: Likewise.
3491 * testsuite/script_test_6.t: Likewise.
3492 * testsuite/script_test_7.t: Likewise.
3493 * testsuite/script_test_9.t: Likewise.
3494
3ea0a085
AM
34952012-09-05 Alan Modra <amodra@gmail.com>
3496
3497 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
3498 (Powerpc_relocate_functions::Status): New typedef.
3499 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3500 (Target_powerpc::Scan::local): Handle REL64.
3501 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
3502 for REL32 and REL64.
3503 (Target_powerpc::symval_for_branch): New function, extracted from..
3504 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
3505 checks. Report overflow errors.
3506
7404fe1b
AM
35072012-09-05 Alan Modra <amodra@gmail.com>
3508
3509 * object.h (Sized_relobj_file::emit_relocs): Delete.
3510 (Sized_relobj_file::emit_relocs_reltype): Delete.
3511 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
3512 relocate_relocs for --emit-relocs.
3513 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
3514 * output.h: Update comment.
3515 (Output_segment::first_section): New function.
3516 (Output_segment::first_section_load_address): Use first_section.
3517 * output.cc (Output_segment::first_section): New function extracted..
3518 (Output_segment::first_section_load_address): ..from here. Delete.
3519 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
3520 * target.h (Sized_target::relocate_for_relocatable): Likewise.
3521 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
3522 adjust call to target.h function.
3523 * i386.cc (Target_i386): Likewise.
3524 * sparc.cc (Target_sparc): Likewise.
3525 * x86_64.cc (Target_x86_64): Likewise.
3526 * powerpc.cc (Target_powerpc): Likewise.
3527 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
3528 first tls section has section symbol for optimised local dynamic
3529 output relocs.
3530 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
3531 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
3532 optimised tls code.
3533 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
3534 Rename to relocate_relocs. Update error message.
3535
957564c9
AS
35362012-09-04 Andreas Schwab <schwab@linux-m68k.org>
3537
3538 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
3539 --just-symbols.
3540
dd93cd0a
AM
35412012-08-31 Alan Modra <amodra@gmail.com>
3542
3543 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
3544 (Powerpc_relobj::toc_base_offset): New stub function.
3545 (Target_powerpc): Add tp_offset, dtp_offset. Rename
3546 got_mod_index_offset to tlsld_got_offset. Update all refs.
3547 (Target_powerpc::Relocate::enum skip_tls): New.
3548 (Target_powerpc::call_tls_get_addr_): New var.
3549 (Target_powerpc::is_branch_reloc): Move to file scope.
3550 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
3551 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
3552 New functions.
3553 (Target_powerpc::enum Got_type): Delete old values, add new ones.
3554 (powerpc_info): Correct common_pagesize for ppc64.
3555 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
3556 (Powerpc_relocate_functions): Add overflow check enums and functions.
3557 Add non-shift version of rela, rela_ua. Delete all rel public
3558 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
3559 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
3560 addr16_ha3, addr14 functions.
3561 (Output_data_got_powerpc::add_constant_pair): New function.
3562 (Output_data_got_powerpc::got_base_offset): Likewise.
3563 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
3564 (instruction constants): Sort, add some more.
3565 (Output_data_glink::do_write): Add and use Address typedef. Use
3566 object->toc_base_offset() stub for 64-bit.
3567 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
3568 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3569 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
3570 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
3571 Always treat .opd relocs as against locally defined symbol.
3572 Correct condition for RELATIVE relocs.
3573 (Target_powerpc::do_finalize_sections): Test for NULL sections.
3574 (Target_powerpc::Relocate::relocate): Use plt call stub as value
3575 for 32-bit syms with a plt entry. Correct ppc64 toc base
3576 calculations. Handle TLS relocs, and more. Add overflow
3577 checking and adjust for Powerpc_relocate_functions changes.
3578 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
3579 Reinstate --emit-relocs code with FIXME.
3580
a1373b60
AM
35812012-08-30 Alan Modra <amodra@gmail.com>
3582
3583 * layout.cc (Layout::set_segment_offsets): Set p_align to
3584 abi_pagesize, not common_pagesize.
3585 (Layout::relaxation_loop_body): Similarly use abi_pagesize
3586 to determine whether file header can go in segment.
3587
703d02da
AM
35882012-08-30 Alan Modra <amodra@gmail.com>
3589
3590 * output.h (Output_reloc::Output_reloc <output section>): Add
3591 is_relative param. Adjust calls.
3592 (Output_reloc::add_output_section_relative): New functions.
3593 * output.cc (Output_reloc::Output_reloc <output section>): Handle
3594 is_relative.
3595 (Output_reloc::symbol_value): Handle SECTION_CODE.
3596
16164a6b
ST
35972012-08-24 Sriraman Tallam <tmsriram@google.com>
3598
3599 * gold.cc (queue_middle_tasks): Call layout again when unique
3600 segments for sections is desired.
3601 * layout.cc (Layout::Layout): Initialize new members.
3602 (Layout::get_output_section_flags): New function.
3603 (Layout::choose_output_section): Call get_output_section_flags.
3604 (Layout::layout): Make output section for mapping to a unique segment.
3605 (Layout::insert_section_segment_map): New function.
3606 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 3607 output sections marked so.
16164a6b
ST
3608 (Layout::segment_precedes): Check for unique segments when sorting.
3609 * layout.h (Layout::Unique_segment_info): New struct.
3610 (Layout::Section_segment_map): New typedef.
3611 (Layout::insert_section_segment_map): New function.
3612 (Layout::get_output_section_flags): New function.
3613 (Layout::is_unique_segment_for_sections_specified): New function.
3614 (Layout::set_unique_segment_for_sections_specified): New function.
3615 (Layout::unique_segment_for_sections_specified_): New member.
3616 (Layout::section_segment_map_): New member.
3617 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
3618 Rename is_gc_pass_one to is_pass_one.
3619 Rename is_gc_pass_two to is_pass_two.
3620 Rename is_gc_or_icf to is_two_pass.
3621 Check for which pass based on whether symbols data is present.
3622 Make it two pass when unique segments for sections is desired.
3623 * output.cc (Output_section::Output_section): Initialize new
3624 members.
3625 * output.h (Output_section::is_unique_segment): New function.
3626 (Output_section::set_is_unique_segment): New function.
3627 (Output_section::is_unique_segment_): New member.
3628 (Output_section::extra_segment_flags): New function.
3629 (Output_section::set_extra_segment_flags): New function.
3630 (Output_section::extra_segment_flags_): New member.
3631 (Output_section::segment_alignment): New function.
3632 (Output_section::set_segment_alignment): New function.
3633 (Output_section::segment_alignment_): New member.
3634 (Output_segment::Output_segment): Initialize is_unique_segment_.
3635 (Output_segment::is_unique_segment): New function.
3636 (Output_segment::set_is_unique_segment): New function.
3637 (Output_segment::is_unique_segment_): New member.
3638 * plugin.cc (allow_unique_segment_for_sections): New function.
3639 (unique_segment_for_sections): New function.
3640 (Plugin::load): Add new functions to transfer vector.
3641 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
3642 * Makefile.in: Regenerate.
3643 * testsuite/plugin_final_layout.sh: Check if unique segment
3644 functionality works.
3645 * testsuite/plugin_section_order.c (onload): Check if new interfaces
3646 are available.
3647 (allow_unique_segment_for_sections): New global.
3648 (unique_segment_for_sections): New global.
3649 (claim_file_hook): Call allow_unique_segment_for_sections.
3650 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 3651
1e2bee4f
CC
36522012-08-22 Cary Coutant <ccoutant@google.com>
3653
3654 * layout.cc (Layout::include_section): Don't assert on GROUP
3655 sections with --emit-relocs.
3656
1d5dfe78
CC
36572012-08-21 Cary Coutant <ccoutant@google.com>
3658
3659 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
3660 if --export-dynamic-symbol names an undef symbol.
3661
c9269dff
AM
36622012-08-18 Alan Modra <amodra@gmail.com>
3663
3664 * powerpc.cc: Formatting and white space.
3665 (Powerpc_relobj): Rename got2_section_ to special_.
3666 Add opd_ent_shndx_ and opd_ent_off_ vectors.
3667 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
3668 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
3669 (Target_powerpc): Add Address typedef and invalid_address. Use
3670 throughout.
3671 (Target_powerpc::is_branch_reloc): New function.
3672 (Powerpc_relocate_functions): Add Address typedef, use throughout.
3673 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
3674 for dst_mask, value and addend.
3675 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
3676 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
3677 (Output_data_glink::do_write): Correct toc base. Don't try to use
3678 uint16_t for 24-bit offset. Use get_output_section_offset and
3679 check return.
3680 (Target_powerpc::Scan::local): Handle more relocs.
3681 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
3682 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
3683 Plug in toc restoring insn after plt calls. Translate branches
3684 to function descriptor symbols to corresponding entry point.
3685 (Target_powerpc::relocate_for_relocatable): Check return from
3686 get_output_section_offset.
3687 * symtab.h: Comment typo.
3688
b1759dce
ILT
36892012-08-14 Ian Lance Taylor <iant@google.com>
3690
3691 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
3692 unsupported_relocal_local to call unsupported_reloc_global.
3693
b9b2ae8b
NC
36942012-08-14 Nick Clifton <nickc@redhat.com>
3695
3696 PR ld/14265
3697 * script-sections.cc (Sections_element::output_section_name): Add
3698 keep return parameter.
3699 (Output_section_element::match_name): Add keep return parameter.
3700 Return the value of the keep_ member.
3701 * script-sections.h (class Output_section): Update
3702 output_section_name prototype.
3703 * layout.cc (Layout::keep_input_section): New public member
3704 function.
3705 (Layout::choose_output_section): Pass keep parameter to
3706 output_section_name.
3707 * layout.h (class Layout): Add keep_input_section.
3708 * object.cc (Sized_relobj_file::do_layout): Check for kept input
3709 sections.
3710 * testsuite/Makefile.am: Add a test.
3711 * testsuite/Makefile.in: Regenerate.
3712 * testsuite/pr14265.c: Source file for the test.
3713 * testsuite/pr14265.t: Linker script for the test.
3714 * testsuite/pr14265.sh: Shell script for the test.
3715
921b5322
AM
37162012-08-14 Alan Modra <amodra@gmail.com>
3717
3718 * target.h (Target::output_section_name): New function.
3719 (Target::do_output_section_name): New function.
3720 * layout.cc (Layout::choose_output_section): Call the above.
3721 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
3722
6ce78956
AM
37232012-08-14 Alan Modra <amodra@gmail.com>
3724
3725 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
3726 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
3727 for replace_constant call.
3728 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
3729 (Output_data_glink::do_print_to_mapfile): New function.
3730 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
3731 (Target_powerpc::Relocate::relocate): Likewise.
3732
d1a8cabd
AM
37332012-08-14 Alan Modra <amodra@gmail.com>
3734
3735 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
3736 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
3737 (Output_data_glink::add_entry,find_entry): Remove shndx param.
3738 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
3739 all references to shndx_. Handle special case for R_PPC_PLTREL24
3740 here.
3741 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
3742 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
3743 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
3744 here.
3745 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
3746 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
3747
d83ce4e3
AM
37482012-08-12 Alan Modra <amodra@gmail.com>
3749
3750 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
3751 (glink insn constants): Use uint32_t.
3752 (Output_data_glink::add_entry): Use insert, not [] operator.
3753
cf43a2fe
AM
37542012-08-11 Alan Modra <amodra@gmail.com>
3755
3756 * object.h (Sized_relobj_file::find_shdr): New function.
3757 (Sized_relobj_file::find_special_sections): New function.
3758 * object.cc (Sized_relobj_file::find_shdr): New function.
3759 (Sized_relobj_file::find_eh_frame): Use find_shdr.
3760 (Sized_relobj_file::find_special_sections): New function, split out..
3761 (Sized_relobj_file::do_read_symbols): ..from here.
3762 * output.h (Output_data_got::replace_constant): New function.
3763 (Output_data_got::num_entries): New function.
3764 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
3765 (Output_data_got::got_offset): Protected rather than private.
3766 (Output_data_got::replace_got_entry): New function.
3767 * output.cc (Output_data_got::replace_got_entry): New function.
3768 * powerpc.cc (class Powerpc_relobj): New.
3769 (class Powerpc_relocate_functions): Delete all psymval variants or
3770 convert to value,addend type. Delete pcrela, pcrela_unaligned.
3771 Implement _ha functions using corresponding _hi function.
3772 (Powerpc_relobj::find_special_sections): New function.
3773 (Target_powerpc::do_make_elf_object): New function.
3774 (class Output_data_got_powerpc): New.
3775 (class Output_data_glink): New.
3776 (class Powerpc_scan_relocatable_reloc): New.
3777 Many more changes througout file.
3778
3c892704
NC
37792012-08-09 Nick Clifton <nickc@redhat.com>
3780
3781 * po/vi.po: Updated Vietnamese translation.
3782
82435b3b
ILT
37832012-08-07 Ian Lance Taylor <iant@google.com>
3784
3785 * layout.cc (Layout::add_target_dynamic_tags): If
3786 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
3787 plt_rel.
3788
a6dc81d2
NC
37892012-07-30 Nick Clifton <nickc@redhat.com>
3790
3791 * po/gold.pot: Updated template.
3792 * po/es.po: Updated Spanish translation.
3793
f1415016
CC
37942012-07-18 Cary Coutant <ccoutant@google.com>
3795
3796 PR gold/14344
3797 * configure.ac: Add check for -gpubnames support.
3798 * configure: Regenerate.
3799 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
3800 support; force -gno-pubnames.
3801 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
3802 support.
3803 (gdb_index_test_4): New test.
3804 * testsuite/Makefile.in: Regenerate.
3805 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
3806 * testsuite/gdb_index_test_2.sh: Likewise.
3807 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
3808 * testsuite/gdb_index_test_4.sh: New script.
3809 * testsuite/gdb_index_test_comm.sh: New script with common code;
3810 don't look for space after colon.
3811
b7fd7c37
ST
38122012-07-16 Sriraman Tallam <tmsriram@google.com>
3813
3814 * gold.cc (queue_middle_tasks): Update function order only after
3815 deferred objects due to plugins are processed.
3816
1f3212db
ILT
38172012-07-11 Ian Lance Taylor <iant@google.com>
3818
3819 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
3820 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
3821 (Target_arm::scan_reloc_for_stub): Likewise.
3822 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
3823 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
3824 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
3825 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
3826 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
3827
81c82a68
ILT
38282012-07-10 Dodji Seketeli <dodji@redhat.com>
3829 Ian Lance Taylor <iant@google.com>
3830
3831 PR gold/14309
3832 * configure.ac: Test whether std::tr1::hash<off_t> works.
3833 * gold.h: Add a specialization for std::tr1::hash<off_t> if
3834 needed.
3835 * output.h (class Output_fill): Add virtual destructor.
3836 * configure, config.in: Rebuild.
3837
eabc84f4
RM
38382012-06-22 Roland McGrath <mcgrathr@google.com>
3839
3840 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
3841
370e30b6
RÁE
38422012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
3843
3844 * plugin.cc (Plugin::load): Handle position independent executables.
3845
fb1b895d
CC
38462012-06-06 Cary Coutant <ccoutant@google.com>
3847
3848 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
3849 add .debug_macro.
3850 (lines_only_debug_sections): Likewise.
3851 (gdb_fast_lookup_sections): New static array.
3852 (is_gdb_debug_section): Rename formal parameter.
3853 (is_lines_only_debug_section): Likewise.
3854 (is_gdb_fast_lookup_section): New function.
3855 (Layout::include_section): Check for ".zdebug_" prefix; pass
3856 section name suffix to is_gdb_debug_section, et al.; check for
3857 fast-lookup sections when building .gdb_index.
3858 * options.h (--strip-debug-gdb): Update GDB version number.
3859
7c0640fa
CC
38602012-06-06 Cary Coutant <ccoutant@google.com>
3861
3862 * configure.ac: Add check for fallocate.
3863 * configure: Regenerate.
3864 * config.in: Regenerate.
3865
3866 * options.h (class General_options): Add --mmap-output-file and
3867 --posix-fallocate options.
3868 * output.cc: (posix_fallocate): Remove; replace with...
3869 (gold_fallocate): New function.
3870 (Output_file::map_no_anonymous): Call gold_fallocate.
3871 (Output_file::map): Check --mmap-output-file option.
3872
2a49eb69
DK
38732012-06-05 Jing Yu <jingyu@google.com>
3874
3875 * gold.h (textdomain): Add do {} to empty while(0).
3876 (bindtextdomain): Likewise.
3877
fad072ac
CC
38782012-06-04 Cary Coutant <ccoutant@google.com>
3879
3880 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
3881 has_dynsym_index.
3882
8cc69fb6
ST
38832012-05-25 Sriraman Tallam <tmsriram@google.com>
3884
3885 * symtab.cc (Symbol_table::define_special_symbol):
3886 Initialize *poldsym to prevent uninitialized variable errors.
3887
1be75daa
CC
38882012-05-23 Cary Coutant <ccoutant@google.com>
3889
3890 * layout.cc (Layout::section_name_mapping): Add rules to handle
3891 exact match on .data.rel.ro.local or .data.rel.ro.
3892 (Layout::output_section_name): Check for exact matches.
3893
9b689de0
CC
38942012-05-23 Cary Coutant <ccoutant@google.com>
3895
3896 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
3897 more carefully.
3898
b24fdbf5
CC
38992012-05-22 Cary Coutant <ccoutant@google.com>
3900
3901 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
3902 object before exporting symbol.
3903
e550e1a2
L
39042012-05-21 H.J. Lu <hongjiu.lu@intel.com>
3905
3906 * testsuite/tls_test.cc: Include "config.h" first.
3907 * testsuite/tls_test_c.c: Likewise.
3908
df7b86aa
NC
39092012-05-17 Daniel Richard G. <skunk@iskunk.org>
3910 Nick Clifton <nickc@redhat.com>
3911
3912 PR 14072
3913 * configure.in: Add check that sysdep.h has been included before
3914 any system header files.
3915 * configure: Regenerate.
3916 * config.in: Regenerate.
3917
1007b503
CC
39182012-05-14 Cary Coutant <ccoutant@google.com>
3919
3920 * layout.cc (Layout::make_output_section): Mark .tdata section
3921 as RELRO.
3922 * testsuite/relro_test.cc: Add a TLS variable.
3923
fd885f3a
L
39242012-05-10 H.J. Lu <hongjiu.lu@intel.com>
3925
3926 PR gold/14091
3927 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
3928 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
3929 R_X86_64_64.
3930
80f5885c
CC
39312012-05-08 Cary Coutant <ccoutant@google.com>
3932
3933 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
3934 (lines_only_debug_sections): Likewise.
3935
2e702c99
RM
39362012-05-02 Roland McGrath <mcgrathr@google.com>
3937
3938 * nacl.cc: New file.
3939 * nacl.h: New file.
3940 * Makefile.am (CCFILES, HFILES): Add them.
3941 * Makefile.in: Regenerate.
3942 * i386.cc (Output_data_plt_i386_nacl): New class.
3943 (Output_data_plt_i386_nacl_exec): New class.
3944 (Output_data_plt_i386_nacl_dyn): New class.
3945 (Target_i386_nacl): New class.
3946 (Target_selector_i386_nacl): New class.
3947 (target_selector_i386): Use it instead of Target_selector_i386.
3948 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
3949 (Target_x86_64_nacl): New class.
3950 (Target_selector_x86_64_nacl): New class.
3951 (target_selector_x86_64, target_selector_x32): Use it instead of
3952 Target_selector_x86_64.
3953 * arm.cc (Output_data_plt_arm_nacl): New class.
3954 (Target_arm_nacl): New class.
3955 (Target_selector_arm_nacl): New class.
3956 (target_selector_arm, target_selector_armbe): Use it instead of
3957 Target_selector_arm.
3958
3959 * target-select.cc (select_target): Take new Input_file* and off_t
3960 arguments, pass them on to recognize method of selector.
3961 * object.cc (make_elf_sized_object): Update caller.
3962 * parameters.cc (parameters_force_valid_target): Likewise.
3963 * incremental.cc (make_sized_incremental_binary): Likewise.
3964 * target-select.h: Update decl.
3965 (Target_selector::recognize): Take new Input_file* argument,
3966 pass it on to do_recognize.
3967 (Target_selector::do_recognize): Take new Input_file* argument.
3968 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
3969 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
3970 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
3971 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
3972
3973 * target.h (Target::Target_info): New members isolate_execinstr
3974 and rosegment_gap.
3975 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
3976 * arm.cc (Target_arm::arm_info): Update initializer.
3977 * i386.cc (Target_i386::i386_info): Likewise.
3978 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
3979 * sparc.cc (Target_sparc::sparc_info): Likewise.
3980 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
3981 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3982 * layout.cc (Layout::attach_allocated_section_to_segment):
3983 Take new const Target* argument. If target->isolate_execinstr(), act
3984 like --rosegment.
3985 (Layout::find_first_load_seg): Take new const Target* argument;
3986 if target->isolate_execinstr(), reject PF_X segments.
3987 (Layout::relaxation_loop_body): Update caller.
3988 (Layout::set_segment_offsets): If target->isolate_execinstr(),
3989 reset file offset to zero when we hit LOAD_SEG, and then do a second
3990 loop over the segments before LOAD_SEG to reassign offsets after
3991 addresses have been determined. Handle target->rosegment_gap().
3992 (Layout::attach_section_to_segment): Take new const Target* argument;
3993 pass it to attach_allocated_section_to_segment.
3994 (Layout::make_output_section): Update caller.
3995 (Layout::attach_sections_to_segments): Take new const Target* argument;
3996 pass it to attach_section_to_segment.
3997 * gold.cc (queue_middle_tasks): Update caller.
3998 * layout.h (Layout): Update method decls with new arguments.
3999
4000 * arm.cc (Target_arm::Target_arm): Take optional argument for the
4001 Target_info pointer to use.
4002 (Target_arm::do_make_data_plt): New virtual method.
4003 (Target_arm::make_data_plt): New method that calls it.
4004 (Target_arm::make_plt_entry): Use it.
4005 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
4006 for the section alignment.
4007 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
4008 method.
4009 (Output_data_plt_arm::first_plt_entry_offset): Call it.
4010 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
4011 method.
4012 (Output_data_plt_arm::get_plt_entry_size): Call it.
4013 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
4014 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
4015 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
4016 method.
4017 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
4018 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
4019 method instead of sizeof(plt_entry).
4020 (Output_data_plt_arm::add_entry): Likewise.
4021 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
4022 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
4023 than static method.
4024 (Target_arm::plt_entry_size): Likewise.
4025 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
4026 Move to ...
4027 (Output_data_plt_arm_standard): ... here, new class.
4028 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
4029 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
4030 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
4031
4032 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4033 Take additional argument for the PLT entry size.
4034 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
4035 Use get_plt_entry_size method rather than plt_entry_size variable.
4036 (Output_data_plt_x86_64::reserve_slot): Likewise.
4037 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
4038 (Output_data_plt_x86_64::add_entry): Likewise.
4039 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
4040 (Output_data_plt_x86_64::address_for_global): Likewise.
4041 (Output_data_plt_x86_64::address_for_local): Likewise.
4042 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4043 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
4044 Make method non-static.
4045 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
4046 method.
4047 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
4048 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
4049 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
4050 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
4051 virtual method.
4052 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
4053 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
4054 virtual method.
4055 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
4056 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
4057 virtual method.
4058 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
4059 (Output_data_plt_x86_64::plt_entry_size)
4060 (Output_data_plt_x86_64::first_plt_entry)
4061 (Output_data_plt_x86_64::plt_entry)
4062 (Output_data_plt_x86_64::tlsdesc_plt_entry)
4063 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
4064 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
4065 (Output_data_plt_x86_64_standard): ... here, new class.
4066 (Target_x86_64::Target_x86_64): Take optional argument for the
4067 Target_info pointer to use.
4068 (Target_x86_64::do_make_data_plt): New virtual method.
4069 (Target_x86_64::make_data_plt): New method to call it.
4070 (Target_x86_64::init_got_plt_for_update): Use that.
4071 Call this->plt_->add_eh_frame method here.
4072 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
4073 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
4074 rather than static method.
4075 (Target_x86_64::plt_entry_size): Likewise.
4076 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
4077 rather than plt_entry_size variable. Move guts of PLT filling to...
4078 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
4079 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
4080 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
4081
4082 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
4083 additional argument for the section alignment.
4084 Don't do add_eh_frame_for_plt here.
4085 (Output_data_plt_i386::first_plt_entry_offset): Make the method
4086 non-static. Use get_plt_entry_size method rather than plt_entry_size
4087 variable.
4088 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
4089 method.
4090 (Output_data_plt_i386::get_plt_entry_size): Call it.
4091 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
4092 (Output_data_plt_i386::add_eh_frame): New method to call it.
4093 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
4094 method.
4095 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
4096 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
4097 method.
4098 (Output_data_plt_i386::fill_plt_entry): New method to call it.
4099 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
4100 method instead of plt_entry_size.
4101 (Output_data_plt_i386::plt_entry_size)
4102 (Output_data_plt_i386::plt_eh_frame_fde_size)
4103 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
4104 (Output_data_plt_i386_standard): ... here, new class.
4105 (Output_data_plt_i386_exec): New class.
4106 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
4107 (Output_data_plt_i386_exec::first_plt_entry): ... here.
4108 (Output_data_plt_i386::exec_plt_entry): Move to ...
4109 (Output_data_plt_i386_exec::plt_entry): ... here.
4110 (Output_data_plt_i386_dyn): New class.
4111 (Output_data_plt_i386::first_plt_entry): Move to ...
4112 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
4113 (Output_data_plt_i386::dyn_plt_entry): Move to ...
4114 (Output_data_plt_i386_dyn::plt_entry): ... here.
4115 (Target_i386::Target_i386): Take optional argument for the Target_info
4116 pointer to use.
4117 (Target_i386::do_make_data_plt): New virtual method.
4118 (Target_i386::make_data_plt): New method to call it.
4119 (Target_i386::make_plt_section): Use that.
4120 Call this->plt_->add_eh_frame method here.
4121 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
4122 rather than plt_entry_size variable.
4123 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
4124 (Output_data_plt_i386::address_for_local): Likewise.
4125 (Output_data_plt_i386::do_write): Likewise.
4126 Move guts of PLT filling to...
4127 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
4128 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
4129 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
4130 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
4131
b9b9f2ee
CC
41322012-05-01 Cary Coutant <ccoutant@google.com>
4133
4134 * dwarf_reader.cc (Dwarf_die::read_attributes)
4135 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
4136 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
4137 * reduced_debug_output.cc
4138 (Output_reduced_debug_info_section::get_die_end): Remove
4139 DW_FORM_GNU_ref_index. Add default case.
4140
57923f48
MW
41412012-04-26 Mark Wielaard <mjw@redhat.com>
4142
4143 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
4144 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
4145 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
4146 DW_AT_high_pc as offset from DW_AT_low_pc.
4147
4148 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
4149 * testsuite/Makefile.in: Regenerate.
4150 * testsuite/gdb_index_test_3.c: New test source file.
4151 * testsuite/gdb_index_test_3.sh: New test source file.
4152
2c54b4f4
ILT
41532012-04-25 Ian Lance Taylor <iant@google.com>
4154
4155 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
4156 pointer.
4157 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
4158 as a class, not a struct.
4159 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
4160 (Target_arm::apply_cortex_a8_workaround): Likewise.
4161 * gc.h: Declare Reloc_types as a struct, not a class.
4162 * object.h: Declare Symbols_data as a struct.
4163 * reloc.h: Declare Read_relocs_data as a struct.
4164 * target.h: Declare Relocate_info as a struct.
4165
a5a5f7a3
DM
41662012-04-24 David S. Miller <davem@davemloft.net>
4167
4168 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
4169 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
4170 and R_SPARC_WPLT30.
4171
f038d496
CC
41722012-04-24 Cary Coutant <ccoutant@google.com>
4173
4174 * incremental-dump.cc (find_input_containing_global): Replace
4175 magic number with symbolic constant.
4176 (dump_incremental_inputs): Update version number.
4177 * incremental.cc (Output_section_incremental_inputs): Update version
4178 number; import symbolic constants from Incremental_inputs_reader.
4179 (Incremental_inputs::create_data_sections): Align relocations
4180 section correctly for 64-bit targets.
4181 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
4182 constants; add padding.
4183 (Output_section_incremental_inputs::write_header): Add assert for
4184 header_size.
4185 (Output_section_incremental_inputs::write_input_files): Add assert
4186 for input_entry_size.
4187 (Output_section_incremental_inputs::write_info_blocks): Add padding;
4188 add assert for object_info_size, input_section_entry_size,
4189 global_sym_entry_size.
4190 * incremental.h (Incremental_inputs_reader): Add symbolic constants
4191 for data structure sizes; use them.
4192 (Incremental_input_entry_reader): Import symbolic constants from
4193 Incremental_inputs_reader; use them.
4194
a4d85145
DM
41952012-04-23 David S. Miller <davem@davemloft.net>
4196
4197 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
4198 and elf_flags_set_.
4199 (Target_sparc::Target_sparc): Initialize new fields.
4200 (Target_sparc::do_make_elf_object): New function.
4201 (Target_sparc::do_adjust_elf_header): New function.
4202
1d509098
CC
42032012-04-23 Cary Coutant <ccoutant@google.com>
4204
4205 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
4206 CU range table of gdb index.
4207
7ebeff7f
DM
42082012-04-20 David S. Miller <davem@davemloft.net>
4209
4210 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
4211 instead of false.
4212
13cf9988
DM
42132012-04-16 David S. Miller <davem@davemloft.net>
4214
2a1079e8
DM
4215 * sparc.cc (Target_sparc::got_address): New function.
4216 (Sparc_relocate_functions::gdop_hix22): New function.
4217 (Sparc_relocate_functions::gdop_lox10): New function.
4218 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
4219 relocs.
4220 (Target_sparc::Scan::local): Likewise if the global symbol is not
4221 preemptible and is not IFUNC.
4222 (Target_sparc::Relocate::relocate): Perform GOTDATA code
4223 transformations for local and non-preemptible non-IFUNC global
4224 symbols.
4225
0bc964fc
DM
4226 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
4227 writing out 64-bit part of ranges.
4228
661d7a80
DM
4229 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
4230 -fpic and -fpie respectively.
4231 * Makefile.in: Regenerate.
4232
8c2bf391
DM
4233 * sparc.cc (class Target_sparc): Add rela_ifunc_.
4234 (Target_sparc::Target_sparc): Initialize new field.
4235 (Target_sparc::do_plt_section_for_global): New function.
4236 (Target_sparc::do_plt_section_for_local): New function.
4237 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
4238 (Target_sparc::make_plt_section): New function, broken out of
4239 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
4240 (Target_sparc::make_plt_entry): Call make_plt_section.
4241 (Target_sparc::make_local_ifunc_plt_entry): New function.
4242 (Target_sparc::rela_ifunc_section): New function.
4243 (Target_sparc::plt_section): Remove const.
4244 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
4245 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
4246 and ifunc_count_ fields.
4247 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
4248 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
4249 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
4250 (Output_data_plt_sparc::rela_ifunc): New function.
4251 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
4252 (Output_data_plt_sparc::has_ifunc_section): New function.
4253 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
4254 (Output_data_plt_sparc::address_for_global): New function.
4255 (Output_data_plt_sparc::address_for_local): New function.
4256 (Output_data_plt_sparc::plt_index_to_offset): New function.
4257 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
4258 and entry_count.
4259 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
4260 entry_count.
4261 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
4262 R_SPARC_JMP_IREL to switch.
4263 (Target_sparc::Scan::check_non_pic): Likewise.
4264 (Target_sparc::Scan::local): Handle IFUNC symbols.
4265 (Target_sparc::Scan::local): Likewise.
4266 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
4267 and plt_address_for_local.
4268 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
4269 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
4270
13cf9988
DM
4271 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
4272 (class Output_data_reloc): Adjust calls to Output_reloc_type.
4273 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
4274 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
4275 global relocs too.
4276 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
4277 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
4278 calls.
4279 * sparc.cc (Target_sparc::Scan::global): Likewise.
4280 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4281
31821be0
CC
42822012-04-16 Cary Coutant <ccoutant@google.com>
4283
4284 * archive.cc (Library_base::should_include_member): Check for
4285 --export-dynamic-symbol.
4286 * options.h (class General_options): Add --export-dynamic-symbol.
4287 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
4288 --export-dynamic-symbol.
4289 (Symbol_table::gc_mark_undef_symbols): Likewise.
4290 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
4291
2615994e
DM
42922012-04-12 David S. Miller <davem@davemloft.net>
4293
4294 * sparc.cc (Reloc::wdisp10): New relocation method.
4295 (Reloc::h34): Likewise.
4296 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
4297 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
4298 R_SPARC_WDISP10.
4299 (Target_sparc::Scan::local): Likewise.
4300 (Target_sparc::Scan::global): Likewise.
4301 (Target_sparc::Relocate::relocate): Likewise.
4302
6782735d
CC
43032012-04-09 Cary Coutant <ccoutant@google.com>
4304
4305 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
4306 low_pc == 0.
4307
8c7a0b00
ILT
43082012-04-06 Ian Lance Taylor <iant@google.com>
4309
4310 * timer.cc: #include <unistd.h>.
4311
58797674
RM
43122012-04-06 Roland McGrath <mcgrathr@google.com>
4313
4314 * configure.in (AC_CHECK_HEADERS): Add locale.h.
4315 * config.in: Regenerate.
4316 * configure: Regenerate.
4317
44350750
NC
43182012-04-05 Nick Clifton <nickc@redhat.com>
4319
4320 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
4321 (AM_LC_MESSAGES): Add.
4322 * aclocal.m4: Regenerate.
4323 * config.in: Regenerate.
4324 * configure: Regenerate.
4325
c1027032
CC
43262012-03-21 Cary Coutant <ccoutant@google.com>
4327
4328 * Makefile.am: Add gdb-index.cc, gdb-index.h.
4329 * Makefile.in: Regenerate.
4330 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
4331 (Sized_elf_reloc_mapper::symbol_section): New function.
4332 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
4333 (make_elf_reloc_mapper): New function.
4334 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
4335 (Dwarf_abbrev_table::do_read_abbrevs): New function.
4336 (Dwarf_abbrev_table::do_get_abbrev): New function.
4337 (Dwarf_ranges_table::read_ranges_table): New function.
4338 (Dwarf_ranges_table::read_range_list): New function.
4339 (Dwarf_pubnames_table::read_section): New function.
4340 (Dwarf_pubnames_table::read_header): New function.
4341 (Dwarf_pubnames_table::next_name): New function.
4342 (Dwarf_die::Dwarf_die): New function.
4343 (Dwarf_die::read_attributes): New function.
4344 (Dwarf_die::skip_attributes): New function.
4345 (Dwarf_die::set_name): New function.
4346 (Dwarf_die::set_linkage_name): New function.
4347 (Dwarf_die::attribute): New function.
4348 (Dwarf_die::string_attribute): New function.
4349 (Dwarf_die::int_attribute): New function.
4350 (Dwarf_die::uint_attribute): New function.
4351 (Dwarf_die::ref_attribute): New function.
4352 (Dwarf_die::child_offset): New function.
4353 (Dwarf_die::sibling_offset): New function.
4354 (Dwarf_info_reader::check_buffer): New function.
4355 (Dwarf_info_reader::parse): New function.
4356 (Dwarf_info_reader::do_parse): New function.
4357 (Dwarf_info_reader::do_read_string_table): New function.
4358 (Dwarf_info_reader::lookup_reloc): New function.
4359 (Dwarf_info_reader::get_string): New function.
4360 (Dwarf_info_reader::visit_compilation_unit): New function.
4361 (Dwarf_info_reader::visit_type_unit): New function.
4362 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
4363 Sized_elf_reloc_mapper.
4364 (Sized_dwarf_line_info::symbol_section): Remove function.
4365 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
4366 (Sized_dwarf_line_info::read_line_mappings): Remove object
4367 parameter, adjust callers.
4368 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
4369 * dwarf_reader.h: Include <sys/types.h>.
4370 (class Track_relocs): Remove forward declaration.
4371 (class Elf_reloc_mapper): New class.
4372 (class Sized_elf_reloc_mapper): New class.
4373 (class Dwarf_abbrev_table): New class.
4374 (class Dwarf_range_list): New class.
4375 (class Dwarf_ranges_table): New class.
4376 (class Dwarf_pubnames_table): New class.
4377 (class Dwarf_die): New class.
4378 (class Dwarf_info_reader): New class.
4379 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
4380 (Sized_dwarf_line_info::symbol_section): Remove member function.
4381 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
4382 base class.
4383 * gdb-index.cc: New source file.
4384 * gdb-index.h: New source file.
4385 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
4386 and .debug_types sections, call Layout::add_to_gdb_index.
4387 (Sized_relobj_incr::do_section_name): Implement.
4388 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
4389 return type; Implement.
4390 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
4391 return type.
4392 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
4393 parameter list and return type.
4394 (Sized_incr_dynobj::do_section_contents): Likewise.
4395 * layout.cc: Include gdb-index.h.
4396 (Layout::Layout): Initialize gdb_index_data_.
4397 (Layout::init_fixed_output_section): Check for .gdb_index section.
4398 (Layout::add_to_gdb_index): New function. Instantiate.
4399 * layout.h: Add forward declaration for class Gdb_index.
4400 (Layout::add_to_gdb_index): New member function.
4401 (Layout::gdb_index_data_): New data member.
4402 * main.cc: Include gdb-index.h.
4403 (main): Print statistics for gdb index.
4404 * object.cc (Object::section_contents): Move code into
4405 do_section_contents.
4406 (need_decompressed_section): Check for sections needed when building
4407 gdb index.
4408 (build_compressed_section_map): Likewise.
4409 (Sized_relobj_file::do_read_symbols): Need local symbols when building
4410 gdb index.
4411 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
4412 sections; call Layout::add_to_gdb_index.
4413 (Sized_relobj_file::do_decompressed_section_contents): Call
4414 do_section_contents directly.
4415 * object.h (Object::do_section_contents): Adjust parameter list and
4416 return type.
4417 (Object::do_decompressed_section_contents): Call do_section_contents
4418 directly.
4419 (Sized_relobj_file::do_section_contents): Adjust parameter list and
4420 return type.
4421 * options.h (class General_options): Add --gdb-index option.
4422 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
4423 list and return type.
4424 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
4425 * reloc.h (Track_relocs::checkpoint): New function.
4426 (Track_relocs::reset): New function.
4427
4428 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
4429 New test cases.
4430 * testsuite/Makefile.in: Regenerate.
4431 * testsuite/gdb_index_test.cc: New test source file.
4432 * testsuite/gdb_index_test_1.sh: New test source file.
4433 * testsuite/gdb_index_test_2.sh: New test source file.
4434
647f1574
DK
44352012-03-19 Doug Kwan <dougkwan@google.com>
4436
4437 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 4438 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
4439 __exidx_start and __exidx_end. Make symbol table parameter
4440 anonymous as it is not used.
4441 * gold.cc (queue_middle_tasks): Call target hook to define any
4442 target-specific symbols.
4443 * target.h (Target::define_standard_symbols): New method.
4444 (Target::do_define_standard_symbols): Same.
4445 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
4446 * testsuite/Makefile.in: Regenerate.
4447 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
4448 and __exidx_end.
4449 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
4450 relocations are generated for __exidx_start and __exidx_end.
4451
7c6109da
DK
44522012-03-16 Doug Kwan <dougkwan@google.com>
4453
4454 * testsuite/Makefile.am: Disable test initpri3b.
4455 * testsuite/Makefile.in: Regenerate.
4456
7b8957f8
DK
44572012-03-15 Doug Kwan <dougkwan@google.com>
4458
4459 * arm.cc (Target_arm::got_section): Make .got section read-only
4460 if -z now is given.
4461
14dc9ef7
ILT
44622012-03-15 Ian Lance Taylor <iant@google.com>
4463
4464 PR gold/13850
4465 * layout.cc (Layout::make_output_section): Correctly mark
4466 SHT_INIT_ARRAY, et. al., as relro.
4467
fa40b62a
DK
44682012-03-14 Doug Kwan <dougkwan@google.com>
4469
4470 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
4471 dynamic relocations for protected symbols in shared objects.
4472
fd325007
ILT
44732012-03-13 Ian Lance Taylor <iant@google.com>
4474
4475 * resolve.cc (Symbol_table::resolve): When merging common symbols,
4476 keep the larger alignment.
4477
e8dd54e1
CC
44782012-03-12 Cary Coutant <ccoutant@google.com>
4479
4480 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
4481 handling of DW_LNE_define_file.
4482
feb5f3b0
CC
44832012-03-12 Cary Coutant <ccoutant@google.com>
4484
4485 * reduced_debug_output.cc
4486 (Output_reduced_debug_info_section::get_die_end): Add new FORM
4487 codes to switch.
4488
a1fb4256
CC
44892012-02-29 Cary Coutant <ccoutant@google.com>
4490
4491 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
4492
5dd8762a
CC
44932012-02-29 Cary Coutant <ccoutant@google.com>
4494
4495 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4496 Call Object::decompressed_section_contents.
4497 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
4498 New dtor.
4499 (Sized_dwarf_line_info::buffer_start_): New data member.
4500 * merge.cc (Output_merge_data::do_add_input_section): Call
4501 Object::decompressed_section_contents.
4502 (Output_merge_string::do_add_input_section): Likewise.
4503 * object.cc (need_decompressed_section): New function.
4504 (build_compressed_section_map): Decompress sections needed later.
4505 (Sized_relobj_file::do_decompressed_section_contents): New function.
4506 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4507 * object.h (Object::decompressed_section_contents): New function.
4508 (Object::discard_decompressed_sections): New function.
4509 (Object::do_decompressed_section_contents): New function.
4510 (Object::do_discard_decompressed_sections): New function.
4511 (Compressed_section_info): New type.
4512 (Compressed_section_map): Include decompressed section contents.
4513 (Sized_relobj_file::do_decompressed_section_contents): New function.
4514 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4515
7b5de7ee
CC
45162012-02-16 Cary Coutant <ccoutant@google.com>
4517
4518 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
4519 * testsuite/Makefile.in: Regenerate.
4520
f9fa4a63
CC
45212012-02-14 Cary Coutant <ccoutant@google.com>
4522
4523 * options.cc (General_options::finalize): Disallow -pie and -static.
4524
2c175ebc
DK
45252012-02-03 Doug Kwan <dougkwan@google.com>
4526
4527 * arm.cc (Arm_relocate_functions::abs8,
4528 Arm_relocate_functions::abs16): Use
4529 Bits::has_signed_unsigned_overflow32.
4530 (Arm_relocate_functions::thm_abs8): Correct range of
4531 overflow check.
4532 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
4533 in assertions.
4534
90cff06f
DK
45352012-02-02 Doug Kwan <dougkwan@google.com>
4536
4537 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
4538 position independent outputs, not just shared objects.
4539
63887f3d
L
45402012-01-30 H.J. Lu <hongjiu.lu@intel.com>
4541
4542 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
4543 * configure: Regenerated.
4544
bef2b434
ILT
45452012-01-27 Ian Lance Taylor <iant@google.com>
4546
4547 * reloc.h (Bits): New class with static functions, copied from
4548 namespace utils in arm.cc.
4549 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
4550 instead.
4551
c335b55d
L
45522012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4553
4554 * incremental.cc (write_info_blocks): Correct relocation offset.
4555
41194d9f
L
45562012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4557
4558 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
4559 (Relocate::tls_gd_to_le): Likewise.
4560
1bae613c
L
45612012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4562
4563 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
4564
24482ca0
L
45652012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4566
4567 * configure.ac: Check if -mcmodel=medium works.
4568 * configure: Regenerated.
4569
c2c7840a
CC
45702012-01-24 Cary Coutant <ccoutant@google.com>
4571
4572 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
4573 definition and ...
4574 (read_unsigned_LEB_128_x): ... this new function.
4575 (read_signed_LEB_128): Replaced with inline definition and ...
4576 (read_signed_LEB_128_x): ... this new function.
4577 * int_encoding.h (read_unsigned_LEB_128_x): New function.
4578 (read_unsigned_LEB_128): Add inline definition.
4579 (read_signed_LEB_128_x): New function.
4580 (read_signed_LEB_128): Add inline definition.
4581 * testsuite/Makefile.am (leb128_unittest): New unit test.
4582 * testsuite/Makefile.in: Regenerate.
4583 * testsuite/leb128_unittest.cc: New unit test.
4584
833de760 45852012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
4586
4587 PR gold/13617
4588 * i386.cc (Target_i386::do_code_fill): When using a jmp
4589 instruction, pad with nop instructions.
4590 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4591
618d6666
L
45922012-01-22 H.J. Lu <hongjiu.lu@intel.com>
4593
4594 * x86_64.cc (gc_process_relocs): Add typename on types used in
4595 template.
4596 (scan_relocs): Likewise.
4597 (relocate_section): Likewise.
4598 (apply_relocation): Likewise.
4599
3660ff06
L
46002012-01-10 H.J. Lu <hongjiu.lu@intel.com>
4601
4602 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
4603 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
4604 under x32.
4605
fc51264f
L
46062012-01-09 H.J. Lu <hongjiu.lu@intel.com>
4607
4608 * x86_64.cc: Initial support for x32.
4609
dd74ae06
CC
46102012-01-03 Cary Coutant <ccoutant@google.com>
4611
4612 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
4613 Use abstract base class for GOT.
4614 * gold/output.h (class Output_data_got_base): New abstract base class.
4615 (class Output_data_got): Derive from new base class, adjust ctors.
4616 (Output_data_got::reserve_slot): Make virtual; rename to
4617 do_reserve_slot; Adjust callers.
4618 * gold/target.h (Sized_target::init_got_plt_for_update): Return
4619 pointer to abstract base class.
4620 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
4621
83896202
ILT
46222011-12-18 Ian Lance Taylor <iant@google.com>
4623
4624 * object.h (Relobj::local_symbol_value): New function.
4625 (Relobj::local_plt_offset): New function.
4626 (Relobj::local_has_got_offset): New function.
4627 (Relobj::local_got_offset): New function.
4628 (Relobj::set_local_got_offset): New function.
4629 (Relobj::do_local_symbol_value): New pure virtual function.
4630 (Relobj::do_local_plt_offset): Likewise.
4631 (Relobj::do_local_has_got_offset): Likewise.
4632 (Relobj::do_local_got_offset): Likewise.
4633 (Relobj::do_set_local_got_offset): Likewise.
4634 (Sized_relobj::do_local_has_got_offset): Rename from
4635 local_has_got_offset.
4636 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
4637 (Sized_relobj::do_set_local_got_offset): Rename from
4638 set_local_got_offset.
4639 (Sized_relobj_file::do_local_plt_offset): Rename from
4640 local_plt_offset.
4641 (Sized_relobj_file::do_local_symbol_value): New function.
4642 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
4643 local_plt_offset.
4644 * output.cc (Output_data_got::Got_entry::write): Change object to
4645 Relobj. Use local_symbol_value.
4646 (Output_data_got::add_global_with_rel): Change rel_dyn to
4647 Output_data_reloc_generic*. Use add_global_generic.
4648 (Output_data_got::add_global_with_rela): Remove. Change all
4649 callers to use add_global_with_rel.
4650 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
4651 Output_data_reloc_generic*. Use add_global_generic.
4652 (Output_data_got::add_global_pair_with_rela): Remove. Change all
4653 callers to use add_global_pair_with_rel.
4654 (Output_data_got::add_local): Change object to Relobj*.
4655 (Output_data_got::add_local_plt): Likewise.
4656 (Output_data_got::add_local_with_rel): Change object to Relobj*,
4657 change rel_dyn to Output_data_reloc_generic*. Use
4658 add_local_generic.
4659 (Output_data_got::add_local_with_rela): Remove. Change all
4660 callers to use all_local_with_rel.
4661 (Output_data_got::add_local_pair_with_rel): Change object to
4662 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
4663 add_output_section_generic.
4664 (Output_data_got::add_local_pair_with_rela): Remove. Change all
4665 callers to use add_local_pair_with_rel.
4666 (Output_data_got::reserve_local): Change object to Relobj*.
4667 * output.h: (class Output_data_reloc_generic): Add pure virtual
4668 declarations for add_global_generic, add_local_generic,
4669 add_output_section_generic.
4670 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
4671 functions for Output_data_reloc_generic. Update declarations for
4672 changes listed in output.cc.
4673 (class Output_data_got): Change template parameter to got_size.
4674 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
4675 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
4676 function.
4677 (Sized_relobj_incr::do_local_plt_offset): New function.
4678 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
4679 add_global_generic.
4680
76677ad0
CC
46812011-12-17 Cary Coutant <ccoutant@google.com>
4682
4683 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
4684 * resolve.cc (Symbol_table::resolve): Likewise.
4685 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
4686 arrays.
4687 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4688
8b8dd8d5
ILT
46892011-12-16 Ian Lance Taylor <iant@google.com>
4690
4691 * output.h (Output_data_reloc_generic::add): Only call
4692 add_dynamic_reloc if this is a dynamic reloc section.
4693
d55525b9
L
46942011-12-15 H.J. Lu <hongjiu.lu@intel.com>
4695
4696 PR gold/13505
4697 * target-reloc.h (apply_relocation): Replace <64, false> with
4698 <size, big_endian>.
4699
ff81c7c1
NC
47002011-11-25 Nick Clifton <nickc@redhat.com>
4701
4702 * po/it.po: New Italian translation.
4703
628f39be
SA
47042011-11-17 Sterling Augustine <saugustine@google.com>
4705
4706 * script.cc (script_include_directive): Implement.
4707 (read_script_file): New local variables name and search_path. Update
4708 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
4709 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
4710 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
4711
98ef3ea4
SA
47122011-11-11 Sterling Augustine <saugustine@google.com>
4713
4714 * yyscript.y (section_cmd): Add support for INCLUDE directive.
4715 (file_or_sections_cmd): Likewise.
4716
f4a8b6d7
DK
47172011-11-11 Doug Kwan <dougkwan@google.com>
4718
4719 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
4720 if --just-symbols is given.
4721
29ab395d
DK
47222011-11-10 Doug Kwan <dougkwan@google.com>
4723
4724 PR gold/13362
4725 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
4726 when processing data relocs.
4727 * reloc.h (Relocate_functions::rel_unaligned): New method.
4728 (Relocate_functions::pcrel_unaligned): Ditto.
4729 (Relocate_functions::rel32_unaligned): Ditto.
4730 (Relocate_functions::pcrel32_unaligned): Ditto.
4731
2c339f71
DK
47322011-11-09 Doug Kwan <dougkwan@google.com>
4733
4734 PR gold/13362
4735 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
4736 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
4737 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
4738 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4739 (Relocate_functions::rel_unaligned): New.
4740 (Relocate_functions::rel32_unaligned): New.
4741 * target-reloc.h (relocate_for_relocatable): Add code to handle
4742 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4743 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
4744 arm_unaligned_reloc_r): New targets.
4745 * testsuite/Makefile.in: Regenerate.
4746 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
4747 linking.
4748
3f3cddf1
ILT
47492011-11-02 Ian Lance Taylor <iant@google.com>
4750
4751 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
4752 NATIVE_LINKER.
4753 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
4754 * options.cc (General_options::finalize): Use library search path
4755 from configure script if specified. If not native and no sysroot,
4756 only search TOOLLIBDIR.
4757 * options.h (Search_directory::Search_directory): Change name to
4758 const std::string&.
4759 (General_options::add_to_library_path_with_sysroot): Change arg to
4760 const std::string&.
4761 * configure, Makefile.in, config.in: Rebuild.
4762
a8e2273b
ILT
47632011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4764
4765 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
4766 we are working around the ARM1176 Erratum.
4767 * options.h (General_options::fix_arm1176): Add option.
4768 * testsuite/Makefile.am: Add testcases, and keep current ones
4769 working.
4770 * testsuite/Makefile.in: Regenerate.
4771 * testsuite/arm_fix_1176.s: New file.
4772 * testsuite/arm_fix_1176.sh: Likewise.
4773
cd6eab1c
ILT
47742011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4775
4776 * arm.cc (Target_arm::Target_arm): Remove initialisation of
4777 may_use_blx_.
4778 (Target_arm::may_use_blx): Remove method.
4779 (Target_arm::set_may_use_blx): Likewise.
4780 (Target_arm::may_use_v4t_interworking): New method.
4781 (Target_arm::may_use_v5t_interworking): Likewise.
4782 (Target_arm::may_use_blx_): Remove member variable.
4783 (Arm_relocate_functions::arm_branch_common): Check for v5T
4784 interworking.
4785 (Arm_relocate_functions::thumb_branch_common): Likewise.
4786 (Reloc_stub::stub_type_for_reloc): Likewise.
4787 (Target_arm::do_finalize_sections): Correct interworking checks.
4788 * testsuite/Makefile.am: Add new tests.
4789 * testsuite/Makefile.in: Regenerate.
4790 * testsuite/arm_farcall_arm_arm.s: New test.
4791 * testsuite/arm_farcall_arm_arm.sh: Likewise.
4792 * testsuite/arm_farcall_arm_thumb.s: Likewise.
4793 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
4794 * testsuite/arm_farcall_thumb_arm.s: Likewise.
4795 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
4796 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
4797 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
4798
286adcf4
CC
47992011-10-31 Cary Coutant <ccoutant@google.com>
4800
4801 PR gold/13023
4802 * expression.cc (Expression::eval_with_dot): Add
4803 is_section_dot_assignment parameter.
4804 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
4805 absolute and assigning to dot within a section.
4806 * script-sections.cc
4807 (Output_section_element_assignment::set_section_addresses): Pass
4808 dot_section to set_if_absolute.
4809 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
4810 as is_section_dot_assignment flag to eval_with_dot.
4811 (Output_section_element_dot_assignment::set_section_addresses):
4812 Likewise.
4813 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
4814 parameter. Also set value if relative to dot_section; set the
4815 symbol's output_section.
4816 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
4817 parameter. Adjust all callers.
4818 (Expression::eval_maybe_dot): Likewise.
4819 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
4820 Adjust all callers.
4821 * testsuite/script_test_2.t: Test assignment of an absolute value
4822 to dot within an output section element.
4823
9634ed06
CC
48242011-10-31 Cary Coutant <ccoutant@google.com>
4825
4826 * options.h (class General_options): Add --[no-]gnu-unique options.
4827 * symtab.cc (Symbol_table::sized_write_globals): Convert
4828 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
4829
de4101c7
CC
48302011-10-31 Cary Coutant <ccoutant@google.com>
4831
4832 PR gold/13359
4833 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
4834 unnecessary assertion.
4835 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
4836
7257cc92
ST
48372011-10-31 Sriraman Tallam <tmsriram@google.com>
4838
4839 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4840 gc_mark_symbol.
4841 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4842 gc_mark_symbol.
4843 Change to just keep the section associated with symbol.
4844 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
4845 they are externally visible and --export-dynamic is turned on.
4846 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
4847
bfc34b3f
ILT
48482011-10-19 Ian Lance Taylor <iant@google.com>
4849
4850 PR gold/13163
4851 * script-sections.cc
4852 (Output_section_element_dot_assignment::needs_output_section): New
4853 function.
4854
ea0d8c47
ILT
48552011-10-19 Ian Lance Taylor <iant@google.com>
4856
4857 PR gold/13204
4858 * layout.cc (Layout::segment_precedes): Don't assert failure if a
4859 --section-start option was seen.
4860 * options.h (General_options::any_section_start): New function.
4861
abd242a9
DM
48622011-10-18 David S. Miller <davem@davemloft.net>
4863
4864 PR binutils/13301
4865 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
4866 member to track relocation locations that have moved during TLS
4867 reloc optimizations.
4868 (Target_sparc::Relocate::Relocate): Initialize to NULL.
4869 (Target_sparc::Relocate::relocate): Adjust view down by 4
4870 bytes if it matches reloc_adjust_addr_.
4871 (Target_sparc::Relocate::relocate_tls): Always move the
4872 __tls_get_addr call delay slot instruction forward 4 bytes when
4873 performing relaxation.
4874
bab9090f
CC
48752011-10-18 Cary Coutant <ccoutant@google.com>
4876
4877 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
4878 (Output_file::map_no_anonymous): Check for non-zero
4879 return code from posix_fallocate.
4880
f7c5b166
CC
48812011-10-17 Cary Coutant <ccoutant@google.com>
4882
4883 PR gold/13245
4884 * plugin.cc (is_visible_from_outside): Check for symbols
4885 referenced from dynamic objects.
4886 * resolve.cc (Symbol_table::resolve): Don't count references
4887 from dynamic objects as references from real ELF files.
4888 * testsuite/plugin_test_2.sh: Adjust expected result.
4889
b490c0bb
CC
48902011-10-17 Cary Coutant <ccoutant@google.com>
4891
4892 * gold.cc: Include timer.h.
4893 (queue_middle_tasks): Stamp time.
4894 (queue_final_tasks): Likewise.
4895 * main.cc (main): Store timer in parameters. Print timers
4896 for each pass.
4897 * parameters.cc (Parameters::Parameters): Initialize timer_.
4898 (Parameters::set_timer): New function.
4899 (set_parameters_timer): New function.
4900 * parameters.h (Parameters::set_timer): New function.
4901 (Parameters::timer): New function.
4902 (Parameters::timer_): New data member.
4903 (set_parameters_timer): New function.
4904 * timer.cc (Timer::stamp): New function.
4905 (Timer::get_pass_time): New function.
4906 * timer.h (Timer::stamp): New function.
4907 (Timer::get_pass_time): New function.
4908 (Timer::pass_times_): New data member.
4909
f475cf7b
CC
49102011-10-17 Cary Coutant <ccoutant@google.com>
4911
4912 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
4913 task for members of lib groups.
4914
cdd7e244
CC
49152011-10-17 Cary Coutant <ccoutant@google.com>
4916
4917 PR gold/13288
4f95c8b4 4918 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
4919 (File_read::make_view): Move bounds check (replace with assert)...
4920 (File_read::find_or_make_view): ... to here.
4921
dfb45471
CC
49222011-10-12 Cary Coutant <ccoutant@google.com>
4923
4f95c8b4 4924 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
4925 ::read returns less than requested size.
4926
53bbcc1b
CC
49272011-10-10 Cary Coutant <ccoutant@google.com>
4928
4f95c8b4 4929 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
4930 Initialize defined_count_.
4931 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
4932 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
4933 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
4934 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
4935 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 4936 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
4937 member.
4938 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 4939 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
4940 Return zeroes instead of internal error.
4941
397b129b
CC
49422011-10-10 Cary Coutant <ccoutant@google.com>
4943
4944 PR gold/13249
4f95c8b4 4945 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 4946 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 4947 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
4948 (Output_reloc::type_): Adjust size of bit field.
4949 (Output_reloc::use_plt_offset_): New bit field.
4950 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
4951 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
4952 flag. Adjust all callers.
4f95c8b4 4953 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
4954 creating RELATIVE relocations.
4955
d5698657
NC
49562011-10-10 Nick Clifton <nickc@redhat.com>
4957
4958 * po/es.po: Updated Spanish translation.
4959 * po/fi.po: Updated Finnish translation.
4960
6a59a5c2
DN
49612011-10-03 Diego Novillo <dnovillo@google.com>
4962
4963 * options.cc (parse_uint): Fix dereference of RETVAL.
4964
f0558624
ST
49652011-09-29 Sriraman Tallam <tmsriram@google.com>
4966
4967 * layout.h (section_order_map_): New member.
4968 (get_section_order_map): New member function.
4969 * output.cc (Output_section::add_input_section): Check for patterns
4970 only when --section-ordering-file is specified.
4971 * gold.cc (queue_middle_tasks): Delay updating order of sections till
4972 output_sections have been formed.
4973 * layout.cc (Layout_Layout): Initialize section_order_map_.
4974 * plugin.cc (update_section_order): Store order in order_map. Do not
4975 update the order.
4976 * testsuite/Makefile.am: Add test case for plugin_final_layout.
4977 * testsuite/Makefile.in: Regenerate.
4978 * testsuite/plugin_section_order.c: New file.
4979 * testsuite/plugin_final_layout.cc: New file.
4980 * testsuite/plugin_final_layout.sh: New file.
4981
a7dac153
CC
49822011-09-29 Cary Coutant <ccoutant@google.com>
4983
4f95c8b4 4984 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 4985 Check for NULL.
4f95c8b4 4986 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
4987 symbols during incremental update.
4988 (Symbol_table::add_from_dynobj): Likewise.
4989
eebd87a5
ILT
49902011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4991 Ian Lance Taylor <iant@google.com>
4992
4993 * symtab.cc (Symbol_table::define_special_symbol): Always
4994 canonicalize version string.
4995
403a3331
CC
49962011-09-26 Cary Coutant <ccoutant@google.com>
4997
4f95c8b4
CC
4998 * gold.cc (queue_initial_tasks): Move option checks ...
4999 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
5000 some options; make others fatal.
5001
235061c2
CC
50022011-09-26 Cary Coutant <ccoutant@google.com>
5003
5004 gcc PR lto/47247
5005 * plugin.cc (get_symbols_v2): New function.
5006 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
5007 (is_referenced_from_outside): New function.
5008 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
5009 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
5010 (get_symbols): Pass version parameter.
5011 (get_symbols_v2): New function.
5012 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
5013 parameter.
5014 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
5015 (onload): Add LDPT_GET_SYMBOLS_V2.
5016 (all_symbols_read_hook): Use get_symbols_v2; check for
5017 LDPR_PREVAILING_DEF_IRONLY_EXP.
5018 * testsuite/plugin_test_3.sh: Update expected results.
5019
dc87f620
ILT
50202011-09-23 Simon Baldwin <simonb@google.com>
5021
5022 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
5023 configuration options.
5024 * configure: Regenerate.
5025 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
5026 * Makefile.in: Regenerate.
5027 * testsuite/Makefile.in: Regenerate.
5028
a8279f82
ST
50292011-09-19 Sriraman Tallam <tmsriram@google.com>
5030
5031 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
5032
0c9350c8
CC
50332011-09-19 Cary Coutant <ccoutant@google.com>
5034
5035 * incremental.cc (can_incremental_update): Fix typo in comment.
5036 * incremental.h (can_incremental_update): Likewise.
5037
aa06ae28
CC
50382011-09-18 Cary Coutant <ccoutant@google.com>
5039
5040 * incremental.cc (can_incremental_update): New function.
5041 * incremental.h (can_incremental_update): New function.
5042 * layout.cc (Layout::init_fixed_output_section): Call it.
5043 (Layout::make_output_section): Don't allow patch space in .eh_frame.
5044 * object.cc (Sized_relobj_file::do_layout): Call
5045 can_incremental_update.
5046
ebb300b2
CC
50472011-09-13 Cary Coutant <ccoutant@google.com>
5048
5049 * configure.ac: Check for glibc support for gnu_indirect_function
5050 support with static linking, setting automake conditional
5051 IFUNC_STATIC.
5052 * Makefile.in: Regenerate.
5053 * configure: Regenerate.
5054
5055 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
5056 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
5057 for IFUNC_STATIC.
5058 * testsuite/Makefile.in: Regenerate.
5059
1206d0d5
CC
50602011-09-13 Cary Coutant <ccoutant@google.com>
5061
5062 * incremental.cc (Sized_relobj_incr::do_layout): Call
5063 report_comdat_group for kept comdat sections.
5064 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
5065 * testsuite/Makefile.in: Regenerate.
5066 * testsuite/incr_comdat_test_1.cc: New source file.
5067 * testsuite/incr_comdat_test_2_v1.cc: New source file.
5068 * testsuite/incr_comdat_test_2_v2.cc: New source file.
5069 * testsuite/incr_comdat_test_2_v3.cc: New source file.
5070
40b29874
ILT
50712011-09-13 Ian Lance Taylor <iant@google.com>
5072
5073 * object.cc (Sized_relobj_file::do_layout): Remove unused local
5074 variable external_symbols_offset.
5075
1b045aac
ILT
50762011-09-12 Ian Lance Taylor <iant@google.com>
5077
5078 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
5079 triggered if object has no symbols.
5080
24c6c55a
DM
50812011-09-09 David S. Miller <davem@davemloft.net>
5082
5083 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
5084 (Output_fill_debug_line::do_write): Likewise.
5085
66570254
CC
50862011-08-29 Cary Coutant <ccoutant@google.com>
5087
5088 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
5089 casts to match formatting specs.
5090 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
5091
8ea8cd50
CC
50922011-08-26 Cary Coutant <ccoutant@google.com>
5093
5094 * layout.cc (Free_list::allocate): Provide guarantee of minimum
5095 remaining hole size when allocating.
5096 (Layout::make_output_section): Set fill methods for debug sections.
5097 * layout.h (Free_list::Free_list_node): Move from private to
5098 public.
5099 (Free_list::set_min_hole_size): New function.
5100 (Free_list::begin, Free_list::end): New functions.
5101 (Free_list::min_hole_): New data member.
5102 * output.cc: Include dwarf.h.
5103 (Output_fill_debug_info::do_minimum_hole_size): New function.
5104 (Output_fill_debug_info::do_write): New function.
5105 (Output_fill_debug_line::do_minimum_hole_size): New function.
5106 (Output_fill_debug_line::do_write): New function.
5107 (Output_section::Output_section): Initialize new data member.
5108 (Output_section::set_final_data_size): Ensure patch space is larger
5109 than minimum hole size.
5110 (Output_section::do_write): Fill holes in debug sections.
5111 * output.h (Output_fill): New class.
5112 (Output_fill_debug_info): New class.
5113 (Output_fill_debug_line): New class.
5114 (Output_section::set_free_space_fill): New function.
5115 (Output_section::free_space_fill_): New data member.
5116 * testsuite/Makefile.am (incremental_test_3): Add
5117 --incremental-patch option.
5118 (incremental_test_4): Likewise.
5119 (incremental_test_5): Likewise.
5120 (incremental_test_6): Likewise.
5121 (incremental_copy_test): Likewise.
5122 (incremental_common_test_1): Likewise.
5123 * testsuite/Makefile.in: Regenerate.
5124
7cf80422
NC
51252011-08-26 Nick Clifton <nickc@redhat.com>
5126
5127 * po/es.po: Updated Spanish translation.
5128
c3f7b0e5
CC
51292011-08-01 Cary Coutant <ccoutant@google.com>
5130
5131 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
5132 * gold/testsuite/Makefile.in: Regenerate.
5133 * gold/testsuite/justsyms_exec.c: New source file.
5134 * gold/testsuite/justsyms_lib.c: New source file.
5135
9590bf25
CC
51362011-08-01 Cary Coutant <ccoutant@google.com>
5137
5138 * layout.cc (Layout::set_segment_offsets): Don't realign text
5139 segment if -Ttext was specified.
5140 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
5141 file type.
5142 * object.h (Sized_relobj_file::e_type): New function.
5143 (Sized_relobj_file::e_type_): New data member.
5144 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
5145 base address for ET_EXEC files.
5146 * target.cc (Target::do_make_elf_object_implementation): Allow
5147 ET_EXEC files with --just-symbols option.
5148
dcd8d12e
CC
51492011-07-28 Cary Coutant <ccoutant@google.com>
5150
5151 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
5152 Add thread_number parameter.
5153 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
5154 * workqueue-threads.cc
5155 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
5156 current thread if its thread number is greater than desired thread
5157 count.
5158 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
5159 Add thread_number parameter.
5160 (Workqueue::should_cancel_thread): Likewise.
5161 (Workqueue::find_runnable_or_wait): Pass thread_number to
5162 should_cancel_thread.
5163 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
5164 parameter.
5165
804eb480
ST
51662011-07-22 Sriraman Tallam <tmsriram@google.com>
5167
5168 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
5169 only after checking if it cannot be forced local.
5170 * symtab.h (is_externally_visible): Check if the symbol is not forced
5171 local.
5172
f1ddb600
ILT
51732011-07-15 Ian Lance Taylor <iant@google.com>
5174
5175 * options.h (class General_options): Add --print-output-format.
5176 Move -EL next to -EB, for better --help output.
5177 * target-select.cc: Include <cstdio>, "options.h", and
5178 "parameters.h".
5179 (Target_selector::do_target_bfd_name): New function.
5180 (print_output_format): New function.
5181 * target-select.h (class Target_selector): Update declarations.
5182 (Target_selector::target_bfd_name): New function.
5183 (print_output_format): Declare.
5184 * main.cc: Include "target-select.h".
5185 (main): Handle --print-output-format.
5186 * gold.cc: Include "target-select.h".
5187 (queue_initial_tasks): Handle --print-output-format when there are
5188 no input files.
5189 * parameters.cc (parameters_force_valid_target): Give a better
5190 error message if -EB/-EL does not match target.
5191 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
5192 function.
5193
7d172687
ILT
51942011-07-15 Ian Lance Taylor <iant@google.com>
5195
5196 * i386.cc (class Output_data_plt_i386): Add layout_ field.
5197 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
5198 (Output_data_plt_i386::do_write): Write address of .dynamic
5199 section to first entry in .got.plt section.
5200 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
5201 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5202 Initialize layout_.
5203 (Output_data_plt_x86_64::do_write): Write address of .dynamic
5204 section to first entry in .got.plt section.
5205 * layout.h (Layout::dynamic_section): New function.
5206
e9552f7e
ST
52072011-07-13 Sriraman Tallam <tmsriram@google.com>
5208
5209 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
5210 to claim_file call.
5211 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
5212 input_section_position_, and input_section_glob_.
5213 (read_layout_from_file): Call function section_ordering_specified.
5214 * layout.h (is_section_ordering_specified): New function.
5215 (section_ordering_specified): New function.
5216 (section_ordering_specified_): New boolean member.
5217 * main.cc(main): Call load_plugins after layout object is defined.
5218 * output.cc (Output_section::add_input_section): Use
5219 function section_ordering_specified to check if section ordering is
5220 needed.
5221 * output.cc (Output_section::add_relaxed_input_section): Use
5222 function section_ordering_specified to check if section ordering is
5223 needed.
5224 (Output_section::update_section_layout): New function.
5225 (Output_section::sort_attached_input_sections): Check if input section
5226 must be reordered.
5227 * output.h (Output_section::update_section_layout): New function.
5228 * plugin.cc (get_section_count): New function.
5229 (get_section_type): New function.
5230 (get_section_name): New function.
5231 (get_section_contents): New function.
5232 (update_section_order): New function.
58797674 5233 (allow_section_ordering): New function.
e9552f7e
ST
5234 (Plugin::load): Add the new interfaces to the transfer vector.
5235 (Plugin_manager::load_plugins): New parameter.
5236 (Plugin_manager::all_symbols_read): New parameter.
5237 (Plugin_manager::claim_file): New parameter. Save the elf object for
5238 unclaimed objects.
5239 (Plugin_manager::get_elf_object): New function.
5240 (Plugin_manager::get_view): Change to directly use the bool to check
5241 if get_view is called from claim_file_hook.
5242 * plugin.h (input_objects): New function
5243 (Plugin__manager::load_plugins): New parameter.
5244 (Plugin_manager::claim_file): New parameter.
5245 (Plugin_manager::get_elf_object): New function.
5246 (Plugin_manager::in_claim_file_handler): New function.
5247 (Plugin_manager::in_claim_file_handler_): New member.
5248 (layout): New function.
5249 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
5250 handler with an extra parameter. Make the elf object before calling
5251 claim_file handler.
5252 * testsuite/plugin_test.c (get_section_count): New function pointer.
5253 (get_section_type): New function pointer.
5254 (get_section_name): New function pointer.
5255 (get_section_contents): New function pointer.
5256 (update_section_order): New function pointer.
5257 (allow_section_ordering): New function pointer.
5258 (onload): Check if the new interfaces exist.
5259
9446efde
ILT
52602011-07-13 Ian Lance Taylor <iant@google.com>
5261
5262 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
5263 relro section.
5264 * x86_64.cc (Target_x86_64::got_section): Likewise.
5265 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
5266 (relro_now_test_SOURCES): New variable.
5267 (relro_now_test_DEPENDENCIES): New variable.
5268 (relro_now_test_LDFLAGS): New variable.
5269 (relro_now_test_LDADD): New variable.
5270 (relro_now_test.so): New target.
5271 * testsuite/Makefile.in: Rebuild.
5272
07aa62f2
ILT
52732011-07-12 Ian Lance Taylor <iant@google.com>
5274
5275 PR gold/12980
5276 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
5277 GLOB_DAT relocation rather than a RELATIVE relocation for a
5278 protected symbol when creating a shared library.
5279 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5280 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
5281 * testsuite/protected_main_1.cc (main): Test that protected
5282 function has same address.
5283
e2153196
ILT
52842011-07-11 Ian Lance Taylor <iant@google.com>
5285
5286 PR gold/12979
5287 * options.h (class General_options): Add -Bgroup.
5288 * options.cc (General_options::finalize): If -Bgroup is set,
5289 default to --unresolved-symbols=report-all.
5290 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
5291 * target-reloc.h (issue_undefined_symbol_error): Handle
5292 --unresolved-symbols=report-all.
5293
6daf5215
ILT
52942011-07-08 Ian Lance Taylor <iant@google.com>
5295
5296 PR gold/11985
5297 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
5298 if linker script discards key sections.
5299 (Layout::create_dynamic_symtab): Likewise.
5300 (Layout::assign_local_dynsym_offsets): Likewise.
5301 (Layout::sized_create_version_sections): Likewise.
5302 (Layout::create_interp): Likewise.
5303 (Layout::finish_dynamic_section): Likewise.
5304 (Layout::set_dynamic_symbol_size): Likewise.
5305
beabb2c6
ILT
53062011-07-08 Ian Lance Taylor <iant@google.com>
5307
5308 PR gold/12386
5309 * options.h (class General_options): Add --unresolved-symbols.
5310 * target-reloc.h (issue_undefined_symbol_error): Check
5311 --unresolved-symbols. Add comments.
5312
9c16daf1
ILT
53132011-07-08 Ian Lance Taylor <iant@google.com>
5314
5315 * testsuite/odr_violation2.cc (Ordering::operator()): Make
5316 expression more complex.
5317
191f1a2d
ILT
53182011-07-08 Ian Lance Taylor <iant@google.com>
5319
5320 PR gold/11317
5321 * target-reloc.h (issue_undefined_symbol_error): New inline
5322 function, broken out of relocate_section.
5323 (relocate_section): Call issue_undefined_symbol_error.
5324 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5325 there is no TLS segment if we are about to issue an undefined
5326 symbol error.
5327 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5328
62855347
ILT
53292011-07-08 Ian Lance Taylor <iant@google.com>
5330
5331 PR gold/12279
5332 * resolve.cc (Symbol_table::should_override): Add fromtype
5333 parameter. Change all callers. Give error when linking together
5334 TLS and non-TLS symbol.
5335 (Symbol_table::should_override_with_special): Add fromtype
5336 parameter. Change all callers.
5337 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5338 there is no TLS segment if we have reported some errors.
5339 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5340
67181c72
ILT
53412011-07-08 Ian Lance Taylor <iant@google.com>
5342
5343 PR gold/12372
5344 * target.h (Target::plt_address_for_global): New function.
5345 (Target::plt_address_for_local): New function.
5346 (Target::plt_section_for_global): Remove.
5347 (Target::plt_section_for_local): Remove.
5348 (Target::do_plt_address_for_global): New virtual function.
5349 (Target::do_plt_address_for_local): New virtual function.
5350 (Target::do_plt_section_for_global): Remove.
5351 (Target::do_plt_section_for_local): Remove.
5352 (Target::register_global_plt_entry): Add Symbol_table and Layout
5353 parameters.
5354 * output.cc (Output_data_got::Got_entry::write): Use
5355 plt_address_for_global and plt_address_for_local.
5356 * layout.cc (Layout::add_target_dynamic_tags): Use size and
5357 address of output section.
5358 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
5359 got_irelative_, and irelative_count_ fields. Update
5360 declarations.
5361 (Output_data_plt_i386::has_irelative_section): New function.
5362 (Output_data_plt_i386::entry_count): Add irelative_count_.
5363 (Output_data_plt_i386::set_final_data_size): Likewise.
5364 (class Target_i386): Add got_irelative_ and rel_irelative_
5365 fields. Update declarations.
5366 (Target_i386::Target_i386): Initialize new fields.
5367 (Target_i386::do_plt_address_for_global): New function replacing
5368 do_plt_section_for_global.
5369 (Target_i386::do_plt_address_for_local): New function replacing
5370 do_plt_section_for_local.
5371 (Target_i386::got_section): Create got_irelative_.
5372 (Target_i386::rel_irelative_section): New function.
5373 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
5374 fields. Don't define __rel_iplt_{start,end}.
5375 (Output_data_plt_i386::add_entry): Add symtab and layout
5376 parameters. Change all callers. Use different PLT and GOT for
5377 IFUNC symbols.
5378 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
5379 layout parameters. Change all callers. Use different PLT and
5380 GOT.
5381 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
5382 (Output_data_plt_i386::rel_irelative): New function.
5383 (Output_data_plt_i386::address_for_global): New function.
5384 (Output_data_plt_i386::address_for_local): New function.
5385 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
5386 IRELATIVE GOT when changing IFUNC GOT entries.
5387 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
5388 reloc.
5389 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
5390 if we didn't create an IRELATIVE GOT.
5391 (Target_i386::Relocate::relocate): Use plt_address_for_global and
5392 plt_address_for_local.
5393 (Target_i386::do_dynsym_value): Use plt_address_for_global.
5394 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
5395 got_irelative_, and irelative_count_ fields. Update
5396 declarations.
5397 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5398 Initialize new fields. Remove symtab parameter. Change all
5399 callers.
5400 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
5401 irelative_count_.
5402 (Output_data_plt_x86_64::has_irelative_section): New function.
5403 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
5404 (class Target_x86_64): Add got_irelative_ and rel_irelative_
5405 fields. Update declarations.
5406 (Target_x86_64::Target_x86_64): Initialize new fields.
5407 (Target_x86_64::do_plt_address_for_global): New function replacing
5408 do_plt_section_for_global.
5409 (Target_x86_64::do_plt_address_for_local): New function replacing
5410 do_plt_section_for_local.
5411 (Target_x86_64::got_section): Create got_irelative_.
5412 (Target_x86_64::rela_irelative_section): New function.
5413 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
5414 all callers. Don't create __rel_iplt_{start,end}.
5415 (Output_data_plt_x86_64::add_entry): Add symtab and layout
5416 parameters. Change all callers. Use different PLT and GOT for
5417 IFUNC symbols.
5418 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
5419 layout parameters. Change all callers. Use different PLT and
5420 GOT.
5421 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
5422 parameters. Change all callers. Use different PLT and GOT for
5423 IFUNC symbols.
5424 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
5425 (Output_data_plt_x86_64::rela_irelative): New function.
5426 (Output_data_plt_x86_64::address_for_global): New function.
5427 (Output_data_plt_x86_64::address_for_local): New function.
5428 (Output_data_plt_x86_64::set_final_data_size): Likewise.
5429 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
5430 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
5431 (Target_x86_64::register_global_plt_entry): Add symtab and layout
5432 parameters.
5433 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
5434 reloc.
5435 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
5436 symbols if we didn't create an IRELATIVE GOT.
5437 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
5438 plt_address_for_local.
5439 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
5440 * testsuite/ifuncvar1.c: New test file.
5441 * testsuite/ifuncvar2.c: New test file.
5442 * testsuite/ifuncvar3.c: New test file.
5443 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
5444 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
5445 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
5446 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
5447 * testsuite/Makefile.in: Rebuild.
5448
33c15b45
CC
54492011-07-07 Cary Coutant <ccoutant@google.com>
5450
5451 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
5452 (two_file_test_1_ndebug.o): Likewise.
5453 (two_file_test_1b_ndebug.o): Likewise.
5454 (two_file_test_2_ndebug.o): Likewise.
5455 (two_file_test_main_ndebug.o): Likewise.
5456 (incremental_test_2): Link with no-debug versions.
5457
f48b5fb7
CC
54582011-07-06 Cary Coutant <ccoutant@google.com>
5459
5460 * gold/incremental.cc
5461 (Output_section_incremental_inputs::write_info_blocks): Check for
5462 hidden and internal symbols.
5463
221597a5
CC
54642011-07-06 Cary Coutant <ccoutant@google.com>
5465
5466 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
5467 Check disposition for startup file.
5468 (Incremental_inputs::report_command_line): Ignore
5469 --incremental-startup-unchanged option.
5470 * options.cc (General_options::parse_incremental_startup_unchanged):
5471 New function.
5472 (General_options::General_options): Initialize new data member.
5473 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
5474 (General_options): Add --incremental-startup-unchanged option.
5475 (General_options::incremental_startup_disposition): New function.
5476 (General_options::incremental_startup_disposition_): New data member.
5477
e24719f6
CC
54782011-07-06 Cary Coutant <ccoutant@google.com>
5479
5480 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
5481 input file index to Script_info ctor.
5482 (Sized_incremental_binary::do_file_has_changed): Find the
5483 command-line argument for files named in scripts.
5484 * incremental.h (Script_info::Script_info): New ctor
5485 with input file index.
5486 (Script_info::input_file_index): New function.
5487 (Script_info::input_file_index_): New data member.
5488 (Incremental_binary::get_library): Add const.
5489 (Incremental_binary::get_script_info): Add const.
5490 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
5491 * testsuite/Makefile.am (incremental_test_5): New test case.
5492 (incremental_test_6): New test case.
5493 * testsuite/Makefile.in: Regenerate.
5494
8f7c81e8
CC
54952011-07-06 Cary Coutant <ccoutant@google.com>
5496
5497 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
5498 debug output when command lines differ.
5499
9fbd3822
CC
55002011-07-06 Cary Coutant <ccoutant@google.com>
5501
5502 * incremental.cc (Incremental_inputs::report_command_line): Ignore
5503 --incremental-patch option.
5504 * layout.cc (Free_list::allocate): Extend allocation beyond original
5505 end if enabled.
5506 (Layout::make_output_section): Mark sections that should get
5507 patch space.
5508 * options.cc (parse_percent): New function.
5509 * options.h (parse_percent): New function.
5510 (DEFINE_percent): New macro.
5511 (General_options): Add --incremental-patch option.
5512 * output.cc (Output_section::Output_section): Initialize new data
5513 members.
5514 (Output_section::add_input_section): Print section name when out
5515 of patch space.
5516 (Output_section::add_output_section_data): Likewise.
5517 (Output_section::set_final_data_size): Add patch space when
5518 doing --incremental-full.
5519 (Output_section::do_reset_address_and_file_offset): Remove patch
5520 space.
5521 (Output_segment::set_section_list_addresses): Print debug output
5522 only if --incremental-update.
5523 * output.h (Output_section::set_is_patch_space_allowed): New function.
5524 (Output_section::is_patch_space_allowed_): New data member.
5525 (Output_section::patch_space_): New data member.
5526 * parameters.cc (Parameters::incremental_full): New function.
5527 * parameters.h (Parameters::incremental_full): New function
5528 * testsuite/Makefile.am (incremental_test_2): Add test for
5529 --incremental-patch option.
5530 * testsuite/Makefile.in: Regenerate.
5531 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
5532 (t18): Remove function body.
5533
f6cccc2c
DK
55342011-07-05 Doug Kwan <dougkwan@google.com>
5535
5536 PR gold/12771
5537 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
5538 Arm_Address type for relocation result.
5539 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
5540 overflow check.
5541 (Arm_relocate_functions::abs32): Use unaligned access.
5542 (Arm_relocate_functions::rel32): Ditto.
5543 (Arm_relocate_functions::prel31): Ditto.
5544 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
5545 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
5546 static data relocations.
5547 * testsuite/Makefile.in: Regnerate.
5548 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
5549
28a13fec
ILT
55502011-07-05 Ian Lance Taylor <iant@google.com>
5551
5552 PR gold/12392
5553 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
5554 symbols if necessary.
5555 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5556
24d47b34
ILT
55572011-07-05 Ian Lance Taylor <iant@google.com>
5558
5559 PR gold/12952
5560 * resolve.cc (Symbol::override_base_with_special): Simply override
5561 version with special symbol version, ignoring previous version.
5562
41f9cbbe
ILT
55632011-07-05 Ian Lance Taylor <iant@google.com>
5564
5565 * object.cc (Sized_relobj_file::include_section_group): Add
5566 information to comment about signature location.
5567
886288f1
ILT
55682011-07-02 Ian Lance Taylor <iant@google.com>
5569
5570 PR gold/12957
5571 * options.h (class General_options): Add -f and -F.
5572 * options.cc (General_options::finalize): Fatal error if -f/-F
5573 are used without -shared.
5574 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
5575
ae3a6d4f
ILT
55762011-07-02 Ian Lance Taylor <iant@google.com>
5577
5578 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
5579
21131061
ILT
55802011-07-01 Ian Lance Taylor <iant@google.com>
5581
5582 PR gold/12525
5583 PR gold/12952
5584 * resolve.cc (Symbol::override_base_with_special): Don't override
5585 the version if the overriding symbol has a different name.
5586 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
5587 all callers. If we give an error about an undefined version,
5588 define the base version if necessary.
5589 * dynobj.h (class Versions): Update declaration.
5590 * testsuite/weak_alias_test_5.cc: New file.
5591 * testsuite/weak_alias_test.script: New file.
5592 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
5593 and versioned_alias have the right value, and call t2.
5594 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
5595 weak_alias_test_5.so.
5596 (weak_alias_test_LDADD): Likewise.
5597 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
5598 * testsuite/Makefile.in: Rebuild.
5599
611062c0
ILT
56002011-07-01 Ian Lance Taylor <iant@google.com>
5601
5602 PR gold/12525
5603 * options.h (class General_options): Support -z notext.
5604 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
5605 -Wl,-z,notext.
5606 (two_file_shared_nonpic.so): Likewise.
5607 (two_file_shared_mixed.so): Likewise.
5608 (two_file_shared_mixed_1.so): Likewise.
5609 (weak_undef_lib_nonpic.so): Likewise.
5610 (alt/weak_undef_lib_nonpic.so): Likewise.
5611 (tls_test_shared_nonpic.so): Likewise.
5612 * testsuite/Makefile.in: Rebuild.
5613
328c7c2f
ILT
56142011-07-01 Ian Lance Taylor <iant@google.com>
5615
5616 PR gold/12525
5617 * configure.ac: Test whether static linking works, setting
5618 the automake conditional HAVE_STATIC.
5619 * testsuite/Makefile.am: Disable tests using -static if
5620 HAVE_STATIC is not true.
5621 * configure, testsuite/Makefile.in: Rebuild.
5622
02d7cd44
ILT
56232011-07-01 Ian Lance Taylor <iant@google.com>
5624
5625 PR gold/12525
5626 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
5627 Assert if we see DW_EH_PE_indirect.
5628 * target.h (Target::ehframe_datarel_base): New function.
5629 (Target::do_ehframe_datarel_base): New target function.
5630 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
5631 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
5632 function.
5633
07a60597
ILT
56342011-07-01 Ian Lance Taylor <iant@google.com>
5635
5636 PR gold/12571
5637 * options.h (class General_options): Add
5638 --ld-generated-unwind-info.
5639 * ehframe.cc (Fde::write): Add address parameter. Change all
5640 callers. If associated with PLT, fill in address and size.
5641 (Cie::set_output_offset): Only add merge mapping if there is an
5642 object.
5643 (Cie::write): Add address parameter. Change all callers.
5644 (Eh_frame::add_ehframe_for_plt): New function.
5645 * ehframe.h (class Fde): Update declarations. Move shndx_ and
5646 input_offset_ fields into union u_, with new plt field.
5647 (Fde::Fde): Adjust for new union field.
5648 (Fde::Fde) [Output_data version]: New constructor.
5649 (Fde::add_mapping): Only add merge mapping if there is an object.
5650 (class Cie): Update declarations.
5651 (class Eh_frame): Declare add_ehframe_for_plt.
5652 * layout.cc (Layout::layout_eh_frame): Break out code into
5653 make_eh_frame_section, and call it.
5654 (Layout::make_eh_frame_section): New function.
5655 (Layout::add_eh_frame_for_plt): New function.
5656 * layout.h (class Layout): Update declarations.
5657 * merge.cc (Merge_map::add_mapping): Add assertion.
5658 * i386.cc: Include "dwarf.h".
5659 (class Output_data_plt_i386): Make first_plt_entry,
5660 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
5661 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5662 and plt_eh_frame_fde.
5663 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
5664 boundary. Call add_eh_frame_for_plt if appropriate.
5665 * x86_64.cc: Include "dwarf.h".
5666 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
5667 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
5668 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5669 and plt_eh_frame_fde.
5670 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
5671 appropriate.
5672
14788a3f
ILT
56732011-06-29 Ian Lance Taylor <iant@google.com>
5674
5675 PR gold/12629
5676 * object.cc (Sized_relobj_file::layout_section): Change shdr
5677 parameter to be const.
5678 (Sized_relobj_file::layout_eh_frame_section): New function, broken
5679 out of do_layout.
5680 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
5681 appropriate. Call layout_eh_frame_section.
5682 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
5683 sections.
5684 * object.h (class Sized_relobj_file): Update declarations.
5685
6c21fce1
ILT
56862011-06-29 Ian Lance Taylor <iant@google.com>
5687
37e41b03 5688 PR gold/12652
6c21fce1
ILT
5689 * script.cc (Token::integer_value): Accept trailing M/m/K/k
5690 modifier.
5691 (Lex::gather_token): Accept trailing M/m/K/k for integers.
5692
4d5e4e62
ILT
56932011-06-29 Ian Lance Taylor <iant@google.com>
5694
5695 PR gold/12675
5696 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
5697 SHT_X86_64_UNWIND.
5698 * layout.cc (Layout::layout_eh_frame): Likewise.
5699
886f533a
ILT
57002011-06-29 Ian Lance Taylor <iant@google.com>
5701
5702 PR gold/12695
5703 * layout.cc (Layout::symtab_section_shndx): New function.
5704 * layout.h (class Layout): Declare symtab_section_shndx.
5705 * output.cc (Output_section::write_header): Call it.
5706
f3ae1b28
ILT
57072011-06-29 Ian Lance Taylor <iant@google.com>
5708
5709 PR gold/12818
5710 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
5711 symbols which are not used in a relocation.
5712
aecf301f
ILT
57132011-06-28 Ian Lance Taylor <iant@google.com>
5714
5715 PR gold/12898
5716 * layout.cc (Layout::segment_precedes): Don't crash if a linker
5717 script create indistinguishable segments.
5718 (Layout::set_segment_offsets): Use stable_sort when sorting
5719 segments. Pass this to Compare_segments constructor.
5720 * layout.h (class Layout): Make segment_precedes non-static.
5721 (class Compare_segments): Change from struct to class. Add
5722 layout_ field. Add constructor.
5723 * script-sections.cc
5724 (Script_sections::attach_sections_using_phdrs_clause): Rename
5725 local orphan to is_orphan. Don't report failure to put empty
5726 section in segment. On attachment failure, report name of
5727 section, and attach to first PT_LOAD segment.
5728
03ef7571
ILT
57292011-06-28 Ian Lance Taylor <iant@google.com>
5730
5731 PR gold/12934
5732 * target-select.cc (Target_selector::Target_selector): Add
5733 emulation parameter. Change all callers.
5734 (select_target_by_bfd_name): Rename from select_target_by_name.
5735 Change all callers.
5736 (select_target_by_emulation): New function.
5737 (supported_emulation_names): New function.
5738 * target-select.h (class Target_selector): Add emulation_ field.
5739 Update declarations.
5740 (Target_selector::recognize_by_bfd_name): Rename from
5741 recognize_by_name. Change all callers.
5742 (Target_selector::supported_bfd_names): Rename from
5743 supported_names. Change all callers.
5744 (Target_selector::recognize_by_emulation): New function.
5745 (Target_selector::supported_emulations): New function.
5746 (Target_selector::emulation): New function.
5747 (Target_selector::do_recognize_by_bfd_name): Rename from
5748 do_recognize_by_name. Change all callers.
5749 (Target_selector::do_supported_bfd_names): Rename from
5750 do_supported_names. Change all callers.
5751 (Target_selector::do_recognize_by_emulation): New function.
5752 (Target_selector::do_supported_emulations): New function.
5753 (select_target_by_bfd_name): Change name in declaration.
5754 (select_target_by_emulation): Declare.
5755 (supported_emulation_names): Declare.
5756 * parameters.cc (parameters_force_valid_target): Try to find
5757 target based on emulation from -m option.
5758 * options.h (class General_options): Change doc string for -m.
5759 * options.cc (help): Print emulations.
5760 (General_options::parse_V): Likewise.
5761 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
5762 Add emulation parameter. Change all callers.
5763
200b2bb9
ILT
57642011-06-28 Ian Lance Taylor <iant@google.com>
5765
5766 * target.h (class Target): Add osabi_ field.
5767 (Target::osabi): New function.
5768 (Target::set_osabi): New function.
5769 (Target::Target): Initialize osabi_.
5770 (Target::do_adjust_elf_header): Make pure virtual.
5771 (Sized_target::do_adjust_elf_header): Declare.
5772 * target.cc (Sized_target::do_adjust_elf_header): New function.
5773 (class Sized_target): Instantiate all versions.
5774 * freebsd.h (class Target_freebsd): Remove.
5775 (Target_selector_freebsd::do_recognize): Call set_osabi on
5776 Target.
5777 (Target_selector_freebsd::do_recognize_by_name): Likewise.
5778 (Target_selector_freebsd::set_osabi): Remove.
5779 * i386.cc (class Target_i386): Inherit from Sized_target rather
5780 than Target_freebsd.
5781 * x86_64.cc (class Target_x86_64): Likewise.
5782
b3ce541e
ILT
57832011-06-28 Ian Lance Taylor <iant@google.com>
5784
5785 * target.h (Target::can_check_for_function_pointers): Rewrite.
5786 Make non-virtual.
5787 (Target::can_icf_inline_merge_sections): Likewise.
5788 (Target::section_may_have_icf_unsafe_poineters): Likewise.
5789 (Target::Target_info): Add can_icf_inline_merge_sections field.
5790 (Target::do_can_check_for_function_pointers): New virtual
5791 function.
5792 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
5793 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
5794 from can_check_for_function_pointers, move in file.
5795 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
5796 section_may_have_icf_unsafe_poineters, move in file.
5797 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
5798 * i386.cc (Target_i386::do_can_check_for_function_pointers):
5799 Rename from can_check_for_function_pointers, move in file.
5800 (Target_i386::can_icf_inline_merge_sections): Remove.
5801 (Target_i386::i386_info): Initialize
5802 can_icf_inline_merge_sections.
5803 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
5804 Initialize can_icf_inline_merge_sections.
5805 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
5806 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
5807 Rename from can_check_for_function_pointers, move in file.
5808 (Target_x86_64::can_icf_inline_merge_sections): Remove.
5809 (Target_x86_64::x86_64_info): Initialize
5810 can_icf_inline_merge_sections.
5811 * testsuite/testfile.cc (Target_test::test_target_info):
5812 Likewise.
5813 * icf.cc (get_section_contents): Correct formatting.
5814
6d1c4efb
ILT
58152011-06-27 Ian Lance Taylor <iant@google.com>
5816
5817 * symtab.cc (Symbol::versioned_name): New function.
5818 (Symbol_table::add_to_final_symtab): Use versioned_name when
5819 appropriate.
5820 (Symbol_table::sized_write_symbol): Likewise.
5821 * symtab.h (class Symbol): Declare versioned_name.
5822 * stringpool.h (class Stringpool_template): Add variant of add
5823 which takes a std::basic_string.
5824 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
5825 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
5826 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
5827 (ver_test_12.o): New target.
5828 * testsuite/Makefile.in: Rebuild.
5829
57eb9b50
DK
58302011-06-27 Doug Kwan <dougkwan@google.com>
5831
5832 * arm.cc (Arm_relocate_functions::thm_jump8,
5833 Arm_relocate_functions::thm_jump11): Use a wider signed
5834 type to compute offset.
5835 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
5836 arm_thm_jump8.
5837 * testsuite/Makefile.in: Regenerate.
5838 * testsuite/arm_branch_in_range.sh: Check test results of
5839 arm_thm_jump11 and arm_thm_jump8.
5840 * testsuite/arm_thm_jump11.s: New test source file.
5841 * testsuite/arm_thm_jump11.t: New linker script.
5842 * testsuite/arm_thm_jump8.s: New test source file.
5843 * testsuite/arm_thm_jump8.t: New linker script.
5844
487b39df
ILT
58452011-06-24 Ian Lance Taylor <iant@google.com>
5846
5847 * layout.cc: Include "object.h".
5848 (ctors_sections_in_init_array): New static variable.
5849 (Layout::is_ctors_in_init_array): New function.
5850 (Layout::layout): Add entry to ctors_sections_in_init_array if
5851 appropriate.
5852 * layout.h (class Layout): Declare is_ctors_in_init_array.
5853 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
5854 is_ctors_reverse_view is set.
5855 (Sized_relobj_file::write_sections): Add layout parameter. Change
5856 all callers. Set is_ctors_reverse_view field of View_size.
5857 (Sized_relobj_file::reverse_words): New function.
5858 * object.h (Sized_relobj_file::View_size): Add
5859 is_ctors_reverse_view field.
5860 (class Sized_relobj_file): Update declarations.
5861 * testsuite/initpri3.c: New test.
5862 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
5863 initpri3b.
5864 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
5865 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
5866 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
5867 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
5868 * testsuite/Makefile.in: Rebuild.
5869
472076e4
CC
58702011-06-24 Cary Coutant <ccoutant@google.com>
5871
5872 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
5873 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
5874 (debug_msg_cdebug.err): New targets.
5875 * testsuite/Makefile.in: Regenerate.
5876 * testsuite/debug_msg.sh: Check output of link with compressed debug.
5877 Fix checks for link with shared library.
5878
a60af0db
DK
58792011-06-24 Doug Kwan <dougkwan@google.com>
5880
5881 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
5882 skip empty text sections.
5883 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
5884
5393d741
ILT
58852011-06-22 Ian Lance Taylor <iant@google.com>
5886
5887 PR gold/12910
5888 * options.h (class General_options): Add --ctors-in-init-array.
5889 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
5890 friends as SHT_PROGBITS for merging sections.
5891 (Layout::layout): Remove special handling of .init_array and
5892 friends. Don't sort if doing relocatable link. Sort for .ctors
5893 and .dtors if ctors_in_init_array.
5894 (Layout::make_output_section): Force correct section types for
5895 .init_array and friends. Don't sort if doing relocatable link,
5896 Don't sort .ctors and .dtors if ctors_in_init_array.
5897 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
5898 (Layout::output_section_name): Add relobj parameter. Change all
5899 callers. Handle .ctors. and .dtors. in code rather than table.
5900 Handle .ctors and .dtors if ctors_in_init_array.
5901 (Layout::match_file_name): New function, moved from output.cc.
5902 * layout.h (class Layout): Update declarations.
5903 * output.cc: Include "layout.h".
5904 (Input_section_sort_entry::get_priority): New function.
5905 (Input_section_sort_entry::match_file_name): Just call
5906 Layout::match_file_name.
5907 (Output_section::Input_section_sort_init_fini_compare::operator()):
5908 Handle .ctors and .dtors. Sort by explicit priority rather than
5909 by name.
5910 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
5911 * testsuite/initpri2.c: New test.
5912 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
5913 (check_PROGRAMS): Add initpri2.
5914 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
5915 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
5916 * configure, testsuite/Makefile.in: Rebuild.
5917
e1f74f98
ILT
59182011-06-19 Ian Lance Taylor <iant@google.com>
5919
5920 PR gold/12880
5921 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
5922 .interp section to a PT_INTERP segment even if we have seen a
5923 --dynamic-linker option. Don't do it if we have seen a PHDRS
5924 clause in a linker script.
5925 (Layout::finalize): Don't create a .interp section if we've
5926 already create a PT_INTERP segment.
5927 (Layout::create_interp): Always call choose_output_section (revert
5928 patch of 2011-06-17). Don't create PT_INTERP segment.
5929 * script-sections.cc
5930 (Script_sections::create_note_and_tls_segments): Add a .interp
5931 section to a PT_INTERP segment even if we have seen a
5932 --dynamic-linker option.
5933
766f91bb
ILT
59342011-06-18 Ian Lance Taylor <iant@google.com>
5935
5936 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
5937 merely because a non-PT_LOAD segment has a dynamic reloc.
5938
0d212c3a
ILT
59392011-06-18 Ian Lance Taylor <iant@google.com>
5940
5941 * layout.cc (Layout::finish_dynamic_section): Don't create
5942 DT_FLAGS entry if not needed.
5943
911a5072
ILT
59442011-06-18 Ian Lance Taylor <iant@google.com>
5945
5946 PR gold/12745
5947 * layout.cc (Layout::layout_eh_frame): Correct handling of
5948 writable .eh_frame section.
5949
534b4e5f
ILT
59502011-06-17 Ian Lance Taylor <iant@google.com>
5951
5952 PR gold/12893
5953 * resolve.cc (Symbol_table::resolve): Don't give an error if a
5954 symbol is redefined with the exact same object and value.
5955
10b4f102
ILT
59562011-06-17 Ian Lance Taylor <iant@google.com>
5957
5958 PR gold/12880
5959 * layout.h (class Layout): Add interp_segment_ field.
5960 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
5961 (Layout::attach_allocated_section_to_segment): If making shared
5962 library, put .interp section in PT_INTERP segment.
5963 (Layout::finalize): Also call create_interp if -dynamic-linker
5964 option was used.
5965 (Layout::create_interp): Assert that there is no PT_INTERP
5966 segment. If not using a SECTIONS clause, use make_output_section.
5967 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
5968 * script-sections.cc
5969 (Script_sections::create_note_and_tls_segments): If making shared
5970 library, put .interp section in PT_INTERP segment.
5971
a29b0dad
ILT
59722011-06-17 Ian Lance Taylor <iant@google.com>
5973
e588ea8d
ILT
5974 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
5975 when making a shared library.
5976
59772011-06-17 Ian Lance Taylor <iant@google.com>
5978
5979 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
5980 parameter. Change all callers. Don't issue warning about PC32
5981 against locally defined symbol.
a29b0dad 5982
9d3b0698
ILT
59832011-06-16 Ian Lance Taylor <iant@google.com>
5984
5985 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
5986 occurs in same object.
5987
85b0f90c
AM
59882011-06-14 Alan Modra <amodra@gmail.com>
5989
5990 * po/POTFILES.in: Regenerate.
5991
a94907d9
ILT
59922011-06-09 Ian Lance Taylor <iant@google.com>
5993
5994 * script-sections.cc
5995 (Orphan_output_section::set_section_addresses): For a relocatable
5996 link set address to 0.
5997
4fb3a1c3
CC
59982011-06-09 Cary Coutant <ccoutant@google.com>
5999
6000 PR gold/12804
6001 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
6002 used with --compress-debug-sections.
6003 * gold/object.cc (Sized_relobj_file::do_layout): Report
6004 uncompressed size of compressed input sections.
6005
61220854
CC
60062011-06-08 Cary Coutant <ccoutant@google.com>
6007
6008 PR gold/12804
6009 * testsuite/two_file_test_2_v1.cc: Change initialization of
6010 v2 to keep it in .data.
6011
e6455dfb
CC
60122011-06-07 Cary Coutant <ccoutant@google.com>
6013
6014 * common.cc (Symbol_table::do_allocate_commons_list): Call
6015 gold_fallback.
6016 * errors.cc (Errors::fatal): Adjust call to gold_exit.
6017 (Errors::fallback): New function.
6018 (gold_fallback): New function.
6019 * errors.h (Errors::fallback): New function.
6020 * gold.cc (gold_exit): Change status parameter to enum; adjust
6021 all callers.
6022 (queue_initial_tasks): Call gold_fallback.
6023 * gold.h: Include cstdlib.
6024 (Exit_status): New enum type.
6025 (gold_exit): Change status parameter to enum.
6026 (gold_fallback): New function.
6027 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
6028 (Layout::create_symtab_sections): Likewise.
6029 (Layout::create_shdrs): Likewise.
6030 * main.cc (main): Adjust call to gold_exit.
6031 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
6032 (Output_data_got::add_got_entry_pair): Likewise.
6033 (Output_section::add_input_section): Likewise.
6034 (Output_section::add_output_section_data): Likewise.
6035 (Output_segment::set_section_list_addresses): Likewise.
6036 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
6037
fb0e076f
CC
60382011-06-07 Cary Coutant <ccoutant@google.com>
6039
6040 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
6041 for incremental links.
6042 * output.cc (Output_segment::set_section_list_addresses): Remove
6043 FIXME and test for TLS or BSS.
6044
a5ee4d5d
CC
60452011-06-07 Cary Coutant <ccoutant@google.com>
6046
6047 * testsuite/Makefile.am: Add incremental_copy_test,
6048 incremental_common_test_1.
6049 * testsuite/Makefile.in: Regenerate.
6050 * testsuite/common_test_1_v1.c: New source file.
6051 * testsuite/common_test_1_v2.c: New source file.
6052 * testsuite/copy_test_v1.cc: New source file.
6053
5146f448
CC
60542011-06-07 Cary Coutant <ccoutant@google.com>
6055
6056 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
6057 update, allocate common from bss section's free list.
6058 * incremental-dump.cc (dump_incremental_inputs): Print flag for
6059 linker-defined symbols.
6060 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
6061 Skip GOT and PLT entries that are no longer referenced.
6062 (Output_section_incremental_inputs::write_info_blocks): Mark
6063 linker-defined symbols.
6064 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
6065 * output.cc (Output_section::allocate): New function.
6066 * output.h (Output_section::allocate): New function.
6067 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
6068 linker-defined symbols.
6069 (Symbol::override_base_with_special): Copy is_predefined_ flag.
6070 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
6071 (Symbol::init_base_output_data): Likewise.
6072 (Symbol::init_base_output_segment): Likewise.
6073 (Symbol::init_base_constant): Likewise.
6074 (Sized_symbol::init_output_data): Likewise.
6075 (Sized_symbol::init_output_segment): Likewise.
6076 (Sized_symbol::init_constant): Likewise.
6077 (Symbol_table::do_define_in_output_data): Likewise.
6078 (Symbol_table::do_define_in_output_segment): Likewise.
6079 (Symbol_table::do_define_as_constant): Likewise.
6080 * symtab.h (Symbol::is_predefined): New function.
6081 (Symbol::init_base_output_data): Add is_predefined parameter.
6082 (Symbol::init_base_output_segment): Likewise.
6083 (Symbol::init_base_constant): Likewise.
6084 (Symbol::is_predefined_): New data member.
6085 (Sized_symbol::init_output_data): Add is_predefined parameter.
6086 (Sized_symbol::init_output_segment): Likewise.
6087 (Sized_symbol::init_constant): Likewise.
6088 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
6089
26d3c67d
CC
60902011-06-07 Cary Coutant <ccoutant@google.com>
6091
6092 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
6093 instead of emit_copy_reloc.
6094 (Copy_relocs::emit_copy_reloc): Refactor.
6095 (Copy_relocs::make_copy_reloc): New function.
6096 (Copy_relocs::add_copy_reloc): Remove.
6097 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
6098 section.
6099 (Copy_relocs::make_copy_reloc): New function.
6100 (Copy_relocs::add_copy_reloc): Remove.
6101 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
6102 unchanged input files.
6103 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
6104 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
6105 Reserve BSS space for COPY relocations.
6106 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6107 (Output_section_incremental_inputs::write_info_blocks): Record
6108 whether a symbol is copied from a shared object.
6109 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
6110 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
6111 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
6112 (Incremental_input_entry_reader::get_output_symbol_index): Add
6113 is_copy parameter.
6114 (Incremental_binary::emit_copy_relocs): New function.
6115 (Incremental_binary::do_emit_copy_relocs): New function.
6116 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6117 new data member.
6118 (Sized_incremental_binary::add_copy_reloc): New function.
6119 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6120 (Sized_incremental_binary::Copy_reloc): New struct.
6121 (Sized_incremental_binary::Copy_relocs): New typedef.
6122 (Sized_incremental_binary::copy_relocs_): New data member.
6123 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
6124 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
6125 * target.h (Sized_target::emit_copy_reloc): New function.
6126 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
6127
7cdb37d9
CC
61282011-06-02 Cary Coutant <ccoutant@google.com>
6129
6130 PR gold/12163
6131 * gold/archive.cc (Archive::Archive): Initialize new data member.
6132 (Archive::include_all_members): Return if archive has already been
6133 included.
6134 * gold/archive.h (Archive::include_all_members_): New data member.
6135
cc643b88
NC
61362011-06-02 Nick Clifton <nickc@redhat.com>
6137
6138 * dynobj.h: Fix spelling mistake in comment.
6139 * output.cc: Likewise.
6140
f62a3ca7 61412011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 6142 Asier Llano
f62a3ca7
DK
6143
6144 PR gold/12826
cc643b88 6145 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
6146 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
6147 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
6148 redundant arm_exidx_test.so.
6149 * testsuite/Makefile.in: Regenerate.
6150 (check_SCRIPTS): Add pr12826.sh
6151 (check_DATA): Add pr12826.stdout
6152 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
6153 * testsuite/pr12826.sh: New file.
6154 * testsuite/pr12826_1.s: Ditto.
6155 * testsuite/pr12826_1.s: Ditto.
6156
8dbe1edc
ILT
61572011-05-30 Ian Lance Taylor <iant@google.com>
6158
6159 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
6160 sections.
6161
c49875be
ILT
61622011-05-29 Ian Lance Taylor <iant@google.com>
6163
6164 PR gold/12804
6165 * testsuite/Makefile.am: Use different file name for two_file_test
6166 temporary file for each incremental test.
6167 * testsuite/Makefile.in: Rebuild.
6168
69d53f7a
ILT
61692011-05-29 Ian Lance Taylor <iant@google.com>
6170
6171 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
6172 binary input file is empty.
6173
41d0ab5f
ILT
61742011-05-27 Ian Lance Taylor <iant@google.com>
6175
6176 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
6177 (ver_test_9.so): Likewise.
6178 * testsuite/Makefile.in: Rebuild.
6179
89d8a36b
CC
61802011-05-26 Cary Coutant <ccoutant@google.com>
6181
6182 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
6183 * incremental.cc (Incremental_inputs::report_input_section): Fix
6184 comment, indentation.
6185 (Incremental_inputs::report_comdat_group): New function.
6186 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6187 of data for incremental input file entry.
6188 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
6189 group count, COMDAT group signatures.
6190 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
6191 an unchanged input file.
6192 * incremental.h (Incremental_object_entry::Incremental_object_entry):
6193 Initialize new data member.
6194 (Incremental_object_entry::add_comdat_group): New function.
6195 (Incremental_object_entry::get_comdat_group_count): New function.
6196 (Incremental_object_entry::get_comdat_signature_key): New function.
6197 (Incremental_object_entry::groups_): New data member.
6198 (Incremental_inputs::report_comdat_group): New function.
6199 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
6200 data for incremental input file entry.
6201 (Incremental_input_entry_reader::get_comdat_group_count): New function.
6202 (Incremental_input_entry_reader::get_input_section): Adjust size of
6203 data for incremental input file entry.
6204 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
6205 (Incremental_input_entry_reader::get_comdat_group_signature): New
6206 function.
6207 * object.cc (Sized_relobj::include_section_group): Report kept
6208 COMDAT groups for incremental links.
6209
1706a06f
ILT
62102011-05-24 David Meyer <pdox@google.com>
6211
6212 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
6213 with name parameter. Add found_name parameter.
6214 * fileread.cc (Input_file::find_file): Adjust code accordingly.
6215 * dirsearch.h (class Dirsearch): Update declaration.
6216
a10ae760
ILT
62172011-05-24 Ian Lance Taylor <iant@google.com>
6218
6219 * archive.cc (Library_base::should_include_member): Pull in object
6220 from archive if it defines the entry symbol.
6221 * parameters.cc (Parameters::entry): New function.
6222 * parameters.h (class Parameters): Declare entry.
6223 * output.h (class Output_file_header): Remove entry_ field.
6224 * output.cc (Output_file_header::Output_file_header): Remove entry
6225 parameter. Change all callers.
6226 (Output_file_header::entry): Use parameters->entry.
6227 * gold.cc (queue_middle_tasks): Likewise.
6228 * plugin.cc (Plugin_hook::run): Likewise.
6229
aa92d6ed
CC
62302011-05-24 Cary Coutant <ccoutant@google.com>
6231
6232 * gold.cc (queue_initial_tasks): Pass incremental base filename
6233 to Output_file::open_base_file; don't print error message.
6234 * incremental-dump.cc (main): Adjust call to
6235 Output_file::open_for_modification.
6236 * incremental-dump.cc (main): Likewise.
6237 * incremental.cc (Incremental_inputs::report_command_line):
6238 Ignore --incremental-base option when comparing command lines.
6239 Ignore parameter when given as separate argument.
6240 * options.h (class General_options): Add --incremental-base.
6241 * output.cc (Output_file::Output_file):
6242 (Output_file::open_base_file): Add base_name and writable parameters;
6243 read base file into new file; print error message here.
6244 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6245 callers.
6246 * output.h (Output_file::open_for_modification): Rename to...
6247 (Output_file::open_base_file): ...this; add base_name and
6248 writable parameters; adjust all callers.
6249 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6250 callers.
6251 * testsuite/Makefile.am (incremental_test_4): Test
6252 --incremental-base.
6253 * testsuite/Makefile.in: Regenerate.
6254
2eedd706
CC
62552011-05-24 Cary Coutant <ccoutant@google.com>
6256
6257 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
6258 incremental_test_4.
6259 * testsuite/Makefile.in: Regenerate.
6260 * testsuite/two_file_test_1_v1.cc: New test source file.
6261 * testsuite/two_file_test_1b_v1.cc: New test source file.
6262 * testsuite/two_file_test_2_v1.cc: New test source file.
6263
0f1c85a6
CC
62642011-05-24 Cary Coutant <ccoutant@google.com>
6265
6266 * dynobj.h (Dynobj::do_dynobj): New function.
6267 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
6268 flag and soname for shared objects.
6269 * incremental.cc (Incremental_inputs::report_object): Make
6270 either Incremental_object_entry or Incremental_dynobj_entry; add
6271 soname to string table.
6272 (Incremental_inputs::report_input_section): Add assertion.
6273 (Output_section_incremental_inputs::set_final_data_size): Adjust
6274 type of input file entry for shared libraries; adjust size of
6275 shared library info entry.
6276 (Output_section_incremental_inputs::write_input_files): Write
6277 as_needed flag for shared libraries.
6278 (Output_section_incremental_inputs::write_info_blocks): Adjust type
6279 of input file entry for shared libraries; write soname.
6280 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
6281 soname from incremental info.
6282 * incremental.h (enum Incremental_input_flags): Add
6283 INCREMENTAL_INPUT_AS_NEEDED.
6284 (Incremental_input_entry::Incremental_input_entry): Initialize new
6285 data member.
6286 (Incremental_input_entry::set_as_needed): New function.
6287 (Incremental_input_entry::as_needed): New function.
6288 (Incremental_input_entry::do_dynobj_entry): New function.
6289 (Incremental_input_entry::as_needed_): New data member.
6290 (Incremental_object_entry::Incremental_object_entry): Don't check
6291 for shared library.
6292 (Incremental_object_entry::do_type): Likewise.
6293 (class Incremental_dynobj_entry): New class.
6294 (Incremental_input_entry_reader::as_needed): New function.
6295 (Incremental_input_entry_reader::get_soname): New function.
6296 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
6297 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
6298 size of shared library info entry.
58797674 6299 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
6300 incremental link when adding DT_NEEDED entries.
6301 * object.h (Object::Object): Initialize new data member.
6302 (Object::dynobj): New function.
6303 (Object::set_as_needed): New function.
6304 (Object::as_needed): New function.
6305 (Object::do_dynobj): New function.
6306 (Object::as_needed_): New data member.
6307
6fa2a40b
CC
63082011-05-24 Cary Coutant <ccoutant@google.com>
6309
6310 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
6311 info; adjust display of GOT entries.
6312 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6313 vector of input objects; remove file_status_.
6314 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
6315 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
6316 got_plt reader; call target hooks to reserve GOT entries.
6317 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6318 of input file info header and GOT info entry.
6319 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
6320 relocation info.
6321 (Got_plt_view_info::got_descriptor): Remove.
6322 (Got_plt_view_info::sym_index): New data member.
6323 (Got_plt_view_info::input_index): New data member.
6324 (Local_got_offset_visitor::visit): Write input file index.
6325 (Global_got_offset_visitor::visit): Write 0 for input file index.
6326 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
6327 with sym_index and input_index.
6328 (Output_section_incremental_inputs::write_got_plt): Adjust size of
6329 incremental info GOT entry; replace got_descriptor with input_index.
6330 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
6331 map from input file index to object.
6332 (Sized_relobj_incr::do_layout): Replace direct data member reference
6333 with accessor function.
6334 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
6335 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
6336 Adjust size of input file info header.
6337 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
6338 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
6339 (Incremental_input_entry_reader::get_input_section): Adjust size of
6340 input file info header.
6341 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
6342 of incremental info GOT entry.
6343 (Incremental_got_plt_reader::get_got_desc): Remove.
6344 (Incremental_got_plt_reader::get_got_symndx): New function.
6345 (Incremental_got_plt_reader::get_got_input_index): New function.
6346 (Sized_incremental_binary::Sized_incremental_binary): Remove
6347 file_status_; add input_objects_.
6348 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
6349 (Sized_incremental_binary::set_file_is_unchanged): Remove.
6350 (Sized_incremental_binary::file_is_unchanged): Remove.
6351 (Sized_incremental_binary::set_input_object): New function.
6352 (Sized_incremental_binary::input_object): New function.
6353 (Sized_incremental_binary::file_status_): Remove.
6354 (Sized_incremental_binary::input_objects_): New data member.
6355 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
6356 references.
6357 (Sized_relobj_incr::invalid_address): Move to base class.
6358 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
6359 class.
6360 (Sized_relobj_incr::do_output_section_offset): Likewise.
6361 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
6362 (Sized_relobj_incr::section_offsets_): Likewise.
6363 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
6364 function.
6365 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
6366 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
6367 with accessor function.
6368 (Sized_relobj_file::do_layout): Likewise.
6369 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
6370 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
6371 (Sized_relobj_file::compute_final_local_value): Replace refs to
6372 section_offsets_ with accessor function.
6373 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
6374 * object.h (Relobj::Relobj): Initialize new data members.
6375 (Relobj::add_dyn_reloc): New function.
6376 (Relobj::first_dyn_reloc): New function.
6377 (Relobj::dyn_reloc_count): New function.
6378 (Relobj::first_dyn_reloc_): New data member.
6379 (Relobj::dyn_reloc_count_): New data member.
6380 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
6381 references.
6382 (Sized_relobj::Address): New typedef.
6383 (Sized_relobj::invalid_address): Move here from child class.
6384 (Sized_relobj::Sized_relobj): Initialize new data members.
6385 (Sized_relobj::sized_relobj): New function.
6386 (Sized_relobj::is_output_section_offset_invalid): Move here from
6387 child class.
6388 (Sized_relobj::get_output_section_offset): Likewise.
6389 (Sized_relobj::local_has_got_offset): Likewise.
6390 (Sized_relobj::local_got_offset): Likewise.
6391 (Sized_relobj::set_local_got_offset): Likewise.
6392 (Sized_relobj::do_for_all_local_got_entries): Likewise.
6393 (Sized_relobj::clear_got_offsets): New function.
6394 (Sized_relobj::section_offsets): Move here from child class.
6395 (Sized_relobj::do_output_section_offset): Likewise.
6396 (Sized_relobj::do_set_section_offset): Likewise.
6397 (Sized_relobj::Local_got_offsets): Likewise.
6398 (Sized_relobj::local_got_offsets_): Likewise.
6399 (Sized_relobj::section_offsets_): Likewise.
6400 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
6401 references.
6402 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
6403 class.
6404 (Sized_relobj_file::sized_relobj): New function
6405 (Sized_relobj_file::local_has_got_offset): Move to base class.
6406 (Sized_relobj_file::local_got_offset): Likewise.
6407 (Sized_relobj_file::set_local_got_offset): Likewise.
6408 (Sized_relobj_file::get_output_section_offset): Likewise.
6409 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
6410 (Sized_relobj_file::do_output_section_offset): Likewise.
6411 (Sized_relobj_file::do_set_section_offset): Likewise.
6412 (Sized_relobj_file::Local_got_offsets): Likewise.
6413 (Sized_relobj_file::local_got_offsets_): Likewise.
6414 (Sized_relobj_file::section_offsets_): Likewise.
6415 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
6416 (all constructors).
6417 (set_needs_dynsym_index): Convert relobj to derived class pointer.
6418 (Output_reloc::get_symbol_index): Likewise.
6419 (Output_reloc::local_section_offset): Likewise.
6420 (Output_reloc::get_address): Likewise.
6421 (Output_reloc::symbol_value): Likewise.
6422 (Output_data_got::reserve_slot): Move to class definition.
6423 (Output_data_got::reserve_local): New function.
6424 (Output_data_got::reserve_slot_for_global): Remove.
6425 (Output_data_got::reserve_global): New function.
6426 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
6427 (all constructors, two instantiations).
6428 (Output_reloc::get_relobj): New function (two instantiations).
6429 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
6430 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
6431 (Output_data_reloc::add_global): Adjust type of relobj.
6432 (Output_data_reloc::add_global_relative): Likewise.
6433 (Output_data_reloc::add_symbolless_global_addend): Likewise.
6434 (Output_data_reloc::add_local): Likewise.
6435 (Output_data_reloc::add_local_relative): Likewise.
6436 (Output_data_reloc::add_symbolless_local_addend): Likewise.
6437 (Output_data_reloc::add_local_section): Likewise.
6438 (Output_data_reloc::add_output_section): Likewise.
6439 (Output_data_reloc::add_absolute): Likewise.
6440 (Output_data_reloc::add_target_specific): Likewise.
6441 (Output_data_got::reserve_slot): Move definition here.
6442 (Output_data_got::reserve_local): New function.
6443 (Output_data_got::reserve_global): New function.
6444 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
6445 section_offsets_ with accessor function.
6446 (Sized_relobj_file::write_sections): Likewise.
6447 (Sized_relobj_file::do_relocate_sections): Likewise.
6448 * target.h (Sized_target::reserve_local_got_entry): New function.
6449 (Sized_target::reserve_global_got_entry): New function.
6450 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
6451 (Target_x86_64::reserve_global_got_entry): New function.
6452 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
6453
4829d394
CC
64542011-05-23 Cary Coutant <ccoutant@google.com>
6455
6456 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
6457 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
6458 bit when checking got_type.
6459 * incremental.cc (Sized_incremental_binary::setup_readers):
6460 Store symbol table and string table locations; initialize bit vector
6461 of file status flags.
6462 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
6463 unchanged files.
6464 (Sized_incremental_binary::do_process_got_plt): New function.
6465 (Sized_incremental_binary::get_symtab_view): Use stored locations.
6466 (Output_section_incremental_inputs::set_final_data_size): Record
6467 file index for each input file.
6468 (Output_section_incremental_inputs::write_got_plt): Store file index
6469 instead of input entry offset for each GOT entry.
6470 * incremental.h
6471 (Incremental_input_entry::Incremental_input_entry): Initialize new
6472 data member.
6473 (Incremental_input_entry::set_offset): Store file index.
6474 (Incremental_input_entry::get_file_index): New function.
6475 (Incremental_input_entry::file_index_): New data member.
6476 (Incremental_binary::process_got_plt): New function.
6477 (Incremental_binary::do_process_got_plt): New function.
6478 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6479 data members.
6480 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
6481 (Sized_incremental_binary::set_file_is_unchanged): New function.
6482 (Sized_incremental_binary::file_is_unchanged): New function.
6483 (Sized_incremental_binary::do_process_got_plt): New function.
6484 (Sized_incremental_binary::file_status_): New data member.
6485 (Sized_incremental_binary::main_symtab_loc_): New data member.
6486 (Sized_incremental_binary::main_strtab_loc_): New data member.
6487 * output.cc (Output_data_got::Got_entry::write): Add case
6488 RESERVED_CODE.
6489 (Output_data_got::add_global): Call add_got_entry.
6490 (Output_data_got::add_global_plt): Likewise.
6491 (Output_data_got::add_global_with_rel): Likewise.
6492 (Output_data_got::add_global_with_rela): Likewise.
6493 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
6494 (Output_data_got::add_global_pair_with_rela): Likewise.
6495 (Output_data_got::add_local): Call add_got_entry.
6496 (Output_data_got::add_local_plt): Likewise.
6497 (Output_data_got::add_local_with_rel): Likewise.
6498 (Output_data_got::add_local_with_rela): Likewise.
6499 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
6500 (Output_data_got::add_local_pair_with_rela): Likewise.
6501 (Output_data_got::reserve_slot): New function.
6502 (Output_data_got::reserve_slot_for_global): New function.
6503 (Output_data_got::add_got_entry): New function.
6504 (Output_data_got::add_got_entry_pair): New function.
6505 (Output_section::add_output_section_data): Edit FIXME.
6506 * output.h
6507 (Output_section_data_build::Output_section_data_build): New
6508 constructor with size parameter.
6509 (Output_data_space::Output_data_space): Likewise.
6510 (Output_data_got::Output_data_got): Initialize new data member; new
6511 constructor with size parameter.
6512 (Output_data_got::add_constant): Call add_got_entry.
6513 (Output_data_got::reserve_slot): New function.
6514 (Output_data_got::reserve_slot_for_global): New function.
6515 (class Output_data_got::Got_entry): Add RESERVED_CODE.
6516 (Output_data_got::add_got_entry): New function.
6517 (Output_data_got::add_got_entry_pair): New function.
6518 (Output_data_got::free_list_): New data member.
6519 * target.h (Sized_target::init_got_plt_for_update): New function.
6520 (Sized_target::register_global_plt_entry): New function.
6521 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
6522 Initialize new data member; call init; add constructor with PLT count.
6523 (Output_data_plt_x86_64::init): New function.
6524 (Output_data_plt_x86_64::add_relocation): New function.
6525 (Output_data_plt_x86_64::reserve_slot): New function.
6526 (Output_data_plt_x86_64::free_list_): New data member.
6527 (Target_x86_64::init_got_plt_for_update): New function.
6528 (Target_x86_64::register_global_plt_entry): New function.
6529 (Output_data_plt_x86_64::add_entry): Allocate from free list for
6530 incremental updates.
6531 (Output_data_plt_x86_64::add_relocation): New function.
6532 * testsuite/object_unittest.cc (Object_test): Set default options.
6533
ec69d6da
ILT
65342011-05-16 Ian Lance Taylor <iant@google.com>
6535
6536 * options.h (class General_options): Make -i a synonym for -r.
6537
732e31de
ILT
65382011-05-16 Ian Lance Taylor <iant@google.com>
6539
6540 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
6541
403676b5
CC
65422011-05-10 Cary Coutant <ccoutant@google.com>
6543
6544 * object.cc (Sized_relobj::do_count_local_symbols): Check for
6545 strip_all (-s).
6546
5b7b7d6e
ILT
65472011-05-06 Ian Lance Taylor <iant@google.com>
6548
6549 * layout.cc (Layout::layout): If the output section flags change,
6550 update the ordering.
6551
f0f9babf
CC
65522011-04-25 Cary Coutant <ccoutant@google.com>
6553
6554 * incremental-dump.cc (dump_incremental_inputs): Print local
6555 symbol info for each input file.
6556 * incremental.cc
6557 (Output_section_incremental_inputs::set_final_data_size): Add local
6558 symbol info to input file entries in incremental info.
6559 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6560 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
6561 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
6562 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
6563 implementation.
6564 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
6565 (Sized_incr_relobj::do_relocate): Write the local symbols.
6566 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
6567 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
6568 Adjust size of input file header.
6569 (Incremental_inputs_reader::get_local_symbol_offset): New function.
6570 (Incremental_inputs_reader::get_local_symbol_count): New function.
6571 (Incremental_inputs_reader::get_input_section): Adjust size of input
6572 file header.
6573 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
6574 (Sized_incr_relobj::This): New typedef.
6575 (Sized_incr_relobj::sym_size): New const data member.
6576 (Sized_incr_relobj::Local_symbol): New struct.
6577 (Sized_incr_relobj::do_output_local_symbol_count): New function.
6578 (Sized_incr_relobj::do_local_symbol_offset): New function.
6579 (Sized_incr_relobj::local_symbol_count_): New data member.
6580 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
6581 (Sized_incr_relobj::local_symbol_index_): New data member.
6582 (Sized_incr_relobj::local_symbol_offset_): New data member.
6583 (Sized_incr_relobj::local_dynsym_offset_): New data member.
6584 (Sized_incr_relobj::local_symbols_): New data member.
6585 * object.h (Relobj::output_local_symbol_count): New function.
6586 (Relobj::local_symbol_offset): New function.
6587 (Relobj::do_output_local_symbol_count): New function.
6588 (Relobj::do_local_symbol_offset): New function.
6589 (Sized_relobj::do_output_local_symbol_count): New function.
6590 (Sized_relobj::do_local_symbol_offset): New function.
6591
d0a9ace3
ILT
65922011-04-22 Vladimir Simonov <sv@sw.ru>
6593
6594 * descriptors.cc (set_close_on_exec): New function.
6595 (Descriptors::open): Use set_close_on_exec.
6596 * output.cc (S_ISLNK): Define if not defined.
6597
94a3fc8b
CC
65982011-04-22 Cary Coutant <ccoutant@google.com>
6599
6600 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6601 global symbol map.
6602 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6603 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
6604 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
6605 relocations.
6606 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
6607 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
6608 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
6609 * incremental.h
6610 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
6611 function.
6612 (Incremental_binary::apply_incremental_relocs): New function.
6613 (Incremental_binary::do_apply_incremental_relocs): New function.
6614 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6615 data member.
6616 (Sized_incremental_binary::add_global_symbol): New function.
6617 (Sized_incremental_binary::global_symbol): New function.
6618 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6619 (Sized_incremental_binary::symbol_map_): New data member.
6620 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
6621 * target.h (Sized_target::apply_relocation): New function.
6622 * target-reloc.h (apply_relocation): New function.
6623 * x86_64.cc (Target_x86_64::apply_relocation): New function.
6624
c87e4302
DK
66252011-04-22 Doug Kwan <dougkwan@google.com>
6626
6627 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
6628 flag of a SHT_ARM_EXIDX section.
2e702c99 6629 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
6630 * testsuite/Makefile.in: Regenerate.
6631 * testsuite/arm_exidx_test.s: New file.
6632 * testsuite/arm_exidx_test.sh: Same.
6633
e7782cf6
CC
66342011-04-20 Cary Coutant <ccoutant@google.com>
6635
6636 PR gold/12689
6637 * archive.h (Incremental_archive_entry::Archive_member):
6638 Initialize arg_serial_ (second constructor).
6639
308ecdc7
ILT
66402011-04-17 Ian Lance Taylor <iant@google.com>
6641
6642 * object.cc (Relocate_info::location): Simplify location string.
6643 * errors.cc (Errors::error_at_location): Don't print program
6644 name.
6645 (Errors::warning_at_location): Likewise.
6646 (Errors::undefined_symbol): Likewise.
6647 * testsuite/debug_msg.sh: Update accordingly.
6648
bec5b579
CC
66492011-04-14 Cary Coutant <ccoutant@google.com>
6650
6651 * gold/layout.cc (Layout::symtab_section_offset): New function.
6652 * gold/layout.h (Layout::symtab_section_offset): New function.
6653 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
6654
88597d34
ILT
66552011-04-12 Ian Lance Taylor <iant@google.com>
6656
6657 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
6658 with MREMAP_MAYMOVE.
6659 * output.h (class Output_file): Add map_is_allocated_ field.
6660 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
6661 not available, provide stubs. If mremap is not available, #define
6662 it to gold_mremap.
6663 (MREMAP_MAYMOVE): Define if not defined.
6664 (Output_file::Output_file): Initialize map_is_allocated_.
6665 (Output_file::resize): Check map_is_allocated_.
6666 (Output_file::map_anonymous): If mmap fails, use malloc.
6667 (Output_file::unmap): Don't do anything for an anonymous map.
6668 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
6669 is not available, provide stubs.
6670 (File_read::View::~View): Use free rather than delete[].
6671 (File_read::make_view): Use malloc rather than new[]. If mmap
6672 fails, use malloc.
6673 (File_read::find_or_make_view): Use malloc rather than new[].
6674 * gold.h: Remove HAVE_REMAP code.
6675 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
6676 exists. Rename mremap to gold_mremap. If mmap is not available
6677 don't do anything.
6678 * configure, config.in: Rebuild.
6679
11e361bc
ILT
66802011-04-11 Ian Lance Taylor <iant@google.com>
6681
6682 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
6683 initialize local variable v.
6684
cdc29364
CC
66852011-04-11 Cary Coutant <ccoutant@google.com>
6686
6687 * archive.cc (Archive::include_member): Adjust call to
6688 report_object.
6689 (Add_archive_symbols::run): Track argument serial numbers.
6690 (Lib_group::include_member): Likewise.
6691 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
6692 * archive.h (Incremental_archive_entry::Archive_member):
6693 Initialize arg_serial_.
6694 (Archive_member::arg_serial_): New data member.
6695 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
6696 (Sized_dynobj::do_add_symbols): Track symbols when doing an
6697 incremental link.
6698 (Sized_dynobj::do_for_all_local_got_entries): New function.
6699 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
6700 function.
6701 * fileread.cc (get_mtime): New function.
6702 * fileread.h (get_mtime): New function.
6703 * gold.cc (queue_initial_tasks): Check for incremental update.
6704 (process_incremental_input): New function.
6705 (queue_middle_tasks): Don't force valid target for incremental
6706 update.
6707 * incremental-dump.cc (find_input_containing_global): Adjust
6708 size of symbol info entry.
6709 (dump_incremental_inputs): Dump argument serial number and
6710 in_system_directory flag; bias shndx by 1; print symbol names
6711 when dumping per-file symbol lists; use new symbol info readers.
6712 * incremental.cc
6713 (Output_section_incremental_inputs:update_data_size): New function.
6714 (Sized_incremental_binary::setup_readers): Setup input readers
6715 for each input file; build maps for files added from libraries
6716 and scripts.
6717 (Sized_incremental_binary::check_input_args): New function.
6718 (Sized_incremental_binary::do_check_inputs): Build map of argument
6719 serial numbers to input arguments.
6720 (Sized_incremental_binary::do_file_has_changed): Rename
6721 do_file_is_unchanged to this; compare file modification times.
6722 (Sized_incremental_binary::do_init_layout): New function.
6723 (Sized_incremental_binary::do_reserve_layout): New function.
6724 (Sized_incremental_binary::do_get_input_reader): Remove.
6725 (Sized_incremental_binary::get_symtab_view): New function.
6726 (Incremental_checker::can_incrementally_link_output_file): Remove.
6727 (Incremental_inputs::report_command_line): Exclude --debug options.
6728 (Incremental_inputs::report_archive_begin): Add parameter; track
6729 argument serial numbers; don't put input file entry for archive
6730 before archive members.
6731 (Incremental_inputs::report_archive_end): Put input file entry
6732 for archive after archive members.
6733 (Incremental_inputs::report_object): Add parameter; track argument
6734 serial numbers and in_system_directory flag.
6735 (Incremental_inputs::report_script): Add parameter; track argument
6736 serial numbers.
6737 (Output_section_incremental_inputs::set_final_data_size): Adjust
6738 size of symbol info entry; check for forwarding symbols.
6739 (Output_section_incremental_inputs::write_input_files): Write
6740 in_system_directory flag and argument serial number.
6741 (Output_section_incremental_inputs::write_info_blocks): Map section
6742 indices between incremental info and original input file; store
6743 input section index for each symbol.
6744 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
6745 change operator() to visit().
6746 (class Global_got_offset_visitor): Likewise.
6747 (class Global_symbol_visitor_got_plt):
6748 (Output_section_incremental_inputs::write_got_plt): Use new visitor
6749 classes.
6750 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
6751 (Sized_incr_relobj::do_read_symbols): New function.
6752 (Sized_incr_relobj::do_layout): New function.
6753 (Sized_incr_relobj::do_layout_deferred_sections): New function.
6754 (Sized_incr_relobj::do_add_symbols): New function.
6755 (Sized_incr_relobj::do_should_include_member): New function.
6756 (Sized_incr_relobj::do_for_all_global_symbols): New function.
6757 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
6758 (Sized_incr_relobj::do_section_size): New function.
6759 (Sized_incr_relobj::do_section_name): New function.
6760 (Sized_incr_relobj::do_section_contents): New function.
6761 (Sized_incr_relobj::do_section_flags): New function.
6762 (Sized_incr_relobj::do_section_entsize): New function.
6763 (Sized_incr_relobj::do_section_address): New function.
6764 (Sized_incr_relobj::do_section_type): New function.
6765 (Sized_incr_relobj::do_section_link): New function.
6766 (Sized_incr_relobj::do_section_info): New function.
6767 (Sized_incr_relobj::do_section_addralign): New function.
6768 (Sized_incr_relobj::do_initialize_xindex): New function.
6769 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
6770 (Sized_incr_relobj::do_read_relocs): New function.
6771 (Sized_incr_relobj::do_gc_process_relocs): New function.
6772 (Sized_incr_relobj::do_scan_relocs): New function.
6773 (Sized_incr_relobj::do_count_local_symbols): New function.
6774 (Sized_incr_relobj::do_finalize_local_symbols): New function.
6775 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
6776 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
6777 (Sized_incr_relobj::do_relocate): New function.
6778 (Sized_incr_relobj::do_set_section_offset): New function.
6779 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
6780 (Sized_incr_dynobj::do_read_symbols): New function.
6781 (Sized_incr_dynobj::do_layout): New function.
6782 (Sized_incr_dynobj::do_add_symbols): New function.
6783 (Sized_incr_dynobj::do_should_include_member): New function.
6784 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
6785 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
6786 (Sized_incr_dynobj::do_section_size): New function.
6787 (Sized_incr_dynobj::do_section_name): New function.
6788 (Sized_incr_dynobj::do_section_contents): New function.
6789 (Sized_incr_dynobj::do_section_flags): New function.
6790 (Sized_incr_dynobj::do_section_entsize): New function.
6791 (Sized_incr_dynobj::do_section_address): New function.
6792 (Sized_incr_dynobj::do_section_type): New function.
6793 (Sized_incr_dynobj::do_section_link): New function.
6794 (Sized_incr_dynobj::do_section_info): New function.
6795 (Sized_incr_dynobj::do_section_addralign): New function.
6796 (Sized_incr_dynobj::do_initialize_xindex): New function.
6797 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
6798 (make_sized_incremental_object): New function.
6799 (Incremental_library::copy_unused_symbols): New function.
6800 (Incremental_library::do_for_all_unused_symbols): New function.
6801 * incremental.h (enum Incremental_input_flags): New type.
6802 (class Incremental_checker): Remove.
6803 (Incremental_input_entry::Incremental_input_entry): Add argument
6804 serial number.
6805 (Incremental_input_entry::arg_serial): New function.
6806 (Incremental_input_entry::set_is_in_system_directory): New function.
6807 (Incremental_input_entry::is_in_system_directory): New function.
6808 (Incremental_input_entry::arg_serial_): New data member.
6809 (Incremental_input_entry::is_in_system_directory_): New data member.
6810 (class Script_info): Move here from script.h.
6811 (Script_info::Script_info): Add filename parameter.
6812 (Script_info::filename): New function.
6813 (Script_info::filename_): New data member.
6814 (Incremental_script_entry::Incremental_script_entry): Add argument
6815 serial number.
6816 (Incremental_object_entry::Incremental_object_entry): Likewise.
6817 (Incremental_object_entry::add_input_section): Build list of input
6818 sections with map to original shndx.
6819 (Incremental_object_entry::get_input_section_index): New function.
6820 (Incremental_object_entry::shndx_): New data member.
6821 (Incremental_object_entry::name_key_): Rename; adjust all refs.
6822 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
6823 (Incremental_archive_entry::Incremental_archive_entry): Add argument
6824 serial number.
6825 (Incremental_inputs::report_archive_begin): Likewise.
6826 (Incremental_inputs::report_object): Likewise.
6827 (Incremental_inputs::report_script): Likewise.
6828 (class Incremental_global_symbol_reader): New class.
6829 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
6830 and store flags and input file type.
6831 (Incremental_input_entry_reader::arg_serial): New function.
6832 (Incremental_input_entry_reader::type): Extract type from flags.
6833 (Incremental_input_entry_reader::is_in_system_directory): New function.
6834 (Incremental_input_entry_reader::get_input_section_count): Call
6835 accessor function for type.
6836 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
6837 function for type; adjust size of global symbol entry.
6838 (Incremental_input_entry_reader::get_global_symbol_count): Call
6839 accessor function for type.
6840 (Incremental_input_entry_reader::get_object_count): Likewise.
6841 (Incremental_input_entry_reader::get_object_offset): Likewise.
6842 (Incremental_input_entry_reader::get_member_count): Likewise.
6843 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
6844 (Incremental_input_entry_reader::get_member_offset): Likewise.
6845 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
6846 (Incremental_input_entry_reader::Global_symbol_info): Remove.
6847 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
6848 (Incremental_input_entry_reader::get_global_symbol_reader): New
6849 function.
6850 (Incremental_input_entry_reader::get_output_symbol_index): New
6851 function.
6852 (Incremental_input_entry_reader::type_): Remove.
6853 (Incremental_input_entry_reader::flags_): New data member.
6854 (Incremental_inputs_reader::input_file_offset): New function.
6855 (Incremental_inputs_reader::input_file_index): New function.
6856 (Incremental_inputs_reader::input_file): Call input_file_offset.
6857 (Incremental_inputs_reader::input_file_at_offset): New function.
6858 (Incremental_relocs_reader::get_r_type): Reformat.
6859 (Incremental_relocs_reader::get_r_shndx): Reformat.
6860 (Incremental_relocs_reader::get_r_offset): Reformat.
6861 (Incremental_relocs_reader::data): New function.
6862 (Incremental_binary::Incremental_binary): Initialize new data members.
6863 (Incremental_binary::check_inputs): Add cmdline parameter.
6864 (Incremental_binary::file_is_unchanged): Remove.
6865 (Input_reader::arg_serial): New function.
6866 (Input_reader::get_unused_symbol_count): New function.
6867 (Input_reader::get_unused_symbol): New function.
6868 (Input_reader::do_arg_serial): New function.
6869 (Input_reader::do_get_unused_symbol_count): New function.
6870 (Input_reader::do_get_unused_symbol): New function.
6871 (Incremental_binary::input_file_count): New function.
6872 (Incremental_binary::get_input_reader): Change signature to use
6873 index instead of filename.
6874 (Incremental_binary::file_has_changed): New function.
6875 (Incremental_binary::get_input_argument): New function.
6876 (Incremental_binary::get_library): New function.
6877 (Incremental_binary::get_script_info): New function.
6878 (Incremental_binary::init_layout): New function.
6879 (Incremental_binary::reserve_layout): New function.
6880 (Incremental_binary::output_file): New function.
6881 (Incremental_binary::do_check_inputs): New function.
6882 (Incremental_binary::do_file_is_unchanged): Remove.
6883 (Incremental_binary::do_file_has_changed): New function.
6884 (Incremental_binary::do_init_layout): New function.
6885 (Incremental_binary::do_reserve_layout): New function.
6886 (Incremental_binary::do_input_file_count): New function.
6887 (Incremental_binary::do_get_input_reader): Change signature.
6888 (Incremental_binary::input_args_map_): New data member.
6889 (Incremental_binary::library_map_): New data member.
6890 (Incremental_binary::script_map_): New data member.
6891 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6892 new data members.
6893 (Sized_incremental_binary::output_section): New function.
6894 (Sized_incremental_binary::inputs_reader): Add const.
6895 (Sized_incremental_binary::symtab_reader): Add const.
6896 (Sized_incremental_binary::relocs_reader): Add const.
6897 (Sized_incremental_binary::got_plt_reader): Add const.
6898 (Sized_incremental_binary::get_symtab_view): New function.
6899 (Sized_incremental_binary::Inputs_reader): New typedef.
6900 (Sized_incremental_binary::Input_entry_reader): New typedef.
6901 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
6902 (Sized_incremental_binary::do_file_is_unchanged): Remove.
6903 (Sized_incremental_binary::do_file_has_changed): New function.
6904 (Sized_incremental_binary::do_init_layout): New function.
6905 (Sized_incremental_binary::do_reserve_layout): New function.
6906 (Sized_input_reader::Inputs_reader): Remove.
6907 (Sized_input_reader::Input_entry_reader): Remove.
6908 (Sized_input_reader::do_arg_serial): New function.
6909 (Sized_input_reader::do_get_unused_symbol_count): New function.
6910 (Sized_input_reader::do_get_unused_symbol): New function.
6911 (Sized_incremental_binary::do_input_file_count): New function.
6912 (Sized_incremental_binary::do_get_input_reader): Change signature;
6913 use index instead of filename.
6914 (Sized_incremental_binary::section_map_): New data member.
6915 (Sized_incremental_binary::input_entry_readers_): New data member.
6916 (class Sized_incr_relobj): New class.
6917 (class Sized_incr_dynobj): New class.
6918 (make_sized_incremental_object): New function.
6919 (class Incremental_library): New class.
6920 * layout.cc (Free_list::num_lists): New static data member.
6921 (Free_list::num_nodes): New static data member.
6922 (Free_list::num_removes): New static data member.
6923 (Free_list::num_remove_visits): New static data member.
6924 (Free_list::num_allocates): New static data member.
6925 (Free_list::num_allocate_visits): New static data member.
6926 (Free_list::init): New function.
6927 (Free_list::remove): New function.
6928 (Free_list::allocate): New function.
6929 (Free_list::dump): New function.
6930 (Free_list::print_stats): New function.
6931 (Layout_task_runner::run): Resize output file for incremental updates.
6932 (Layout::Layout): Initialize new data members.
6933 (Layout::set_incremental_base): New function.
6934 (Layout::init_fixed_output_section): New function.
6935 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
6936 incremental updates.
6937 (Layout::create_gold_note): Do not create gold note section for
6938 incremental updates.
6939 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
6940 for incremental updates.
6941 (Layout::set_section_offsets): For incremental updates, allocate space
6942 from free list.
6943 (Layout::create_symtab_sections): Layout with offsets relative to
6944 start of section; for incremental updates, allocate space from free
6945 list.
6946 (Layout::create_shdrs): For incremental updates, allocate space from
6947 free list.
6948 (Layout::finish_dynamic_section): For incremental updates, do not
6949 check --as-needed (fixed in subsequent patch).
6950 * layout.h (class Free_list): New class.
6951 (Layout::set_incremental_base): New function.
6952 (Layout::incremental_base): New function.
6953 (Layout::init_fixed_output_section): New function.
6954 (Layout::allocate): New function.
6955 (Layout::incremental_base_): New data member.
6956 (Layout::free_list_): New data member.
6957 * main.cc (main): Print Free_list statistics.
6958 * object.cc (Relobj::finalize_incremental_relocs): Add
6959 clear_counts parameter; clear counts only when clear_counts is set.
6960 (Sized_relobj::Sized_relobj): Initialize new base class.
6961 (Sized_relobj::do_layout): Don't report special sections.
6962 (Sized_relobj::do_for_all_local_got_entries): New function.
6963 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
6964 symtab_off to all symbol table offsets.
6965 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
6966 * object.h (class Got_offset_list): Move to top of file.
6967 (Object::Object): Allow case where input_file == NULL.
6968 (Object::~Object): Likewise.
6969 (Object::input_file): Assert that input_file != NULL.
6970 (Object::lock): Allow case where input_file == NULL.
6971 (Object::unlock): Likewise.
6972 (Object::is_locked): Likewise.
6973 (Object::token): Likewise.
6974 (Object::release): Likewise.
6975 (Object::is_incremental): New function.
6976 (Object::get_mtime): New function.
6977 (Object::for_all_local_got_entries): New function.
6978 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
6979 (Object::set_is_in_system_directory): New function.
6980 (Object::is_in_system_directory): New function.
6981 (Object::do_is_incremental): New function.
6982 (Object::do_get_mtime): New function.
6983 (Object::do_for_all_local_got_entries): New function.
6984 (Object::is_in_system_directory_): New data member.
6985 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
6986 (class Sized_relobj_base): New class.
6987 (class Sized_relobj): Derive from Sized_relobj_base.
6988 (class Sized_relobj::Symbols): Redeclare from base class.
6989 (class Sized_relobj::local_got_offset_list): Remove.
6990 (class Sized_relobj::Output_sections): Redeclare from base class.
6991 (class Sized_relobj::do_for_all_local_got_entries): New function.
6992 (class Sized_relobj::write_local_symbols): Add offset parameter.
6993 (class Sized_relobj::local_symbol_offset_): Update comment.
6994 (class Sized_relobj::local_dynsym_offset_): Update comment.
6995 * options.cc (Input_arguments::add_file): Remove const.
6996 * options.h (Input_file_argument::Input_file_argument):
6997 Initialize arg_serial_ (all constructors).
6998 (Input_file_argument::set_arg_serial): New function.
6999 (Input_file_argument::arg_serial): New function.
7000 (Input_file_argument::arg_serial_): New data member.
7001 (Input_arguments::Input_arguments): Initialize file_count_.
7002 (Input_arguments::add_file): Remove const.
7003 (Input_arguments::number_of_input_files): New function.
7004 (Input_arguments::file_count_): New data member.
7005 (Command_line::number_of_input_files): Call
7006 Input_arguments::number_of_input_files.
7007 * output.cc (Output_segment_headers::Output_segment_headers):
7008 Set current size.
7009 (Output_section::Input_section::current_data_size): New function.
7010 (Output_section::Output_section): Initialize new data members.
7011 (Output_section::add_input_section): Don't do merge sections for
7012 an incremental link; allocate space from free list for an
7013 incremental update.
7014 (Output_section::add_output_section_data): Allocate space from
7015 free list for an incremental update.
7016 (Output_section::update_data_size): New function.
7017 (Output_section::set_fixed_layout): New function.
7018 (Output_section::reserve): New function.
7019 (Output_segment::set_section_addresses): Remove const.
7020 (Output_segment::set_section_list_addresses): Remove const; allocate
7021 space from free list for an incremental update.
7022 (Output_segment::set_offset): Adjust size of RELRO segment for an
7023 incremental update.
7024 * output.h (Output_data::current_data_size): Move here from
7025 child classes.
7026 (Output_data::pre_finalize_data_size): New function.
7027 (Output_data::update_data_size): New function.
7028 (Output_section_headers::update_data_size): new function.
7029 (Output_section_data_build::current_data_size): Move to Output_data.
7030 (Output_data_strtab::update_data_size): New function.
7031 (Output_section::current_data_size): Move to Output_data.
7032 (Output_section::set_fixed_layout): New function.
7033 (Output_section::has_fixed_layout): New function.
7034 (Output_section::reserve): New function.
7035 (Output_section::update_data_size): New function.
7036 (Output_section::has_fixed_layout_): New data member.
7037 (Output_section::free_list_): New data member.
7038 (Output_segment::set_section_addresses): Remove const.
7039 (Output_segment::set_section_list_addresses): Remove const.
7040 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
7041 New function.
7042 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
7043 New function.
7044 * readsyms.cc (Read_symbols::do_read_symbols): Add library
7045 parameter when calling Add_symbols constructor; store argument
7046 serial number for members of a lib group.
7047 (Add_symbols::locks): Allow case where token == NULL.
7048 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
7049 (Read_member::~Read_member): New function.
7050 (Read_member::is_runnable): New function.
7051 (Read_member::locks): New function.
7052 (Read_member::run): New function.
7053 (Check_script::~Check_script): New function.
7054 (Check_script::is_runnable): New function.
7055 (Check_script::locks): New function.
7056 (Check_script::run): New function.
7057 (Check_library::~Check_library): New function.
7058 (Check_library::is_runnable): New function.
7059 (Check_library::locks): New function.
7060 (Check_library::run): New function.
7061 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
7062 (Add_symbols::library_): New data member.
7063 (class Read_member): New class.
7064 (class Check_script): New class.
7065 (class Check_library): New class.
7066 * reloc.cc (Read_relocs::is_runnable): Allow case where
7067 token == NULL.
7068 (Read_relocs::locks): Likewise.
7069 (Scan_relocs::locks): Likewise.
7070 (Relocate_task::locks): Likewise.
7071 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
7072 to clear counters.
7073 (Sized_relobj::incremental_relocs_scan): Fix comment.
7074 (Sized_relobj::do_relocate): Pass output file offset to
7075 write_local_symbols.
7076 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
7077 from class declaration.
7078 * script.cc (read_input_script): Allocate Script_info; pass
7079 argument serial number to report_script.
7080 * script.h (class Script_info): Move to incremental.h.
7081 * symtab.cc (Symbol_table::add_from_incrobj): New function.
7082 * symtab.h (Symbol_table::add_from_incrobj): New function.
7083 (Symbol_table::set_file_offset): New function.
7084
b961d0d7
CC
70852011-04-05 Cary Coutant <ccoutant@google.com>
7086
7087 * incremental-dump.cc (dump_incremental_inputs): Change signature
7088 to take a Sized_incremental_binary; change caller. Use readers
7089 in Sized_incremental_binary.
7090 * incremental.cc
7091 (Sized_incremental_binary::find_incremental_inputs_sections):
7092 Rename do_find_incremental_inputs_sections to this.
7093 (Sized_incremental_binary::setup_readers): New function.
7094 (Sized_incremental_binary::do_check_inputs): Check
7095 has_incremental_info_ flag; move setup code to setup_readers;
7096 use input readers.
7097 (Sized_incremental_binary::do_file_is_unchanged): New function.
7098 (Sized_incremental_binary::do_get_input_reader): New function.
7099 * incremental.h (class Incremental_binary): Move to end of file.
7100 (Incremental_binary::file_is_unchanged): New function.
7101 (Incremental_binary::do_file_is_unchanged): New function.
7102 (Incremental_binary::Input_reader): New class.
7103 (Incremental_binary::get_input_reader): New function.
7104 (class Sized_incremental_binary): Move to end of file.
7105 (Sized_incremental_binary::Sized_incremental_binary): Setup the
7106 input section reader classes.
7107 (Sized_incremental_binary::has_incremental_info): New function.
7108 (Sized_incremental_binary::inputs_reader): New function.
7109 (Sized_incremental_binary::symtab_reader): New function.
7110 (Sized_incremental_binary::relocs_reader): New function.
7111 (Sized_incremental_binary::got_plt_reader): New function.
7112 (Sized_incremental_binary::do_file_is_unchanged): New function.
7113 (Sized_incremental_binary::Sized_input_reader): New class.
7114 (Sized_incremental_binary::get_input_reader): New function.
7115 (Sized_incremental_binary::find_incremental_inputs_sections):
7116 Rename do_find_incremental_inputs_sections to this.
7117 (Sized_incremental_binary::setup_readers): New function.
7118 (Sized_incremental_binary::has_incremental_info_): New data member.
7119 (Sized_incremental_binary::inputs_reader_): New data member.
7120 (Sized_incremental_binary::symtab_reader_): New data member.
7121 (Sized_incremental_binary::relocs_reader_): New data member.
7122 (Sized_incremental_binary::got_plt_reader_): New data member.
7123 (Sized_incremental_binary::current_input_file_): New data member.
7124
a869183f
PP
71252011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
7126
7127 PR gold/12640
7128 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
7129 violation.
7130
71312011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
7132
7133 * archive.cc (Archive::include_member): Adjust call to report_object.
7134 (Add_archive_symbols::run): Add script_info to call to
7135 report_archive_begin.
7136 (Lib_group::include_member): Adjust call to report_object.
7137 (Add_lib_group_symbols::run): Adjust call to report_object.
7138 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
7139 blocks. Add object count for script input files.
7140 * incremental.cc (Incremental_inputs::report_archive_begin): Add
7141 script_info parameter; change all callers.
7142 (Incremental_inputs::report_object): Add script_info parameter;
7143 change all callers.
7144 (Incremental_inputs::report_script): Store backpointer to
7145 incremental info entry.
7146 (Output_section_incremental_inputs::set_final_data_size): Record
7147 additional information for scripts.
7148 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7149 * incremental.h (Incremental_script_entry::add_object): New function.
7150 (Incremental_script_entry::get_object_count): New function.
7151 (Incremental_script_entry::get_object): New function.
7152 (Incremental_script_entry::objects_): New data member; adjust
7153 constructor.
7154 (Incremental_inputs::report_archive_begin): Add script_info parameter.
7155 (Incremental_inputs::report_object): Add script_info parameter.
7156 (Incremental_inputs_reader::get_object_count): New function.
7157 (Incremental_inputs_reader::get_object_offset): New function.
7158 * options.cc (Input_arguments::add_file): Return reference to
7159 new input argument.
7160 * options.h (Input_argument::set_script_info): New function.
7161 (Input_argument::script_info): New function.
7162 (Input_argument::script_info_): New data member; adjust all
7163 constructors.
7164 (Input_file_group::add_file): Return reference to new input argument.
7165 (Input_file_lib::add_file): Likewise.
7166 (Input_arguments::add_file): Likewise.
7167 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
7168 * script.cc (Parser_closure::Parser_closure): Add script_info
7169 parameter; adjust all callers.
7170 (Parser_closure::script_info): New function.
7171 (Parser_closure::script_info_): New data member.
7172 (read_input_script): Report scripts earlier to incremental info.
7173 (script_add_file): Set script_info in Input_argument.
7174 (script_add_library): Likewise.
7175 * script.h (Script_options::Script_info): Rewrite class.
7176
a869183f 71772011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
7178
7179 * archive.cc (Library_base::should_include_member): Move
7180 method here from class Archive.
7181 (Archive::Archive): Initialize base class.
7182 (Archive::should_include_member): Move to base class.
7183 (Archive::do_for_all_unused_symbols): New function.
7184 (Add_archive_symbols::run): Remove redundant access to
7185 incremental_inputs.
7186 (Lib_group::Lib_group): Initialize base class.
7187 (Lib_group::do_filename): New function.
7188 (Lib_group::include_member): Pass pointer to Lib_group to
7189 report_object.
7190 (Lib_group::do_for_all_unused_symbols): New function.
7191 (Add_lib_group_symbols::run): Report archive information for
7192 incremental links.
7193 * archive.h (class Library_base): New base class.
7194 (class Archive): Derive from Library_base.
7195 (Archive::filename): Move to base class.
7196 (Archive::set_incremental_info): Likewise.
7197 (Archive::incremental_info): Likewise.
7198 (Archive::Should_include): Likewise.
7199 (Archive::should_include_member): Likewise.
7200 (Archive::Armap_entry): Remove.
7201 (Archive::Unused_symbol_iterator): Remove.
7202 (Archive::unused_symbols_begin): Remove.
7203 (Archive::unused_symbols_end): Remove.
7204 (Archive::do_filename): New function.
7205 (Archive::do_get_mtime): New function.
7206 (Archive::do_for_all_unused_symbols): New function.
7207 (Archive::task_): Move to base class.
7208 (Archive::incremental_info_): Likewise.
7209 (class Lib_group): Derive from Library_base.
7210 (Lib_group::do_filename): New function.
7211 (Lib_group::do_get_mtime): New function.
7212 (Lib_group::do_for_all_unused_symbols): New function.
7213 (Lib_group::task_): Move to base class.
7214 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
7215 function.
7216 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
7217 function.
7218 * incremental.cc (Incremental_inputs::report_archive_begin):
7219 Use Library_base; call library's get_mtime; add incremental inputs
7220 entry before members.
7221 (class Unused_symbol_visitor): New class.
7222 (Incremental_inputs::report_archive_end): Use Library_base; use
7223 visitor class to record unused symbols; don't add incremental inputs
7224 entry after members.
7225 (Incremental_inputs::report_object): Use Library_base.
7226 * incremental.h
7227 (Incremental_archive_entry::Incremental_archive_entry): Remove
7228 unused Archive parameter.
7229 (Incremental_inputs::report_archive_begin): Use Library_base.
7230 (Incremental_inputs::report_archive_end): Likewise.
7231 (Incremental_inputs::report_object): Likewise.
7232 * object.cc (Sized_relobj::do_for_all_global_symbols): New
7233 function.
7234 * object.h (Object::for_all_global_symbols): New function.
7235 (Object::do_for_all_global_symbols): New function.
7236 (Sized_relobj::do_for_all_global_symbols): New function.
7237 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
7238 function.
7239 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
7240 function.
7241
61ab3e40
ILT
72422011-03-27 Ian Lance Taylor <iant@google.com>
7243
7244 * archive.cc (Archive::interpret_header): Return -1 if something
7245 goes wrong. Change callers accordingly.
7246
30e1f9e6
CC
72472011-03-25 Cary Coutant <ccoutant@google.com>
7248
7249 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
7250 * testsuite/Makefile.in: Regenerate.
7251
9370ce59 72522011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
7253
7254 * plugin.cc (get_view): New.
7255 (Plugin::load): Pass get_view to the plugin.
7256 (Plugin_manager::get_view): New.
7257
9312bb0a
ILT
72582011-03-21 Ian Lance Taylor <iant@google.com>
7259
7260 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 7261 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 7262
7e12ba9e
ST
72632011-03-21 Sriraman Tallam <tmsriram@google.com>
7264
7265 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
7266 Change == to -eq.
7267 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
7268 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
7269 Change == to -eq.
7270 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
7271 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
7272
fd7a005d
ILT
72732011-03-14 Ian Lance Taylor <iant@google.com>
7274
7275 * script-sections.cc (Sort_output_sections::script_compare):
7276 Rename from is_before, change return type.
7277 (Sort_output_sections::operator()): Adjust accordingly.
7278
ed16fd1b
ILT
72792011-03-11 Jeffrey Yasskin <jyasskin@google.com>
7280
7281 PR gold/12572
7282 * testsuite/odr_violation2.cc: Add comment to make all error line
7283 numbers double digits.
7284 * testsuite/debug_msg.sh: Adjust expected errors.
7285
71ff8986
ILT
72862011-03-09 Jeffrey Yasskin <jyasskin@google.com>
7287
7288 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
7289 but mark earlier ones as non-canonical
7290 (offset_to_iterator): Update search target and example
7291 (do_addr2line): Return extra lines in a vector*
7292 (format_file_lineno): Extract from do_addr2line
7293 (one_addr2line): Add vector* out-param
7294 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
7295 when a lineno entry appeared last for its instruction
7296 (Dwarf_line_info): Add vector* out-param
7297 * object.cc (Relocate_info): Pass NULL for the vector* out-param
7298 * symtab.cc (Odr_violation_compare): Include the lineno in the
7299 comparison again.
7300 (linenos_from_loc): New. Combine the canonical line for an
7301 address with its other lines.
7302 (True_if_intersect): New. Helper functor to make
7303 std::set_intersection a query.
7304 (detect_odr_violations): Compare sets of lines instead of just
7305 one line for each function. This became less deterministic, but
7306 has fewer false positives.
7307 * symtab.h: Declarations.
7308 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
7309 mix an optimized and non-optimized object in the same binary
7310 (odr_violation2.so): Same.
7311 * testsuite/Makefile.in: Regenerate from Makefile.am.
7312 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
7313 * testsuite/debug_msg.sh: Update line numbers and add
7314 assertions.
7315 * testsuite/odr_violation1.cc: Use OdrDerived, in a
7316 non-optimized context.
7317 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
7318 isn't inlined, and use OdrDerived in an optimized context.
7319 * testsuite/odr_header1.h: Defines OdrDerived, where
7320 optimization will change the
7321 first-instruction-in-the-destructor's file and line number.
7322 * testsuite/odr_header2.h: Defines OdrBase.
7323
a19fefdc
ILT
73242011-03-09 Ian Lance Taylor <iant@google.com>
7325
7326 * fileread.cc (File_read::clear_views): Don't delete the whole
7327 file view.
7328
ecb351e9
ILT
73292011-03-08 Ian Lance Taylor <iant@google.com>
7330
7331 PR gold/12525
7332 * fileread.cc: #include <climits>.
7333 (GOLD_IOV_MAX): Define.
7334 (File_read::read_multiple): Limit number of entries by iov_max.
7335 * fileread.h (class File_read): Always set max_readv_entries to
7336 128.
7337
b821d13c
ILT
73382011-03-07 Ian Lance Taylor <iant@google.com>
7339
7340 PR gold/12525
7341 * options.h (class General_options): Add -dy and -dn.
7342
89243142
CC
73432011-03-02 Cary Coutant <ccoutant@google.com>
7344
7345 * testsuite/script_test_9.t: Add TLS segment.
7346
d0773f31
ILT
73472011-03-02 Simon Baldwin <simonb@google.com>
7348
7349 * configure.ac: Add check for gnu_indirect_function support in
7350 the toolchain building binutils.
7351 * configure: Rebuild.
7352
9370ce59 73532011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
7354
7355 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
7356 plugin only symbols.
7357 (Symbol_table::sized_finalize_symbol) Mark symbol only present
7358 in plugin files as not needed in the symbol table.
7359
4cf7a849
ST
73602011-02-11 Sriraman Tallam <tmsriram@google.com>
7361
7362 * output.cc (Output_section::add_input_section): Delay fill
7363 generation for section ordering.
7364
b578bd7d
ILT
73652011-02-09 Ian Lance Taylor <iant@google.com>
7366
7367 PR gold/12316
7368 * object.h (class Sized_relobj): Remove clear_local_symbols.
7369 * reloc.cc (Sized_relobj::do_relocate): Don't call
7370 clear_local_symbols.
7371
9370ce59 73722011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
7373
7374 * plugin.cc (is_visible_from_outside): Return true for symbols
7375 in the -u option.
7376
55382fb7
ILT
73772011-02-04 Jeffrey Yasskin <jyasskin@google.com>
7378
7379 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
7380 filename.
7381
4e271fff
ST
73822011-02-02 Sriraman Tallam <tmsriram@google.com>
7383
7384 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 7385 to std::string.
4e271fff 7386 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 7387 section_name to be std::string.
4e271fff
ST
7388 (is_function_ctor_or_dtor): Change type of parameter to std::string.
7389
d433c3ac
ILT
73902011-01-25 Ian Lance Taylor <iant@google.com>
7391
7392 * script.cc (script_add_extern): Rewrite to use
7393 add_symbol_reference.
7394
880473a6
DK
73952011-01-25 Doug Kwan <dougkwan@google.com>
7396
d433c3ac 7397 * icf.cc (get_section_contents): Always lock section's object.
880473a6 7398
f30f86fa
ILT
73992011-01-24 Ian Lance Taylor <iant@google.com>
7400
7401 * options.h (class General_options): Accept
7402 --no-detect-odr-violations.
7403
8e51a0b9
ILT
74042011-01-24 Ian Lance Taylor <iant@google.com>
7405
7406 * version.cc (version_string): Bump to 1.11.
7407
0f3b89d8
ILT
74082011-01-24 Ian Lance Taylor <iant@google.com>
7409
7410 * plugin.cc (class Plugin_rescan): Define new class.
7411 (Plugin_manager::claim_file): Set any_claimed_.
7412 (Plugin_manager::save_archive): New function.
7413 (Plugin_manager::save_input_group): New function.
7414 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
7415 necessary.
7416 (Plugin_manager::new_undefined_symbol): New function.
7417 (Plugin_manager::rescan): New function.
7418 (Plugin_manager::rescannable_defines): New function.
7419 (Plugin_manager::add_input_file): Set any_added_.
7420 * plugin.h (class Plugin_manager): define new fields rescannable_,
7421 undefined_symbols_, any_claimed_, and any_added_. Declare
7422 Plugin_rescan as friend. Declare new functions.
7423 (Plugin_manager::Rescannable): Define type.
7424 (Plugin_manager::Rescannable_list): Define type.
7425 (Plugin_manager::Undefined_symbol_list): Define type.
7426 (Plugin_manager::Plugin_manager): Initialize new fields.
7427 * archive.cc (Archive::defines_symbol): New function.
7428 (Add_archive_symbols::run): Pass archive to plugins if any.
7429 * archive.h (class Archive): Declare defines_symbol.
7430 * readsyms.cc (Input_group::~Input_group): New function.
7431 (Finish_group::run): Pass input_group to plugins if any.
7432 * readsyms.h (class Input_group): Declare destructor.
7433 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
7434 any.
7435
3bb951e5
ILT
74362011-01-10 Ian Lance Taylor <iant@google.com>
7437
7438 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
7439 section as relro.
7440 (Layout::set_segment_offsets): Reset increase_relro before calling
7441 set_section_addresses a second time.
7442
0aa45fac
CC
74432011-01-04 Cary Coutant <ccoutant@google.com>
7444
7445 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
7446 sections before NOBITS sections.
7447
0db46eb4
L
74482011-01-01 H.J. Lu <hongjiu.lu@intel.com>
7449
7450 * version.cc (print_version): Update copyright to 2011.
7451
829c9745
CC
74522010-12-23 Cary Coutant <ccoutant@google.com>
7453
7454 * output.h (Output_data_reloc::add_output_section): Pass OD instead
7455 of OS to this->add. Add OD parameter to second form of the function.
7456
7500420b
ILT
74572010-12-20 Ian Lance Taylor <iant@google.com>
7458
7459 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
7460 second of two consecutive entries with same offset.
7461
f8e9a930
RW
74622010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7463
7464 * testsuite/Makefile.am (ifuncmain2static_LDADD)
7465 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
7466 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
7467 to avoid unneeded links against $(LDADD).
7468 * testsuite/Makefile.in: Regenerate.
7469
2fbb4320
ILT
74702010-12-15 Ian Lance Taylor <iant@google.com>
7471
7472 PR gold/12324
7473 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
7474 for R_X86_64_32 and R_X86_64_PC32.
7475 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
7476 ver_matching_def_pic.o.
7477 (ver_matching_def_pic.o): New target.
7478
fedb228d
RW
74792010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7480
7481 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
7482 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
7483 Move definition before File_read::View member definitions.
7484 (File_read::View::~View): Initialize and hold lock before
7485 updating current_mapped_bytes.
7486
9b547ce6
RW
74872010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7488
7489 * dwarf_reader.cc: Remove outdated comment.
7490 * gold-threads.cc: Fix typo in error message.
7491 * archive.cc: Fix typos in comments.
7492 * archive.h: Likewise.
7493 * arm-reloc-property.cc: Likewise.
7494 * arm-reloc-property.h: Likewise.
7495 * arm-reloc.def: Likewise.
7496 * arm.cc: Likewise.
7497 * attributes.h: Likewise.
7498 * cref.cc: Likewise.
7499 * ehframe.cc: Likewise.
7500 * fileread.h: Likewise.
7501 * gold.h: Likewise.
7502 * i386.cc: Likewise.
7503 * icf.cc: Likewise.
7504 * incremental.h: Likewise.
7505 * int_encoding.cc: Likewise.
7506 * layout.h: Likewise.
7507 * main.cc: Likewise.
7508 * merge.h: Likewise.
7509 * object.cc: Likewise.
7510 * object.h: Likewise.
7511 * options.cc: Likewise.
7512 * readsyms.cc: Likewise.
7513 * reduced_debug_output.cc: Likewise.
7514 * reloc.cc: Likewise.
7515 * script-sections.cc: Likewise.
7516 * sparc.cc: Likewise.
7517 * symtab.h: Likewise.
7518 * target-reloc.h: Likewise.
7519 * target.cc: Likewise.
7520 * target.h: Likewise.
7521 * timer.cc: Likewise.
7522 * timer.h: Likewise.
7523 * x86_64.cc: Likewise.
7524
83e17bd5
CC
75252010-12-09 Cary Coutant <ccoutant@google.com>
7526
7527 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
7528 stack.
7529 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
7530 parameter; change all callers.
7531 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
7532 * options.h (warn_execstack): New option.
7533
017257f8
DK
75342010-12-07 Doug Kwan <dougkwan@google.com>
7535
7536 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
7537 like function call relocations.
7538
c20cbc06
ILT
75392010-12-07 Ian Lance Taylor <iant@google.com>
7540
7541 * archive.cc (Archive::get_elf_object_for_member): Permit
7542 punconfigured to be NULL.
7543 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
7544 (Archive::include_member): Pass NULL to get_elf_object_for_member
7545 if we searched for the archive and this is the first included
7546 object.
7547
4dbfafcc
ILT
75482010-12-01 Ian Lance Taylor <iant@google.com>
7549
7550 * dwarf_reader.h (class Sized_dwarf_line_info): Add
7551 track_relocs_type_ field.
7552 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7553 Set track_relocs_type_.
7554 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
7555 contents when using RELA relocs.
7556 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
7557 reloc_map_.
7558 * reloc.cc (Track_relocs::next_addend): New function.
7559 * reloc.h (class Track_relocs): Declare next_addend.
7560
e5e19edd
ILT
75612010-12-01 Ian Lance Taylor <iant@google.com>
7562
7563 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
7564 virtual destructor.
7565
9a5ce24c
ILT
75662010-12-01 Ian Lance Taylor <iant@google.com>
7567
7568 * README: Update compilers known to work and fail.
7569
c7791212
NC
75702010-11-23 Matthias Klose <doko@ubuntu.com>
7571
7572 * configure.in: For --enable-gold, handle value `default' instead of
7573 `both*'. Always install ld as ld.bfd, install as ld if gold is
7574 not the default.
7575 * configure: Regenerate.
7576
0ad220c9
DK
75772010-11-18 Doug Kwan <dougkwan@google.com>
7578
7579 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
7580 and right_alignment to be zero. Store result alignment only if it is
7581 greater than existing alignment.
7582
ab8056e0
CC
75832010-11-16 Cary Coutant <ccoutant@google.com>
7584
7585 PR gold/12220
7586 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7587 Check for ".zdebug_line".
7588
fd064a5b
CC
75892010-11-16 Doug Kwan <dougkwan@google.com>
7590 Cary Coutant <ccoutant@google.com>
7591
7592 * output.h (Output_segment::set_section_addresses): Pass increase_relro
7593 by reference; adjust all callers.
7594 * output.cc (Output_segment::set_section_addresses): Adjust references
7595 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
7596 list is empty.
7597 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
7598 end at page boundary.
7599
6fc6ea19
CC
76002010-11-16 Cary Coutant <ccoutant@google.com>
7601
7602 PR gold/12220
7603 * layout.cc (Layout::choose_output_section): Transform names of
7604 compressed sections even when using a script with a SECTIONS clause.
7605 (Layout::output_section_name): Remove code to transform
7606 compressed debug section names.
7607 * output.cc (Output_section::add_input_section): Use uncompressed
7608 section size when tracking input sections.
7609
95a2c8d6
RS
76102010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
7611
7612 * symtab.h (Symbol::NON_PIC_REF): Remove.
7613 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
7614 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
7615 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
7616 (Symbol::use_plt_offset): Take a flags argument and pass it
7617 directly to needs_dynamic_reloc. Restrict check for undefined
7618 weak symbols to function calls.
7619 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
7620 (Target_arm::Scan::global): Use it.
7621 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
7622 (Target_arm::Relocate::relocate): Likewise.
7623 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
7624 parameter with an r_type parameter. Use get_reference_flags
7625 to get the flags.
7626 (Target_arm::Relocate::relocate): Update accordingly.
7627 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
7628 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
7629 (Target_i386::Scan::global): Likewise.
7630 (Target_i386::Relocate::relocate): Likewise.
7631 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
7632 parameter with an r_type parameter. Use get_reference_flags
7633 to get the flags.
7634 (Target_i386::Relocate::relocate): Update accordingly.
7635 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
7636 (Target_powerpc::Scan::global): Use it.
7637 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
7638 (Target_powerpc::Relocate::relocate): Likewise.
7639 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
7640 (Target_sparc::Scan::global): Use it.
7641 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
7642 (Target_sparc::Relocate::relocate): Likewise.
7643 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
7644 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
7645 (Target_x86_64::Scan::global): Likewise.
7646 (Target_x86_64::Relocate::relocate): Likewise.
7647
f625ae50
DK
76482010-11-08 Doug Kwan <dougkwan@google.com>
7649 Cary Coutant <ccoutant@google.com>
7650
7651 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
7652 (Arm_exidx_merge_section::section_contents_): New data member.
7653 (Arm_input_section::Arm_input_section): Initialize original_contents_.
7654 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 7655 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
7656 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
7657 in parameters instead of calling Object::section_contents without
7658 locking.
7659 (Arm_output_section::group_section): New parameter TASK. Pass it
7660 to callees that need locking objects.
7661 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
7662 to lock EXIDX input sections. Fix a formatting issue. Call
7663 Arm_exidx_merged_section::build_contents to create merged section
7664 contents.
7665 (Arm_output_section::create_stub_group): New parameter TASK. Use it
7666 to lock object of stub table owner.
7667 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
7668 TEXT_SIZE to initialize data member TEXT_SIZE_.
7669 (Arm_exidx_input_section::addralign): Fix typo in comment.
7670 (Arm_exidx_input_section::text_size): New method.
7671 (Target_arm::do_relax): New parameter TASK. Pass it to callees
7672 that require locking objects. Lock objects before scanning for stubs
7673 and updating local symbols.
7674 (Arm_input_section<big_endian>::init): Copy contents of original
7675 input section.
2e702c99 7676 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
7677 original input section instead of calling Object::section_contents
7678 without locking.
7679 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
7680 size without calling Object::section_size().
7681 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
7682 for size. Allocate a buffer for merged EXIDX entries.
7683 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 7684 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
7685 building code to Arm_exidx_merged_section::build_contetns. Write
7686 out contetns in buffer instead of building it on the fly.
7687 (Arm_relobj::make_exidx_input_section): Also pass text section size
7688 to Arm_exidx_input_section constructor.
7689 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
7690 (Arm_dynobj::do_read_symbols): Fix memory leak.
7691 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
7692 * target.h: (class Task): Add forward declaration.
7693 (Target::relax): Add new parameter TASK and pass it to
7694 Target::do_relax().
7695 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
7696
5f9bcf58
CC
76972010-11-05 Cary Coutant <ccoutant@google.com>
7698
7699 PR gold/10708
7700 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
7701 object when reading from the file.
7702 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
7703 second layout pass.
7704 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
7705 when reading section contents.
7706 (get_section_contents): Likewise.
7707 (icf::find_identical_sections): Likewise.
7708 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
7709 object when reading from the file.
7710 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
7711 the object when doing deferred section layout.
7712
e597fa08
NC
77132010-11-03 Nick Clifton <nickc@redhat.com>
7714
7715 PR gold/12001
7716 * script.h (class Symbol_assignment: name): New member. Returns
7717 the name of the symbol.
7718 * scrfipt.cc (Script_options::is_pending_assignment): New member.
7719 Returns true if the given symbol name is on the list of
7720 assignments wating to be processed.
7721 * archive.cc (should_incldue_member): If the symbol is undefined,
7722 check to see if it is on the list of symbols pending assignment.
7723
3f9a3278
ILT
77242010-11-03 Ryan Mansfield <rmansfield@qnx.com>
7725
7726 * script-sections.cc (Script_sections::find_memory_region): Check
7727 for a NULL output section pointer.
7728
d06fb4d1
DK
77292010-10-29 Doug Kwan <dougkwan@google.com>
7730
7731 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
7732 Output_section::add_relaxed_input_section.
7733 * output.cc (Output_section::add_relaxed_input_section): Add new
7734 arguments LAYOUT and NAME. Set section order index.
7735 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7736 Copy section order index.
7737 * output.h (Output_section::add_relaxed_input_section): Add new
7738 arguments LAYOUT and NAME.
7739
90e24de5
ILT
77402010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7741
7742 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 7743 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
7744 * testsuite/Makefile.in: Regenerate.
7745
c9484ea5
DK
77462010-10-20 Doug Kwan <dougkwan@google.com>
7747
7748 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
7749 without SHF_LINK_ORDER flags.
7750 * layout.cc (Layout::choose_output_section): Do not filter
7751 SHF_LINK_ORDER flag in a relocatable link.
7752
5bc2f5be
CC
77532010-10-17 Cary Coutant <ccoutant@google.com>
7754
7755 * output.h (Output_segment::set_section_addresses): Change function
7756 signature. Update all callers.
7757 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
7758 sections.
7759 (Output_segment::set_section_addresses): Align after last TLS
7760 section. Add padding before last relro section instead of after.
7761
0c91cf04
DK
77622010-10-17 Doug Kwan <dougkwan@google.com>
7763
7764 * gold/arm.cc (Target_arm::got_section): Use correct order and set
7765 GOT output section to be writable.
7766
8c21d9d3
CC
77672010-10-14 Cary Coutant <ccoutant@google.com>
7768
7769 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
7770 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
7771 * gold.cc (queue_initial_tasks): Check parameters for incremental link
7772 mode.
7773 * incremental.cc (report_command_line): Ignore all forms of
7774 --incremental.
7775 * layout.cc (Layout::Layout): Check parameters for incremental link
7776 mode.
7777 * options.cc (General_options::parse_incremental): New function.
7778 (General_options::parse_no_incremental): New function.
7779 (General_options::parse_incremental_full): New function.
7780 (General_options::parse_incremental_update): New function.
7781 (General_options::incremental_mode_): New data member.
7782 (General_options::finalize): Check incremental_mode_.
7783 * options.h (General_options): Update help text for --incremental.
7784 Add --no-incremental, --incremental-full, --incremental-update.
7785 (General_options::Incremental_mode): New enum type.
7786 (General_options::incremental_mode): New function.
7787 (General_options::incremental_mode_): New data member.
7788 * parameters.cc (Parameters::incremental_mode_): New data member.
7789 (Parameters::set_options): Set incremental_mode_.
7790 (Parameters::set_incremental_full): New function.
7791 (Parameters::incremental): New function.
7792 (Parameters::incremental_update): New function.
7793 (set_parameters_incremental_full): New function.
7794 * parameters.h (Parameters::set_incremental_full): New function.
7795 (Parameters::incremental): New function.
7796 (Parameters::incremental_update): New function.
7797 (Parameters::incremental_mode_): New data member.
7798 (set_parameters_incremental_full): New function.
7799 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
7800 incremental link mode.
7801 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
7802 (Sized_relobj::do_relocate_sections): Likewise.
7803 * testsuite/Makefile.am (incremental_test): Use --incremental-full
7804 option.
7805 * testsuite/Makefile.in: Regenerate.
7806 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 7807
bb32aa18 78082010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
7809
7810 * script-sections.h (class Script_sections): Make
7811 Sections_elements typedef public.
7812 * script-sections.cc (class Sort_output_sections): Add elements_
7813 field. Add constructor which sets it; change all callers.
7814 (Sort_output_sections::is_before): New function.
7815 (Sort_output_sections::operator()): Call is_before.
7816 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
7817 conditional.
7818 * testsuite/script_test_10.sh: New test. Test script section
7819 order.
7820 * testsuite/script_test_10.t: Likewise.
7821 * testsuite/script_test_10.s: Likewise.
7822 * testsuite/Makefile.am: Wrap the cross linker tests and the
7823 common tests into NATIVE_OR_CROSS_LINKER.
7824 (check_SCRIPTS): Add script_test_10.sh.
7825 (check_DATA): Add script_test_10.stdout.
7826 (script_test_10.o, script_test_10): New targets.
7827 (script_test_10.stdout): New target.
7828 * configure, testsuite/Makefile.in: Regenerate.
7829
3cef7179
ILT
78302010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7831
7832 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
7833 error for the deprecated relocations.
7834 (Target_arm::Scan::global): Likewise.
7835 (Target_arm::Relocate::relocate): Likewise.
7836
7411e9a8
RS
78372010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
7838
7839 * fileread.cc (Input_file::find_file): Initialize *found_name
7840 and *namep when using the fallback search for case 4.
7841
6a9da32a
CC
78422010-10-11 Cary Coutant <ccoutant@google.com>
7843
7844 * options.h (class General_options): Redefine -z lazy as an alias for
7845 the negation of -z now.
7846
ac897c20
ILT
78472010-10-11 Ian Lance Taylor <iant@google.com>
7848
7849 * resolve.cc (symbol_to_bits): Report the value of the unsupported
7850 binding.
7851
ea5cae92
NC
78522010-10-06 Nick Clifton <nickc@redhat.com>
7853
7854 * script-sections.cc(class Memory_region): Remove
7855 current_lma_offset_ field. Rename current_vma_offset_ to
7856 current_offset_. Add last_section_ field.
7857 (Memory_region::get_current_vma_address): Rename to
7858 get_current_address.
7859 (Memory_region::get_current_lma_address): Delete.
7860 (Memory_region::increment_vma_offset): Rename to
7861 increment_offset.
7862 (Memory_region::increment_lma_offset): Delete.
7863 (Memory_region::attributes_compatible): New method. Returns
7864 true if the provided section is compatible with the region.
7865 (Memory_region::get_last_section): New method. Returns the last
7866 section to use the region.
7867 (Memory_region::set_last_section): New method. Stores the last
7868 section to use the region.
7869 (Script_sections::block_in_region): New method. Returns true if
7870 a block of memory is contained within a region.
7871 (Script_sections::find_memory_region): New method. Locates a
7872 memory region to be used to set a VMA or LMA address.
7873 (Output_section_definition::set_section_addresses): Add code to
7874 check for addresses set by memory regions.
7875 (Output_segment::set_section_addresses): Remove memory region
7876 walking code.
7877 (Script_sections::create_segment): Add a warning if a header
7878 segment is created outside of any region.
7879 * script-sections.h (class Script_sections): Add prototypes for
7880 find_memory_region and block_in_region methods.
7881 * testsuite/memory_test.s: Use .long instead of .word.
7882 * testsuite/memory_test.t: Add some more output sections.
7883 * testsuite/memory_test.sh: Update expected output.
7884
a9bfd952
DK
78852010-10-02 Doug Kwan <dougkwan@google.com>
7886
7887 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
7888 defintion to symtab.h
7889 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
7890 declaration to defintion.
7891
bacff3ab
NC
78922010-10-01 Nick Clifton <nickc@redhat.com>
7893
7894 * expression.cc (eval): Replace dummy argument with NULL.
7895 (eval_maybe_dot): Check for a NULL result section pointer.
7896 (Symbol_expression::value): Likewise.
7897 (Dot_expression::value): Likewise.
7898 (BINARY_EXPRESSION): Likewise.
7899 (Max_expression::value): Likewise.
7900 (Min_expression::value): Likewise.
7901 (Absolute_expression::value): Likewise.
7902 (Addr_expression::value_from_output_section): Likewise.
7903 (Loaddddr_expression::value_from_output_section): Likewise.
7904 (Segment_start_expression::value): Likewise.
7905 * script-sections.cc
7906 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
7907 argument with NULL.
7908 (Sections_elememt_dot_assignment::set_section_addresses):
7909 Likewise.
7910 (Output_data_expression::do_write_to_buffer): Likewise.
7911 (Output_section_definition::finalize_symbols): Likewise.
7912 (Output_section_definition::set_section_addresses): Likewise.
7913
f81bc8b5
DK
79142010-09-30 Doug Kwan <dougkwan@google.com>
7915
7916 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
7917
c95e9f27
ST
79182010-09-28 Sriraman Tallam <tmsriram@google.com>
7919
7920 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 7921 function.
c95e9f27
ST
7922 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
7923 virtual function.
7924 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
7925 virtual function.
7926 * icf.cc (get_section_contents): Inline merge sections only when
7927 target allows it.
7928
3cac54d2
RW
79292010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7930
7931 * configure: Regenerate.
7932
2904037a
ILT
79332010-09-17 Ian Lance Taylor <iant@google.com>
7934
7935 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
7936 * testsuite/Makefile.am (memory_test.o): New target.
7937 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
7938 memory_test.t.
7939 * testsuite/Makefile.in: Rebuild.
2904037a 7940
bca7fb63
DK
79412010-09-17 Doug Kwan <dougkwan@google.com>
7942
7943 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
7944 defintion if relocation uses GOT entries of the symbol.
7945 * testsuite/icf_safe_test.sh: Fix test.
7946 * testsuite/icf_safe_so_test.sh: Fix test.
7947
4ef28648
CC
79482010-09-16 Cary Coutant <ccoutant@google.com>
7949
7950 * script_sections.cc (class Memory_region): Remove "NULL" from
7951 vector initializations.
7952
793990de
CC
79532010-09-15 Cary Coutant <ccoutant@google.com>
7954
7955 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
7956 Resolve forwarding symbols.
7957
81e015e2
DK
79582010-09-15 Doug Kwan <dougkwan@google.com>
7959
7960 * gold/testsuite/script_test_3.t: Add ARM special sections.
7961 * gold/testsuite/script_test_4.t: Same.
7962 * gold/testsuite/script_test_5.t: Same.
7963 * gold/testsuite/script_test_6.t: Same.
7964 * gold/testsuite/script_test_7.t: Same.
7965 * gold/testsuite/script_test_7.t: Same.
7966 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
7967
36171d64
CC
79682010-09-14 Cary Coutant <ccoutant@google.com>
7969
7970 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
7971 (Target_x86_64::Relocate::relocate_tls): Replace check for
7972 saw_tls_block_reloc_ with test for executable section.
7973
d89051bd
CC
79742010-09-12 Cary Coutant <ccoutant@google.com>
7975
7976 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
7977 position-independent executables to shared libraries need dynamic
7978 relocations.
7979 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
7980 position-independent executables.
7981 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
7982 * testsuite/Makefile.in: Regenerate.
7983
fca41f0f
NC
79842010-09-10 Nick Clifton <nickc@redhat.com>
7985
7986 PR gold/11997
7987 * testsuite/memory_test.t: Discard any sections that are not
7988 needed.
7989
6695e4b3
L
79902010-09-09 H.J. Lu <hongjiu.lu@intel.com>
7991
7992 PR gold/11996
7993 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
7994 "This::" to work around a bug in gcc 4.2.
7995
7996 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
7997
0f72bf6f
RÁE
79982010-09-09 Rafael Espindola <espindola@google.com>
7999
8000 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
8001 sections with different PF_X flags in the same segment.
8002 (Layout::find_first_load_seg): Search all segments to find the first
8003 one.
8004 * options.h (rosegment): New.
8005
80062010-09-08 Rafael Espindola <espindola@google.com>
a6577478 8007
05a79166 8008 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 8009
aa98ff75
DK
80102010-09-08 Doug Kwan <dougkwan@google.com>
8011
8012 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
8013 (Arm_relobj::do_relocate_sections): Add new parameter for output
8014 file to match the parent.
8015 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
8016 of local symbols instead of input values. Update code to track
8017 changes in gold::relocate_section.
8018 * object.cc (Sized_relobj::compute_final_local_value): New methods.
8019 (Sized_relobj::compute_final_local_value_internal): New methods.
8020 (Sized_relobj::do_finalize_local_symbols): Move code from loop
8021 body into private version of Sized_relobj::compute_final_local_value.
8022 Call the inline method.
8023 * object.h (Symbol_value::Symbol_value): Define destructor. Free
8024 merged symbol value if there is one.
8025 (Symbol_value::has_output_value): New method defintiion.
8026 (Sized_relobj::Compute_final_local_value_status): New enum type.
8027 (Sized_relobj::compute_final_local_value): New methods.
8028 (Sized_relobj::compute_final_local_value_internal): New methods.
8029 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
8030 and arm_cortex_a8.sh.
8031 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
8032 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
8033 New tests.
8034 * Makefile.in: Regenerate.
8035 * testsuite/arm_bl_out_of_range.s: Update test.
8036 * testsuite/thumb_bl_out_of_range.s: Ditto.
8037 * testsuite/thumb_blx_out_of_range.s: Ditto.
8038 * testsuite/arm_branch_out_of_range.sh: New file.
8039 * testsuite/arm_cortex_a8.sh: Ditto.
8040 * testsuite/arm_cortex_a8_b.s: Ditto.
8041 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
8042 * testsuite/arm_cortex_a8_b_local.s: Ditto.
8043 * testsuite/arm_cortex_a8_bl.s: Ditto.
8044 * testsuite/arm_cortex_a8_blx.s: Ditto.
8045 * testsuite/arm_cortex_a8_local.s: Ditto.
8046 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
8047 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
8048
05a79166
L
80492010-09-08 Rafael Espindola <espindola@google.com>
8050
8051 * Makefile.am (memory_test.stdout): Run readelf with -W.
8052 * Makefile.in: Regenerate.
8053 * testsuite/memory_test.sh: Make the regexps accept both 32 and
8054 64 bit output.
8055
33dbc701
RÁE
80562010-09-08 Rafael Espindola <espindola@google.com>
8057
8058 * script-sections.cc (Script_sections::add_memory_region): Convert
8059 field precision to int.
8060 * script.cc (script_set_section_region, script_set_section_region):
8061 Convert field precision to int.
8062
731ca54a
RÁE
80632010-09-08 Rafael Espindola <espindola@google.com>
8064
8065 * arm.cc (do_finalize_sections): Create the __exidx_start and
8066 __exdix_end symbols even when the section is missing.
8067
7f8cd844
NC
80682010-09-08 Nick Clifton <nickc@redhat.com>
8069
8070 * README: Remove claim that MEMORY is not supported.
8071 * expression.cc (script_exp_function_origin)
8072 (script_exp_function_length): Move from here to ...
8073 * script.cc: ... here.
8074 (script_set_section_region, script_add_memory)
8075 (script_parse_memory_attr, script_include_directive): New
8076 functions.
8077 * script-sections.cc
8078 (class Memory_region): New class.
8079 (class Output_section_definition): Add set_memory_region,
8080 set_section_vma, set_section_lma and get_section_name methods.
8081 (class Script_Sections): Add add_memory_region,
8082 find_memory_region, find_memory_region_origin,
8083 find_memory_region_length and set_memory_region methods.
8084 Have set_section_addresses method walk the list of set memory
8085 regions.
8086 Extend the print methos to display memory regions.
8087 * script-sections.h: Add prototypes for new methods.
8088 Add enum for MEMORY region attributes.
8089 * yyscript.y: Add support for parsing MEMORY regions.
8090 * script-c.h: Add prototypes for new functions.
8091 * testsuite/Makefile.am: Add test of MEMORY region functionality.
8092 * testsuite/Makefile.in: Regenerate.
8093 * testsuite/memory_test.sh: New script.
8094 * testsuite/memory_test.s: New assembler source file.
8095 * testsuite/memory_test.t: New linker script.
8096
a4649286
DK
80972010-08-27 Doug Kwan <dougkwan@google.com>
8098
8099 * gold/resolve.cc (Symbol_table::should_override): Let a weak
8100 reference override an existing dynamic weak reference.
8101 * testsuite/Makefile.am: Add new test dyn_weak_ref.
8102 * testsuite/Makefile.in: Regenerate.
8103 * testsuite/dyn_weak_ref.sh: New file.
8104 * testsuite/dyn_weak_ref_1.c: Ditto.
8105 * testsuite/dyn_weak_ref_2.c: Ditto.
8106
b56648ad
ILT
81072010-08-27 Ian Lance Taylor <iant@google.com>
8108
8109 * incremental.h (class Incremental_input_entry): Add virtual
8110 destructor.
8111
809313cb
ILT
81122010-08-27 Ian Lance Taylor <iant@google.com>
8113
8114 * testsuite/start_lib_test_3.c: Mark t3 as used.
8115
11e32464
NC
81162010-08-27 Nick Clifton <nickc@redhat.com>
8117
8118 * options.cc (version_script): Fix small typo in previous
8119 whitespace tidyup.
8120
ca09d69a
NC
81212010-08-25 Nick Clifton <nickc@redhat.com>
8122
8123 * archive.cc: Formatting fixes: Remove whitespace between
8124 typename and following asterisk. Remove whitespace between
8125 function name and opening parenthesis.
8126 * archive.h: Likewise.
8127 * arm.cc: Likewise.
8128 * attributes.cc: Likewise.
8129 * attributes.h: Likewise.
8130 * common.cc: Likewise.
8131 * copy-relocs.cc: Likewise.
8132 * dirsearch.h: Likewise.
8133 * dynobj.cc: Likewise.
8134 * ehframe.cc: Likewise.
8135 * ehframe.h: Likewise.
8136 * expression.cc: Likewise.
8137 * fileread.cc: Likewise.
8138 * fileread.h: Likewise.
8139 * gc.h: Likewise.
8140 * gold-threads.cc: Likewise.
8141 * gold.cc: Likewise.
8142 * i386.cc: Likewise.
8143 * icf.h: Likewise.
8144 * incremental-dump.cc: Likewise.
8145 * incremental.cc: Likewise.
8146 * layout.cc: Likewise.
8147 * layout.h: Likewise.
8148 * main.cc: Likewise.
8149 * merge.cc: Likewise.
8150 * merge.h: Likewise.
8151 * object.cc: Likewise.
8152 * object.h: Likewise.
8153 * options.cc: Likewise.
8154 * options.h: Likewise.
8155 * output.cc: Likewise.
8156 * output.h: Likewise.
8157 * plugin.cc: Likewise.
8158 * plugin.h: Likewise.
8159 * powerpc.cc: Likewise.
8160 * reloc.cc: Likewise.
8161 * script-c.h: Likewise.
8162 * script-sections.cc: Likewise.
8163 * script.cc: Likewise.
8164 * stringpool.cc: Likewise.
8165 * symtab.cc: Likewise.
8166 * symtab.h: Likewise.
8167 * target.cc: Likewise.
8168 * timer.cc: Likewise.
8169 * timer.h: Likewise.
8170 * version.cc: Likewise.
8171 * x86_64.cc: Likewise.
8172
b8fa8750
NC
81732010-08-24 Nick Clifton <nickc@redhat.com>
8174
8175 PR 11899
8176 * layout.cc (segment_precedes): Sort segments by their physical
8177 addresses, if they have been set.
8178
9919d93b
CC
81792010-08-23 Cary Coutant <ccoutant@google.com>
8180
8181 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
8182 symbols data.
8183 (Lib_group::include_member): Unlock object after deleting its
8184 symbols data.
8185 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
8186 the bug fixed here.
8187
97b4be1c
CC
81882010-08-19 Neil Vachharajani <nvachhar@google.com>
8189 Cary Coutant <ccoutant@google.com>
8190
8191 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
8192 constructor, and set_blocker.
8193 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
8194 readsyms_blocker_.
8195 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
8196 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
8197 * testsuite/Makefile.am (start_lib_test): New test case.
8198 * testsuite/Makefile.in: Regenerate.
8199 * testsuite/start_lib_test_main.c: New file.
8200 * testsuite/start_lib_test_1.c: New file.
8201 * testsuite/start_lib_test_2.c: New file.
8202 * testsuite/start_lib_test_3.c: New file.
8203
dd0b1884
ILT
82042010-08-19 Ian Lance Taylor <iant@google.com>
8205
8206 * Makefile.in: Rebuild with automake 1.11.1.
8207 * aclocal.m4: Likewise.
8208 * testsuite/Makefile.in: Likewise.
8209
7223e9ca
ILT
82102010-08-19 Ian Lance Taylor <iant@google.com>
8211
8212 PR 10893
8213 * i386.cc (class Output_data_plt_i386): Update declarations.
8214 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
8215 local_ifuncs_ fields.
8216 (Target_i386::do_plt_section_for_global): New function.
8217 (Target_i386::do_plt_section_for_local): New function.
8218 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
8219 parameter; change all callers. Initialize global_ifuncs_ and
8220 local_ifuncs_. If doing a static link define __rel_iplt_start and
8221 __rel_iplt_end.
8222 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
8223 (Output_data_plt_i386::add_local_ifunc_entry): New function.
8224 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
8225 symbols.
8226 (Target_i386::make_plt_section): New function, broken out of
8227 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
8228 (Target_i386::make_plt_entry): Call make_plt_section.
8229 (Target_i386::make_local_ifunc_plt_entry): New function.
8230 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
8231 (Target_i386::Scan::local): Handle IFUNC symbols. Add
8232 R_386_IRELATIVE to switch.
8233 (Target_i386::Scan::global): Likewise.
8234 (Target_i386::Relocate::relocate): Likewise.
8235 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
8236 switch.
8237 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
8238 (Target_x86_64::do_plt_section_for_global): New function.
8239 (Target_x86_64::do_plt_section_for_local): New function.
8240 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
8241 parameter; change all callers. If doing a static link define
8242 __rela_iplt_start and __rela_iplt_end.
8243 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
8244 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
8245 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
8246 to point to .plt.
8247 (Target_x86_64::make_local_ifunc_plt_entry): New function.
8248 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
8249 switch.
8250 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
8251 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
8252 R_X86_64_IRELATIVE to switch.
8253 (Target_x86_64::Scan::global): Likewise.
8254 (Target_x86_64::Relocate::relocate): Likewise.
8255 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
8256 switch.
8257 * target.h (class Target): Add plt_section_for_global and
8258 plt_section_for_local functions. Add do_plt_section_for_global
8259 and do_plt_section_for_local virtual functions.
8260 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
8261 clarifying comments.
8262 (Symbol::use_plt_offset): Handle IFUNC symbol.
8263 * object.cc (Sized_relobj::Sized_relobj): Initialize
8264 local_plt_offsets_.
8265 (Sized_relobj::local_has_plt_offset): New function.
8266 (Sized_relobj::local_plt_offset): New function.
8267 (Sized_relobj::set_local_plt_offset): New function.
8268 (Sized_relobj::do_count): Handle IFUNC symbol.
8269 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
8270 a bit away from input_shndx_ field. Add set_is_func_symbol and
8271 is_ifunc_symbol functions.
8272 (class Sized_relobj): Update declarations. Remove Tls_got_entry
8273 and Local_tls_got_offsets. Define Local_plt_offsets. Add
8274 local_plt_offsets_ field.
8275 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
8276 * output.h (class Output_section_data): Add non-const
8277 output_section function.
8278 (class Output_data_got): Update declarations.
8279 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
8280 Add use_plt_offset parameter to global and local constructors.
8281 Change all callers. Change local_sym_index_ field to 31 bits.
8282 Change GSYM_CODE and CONSTANT_CODE accordingly.
8283 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
8284 doing a static link don't set sh_link field.
8285 (Output_data_got::Got_entry::write): Use PLT offset if
8286 appropriate.
8287 (Output_data_got::add_global_plt): New function.
8288 (Output_data_got::add_local_plt): New function.
8289 * target-reloc.h (relocate_section): Handle IFUNC symbol.
8290 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
8291 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
8292 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
8293 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
8294 IFUNC conditional.
8295 * testsuite/ifunc-sel.h: New file.
8296 * testsuite/ifuncmain1.c: New file.
8297 * testsuite/ifuncmain1vis.c: New file.
8298 * testsuite/ifuncmod1.c: New file.
8299 * testsuite/ifuncdep2.c: New file.
8300 * testsuite/ifuncmain2.c: New file.
8301 * testsuite/ifuncmain3.c: New file.
8302 * testsuite/ifuncmod3.c: New file.
8303 * testsuite/ifuncmain4.c: New file.
8304 * testsuite/ifuncmain5.c: New file.
8305 * testsuite/ifuncmod5.c: New file.
8306 * testsuite/ifuncmain6pie.c: New file.
8307 * testsuite/ifuncmod6.c: New file.
8308 * testsuite/ifuncmain7.c: New file.
8309 * configure, testsuite/Makefile.in: Rebuild.
8310
56f75c03
ILT
83112010-08-18 Ian Lance Taylor <iant@google.com>
8312
8313 * incremental.cc
8314 (Output_section_incremental_inputs::write_input_files): Add cast
8315 to avoid signed/unsigned comparison warning.
8316 (Output_section_incremental_inputs::write_info_blocks): Likewise.
8317
55455f89
CC
83182010-08-12 Cary Coutant <ccoutant@google.com>
8319
8320 * common.cc (Sort_commons::operator()): Remove unnecessary code.
8321
e2054bcb
ILT
83222010-08-13 Ian Lance Taylor <iant@google.com>
8323
8324 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
8325
74f67560
DK
83262010-08-12 Cary Coutant <ccoutant@google.com>
8327 Doug Kwan <dougkwan@google.com>
8328
8329 * resolve.cc (Symbol_table::should_override): When a weak dynamic
8330 defintion overrides non-weak undef, remember that the original undef
8331 is not weak.
8332 * symtab.cc (Symbol_table::sized_write_global): For undef without
8333 an original weak binding, set binding to global in output.
8334 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
8335 * testsuite/Makefile.in: Regenerate.
8336 * testsuite/strong_ref_weak_def.sh: New file.
8337 * testsuite/strong_ref_weak_def_1.c: Ditto.
8338 * testsuite/strong_ref_weak_def_2.c: Ditto.
8339
d1238d12
CC
83402010-08-12 Cary Coutant <ccoutant@google.com>
8341
8342 * testsuite/incremental_test.sh: Rewrite.
8343 * testsuite/incremental_test_1.c: Rewrite.
8344 * testsuite/incremental_test_2.c: Rewrite.
8345
0e70b911
CC
83462010-08-12 Cary Coutant <ccoutant@google.com>
8347
8348 * arm.cc (Target_arm::got_size): Add const.
8349 (Target_arm::got_entry_count): New function.
8350 (Target_arm::plt_entry_count): New function.
8351 (Target_arm::first_plt_entry_offset): New function.
8352 (Target_arm::plt_entry_size): New function.
8353 (Output_data_plt_arm::entry_count): New function.
8354 (Output_data_plt_arm::first_plt_entry_offset): New function.
8355 (Output_data_plt_arm::get_plt_entry_size): New function.
8356 * i386.cc (Target_i386::got_size): Add const.
8357 (Target_i386::got_entry_count): New function.
8358 (Target_i386::plt_entry_count): New function.
8359 (Target_i386::first_plt_entry_offset): New function.
8360 (Target_i386::plt_entry_size): New function.
8361 (Output_data_plt_i386::entry_count): New function.
8362 (Output_data_plt_i386::first_plt_entry_offset): New function.
8363 (Output_data_plt_i386::get_plt_entry_size): New function.
8364 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
8365 find_incremental_inputs_sections. Dump incremental_got_plt section.
8366 * incremental.cc: Include target.h.
8367 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
8368 parameter. Adjust all callers. Find incremental_got_plt section.
8369 (Incremental_inputs::create_data_sections): Create incremental_got_plt
8370 section.
8371 (Output_section_incremental_inputs::set_final_data_size): Calculate
8372 size of incremental_got_plt section.
8373 (Output_section_incremental_inputs::do_write): Write the
8374 incremental_got_plt section.
8375 (Got_plt_view_info): New struct.
8376 (Local_got_offset_visitor): New class.
8377 (Global_got_offset_visitor): New class.
8378 (Global_symbol_visitor_got_plt): New class.
8379 (Output_section_incremental_inputs::write_got_plt): New function.
8380 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
8381 Add parameter. Adjust all callers.
8382 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8383 (Incremental_inputs::got_plt_section): New function.
8384 (Incremental_inputs::got_plt_section_): New data member.
8385 (Incremental_got_plt_reader): New class.
8386 * layout.cc (Layout::create_incremental_info_sections): Add the
8387 incremental_got_plt section.
8388 * object.h (Got_offset_list::get_list): New function.
8389 (Got offset_list::for_all_got_offsets): New function.
8390 (Sized_relobj::local_got_offset_list): New function.
8391 * powerpc.cc (Target_powerpc::got_size): Add const.
8392 (Target_powerpc::got_entry_count): New function.
8393 (Target_powerpc::plt_entry_count): New function.
8394 (Target_powerpc::first_plt_entry_offset): New function.
8395 (Target_powerpc::plt_entry_size): New function.
8396 (Output_data_plt_powerpc::entry_count): New function.
8397 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
8398 (Output_data_plt_powerpc::get_plt_entry_size): New function.
8399 * sparc.cc (Target_sparc::got_size): Add const.
8400 (Target_sparc::got_entry_count): New function.
8401 (Target_sparc::plt_entry_count): New function.
8402 (Target_sparc::first_plt_entry_offset): New function.
8403 (Target_sparc::plt_entry_size): New function.
8404 (Output_data_plt_sparc::entry_count): New function.
8405 (Output_data_plt_sparc::first_plt_entry_offset): New function.
8406 (Output_data_plt_sparc::get_plt_entry_size): New function.
8407 * symtab.h (Symbol::got_offset_list): New function.
8408 (Symbol_table::for_all_symbols): New function.
8409 * target.h (Sized_target::got_entry_count): New function.
8410 (Sized_target::plt_entry_count): New function.
8411 (Sized_target::plt_entry_size): New function.
8412 * x86_64.cc (Target_x86_64::got_size): Add const.
8413 (Target_x86_64::got_entry_count): New function.
8414 (Target_x86_64::plt_entry_count): New function.
8415 (Target_x86_64::first_plt_entry_offset): New function.
8416 (Target_x86_64::plt_entry_size): New function.
8417 (Output_data_plt_x86_64::entry_count): New function.
8418 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
8419 (Output_data_plt_x86_64::get_plt_entry_size): New function.
8420
09ec0418
CC
84212010-08-12 Cary Coutant <ccoutant@google.com>
8422
8423 * archive.cc: Include incremental.h.
8424 (Archive::Archive): Initialize incremental_info_.
8425 (Archive::include_member): Record archive members in incremental info.
8426 (Add_archive_symbols::run): Record begin and end of an archive in
8427 incremental info.
8428 (Lib_group::include_member): Record objects in incremental info.
8429 * archive.h (Incremental_archive_entry): Forward declaration.
8430 (Archive::set_incremental_info): New member function.
8431 (Archive::incremental_info): New member function.
8432 (Archive::Unused_symbol_iterator): New class.
8433 (Archive::unused_symbols_begin): New member function.
8434 (Archive::unused_symbols_end): New member function.
8435 (Archive::incremental_info_): New data member.
8436 * incremental-dump.cc (find_input_containing_global): New function.
8437 (dump_incremental_inputs): Dump new incremental info sections.
8438 * incremental.cc: Include symtab.h.
8439 (Output_section_incremental_inputs): New class.
8440 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
8441 new incremental info sections.
8442 (Sized_incremental_binary::do_check_inputs): Likewise.
8443 (Incremental_inputs::report_archive): Remove.
8444 (Incremental_inputs::report_archive_begin): New function.
8445 (Incremental_inputs::report_archive_end): New function.
8446 (Incremental_inputs::report_object): New function.
8447 (Incremental_inputs::finalize_inputs): Remove.
8448 (Incremental_inputs::report_input_section): New function.
8449 (Incremental_inputs::report_script): Rewrite.
8450 (Incremental_inputs::finalize): Do nothing but finalize string table.
8451 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8452 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8453 (Incremental_inputs::create_data_sections): New function.
8454 (Incremental_inputs::relocs_entsize): New function.
8455 (Output_section_incremental_inputs::set_final_data_size): New function.
8456 (Output_section_incremental_inputs::do_write): New function.
8457 (Output_section_incremental_inputs::write_header): New function.
8458 (Output_section_incremental_inputs::write_input_files): New function.
8459 (Output_section_incremental_inputs::write_info_blocks): New function.
8460 (Output_section_incremental_inputs::write_symtab): New function.
8461 * incremental.h (Incremental_script_entry): Forward declaration.
8462 (Incremental_object_entry): Forward declaration.
8463 (Incremental_archive_entry): Forward declaration.
8464 (Incremental_inputs): Forward declaration.
8465 (Incremental_inputs_header_data): Remove.
8466 (Incremental_inputs_header): Remove.
8467 (Incremental_inputs_header_write): Remove.
8468 (Incremental_inputs_entry_data): Remove.
8469 (Incremental_inputs_entry): Remove.
8470 (Incremental_inputs_entry_write): Remove.
8471 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
8472 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
8473 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8474 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
8475 Likewise.
8476 (Incremental_input_entry): New class.
8477 (Incremental_script_entry): New class.
8478 (Incremental_object_entry): New class.
8479 (Incremental_archive_entry): New class.
8480 (Incremental_inputs::Incremental_inputs): Initialize new data members.
8481 (Incremental_inputs::report_inputs): Remove.
8482 (Incremental_inputs::report_archive): Remove.
8483 (Incremental_inputs::report_archive_begin): New function.
8484 (Incremental_inputs::report_archive_end): New function.
8485 (Incremental_inputs::report_object): Change prototype.
8486 (Incremental_inputs::report_input_section): New function.
8487 (Incremental_inputs::report_script): Change prototype.
8488 (Incremental_inputs::get_reloc_count): New function.
8489 (Incremental_inputs::set_reloc_count): New function.
8490 (Incremental_inputs::create_data_sections): New function.
8491 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8492 (Incremental_inputs::inputs_section): New function.
8493 (Incremental_inputs::symtab_section): New function.
8494 (Incremental_inputs::relocs_section): New function.
8495 (Incremental_inputs::get_stringpool): Add const.
8496 (Incremental_inputs::command_line): Add const.
8497 (Incremental_inputs::inputs): Remove.
8498 (Incremental_inputs::command_line_key): New function.
8499 (Incremental_inputs::input_file_count): New function.
8500 (Incremental_inputs::input_files): New function.
8501 (Incremental_inputs::relocs_entsize): New function.
8502 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8503 (Incremental_inputs::finalize_inputs): Remove.
8504 (Incremental_inputs::Input_info): Remove.
8505 (Incremental_inputs::lock_): Remove.
8506 (Incremental_inputs::inputs_): Change type.
8507 (Incremental_inputs::inputs_map_): Remove.
8508 (Incremental_inputs::current_object_entry_): New data member.
8509 (Incremental_inputs::inputs_section_): New data member.
8510 (Incremental_inputs::symtab_section_): New data member.
8511 (Incremental_inputs::relocs_section_): New data member.
8512 (Incremental_inputs::reloc_count_): New data member.
8513 (Incremental_inputs_reader): New class.
8514 (Incremental_symtab_reader): New class.
8515 (Incremental_relocs_reader): New class.
8516 * layout.cc (Layout::finalize): Move finalization of incremental info
8517 and creation of incremental info sections to follow finalization of
8518 symbol table. Set offsets for postprocessing sections.
8519 (Layout::create_incremental_info_sections): Call
8520 Incremental_inputs::create_data_sections. Add incremental symtab
8521 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
8522 sections to layout after input sections.
8523 * layout.h (struct Timespec): Forward declaration.
8524 (Layout::incremental_inputs): Add const.
8525 (Layout::create_incremental_info_sections): Add parameter.
8526 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
8527 * object.cc: Include incremental.h.
8528 (Relobj::finalize_incremental_relocs): New function.
8529 (Sized_relobj::do_layout): Record input sections in incremental info.
8530 * object.h (Object::output_section): New function.
8531 (Object::output_section_offset): Moved from Relobj.
8532 (Object::get_incremental_reloc_base): New function.
8533 (Object::get_incremental_reloc_count): New function.
8534 (Object::do_output_section): New function.
8535 (Object::do_output_section_offset): Moved from Relobj.
8536 (Object::do_get_incremental_reloc_base): New function.
8537 (Object::do_get_incremental_reloc_count): New function.
8538 (Object::Object): Initialize new data members.
8539 (Relobj::output_section): Renamed do_output_section and moved to
8540 protected.
8541 (Relobj::output_section_offset): Moved to Object.
8542 (Relobj::do_get_incremental_reloc_base): New function.
8543 (Relobj::do_get_incremental_reloc_count): New function.
8544 (Relobj::allocate_incremental_reloc_counts): New function.
8545 (Relobj::count_incremental_reloc): New function.
8546 (Relobj::finalize_incremental_relocs): New function.
8547 (Relobj::next_incremental_reloc_index): New function.
8548 (Relobj::reloc_counts_): New data member.
8549 (Relobj::reloc_bases_): New data member.
8550 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
8551 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
8552 (Sized_relobj::incremental_relocs_scan): New function.
8553 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8554 (Sized_relobj::incremental_relocs_write): New function.
8555 (Sized_relobj::incremental_relocs_write_reltype): New function.
8556 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
8557 incremental link.
8558 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
8559 archives and object files elsewhere.
8560 (Add_symbols::run): Report object files here.
8561 (Finish_group::run): Report end of archive at end of group.
8562 * reloc.cc: Include layout.h, incremental.h.
8563 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
8564 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
8565 (Sized_relobj::incremental_relocs_scan): New function.
8566 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8567 (Sized_relobj::do_relocate_sections): Write incremental relocations.
8568 (Sized_relobj::incremental_relocs_write): New function.
8569 (Sized_relobj::incremental_relocs_write_reltype): New function.
8570 * script.cc (read_input_script): Rewrite test for incremental link.
8571 Change call to Incremental_inputs::report_script.
8572 * symtab.h (Symbol_table::first_global_index): New function.
8573 (Symbol_table::output_count): New function.
8574
ce0d1972
DK
85752010-08-12 Doug Kwan <dougkwan@google.com>
8576
8577 * arm.cc (Target_arm::merge_object_attributes): Check command line
8578 options --no-wchar-size-warning and --no-enum-size-warning.
8579 * options.h (General_options): Add ld-compatible options
8580 --no-enum-size-warning and --no-wchar-size-warning.
8581
6e5710ce
ILT
85822010-08-04 Ian Lance Taylor <iant@google.com>
8583
8584 * x86_64.cc (Target_x86_64::Scan::local): Use
8585 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
8586 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
8587 (Target_x86_64::Scan::global): Likewise.
8588 (Target_x86_64::Relocate::relocate): Likewise.
8589 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
8590 Likewise.
8591
fef830db
CC
85922010-08-03 Cary Coutant <ccoutant@google.com>
8593
8594 * merge.cc (Output_merge_string::do_add_input_section): Count strings
8595 to reserve space in merged_strings vector. Keep total input size
8596 for stats.
8597 (Output_merge_string::do_print_merge_stats): Print total input size.
8598 * merge.h (Output_merge_string): Add input_size_ field.
8599 * stringpool.cc (Stringpool_template::string_length): Move
8600 implementations out of Stringpool_template class and place in
8601 stringpool.h.
8602 * stringpool.h (string_length): Move out of Stringpool_template.
8603
1e3811b0
ILT
86042010-08-03 Ian Lance Taylor <iant@google.com>
8605
8606 PR 11712
8607 * layout.cc (relaxation_loop_body): If address of load segment is
8608 set, adjust address to include headers if possible.
8609
7af0c620
ILT
86102010-08-03 Ian Lance Taylor <iant@google.com>
8611
8612 * version.cc (version_string): Bump to 1.10.
8613
22f0da72
ILT
86142010-08-03 Ian Lance Taylor <iant@google.com>
8615
8616 PR 11805
8617 * layout.h (enum Output_section_order): Define.
8618 (class Layout): Update declarations.
8619 * layout.cc (Layout::get_output_section): Add order parameter.
8620 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
8621 is_first_non_relro parameters. Change all callers.
8622 (Layout::choose_output_section): Likewise.
8623 (Layout::add_output_section_data): Likewise.
8624 (Layout::make_output_section): Likewise. Set order.
8625 (Layout::default_section_order): New function.
8626 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
8627 * output.cc (Output_section::Output_section): Initialize order_.
8628 Don't initialize deleted fields.
8629 (Output_segment::Output_segment): Don't initialize deleted
8630 fields.
8631 (Output_segment::add_output_section_to_load): New function
8632 replacing add_output_section. Change all callers to call this or
8633 add_output_section_to_nonload.
8634 (Output_segment::add_output_section_to_nonload): New function.
8635 (Output_segment::remove_output_section): Rewrite.
8636 (Output_segment::add_initial_output_data): Likewise.
8637 (Output_segment::has_any_data_sections): Likewise.
8638 (Output_segment::is_first_section_relro): Likewise.
8639 (Output_segment::maximum_alignment): Likewise.
8640 (Output_segment::has_dynamic_reloc): New function replacing
8641 dynamic_reloc_count. Change all callers.
8642 (Output_segment::has_dynamic_reloc_list): New function replacing
8643 dynamic_reloc_count_list. Change all callers.
8644 (Output_segment::set_section_addresses): Rewrite.
8645 (Output_segment::set_offset): Rewrite.
8646 (Output_segment::find_first_and_last_list): Remove.
8647 (Output_segment::set_tls_offsets): Rewrite.
8648 (Output_segment::first_section_load_address): Likewise.
8649 (Output_segment::output_section_count): Likewise.
8650 (Output_segment::section_with_lowest_load_address): Likewise.
8651 (Output_segment::write_section_headers): Likewise.
8652 (Output_segment::print_sections_to_map): Likewise.
8653 * output.h (class Output_data): Remove dynamic_reloc_count_
8654 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
8655 (Output_data::add_dynamic_reloc): Rewrite.
8656 (Output_data::has_dynamic_reloc): New function.
8657 (Output_data::dynamic_reloc_count): Remove.
8658 (class Output_section): Add order_ field. Remvoe is_relro_local_,
8659 is_last_relro_, is_first_non_relro_, is_interp_,
8660 is_dynamic_linker_section_ fields. Add order and set_order
8661 functions. Remove is_relro_local, set_is_relro_local,
8662 is_last_relro, set_is_last_relro, is_first_non_relro,
8663 set_is_first_non_relro functions, is_interp, set_is_interp,
8664 is_dynamic_linker_section, and set_is_dynamic_linker_section
8665 functions.
8666 (class Output_segment): Change Output_data_list from std::list to
8667 std:;vector. Add output_lists_ field. Remove output_data_ and
8668 output_bss_ fields. Update declarations.
8669
3ff2ccb0
ILT
86702010-08-02 Ian Lance Taylor <iant@google.com>
8671
8672 * arm.cc (Target_arm::gc_process_relocs): Use typename.
8673 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
8674 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
8675
88a4108b
ILT
86762010-08-02 Ian Lance Taylor <iant@google.com>
8677
8678 PR 11855
8679 * script.cc (Script_options::Script_options): Initialize
8680 symbol_definitions_ and symbol_references_.
8681 (Script_options::add_symbol_assignment): Update
8682 symbol_definitions_ and symbol_references_.
8683 (Script_options::add_symbol_reference): New function.
8684 (script_symbol): New function.
8685 * script.h (class Script_options): Add symbol_definitions_ and
8686 symbol_references_ fields.
8687 (Script_options::referenced_const_iterator): New type.
8688 (Script_options::referenced_begin): New function.
8689 (Script_options::referenced_end): New function.
8690 (Script_options::is_referenced): New function.
8691 (Script_options::any_unreferenced): New function.
8692 * script-c.h (script_symbol): Declare.
8693 * yyscript.y (exp): Call script_symbol.
8694 * symtab.cc: Include "script.h".
8695 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
8696 Change all callers. Check symbols referenced by scripts.
8697 (Symbol_table::add_undefined_symbols_from_command_line): Add
8698 layout parameter. Change all callers.
8699 (Symbol_table::do_add_undefined_symbols_from_command_line):
8700 Likewise. Break out loop body. Check symbols referenced by
8701 scripts.
8702 (Symbol_table::add_undefined_symbol_from_command_line): New
8703 function broken out of
8704 do_add_undefined_symbols_from_command_line.
8705 * symtab.h (class Symbol_table): Update declarations.
8706 * archive.cc: Include "layout.h".
8707 (Archive::should_include_member): Add layout parameter. Change
8708 all callers. Check for symbol mentioned in expression.
8709 * archive.h (class Archive): Update declaration.
8710 * object.cc (Sized_relobj::do_should_include_member): Add layout
8711 parameter.
8712 * object.h (Object::should_include_member): Add layout parameter.
8713 Change all callers.
8714 (Object::do_should_include_member): Add layout parameter.
8715 (class Sized_relobj): Update declaration.
8716 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
8717 parameter.
8718 * dynobj.h (class Sized_dynobj): Update declaration.
8719 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
8720 layout parameter.
8721 * plugin.h (class Sized_pluginobj): Update declaration.
8722
5f1ab67a
ILT
87232010-08-02 Ian Lance Taylor <iant@google.com>
8724
8725 PR 11866
8726 * output.cc (Output_segment::set_offset): Search for the first and
8727 last sections rather than assuming that the list is in order.
8728 (Output_segment::find_first_and_last_list): New function.
8729 * output.h (class Output_segment): Update declarations.
8730 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
8731 (relro_strip_test_SOURCES): New variable.
8732 (relro_strip_test_DEPENDENCIES): New variable.
8733 (relro_strip_test_LDFLAGS): New variable.
8734 (relro_strip_test_LDADD): New variable.
8735 (relro_strip_test.so): New target.
8736
a8df5856
ILT
87372010-08-02 Ian Lance Taylor <iant@google.com>
8738
8739 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
8740 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
8741 (Target_i386::got_tlsdesc_section): New function.
8742 (Target_i386::got_section): Create space for GOT entries for
8743 TLSDESC relocations.
8744 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
8745 R_386_TLS_GOTDESC.
8746 (Target_i386::Scan::global): Likewise.
8747 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
8748 using TLSDESC GOT.
8749 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
8750 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
8751 (Target_x86_64::got_tlsdesc_section): New function.
8752 (Target_x86_64::got_section): Create space for GOT entries for
8753 TLSDESC relocations.
8754 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
8755 R_386_TLS_GOTDESC.
8756 (Target_x86_64::Scan::global): Likewise.
8757 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
8758 using TLSDESC GOT.
8759
0c10a0a6
ILT
87602010-08-02 Ian Lance Taylor <iant@google.com>
8761
8762 * testsuite/final_layout.sh: Use dc to convert from hex to
8763 decimal.
8764
41cbeecc
ST
87652010-07-29 Sriraman Tallam <tmsriram@google.com>
8766
8767 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
8768 paramter to the call to gold::gc_process_relocs.
8769 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
8770 paramter to the call to gold::gc_process_relocs.
8771 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
8772 parameter to the call to gold::gc_process_relocs.
8773 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
8774 template parameter to the call to gold::gc_process_relocs.
8775 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
8776 paramter to the call to gold::gc_process_relocs.
8777 * gc.h (get_embedded_addend_size): New function.
8778 (gc_process_relocs): Save the size of the reloc for use by ICF.
8779 * icf.cc (get_section_contents): Get the addend from the text section
8780 for SHT_REL relocation sections.
8781 * icf.h (Icf::Reloc_addend_size_info): New typedef.
8782 (Icf::Reloc_info): Add new member reloc_addend_size_info.
8783 * int_encoding.h (read_from_pointer): New overloaded function.
8784 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
8785 * testsuite/icf_sht_rel_addend_test.sh: New file.
8786 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
8787 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
8788
6ea55b82
RW
87892010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8790
8791 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
8792 * Makefile.in: Regenerate.
8793 * testsuite/Makefile.in: Regenerate.
8794
9691462b
ILT
87952010-07-27 Jeffrey Yasskin <jyasskin@google.com>
8796
8797 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
8798 * gold/testsuite/debug_msg.cc: Likewise.
8799 * gold/testsuite/odr_violation1.cc
8800 * gold/testsuite/odr_violation2.cc
8801
76897331
CC
88022010-07-21 Cary Coutant <ccoutant@google.com>
8803
8804 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
8805 string, and length fields.
8806 (Output_merge_string::Merged_strings_list): New type.
8807 (Output_merge_string::Merged_strings_lists): New typedef.
8808 (Output_merge_string): Replace merged_strings_ with
8809 merged_strings_lists_.
8810 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
8811 Merged_strings_list per input object and section. Don't store pointer
8812 to the string. Don't store length with each merged string entry.
8813 (Output_merge_string::finalize_merged_data): Loop over list of merged
8814 strings lists. Recompute length of each merged string.
8815
78384e8f
CC
88162010-07-15 Cary Coutant <ccoutant@google.com>
8817
8818 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
8819 here.
8820
783659f9
ILT
88212010-07-14 Ian Lance Taylor <iant@google.com>
8822
8823 * descriptors.cc (Descriptors::open): Report correct name in error
8824 message.
8825
131687b4
DK
88262010-07-13 Doug Kwan <dougkwan@google.com>
8827
8828 * arm.cc (Arm_input_section::Arm_input_section): For a
8829 SHT_ARM_EXIDX section, always keeps the input sections.
8830 (Arm_input_section::set_exidx_section_link): New method.
8831 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
8832 has_errors_ to false.
8833 (Arm_exidx_input_section::has_errors,
8834 Arm_exidx_input_section::set_has_errors): New methods.
8835 (Arm_exidx_input_section::has_errors_): New data member.
8836 (Arm_relobj::get_exidx_shndx_list): New method.
8837 (Arm_output_section::append_text_sections_to_list): Do not skip
8838 section without SHF_EXECINSTR.
8839 (Arm_output_section::fix_exidx_coverage): Skip input sections with
8840 errors.
2e702c99 8841 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
8842 section header. Make error messages more verbose. Check for
8843 a non-executable section linked to an EXIDX section.
8844 (Arm_relobj::do_read_symbols): Remove error checking, which has been
8845 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
8846 check that there is no deferred EXIDX section if we exit early.
8847 Instead of not making an EXIDX section in case of an error, make one
8848 and set the has_errors flag of it.
8849 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
8850 in a relocatable link.
8851 (Target_arm::do_relax): Look for the EXIDX output section instead of
8852 assuming that it is called .ARM.exidx.
2e702c99 8853 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
8854 section list. Do not check for SHF_EXECINSTR section flags but
8855 skip any input section with errors.
8856 * output.cc (Output_section::Output_section): Initialize
8857 always_keeps_input_sections_ to false.
8858 (Output_section::add_input_section): Check for
8859 always_keeps_input_sections_.
8860 * output.h (Output_section::always_keeps_input_sections,
8861 Output_section::set_always_keeps_input_sections): New methods.
8862 (Output_section::always_keeps_input_sections): New data member.
8863
69517287
RÁE
88642010-07-13 Rafael Espindola <espindola@google.com>
8865
8866 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
8867 * fileread.h (Input_file): Add try_extra_search_path and find_file.
8868
82742395
ILT
88692010-07-13 Philip Herron <herron.philip@googlemail.com>
8870 Ian Lance Taylor <iant@google.com>
8871
8872 * output.h (Output_section_lookup_maps::add_merge_section):
8873 Correct check of whether value was inserted.
8874 (Output_section_lookup_maps::add_merge_input_section): Likewise.
8875 (Output_section_lookup_maps::add_relaxed_input_section):
8876 Likewise.
8877 * arm.cc (Target_arm::got_section): Remove used local os.
8878 * i386.cc (Target_i386::got_section): Likewise.
8879 * x86_64.cc (Target_x86_64::got_section): Likewise.
8880 * sparc.cc (Target_sparc::got_section): Likewise.
8881 (Target_sparc::relocate): Remove unused local have_got_offset.
8882 * powerpc.cc (Target_powerpc::relocate): Likewise.
8883
f2d707b5
ILT
88842010-07-13 Ian Lance Taylor <iant@google.com>
8885
241531d6
ILT
8886 * compressed_output.cc (zlib_decompress): Fix signature in
8887 !HAVE_ZLIB_H case.
8888
f2d707b5
ILT
8889 * archive.cc (Archive::include_member): Unlock an external member
8890 of a thin archive. Don't bother to delete an object we know is
8891 NULL.
8892
a2e47362
CC
88932010-07-12 Cary Coutant <ccoutant@google.com>
8894
8895 * compressed_output.cc (zlib_decompress): New function.
8896 (get_uncompressed_size): New function.
8897 (decompress_input_section): New function.
8898 * compressed_output.h (get_uncompressed_size): New function.
8899 (decompress_input_section): New function.
8900 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
8901 Handle compressed debug sections.
8902 * layout.cc (is_compressed_debug_section): New function.
8903 (Layout::output_section_name): Map compressed section names to
8904 canonical names.
8905 * layout.h (is_compressed_debug_section): New function.
8906 (is_debug_info_section): Recognize compressed debug sections.
8907 * merge.cc: Include compressed_output.h.
8908 (Output_merge_data::do_add_input_section): Handle compressed
8909 debug sections.
8910 (Output_merge_string::do_add_input_section): Handle compressed
8911 debug sections.
8912 * object.cc: Include compressed_output.h.
8913 (Sized_relobj::Sized_relobj): Initialize new data members.
8914 (build_compressed_section_map): New function.
8915 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
8916 * object.h (Object::section_is_compressed): New method.
8917 (Object::do_section_is_compressed): New method.
8918 (Sized_relobj::Compressed_section_map): New type.
8919 (Sized_relobj::do_section_is_compressed): New method.
8920 (Sized_relobj::compressed_sections_): New data member.
8921 * output.cc (Output_section::add_input_section): Handle compressed
8922 debug sections.
8923 * reloc.cc: Include compressed_output.h.
8924 (Sized_relobj::write_sections): Handle compressed debug sections.
8925
ce279a62
CC
89262010-07-08 Cary Coutant <ccoutant@google.com>
8927
8928 * resolve.cc (Symbol_table::resolve): Remember whether undef was
8929 weak when resolving to a dynamic def.
8930 (Symbol_table::should_override): Add adjust_dyndef flag; set it
8931 for weak undef/dynamic def cases. Adjust callers.
8932 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
8933 undef_binding_weak_.
8934 (Symbol_table::sized_write_globals): Adjust symbol binding.
8935 (Symbol_table::sized_write_symbol): Add binding parameter.
8936 * symtab.h (Symbol::set_undef_binding): New method.
8937 (Symbol::is_undef_binding_weak): New method.
8938 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
8939 (Symbol_table::should_override): Add new parameter.
8940 (Symbol_table::sized_write_symbol): Add new parameter.
8941
8942 * testsuite/weak_undef_file1.cc: Add new test case.
8943 * testsuite/weak_undef_file2.cc: Fix header comment.
8944 * testsuite/weak_undef_test.cc: Add new test case.
8945
b2286c10
DK
89462010-06-29 Doug Kwan <dougkwan@google.com>
8947
8948 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
8949 Initialize USE_SYMBOL_.
8950 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
8951 definition.
8952 (Arm_reloc_property::uses_symbol_): New data member declaration.
8953 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
8954 uses symbol value and symbol is undefined but not weakly undefined.
8955
4802450a
RÁE
89562010-06-28 Rafael Espindola <espindola@google.com>
8957
8958 * plugin.cc (Plugin::load): Use dlerror.
8959
e5ca47ba
ILT
89602010-06-26 Jeffrey Yaskin <jyasskin@google.com>
8961
8962 * symtab.cc (detect_odr_violations): When reporting an ODR
8963 violation, report an object where the symbol is defined.
8964
8a75a161
DK
89652010-06-25 Doug Kwan <dougkwan@google.com>
8966
8967 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
8968 (Target_arm::section_may_have_icf_unsafe_pointers): New method
8969 definition.
8970 (Target_arm::Scan::local_reloc_may_be_function_pointer,
8971 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
8972 target hook to detect function points.
8973 (Target_arm::Scan::possible_function_pointer_reloc): New method.
8974 * icf.h (Icf::check_section_for_function_pointers): Change type of
8975 parameter SECTION_NAME to const reference to std::string. Use
8976 target hook to determine if section may have unsafe pointers.
8977 * target.h (Target::section_may_have_icf_unsafe_pointers): New
8978 method definition.
8979
42218b9f
RÁE
89802010-06-21 Rafael Espindola <espindola@google.com>
8981
8982 * fileread.cc (Input_file::find_fie): New
8983 (Input_file::open): Use Input_file::find_fie.
8984 * fileread.h (Input_file::find_fie): New
8985 * plugin.cc (set_extra_library_path): New.
8986 (Plugin::load): Add set_extra_library_path to the transfer vector.
8987 (Plugin_manager::set_extra_library_path): New.
8988 (Plugin_manager::add_input_file): Use the extra search path if set.
8989 (set_extra_library_path(): New.
8990 * plugin.h (Plugin_manager): Add set_extra_library_path and
8991 extra_search_path_.
8992
a0506cca
CC
89932010-06-19 Cary Coutant <ccoutant@google.com>
8994
8995 * layout.cc (gdb_sections): Add .debug_types.
8996 (lines_only_debug_sections): Likewise.
8997
6508b958
RÁE
89982010-06-18 Rafael Espindola <espindola@google.com>
8999
9000 * plugin.cc (add_input_file,add_input_library)
9001 (Plugin_manager::add_input_file): Make filename arguments const.
9002 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
9003 const.
9004
3e235302
DK
90052010-06-16 Doug Kwan <dougkwan@google.com>
9006
9007 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
9008 .ARM.attributes section if we have not merged any input
9009 attributes sections.
9010
106e8a6c
DK
90112010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9012
9013 * arm.cc: Allow combining objects with no EABI version
9014 information.
9015
91ff43fe
RÁE
90162010-06-15 Rafael Espindola <espindola@google.com>
9017
9018 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
9019
68ed838c
ILT
90202010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9021
9022 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
9023 (struct iovec): Correct !HAVE_READV definition.
9024
f3a2388f
CC
90252010-06-10 Cary Coutant <ccoutant@google.com>
9026
9027 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
9028 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
9029 reloc sections.
9030 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
9031
9032 PR 11683
9033 * symtab.h (Symbol::is_placeholder): New member function.
9034 * target-reloc.h (relocate_section): Check for placeholder symbols.
9035
9036 * testsuite/Makefile.am (plugin_test_8): New test.
9037 (plugin_test_9): New test.
9038 * testsuite/Makefile.in: Regenerate.
9039
e1df38aa
NC
90402010-06-09 Nick Clifton <nickc@redhat.com>
9041
9042 * yyscript.y (input_list_element): Allow strings prefixed with
9043 the '-' character. Treat these as libraries.
9044 * script.cc (script_add_library): New function. Adds a library
9045 specified by "-l<name>" found in an input script.
9046 * script-c.h: Add prototype for script_add_library.
9047
25bbe950
DK
90482010-06-07 Doug Kwan <dougkwan@google.com>
9049
9050 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
9051 Restrict stub-group size to be within long conditional branch
9052 range when working around cortex-A8 erratum.
9053
0f32ea4c
ILT
90542010-06-07 Damien Diederen <dd@crosstwine.com>
9055
9056 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
9057 #ifdef typo.
9058
8fe2a369
ST
90592010-06-03 Sriraman Tallam <tmsriram@google.com>
9060
9061 PR gold/11658
9062 * output.cc
9063 (Output_section::Input_section_sort_entry::compare_section_ordering):
9064 Change to return non-zero correctly.
9065 (Output_section::Input_section_sort_section_order_index_compare
9066 ::operator()): Change to fix ambiguity in comparisons.
9067
6e9ba2ca
ST
90682010-06-01 Sriraman Tallam <tmsriram@google.com>
9069
9070 * gold.h (is_wildcard_string): New function.
9071 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
9072 (Layout::layout_eh_frame): Ditto.
9073 (Layout::find_section_order_index): New method.
9074 (Layout::read_layout_from_file): New method.
9075 * layout.h (Layout::find_section_order_index): New method.
9076 (Layout::read_layout_from_file): New method.
9077 (Layout::input_section_position_): New private member.
9078 (Layout::input_section_glob_): New private member.
9079 * main.cc (main): Call read_layout_from_file here.
9080 * options.h (--section-ordering-file): New option.
9081 * output.cc (Output_section::input_section_order_specified_): New
9082 member.
9083 (Output_section::Output_section): Initialize new member.
9084 (Output_section::add_input_section): Add new parameter.
9085 Keep input sections when --section-ordering-file is used.
9086 (Output_section::set_final_data_size): Sort input sections when
9087 section ordering file is specified.
9088 (Output_section::Input_section_sort_entry): Add new parameter.
9089 Check sorting type.
9090 (Output_section::Input_section_sort_entry::compare_section_ordering):
9091 New method.
9092 (Output_section::Input_section_sort_compare::operator()): Change to
9093 consider section_order_index.
9094 (Output_section::Input_section_sort_init_fini_compare::operator()):
9095 Change to consider section_order_index.
9096 (Output_section::Input_section_sort_section_order_index_compare
9097 ::operator()): New method.
9098 (Output_section::sort_attached_input_sections): Change to sort
9099 according to section order when specified.
e1df38aa
NC
9100 (Output_section::add_input_section<32, true>): Add new parameter.
9101 (Output_section::add_input_section<64, true>): Add new parameter.
9102 (Output_section::add_input_section<32, false>): Add new parameter.
9103 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
9104 * output.h (Output_section::add_input_section): Add new parameter.
9105 (Output_section::input_section_order_specified): New
9106 method.
9107 (Output_section::set_input_section_order_specified): New method.
9108 (Input_section::Input_section): Initialize section_order_index_.
9109 (Input_section::section_order_index): New method.
9110 (Input_section::set_section_order_index): New method.
9111 (Input_section::section_order_index_): New member.
9112 (Input_section::Input_section_sort_section_order_index_compare): New
9113 struct.
9114 (Output_section::input_section_order_specified_): New member.
9115 * script-sections.cc (is_wildcard_string): Delete and move modified
9116 method to gold.h.
9117 (Output_section_element_input::Output_section_element_input): Modify
9118 call to is_wildcard_string.
9119 (Output_section_element_input::Input_section_pattern
9120 ::Input_section_pattern): Ditto.
9121 (Output_section_element_input::Output_section_element_input): Ditto.
9122 * testsuite/Makefile.am (final_layout): New test case.
9123 * testsuite/Makefile.in: Regenerate.
9124 * testsuite/final_layout.cc: New file.
9125 * testsuite/final_layout.sh: New file.
9126
3537c84b
RÁE
91272010-06-01 Rafael Espindola <espindola@google.com>
9128
9129 * plugin.cc (Plugin::load): Pass the output name to the plugin.
9130
105b6afd
RÁE
91312010-06-01 Rafael Espindola <espindola@google.com>
9132
9133 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
9134 visibility of symbols.
9135
29e11421
DK
91362010-05-27 Doug Kwan <dougkwan@google.com>
9137
9138 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
9139 from start of output section instead of address for a local symbol
9140 in a merged or relaxed section when doing a relocatable link.
9141
5e0f337e
RÁE
91422010-05-26 Rafael Espindola <espindola@google.com>
9143
703d02da 9144 PR 11604
5e0f337e
RÁE
9145 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
9146 adding sections the garbage collector removed.
9147 * gold/testsuite/Makefile.am: Add test.
9148 * gold/testsuite/Makefile.in: Regenerate.
9149 * gold/testsuite/plugin_test_7.sh: New.
9150 * gold/testsuite/plugin_test_7_1.c: New.
9151 * gold/testsuite/plugin_test_7_2.c: New.
9152
f4187277
RÁE
91532010-05-26 Rafael Espindola <espindola@google.com>
9154
9155 * script-sections.cc (Output_section_definition::set_section_addresses):
9156 Check for --section-start.
9157
5c388529
DK
91582010-05-26 Doug Kwan <dougkwan@google.com>
9159
9160 * arm.cc (Arm_scan_relocatable_relocs): New class.
9161 (Target_arm::relocate_special_relocatable): New method.
9162 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
9163 (Arm_relocate_functions::thumb_branch_common): Same.
9164 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
9165 instead of Default_scan_relocatable_relocs.
9166 * target-reloc.h (relocate_for_relocatable): Let target handle
9167 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
9168 * target.h (Sized_target::relocate_special_relocatable): New method.
9169
bca1c3ae
ILT
91702010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9171
9172 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
9173
0439c796
DK
91742010-05-23 Doug Kwan <dougkwan@google.com>
9175
9176 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
9177 instead of a cast.
9178 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
9179 with a direct branch, not a conditional branch, to a stub.
9180 * merge.cc (Output_merge_base::record_input_section): New method
9181 defintion.
9182 (Output_merge_data::do_add_input_section): Record input section if
9183 keeps-input-sections flag is set.
9184 (Output_merge_string::do_add_input_section): Ditto.
9185 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
9186 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
9187 INPUT_SECTIONS_.
9188 (Output_merge_base::keeps_input_sections,
9189 Output_merge_base::set_keeps_input_sections,
9190 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
9191 method definitions.
9192 (Output_merge_base::Input_sections): New type declaration.
9193 (Output_merge_base::input_sections_begin,
9194 Output_merge_base::input_sections_end,
9195 Output_merge_base::do_set_keeps_input_sections): New method definitions.
9196 (Output_merge_base::bool keeps_input_sections_,
9197 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
9198 Output_merge_base::input_sections_): New data members.
9199 (Output_merge_data::do_set_keeps_input_sections): New method
9200 defintion.
9201 (Output_merge_string::do_set_keeps_input_sections): Ditto.
9202 * output.cc (Output_section::Input_section::relobj): Move method
9203 defintion from class declaration to here and handle merge sections.
9204 (Output_section::Input_section::shndx): Ditto.
9205 (Output_section::Output_section): Remove initializations of removed
9206 data members and initialize new data member LOOKUP_MAPS_.
9207 (Output_section::add_input_section): Set keeps-input-sections flag
9208 for a newly created merge output section as appropriate. Adjust code
9209 to use Output_section_lookup_maps class.
9210 (Output_section::add_relaxed_input_section): Adjst code for lookup
9211 maps code refactoring.
2e702c99 9212 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
9213 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
9214 class. If adding input section to a newly created merge output
9215 section fails, remove the new merge section.
9216 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 9217 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 9218 (Output_section::find_merge_section): Ditto.
0439c796 9219 (Output_section::build_lookup_maps): New method defintion.
2e702c99 9220 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
9221 Output_section_lookup_maps class.
9222 (Output_section::get_input_sections): Export merge sections. Adjust
9223 code to use Output_section_lookup_maps class.
9224 (Output_section:::add_script_input_section): Adjust code to use
9225 Output_section_lookup_maps class. Update lookup maps for merge
9226 sections also.
9227 (Output_section::discard_states): Use Output_section_lookup_maps.
9228 (Output_section::restore_states): Same.
9229 * output.h (Merge_section_properties): Move class defintion out of
9230 Output_section.
9231 (Output_section_lookup_maps): New class.
9232 (Output_section::Input_section::is_merge_section): New method
9233 defintion.
9234 (Output_section::Input_section::relobj): Move defintion out of class
9235 defintion. Declare method only.
9236 (Output_section::Input_section::shndx): Ditto.
9237 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 9238 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
9239 (Output_section::Merge_section_by_properties_map,
9240 Output_section::Output_section_data_by_input_section_map,
9241 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
9242 Remove types.
2e702c99 9243 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
9244 KEEPS_INPUT_SECTIONS.
9245 (Output_section::build_lookup_maps): New method declaration.
9246 (Output_section::merge_section_map_,
9247 Output_section::merge_section_by_properties_map_,
9248 Output_section::relaxed_input_section_map_,
9249 Output_section::is_relaxed_input_section_map_valid_): Remove data
9250 members.
9251 (Output_section::lookup_maps_): New data member.
9252
76295588
L
92532010-05-21 Doug Kwan <dougkwan@google.com>
9254
9255 PR gold/11619
9256 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
9257 avoid a compilation error.
9258
d103a984
RÁE
92592010-05-19 Rafael Espindola <espindola@google.com>
9260
9261 * script-sections.cc (Output_section_definition::allocate_to_segment):
9262 Update the phdrs_list even when the output section is NULL.
9263 * testsuite/Makefile.am: Add test.
9264 * testsuite/Makefile.in: Regenerate.
9265 * testsuite/script_test_9.cc: New.
9266 * testsuite/script_test_9.sh: New.
9267 * testsuite/script_test_9.t: New.
9268
6625d24e
DK
92692010-05-19 Doug Kwan <dougkwan@google.com>
9270
9271 * arm.cc (Arm_input_section::original_size): New method.
9272 (Arm_input_section::do_addralign): Add a cast.
9273 (Arm_input_section::do_output_offset): Remove static cast.
9274 (Arm_input_section::original_addralign,
9275 Arm_input_section::original_size_): Change type to uint32_t.
9276 (Arm_input_section::init): Add safe casts for section alignment
9277 and size.
9278 (Arm_input_section::set_final_data_size): Do not set address and
9279 offset of stub table.
9280 (Arm_output_section::fix_exidx_coverage): Change use of of
9281 Output_section::Simple_input_section to that of
9282 Output_section::Input_section.
9283 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
9284 except for the first pass.
9285 * output.cc (Output_section::get_input_sections): Change type of
9286 input_sections to std::list<Input_section>.
9287 (Output_section::add_script_input_section): Rename from
9288 Output_section::add_simple_input_section. Change type of SIS
9289 parameter from Simple_input_section to Input_section.
9290 * output.h (Output_section::Simple_input_section): Remove class.
9291 (Output_section::Input_section): Change class visibility to public.
9292 (Output_section::Input_section::addralign): Use stored alignments
9293 for special input sections if set.
9294 (Output_section::Input_section::set_addralign): New method.
9295 (Output_section::get_input_sections): Change parameter type from
9296 list of Simple_input_section to list of Input_section.
9297 (Output_section::add_script_input_section): Rename from
9298 Output_section::add_simple_input_section. Change first parameter's
9299 type from Simple_input_section to Input_section and remove the
9300 second and third parameters.
9301 * script-sections.cc (Input_section::Input_section_list): Change
9302 type to list of Output_section::Input_section/
9303 (Input_section_info::Input_section_info): Change parameter type of
9304 INPUT_SECTION to Output_section::Input_section.
9305 (Input_section_info::input_section): Change return type.
9306 (Input_section_info::input_section_): Change type to
9307 Output_section::Input_section.
9308 (Output_section_element_input::set_section_addresses): Adjust code
9309 to use Output_section::Input_section instead of
9310 Output_section::Simple_input_section. Adjust code for renaming
9311 of Output_section::add_simple_input_section.
9312 (Orphan_output_section::set_section_addresses): Ditto.
9313
e1e82ea4
RW
93142010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9315
9316 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
9317 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
9318
91e75c8a
RÁE
93192010-05-18 Rafael Espindola <espindola@google.com>
9320
9321 * options.cc (General_options::finalize): Handle -nostdlib.
9322 * options.h (nostdlib): New option.
9323 * script.cc (script_add_search_dir): Handle -nostdlib.
9324
da59ad79
DK
93252010-05-12 Doug Kwan <dougkwan@google.com>
9326
9327 * arm.cc (Target_arm::do_finalize_sections): Create an empty
9328 attributes section only if there no attributes section after merging.
9329 (Target_arm::merge_object_attributes): Move value of
e1df38aa 9330 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
9331 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
9332 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
9333 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
9334 and arm_attr_merge_7.stdout.
9335 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
9336 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
9337 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
9338 arm_attr_merge_7b.o): New rules.
9339 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
9340 arm_attr_merge_7
9341 * testsuite/Makefile.in: Regenerate.
9342 * testsuite/arm_attr_merge.sh: New file.
9343 * testsuite/arm_attr_merge_[67][ab].s: Same.
9344
3e01a7fd
NC
93452010-05-05 Nick Clifton <nickc@redhat.com>
9346
9347 * po/es.po: Updated Spanish translation.
9348
7ad2014a
L
93492010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9350
9351 * Makefile.am (install-exec-local): Properly install gold as
9352 default cross linker.
9353 * Makefile.in: Regenerated.
9354
4fda8867
NC
93552010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9356 Nick Clifton <nickc@redhat.com>
9357
9358 * configure.ac (install_as_default): Define and set to false
9359 unless --enable-gold or --enable-gold=both/gold has been
9360 specified.
9361 * configure: Regenerate.
9362
9363 * Makefile.am (install-exec-local): Install the executable as
9364 'ld.gold'. If install_as_default is true then also install it as
9365 'ld'.
9366 * Makefile.in: Regenerated.
9367
bd288ea2
ILT
93682010-04-24 Ian Lance Taylor <iant@google.com>
9369
9370 * layout.cc (Layout::layout_reloc): In relocatable link don't
9371 combine reloc sections for grouped sections.
9372
ef38fd8a
ST
93732010-04-23 Sriraman Tallam <tmsriram@google.com>
9374
9375 * gc.h (gc_process_relocs): Pass information on relocs pointing to
9376 sections that are not ordinary to icf.
9377 * icf.cc (get_section_contents): Handle relocation pointing to section
9378 with no object or shndx information.
9379 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
9380 * testsuite/Makefile.in: Regenerate.
9381 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
9382 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
9383
f6973bdc
ILT
93842010-04-22 Ian Lance Taylor <iant@google.com>
9385
9386 * expression.cc (Expression::Expression_eval_info): Add
9387 result_alignment_pointer field.
9388 (Expression::eval_with_dot): Add result_alignment_pointer
9389 parameter. Change all callers.
9390 (Expression::eval_maybe_dot): Likewise.
9391 (class Binary_expression): Add alignment_pointer parameter to
9392 left_value and right_value. Change all callers.
9393 (BINARY_EXPRESSION): Set result alignment.
9394 (class Trinary_expression): Add alignment_pointer parameter to
9395 arg2_value and arg3_value. Change all callers.
9396 (Trinary_cond::value): Set result alignment.
9397 (Max_expression::value, Min_expression::value): Likewise.
9398 (Align_expression::value): Likewise.
9399 * script-sections.cc (class Sections_element): Add dot_alignment
9400 parameter to set_section_addresses virtual function. Update
9401 instantiations.
9402 (class Output_section_element): Likewise.
9403 (Script_sections::create_segments): Add dot_alignment parameter.
9404 Change all callers.
9405 (Script_sections::create_segments_from_phdrs_clause): Likewise.
9406 (Script_sections::set_phdrs_clause_addresses): Likewise.
9407 * script-sections.h: Update declarations.
9408 * script.h: Update declarations.
9409 * output.h (Output_segment::set_minimum_p_align): Don't decrease
9410 min_p_align.
9411 * testsuite/script_test_3.t: Set large alignment.
9412 * testsuite/script_test_3.sh: Make sure that at least one LOAD
9413 segment has expected alignment.
9414
9c9c98a5
NC
94152010-04-22 Nick Clifton <nickc@redhat.com>
9416
9417 * po/gold.pot: Updated by the Translation project.
9418 * po/vi.po: Updated Vietnamese translation.
9419
2253bfba
L
94202010-04-22 H.J. Lu <hongjiu.lu@intel.com>
9421
9422 * testsuite/Makefile.am (check_PROGRAMS): Add
9423 icf_virtual_function_folding_test.
9424 * testsuite/Makefile.in: Regenerated.
9425
85fdf906
AH
94262010-04-15 Andrew Haley <aph@redhat.com>
9427
9428 * options.h (merge_exidx_entries): New option.
9429 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
9430 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
9431 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
9432 (Target_arm::merge_exidx_entries): New function.
9433 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
9434 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
9435 to Arm_exidx_fixup constructor.
9436 Add new arg, merge_exidx_entries.
9437 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
9438 Arm_output_section::fix_exidx_coverage.
9439
ce97fa81
ST
94402010-04-18 Sriraman Tallam <tmsriram@google.com>
9441
9442 * icf.cc (get_section_contents): Check for preemptible functions.
9443 Ignore addend when appropriate.
9444 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
9445 section folded.
9446 (add_from_relobj): Check for section folded.
9447 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
9448 * symtab.h (should_add_dynsym_entry): Add new parameter.
9449 * target-reloc.h (scan_relocs): Check for section folded.
9450 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
9451 Check reloc types for function pointers in shared objects.
9452 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
9453 case.
9454 (icf_preemptible_functions_test): New test case.
9455 (icf_string_merge_test): New test case.
9456 * testsuite.Makefile.in: Regenerate.
9457 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
9458 bar_glob. Refactor code.
9459 * testsuite/icf_preemptible_functions_test.cc: New file.
9460 * testsuite/icf_preemptible_functions_test.sh: New file.
9461 * testsuite/icf_string_merge_test.cc: New file.
9462 * testsuite/icf_string_merge_test.sh: New file.
9463 * testsuite/icf_virtual_function_folding_test.cc: New file.
9464 * testsuite/icf_virtual_function_folding_test.sh: New file.
9465
04ceb17c
DK
94662010-04-14 Doug Kwan <dougkwan@google.com>
9467
9468 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
9469 for local symbol recounting if we remove a section due to ICF.
9470 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
9471 there are no regular objects in input.
9472
153e7da4
DK
94732010-04-13 Doug Kwan <dougkwan@google.com>
9474
9475 * arm.cc (Arm_input_section::set_final_data_size): Compute
9476 accurate final data size instead of using current data size.
9477
4dbd9faf
DK
94782010-04-09 Doug Kwan <dougkwan@google.com>
9479
9480 * layout.cc (Layout::choose_output_section): Handle script section
9481 types.
9482 (Layout::make_output_section_for_script): Add section type parameter.
9483 Handle script section types.
9484 * layout.h (Layout::make_output_section_for_script): Add section
9485 type parameter.
9486 * output.cc (Output_section::Output_section): Initialize data member
9487 is_noload_.
9488 (Output_section::do_reset_address_and_file_offset): Do not set address
9489 to 0 if section is a NOLOAD section.
9490 * output.h (Output_section::is_noload): New method.
9491 (Output_section::set_is_noload): Ditto.
9492 (Output_section::is_noload_): New data member.
9493 * script-c.h (Script_section_type): New enum type.
9494 (struct Parser_output_section_header): Add new file section_type.
9495 * script-sections.cc (Sections_element::output_section_name): Add
9496 parameter for returning script section type.
9497 (Output_section_definition::output_section_name): Ditto.
9498 (Output_section_definition::section_type)P; New method.
9499 (Output_section_definiton::script_section_type_name): Ditto.
9500 (Output_section_definition::script_section_type_): New data member.
9501 (Output_section_definition::Output_section_definition): Initialize
9502 data member Output_section_definition::script_section_type_.
9503 (Output_section_definition::create_sections): Pass script section type
9504 to Layout::make_output_section_for_script.
9505 (Output_section_definition::output_section_name): Return script
9506 section type to caller.
9507 (Output_section_definition::set_section_address): Do not advance
9508 dot value and load address if section type is NOLOAD. Set address
9509 of NOLOAD sections regardless of section flags.
9510 (Output_section_definition::print): Print section type if it is
9511 not SCRIPT_SECTION_TYPE_NONE.
9512 (Output_section_definition::section_type): New method.
9513 (Output_section_definition::script_section_type_name): Ditto.
9514 (Script_sections::output_section_name): Add new parameter
9515 PSECTION_TYPE for returning script section type. Pass it to
9516 section elements. Handle discard sections.
9517 (Sort_output_sections::operator()): Handle NOLOAD sections.
9518 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 9519 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
9520 returning script section type.
9521 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
9522 INFO and NOLOAD.
9523 * yyscript.y (union): Add new field SECTION_TYPE.
9524 (COPY, DSECT, INFO, NOLOAD): New tokens.
9525 (opt_address_and_section_type): Change type to output_section_header.
9526 (section_type): New non-terminal
9527 (section_header): Handle section type.
2253bfba 9528 (opt_address_and_section_type): Return section type value.
4dbd9faf 9529
721ea635
L
95302010-04-09 H.J. Lu <hongjiu.lu@intel.com>
9531
9532 * testsuite/plugin_common_test_1.c (foo): Add prototype.
9533 * testsuite/plugin_common_test_2.c (foo): Likewise.
9534
6bf924b0
DK
95352010-04-08 Doug Kwan <dougkwan@google.com>
9536
9537 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
9538 Output_merge_data.
9539 * output.cc (Output_section::add_merge_input_section): Simplify
9540 code and return status of Output_merge_base::add_input_section.
e1df38aa 9541 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
9542 returns true.
9543
24af6f92
DK
95442010-04-07 Doug Kwan <dougkwan@google.com>
9545
9546 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
9547 if section is marked as containing instructions but has no mapping
9548 symbols.
9549 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
9550 correct section index.
9551 (Arm_relobj::find_linked_text_section): Ditto.
9552
00698fc5
CC
95532010-04-07 Cary Coutant <ccoutant@google.com>
9554
9555 * archive.cc (include_member): Destroy Read_symbols_data object before
9556 releasing file.
9557 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
9558 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
9559 (Read_symbols_data::~Read_symbols_data) New destructor.
9560 (Section_relocs::Section_relocs) New constructor.
9561 (Section_relocs::~Section_relocs) New destructor.
9562 (Read_relocs_data::Read_relocs_data) New constructor.
9563 (Read_relocs_data::~Read_relocs_data) New destructor.
9564 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
9565 pointers to NULL after deleting.
9566
7296d933
DK
95672010-04-07 Doug Kwan <dougkwan@google.com>
9568
9569 * arm.cc: Replace "endianity" with "endianness" in comments.
9570 (Arm_exidx_cantunwind): Ditto.
9571 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
9572 (Arm_relobj::merge_flags_and_attributes): New method.
9573 (Arm_relobj::merge_flags_and_attributes_): New data member.
9574 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
9575 (Arm_relobj::scan_sections_for_stubs): Ditto.
9576 (Arm_relobj::do_read_symbols): Check to see if we really want to
9577 merge processor-specific flags and attributes. Exit early if
9578 an object is empty except for section names and the undefined symbol.
9579 (Target_arm::do_finalize_sections): Move check for ELF format to
9580 Arm_relobj::do_read_symbols. Merge processor specific flags and
9581 attributes from a regular object only when we have determined that
9582 it is aapropriate. Do not create an .ARM.attributes section in
9583 output if there is no regular input object.
9584 (Target_arm::merge_processor_specific_flags): Check
9585 --warn-mismatch before printing any error.
9586 (Target_arm::merge_object_attributes): Ditto.
9587 * gold.cc (queue_middle_tasks): Handle the case in which there is
9588 no regular object in input.
9589 * options.cc (General_options::parse_EB): New method.
9590 (General_options::parse_EL): Same.
9591 (General_options::General_options): Initialize endianness_.
9592 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
9593 New options.
9594 (General_options::Endianness): New enum.
9595 (General_options::endianness): New method.
9596 (General_options::endianness_): New data member.
9597 * parameters.cc (Parameters::set_options): Check target endianness.
9598 (Parameters::set_target_once): Ditto.
9599 (Parameters::check_target_endianness): New method.
9600 (parameters_force_valid_target): If either -EL or -EB is specified,
9601 use it to define endianness of default target.
9602 * parameters.h (Parameters::check_target_endianness): New method
9603 declaration.
9604 * target.h (class Target): Change "endianity" to "endianness"
9605 in comments.
9606
efc8d4f2
RW
96072010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9608
9609 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
9610 * configure: Regenerate.
9611 * Makefile.in: Regenerate.
9612 * testsuite/Makefile.in: Regenerate.
9613
be234d88
CC
96142010-04-06 Cary Coutant <ccoutant@google.com>
9615
9616 gcc PR lto/42757
9617 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
9618 prevailing definitions of common symbols.
9619 * testsuite/plugin_test_6.sh: New test case.
9620 * testsuite/plugin_common_test_1.c: New test case.
9621 * testsuite/plugin_common_test_2.c: New test case.
9622 * testsuite/Makefile.am (plugin_test_6): New test case.
9623 * testsuite/Makefile.in: Regenerate.
9624
bd32c6bd
NC
96252010-04-06 Nick Clifton <nickc@redhat.com>
9626
9627 * po/vi.po: New Vietnamese translation.
9628
323c532f
DK
96292010-03-30 Doug Kwan <dougkwan@google.com>
9630
9631 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
9632
4fcd97eb
DK
96332010-03-25 Doug Kwan <dougkwan@google.com>
9634
9635 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
9636 to avoid a conversion warning on a 32-bit host.
9637
4ebf39db
ILT
96382010-03-24 Ian Lance Taylor <iant@google.com>
9639
9640 * testsuite/script_test_3.t: Add a TLS segment.
9641 * testsuite/Makefile.am (check_PROGRAMS): Add
9642 tls_phdrs_script_test.
9643 (tls_phdrs_script_test_SOURCES): Define.
9644 (tls_phdrs_script_test_DEPENDENCIES): Define.
9645 (tls_phdrs_script_test_LDFLAGS): Define.
9646 (tls_phdrs_script_test_LDADD): Define.
9647 * testsuite/Makefile.in: Rebuild.
9648
4a599bdd
CC
96492010-03-23 Cary Coutant <ccoutant@google.com>
9650
9651 * fileread.cc (find_or_make_view): Fix comment.
9652
6c93b22c
ILT
96532010-03-23 Ian Lance Taylor <iant@google.com>
9654
9655 * script-sections.cc (class Orphan_section_placement): Define
9656 PLACE_TLS and PLACE_TLS_BSS.
9657 (Orphan_section_placement::Orphan_section_placement): Initialize
9658 new places.
9659 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
9660 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
9661 (tls_script_test_SOURCES): Define.
9662 (tls_script_test_DEPENDENCIES): Define.
9663 (tls_script_test_LDFLAGS): Define.
9664 (tls_script_test_LDADD): Define.
9665 * testsuite/Makefile.in: Rebuild.
9666
a2c7281b
DK
96672010-03-22 Doug Kwan <dougkwan@google.com>
9668
9669 * arm.cc (Arm_relocate_functions::abs8,
9670 Arm_relocate_functions::abs16): Use correct check for overflow
9671 specified in the ARM ELF specs.
9672 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
9673 target of a BLX instruction specially.
9674 (Reloc_stub::stub_type_for_reloc): Ditto.
9675 (Relocate::relocate): Use symbolic names instead of numeric relocation
9676 codes to report error.
9677 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
9678 workaround.
9679 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
9680 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
9681 thumb2_blx_out_of_range.stdout
9682 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
9683 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
9684 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
9685 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
9686 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
9687 thumb2_blx_in_range, thumb2_blx_in_range.o,
9688 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
9689 thumb2_blx_out_of_range.o): New rules.
2e702c99 9690 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
9691 thumb2_blx_in_range and thumb2_blx_out_of_range.
9692 * testsuite/Makefile.in: Regenerate.
9693 * arm_branch_in_range.sh: Add tests for THUMB BLX.
9694 * testsuite/thumb_blx_in_range.s: New file.
9695 * testsuite/thumb_blx_out_of_range.s: New file.
9696
b0193076
RÁE
96972010-03-22 Rafael Espindola <espindola@google.com>
9698
9699 * archive.cc (Should_include): Move to archive.h.
9700 (should_include_member): Make it a member of Archive.
9701 (Lib_group): New.
9702 (Add_lib_group_symbols): New.
9703 * archive.h: Include options.h.
9704 (Archive_member): Moved from Archive.
9705 (Should_include): Moved from archive.cc.
9706 (Lib_group): New.
9707 (Add_lib_group_symbols): New.
9708 * dynobj.cc (do_should_include_member): New.
9709 * dynobj.h (do_should_include_member): New.
9710 * gold.cc (queue_initial_tasks): Update call to queue.
9711 * main.cc (main): Print lib group stats.
9712 * object.cc (do_should_include_member): New.
9713 * object.h: Include archive.h.
9714 (Object::should_include_member): New.
9715 (Object::do_should_include_member): New.
9716 (Sized_relobj::do_should_include_member): New.
9717 * options.cc (General_options::parse_start_lib): New.
9718 (General_options::parse_end_lib): New.
9719 (Input_arguments::add_file): Handle lib groups.
9720 (Input_arguments::start_group): Check we are not in a lib.
9721 (Input_arguments::start_lib): New.
9722 (Input_arguments::end_lib): New.
9723 * options.h (General_options): Add start_lib and end_lib.
9724 (Input_argument::lib_): New.
9725 (Input_argument::lib): New.
9726 (Input_argument::is_lib): New.
9727 (Input_file_lib): New.
9728 (Input_arguments::in_lib_): New.
9729 (Input_arguments::in_lib): New.
9730 (Input_arguments::start_lib): New.
9731 (Input_arguments::end_lib_): New.
9732 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
9733 in unused members as preempted.
9734 (Sized_pluginobj::do_should_include_member): New.
9735 * plugin.h (Sized_pluginobj::do_should_include_member): New.
9736 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
9737 return the blocker.
9738 (Read_symbols::do_whole_lib_group): New.
9739 (Read_symbols::do_lib_group): New.
9740 (Read_symbols::do_read_symbols): Handle lib groups.
9741 (Read_symbols::get_name): Handle lib groups.
9742 * readsyms.h (Read_symbols): Add an archive member pointer.
9743 (Read_symbols::do_whole_lib_group): New.
9744 (Read_symbols::do_lib_group): New.
9745 (Read_symbols::member_): New.
9746 * script.cc (read_input_script): Update call to queue_soon.
9747
d099120c
DK
97482010-03-19 Doug Kwan <dougkwan@google.com>
9749
9750 * arm.cc (Stub_table::Stub_table): Initialize new data members
9751 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9752 (Stub_table::add_reloc_stub): Assign stub offset and update
9753 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9754 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
9755 New data members.
2e702c99 9756 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
9757 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
9758 instead of going over all reloc stubs.
2e702c99 9759 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
9760 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9761 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 9762 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
9763 Stringpool_template::offset_.
9764 * stringpool.h (Stringpool_template::set_no_zero_null): Set
9765 Stringpool_template::offset_ to zero.
9766
1aa37384
DK
97672010-03-15 Doug Kwan <dougkwan@google.com>
9768
9769 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9770 offset_.
9771 (Stringpool_template::new_key_offset): New method.
9772 (Stringpool_template::add_string): Assign offsets when adding new
9773 strings.
9774 (Stringpool_template::set_string_offsets): Do not set string offsets
9775 when not optimizing.
9776 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
9777 member size_.
2e702c99
RM
9778 (Chunked_vector::clear): Clear size_.
9779 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
9780 (Chunked_vector::size): Return size_.
9781 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 9782 (Chunked_vector::size_): New data member.
1aa37384
DK
9783 (Stringpool_template::set_no_zero_null): Assert string set is empty.
9784 (Stringpool_template::new_key_offset): New method declaration.
9785 (Stringpool_template::offset_): New data member.
9786
b672b057
RÁE
97872010-03-15 Rafael Espindola <espindola@google.com>
9788
9789 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
9790 Add_symbols' constructor.
9791 * readsyms.h (Add_symbols): Remove the input_group member.
9792
b6848d3c
ILT
97932010-03-10 Ian Lance Taylor <iant@google.com>
9794
9795 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
9796 target to ask whether a reference to a symbol requires a stack
9797 split.
9798 * target.h (Target::is_call_to_non_split): New function.
9799 (Target::do_is_call_to_non_split): Declare virtual function.
9800 * target.cc: Include "symtab.h".
9801 (Target::do_is_call_to_non_split): New function.
9802 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
9803
a2a5469e
CC
98042010-03-10 Cary Coutant <ccoutant@google.com>
9805
9806 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
9807 (File_read::open[1]): Remove initial mapping of whole_file_view_.
9808 (File_read::open[2]): Add whole_file_view_ to list of views.
9809 (File_read::make_view): Remove test of whole_file_view_.
9810 (File_read::find_or_make_view): Create whole_file_view_ if
9811 necessary.
9812 (File_read::clear_views): Replace bool parameter with enum;
9813 adjust all callers. Don't delete views with permanent data;
9814 do delete cached views and views from archives if
9815 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
9816 if clearing the corresponding view.
9817 * fileread.h (File_read::Clear_views_mode): New enum.
9818 (File_read::View::is_permanent_view): New method.
9819 (File_read::clear_views): Replace bool parameter
9820 with enum; adjust all callers.
9821 * options.h (General_options): Change keep_files_mapped option;
9822 add map_whole_files.
9823 * readsyms.cc (Add_symbols::run): Delete sd_ object before
9824 releasing the file.
9825 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
9826 the file.
9827
8861f32b
DM
98282010-03-10 David S. Miller <davem@davemloft.net>
9829
9830 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
9831
d62d0f5f
ST
98322010-03-09 Sriraman Tallam <tmsriram@google.com>
9833
9834 * icf.cc (get_section_contents): Add '@' marker after processing the
9835 merge reloc.
9836
9177756d
DK
98372010-03-08 Doug Kwan <dougkwan@google.com>
9838
9839 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
9840 due to a conversion warning.
9841 (Arm_relobj::update_output_local_symbol_count): Check for local
9842 symbol with unset output index.
9843
9e9e071b
ILT
98442010-03-05 Ian Lance Taylor <iant@google.com>
9845
9846 * options.h (class General_options): Add --spare-dynamic-tags.
9847 * output.cc (Output_data_dynamic::set_final_data_size): Implement
9848 --spare-dynamic-tags.
9849
a81ee015
ILT
98502010-03-05 Ian Lance Taylor <iant@google.com>
9851
9852 * incremental.cc: Include "libiberty.h".
9853
44ec90b9
RO
98542010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
9855
9856 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
9857 function, is_info_ member.
9858 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
9859 (Versions::Versions): Update caller.
9860 (Versions::define_base_version): Likewise.
9861 (Versions::add_def): Likewise.
9862
0897ed3b
ST
98632010-03-03 Sriraman Tallam <tmsriram@google.com>
9864
9865 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
9866 (Scan::possible_function_pointer_reloc): New function.
9867 (Scan::local_reloc_may_be_function_pointer): Change to call
9868 possible_function_pointer_reloc.
9869 (Scan::global_reloc_may_be_function_pointer): Ditto.
9870 * icf.h (Icf::check_section_for_function_pointers): Change to reject
9871 relocations in ".data.rel.ro._ZTV" section.
9872 * testsuite/icf_safe_so_test.sh: Change to pass i386.
9873 * testsuite/icf_safe_so_test.cc: Ditto.
9874 * testsuite/icf_safe_test.cc: Ditto.
9875 * testsuite/icf_safe_test.sh: Ditto.
9876
d3bbad62
ILT
98772010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9878 Ian Lance Taylor <iant@google.com>
9879
9880 * target-reloc.h (relocate_section): Check the symbol table index
9881 for -1U before setting the local symbol index.
9882 (scan_relocatable_relocs): If copying the relocation, record that
9883 the local symbol is required.
9884 * object.h (Symbol_value::is_output_symtab_index_set): New
9885 function.
9886 (Symbol_value::may_be_discarded_from_output_symtab): New
9887 function.
9888 (Symbol_value::has_output_symtab_entry): New function.
9889 (Symbol_value::needs_output_symtab_entry): Remove.
9890 (Symbol_value::output_symtab_index): Make sure the symbol index is
9891 set.
9892 (Symbol_value::set_output_symtab_index): Make sure the symbol
9893 index is not set. Make sure the new index is valid.
9894 (Symbol_value::set_must_have_output_symtab_entry): New function.
9895 (Symbol_value::has_output_dynsym_entry): New function.
9896 (Symbol_value::set_output_dynsym_index): Make sure the new index
9897 is valid.
9898 (Sized_relobj::set_must_have_output_symtab_entry): New function.
9899 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
9900 local symbol if permitted.
9901 (Sized_relobj::do_finalize_local_symbols): Call
9902 is_output_symtab_index_set rather than needs_output_symtab_entry.
9903 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
9904 rather than needs_output_symtab_entry. Call
9905 has_output_dynsym_entry rather than needs_output_dynsym_entry.
9906 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
9907 is_output_symtab_index_set rather than needs_output_symtab_entry.
9908 * testsuite/discard_locals_relocatable_test.c: New file.
9909 * testsuite/discard_locals_test.sh: Test -r.
9910 * testsuite/Makefile.am (check_DATA): Add
9911 discard_locals_relocatable_test1.syms,
9912 discard_local_relocatable_test2.syms.
9913 (MOSTLYCLEANFILES): Likewise. Also add
9914 discard_locals_relocatable_test1.lout and
9915 discard_locals_relocatable_test2.out.
9916 (discard_locals_relocatable_test1.syms): New target.
9917 (discard_locals_relocatable_test.o): New target.
9918 (discard_locals_relocatable_test1.out): New target.
9919 (discard_locals_relocatable_test2.syms): New target.
9920 (discard_locals_relocatable_test2.out): New target.
9921 (various): Add missing ../ld-new dependencies.
9922 * testsuite/Makefile.in: Rebuild.
9923
7e8ccf26
NC
99242010-03-03 Nick Clifton <nickc@redhat.com>
9925
9926 * po/fi.po: New Finnish translation.
9927
2a0ff005
DK
99282010-03-01 Doug Kwan <dougkwan@google.com>
9929
9930 * layout.cc (Layout::Layout): Force section types of .init_array*,
9931 .preinit_array* and .fini_array* sections.
9932 * output.cc (Output_section::Input_section_sort_entry::has_priority):
9933 Fix check of return value of std::string::find.().
9934 (Output_section::Input_section_sort_compare::operator()): Remove
9935 comment about .init_array.
9936 (Output_section::Input_section_sort_init_fini_compare::operator()):
9937 New method.
9938 (Output_section::sort_attached_input_sections): Handle .init_array
9939 and .fini_array specially.
9940 * output.h (Output_section::Inut_section_sort_compare): Update
9941 comment.
9942 (Output_section::Input_section_sort_init_fini_compare): New struct.
9943
c3e4ae29
DK
99442010-02-26 Doug Kwan <dougkwan@google.com>
9945
9946 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
9947 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
9948 * testsuite/debug_msg.sh: Avoid matching source line number for
9949 use of global variable undef_int.
9950
2fd9ae7a
DK
99512010-02-26 Doug Kwan <dougkwan@google.com>
9952
9953 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
9954 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
9955 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
9956 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
9957 * options.cc (General_options::General_options): Initialize member
9958 fix_v4bx_.
9959 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
9960 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
9961 and rm_no_fix_v4bx.stdout
9962 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
9963 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
9964 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
9965 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
9966 and arm_no_fix_v4bx.
9967 * Makefile.in: Regenerate.
9968 * testsuite/arm_fix_v4bx.s: New file.
9969 * testsuite/arm_fix_v4bx.sh: Ditto.
9970
67ec7d0b
DK
99712010-02-24 Doug Kwan <dougkwan@google.com>
9972
9973 * arm.cc (Target_arm::got_section): Make the .got section the first
9974 non RELRO section in the data segment.
9975 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
9976 suffixes of section names.
9977
10165461
DK
99782010-02-24 Doug Kwan <dougkwan@google.com>
9979
9980 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
9981 flags and attributes merging if an input file is a binary file.
9982 * fileread.cc (Input_file::open): Record format of original file.
9983 * fileread.h (Input_file::Format): New enum type.
2e702c99 9984 (Input_file::Input_file): Initialize data member format_.
10165461
DK
9985 (Input_file::format): New method definition.
9986 (Input_file::format_):: New data member.
9987
4a54abbb
DK
99882010-02-24 Doug Kwan <dougkwan@google.com>
9989
9990 * arm.cc (Arm_output_data_got): New class.
9991 (ARM_TCB_SIZE): New constant
9992 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
9993 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
9994 If user uses a script with a SECTIONS clause, issue only a warning
9995 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 9996 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
9997 garbage collection.
9998 (Target_arm::got_mode_index_entry): Handle static linking.
9999 (Target_arm::Scan::local): Ditto.
10000 (Target_arm::Scan::global): Ditto.
10001 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
10002 all incorrectly implemented relocations.
e1df38aa 10003 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
10004 Arm_output_section::fix_exidx_coverage.
10005 * layout.cc (Layout::section_name_mapping): Remove trailing dots
10006 from ".ARM.exidx." and ".ARM.extab.".
10007
ca419a6f
ILT
100082010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10009
10010 * arm.cc (Target_arm::do_finalize_sections): Create attribute
10011 section if it does not already exist.
10012 * attributes.cc (Attributes_section_data::Attributes_section_data):
10013 Don't crash if size is zero.
10014
135b9c78
ILT
100152010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10016 Ian Lance Taylor <iant@google.com>
10017
10018 * gold.cc (queue_middle_tasks): If no input files were opened,
10019 exit.
10020 * workqueue.h (Task_function::Task_function): Assert that there is
10021 a blocker.
10022
bb0bfe4f
DK
100232010-02-22 Doug Kwan <dougkwan@google.com>
10024
10025 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
10026 * icf.cc (get_section_contents): Cast snprintf arguments to long long
10027 types to avoid warnings due to different uint64_t implementations
10028 on different hosts.
10029
2a2b6d42
DK
100302010-02-21 Doug Kwan <dougkwan@google.com>
10031
10032 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
10033 handling of the maximum backward branch offset.
2e702c99 10034 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
10035 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
10036 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 10037 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
10038 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
10039 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
10040 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
10041 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
10042 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
10043 thumb_bl_out_of_range thumb_bl_out_of_range.o,
10044 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
10045 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
10046 thumb2_bl_out_of_range.o): New rules.
10047 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
10048 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
10049 thumb2_bl_out_of_range
10050 * testsuite/Makefile.in: Regenerate.
10051 * testsuite/arm_bl_in_range.s: New file.
10052 * testsuite/arm_bl_out_of_range.s: Ditto.
10053 * testsuite/arm_branch_in_range.sh: Ditto.
10054 * testsuite/arm_branch_range.t: Ditto.
10055 * testsuite/thumb2_branch_range.t: Ditto.
10056 * testsuite/thumb_bl_in_range.s: Ditto.
10057 * testsuite/thumb_bl_out_of_range.s: Ditto.
10058 * testsuite/thumb_branch_range.t: Ditto.
10059
b487ad64
ST
100602010-02-20 Sriraman Tallam <tmsriram@google.com>
10061
10062 * gc.h (gc_process_relocs): Change vectors to point to the new list.
10063 Add reloc offset information.
10064 * icf.cc (get_section_contents): Change iterators to point to the new
10065 vectors. Add reloc offset information to the contents.
10066 * icf.h (Icf::Sections_reachable_info): New typedef.
10067 (Icf::Sections_reachable_list): New typedef.
10068 (Icf::Offset_info): New typedef.
10069 (Icf::Reloc_info): New struct typedef.
10070 (Icf::Reloc_info_list): New typedef.
10071 (Icf::symbol_reloc_list): Delete method.
10072 (Icf::addend_reloc_list): Delete method.
10073 (Icf::section_reloc_list): Delete method.
10074 (Icf::reloc_info_list): New method.
10075 (Icf::reloc_info_list_): New member.
10076
f96accdf
DK
100772010-02-19 Doug Kwan <dougkwan@google.com>
10078
10079 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
10080 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
10081 * arm.cc (Arm_relocation_functions): New forward declaration.
10082 (Target_arm::Target_arm): Initialize new data members
10083 got_mod_index_offset_ and tls_base_symbol_defined_.
10084 (Target_arm::Relocate::relocate_tls): New method.
10085 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
10086 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
10087 New methods.
2e702c99 10088 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
10089 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
10090 (Target_arm::got_mod_index_offset_,
10091 Target_arm::tls_base_symbol_defined_): New data members.
10092 (Target_arm::Scan::local, Target::Scan::global,
10093 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
10094 relocations.
10095
c8761b9a
DK
100962010-02-18 Doug Kwan <dougkwan@google.com>
10097
10098 * arm.cc (Arm_relobj::find_linked_text_section): New method.
10099 (Arm_relobj::make_exidx_input_section): Pass section index of linked
10100 text section as a parameter becuase some broken tools may not set
10101 the link in section header.
10102 (Target_arm::has_got_section): New method.
10103 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
10104 without any mapping symbol as data only. Remove warning.
10105 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
10106 link in its section header, try to discover the link by inspecting the
10107 REL31 relocation at the beginning of the section.
10108 (Target_arm::Scan::check_non_pic): Report name of offending relocation
10109 in error message.
10110 (Target_arm::Scan::global): Treat any reference to the symbol
10111 _GLOBAL_OFFSET_TABLE_ as a GOT access.
10112
21bb3914
ST
101132010-02-12 Sriraman Tallam <tmsriram@google.com>
10114
10115 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
10116 (Scan::global_reloc_may_be_function_pointer): New function.
10117 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10118 (Scan::global_reloc_may_be_function_pointer): New function.
10119 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10120 (Scan::global_reloc_may_be_function_pointer): New function.
10121 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
10122 (Scan::global_reloc_may_be_function_pointer): New function.
10123 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
10124 (Scan::global_reloc_may_be_function_pointer): New function.
10125 (Scan::possible_function_pointer_reloc): New function.
10126 (Target_x86_64::can_check_for_function_pointers): New function.
10127 * gc.h (gc_process_relocs): Scan relocation types to determine if
10128 function pointers were taken for targets that support it.
10129 * icf.cc (Icf::find_identical_sections): Include functions for
10130 folding in safe ICF whose pointer is not taken.
10131 * icf.h (Secn_fptr_taken_set): New typedef.
10132 (fptr_section_id_): New member.
10133 (section_has_function_pointers): New function.
10134 (set_section_has_function_pointers): New function.
10135 (check_section_for_function_pointers): New function.
10136 * options.h: Fix comment for safe ICF option.
10137 * target.h (can_check_for_function_pointers): New function.
10138 * testsuite/Makefile.am: Add icf_safe_so_test test case.
10139 Modify icf_safe_test for X86-64.
10140 * testsuite/Makefile.in: Regenerate.
10141 * testsuite/icf_safe_so_test.cc: New file.
10142 * testsuite/icf_safe_so_test.sh: New file.
10143 * testsuite/icf_safe_test.cc (kept_func_3): New function.
10144 (main): Change to take pointer to function kept_func_3.
10145 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
10146 folding is done correctly for X86-64.
10147
0da6fa6c
DM
101482010-02-12 David S. Miller <davem@davemloft.net>
10149
10150 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
10151 is_symbolless parameter.
10152 (Output_reloc<SHT_REL>::is_symbolless): New.
10153 (Output_reloc<SHT_REL>::is_symbolless_): New.
10154 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
10155 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
10156 (Output_reloc<SHT_RELA>::is_symbolless): New.
10157 (Output_data_reloc::add_global): Handle is_symbolless.
10158 (Output_data_reloc::add_global_relative): Likewise.
10159 (Output_data_reloc::add_local): Likewise.
10160 (Output_data_reloc::add_local_relative): Likewise.
10161 (Output_data_reloc::add_symbolless_global_addend): New.
10162 (Output_data_reloc::add_symbolless_local_addend): New.
10163 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
10164 is_symbolless.
10165 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
10166 instead of ->is_relative_
10167 (Output_reloc::write): Likewise.
10168 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
10169 (Output_reloc::write_rel): Simplify.
10170
10171 * sparc.cc (Target_sparc::Scan::local): Use
10172 ->add_symbolless_local_addend as needed.
10173 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
10174 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
10175 based upon relocation offset.
10176
e4782e83
DK
101772010-02-11 Doug Kwan <dougkwan@google.com>
10178
10179 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
10180 (Target_arm::Scan::global): Ditto. Also remove a comment before the
10181 beginning of function.
10182 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
10183 and MOVT_ABS relocations. Those are non issued in scanning. Fix
10184 parameter is_32bit in calls to should_apply_static_reloc.
10185 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
10186 (check_DATA): Add arm_abs_global.stdout.
10187 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
10188 arm_abs_global.stdout): New rules.
10189 (MOSTLLYCLEANFILES): Add arm_abs_global
10190 * Makefile.in: Regenerate.
10191 * testsuite/arm_abs_global.s: New file.
10192 * testsuite/arm_abs_global.sh: Ditto.
10193 * testsuite/arm_abs_lib.s: Ditto.
10194
93ceb764
ILT
101952010-02-11 Ian Lance Taylor <iant@google.com>
10196
10197 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
10198 Read_relocs task.
10199 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
10200 Allocate_commons_task first.
10201 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
10202 task, rather than symtab_lock_.
10203 (Gc_process_relocs::~Gc_process_relocs): New function.
10204 (Gc_process_relocs::is_runnable): Check this_blocker_.
10205 (Gc_process_relocs::locks): Use next_blocker_ rather than
10206 blocker_.
10207 (Scan_relocs::~Scan_relocs): New function.
10208 (Scan_relocs::is_runnable): Check this_blocker_ rather than
10209 symtab_lock_.
10210 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
10211 next_blocker_.
10212 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
10213 fields. Add this_blocker_ and next_blocker_ fields. Adjust
10214 constructor accordingly.
10215 (class Gc_process_relocs): Likewise.
10216 (class Scan_relocs): Likewise.
10217 * common.h (class Allocate_commons_task): Remove symtab_lock_
10218 field, and corresponding constructor parameter.
10219 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
10220 symtab_lock_.
10221 (Allocate_commons_task::locks): Likewise.
10222
114dfbe1
ILT
102232010-02-11 Ian Lance Taylor <iant@google.com>
10224
10225 * gold-threads.h (class Once): Define.
10226 (class Initialize_lock): Rewrite as child of Once.
10227 * gold-threads.cc (class Once_initialize): Define.
10228 (once_pointer_control): New static variable.
10229 (once_pointer, once_arg): New static variables.
10230 (c_run_once): New static function.
10231 (Once::Once, Once::run_once, Once::internal_run): New functions.
10232 (class Initialize_lock_once): Remove.
10233 (initialize_lock_control): Remove.
10234 (initialize_lock_pointer): Remove.
10235 (initialize_lock_once): Remove.
10236 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
10237 (Initialize_lock::initialize): Rewrite.
10238 (Initialize_lock::do_run_once): New function.
10239 * archive.cc (Archive::interpret_header): Only clear name if it is
10240 not already empty.
10241 * fileread.cc: Include "gold-threads.h"
10242 (file_counts_lock): New static variable.
10243 (file_counts_initialize_lock): Likewise.
10244 (File_read::release): Only increment counts when using --stats.
10245 Use a lock around the increment.
10246 * parameters.cc (class Set_parameters_target_once): Define.
10247 (set_parameters_target_once): New static variable.
10248 (Parameters::Parameters): Move here from parameters.h.
10249 (Parameters::set_target): Rewrite.
10250 (Parameters::set_target_once): New function.
10251 (Parameters::clear_target): Move here and rewrite.
10252 * parameters.h (class Parameters): Update declarations. Add
10253 set_parameters_target_once_ field.
10254 (Parameters::Parameters): Move to parameters.cc.
10255 (Parameters::clear_target): Likewise.
10256 * readsyms.cc (Read_symbols::do_group): Create a Start_group
10257 task.
10258 (Start_group::~Start_group): New function.
10259 (Start_group::is_runnable): New function.
10260 (Start_group::locks, Start_group::run): New functions.
10261 (Finish_group::run): Change saw_undefined to size_t.
10262 * readsyms.h (class Start_group): Define.
10263 (class Finish_group): Change saw_undefined_ field to size_t.
10264 (Finish_group::Finish_group): Remove saw_undefined and
10265 this_blocker parameters. Change all callers.
10266 (Finish_group::set_saw_undefined): New function.
10267 (Finish_group::set_blocker): New function.
10268 * symtab.h (class Symbol_table): Change saw_undefined to return
10269 size_t. Change saw_undefined_ field to size_t.
10270 * target-select.cc (Set_target_once::do_run_once): New function.
10271 (Target_selector::Target_selector): Initialize set_target_once_
10272 field. Don't initialize lock_ and initialize_lock_ fields.
10273 (Target_selector::instantiate_target): Rewrite.
10274 (Target_selector::set_target): New function.
10275 * target-select.h (class Set_target_once): Define.
10276 (class Target_selector): Update declarations. Make
10277 Set_target_once a friend. Remove lock_ and initialize_lock_
10278 fields. Add set_target_once_ field.
10279
fa17a3f4
ILT
102802010-02-10 Ian Lance Taylor <iant@google.com>
10281
10282 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
10283 queueing any tasks.
10284 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
10285 (queue_middle_tasks): Add all blockers before queueing any tasks.
10286 (queue_final_tasks): Likewise.
10287 * token.h (Task_token::add_blockers): New function.
10288 * object.h (Input_objects::number_of_relobjs): New function.
10289
c7177d31
ILT
102902010-02-10 Ian Lance Taylor <iant@google.com>
10291
5de0e392
ILT
10292 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
10293 shared, not if not position independent.
10294 * x86_64.cc (Relocate::relocate_tls): Likewise.
10295 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
10296 (tls_pie_pic_test): New target.
10297 * testsuite/Makefile.in: Rebuild.
10298
c7177d31
ILT
10299 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
10300 (tls_test_main_pie.o, tls_test_pie.o): New targets.
10301 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
10302 * testsuite/Makefile.in: Rebuild.
10303
684b268a
DM
103042010-02-09 David S. Miller <davem@davemloft.net>
10305
10306 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
10307 R_SPARC_RELATIVE using ->add_local_relative().
10308 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
10309
612a8d3d
DM
10310 * output.h (Output_data_dynamic::add_section_size): New method
10311 that takes two Output_data objects.
10312 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
10313 entry param. Handle it in initializers.
10314 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
10315 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
10316 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
10317 arg.
10318 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
10319 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
10320 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
10321 for dynrel_includes_plt.
10322 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10323 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10324 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
10325 before .rela.plt
10326 (Target_sparc::do_finalize_sections): Update to pass true for
10327 dynrel_includes_plt.
10328 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
10329 output before .rela.plt
10330 (Target_powerpc::do_finalize_sections): Update to pass true for
10331 dynrel_includes_plt when 32-bit.
10332
cb1be87e
DK
103332010-02-08 Doug Kwan <dougkwan@google.com>
10334
10335 * arm.cc (Arm_relobj::simple_input_section_output_address): New
10336 method.
10337 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
10338 Arm_relobj::scan_section_for_cortex_a8_stubs,
10339 Arm_relobj::do_relocation_section): Instead of calling
10340 Output_section::output_address, use faster
10341 Arm_relobj::simple_input_section_output_address.
10342
705b5121
DM
103432010-02-08 David S. Miller <davem@davemloft.net>
10344
10345 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
10346 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
10347 relocation helper function.
10348
024c4466
DM
10349 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
10350 just like R_SPARC_GOT{10,13,22}.
10351 (Target_sparc::Scan::local): Likewise.
10352 (Target_sparc::Relocate:relocate): Likewise.
10353
9109c078
ILT
103542010-02-06 Ian Lance Taylor <iant@google.com>
10355
10356 * configure.ac: Rewrite targetobjs duplicate removal code to use
10357 only shell constructs.
10358 * configure: Rebuild.
10359
cf846138
DK
103602010-02-05 Doug Kwan <dougkwan@google.com>
10361
10362 PR 11247
10363 * arm.cc (Arm_relobj::section_is_scannable): New method.
10364 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
10365 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
10366
6cfaf60b
DK
103672010-02-04 Doug Kwan <dougkwan@google.com>
10368
10369 PR 11247
10370 * arm-reloc-property.cc (cstdio): Include.
10371 * configure.ac (targetobjs): Remove duplicates.
10372 * configure: Regenerate.
10373 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
10374 big and little endian version for a given address size.
10375
5c57f1be
DK
103762010-02-03 Doug Kwan <dougkwan@google.com>
10377
10378 * arm-reloc-property.cc
10379 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10380 definition.
10381 * arm-reloc-property.h
10382 (Arm_reloc_property_table::get_implemented_static_reloc_property):
10383 New method definition.
10384 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10385 declaration.
10386 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
10387 overflow to N.
10388 (GOT_PREL): Change implemented to Y.
10389 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
10390 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
10391 (Arm_relocate_functions::movw_abs_nc): Remove method.
10392 (Arm_relocate_functions::movt_abs): Ditto.
10393 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
10394 (Arm_relocate_functions::thm_movt_abs): Ditto.
10395 (Arm_relocate_functions::movw_rel_nc): Ditto.
10396 (Arm_relocate_functions::movw_rel): Ditto.
10397 (Arm_relocate_functions::movt_rel): Ditto.
10398 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
10399 (Arm_relocate_functions:thm_movw_rel): Ditto.
10400 (Arm_relocate_functions:thm_movt_rel): Ditto.
10401 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
10402 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
10403 New method definitions.
10404 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
10405 (Arm_relocation_functions::arm_grp_ldr): Ditto.
10406 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
10407 (Arm_relocation_functions::arm_grp_ldc): Ditto.
10408 (Target_arm::Relocate::relocate): Check for non-static or
10409 unimplemented relocation code and exit early. Change calls to
10410 Target_arm::reloc_uses_thumb_bit and
10411 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
10412 instead. Refactor code to handle similar relocations to increase
10413 code sharing. Remove check for unsupported relocation code in switch
10414 statement.
10415 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
10416 relocation property table to find out size. Change error message to
10417 print out the name of a relocation code instead of the numeric value.
10418 (Target_arm::scan_reloc_for_stub): Use relocation property table
10419 instead of calling Target_arm::reloc_uses_thumb_bit().
10420
218c5831
DK
104212010-02-02 Doug Kwan <dougkwan@google.com>
10422
10423 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
10424 types of relaxed input section.
10425
0d31c79d
DK
104262010-02-02 Doug Kwan <dougkwan@google.com>
10427
10428 * Makefile.am (HFILES): Add arm-reloc-property.h.
10429 (DEFFILES): New.
2e702c99
RM
10430 (TARGETSOURCES): Add arm-reloc-property.cc
10431 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
10432 (libgold_a_SOURCES): $(DEFFILES)
10433 * Makefile.in: Regenerate.
10434 * arm-reloc-property.cc: New file.
10435 * arm-reloc-property.h: New file.
10436 * arm-reloc.def: New file.
10437 * arm.cc: Update comments.
10438 (arm-reloc-property.h): New included header.
10439 (arm_reloc_property_table): New global variable.
10440 (Target_arm::do_select_as_default_target): New method definition.
10441 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
10442 arm-reloc-property to targ_extra_obj.
10443 * parameters.cc (set_parameters_target): Call
10444 Target::select_as_default_target().
10445 * target.h (Target::select_as_default_target): New method definition.
10446 (Target::do_select_as_default_target): Same.
10447
546c7457
DK
104482010-02-01 Doug Kwan <dougkwan@google.com>
10449
10450 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
10451 first_output_text_section_.
10452 (Arm_exidx_fixup::first_output_text_section): New method definition.
10453 (Arm_exidx_fixup::first_output_text_section_): New data member.
10454 (Arm_exidx_fixup::process_exidx_section): Record the first text
10455 output section seen.
10456 (Arm_output_section::fix_exidx_coverage): Set correct linked section
10457 and entsize in output section header.
10458
11b861d5
DK
104592010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10460
10461 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
10462 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
10463 (Arm_relocate_functions::thm_alu11): New Method.
10464 (Arm_relocate_functions::thm_pc8): New Method.
10465 (Arm_relocate_functions::thm_pc12): New Method.
10466 (Target_arm::Scan::local): Handle the relocations.
10467 (Target_arm::Scan::global): Likewise.
10468 (Target_arm::Relocate::relocate): Likewise.
10469 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10470
c9a2c125
DK
104712010-01-29 Doug Kwan <dougkwan@google.com>
10472
10473 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
10474 of relocation types as ld.
10475
1521477a
DK
104762010-01-29 Doug Kwan <dougkwan@google.com>
10477
10478 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
10479 to public.
10480 (Arm_relocate_functions::thumb_branch_common): Ditto.
10481 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
10482 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
10483 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
10484 Arm_relocate_functions::jump24): Remove.
10485 (Target_arm::Relocate::relocate): Adjust code to call
10486 Arm_relocation_functions::arm_branch_common and
10487 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 10488 wrappers. Merge switch-cases together to reduce source code size.
1521477a 10489
e7eca48c
DK
104902010-01-29 Doug Kwan <dougkwan@google.com>
10491
10492 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
10493 output_local_symbol_count_needs_update_.
10494 (Arm_relobj::output_local_symbol_count_needs_update,
10495 Arm_relobj::set_output_local_symbol_count_needs_update,
10496 Arm_relobj::update_output_local_symbol_count): New methods.
10497 (Arm_relobj::output_local_symbol_count_needs_update_): New data
10498 member.
10499 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
10500 of pointed function as in a R_ARM_PREL31 relocation.
10501 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
10502 for output local symbol count updating.
10503 (Target_arm::do_relax): Update output local symbol counts in objects
10504 if necessary.
10505 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
10506
02961d7e
ILT
105072010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10508
10509 * arm.cc: Added support for the ARM relocations:
10510 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
10511 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
10512 (Arm_relocate_functions::movw_rel_nc): Renamed (was
10513 movw_prel_nc).
10514 (Arm_relocate_functions::movw_rel): New method.
10515 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
10516 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
10517 thm_movw_prel_nc).
10518 (Arm_relocate_functions::thm_movw_rel): New method.
10519 (Arm_relocate_functions::thm_movt_rel): Renamed (was
10520 thm_movt_prel).
10521 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
10522 relocations.
10523 (Target_arm::Scan::global): Likewise.
10524 (Target_arm::Relocate::relocate): Likewise.
10525 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10526 Likewise.
10527
b10d2873
ILT
105282010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10529
10530 * arm.cc: Added support for ARM group relocations.
10531 (Target_arm::reloc_needs_sym_origin): New method.
10532 (Arm_relocate_functions::calc_grp_kn): New method.
10533 (Arm_relocate_functions::calc_grp_residual): New method.
10534 (Arm_relocate_functions::calc_grp_gn): New method.
10535 (Arm_relocate_functions::arm_grp_alu): New Method.
10536 (Arm_relocate_functions::arm_grp_ldr): New Method.
10537 (Arm_relocate_functions::arm_grp_ldrs): New Method.
10538 (Arm_relocate_functions::arm_grp_ldc): New Method.
10539 (Target_arm::Scan::local): Handle the ARM group relocations.
10540 (Target_arm::Scan::global): Likewise.
10541 (Target_arm::Relocate::relocate): Likewise.
10542 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10543 Likewise.
10544
2b328d4e
DK
105452010-01-26 Doug Kwan <dougkwan@google.com>
10546
10547 * arm.cc (set): Include.
10548 (class Arm_exidx_fixup): Change type of last_input_section_ to const
10549 pointer type.
2e702c99 10550 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
10551 (Arm_output_section::append_text_sections_to_list): New method.
10552 (Arm_output_section::fix_exidx_coverage): Ditto.
10553 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 10554 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
10555 Relobj::set_section_offset() instead of
10556 Sized_relobj::invalidate_section_offset().
2e702c99 10557 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
10558 parameter for section headers. Ignore relocation sections for
10559 unallocated sections and EXIDX sections.
10560 (Target_arm::fix_exidx_coverage): New method.
10561 (Target_arm::output_section_address_less_than): New type.
10562 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
10563 linked text section instead of the EXIDX section.
10564 (Arm_output_section::create_stub_group): Add an assertion to check
10565 that this is not an EXIDX output section.
10566 (Arm_output_section::append_text_sections_to_list): New method.
10567 (Arm_output_section::fix_exidx_coverage): Ditto.
10568 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 10569 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
10570 (Target_arm::do_relax): Fix EXIDX output section coverage in the
10571 first pass.
10572 (Target_arm::fix_exidx_coverage): New method.
10573 * object.h (Relobj::set_output_section): New method.
10574 (Sized_relobj::invalidate_section_offset): Remove method.
10575 (Sized_relobj::do_invalidate_section_offset): Remove method.
10576 (Sized_relobj::do_set_section_offset): Handle offset value -1.
10577
c7f3c371
DK
105782010-01-25 Doug Kwan <dougkwan@google.com>
10579
10580 * arm.cc (Arm_exidx_merged_section::do_output_offset):
10581 Fix warning due to signed and unsigned comparison on a 32-bit host.
10582
8923b24c
DK
105832010-01-22 Doug Kwan <dougkwan@google.com>
10584
10585 * arm.cc (Target_arm::do_relax): Record an output section for section
10586 offset adjustment it contains any stub table that has changed.
10587 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
10588 offsets in an output section if necessary.
10589 * output.cc (Output_section::Output_section): Initialize
10590 section_offsets_need_adjustments_.
10591 (Output_section::add_input_section_for_script): Renamed to
10592 Output_section::add_simple_input_section.
10593 (Output_section::save_states): Add a comment.
10594 (Output_section::discard_states): New method defintion.
10595 (Output_section::adjust_section_offsets): Same.
10596 * output.h (Output_section::add_input_section_for_script): Renamed to
10597 Output_section::add_simple_input_section.
10598 (Output_section::discard_states): New method declaration.
10599 (Output_section::adjust_section_offsets): Same.
10600 (Output_section::section_offsets_need_adjustment,
10601 Output_section::set_section_offsets_need_adjustment): New method
10602 definitions.
10603 (Output_section::section_offsets_need_adjustment_): New data member.
10604 * script-sections.cc
10605 (Output_section_element_input::set_section_address): Adjust code for
10606 renaming of Output_section::add_input_section_for_script.
10607 (Orphan_output_section::set_section_address): Same.
10608
9b2fd367
DK
106092010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10610
10611 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
10612 Fix_v4bx enum values .
10613 * gold/options.h (General_options): New option definitions.
10614 (General_options::fix_v4bx): New method.
10615 (General_options::Fix_v4bx): New enum.
10616 * gold/options.cc (General_options::parse_fix_v4bx): New method.
10617 (General_options::parse_fix_v4bx_interworking): New method.
10618
80d0d023
DK
106192010-01-22 Doug Kwan <dougkwan@google.com>
10620
10621 * arm.cc (Arm_exidx_fixup): New class.
10622
af2cdeae
DK
106232010-01-21 Doug Kwan <dougkwan@google.com>
10624
10625 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
10626 classes.
10627 (Arm_exidx_section_offset_map): New type.
10628
993d07c1
DK
106292010-01-21 Doug Kwan <dougkwan@google.com>
10630
10631 * arm.cc (Arm_exidx_input_section): New class.
10632 (Arm_relobj::exidx_input_section_by_link,
10633 Arm_relobj::exidx_input_section_by_shndx,
10634 Arm_relobj::make_exidx_input_section): New methods.
10635 (read_arm_attributes_section): Remove.
10636 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
10637 information about them.
10638 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
10639 to here.
10640
5ac169d4
DK
106412010-01-20 Doug Kwan <dougkwan@google.com>
10642
10643 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
10644 Input_section_specifier to Section_id.
10645 (Target_arm::new_arm_input_section: Adjust code for change of key
10646 type.
10647 (Target_arm::find_arm_input_section): Ditto.
10648 * gc.h (object.h): Include for Section_id nand Section_id_hash.
10649 (Section_id): Remove.
10650 (Garbage_collection::Section_id_hash): Remove.
10651 * icf.h (object.h): Include for Section_id nand Section_id_hash.
10652 (Section_id): Remove.
10653 (Icf::Section_id_hash): Remove.
10654 * object.h (Section_id, Const_section_id, Section_id_hash,
10655 Const_section_id_hash): New type definitions.
10656 * output.cc (Output_section::add_relaxed_input_section): Change to
10657 use Const_section_id instead of Input_section_specifier as key type.
10658 (Output_section::add_merge_input_section): Ditto.
10659 (Output_section::build_relaxation_map): Change to use Section_id
10660 instead of Input_section_specifier as key type.
2e702c99 10661 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
10662 Ditto.
10663 (Output_section::convert_input_sections_to_relaxed_sections): Change
10664 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 10665 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
10666 (Output_section::find_relaxed_input_section): Ditto.
10667 * output.h (Input_section_specifier): Remove class.
10668 (Output_section::Output_section_data_by_input_section_map): Change
10669 key type to Const_section_id.
10670 (Output_section::Output_relaxed_input_section_by_input_section_map):
10671 Ditto.
10672 (Output_section::Relaxation_map): Change key type to Section_id.
10673
a2162063
ILT
106742010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10675
10676 * gold/arm.cc: Added support for R_ARM_V4BX relocation
10677 (class Arm_v4bx_stub): New class.
10678 (DEF_STUBS): Updated definition to support v4_veneer_bx.
10679 (Stub_factory::make_arm_v4bx_stub): New method.
10680 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
10681 (Stub_table::empty): Handle v4bx stubs.
10682 (Stub_table::add_arm_v4bx_stub): New method.
10683 (Stub_table::find_arm_v4bx_stub): New method.
10684 (Arm_relocate_functions::v4bx): New method.
10685 (Target_arm::fix_v4bx): New method.
10686 (Target_arm::Target_arm): Handle R_ARM_V4BX.
10687 (Stub_table::relocate_stubs): Likewise.
10688 (Stub_table::do_write): Likewise.
10689 (Stub_table::update_data_size_and_addralign): Likewise.
10690 (Stub_table::finalize_stubs): Likewise.
10691 (Target_arm::Scan::local): Likewise.
10692 (Target_arm::Scan::global): Likewise.
10693 (Target_arm::do_finalize_sections): Likewise.
10694 (Target_arm::Relocate::relocate): Likewise.
10695 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10696 Likewise.
10697 (Target_arm::scan_reloc_for_stub): Likewise.
10698 (Target_arm::scan_reloc_section_for_stubs): Likewise.
10699
5696ab0b
ILT
107002010-01-19 Ian Lance Taylor <iant@google.com>
10701
10702 * output.cc (Output_section_headers::do_sized_write): Write large
10703 segment count to sh_info field.
10704 (Output_file_header::do_sized_write): For large segment count,
10705 write PN_XNUM to e_phnum field.
10706
800d0f56
ILT
107072010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10708
10709 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
10710 (Arm_relocate_functions::thm_jump8): New function.
10711 (Arm_relocate_functions::thm_jump11): New function.
10712 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
10713 R_ARM_THM_JUMP11.
10714 (Target_arm::Scan::global): Likewise.
10715 (Target_arm::Relocate::relocate): Likewise.
10716 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10717 Likewise.
10718
41263c05
DK
107192010-01-14 Doug Kwan <dougkwan@google.com>
10720
10721 * arm.cc (map, utility): Include headers.
10722 (Target_arm::apply_cortex_a8_workaround): New method.
10723 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
10724 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
10725 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
10726 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
10727 the --[no-]fix-cortex-a8 command line options.
10728 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
10729 (Target_arm::relocate_stub): Use addend in instruction template.
10730 * options.h (DEFINE_bool): Set the user-set flag.
10731 (General_options): Add --[no-]-fix-cortex options.
10732 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 10733 : Update fast look-up map after conversion.
41263c05 10734
459e9b03
ST
107352010-01-14 Sriraman Tallam <tmsriram@google.com>
10736
10737 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
10738 in the first pass of do_layout.
10739
b521dfe4
DK
107402010-01-13 Doug Kwan <dougkwan@google.com>
10741
10742 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10743 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
10744 apparent compiler problem of not folding static constant integral
10745 data members of elfcpp::Elf_sizes<32>.
10746
44272192
DK
107472010-01-13 Doug Kwan <dougkwan@google.com>
10748
10749 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10750 Arm_relobj::section_needs_cortex_a8_stub_scanning,
10751 Arm_relobj::scan_section_for_cortex_a8_erratum,
10752 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
10753 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
10754 sections to scan for relocation stubs into a new method
10755 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
10756 relocation and Cortex-A8 stub scanning.
10757 (Target_arm::do_relax): Force stubs to be after stubbed sections
10758 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 10759 the beginning of a new relaxation pass. Update a comment.
44272192
DK
10760 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
10761
44b71ece
ILT
107622010-01-12 Ian Lance Taylor <iant@google.com>
10763
10764 * target-reloc.h (visibility_error): New inline function.
10765 (relocate_section): Call visibility_error.
10766 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
10767 (MOSTLYCLEANFILES): Likewise.
10768 (protected_4_pic.o, protected_3.err): New targets.
10769 * testsuite/protected_4.cc: New file.
10770
a120bc7f
DK
107712010-01-12 Doug Kwan <dougkwan@google.com>
10772
10773 * arm.cc (Cortex_a8_reloc): New class.
10774 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
10775 and cortex_a8_relocs_info_.
10776 (Target_arm::fix_cortex_a8): New method definition.
10777 (Target_arm::Cortex_a8_relocs_info): New type.
10778 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
10779 New data member declarations.
10780 (Target_arm::scan_reloc_for_stub): Record information about
10781 relocations for THUMB branches that might be exempted from the
10782 Cortex-A8 workaround.
10783 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
10784 at the beginning of a relaxation pass.
10785
20138696
DK
107862010-01-12 Doug Kwan <dougkwan@google.com>
10787
10788 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
10789 (Arm_relobj::Mapping_symbol_position,
10790 Arm_reloj::Mapping_symbol_position_less,
10791 Arm_relobj::Mapping_symbols_info): New types.
10792 (Target_arm::is_mapping_symbol_name): New method definition.
10793 (Arm_relobj::do_count_local_symbols): Save information about mapping
10794 symbols.
10795
089d69dc
DK
107962010-01-11 Doug Kwan <dougkwan@google.com>
10797
10798 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
10799 Arm_relocate_functions::thumb32_branch_upper,
10800 Arm_relocate_functions::thumb32_branch_lower,
10801 Arm_relocate_functions::thumb32_cond_branch_offset,
10802 Arm_relocate_functions::thumb32_cond_branch_upper,
10803 Arm_relocate_functions::thumb32_cond_branch_lower,
10804 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
10805 branch offset encoding.
10806 (Arm_relocate_functions::thumb_branch_common): Use new branch
10807 offset encoding methods to avoid code duplication.
10808 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
10809 (Stub_addend_reader::operator()): Use new branch encoding method
10810 to avoid code duplication.
10811
99e5bff2
DK
108122010-01-11 Doug Kwan <dougkwan@google.com>
10813
10814 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
10815 (Target_arm::do_finalize_sections): Define special EXIDX section
10816 symbols only if referenced.
10817 * gc.h (Garbage_collection::add_reference): New method.
10818 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
10819 code duplication.
10820
98e090bd
ILT
108212010-01-11 Ian Lance Taylor <iant@google.com>
10822
d0a91bd8
ILT
10823 * script.cc (Version_script_info::build_expression_list_lookup):
10824 Change complaing about duplicate wildcard match from error to
10825 warning.
10826
98e090bd
ILT
10827 * script.cc (class Lazy_demangler): Recreate--revert part of patch
10828 of 2009-12-30.
10829 (Version_script_info::Version_script_info): Initialize globs_,
10830 default_version_, default_is_global_, and exact_. Don't
10831 initialize globals_ or locals_.
10832 (Version_script_info::build_lookup_tables): Build local symbols
10833 first.
10834 (Version_script_info::unquote): New function.
10835 (Version_script_info::add_exact_match): New function.
10836 (Version_script_info::build_expression_list_lookup): Remove lookup
10837 parameter. Add is_global parameter. Change all callers. Handle
10838 wildcard pattern specially. Unquote pattern. Call
10839 add_exact_match.
10840 (Version_script_info::get_name_to_match): New function.
10841 (Version_script_info::get_symbol_version): New function.
10842 (Version_script_info::get_symbol_version_helper): Remove.
10843 (Version_script_info::check_unmatched_names): Call unquote.
10844 * script.h (class Version_script_info): Change get_symbol_version
10845 to be non-inline and add is_global parameter; change all callers.
10846 Rewrite symbol_is_local. Update declarations. Define struct
10847 Version_tree_match, Exact, Globs. Don't define struct Lookup.
10848 Remove globals_ and locals_ members. Add exact_, globs_,
10849 default_version_, is_global_.
10850 (Version_script_info::Glob): Remove pattern, add expression and
10851 is_global. Update constructor. Change all callers.
10852 * dynobj.cc (Versions::finalize): Mark the version symbol as the
10853 default version.
10854 (Versions::symbol_section_contents): If a symbol is undefined, or
10855 defined in a dynamic object, set the version index to
10856 VER_NDX_LOCAL.
10857 * symtab.cc (Symbol_table::add_from_relobj): Don't call
10858 symbol_is_local.
10859 (Symbol_table::add_from_pluginobj): Likewise.
10860 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
10861
d56962d3
DK
108622010-01-11 Doug Kwan <dougkwan@google.com>
10863
10864 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
10865 (incremental_dump_LDADD): Add linking option for libintl.
10866 * Makefile.in: Regenerate.
10867
94e6ee91
L
108682010-01-11 H.J. Lu <hongjiu.lu@intel.com>
10869
10870 PR gold/11144
10871 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
10872 instead of -Ds.
10873 * testsuite/Makefile.in: Regenerated.
10874
e96c574b
DK
108752010-01-10 Doug Kwan <dougkwan@google.com>
10876
10877 * options.h (DEFINE_var): Use parentheses around argument varname__
10878 in macro body to avoid any unintended subsequent substitutions.
10879
7198066b
ILT
108802010-01-10 Ian Lance Taylor <iant@google.com>
10881
ba4d53bf
ILT
10882 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
10883 candidates before doing symbol resolution.
10884
7198066b
ILT
10885 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
10886 ODR candidates if only one is weak.
10887
a2beed37
ILT
108882010-01-08 Ian Lance Taylor <iant@google.com>
10889
10890 * script.cc (Version_script_info::build_expression_list_lookup):
10891 Don't warn about ambiguous version, just record the ambiguity.
10892 (Version_script_info::get_symbol_version_helper): Give error if
10893 version is ambiguous.
10894
2fb7225c
DK
108952010-01-08 Doug Kwan <dougkwan@google.com>
10896
10897 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
10898 prev_data_size_ and prev_addralign_. Remove initializer for
10899 deleted data member has_been_changed_.
10900 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
10901 to determine if the table is empty.
10902 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
10903 Remove.
10904 (Stub_table::add_reloc_stub): Define method in class definition
10905 instead of just declaring it there.
10906 (Stub_table::add_cortex_a8_stub): New method definition.
10907 (Stub_table::update_data_size_and_addralign): Ditto.
10908 (Stub_table::finalize_stubs): Ditto.
10909 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
10910 (Stub_table::do_addralign_): Return address alignment in the
10911 (Stub_table::do_reset_address_and_file_offset): Define method in
10912 class definition instead of declaring it there. Set current data
10913 size to be the data size of the previous pass.
10914 (Stub_table::set_final_data_size): Use current data size as the
10915 final data size.
10916 (Stub_table::relocate_stub): Change parameter type of stub from
10917 Reloc_stub pointer to Stub pointer.
10918 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
10919 (Stub_table::Cortex_a8_stub_list): New typedef.
10920 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
10921 Stub_table::prev_addralign_): New data member.
10922 (Arm_relobj::Arm_relobj): Initialize data member
10923 section_has_cortex_a8_workaround_.
10924 (Arm_relobj::section_has_cortex_a8_workaround,
10925 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
10926 definitions.
10927 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
10928 declarations.
10929 (Target_arm::relocate_stub): Change parameter type of stub from
10930 Reloc_stub pointer to Stub pointer.
10931 (Insn_template::size, Insn_template::alignment): Handle
10932 THUMB16_SPECIAL_TYPE.
10933 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
10934 Stub_table::update_data_size_and_addralign,
10935 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
10936 definitions.
10937 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
10938 (Stub_table::do_write): Ditto.
10939 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 10940
880cd20d
ILT
109412010-01-08 Ian Lance Taylor <iant@google.com>
10942
10943 PR 11108
10944 * symtab.h (class Symbol): Remove fields is_target_special_ and
10945 has_plt_offset_. Add field is_defined_in_discarded_section_.
10946 (Symbol::is_defined_in_discarded_section): New function.
10947 (Symbol::set_is_defined_in_discarded_section): New function.
10948 (Symbol::has_plt_offset): Rewrite.
10949 (Symbol::set_plt_offset): Verify that new offset is not -1U.
10950 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
10951 Don't initialize is_target_special_ or has_plt_offset_.
10952 Initialize is_defined_in_discarded_section_.
10953 (Symbol_table::add_from_relobj): If appropriate, set
10954 is_defined_in_discarded_section.
10955 * resolve.cc (Symbol::override_base_with_special): Don't test
10956 is_target_special_. Change has_plt_offset_ to has_plt_offset().
10957 * target-reloc.h (relocate_section): Do special handling for
10958 symbols defined in discarded sections for global symbols as well
10959 as local symbols.
10960
2703e3eb
ILT
109612010-01-08 Ian Lance Taylor <iant@google.com>
10962
10963 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
10964 the SHT_SYMTAB case.
10965
339d40a3
ILT
109662010-01-08 Ian Lance Taylor <iant@google.com>
10967
10968 * object.cc (Sized_relobj::do_layout): Don't get confused if
10969 layout_eh_frame returns NULL.
10970
abecea76
ILT
109712010-01-08 Ian Lance Taylor <iant@google.com>
10972
10973 PR 11084
10974 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
10975 dynamic symbol table, use the normal symbol table.
10976 (Sized_dynobj::do_read_symbols): Remove assertion about type of
10977 symbol table.
10978
6b7dd3f3
ILT
109792010-01-08 Ian Lance Taylor <iant@google.com>
10980
10981 PR 11072
10982 * layout.cc (Layout::include_section): Remove .gnu_debuglink
10983 sections.
10984
36c50e63
L
109852010-01-08 H.J. Lu <hongjiu.lu@intel.com>
10986
10987 * version.cc (print_version): Change to "Copyright 2010".
10988
e291e7b9
ILT
109892010-01-08 Ian Lance Taylor <iant@google.com>
10990
10991 PR 10287
10992 PR 11063
10993 * i386.cc (class Target_i386): Change return type of plt_section
10994 to be non-const.
10995 (class Output_data_plt_i386): Add tls_desc_rel_ field.
10996 (Output_data_plt_i386::Output_data_plt_i386): Initialize
10997 tls_desc_rel_ field.
10998 (Output_data_plt_i386::rel_tls_desc): New function.
10999 (Target_i386::rel_tls_desc_section): New function.
11000 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
11001 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
11002 R_386_TLS_DESC reloc in rel_tls_desc_section.
11003 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
11004 Define struct Tlsdesc_info.
11005 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
11006 (Target_x86_64::do_reloc_symbol_index): New function.
11007 (Target_x86_64::add_tlsdesc_info): New function.
11008 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
11009 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
11010 tlsdesc_rel_ field.
11011 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
11012 all callers.
11013 (Output_data_plt_x86_64::rela_tlsdesc): New function.
11014 (Target_x86_64::rela_tlsdesc_section): New function.
11015 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
11016 handling.
11017 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
11018 (Target_x86_64::do_reloc_addend): New function.
11019 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
11020 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
11021 declarations. Define TARGET_CODE. Add arg field to u1_ union.
11022 (Output_reloc::type): New function.
11023 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
11024 (Output_reloc::is_target_specific): New function.
11025 (Output_reloc::target_arg): New function.
11026 (class Output_reloc) [SHT_RELA]: Add four new constructors for
11027 absolute relocs and target specific relocs.
11028 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
11029 add_target_specific.
11030 (class Output_data_reloc) [SHT_RELA]: Likewise.
11031 * output.cc (Output_reloc::Output_reloc): Add four new versions
11032 for absolute relocs and target specific relocs.
11033 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
11034 (Output_reloc::get_symbol_index): Likewise.
11035 (Output_reloc::local_section_offset): Check that local_sym_index_
11036 is not TARGET_CODE or 0.
11037 (Output_reloc::symbol_value): Likewise.
11038 (Output_reloc::write) [SHT_RELA]: Call target for target specific
11039 reloc.
11040 * target.h (class Target): Add reloc_symbol_index and reloc_addend
11041 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
11042 functions.
11043 * layout.cc (add_target_dynamic_tags): Use output section for
11044 DT_PLTRELSZ and DT_JMPREL.
11045
3a44184e
ILT
110462010-01-07 Ian Lance Taylor <iant@google.com>
11047
11048 PR 11061
11049 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
11050 function.
11051 (class Output_data_reloc_generic): Define.
11052 (class Output_data_reloc_base): Change base class to
11053 Output_data_reloc_generic. Change add() method to call
11054 bump_relative_reloc_count for a relative reloc. Remove
11055 sort_relocs_ field.
11056 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
11057 to sort_relocs().
11058 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
11059 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
11060 appropriate.
11061 * layout.h (class Layout): Update declaration.
11062
ea715a34
ILT
110632010-01-07 Ian Lance Taylor <iant@google.com>
11064
11065 * output.h (class Output_data): Add const version of
11066 output_section and do_output_section.
11067 (class Output_section_data): Add const version of
11068 do_output_section.
11069 (class Output_section): Likewise.
11070 * layout.cc (Layout::add_target_dynamic_tags): New function.
11071 * layout.h (class Layout): Update declarations.
11072 * arm.cc (Target_arm::do_finalize_sections): Use
11073 add_target_dynamic_tags.
11074 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11075 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11076 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11077 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11078
659948a4
ILT
110792010-01-07 Ian Lance Taylor <iant@google.com>
11080
11081 PR 11042
11082 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
11083 object as needed.
11084
9d3b86f6
ILT
110852010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
11086 Ian Lance Taylor <iant@google.com>
11087
11088 PR 11019
11089 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
11090 Xindex::read_symtab_xindex.
11091
bb0d3eb0
DK
110922010-01-07 Doug Kwan <dougkwan@google.com>
11093
11094 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
11095 (Insn_template::thumb16_bcond_insn): New method declaration.
11096 (Insn_template): Fix spelling.
11097 (Stub::thumb16_special): New method declaration.
11098 (Stub::do_write): Define virtual method which was previously pure
11099 virtual.
11100 (Stub::do_thumb16_special): New method declaration.
11101 (Stub::do_fixed_endian_write): New template member.
11102 (Reloc_stub::do_write): Remove.
11103 (Reloc_stub::do_fixed_endian_write): Remove.
11104 (Cortex_a8_stub): New class definition.
11105 (Stub_factory::make_cortex_a8_stub): New method definition.
11106 (Stub_factory::Stub_factory): Add missing static storage class
11107 qualifier for elf32_arm_stub_a8_veneer_blx.
11108
ffeef7df
ILT
111092010-01-07 Ian Lance Taylor <iant@google.com>
11110
dc3f80fe
ILT
11111 PR 10980
11112 * options.h (class General_options): Add --warn-unresolved-symbols
11113 and --error-unresolved-symbols.
11114 * errors.cc (Errors::undefined_symbol): Implement
11115 --warn-unresolved-symbols.
11116
ffeef7df
ILT
11117 * options.h (class General_options): Add -z text and -z textoff.
11118 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
11119
f1ec9ded
ST
111202010-01-06 Sriraman Tallam <tmsriram@google.com>
11121
11122 * gc.h (Garbage_collection::Cident_section_map): New typedef.
11123 (Garbage_collection::cident_sections): New function.
11124 (Garbage_collection::add_cident_section): New function.
11125 (Garbage_collection::cident_sections_): New member.
11126 (gc_process_relocs): Add references to sections whose names are C
11127 identifiers.
11128 * gold.h (cident_section_start_prefix): New constant.
11129 (cident_section_stop_prefix): New constant.
11130 (is_cident): New function.
11131 * layout.cc (Layout::define_section_symbols): Replace string constants
11132 with the newly defined constants.
11133 * object.cc (Sized_relobj::do_layout): Track sections whose names are
11134 C identifiers.
11135 * testsuite/Makefile.am: Add gc_orphan_section_test.
11136 * testsuite/Makefile.in: Regenerate.
11137 * testsuite/gc_orphan_section_test.cc: New file.
11138 * testsuite/gc_orphan_section_test.sh: New file.
11139
6eda8c29
ILT
111402010-01-06 Ian Lance Taylor <iant@google.com>
11141
b9674e17
ILT
11142 PR 10980
11143 * options.h (class General_options): Add --warn-shared-textrel.
11144 * layout.cc (Layout::finish_dynamic_section): Implement
11145 --warn-shared-textrel.
11146
6eda8c29
ILT
11147 PR 10980
11148 * options.h (class General_options): Add --warn-multiple-gp.
11149
32dcd44e
ILT
111502010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11151
11152 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
11153 $(THREADSLIB) and $(LIBDL).
11154 * Makefile.in: Rebuild.
11155
a192ba05
ILT
111562010-01-06 Ian Lance Taylor <iant@google.com>
11157
11158 PR 10980
11159 * options.cc (General_options::parse_section_start): New function.
11160 (General_options::section_start): New function.
11161 (General_options::General_options): Initialize all members.
11162 * options.h: Include <map>
11163 (class General_options): Add --section-start. Add section_starts_
11164 member.
11165 * layout.cc (Layout::attach_allocated_section_to_segment): If
11166 --section-start was used, set the address of the segment. Remove
11167 local sort_sections.
11168 (Layout::relaxation_loop_body): If the address of the load segment
11169 has been set by --section-start, don't use it.
11170 * output.h (Output_segment::update_flags_for_output_section): New
11171 function.
11172 * output.cc (Output_segment::add_output_section): Call
11173 update_flags_for_output_section.
11174
dde3f402
ILT
111752010-01-05 Ian Lance Taylor <iant@google.com>
11176
62dfdd4d
ILT
11177 PR 10980
11178 * options.h (class General_options): Add --undefined-version.
11179 * script.cc (struct Version_expression): Add was_matched_by_symbol
11180 field.
11181 (Version_script_info::matched_symbol): New function.
11182 (Version_script_info::get_symbol_version_helper): Call
11183 matched_symbol.
11184 (Version_script_info::check_unmatched_names): New function.
11185 * script.h (class Version_script_info): Update declarations.
11186 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
11187
9c4ae156
ILT
11188 * options.h (class General_options): Use DEFINE_bool_alias for
11189 allow_multiple_definition.
11190 * resolve.cc (Symbol_table::should_override): Don't test
11191 allow_multiple_definition.
11192
dde3f402
ILT
11193 PR 10980
11194 * options.h (class General_options): Add --cref.
11195 * main.cc (main): Print cref table if --cref. Don't close mapfile
11196 until after printing cref table.
11197 * cref.cc: Include "symtab.h".
11198 (class Cref_inputs): Define Cref_table_compare and Cref_table.
11199 (Cref_table_compare::operator()): New function.
11200 (Cref_inputs::gather_cref): New function.
11201 (filecol): New static const.
11202 (Cref_inputs::print_cref): New function.
11203 (Cref::print_cref): New function.
11204 * cref.h: Include <cstdio>.
11205 (class Cref): Update declarations.
11206 * mapfile.h (Mapfile::file): New function.
11207 * object.h (class Object): Define Symbols. Declare virtual
11208 do_get_global_symbols.
11209 (Object::get_global_symbols): New function.
11210 * object.cc (Input_objects::add_object): Pass object to cref_ if
11211 --cref.
11212 (Input_objects::archive_start): Likewise.
11213 (Input_objects::archive_stop): Likewise.
11214 (Input_objects::print_cref): New function.
11215 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
11216 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
11217 --cref.
11218 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
11219 function.
11220 * plugin.h (class Sized_pluginobj): Update declarations.
11221
8781f709
ILT
112222010-01-05 Ian Lance Taylor <iant@google.com>
11223
11224 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
11225 to is_default_version. Rename insdef to insdefault.
11226 (Symbol_table::add_from_relobj): Rename def to is_default_version
11227 and local to is_forced_local.
11228 (Symbol_table::add_from_pluginobj): Likewise.
11229 (Symbol_table::add_from_dynobj): Likewise.
11230 (Symbol_table::define_special_symbol): Rename insdef to
11231 insdefault.
11232
fe35d28d
ILT
112332010-01-04 Ian Lance Taylor <iant@google.com>
11234
30bc8c46
ILT
11235 PR 10980
11236 * options.h (class General_options): Add
11237 --allow-multiple-definition and -z muldefs.
11238 * resolve.cc (Symbol_table::should_override): Don't warn about a
11239 multiple symbol definition if --allow-multiple-definition or -z
11240 muldefs.
11241
7eaea549
ILT
11242 PR 10980
11243 * options.h (class General_options): Add --add-needed and
11244 --copy-dt-needed-entries. Tweak --as-needed help entry.
11245 * object.cc (Input_objects::check_dynamic_dependencies): Give an
11246 error if --copy-dt-needed-entries aka --add-needed is used and
11247 would cause a change in behaviour.
11248
fe35d28d
ILT
11249 PR 10980
11250 * options.h (class General_options): Add -G as a short version of
11251 --shared. Add no-op options -assert, -g, and -i.
11252
55a2bb35
ST
112532010-01-04 Sriraman Tallam <tmsriram@google.com>
11254
11255 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
11256 check for .text or .gnu.linkonce.t sections.
11257 * icf.cc (Icf::find_identical_sections): Ditto.
11258 Change the detection for mangled function name within the section
11259 name.
11260 * icf.h (is_section_foldable_candidate): New function.
11261
719328e1
ILT
112622009-12-30 Ian Lance Taylor <iant@google.com>
11263
11264 PR 10980
11265 * options.h (class General_options): Permit two dashes with
11266 --retain-symbols-file.
11267
d7bb5745
ILT
112682009-12-30 Ian Lance Taylor <iant@google.com>
11269
403a15dd
ILT
11270 PR 10979
11271 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
11272 don't put the file header and segment headers in the text
11273 segment.
11274
eda294df
ILT
11275 PR 10979
11276 * common.cc (Sort_commons::operator()): Stabilize sort when both
11277 entries are NULL.
11278 (Symbol_table::do_allocate_commons_list): When allocating common
11279 symbols, skip a symbol which is no longer common.
11280 * symtab.h (Symbol::is_common): Test whether the symbol comes from
11281 an object before checking its type.
11282 * testsuite/common_test_2.c: New file.
11283 * testsuite/common_test_3.c: New file.
11284 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
11285 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
11286 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
11287 (common_test_2_pic.o, common_test_2.so): New targets.
11288 (common_test_3_pic.o, common_test_3.so): New targets.
11289 * testsuite/Makefile.in: Rebuild.
11290
d7bb5745
ILT
11291 PR 10979
11292 * script.cc (read_input_script): If we see a new SECTIONS clause,
11293 and we have added an input section, give an error.
11294 * layout.h (class Layout): Add have_added_input_section function.
11295 Add have_added_input_section_ field.
11296 * layout.cc (Layout::Layout): Initialize
11297 have_added_input_section_.
11298 (Layout::layout): Set have_added_input_section_.
11299 (Layout::layout_eh_frame): Likewise.
11300
fc59c572
ILT
113012009-12-30 Ian Lance Taylor <iant@google.com>
11302
11303 PR 10931
11304 * options.h (class General_options): Add --sort-common option.
11305 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
11306 * common.cc (Sort_common): Add sort_order parameter to
11307 constructor. Add sort_order_ field.
11308 (Sort_commons::operator): Check sort_order_.
11309 (Symbol_table::allocate_commons): Determine the sort order.
11310 (Symbol_table::do_allocate_commons): Add sort_order parameter.
11311 Change all callers.
11312 (Symbol_table::do_allocate_commons_list): Likewise.
11313
1c74fab0
ILT
113142009-12-30 Ian Lance Taylor <iant@google.com>
11315
11316 PR 10916
11317 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
11318 symbols from this object, don't change the visibility of an
11319 undefined symbol.
11320 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
11321
6affe781
ILT
113222009-12-30 Ian Lance Taylor <iant@google.com>
11323
11324 PR 10861
11325 * script.h (class Version_script_info): Define Language enum.
11326 Update declarations. Define Glob, Exact, and Lookup types. Add
11327 new fields globals_, locals_, and is_finalized_.
11328 * script.cc: Various formatting fixes.
11329 (class Parser_closure): Change language_stack_ from a vector of
11330 std::string to one of Version_script_info::Language. Adjust all
11331 uses accordingly.
11332 (class Lazy_demangler): Remove.
11333 (struct Version_expression): Change language from std::string to
11334 Version_script_info::Language.
11335 (Version_script_info::Version_script_info): New function.
11336 (Version_script_info::~Version_script_info): Don't call clear.
11337 (Version_script_info::finalize): New function.
11338 (Version_script_info::build_lookup_tables): New function.
11339 (Version_script_info::build_expression_list_lookup): New
11340 function.
11341 (Version_script_info::get_symbol_version_helper): Rewrite to use
11342 lookup tables.
11343 (Version_script_info::print_expression_list): Adjust to use
11344 Version_script_info::Language.
11345 (script_push_lex_into_version_mode): Check that the version script
11346 has not been finalized.
11347 (version_script_push_lang): Change language string to
11348 Version_script_info::Language.
11349 * options.cc (Command_line::version_script): New function.
11350 * options.h (class General_options): Add finalize_dynamic_list
11351 function. Change version_script from declaration to definition.
11352 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
11353 * testsuite/version_script.map: Remove duplicate def of foo.
11354 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
11355 version_script.map.
11356 * testsuite/Makefile.in: Rebuild.
11357
818bf354
ILT
113582009-12-30 Ian Lance Taylor <iant@google.com>
11359
11360 PR 10843
11361 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
11362 if the input symbol index is 0, make the output symbol index 0.
11363
ebcc8304
ILT
113642009-12-30 Ian Lance Taylor <iant@google.com>
11365
11366 PR 10670
11367 * options.h (class General_options): Add -x/--discard-all.
11368 * object.cc (Sized_relobj::do_count_local_symbols): Handle
11369 --discard-all. If the local symbol needs a dynamic entry, check
11370 that before handling --discard-locals.
11371
176fe33f
ILT
113722009-12-30 Ian Lance Taylor <iant@google.com>
11373
bb321bb1
ILT
11374 PR 10450
11375 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
11376 flags to PF_R.
11377 (Output_segment::add_output_section): Don't change the flags if
11378 the type is PT_TLS.
11379
176fe33f
ILT
11380 PR 10450
11381 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
11382 GNU hash table if they need a dynamic value. Otherwise, don't add
11383 them if they are defined in a dynamic object or are forced local.
11384
e8cd95c7
ILT
113852009-12-29 Ian Lance Taylor <iant@google.com>
11386
1b81fb71
ILT
11387 PR 10450
11388 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
11389 .gnu.hash table for a 32-bit target.
11390
8d6d383d
ILT
11391 PR 10450
11392 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
11393 regular and a dynamic object only needs a dynamic symbol table
11394 entry if it is externally visible.
11395
e785ec03
ILT
11396 PR 10450
11397 * i386.cc (class Target_i386): Initialize global_offset_table_ in
11398 constructor. Add global_offset_table_ field.
11399 (Target_i386::got_section): Set global_offset_table_.
11400 (Target_i386::do_finalize_sections): Set global_offset_table_
11401 size.
11402 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
11403 in constructor. Add global_offset_table_ field.
11404 (Target_x86_64::got_section): Set global_offset_table_.
11405 (Target_x86_64::do_finalize_sections): Set global_offset_table_
11406 size.
11407
1a2dff53
ILT
11408 * layout.cc (Layout::Layout): Initialize increase_relro_.
11409 (Layout::get_output_section): Add is_relro, is_last_relro, and
11410 is_first_non_relro parameters. Change all callers.
11411 (Layout::choose_output_section): Likewise.
11412 (Layout::add_output_section_data): Likewise.
11413 (Layout::make_output_section): Likewise.
11414 (Layout::set_segment_offsets): Clear increase_relro when using a
11415 linker script.
11416 * layout.h (class Layout): Add increase_relro method. Add
11417 increase_relro_ field. Update declarations.
11418 * output.cc (Output_section::Output_section): Initialize
11419 is_last_relro_ and is_first_non_relro_.
11420 (Output_segment::add_output_section): Group relro sections is
11421 do_sort is true. Handle is_last_relro and is_first_non_relro.
11422 (Output_segment::maximum_alignment): Remove relro handling.
11423 (Output_segment::set_section_addresses): Add increase_relro
11424 parameter. Change all callers. Add initial alignment to align
11425 relro sections on separate page. Remove old relro handling.
11426 (Output_segment::set_section_list_addresses): Remove in_relro
11427 parameter. Change all callers.
11428 (Output_segment::set_offset): Add increase parameter. Change all
11429 callers. Remove old relro handling.
11430 * output.h (class Output_section): Add new methods: is_last_relro,
11431 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
11432 Add is_last_relro_ and is_first_non_relro_ fields.
11433 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
11434 Create separate .got.plt section. Call increase_relro.
11435 * x86_64.cc (Target_x86_64::got_section): Likewise.
11436 * testsuite/relro_script_test.t: Add .got.plt.
11437
f0ba79e2
ILT
11438 PR 10450
11439 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
11440 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
11441 (Layout::finalize): Call set_dynamic_symbol_size.
11442 (Layout::set_dynamic_symbol_size): New function.
11443 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
11444 set_dynamic_symbol_size.
11445
e8cd95c7
ILT
11446 PR 10450
11447 * output.h (class Output_section): Add is_entsize_zero_ field.
11448 * output.cc (Output_section::Output_section): Initialize
11449 is_entsize_zero_.
11450 (Output_section::set_entsize): If two different entsizes are
11451 requested, force it to zero.
11452 (Output_section::add_input_section): Set flags for .debug_str
11453 before updating section flags. Set entsize.
11454 (Output_section::update_flags_for_input_section): Set SHF_MERGE
11455 and SHF_STRING if all input sections have those flags.
11456
3e1b9a8a
RÁE
114572009-12-29 Rafael Espindola <espindola@google.com>
11458
11459 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
11460 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
11461 reporting.
3e1b9a8a 11462
3dcad376
ST
114632009-12-29 Sriraman Tallam <tmsriram@google.com>
11464
11465 * options.cc (General_options::parse_version): Allow -v to exit
11466 without an error if there is nothing to link.
11467
084e2665
ILT
114682009-12-29 Ian Lance Taylor <iant@google.com>
11469
11470 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
11471 using a version of gcc before 4.1.
11472 * configure: Rebuild.
11473
250acde3
CD
114742009-12-28 Chris Demetriou <cgd@google.com>
11475
11476 * attributes.cc (Output_attributes_section_data::do_write): Use
11477 std::vector::front rather than std::vector::data.
11478
99fff23b
ILT
114792009-12-28 Ian Lance Taylor <iant@google.com>
11480
11481 * symtab.h (class Symbol_table): Add enum Defined.
11482 * resolve.cc (Symbol_table::should_override): Add defined
11483 parameter. Change all callers. Test whether object is NULL
11484 before calling a method on it.
11485 (Symbol_table::report_resolve_problem): Add defined parameter.
11486 Change all callers.
11487 (Symbol_table::should_override_with_special): Likewise.
11488 * symtab.cc (Symbol_table::define_in_output_data): Add defined
11489 parameter. Change all callers.
11490 (Symbol_table::do_define_in_output_data): Likewise.
11491 (Symbol_table::define_in_output_segment): Likewise.
11492 (Symbol_table::do_define_in_output_segment): Likewise.
11493 (Symbol_table::define_as_constant): Likewise.
11494 (Symbol_table::do_define_as_constant): Likewise.
11495 * script.h (class Symbol_assignment): Add is_defsym parameter to
11496 constructor; change all callers.
11497 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
11498 parameter. Change all callers. Add is_defsym_ field.
11499 (class Parser_closure): Add parsing_defsym parameter to
11500 constructor; change all callers. Add parsing_defsym accessor
11501 function. Add parsing_defsym_ field.
11502
556bd683
ILT
115032009-12-28 Ian Lance Taylor <iant@google.com>
11504
11505 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 11506 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 11507
1782c879
ILT
115082009-12-23 Ian Lance Taylor <iant@google.com>
11509
11510 * i386.cc (Target_i386::do_calls_non_split): Recognize
11511 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
11512 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
11513 -fsplit-stack prologue when using %r11.
1782c879 11514
329ca2b1
ST
115152009-12-21 Sriraman Tallam <tmsriram@google.com>
11516
11517 * options.cc (General_options::parse_version): Make -v continue and do
11518 the link like GNU ld does.
11519
d675ff46
RÁE
115202009-12-17 Rafael Avila de Espindola <espindola@google.com>
11521
11522 * Makefile.am (CCFILES): Add timer.cc.
11523 (HFILES): Add timer.h.
11524 * configure.ac: Check for sysconf and times.
11525 * main.cc: include timer.h.
11526 (main): Use Timer instead of get_run_time.
11527 * timer.cc: New.
11528 * timer.h: New.
11529 * workqueue.cc: include timer.h.
11530 (Workqueue::find_and_run_task):
11531 Report user, sys and wall time.
11532 * Makefile.in: Regenerate.
11533 * config.in: Regenerate.
11534 * configure: Regenerate.
11535
d6344fb5
DK
115362009-12-16 Doug Kwan <dougkwan@google.com>
11537
11538 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
11539 sections.
11540 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
11541 relaxed input sections.
11542 * output.cc (Output_section::find_relaxed_input_section): Change
11543 return type to Output_relaxed_input_section pointer. Adjust code
11544 for new type of relaxed_input_section_map_.
11545 * output.h (Output_section::find_relaxed_input_section): Change
11546 return type to Output_relaxed_input_section pointer.
11547 (Output_section::Output_relaxed_input_section_by_input_section_map):
11548 New type.
11549 (Output_section::relaxed_input_section_map_): Change type to
11550 Output_section::Output_relaxed_input_section_by_input_section_map.
11551 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
11552 input section.
11553
0e0d5469
ILT
115542009-12-15 Ian Lance Taylor <iant@google.com>
11555
11556 * layout.cc (Layout::create_shstrtab): Only write out after input
11557 sections if we are compressing debug sections.
11558
0649a889
ILT
115592009-12-15 Ian Lance Taylor <iant@google.com>
11560
11561 * archive.cc (Archive::add_symbols): Only look up a symbol without
11562 a version if there is, in fact, a version.
11563
2ea97941
ILT
115642009-12-14 Ian Lance Taylor <iant@google.com>
11565
11566 Revert -Wshadow changes, all changes from:
11567 2009-12-11 Doug Kwan <dougkwan@google.com>
11568 2009-12-11 Nick Clifton <nickc@redhat.com>
11569 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
11570
b0eec2cc
DK
115712009-12-11 Doug Kwan <dougkwan@google.com>
11572
11573 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
11574 due to -Wshadow.
11575 * attributes.cc (Object_attribute::size): Ditto.
11576 (Attributes_section_data::size): Ditto.
11577 (Attributes_section_data::Attributes_section_data): Ditto.
11578 (Output_attributes_section_data::do_write): Ditto.
11579 * attributes.h (Object_attribute::set_type): Ditto.
11580 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
11581
91d6fa6a
NC
115822009-12-11 Nick Clifton <nickc@redhat.com>
11583
11584 * archive.cc: Fix shadowed variable warnings.
11585 * arm.cc: Likewise.
11586 * compressed_output.cc: Likewise.
11587 * compressed_output.h: Likewise.
11588 * configure: Likewise.
11589 * dwarf_reader.cc: Likewise.
11590 * dynobj.cc: Likewise.
11591 * dynobj.h: Likewise.
11592 * ehframe.cc: Likewise.
11593 * ehframe.h: Likewise.
11594 * errors.cc: Likewise.
11595 * expression.cc: Likewise.
11596 * fileread.cc: Likewise.
11597 * fileread.h: Likewise.
11598 * freebsd.h: Likewise.
11599 * i386.cc: Likewise.
11600 * icf.cc: Likewise.
11601 * incremental.h: Likewise.
11602 * layout.cc: Likewise.
11603 * layout.h: Likewise.
11604 * mapfile.cc: Likewise.
11605 * merge.cc: Likewise.
11606 * merge.h: Likewise.
11607 * object.cc: Likewise.
11608 * object.h: Likewise.
11609 * options.h: Likewise.
11610 * output.cc: Likewise.
11611 * output.h: Likewise.
11612 * parameters.cc: Likewise.
11613 * plugin.cc: Likewise.
11614 * powerpc.cc: Likewise.
11615 * reduced_debug_output.cc: Likewise.
11616 * reduced_debug_output.h: Likewise.
11617 * reloc.cc: Likewise.
11618 * reloc.h: Likewise.
11619 * resolve.cc: Likewise.
11620 * script-sections.cc: Likewise.
11621 * script.cc: Likewise.
11622 * script.h: Likewise.
11623 * sparc.cc: Likewise.
11624 * symtab.cc: Likewise.
11625 * symtab.h: Likewise.
11626 * target-select.cc: Likewise.
11627 * target-select.h: Likewise.
11628 * token.h: Likewise.
11629 * workqueue.cc: Likewise.
11630 * workqueue.h: Likewise.
11631 * x86_64.cc: Likewise.
11632
a0351a69
DK
116332009-12-10 Doug Kwan <dougkwan@google.com>
11634
11635 * arm.cc (attributes.h): New include.
11636 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
11637 (Arm_relobj::~Arm_relobj): Delete object pointed by
11638 attributes_section_data_.
11639 (Arm_relobj::attributes_section_data): New method definition.
11640 (Arm_relobj::attributes_section_data_): New data member declaration.
11641 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
11642 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
11643 attributes_section_data_.
11644 (Arm_dynobj::attributes_section_data): New method definition.
11645 (Arm_dynobj::attributes_section_data_): New data member declaration.
11646 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
11647 initialization value of may_use_blx_ to false.
2e702c99 11648 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
11649 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
11650 object attributes to compute results instead of hard-coding.
11651 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
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):
11656 New method declarations.
11657 (Target_arm::get_aeabi_object_attribute): New method definition.
11658 (Target_arm::attributes_section_data_): New data member declaration.
11659 (read_arm_attributes_section): New template definition.
11660 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
11661 (Arm_dynobj::do_read_symbols): Ditto.
11662 (Target_arm::do_finalize_sections): Merge attributes sections from
11663 input. Check for BLX use after attributes section merging.
11664 Fix __exidx_start and __exidx_end visibility. Create an
11665 .ARM.attributes section if necessary.
11666 (Target_arm::get_secondary_compatible_arch,
11667 Target_arm::set_secondary_compatible_arch,
11668 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11669 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 11670 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
11671 New method definitions.
11672
b59befec
ILT
116732009-12-09 Ian Lance Taylor <iant@google.com>
11674
11675 * plugin.cc (Plugin::load): Don't cast from void* to a function
11676 pointer.
11677
1276bc89
ILT
116782009-12-09 Ian Lance Taylor <iant@google.com>
11679
11680 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
11681 information fields.
11682
2f2de248
L
116832009-12-09 H.J. Lu <hongjiu.lu@intel.com>
11684
11685 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
11686 Replace two_file_shared_1.so with two_file_shared_2.so.
11687 * testsuite/Makefile.in: Regenerated.
11688
4f787271
DK
116892009-12-08 Doug Kwan <dougkwan@google.com>
11690
11691 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
11692 (HFILES): Add attributes.h and int_encoding.h.
11693 * Makefile.in: Regenerate.
11694 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
11695 function definitions to int_encoding.cc
11696 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
11697 prototypes to int_encoding.h
11698 * reduced_debug_output.cc (int_encoding.h): New include.
11699 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
11700 function definitions to int_encoding.cc
11701 (insert_into_vector, read_from_pointer): Move template definitions to
11702 int_encoding.h
11703 * attributes.cc: New file.
11704 * attributes.h: New file.
11705 * int_encoding.cc: New file.
11706 * int_encoding.h: New file.
11707
20b52f1a
RÁE
117082009-12-07 Rafael Avila de Espindola <espindola@google.com>
11709
11710 PR gold/11055
11711 * incremental-dump.cc (dump_incremental_inputs): New.
11712 (main): Use dump_incremental_inputs.
11713
53d7974c
L
117142009-12-07 H.J. Lu <hongjiu.lu@intel.com>
11715
11716 PR gold/10893
11717 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
11718 checking elfcpp::STT_FUNC.
11719 (Target_i386::Relocate::relocate): Likewise.
11720 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
11721
11722 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
11723 symbols from shared libraries into normal FUNC symbols.
11724
11725 * symtab.h (Symbol): Add is_func and use it.
11726
05a352e6
DK
117272009-12-05 Doug Kwan <dougkwan@google.com>
11728
11729 * arm.cc (Target_arm::arm_info): Initialize new fields
11730 attributes_section and attributes_vendor.
11731 * i386.cc (Target_i386::i386_info): Same.
11732 * object.cc (Sized_relobj::do_layout): Skip attribute section.
11733 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
11734 fields attributes_section and attributes_vendor.
53d7974c 11735 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
11736 * target.h (Target::attributes_section, Target::attributes_vendor,
11737 Target::is_attributes_section, Target::attribute_arg_type,
11738 Target::attributes_order): New method definitions.
11739 (Target::Target_info::attributes_section,
11740 Target::Target_info::attributes_vendor): New fields.
11741 (Target::do_attribute_arg_type, Target::do_attributes_order): New
11742 virtual method definitions.
11743 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
11744 attributes_section and attributes_vendor.
11745 * testsuite/testfile.cc (Target_test::test_target_info): Same.
11746
f4e5969c
DK
117472009-12-05 Doug Kwan <dougkwan@google.com>
11748
11749 * arm.cc: Update comments about interworking and stub generation.
11750 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
11751 considered as non-PIC.
11752 (Arm_relocate_functions::base_abs): Fix formatting.
11753 (Arm_relocate_functions::got_prel): Fix comment. Change interface
11754 of function to use GOT entry address instead of offset.
11755 (Target_arm::Scan::global): Issue an error if a symbol would need a
11756 PLT does not get one because it is untyped. Remove code to create
11757 dynamic symbols for relative branches.
11758 (Target_arm::Relocate::relocate: Use 0 instead of false since function
11759 takes unsigned integer instead of boolean.
11760
1abce4a6
L
117612009-12-05 H.J. Lu <hongjiu.lu@intel.com>
11762
11763 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
11764 (two_file_test_LDADD): Likewise.
11765 (common_test_1_LDADD): Likewise.
11766 (exception_test_LDADD) Likewise.
11767 (weak_test_LDADD): Likewise.
11768 (many_sections_test_LDADD): Likewise.
11769 (initpri1_LDADD): Likewise.
11770 (script_test_1_LDADD): Likewise.
11771 (script_test_2_LDADD): Likewise.
11772 (justsyms_LDADD): Likewise.
11773 (binary_test_LDADD): Likewise.
11774 (large_LDADD): Likewise.
11775 * testsuite/Makefile.in: Regenerated.
11776
adcf2816 117772009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 11778
adcf2816
L
11779 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
11780 (Symbol_table::override_with_special): Likewise.
11781 (Symbol_table::add_from_object): Likewise.
11782
28e67f5d
RÁE
117832009-12-04 Rafael Avila de Espindola <espindola@google.com>
11784
11785 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11786 Don't set the data_offset twice.
11787
ae10a101
RÁE
117882009-12-04 Rafael Avila de Espindola <espindola@google.com>
11789
11790 * testsuite/Makefile.in: Regenerate.
11791
f59f41f3
DK
117922009-12-03 Doug Kwan <dougkwan@google.com>
11793
11794 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
11795 (Target_arm::do_finalize_sections): Add parameter for symbol table
11796 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
11797 * i386.cc (Target_i386::do_finalize_sections): Add an additional
11798 parameter for symbol table pointer.
11799 * layout.cc (Layout::finalize): Call Target::finalize_sections with
11800 an additional parameter for a pointer to symbol table.
11801 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
11802 parameter for a symbol table pointer.
11803 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
11804 * target.h (Target::finalize_sections, Target::do_finalize_sections):
11805 Ditto.
11806 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
11807 parameter for a symbol table pointer.
11808
ca55d848
RÁE
118092009-12-03 Rafael Avila de Espindola <espindola@google.com>
11810
11811 * incremental.cc (Incremental_inputs_header)
11812 (Incremental_inputs_header_write, Incremental_inputs_entry)
11813 (Incremental_inputs_entry_write): Move ...
11814 * incremental.h (Incremental_inputs_header)
11815 (Incremental_inputs_header_write, Incremental_inputs_entry)
11816 (Incremental_inputs_entry_write): here.
11817
3aec4f9c
RÁE
118182009-12-02 Rafael Avila de Espindola <espindola@google.com>
11819
11820 * incremental.cc (make_sized_incremental_binary): Set the target.
11821 Error if it is incompatible.
11822 * output.h (Output_file): Add filename method.
11823
9c0ae74d
RÁE
118242009-12-02 Rafael Avila de Espindola <espindola@google.com>
11825
11826 * incremental.cc (Incremental_inputs_entry): Remove unused argument
11827 from the get_* methods.
11828
a45500ae
RÁE
118292009-12-02 Rafael Avila de Espindola <espindola@google.com>
11830
11831 * incremental-dump.cc (main): Check that the offeset of a script is 0.
11832 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11833 Write 0 for the data_offset of scripts.
11834
325e6408
RÁE
118352009-12-02 Rafael Avila de Espindola <espindola@google.com>
11836
11837 * testsuite/Makefile.am: Add the incremental_test.sh test.
11838 * testsuite/incremental_test.sh: New.
11839 * testsuite/incremental_test_1.c: New.
11840 * testsuite/incremental_test_2.c: New.
11841
954c3e2e
RÁE
118422009-12-01 Rafael Avila de Espindola <espindola@google.com>
11843
703d02da 11844 * incremental-dump.cc (main): Fix typos.
954c3e2e 11845
f8086623
RÁE
118462009-11-27 Rafael Avila de Espindola <espindola@google.com>
11847
11848 PR gold/11025
11849 * incremental-dump.cc (main): Use llu to print 64 bit values.
11850
3b0dd6ac
L
118512009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
11852 H.J. Lu <hongjiu.lu@intel.com>
11853
11854 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
11855 $(LIBDL).
11856 (incremental_dump_LDADD): Likewise.
11857 * Makefile.in: Regenerated.
11858
a6d1ef57 118592009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 11860
a6d1ef57
DK
11861 Revert:
11862
11863 2009-11-25 Doug Kwan <dougkwan@google.com>
11864
11865 * arm.cc (Target_arm::Target_arm): Move method definition
11866 outside of class definition. Add code to handle
11867 --target1-rel, --target1-abs and --target2= options.
11868 (Target_arm::get_reloc_reloc_type): Change method to be
11869 non-static and const.
11870 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
11871 New data member declaration.
11872 (Target_arm::Scan::local, Target_arm::Scan::global,
11873 Target_arm::Relocate::relocate,
11874 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11875 Adjust call to Target_arm::get_real_reloc_type.
11876 (Target_arm::get_real_reloc_type): Use command line options
11877 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11878 * options.h (--target1-rel, --target1-abs, --target2): New
11879 ARM-only options.
11880
50aeb7d4
DK
118812009-11-25 Doug Kwan <dougkwan@google.com>
11882
11883 * arm.cc (Target_arm::Target_arm): Move method definition outside of
11884 class definition. Add code to handle --target1-rel, --target1-abs
11885 and --target2= options.
11886 (Target_arm::get_reloc_reloc_type): Change method to be non-static
11887 and const.
11888 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
11889 member declaration.
11890 (Target_arm::Scan::local, Target_arm::Scan::global,
11891 Target_arm::Relocate::relocate,
11892 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
11893 call to Target_arm::get_real_reloc_type.
11894 (Target_arm::get_real_reloc_type): Use command line options to
11895 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11896 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
11897 options.
11898
51938283
DK
118992009-11-25 Doug Kwan <dougkwan@google.com>
11900
11901 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
11902 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
11903 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
11904 formatting.
11905 (Arm_relocate_functions::thm_call): Replace body with a call to
11906 Arm_relocate_functions::thumb_branch_common.
11907 (Arm_relocate_functions::thm_jump24,
11908 Arm_relocate_functions::thm_xpc22): New method definitions.
11909 (Arm_relocate_functions::thumb_branch_common): New method definition.
11910 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
11911 operator.
11912 (Target_arm::Relocate::relocate): Adjust call to thm_call.
11913 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
11914
e2b8f3c4
RÁE
119152009-11-24 Rafael Avila de Espindola <espindola@google.com>
11916
11917 * Makefile.am: Build incremental-dump
11918 * Makefile.in: Regenerate.
11919 * incremental-dump.cc: New.
11920 * incremental.cc (Incremental_inputs_header_data,
11921 Incremental_inputs_entry_data): Move to incremental.h
11922 * incremental.h: (Incremental_inputs_header_data,
11923 Incremental_inputs_entry_data): Move from incremental.cc
11924
bcba9aec
RÁE
119252009-11-24 Rafael Avila de Espindola <espindola@google.com>
11926
11927 * incremental.cc (Incremental_inputs_header,
11928 Incremental_inputs_header_write, Incremental_inputs_entry,
11929 Incremental_inputs_entry_write): Add a typedef with the data type.
11930
7c3afe08
RÁE
119312009-11-24 Rafael Avila de Espindola <espindola@google.com>
11932
11933 * incremental.cc (Incremental_inputs_header,
11934 Incremental_inputs_header_write, Incremental_inputs_entry,
11935 Incremental_inputs_entry_write): Update comment about which
11936 type has the filed descriptions.
11937
d204b6e9
DK
119382009-11-15 Doug Kwan <dougkwan@google.com>
11939
11940 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
11941 (Arm_relocate_functions::arm_branch_common): Change method defintion
11942 in class definition to a method declaration and update list of formal
11943 parameters.
11944 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
11945 Arm_relocation_functions::jump24): Adjust call to
11946 Arm_relocate_functions::arm_branch_common. Update list of formal
11947 parameters.
11948 (Arm_relocate_functions::xpc25): New method definition.
11949 (Arm_relocate_functions::arm_branch_common): Move method defintion
11950 out from class definition. Use stubs for mode-switching and extending
11951 branch ranges.
11952 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
11953 specially. Change code to enable use of stubs in ARM branches.
11954
43d12afe
DK
119552009-11-10 Doug Kwan <dougkwan@google.com>
11956
11957 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
11958 in method declaration.
11959 (Target_arm::relocate_stub): New method declaration.
11960 (Target_arm::default_target): Change to return a pointer instead of
11961 a const reference.
11962 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
11963 Target_arm::default_target.
11964 (Arm_Relobj::do_relocate_sections): Remove options paramater in
11965 method definition.
11966 (Target_arm::relocate_section): Adjust view.
11967 (Target_arm::relocate_stub): New method definition.
11968
ac33a407
DK
119692009-11-10 Doug Kwan <dougkwan@google.com>
11970
11971 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
11972 a format warning.
11973 * incremental.cc (open_incremental_binary): Initialized local
11974 variables to avoid warnings.
11975 * object.cc (make_elf_object): Ditto.
11976 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
11977 a format warning.
e1df38aa 11978
88ee28e9
L
11979009-11-09 H.J. Lu <hongjiu.lu@intel.com>
11980
11981 PR gold/10930
11982 * testsuite/plugin_test.c: Include "config.h".
11983
2daedcd6
DK
119842009-11-09 Doug Kwan <dougkwan@google.com>
11985
11986 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
11987 (arm_symbol_value): Remove.
11988 (Arm_relocate_functions::arm_branch_common,
11989 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
11990 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
11991 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
11992 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
11993 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
11994 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
11995 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
11996 Arm_relocate_functions::thm_mobw_abs_nc,
11997 Arm_relocate_functions::thm_mov_abs,
11998 Arm_relocate_functions::movw_prel_nc,
11999 Arm_relocate_functions::thm_movt_abs,
12000 Arm_relocate_functions::movt_prel,
12001 Arm_relocate_functions::thm_movw_prel_nc,
12002 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
12003 (Target_arm::Relocate::relocate): Only decompose address into two
12004 parts if relocation type uses the thumb-bit and pass the actual
12005 bit instead of a flag indicating that the thumb-bit is used. Adjust
12006 calls to methods in Arm_relocate_functions for this change.
12007
1276bc89 120082009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
12009
12010 PR 10925
12011 * reloc.cc: Instantiate
12012 Sized_relobj::initialize_input_to_output_maps and
12013 Sized_relobj:free_input_to_output_maps.
12014
e53ad1b5
ILT
120152009-11-06 Ian Lance Taylor <iant@google.com>
12016
12017 PR 10876
12018 * defstd.cc (in_segment): Set only_if_ref true for "end".
12019
eb44217c
DK
120202009-11-06 Doug Kwan <dougkwan@google.com>
12021
12022 * arm.cc (class Reloc_stub): Correct a comment.
12023 (Target_arm::Target_arm): Initialize arm_input_section_map_.
12024 (Target_arm::scan_section_for_stubs): New method declaration.
12025 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
12026 Change methods from private to protected.
12027 (Target_arm::do_may_relax): New method definition.
12028 (Target_arm::do_relax, Target_arm::group_sections,
12029 Target_arm::scan_reloc_for_stub,
12030 Target_arm::scan_reloc_section_for_stubs): New method declarations.
12031 (Target_arm::arm_input_section_map_): New data member declaration.
12032 (Target_arm::scan_reloc_for_stub,
12033 Target_arm::scan_reloc_section_for_stubs,
12034 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
12035 Target_arm::do_relax): New method definitions.
12036
5d329b7d
ILT
120372009-11-06 Mikolaj Zalewski <mikolaj@google.com>
12038
12039 * configure.ac: Check for (struct stat)::st_mtim
12040 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
12041 * config.in: Regenerate.
12042 * configure: Regenerate.
12043
96a0d71b
ILT
120442009-11-05 Ian Lance Taylor <iant@google.com>
12045
12046 PR 10910
12047 * output.cc (Output_segment::add_output_section): Add missing
12048 return statement.
12049
594c8e5e
ILT
120502009-11-04 Ian Lance Taylor <iant@google.com>
12051
12052 PR 10880
12053 * object.h (class Object): Add is_needed and set_is_needed
12054 methods. Add is_needed_ field. Make bool fields into bitfields.
12055 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
12056 defined in a dynamic object and referenced by a regular object,
12057 set is_needed for the dynamic object.
12058 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
12059 if the file is marked with as_needed and it is not needed.
12060
22b127cc
ILT
120612009-11-04 Ian Lance Taylor <iant@google.com>
12062
12063 PR 10887
12064 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
12065 tags if data is discarded by linker script.
12066 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12067 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12068 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12069 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12070
f5c870d2
ILT
120712009-11-04 Ian Lance Taylor <iant@google.com>
12072
12073 * layout.cc (Layout::get_output_section): Add is_interp and
12074 is_dynamic_linker_section parameters. Change all callers.
12075 (Layout::choose_output_section): Likewise.
12076 (Layout::make_output_section): Likewise.
12077 (Layout::add_output_section_data): Add is_dynamic_linker_section
12078 parameter. Change all callers.
12079 * layout.h (class Layout): Update declarations.
12080 * output.h (class Output_section): Add is_interp, set_is_interp,
12081 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
12082 Add is_interp_, is_dynamic_linker_section_ fields. Change
12083 generate_code_fills_at_write_ to a bitfield.
12084 * output.cc (Output_section::Output_sections): Initialize new
12085 fields.
12086 (Output_segment::add_output_section): Add do_sort parameter.
12087 Change all callers.
12088
1ae4d23b
ILT
120892009-11-03 Ian Lance Taylor <iant@google.com>
12090
12091 PR 10860
12092 * options.h (class General_options): Add --warn-common.
12093 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
12094 merging two common symbols.
12095 (Symbol_table::should_override): Handle --warn-common when merging
12096 a common symbol with a defined symbol. Use report_resolve_problem
12097 for multiple definitions.
12098 (Symbol_table::report_resolve_problem): New function.
12099 * symtab.h (class Symbol_table): Declare report_resolve_problem.
12100
55da9579
DK
121012009-11-03 Doug Kwan <dougkwan@google.com>
12102
12103 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
12104 stub_factory_.
12105 (Target_arm::stub_factory): New method definition.
12106 (Target_arm::new_arm_input_section,
12107 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
12108 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 12109 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
12110 New type definitions.
12111 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
12112 member declarations.
12113 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
12114 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
12115 New method definitions.
12116
37a9ac43
ILT
121172009-11-03 Ian Lance Taylor <iant@google.com>
12118
12119 * options.h (class General_options): Add --warn_constructors.
12120
b3d6a3d4
ILT
121212009-11-03 Ian Lance Taylor <iant@google.com>
12122
12123 PR 10893
12124 * defstd.cc (in_section): Add entries for __rel_iplt_start,
12125 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
12126
934b01dd
ILT
121272009-11-03 Ian Lance Taylor <iant@google.com>
12128
12129 PR 10895
12130 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
12131 --msgid-bugs-address.
12132 (install-pdf): New target.
12133 (install-data_yes): Look up one directory to find mkinstalldirs.
12134
03c1939b
L
121352009-11-03 H.J. Lu <hongjiu.lu@intel.com>
12136
12137 * po/Make-in (.po.gmo): Don't generate .gmo files in source
12138 tree.
12139
ebd95253
DK
121402009-10-30 Doug Kwan <dougkwan@google.com>
12141
12142 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
12143
e9bbb538
DK
121442009-10-30 Doug Kwan <dougkwan@google.com>
12145
12146 * arm.cc (Stub_addend_reader): New struct template definition
12147 and partial specializations.
12148 (Stub_addend_reader::operator()): New method definition for a
12149 partially specialized template.
12150
d5b40221
DK
121512009-10-30 Doug Kwan <dougkwan@google.com>
12152
12153 * arm.cc (Arm_relobj::processor_specific_flags): New method
12154 definition.
12155 (Arm_relobj::do_read_symbols): New method declaration.
12156 (Arm_relobj::processor_specific_flags_): New data member declaration.
12157 (Arm_dynobj): New class definition.
12158 (Target_arm::do_finalize_sections): Add input_objects parameter.
12159 (Target_arm::do_adjust_elf_header): New method declaration.
12160 (Target_arm::are_eabi_versions_compatible,
12161 (Target_arm::merge_processor_specific_flags): New method declaration.
12162 (Target_arm::do_make_elf_object): New overloaded method definitions
12163 and declaration.
12164 (Arm_relobj::do_read_symbols): New method definition.
12165 (Arm_dynobj::do_read_symbols): Ditto.
12166 (Target_arm::do_finalize_sections): Add input_objects parameters.
12167 Merge processor-specific flags from all input objects.
12168 (Target_arm::are_eabi_versions_compatible,
12169 Target_arm::merge_processor_specific_flags,
12170 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
12171 New method definitions.
12172 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
12173 Input_objects pointer type parameter.
12174 * layout.cc (Layout::finalize): Pass input objects to target's.
12175 finalize_sections function.
12176 * output.cc (Output_file_header::do_sized_write): Set ELF file
12177 header's processor-specific flags.
12178 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
12179 Input_objects pointer type parameter.
12180 * sparc.cc (Target_sparc::do_finalize_sections): Same.
12181 * target.h (Input_objects): New forward class declaration.
12182 (Target::processor_specific_flags,
12183 Target::are_processor_specific_flags_sect): New method definitions.
12184 (Target::finalize_sections): Add input_objects parameter.
12185 (Target::Target): Initialize processor_specific_flags_ and
12186 are_processor_specific_flags_set_.
12187 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
12188 parameter.
12189 (Target::set_processor_specific_flags): New method definition.
12190 (Target::processor_specific_flags_,
12191 Target::are_processor_specific_flags_set_): New data member
12192 declarations.
12193 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
12194 Input_objects pointer type parameter.
12195
ebabffbd
DK
121962009-10-30 Doug Kwan <dougkwan@google.com>
12197
12198 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
12199
ad0f2072
ILT
122002009-10-28 Ian Lance Taylor <iant@google.com>
12201
12202 * object.h (class Relobj): Drop options parameter from
12203 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
12204 do_scan_relocs, do_relocate. Change all callers.
12205 (class Sized_relobj): Drop options parameters from
12206 do_gc_process_relocs, do_scan_relocs, do_relocate,
12207 do_relocate_sections, relocate_sections, emit_relocs_scan,
12208 emit_relocs_scan_reltype. Change all callers.
12209 (struct Relocate_info): Remove options field and all references to
12210 it.
12211 * reloc.h (class Read_relocs): Remove options constructor
12212 parameter and options_ field. Change all callers.
12213 (class Gc_process_relocs, class Scan_relocs): Likewise.
12214 (class Relocate_task): Likewise.
12215 * target-reloc.h (scan_relocs): Remove options parameter. Change
12216 all callers.
12217 (scan_relocatable_relocs): Likewise.
12218 * target.h (class Sized_target): Remove options parameter from
12219 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
12220 all callers.
12221 * gc.h (gc_process_relocs): Remove options parameter. Change all
12222 callers.
12223 * arm.cc: Update functions to remove options parameters.
12224 * i386.cc: Likewise.
12225 * powerpc.cc: Likewise.
12226 * sparc.cc: Likewise.
12227 * x86_64.cc: Likewise.
12228 * testsuite/testfile.cc: Likewise.
12229
8ffa3667
DK
122302009-10-28 Doug Kwan <dougkwan@google.com>
12231
12232 * arm.cc (Arm_relobj): New class definition.
e1df38aa 12233 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
12234 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
12235 New method definitions.
12236
40f36857
CC
122372009-10-28 Cary Coutant <ccoutant@google.com>
12238
12239 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
12240 (Plugin::cleanup_done_): New member.
12241 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
12242 (Plugin_manager::cleanup_done_): Remove.
12243 (Plugin_manager::add_input_file): Edit error message.
12244 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
12245 (Plugin_manager::cleanup): Remove use of cleanup_done_.
12246
2c849493
ILT
122472009-10-27 Mikolaj Zalewski <mikolajz@google.com>
12248
12249 * fileread.cc: (File_read::View::~View): Use the new
12250 data_ownership_ filed.
12251 (File_read::~File_read): Dispose the new whole_file_view_.
12252 (File_read::open): Mmap the whole file if needed.
12253 (File_read::open): Use whole_file_view_ instead of contents_.
12254 (File_read::find_view): Use whole_file_view_ if applicable.
12255 (File_read::do_read): Use whole_file_view_ instead of contents_.
12256 (File_read::make_view): Use whole_file_view_ instead of contents_,
12257 update File_read::View::View call.
12258 (File_read::find_or_make_view): Update File_read::View::View
12259 call.
12260 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
12261 remove contents_
12262 (File_read::View::Data_ownership): New enum.
12263 (File_read::View::View): Replace bool mapped_ with Data_ownership
12264 argument.
12265 (File_read::View::mapped_): Remove (replaced by data_ownership_).
12266 (File_read::View::data_ownership_): New field.
12267 (File_read::contents_): Remove (replaced by whole_file_view_).
12268 (File_read::whole_file_view_): New field.
12269 * options.h (class General_options): Add --keep-files-mapped.
12270
24998053
CC
122712009-10-27 Cary Coutant <ccoutant@google.com>
12272
12273 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
12274 * testsuite/Makefile.am (plugin_test_5): New test case.
12275 * testsuite/Makefile.in: Regenerate.
12276
72adc4fa
DK
122772009-10-25 Doug Kwan <dougkwan@google.com>
12278
12279 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
12280 from private to protected to allow access by child class.
12281 (Sized_relobj::do_relocate_sections): New method declaration.
12282 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 12283 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
12284 Sized_relobj::relocate_sections. Instantiate template explicitly
12285 for different target sizes and endianity.
12286
07f508a2
DK
122872009-10-24 Doug Kwan <dougkwan@google.com>
12288
12289 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
12290 (Arm_input_section::as_arm_input_section): New method.
12291 (Arm_output_section): New class definition.
12292 (Arm_output_section::create_stub_group,
12293 Arm_output_section::group_sections): New method definitions.
12294
10ad9fe5
DK
122952009-10-22 Doug Kwan <dougkwan@google.com>
12296
12297 * arm.cc (Arm_input_section): New class definition.
12298 (Arm_input_section::init, Arm_input_section:do_write,
12299 Arm_input_section::set_final_data_size,
12300 Arm_input_section::do_reset_address_and_file_offset): New method
12301 definitions.
12302
56ee5e00
DK
123032009-10-21 Doug Kwan <dougkwan@google.com>
12304
12305 * arm.cc (Stub_table, Arm_input_section): New forward class
12306 declarations.
12307 (Stub_table): New class defintion.
12308 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
12309 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
12310 New method definition.
12311
b569affa
DK
123122009-10-21 Doug Kwan <dougkwan@google.com>
12313
12314 * arm.cc: Update copyright comments.
12315 (Target_arm): New forward class template declaration.
12316 (Arm_address): New type.
12317 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
12318 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
12319 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
12320 constants.
12321 (Insn_template): Same.
12322 (DEF_STUBS): New macro.
12323 (Stub_type): New enum type.
12324 (Stub_template): New class definition.
12325 (Stub): Same.
12326 (Reloc_stub): Same.
12327 (Stub_factory): Same.
12328 (Target_arm::Target_arm): Initialize may_use_blx_ and
12329 should_force_pic_veneer_.
12330 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
12331 Target_arm::should_force_pic_veneer,
12332 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
12333 Target_arm::using_thumb_only, Target_arm:;default_target): New
12334 method defintions.
12335 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
12336 New data member declarations.
12337 (Insn_template::size, Insn_template::alignment): New method defintions.
12338 (Stub_template::Stub_template): New method definition.
12339 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
12340 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
12341 (Stub_factory::Stub_factory): New method definition.
12342 * gold.h (string_hash): New template.
12343 * output.h (Input_section_specifier::hash_value): Use
12344 gold::string_hash.
12345 (Input_section_specifier::string_hash): Remove.
12346 * stringpool.cc (Stringpool_template::string_hash): Use
12347 gold::string_hash.
12348
6c172549
DK
123492009-10-20 Doug Kwan <dougkwan@google.com>
12350
12351 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
12352 symbols of relaxed input sections.
12353 * output.h (Output_section::find_relaxed_input_section): Make
12354 method public.
12355
c5617f2f
DK
123562009-10-16 Doug Kwan <dougkwan@google.com>
12357
12358 * dynobj.cc (Versions::Versions): Initialize version_script_.
12359 Only insert base version symbol definition for a shared object
12360 if version script defines any version versions.
12361 (Versions::define_base_version): New method definition.
12362 (Versions::add_def): Check that base version is not needed.
12363 (Versions::add_need): Define base version lazily.
12364 * dynobj.h (Versions::define_base_version): New method declaration.
12365 (Versions::needs_base_version_): New data member declaration.
12366 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
12367 (check_DATA): Add no_version_test.stdout.
12368 (libno_version_test.so, no_version_test.o no_version_test.stdout):
12369 New make rules.
12370 * testsuite/Makefile.in: Regenerate.
12371 * testsuite/no_version_test.c: New file.
12372 * testsuite/no_version_test.sh: Ditto.
12373
3c12dcdb
DK
123742009-10-16 Doug Kwan <dougkwan@google.com>
12375
12376 * expression.cc (class Segment_start_expression): New class definition.
12377 (Segment_start_expression::value): New method definition.
12378 (script_exp_function_segment_start): Return a new
12379 Segment_start_expression.
12380 * gold/script-c.h (script_saw_segment_start_expression): New function
12381 prototype.
12382 * script-sections.cc (Script_sections::Script_sections): Initialize
12383 SAW_SEGMENT_START_EXPRESSION_ to false.
12384 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
12385 and -Tbbs options to specify section addresses if given in
12386 command line and no SEGMENT_START expression is seen in a script.
12387 * script-sections.h (Script_sections::saw_segment_start_expression,
12388 Script_sections::set_saw_segment_start_expression): New method
12389 definition.
12390 (Script_sections::saw_segment_start_expression_): New data member
12391 declaration.
12392 * script.cc (script_saw_segment_start_expression): New function.
12393 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
12394 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
12395 script_test_7.sh and script_test_8.sh.
12396 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
12397 script_test_8.stdout.
12398 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
12399 (script_test_6, script_test_6.stdout, script_test_7,
12400 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
12401 * Makefile.in: Regenerate.
12402 * testsuite/script_test_6.sh: New file.
12403 * testsuite/script_test_6.t: Same.
12404 * testsuite/script_test_7.sh: Same.
12405 * testsuite/script_test_7.t: Same.
12406 * testsuite/script_test_8.sh: Same.
12407
64b1ae37
DK
124082009-10-16 Doug Kwan <dougkwan@google.com>
12409
12410 * output.cc (Output_segment::set_section_list_address): Cast
12411 expressions to unsigned long long type to avoid format warnings.
12412
661be1e2
ILT
124132009-10-15 Ian Lance Taylor <iant@google.com>
12414
12edd763 12415 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 12416 dot assignment to script_sections_.
12edd763
ILT
12417 * script-sections.cc (Script_sections::add_dot_assignment):
12418 Initialize if necessary.
12419
68b6574b
ILT
12420 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
12421 program headers with no load segment if there is a linker script.
12422
661be1e2
ILT
12423 * layout.cc (Layout::set_segment_offsets): Align the file offset
12424 to the segment aligment for -N or -n with no load segment.
12425 * output.cc (Output_segment::add_output_section): Don't crash if
12426 the first section is a TLS section.
12427 (Output_segment::set_section_list_addresses): Print an error
12428 message if the address moves backward in a linker script.
12429 * script-sections.cc
12430 (Output_section_element_input::set_section_addresses): Don't
12431 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
12432 (Orphan_output_section::set_section_addresses): Likewise.
12433
f15f61a7
DK
124342009-10-15 Doug Kwan <dougkwan@google.com>
12435
12436 * layout.cc (Layout::finish_dynamic_section): Generate tags
12437 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
12438 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
12439 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
12440
82bb573a
ILT
124412009-10-14 Ian Lance Taylor <iant@google.com>
12442
12443 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
12444 fields.
12445 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
12446 data_shdr fields of relinfo.
12447 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
12448 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
12449 R_386_TLS_LDO_32, adjust based on section flags.
12450 (Target_i386::Relocate::fix_up_ldo): Remove.
12451
374ad285
ILT
124522009-10-13 Ian Lance Taylor <iant@google.com>
12453
12454 Add support for -pie.
12455 * options.h (class General_options): Add -pie and
12456 --pic-executable.
12457 (General_options::output_is_position_independent): Test -pie.
12458 (General_options::output_is_executable): Return true if not shared
12459 and not relocatable.
12460 (General_options::output_is_pie): Remove.
12461 * options.cc (General_options::finalize): Reject incompatible uses
12462 of -pie.
12463 * gold.cc (queue_middle_tasks): A -pie link is not static.
12464 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
12465 * symtab.cc (Symbol::final_value_is_known): Return false if
12466 output_is_position_independent.
12467 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
12468 output_is_position_independent.
12469 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
12470 output_is_position_independent.
12471 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
12472 output_is_position_independent.
12473 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
12474 two_file_pie_test.
12475 (basic_pie_test.o, basic_pie_test): New targets.
12476 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
12477 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
12478 (two_file_pie_test): New target.
12479 * testsuite/Makefile.in: Rebuild.
12480 * README: Remove note saying that -pie is not supported.
12481
c6585162
ILT
124822009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
12483
12484 * options.h (class General_options): Add -init and -fini.
12485 * layout.cc (Layout::finish_dynamic_section): Emit
12486 given init and fini functions.
12487
032ce4e9
ST
124882009-10-13 Sriraman Tallam <tmsriram@google.com>
12489
12490 * gc.h (gc_process_relocs): Check if icf is enabled using new
12491 function.
12492 * gold.cc (queue_initial_tasks): Likewise.
12493 (queue_middle_tasks): Likewise.
12494 * object.cc (do_layout): Likewise.
12495 * symtab.cc (is_section_folded): Likewise.
12496 * main.cc (main): Likewise.
12497 * reloc.cc (Read_relocs::run): Likewise.
12498 (Sized_relobj::do_scan_relocs): Likewise.
12499 * icf.cc (is_function_ctor_or_dtor): New function.
12500 (Icf::find_identical_sections): Check if function is ctor or dtor when
12501 safe icf is chosen.
12502 * options.h (General_options::icf): Change option to be an enum.
12503 (Icf_status): New enum.
12504 (icf_enabled): New method.
12505 (icf_safe_folding): New method.
12506 (set_icf_status): New method.
12507 (icf_status_): New variable.
12508 * (options.cc) (General_options::finalize): Set icf_status_.
12509 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
12510 icf_test and icf_keep_unique_test to use the --icf enum flag.
12511 * testsuite/icf_safe_test.sh: New file.
e1df38aa 12512 * testsuite/icf_safe_test.cc: New file.
032ce4e9 12513
f345227a
ST
125142009-10-12 Sriraman Tallam <tmsriram@google.com>
12515
12516 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
12517 includes to gc.h and icf.h.
12518 * arm.cc: Include gc.h.
12519 * gold.cc: Likewise.
12520 * i386.cc: Likewise.
12521 * powerpc.cc: Likewise.
12522 * sparc.cc: Likewise.
12523 * x86_64.cc: Likewise.
12524 * gc.h: Include icf.h.
12525
1c7814ed
ILT
125262009-10-11 Ian Lance Taylor <iant@google.com>
12527
12528 * plugin.cc: Include "gold.h" before other header files.
12529
ae3b5189
CD
125302009-10-10 Chris Demetriou <cgd@google.com>
12531
12532 * options.h (Input_file_argument::Input_file_type): New enum.
12533 (Input_file_argument::is_lib_): Replace with...
12534 (Input_file_argument::type_): New member.
12535 (Input_file_argument::Input_file_argument): Take Input_file_type
12536 'type' rather than boolean 'is_lib' as second argument.
12537 (Input_file_argument::is_lib): Use type_.
12538 (Input_file_argument::is_searched_file): New function.
12539 (Input_file_argument::may_need_search): Handle is_searched_file.
12540 * options.cc (General_options::parse_library): Support -l:filename.
12541 (General_options::parse_just_symbols): Update for Input_file_argument
12542 changes.
12543 (Command_line::process): Likewise.
12544 * archive.cc (Archive::get_file_and_offset): Likewise.
12545 * plugin.cc (Plugin_manager::release_input_file): Likewise.
12546 * script.cc (read_script_file, script_add_file): Likewise.
12547 * fileread.cc (Input_file::Input_file): Likewise.
12548 (Input_file::will_search_for): Handle is_searched_file.
12549 (Input_file::open): Likewise.
12550 * readsyms.cc (Read_symbols::get_name): Likewise.
12551 * testsuite/Makefile.am (searched_file_test): New test.
12552 * testsuite/Makefile.in: Regenerate.
12553 * testsuite/searched_file_test.cc: New file.
12554 * testsuite/searched_file_test_lib.cc: New file.
12555
f3048a1d
ILT
125562009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12557 Ian Lance Taylor <iant@google.com>
12558
12559 * descriptor.cc: Include <cstdio> and "binary-io.h".
12560 (Descriptors::open): Open the files in binary mode always.
12561 * script.cc (Lex::get_token): Treat \r as whitespace.
12562
d4780e57
ILT
125632009-10-09 Ian Lance Taylor <iant@google.com>
12564
12565 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
12566
d9a893b8
ILT
125672009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12568 Ian Lance Taylor <iant@google.com>
12569
12570 * configure.ac: Check for readv function also.
12571 * fileread.cc (readv): Define if not HAVE_READV.
12572 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
12573 does not exist.
12574 * config.in: Regenerate.
12575 * configure: Regenerate.
12576
c0a62865
DK
125772009-10-09 Doug Kwan <dougkwan@google.com>
12578
12579 * layout.cc (Layout::make_output_section): Call target hook to make
12580 ordinary output section.
12581 (Layout::finalize): Adjust parameter list of call the
12582 Target::may_relax().
12583 * layout.h (class Layout::section_list): New method.
12584 * merge.h (Output_merge_base::entsize): Change visibility to public.
12585 (Output_merge_base::is_string, Output_merge_base::do_is_string):
12586 New methods.
12587 (Output_merge_string::do_is_string): New method.
12588 * object.cc (Sized_relobj::do_setup): renamed from
12589 Sized_relobj::set_up.
12590 * object.h (Sized_relobj::adjust_shndx,
12591 Sized_relobj::initializ_input_to_output_maps,
12592 Sized_relobj::free_input_to_output_maps): Change visibilities to
12593 protected.
12594 (Sized_relobj::setup): Virtualize.
12595 (Sized_relobj::do_setup): New method declaration.
12596 (Sized_relobj::invalidate_section_offset,
12597 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
12598 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
12599 * options.cc (parse_int): New function.
12600 * options.h (parse_int): New declaration.
12601 (DEFINE_int): New macro.
12602 (stub_group_size): New option.
12603 * output.cc (Output_section::Output_section): Initialize memebers
12604 merge_section_map_, merge_section_by_properties_map_,
12605 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
12606 (Output_section::add_input_section): Handled deferred code-fill
12607 generation and remove an old comment.
12608 (Output_section::add_relaxed_input_section): New method definition.
12609 (Output_section::add_merge_input_section): Use merge section by
12610 properties map to speed to search. Update merge section maps
12611 as appropriate.
12612 (Output_section::build_relaxation_map): New method definition.
12613 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
12614 Same.
12615 (Output_section::relax_input_section): Renamed to
12616 Output_section::convert_input_sections_to_relaxed_sections and change
12617 interface to take a vector of pointers to relaxed sections.
12618 (Output_section::find_merge_section,
12619 Output_section::find_relaxed_input_section): New method definitions.
12620 (Output_section::is_input_address_mapped,
12621 Output_section::output_offset, Output_section::output_address):
12622 Use output section data maps to speed up searching.
12623 (Output_section::find_starting_output_address): Add comments.
12624 (Output_section::do_write,
12625 Output_section::write_to_postprocessing_buffer): Do code-fill
12626 generation as appropriate.
12627 (Output_section::get_input_sections): Invalidate relaxed input section
12628 map.
12629 (Output_section::restore_states): Adjust type of checkpoint .
12630 Invalidate relaxed input section map.
12631 * output.h (Output_merge_base): New class declaration.
12632 (Input_section_specifier): New class defintion.
12633 (class Output_relaxed_input_section) Change base class to
12634 Output_section_data_build.
12635 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
12636 base class initializer.
12637 (Output_section::add_relaxed_input_section): New method declaration.
12638 (Output_section::Input_section): Change visibility to protected.
2e702c99 12639 (Output_section::Input_section::relobj,
c0a62865
DK
12640 Output_section::Input_section::shndx): Handle relaxed input sections.
12641 Output_section::input_sections) Change visibility to protected. Also
12642 define overload to return a non-const pointer.
12643 (Output_section::Merge_section_properties): New class defintion.
12644 (Output_section::Merge_section_by_properties_map,
12645 Output_section::Output_section_data_by_input_section_map,
12646 Output_section::Relaxation_map): New types.
12647 (Output_section::relax_input_section): Rename method to
12648 Output_section::convert_input_sections_to_relaxed_sections and change
12649 interface to take a vector of relaxed section pointers.
12650 (Output_section::find_merge_section,
12651 Output_section::find_relaxed_input_section,
12652 Output_section::build_relaxation_map,
12653 Output_section::convert_input_sections_in_list_to_relaxed_sections):
12654 New method declarations.
12655 (Output_section::merge_section_map_
12656 Output_section::merge_section_by_properties_map_,
12657 Output_section::relaxed_input_section_map_,
12658 Output_section::is_relaxed_input_section_map_valid_,
12659 Output_section::generate_code_fills_at_write_): New data members.
12660 * script-sections.cc
12661 (Output_section_element_input::set_section_addresses): Call
12662 current_data_size and addralign methods of relaxed input sections.
12663 (Orphan_output_section::set_section_addresses): Call current_data_size
12664 and addralign methods of relaxed input sections.
12665 * symtab.cc (Symbol_table::compute_final_value): Extract template
12666 from the body of Symbol_table::sized_finalize_symbol.
12667 (Symbol_table::sized_finalized_symbol): Call
12668 Symbol_table::compute_final_value.
12669 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
12670 (Symbol_table::compute_final_value): New templated method declaration.
12671 * target.cc (Target::do_make_output_section): New method defintion.
12672 * target.h (Target::make_output_section): New method declaration.
12673 (Target::relax): Add more parameters for input objects, symbol table
12674 and layout. Adjust call to do_relax.
12675 (Target::do_make_output_section): New method declaration.
12676 (Target::do_relax): Add parameters for input objects, symbol table
12677 and layout.
12678
d446d6c4
ILT
126792009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12680
12681 * pread.c: Include stdio.h.
12682
bc06c745
ILT
126832009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12684
12685 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
12686 defined.
12687
75aea3d0
ILT
126882009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12689
12690 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
12691 Change read_shndx type to unsigned int.
12692 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12693 int.
12694 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12695 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
12696 Change read_shndx type to unsigned int.
12697 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12698 int.
12699 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12700 * layout.cc (Layout::create_symtab_sections): Cast the result of
12701 local_symcount * symsize to off_t in the gold_assert.
12702
be8fcb75
ILT
127032009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12704
12705 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
12706 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
12707 R_ARM_BASE_ABS.
12708 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
12709 (Arm_relocate_functions::thm_abs5): New function.
12710 (Arm_relocate_functions::abs12): New function.
12711 (Arm_relocate_functions::abs16): New function.
12712 (Arm_relocate_functions::base_abs): New function.
12713 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
12714 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
12715 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
12716 R_ARM_BASE_ABS.
12717 (Scan::global): Likewise.
12718 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
12719 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
12720 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
12721 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
12722 R_ARM_BASE_ABS.
12723
c2a122b6
ILT
127242009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12725
12726 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
12727 (Arm_relocate_functions::movt_prel): New function.
12728 (Arm_relocate_functions::thm_movw_prel_nc): New function.
12729 (Arm_relocate_functions::thm_movt_prel): New function.
12730 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
12731 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
12732 (Scan::global, Relocate::relocate): Likewise.
12733 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12734
c4aa1e2d
ILT
127352009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12736
12737 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
12738 Incremental_checker.
12739 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
12740 unsigned int.
12741 (class Incremental_inputs_header): New class.
12742 (Incremental_inputs_header_writer): Edit comment.
12743 (Incremental_inputs_entry): New class.
12744 (Incremental_inputs_entry_writer): Edit comment.
12745 (Sized_incremental_binary::do_find_incremental_inputs_section):
12746 Add *strtab_shndx parameter, fill it.
12747 (Sized_incremental_binary::do_check_inputs): New method.
12748 (Incremental_checker::can_incrementally_link_output_file): Use
12749 Sized_incremental_binary::check_inputs.
12750 (Incremental_inputs::report_command_line): Save command line in
12751 command_line_.
12752 * incremental.h:
12753 (Incremental_binary::find_incremental_inputs_section): New
12754 method.
12755 (Incremental_binary::do_find_incremental_inputs_section): Add
12756 strtab_shndx parameter.
12757 (Incremental_binary::do_check_inputs): New pure virtual method.
12758 (Sized_incremental_binary::do_check_inputs): Declare.
12759 (Incremental_checker::Incremental_checker): Add incremental_inputs
12760 parameter, use it to initialize incremental_inputs_.
12761 (Incremental_checker::incremental_inputs_): New field.
12762 (Incremental_checker::command_line): New method.
12763 (Incremental_checker::inputs): New method.
12764 (Incremental_checker::command_line_): New field.
12765
c549a694
ILT
127662009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12767
12768 * incremental.cc: Include <cstdarg> and "target-select.h".
12769 (vexplain_no_incremental): New function.
12770 (explain_no_incremental): New function.
12771 (Incremental_binary::error): New method.
12772 (Sized_incremental_binary::do_find_incremental_inputs_section): New
12773 method.
12774 (make_sized_incremental_binary): New function.
12775 (open_incremental_binary): New function.
12776 (can_incrementally_link_file): Add checks if output is ELF and has
12777 inputs section.
12778 * incremental.h: Include "elfcpp_file.h" and "output.h".
12779 (Incremental_binary): New class.
12780 (Sized_incremental_binary): New class.
12781 (open_incremental_binary): Declare.
12782 * object.cc (is_elf_object): Use
12783 elfcpp::Elf_recognizer::is_elf_file.
12784 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
12785 * output.h (Output_file::filesize): New method.
12786
fd3c5f0b
ILT
127872009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12788
12789 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
12790 New function.
12791 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
12792 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
12793 function.
12794 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
12795 function.
12796 (Arm_relocate_functions::movw_abs_nc): New function.
12797 (Arm_relocate_functions::movt_abs): New function.
12798 (Arm_relocate_functions::thm_movw_abs_nc): New function.
12799 (Arm_relocate_functions::thm_movt_abs): New function.
12800 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
12801 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
12802 (Scan::global): Likewise.
12803 (Relocate::relocate): Likewise.
12804 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12805
7f5309a5
ILT
128062009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12807
12808 * arm.cc (Arm_relocate_functions::got_prel) New function.
12809 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
12810 (Relocate::relocate): Likewise.
12811 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12812
364c7fa5
ILT
128132009-10-06 Ian Lance Taylor <iant@google.com>
12814
12815 * options.h (class General_options): Define
12816 split_stack_adjust_size parameter.
12817 * object.h (class Object): Add uses_split_stack_ and
12818 has_no_split_stack_ fields. Add uses_split_stack and
12819 has_no_split_stack accessor functions. Declare
12820 handle_split_stack_section.
12821 (class Reloc_symbol_changes): Define.
12822 (class Sized_relobj): Define Function_offsets. Declare
12823 split_stack_adjust, split_stack_adjust_reltype, and
12824 find_functions.
12825 * object.cc (Object::handle_split_stack_section): New function.
12826 (Sized_relobj::do_layout): Call handle_split_stack_section.
12827 * dynobj.cc (Sized_dynobj::do_layout): Call
12828 handle_split_stack_section.
12829 * reloc.cc (Sized_relobj::relocate_sections): Call
12830 split_stack_adjust for executable sections in split_stack
12831 objects. Pass reloc_map to relocate_section.
12832 (Sized_relobj::split_stack_adjust): New function.
12833 (Sized_relobj::split_stack_adjust_reltype): New function.
12834 (Sized_relobj::find_functions): New function.
12835 * target-reloc.h: Include "object.h".
12836 (relocate_section): Add reloc_symbol_changes parameter. Change
12837 all callers.
12838 * target.h (class Target): Add calls_non_split method. Declare
12839 do_calls_non_split virtual method. Declare match_view and
12840 set_view_to_nop.
12841 * target.cc: Include "elfcpp.h".
12842 (Target::do_calls_non_split): New function.
12843 (Target::match_view): New function.
12844 (Target::set_view_to_nop): New function.
12845 * gold.cc (queue_middle_tasks): Give an error if mixing
12846 split-stack and non-split-stack objects with -r.
12847 * i386.cc (Target_i386::relocate_section): Add
12848 reloc_symbol_changes parameter.
12849 (Target_i386::do_calls_non_split): New function.
12850 * x86_64.cc (Target_x86_64::relocate_section): Add
12851 reloc_symbol_changes parameter.
12852 (Target_x86_64::do_calls_non_split): New function.
12853 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
12854 parameter.
12855 * powerpc.cc (Target_powerpc::relocate_section): Add
12856 reloc_symbol_changes parameter.
12857 * sparc.cc (Target_sparc::relocate_section): Add
12858 reloc_symbol_changes parameter.
12859 * configure.ac: Call AM_CONDITIONAL for the default target.
12860 * configure: Rebuild.
12861 * testsuite/Makefile.am (TEST_AS): New variable.
12862 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
12863 (check_DATA): Add split_i386 and split_x86_64 files.
12864 (SPLIT_DEFSYMS): Define.
12865 (split_i386_[1234n].o): New targets.
12866 (split_i386_[124]): New targets.
12867 (split_i386_[1234r].stdout): New targets.
12868 (split_x86_64_[1234n].o): New targets.
12869 (split_x86_64_[124]): New targets.
12870 (split_x86_64_[1234r].stdout): New targets.
12871 (MOSTLYCLEANFILES): Add new executables.
12872 * testsuite/split_i386.sh: New file.
12873 * testsuite/split_x86_64.sh: New file.
12874 * testsuite/split_i386_1.s: New file.
12875 * testsuite/split_i386_2.s: New file.
12876 * testsuite/split_i386_3.s: New file.
12877 * testsuite/split_i386_4.s: New file.
12878 * testsuite/split_i386_n.s: New file.
12879 * testsuite/split_x86_64_1.s: New file.
12880 * testsuite/split_x86_64_2.s: New file.
12881 * testsuite/split_x86_64_3.s: New file.
12882 * testsuite/split_x86_64_4.s: New file.
12883 * testsuite/split_x86_64_n.s: New file.
12884 * testsuite/testfile.cc (Target_test): Update relocation_section
12885 function.
12886 * testsuite/Makefile.in: Rebuild.
12887
e8a9fcda
ILT
128882009-10-06 Ian Lance Taylor <iant@google.com>
12889
12890 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
12891 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
12892 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
12893 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
12894 the address on ldo_addrs_.
12895 (Target_i386::Relocate::fix_up_ldo): New function.
12896
e99daf92
ILT
128972009-10-06 Rafael Espindola <espindola@google.com>
12898
12899 * plugin.cc (add_input_library): New.
12900 (Plugin::load): Add add_input_library to tv.
12901 (Plugin_manager::add_input_file): Add the is_lib argument.
12902 (add_input_file): Update call to Plugin_manager::add_input_file.
12903 (add_input_library): New.
12904 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
12905
966d4097
DK
129062009-09-30 Doug Kwan <dougkwan@google.com>
12907
12908 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
12909 symbol and call Symbol::may_need_copy_reloc to determine if
12910 a copy reloc is needed.
12911 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
12912 nocopyreloc is given in command line.
12913 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
12914 given in command line.
12915 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
12916 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
12917 of the removed Target_i386::may_need_copy_reloc.
12918 * options.h (copyreloc): New option with default value false.
12919 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12920 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
12921 instead of the removed Target_powerpc::may_need_copy_reloc.
12922 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12923 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
12924 instead of the removed Target_sparc::may_need_copy_reloc.
12925 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
12926 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
12927 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
12928 instead of the removed Target_x86_64::may_need_copy_reloc.
12929
029ba973
ILT
129302009-09-30 Ian Lance Taylor <iant@google.com>
12931
12932 * object.h (class Object): Remove target_ field, and target,
12933 sized_target, and set_target methods.
12934 (Object::sized_target): Remove.
12935 (class Sized_relobj): Update declarations. Remove sized_target.
12936 * object.cc (Sized_relobj::setup): Remove target parameter.
12937 Change all callers.
12938 (Input_objects::add_object): Don't do anything with the target.
12939 (make_elf_sized_object): Add punconfigured parameter. Change all
12940 callers. Set or test parameter target.
12941 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
12942 Change all callers.
12943 * parameters.cc (Parameters::set_target): Change parameter type to
12944 be non-const.
12945 (Parameters::default_target): Remove.
12946 (set_parameters_target): Change parameter type to be non-const.
12947 (parameters_force_valid_target): New function.
12948 (parameters_clear_target): New function.
12949 * parameters.h (class Parameters): Update declarations. Remove
12950 default_target method. Add sized_target and clear_target
12951 methods. Change target_ to be non-const.
12952 (set_parameters_target): Update declaration.
12953 (parameters_force_valid_target): Declare.
12954 (parameters_clear_target): Declare.
12955 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
12956 as NULL if we aren't searching.
12957 (Add_symbols::run): Don't check for compatible target.
12958 * fileread.cc (Input_file::open_binary): Call
12959 parameters_force_valid_target.
12960 * gold.cc (queue_middle_tasks): Likewise.
12961 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
12962 set_target on object.
12963 * dynobj.h (class Sized_dynobj): Update declarations.
12964 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
12965 make_elf_object returns NULL.
12966 (Archive::include_member): Don't check whether object target is
12967 compatible.
12968 * output.cc (Output_section::add_input_section): Get target from
12969 parameters.
12970 (Output_section::relax_input_section): Likewise.
12971 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
12972 parameters.
12973 (Sized_relobj::do_scan_relocs): Likewise.
12974 (Sized_relobj::relocate_sections): Likewise.
12975 * resolve.cc (Symbol_table::resolve): Likewise.
12976 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
12977 parameter. Change all callers.
12978 (Symbol_table::add_from_object): Get target from parameters.
12979 (Symbol_table::add_from_relobj): Don't check object target.
12980 (Symbol_table::add_from_dynobj): Likewise.
12981 (Symbol_table::define_special_symbol): Get target from
12982 parameters.
12983 * symtab.h (class Symbol_table): Update declaration.
12984 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
12985 parameter. Change all callers. Clear parameter target.
12986 (Binary_test): Test target here.
12987 * testsuite/object_unittest.cc (gold_testsuite): Remove
12988 target_test_pointer parameter. Change all callers.
12989 (Object_test): Test target here.
12990
a6a22b83
ILT
129912009-09-26 Ian Lance Taylor <iant@google.com>
12992
12993 * testsuite/initpri1.c: Don't try to use constructor priorities if
12994 compiling with gcc before 4.3.
12995
6a8f49fe
ILT
129962009-09-22 Mikolaj Zalewski <mikolajz@google.com>
12997
12998 * testsuite/retain_symbols_file_test.sh (check_present): Change
12999 output file name to retain_symbols_file_test.stdout.
13000 (check_absent): Likewise.
13001
8c604651
CS
130022009-09-18 Craig Silverstein <csilvers@google.com>
13003
13004 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
13005 * options.cc: Include <cerrno> and <fstream>.
13006 (General_options::finalize): Parse -retain-symbols-file tag.
13007 * options.h: New flag.
13008 (General_options): New method should_retain_symbol, new
13009 variable symbols_to_retain.
13010 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
13011 should_retain_symbol map.
13012 * testsuite/Makefile.am (retain_symbols_file_test): New test.
13013 * testsuite/Makefile.in: Regenerate.
13014 * testsuite/retain_symbols_file_test.sh: New file.
13015
ca58b19f
NC
130162009-09-18 Nick Clifton <nickc@redhat.com>
13017
13018 * po/es.po: Updated Spanish translation.
13019
20e6d0d6
DK
130202009-09-17 Doug Kwan <dougkwan@google.com>
13021
13022 * debug.h (DEBUG_RELAXATION): New constant.
13023 (DEBUG_ALL): Add DEBUG_RELAXATION.
13024 (debug_string_to_enum): Add relaxation debug option.
13025 * layout.cc
13026 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
13027 Layout::Relaxation_debug_check::read_sections,
13028 Layout::Relaxation_debug_check::read_sections): New method definitions.
13029 (Layout::Layout): Initialize data members
13030 record_output_section_data_from_scrips_,
13031 script_output_section_data_list_ and relaxation_debug_check_.
13032 (Layout::save_segments, Layout::restore_segments,
13033 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13034 Layout::relaxation_loop_body): New method definitions.
13035 (Layout::finalize): Support relaxation. Move section layout code to
13036 Layout::relaxation_loop_body.
13037 (Layout::set_asection_address_from_script): Move code for orphan
13038 section placement out.
13039 (Layout::place_orphan_sections_in_script): New method definition.
13040 * layout.h (Output_segment_headers, Output_file_header):
13041 New forward class declarations.
13042 (Layout::~Layout): Define.
13043 (Layout::new_output_section_data_from_script): New method definition.
13044 (Layout::place_orphan_sections_in_script): New method declaration.
13045 (Layout::Segment_states): New type declaration.
13046 (Layout::save_segments, Layout::restore_segments,
13047 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13048 Layout::relaxation_loop_body): New method declarations.
13049 (Layout::Output_section_data_list): New type declaration.
13050 (Layout::Relaxation_debug_check): New class definition.
13051 (Layout::record_output_section_data_from_script_,
13052 Layout::script_output_section_data_list_, Layout::segment_states_,
13053 Layout::relaxation_debug_check_): New data members.
13054 * output.cc: (Output_section_headers::do_size): New method definition.
13055 (Output_section_headers::Output_section_headers): Move size
13056 computation to Output_section_headers::do_size.
13057 (Output_segment_headers::do_size): New method definition.
e1df38aa 13058 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
13059 Output_file_header::do_size and call it.
13060 (Output_file_header::do_size): New method definition.
13061 (Output_data_group::Output_data_group): Adjust call to
13062 Output_section_data.
13063 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
13064 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 13065 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
13066 RELAXED_INPUT_SECTION_CODE.
13067 (Output_section::Output_section): Initialize data member checkpoint_.
13068 (Output_section::~Output_section): Delete checkpoint object pointed
13069 by checkpoint_.
13070 (Output_section::add_input_section): Always add an Input_section if
13071 relaxing.
13072 (Output_section::add_merge_input_section): Add assert.
13073 (Output_section::relax_input_section): New method definition.
13074 (Output_section::set_final_data_size): Set load address to zero for
13075 an unallocated section.
13076 (Output_section::do_address_and_file_offset_have_reset_values):
13077 New method definition.
13078 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
13079 Handle relaxed input section.
13080 (Output_section::sort_attached_input_sections): Checkpoint input
13081 section list lazily.
13082 (Output_section::get_input_sections): Change type of input_sections to
13083 list of Simple_input_section pointers. Checkpoint input section list
13084 lazily. Also handle relaxed input sections.
13085 (Output_section::add_input_section_for_script): Take a reference to
13086 a Simple_input_section object instead of Relobj pointer and section
13087 index as parameter. Handle relaxed input sections.
13088 (Output_section::save_states, Output_section::restore_states): New
13089 method definitions.
13090 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
13091 (Output_data::is_data_size_fixed): New method definition.
13092 (Output_data::reset_addresss_and_file_offset): Do not reset data size
13093 if it is fixed.
13094 (Output_data::address_and_file_offset_have_reset_values): New method
13095 definition.
13096 (Output_data::do_address_and_file_offset_have_reset_values): New method
13097 definition.
13098 (Output_data::set_data_size): Check that data size is not fixed.
13099 (Output_data::fix_data_size): New method definition.
13100 (Output_data::is_data_size_fixed_): New data member.
13101 (Output_section_headers::set_final_data_size): New method definition.
13102 (Output_section_headers::do_size): New method declaration.
13103 (Output_segment_headers::set_final_data_size): New method definition.
13104 (Output_segment_headers::do_size): New method declaration.
13105 (Output_file_header::set_final_data_size)::New method definition.
13106 (Output_file_header::do_size)::New method declaration.
13107 (Output_section_data::Output_section_data): Add new parameter
13108 is_data_size_fixed and use it to fix data size.
13109 (Output_data_const::Output_data_const): Adjust call to base class
13110 constructor and fix data size.
13111 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
13112 base class constructor and fix data size.
13113 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
13114 base class constructor and fix data size.
13115 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
13116 class constructor and fix data size.
13117 (Output_data_group::set_final_data_size): New method definition.
13118 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
13119 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
13120 class constructor and fix data size.
13121 (Output_relaxed_input_section): New class definition.
13122 (Output_section::Simple_input_section): New class definition.
13123 (Output_section::get_input_sections): Adjust parameter list.
13124 (Output_section::add_input_section_for_script): Same.
13125 (Output_section::save_states, Output_section::restore_states,
13126 Output_section::do_address_and_file_offset_have_reset_values,
13127 (Output_section::Input_section::Input_section): Handle
13128 RELAXED_INPUT_SECTION_CODE. Add new overload for
13129 Output_relaxed_input_section.
13130 (Output_section::Input_section::is_input_section,
13131 Output_section::Input_section::set_output_section): Handle relaxed
13132 input section.
13133 (Output_section::Input_section::is_relaxed_input_section,
13134 Output_section::Input_section::output_section_data,
13135 Output_section::Input_section::relaxed_input_section): New method
13136 definitions.
13137 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
13138 value.
13139 (Output_section::Input_section::u1_): Update comments.
13140 (Output_section::Input_section::u2_): Add new union member poris.
13141 (Output_section::Checkpoint_output_section): New classs definition.
13142 (Output_section::relax_input_section): New method declaration.
13143 (Output_section::checkpoint_): New data member.
13144 (Output_segment): Update comments.
13145 (Output_segment::Output_segment): Un-privatize copy constructor.
13146 (Output_segment::operator=): Un-privatize.
13147 * script-sections.cc (Output_section_element::Input_section_list):
13148 Change element type to Output_section::Simple_input_section.
13149 (Output_section_element_dot_assignment::set_section_addresses):
13150 Register output section data for relaxation clean up.
13151 (Output_data_exression::Output_data_expression): Adjust call to base
13152 constructor to fix data size.
13153 (Output_section_element_data::set_section_addresses): Register
13154 Output_data_expression object for relaxation clean up.
13155 (struct Input_section_info): Replace Relobj pointer and section index
13156 pair with Output_section::Simple_input_section and Convert struct to a
13157 class.
13158 (Input_section_sorter::operator()): Adjust access to
e1df38aa 13159 Input_section_info data member to use accessors.
20e6d0d6
DK
13160 (Output_section_element_input::set_section_addresses): Use layout
13161 parameter. Adjust code to use Output_section::Simple_input_section
13162 and Input_secction_info classes. Register filler for relaxation
13163 clean up.
13164 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
13165 and section index pair with Output_section::Simple_input_section
13166 class. Adjust code accordingly.
13167 (Phdrs_element::release_segment): New method definition.
13168 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
13169 segment list.
13170 (Script_sections::release_segments): New method definition.
13171 * gold/script-sections.h (Script_sections::release_segments): New
13172 method declaration.
13173 * gold/target.h (Target::may_relax, Target::relax,
13174 Target::do_may_relax, Target::do_relax): New method definitions.
13175
5e445df6
ILT
131762009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13177
13178 * arm.cc (has_signed_unsigned_overflow): New function.
13179 (Arm_relocate_functions::abs8): New function.
13180 (Target_arm::Scan::local): Handle R_ARM_ABS8.
13181 (Target_arm::Scan::global): Likewise.
13182 (Target_arm::relocate::relocate): Likewise.
13183 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
13184 Likewise.
13185
8c604651 131862009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
13187
13188 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
13189 * testsuite/Makefile.in: Regenerate.
13190
1e9cc1c2
NC
131912009-09-11 Nick Clifton <nickc@redhat.com>
13192
13193 * po/gold.pot: Updated by the Translation project.
13194
6a89f575
CC
131952009-09-08 Cary Coutant <ccoutant@google.com>
13196
13197 * output.cc (Output_file::open): Add execute permission to empty file.
13198 * testsuite/Makefile.am (permission_test): New test.
13199 * testsuite/Makefile.in: Regenerate.
13200
fdcac5af
ILT
132012009-09-02 Ian Lance Taylor <iant@google.com>
13202
13203 * output.cc (Output_file::resize): Call map_no_anonymous rather
13204 than map.
13205
44453f85
ILT
132062009-09-01 Mikolaj Zalewski <mikolajz@google.com>
13207
13208 * gold.cc: Include "incremental.h".
13209 (queue_initial_tasks): Call Incremental_checker methods.
13210 * incremental.cc: Include "output.h".
13211 (Incremental_checker::can_incrementally_link_output_file): New
13212 method.
13213 * incremental.h (Incremental_checker): New class.
13214
13215 * output.cc (Output_file::open_for_modification): New method.
13216 (Output_file::map_anonymous): Changed return type to bool. Record
13217 map in base_ field.
13218 (Output_file::map_no_anonymous): New method, broken out of map.
13219 (Output_file::map): Use map_no_anonymous and map_anonymous.
13220 * output.h (class Output_file): Update declarations.
13221
293c1386
CC
132222009-08-24 Cary Coutant <ccoutant@google.com>
13223
13224 * options.h (Command_line::Pre_options): New class.
13225 (Command_line::pre_options): New member.
13226 * options.cc (gold::options::ready_to_register): New variable.
13227 (One_option::register_option): Do nothing if not registering options.
13228 Assert if same short option registered twice.
13229 (General_options::General_options): Turn off option registration when
13230 done constructing.
13231 (Command_line::Pre_options::Pre_options): New constructor.
13232
f773f3d2
CC
132332009-08-24 Cary Coutant <ccoutant@google.com>
13234
06a73cfe
CC
13235 * options.h (General_options::no_keep_memory): Remove incorrect
13236 short option.
f773f3d2 13237
a15af8e2
RW
132382009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13239
13240 * Makefile.am (am__skiplex, am__skipyacc): New.
13241 * Makefile.in: Regenerate.
13242
c462b41b
RW
132432009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13244
14ec8efd
RW
13245 * Makefile.am (AM_CPPFLAGS): Renamed from ...
13246 (INCLUDES): ... this.
13247 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
13248 (AM_CPPFLAGS): Renamed from ...
13249 (INCLUDE): ... this.
13250 * Makefile.in, testsuite/Makefile.in: Regenerate.
13251
81ecdfbb
RW
13252 * Makefile.in: Regenerate.
13253 * aclocal.m4: Likewise.
13254 * config.in: Likewise.
13255 * configure: Likewise.
13256 * testsuite/Makefile.in: Likewise.
13257
c462b41b
RW
13258 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13259 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13260 * Makefile.in: Regenerate.
13261 * testsuite/Makefile.in: Regenerate.
13262
2da73f13
CC
132632009-08-19 Cary Coutant <ccoutant@google.com>
13264
13265 * resolve.cc (Symbol_table::resolve): Don't complain about defined
13266 symbols in shared libraries overridden by hidden or internal symbols
13267 in the main program.
13268
2db70501
CD
132692009-08-19 Chris Demetriou <cgd@google.com>
13270
13271 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
13272 checking source file names in error messages.
13273
f733487b
DK
132742009-08-18 Doug Kwan <dougkwan@google.com>
13275
13276 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
13277 an elcpp::Ehdr as parameter. Adjust call to set_target.
13278 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
13279 an elfcpp::Ehdr as parameter.
13280 * object.cc (Object::set_target): Remove the version that looks up
13281 a target and sets it.
13282 (Sized_relobj::setup): Take a Target object instead of
13283 an elfcpp::Ehdr as parameter. Adjust call to set_target.
13284 (make_elf_sized_object): Find target and ask target to
13285 make an ELF object.
13286 * object.h: (Object::set_target): Remove the version that looks up
13287 a target and sets it.
13288 (Sized_relobj::setup): Take a Target object instead of
13289 an elfcpp:Ehdr as parameter.
13290 * target.cc: Include dynobj.h.
13291 (Target::do_make_elf_object_implementation): New.
2e702c99 13292 (Target::do_make_elf_object): New.
f733487b
DK
13293 * target.h (Target::make_elf_object): New template declaration.
13294 (Target::do_make_elf_object): New method declarations.
13295 (Target::do_make_elf_object_implementation): New template declaration.
13296
cc70f101
ILT
132972009-08-14 Ian Lance Taylor <iant@google.com>
13298
13299 * gold.h (FUNCTION_NAME): Define.
13300 (gold_unreachable): Use FUNCTION_NAME.
13301
ef5e0cb1
ST
133022009-08-12 Sriraman Tallam <tmsriram@google.com>
13303
13304 * icf.cc (Icf::find_identical_sections): Issue a warning when a
13305 symbol in the --keep-unique list is not found.
13306
48c187ce
ST
133072009-08-12 Sriraman Tallam <tmsriram@google.com>
13308
13309 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
13310 been maked as --keep-unique.
13311 (Icf::unfold_section): New function.
13312 * icf.h (Icf::unfold_section): New function.
13313 * options.h (General_options::keep_unique): New option.
13314 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
13315 * testsuite/Makefile.in: Regenerate.
13316 * testsuite/icf_keep_unique_test.sh: New file.
13317 * testsuite/icf_keep_unique_test.cc: New file.
13318
645afe0c
CC
133192009-08-12 Cary Coutant <ccoutant@google.com>
13320
13321 PR 10471
13322 * resolve.cc (Symbol_table::resolve): Check for references from
13323 dynamic objects to hidden and internal symbols.
13324 * testsuite/Makefile.am (hidden_test.sh): New test.
13325 * testsuite/Makefile.in: Regenerate.
13326 * testsuite/hidden_test.sh: New script.
13327 * testsuite/hidden_test_1.c: New test source.
13328 * testsuite/hidden_test_main.c: New test source.
13329
11af873f
DK
133302009-08-11 Doug Kwan <dougkwan@google.com>
13331
13332 * arm.cc: Update comments.
13333 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
13334 segment to locate the .ARM.exidx section if present.
13335
b9f7d72d
DK
133362009-08-09 Doug Kwan <dougkwan@google.com>
13337
13338 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
13339 patch.
13340
ddd3c53c
ST
133412009-08-07 Sriraman Tallam <tmsriram@google.com>
13342 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
13343 compiler warnings.
13344
27721062
ST
133452009-08-06 Sriraman Tallam <tmsriram@google.com>
13346
13347 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
13348 valid tls_segment only for non-debug-section relocations.
13349 * testsuite/Makefile.am: Add gc_tls_test.
13350 * testsuite/Makefile.in: Regenerate.
13351 * testsuite/gc_tls_test.cc: New file.
13352 * testsuite/gc_tls_test.sh: New file.
13353
ef15dade 133542009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 13355
ef15dade
ST
13356 * icf.cc: New file.
13357 * icf.h: New file.
13358 * Makefile.am (CCFILES): Add icf.cc.
13359 (HFILES): Add icf.h
13360 * Makefile.in: Regenerate.
13361 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
13362 * gc.h (gc_process_relocs): Populate lists used by icf to contain
13363 section, symbol and addend information for the relocs.
13364 * gold.cc (queue_middle_tasks): Call identical code folding.
13365 * gold.h: Add defines for multimap.
13366 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
13367 to the call of finalize_local_symbols.
13368 * main.cc (main): Create object of class Icf.
13369 * object.cc (Sized_relobj::do_layout): Allow this function to be
13370 called twice during icf.
13371 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
13372 to sections marked as identical by icf.
13373 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
13374 when available.
13375 (Sized_relobj::do_section_entsize): New function.
13376 * object.h (Object::section_entsize): New function.
13377 (Object::do_section_entsize): New pure virtual function.
13378 (Relobj::finalize_local_symbols): Add new parameter.
13379 (Relobj::do_section_entsize): New function.
13380 * options.h (General_options::icf): New option.
13381 (General_options::icf_iterations): New option.
13382 (General_options::print_icf_sections): New option.
13383 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
13384 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
13385 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
13386 icf.
13387 * symtab.cc (Symbol_table::is_section_folded): New function.
13388 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
13389 to sections marked as identical by icf.
13390 * symtab.h (Symbol_table::set_icf): New function.
13391 (Symbol_table::icf): New function.
13392 (Symbol_table::is_section_folded): New function.
13393 (Symbol_table::icf_): New data member.
13394 * target-reloc.h (relocate_section): Ignore sections folded by icf.
13395 * testsuite/Makefile.am: Add commands to build icf_test.
13396 * testsuite/Makefile.in: Regenerate.
13397 * testsuite/icf_test.sh: New file.
13398 * testsuite/icf_test.cc: New file.
13399
c3b65ac4
CD
134002009-07-24 Chris Demetriou <cgd@google.com>
13401
13402 * layout.cc (is_compressible_debug_section): Fix incorrect
13403 comment about compressed section names.
13404
1caf2c51
ILT
134052009-07-20 Ian Lance Taylor <ian@airs.com>
13406
13407 PR 10419
13408 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
13409
1ef4d87f
ILT
134102009-07-16 Ian Lance Taylor <iant@google.com>
13411
13412 PR 10400
13413 * layout.h: #include <map>.
13414 (class Kept_section): Change from struct to class. Add accessors
13415 and setters. Add section size to Comdat_group mapping. Change
13416 Comdat_group to std::map. Add is_comdat_ field. Add
13417 linkonce_size field in union.
13418 (class Layout): Update declaration of find_or_add_kept_section.
13419 Don't declare find_kept_object.
13420 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
13421 parameter. Add object, shndx, is_comdat, and is_group_name
13422 parameters. Change all callers. Adjust for new Kept_section.
13423 (Layout::find_kept_object): Remove.
13424 * object.cc (Sized_relobj::include_section_group): Update use of
13425 Kept_section. Rename secnum to shndx. Only record
13426 Kept_comdat_section if sections are the same size.
13427 (Sized_relobj::include_linkonce_section): Update use of
13428 Kept_section. Only record Kept_comdat_section if sections are the
13429 same size. Set size of linkonce section.
13430 (Sized_relobj::map_to_kept_section): Update call to
13431 get_kept_comdat_section.
13432 * object.h (class Sized_relobj): Rename fields in
13433 Kept_comdat_section to drop trailing underscores; change object
13434 field to Relobj*. Change Kept_comdat_section_table to store
13435 struct rather than pointer.
13436 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
13437 Add kept_object and kept_shndx parameters. Change all callers.
13438 (Sized_relobj::get_kept_comdat_section): Change return type to
13439 bool. Add kept_object and kept_shndx parameters. Change all
13440 callers.
13441 * plugin.cc (Pluginobj::include_comdat_group): Update call to
13442 Layout::find_or_add_kept_section.
13443
37c3b7b0
ILT
134442009-07-09 Ian Lance Taylor <iant@google.com>
13445
13446 * merge.cc (Object_merge_map::initialize_input_to_output_map):
13447 Reserve space in the hash table.
13448
98fa85cb
ILT
134492009-07-06 Mikolaj Zalewski <mikolajz@google.com>
13450
13451 * fileread.cc (File_read::get_mtime): New method.
13452 * fileread.h (Timespec): New structure.
13453 (File_read::get_mtime): New method.
13454 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
13455 Renamed from timestamp_nsec.
13456 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
13457 Elf_Xword.
e1df38aa 13458 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 13459 timestamp_nsec.
e1df38aa 13460 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
13461 (Incremental_inputs::report_obejct): Save mtime; style fix.
13462 (Incremental_inputs::report_script): Save mtime; style fix.
13463 (Incremental_inputs::finalize_inputs): Style fix.
13464 (Incremental_inputs::finalize): Style fix.
13465 (Incremental_inputs::create_input_section_data): Store inputs
13466 mtime.
13467 * incremental.h (Incremental_inputs::report_script): Add mtime
13468 argument.
13469 (Incremental_inputs::Input_info::Input_info): Intialize only one
13470 union member.
13471 (Incremental_inputs::Input_info::archive): Move to nameless
13472 union.
13473 (Incremental_inputs::Input_info::obejct): Move to nameless union.
13474 (Incremental_inputs::Input_info::script): Move to nameless union.
13475 (Incremental_inputs::mtime): New field.
13476 * script.cc (read_input_script): Pass file mtime to
13477 Incremental_input.
13478 * script.h (Script_info::inputs): Style fix.
13479
c9d70757
ILT
134802009-07-01 Ian Lance Taylor <ian@airs.com>
13481
13482 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
13483 instead of 32.
13484
9c547ec3
ILT
134852009-06-24 Ian Lance Taylor <iant@google.com>
13486
13487 PR 10156
13488 * layout.cc (Layout::choose_output_section): If we find an
13489 existing section, update the flags.
13490 (Layout::create_notes): New function, broken out of
13491 Layout::finalize.
13492 (Layout::finalize): Don't create note sections.
13493 (Layout::create_note): Don't crash if linker script discards
13494 section.
13495 (Layout::create_gold_note): Likewise.
13496 (Layout::create_build_id): Likewise. Don't set
13497 after_input_sections on the section.
13498 (Layout::create_executable_stack_info): Remove target parameter.
13499 Change caller.
13500 * layout.h (class Layout): Declare create_notes. Update
13501 declaration of create_executable_stack_info.
13502 * gold.cc (queue_middle_tasks): Call create_notes.
13503 * output.cc (Output_section::update_flags_for_input_section): Move
13504 here from output.h. If SHF_ALLOC flag is newly set, mark address
13505 invalid.
13506 * output.h (Output_data::mark_address_invalid): New function.
13507 (class Output_section): Only declare, not define,
13508 update_flags_for_input_section. Remove set_flags.
13509
55458500
ILT
135102009-06-24 Ian Lance Taylor <iant@google.com>
13511
13512 * script-sections.cc (Output_section_definition::
13513 set_section_addresses): Rename shadowing local load_address to
13514 laddr.
13515
1307d6cd
ILT
135162009-06-24 Ian Lance Taylor <iant@google.com>
13517
13518 PR 10244
13519 * reloc.cc (relocate_sections): Skip empty relocation sections.
13520
ec3f783e
ILT
135212009-06-23 Ian Lance Taylor <iant@google.com>
13522
13523 PR 10156
13524 * layout.cc (Layout::create_note): Use choose_output_section
13525 rather than make_output_section.
13526
459c9f1c
ILT
135272009-06-23 Ian Lance Taylor <iant@google.com>
13528
13529 PR 10237
13530 * options.cc (General_options::parse_V): Set printed_version_.
13531 (General_options::General_options): Initialize printed_version_.
13532 * options.h (class General_options): Add printed_version_ field.
13533 * gold.cc (queue_initial_tasks): If there are no input files,
13534 don't give a fatal error if we printed the version information.
13535 (queue_middle_tasks): If using -r with a shared object, give a
13536 fatal error rather than an ordinary error.
13537
1518dc8f
ILT
135382009-06-23 Ian Lance Taylor <iant@google.com>
13539
13540 PR 10219
13541 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
13542 (Layout::make_output_section): Set have_stabstr_section_ if we see
13543 a .stab*str section.
13544 (Layout::finalize): Call link_stabs_sections.
13545 (Layout::link_stabs_sections): New file.
13546 * layout.h (class Layout): Add have_stabstr_section_ field.
13547 Declare link_stabs_sections.
13548
3d857b98
DK
135492009-06-23 Doug Kwan <dougkwan@google.com>
13550
13551 * Makefile.am (libgold_a_LIBADD): New.
13552 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 13553 * Makefile.in: Regenerate.
3d857b98
DK
13554 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
13555 * configure: Regenerate.
13556 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
13557 * fileread.cc: Include sys/state.h
13558 * gold.h: Declare memmem and strndup if found missing.
13559 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
13560
0639a6f6
ILT
135612009-06-23 Ian Lance Taylor <iant@google.com>
13562
13563 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
13564 * configure: Rebuild.
13565
8d63875c
ILT
135662009-06-23 Ian Lance Taylor <iant@google.com>
13567
13568 PR 10147
13569 * object.cc (Object::section_contents): Don't try to get a view if
13570 the section has length zero.
13571 (Object::handle_gnu_warning_section): If the section is empty, use
13572 the name of the section as the warning.
13573
f7c8a183
ILT
135742009-06-23 Ian Lance Taylor <iant@google.com>
13575
13576 PR 10133
13577 * stringpool.h (class Stringpool_template): Add optimize_ field.
13578 (Stringpool_template::set_optimize): New function.
13579 * stringpool.cc (Stringpool_template::Stringpool_template):
13580 Initialize optimize_ field.
13581 (Stringpool_template::set_string_offsets): Test local optimize
13582 fild rather than parameter.
13583 * layout.cc (Layout::Layout): Call set_optimize on the section
13584 name stringpool.
13585
e6a307ba
ILT
135862009-06-22 Ian Lance Taylor <iant@google.com>
13587
13588 PR 10030
13589 * yyscript.y: Parse TARGET.
13590 * script.cc (script_set_target): New function.
13591 * script-c.h (script_set_target): Declare.
13592 * options.cc (General_options::string_to_object_format): Rename
13593 from string_to_object_format in anonymous namespace. Change
13594 callers.
13595 * options.h (class General_options): Declare
13596 string_to_object_format.
13597
3ee173de
ILT
135982009-06-22 Ian Lance Taylor <iant@google.com>
13599
13600 * script-sections.cc (Script_sections::create_segments): Don't put
13601 program headers in a PT_LOAD segment if -n or -N.
13602
136032009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
13604
13605 PR 10141
13606 * options.h (class General_options): Add -z lazy and -z now. Sort
13607 -z options into alphabetical order.
13608 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
13609
cd6739a1 136102009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
13611
13612 * layout.cc (Layout::make_output_section): Call
13613 Target::new_output_section.
13614 (Layout::attach_allocated_section_to_segment): Put large section
13615 sections in a separate load segment with the large segment flag
13616 set.
13617 (Layout::segment_precedes): Sort large data segments after other
13618 load segments.
13619 (align_file_offset): New static function.
13620 (Layout::set_segment_offsets): Use align_file_offset.
13621 * output.h (class Output_section): Add is_small_section_ and
13622 is_large_section_ fields.
13623 (Output_section::is_small_section): New function.
13624 (Output_section::set_is_small_section): New function.
13625 (Output_section::is_large_section): New function.
13626 (Output_section::set_is_large_section): New function.
13627 (Output_section::is_large_data_section): New function.
13628 (class Output_segment): Add is_large_data_segment_ field.
13629 (Output_segment::is_large_data_segment): New function.
13630 (Output_segment::set_is_large_data_segment): New function.
13631 * output.cc (Output_section::Output_section): Initialize new
13632 fields.
13633 (Output_segment::Output_segment): Likewise.
13634 (Output_segment::add_output_section): Add assertion that large
13635 data sections always go in large data segments. Force small data
13636 sections to the end of the list of data sections. Force small BSS
13637 sections to the start of the list of BSS sections. For large BSS
13638 sections to the end of the list of BSS sections.
13639 * symtab.h (class Symbol): Declare is_common_shndx.
13640 (Symbol::is_defined): Check Symbol::is_common_shndx.
13641 (Symbol::is_common): Likewise.
13642 (class Symbol_table): Define enum Commons_section_type. Update
13643 declarations. Add small_commons_ and large_commons_ fields.
13644 * symtab.cc (Symbol::is_common_shndx): New function.
13645 (Symbol_table::Symbol_table): Initialize new fields.
13646 (Symbol_table::add_from_object): Put small and large common
13647 symbols in the right list.
13648 (Symbol_table::sized_finalized_symbol): Check
13649 Symbol::is_common_shndx.
13650 (Symbol_table::sized_write_globals): Likewise.
13651 * common.cc (Symbol_table::do_allocate_commons): Allocate new
13652 common symbol lists. Don't call do_allocate_commons_list if the
13653 list is empty.
13654 (Symbol_table::do_allocate_commons_list): Remove is_tls
13655 parameter. Add comons_section_type parameter. Change all
13656 callers. Handle small and large common symbols.
13657 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
13658 Symbol::is_common_shndx.
13659 * resolve.cc (symbol_to_bits): Likewise.
13660 * target.h (Target::small_common_shndx): New function.
13661 (Target::small_common_section_flags): New function.
13662 (Target::large_common_shndx): New function.
13663 (Target::large_common_section_flags): New function.
13664 (Target::new_output_section): New function.
13665 (Target::Target_info): Add small_common_shndx, large_common_shndx,
13666 small_common_section_flags, and large_common_section_flags
13667 fields.
13668 (Target::do_new_output_section): New virtual function.
13669 * arm.cc (Target_arm::arm_info): Initialize new fields.
13670 * i386.cc (Target_i386::i386_info): Likewise.
13671 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
13672 Likewise.
13673 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
13674 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13675 (Target_x86_64::do_new_output_section): New function.
13676 * configure.ac: Define conditional MCMODEL_MEDIUM.
13677 * testsuite/Makefile.am (check_PROGRAMS): Add large.
13678 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
13679 (large_LDFLAGS): Define.
13680 * testsuite/large.c: New file.
13681 * testsuite/testfile.cc (Target_test::test_target_info):
13682 Initialize new fields.
13683 * configure, testsuite/Makefile.in: Rebuild.
13684
bb04269c
DK
136852009-06-05 Doug Kwan <dougkwan@google.com>
13686
13687 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 13688 * Makefile.in: Regenerate.
bb04269c
DK
13689 * i386.cc (class Target_i386): Define new virtual method to
13690 override do_is_local_label_name in parent.
13691 * object.cc (Sized_relobj::do_count_local_symbols): Discard
13692 local symbols if --discard-locals or -X is given.
13693 * options.h (class General_options): Declare new options
13694 '--discard-locals' and '-X' for discarding locals.
13695 * target.h (class Target): Define new methods is_local_label_name.
13696 Declare new virtual method do_is_local_label_name.
13697 * target.cc: New file.
13698 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
13699 (check_SCRIPTS): Add discard_locals_test.sh.
13700 (check_DATA): Add discard_local_tests.syms.
13701 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
13702 (discard_local_tests.syms, discard_locals_test.o): New make rules.
13703 * testsuite/Makefile.in: Regenerate.
13704 * testsuite/discard_locals_test.c: New file.
13705 * testsuite/discard_locals_test.sh: Same.
13706
805bb01c
DK
137072009-06-05 Doug Kwan <dougkwan@google.com>
13708
13709 * object.cc (Sized_relobj::Sized_relobj): Initialize
13710 discarded_eh_frame_shndx_ to -1U.
13711 (Sized_relobj::do_layout): Record index of a discard .eh_frame
13712 section.
13713 (Sized_relobj::do_count_local_symbols): Skip local symbols in
13714 a discarded .eh_frame section.
13715 (Sized_relobj::do_finalize_local_symbols): Ditto.
13716 * object.h (class Sized_relobj): Declare new member
13717 discarded_eh_frame_shndx_.
13718 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
13719 (local_labels_test.o, local_labels_test): New rules.
13720 * testsuite/Makefile.in: Regenerate.
13721
1dcd334d
DK
137222009-06-04 Doug Kwan <dougkwan@google.com>
13723
13724 * layout.cc (Layout::section_name_mapping): Add mapping for
13725 special ARM sections.
13726
96d49306
DK
137272009-06-03 Doug Kwan <dougkwan@google.com>
13728
13729 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
13730 (utils::has_overflow): Same.
13731
dff16297
ILT
137322009-06-03 Ian Lance Taylor <iant@google.com>
13733
13734 * layout.cc (Layout::section_name_mapping): New array, replacing
13735 Layout::linkonce_mapping.
13736 (Layout::section_name_mapping_count): New variable, replacing
13737 Layout::linkonce_mapping_count.
13738 (Layout::linkonce_output_name): Remove.
13739 (Layout::output_section_name): Rewrite.
13740 * layout.h (class Layout): Rename Linkonce_mapping to
13741 Section_name_mapping, linkonce_mapping to section_name_mapping,
13742 linkonce_mapping_count to section_name_mapping_count. Don't
13743 declare linkonce_output_name.
13744
c121c671
DK
137452009-06-03 Doug Kwan <dougkwan@google.com>
13746
13747 * gold/arm.cc (namespace utils): New.
13748 (Target_arm::reloc_is_non_pic): Define new method.
13749 (class Arm_relocate_functions): New.
13750 (Target_arm::Relocate::relocate): Handle relocation types used by
13751 Android.
13752
07800fab
ILT
137532009-06-03 Ian Lance Taylor <iant@google.com>
13754
13755 * arm.cc (Target_arm::scan::global): Use || instead of |.
13756
c121c671
DK
137572009-06-02 Doug Kwan <dougkwan@google.com>
13758
13759 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
13760 issued_non_pic_error_.
13761 (class Target_arm::Scan): Declare new method check_non_pic.
13762 Define new method symbol_needs_plt_entry.
13763 Declare new data member issued_non_pic_error_.
13764 (class Target_arm::Relocate): Declare new method
13765 should_apply_static_reloc.
13766 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
13767 (Target_arm::Scan::check_non_pic): Define new method.
13768 (Target_arm::Scan::local): Handle a small subset of reloc types used
13769 by Android.
13770 (Target_arm::Scan::local): Same.
13771 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
13772
b19b0c6d
ILT
137732009-05-31 Mikolaj Zalewski <mikolajz@google.com>
13774
13775 * incremental.cc (Incremental_inputs::report_command_line): Filter
13776 out --incremental-* options.
13777
94cdfcff
DK
137782009-05-29 Doug Kwan <dougkwan@google.com>
13779
13780 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
13781 template class.
13782 (class Target_arm): Update comment.
13783 (Target_arm::Target_arm): Initialize new data members GOT_,
13784 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
13785 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
13786 and Target_arm::rel_dyn_section.
13787 Declare new_enum Target_arm::Got_type.
13788 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
13789 and DYNBSS_.
13790 Update commments for member do_dynsym_value.
13791 (Target_arm::got_size, Target_arm::plt_section,
13792 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
13793 new methods inside class defintion.
13794 (Target_arm::got_section): Define new method.
13795 (Target_arm::rel_dyn_section): Same.
13796 (Output_data_plt_arm): New template class.
13797 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
13798 (Output_data_plt_arm:do_adjust_output_section): Define new method.
13799 (Output_data_plt_arm::add_entry): Same.
13800 (Output_data_plt_arm::first_plt_entry): Define new
13801 static data member for PLT instruction template.
13802 (Output_data_plt_arm::plt_entry): Same.
13803 (Output_data_plt_arm::do_write): Define new method.
13804 (Target_arm::make_plt_entry): Same.
13805 (Target_arm::do_finalize_sections): Same.
13806 (Target_arm::do_dynsym_value): Same.
13807
4a657b0d
DK
138082009-05-28 Doug Kwan <dougkwan@google.com>
13809
13810 * Makefile.am (TARGETSOURCES): Add arm.cc.
13811 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
13812 * Makefile.in: Regenerate.
13813 * arm.cc: New file.
13814 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
13815
e7ae8c36
DK
138162009-05-26 Doug Kwan <dougkwan@google.com>
13817
13818 * options.cc (General_options::parse_exclude_libs). Fix a comment.
13819 (General_options::check_excluded_libs): Strip off directories in
13820 archive name before matching like GNU ld does.
13821 * testsuite/Makefile.am (MOSTLYCLEANFILES,
13822 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
13823 (exclude_libs_test_LDFLAGS): Add linker option
13824 -Wl,--exclude-libs,libexclude_libs_test_3
13825 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
13826 an explicit archive without using -l.
13827 (alt/libexclude_libs_test_3.a): New make rule.
13828 * testsuite/Makefile.in: Regenerate.
13829 * testsuite/exclude_libs_test.c : Declare lib3_default().
13830 (main): Call it.
13831 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
13832 * exclude_libs_test_3.c: New file.
13833
f12e7348
NC
138342009-05-26 Nick Clifton <nickc@redhat.com>
13835
13836 * po/id.po: New Indonesian translation.
13837 * po/gold.pot: Updated template file.
13838
4daadc0d
ST
138392009-05-22 Sriraman Tallam <tmsriram@google.com>
13840
e1df38aa 13841 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
13842 gc_comdat_test files. Add -Wl,--gc-sections to build
13843 gc_comdat_test.
13844 * testsuite/Makefile.in: Regenerate.
13845 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
13846
531813ad
ST
138472009-05-21 Sriraman Tallam <tmsriram@google.com>
13848
13849 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
13850 kept comdat section was garbage collected.
13851 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
13852 * testsuite/Makefile.in: Regenerate.
13853 * testsuite/gc_comdat_test.sh: New file.
13854 * testsuite/gc_comdat_test_1.cc: New file.
13855 * testsuite/gc_comdat_test_2.cc: New file.
13856
65514900
CC
138572009-05-19 Doug Kwan <dougkwan@google.com>
13858
13859 * archive.cc (Archive::Archive): Move constructor from archive.h
13860 to here. Initialize no_export_.
13861 (Archive::get_elf_object_for_member): Set no_export flag of object.
13862 * archive.h (Archive::Archive): Move constructor body to
13863 archive.cc.
13864 (Archive::no_export): New method.
13865 (Archive::no_export_): New field.
13866 * object.h (Object::Object): Initialize no_export_ to false.
13867 (Object::no_export, Object::set_no_export): New methods.
13868 (Object::no_export_): New field.
13869 * options.cc (General_options::parse_exclude_libs): New method.
13870 (General_options::check_excluded_libs) Same.
13871 * options.h (exclude_libs): New option.
13872 (General_options::check_excluded_libs): New method declaration.
13873 (General_options::excluded_libs_): New field.
13874 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
13875 default or protected visibility if an object has no-export flag set.
13876 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
13877 (check_SCRIPTS): Add exclude_libs_test.sh.
13878 (check_DATA): Add exclude_libs_test.syms.
13879 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
13880 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
13881 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
13882 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
13883 (exclude_libs_test.syms, libexclude_libs_test_1.a,
13884 libexclude_libs_test_2.a): New rules.
13885 * testsuite/Makefile.in: Regenerate.
13886 * testsuite/exclude_libs_test.c: New file.
13887 * testsuite/exclude_libs_test.sh: Ditto.
13888 * testsuite/exclude_libs_test_1.c: Ditto.
13889 * testsuite/exclude_libs_test_2.c: Ditto.
13890
1b77ea50
ILT
138912009-05-15 Ian Lance Taylor <iant@google.com>
13892
13893 * configure.ac: Check for declarations for cases where libiberty.h
13894 checks HAVE_DECL_xxx.
13895 * configure, config.in: Rebuild.
13896
072fe7ce
ILT
138972009-05-15 Mikolaj Zalewski <mikolajz@google.com>
13898
13899 * gold.h (Incremental_argument_list): Remove (invalid) forward
13900 declaration.
13901 * incremental.cc (Incremental_inputs::report_achive): New method.
13902 (Incremental_inputs::report_object): New method.
13903 (Incremental_inputs::report_script): New method.
13904 (Incremental_inputs::finalize_inputs): New method.
13905 (Incremental_inputs::finalize): Call finalize_inputs().
13906 (Incremental_inputs::sized_create_incremental_inputs_section_data):
13907 Create inputs entries.
13908 * incremental.h (Incremental_input_type): New enum.
13909 (Incremental_inputs::Incremental_input): Initialize new fields.
13910 (Incremental_inputs::report_inputs): New method.
13911 (Incremental_inputs::report_achive): New method.
13912 (Incremental_inputs::report_object): New method.
13913 (Incremental_inputs::report_script): New method.
13914 (Incremental_inputs::finalize_inputs): New method.
13915 (Incremental_inputs::Input_info): New struct.
13916 (Incremental_inputs::Input_info_map): New typedef.
13917 (Incremental_inputs::lock_): New field.
13918 (Incremental_inputs::Inputs_): New field.
13919 (Incremental_inputs::Inputs_map): New field.
13920 * main.cc (main): Call Incremental_input::report_inputs.
13921 * options.h (Input_argument_list): Typedef moved from
13922 Input_arguments.
13923 (Input_file_group::Files): Remove, use ::Input_argument_list.
13924 (Input_file_group::Input_argument_list): Remove, use
13925 ::Input_argument_list.
13926 * plugin.cc (Plugin_manager::add_input_file): Add error in
13927 incremental build.
13928 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
13929 functions.
13930 * script.cc (read_input_script): Call
13931 Incremental_input::report_script.
13932 * script.h (Script_info): New class.
13933
b0481b0b
ILT
139342009-04-27 Ian Lance Taylor <iant@google.com>
13935
13936 * x86_64.cc (do_adjust_output_section): Set entsize to
13937 plt_entry_size.
13938
b22a5a41 139392009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
13940
13941 * output.cc (Output_file::close): After short writes, continue
13942 writing from the correct offset in the buffer being written.
13943
40fde488
CD
139442009-04-23 Chris Demetriou <cgd@google.com>
13945
13946 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
13947 * configure: Regenerate.
13948 * config.in: Regenerate.
13949 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
13950 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
13951
3ce2c28e
ILT
139522009-04-21 Mikolaj Zalewski <mikolajz@google.com>
13953
13954 * incremental.cc (Incremental_inputs_header_data): Renamed from
13955 Incremental_input_header_data.
13956 (Incremental_inputs_header_data::data_size): New field.
13957 (Incremental_inputs_header_data::put_input_file_count): Renamed
13958 from input_file_count.
13959 (Incremental_inputs_header_data::put_command_line_offset): Renamed
13960 from command_line_offset.
13961 (Incremental_inputs_header_data::put_reserved): Renamed from
13962 put_reserved.
13963 (Incremental_inputs_entry_data): Renamed from
13964 Incremental_input_entry_data.
13965 (Incremental_inputs_entry_data::data_size): New field.
13966 (Incremental_inputs::report_command_line): New method.
13967 (Incremental_inputs::finalize): New method.
13968 (Incremental_inputs::create_incremental_inputs_data): New method.
13969 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
13970 * incremental.h: New file.
13971 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 13972 (Layout::finalize): Create incremental inputs section in
3ce2c28e 13973 incremental builds.
703d02da 13974 (Layout::create_incremental_info_sections): New method.
3ce2c28e 13975 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
13976 (Layout::create_incremental_info_sections): New method.
13977 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
13978 * main.cc (main): Notify Incremental_input of the command line.
13979
e55bde5e
ILT
139802009-04-01 Ian Lance Taylor <iant@google.com>
13981 Mikolaj Zalewski <mikolajz@google.com>
13982
13983 * gold.h (reserve_unordered_map): Define, three versions, one for
13984 each version of Unordered_map.
13985 * layout.cc (Layout::Layout): Remove options parameter. Add
13986 number_of_input_files parameter. Don't initialize options_.
13987 Initialize number_of_input_files_ and resized_signatures_. Move
13988 sections_are_attached_.
13989 (Layout::layout_group): Reserve space for group_signatures_.
13990 (Layout::find_or_add_kept_section): Change name parameter to be a
13991 reference. Resize signatures_ map when it gets large enough.
13992 (Layout::layout_eh_frame): Use parameters->options() instead of
13993 this->options_.
13994 (Layout::make_output_section): Likewise.
13995 (Layout::attach_allocated_section_to_segment): Likewise.
13996 (Layout::finalize, Layout::create_executable_stack): Likewise.
13997 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
13998 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
13999 * layout.h (class Layout): Update declarations. Remove options_
14000 field. Add number_of_input_files_ and resized_signatures_
14001 fields. Move sections_are_attached_ field.
14002 * main.cc (main): Pass number of input files to Layout
14003 constructor. Don't pass options.
14004
154b857c
ILT
140052009-03-30 Ian Lance Taylor <iant@google.com>
14006
14007 * ffsll.c (ffsll): Correct implementation.
14008
2f35ab9b
ILT
140092009-03-27 Ian Lance Taylor <iant@google.com>
14010
fd03461a
ILT
14011 * ffsll.c: New file.
14012 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
14013 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
14014 * ftruncate.c (ftruncate): Declare before definition.
14015 * mremap.c (mremap): Likewise.
14016 * pread.c (pread): Likewise.
14017 * configure, Makefile.in, config.in: Rebuild.
14018
2f35ab9b
ILT
14019 * mremap.c: New file.
14020 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
14021 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
14022 (mremap): Declare if HAVE_MREMAP is not defined.
14023 * configure, Makefile.in, config.in: Rebuild.
14024
33aea2fd
CC
140252009-03-27 Cary Coutant <ccoutant@google.com>
14026
14027 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
14028 position independent.
14029 * sparc.cc (Target_sparc::check_non_pic): Likewise.
14030 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
14031
6d479619
CC
140322009-03-24 Cary Coutant <ccoutant@google.com>
14033
14034 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
14035 an executable.
14036 (needs_dynamic_reloc): Likewise.
14037
afc06bb8
ILT
140382009-03-24 Ian Lance Taylor <iant@google.com>
14039
14040 * yyscript.y (file_cmd): Recognize EXTERN.
14041 (extern_name_list, extern_name_list_body): New nonterminals.
14042 * script.cc (script_add_extern): Define.
14043 * script-c.h (script_add_extern): Declare.
14044
f6060a4d
ILT
140452009-03-24 Rafael Avila de Espindola <espindola@google.com>
14046
14047 * object.cc (is_elf_object): Define.
14048 * object.h (is_elf_object): Declare.
14049 * archive.cc (Archive::get_elf_object_for_member): Call
14050 is_elf_object.
33aea2fd 14051 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 14052
26736d8e
ILT
140532009-03-24 Elliott Hughes <enh@google.com>
14054
14055 * output.cc (Output_file::map_anonymous): Define.
14056 (Output_file::map): Use map_anonymous. If the regular mmap fails,
14057 try an anonymous one. Report the size if the mmap fails.
14058 * output.h (class Output_file): Declare map_anonymous.
14059
22fd9730
ILT
140602009-03-24 Ian Lance Taylor <iant@google.com>
14061
14062 * target-select.cc (instantiate_target): Don't acquire the lock if
14063 the instantiated_target_ field has already been set.
14064
cb010894
ILT
140652009-03-23 Ian Lance Taylor <iant@google.com>
14066
7f055c20
ILT
14067 * gold-threads.h (class Initialize_lock): Define.
14068 * gold-threads.cc (class Initialize_lock_once): Define.
14069 (initialize_lock_control): New static variable.
14070 (initialize_lock_pointer): New static variable.
14071 (initialize_lock_once): New static function.
14072 (Initialize_lock::Initialize_lock): Define.
14073 (Initialize_lock::initialize): Define.
14074 * target-select.h: Include "gold-threads.h".
14075 (class Target_selector): Add lock_ and initialize_lock_ fields.
14076 Don't define instantiate_target, just declare it.
14077 * target-select.cc (Target_selector::Target_selector): Initialize
14078 new fields.
14079 (Target_selector::instantiate_target): Define.
14080 * descriptors.h: Include "gold-threads.h".
14081 (class Descriptors): Add initialize_lock_ field.
14082 * descriptors.cc (Descriptors::Descriptors): Initialize new
14083 field.
14084 (Descriptors::open): Use initialize_lock_ field
14085 * errors.h (class Errors): Add initialize_lock_ field.
14086 * errors.cc (Errors::Errors): Initialize new field.
14087 (Errors::initialize_lock): Use initialize_lock_ field.
14088 * powerpc.cc (class Target_selector_powerpc): Remove
14089 instantiated_target_ field. In do_recognize call
14090 instantiate_target rather than do_instantiate_target. In
14091 do_instantiate_target just allocate a new target.
14092 * sparc.cc (class Target_selector_sparc): Likewise.
14093
36959681
ILT
14094 * freebsd.h: New file.
14095 * i386.cc: Include "freebsd.h".
14096 (Target_i386): Derive from Target_freebsd rather than
14097 Sized_target.
14098 (Target_selector_i386): Derive from Target_selector_freebsd rather
14099 than Target_selector.
14100 * x86_64.cc: Include "freebsd.h".
14101 (Target_x86_64): Derive from Target_freebsd rather than
14102 Sized_target.
14103 (Target_selector_x86_64): Derive from Target_selector_freebsd
14104 rather than Target_selector.
14105 * target.h (class Target): Add adjust_elf_header and
14106 do_adjust_elf_header.
14107 * output.cc (Output_file_header:: do_sized_write): Call target
14108 adjust_elf_header routine.
14109 * configure.tgt: Set targ_osabi.
14110 * configure.ac: Define GOLD_DEFAULT_OSABI.
14111 * parameters.cc (Parameters::default_target): Pass
14112 GOLD_DEFAULT_OSABI to select_target.
14113 * target-select.h (class Target_selector): Make instantiate_target
14114 protected rather than private.
14115 * Makefile.am (HFILES): Add freebsd.h.
14116 * configure, Makefile.in, config.in: Rebuild.
14117
cb010894
ILT
14118 * merge.cc (do_add_input_section): Correct pend value. Change
14119 message about last entry not being null terminated from error to
14120 warning.
14121
0e879927
ILT
141222009-03-20 Mikolaj Zalewski <mikolajz@google.com>
14123
14124 * incremental.cc: New file.
14125 * Makefile.am (CCFILES): Add incremental.cc.
14126 * Makefile.in: Rebuild.
14127
41105937
PP
141282009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
14129
14130 * layout.cc (Layout::output_section_name): Preserve names
14131 of '.note.' sections.
e1df38aa 14132
60439920
ILT
141332009-03-19 Ian Lance Taylor <iant@google.com>
14134
14135 * descriptors.cc (Descriptors::open): Check that the options are
14136 valid before using them.
14137
0d371ad3
ILT
141382009-03-18 Ian Lance Taylor <iant@google.com>
14139
14140 * script-sections.h: Include <list>.
14141 (class Script_sections): Change Sections_elements from std::vector
14142 to std::list. Typedef public Elements_iterator. Add
14143 orphan_section_placement_, data_segment_align_start_, and
14144 saw_data_segment_align_ fields. Remove data_segment_align_index_
14145 field.
14146 * script-sections.cc (class Orphan_section_placement): New class.
14147 (class Sections_element): Add virtual functions is_relro and
14148 orphan_section_init. Remove virtual function place_orphan_here.
14149 (class Output_section_definition): Add is_relro and
14150 orphan_section_init. Remove place_orphan_here.
14151 (class Orphan_output_section): Likewise.
14152 (Script_sections::Script_sections): Update for field changes.
14153 (Script_sections::data_segment_align): Set saw_data_segment_align_
14154 and data_segment_align_start_, not data_segment_align_index.
14155 (Script_sections::data_segment_relro_end): Check
14156 saw_data_segment_align_. Use data_segment_align_start_ rather
14157 than data_segment_align_index_.
14158 (Script_sections::place_orphan): Rewrite to use
14159 Orphan_section_placement.
14160
9201d894
ILT
141612009-03-17 Ian Lance Taylor <iant@google.com>
14162
9c5b8369
ILT
14163 * archive.cc (Archive::add_symbols): Check for a version attached
14164 to the symbol name in the archive map.
14165 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
14166 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
14167 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
14168 (ver_test_11.a): New target.
14169 * testsuite/Makefile.in: Rebuild.
14170
9201d894
ILT
14171 * configure.ac: Check for chsize and posix_fallocate. Replace
14172 ftruncate.
14173 * ftruncate.c: New file, from gnulib.
14174 * output.cc (posix_fallocate): Define dummy version if not
14175 HAVE_POSIX_FALLOCATE.
14176 (Output_file::map): Call posix_fallocate rather than lseek and
14177 write.
14178 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
14179 * configure, Makefile.in, config.in: Rebuild.
14180
ef4ab7a8 141812009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 14182
ef4ab7a8
PP
14183 * layout.h (Layout::create_note): Add section_name parameter.
14184 * layout.cc (Layout::create_note): Likewise.
14185 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 14186
8c500701
ILT
141872009-03-17 Ian Lance Taylor <iant@google.com>
14188
e85b18e1
ILT
14189 * descriptors.cc: Include "options.h".
14190 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
14191 (Descriptors::open): Always use O_CLOEXEC when opening a new
14192 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
14193 then set FD_CLOEXEC.
14194
9efe6174
ILT
14195 * sparc.cc (class Target_sparc): Add has_got_section.
14196 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
14197 make sure we have a GOT section.
14198
14199 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
14200 (Target_sparc::Scan::local): Likewise.
14201 (Target_sparc::Scan::global): Likewise.
14202 (Target_sparc::Relocate::relocate): Likewise.
14203 (Target_sparc::Relocate::relocate_tls): Likewise.
14204
8c500701
ILT
14205 * symtab.cc (Symbol_table::define_default_version): New function,
14206 broken out of add_from_object.
14207 (Symbol_table::add_from_object): Call define_default_version.
14208 (Symbol_table::define_special_symbol): Add resolve_oldsym
14209 parameter. Change all callers. If the version for a symbol comes
14210 from a version script, resolve it with the symbol with the same
14211 name with no version. Also add the symbol without a version if
14212 appropriate.
14213 (do_define_in_output_data): If resolving with oldsym, don't delete
14214 sym.
14215 (do_define_in_output_segment): Likewise.
14216 (do_define_as_constant): Likewise.
14217 * symtab.h (class Symbol_table): Update declarations.
14218
f1ed28fb
ILT
142192009-03-13 Ian Lance Taylor <iant@google.com>
14220
15f8229b
ILT
14221 * readsyms.cc (Read_symbols::incompatible_warning): New function.
14222 (Read_symbols::requeue): New function.
14223 (Read_symbols::do_read_symbols): If make_elf_object fails because
14224 the target type is not configured, and the file was searched for,
14225 issue a warning and retry with the next directory.
14226 (Add_symbols::run): If the file has an incompatible format, and
14227 it was searched for, requeue the Read_symbols task. On error,
14228 release the object.
14229 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
14230 dirindex parameter to constructor. Change all callers. Declare
14231 incompatible_warning and requeue.
14232 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
14233 input_argument_ and input_group_ fields. Add them to
14234 constructor. Change all callers.
14235 (class Read_script): Add dirindex_ field. Add it to constructor.
14236 Change all callers.
14237 * archive.cc (Archive::setup): Remove input_objects parameter.
14238 Change all callers.
14239 (Archive::get_file_and_offset): Likewise.
14240 (Archive::read_all_symbols): Likewise.
14241 (Archive::read_symbols): Likewise.
14242 (Archive::get_elf_object_for_member): Remove input_objects
14243 parameter. Add punconfigured parameter. Change all callers.
14244 (Archive::add_symbols): Change return type to bool. Check return
14245 value of include_member.
14246 (Archive::include_all_members): Likewise.
14247 (Archive::include_member): Change return type to bool. Return
14248 false if first included object has incompatible target. Set
14249 included_member_ field.
14250 (Add_archive_symbols::run): If add_symbols returns false, requeue
14251 Read_symbols task.
14252 * archive.h (class Archive): Add included_member_ field.
14253 Initialize it in constructor. Add input_file and searched_for
14254 methods. Update declarations.
14255 (class Add_archive_symbols): Add dirpath_, dirindex_, and
14256 input_argument_ fields. Add them to constructor. Change all
14257 callers.
14258 * script.cc: Include "target-select.h".
14259 (class Parser_closure): Add skip_on_incompatible_target_ and
14260 found_incompatible_target_ fields. Add
14261 skip_on_incompatible_target parameter to constructor. Change all
14262 callers. Add methods skip_on_incompatible_target,
14263 clear_skip_on_incompatible_target, found_incompatible_target, and
14264 set_found_incompatible_target.
14265 (read_input_script): Add dirindex parameter. Change all callers.
14266 If parser finds an incompatible target, requeue Read_symbols
14267 task.
14268 (script_set_symbol): Clear skip_on_incompatible_target in
14269 closure.
14270 (script_add_assertion, script_parse_option): Likewise.
14271 (script_start_sections, script_add_phdr): Likewise.
14272 (script_check_output_format): New function.
14273 * script.h (read_input_script): Update declaration.
14274 * script-c.h (script_check_output_format): Declare.
14275 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
14276 (ignore_cmd): Remove OUTPUT_FORMAT.
14277 * fileread.cc (Input_file::Input_file): Add explicit this.
14278 (Input_file::will_search_for): New function.
14279 (Input_file::open): Add pindex parameter. Change all callers.
14280 * fileread.h (class Input_file): Add input_file_argument method.
14281 Declare will_search_for. Update declarations.
14282 * object.cc (make_elf_object): Add punconfigured parameter.
14283 Change all callers.
14284 * object.h (class Object): Make input_file public. Add
14285 searched_for method.
14286 (make_elf_object): Update declaration.
14287 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
14288 restart search.
14289 * dirsearch.h (class Dirsearch): Update declaration.
14290 * options.h (class General_options): Add --warn-search-mismatch.
14291 * parameters.cc (Parameters::is_compatible_target): New function.
14292 * parameters.h (class Parameters): Declare is_compatible_target.
14293 * workqueue.cc (Workqueue::add_blocker): New function.
14294 * workqueue.h (class Workqueue): Declare add_blocker.
14295
f1ed28fb
ILT
14296 * fileread.cc (Input_file::open): Remove options parameter.
14297 Change all callers.
14298 (Input_file::open_binary): Likewise.
14299 * script.cc (read_input_script): Likewise.
14300 * readsyms.h (class Read_symbols): Remove options_ field. Remove
14301 options parameter from constructor. Change all callers.
14302 (class Read_script): Likewise.
14303 * fileread.h (class Input_file): Update declarations.
14304 * script.h (read_input_script): Update declaration.
14305
34dd024a
NC
143062009-03-10 Nick Clifton <nickc@redhat.com>
14307
14308 * po/es.po: New Spanish translation.
14309
6d71b17c
CC
143102009-03-06 Cary Coutant <ccoutant@google.com>
14311
14312 * options.cc (parse_short_option): Keep dash_z from registering itself.
14313
031cdbed
ILT
143142009-03-03 Ian Lance Taylor <iant@google.com>
14315
14316 PR 9918
14317 * target-reloc.h (relocate_section): Pass output_section to
14318 relocate.
14319 * i386.cc (Target_i386::should_apply_static_reloc): Add
14320 output_section parameter. Change all callers.
14321 (Target_i386::Relocate::relocate): Add output_section parameter.
14322 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14323 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
14324 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
14325 * testsuite/two_file_shared.sh: New script.
14326 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
14327 (check_DATA): Add two_file_shared.dbg.
14328 (two_file_shared.dbg): New target.
14329 * testsuite/Makefile.in: Rebuild.
14330
15d5fa16
ILT
143312009-03-01 Ian Lance Taylor <iant@google.com>
14332
14333 * configure.ac: Check for byteswap.h.
14334 * configure: Rebuild.
14335 * config.in: Rebuild.
14336
8a4c0b0d
ILT
143372009-03-01 Mikolaj Zalewski <mikolajz@google.com>
14338
14339 * layout.cc (Layout::find_or_add_kept_section): New function.
14340 (Layout::add_comdat): Removed.
14341 * layout.h (struct Kept_section): Move out of class Layout.
14342 Remove trailing underscores from field names. Add group_sections
14343 field. Rename group_ field to is_group. Change all uses.
14344 (class Layout): Declare find_or_add_kept_section, not add_comdat.
14345 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
14346 comdat_groups_ field.
14347 (Sized_relobj::include_section_group): Use
14348 find_or_add_kept_section and Kept_section::group_sections.
14349 (Sized_relobj::include_linkonce_section): Likewise.
14350 * object.cc (class Sized_relobj): Don't define Comdat_group or
14351 Comdat_group_table. Remove find_comdat_group and
14352 add_comdat_group. Remove comdat_groups_ field.
14353 * plugin.cc (include_comdat_group): Use
14354 Layout::find_or_add_kept_section.
14355
b4ecf66b
ILT
143562009-02-28 Ian Lance Taylor <iant@google.com>
14357
14359ca0
ILT
14358 * README: --gc-sections and map files are now supported. Document
14359 some build requirements.
14360
b4ecf66b
ILT
14361 PR 6992
14362 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
14363 relocatable link set the value of the section symbol to zero.
14364 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
14365 relocatable link don't include the section address in the local
14366 symbol value.
14367
0602e05a
ILT
143682009-02-27 Ian Lance Taylor <iant@google.com>
14369
fd9d194f
ILT
14370 PR 6811
14371 * options.h (class Search_directory): Add is_system_directory.
14372 (class General_options): Declare is_in_system_directory.
14373 * options.cc (get_relative_sysroot): Make static.
14374 (get_default_sysroot): Make static.
14375 (General_optoins::is_in_system_directory): New function.
14376 * fileread.cc (Input_file::is_in_system_directory): New function.
14377 * fileread.h (class Input_file): Declare is_in_system_directory.
14378 * object.h (class Object): Add is_in_system_directory.
14379 (class Input_objects): Remove system_library_directory_ field.
14380 * object.cc (Input_objects::add_object): Don't set
14381 system_library_directory_.
14382 (input_objects::found_in_system_library_directory): Remove.
14383 * symtab.cc (Symbol_table::write_globals): Remove input_objects
14384 parameter. Change all callers.
14385 (Symbol_table::sized_write_globals): Likewise.
14386 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
14387 Call Object::is_in_system_directory.
14388 * symtab.h (class Symbol_table): Update declarations.
14389
61edd21f
ILT
14390 PR 5990
14391 * descriptors.h (Open_descriptor): Add is_on_stack field.
14392 * descriptors.cc (Descriptors::open): If the descriptor is on the
14393 top of the stack, remove it. Initialize is_on_stack field.
14394 (Descriptors::release): Only add pod to stack if it is not on the
14395 stack already.
14396 (Descriptors::close_some_descriptor): Clear stack_next and
14397 is_on_stack fields.
14398
e29e076a
ILT
14399 PR 7091
14400 * output.cc (Output_section::find_starting_output_address): Rename
14401 from starting_output_address; add PADDR parameter; change return
14402 type.
14403 * output.h (class Output_section): Declare
14404 find_starting_output_address instead of starting_output_address.
14405 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
14406 section symbol for which we can't find a merge section.
14407
0602e05a
ILT
14408 PR 9836
14409 * symtab.cc (Symbol_table::add_from_object): If the visibility is
14410 hidden or internal, force the symbol to be local.
14411 * resolve.cc (Symbol::override_visibility): Define.
14412 (Symbol::override_base): Use override_visibility.
14413 (Symbol_table::resolve): Likewise.
14414 (Symbol::override_base_with_special): Likewise.
14415 (Symbol_table::override_with_special): If the visibility is hidden
14416 or internal, force the symbol to be local.
14417 * symtab.h (class Symbol): Add set_visibility and
14418 override_visibility.
14419 * testsuite/ver_test_1.sh: New file.
14420 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
14421 (check_DATA): Add ver_test_1.syms.
14422 (ver_test_1.syms): New target.
14423 * testsuite/Makefile.in: Rebuild.
14424
401a9a73
CC
144252009-02-25 Cary Coutant <ccoutant@google.com>
14426
14427 * layout.cc (Layout::choose_output_section): Don't rename sections
14428 when using a linker script that has a SECTIONS clause.
14429 * Makefile.in: Regenerate.
14430
14431 * testsuite/Makefile.am (script_test_5.sh): New test case.
14432 * testsuite/Makefile.in: Regenerate.
14433 * testsuite/script_test_5.cc: New file.
14434 * testsuite/script_test_5.sh: New file.
14435 * testsuite/script_test_5.t: New file.
14436
f488e4b0
CC
144372009-02-13 Rafael Avila de Espindola <espindola@google.com>
14438
14439 * archive.cc (Archive::include_member): Update calls to add_symbols.
14440 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
14441 the Layout argument.
14442 * dynobj.h (do_add_symbols): Add the Layout argument.
14443 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
14444 Layout argument.
14445 * object.h (Object::add_symbols): Add the Layout argument.
14446 (Object::do_add_symbols): Add the Layout argument.
14447 (Sized_relobj::do_add_symbols): Add the Layout argument.
14448 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
14449 Unify the two versions.
14450 (Add_plugin_symbols): Remove.
14451 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
14452 (Sized_pluginobj::do_add_symbols): Unify the two versions.
14453 (Add_plugin_symbols): Remove.
14454 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
14455 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
14456 (Add_symbols::run): Make it work with Pulginobj.
14457
89dd1680
ILT
144582009-02-06 Ian Lance Taylor <iant@google.com>
14459
14460 * object.cc (Sized_relobj::do_layout): Make info message start
14461 with lower case letter.
14462
266d0a74
ILT
144632009-02-06 Mikolaj Zalewski <mikolajz@google.com>
14464
602b464e
ILT
14465 * binary.cc: Fix file comment.
14466
266d0a74
ILT
14467 * options.h (enum Incremental_disposition): Define.
14468 (class General_options): Add new options: --incremental,
14469 --incremental_changed, --incremental_unchanged,
14470 --incremental_unknown. Add incremental_disposition_ and
14471 implicit_incremental_ fields.
14472 (General_options::incremental_disposition): New function.
14473 (class Position_dependent_options): Add incremental_disposition
14474 option.
14475 (Position_dependent_options::copy_from_options): Set incremental
14476 dispositions.
14477 * options.cc (General_options::parse_incremental_changed): New
14478 function.
2e702c99
RM
14479 (General_options::parse_incremental_unchanged): New function.
14480 (General_options::parse_incremental_unknown): New function.
14481 (General_options::General_options): Initialize new fields
266d0a74 14482 incremental_disposition_ and implicit_incremental_.
2e702c99 14483 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
14484 without --incremental.
14485
f073bbf7
CD
144862009-02-06 Chris Demetriou <cgd@google.com>
14487
14488 * gold.h (gold_undefined_symbol): Change to take only a Symbol
14489 pointer and to report location as the file name associated with
14490 the symbol.
14491 (gold_undefined_symbol_at_location): New function to replace the
14492 old gold_undefined_symbol functionality.
14493 * target-reloc.h (relocate_section): Update to use
14494 gold_undefined_symbol_at_location.
14495 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14496 Call gold_undefined_symbol function rather than gold_error.
14497 * errors.h (Errors::undefined_symbol): Take location as a
14498 string, rather than calculating it from a relocation.
14499 * errors.cc (Errors::fatal): Print "fatal error:" before the
14500 formatted message.
14501 (Errors::error, Errors::error_at_location): Print "error: "
14502 before the formatted message.
14503 (Errors::undefined_symbol): Take location as a string, rather
14504 than calculating it from a relocation.
14505 (gold_undefined_symbol_at_location): New function akin to
14506 old gold_undefined_symbol, calculates location from relocation.
14507 (gold_undefined_symbol): Change to take only a Symbol pointer
14508 and to report location as the file name associated with the symbol.
14509 * testsuite/debug_msg.sh: Update for changed error messages.
14510 * testsuite/undef_symbol.sh: Likewise.
14511
8e94a90c
ILT
145122009-02-04 Duncan Sands <baldrick@free.fr>
14513
14514 PR 9812
14515 * reduced_debug_output.h
14516 (Output_reduced_debug_abbrev_section::failed): Use format for
14517 gold_warning.
14518 (Output_reduced_debug_info_section::faild): Likewise.
14519
88a0e15b
ILT
145202009-01-31 Mikolaj Zalewski <mikolajz@google.com>
14521
14522 * script.cc (Lazy_demangler): New class.
2e702c99 14523 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
14524 symbol only once.
14525
5efc7cd2
CC
145262009-01-29 Cary Coutant <ccoutant@google.com>
14527
14528 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
14529 to __tls_get_addr.
14530 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14531
e0ebcf42
ILT
145322009-01-28 Ian Lance Taylor <iant@google.com>
14533
5efc7cd2 14534 * version.cc (version_string): Bump to 1.9.
75fe7426 14535
e0ebcf42
ILT
14536 * gold.h: Include <cstring> and <stdint.h>.
14537 * version.cc: Include <cstdio>.
14538 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
14539 warning.
14540 * reduced_debug_output.cc (insert_into_vector): Rename from
14541 Insert_into_vector; change all callers. Use Swap_unaligned to
14542 avoid aliasing issue; remove union since it is unnecessary.
14543
8e2813be 145442009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
14545
14546 * Makefile.am (CCFILES): Add gc.cc.
14547 (HFILES): Add gc.h.
14548 * Makefile.in: Regenerate.
14549 * gold.cc (Gc_runner): New class.
14550 (queue_initial_tasks): Call garbage collection related tasks
14551 when corresponding options are invoked.
14552 (queue_middle_gc_tasks): New function.
14553 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
14554 processed early before laying out sections during garbage collection.
14555 * gold.h (queue_middle_gc_tasks): New function.
14556 (is_prefix_of): Move from "layout.cc".
14557 * i386.cc (Target_i386::gc_process_relocs): New function.
14558 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
14559 * main.cc (main): Create object of class "Garbage_collection".
14560 * object.cc (Relobj::copy_symbols_data): New function.
14561 (Relobj::is_section_name_included): New function.
e1df38aa
NC
14562 (Sized_relobj::do_layout): Allow this function to be called twice
14563 during garbage collection and defer layout of section during the
6d03d481
ST
14564 first call.
14565 * object.h (Relobj::get_symbols_data): New function.
14566 (Relobj::is_section_name_included): New function.
14567 (Relobj::copy_symbols_data): New function.
14568 (Relobj::set_symbols_data): New function.
14569 (Relobj::get_relocs_data): New function.
14570 (Relobj::set_relocs_data): New function.
14571 (Relobj::is_output_section_offset_invalid): New pure virtual function.
14572 (Relobj::gc_process_relocs): New function.
14573 (Relobj::do_gc_process_relocs): New pure virtual function.
14574 (Relobj::sd_): New data member.
14575 (Sized_relobj::is_output_section_offset_invalid): New function.
14576 (Sized_relobj::do_gc_process_relocs): New function.
14577 * options.h (General_options::gc_sections): Modify to not be a no-op.
14578 (General_options::print_gc_sections): New option.
14579 * plugin.cc (Plugin_finish::run): Remove function call to
14580 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
14581 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
14582 * reloc.cc (Read_relocs::run): Add task to process relocs and
14583 determine unreferenced sections when doing garbage collection.
14584 (Gc_process_relocs): New class.
14585 (Sized_relobj::do_gc_process_relocs): New function.
14586 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
14587 sections that are garbage collected.
14588 * reloc.h (Gc_process_relocs): New class.
14589 * sparc.cc (Target_sparc::gc_process_relocs): New function.
14590 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
14591 symbols whose corresponding sections are garbage collected.
14592 (Symbol_table::Symbol_table): Add new parameter for the garbage
14593 collection object.
14594 (Symbol_table::gc_mark_undef_symbols): New function.
14595 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14596 (Symbol_table::gc_mark_dyn_syms): New function.
14597 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
14598 as garbage.
14599 (Symbol_table::add_from_object): Likewise.
14600 (Symbol_table::add_from_relobj): When building shared objects, do not
14601 treat externally visible symbols as garbage.
14602 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
14603 table information for static and relocatable links.
14604 * symtab.h (Symbol_table::set_gc): New function.
14605 (Symbol_table::gc): New function.
14606 (Symbol_table::gc_mark_undef_symbols): New function.
14607 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14608 (Symbol_table::gc_mark_dyn_syms): New function.
14609 (Symbol_table::gc_): New data member.
e1df38aa 14610 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
14611 function.
14612 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
14613 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
14614
3b293544
CF
146152009-01-20 Chris Faylor <me.sourceware@sourceware.org>
14616
14617 * options.h (General_options::gc_sections): Define as a no-op for now.
14618 (General_options::no_keep_memory): Ditto.
14619 (General_options::Bshareable): Define.
14620 * options.cc (General_options::finalize): Honor -Bshareable.
14621
83d22aa8
AS
146222009-01-20 Andreas Schwab <schwab@suse.de>
14623
14624 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
14625 read the value in the contents, since we don't use it. Use the
14626 template endianness when writing.
14627 (Relocate::relocate): Use it for R_PPC_REL16_HA.
14628
cd536b21
AS
146292009-01-19 Andreas Schwab <schwab@suse.de>
14630
14631 * configure.tgt (powerpc64-*): Fix targ_obj.
14632
99e9a495
ILT
146332009-01-15 Ian Lance Taylor <iant@google.com>
14634
14635 * object.cc (Sized_relobj::write_local_symbols): Don't write out
14636 local symbols when stripping all symbols.
14637
bbbfea06
CC
146382009-01-14 Cary Coutant <ccoutant@google.com>
14639
99e9a495 14640 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 14641
0f7c0701
CC
146422009-01-14 Cary Coutant <ccoutant@google.com>
14643
14644 * archive.cc (Archive::get_elf_object_for_member): Remove call
14645 to File_read::claim_for_plugin.
14646 * descriptors.cc (Descriptors::open): Remove reference to
14647 is_claimed.
14648 (Descriptors::claim_for_plugin): Remove.
14649 * descriptors.h (Descriptors::claim_for_plugin): Remove.
14650 (Descriptors::is_claimed): Remove.
14651 (claim_descriptor_for_plugin): Remove.
14652 * fileread.cc (File_read::claim_for_plugin): Remove.
14653 * fileread.h (File_read::claim_for_plugin): Remove.
14654 (File_read::descriptor): Reopen descriptor if necessary.
14655 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
14656 (Plugin_manager::all_symbols_read): Add task parameter. Change
14657 all callers.
14658 (Plugin_manager::get_input_file): New function.
14659 (Plugin_manager::release_input_file): New function.
14660 (Pluginobj::Pluginobj): Add filesize parameter and initialize
14661 corresponding data member.
14662 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
14663 and pass to base constructor. Change all callers.
14664 (get_input_file, release_input_file): New functions.
14665 (make_sized_plugin_object): Add filesize parameter. Change all callers.
14666 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
14667 (Plugin_manager::all_symbols_read): Add task parameter.
14668 (Plugin_manager::get_input_file): New function.
14669 (Plugin_manager::release_input_file): New function.
14670 (Plugin_manager::task_): New data member.
14671 (Pluginobj::Pluginobj): Add filesize parameter.
14672 (Pluginobj::filename): New function.
14673 (Pluginobj::descriptor): New function.
14674 (Pluginobj::filesize): New function.
14675 (Pluginobj::filesize_): New data member.
14676 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
14677 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
14678 File_read::claim_for_plugin; use Object::unlock to unlock the file.
14679
14680 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
14681 with archive libraries.
14682 * testsuite/Makefile.in: Regenerate.
14683 * testsuite/plugin_test.c (struct sym_info): New type.
14684 (get_input_file, release_input_file): New static variables.
14685 (onload): Capture new transfer vector entries.
14686 (claim_file_hook): Stop reading at end of file according to filesize.
14687 Factor out parsing of readelf output into separate function.
14688 (all_symbols_read_hook): Exercise get_input_file and release_input_file
14689 APIs and get the source file name from the symbol table. Convert
14690 source file name to corresponding object file name. Print info
14691 message when adding new input files.
14692 (parse_readelf_line): New function.
14693 * testsuite/plugin_test_1.sh: Add checks for new info messages.
14694 * testsuite/plugin_test_2.sh: Likewise.
14695 * testsuite/plugin_test_3.sh: Likewise.
14696 * testsuite/plugin_test_4.sh: New test case.
14697
62a6d109
ILT
146982009-01-07 Ian Lance Taylor <iant@google.com>
14699
14700 * version.cc (version_string): Bump to 1.8.
14701
483620e8
CC
147022008-12-23 Cary Coutant <ccoutant@google.com>
14703
14704 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
14705 * plugin.cc (Plugin_manager::finish): Rename as
14706 layout_deferred_objects. Move cleanup to separate function.
14707 (Plugin_manager::cleanup): New function.
14708 (Plugin_finish::run): Call layout_deferred_objects and cleanup
14709 separately.
14710 * plugin.h (Plugin_manager::finish): Rename as
14711 layout_deferred_objects.
14712 (Plugin_manager::cleanup): New function.
14713 (Plugin_manager::cleanup_done): New field.
14714
d66a9eb3
CC
147152008-12-23 Cary Coutant <ccoutant@google.com>
14716
14717 * plugin.cc (is_visible_from_outside): New function.
14718 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
14719 so we don't return "IR only" status for exported symbols or -r links.
14720
14721 * testsuite/Makefile.am (plugin_test_3): New test case.
14722 * testsuite/Makefile.in: Regenerate.
14723 * testsuite/plugin_test_3.sh: New file.
14724
5995b570
CC
147252008-12-22 Cary Coutant <ccoutant@google.com>
14726
14727 * object.cc (Sized_relobj::layout_section): New function.
14728 (Sized_relobj::do_layout): Defer layout of input sections until after
14729 plugin has provided replacement files.
14730 (Sized_relobj::do_layout_deferred_sections): New function.
14731 * object.h (Relobj::set_section_offset): Remove virtual keyword.
14732 (Relobj::layout_deferred_sections): New function.
14733 (Relobj::do_layout_deferred_sections): New function.
14734 (Sized_relobj::do_layout_deferred_sections): New function.
14735 (Sized_relobj::layout_section): New function.
14736 (Sized_relobj::Deferred_layout): New structure.
14737 (Sized_relobj::deferred_layout_): New field.
14738 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
14739 Change all callers. Layout deferred sections.
14740 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
14741 references.
14742 (Plugin_hook::run): Move code from do_plugin_hook inline.
14743 (Plugin_hook::do_plugin_hook): Remove.
14744 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
14745 (Plugin_manager::finish): Renamed, was cleanup.
14746 (Plugin_manager::should_defer_layout): New function.
14747 (Plugin_manager::add_deferred_layout_object): New function.
14748 (Plugin_manager::Deferred_layout_list): New type.
14749 (Plugin_manager::deferred_layout_objects_): New field.
14750 (Plugin_hook::do_plugin_hook): Remove.
14751
ee769c88
ILT
147522008-12-17 Ian Lance Taylor <iant@google.com>
14753
14754 * options.h (class General_options): Add --no case for
14755 --export-dynamic.
14756
abc8dcba
CC
147572008-12-16 Cary Coutant <ccoutant@google.com>
14758
14759 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
14760 vector.
14761 (Plugin_manager::claim_file): Create plugin object even if
14762 plugin did not call the add_symbols callback.
14763 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
14764 asking for more symbols than were added.
14765 * testsuite/Makefile.am (plugin_test_1): Add test case with
14766 no global symbols.
14767 (empty.syms): New target.
14768 * testsuite/Makefile.in: Regenerate.
14769 * testsuite/plugin_test.c (claim_file_hook): Add new debug
14770 message. Don't call add_symbols if no globals.
14771 (all_symbols_read_hook): Don't provide replacement for empty
14772 claimed file.
14773
b0074644
ILT
147742008-12-12 Ian Lance Taylor <iant@google.com>
14775
68943102
ILT
14776 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
14777 r_type == 0 for a local symbol with r_sym == 0.
14778 (scan_relocatable_relocs): Pass r_sym to
14779 local_non_section_strategy.
14780 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
14781 r_sym parameter.
14782
b0074644
ILT
14783 * configure.ac: Update test for TLS descriptors: they are
14784 supported as of glibc 2.9.
14785 * configure: Rebuild.
14786
c2508178
ILT
147872008-12-11 Ian Lance Taylor <iant@google.com>
14788
14789 PR 7091
14790 * target-reloc.h (Default_scan_relocatable_relocs): For each
14791 function, map r_type == 0 to RELOC_DISCARD.
14792
2756a258
CC
147932008-12-10 Cary Coutant <ccoutant@google.com>
14794
14795 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
14796 object to override a kept COMDAT group from a plugin object.
14797
bb6f53d3
ILT
147982008-12-09 Ian Lance Taylor <iant@google.com>
14799
fbc558e1
ILT
14800 PR 7088
14801 * yyscript.y (file_cmd): Handle INPUT.
14802
bb6f53d3
ILT
14803 * testsuite/initpri1.c: Change all declarations to be full
14804 prototypes by adding void, to avoid compiler warnings.
14805
4674ecfc
CC
148062008-12-05 Rafael Avila de Espindola <espindola@google.com>
14807
14808 * options.cc (General_options::parse_plugin_opt): New.
14809 (General_options::add_plugin): The argument now is just the filename.
14810 (General_options::add_plugin_option): New.
14811 * options.h (plugin_opt): New.
14812 (add_plugin): Change argument name.
14813 (add_plugin_option): New.
14814 * plugin.cc (Plugin::load): Don't parse the plugin option.
14815 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
14816 (Plugin::add_option): New.
14817 (Plugin::args_): Change type.
14818 (Plugin::filename_): New.
14819 (Plugin_manager::add_plugin_option): New.
14820 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
14821 * testsuite/Makefile.in: Regenerate.
14822
fd06b4aa
CC
148232008-12-05 Cary Coutant <ccoutant@google.com>
14824
14825 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
14826 Handle --strip-lto-sections option.
14827 * options.h (strip_lto_sections): New option.
14828
6c52134c
CC
148292008-12-01 Cary Coutant <ccoutant@google.com>
14830
14831 * plugin.cc (ld_plugin_message): Change format parameter to const.
14832 Fix mismatch between new[] and delete.
14833
a45248e0
CC
148342008-11-14 Cary Coutant <ccoutant@google.com>
14835
14836 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
14837 instead of -1U.
14838
c82fbeee
CS
148392008-11-05 Craig Silverstein <csilvers@google.com>
14840
14841 * options.cc (General_options::parse_dynamic_list): New function.
14842 * options.h (General_options): New flags dynamic_list,
14843 dynamic_list_data, dynamic_list_cpp_new, and
14844 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
14845 (General_options::in_dynamic_list): New function.
14846 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
14847 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
14848 (Lex::can_continue_name): Likewise.
14849 (yylex): Likewise.
14850 (read_script_file): New parameter script_options.
14851 (read_dynamic_list): New function.
14852 (Script_options::define_dynamic_list): New function.
14853 (dynamic_list_keyword_parsecodes): New variable.
14854 (dynamic_list_keywords): New variable.
14855 * script.h (Script_options::define_dynamic_list): New function
14856 prototype.
14857 (read_dynamic_list): New function prototype.
14858 * symtab.cc (strprefix): New macro.
14859 (Symbol::should_add_dynsym_entry): Support dynamic_list,
14860 dynamic_list_data, dynamic_list_cpp_new, and
14861 dynamic_list_cpp_typeinfo.
14862 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
14863 (dynamic_list_expr): New rule.
14864 (dynamic_list_nodes): Likewise.
14865 (dynamic_list_node): Likewise.
14866 * testsuite/Makefile.am (dynamic_list): New test.
14867 * testsuite/Makefile.in: Regenerated.
14868 * testsuite/dynamic_list.t: New file.
14869 * testsuite/dynamic_list.sh: New file.
14870
e0bb29a5
CS
148712008-11-05 Craig Silverstein <csilvers@google.com>
14872
14873 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
14874 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
14875 (t11_last): Likewise.
14876 * testsuite/ver_test_6.c (main): Likewise.
14877
4e1e25e0
CC
148782008-10-07 Cary Coutant <ccoutant@google.com>
14879
14880 * options.c (General_options::finalize): Add check for -static and
14881 -shared.
14882 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
14883 is not empty.
14884
92f03fcb
CC
148852008-10-02 Cary Coutant <ccoutant@google.com>
14886
14887 * plugin.cc (make_sized_plugin_object): Fix conditional
14888 compilation to work when not all targets are enabled.
14889
fbd8a257
CC
148902008-09-29 Cary Coutant <ccoutant@google.com>
14891
14892 * archive.cc (Archive::get_file_and_offset): Use filename instead
14893 of name to get library path.
14894 (Archive::include_member): Unlock external member of a thin archive.
14895
14896 * testsuite/Makefile.am (TEST_AR): New variable.
14897 (thin_archive_test_1): New test.
14898 (thin_archive_test_2): New test.
81636b3f
CC
14899 * testsuite/Makefile.in: Regenerate.
14900 * testsuite/thin_archive_main.cc: New file.
14901 * testsuite/thin_archive_test_1.cc: New file.
14902 * testsuite/thin_archive_test_2.cc: New file.
14903 * testsuite/thin_archive_test_3.cc: New file.
14904 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 14905
eff45813
CC
149062008-09-29 Cary Coutant <ccoutant@google.com>
14907
14908 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
14909 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
14910 instead of -1U.
14911 (Sized_relobj::do_finalize_local_symbols): Likewise.
14912 (Sized_relobj::map_to_kept_section): Likewise.
14913 * object.h (Sized_relobj::invalid_address): New constant.
14914 (Sized_relobj::do_output_section_offset): Check for invalid_address
14915 and return -1ULL.
14916 * output.cc (Output_reloc::local_section_offset): Use constant
14917 invalid_address instead of -1U.
14918 (Output_reloc::get_address): Likewise.
14919 (Output_section::output_address): Change -1U to -1ULL.
14920 * output.h (Output_reloc::invalid_address): New constant.
14921 * reloc.cc (Sized_relobj::write_sections): Use constant
14922 invalid_address instead of -1U.
14923 (Sized_relobj::relocate_sections): Likewise.
14924 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
14925 values for merge sections.
14926 * target-reloc.h (relocate_for_relocatable): Use constant
14927 invalid_address instead of -1U.
14928
89fc3421
CC
149292008-09-19 Cary Coutant <ccoutant@google.com>
14930
14931 Add plugin functionality for link-time optimization (LTO).
14932 * configure.ac (plugins): Add --enable-plugins option.
14933 * configure: Regenerate.
14934 * config.in: Regenerate.
14935 * Makefile.am (LIBDL): New variable.
14936 (CCFILES): Add plugin.cc.
14937 (HFILES): Add plugin.h.
14938 (ldadd_var): Add LIBDL.
14939 * Makefile.in: Regenerate.
14940
14941 * archive.cc: Include "plugin.h".
14942 (Archive::setup): Don't preread archive symbols when using a plugin.
14943 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
14944 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
14945 files.
14946 (Archive::include_member): Add symbols from plugin objects.
14947 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
14948 * descriptors.cc (Descriptors::open): Check for file descriptors
14949 abandoned by plugins.
14950 (Descriptors::claim_for_plugin): New function.
14951 * descriptors.h (Descriptors::claim_for_plugin): New function.
14952 (Open_descriptor::is_claimed): New field.
14953 (claim_descriptor_for_plugin): New function.
14954 * fileread.cc (File_read::claim_for_plugin): New function.
14955 * fileread.h (File_read::claim_for_plugin): New function.
14956 (File_read::descriptor): New function.
14957 * gold.cc: Include "plugin.h".
14958 (queue_initial_tasks): Add task to call plugin hooks for generating
14959 new object files.
14960 * main.cc: Include "plugin.h".
14961 (main): Load plugin libraries.
14962 * object.h (Pluginobj): Declare.
14963 (Object::pluginobj): New function.
14964 (Object::do_pluginobj): New function.
14965 (Object::set_target): New function.
14966 * options.cc: Include "plugin.h".
14967 (General_options::parse_plugin): New function.
14968 (General_options::General_options): Initialize plugins_ field.
14969 (General_options::add_plugin): New function.
14970 * options.h (Plugin_manager): Declare.
14971 (General_options): Add --plugin option.
14972 (General_options::has_plugins): New function.
14973 (General_options::plugins): New function.
14974 (General_options::add_plugin): New function.
14975 (General_options::plugins_): New field.
14976 * plugin.cc: New file.
14977 * plugin.h: New file.
14978 * readsyms.cc: Include "plugin.h".
14979 (Read_symbols::do_read_symbols): Check for archive before checking
14980 for ELF file. Call plugin hooks to claim files.
14981 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
14982 from a real object file; force override when processing replacement
14983 files.
14984 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
14985 (Symbol::init_base_object): Likewise.
14986 (Symbol::init_base_output_data): Likewise.
14987 (Symbol::init_base_output_segment): Likewise.
14988 (Symbol::init_base_constant): Likewise.
14989 (Symbol::init_base_undefined): Likewise.
14990 (Symbol::output_section): Assert that object is not a plugin.
14991 (Symbol_table::add_from_pluginobj): New function.
14992 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
14993 undefined.
14994 (Symbol_table::sized_write_globals): Likewise.
14995 (Symbol_table::add_from_pluginobj): Instantiate template.
14996 * symtab.h (Sized_pluginobj): Declare.
14997 (Symbol::in_real_elf): New function.
14998 (Symbol::set_in_real_elf): New function.
14999 (Symbol::in_real_elf_): New field.
15000 (Symbol_table::add_from_pluginobj): New function.
15001
15002 * testsuite/Makefile.am (AM_CFLAGS): New variable.
15003 (LIBDL): New variable.
15004 (LDADD): Add LIBDL.
15005 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
15006 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
15007 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
15008 (MOSTLYCLEANFILES): Likewise.
15009 * testsuite/Makefile.in: Regenerate.
15010 * testsuite/plugin_test.c: New file.
15011 * testsuite/plugin_test_1.sh: New file.
15012 * testsuite/plugin_test_2.sh: New file.
15013
de31bda5
ILT
150142008-09-16 Ian Lance Taylor <iant@google.com>
15015
9c2d0ef9
ILT
15016 * target-reloc.h (relocate_section): Check whether a symbol is
15017 defined by the ABI before reporting an undefined symbol error.
15018 * target.h (Target::is_defined_by_abi): Make parameter const.
15019 (Target::do_is_defined_by_abi): Likewise.
15020 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
15021 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
15022 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
15023 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
15024 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
15025 * testsuite/Makefile.in: Rebuild.
15026
de31bda5
ILT
15027 * fileread.cc (make_view): Add casts to avoid warning.
15028
9fa33bee
AO
150292008-09-16 Alexandre Oliva <aoliva@redhat.com>
15030
15031 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
15032 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15033
183fd0e3
AO
150342008-09-16 Alexandre Oliva <aoliva@redhat.com>
15035
15036 * options.h (General_options::output_is_executable): New.
15037 (General_options::output_is_pie): New.
15038 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
15039 for shared libraries.
15040 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15041
7be8330a
CD
150422008-09-11 Chris Demetriou <cgd@google.com>
15043
15044 * options.h (origin): New -z option.
15045 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
15046 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
15047 in DT_FLAGS_1.
15048
a9caad02
CC
150492008-09-05 Cary Coutant <ccoutant@google.com>
15050
15051 * fileread.cc (File_read::make_view): Add check for attempt to map
15052 beyond end of file.
15053
ae6dce4d
CC
150542008-09-05 Cary Coutant <ccoutant@google.com>
15055
15056 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
15057 explicit instantiations.
15058
d7ab2a47
KVH
150592008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
15060
15061 PR gold/6858
15062 * options.cc (General_options::finalize): Allow undefined symbols
15063 in shlibs if linking -shared.
15064
15065 PR gold/6859
15066 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
15067 symbols as not needing a dynsym entry.
15068
1e52a9c1
CS
150692008-08-20 Craig Silverstein <csilvers@google.com>
15070
15071 * fileread.cc (File_read::open): Do not lock the file unless it
15072 was successfully opened.
15073
d85c80a3
CC
150742008-08-14 Cary Coutant <ccoutant@google.com>
15075
15076 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
15077 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
15078 * testsuite/tls_test.cc (struct int128): 128-bit struct
15079 for testing TLS relocs with non-zero addend.
15080 (v12): New TLS variable.
15081 (t12): New test.
15082 (t_last): Add check for v12.
15083 * testsuite/tls_test.h (t12): New function.
15084 * testsuite/tls_test_main.cc (thread_routine): Call new test.
15085
2d924fd9
ILT
150862008-08-13 Ian Lance Taylor <iant@google.com>
15087
15088 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
15089 set tls_segment_ or relro_segment_.
15090 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
15091 when appropriate.
15092 * output.h (Output_section::clear_is_relro): New function.
15093 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
15094 sections specially even when output_data_ is empty.
15095 (Output_segment::maximum_alignment): When first section is relro,
15096 only force alignment for PT_LOAD segments.
15097 * script.cc (script_data_segment_align): New function.
15098 (script_data_segment_relro_end): New function.
15099 * script-c.h (script_data_segment_align): Declare.
15100 (script_data_segment_relro_end): Declare.
15101 * script-sections.h (class Script_sections): Declare
15102 data_segment_align and data_segment_relro_end. Add fields
15103 segment_align_index_ and saw_relro_end_.
15104 * script-sections.cc (class Sections_element): Add set_is_relro
15105 virtual function. Add new bool* parameter to place_orphan_here.
15106 Add get_output_section virtual function.
15107 (class Output_section_definition): Add set_is_relro. Add new
15108 bool* parameter to place_orphan_here. Add get_output_section.
15109 Add is_relro_ field.
15110 (Output_section_definition::Output_section_definition): Initialize
15111 evaluated_address_, evaluated_load_address, evaluated_addralign_,
15112 and is_relro_ fields.
15113 (Output_section_definition::place_orphan_here): Add is_relro
15114 parameter.
15115 (Output_section_definition::set_section_addresses): Set relro for
15116 output section.
15117 (Output_section_definition::alternate_constraint): Likewise.
15118 (class Orphan_output_section): Add new bool* parameter to
15119 place_orphan_here. Add get_output_section.
15120 (Orphan_output_section::place_orphan_here): Add is_relro
15121 parameter.
15122 (Script_sections::Script_sections): Initialize
15123 data_segment_align_index_ and saw_relro_end_.
15124 (Script_sections::data_segment_align): New function.
15125 (Script_sections::data_segment_relro_end): New function.
15126 (Script_sections::place_orphan): Set or clear is_relro.
15127 (Script_sections::set_section_addresses): Force alignment of first
15128 TLS section.
15129 * yyscript.y (exp): Call script_data_segment_align and
15130 script_data_segment_relro_end.
15131 * testsuite/relro_script_test.t: New file.
15132 * testsuite/relro_test.cc (using_script): Declare.
15133 (t1, t2): Test using_script.
15134 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
15135 (relro_script_test_SOURCES): Define.
15136 (relro_script_test_DEPENDENCIES): Define.
15137 (relro_script_test_LDFLAGS): Define.
15138 (relro_script_test_LDADD): Define.
15139 (relro_script_test.so): New target.
15140 * testsuite/Makefile.in: Rebuild.
15141
f827c9a9
CC
151422008-08-06 Cary Coutant <ccoutant@google.com>
15143
15144 * archive.cc (Archive::total_archives, Archive::total_members)
15145 (Archive::total_members_loaded): New variables.
15146 (Archive::setup): Add parameter. Add option to preread
15147 archive symbols.
15148 (Archive::read_armap): Add counter.
15149 (Archive::get_file_and_offset): New function.
15150 (Archive::get_elf_object_for_member): New function.
15151 (Archive::read_all_symbols): New function.
15152 (Archive::read_symbols): New function.
15153 (Archive::add_symbols): Add counters.
15154 (Archive::include_all_members): Use armap to find members if it's
15155 already built.
15156 (Archive::include_member): Skip reading symbols if already read.
15157 Factored code into Archive::get_file_and_offset and
15158 Archive::get_elf_object_for_member. Changed call to
15159 Mapfile::report_include_archive_member.
15160 (Archive::print_stats): New function.
15161 * archive.h: Declare Object and Read_symbols_data classes.
15162 (Archive::Archive): Add initializers for new members.
15163 (Archive::setup): Add parameter.
15164 (Archive::print_stats): New function.
15165 (Archive::total_archives, Archive::total_members)
15166 (Archive::total_members_loaded): New variables.
15167 (Archive::get_file_and_offset): New function.
15168 (Archive::get_elf_object_for_member): New function.
15169 (Archive::read_all_symbols): New function.
15170 (Archive::read_symbols): New function.
15171 (Archive::Archive_member): New class.
15172 (Archive::members_): New member.
15173 (Archive::num_members_): New member.
15174 * main.cc: Include archive.h.
15175 (main): Call Archive::print_stats.
15176 * mapfile.cc (Mapfile::report_include_archive_member): Delete
15177 archive parameter; member_name is now the fully-decorated name.
15178 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
15179 * options.h: (General_options): Add --preread-archive-symbols option.
15180 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
15181 Archive::setup.
15182
de4c45bd
ILT
151832008-08-04 Ian Lance Taylor <iant@google.com>
15184
15185 * symtab.h (Symbol::use_plt_offset): New function.
15186 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
15187 * powerpc.cc (Relocate::relocate): Likewise.
15188 * sparc.cc (Relocate::relocate): Likewise.
15189 * x86_64.cc (Relocate::relocate): Likewise.
15190 * testsuite/weak_plt.sh: New test.
15191 * testsuite/weak_plt_main.cc: New test.
15192 * testsuite/weak_plt_shared.cc: New test.
15193 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
15194 (check_PROGRAMS): Add weak_plt.
15195 (check_DATA): Add weak_plt_shared.so.
15196 (weak_plt_main_pic.o, weak_plt): New targets.
15197 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
15198 * testsuite/Makefile.in: Rebuild.
15199
15200 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
15201 gcctestdir/ld.
15202 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
15203 * testsuite/Makefile.in: Rebuild.
15204
323ee3f4
AM
152052008-08-04 Alan Modra <amodra@bigpond.net.au>
15206
15207 * Makefile.am (POTFILES.in): Set LC_ALL=C.
15208 * Makefile.in: Regenerate.
15209 * po/POTFILES.in: Regenerate.
15210
7c07ecec
ILT
152112008-07-29 Ian Lance Taylor <iant@google.com>
15212
15213 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
15214 symbols before other symbols.
15215 * testsuite/script_test_2.cc (test_addr): Declare.
15216 (test_addr_alias): Declare.
15217 (main): Check that test_addr and test_addr_alias have the right
cd536b21 15218 values.
7c07ecec
ILT
15219 * testsuite/script_test_2.t: Define test_addr_alias and
15220 test_addr.
15221
5778530e
ILT
152222008-07-24 Ian Lance Taylor <iant@google.com>
15223
2a00e4fb
ILT
15224 PR 5990
15225 * descriptors.cc: New file.
15226 * descriptors.h: New file.
15227 * gold-threads.h (class Hold_optional_lock): New class.
15228 * fileread.cc: Include "descriptors.h".
15229 (File_read::~File_read): Release descriptor rather than closing
15230 it.
15231 (File_read::open) [file]: Call open_descriptor rather than open.
15232 Set is_descriptor_opened_.
15233 (File_read::open) [memory]: Assert that descriptor is not open.
15234 (File_read::reopen_descriptor): New function.
15235 (File_read::release): Release descriptor.
15236 (File_read::do_read): Make non-const. Reopen descriptor.
15237 (File_read::read): Make non-const.
15238 (File_read::make_view): Reopen descriptor.
15239 (File_read::do_readv): Likewise.
15240 * fileread.h (class File_read): Add is_descriptor_opened_ field.
15241 Update declarations.
15242 * layout.cc: Include "descriptors.h".
15243 (Layout::create_build_id): Use open_descriptor rather than open.
15244 * output.cc: Include "descriptors.h".
15245 (Output_file::open): Use open_descriptor rather than open.
15246 * archive.cc (Archive::const_iterator): Change Archive to be
15247 non-const.
15248 (Archive::begin, Archive::end): Make non-const.
15249 (Archive::count_members): Likewise.
15250 * archive.h (class Archive): Update declarations.
15251 * object.h (Object::read): Make non-const.
15252 * Makefile.am (CCFILES): Add descriptors.cc.
15253 (HFILES): Add descriptors.h.
15254 * Makefile.in: Rebuild.
15255
801647d1
ILT
15256 PR 6716
15257 * gold.h: Always include <clocale>. Add Solaris workarounds
15258 following code in binutils/sysdep.h.
15259
5edd166e
ILT
15260 PR 6048
15261 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
15262 this->eh_frame_hdr_ is NULL before using it.
15263
c89ad728
ILT
15264 * dynobj.cc (Versions::Versions): Update comment.
15265
aa86f06b
ILT
15266 * dynobj.cc (Versions::Versions): If there is an soname, use it as
15267 the base version name.
15268
5778530e
ILT
15269 * stringpool.cc (Stringpool_template::add_with_length): Set key to
15270 array size plus one.
15271 (Stringpool_template::set_string_offsets): Subtract one from key
15272 before using it as an array index.
15273 (Stringpool_template::get_offset_with_length): Likewise.
15274 (Stringpool_template::write_to_buffer): Likewise.
15275 * stringpool.h (Stringpool_template::get_offset_from_key):
15276 Likewise.
15277
057ead22
ILT
152782008-07-23 Ian Lance Taylor <iant@google.com>
15279
7f649c59
ILT
15280 PR 6658
15281 * object.h (Merged_symbol_value::value): Do our best to handle a
15282 negative addend.
15283
057ead22
ILT
15284 PR 6647
15285 * script.cc (Version_script_info::get_versions): Don't add empty
15286 version tag to return value.
15287 (Version_script_info::get_symbol_version_helper): Change return
15288 type to bool. Add pversion parameter. Change all callers.
15289 (script_register_vers_node): Don't require a non-NULL tag.
15290 * script.h (class Version_script_info): Update declarations.
15291 (Version_script_info::get_symbol_version): Change return type to
15292 bool. Add version parameter. Change all callers.
15293 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
15294 handling. Handle an empty version from a version script.
15295 (Symbol_table::define_special_symbol): Likewise.
15296 * testsuite/ver_test_10.script: New file.
15297 * testsuite/ver_test_10.sh: New file.
15298 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
15299 (check_DATA): Add ver_test_10.syms.
15300 (ver_test_10.syms, ver_test_10.so): New target.
15301 * testsuite/Makefile.in: Rebuild.
15302
58e54ac2
CD
153032008-07-23 Simon Baldwin <simonb@google.com>
15304
15305 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
15306 to zero for undefined symbols from dynamic libraries.
15307
95d14cd3
ILT
153082008-07-23 Ian Lance Taylor <iant@google.com>
15309
15310 * symtab.cc (Symbol_table::resolve): Remove version parameter.
15311 Change all callers.
15312 * symtab.h (class Symbol_table): Update declaration.
15313 * testsuite/ver_test_9.cc: New file.
15314 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
15315 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
15316 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
15317 (ver_test_9.so, ver_test_9.o): New targets.
15318 * testsuite/Makefile.in: Rebuild.
15319
92de84a6
ILT
153202008-07-22 Ian Lance Taylor <iant@google.com>
15321
34810851
ILT
15322 * options.h (class General_options): Define --check-sections.
15323 * layout.cc (Layout::set_segment_offsets): Handle
15324 --check-sections.
15325
af6156ef
ILT
15326 * options.h (class General_options): Define -n/--nmagic and
15327 -N/--omagic.
15328 * options.cc (General_options::finalize): For -n/--nmagic or
15329 -N/--omagic, set -static.
15330 * layout.cc (Layout::attach_allocated_section_to_segment): If
15331 -N/--omagic, don't put read-only and read-write sections in
15332 different segments.
15333 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
15334 finding a read-only segment.
15335 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
15336 don't set the minimum segment alignment to the common page size,
15337 and don't set the file offset to the address modulo the page size.
15338 * script-sections.cc (Script_sections::create_segments): If
15339 -n/--omagic, don't put read-only and read-write sections in
15340 different segments.
15341
92de84a6
ILT
15342 * cref.cc: New file.
15343 * cref.h: New file.
15344 * options.h (class General_options): Add --print-symbol-counts.
15345 * main.cc (main): Issue defined symbol report if requested.
15346 * archive.cc (Archive::interpret_header): Make into a const member
15347 function.
15348 (Archive::add_symbols): Call Input_objects::archive_start and
15349 archive_stop.
15350 (Archive::const_iterator): Define new class.
15351 (Archive::begin, Archive::end): New functions.
15352 (Archive::include_all_members): Rewrite to use iterator.
15353 (Archive::count_members): New function.
15354 * archive.h (class Archive): Update declarations.
15355 (Archive::filename): New function.
15356 * object.cc: Include "cref.h".
15357 (Sized_relobj::Sized_relobj): Initialize defined_count_.
15358 (Sized_relobj::do_get_global_symbol_counts): New function.
15359 (Input_objects::add_object): Add object to cross-referencer.
15360 (Input_objects::archive_start): New function.
15361 (Input_objects::archive_stop): New function.
15362 (Input_objects::print_symbol_counts): New function.
15363 * object.h: Declare Cref and Archive.
15364 (Object::get_global_symbol_counts): New function.
15365 (Object::do_get_global_symbol_counts): New pure virtual function.
15366 (class Sized_relobj): Add defined_count_ field. Update
15367 declarations.
15368 (class Input_objects): Add cref_ field. Update constructor.
15369 Update declarations.
15370 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
15371 defined_count_.
15372 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
15373 symbol counts.
15374 (Sized_dynobj::do_get_global_symbol_counts): New function.
15375 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
15376 defined_count_. Update declarations. Define Symbols typedef.
15377 * symtab.cc (Symbol_table::add_from_relobj): Add defined
15378 parameter. Change all callers.
15379 (Symbol_table::add_from_dynobj): Add sympointers and defined
15380 parameters. Change all callers.
15381 * symtab.h (class Symbol_table): Update declarations.
15382 * Makefile.am (CCFILES): Add cref.cc.
15383 (HFILES): Add cref.h.
15384 * Makefile.in: Rebuild.
15385
3f7c5e1d
CD
153862008-07-22 Simon Baldwin <simonb@google.com>
15387
15388 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
15389 to zero when writing undefined symbols.
15390
e0b64032
ILT
153912008-07-22 Ian Lance Taylor <iant@google.com>
15392
15393 * output.cc (Output_section::add_input_section): Don't try to
15394 merge empty merge sections.
15395
096b02cf
CS
153962008-07-21 Craig Silverstein <csilvers@google.com>
15397
15398 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15399 Include symbol version in error message.
cd536b21 15400
1d1f116d
CD
154012008-07-20 Chris Demetriou <cgd@google.com>
15402
cd536b21 15403 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
15404 (RANDOM_SEED_CFLAGS): New substituted variable.
15405 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
15406 * configure: Rebuild.
15407 * Makefile.in: Likewise.
15408 * testsuite/Makefile.in: Likewise.
15409
a18f591e
ILT
154102008-07-18 Ian Lance Taylor <iant@google.com>
15411
15412 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
15413 where we see NAME/NULL and NAME/VERSION as separate symbols.
15414 * testsuite/ver_test_main.cc (main): Call t4.
15415 (t4, t4_2a): Define.
15416 * testsuite/ver_test_2.cc (t4_2): Define.
15417 * testsuite/ver_test_2.script: Put t4_2a in VER2.
15418 * testsuite/ver_test_4.cc (t4_2a): Define.
15419 * testsuite/ver_test_4.script: Put t4_2a in VER2.
15420 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
15421
c6e3f6ed
ILT
154222008-07-17 Ian Lance Taylor <iant@google.com>
15423
15424 * dynobj.cc (Versions::add_def): If we give an error about a
15425 missing version, go ahead and create the version anyhow.
15426
ef9beddf
ILT
154272008-07-10 Ian Lance Taylor <iant@google.com>
15428
15429 Handle output sections with more than 0x7fffffff bytes.
15430 * object.h (class Relobj): Change map_to_output_ to
15431 output_sections_, and just keep a section pointer. Change all
15432 uses. Move comdat group support to Sized_relobj.
15433 (Relobj::is_section_specially_mapped): Remove.
15434 (Relobj::output_section): Remove poff parameter. Change all
15435 callers.
15436 (Relobj::output_section_offset): New function.
15437 (Relobj::set_section_offset): Rewrite.
15438 (Relobj::map_to_output): Remove.
15439 (Relobj::output_sections): New function.
15440 (Relobj::do_output_section_offset): New pure virtual function.
15441 (Relobj::do_set_section_offset): Likewise.
15442 (class Sized_relobj): Add section_offsets_ field. Add comdat
15443 group support from Relobj. Update declarations.
15444 (Sized_relobj::get_output_section_offset): New function.
15445 (Sized_relobj::do_output_section_offset): New function.
15446 (Sized_relobj::do_set_section_offset): New function.
15447 * object.cc (Relobj::output_section_address): Remove.
15448 (Sized_relobj::Sized_relobj): Initialize new fields.
15449 (Sized_relobj::include_section_group): Cast find_kept_object to
15450 Sized_relobj.
15451 (Sized_relobj::include_linkonce_section): Likewise.
15452 (Sized_relobj::do_layout): Use separate arrays for output section
15453 and output offset.
15454 (Sized_relobj::do_count_local_symbols): Change map_to_output to
15455 output_sections.
15456 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
15457 output_sections and section_offsets.
15458 (Sized_relobj::write_local_symbols): Likewise.
15459 (map_to_kept_section): Compute output address directly.
15460 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
15461 output_sections and section_offsets.
15462 (Sized_relobj::write_sections): Likewise.
15463 (Sized_relobj::relocate_sections): Likewise.
15464 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
15465 * output.h (class Output_reloc): Update declarations. Change
15466 u2_.relobj to Sized_relobj*.
15467 (class Output_data_reloc): Change add functions to use
15468 Sized_relobj*.
15469 * output.cc (Output_reloc::Output_reloc): Change relobj to
15470 Sized_relobj*.
15471 (Output_reloc::local_section_offset): Change return type to
15472 Elf_Addr. Use get_output_section_offset.
15473 (Output_reloc::get_address): Likewise.
15474 (Output_section::is_input_address_mapped): Don't call
15475 is_section_specially_mapped.
15476 (Output_section::output_offset): Likewise.
15477 (Output_section::output_address): Likewise.
15478 (Output_section::starting_output_address): Likewise.
15479 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
15480 parameter to Sized_relobj*.
15481 (Copy_relocs::need_copy_reloc): Likewise.
15482 (Copy_relocs::save): Likewise.
15483 * copy-relocs.h (class Copy_relocs): Update declarations.
15484 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
15485 Sized_relobj*. Change relobj_ field to Sized_relobj*.
15486 * target-reloc.h (relocate_for_relocatable): Change
15487 offset_in_output_section type to Elf_Addr. Change code that uses
15488 it as well.
15489 * layout.cc (Layout::layout): Always set *off.
15490 * mapfile.cc (Mapfile::print_input_section): Use
15491 output_section_offset.
15492 * i386.cc (Target_i386::copy_reloc): Change object parameter to
15493 Sized_relobj*.
15494 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
15495 * sparc.cc (Target_sparc::copy_reloc): Likewise.
15496 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
15497
5cb66f97
ILT
154982008-07-03 Ian Lance Taylor <iant@google.com>
15499
15500 * layout.cc (Layout::include_section): Do not discard unrecognized
15501 SHT_STRTAB sections.
15502
afe47622
CS
155032008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
15504
15505 * script.cc (Lex::can_continue_name): Make '?' allowable in
15506 version-script names.
15507 * testsuite/version_script.map: Change glob pattern to use '?'
15508
5adf9721
ILT
155092008-06-30 Manish Singh <yosh@gimp.org>
15510
15511 PR 6585
15512 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
15513 Correct typo.
15514
e6fde208
ILT
155152008-06-30 Ian Lance Taylor <iant@google.com>
15516
15517 PR 6660
15518 PR 6682
15519 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
15520 versions]: Don't try to read the value in the contents, since we
15521 don't use it. Use the template endianness when writing.
15522
3f2e6a2d
CC
155232008-06-25 Cary Coutant <ccoutant@google.com>
15524
15525 * fileread.cc (File_read::make_view): Assert on zero-length view.
15526 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
15527 symbol table when there are no symbols to read.
15528
c43d3a48
CS
155292008-06-23 Craig Silverstein <csilvers@google.com>
15530
15531 * version.cc (version_string): Bump to 1.7
15532
5f494ea0
CS
155332008-06-18 Craig Silverstein <csilvers@google.com>
15534
15535 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
15536 constant 0xFFFF to type Valtype.
15537 (Powerpc_relocate_functions::rel16_ha): Likewise.
15538
c42e122e
ILT
155392008-06-17 Ian Lance Taylor <iant@google.com>
15540
f34787f8
ILT
15541 * output.h (Output_section::Input_section): Initialize p2align_ to
15542 zero for Output_section_data constructors.
15543 (Output_section::Input_section::addralign): If not an input
15544 section, return the alignment of the Output_section_data.
15545 * testsuite/copy_test.cc: New file.
15546 * testsuite/copy_test_1.cc: New file.
15547 * testsuite/copy_test_2.cc: New file.
15548 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
15549 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
15550 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
15551 (copy_test_1_pic.o, copy_test_1.so): New targets.
15552 (copy_test_2_pic.o, copy_test_2.so): New targets.
15553 * testsuite/Makefile.in: Rebuild.
15554
c42e122e
ILT
15555 * script-sections.cc (Script_sections::place_orphan): Initialize
15556 local variable exact.
15557
ce3ac18a
DE
155582008-06-13 David Edelsohn <edelsohn@gnu.org>
15559
15560 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
15561
42cacb20
DE
155622008-06-12 David Edelsohn <edelsohn@gnu.org>
15563 David S. Miller <davem@davemloft.net>
15564
15565 * powerpc.cc: New file.
15566 * Makefile.am (TARGETSOURCES): Add powerpc.cc
15567 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
15568 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
15569 * Makefile.in: Rebuild.
15570
7b308235
ILT
155712008-06-09 Ian Lance Taylor <iant@google.com>
15572
15573 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
15574 <exception>.
15575 (throwing, orig_terminate): New static variables.
15576 (terminate_handler): New static function.
15577 (t2): Set terminate handler.
15578
f0b886e3
ILT
155792008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
15580
15581 PR 6584
cd536b21 15582 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
15583 alignment.
15584
3e90f135
CC
155852008-05-30 Cary Coutant <ccoutant@google.com>
15586
15587 * archive.cc (Archive::include_all_members) Correct to step
15588 over symbol table and extended name table in thin archives.
15589
e09ad04a
ILT
155902008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
15591
15592 PR 6407
15593 * target-reloc.h (relocate_for_relocatable): Fix new_offset
15594 calculation.
15595
62b01cb5
ILT
155962008-05-28 Caleb Howe <cshowe@google.com>
15597
15598 * reduced_debug_output.cc: New file.
15599 * reduced_debug_output.h: New file.
92de84a6 15600 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
15601 * options.cc (General_options::finalize): Add strip_debug_non_line
15602 to the strip heirarchy.
15603 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
15604 fields.
15605 * layout.cc: Include "reduced_debug_output.h".
15606 (Layout::Layout): Initialize new fields.
15607 (line_only_debug_sections): New static array.
15608 (is_lines_only_debug_sections): New static inline function.
15609 (Layout::include_section): Handle --strip-debug-non-line.
15610 (Layout::make_output_section): If --strip-debug-non-line, build
15611 new output sections for .debug_abbrev and .debug_info.
15612 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
15613 gold. Warn about possible overflow.
15614 (read_signed_LEB_128): Likewise.
15615 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
15616 (read_signed_LEB_128): Declare.
15617 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
15618 (HFILES): Add reduced_debug_output.h.
15619 * Makefile.in: Rebuild.
15620
7d9e3d98
ILT
156212008-05-21 Ian Lance Taylor <iant@google.com>
15622
15623 * mapfile.cc: New file.
15624 * mapfile.h: New file.
15625 * options.h (class General_options): Add -M/--print-map and -Map.
15626 * options.cc (General_options::finalize): Make -M equivalent to
15627 -Map -.
15628 * main.cc: Include <cstdio> and "mapfile.h".
15629 (main): Open mapfile if requested.
15630 * gold.cc (class Middle_runner): Add mapfile_ field. Update
15631 constructor. Change caller.
15632 (queue_initial_tasks): Add mapfile parameter. Change caller.
15633 (queue_middle_tasks): Likewise.
15634 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
15635 declarations.
15636 * archive.cc: Include "mapfile.h".
15637 (Archive::add_symbols): Add mapfile parameter. Change all
15638 callers. Pass mapfile, symbol, and reason to include_member.
15639 (Archive::include_all_members): Add mapfile parameter. Change all
15640 callers.
15641 (Archive::include_member): Add mapfile, sym, and why parameters.
15642 Change all callers. Report inclusion to map file.
15643 * archive.h: Include "fileread.h".
15644 (class Archive): Update declarations.
15645 (Archive::file): New const method.
15646 (class Add_archive_symbols): Add mapfile_ field. Update
15647 constructor. Change all callers.
15648 * readsyms.h (class Read_symbols): Likewise.
15649 (class Finish_group): Likewise.
15650 (class Read_script): Likewise.
15651 * common.cc: Include "mapfile.h".
15652 (Symbol_table::allocate_commons): Add mapfile parameter. Change
15653 all callers.
15654 (Symbol_table::do_allocate_commons): Likewise.
15655 (Symbol_table::do_allocate_commons_list): Likewise. Report common
15656 symbol allocation to mapfile.
15657 * common.h (class Allocate_commons_task): Add mapfile_ field.
15658 Update constructor. Change all callers.
15659 * symtab.h (class Symbol_table): Update declarations.
15660 * layout.cc: Include "mapfile.h".
15661 (Layout_task_runner::run): Print information to mapfile.
15662 (Layout::create_gold_note): Change Output_data_fixed_space to
15663 Output_data_zero_fill.
15664 (Layout::create_build_id): Likewise.
15665 (Layout::print_to_mapfile): New function.
15666 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
15667 constructor. Change caller.
15668 (class Layout): Declare print_to_mapfile.
15669 * output.cc (Output_section::Input_section::print_to_mapfile): New
15670 function.
15671 (Output_section::add_input_section): If producing a map, always
15672 add to input_sections_ list.
15673 (Output_section::do_print_to_mapfile): New function.
15674 (Output_segment::print_sections_to_mapfile): New function.
15675 (Output_segment::print_section_list_to_mapfile): New function.
15676 * output.h: Include "mapfile.h".
15677 (Output_data::print_to_mapfile): New function.
15678 (Output_data::do_print_to_mapfile): New virtual function.
15679 (Output_segment_headers::do_print_to_mapfile): New function.
15680 (Output_file_header::do_print_to_mapfile): New function.
15681 (Output_data_const::do_print_to_mapfile): New function.
15682 (class Output_data_const_buffer): Add map_name_ field. Update
15683 constructor. Change all callers. Add do_print_to_mapfile
15684 function.
15685 (class Output_data_fixed_space): Likewise.
15686 (class Output_data_space): Likewise.
15687 (class Output_data_zero_fill): New class.
15688 (Output_data_strtab::do_print_to_mapfile): New function.
15689 (Output_data_reloc_base::do_print_to_mapfile): New function.
15690 (Output_relocatable_relocs::do_print_to_mapfile): New function.
15691 (Output_data_group::do_print_to_mapfile): New function.
15692 (Output_data_got::do_print_to_mapfile): New function.
15693 (Output_data_dynamic::do_print_to_mapfile): New function.
15694 (Output_symtab_xindex::do_print_to_mapfile): New function.
15695 (class Output_section): Declare do_print_to_mapflie. Declare
15696 print_to_mapfile in Input_section.
15697 (class Output_segment): Declare new functions.
15698 * object.h (Sized_relobj::symbol_count): New function.
15699 * script-sections.cc
15700 (Output_section_element_dot_assignment::set_section_addresses):
15701 Change Output_data_fixed_space to Output_data_zero_fill.
15702 (Output_data_expression::do_print_to_mapfile): New function.
15703 * script.cc (read_input_script): Add mapfile parameter. Change
15704 all callers.
15705 * script.h (read_input_script): Update declaration.
15706 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
15707 (Eh_frame::do_print_to_mapfile): New function.
15708 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
15709 (Output_merge_string::do_print_to_mapfile): New function.
15710 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
15711 function.
15712 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
15713 function.
15714 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
15715 function.
15716 * Makefile.am (CCFILES): Add mapfile.cc.
15717 (HFILES): Add mapfile.h.
15718 * Makefile.in: Rebuild.
15719
9f1d377b
ILT
157202008-05-19 Ian Lance Taylor <iant@google.com>
15721
15722 * options.h (class General_options): Add -z relro.
15723 * layout.cc (Layout::Layout): Initialize relro_segment_.
15724 (Layout::add_output_section_data): Return the output section.
15725 (Layout::make_output_section): Rcognize relro sections and mark
15726 them appropriately.
15727 (Layout::attach_allocated_section_to_segment): Put relro sections
15728 in a PT_GNU_RELRO segment.
15729 (Layout::create_initial_dynamic_sections): Mark the .dynamic
15730 section as relro.
15731 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
15732 PT_TLS segments.
15733 (Layout::linkonce_mapping): Map d.rel.ro.local to
15734 .data.rel.ro.local.
15735 (Layout::output_section_name): Us .data.rel.ro.local for any
15736 section which begins with that.
15737 * layout.h (class Layout): Update add_output_section_data
15738 declaration. Add relro_segment_ field.
15739 * output.cc (Output_section::Output_section): Initialize is_relro_
15740 and is_relro_local_ fields.
15741 (Output_segment::add_output_section): Group relro sections.
15742 (Output_segment::is_first_section_relro): New function.
15743 (Output_segment::maximum_alignment): If there is a relro section,
15744 align the segment to the common page size.
15745 (Output_segment::set_section_addresses): Track whether we are
15746 looking at relro sections. If the last section is a relro
15747 section, align to the common page size.
15748 (Output_segment::set_section_list_addresses): Add in_relro
15749 parameter. Change all callers. Align to the page size when
15750 moving from relro to non-relro section.
15751 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
15752 segment.
15753 * output.h (class Output_section): Add is_relro_ and
15754 is_relro_local_ fields.
15755 (Output_section::is_relro): New function.
15756 (Output_section::set_is_relro): New function.
15757 (Output_section::is_relro_local): New function.
15758 (Output_section::set_is_relro_local): New function.
15759 (class Output_segment): Update declarations.
15760 * i386.cc (Target_i386::got_section): Mark .got section as relro.
15761 * sparc.cc (Target_sparc::got_section): Likewise.
15762 * x86_64.cc (Target_x86_64::got_section): Likewise.
15763 * testsuite/relro_test_main.cc: New file.
15764 * testsuite/relro_test.cc: New file.
15765 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
15766 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
15767 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
15768 (relro_test.so, relro_test_pic.o): New targets.
15769 * testsuite/Makefile.in: Rebuild.
15770
a984ee1d
ILT
157712008-05-16 Ian Lance Taylor <iant@google.com>
15772
01676dcd
ILT
15773 * output.cc (Output_segment::add_output_section): Remove front
15774 parameter.
15775 * output.h (class Output_segment): Remove
15776 add_initial_output_section and overloaded add_output_section.
15777 Update declaration of remaining add_output_section.
15778 * layout.cc (Layout::create_interp): Call add_output_section
15779 rather than add_initial_output_section.
15780 (Layout::finish_dynamic_section): Likewise.
15781
497897f9
ILT
15782 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
15783 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
15784 know the dynamic type.
15785 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
15786 field. Initialize it in constructor.
15787 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
15788 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
15789 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
15790 reloc.
15791
a984ee1d
ILT
15792 * output.cc (Output_reloc::get_address): Change return type to
15793 Elf_Addr.
15794 * output.h (class Output_reloc): Update get_address declaration.
15795 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
15796 for section addresses.
15797
55ba0940
ILT
157982008-05-09 Ian Lance Taylor <iant@google.com>
15799
15800 PR 6493
15801 * gold.cc (gold_nomem): Use return value of write.
15802
75517b77
ILT
158032008-05-08 Ian Lance Taylor <iant@google.com>
15804
15805 * symtab.c (Symbol::init_base_output_data): Add version
15806 parameter. Change all callers.
15807 (Symbol::init_base_output_segment): Likewise.
15808 (Symbol::init_base_constant): Likewise.
15809 (Symbol::init_base_undefined): Likewise.
15810 (Sized_symbol::init_output_data): Likewise.
15811 (Sized_symbol::init_output_segment): Likewise.
15812 (Sized_symbol::init_constant): Likewise.
15813 (Sized_symbol::init_undefined): Likewise.
15814 (Symbol_table::do_define_in_output_data): If the new symbol has a
15815 version, mark it as the default.
15816 (Symbol_table::do_define_in_output_segment): Likewise.
15817 (Symbol_table::do_define_as_constant): Likewise.
15818 * symtab.h (class Symbol): Update declarations.
15819 (class Sized_symbol): Likewise.
15820 * resolve.cc (Symbol::override_version): New function.
c42e122e 15821 (Symbol::override_base): Call override_version.
75517b77
ILT
15822 (Symbol::override_base_with_special): Likewise.
15823 * testsuite/ver_script_8.script: New file.
15824 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
15825 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
15826 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
15827 (ver_test_8_1.so, ver_test_8_2.so): New targets.
15828
f1f70eae
ILT
158292008-05-06 Ian Lance Taylor <iant@google.com>
15830
f3e9c5c5
ILT
15831 PR 6049
15832 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
15833 functions.
15834 (class General_options): Remove existing --undefined, and add
15835 --no-undefined instead. Add new --undefined as synonym for -u.
15836 * archive.cc (Archive::add_symbols): Check whether symbol was
15837 named with -u.
15838 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
15839 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
15840 all uses. Add IS_UNDEFINED. Update declarations to split
15841 different versions of init_base. Declare init_base_undefined.
15842 (Symbol::is_defined): Handle IS_UNDEFINED.
15843 (Symbol::is_undefined): Likewise.
15844 (Symbol::is_weak_undefined): Call is_undefined.
15845 (Symbol::is_absolute): Handle IS_CONSTANT.
15846 (class Sized_symbol): Update declarations to split different
15847 versions of init. Declare init_undefined.
15848 (class Symbol_table): Declare new functions.
15849 * symtab.cc (Symbol::init_base_object): Rename from init_base.
15850 Change all callers.
15851 (Symbol::init_base_output_data): Likewise.
15852 (Symbol::init_base_output_segment): Likewise.
15853 (Symbol::init_base_constant): Likewise.
15854 (Symbol::init_base_undefined): New function.
15855 (Sized_symbol::init_object): Rename from init. Change all
15856 callers.
15857 (Sized_symbol::init_output_data): Likewise.
15858 (Sized_symbol::init_output_segment): Likewise.
15859 (Sized_symbol::init_constant): Likewise.
15860 (Sized_symbol::init_undefined): New function.
15861 (Symbol_table::add_undefined_symbols_from_command_line): New
15862 function.
15863 (Symbol_table::do_add_undefined_symbols_from_command_line): New
15864 function.
15865 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
15866 (Symbol::output_section): Likewise.
15867 (Symbol::set_output_section): Likewise.
15868 (Symbol_table::sized_finalize_symbol): Likewise.
15869 (Symbol_table::sized_write_globals): Likewise.
15870 * resolve.cc (Symbol_table::should_override): Likewise.
15871 (Symbol::override_base_with_special): Likewise.
15872
8bdcdf2c
ILT
15873 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
15874 symbol, change it to have default visibility.
15875 * testsuite/protected_1.cc: New file.
15876 * testsuite/protected_2.cc: New file.
15877 * testsuite/protected_3.cc: New file.
15878 * testsuite/protected_main_1.cc: New file.
15879 * testsuite/protected_main_2.cc: New file.
15880 * testsuite/protected_main_3.cc: New file.
15881 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
15882 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
15883 (protected_1_LDFLAGS, protected_1_LDADD): Define.
15884 (protected_1.so): New target.
15885 (protected_1_pic.o, protected_2_pic.o): New targets.
15886 (protected_3_pic.o): New target.
15887 (check_PROGRAMS): Add protected_2.
15888 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
15889 (protected_2_LDFLAGS, protected_2_LDADD): Define.
15890 * testsuite/Makefile.in: Rebuild.
15891
2b706932
ILT
15892 * options.h (DEFINE_var): Add set_user_set_##varname__.
15893 (DEFINE_bool_alias): New macro.
15894 (class General_options): Define -Bstatic using DEFINE_bool_alias
15895 rather than DEFINE_special. Add --undefined as an alias for -z
15896 defs.
15897 * options.cc (General_options::parse_Bstatic): Remove.
15898
d82a5bcc
ILT
15899 * options.h (class General_options): Add --fatal-warnings.
15900 * main.cc (main): Implement --fatal-warnings.
15901 * errors.h (Errors::warning_count): New function.
15902
f1f70eae
ILT
15903 * options.h (class General_options): Add -Bsymbolic-functions.
15904 * symtab.h (Symbol::is_preemptible): Check for
15905 -Bsymbolic-functions.
15906
8825ac63
ILT
159072008-05-05 Ian Lance Taylor <iant@google.com>
15908
d98bc257
ILT
15909 * options.h (DEFINE_bool): For DASH_Z, create the negative option
15910 as noVARNAME rather than no-VARNAME.
15911 (class General_options): Add option -z combreloc.
15912 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
15913 get_address.
15914 (Output_reloc::sort_before) [SHT_REL]: New function.
15915 (Output_reloc::sort_before) [SHT_RELA]: New function.
15916 (class Output_data_reloc_base): Add sort_relocs_ field. Define
15917 Sort_relocs_comparison.
15918 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
15919 parameter. Change all callers.
15920 (Output_data_reloc::Output_data_reloc) [both versions]: Add
15921 sort_relocs parameter. Change all callers.
15922 * output.cc (Output_reloc::get_address): New function, broken out
15923 of write_rel.
15924 (Output_reloc::write_rel): Call it.
15925 (Output_reloc::compare): New function.
15926 (Output_data_reloc_base::do_write): Optionally sort relocs.
15927
60b2b4e7
ILT
15928 * configure.ac: If targ_extra_obj is set, link it in.
15929 * configure.tgt: Initialize all variables.
15930 (x86_64*): Set targ_extra_obj and targ_extra_size.
15931 * configure: Rebuild.
15932
8825ac63
ILT
15933 * object.cc (Sized_relobj::include_section_group): Adjust section
15934 indexes read from group data. Build vector to pass to
15935 layout_group.
15936 * layout.cc (Layout::layout_group): Add flags and shndxes
15937 parameters. Remove contents parameter. Change caller. Update
15938 explicit instantiations.
15939 * layout.h (class Layout): Update layout_group declaration.
15940 * output.cc (Output_data_group::Output_data_group): Add flags and
15941 input_shndxes parameters. Remove contents parameter. Change
15942 caller.
15943 (Output_data_group::do_write): Change input_sections_ to
15944 input_shndxes_.
15945 * output.h (class Output_data_group): Update constructor
15946 declaration. Rename input_sections_ to input_shndxes_.
15947 * testsuite/many_sections_test.cc: Add template.
15948
e94cf127
CC
159492008-04-30 Cary Coutant <ccoutant@google.com>
15950
4418b2d5
CC
15951 * target-reloc.h (relocate_section): Fix dead-pointer bug.
15952
e94cf127
CC
15953 * layout.cc (Layout::include_section): Refactored check for debug
15954 info section.
15955 (Layout::add_comdat): Add new parameters. Change type
15956 of signature parameter. Add object and shndx to signatures table.
15957 (Layout::find_kept_object): New function.
15958 * layout.h: Include <cstring>.
15959 (Layout::is_debug_info_section): New function.
15960 (Layout::add_comdat): Add new parameters.
15961 (Layout::find_kept_object): New function.
15962 (Layout::Kept_section): New struct.
15963 (Layout::Signatures): Change type of map range.
15964 * object.cc (Relobj::output_section_address): New function.
15965 (Sized_relobj::include_section_group): Add new parameters. Change
15966 calls to Layout::add_comdat. Change to build table of kept comdat
15967 groups and table mapping discarded sections to kept sections.
15968 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
15969 (Sized_relobj::do_layout): Change calls to include_section_group and
15970 include_linkonce_section.
15971 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
15972 value to zero when section is discarded.
15973 (Sized_relobj::map_to_kept_section): New function.
15974 * object.h (Relobj::output_section_address): New function.
15975 (Relobj::Comdat_group): New type.
15976 (Relobj::find_comdat_group): New function.
15977 (Relobj::Comdat_group_table): New type.
15978 (Relobj::Kept_comdat_section): New type.
15979 (Relobj::Kept_comdat_section_table): New type.
15980 (Relobj::add_comdat_group): New function.
15981 (Relobj::set_kept_comdat_section): New function.
15982 (Relobj::get_kept_comdat_section): New function.
15983 (Relobj::comdat_groups_): New field.
15984 (Relobj::kept_comdat_sections_): New field.
15985 (Symbol_value::input_value): Update comment.
15986 (Sized_relobj::map_to_kept_section) New function.
15987 (Sized_relobj::include_linkonce_section): Add new parameter.
15988 * target-reloc.h (Comdat_behavior): New type.
15989 (get_comdat_behavior): New function.
15990 (relocate_section): Add code to map a discarded section to the
15991 corresponding kept section when applying a relocation.
15992
e4e5049b
CS
159932008-04-30 Craig Silverstein <csilvers@google.com>
15994
15995 * dwarf_reader.cc (next_generation_count): New static var.
15996 (Addr2line_cache_entry): New struct.
15997 (addr2line_cache): New static var.
15998 (Dwarf_line_info::one_addr2line): Added caching.
15999 (Dwarf_line_info::clear_addr2line_cache): New function.
16000 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
16001 cache-size parameter.
16002 (Dwarf_line_info::one_addr2line_cache): New function.
16003 * symtab.cc (Symbol_table::detect_odr_violations): Pass
16004 new cache-size argument to one_addr2line(), and clear cache.
16005
d09e9154
CC
160062008-04-28 Cary Coutant <ccoutant@google.com>
16007
16008 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
16009 R_386_PC8 relocations.
16010
7ef73768
ILT
160112008-04-23 Ian Lance Taylor <iant@google.com>
16012
55438702
ILT
16013 * object.cc (Sized_relobj::include_section_group): Check for
16014 invalid section group.
16015
c165fb93
ILT
16016 * object.cc (make_elf_object): Correct test for 64-bit ELF file
16017 header size.
16018
7ef73768
ILT
16019 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
16020 than read for file header.
16021 * archive.cc (Archive::include_member): Likewise.
16022
6194aaab
L
160232008-04-23 Paolo Bonzini <bonzini@gnu.org>
16024
16025 * aclocal.m4: Regenerate.
16026 * configure: Regenerate.
16027
d491d34e
ILT
160282008-04-19 Ian Lance Taylor <iant@google.com>
16029
5ea2bac6
ILT
16030 * version.cc (version_string): Bump to 1.6.
16031
7bc3e21a
ILT
16032 * testsuite/Makefile.am (many_sections_r_test): New target.
16033 (many_sections_r_test_SOURCES): Remove.
16034 (many_sections_r_test_DEPENDENCIES): Remove.
16035 (many_sections_r_test_LDFLAGS): Remove.
16036 (many_sections_r_test_LDADD): Remove.
16037
7fcd3aa9
ILT
16038 * object.cc (Sized_relobj::do_add_symbols): Always pass
16039 local_symbol_count_ to add_from_relobj.
16040
4c94d6ae
ILT
16041 * testsuite/Makefile.am (many_sections_check.h): Only check one in
16042 every thousand variables.
16043 * testsuite/Makefile.in: Rebuild.
16044
d491d34e
ILT
16045 * object.cc (Xindex::initialize_symtab_xindex): New function.
16046 (Xindex::read_symtab_xindex): New function.
16047 (Xindex::sym_xindex_to_shndx): New function.
16048 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
16049 available.
16050 (Sized_relobj::do_initialize_xindex): New function.
16051 (Sized_relobj::do_read_symbols): Adjust section links.
16052 (Sized_relobj::symbol_section_and_value): Add is_ordinary
16053 parameter. Change all callers.
16054 (Sized_relobj::include_section_group): Adjust section links and
16055 symbol section indexes.
16056 (Sized_relobj::do_layout): Adjust section links.
16057 (Sized_relobj::do_count_local_symbols): Adjust section links and
16058 symbol section indexes.
16059 (Sized_relobj::do_finalize_local_symbols): Distinguish between
16060 ordinary and special symbols.
16061 (Sized_relobj::write_local_symbols): Add symtab_xindex and
16062 dynsym_xindex parameters. Change all callers. Adjust section
16063 links. Use SHN_XINDEX when needed.
16064 (Sized_relobj::get_symbol_location_info): Adjust section links.
16065 Don't get fooled by special symbols.
16066 * object.h (class Xindex): Define.
16067 (class Object): Add xindex_ parameter. Declare virtual functoin
16068 do_initialize_xindex.
16069 (Object::adjust_sym_shndx): New function.
16070 (Object::set_xindex): New protected function.
16071 (class Symbol_value): Add is_ordinary_shndx_ field.
16072 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
16073 (Symbol_value::value): Assert ordinary section.
16074 (Symbol_value::initialize_input_to_output_map): Likewise.
16075 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
16076 Change all callers.
16077 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
16078 all callers.
16079 (class Sized_relobj): Update declarations.
16080 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
16081 parameter. Change all callers.
16082 (Sized_relobj::adjust_shndx): New function.
16083 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
16084 field.
16085 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
16086 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
16087 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
16088 (Sized_dynobj::read_dynsym_section): Adjust section links.
16089 (Sized_dynobj::read_dynamic): Likewise.
16090 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
16091 section links.
16092 (Sized_dynobj::do_initialize_xindex): New function.
16093 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
16094 do_initialize_xindex.
16095 (Sized_dynobj::adjust_shndx): New function.
16096 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
16097 dynsym_xindex_ fields.
16098 (Layout::finalize): Add a call to set_section_indexes before
16099 creating the symtab sections.
16100 (Layout::set_section_indexes): Don't do anything if the section
16101 already has a section index.
16102 (Layout::create_symtab_sections): Add shnum parameter. Change
16103 caller. Create .symtab_shndx section if needed.
16104 (Layout::create_shdrs): Add shstrtab_section parameter. Change
16105 caller.
16106 (Layout::allocated_output_section_count): New function.
16107 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
16108 needed.
16109 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
16110 fields. Update declarations.
16111 (Layout::symtab_xindex): New function.
16112 (Layout::dynsym_xindex): New function.
16113 (class Write_symbols_task): Add layout_ field.
16114 (Write_symbols_task::Write_symbols_task): Add layout parameter.
16115 Change caller.
16116 * output.cc (Output_section_headers::Output_section_headers): Add
16117 shstrtab_section parameter. Change all callers.
16118 (Output_section_headers::do_sized_write): Store overflow values
16119 for section count and section string table section index in
16120 section header zero.
16121 (Output_file_header::do_sized_write): Check for overflow of
16122 section count and section string table section index.
16123 (Output_symtab_xindex::do_write): New function.
16124 (Output_symtab_xindex::endian_do_write): New function.
16125 * output.h (class Output_section_headers): Add shstrtab_section_.
16126 Update declarations.
16127 (class Output_symtab_xindex): Define.
16128 (Output_section::has_out_shndx): New function.
16129 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
16130 field.
16131 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
16132 Change all callers.
16133 (Sized_symbol::init): Likewise.
16134 (Symbol::output_section): Check for ordinary symbol.
16135 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
16136 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
16137 callers.
16138 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
16139 Change all callers. Simplify handling of symbols from sections
16140 not included in the link.
16141 (Symbol_table::add_from_dynobj): Handle ordinary symbol
16142 distinction.
16143 (Weak_alias_sorter::operator()): Assert that symbols are
16144 ordinary.
16145 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
16146 distinction.
16147 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
16148 parameters. Change all callers.
16149 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
16150 symbol distinction. Use SHN_XINDEX when needed.
16151 (Symbol_table::write_section_symbol): Add symtab_xindex
16152 parameter. Change all callers.
16153 (Symbol_table::sized_write_section_symbol): Likewise. Use
16154 SHN_XINDEX when needed.
16155 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
16156 declarations.
16157 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
16158 (Symbol::is_defined): Check is_ordinary.
16159 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
16160 (Symbol::is_absolute, Symbol::is_common): Likewise.
16161 (class Sized_symbol): Update declarations.
16162 (class Symbol_table): Update declarations.
16163 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
16164 parameters. Change all callers.
16165 (Sized_symbol::override): Likewise.
16166 (Symbol_table::override): Likewise.
16167 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
16168 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
16169 is_ordinary, and orig_st_shndx parameters. Change all callers.
16170 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
16171 to be in an ordinary section.
16172 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
16173 object and is_ordinary parameters. Change all callers.
16174 (Sized_dwarf_line_info::read_relocs): Add object parameter.
16175 Change all callers. Don't add undefined or non-ordinary symbols
16176 to reloc_map_.
16177 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
16178 Change all callers.
16179 * dwarf_reader.h (class Sized_dwarf_line_info): Update
16180 declarations.
16181 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
16182 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
16183 (Sized_relobj::relocate_sections): Likewise.
16184 * target-reloc.h (scan_relocs): Adjust section symbol index.
16185 (scan_relocatable_relocs): Likewise.
16186 * i386.cc (Scan::local): Check for ordinary symbols.
16187 * sparc.cc (Scan::local): Likewise.
16188 * x86_64.cc (Scan::local): Likewise.
16189 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
16190 to symbol_section_and_value.
16191 * testsuite/many_sections_test.cc: New file.
16192 * testsuite/Makefile.am (BUILT_SOURCES): Define.
16193 (check_PROGRAMS): Add many_sections_test.
16194 (many_sections_test_SOURCES): Define.
16195 (many_sections_test_DEPENDENCIES): Define.
16196 (many_sections_test_LDFLAGS): Define.
16197 (BUILT_SOURCES): Add many_sections_define.h.
16198 (many_sections_define.h): New target.
16199 (BUILT_SOURCES): Add many_sections_check.h.
16200 (many_sections_check.h): New target.
16201 (check_PROGRAMS): Add many_sections_r_test.
16202 (many_sections_r_test_SOURCES): Define.
16203 (many_sections_r_test_DEPENDENCIES): Define.
16204 (many_sections_r_test_LDFLAGS): Define.
16205 (many_sections_r_test_LDADD): Define.
16206 (many_sections_r_test.o): New target.
16207 * testsuite/Makefile.in: Rebuild.
16208
c5818ff1
CC
162092008-04-17 Cary Coutant <ccoutant@google.com>
16210
16211 * errors.cc (Errors::info): New function.
16212 (gold_info): New function.
16213 * errors.h (Errors::info): New function.
16214 * gold.h (gold_info): New function.
16215 * object.cc (Input_objects::add_object): Print trace output.
16216 * options.cc (options::parse_set): New function.
16217 (General_options::parse_wrap): Deleted.
16218 (General_options::General_options): Deleted initializer.
16219 * options.h (options::String_set): New typedef.
16220 (options::parse_set): New function.
16221 (DEFINE_set): New macro.
16222 (General_options::wrap): Changed to use DEFINE_set. Changed
16223 callers of any_wrap_symbols and is_wrap_symbol.
16224 (General_options::trace, General_options::trace_symbol):
16225 New options.
16226 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
16227 (General_options::wrap_symbols_): Deleted.
16228 * symtab.cc (Symbol_table::add_from_object): Print trace output.
16229
b5be4a7c
DM
162302008-04-17 David S. Miller <davem@davemloft.net>
16231
16232 * options.cc (General_options::parse_V): New function.
16233 * options.h: Add entries for -V and -Qy.
16234
155a0dd7
ILT
162352008-04-17 Ian Lance Taylor <iant@google.com>
16236
16237 * common.cc (Symbol_table::allocate_commons): Remove options
16238 parameter. Change caller.
16239 (Symbol_table::do_allocate_commons): Remove options parameter.
16240 Change caller. Just call do_allocate_commons_list twice.
16241 (Symbol_table::do_allocate_commons_list): New function, broken out
16242 of do_allocate_commons.
16243 * common.h (class Allocate_commons_task): Remove options_ field.
16244 Update constructor.
16245 * symtab.cc (Symbol_table::Symbol_table): Initialize
16246 tls_commons_.
16247 (Symbol_table::add_from_object): Put TLS common symbols on
16248 tls_commons_ list.
16249 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
16250 which are IN_OUTPUT_DATA.
16251 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
16252 allocate_commons and do_allocate_commons declarations. Declare
16253 do_allocate_commons_list.
16254 * gold.cc (queue_middle_tasks): Update creation of
16255 Allocate_commons_task to not pass options.
16256 * testsuite/Makefile.am (INCLUDES): Add -I.. .
16257 (TLS_TEST_C_FLAGS): New variable.
16258 (tls_test_c_pic.o): New target.
16259 (tls_test_shared.so): Link in tls_test_c_pic.o.
16260 (tls_test_c_pic_ie.o): New target.
16261 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
16262 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
16263 (tls_test_c.o): New target.
16264 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
16265 (tls_pic_test_LDADD): Likewise.
16266 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
16267 (tls_shared_gd_to_ie_test_LDADD): Likewise.
16268 (tls_test_c_gnu2.o): New target.
16269 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
16270 tls_test_c_gnu2.o.
16271 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
16272 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
16273 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
16274 * testsuite/tls_test.cc: Include "config.h".
16275 (t_last): Call t11_last.
16276 * testsuite/tls_test.h (t11, t11_last): Declare.
16277 * testsuite/tls_test_c.c: New file.
16278 * testsuite/tls_test_main.cc (thread_routine): Call t11.
16279 * configure.ac: Check for OpenMP support.
16280 * configure, config.in, Makefile.in: Rebuild.
16281 * testsuite/Makefile.in: Rebuild.
16282
edfbb029
CC
162832008-04-16 Cary Coutant <ccoutant@google.com>
16284
16285 * i386.cc (Target_i386::define_tls_base_symbol): New function.
16286 (Target_i386::tls_base_symbol_defined_): New field.
16287 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16288 (Target_i386::Scan::global): Likewise.
16289 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
16290 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
16291 (Target_x86_64::tls_base_symbol_defined_): New field.
16292 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16293 (Target_x86_64::Scan::global): Likewise.
16294
f3c69fca
CC
162952008-04-16 Cary Coutant <ccoutant@google.com>
16296
16297 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
16298 (Symbol::needs_plt_entry): Allow weak undefined symbols.
16299 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
16300 building shared libraries.
16301 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
16302 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
16303 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
16304 * testsuite/Makefile.in: Rebuild.
16305 * testsuite/weak_undef.h: New file.
16306 * testsuite/weak_undef_file1.cc: Add extra test cases.
16307 * testsuite/weak_undef_file2.cc: Likewise.
16308 * testsuite/weak_undef_test.cc: Likewise.
16309
7c414435
DM
163102008-04-16 David S. Miller <davem@davemloft.net>
16311
32b769e1
DM
16312 * sparc.cc (Target_sparc::Scan): Change from struct to class.
16313 Add issued_non_pic_error_ field. Declare check_non_pic.
16314 (Target_sparc::Scan::check_non_pic): New function.
16315 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
16316 (Target_sparc::Scan::global): Likewise.
16317
11936fb1
DM
16318 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
16319 * configure: Rebuild.
16320
7c414435
DM
16321 * options.h (DEFINE_enable): New macro.
16322 (new_dtags): New enable option.
16323 (initfirst, interpose, loadfltr, nodefaultlib,
16324 nodelete, nodlopen, nodump): New -z options.
16325 * layout.cc (Layout:finish_dynamic_section): If new
16326 dtags enabled, emit DT_RUNPATH. Also, emit a
16327 DT_FLAGS_1 containing any specified -z flags.
16328
85c7bf8b
ILT
163292008-04-16 Ian Lance Taylor <iant@google.com>
16330
12c0daef
ILT
16331 * copy-relocs.cc: New file.
16332 * copy-relocs.h: New file.
16333 * reloc.cc: Remove Copy_relocs code.
16334 * reloc.h: Likewise.
16335 * reloc-types.h (struct Reloc_types) [both versions]: Add
16336 get_reloc_addend_noerror.
16337 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
16338 variants of add_global which take an addend which must be zero.
16339 * i386.cc: Include "copy-relocs.h".
16340 (class Target_i386): Change type of copy_relocs_ to variable,
16341 update initializer.
16342 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
16343 Change all callers.
16344 (Target_i386::do_finalize_sections): Change handling of
16345 copy_relocs_.
16346 * sparc.cc: Include "copy-relocs.h".
16347 (class Target_sparc): Change type of copy_relocs_ to variable,
16348 update initializer.
16349 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
16350 Change all callers.
16351 (Target_sparc::do_finalize_sections): Change handling of
16352 copy_relocs_.
16353 * x86_64.cc: Include "copy-relocs.h".
16354 (class Target_x86_64): Change type of copy_relocs_ to variable,
16355 update initializer.
16356 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
16357 class. Change all callers.
16358 (Target_x86_64::do_finalize_sections): Change handling of
16359 copy_relocs_.
16360 * Makefile.am (CCFILES): Add copy-relocs.cc.
16361 (HFILES): Add copy-relocs.h.
16362
4f4995b6
ILT
16363 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
16364
85c7bf8b
ILT
16365 * testsuite/script_test_4.sh: Permit leading zeroes.
16366
4f2a9edd
ILT
163672008-04-15 Ian Lance Taylor <iant@google.com>
16368
e6188289
ILT
16369 * script-sections.cc (Script_sections::create_segments): Use
16370 header_size_adjustment even when there is enough room for the
16371 headers.
16372 * testsuite/script_test_4.sh: New file.
16373 * testsuite/script_test_4.t: New file.
16374 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
16375 (check_DATA): Add script_test_4.stdout.
16376 (MOSTLYCLEANFILES): Likewise.
16377 (script_test_4): New target.
16378 (script_test_4.stdout): New target.
16379 * testsuite/Makefile.in: Rebuild.
16380
4f2a9edd
ILT
16381 * sparc.cc: Add definitions for Output_data_plt_sparc class
16382 constants.
16383
f5314dd5
DM
163842008-04-14 David S. Miller <davem@davemloft.net>
16385
16386 * sparc.cc: New file.
16387 * Makefile.am (TARGETSOURCES): Add sparc.cc
16388 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
16389 * configure.tgt: Document targ_extra_size and
16390 targ_extra_big_endian. Add entries for sparc-* and
16391 sparc64-*.
16392 * configure.ac: Handle targ_extra_size and
16393 targ_extra_big_endian.
16394 * Makefile.in: Rebuild.
16395 * configure: Likewise.
16396 * po/POTFILES.in: Likewise.
16397 * po/gold.pot: Likewise.
16398
154e0e9a
ILT
163992008-04-14 Ian Lance Taylor <iant@google.com>
16400
16401 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
16402 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
16403 in the name/type/flags to section mapping. Don't call
16404 allocate_output_section.
16405 (Layout::choose_output_section): Change parameter from adjust_name
16406 to is_input_section. Don't permit input sections after sections
16407 are attached to segments. Don't call allocate_output_section.
16408 (Layout::layout_eh_frame): Call update_flags_for_input_section,
16409 not write_enable_output_section.
16410 (Layout::make_output_section): Don't push to
16411 unattached_section_list_ nor call attach_to_segment. Call
16412 attach_section_to_segment if sections are attached.
16413 (Layout::attach_sections_to_segments): New function.
16414 (Layout::attach_section_to_segment): New function.
16415 (Layout::attach_allocated_section_to_segment): Rename from
16416 attach_to_segment. Remove flags parameter.
16417 (Layout::allocate_output_section): Remove function.
16418 (Layout::write_enable_output_section): Remove function.
16419 * layout.h (class Layout): Update for above changes. Add new
16420 field sections_are_attached_.
16421 * output.h (Output_section::update_flags_for_input_section): New
16422 function.
16423 * output.cc (Output_section::add_input_section): Call
16424 update_flags_for_input_section.
16425 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
16426
009a67a2
CC
164272008-04-11 Cary Coutant <ccoutant@google.com>
16428
16429 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
16430 thought unnecessary.
16431 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
16432
759b1a24
ILT
164332008-04-11 Ian Lance Taylor <iant@google.com>
16434
16435 * output.h (class Output_section_data): Remove inline definition
16436 of set_addralign.
16437 * output.cc (Output_section_data::set_addralign): New function.
16438
c2b45e22
CC
164392008-04-11 Cary Coutant <ccoutant@google.com>
16440
16441 Add support for TLS descriptors for i386 and x86_64.
16442 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
16443 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
16444 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
16445 GOT_TYPE_TLS_DESC.
16446 (Target_i386::got_mod_index_entry): Remove unnecessary code.
16447 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
16448 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
16449 relocations.
16450 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
16451 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
16452 Fix problem with initial-exec relocations.
16453 (Target_i386::Relocate::relocate_tls): Likewise.
16454 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
16455 relaxation.
16456 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
16457 support for section-plus-offset dynamic table entries.
16458 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
16459 (Output_data_dynamic::Dynamic_entry): Add support for
16460 section-plus-offset dynamic table entries.
16461 (Output_data_dynamic::Classification): Likewise.
16462 (Output_data_dynamic::classification_): Renamed offset_.
16463 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
16464 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
16465 (Target_x86_64::make_plt_section): New function.
16466 (Target_x86_64::reserve_tlsdesc_entries): New function.
16467 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
16468 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
16469 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
16470 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
16471 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
16472 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
16473 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
16474 add extra PLT entry for TLS descriptors.
16475 (Output_data_plt_x86_64::got_): New field.
16476 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
16477 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
16478 fields.
16479 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
16480 descriptors.
16481 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
16482 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
16483 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
16484 R_386_TLS_DESC_CALL relocations.
16485 (Target_x86_64::Scan::global): Likewise.
16486 (Target_x86_64::do_finalize_sections): Add dynamic table entries
16487 for TLS descriptors.
16488 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
16489 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
16490 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
16491 GD-to-IE relaxation.
16492 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
16493 and TLS_DESCRIPTORS.
16494 * Makefile.in: Rebuild.
16495 * configure: Rebuild.
16496 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
16497 (tls_test_shared2.so): New target.
16498 (tls_shared_gd_to_ie_test_SOURCES): New variable.
16499 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
16500 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
16501 (tls_shared_gd_to_ie_test_LDADD): New variable.
16502 (tls_shared_gnu2_gd_to_ie_test): New target.
16503 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
16504 New targets.
16505 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
16506 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
16507 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
16508 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
16509 (tls_shared_gnu2_test): New target.
16510 (tls_test_gnu2_shared.so): New target.
16511 (tls_shared_gnu2_test_SOURCES): New variable.
16512 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
16513 (tls_shared_gnu2_test_LDFLAGS): New variable.
16514 (tls_shared_gnu2_test_LDADD): New variable.
16515 * testsuite/Makefile.in: Rebuild.
16516 * testsuite/Makefile.
16517
83bfb6b7
ILT
165182008-04-11 Ian Lance Taylor <iant@google.com>
16519
16520 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
16521 justsyms.t.
16522 * testsuite/Makefile.in: Rebuild.
16523
16524 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
16525 long.
16526 * testsuite/script_test_2.cc (main): Adjust test.
16527
706e1f5e
ILT
165282008-04-11 David S. Miller <davem@davemloft.net>
16529 Ian Lance Taylor <iant@google.com>
16530
16531 * options.h (General_options): Add entries for '-Y' and
16532 '-relax'.
16533 * options.cc (General_options:finalize): If -Y was used, add those
16534 entries to the library path instead of the default "/lib" and
16535 "/usr/lib".
16536
7c98e6bb
DM
165372008-04-11 David S. Miller <davem@davemloft.net>
16538
16539 * testsuite/justsyms.t: Start at 0x100.
16540 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
16541 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
16542 long.
16543 * testsuite/script_test_2.cc: Adjust string and section length
16544 checks.
7c98e6bb 16545
99a37bfd
ILT
165462008-04-09 Ian Lance Taylor <iant@google.com>
16547
2cefc357
ILT
16548 PR gold/5996
16549 * script-sections.cc (Sections_element::allocate_to_segment): Add
16550 orphan parameter.
16551 (Output_section_definition::allocate_to_segment): Likewise.
16552 (Orphan_output_section::allocate_to_segment): Likewise.
16553 (Script_sections::attach_sections_using_phdrs_clause): Don't
16554 propagate non-PT_LOAD segments to orphan sections.
16555 * testsuite/Makefile.am (script_test_3.stdout): Generate using
16556 readelf rather than objdump.
16557 * testsuite/script_test_3.sh: Adjust accordingly. Test that
16558 .interp section and PT_INTERP segment are the same size.
16559 * testsuite/Makefile.in: Rebuild.
16560
99a37bfd
ILT
16561 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
16562 aliases for symbols defined in the same object.
16563 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
16564 (weak_alias_test_SOURCES): New variable.
16565 (weak_alias_test_DEPENDENCIES): New variable.
16566 (weak_alias_test_LDFLAGS): New variable.
16567 (weak_alias_test_LDADD): New variable.
16568 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
16569 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
16570 (weak_alias_test_3.o): New target.
16571 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
16572 * testsuite/weak_alias_test_main.cc: New file.
16573 * testsuite/weak_alias_test_1.cc: New file.
16574 * testsuite/weak_alias_test_2.cc: New file.
16575 * testsuite/weak_alias_test_3.cc: New file.
16576
780e49c5
ILT
165772008-04-08 Ian Lance Taylor <iant@google.com>
16578
cdb0b8f5
ILT
16579 * options.h (class General_options): Add --noinhibit-exec option.
16580 * main.cc (main): Check --noinhibit-exec.
16581
0864d551
ILT
16582 * options.h (class General_options): Define --wrap as a special
16583 option. Add wrap_symbols_ field.
16584 (General_options::any_wrap_symbols): New function.
16585 (General_options::is_wrap_symbol): New function.
16586 * options.cc (General_options::parse_wrap): New function.
16587 (General_options::General_options): Initialize wrap_symbols_.
16588 * symtab.cc (Symbol_table::wrap_symbol): New function.
16589 (Symbol_table::add_from_object): Handle --wrap.
16590 * symtab.h (class Symbol_table): Declare wrap_symbol.
16591 * target.h (Target::wrap_char): New function.
16592 (Target::Target_info): Add wrap_char field.
16593 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
16594 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
16595 * testsuite/testfile.cc (Target_test::test_target_info):
16596 Likewise.
16597
789aa6de
ILT
16598 * errors.cc (Errors::undefined_symbol): Mention symbol version if
16599 there is one.
16600
2c38906f
ILT
16601 * layout.h (class Layout): Add added_eh_frame_data_ field.
16602 * layout.cc (Layout::Layout): Initialize new field.
16603 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
16604 output section until we find a section we merged successfully.
16605 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
16606 that the size be non-zero.
16607
780e49c5
ILT
16608 * merge.cc (Object_merge_map::get_output_offset): Remove inline
16609 qualifier.
16610
7fcd0256
ILT
166112008-04-08 Craig Silverstein <csilvers@google.com>
16612
16613 * configure.ac: Export new conditional variable HAVE_ZLIB.
16614 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
16615 on HAVE_ZLIB.
16616 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
16617 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16618
6835af53
ILT
166192008-04-07 Ian Lance Taylor <iant@google.com>
16620
e24f324c
ILT
16621 * version.cc (version_string): Set to "1.5".
16622
a036edd8
ILT
16623 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
16624 Add issued_non_pic_error_ field. Declare check_non_pic.
16625 (Target_x86_64::Scan::check_non_pic): New function.
16626 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
16627 (Target_x86_64::Scan::global): Likewise.
16628
624f8810
ILT
16629 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
16630 addend parameter. Change caller. Handle merge sections.
16631 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
16632 Address to Addend. Don't add in the result of
16633 local_section_offset, pass down the addend and use the returned
16634 value.
16635 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
16636 Update declarations of local_section_offset and symbol_value.
16637 * testsuite/two_file_test_1.cc (t18): New function.
16638 * testsuite/two_file_test_2.cc (f18): New function.
16639 * testsuite/two_file_test_main.cc (main): Call t18.
16640 * testsuite/two_file_test.h (t18, f18): Declare.
16641
6835af53
ILT
16642 * configure.ac: Don't test for objdump, c++filt, or readelf.
16643 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
16644 conditionals.
16645 (TEST_READELF): New variable.
16646 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
16647 (check_PROGRAMS): Add two_file_strip_test.
16648 (two_file_strip_test): New target.
16649 (check_PROGRAMS): Add two_file_same_shared_strip_test.
16650 (two_file_same_shared_strip_test_SOURCES): New variable.
16651 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
16652 (two_file_same_shared_strip_test_LDFLAGS): New variable.
16653 (two_file_same_shared_strip_test_LDADD): New variable.
16654 (two_file_shared_strip.so): New target.
16655 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
16656 (ver_test_5.syms, ver_test_7.syms): Likewise.
16657 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
16658 (strip_test_3.stdout): Use TEST_OBJDUMP.
16659 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16660
86925eef
CC
166612008-04-04 Cary Coutant <ccoutant@google.com>
16662
16663 * symtab.h (Symbol::is_weak_undefined): New function.
16664 (Symbol::is_strong_undefined): New function.
16665 (Symbol::is_absolute): New function.
16666 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
16667 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
16668 absolute symbols.
16669 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
16670 (weak_undef_test): New target.
16671 * testsuite/Makefile.in: Rebuild.
16672 * testsuite/weak_undef_file1.cc: New file.
16673 * testsuite/weak_undef_file2.cc: New file.
16674 * testsuite/weak_undef_test.cc: New file.
16675
126f3ece
ILT
166762008-04-03 Craig Silverstein <csilvers@google.com>
16677
16678 * compressed_output.h (class Output_compressed_section): Use
16679 unsigned buffer.
16680 * compressed_output.cc (zlib_compress): Use unsigned buffers,
16681 add zlib header.
16682 (zlib_compressed_suffix): Removed.
16683 (Output_compressed_section::set_final_data_size): Use unsigned
16684 buffers.
16685 * testsuite/Makefile.am (flagstest_compress_debug_sections):
16686 Fix linker invocation.
16687 (flagstest_o_specialfile_and_compress_debug_sections):
16688 Likewise.
16689 * testsuite/Makefile.in: Regenerated.
16690
deae2a14
DM
166912008-04-02 David S. Miller <davem@davemloft.net>
16692
16693 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
16694 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
16695
70752818
ILT
166962008-04-02 Craig Silverstein <csilvers@google.com>
16697
16698 * TODO: New file.
16699
39d0cb0e
ILT
167002008-04-02 Ian Lance Taylor <iant@google.com>
16701
16702 * fileread.cc (File_read::find_view): Add byteshift and vshifted
16703 parameters. Update for new key type to views_. Change all
16704 callers.
16705 (File_read::read): Adjust for byteshift in returned view.
16706 (File_read::add_view): New function, broken out of
16707 find_and_make_view.
16708 (File_read::make_view): New function, broken out of
16709 find_and_make_view.
16710 (File_read::find_or_make_view): Add offset and aligned
16711 parameters. Rewrite accordingly. Change all callers.
16712 (File_read::get_view): Add offset and aligned parameters. Adjust
16713 for byteshift in return value.
16714 (File_read::get_lasting_view): Likewise.
16715 * fileread.h (class File_read): Update declarations.
16716 (class File_read::View): Add byteshift_ field. Add byteshift to
16717 constructor. Add byteshift method.
16718 * archive.h (Archive::clear_uncached_views): New function.
16719 (Archive::get_view): Add aligned parameter. Change all callers.
16720 * object.h (Object::get_view): Add aligned parameter. Change all
16721 callers.
16722 (Object::get_lasting_view): Likewise.
16723
16724 * fileread.cc (File_read::release): Don't call clear_views if
16725 there are multiple objects.
16726 * fileread.h (File_read::clear_uncached_views): New function.
16727 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
16728 on the archive.
16729
a1207466
CC
167302008-03-31 Cary Coutant <ccoutant@google.com>
16731
16732 Add thin archive support.
16733 * archive.cc (Archive::armagt): New const.
16734 (Archive::setup): Remove task parameter and calls to unlock.
16735 (Archive::unlock_nested_archives): New function.
16736 (Archive::read_header): Add nested_off parameter. Change
16737 all callers.
16738 (Archive::interpret_header): Likewise.
16739 (Archive::include_all_members): Change to handle thin
16740 archives.
16741 (Archive::include_member): Likewise.
16742 * archive.h (Archive::Archive): Add new parameters and
16743 initializers.
16744 (Archive::armagt): New const.
16745 (Archive::setup): Remove task parameter.
16746 (Archive::unlock_nested_archives): New function.
16747 (Archive::read_header): Add nested_off parameter.
16748 (Archive::interpret_header): Likewise.
16749 (Archive::Nested_archive_table): New typedef.
16750 (Archive::is_thin_archive_): New field.
16751 (Archive::nested_archives_): New field.
16752 (Archive::options_): New field.
16753 (Archive::dirpath_): New field.
16754 (Archive::task_): New field.
16755 * readsyms.cc (Read_symbols::do_read_symbols): Add check
16756 for thin archives. Pass additional parameters to
16757 Archive::Archive. Unlock the archive file after calling
16758 Archive::setup.
cd536b21 16759
479f6503
ILT
167602008-03-29 Ian Lance Taylor <iant@google.com>
16761
686c8caf
ILT
16762 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
16763 version symbol to be local.
16764 * testsuite/ver_test_4.sh: New file.
16765 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
16766 (check_DATA): Add ver_test_4.syms.
16767 (ver_test_4.syms): New target.
16768 * testsuite/Makefile.in: Rebuild.
16769
ab794b6b
ILT
16770 * output.cc
16771 (Output_section::Input_section_sort_entry::has_priority): New
16772 function.
16773 (Output_section::Input_section_sort_entry::match_file_name): New
16774 function.
16775 (Output_section::Input_section_sort_entry::match_section_name):
16776 Remove.
16777 (Output_section::Input_section_sort_entry::match_section_name_prefix):
16778 Remove.
16779 (Output_section::Input_section_sort_entry::match_section_file):
16780 Remove.
16781 (Output_section::Input_section_sort_compare::operator()): Rewrite
16782 using new Input_section_sort_entry functions. Sort crtbegin and
16783 crtend first. Sort sections with no priority before sections with
16784 a priority.
16785 * testsuite/initpri1.c (d3): Check j != 4.
16786 (cd5): New constructor/destructor function.
16787 (main): Check j != 2.
16788
479f6503
ILT
16789 * symtab.cc (Symbol_table::add_from_object): If we don't use the
16790 new symbol when resolving, don't call set_is_default.
16791 * testsuite/ver_test_7.cc: New file.
16792 * testsuite/ver_test_7.sh: New file.
16793 * testsuite/Makefile.am (ver_test_7.so): New target.
16794 (ver_test_7.o): New target.
16795 (check_SCRIPTS): Add ver_test_7.sh.
16796 (check_DATA): Add ver_test_7.syms.
16797 (ver_test_7.syms): New target.
16798
2fd32231
ILT
167992008-03-28 Ian Lance Taylor <iant@google.com>
16800
16801 * layout.cc (Layout::layout): If we see an input section with a
16802 name that needs sorting, set the must_sort flag for the output
16803 section.
16804 (Layout::make_output_section): If the name of the output section
16805 indicates that it might require sorting, set the may_sort flag.
16806 * output.h (Output_section::may_sort_attached_input_sections): New
16807 function.
16808 (Output_section::set_may_sort_attached_input_sections): New
16809 function.
16810 (Output_section::must_sort_attached_input_sections): New
16811 function.
16812 (Output_section::set_must_sort_attached_input_sections): New
16813 function.
16814 (class Output_section): Declare Input_section_sort_entry. Define
16815 Input_section_sort_compare. Declare
16816 sort_attached_input_sections. Add new fields:
16817 may_sort_attached_input_sections_,
16818 must_sort_attached_input_sections_,
16819 attached_input_sections_are_sorted_.
16820 * output.cc (Output_section::Output_section): Initialize new
16821 fields.
16822 (Output_section::add_input_section): Add an entry to
16823 input_sections_ if may_sort or must_sort are true.
16824 (Output_section::set_final_data_size): Call
16825 sort_attached_input_sections if necessary.
16826 (Output_section::Input_section_sort_entry): Define new class.
16827 (Output_section::Input_section_sort_compare::operator()): New
16828 function.
16829 (Output_section::sort_attached_input_sections): New function.
16830 * configure.ac: Check whether the compiler supports constructor
16831 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
16832 * testsuite/initpri1.c: New file.
16833 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
16834 CONSTRUCTOR_PRIORITY.
16835 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
16836 (initpri1_LDFLAGS): New variable.
16837 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16838
18e6b24e
ILT
168392008-03-27 Ian Lance Taylor <iant@google.com>
16840
49bdd526
ILT
16841 * common.cc (Sort_commons::operator): Correct sorting algorithm.
16842 * testsuite/common_test_1.c: New file.
16843 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
16844 (common_test_1_SOURCES): New variable.
16845 (common_test_1_DEPENDENCIES): New variable.
16846 (common_test_1_LDFLAGS): New variable.
16847
18e6b24e
ILT
16848 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
16849 and commons_ correctly when NAME/VERSION does not override
16850 NAME/NULL.
16851 * testsuite/ver_test_6.c: New file.
16852 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
16853 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
16854 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
16855
04bf7072
ILT
168562008-03-26 Ian Lance Taylor <iant@google.com>
16857
5871526f
ILT
16858 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
16859 of an undefined symbol from a version script.
16860 * testsuite/Makefile.am (ver_test_5.so): New target.
16861 (ver_test_5.o): New target.
16862 (check_SCRIPTS): Add ver_test_5.sh.
16863 (check_DATA): Add ver_test_5.syms.
16864 (ver_test_5.syms): New target.
16865 * testsuite/ver_test_5.cc: New file.
16866 * testsuite/ver_test_5.script: New file.
16867 * testsuite/ver_test_5.sh: New file.
16868 * Makefile.in, testsuite/Makefile.in: Rebuild.
16869
04bf7072
ILT
16870 PR gold/5986
16871 Fix problems building gold with gcc 4.3.0.
16872 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
16873 (gold_error_at_location, gold_warning_at_location): Use it.
16874 * configure.ac: Check whether we can compile and use a template
16875 function with a printf attribute.
16876 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
16877 when jumping over bytes.
16878 * object.cc: Instantiate Object::read_section_data.
16879 * debug.h: Include <cstring>
16880 * dwarf_reader.cc: Include <algorithm>
16881 * main.cc: Include <cstring>.
16882 * options.cc: Include <cstring>.
16883 * output.cc: Include <cstring>.
16884 * script.cc: Include <cstring>.
16885 * script.h: Include <string>.
16886 * symtab.cc: Include <cstring> and <algorithm>.
16887 * target-select.cc: Include <cstring>.
16888 * version.cc: Include <string>.
16889 * testsuite/testmain.cc: Include <cstdlib>.
16890 * configure, config.in: Rebuild.
16891
874c5b28
ILT
168922008-03-25 Ian Lance Taylor <iant@google.com>
16893
819d6c3a
ILT
16894 * options.cc: Include "../bfd/bfdver.h".
16895 (options::help): Print bug reporting address.
16896
f4b2c6f5
ILT
16897 * version.cc (print_version): Adjust output for current value of
16898 BFD_VERSION_STRING.
16899
16900 * NEWS: New file.
16901
e96caa79
ILT
16902 * options.cc (options::help): Print list of supported targets.
16903 * target-select.h: Include <vector>.
16904 (class Target_selector): Make machine_, size_, and is_big_endian_
16905 fields const. Add bfd_name_ and instantiated_target_ fields.
16906 (Target_selector::Target_selector): Add bfd_name parameter.
16907 (Target_selector::recognize): Make non-virtual, call
16908 do_recognize.
16909 (Target_selector::recognize_by_name): Make non-virtual, call
16910 do_recognize_by_name.
16911 (Target_selector::supported_names): New function.
16912 (Target_selector::bfd_name): New function.
16913 (Target_selector::do_instantiate_target): New pure virtual
16914 function.
16915 (Target_selector::do_recognize): New virtual function.
16916 (Target_selector::do_recognize_by_name): New virtual function.
16917 (Target_selector::instantiate_target): New private function.
16918 (supported_target_names): Declare.
16919 * target-select.cc (Target_selector::Target_selector): Update for
16920 new parameter and fields.
16921 (select_target_by_name): Check that the name matches before
16922 calling recognize_by_name.
16923 (supported_target_names): New function.
16924 * i386.cc (class Target_selector_i386): Update Target_selector
16925 constructor call. Remove recognize and recognize_by_name. Add
16926 do_instantiate_target.
16927 * x86_64.cc (class Target_selector_x86_64): Likewise.
16928 * testsuite/testfile.cc (class Target_selector_test): Update for
16929 changes to Target_selector.
16930
874c5b28
ILT
16931 * README: Rewrite, with some notes on unsupported features.
16932
0a65a3a7
CC
169332008-03-24 Cary Coutant <ccoutant@google.com>
16934
16935 * i386.cc (Target_i386::Got_type): New enum declaration.
16936 (Target_i386::Scan::local): Updated callers of Output_data_got
16937 member functions.
16938 (Target_i386::Scan::global): Likewise.
16939 (Target_i386::Relocate::relocate): Likewise.
16940 (Target_i386::Relocate::relocate_tls): Likewise.
16941 * object.h (Got_offset_list): New class.
16942 (Sized_relobj::local_has_got_offset): Added got_type parameter.
16943 (Sized_relobj::local_got_offset): Likewise.
16944 (Sized_relobj::set_local_got_offset): Likewise.
16945 (Sized_relobj::local_has_tls_got_offset): Removed.
16946 (Sized_relobj::local_tls_got_offset): Removed.
16947 (Sized_relobj::set_local_tls_got_offset): Removed.
16948 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
16949 * output.cc (Output_data_got::add_global): Added got_type parameter.
16950 (Output_data_got::add_global_with_rel): Likewise.
16951 (Output_data_got::add_global_with_rela): Likewise.
16952 (Output_data_got::add_global_pair_with_rel): New function.
16953 (Output_data_got::add_global_pair_with_rela): New function.
16954 (Output_data_got::add_local): Added got_type parameter.
16955 (Output_data_got::add_local_with_rel): Likewise.
16956 (Output_data_got::add_local_with_rela): Likewise.
16957 (Output_data_got::add_local_pair_with_rel): New function.
16958 (Output_data_got::add_local_pair_with_rela): New function.
16959 (Output_data_got::add_global_tls): Removed.
16960 (Output_data_got::add_global_tls_with_rel): Removed.
16961 (Output_data_got::add_global_tls_with_rela): Removed.
16962 (Output_data_got::add_local_tls): Removed.
16963 (Output_data_got::add_local_tls_with_rel): Removed.
16964 (Output_data_got::add_local_tls_with_rela): Removed.
16965 * output.h (Output_data_got::add_global): Added got_type parameter.
16966 (Output_data_got::add_global_with_rel): Likewise.
16967 (Output_data_got::add_global_with_rela): Likewise.
16968 (Output_data_got::add_global_pair_with_rel): New function.
16969 (Output_data_got::add_global_pair_with_rela): New function.
16970 (Output_data_got::add_local): Added got_type parameter.
16971 (Output_data_got::add_local_with_rel): Likewise.
16972 (Output_data_got::add_local_with_rela): Likewise.
16973 (Output_data_got::add_local_pair_with_rel): New function.
16974 (Output_data_got::add_local_pair_with_rela): New function.
16975 (Output_data_got::add_global_tls): Removed.
16976 (Output_data_got::add_global_tls_with_rel): Removed.
16977 (Output_data_got::add_global_tls_with_rela): Removed.
16978 (Output_data_got::add_local_tls): Removed.
16979 (Output_data_got::add_local_tls_with_rel): Removed.
16980 (Output_data_got::add_local_tls_with_rela): Removed.
16981 * resolve.cc (Symbol::override_base_with_special): Removed
16982 reference to has_got_offset_ field.
16983 * symtab.cc (Symbol::init_fields): Replaced initialization
16984 of got_offset_ with got_offsets_. Removed initialization
16985 of has_got_offset_
53fcba31 16986 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
16987 (Symbol::got_offset): Likewise.
16988 (Symbol::set_got_offset): Likewise.
16989 (Symbol::has_tls_got_offset): Removed.
16990 (Symbol::tls_got_offset): Removed.
16991 (Symbol::set_tls_got_offset): Removed.
16992 (Symbol::got_offset_): Removed.
16993 (Symbol::tls_mod_got_offset_): Removed.
16994 (Symbol::tls_pair_got_offset_): Removed.
16995 (Symbol::got_offsets_): New field.
16996 (Symbol::has_got_offset): Removed.
16997 (Symbol::has_tls_mod_got_offset): Removed.
16998 (Symbol::has_tls_pair_got_offset): Removed.
16999 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
17000 (Target_x86_64::Scan::local): Updated callers of Output_data_got
17001 member functions.
17002 (Target_x86_64::Scan::global): Likewise.
17003 (Target_x86_64::Relocate::relocate): Likewise.
17004 (Target_x86_64::Relocate::relocate_tls): Likewise.
17005
bd52eafb
BE
170062008-03-25 Ben Elliston <bje@au.ibm.com>
17007
17008 * yyscript.y: Fix spelling error in comment.
17009
8b105e34
ILT
170102008-03-24 Ian Lance Taylor <iant@google.com>
17011
8ed814a9
ILT
17012 * options.h (class General_options): Define build_id option.
17013 * layout.h (class Layout): Declare write_build_id, create_note,
17014 create_build_id. Add build_id_note_ member.
17015 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
17016 "libiberty.h", "md5.h", "sha1.h".
17017 (Layout::Layout): Initialize eh_frame_data_,
17018 eh_frame_hdr_section_, and build_id_note_.
17019 (Layout::finalize): Call create_build_id.
17020 (Layout::create_note): New function, broken out of
17021 Layout::create_gold_note.
17022 (Layout::create_gold_note): Call create_note.
17023 (Layout::create_build_id): New function.
17024 (Layout::write_build_id): New function.
17025 (Close_task_runner::run): Call write_build_id.
17026
8b105e34
ILT
17027 * x86_64.cc: Correct license to GPLv3.
17028
086a1841
ILT
170292008-03-23 Ian Lance Taylor <iant@google.com>
17030
17031 * options.cc: Include "demangle.h".
17032 (parse_optional_string): New function.
17033 (parse_long_option): Handle takes_optional_argument.
17034 (parse_short_option): Update dash_z initializer. Handle
17035 takes_optional_argument.
17036 (General_options::General_options): Initialize do_demangle_.
17037 (General_options::finalize): Set do_demangle_. Handle demangling
17038 style.
17039 * options.h (parse_optional_string): Declare.
17040 (struct One_option): Add optional_arg field. Update constructor.
17041 Update call constructor calls. Add takes_optional_argument
17042 function.
17043 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
17044 (DEFINE_optional_string): Define.
17045 (General_options::demangle): Change from DEFINE_bool to
17046 DEFINE_optional_string.
17047 (General_options::no_demangle): New function.
17048 (General_options::do_demangle): New function.
17049 (General_options::set_do_demangle): New function.
17050 (General_options::execstack_status_): Move definition to end of
17051 class definition.
17052 (General_options::static_): Likewise.
17053 (General_options::do_demangle_): New field.
17054 * object.cc (big_endian>::get_symbol_location_info): Call
17055 Options::do_demangle, not Options::demangle.
17056 * symtab.cc (demangle): Likewise.
17057
cbb93e63
ILT
170582008-03-22 Ian Lance Taylor <iant@google.com>
17059
17060 * gold.h: Include <cstddef> and <sys/types.h>
17061 * options.h: Include <cstring>.
17062
ec531623
ILT
170632008-03-21 Ian Lance Taylor <iant@google.com>
17064
17065 * Added source code to GNU binutils.
752937aa 17066\f
b90efa5b 17067Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
17068
17069Copying and distribution of this file, with or without modification,
17070are permitted in any medium without royalty provided the copyright
17071notice and this notice are preserved.
17072
17073Local Variables:
17074mode: change-log
17075left-margin: 8
17076fill-column: 74
17077version-control: never
17078End:
This page took 1.196522 seconds and 4 git commands to generate.