0ec1c2718c8d5a2bcaa99ff0dc36f3d4abb5f95d
[binutils-gdb.git] / gold / ChangeLog
1 2015-06-08 Nick Clifton <nickc@redhat.com>
2
3 * po/fr.po: New French Translation.
4
5 2015-06-07 Cary Coutant <ccoutant@gmail.com>
6
7 PR gold/18288
8 * resolve.cc (symbol_to_bits): Remove type parameter; adjust all
9 callers. Don't use STT_COMMON to check for common symbols.
10 (Symbol_table::resolve): Warn if relocatable object has STT_COMMON
11 symbol that's not in a common section.
12 * symtab.h (Symbol::is_common): Don't use STT_COMMON to check for
13 common symbols.
14
15 2015-06-04 Cary Coutant <ccoutant@gmail.com>
16
17 PR gold/18200
18 * Makefile.am (diststuff): Add target.
19 * Makefile.in: Regenerate.
20
21 2015-06-04 Cary Coutant <ccoutant@gmail.com>
22
23 PR gold/17498
24 * object.cc (Sized_relobj_file::do_count_local_symbols): Discard
25 temporary locals in merge sections.
26 * options.cc (General_options::parse_discard_all): New method.
27 (General_options::parse_discard_locals): New method.
28 (General_options::parse_discard_none): New method.
29 (General_options::General_options): Initialize discard_locals_.
30 * options.h (--discard-all): Convert to special option.
31 (--discard-locals): Likewise.
32 (--discard-none): New option.
33 (General_options::discard_all): New method.
34 (General_options::discard_locals): New method.
35 (General_options::discard_sec_merge): New method.
36 (General_options::Discard_locals): New enum.
37 (General_options::discard_locals_): New data member.
38
39 2015-06-03 Cary Coutant <cary@google.com>
40
41 * script-sections.cc (Script_sections::Script_sections): Initialize
42 segments_created_.
43 (Script_sections::create_note_and_tls_segments): Set flag when
44 segments are created.
45 (Script_sections::expected_segment_count): Count PT_INTERP.
46 (Script_sections::attach_sections_using_phdrs_clause): Set flag when
47 segments are created.
48 * script-sections.h (Script_sections::segments_created_): New data
49 member.
50
51 2015-06-03 Cary Coutant <ccoutant@gmail.com>
52
53 PR gold/15370
54 * script-sections.cc
55 (Output_section_element_input::set_section_addresses): When there
56 are several patterns with no sort spec, put all sections in the same
57 bin.
58 * testsuite/Makefile.am (script_test_12): New testcase.
59 (script_test_12i): New testcase.
60 * testsuite/Makefile.in: Regenerate.
61 * testsuite/script_test_12.t: New test linker script.
62 * testsuite/script_test_12i.t: New test linker script.
63 * testsuite/script_test_12a.c: New test source file.
64 * testsuite/script_test_12b.c: New test source file.
65
66 2015-06-02 Cary Coutant <ccoutant@gmail.com>
67
68 * nacl.h (Sniff_file): Switch parameters to get_view to get an
69 aligned view.
70
71 2015-06-03 Cary Coutant <ccoutant@gmail.com>
72
73 PR gold/17819
74 * gold.cc (queue_final_tasks): When --build-id=tree, queue a
75 separate task to schedule the build id computation.
76 * layout.cc (Hash_task::Hash_task): Remove build_id_blocker,
77 add Output_file and offset.
78 (Hash_task::run): Get and release the input views.
79 (Hash_task::is_runnable): Always return NULL (always runnable).
80 (Layout::queue_build_id_tasks): Remove.
81 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
82 parameters; use them instead of class members.
83 (Build_id_task_runner::run): New function.
84 (Close_task_runner::run): Pass array_of_hashes and size_of_hashes
85 to write_build_id.
86 * layout.h (Layout::queue_build_id_tasks): Remove.
87 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
88 parameters.
89 (Layout::array_of_hashes_): Remove.
90 (Layout::size_of_array_of_hashes_): Remove.
91 (Layout::input_view_): Remove.
92 (Build_id_task_runner): New class.
93 (Close_task_runner::Close_task_runner): Add array_of_hashes and
94 size_of_hashes parameters.
95 (Close_task_runner::array_of_hashes_): New data member.
96 (Close_task_runner::size_of_hashes_): New data member.
97 * testsuite/Makefile.am
98 (flagstest_compress_debug_sections_and_build_id_tree): New test.
99 * testsuite/Makefile.in: Regenerate.
100
101 2015-06-01 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
102
103 * merge.cc (get_input_merge_map): Update for data structure change.
104 (get_or_make_input_merge_map): Update for data structure change.
105 * merge.h (Object_merge_map): Use a std::vector<std::pair>> instead of
106 a std::map. Remove first_shnum_, first_map_, second_shnum_, second_map_.
107
108 2015-05-16 Alan Modra <amodra@gmail.com>
109
110 * reloc.cc (Sized_relobj_file::find_functions): Use function_location.
111 * powerpc.cc (Target_powerpc::do_calls_non_split): New function.
112 (addi_12_1, addis_2_12, addis_12_1, cmpld_7_12_0): New constants.
113 (lis_0): Rename from lis_0_0.
114
115 2015-04-29 Cary Coutant <cary@google.com>
116 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
117
118 * gc.h (Garbage_collection::is_section_garbage): Change Object*
119 to Relobj*.
120 (Garbage_collection::add_reference): Likewise.
121 (Garbage_collection::gc_process_relocs): Likewise. Don't push
122 object/shndx pair onto *secvec for dynamic objects. Don't follow
123 relocations pointing to dynamic objects for GC.
124 * icf.cc (Icf::find_identical_sections): Change Object* to Relobj*.
125 (Icf::unfold_section): Likewise.
126 (Icf::is_section_folded): Likewise.
127 (Icf::get_folded_section): Likewise.
128 * icf.h: (Icf::get_folded_section): Likewise.
129 (Icf::unfold_section): Likewise.
130 (Icf::is_section_folded): Likewise.
131 (Icf::section_has_function_pointers): Likewise.
132 (Icf::set_section_has_function_pointers): Likewise.
133 * object.h (Section_id): Likewise.
134 (Const_section_id): Likewise.
135 * output.cc (Output_section::update_section_layout): Likewise.
136 * output.h: (Output_section_lookup_maps::find_relaxed_input_section):
137 Likewise.
138 * plugin.cc (update_section_order): Likewise.
139 (unique_segment_for_sections): Likewise.
140 * powerpc.cc (Powerpc_relobj::add_reference): Likewise.
141 (Target_powerpc::do_gc_add_reference): Likewise.
142 (Target_powerpc::gc_process_relocs): Likewise.
143 (Target_powerpc::do_gc_add_reference): Likewise.
144 * symtab.cc (Symbol_table::is_section_folded): Likewise.
145 (Symbol_table::gc_mark_symbol): Likewise.
146 * symtab.h: (Symbol_table::is_section_folded): Likewise.
147 * target.h: (Sized_target::gc_add_reference): Likewise.
148 (Sized_target::do_gc_add_reference): Likewise.
149
150 2015-04-29 Nick Clifton <nickc@redhat.com>
151
152 * po/fi.po: Updated Finnish translation.
153
154 2015-04-28 Alan Modra <amodra@gmail.com>
155
156 * powerpc.cc (Target_powerpc::do_dynsym_value): Use Address rather
157 than unsigned int for find_global_entry result temp. Compare
158 against invalid_address.
159 (Target_powerpc::do_plt_address_for_global): Likewise.
160 (Target_powerpc::Relocate::relocate): Likewise. Don't assert
161 on plt call stub existence for debug info. Do assert for plt
162 and global entry stub existence if an alloc section.
163
164 2015-04-28 Alan Modra <amodra@gmail.com>
165
166 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
167 on missing global entry stub due to bogus debug info.
168
169 2015-04-27 Han Shen <shenhan@google.com>
170
171 * options.h (--fix-cortex-a53-843419): Rename option.
172 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
173 option.
174 (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
175
176 2015-04-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
177
178 PR gold/18327
179 * output.cc (Output_section::is_input_address_mapped): Assume a missing
180 entry is mapped.
181 * testsuite/Makefile.am: Add the eh_test test.
182 * testsuite/Makefile.in: Regenerate.
183 * testsuite/eh_test_a.cc: New test.
184 * testsuite/eh_test_b.cc: New test.
185
186 2015-04-23 Sriraman Tallam <tmsriram@google.com>
187
188 * options.h (--weak-unresolved-symbols): New option.
189 * symtab.cc (Symbol_table::sized_write_globals): Change symbol
190 binding to weak with new option.
191 * symtab.h (is_weak_undefined): Check for new option.
192 (is_strong_undefined): Check for new option.
193 * testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
194 * testsuite/Makefile.in: Regenerate.
195 * testsuite/weak_unresolved_symbols_test.cc: New file.
196
197 2015-04-20 Ian Coolidge <icoolidge@google.com>
198
199 * symtab.cc (Symbol::should_add_dynsym_entry): Return true for
200 GNU_UNIQUE.
201
202 2015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
203
204 * gc.cc (Garbage_collection::do_transitive_closure): Use back and
205 push_back.
206 * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
207 * object.cc (Sized_relobj_file::do_layout): Use push_back.
208 * powerpc.cc (process_gc_mark): Use push_back.
209 (Target_powerpc::do_gc_mark_symbol): Use push_back.
210 * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
211
212 2015-04-16 Han Shen <shenhan@google.com>
213
214 * aarch64.cc (AArch64_insn_utilities): New utility class.
215 (AArch64_relobj::Mapping_symbol_position): New struct.
216 (AArch64_relobj::Mapping_symbol_info): New typedef.
217 (AArch64_relobj::do_count_local_symbols): New function overriding
218 parent's implementation.
219 (AArch64_relobj::mapping_symbol_info_): New member
220 (AArch64_relobj::scan_erratum_843419): New method.
221 (Target_aarch64::scan_erratum_843419_span): New method.
222 (Target_aarch64::is_erratum_843419_sequence): New method.
223 * options.h (fix_cortex_a53): New option.
224
225 2015-04-09 Cary Coutant <ccoutant@google.com>
226
227 * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
228 in a PIE link.
229 * testsuite/Makefile.am (tls_pie_test.sh): New test.
230 * testsuite/Makefile.in: Regenerate.
231 * testsuite/tls_pie_test.sh: New.
232
233 2015-04-09 Cary Coutant <ccoutant@google.com>
234
235 * debug.h (DEBUG_LOCATION): New.
236 (DEBUG_ALL): Include DEBUG_LOCATION.
237 (debug_string_to_enum): Add DEBUG_LOCATION.
238 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
239 output to print correct context.
240 (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
241 up to 4 more locations at the beginning of the function.
242 * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
243 result before sorting list of line numbers.
244 * testsuite/debug_msg.sh: Allow range of line numbers for
245 canonical results on optimized code.
246
247 2015-04-07 HC Yen <hc.yen@mediatek.com>
248
249 Add AArch32 support for gold linker.
250 gold/
251 * arm.cc: Add V8 arch combine table.
252
253 2015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
254
255 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
256
257 2015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
258
259 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
260 to find by using the return value of insert.
261
262 2015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
263
264 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
265 constructor call.
266
267 2015-04-06 Ilya Tocar <ilya.tocar@intel.com>
268
269 PR gold/17641
270 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
271 (Target_x86_64::Scan::local): Don't create GOT entry, when we
272 can convert mov to lea.
273 (Target_x86_64::Scan::global): Ditto.
274 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
275 %reg to lea foo(%rip), %reg if possible.
276 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
277 * testsuite/x86_64_mov_to_lea1.s: New.
278 * testsuite/x86_64_mov_to_lea2.s: Ditto.
279 * testsuite/x86_64_mov_to_lea3.s: Ditto.
280 * testsuite/x86_64_mov_to_lea4.s: Ditto.
281 * testsuite/x86_64_mov_to_lea.sh: Ditto.
282
283 2015-04-02 H.J. Lu <hongjiu.lu@intel.com>
284
285 * configure: Regenerated.
286
287 2015-04-01 Ilya Tocar <ilya.tocar@intel.com>
288
289 PR gold/17640
290 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
291 (Target_i386::Scan::local): Don't create GOT entry, when we
292 can convert GOT to GOTOFF.
293 (Target_i386::Scan::global): Ditto.
294 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
295 lea foo@GOTOFF(%reg), %reg if possible.
296 * testsuite/Makefile.am (i386_mov_to_lea): New test.
297 * testsuite/i386_mov_to_lea1.s: New.
298 * testsuite/i386_mov_to_lea2.s: Ditto.
299 * testsuite/i386_mov_to_lea3.s: Ditto.
300 * testsuite/i386_mov_to_lea4.s: Ditto.
301 * testsuite/i386_mov_to_lea5.s: Ditto.
302 * testsuite/i386_mov_to_lea.sh: Ditto.
303
304 2015-04-01 H.J. Lu <hongjiu.lu@intel.com>
305
306 * Makefile.am (ZLIB): New.
307 (ZLIBINC): Likewise.
308 (AM_CFLAGS): Add $(ZLIBINC).
309 (AM_CXXFLAGS): Likewise.
310 (ldadd_varldadd_var): Add $(ZLIB).
311 (incremental_dump_LDADD): Likewise.
312 (dwp_LDADD): Likewise.
313 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
314 <zlib.h>.
315 (zlib_compress): Don't check HAVE_ZLIB_H.
316 (zlib_decompress): Likewise.
317 * options.h (compress_debug_sections): Likewise.
318 * configure.ac (AM_CONDITIONAL): Removed.
319 * testsuite/Makefile.am (ZLIB): New.
320 (LDADD): Add $(ZLIB).
321 Don't check HAVE_ZLIB.
322 * Makefile.in: Regenerated.
323 * config.in: Likewise.
324 * configure: Likewise.
325 * testsuite/Makefile.in: Likewise.
326
327 2015-03-30 Jing Yu <jingyu@google.com>
328
329 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
330 TLSLD_ADD_DTPREL_LO12_NC.
331 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
332 _TLS_MODULE_BASE_ point to the start of tls segment.
333 (Target_aarch64::optimize_tls_reloc): Add cases for
334 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
335 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
336 (Target_aarch64::Scan::local): Likewise.
337 (Target_aarch64::Scan::global): Likewise.
338 (Target_aarch64::Relocate::relocate): Likewise.
339 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
340 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
341 relocations.
342
343 2015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
344
345 * merge.cc (Object_merge_map::add_mapping): call
346 Object_merge_map::Input_merge_map::add_mapping.
347 (Object_merge_map::Input_merge_map::add_mapping): New.
348 (Output_merge_data::do_add_input_section): Call
349 get_or_make_input_merge_map before a loop.
350 (Output_merge_string<Char_type>::finalize_merged_data): Call
351 get_or_make_input_merge_map before a loop.
352 * merge.h (Object_merge_map): Make Input_merge_map public.
353 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
354 (Relobj::get_or_create_merge_map): New.
355 * object.h (Relobj::get_or_create_merge_map): New.
356
357 2015-03-24 Alan Modra <amodra@gmail.com>
358
359 PR 18147
360 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
361 relocation errors for branches to strong undefined symbols.
362
363 2015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
364
365 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
366 (Object_merge_map::is_merge_section_for): Remove.
367 (Object_merge_map::find_merge_section): New.
368 * merge.h (Object_merge_map::is_merge_section_for): Remove.
369 (Object_merge_map::find_merge_section): New.
370 (Object_merge_map::get_input_merge_map): Add a const version.
371 * object.cc (Relobj::is_merge_section_for): Remove.
372 (Relobj::find_merge_section): New.
373 * object.h (Relobj::is_merge_section_for): Remove.
374 (Relobj::find_merge_section): New.
375 * output.cc
376 (Output_section::Input_section::is_merge_section_for): Remove.
377 (Output_section::add_merge_input_section): Don't call
378 add_merge_input_section.
379 (Output_section::find_merge_section): Return const. Use
380 object->find_merge_section.
381 (Output_section::build_lookup_maps): Don't build a map for
382 merge sections.
383 (Output_section::is_input_address_mapped): Return false if
384 section is not found.
385 (Output_section::find_starting_output_address): Use
386 find_merge_section instead of is_merge_section_for.
387 (Output_section::add_script_input_section): Don't build a map for
388 merge sections.
389 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
390 (Output_section_lookup_maps::find_merge_section): Remove.
391 (Output_section_lookup_maps::add_merge_input_section) Remove.
392 (Output_section::find_merge_section): Return const.
393
394 2015-03-22 Cary Coutant <cary@google.com>
395
396 PR gold/18106
397 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
398 non-SIB form of lea, with nop after the call.
399
400 2015-03-21 Cary Coutant <cary@google.com>
401
402 PR gold/14217
403 * output.cc (Output_segment::is_first_section_relro): Don't ignore
404 .tdata section.
405 (Output_segment::set_section_addresses): Don't align size of relro
406 segment for .tbss.
407
408 2015-03-21 Cary Coutant <cary@google.com>
409
410 PR gold/18010
411 * stringpool.cc (Stringpool_template): Don't optimize if section
412 alignment is greater than sizeof(char).
413
414 2015-03-21 Cary Coutant <cary@google.com>
415
416 PR gold/18048
417 * script-c.h (script_include_directive): Add first_token parameter.
418 * script.cc (script_include_directive): Add first_token parameter, and
419 pass it to read_script_file.
420 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
421 (PARSING_MEMORY_DEF): New tokens.
422 (top): Add new productions for INCLUDE files.
423 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
424 Pass PARSING_LINKER_SCRIPT to script_include_directive.
425 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
426 (section_cmd): Pass PARSING_SECTION_CMDS.
427 (file_or_sections_cmd): Remove.
428 (memory_def): Pass PARSING_MEMORY_DEF.
429 * testsuite/Makefile.am (memory_test_2): New test.
430 * testsuite/Makefile.in: Regenerate.
431 * testsuite/memory_test_inc.t: New script file.
432 * testsuite/memory_test_inc_1.t.src: New script file.
433 * testsuite/memory_test_inc_2.t.src: New script file.
434 * testsuite/memory_test_inc_3.t.src: New script file.
435
436 2015-03-21 Cary Coutant <cary@google.com>
437
438 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
439 (Sized_relobj_dwo::setup): Build compressed section map.
440 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
441 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
442 section map.
443 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
444 compressed_sections_ field.
445 (build_compressed_section_map): Take Object instead of
446 Sized_relobj_file parameter; add decompress_if_needed parameter.
447 (Sized_relobj_file::do_find_special_sections): Store compressed
448 section map in parent Object.
449 (Sized_relobj_file::do_decompressed_section_contents): Move
450 implementation to Object::decompressed_section_contents.
451 (Sized_relobj_file::do_discard_decompressed_sections): Move
452 implementation to Object::discard_decompressed_sections.
453 * object.h (build_compressed_section_map): Declare.
454 (Object::Object): Add compressed_sections_ field.
455 (Object::section_is_compressed): Move implementation here.
456 (Object::decompressed_section_contents): De-virtualize.
457 (Object::discard_decompressed_sections): De-virtualize.
458 (Object::do_section_is_compressed): Delete.
459 (Object::do_decompressed_section_contents): Delete.
460 (Object::set_compressed_sections): New method.
461 (Object::compressed_sections): New method.
462 (Object::compressed_sections_): New data member.
463 (Compressed_section_info, Compressed_section_map): Move to top of file.
464 (Sized_relobj_file::do_section_is_compressed): Delete.
465 (Sized_relobj_file::do_decompressed_section_contents): Delete.
466 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
467 (Sized_relobj_file::compressed_sections_): Move to Object class.
468
469 2015-03-21 Cary Coutant <ccoutant@google.com>
470
471 PR gold/18152
472 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
473 deferred objects.
474
475 2015-03-11 Cary Coutant <ccoutant@google.com>
476
477 * options.cc (General_options::finalize): Don't allow -z relro
478 with incremental linking.
479 * testsuite/Makefile.am (incremental_test): Add -z norelro.
480 (incremental_test_2): Likewise.
481 (incremental_test_3): Likewise.
482 (incremental_test_4): Likewise.
483 (incremental_test_5): Likewise.
484 (incremental_test_6): Likewise.
485 (incremental_copy_test): Likewise.
486 (incremental_common_test_1): Likewise.
487 (incremental_comdat_test_1): Likewise.
488 * testsuite/Makefile.in: Regenerate.
489
490 2015-03-09 Cary Coutant <ccoutant@google.com>
491
492 PR gold/14675
493 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
494 return enum indicating whether .eh_frame section is empty, optimizable,
495 unrecognized, or an end marker. Adjust explicit instantiations.
496 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
497 (Eh_frame::add_ehframe_input_section): Change return type.
498 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
499 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
500 to the .eh_frame output section until we see the end marker.
501 (Layout::finalize_eh_frame_section): New.
502 * layout.h: (Layout::finalize_eh_frame_section): New.
503
504 2015-03-05 H.J. Lu <hongjiu.lu@intel.com>
505
506 * output.cc (Relobj::initialize_input_to_output_map<size>):
507 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
508
509 2015-03-04 Cary Coutant <ccoutant@google.com>
510
511 * parameters.cc (Parameters::set_target_once): Call
512 Target::select_as_default_target just once from here...
513 (set_parameters_target): ...instead of from here.
514
515 2015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
516
517 * ehframe.cc (Cie::set_output_offset): Pass in and use a
518 Output_section_data instead of a Merge_map.
519 (Eh_frame::Eh_frame): Don't initialize merge_map_.
520 (Eh_frame::read_cie): Use add_merge_mapping instead of
521 Merge_map::add_mapping.
522 (Eh_frame::read_fde): Ditto.
523 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
524 (Eh_frame::do_output_offset): Use merge_output_offset istead of
525 merge_map_->get_output_offset.
526 (Eh_frame::do_is_merge_section_for): Delete.
527 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
528 instead of a Merge_map.
529 (Cie::set_output_offset): Pass in a Output_section_data instead of a
530 Merge_map.
531 (Eh_frame::do_is_merge_section_for): Delete.
532 (Eh_frame::merge_map_): Delete.
533 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
534 and use a Output_section_data instead of a Merge_map.
535 (Object_merge_map::add_mapping): Ditto.
536 (Object_merge_map::get_output_offset): Remove the merge_map argument.
537 (Object_merge_map::is_merge_section_for): Pass in and use a
538 Output_section_data instead of a Merge_map.
539 (Merge_map): Delete.
540 (Output_merge_base::do_output_offset): Use merge_output_offset instead
541 of merge_map_.get_output_offset.
542 (Output_merge_base::do_is_merge_section_for): Delete.
543 (Output_merge_data::do_add_input_section): Use
544 object->add_merge_mapping instead of add_mapping.
545 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
546 * merge.h (Merge_map): Delete forward declaration.
547 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
548 instead of a Merge_map.
549 (Object_merge_map::get_output_offset): Remove the merge_map argument.
550 (Object_merge_map::is_merge_section_for): Pass in and use a
551 Output_section_data instead of a Merge_map.
552 (Input_merge_map::Object_merge_map::merge_map): Replace with
553 output_data.
554 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
555 Output_section_data instead of a Merge_map.
556 (Merge_map): Delete.
557 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
558 (Output_merge_base::do_is_merge_section_for): Delete.
559 (Output_merge_base::add_mapping): Delete.
560 (Output_merge_base::merge_map_): Delete.
561 * object.cc (Relobj::initialize_input_to_output_map): New.
562 (Relobj::initialize_input_to_output_map): New.
563 (Relobj::merge_output_offset): New.
564 (Relobj::is_merge_section_for): New.
565 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
566 bits.
567 * object.h (Relobj::merge_map): Delete.
568 (initialize_input_to_output_map): New.
569 (set_merge_map): Delete.
570 (add_merge_mapping): New.
571 (merge_output_offset): New.
572 (is_merge_section_for): New.
573 * output.cc (Output_section::Input_section::is_merge_section_for):
574 Use object->is_merge_section_for.
575 * output.h (Output_section_data::is_merge_section_for): Delete.
576 (Output_section_data::do_is_merge_section_for): Delete.
577 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
578 Use object->initialize_input_to_output_map.
579 (Merged_symbol_value<size>::value_from_output_section): Use
580 object->merge_output_offset.
581
582 2015-03-02 Peter Collingbourne <pcc@google.com>
583 Cary Coutant <ccoutant@google.com>
584
585 * output.cc (Output_section::add_merge_input_section): Do not
586 attempt to merge sections with an entsize of 0.
587
588 2015-03-02 Khem Raj <raj.khem@gmail.com>
589
590 * attributes.h (class Output_attributes_section_data ): Add
591 do_print_to_mapfile function.
592
593 2015-02-24 Alan Modra <amodra@gmail.com>
594
595 PR 18010
596 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
597 complain if value is not a multiple of four.
598 (Target_powerpc::Relocate::relocate): Correct handling of
599 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
600
601 2015-02-21 H.J. Lu <hongjiu.lu@intel.com>
602
603 * configure.ac (default_size): Set to 32 for x32.
604 * configure: Regenerated.
605
606 2015-02-18 Alan Modra <amodra@gmail.com>
607
608 PR 17954
609 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
610 visibility.
611
612 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
613
614 * gc.h (Garbage_collection::add_reference): Don't use find.
615
616 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
617
618 * object.cc (write_local_symbols): avoid std::vector copy.
619
620 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
621
622 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
623
624 2015-02-09 Mark Wielaard <mjw@redhat.com>
625
626 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
627 DW_LANG_Fortran03 and DW_LANG_Fortran08.
628
629 2015-02-16 Cary Coutant <ccoutant@google.com>
630
631 PR gold/13577
632 PR gold/16992
633 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
634 DF_SYMBOLIC if --dynamic-list option is used.
635 * options.cc (General_options::finalize): --dynamic-list is not
636 mutually exclusive with -Bsymbolic.
637 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
638 listed in --dynamic-list.
639 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
640 -Bsymbolic-functions.
641 * testsuite/Makefile.in: Regenerate.
642
643 2015-02-16 Cary Coutant <ccoutant@google.com>
644
645 PR gold/17971
646 * incremental.cc: Remove redundant include of "output.h".
647
648 2015-02-12 Jing Yu <jingyu@google.com>
649
650 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
651 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
652 New relocation.
653 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
654 TLSLE_MOVW_* relocations.
655 (Target_aarch64::Scan::global): Likewise.
656 (Target_aarch64::Relocate::relocate): Likewise.
657 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
658 for new TLSLE_MOVW_* relocations.
659
660 2015-02-11 Will Newton <will.newton@linaro.org>
661
662 PR gold/13321
663 * arm.cc (Target_arm::make_plt_section): Create an ARM
664 state mapping symbol at the start of the PLT.
665
666 2015-02-09 H.J. Lu <hongjiu.lu@intel.com>
667
668 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
669 Replace two_file_shared_2.so with two_file_shared_1.so.
670 * testsuite/Makefile.in: Regenerated.
671
672 2015-02-09 Alan Modra <amodra@gmail.com>
673
674 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
675 plugin_test_thin.a and defsym_test.
676 * testsuite/Makefile.in: Regenerate.
677
678 2015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
679
680 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
681 body.
682
683 2015-02-04 Peter Collingbourne <pcc@google.com>
684
685 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
686 forwarding symbols when computing symbol resolution info for plugins.
687 * plugin.h (Plugin_manager::symtab): New method.
688 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
689
690 2015-02-03 Cary Coutant <ccoutant@google.com>
691 Peter Collingbourne <pcc@google.com>
692
693 PR gold/15660
694 * archive.cc (Thin_archive_object_unlocker): New class.
695 (Archive::include_member): Unlock external members of thin archives.
696 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
697 (plugin_test_2): Likewise.
698 (plugin_test_3): Likewise.
699 (plugin_test_4): Likewise.
700 (plugin_test_5): Likewise.
701 (plugin_test_6): Likewise.
702 (plugin_test_7): Likewise.
703 (plugin_test_8): Likewise.
704 (plugin_test_9): Likewise.
705 (plugin_test_10): Likewise.
706 (plugin_test_11): New test case.
707 * testsuite/Makefile.in: Regenerate.
708 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
709 file to decide whether to claim file.
710 (all_symbols_read_hook): Likewise.
711 * testsuite/plugin_test_1.sh: Adjust expected output.
712 * testsuite/plugin_test_2.sh: Likewise.
713 * testsuite/plugin_test_3.sh: Likewise.
714 * testsuite/plugin_test_6.sh: Likewise.
715 * testsuite/plugin_test_tls.sh: Likewise.
716 * testsuite/plugin_test_11.sh: New testcase.
717
718 2015-02-03 Cary Coutant <ccoutant@google.com>
719
720 * descriptors.cc (Descriptors::open): Set artificially-low limit for
721 file descriptors when debugging enabled. Add debug output.
722 (Descriptors::release): Add debug output.
723 (Descriptors::close_some_descriptor): Likewise.
724 (Descriptors::close_all): Likewise.
725 * fileread.cc (File_read::lock): Likewise.
726 (File_read::unlock): Likewise.
727
728 2015-02-02 Cary Coutant <ccoutant@google.com>
729
730 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
731 executable output file.
732
733 2015-01-22 Han Shen <shenhan@google.com>
734
735 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
736 (Target_arm::do_plt_address_for_global): New method.
737 (Target_arm::do_plt_address_for_local): New method.
738 (Target_arm::rel_irelative_section): New method.
739 (Target_arm::make_data_plt): Add more parameters for plt ctor.
740 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
741 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
742 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
743 (Target_arm::Scan::check_non_pic): Add ifunc support.
744 (Target_arm::Scan::local): Add ifunc support.
745 (Target_arm::Scan::global): Add ifunc support.
746 (Target_arm::make_plt_section): New method.
747 (Target_arm::make_plt_entry): Change to call to make_plt_section.
748 (Target_arm::make_local_ifunc_plt_entry): New method.
749 (Target_arm::got_irelative_): New member.
750 (Target_arm::rel_irelative_): New member.
751 (Target_arm::got_section): Add creation for got_irelative_.
752 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
753 (Target_arm::Relocate::relocate): Properly set local ifunc address.
754 (Target_arm::do_dynsym_value): Properly set global ifunc address.
755 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
756 (Output_data_plt_arm::IRelative_data): New type.
757 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
758 (Output_data_plt_arm::add_entry): Add more parameters.
759 (Output_data_plt_arm::add_relocation): New method.
760 (Output_data_plt_arm::add_local_ifunc_entry): New method.
761 (Output_data_plt_arm::rel_irelative): New method.
762 (Output_data_plt_arm::entry_count): Modified.
763 (Output_data_plt_arm::address_for_global): New method.
764 (Output_data_plt_arm::address_for_local): New method.
765 gold/
766 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
767 (Output_data_plt_arm::insert_irelative_data): New method.
768 (Output_data_plt_arm::irelative_rel_): New member.
769 (Output_data_plt_arm::got_): New member.
770 (Output_data_plt_arm::got_irelative_): New member.
771 (Output_data_plt_arm::irelative_count_): New member.
772 (Output_data_plt_arm::IRelative_data_vec): New typedef.
773 (Output_data_plt_arm::irelative_data_vec_): New member.
774 (Output_data_plt_arm::do_write): Write out irelative entries.
775 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
776 more parameters to ctor.
777 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
778 more parameters to ctor.
779 * output.h (Output_data_reloc::add_local_relative): New method.
780 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
781
782 2015-01-29 Alan Modra <amodra@gmail.com>
783
784 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
785 and GOT_TLSGD to LE optimization.
786
787 2015-01-28 Cary Coutant <ccoutant@google.com>
788
789 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
790 for undef TLS symbols.
791 (Target_x86_64::Relocate::relocate_tls): Likewise.
792 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
793
794 2015-01-25 Cary Coutant <ccoutant@google.com>
795
796 * output.cc (Output_segment::set_section_addresses): Fix calculation
797 of size of relro segment.
798
799 2015-01-22 Alan Modra <amodra@gmail.com>
800
801 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
802 condition for need of ifunc plt entry.
803 (Target_powerpc::Scan::global <got relocs>): Likewise.
804
805 2015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
806
807 * mips.cc (reloc_high): Add r_sym.
808 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
809 reloc_high constructor.
810 (Mips_relocate_functions::relgot16_local): Likewise.
811 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
812 r_type to decide whether LO16 matches HI16.
813 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
814 rello16 and relgot16_local.
815
816 2015-01-09 Cary Coutant <ccoutant@google.com>
817
818 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
819 unless alignment is larger than page size.
820
821 2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
822 Cary Coutant <ccoutant@google.com>
823
824 PR gold/17729
825 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
826 (DEFAULT_TARGET_X32): Set for x32.
827 * x86_64.cc (cmp_insn_32): New.
828 (lea_r10_insn_32): Likewise.
829 (lea_r11_insn_32): Likewise.
830 (cmp_insn_64): Likewise.
831 (lea_r10_insn_64): Likewise.
832 (lea_r11_insn_64): Likewise.
833 (Target_x86_64<size>::do_calls_non_split): Handle x32.
834 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
835 (check_DATA): Add split_x32 files.
836 (split_x32_[1234n].o): New targets.
837 (split_x32_[124]): New targets.
838 (split_x32_[1234r].stdout): New targets.
839 * testsuite/split_x32.sh: New file.
840 * testsuite/split_x32_1.s: Likewise.
841 * testsuite/split_x32_2.s: Likewise.
842 * testsuite/split_x32_3.s: Likewise.
843 * testsuite/split_x32_4.s: Likewise.
844 * testsuite/split_x32_n.s: Likewise.
845 * configure: Regenerated.
846 * testsuite/Makefile.in: Likewise.
847
848 2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
849
850 PR gold/17809
851 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
852 x32.
853
854 2015-01-02 Alan Modra <amodra@gmail.com>
855
856 * version.cc (print_version): Just print current year.
857 * dwp.cc (print_version): Likewise.
858
859 2015-01-01 Alan Modra <amodra@gmail.com>
860
861 Update year range in copyright notice of all files.
862
863 2014-12-25 Alan Modra <amodra@gmail.com>
864
865 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
866 new enums.
867 (Target_arm::merge_object_attributes, ): Likewise.
868
869 2014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
870
871 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
872 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
873 AEABI_VFP_args_vfp to check that.
874 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
875 value and replace hardcoded values by enum values.
876
877 2014-12-22 Cary Coutant <ccoutant@google.com>
878
879 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
880
881 2014-12-20 H.J. Lu <hongjiu.lu@intel.com>
882
883 PR gold/14608
884 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
885 to "return i * i * 3;".
886
887 2014-12-16 Cary Coutant <ccoutant@google.com>
888
889 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
890 (Mapfile::print_output_data): Use current_data_size() to avoid
891 assert for sections requiring postprocessing; if address is not valid,
892 print 0.
893 (Mapfile::print_output_section): Use current_data_size(); print note
894 that addresses and sizes are before compression.
895
896 2014-12-14 H.J. Lu <hongjiu.lu@intel.com>
897
898 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
899 Cast current_group_size to unsigned long when reporting error.
900
901 2014-12-10 Jing Yu <jingyu@google.com>
902
903 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
904 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
905 Update error message.
906 (Target_aarch64::do_relax): Use absolute value of option
907 stub_group_size. Replace local variable with class member
908 stub_group_size_.
909
910 2014-12-04 Alan Modra <amodra@gmail.com>
911
912 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
913 addend of PLTREL24 reloc when not generating a plt stub. Make
914 max_branch_offset an "Address".
915 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
916 (Target_powerpc::Relocate::relocate): Likewise.
917
918 2014-12-04 Alan Modra <amodra@gmail.com>
919
920 PR 17670
921 * symtab.cc (Symbol::set_undefined): Remove assertion.
922 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
923 on symbols defined in discarded sections, instead return false.
924 Rearrange params, update all callers.
925 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
926 branches to syms in discarded sections.
927 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
928 undefined and flag as discarded.
929 (Target_powerpc::Relocate::relocate): Localize variable.
930
931 2014-12-03 H.J. Lu <hongjiu.lu@intel.com>
932
933 PR gold/17675
934 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
935 * testsuite/Makefile.in: Regenerated.
936
937 2014-12-03 Alan Modra <amodra@gmail.com>
938
939 PR 17566
940 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
941 when adding dynamic relocations against section symbols.
942
943 2014-12-01 Dimitry Ivanov <dimitry@google.com>
944
945 * layout.cc (Layout::finish_dynamic_section): When '-z global'
946 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
947 * options.h (General_options): New -z option (global).
948
949 2014-12-01 Cary Coutant <ccoutant@google.com>
950
951 PR gold/17578
952 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
953 is given.
954 (Layout::create_executable_stack_info): Warn when -z noexecstack is
955 given but some inputs require executable stack.
956
957 2014-11-26 Cary Coutant <ccoutant@google.com>
958
959 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
960 .debug_str_offsets; strip .debug_gnu_pubnames and
961 .debug_gnu_pubtypes.
962 (lines_only_debug_sections): Strip all four new sections.
963
964 2014-11-26 Jing Yu <jingyu@google.com>
965
966 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
967 register to be x0 when to relax TLSDESC_LD64_LO12.
968
969 2014-11-26 Alan Modra <amodra@gmail.com>
970
971 * powerpc.cc (struct Stub_table_owner): New.
972 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
973 unsigned int vector. Update all references.
974 (powerpc_relobj::set_stub_table): Take an unsigned int param
975 rather than a Stub_table. Update callers.
976 (Powerpc_relobj::clear_stub_table): New function.
977 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
978 stub_group_size_ vars.
979 (Target_powerpc::new_stub_table): Delete.
980 (max_branch_delta): New function, extracted from..
981 (Target_powerpc::Relocate::relocate): ..here..
982 (Target_powerpc::Branch_info::make_stub): ..and here. Return
983 status on whether stub created successfully.
984 (Stub_control::Stub_control): Add "no_size_errors" param. Move
985 default sizing to..
986 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
987 reduce on relax failure.
988 (Target_powerpc::group_sections): Add "no_size_errors" param.
989 Use stub_group_size_. Set up group info in a temp vector,
990 before building Stub_table vector. Account for input sections
991 possibly already converted to relaxed sections.
992 (Stub_table::init): Delete. Merge into..
993 (Stub_table::Stub_table): ..here.
994 (Stub_table::can_reach_stub): New function.
995 (Stub_table::add_plt_call_entry): Add "from" parameter and
996 return true iff stub could be reached.
997 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
998 param too.
999 (Stub_table::clear_stubs): Add "all" param.
1000
1001 2014-11-26 Alan Modra <amodra@gmail.com>
1002
1003 * powerpc.cc (Stub_control::set_output_and_owner): New function.
1004 (Target_powerpc::group_sections): Use it.
1005
1006 2014-11-25 Cary Coutant <ccoutant@google.com>
1007
1008 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
1009 (Binary_to_elf::write_symbol): Add st_size parameter.
1010 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
1011
1012 2014-11-25 Cary Coutant <ccoutant@google.com>
1013
1014 PR gold/17639
1015 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
1016 (Sized_relobj_file::do_layout): Handle deferred sections properly
1017 during GC pass 1. Don't add reloc sections to deferred list twice.
1018 * object.h (Sized_relobj_file::is_deferred_layout): New function.
1019 (Sized_relobj_file::is_deferred_layout_): New data member.
1020
1021 2014-11-21 H.J. Lu <hongjiu.lu@intel.com>
1022
1023 PR gold/17619
1024 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
1025 Check PC-relative offset overflow in PLT entry.
1026
1027 2014-11-21 Alan Modra <amodra@gmail.com>
1028
1029 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
1030 for undefined weaks.
1031
1032 2014-11-20 Alan Modra <amodra@gmail.com>
1033
1034 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
1035 from --stub-group-size parameter divided by 1024.
1036 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
1037 template parameter. Update all uses.
1038 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
1039 has_stub_value. Set for long branches. Don't report overflow for
1040 branch to undefined weak symbols. Print info message on
1041 overflowing branch to stub.
1042
1043 2014-11-20 Alan Modra <amodra@gmail.com>
1044
1045 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
1046
1047 2014-11-13 H.J. Lu <hongjiu.lu@intel.com>
1048
1049 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
1050 entry for R_X86_64_GOTPLT64.
1051 (Target_x86_64<size>::Relocate::relocate): Update comments for
1052 R_X86_64_GOTPLT64.
1053
1054 2014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
1055
1056 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
1057 * plugin.h: add lock definition
1058
1059 2014-10-29 Han Shen <shenhan@google.com>
1060 Jing Yu <jingyu@google.com>
1061
1062 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
1063 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1064 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
1065 Symbol::TLS_REF.
1066 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
1067 method.
1068 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
1069 (Target_aarch64::tls_ld_to_le): New method.
1070 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
1071 for 64bit targets.
1072 (Output_data_plt_aarch64::irelative_rel_): New data member.
1073 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
1074 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
1075 (Output_data_plt_aarch64::add_relocation): New method.
1076 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
1077 offset. Add got_irelative size to got size.
1078 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
1079 type string with the new typename.
1080 (AArch64_relocate_functions::update_adr): Replace parameter x with
1081 immed.
1082 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
1083 (AArch64_relocate_functions::reloc_common): New method.
1084 (AArch64_relocate_funcsions::rela_general): Extract common part out
1085 into reloc_common method.
1086 (AArch64_relocate_functions::rela_general): Likewise.
1087 (AArch64_relocate_functions::pcrela_general): Likewise.
1088 (AArch64_relocate_functions::adr): New method.
1089 (AArch64_relocate_functions::adrp): Calculate immed before calling
1090 update_adr.
1091 (AArch64_relocate_functions::adrp): Likewise.
1092 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
1093 comparing x to 0. Calculate immed from ~x when x < 0.
1094 (Target_aarch64::optimize_tls_reloc): Add new cases for
1095 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1096 TLSLD_MOVW_DTPREL_G0_NC.
1097 (Target_aarch64::possible_function_pointer_reloc): Implement this
1098 method.
1099 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
1100 comment.
1101 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
1102 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1103 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1104 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
1105 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1106 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1107 (Target_aarch64::make_plt_entry): Call add_entry with two more
1108 parameters.
1109 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1110 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
1111 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1112 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1113 (Target_aarch64::Relocate::relocate_tls): Add cases for
1114 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1115 TLSLD_MOVW_DTPREL_G0_NC.
1116 * testsuite/icf_safe_so_test.cc: Correct test comment.
1117 * testsuite/icf_safe_test.sh: Add AArch64 arch.
1118
1119 2014-10-22 Alan Modra <amodra@gmail.com>
1120
1121 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
1122 thread_starter.
1123
1124 2014-10-18 Andreas Schwab <schwab@linux-m68k.org>
1125
1126 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
1127
1128 2014-10-17 Cary Coutant <ccoutant@google.com>
1129
1130 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1131 Add "typename" keyword.
1132
1133 2014-10-15 Han Shen <shenhan@google.com>
1134 Jing Yu <jingyu@google.com>
1135
1136 Patch for gold aarch64 backend to support relaxation.
1137 * aarch64-reloc.def: Change format.
1138 * aarch64.cc (class Reloc_stub): New class.
1139 (class Stub_table): New class.
1140 (class AArch64_relobj): New class.
1141 (class AArch64_input_section): New class.
1142 (class AArch64_output_section): New class.
1143 (Target_aarch64::new_stub_table): New method.
1144 (Target_aarch64::new_aarch64_input_section): New method.
1145 (Target_aarch64::find_aarch64_input_section): New method.
1146 (Target_aarch64::scan_section_for_stubs): New method.
1147 (Target_aarch64::scan_reloc_section_for_stubs): New method.
1148 (Target_aarch64::relocate_stub): New method.
1149 (Target_aarch64::current_target): New method.
1150 (Target_aarch64::do_make_elf_object): New method.
1151 (Target_aarch64::do_may_relax): New method.
1152 (Target_aarch64::do_relax): New method.
1153 (Target_aarch64::group_sections): New method.
1154 (Target_aarch64::scan_reloc_for_stub): New method.
1155 (Target_aarch64::do_make_output_section): New method.
1156 (Target_aarch64::stub_tables_): New data member.
1157 (Target_aarch64::aarch64_input_section_map_): New data member.
1158 (AArch64_relocate_functions::maybe_apply_stub): New method.
1159
1160 2014-09-30 Cary Coutant <ccoutant@google.com>
1161
1162 PR gold/17432
1163 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
1164
1165 2014-09-30 Kito Cheng <kito@0xlab.org>
1166
1167 PR gold/13597
1168 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
1169 hash table before sysv-style hash table.
1170
1171 2014-09-29 Sriraman Tallam <tmsriram@google.com>
1172
1173 * options.h (--pic-executable): Add negative to alias to -no-pie.
1174
1175 2014-09-26 Cary Coutant <ccoutant@google.com>
1176
1177 PR gold/16773
1178 * object.cc (Sized_relobj_file): Compute value of section symbols
1179 for TLS sections the same as TLS symbols.
1180
1181 2014-09-25 Cary Coutant <ccoutant@google.com>
1182
1183 PR gold/17432
1184 * resolve.cc (Symbol_table::resolve): Override common placeholder
1185 symbols, but adjust sizes.
1186 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
1187 symbols to common lists.
1188
1189 2014-09-24 Alan Modra <amodra@gmail.com>
1190
1191 * po/POTFILES.in: Regenerate.
1192
1193 2014-09-23 Taiju Tsuiki <tzik@google.com>
1194 Cary Coutant <ccoutant@google.com>
1195
1196 PR gold/14860
1197 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
1198 on input_sections_blocker.
1199 * layout.cc (Write_sections_task::locks): Unblock
1200 input_sections_blocker_.
1201 * layout.h (Write_sections_task::Write_sections_task): Add
1202 input_sections_blocker.
1203 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
1204 to DEPENDENCIES.
1205 * testsuite/Makefile.in: Regenerate.
1206
1207 2014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1208
1209 * testsuite/Makefile.am (plugin_test_10): New test.
1210 * testsuite/Makefile.in: Regenerate
1211 * testsuite/plugin_common_test_2.c (c1): Align to 8.
1212 * testsuite/plugin_test_10.sh: New file.
1213
1214 2014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1215
1216 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
1217 * resolve.cc (Symbol_table::resolve): Don't override common symbols
1218 during the replacement phase.
1219
1220 2014-09-17 Han Shen <shenhan@google.com>
1221 Jing Yu <jingyu@google.com>
1222
1223 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
1224 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
1225 * aarch64.cc (Target_aarch64): Add data members
1226 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
1227 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
1228 constructor.
1229 (Target_aarch64::do_reloc_symbol_index): New method.
1230 (Target_aarch64::do_reloc_addend): New method.
1231 (Target_aarch64::add_tlsdesc_info): New method.
1232 (Target_aarch64::do_dynsym_value): New method.
1233 (Target_aarch64::do_make_data_plt): Add new parameters: got,
1234 got_irelative. Pass them to Output_data_plt_aarch64_standard.
1235 (Target_aarch64::make_data_plt): Add new parameters: got,
1236 got_irelative. Pass them to do_make_data_plt.
1237 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
1238 (Target_aarch64::Relocate:tls_gd_to_le): New method.
1239 (Target_aarch64::Relocate:tls_ie_to_le): New method.
1240 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
1241 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
1242 (Target_aarch64::got_tlsdesc_section): New method.
1243 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1244 (Target_aarch64::define_tls_base_symbol): New method.
1245 (Target_aarch64::reserve_tlsdesc_entries): New method.
1246 (Target_aarch64::got_mod_index_entry): New method.
1247 (Target_aarch64::rela_tlsdesc_section): New method.
1248 (Target_aarch64::rela_irelative_section): New method.
1249 (Target_aarch64::Tlsdesc_info): New struct.
1250 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
1251 relocations and tlsdesc relocations.
1252 (Target_aarch64::optimize_tls_reloc): Implement method.
1253 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
1254 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
1255 in constructor.
1256 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
1257 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
1258 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
1259 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
1260 (Output_data_plt_aarch64::rela_tlsdesc): New method.
1261 (Output_data_plt_aarch64::rela_irelative): New method.
1262 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
1263 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
1264 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
1265 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
1266 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
1267 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
1268 (Output_data_plt_aarch64_standard): New member variables:
1269 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
1270 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
1271 New parameter: got, got_irelative.
1272 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
1273 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
1274 (Output_data_plt_aarch64::do_write): Replace got_address with
1275 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
1276 (AArch64_relocate_functions::update_movnz): New method.
1277 (AArch64_relocate_functions): Correct format.
1278 (AArch64_relocate_functions::movnz): New method.
1279 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
1280 before the switch. Add new cases to switch.
1281 Check ie_to_le relaxation on tlsie relocations. Add code handling
1282 tlsgd tlsdesc cases.
1283 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
1284 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
1285 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
1286 Call reloc_name_in_error_message to print unsupported reloc.
1287 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
1288 make_data_plt.
1289 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
1290 relocs. Fill in some more dynamic tags.
1291 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
1292 Skip call tls_get_addr when tlsgd is relaxed.
1293 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
1294 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
1295 tlsdesc->ie relaxation.
1296
1297 2014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1298
1299 * mips.cc (Target_mips_nacl): New class.
1300 (Target_selector_mips_nacl): New class.
1301 (target_selector_mips32): Rename from target_selector_mips32be and use
1302 Target_selector_mips_nacl instead of Target_selector_mips.
1303 (target_selector_mips32el): Rename from target_selector_mips32 and use
1304 Target_selector_mips_nacl instead of Target_selector_mips.
1305 (target_selector_mips64): Rename from target_selector_mips64be and use
1306 Target_selector_mips_nacl instead of Target_selector_mips.
1307 (target_selector_mips64el): Rename from target_selector_mips64 and use
1308 Target_selector_mips_nacl instead of Target_selector_mips.
1309 (Target_mips::mips_info): Add const attribute.
1310
1311 2014-09-02 Cary Coutant <ccoutant@google.com>
1312
1313 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
1314 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
1315 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
1316 (Sized_incr_dynobj::do_section_name): Likewise.
1317 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
1318 (Sized_incr_dynobj::do_section_name): Likewise.
1319 * object.h (Object::section_name): Likewise.
1320 (Object::do_section_name): Likewise.
1321 (Sized_relobj_file::do_section_name): Likewise.
1322 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
1323 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
1324
1325 2014-09-02 Cary Coutant <ccoutant@google.com>
1326
1327 PR gold/17005
1328 * ehframe.cc (Fde::write): Add output_offset parameter.
1329 (Cie::write): Likewise.
1330 (Eh_frame::set_final_data_size): Account for offset within output
1331 section.
1332 (Eh_frame::do_sized_write): Likewise.
1333 * ehframe.h (Fde::write): Add output_offset parameter.
1334 (Cie::write): Likewise.
1335 * output.cc (Output_section::Input_section_sort_entry): Remove
1336 section_has_name_; add output_section_name parameter. Use
1337 output section name for non-input sections.
1338 (Output_section::Input_section_sort_entry::section_has_name): Remove.
1339 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
1340 (Output_section::Input_section_sort_compare): Remove logic for
1341 sections without names.
1342 (Output_section::Input_section_sort_init_fini_compare): Likewise.
1343 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
1344 Likewise.
1345 (Output_section::Input_section_sort_section_name_compare): Likewise.
1346
1347 2014-08-29 Han Shen <shenhan@google.com>
1348 Jing Yu <jingyu@google.com>
1349
1350 * aarch64-reloc-property.cc
1351 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
1352 reference reloc property in the table.
1353 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
1354 3 other entries.
1355 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
1356 2 new overloaded methods.
1357 (Output_data_got_aarch64::do_write): Add code to write out
1358 static relocs.
1359 (class Output_data_got_aarch64::Static_reloc): New class to wrap
1360 static relocs.
1361 (Output_data_got_aarch64::static_relocs): New vector to
1362 hold static relocs.
1363 (Target_aarch64::TCB_SIZE): New const static memeber.
1364 (Target_aarch64::tcb_size): New method.
1365 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
1366 (Target_aarch64::Relocate::relocate_tls): New method.
1367 (Target_aarch64::Scan::local): Add code handling new reloc types.
1368 (Target_aarch64::Scan::global): Add code handling new reloc types.
1369
1370 2014-08-13 Sriraman Tallam <tmsriram@google.com>
1371
1372 * options.h (-no-pie): Add option.
1373
1374 2014-08-08 Jing Yu <jingyu@google.com>
1375 Han Shen <shenhan@google.com>
1376
1377 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
1378 (DEFFILES): add aarch64-reloc.def.
1379 (TARGETSOURCES): Add aarch64-reloc-property.cc.
1380 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
1381 * Makefile.in: Regenerate.
1382 * aarch64-reloc-property.cc: New file.
1383 * aarch64-reloc-property.h: New file.
1384 * aarch64-reloc.def: New file.
1385 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
1386 with tab to make the format consistent.
1387 (Output_data_got_aarch64::symbol_table_): New method.
1388 (Target_aarch64::do_plt_address_for_global): New method.
1389 (Target_aarch64::do_plt_address_for_local): New method.
1390 (Target_aarch64::do_select_as_default_target): New method.
1391 (Target_aarch64::do_make_data_plt): New method.
1392 (Target_aarch64::make_data_plt): New method.
1393 (Output_data_plt_aarch64::has_irelative_section): New method.
1394 (Output_data_plt_aarch64::address_for_global): New method.
1395 (Output_data_plt_aarch64::address_for_local): New method.
1396 (Output_data_plt_aarch64::irelative_rel_): New parameter.
1397 (Output_data_plt_aarch64::add_entry): Implement contents.
1398 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
1399 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
1400 the got_pov entry to plt0.
1401 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
1402 Implement contents.
1403 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
1404 (AArch64_howto): New struct.
1405 (aarch64_howto[]): New static const array.
1406 (AArch64_relocate_functions): New class.
1407 (Target_aarch64::Scan::get_reference_flags): Remove method.
1408 (Target_aarch64::Scan::local): Implement to support a few relocations.
1409 (Target_aarch64::Scan::global): Implement to support a few relocations.
1410 (Target_aarch64::make_plt_section): Implement contents.
1411 (Target_aarch64::make_plt_entry): Implement contents.
1412 (Target_aarch64::do_finalize_sections): Implement contents.
1413 (Target_aarch64::Relocate::relocate): Implement a few relocations.
1414 (Target_aarch64::relocate_section): Implement contents.
1415
1416 2014-08-06 Alan Modra <amodra@gmail.com>
1417
1418 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
1419
1420 2014-08-06 Alan Modra <amodra@gmail.com>
1421
1422 PR 13227
1423 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
1424
1425 2014-07-21 Sriraman Tallam <tmsriram@google.com>
1426
1427 * object.cc (Relobj::is_section_name_included): Add
1428 ".rodata.nptl_version" to not garbage collect this section.
1429
1430 2014-07-08 Cary Coutant <ccoutant@google.com>
1431
1432 * expression.cc (struct Expression::Expression_eval_info): Add
1433 new fields type_pointer, vis_pointer, and nonvis_pointer.
1434 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
1435 nonvis_pointer parameters. Adjust all calls.
1436 (Symbol_expression::value): Update type, visibility, and nonvis bits
1437 in caller.
1438 * script.cc (Symbol_assignment::sized_finalize): Update type,
1439 visibility, and remaining st_other bits for new symbol.
1440 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
1441 vis_pointer, and nonvis_pointer parameters.
1442 * symtab.h (Symbol::set_type): New method.
1443
1444 * testsuite/Makefile.am (defsym_test): New test.
1445 * testsuite/Makefile.in: Regenerate.
1446 * testsuite/defsym_test.c: New file.
1447 * testsuite/defsym_test.sh: New file.
1448
1449 2014-07-08 Cary Coutant <ccoutant@google.com>
1450
1451 PR gold/15639
1452 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
1453 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
1454 (Sized_dynobj::base_read_symbols): ...new method.
1455 * object.h (Sized_relobj_file::base_read_symbols): New method.
1456 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
1457 (Sized_relobj_file::base_read_symbols): ...new method.
1458 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
1459 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
1460 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
1461
1462 2014-07-04 Alan Modra <amodra@gmail.com>
1463
1464 * po/POTFILES.in: Regenerate.
1465
1466 2014-07-02 Jing Yu <jingyu@google.com>
1467
1468 * aarch64.cc: New file
1469 * Makefile.am (TARGETSOURCES): Add aarch64.cc
1470 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
1471 * Makefile.in: Regenerate.
1472 * configure.tgt: Add entries for aarch64*.
1473 * configure.ac: Likewise.
1474 * configure: Likewise.
1475
1476 2014-06-27 Alan Modra <amodra@gmail.com>
1477
1478 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
1479
1480 2014-06-24 Cary Coutant <ccoutant@google.com>
1481
1482 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
1483 sections.
1484 (Dwo_file::sized_read_unit_index): Likewise.
1485
1486 2014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1487
1488 * mips.cc: New file.
1489 * Makefile.am (TARGETSOURCES): Add mips.cc
1490 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
1491 * configure.tgt: Add entries for mips*.
1492 * configure.ac: Likewise.
1493 * Makefile.in: Regenerate.
1494 * configure: Likewise.
1495
1496 2014-06-09 Cary Coutant <ccoutant@google.com>
1497
1498 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
1499 unit_length is within section bounds.
1500
1501 2014-06-09 Cary Coutant <ccoutant@google.com>
1502
1503 PR gold/16980
1504 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
1505 map.
1506
1507 2014-06-07 Alan Modra <amodra@gmail.com>
1508
1509 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
1510
1511 2014-06-06 Cary Coutant <ccoutant@google.com>
1512
1513 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
1514 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
1515 (Dwarf_pubnames_table::read_header): Likewise.
1516 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
1517 .debug_gnu_pubtypes.
1518
1519 2014-06-05 Joel Brobecker <brobecker@adacore.com>
1520
1521 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
1522 * Makefile.in, configure: Regenerate.
1523
1524 2014-06-03 Alan Modra <amodra@gmail.com>
1525
1526 * powerpc.cc (addis_12_2): Define.
1527 (Stub_table::do_write): Support fusion on ELFv2 stubs.
1528
1529 2014-06-03 Alan Modra <amodra@gmail.com>
1530
1531 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
1532 st_other output.
1533
1534 2014-06-02 Alan Modra <amodra@gmail.com>
1535
1536 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
1537 Only ignore relocs on ELFv1.
1538 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
1539
1540 2014-05-30 Cary Coutant <ccoutant@google.com>
1541
1542 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
1543 * testsuite/Makefile.in: Regenerate.
1544 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
1545
1546 2014-05-27 H.J. Lu <hongjiu.lu@intel.com>
1547
1548 PR gold/16945
1549 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
1550 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
1551
1552 2014-05-15 Alan Modra <amodra@gmail.com>
1553
1554 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
1555 Compare FDE contents with DW_CFA_nop rather than 0.
1556
1557 2014-05-13 Sriraman Tallam <tmsriram@google.com>
1558
1559 * symtab.h (may_need_copy_reloc): Remove check for position independent
1560 code.
1561 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
1562 position independence before pc absolute may_need_copy_reloc call.
1563 Add check for executable output befor pc relative may_need_copy_reloc
1564 call.
1565 * i386.cc: Ditto.
1566 * arm.cc: Ditto.
1567 * sparc.cc: Ditto.
1568 * tilegx.cc: Ditto.
1569 * powerpc.cc: Add check for no position independence before
1570 may_need_copy_reloc calls.
1571 * testsuite/pie_copyrelocs_test.cc: New file.
1572 * testsuite/pie_copyrelocs_shared_test.cc: New file.
1573 * Makefile.am (pie_copyrelocs_test): New test.
1574 * Makefile.in: Regenerate.
1575
1576 2014-05-08 Martin Liška <mliska@suse.cz>
1577
1578 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
1579
1580 2014-05-06 Cary Coutant <ccoutant@google.com>
1581
1582 PR gold/16900
1583 * i386.cc (Output_data_got_plt_i386): New class.
1584 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
1585 parameter. Change all callers.
1586 (Output_data_plt_i386::layout_): Remove.
1587 (Output_data_plt_i386::got_plt_): Change type.
1588 (Target_i386::got_plt_): Change type. Change all references.
1589 (Target_i386::got_section): Create instance of new class.
1590 (Output_data_got_plt_i386::do_write): New function.
1591 * x86_64.cc (Output_data_got_plt_x86_64): New class.
1592 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
1593 parameter. Change all callers.
1594 (Output_data_plt_x86_64::layout_): Remove.
1595 (Output_data_plt_x86_64::got_plt_): Change type.
1596 (Target_x86_64::got_plt_): Change type. Change all references.
1597 (Target_x86_64::got_section): Create instance of new class.
1598 (Output_data_got_plt_x86_64::do_write): New function.
1599 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
1600 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
1601 class.
1602
1603 2014-05-05 Cary Coutant <ccoutant@google.com>
1604
1605 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
1606 if we have pubnames/pubtypes.
1607
1608 2014-05-02 Cary Coutant <ccoutant@google.com>
1609
1610 * defstd.cc (in_segment): Define __ehdr_start here...
1611 * layout.cc (Layout::finalize): ...Instead of here. Set the
1612 output segment when known.
1613 * resolve.cc (Symbol::override_base_with_special): Remember
1614 the original binding.
1615 * symtab.cc (Symbol::set_output_segment): New function.
1616 (Symbol::set_undefined): New function.
1617 * symtab.h (Symbol::is_weak_undefined): Check original undef
1618 binding.
1619 (Symbol::is_strong_undefined): New function.
1620 (Symbol::set_output_segment): New function.
1621 (Symbol::set_undefined): New function.
1622 * target-reloc.h (is_strong_undefined): Remove.
1623 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
1624 Check for hidden undefs.
1625 (relocate_section): Call Symbol::is_strong_undefined.
1626
1627 * testsuite/Makefile.am (ehdr_start_test_1)
1628 (ehdr_start_test_2, ehdr_start_test_3)
1629 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
1630 * testsuite/Makefile.in: Regenerate.
1631 * testsuite/ehdr_start_def.cc: New source file.
1632 * testsuite/ehdr_start_test.cc: New source file.
1633 * testsuite/ehdr_start_test.t: New linker script.
1634 * testsuite/ehdr_start_test_4.sh: New shell script.
1635
1636 2014-04-23 Cary Coutant <ccoutant@google.com>
1637
1638 PR gold/16870
1639 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
1640
1641 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1642
1643 * layout.cc (Layout::include_section): Allow a target to decide
1644 whether to include a section.
1645 * target.h (Target::should_include_section): New function.
1646 (Target::do_should_include_section): New function.
1647
1648 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1649
1650 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
1651 inline into ...
1652 (Copy_relocs::emit): ... here.
1653 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
1654 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
1655 (Copy_reloc_entry::entries_): Change from private to protected.
1656
1657 2014-04-02 Sriraman Tallam <tmsriram@google.com>
1658
1659 * icf.cc (get_section_contents): Replace copies of reloc
1660 vectors with const references.
1661
1662 2014-04-02 Cary Coutant <ccoutant@google.com>
1663
1664 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
1665 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
1666 * configure: Regenerate.
1667 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
1668 -fno-use-linker-plugin.
1669 (LINK1, CXXLINK1): Add it to the link command.
1670 * testsuite/Makefile.in: Regenerate.
1671
1672 2014-03-12 Alan Modra <amodra@gmail.com>
1673
1674 * Makefile.in: Regenerate.
1675
1676 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1677
1678 * symtab.h (Symbol::set_nonvis): New function.
1679
1680 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1681
1682 * symtab.cc (Sized_symbol<32>::init_output_data):
1683 Instantiate the template.
1684 (Sized_symbol<64>::init_output_data): Likewise.
1685
1686 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1687
1688 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
1689 adjust dynamic symbol value.
1690 * target.h (Target::adjust_dyn_symbol): New function.
1691 (Target::do_adjust_dyn_symbol): New function.
1692
1693 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1694
1695 * output.cc (Output_data_dynamic::Dynamic_entry::write):
1696 Get the value of DYNAMIC_CUSTOM dynamic entry.
1697 * output.h (Output_data_dynamic::add_custom): New function.
1698 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
1699 dynamic entry.
1700 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
1701 * target.h (Target::dynamic_tag_custom_value): New function.
1702 (Target::do_dynamic_tag_custom_value): New function.
1703
1704 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1705
1706 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
1707 dynsym indexes.
1708 * target.h (Target::has_custom_set_dynsym_indexes): New function.
1709 (Target::do_has_custom_set_dynsym_indexes): New function.
1710 (Target::set_dynsym_indexes): New function.
1711 (Target::do_set_dynsym_indexes): New function.
1712
1713 2014-03-07 Alan Modra <amodra@gmail.com>
1714
1715 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
1716 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
1717 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
1718 (Powerpc_relocate_functions::has_overflow_bitfield,
1719 overflowed): Use the above.
1720 (Target_powerpc::Relocate::relocate): Correct overflow checking
1721 for a number of relocations. Modify overflow test for 16-bit
1722 fields in instructions to signed/unsigned according to whether
1723 the field takes a signed or unsigned value.
1724
1725 2014-03-05 Alan Modra <amodra@gmail.com>
1726
1727 Update copyright years.
1728
1729 2014-03-05 Alan Modra <amodra@gmail.com>
1730
1731 * powerpc.cc (Target_powerpc::Scan::local, global): Support
1732 R_PPC64_ADDR64_LOCAL.
1733 (Target_powerpc::Relocate::relocate): Likewise.
1734
1735 2014-03-03 Alan Modra <amodra@gmail.com>
1736
1737 * dwp.cc (print_version): Update copyright year to current.
1738
1739 2014-02-10 Alan Modra <amodra@gmail.com>
1740
1741 * po/gold.pot: Regenerate.
1742
1743 2014-02-06 Cary Coutant <ccoutant@google.com>
1744
1745 Fix problem where -u is ignored when a weak undef is seen.
1746
1747 * archive.cc (Library_base::should_include_member): Reorder
1748 code to check for -u option if a weak undef has already been seen.
1749 * testsuite/Makefile.am (weak_undef_test_2): New test case.
1750 * testsuite/Makefile.in: Regenerate.
1751 * testsuite/weak_undef_file3.cc: New file.
1752 * testsuite/weak_undef_file4.cc: New file.
1753 * testsuite/weak_undef_test_2.cc: New file.
1754
1755 2014-02-05 Cary Coutant <ccoutant@google.com>
1756
1757 Fix issues with gold undefined symbol diagnostics.
1758
1759 PR binutils/15435
1760 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
1761 check to here.
1762 * target-reloc.h (is_strong_undefined): New function.
1763 (relocate_section): Move undef vtable symbol check from here.
1764 Check for is_strong_undefined.
1765
1766 2014-02-05 Cary Coutant <ccoutant@google.com>
1767
1768 Fix problems with the --dynamic-list option.
1769
1770 PR gold/13577
1771 * options.cc (General_options::parse_dynamic_list):
1772 Set have_dynamic_list_.
1773 (General_options::General_options): Initialize have_dynamic_list_.
1774 (General_options::finalize): Turn off -Bsymbolic and
1775 -Bsymbolic-functions if --dynamic-list provided.
1776 * options.h (General_options::have_dynamic_list): New function.
1777 (General_options::have_dynamic_list_): New data member.
1778 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
1779 correctly.
1780
1781 PR gold/16530
1782 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
1783 in --dynamic-list, mark it.
1784
1785 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
1786 (dynamic_list_2): New test case.
1787 * testsuite/Makefile.in: Regenerate.
1788 * testsuite/dynamic_list_2.cc: New file.
1789 * testsuite/dynamic_list_2.t: New file.
1790 * testsuite/dynamic_list_lib1.cc: New file.
1791 * testsuite/dynamic_list_lib2.cc: New file.
1792 * testsuite/gc_dynamic_list_test.c: New file.
1793 * testsuite/gc_dynamic_list_test.sh: New file.
1794 * testsuite/gc_dynamic_list_test.t: New file.
1795
1796 2014-01-28 Cary Coutant <ccoutant@google.com>
1797
1798 Add .gdb_index version 7 support.
1799
1800 * gold/dwarf_reader.cc: include <utility> (for make_pair).
1801 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
1802 debug sections.
1803 (Dwarf_ranges_table::read_ranges_table): Likewise.
1804 (Dwarf_pubnames_table::read_section): Check for GNU-style
1805 sections, and for compressed debug sections.
1806 (Dwarf_pubnames_table::read_header): Compute end address of table.
1807 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
1808 for end of list by offset, not by offset == 0.
1809 (Dwarf_info_reader::do_read_string_table): Check for compressed
1810 debug sections.
1811 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1812 Initialize new data members.
1813 (Dwarf_pubnames_table::next_name): return flag_byte.
1814 (Dwarf_pubnames_table::end_of_table_): New data member.
1815 (Dwarf_pubnames_table::is_gnu_style_): New data member.
1816 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
1817 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
1818 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
1819 read skeleton type unit DIEs.
1820 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
1821 (Gdb_index::do_write): Write flag_byte.
1822 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
1823 (Gdb_index::Cu_vector): Store flags along with cu indexes.
1824 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
1825 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
1826
1827 2014-01-08 H.J. Lu <hongjiu.lu@intel.com>
1828
1829 * version.cc (print_version): Update copyright year to 2014.
1830
1831 2013-12-19 Dimitry Andric <dimitry@andric.com>
1832
1833 * stringpool.cc (Stringpool_template::reserve): Add
1834 HAVE_UNORDERED_MAP case.
1835 * stringpool.cc (Stringpool_template::print_stats): Likewise.
1836
1837 2013-12-18 Cary Coutant <ccoutant@google.com>
1838
1839 * configure.ac: Check for <unordered_set> and <unordered_map>.
1840 * config.in: Regenerate.
1841 * configure: Regenerate.
1842 * system.h: Use <unordered_set> and <unordered_map> if available.
1843
1844 2013-12-10 Roland McGrath <mcgrathr@google.com>
1845
1846 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
1847 with $(INSTALL_PROGRAM_ENV).
1848 * Makefile.in: Regenerate.
1849
1850 2013-11-22 Cary Coutant <ccoutant@google.com>
1851
1852 * configure.ac: Add check for which library is needed for
1853 dlopen.
1854 * configure: Regenerate.
1855
1856 2013-11-22 Cary Coutant <ccoutant@google.com>
1857
1858 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
1859 assembler.
1860 * testsuite/Makefile.in: Regenerate.
1861
1862 2013-11-17 H.J. Lu <hongjiu.lu@intel.com>
1863
1864 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
1865 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
1866 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
1867 (Target_x86_64<size>::Scan::local): Likewise.
1868 (Target_x86_64<size>::Scan::global): Likewise.
1869 (Target_x86_64<size>::Relocate::relocate): Likewise.
1870 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
1871 Likewise.
1872 (Target_x86_64<size>::Scan::check_non_pic(): Handle
1873 R_X86_64_PC32_BND.
1874
1875 * testsuite/Makefile.am (check_PROGRAMS): Add
1876 exception_x86_64_bnd_test.
1877 (exception_x86_64_bnd_test_SOURCES): New macro.
1878 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
1879 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
1880 (exception_x86_64_bnd_test_LDADD): Likewise.
1881 (exception_x86_64_bnd_1.o): New rule.
1882 (exception_x86_64_bnd_2.o): Likewise.
1883 * testsuite/Makefile.in: Regenerated.
1884
1885 2013-11-15 Alan Modra <amodra@gmail.com>
1886
1887 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
1888 accessor.
1889 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
1890 Only call ppc64_local_entry_offset for 64-bit. Restrict
1891 symval_for_branch lookup to ELFv1.
1892 (Stub_table::add_plt_call_entry): Use unsigned int off.
1893 (Output_data_glink::Address, invalid_address): New.
1894 (Output_data_glink::add_eh_frame): Move out of line. Add
1895 support for ELFv2.
1896 (Output_data_glink::add_global_entry, find_global_entry,
1897 global_entry_address): New functions.
1898 (Output_data_glink::global_entry_stubs_, end_branch_table_,
1899 ge_size): New variables.
1900 (Output_data_glink::set_final_data_size): Add global entry
1901 stub sizing.
1902 (Output_data_glink::do_write): Write global entry stubs.
1903 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
1904 parameter. Return true for ELFv2. Adjust callers.
1905 (Target_powerpc::Scan::local, global): Restrict opd lookup to
1906 ELFv1. Similarly for ifunc and dynamic relocation processing
1907 specific to ELFv1. Recognize that symbols are defined on
1908 their plt entries for ELFv2.
1909 (Target_powerpc::symval_for_branch): Assert if called for
1910 ELFv2 or ppc32.
1911 (Target_powerpc::Relocate::relocate): Use global entry plt
1912 stub for symbol value if such exists on ELFv2.
1913 (Target_powerpc::Relocate::relocate): Don't call
1914 symval_for_branch when ELFv2. Do adjust for local entry
1915 offset when ELFv2.
1916 (Target_powerpc::do_dynsym_value): Set symbols to global entry
1917 plt stub for ELFv2.
1918 (Target_powerpc::do_plt_address_for_global): Similarly.
1919
1920 2013-11-14 Cary Coutant <ccoutant@google.com>
1921
1922 Revert patch -- this did not fix the problem, and there is
1923 no race there.
1924
1925 2013-11-14 Cary Coutant <ccoutant@google.com>
1926
1927 PR gold/14860
1928 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1929 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1930 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1931 updating fde_offsets_.
1932 (Eh_frame_hdr::lock_): New data member.
1933
1934 2013-11-14 Cary Coutant <ccoutant@google.com>
1935
1936 * dwp.cc (Dwo_file_entry): New type.
1937 (File_list): Use Dwo_file_entry.
1938 (Dwo_file::verify): New function.
1939 (Dwo_file::verify_dwo_list): New function.
1940 (Dwo_file::sized_verify_dwo_list): New function.
1941 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
1942 list.
1943 (Dwp_options): New enum type.
1944 (dwp_options): Add --verify-only.
1945 (usage): Likewise.
1946 (main): Likewise.
1947 * dwp.h (gold_info): Add declaration.
1948
1949 2013-11-14 Cary Coutant <ccoutant@google.com>
1950
1951 PR gold/14860
1952 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1953 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1954 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1955 updating fde_offsets_.
1956 (Eh_frame_hdr::lock_): New data member.
1957
1958 2013-11-06 Cary Coutant <ccoutant@google.com>
1959
1960 PR gold/15758
1961 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
1962 before reloc sections.
1963
1964 2013-11-04 Alan Modra <amodra@gmail.com>
1965
1966 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
1967 (Symbol::needs_dynamic_reloc): Test new flag.
1968 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
1969 (Target_powerpc::Scan::get_reference_flags): Add target param.
1970 Return FUNC_DESC_ABI for 64-bit ELFv1.
1971 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
1972 call.
1973 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
1974 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
1975
1976 2013-10-31 Cary Coutant <ccoutant@google.com>
1977
1978 Restore support for dwp v2 DWARF package file format.
1979
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
2050 2013-10-31 Cary Coutant <ccoutant@google.com>
2051
2052 * configure.ac: Fix check for -fmerge-constants.
2053 * configure.ac: Regenerate.
2054
2055 2013-10-30 Roland McGrath <mcgrathr@google.com>
2056
2057 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
2058 Correct 9-byte nop sequence to match what the assembler generates.
2059
2060 2013-10-30 Alan Modra <amodra@gmail.com>
2061
2062 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
2063 ppc64_local_entry_offset, ppc64_local_entry_offset,
2064 do_read_symbols): New functions.
2065 (Powerpc_relobj::e_flags_, st_other_): New vars.
2066 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
2067 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
2068 (Powerpc_relobj::e_flags_): New var.
2069 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
2070 and adjust for ELFv2.
2071 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
2072 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
2073 (Powerpc_dynobj::do_find_special_sections): Likewise.
2074 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
2075 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
2076 to ELFv2 local entry.
2077 (Target_powerpc::do_relax): No thread safe barriers needed for
2078 ELFv2.
2079 (Output_data_plt_powerpc::initial_plt_entry_size_,
2080 plt_entry_size): Delete. Replace all uses with
2081 first_plt_entry_offset() and plt_entry_size().
2082 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
2083 reserved_size parm. Update callers.
2084 (Output_data_plt_powerpc::entry_count): Update.
2085 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
2086 and use Target_powerpc::first_plt_entry_offset().
2087 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
2088 rename to plt_entry_size.
2089 (Output_data_plt_powerpc::add_ifunc_entry,
2090 add_local_ifunc_entry): Adjust reloc for ELFv2.
2091 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
2092 (glink_eh_frame_fde_64v2): New.
2093 (Stub_table::plt_call_size): Support ELFv2 sizing.
2094 (Output_data_glink::add_eh_frame): Use the new FDE.
2095 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
2096 (Stub_table::do_write): Write ELFv2 stubs and glink.
2097 (Target_powerpc::Relocate::relocate): Replaces nop after call
2098 with ld 2,24(1) and adjust local offset destination for ELFv2.
2099
2100 2013-10-30 Alan Modra <amodra@gmail.com>
2101
2102 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
2103 (Target_powerpc::Scan::global, local): Likewise.
2104 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
2105 on all ppc64 @h and @ha relocs.
2106
2107 2013-10-14 Alan Modra <amodra@gmail.com>
2108
2109 * output.h (Output_data_got::add_constant): Tidy.
2110 (Output_data_got::add_constant_pair): New function.
2111 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
2112 methods used so as to first call reserve_ent().
2113
2114 2013-10-11 Roland McGrath <mcgrathr@google.com>
2115
2116 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
2117 add_got_entry and add_got_entry_pair.
2118
2119 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
2120 (HAVE_PUBNAMES): Likewise.
2121 * configure: Regenerate.
2122
2123 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
2124 * testsuite/Makefile.in: Regenerate.
2125
2126 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
2127 Remove const from declaration.
2128 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
2129 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
2130 * output.h (Output_file_header): Remove const from member target_
2131 and corresponding constructor argument.
2132 * output.cc (Output_file_header::Output_file_header): Update prototype.
2133 (Output_file_header::do_sized_write): Use this->target_ in place
2134 of parameters()->target().
2135
2136 * testsuite/undef_symbol.cc (Foo::get_a): New method.
2137
2138 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
2139 * configure: Regenerate.
2140 * Makefile.in: Regenerate.
2141 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
2142 * testsuite/merge_string_literals_2.c: Likewise.
2143 * testsuite/Makefile.am
2144 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
2145 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
2146 literal -fmerge-constants.
2147 * testsuite/Makefile.in: Regenerate.
2148
2149 * i386.cc (Target_i386): Remove unused member dynbss_.
2150 * arm.cc (Target_arm): Likewise.
2151 * powerpc.cc (Target_powerpc): Likewise.
2152 * sparc.cc (Target_sparc): Likewise.
2153 * tilegx.cc (Target_tilegx): Likewise.
2154 * x86_64.cc (Target_x86_64): Likewise.
2155 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
2156 type_signature_, type_offset_.
2157 * plugin.h (Plugin_hook): Remove unused member layout_.
2158 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
2159 mapfile_.
2160 (Read_member): Remove unused members input_objects_, symtab_,
2161 mapfile_, layout_.
2162 (Check_library): Remove unused member symtab_.
2163 * archive.h (Lib_group): Remove unused member lib_.
2164 * archive.cc (Lib_group::Lib_group): Update initializer.
2165 * incremental.h (Incremental_binary): Remove unused member target_.
2166 (Incremental_script_entry): Removed unused member script_.
2167 * layout.h (Write_symbols_task): Remove unused member input_objects_.
2168 * icf.h (Icf): Remove unused member num_tracked_relocs.
2169
2170 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
2171 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
2172 its only use.
2173 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
2174
2175 * archive.h: Use struct rather than class for forward declaration
2176 of Read_symbols_data.
2177
2178 2013-10-07 Cary Coutant <ccoutant@google.com>
2179
2180 PR gold/16010
2181 * testsuite/Makefile.am (icf_test): Fix dependencies.
2182 (icf_safe_test): Likewise.
2183 (icf_safe_so_test): Likewise.
2184 (large_symbol_alignment): Add empty _LDADD rule.
2185 * testsuite/Makefile.in: Regenerate.
2186
2187 2013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
2188
2189 PR gold/15927
2190 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
2191 relocation for R_X86_64_32 on x32.
2192
2193 2013-08-27 Roland McGrath <mcgrathr@google.com>
2194
2195 * output.cc (Output_segment::set_section_addresses): Take new
2196 Target* argument. If target->isolate_execinstr() and the segment
2197 is executable and starts at a target->abi_pagesize() boundary,
2198 pad its end out to a target->abi_pagesize() boundary with code fill.
2199 * output.h (Output_segment::set_section_addresses): Update decl.
2200 * layout.h (Layout::check_output_data_for_reset_values): Take new
2201 argument RELAX_OUTPUTS.
2202 (Layout): New member relax_output_list_.
2203 (Layout::add_relax_output): New method.
2204 * layout.cc (Layout::Layout): Update constructor.
2205 (Layout::reset_relax_output): New method.
2206 (Layout::clean_up_after_relaxation): Call it.
2207 (Layout::prepare_for_relaxation): Update caller.
2208 (Layout::set_segment_offsets): Update callers of set_section_addresses.
2209 Call reset_relax_output before re-processing segments for
2210 isolate_execinstr case.
2211 (Layout::write_data): Handle relax_output_list_.
2212 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
2213 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
2214
2215 2013-08-23 Yuri Chornoivan <yurchor@ukr.net>
2216
2217 PR binutils/15834
2218 * object.h: Fix typos.
2219
2220 2013-08-16 Roland McGrath <mcgrathr@google.com>
2221
2222 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
2223 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
2224
2225 2013-08-07 Cary Coutant <ccoutant@google.com>
2226
2227 Revert support for v2 DWP files:
2228
2229 2013-03-01 Cary Coutant <ccoutant@google.com>
2230
2231 Add dwp support for v2 DWARF package file format.
2232 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2233 tu_length parameter. Adjust all callers.
2234 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2235 * dwp.cc: Include dwarf.h.
2236 (Section_bounds): New struct type.
2237 (Unit_set): New struct type.
2238 (Dwo_file::Dwo_file): Initialize new data member.
2239 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2240 Combine and rename to...
2241 (Dwo_file::read_unit_index): ...this.
2242 (Dwo_file::sized_read_compunit_index)
2243 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2244 (Dwo_file::sized_read_unit_index): ...this.
2245 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2246 parameters; add section_id parameter.
2247 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2248 (Dwo_file::add_unit_set): ...this.
2249 (Dwo_file::shndx_map_): Remove.
2250 (Dwo_file::sect_offsets_): New data member.
2251 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2252 (Dwp_output_file::add_section): Rename to...
2253 (Dwp_output_file::add_contribution): ...this.
2254 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2255 (Dwp_output_file::add_tu_set): Likewise.
2256 (Dwp_output_file::Contribution): New type.
2257 (Dwp_output_file::Section::contributions): New data member.
2258 (Dwp_output_file::Cu_or_tu_set): Remove.
2259 (Dwp_output_file::Section::Section): New ctor.
2260 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2261 (Dwp_output_file::Dwp_index::Section_table): New type.
2262 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2263 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2264 parameter.
2265 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2266 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2267 (Dwp_output_file::Dwp_index::section_table): New member function.
2268 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2269 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2270 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2271 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2272 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2273 (Dwp_output_file::Dwp_index::section_table_): New data member.
2274 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2275 (Dwp_output_file::add_output_section): New member function.
2276 (Dwp_output_file::write_new_section): New member function.
2277 (Dwp_output_file::write_contributions): New member function.
2278 (Dwp_output_file::section_id_map_): New data member.
2279 (class Dwo_id_info_reader): Remove.
2280 (class Unit_reader): New class.
2281 (get_dwarf_section_name): New function.
2282 (Dwo_file::read_executable): Adjust initializations of class data.
2283 (Dwo_file::read): Add support for v2 package file format.
2284 (Dwo_file::read_unit_index): Likewise.
2285 (Dwo_file::sized_read_unit_index): Likewise.
2286 (Dwo_file::copy_section): Likewise.
2287 (Dwo_file::add_unit_set): Likewise.
2288 (Dwp_output_file::add_output_section): Likewise.
2289 (Dwp_output_file::add_contribution): Likewise.
2290 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2291 for empty slot.
2292 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2293 file format.
2294 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2295 slot.
2296 (Dwp_output_file::initialize): Remove unused function.
2297 (Dwp_output_file::finalize): Add support for v2 package file format.
2298 (Dwp_output_file::write_index): Likewise.
2299 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2300 function prototype.
2301
2302 2013-07-31 Cary Coutant <ccoutant@google.com>
2303
2304 * object.cc (Sized_relobj::do_output_section_address): New function.
2305 (Sized_relobj): Instantiate explicitly.
2306 * object.h (Object::output_section_address): New function.
2307 (Object::do_output_section_address): New function.
2308 (Sized_relobj::do_output_section_address): New function.
2309 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
2310
2311 2013-07-30 Cary Coutant <ccoutant@google.com>
2312 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2313
2314 * parameters.cc (Parameters::entry): Return target-specific entry
2315 symbol name.
2316 * target.h (Target::entry_symbol_name): New function.
2317 (Target_info::entry_symbol_name): New data member.
2318
2319 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
2320 * i386.cc (Target_i386::i386_info): Likewise.
2321 (Target_i386_nacl::i386_nacl_info): Likewise.
2322 * sparc.cc (Target_sparc::sparc_info): Likewise.
2323 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
2324 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
2325 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
2326 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2327
2328 2013-07-22 Sterling Augustine <saugustine@google.com>
2329
2330 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
2331 Convert parameter shndx to local variable. Add parameters symtab
2332 and symtab_size. Scan over section names. Find relocation
2333 section corresponding to current section. Create and initialize
2334 reloc_mapper_ and reloc_type_.
2335 (Dwarf_pubnames_table::read_header): Add assertion. Change
2336 unit_length to off_t. Initialize member unit_length_. Fill in field
2337 cu_offset_.
2338 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2339 Initialize new fields unit_length_ and cu_offset_.
2340 (Dwarf_pubnames_table::read_section): Update prototype.
2341 (Dwarf_pubnames_table::cu_offset): New member function.
2342 (Dwarf_pubnames_table::subsection_size): Likewise.
2343 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
2344 New fields.
2345 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
2346 member functions public.
2347 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
2348 Update comment. Rework logic. Move repeated parts to...
2349 (Gdb_index_info_reader::read_pubtable): ...here. New function.
2350 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
2351 pubtypes_table_, and stmt_list_offset.
2352 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2353 Gdb_index::find_pubtype_offset,
2354 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
2355 (Gdb_index::pubnames_read): Update prototype and rework logic.
2356 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
2357 Forward declare.
2358 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2359 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
2360 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
2361 Gdb_index::map_pubtable_to_dies):
2362 Declare functions.
2363 (Gdb_index::pubnames_read): Update declaration.
2364 (Gdb_index::Pubname_offset_map): New type.
2365 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
2366 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
2367 Gdb_index::stmt_list_offset): Declare.
2368 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
2369 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
2370 Gdb_index::pubtypes_offset_): Remove.
2371
2372 2013-07-19 Roland McGrath <mcgrathr@google.com>
2373
2374 * options.h (General_options): Add -Trodata-segment option.
2375 * parameters.cc (Parameters::check_rodata_segment): New function.
2376 (Parameters::set_target_once): Call it.
2377 * parameters.h (Parameters): Declare it (private member function).
2378 * layout.cc (load_seg_unusable_for_headers): New function, broken
2379 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
2380 then validate rodata segment rather than text segment.
2381 (relaxation_loop_body): Call that.
2382 (is_text_segment): New function. Don't admit a non-executable
2383 segment if TARGET->isolate_execinstr().
2384 (set_segment_offsets): Call it. Honor -Trodata-segment option.
2385
2386 2013-07-15 Shawn Landden <shawnlandden@gmail.com>
2387
2388 PR gold/15070
2389 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
2390 * nacl.h (Sniff_file::View::View): Request aligned view.
2391
2392 2013-07-11 Cary Coutant <ccoutant@google.com>
2393
2394 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
2395 correct BRLT entry size.
2396
2397 2013-07-03 Alan Modra <amodra@gmail.com>
2398
2399 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
2400 comment.
2401
2402 2013-07-01 Cary Coutant <ccoutant@google.com>
2403
2404 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
2405 reloc_type_.
2406 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
2407 (Dwarf_ranges_table::lookup_reloc): New function.
2408 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
2409 reloc_type_.
2410 (Dwarf_ranges_table::lookup_reloc): New function.
2411 (Dwarf_ranges_table::reloc_type_): New data member.
2412
2413 2013-06-27 Jing Yu <jingyu@google.com>
2414
2415 PR gold/15662
2416 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
2417 function.
2418 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
2419 (Target_powerpc::do_relax): Call the above.
2420
2421 2013-06-27 Cary Coutant <ccoutant@google.com>
2422
2423 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
2424 on garbage collected .opd section.
2425
2426 2013-06-27 Alan Modra <amodra@gmail.com>
2427
2428 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
2429 is non-zero.
2430 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
2431 (Target_powerpc::do_function_location): Likewise for loc->shndx.
2432
2433 2013-06-14 Cary Coutant <ccoutant@google.com>
2434
2435 * resolve.cc (Symbol::override_base): Don't override st_type
2436 from plugin placeholder symbols.
2437 (Symbol_table::resolve): Likewise.
2438 (Symbol_table::should_override): Don't complain about TLS mismatch
2439 if the TO symbol is a plugin placeholder.
2440 * testsuite/Makefile.am (plugin_test_tls): New test.
2441 * testsuite/Makefile.in: Regenerate.
2442 * testsuite/plugin_test_tls.sh: New test script.
2443 * testsuite/two_file_test_2_tls.cc: New test source.
2444 * testsuite/two_file_test_tls.cc: New test source.
2445
2446 2013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
2447
2448 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
2449 the maximum segment alignment is larger than the page size.
2450 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
2451 correctly aligns the symbols with large alignemnt.
2452 * testsuite/Makefile.in: Regenerate.
2453 * testsuite/large_symbol_alignment.cc: New file.
2454
2455 2013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
2456 Sriraman Tallam <tmsriram@google.com>
2457
2458 * options.h (sort_section): New option.
2459 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
2460 Rename from Input_section_sort_section_name_special_ordering_compare.
2461 (Input_section_sort_section_name_compare): New struct.
2462 * output.cc (Output_section::Input_section_sort_section_name_compare::
2463 operator()): New function.
2464 (Output_section::sort_attached_input_sections): Use new sort function
2465 for .text if --sort-section=name is specified.
2466 * layout.cc (Layout::make_output_section):
2467 Add sorting by name when --sort-section=name is specified.
2468 * testsuite/Makefile.am (text_section_grouping): Test option
2469 --sort-section=name.
2470 * testsuite/Makefile.in: Regenerate.
2471 * testsuite/section_sorting_name.cc: New file.
2472 * testsuite/section_sorting_name.sh: New file.
2473
2474 2013-05-21 Cary Coutant <ccoutant@google.com>
2475
2476 * symtab.h (Symbol::is_cxx_vtable): New function.
2477 * target-reloc.h (relocate_section): Check for vtable symbol.
2478 * testsuite/Makefile.am (missing_key_func.sh): New test case.
2479 * testsuite/Makefile.in: Regenerate.
2480 * testsuite/missing_key_func.cc: New test source.
2481 * testsuite/missing_key_func.sh: New test script.
2482
2483 2013-05-21 Cary Coutant <ccoutant@google.com>
2484
2485 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
2486 type of enclosing symbol.
2487 (Relocate_info::location): Check symbol type when describing symbol.
2488 * object.h (Symbol_location_info): Remove unused line_number;
2489 add enclosing_symbol_type.
2490 * testsuite/debug_msg.sh: Adjust expected output.
2491
2492 2013-05-13 Cary Coutant <ccoutant@google.com>
2493
2494 * configure.ac: Export DEFAULT_TARGET.
2495 * configure: Regenerate.
2496 * Makefile.in: Regenerate.
2497 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
2498 * testsuite/Makefile.in: Regenerate.
2499 * testsuite/debug_msg.sh: Delete duplicate tests.
2500 Don't check undef_int error message match for powerpc where the
2501 source file and line number aren't available.
2502
2503 2013-05-10 Roland McGrath <mcgrathr@google.com>
2504
2505 * options.h (General_options): Add --rosegment-gap option.
2506 * options.cc (finalize): --rosegment-gap implies --rosegment.
2507 * layout.cc (set_segment_offsets): Let user option override
2508 target->rosegment_gap().
2509
2510 2013-05-10 Roland McGrath <mcgrathr@google.com>
2511
2512 * options.h (General_options): Remove leading space from help
2513 messages for -nostdlib and --rosegment.
2514
2515 2013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
2516
2517 PR ld/15365
2518 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
2519
2520 2013-05-03 Alan Modra <amodra@gmail.com>
2521
2522 * merge.cc (Output_merge_string::do_add_input_section): Correct
2523 scan for number of strings. Rename vars to avoid shadowing.
2524 Include missing terminator in input_size_.
2525
2526 2013-05-01 H.J. Lu <hongjiu.lu@intel.com>
2527
2528 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
2529 Restore empty string handling.
2530
2531 2013-05-01 Cary Coutant <ccoutant@google.com>
2532
2533 * stringpool.cc (Stringpool_template::new_key_offset): Fix
2534 uninitialized warning.
2535
2536 2013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
2537
2538 * output.cc (Output_section::add_merge_input_section): Allow
2539 to merge sections if the alignment is more than character size.
2540 * merge.h (Output_merge_string::Output_merge_string): Remove
2541 assert.
2542 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
2543 only not-null strings. Check the alignment of strings.
2544 * stringpool.h
2545 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
2546 alignment as the argument.
2547 (Stringpool_template<Stringpool_char>::addralign_): New class member.
2548 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
2549 Align non-zero length strings according to the addralign_.
2550 (Stringpool_template<Stringpool_char>::set_string_offsets):
2551 Updating offsets according to the given alignment.
2552 * testsuite/Makefile.am (text_section_grouping): Test if string
2553 literals are getting merged.
2554 * testsuite/Makefile.in: Regenerate.
2555 * testsuite/merge_string_literals_1.c: New file.
2556 * testsuite/merge_string_literals_2.c: Ditto.
2557 * testsuite/merge_string_literals.sh: Ditto.
2558
2559 2013-04-26 Ian Lance Taylor <iant@google.com>
2560
2561 * target-reloc.h (relocate_section): If the reloc offset is out of
2562 range, pass VIEW as NULL to relocate.relocate.
2563 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
2564 * i386.cc (Target_i386::Relocate::relocate): Likewise.
2565 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
2566 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
2567 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
2568 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
2569
2570 2013-04-26 Geoff Pike <gpike@chromium.org>
2571
2572 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
2573 * layout.cc (Hash_task): New class.
2574 (Layout::queue_build_id_tasks): New function.
2575 (Layout::write_build_id): Handle single-thread portion of build ID
2576 computation. (In some cases, all of it is single-threaded.) Replace
2577 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
2578 functionality in fewer lines of code.
2579 * layout.h (Layout::queue_build_id_tasks): New function declaration.
2580 * options.h (General_options): make "--build-id" default to tree
2581 rather than sha1. Add two new options related to --build-id=tree:
2582 --build-id-chunk-size-for-treehash and
2583 --build-id-min-file-size-for-treehash.
2584 * Makefile.am: add testing of --build-id=tree and related new options
2585 (these tests will be invoked by "make check").
2586 * Makefile.in: Regenerate.
2587
2588 2013-04-25 Alan Modra <amodra@gmail.com>
2589
2590 * configure.tgt: Add powerpcle and powerpc64le.
2591
2592 2013-04-22 Alan Modra <amodra@gmail.com>
2593
2594 PR gold/15355
2595 * layout.cc (Layout::segment_precedes): Allow more than one
2596 segment with the same type and flags.
2597
2598 2013-04-15 Cary Coutant <ccoutant@google.com>
2599
2600 * layout.cc (Layout::set_relocatable_section_offsets): Don't
2601 allocate space in file for BSS sections.
2602
2603 2013-04-15 Cary Coutant <ccoutant@google.com>
2604
2605 * script-sections.cc (Orphan_output_section): Reset address
2606 to zero after each orphaned section for relocatable links.
2607
2608 2013-04-15 Cary Coutant <ccoutant@google.com>
2609
2610 * symtab.cc (Symbol_table::sized_write_globals): Subtract
2611 section starting address for relocatable link.
2612 * testsuite/Makefile.am (script_test_11): New test.
2613 * testsuite/Makefile.in: Regenerate.
2614 * testsuite/script_test_11.c: New source file.
2615 * testsuite/script_test_11.t: New linker script.
2616
2617 2013-04-13 Alan Modra <amodra@gmail.com>
2618
2619 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
2620 owner when sections are not adjacent and exceed group size.
2621 (Target_powerpc::group_sections): Handle corner case.
2622 (Target_powerpc::Branch_info::make_stub): Handle case where
2623 stub table doesn't exist due to branches in non-exec sections.
2624 (Target_powerpc::Relocate::relocate): Likewise.
2625
2626 2013-04-11 Alan Modra <amodra@gmail.com>
2627
2628 PR gold/15354
2629 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
2630 .branch_lt to match bfd ld. Adjust comments throughout file.
2631
2632 2013-04-04 Ian Lance Taylor <iant@google.com>
2633
2634 GCC PR c++/56840
2635 * object.cc (do_layout_deferred_sections): Handle .eh_frame
2636 sections before checking whether they are included in the link.
2637
2638 2013-03-29 Sriraman Tallam <tmsriram@google.com>
2639
2640 * archive.cc (Archive::get_elf_object_for_member): Create the elf
2641 object before calling the plugin claim_file handler. Pass the elf
2642 object of the archive to the plugin. Delete the elf object if the
2643 plugin claims the file.
2644
2645 2013-03-21 Alan Modra <amodra@gmail.com>
2646
2647 * layout.cc (Layout::set_segment_offsets): Accept writable .text
2648 segment when omagic.
2649
2650 2013-03-21 Alan Modra <amodra@gmail.com>
2651
2652 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
2653 comparison warning.
2654 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
2655 uninitialized" warning.
2656
2657 2013-03-20 Alan Modra <amodra@gmail.com>
2658
2659 * symtab.h (Symbol::clear_version): New function.
2660 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
2661 is_needed by weak references. Clear version for symbols defined
2662 in as-needed objects that are not needed.
2663
2664 2013-03-15 Alan Modra <amodra@gmail.com>
2665
2666 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
2667 static and public. Add report_err param. Return false for data refs.
2668 (Target_powerpc::rela_dyn_section): New overloaded function.
2669 (Target_powerpc::plt_, iplt_): Elucidate.
2670 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
2671 (Output_data_plt_powerpc::do_write): Don't write .iplt.
2672 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
2673 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
2674 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
2675 push_branch and make_plt_entry for ifunc syms when
2676 reloc_needs_plt_for_ifunc.
2677 (Target_powerpc::Relocate::relocate): Don't use plt entry value
2678 for ifunc unless reloc_needs_plt_for_ifunc.
2679
2680 2013-03-15 Alan Modra <amodra@gmail.com>
2681
2682 * gc.h (gc_process_relocs): Don't look through function descriptors.
2683 * icf.cc (get_section_contents): Do so here instead.
2684
2685 2013-03-13 Alan Modra <amodra@gmail.com>
2686
2687 * powerpc.cc (is_branch_reloc): Forward declare.
2688 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
2689 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
2690 false for 64-bit, true for 32-bit non-branch relocs.
2691 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
2692 * testsuite/Makefile.am (icf_test): Use linker map file instead of
2693 nm output.
2694 (icf_safe_test): Generate linker map file as well as nm output.
2695 (icf_safe_so_test): Likewise.
2696 * testsuite/Makefile.in: Regenerate.
2697 * testsuite/icf_test.sh: Parse linker map file to determine
2698 section folding.
2699 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
2700 * testsuite/icf_safe_so_test.sh: Likewise.
2701 (X86_32_or_ARM_specific_safe_fold): Merge into..
2702 (arch_specific_safe_fold): ..this.
2703 (X86_64_specific_safe_fold): Delete unused function.
2704
2705 2013-03-12 Alan Modra <amodra@gmail.com>
2706
2707 * gc.h (gc_process_relocs): Look through function descriptors
2708 to determine shndx, symvalue and addend used by ICF. Tidy
2709 variable duplication.
2710
2711 2013-03-11 Alan Modra <amodra@gmail.com>
2712
2713 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
2714 * layout.cc (Layout_task_runner::run): ..to here.
2715 * symtab.h (struct Symbol_location): Extract from..
2716 (class Symbol_table): ..here.
2717 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
2718 * target.h (class Target): Add function_location and
2719 do_function_location functions.
2720 (class Sized_target): Add do_function_location.
2721 * object.h (class Sized_relobj_file): Move find_shdr..
2722 (class Object): ..to here.
2723 * object.cc: Likewise. Update to suit. Instantiate.
2724 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
2725 * powerpc.cc (class Powerpc_dynobj): New.
2726 (Target_powerpc::do_function_location): New function.
2727 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
2728 (Powerpc_dynobj::do_read_symbols): New function.
2729 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
2730
2731 2013-03-08 Ian Lance Taylor <iant@google.com>
2732
2733 * options.cc (General_options::string_to_object_format): Accept
2734 "default".
2735
2736 2013-03-08 Alan Modra <amodra@gmail.com>
2737
2738 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
2739 pointer to Post_fde.
2740 (struct Post_fde): Move definition to here..
2741 * ehframe.cc (struct Post_fde): ..from here.
2742 (Cie::write): Don't alloc Post_fde.
2743 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
2744
2745 2013-03-07 Alan Modra <amodra@gmail.com>
2746
2747 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
2748 relocation referencing .LC0.
2749 * testsuite/discard_locals_test.sh: Remove FIXMEs.
2750
2751 2013-03-07 Alan Modra <amodra@gmail.com>
2752
2753 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
2754 always_inline. Add assembly for powerpc to avoid GOT.
2755
2756 2013-03-07 Alan Modra <amodra@gmail.com>
2757
2758 * testsuite/script_test_10.sh: Don't test .bss section
2759 header number.
2760
2761 2013-03-06 Alan Modra <amodra@gmail.com>
2762
2763 * powerpc.cc (class Powerpc_relobj): Move some member functions.
2764 (Target_powerpc::symval_for_branch): Add symtab param. Update
2765 all callers. Handle folded sections.
2766 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
2767 to Powerpc_relobj.
2768 (Global_symbol_visitor_opd::operator()): Likewise.
2769
2770 2013-03-04 Alan Modra <amodra@gmail.com>
2771
2772 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
2773 * testsuite/Makefile.in: Regenerate.
2774
2775 2013-03-01 Cary Coutant <ccoutant@google.com>
2776
2777 Add dwp support for v2 DWARF package file format.
2778 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2779 tu_length parameter. Adjust all callers.
2780 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2781 * dwp.cc: Include dwarf.h.
2782 (Section_bounds): New struct type.
2783 (Unit_set): New struct type.
2784 (Dwo_file::Dwo_file): Initialize new data member.
2785 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2786 Combine and rename to...
2787 (Dwo_file::read_unit_index): ...this.
2788 (Dwo_file::sized_read_compunit_index)
2789 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2790 (Dwo_file::sized_read_unit_index): ...this.
2791 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2792 parameters; add section_id parameter.
2793 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2794 (Dwo_file::add_unit_set): ...this.
2795 (Dwo_file::shndx_map_): Remove.
2796 (Dwo_file::sect_offsets_): New data member.
2797 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2798 (Dwp_output_file::add_section): Rename to...
2799 (Dwp_output_file::add_contribution): ...this.
2800 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2801 (Dwp_output_file::add_tu_set): Likewise.
2802 (Dwp_output_file::Contribution): New type.
2803 (Dwp_output_file::Section::contributions): New data member.
2804 (Dwp_output_file::Cu_or_tu_set): Remove.
2805 (Dwp_output_file::Section::Section): New ctor.
2806 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2807 (Dwp_output_file::Dwp_index::Section_table): New type.
2808 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2809 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2810 parameter.
2811 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2812 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2813 (Dwp_output_file::Dwp_index::section_table): New member function.
2814 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2815 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2816 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2817 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2818 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2819 (Dwp_output_file::Dwp_index::section_table_): New data member.
2820 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2821 (Dwp_output_file::add_output_section): New member function.
2822 (Dwp_output_file::write_new_section): New member function.
2823 (Dwp_output_file::write_contributions): New member function.
2824 (Dwp_output_file::section_id_map_): New data member.
2825 (class Dwo_id_info_reader): Remove.
2826 (class Unit_reader): New class.
2827 (get_dwarf_section_name): New function.
2828 (Dwo_file::read_executable): Adjust initializations of class data.
2829 (Dwo_file::read): Add support for v2 package file format.
2830 (Dwo_file::read_unit_index): Likewise.
2831 (Dwo_file::sized_read_unit_index): Likewise.
2832 (Dwo_file::copy_section): Likewise.
2833 (Dwo_file::add_unit_set): Likewise.
2834 (Dwp_output_file::add_output_section): Likewise.
2835 (Dwp_output_file::add_contribution): Likewise.
2836 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2837 for empty slot.
2838 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2839 file format.
2840 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2841 slot.
2842 (Dwp_output_file::initialize): Remove unused function.
2843 (Dwp_output_file::finalize): Add support for v2 package file format.
2844 (Dwp_output_file::write_index): Likewise.
2845 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2846 function prototype.
2847
2848 2013-03-01 Cary Coutant <ccoutant@google.com>
2849
2850 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
2851 function into class definition in header file.
2852 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
2853 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
2854 New function.
2855 (Dwarf_info_reader::check_buffer): Move here from .cc file.
2856
2857 2013-02-28 Alan Modra <amodra@gmail.com>
2858
2859 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
2860 * target.cc (Target::do_plt_fde_location): New function.
2861 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
2862 accessor function, and constructor param.
2863 (struct Post_fde, Post_fdes): Declare.
2864 (Cie::write): Add post_fdes param.
2865 * ehframe.cc (Fde::write): Use plt_fde_location.
2866 (struct Post_fde): Define.
2867 (Cie::write): Stash FDEs added post merge mapping.
2868 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
2869 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
2870 (Eh_frame::do_sized_write): Arrange to write post map FDES after
2871 other FDEs.
2872 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
2873 (Target_powerpc::has_glink): New function.
2874 (Target_powerpc::do_relax): Add eh_frame info for stubs.
2875 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
2876 glink_eh_frame_fde_32, default_fde): New data.
2877 (Stub_table::eh_frame_added_): New var.
2878 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
2879 Make const.
2880 (Stub_table::add_eh_frame): New function.
2881 (Output_data_glink::add_eh_frame): New function.
2882 (Target_powerpc::make_glink_section): Call add_eh_frame.
2883
2884 2013-02-15 Ian Lance Taylor <iant@google.com>
2885
2886 * options.h (DEFINE_uint64_alias): Define.
2887 (class General_options): Add -Ttext-segment as an alias for
2888 -Ttext.
2889
2890 2013-02-15 Alan Modra <amodra@gmail.com>
2891
2892 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
2893 (Stub_table::do_write): ..here, two places.
2894 (Stub_table::plt_call_size): Use it here too.
2895
2896 2013-02-11 Ian Lance Taylor <iant@google.com>
2897
2898 * descriptors.cc (Descriptors::close_all): New function.
2899 * descriptors.h (class Descriptors): Declare close_all.
2900 (close_all_descriptors): New inline function.
2901 * plugin.cc: Include "descriptors.h".
2902 (Plugin_manager::cleanup): Call close_all_descriptors.
2903
2904 2013-02-06 Alan Modra <amodra@gmail.com>
2905
2906 * README: Update coding style link.
2907
2908 2013-01-28 Cary Coutant <ccoutant@google.com>
2909
2910 * dwp.cc (File_list): New typedef.
2911 (Dwo_name_info_reader): New class.
2912 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
2913 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
2914 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
2915 (Dwo_file::read_executable): New function.
2916 (Dwo_file::read): Move common setup code to ...
2917 (Dwo_file::make_object): ... here.
2918 (dwp_options): Add --exec/-e.
2919 (usage): Likewise.
2920 (main): Likewise.
2921
2922 2013-01-24 Sriraman Tallam <tmsriram@google.com>
2923
2924 * layout.cc (Layout::layout): Check for option text_reorder.
2925 (Layout::make_output_section): Ditto.
2926 * options.h (text_reorder): New option.
2927 * output.cc (Input_section_sort_compare): Remove special ordering
2928 of section names.
2929 (Output_section::
2930 Input_section_sort_section_name_special_ordering_compare::
2931 operator()): New function.
2932 (Output_section::sort_attached_input_sections): Use new sort function
2933 for .text.
2934 * output.h (Input_section_sort_section_name_special_ordering_compare):
2935 New struct.
2936 * testsuite/Makefile.am (text_section_grouping): Test option
2937 --no-text-reorder
2938 * testsuite/Makefile.in: Regenerate.
2939 * testsuite/text_section_grouping.sh: Check order of functions without
2940 default text reordering.
2941
2942 2013-01-18 Mike Frysinger <vapier@gentoo.org>
2943
2944 * options.h (General_options): Change default to true for new_dtags.
2945
2946 2013-01-18 Mike Frysinger <vapier@gentoo.org>
2947
2948 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
2949 when enable_new_dtags is false. Only add DT_RUNPATH when
2950 enable_new_dtags is true.
2951
2952 2013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
2953
2954 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
2955 used in declaration and definition consistent.
2956 (Target_powerpc::symval_for_branch): Ditto.
2957
2958 2013-01-16 Sriraman Tallam <tmsriram@google.com>
2959
2960 * testsuite/plugin_final_layout.cc: Fix comment.
2961
2962 2013-01-16 Sriraman Tallam <tmsriram@google.com>
2963
2964 * layout.cc (Layout::layout): Do not do default sorting for
2965 text sections when section ordering is specified.
2966 (make_output_section): Ditto.
2967 * testsuite/plugin_final_layout.cc: Name the function sections
2968 to catch reordering issues.
2969
2970 2013-01-15 Alan Modra <amodra@gmail.com>
2971
2972 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
2973 plt-thread-safe.
2974
2975 2013-01-15 Alan Modra <amodra@gmail.com>
2976
2977 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
2978 * testsuite/Makefile.in: Regenerate.
2979
2980 2013-01-14 Alan Modra <amodra@gmail.com>
2981
2982 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
2983 * testsuite/Makefile.in: Regenerate.
2984
2985 2013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
2986
2987 PR bfd/14430
2988 Fix mingw gold build with plugins enabled
2989 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
2990 * configure.ac: Export DLOPEN_LIBS and add headers check.
2991 * plugin.cc: Handle non-dlfcn case.
2992 * Makefile.in: Regenerate.
2993 * config.in: Regenerate.
2994 * configure: Regenerate.
2995 * testsuite/Makefile.in: Regenerate.
2996
2997 2013-01-09 Sriraman Tallam <tmsriram@google.com>
2998
2999 * output.h (sort_attached_input_sections): Change to be public.
3000 * script-sections.cc
3001 (Output_section_definition::set_section_addresses): Sort
3002 attached input sections according to section order before linker
3003 script assigns section addresses.
3004 (Orphan_output_section::set_section_addresses): Sort
3005 attached input sections according to section order before linker
3006 script assigns section addresses.
3007 * Makefile.am (final_layout.sh): Use a simple linker script to
3008 check if section ordering still works.
3009 * Makefile.in: Regenerate.
3010
3011 2013-01-09 Ben Cheng <bccheng@google.com>
3012
3013 * arm.cc (Target_arm::attributes_accept_div): New function.
3014 (Target_arm::attributes_forbid_div): New function.
3015 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
3016 attribute using the same new functions as what bfd/elf32_arm.c
3017 does.
3018
3019 2013-01-07 Cary Coutant <ccoutant@google.com>
3020
3021 PR gold/14993
3022 * output.cc (Output_section::add_input_section): For incremental
3023 updates, don't track input sections that are allocated from patch
3024 space.
3025
3026 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3027 Ian Lance Taylor <iant@google.com>
3028
3029 PR gold/14897
3030 * configure.ac (--enable-ld): Removed.
3031 (install_as_default): Set to yes only for --enable-gold=default
3032 or --disable-ld.
3033 * configure: Regenerated.
3034
3035 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3036
3037 * options.h (General_options): Add -fuse-ld= for GCC linker
3038 option compatibility.
3039
3040 2013-01-04 Cary Coutant <ccoutant@google.com>
3041
3042 * configure.ac: Fix typo restoring CXXFLAGS.
3043 * configure: Regenerate.
3044
3045 2013-01-04 Cary Coutant <ccoutant@google.com>
3046
3047 * testsuite/Makefile.am (CXXLINK_S): New macro.
3048 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
3049 * testsuite/Makefile.in: Regenerate.
3050
3051 2013-01-02 H.J. Lu <hongjiu.lu@intel.com>
3052
3053 * version.cc (print_version): Update copyright year to 2013.
3054
3055 2012-12-20 Ian Lance Taylor <iant@google.com>
3056
3057 * layout.cc (Layout::special_ordering_of_input_section): New
3058 function.
3059 (Layout::layout): If input section requires special ordering, must
3060 sort input sections.
3061 (Layout::make_output_section): May sort .text input sections.
3062 (Layout::is_section_name_prefix_grouped): Remove.
3063 * layout.h (class Layout): Declare
3064 special_ordering_of_input_section. Don't declare
3065 is_section_name_prefix_grouped.
3066 * output.cc (Output_section::add_input_section): Revert last
3067 change.
3068 (Output_section::Input_section_sort::match_file_name): Don't crash
3069 if called on output section data.
3070 (Output_section::Input_section_sort_compare): Sort based on
3071 special ordering.
3072 (Output_section::Input_section_sort_section_order_index_compare):
3073 Revert last patch.
3074 (Output_section::sort_attached_input_sections): Likewise.
3075
3076 2012-12-18 Sriraman Tallam <tmsriram@google.com>
3077
3078 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
3079 * layout.h (Layout::is_section_name_prefix_grouped): New function.
3080 * output.cc (Output_section::add_input_section): Check if section
3081 name contains special prefix. Keep input sections to sort such
3082 sections.
3083 (Output_section::Input_section_sort_section_order_index_compare
3084 ::operator()): Group sections according to prefixes.
3085 (Output_section::sort_attached_input_sections): Add condition to
3086 Input_section_entry constructor call.
3087 * testsuite/Makefile.am (text_section_grouping): New test.
3088 * testsuite/Makefile.in: Regenerate.
3089 * testsuite/text_section_grouping.cc: New file.
3090 * testsuite/text_section_grouping.sh: New file.
3091
3092 2012-12-17 Nick Clifton <nickc@redhat.com>
3093
3094 * Makefile.am: Add copyright notice.
3095 * NEWS: Likewise.
3096 * README: Likewise.
3097 * configure.ac: Likewise.
3098 * ftruncate.c: Likewise.
3099 * Makefile.in: Regenerate.
3100
3101 2012-12-14 Cary Coutant <ccoutant@google.com>
3102
3103 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
3104 --no-as-needed flag.
3105 (exception_separate_shared_12_test): Likewise.
3106 (incremental_copy_test): Likewise.
3107 * testsuite/Makefile.in: Regenerate.
3108
3109 2012-12-14 Cary Coutant <ccoutant@google.com>
3110
3111 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
3112 (Dwp_output_file::Dwp_index::enter_set): Add assert.
3113
3114 2012-12-12 Alan Modra <amodra@gmail.com>
3115
3116 * powerpc.cc (class Track_tls): New.
3117 (class Relocate, class Scan): Inherit Track_tls.
3118 (Target_powerpc::Scan::local, global): Track tls optimization
3119 and avoid creating plt entry for __tls_get_addr if all uses
3120 are optimized away.
3121 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
3122
3123 2012-12-12 Alan Modra <amodra@gmail.com>
3124
3125 * options.h (General_options): Add --toc-sort/--no-toc-sort.
3126 Replace no_toc_optimize with toc_optimize.
3127 * output.h (Output_section::input_sections): Provide non-const variant.
3128 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
3129 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
3130 accessors.
3131 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
3132 (class Sort_toc_sections): New.
3133 (Target_powerpc::do_finalize_sections): Sort toc sections.
3134 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
3135
3136 2012-12-10 Roland McGrath <mcgrathr@google.com>
3137
3138 * testsuite/binary_unittest.cc (read_all): New function.
3139 (Sized_binary_test): Use it instead of ::read.
3140 * fileread.cc (do_read): Don't assume pread always reads the whole
3141 amount in a single call.
3142
3143 2012-12-10 Alan Modra <amodra@gmail.com>
3144
3145 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
3146 Set EM_PPC64 or EM_PPC here.
3147 (Target_selector_powerpc::do_recognize): Delete.
3148
3149 2012-12-10 Alan Modra <amodra@gmail.com>
3150
3151 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
3152 stub_table_.
3153 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
3154
3155 2012-12-07 Roland McGrath <mcgrathr@google.com>
3156
3157 * testsuite/binary_unittest.cc (Sized_binary_test):
3158 Use open_descriptor rather than ::open.
3159
3160 2012-12-07 Alan Modra <amodra@gmail.com>
3161
3162 * powerpc.cc (Stub_table::do_write): Delete redundant Address
3163 typedef and invalid_address constant.
3164 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
3165 instantiate constants.
3166
3167 2012-12-06 Roland McGrath <mcgrathr@google.com>
3168
3169 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
3170 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
3171 * aclocal.m4: Regenerate.
3172 * configure: Regenerate.
3173 * Makefile.in: Regenerate.
3174 * testsuite/Makefile.in: Regenerate.
3175
3176 2012-12-07 Alan Modra <amodra@gmail.com>
3177
3178 * options.h (General_options): Add no_toc_optimize.
3179 * powerpc.cc (ok_lo_toc_insn): New function.
3180 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
3181
3182 2012-12-06 Alan Modra <amodra@gmail.com>
3183
3184 * options.h (General_options): Add plt_align, plt_static_chain,
3185 plt_thread_safe. Update stub_group_size help text.
3186 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
3187 for new plt_thread_safe_ var.
3188 (use_plt_offset): Correct comments.
3189 (Target_powerpc::do_relax): Look for thread creation symbols to
3190 determine default plt_thread_safe value. Clear plt call stubs
3191 as well as branch stubs each iteration.
3192 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
3193 insn constants.
3194 (l, hi, ha, write_insn): Move earlier.
3195 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
3196 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
3197 plt stubs too.
3198 (Stub_table::update_size): Adjust.
3199 (Stub_table::prev_size, set_prev_size): Delete.
3200 (Stub_table::stub_align): Let --plt-align affect result.
3201 (Stub_table::plt_call_size): Calculate sizes for various stubs.
3202 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
3203 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
3204 (Stub_table::do_write): Support more stub variants.
3205
3206 2012-12-04 Alan Modra <amodra@gmail.com>
3207
3208 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
3209 (Target_powerpc::do_define_standard_symbols): New function.
3210
3211 2012-12-03 Alan Modra <amodra@gmail.com>
3212
3213 * output.h: Formatting, whitespace.
3214
3215 2012-12-03 Alan Modra <amodra@gmail.com>
3216
3217 * layout.h (Layout::get_executable_sections): Declare.
3218 * layout.cc (Layout::get_executable_sections): New function.
3219 * arm.cc (Target_arm::group_sections): Use it.
3220 (Arm_output_section::group_sections): Delete now redundant test.
3221 * output.cc (Output_reloc::Output_reloc): Add is_relative.
3222 param to handle relative relocs.
3223 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
3224 (Output_data_reloc::add_absolute): Adjust.
3225 (Output_data_reloc::add_relative): New function.
3226 (Output_data::reset_data_size): New function.
3227 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
3228 (Output_section::set_addralign): New function.
3229 (Output_section::checkpoint_set_addralign): New function.
3230 (Output_section::clear_section_offsets_need_adjustment): New function.
3231 (Output_section::input_sections): Make public.
3232 * powerpc.cc (class Output_data_brlt_powerpc): New.
3233 (class Stub_table, class Stub_control): New.
3234 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
3235 stub_table_, set_stub_table, stub_table): New vectors and accessor
3236 functions.
3237 (Target_powerpc::do_may_relax, do_relax, push_branch,
3238 new_stub_table, stub_tables, brlt_section, group_sections,
3239 add_branch_lookup_table, find_branch_lookup_table,
3240 write_branch_lookup_table, make_brlt_section): New functions.
3241 (Target_powerpc::struct Sort_sections, class Branch_info): New.
3242 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
3243 branch_info_): New vars.
3244 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
3245 make call stubs here.
3246 (Output_data_glink): Remove all call stub handling from this class.
3247 (Target_powerpc::Scan::local, global): Save interesting branch
3248 relocs and relocs for ifunc. Adjust calls to plt entry functions.
3249 (Target_powerpc::do_finalize_sections): Only make reg save/restore
3250 functions on final link.
3251 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
3252 Handle long branch destinations too.
3253 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
3254 do_plt_address_for_local): Adjust lookup of plt call stubs.
3255
3256 2012-11-30 Alan Modra <amodra@gmail.com>
3257
3258 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
3259 relocs against protected symbols when building 32-bit shared libs.
3260
3261 2012-11-30 Alan Modra <amodra@gmail.com>
3262
3263 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
3264 param. Call got_section() to make .got. Update all callers
3265 and their callers and so on.
3266
3267 2012-11-30 Alan Modra <amodra@gmail.com>
3268
3269 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
3270 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
3271 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
3272 value if it already exists.
3273
3274 2012-11-19 H.J. Lu <hongjiu.lu@intel.com>
3275
3276 PR gold/14858
3277 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
3278
3279 2012-11-14 Roland McGrath <mcgrathr@google.com>
3280
3281 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
3282 than bfc instruction for data sandboxing.
3283
3284 2012-11-08 Alan Modra <amodra@gmail.com>
3285
3286 * po/POTFILES.in: Regenerate.
3287
3288 2012-11-05 Alan Modra <amodra@gmail.com>
3289
3290 * configure.ac: Apply 2012-09-10 change to config.in here.
3291 * configure: Regenerate.
3292
3293 2012-11-05 Alan Modra <amodra@gmail.com>
3294
3295 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
3296 (struct Opd_ent): Use "Address" rather than "Offset".
3297 (Output_data_got_powerpc::got_base_offset): Return Valtype.
3298 (Target_powerpc::got_section): Make public.
3299 (Target_powerpc::scan_relocs): Move code setting symbols..
3300 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
3301 Create _SDA_BASE_ only when referenced.
3302
3303 2012-11-02 Roland McGrath <mcgrathr@google.com>
3304
3305 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
3306 from last change.
3307
3308 2012-11-01 Roland McGrath <mcgrathr@google.com>
3309
3310 * target.h (Sized_target::relocate_relocs): Use Elf_Off
3311 for offset_in_output_section parameter.
3312 (Sized_target::relocate_special_relocatable): Likewise.
3313 * arm.cc (Target_arm::relocate_relocs): Likewise.
3314 (Target_arm::relocate_special_relocatable): Likewise.
3315 * i386.cc (Target_i386::relocate_relocs): Likewise.
3316 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
3317 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
3318 * target-reloc.h (relocate_relocs): Likewise.
3319 * testsuite/testfile.cc (Target_test): Likewise.
3320 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
3321 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
3322
3323 * system.h: Move inclusion of <clocale> to after <libintl.h> in
3324 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
3325
3326 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
3327 parameter, which is unused in the [!F_SETFD] case.
3328
3329 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
3330 SYMNDX to off_t before comparing it to this->data_size().
3331 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
3332 * incremental.cc (Output_section_incremental_inputs::do_write):
3333 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
3334
3335 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
3336
3337 2012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
3338
3339 * gold.cc (Target_arm::do_adjust_elf_header): Add the
3340 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
3341 in EABI_VER5.
3342
3343 2012-10-29 Cary Coutant <ccoutant@google.com>
3344
3345 * dwp.cc (usage): Add file and exit status parameters;
3346 add --help and --version options.
3347 (print_version): New function.
3348 (main): Add --help and --version options.
3349
3350 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3351
3352 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
3353 final_layout_sequence.txt.
3354 * testsuite/Makefile.in: Regenerated.
3355
3356 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3357
3358 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
3359 COMPILE generated by automake.
3360 (LINK1): Likewise.
3361 (CXXCOMPILE1): Likewise.
3362 (CXXLINK1): Likewise.
3363 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
3364 (LINK): Likewise.
3365 (CXXCOMPILE): Likewise.
3366 (CXXLINK): Likewise.
3367 * testsuite/Makefile.in: Regenerated.
3368
3369 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3370
3371 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
3372 on bad fwrite return.
3373
3374 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3375
3376 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
3377 on val.
3378
3379 2012-10-23 Cary Coutant <ccoutant@google.com>
3380
3381 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
3382 * testsuite/Makefile.in: Regenerate.
3383 * testsuite/dwp_test.h: New source file.
3384 * testsuite/dwp_test_1.cc: New source file.
3385 * testsuite/dwp_test_1.s: New source file.
3386 * testsuite/dwp_test_1.sh: New source file.
3387 * testsuite/dwp_test_1b.cc: New source file.
3388 * testsuite/dwp_test_1b.s: New source file.
3389 * testsuite/dwp_test_2.cc: New source file.
3390 * testsuite/dwp_test_2.s: New source file.
3391 * testsuite/dwp_test_2.sh: New source file.
3392 * testsuite/dwp_test_main.cc: New source file.
3393 * testsuite/dwp_test_main.s: New source file.
3394
3395 2012-10-23 Cary Coutant <ccoutant@google.com>
3396
3397 * dwp.h: New header file.
3398 * dwp.cc: New source file.
3399 * gold.h: Move shared declarations to system.h.
3400 * system.h: New header file.
3401 * Makefile.am: Add dwp.
3402 * Makefile.in: Regenerate.
3403
3404 2012-10-23 Cary Coutant <ccoutant@google.com>
3405
3406 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
3407 Dwarf_info_reader::read_from_pointer.
3408 (Dwarf_pubnames_table::read_header): Likewise.
3409 (Dwarf_pubnames_table::next_name): Likewise.
3410 (Dwarf_die::read_attributes): Likewise.
3411 (Dwarf_die::skip_attributes): Likewise.
3412 (Dwarf_info_reader::read_from_pointer): New function template.
3413 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
3414 (Dwarf_pubnames_table): Likewise.
3415 (Dwarf_info_reader::read_from_pointer): New function template.
3416 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
3417 Dwarf_pubnames_table ctor.
3418
3419 2012-10-23 Cary Coutant <ccoutant@google.com>
3420
3421 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
3422 abbrev_shndx.
3423 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
3424 abbrev_shndx_.
3425 (Dwarf_info_reader::set_abbrev_shndx): New method.
3426 (Dwarf_info_reader::abbrev_shndx_): New data member.
3427
3428 2012-10-23 Cary Coutant <ccoutant@google.com>
3429
3430 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
3431 from object, not parameters.
3432 (Dwarf_info_reader::parse): Likewise.
3433 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
3434 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
3435 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
3436 methods.
3437
3438 2012-10-23 Cary Coutant <ccoutant@google.com>
3439
3440 * fileread.cc (Input_file::Input_file): New constructor.
3441 * fileread.h (class Input_file): Add new constructor.
3442
3443 2012-10-18 Alan Modra <amodra@gmail.com>
3444
3445 PR gold/14727
3446 * object.cc (Relobj::is_section_name_included): Also match
3447 .sdata personality section.
3448
3449 2012-10-18 Alan Modra <amodra@gmail.com>
3450
3451 * target-reloc.h (class Default_comdat_behavior): New, package up..
3452 (get_comdat_behaviour): ..this.
3453 (relocate_section): Add Relocate_comdat_behavior template arg,
3454 adjust code to suit.
3455 * arm.cc (Target_arm::relocate_section): Adjust to suit.
3456 (Target_arm::scan_reloc_section): Likewise.
3457 * i386.cc (Target_i386::relocate_section): Likewise.
3458 * sparc.cc (Target_sparc::relocate_section): Likewise.
3459 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
3460 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
3461 * powerpc.cc (class Relocate_comdat_behavior): New.
3462 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
3463 gold::relocate_section with new template arg.
3464
3465 2012-10-18 Alan Modra <amodra@gmail.com>
3466
3467 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
3468 dynamic relocs for GOT_TPREL got entries, without symbol if
3469 resolving locally.
3470 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
3471 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
3472 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
3473
3474 2012-10-17 Alan Modra <amodra@gmail.com>
3475
3476 PR gold/14726
3477 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
3478
3479 2012-10-16 Sriraman Tallam <tmsriram@google.com>
3480
3481 * layout.cc (Layout::include_section): Keep sections marked
3482 SHF_EXCLUDE when doing relocatable links.
3483
3484 2012-10-16 Alan Modra <amodra@gmail.com>
3485
3486 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
3487 (Target_powerpc::do_finalize_sections): Call it.
3488 (Output_data_save_res): New class and supporting functions.
3489 (Target_powerpc::symval_for_branch): Only look up .opd entry for
3490 normal symbols defined in object files.
3491
3492 2012-10-12 Alan Modra <amodra@gmail.com>
3493
3494 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
3495 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
3496 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
3497 section if scan_opd_relocs not yet called.
3498 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
3499
3500 2012-10-12 Alan Modra <amodra@gmail.com>
3501
3502 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3503 add_local_ifunc_entry): Revert last change.
3504 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
3505
3506 2012-10-05 Alan Modra <amodra@gmail.com>
3507
3508 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
3509 do_plt_address_for_global): New functions.
3510 (Output_data_got_powerpc::do_write): Don't segfault when linking
3511 statically.
3512 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3513 add_local_ifunc_entry): Return true on adding entry..
3514 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
3515 glink->add_entry call. Remove unused symtab param. Adjust calls.
3516 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
3517 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
3518 set up symbols here.
3519 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
3520 syms here. Do so even when no .iplt. Don't segfault when linking
3521 statically.
3522 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
3523 new variants without reloc param.
3524 (Glink_sym_ent::Glink_sym_ent): Likewise.
3525 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
3526 reloc when refs will resolve to plt call stub.
3527 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
3528 R_PPC_PLTREL24 to resolve locally.
3529 (Target_powerpc::Scan::global): Correct ifunc handling.
3530 (Target_powerpc::Relocate::relocate): Correct local sym glink
3531 lookup. Don't destroy "value" when we have a plt call stub,
3532 and when checking plt call validity.
3533 (Target_powerpc::do_dynsym_value): Simplify.
3534
3535 2012-10-05 Alan Modra <amodra@gmail.com>
3536
3537 * i386.cc (Output_data_plt_i386::address_for_global,
3538 address_for_local): Add plt offset to returned value. Adjust uses.
3539 * sparc.cc (Output_data_plt_sparc::address_for_global,
3540 address_for_local): Likewise.
3541 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
3542 address_for_local): Likewise.
3543 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
3544 address_for_local): Likewise.
3545 * target.h (Target::plt_address_for_global, plt_address_for_local):
3546 Update comment.
3547 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
3548 (Output_data_got::Got_entry::write): Nor here.
3549 * output.h: Comment fix.
3550
3551 2012-10-02 Jiong Wang <jiwang@tilera.com>
3552
3553 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
3554 global_offset_table_ value for larget got.
3555 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
3556
3557 2012-09-29 Alan Modra <amodra@gmail.com>
3558
3559 * powerpc.cc (Target_powerpc::iplt_): New output section.
3560 (Target_powerpc::iplt_section, make_iplt_section,
3561 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
3562 (Target_powerpc::make_plt_entry): Handle ifunc syms.
3563 Target_powerpc::plt_entry_count): Count iplt entries too.
3564 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
3565 reloc section in constructor. New params.
3566 (Target_powerpc::make_plt_section): Create reloc section here instead.
3567 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
3568 functions.
3569 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
3570 (Output_data_glink::add_entry, find_entry): New functions to
3571 deal with local syms.
3572 (Glink_sym_ent): Add support for local syms.
3573 (Output_data_glink::do_write): Handle ifunc plt entries.
3574 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3575 (Target_powerpc::Scan::local, global): Handle ifunc syms.
3576 (Target_powerpc::Relocate::relocate): Likewise.
3577 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
3578
3579 2012-09-25 Alan Modra <amodra@gmail.com>
3580
3581 * object.h (Sized_relobj_file::adjust_local_symbol,
3582 do_adjust_local_symbol): New functions.
3583 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
3584 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
3585 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
3586 and irregular opd entry spacing.
3587 (Powerpc_relobj::do_read_relocs): Add opd size checks.
3588 (Global_symbol_visitor_opd): New functor.
3589 (Target_powerpc::do_finalize_sections): Omit global symbols defined
3590 on deleted opd entries.
3591
3592 2012-09-15 Jiong Wang <jiwang@tilera.com>
3593
3594 * tilegx.cc: New file.
3595 * Makefile.am (TARGETSOURCES): Add tilegx.cc
3596 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
3597 * configure.tgt: Add entries for tilegx*.
3598 * configure.ac: Likewise.
3599 * Makefile.in: Rebuild.
3600 * configure: Likewise.
3601 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
3602 tilegx.
3603
3604 2012-09-13 Alan Modra <amodra@gmail.com>
3605
3606 * target-reloc.h (scan_relocs): Call scan.local for relocs
3607 against symbols in discarded sections. Pass is_discarded
3608 param.
3609 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
3610 Add is_discarded param.
3611 * powerpc (Target_powerpc::Scan::local): Likewise. Use
3612 is_discarded to flag opd entry as discarded. Don't emit dyn
3613 relocs on such entries.
3614 (Target_powerpc::Scan::global): Similarly detect and handle
3615 such opd entries.
3616 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
3617 opd_ent_. Update all uses.
3618 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
3619 (Target_powerpc::relocate_section): Zero out discarded opd
3620 entry relocs.
3621
3622 2012-09-12 Ian Lance Taylor <iant@google.com>
3623
3624 PR gold/14570
3625 * output.cc: Rename Output_data_got template parameter from size
3626 to got_size for all functions. Compile all variants of
3627 Output_data_got.
3628 (Output_data_got::Got_entry::write): Correct use of size for
3629 symbol value. Use local_is_tls rather than casting to
3630 Sized_relobj_file.
3631 * object.h (class Object): Add local_is_tls and do_local_is_tls.
3632 (class Sized_relobj_file): Add do_local_is_tls.
3633 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
3634
3635 2012-09-11 Alan Modra <amodra@gmail.com>
3636
3637 PR gold/14566
3638 * layout.cc (Layout::set_segment_offsets): When using
3639 common-page-size alignment, ensure we are on a new max-page-size
3640 page.
3641 * output.cc (Output_segment::set_section_addresses): Use
3642 abi_pagesize, not common_pagesize for relro boundary.
3643 (Output_segment::set_offset): Likewise.
3644
3645 2012-09-11 Alan Modra <amodra@gmail.com>
3646
3647 * output.h (Output_data_got::add_global_tls, add_local_tls,
3648 add_local_tls_pair): New functions.
3649 (Output_data_got::add_local_pair_with_rel): Remove second
3650 reloc param. Expand comment.
3651 (Output_data_got::Got_entry): Rename use_plt_offset_ to
3652 use_plt_or_tls_offset_, similarly for constructor param.
3653 (Output_data_got::Got_entry::write): Add got_index param.
3654 * output.cc (Output_data_got::add_global_tls, add_local_tls,
3655 add_local_tls_pair): New functions.
3656 (Output_data_got::Got_entry::write): Handle tls symbols
3657 with use_plt_or_tls_offset_ set specially.
3658 (Output_data_got::add_local_pair_with_rel): Only one reloc.
3659 (Output_data_got::do_write): Replace iterator with index, pass
3660 index to entry write function.
3661 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
3662 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
3663 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
3664 call.
3665 * i386.cc (Target_i386::Scan::local): Likewise.
3666 * sparc.cc (Target_sparc::Scan::local): Likewise.
3667 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
3668 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
3669 do_tls_offset_for_global): New functions.
3670 (Target_powerpc::Scan::local): Correct TLS relocations and got
3671 entry values.
3672 (Target_powerpc::Scan::global): Don't emit unnecessary
3673 dynamic relocations on TLS GOT entries.
3674
3675 2012-09-10 Matthias Klose <doko@ubuntu.com>
3676
3677 * config.in: Disable sanity check for kfreebsd.
3678
3679 2012-09-10 Sterling Augustine <saugustine@google.com>
3680
3681 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
3682 (Gdb_index::pubtypes_read): New parameter.
3683 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
3684 to calls.
3685 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
3686 pubtypes_object_.
3687
3688 2012-09-09 Alan Modra <amodra@gmail.com>
3689
3690 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
3691 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
3692 * gc.h (gc_process_relocs): Call target gc_add_reference.
3693 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
3694 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
3695 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
3696 unnecessary cast.
3697 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
3698 to cater for when we don't need code offset. Update use.
3699 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
3700 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
3701 set_opd_valid): New functions.
3702 (Target_powerpc::do_gc_add_reference): New function.
3703 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
3704 stashed refs.
3705 (Target_powerpc::do_gc_mark_symbol): New function.
3706
3707 2012-09-06 Cary Coutant <ccoutant@google.com>
3708
3709 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
3710 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
3711 (Dwarf_die::skip_attributes): Likewise.
3712 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
3713 * testsuite/gdb_index_test.cc (inline_func_1): New function.
3714 (main): Call it.
3715 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
3716
3717 2012-09-05 H.J. Lu <hongjiu.lu@intel.com>
3718
3719 * testsuite/script_test_3.t: Add .got.plt output section
3720 statement.
3721 * testsuite/script_test_4.t: Likewise.
3722
3723 2012-09-05 Alan Modra <amodra@gmail.com>
3724
3725 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
3726 update all uses and lose "enum" when using type.
3727
3728 2012-09-05 Alan Modra <amodra@gmail.com>
3729
3730 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
3731 * configure: Regenerate.
3732 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
3733 (plugin_final_layout.stdout): Likewise.
3734 (memory_test): Set page sizes to 0x1000.
3735 * testsuite/Makefile.in: Regenerate.
3736 * testsuite/discard_locals_test.sh: Add FIXME comment.
3737 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
3738 * testsuite/pr14265.t: Add .got output section statement.
3739 * testsuite/script_test_2.t: Likewise.
3740 * testsuite/script_test_3.t: Likewise.
3741 * testsuite/script_test_4.t: Likewise.
3742 * testsuite/script_test_5.t: Likewise.
3743 * testsuite/script_test_6.t: Likewise.
3744 * testsuite/script_test_7.t: Likewise.
3745 * testsuite/script_test_9.t: Likewise.
3746
3747 2012-09-05 Alan Modra <amodra@gmail.com>
3748
3749 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
3750 (Powerpc_relocate_functions::Status): New typedef.
3751 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3752 (Target_powerpc::Scan::local): Handle REL64.
3753 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
3754 for REL32 and REL64.
3755 (Target_powerpc::symval_for_branch): New function, extracted from..
3756 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
3757 checks. Report overflow errors.
3758
3759 2012-09-05 Alan Modra <amodra@gmail.com>
3760
3761 * object.h (Sized_relobj_file::emit_relocs): Delete.
3762 (Sized_relobj_file::emit_relocs_reltype): Delete.
3763 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
3764 relocate_relocs for --emit-relocs.
3765 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
3766 * output.h: Update comment.
3767 (Output_segment::first_section): New function.
3768 (Output_segment::first_section_load_address): Use first_section.
3769 * output.cc (Output_segment::first_section): New function extracted..
3770 (Output_segment::first_section_load_address): ..from here. Delete.
3771 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
3772 * target.h (Sized_target::relocate_for_relocatable): Likewise.
3773 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
3774 adjust call to target.h function.
3775 * i386.cc (Target_i386): Likewise.
3776 * sparc.cc (Target_sparc): Likewise.
3777 * x86_64.cc (Target_x86_64): Likewise.
3778 * powerpc.cc (Target_powerpc): Likewise.
3779 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
3780 first tls section has section symbol for optimised local dynamic
3781 output relocs.
3782 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
3783 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
3784 optimised tls code.
3785 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
3786 Rename to relocate_relocs. Update error message.
3787
3788 2012-09-04 Andreas Schwab <schwab@linux-m68k.org>
3789
3790 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
3791 --just-symbols.
3792
3793 2012-08-31 Alan Modra <amodra@gmail.com>
3794
3795 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
3796 (Powerpc_relobj::toc_base_offset): New stub function.
3797 (Target_powerpc): Add tp_offset, dtp_offset. Rename
3798 got_mod_index_offset to tlsld_got_offset. Update all refs.
3799 (Target_powerpc::Relocate::enum skip_tls): New.
3800 (Target_powerpc::call_tls_get_addr_): New var.
3801 (Target_powerpc::is_branch_reloc): Move to file scope.
3802 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
3803 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
3804 New functions.
3805 (Target_powerpc::enum Got_type): Delete old values, add new ones.
3806 (powerpc_info): Correct common_pagesize for ppc64.
3807 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
3808 (Powerpc_relocate_functions): Add overflow check enums and functions.
3809 Add non-shift version of rela, rela_ua. Delete all rel public
3810 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
3811 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
3812 addr16_ha3, addr14 functions.
3813 (Output_data_got_powerpc::add_constant_pair): New function.
3814 (Output_data_got_powerpc::got_base_offset): Likewise.
3815 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
3816 (instruction constants): Sort, add some more.
3817 (Output_data_glink::do_write): Add and use Address typedef. Use
3818 object->toc_base_offset() stub for 64-bit.
3819 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
3820 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3821 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
3822 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
3823 Always treat .opd relocs as against locally defined symbol.
3824 Correct condition for RELATIVE relocs.
3825 (Target_powerpc::do_finalize_sections): Test for NULL sections.
3826 (Target_powerpc::Relocate::relocate): Use plt call stub as value
3827 for 32-bit syms with a plt entry. Correct ppc64 toc base
3828 calculations. Handle TLS relocs, and more. Add overflow
3829 checking and adjust for Powerpc_relocate_functions changes.
3830 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
3831 Reinstate --emit-relocs code with FIXME.
3832
3833 2012-08-30 Alan Modra <amodra@gmail.com>
3834
3835 * layout.cc (Layout::set_segment_offsets): Set p_align to
3836 abi_pagesize, not common_pagesize.
3837 (Layout::relaxation_loop_body): Similarly use abi_pagesize
3838 to determine whether file header can go in segment.
3839
3840 2012-08-30 Alan Modra <amodra@gmail.com>
3841
3842 * output.h (Output_reloc::Output_reloc <output section>): Add
3843 is_relative param. Adjust calls.
3844 (Output_reloc::add_output_section_relative): New functions.
3845 * output.cc (Output_reloc::Output_reloc <output section>): Handle
3846 is_relative.
3847 (Output_reloc::symbol_value): Handle SECTION_CODE.
3848
3849 2012-08-24 Sriraman Tallam <tmsriram@google.com>
3850
3851 * gold.cc (queue_middle_tasks): Call layout again when unique
3852 segments for sections is desired.
3853 * layout.cc (Layout::Layout): Initialize new members.
3854 (Layout::get_output_section_flags): New function.
3855 (Layout::choose_output_section): Call get_output_section_flags.
3856 (Layout::layout): Make output section for mapping to a unique segment.
3857 (Layout::insert_section_segment_map): New function.
3858 (Layout::attach_allocated_section_to_segment): Make unique segment for
3859 output sections marked so.
3860 (Layout::segment_precedes): Check for unique segments when sorting.
3861 * layout.h (Layout::Unique_segment_info): New struct.
3862 (Layout::Section_segment_map): New typedef.
3863 (Layout::insert_section_segment_map): New function.
3864 (Layout::get_output_section_flags): New function.
3865 (Layout::is_unique_segment_for_sections_specified): New function.
3866 (Layout::set_unique_segment_for_sections_specified): New function.
3867 (Layout::unique_segment_for_sections_specified_): New member.
3868 (Layout::section_segment_map_): New member.
3869 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
3870 Rename is_gc_pass_one to is_pass_one.
3871 Rename is_gc_pass_two to is_pass_two.
3872 Rename is_gc_or_icf to is_two_pass.
3873 Check for which pass based on whether symbols data is present.
3874 Make it two pass when unique segments for sections is desired.
3875 * output.cc (Output_section::Output_section): Initialize new
3876 members.
3877 * output.h (Output_section::is_unique_segment): New function.
3878 (Output_section::set_is_unique_segment): New function.
3879 (Output_section::is_unique_segment_): New member.
3880 (Output_section::extra_segment_flags): New function.
3881 (Output_section::set_extra_segment_flags): New function.
3882 (Output_section::extra_segment_flags_): New member.
3883 (Output_section::segment_alignment): New function.
3884 (Output_section::set_segment_alignment): New function.
3885 (Output_section::segment_alignment_): New member.
3886 (Output_segment::Output_segment): Initialize is_unique_segment_.
3887 (Output_segment::is_unique_segment): New function.
3888 (Output_segment::set_is_unique_segment): New function.
3889 (Output_segment::is_unique_segment_): New member.
3890 * plugin.cc (allow_unique_segment_for_sections): New function.
3891 (unique_segment_for_sections): New function.
3892 (Plugin::load): Add new functions to transfer vector.
3893 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
3894 * Makefile.in: Regenerate.
3895 * testsuite/plugin_final_layout.sh: Check if unique segment
3896 functionality works.
3897 * testsuite/plugin_section_order.c (onload): Check if new interfaces
3898 are available.
3899 (allow_unique_segment_for_sections): New global.
3900 (unique_segment_for_sections): New global.
3901 (claim_file_hook): Call allow_unique_segment_for_sections.
3902 (all_symbols_read_hook): Call unique_segment_for_sections.
3903
3904 2012-08-22 Cary Coutant <ccoutant@google.com>
3905
3906 * layout.cc (Layout::include_section): Don't assert on GROUP
3907 sections with --emit-relocs.
3908
3909 2012-08-21 Cary Coutant <ccoutant@google.com>
3910
3911 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
3912 if --export-dynamic-symbol names an undef symbol.
3913
3914 2012-08-18 Alan Modra <amodra@gmail.com>
3915
3916 * powerpc.cc: Formatting and white space.
3917 (Powerpc_relobj): Rename got2_section_ to special_.
3918 Add opd_ent_shndx_ and opd_ent_off_ vectors.
3919 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
3920 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
3921 (Target_powerpc): Add Address typedef and invalid_address. Use
3922 throughout.
3923 (Target_powerpc::is_branch_reloc): New function.
3924 (Powerpc_relocate_functions): Add Address typedef, use throughout.
3925 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
3926 for dst_mask, value and addend.
3927 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
3928 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
3929 (Output_data_glink::do_write): Correct toc base. Don't try to use
3930 uint16_t for 24-bit offset. Use get_output_section_offset and
3931 check return.
3932 (Target_powerpc::Scan::local): Handle more relocs.
3933 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
3934 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
3935 Plug in toc restoring insn after plt calls. Translate branches
3936 to function descriptor symbols to corresponding entry point.
3937 (Target_powerpc::relocate_for_relocatable): Check return from
3938 get_output_section_offset.
3939 * symtab.h: Comment typo.
3940
3941 2012-08-14 Ian Lance Taylor <iant@google.com>
3942
3943 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
3944 unsupported_relocal_local to call unsupported_reloc_global.
3945
3946 2012-08-14 Nick Clifton <nickc@redhat.com>
3947
3948 PR ld/14265
3949 * script-sections.cc (Sections_element::output_section_name): Add
3950 keep return parameter.
3951 (Output_section_element::match_name): Add keep return parameter.
3952 Return the value of the keep_ member.
3953 * script-sections.h (class Output_section): Update
3954 output_section_name prototype.
3955 * layout.cc (Layout::keep_input_section): New public member
3956 function.
3957 (Layout::choose_output_section): Pass keep parameter to
3958 output_section_name.
3959 * layout.h (class Layout): Add keep_input_section.
3960 * object.cc (Sized_relobj_file::do_layout): Check for kept input
3961 sections.
3962 * testsuite/Makefile.am: Add a test.
3963 * testsuite/Makefile.in: Regenerate.
3964 * testsuite/pr14265.c: Source file for the test.
3965 * testsuite/pr14265.t: Linker script for the test.
3966 * testsuite/pr14265.sh: Shell script for the test.
3967
3968 2012-08-14 Alan Modra <amodra@gmail.com>
3969
3970 * target.h (Target::output_section_name): New function.
3971 (Target::do_output_section_name): New function.
3972 * layout.cc (Layout::choose_output_section): Call the above.
3973 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
3974
3975 2012-08-14 Alan Modra <amodra@gmail.com>
3976
3977 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
3978 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
3979 for replace_constant call.
3980 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
3981 (Output_data_glink::do_print_to_mapfile): New function.
3982 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
3983 (Target_powerpc::Relocate::relocate): Likewise.
3984
3985 2012-08-14 Alan Modra <amodra@gmail.com>
3986
3987 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
3988 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
3989 (Output_data_glink::add_entry,find_entry): Remove shndx param.
3990 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
3991 all references to shndx_. Handle special case for R_PPC_PLTREL24
3992 here.
3993 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
3994 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
3995 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
3996 here.
3997 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
3998 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
3999
4000 2012-08-12 Alan Modra <amodra@gmail.com>
4001
4002 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
4003 (glink insn constants): Use uint32_t.
4004 (Output_data_glink::add_entry): Use insert, not [] operator.
4005
4006 2012-08-11 Alan Modra <amodra@gmail.com>
4007
4008 * object.h (Sized_relobj_file::find_shdr): New function.
4009 (Sized_relobj_file::find_special_sections): New function.
4010 * object.cc (Sized_relobj_file::find_shdr): New function.
4011 (Sized_relobj_file::find_eh_frame): Use find_shdr.
4012 (Sized_relobj_file::find_special_sections): New function, split out..
4013 (Sized_relobj_file::do_read_symbols): ..from here.
4014 * output.h (Output_data_got::replace_constant): New function.
4015 (Output_data_got::num_entries): New function.
4016 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
4017 (Output_data_got::got_offset): Protected rather than private.
4018 (Output_data_got::replace_got_entry): New function.
4019 * output.cc (Output_data_got::replace_got_entry): New function.
4020 * powerpc.cc (class Powerpc_relobj): New.
4021 (class Powerpc_relocate_functions): Delete all psymval variants or
4022 convert to value,addend type. Delete pcrela, pcrela_unaligned.
4023 Implement _ha functions using corresponding _hi function.
4024 (Powerpc_relobj::find_special_sections): New function.
4025 (Target_powerpc::do_make_elf_object): New function.
4026 (class Output_data_got_powerpc): New.
4027 (class Output_data_glink): New.
4028 (class Powerpc_scan_relocatable_reloc): New.
4029 Many more changes througout file.
4030
4031 2012-08-09 Nick Clifton <nickc@redhat.com>
4032
4033 * po/vi.po: Updated Vietnamese translation.
4034
4035 2012-08-07 Ian Lance Taylor <iant@google.com>
4036
4037 * layout.cc (Layout::add_target_dynamic_tags): If
4038 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
4039 plt_rel.
4040
4041 2012-07-30 Nick Clifton <nickc@redhat.com>
4042
4043 * po/gold.pot: Updated template.
4044 * po/es.po: Updated Spanish translation.
4045
4046 2012-07-18 Cary Coutant <ccoutant@google.com>
4047
4048 PR gold/14344
4049 * configure.ac: Add check for -gpubnames support.
4050 * configure: Regenerate.
4051 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
4052 support; force -gno-pubnames.
4053 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
4054 support.
4055 (gdb_index_test_4): New test.
4056 * testsuite/Makefile.in: Regenerate.
4057 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
4058 * testsuite/gdb_index_test_2.sh: Likewise.
4059 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
4060 * testsuite/gdb_index_test_4.sh: New script.
4061 * testsuite/gdb_index_test_comm.sh: New script with common code;
4062 don't look for space after colon.
4063
4064 2012-07-16 Sriraman Tallam <tmsriram@google.com>
4065
4066 * gold.cc (queue_middle_tasks): Update function order only after
4067 deferred objects due to plugins are processed.
4068
4069 2012-07-11 Ian Lance Taylor <iant@google.com>
4070
4071 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
4072 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
4073 (Target_arm::scan_reloc_for_stub): Likewise.
4074 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
4075 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
4076 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
4077 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
4078 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
4079
4080 2012-07-10 Dodji Seketeli <dodji@redhat.com>
4081 Ian Lance Taylor <iant@google.com>
4082
4083 PR gold/14309
4084 * configure.ac: Test whether std::tr1::hash<off_t> works.
4085 * gold.h: Add a specialization for std::tr1::hash<off_t> if
4086 needed.
4087 * output.h (class Output_fill): Add virtual destructor.
4088 * configure, config.in: Rebuild.
4089
4090 2012-06-22 Roland McGrath <mcgrathr@google.com>
4091
4092 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
4093
4094 2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
4095
4096 * plugin.cc (Plugin::load): Handle position independent executables.
4097
4098 2012-06-06 Cary Coutant <ccoutant@google.com>
4099
4100 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
4101 add .debug_macro.
4102 (lines_only_debug_sections): Likewise.
4103 (gdb_fast_lookup_sections): New static array.
4104 (is_gdb_debug_section): Rename formal parameter.
4105 (is_lines_only_debug_section): Likewise.
4106 (is_gdb_fast_lookup_section): New function.
4107 (Layout::include_section): Check for ".zdebug_" prefix; pass
4108 section name suffix to is_gdb_debug_section, et al.; check for
4109 fast-lookup sections when building .gdb_index.
4110 * options.h (--strip-debug-gdb): Update GDB version number.
4111
4112 2012-06-06 Cary Coutant <ccoutant@google.com>
4113
4114 * configure.ac: Add check for fallocate.
4115 * configure: Regenerate.
4116 * config.in: Regenerate.
4117
4118 * options.h (class General_options): Add --mmap-output-file and
4119 --posix-fallocate options.
4120 * output.cc: (posix_fallocate): Remove; replace with...
4121 (gold_fallocate): New function.
4122 (Output_file::map_no_anonymous): Call gold_fallocate.
4123 (Output_file::map): Check --mmap-output-file option.
4124
4125 2012-06-05 Jing Yu <jingyu@google.com>
4126
4127 * gold.h (textdomain): Add do {} to empty while(0).
4128 (bindtextdomain): Likewise.
4129
4130 2012-06-04 Cary Coutant <ccoutant@google.com>
4131
4132 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
4133 has_dynsym_index.
4134
4135 2012-05-25 Sriraman Tallam <tmsriram@google.com>
4136
4137 * symtab.cc (Symbol_table::define_special_symbol):
4138 Initialize *poldsym to prevent uninitialized variable errors.
4139
4140 2012-05-23 Cary Coutant <ccoutant@google.com>
4141
4142 * layout.cc (Layout::section_name_mapping): Add rules to handle
4143 exact match on .data.rel.ro.local or .data.rel.ro.
4144 (Layout::output_section_name): Check for exact matches.
4145
4146 2012-05-23 Cary Coutant <ccoutant@google.com>
4147
4148 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
4149 more carefully.
4150
4151 2012-05-22 Cary Coutant <ccoutant@google.com>
4152
4153 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
4154 object before exporting symbol.
4155
4156 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
4157
4158 * testsuite/tls_test.cc: Include "config.h" first.
4159 * testsuite/tls_test_c.c: Likewise.
4160
4161 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
4162 Nick Clifton <nickc@redhat.com>
4163
4164 PR 14072
4165 * configure.in: Add check that sysdep.h has been included before
4166 any system header files.
4167 * configure: Regenerate.
4168 * config.in: Regenerate.
4169
4170 2012-05-14 Cary Coutant <ccoutant@google.com>
4171
4172 * layout.cc (Layout::make_output_section): Mark .tdata section
4173 as RELRO.
4174 * testsuite/relro_test.cc: Add a TLS variable.
4175
4176 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
4177
4178 PR gold/14091
4179 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
4180 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
4181 R_X86_64_64.
4182
4183 2012-05-08 Cary Coutant <ccoutant@google.com>
4184
4185 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
4186 (lines_only_debug_sections): Likewise.
4187
4188 2012-05-02 Roland McGrath <mcgrathr@google.com>
4189
4190 * nacl.cc: New file.
4191 * nacl.h: New file.
4192 * Makefile.am (CCFILES, HFILES): Add them.
4193 * Makefile.in: Regenerate.
4194 * i386.cc (Output_data_plt_i386_nacl): New class.
4195 (Output_data_plt_i386_nacl_exec): New class.
4196 (Output_data_plt_i386_nacl_dyn): New class.
4197 (Target_i386_nacl): New class.
4198 (Target_selector_i386_nacl): New class.
4199 (target_selector_i386): Use it instead of Target_selector_i386.
4200 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
4201 (Target_x86_64_nacl): New class.
4202 (Target_selector_x86_64_nacl): New class.
4203 (target_selector_x86_64, target_selector_x32): Use it instead of
4204 Target_selector_x86_64.
4205 * arm.cc (Output_data_plt_arm_nacl): New class.
4206 (Target_arm_nacl): New class.
4207 (Target_selector_arm_nacl): New class.
4208 (target_selector_arm, target_selector_armbe): Use it instead of
4209 Target_selector_arm.
4210
4211 * target-select.cc (select_target): Take new Input_file* and off_t
4212 arguments, pass them on to recognize method of selector.
4213 * object.cc (make_elf_sized_object): Update caller.
4214 * parameters.cc (parameters_force_valid_target): Likewise.
4215 * incremental.cc (make_sized_incremental_binary): Likewise.
4216 * target-select.h: Update decl.
4217 (Target_selector::recognize): Take new Input_file* argument,
4218 pass it on to do_recognize.
4219 (Target_selector::do_recognize): Take new Input_file* argument.
4220 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
4221 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
4222 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
4223 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
4224
4225 * target.h (Target::Target_info): New members isolate_execinstr
4226 and rosegment_gap.
4227 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
4228 * arm.cc (Target_arm::arm_info): Update initializer.
4229 * i386.cc (Target_i386::i386_info): Likewise.
4230 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
4231 * sparc.cc (Target_sparc::sparc_info): Likewise.
4232 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
4233 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
4234 * layout.cc (Layout::attach_allocated_section_to_segment):
4235 Take new const Target* argument. If target->isolate_execinstr(), act
4236 like --rosegment.
4237 (Layout::find_first_load_seg): Take new const Target* argument;
4238 if target->isolate_execinstr(), reject PF_X segments.
4239 (Layout::relaxation_loop_body): Update caller.
4240 (Layout::set_segment_offsets): If target->isolate_execinstr(),
4241 reset file offset to zero when we hit LOAD_SEG, and then do a second
4242 loop over the segments before LOAD_SEG to reassign offsets after
4243 addresses have been determined. Handle target->rosegment_gap().
4244 (Layout::attach_section_to_segment): Take new const Target* argument;
4245 pass it to attach_allocated_section_to_segment.
4246 (Layout::make_output_section): Update caller.
4247 (Layout::attach_sections_to_segments): Take new const Target* argument;
4248 pass it to attach_section_to_segment.
4249 * gold.cc (queue_middle_tasks): Update caller.
4250 * layout.h (Layout): Update method decls with new arguments.
4251
4252 * arm.cc (Target_arm::Target_arm): Take optional argument for the
4253 Target_info pointer to use.
4254 (Target_arm::do_make_data_plt): New virtual method.
4255 (Target_arm::make_data_plt): New method that calls it.
4256 (Target_arm::make_plt_entry): Use it.
4257 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
4258 for the section alignment.
4259 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
4260 method.
4261 (Output_data_plt_arm::first_plt_entry_offset): Call it.
4262 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
4263 method.
4264 (Output_data_plt_arm::get_plt_entry_size): Call it.
4265 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
4266 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
4267 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
4268 method.
4269 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
4270 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
4271 method instead of sizeof(plt_entry).
4272 (Output_data_plt_arm::add_entry): Likewise.
4273 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
4274 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
4275 than static method.
4276 (Target_arm::plt_entry_size): Likewise.
4277 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
4278 Move to ...
4279 (Output_data_plt_arm_standard): ... here, new class.
4280 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
4281 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
4282 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
4283
4284 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4285 Take additional argument for the PLT entry size.
4286 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
4287 Use get_plt_entry_size method rather than plt_entry_size variable.
4288 (Output_data_plt_x86_64::reserve_slot): Likewise.
4289 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
4290 (Output_data_plt_x86_64::add_entry): Likewise.
4291 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
4292 (Output_data_plt_x86_64::address_for_global): Likewise.
4293 (Output_data_plt_x86_64::address_for_local): Likewise.
4294 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4295 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
4296 Make method non-static.
4297 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
4298 method.
4299 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
4300 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
4301 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
4302 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
4303 virtual method.
4304 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
4305 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
4306 virtual method.
4307 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
4308 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
4309 virtual method.
4310 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
4311 (Output_data_plt_x86_64::plt_entry_size)
4312 (Output_data_plt_x86_64::first_plt_entry)
4313 (Output_data_plt_x86_64::plt_entry)
4314 (Output_data_plt_x86_64::tlsdesc_plt_entry)
4315 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
4316 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
4317 (Output_data_plt_x86_64_standard): ... here, new class.
4318 (Target_x86_64::Target_x86_64): Take optional argument for the
4319 Target_info pointer to use.
4320 (Target_x86_64::do_make_data_plt): New virtual method.
4321 (Target_x86_64::make_data_plt): New method to call it.
4322 (Target_x86_64::init_got_plt_for_update): Use that.
4323 Call this->plt_->add_eh_frame method here.
4324 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
4325 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
4326 rather than static method.
4327 (Target_x86_64::plt_entry_size): Likewise.
4328 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
4329 rather than plt_entry_size variable. Move guts of PLT filling to...
4330 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
4331 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
4332 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
4333
4334 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
4335 additional argument for the section alignment.
4336 Don't do add_eh_frame_for_plt here.
4337 (Output_data_plt_i386::first_plt_entry_offset): Make the method
4338 non-static. Use get_plt_entry_size method rather than plt_entry_size
4339 variable.
4340 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
4341 method.
4342 (Output_data_plt_i386::get_plt_entry_size): Call it.
4343 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
4344 (Output_data_plt_i386::add_eh_frame): New method to call it.
4345 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
4346 method.
4347 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
4348 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
4349 method.
4350 (Output_data_plt_i386::fill_plt_entry): New method to call it.
4351 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
4352 method instead of plt_entry_size.
4353 (Output_data_plt_i386::plt_entry_size)
4354 (Output_data_plt_i386::plt_eh_frame_fde_size)
4355 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
4356 (Output_data_plt_i386_standard): ... here, new class.
4357 (Output_data_plt_i386_exec): New class.
4358 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
4359 (Output_data_plt_i386_exec::first_plt_entry): ... here.
4360 (Output_data_plt_i386::exec_plt_entry): Move to ...
4361 (Output_data_plt_i386_exec::plt_entry): ... here.
4362 (Output_data_plt_i386_dyn): New class.
4363 (Output_data_plt_i386::first_plt_entry): Move to ...
4364 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
4365 (Output_data_plt_i386::dyn_plt_entry): Move to ...
4366 (Output_data_plt_i386_dyn::plt_entry): ... here.
4367 (Target_i386::Target_i386): Take optional argument for the Target_info
4368 pointer to use.
4369 (Target_i386::do_make_data_plt): New virtual method.
4370 (Target_i386::make_data_plt): New method to call it.
4371 (Target_i386::make_plt_section): Use that.
4372 Call this->plt_->add_eh_frame method here.
4373 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
4374 rather than plt_entry_size variable.
4375 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
4376 (Output_data_plt_i386::address_for_local): Likewise.
4377 (Output_data_plt_i386::do_write): Likewise.
4378 Move guts of PLT filling to...
4379 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
4380 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
4381 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
4382 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
4383
4384 2012-05-01 Cary Coutant <ccoutant@google.com>
4385
4386 * dwarf_reader.cc (Dwarf_die::read_attributes)
4387 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
4388 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
4389 * reduced_debug_output.cc
4390 (Output_reduced_debug_info_section::get_die_end): Remove
4391 DW_FORM_GNU_ref_index. Add default case.
4392
4393 2012-04-26 Mark Wielaard <mjw@redhat.com>
4394
4395 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
4396 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
4397 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
4398 DW_AT_high_pc as offset from DW_AT_low_pc.
4399
4400 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
4401 * testsuite/Makefile.in: Regenerate.
4402 * testsuite/gdb_index_test_3.c: New test source file.
4403 * testsuite/gdb_index_test_3.sh: New test source file.
4404
4405 2012-04-25 Ian Lance Taylor <iant@google.com>
4406
4407 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
4408 pointer.
4409 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
4410 as a class, not a struct.
4411 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
4412 (Target_arm::apply_cortex_a8_workaround): Likewise.
4413 * gc.h: Declare Reloc_types as a struct, not a class.
4414 * object.h: Declare Symbols_data as a struct.
4415 * reloc.h: Declare Read_relocs_data as a struct.
4416 * target.h: Declare Relocate_info as a struct.
4417
4418 2012-04-24 David S. Miller <davem@davemloft.net>
4419
4420 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
4421 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
4422 and R_SPARC_WPLT30.
4423
4424 2012-04-24 Cary Coutant <ccoutant@google.com>
4425
4426 * incremental-dump.cc (find_input_containing_global): Replace
4427 magic number with symbolic constant.
4428 (dump_incremental_inputs): Update version number.
4429 * incremental.cc (Output_section_incremental_inputs): Update version
4430 number; import symbolic constants from Incremental_inputs_reader.
4431 (Incremental_inputs::create_data_sections): Align relocations
4432 section correctly for 64-bit targets.
4433 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
4434 constants; add padding.
4435 (Output_section_incremental_inputs::write_header): Add assert for
4436 header_size.
4437 (Output_section_incremental_inputs::write_input_files): Add assert
4438 for input_entry_size.
4439 (Output_section_incremental_inputs::write_info_blocks): Add padding;
4440 add assert for object_info_size, input_section_entry_size,
4441 global_sym_entry_size.
4442 * incremental.h (Incremental_inputs_reader): Add symbolic constants
4443 for data structure sizes; use them.
4444 (Incremental_input_entry_reader): Import symbolic constants from
4445 Incremental_inputs_reader; use them.
4446
4447 2012-04-23 David S. Miller <davem@davemloft.net>
4448
4449 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
4450 and elf_flags_set_.
4451 (Target_sparc::Target_sparc): Initialize new fields.
4452 (Target_sparc::do_make_elf_object): New function.
4453 (Target_sparc::do_adjust_elf_header): New function.
4454
4455 2012-04-23 Cary Coutant <ccoutant@google.com>
4456
4457 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
4458 CU range table of gdb index.
4459
4460 2012-04-20 David S. Miller <davem@davemloft.net>
4461
4462 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
4463 instead of false.
4464
4465 2012-04-16 David S. Miller <davem@davemloft.net>
4466
4467 * sparc.cc (Target_sparc::got_address): New function.
4468 (Sparc_relocate_functions::gdop_hix22): New function.
4469 (Sparc_relocate_functions::gdop_lox10): New function.
4470 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
4471 relocs.
4472 (Target_sparc::Scan::local): Likewise if the global symbol is not
4473 preemptible and is not IFUNC.
4474 (Target_sparc::Relocate::relocate): Perform GOTDATA code
4475 transformations for local and non-preemptible non-IFUNC global
4476 symbols.
4477
4478 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
4479 writing out 64-bit part of ranges.
4480
4481 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
4482 -fpic and -fpie respectively.
4483 * Makefile.in: Regenerate.
4484
4485 * sparc.cc (class Target_sparc): Add rela_ifunc_.
4486 (Target_sparc::Target_sparc): Initialize new field.
4487 (Target_sparc::do_plt_section_for_global): New function.
4488 (Target_sparc::do_plt_section_for_local): New function.
4489 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
4490 (Target_sparc::make_plt_section): New function, broken out of
4491 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
4492 (Target_sparc::make_plt_entry): Call make_plt_section.
4493 (Target_sparc::make_local_ifunc_plt_entry): New function.
4494 (Target_sparc::rela_ifunc_section): New function.
4495 (Target_sparc::plt_section): Remove const.
4496 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
4497 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
4498 and ifunc_count_ fields.
4499 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
4500 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
4501 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
4502 (Output_data_plt_sparc::rela_ifunc): New function.
4503 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
4504 (Output_data_plt_sparc::has_ifunc_section): New function.
4505 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
4506 (Output_data_plt_sparc::address_for_global): New function.
4507 (Output_data_plt_sparc::address_for_local): New function.
4508 (Output_data_plt_sparc::plt_index_to_offset): New function.
4509 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
4510 and entry_count.
4511 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
4512 entry_count.
4513 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
4514 R_SPARC_JMP_IREL to switch.
4515 (Target_sparc::Scan::check_non_pic): Likewise.
4516 (Target_sparc::Scan::local): Handle IFUNC symbols.
4517 (Target_sparc::Scan::local): Likewise.
4518 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
4519 and plt_address_for_local.
4520 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
4521 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
4522
4523 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
4524 (class Output_data_reloc): Adjust calls to Output_reloc_type.
4525 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
4526 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
4527 global relocs too.
4528 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
4529 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
4530 calls.
4531 * sparc.cc (Target_sparc::Scan::global): Likewise.
4532 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4533
4534 2012-04-16 Cary Coutant <ccoutant@google.com>
4535
4536 * archive.cc (Library_base::should_include_member): Check for
4537 --export-dynamic-symbol.
4538 * options.h (class General_options): Add --export-dynamic-symbol.
4539 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
4540 --export-dynamic-symbol.
4541 (Symbol_table::gc_mark_undef_symbols): Likewise.
4542 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
4543
4544 2012-04-12 David S. Miller <davem@davemloft.net>
4545
4546 * sparc.cc (Reloc::wdisp10): New relocation method.
4547 (Reloc::h34): Likewise.
4548 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
4549 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
4550 R_SPARC_WDISP10.
4551 (Target_sparc::Scan::local): Likewise.
4552 (Target_sparc::Scan::global): Likewise.
4553 (Target_sparc::Relocate::relocate): Likewise.
4554
4555 2012-04-09 Cary Coutant <ccoutant@google.com>
4556
4557 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
4558 low_pc == 0.
4559
4560 2012-04-06 Ian Lance Taylor <iant@google.com>
4561
4562 * timer.cc: #include <unistd.h>.
4563
4564 2012-04-06 Roland McGrath <mcgrathr@google.com>
4565
4566 * configure.in (AC_CHECK_HEADERS): Add locale.h.
4567 * config.in: Regenerate.
4568 * configure: Regenerate.
4569
4570 2012-04-05 Nick Clifton <nickc@redhat.com>
4571
4572 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
4573 (AM_LC_MESSAGES): Add.
4574 * aclocal.m4: Regenerate.
4575 * config.in: Regenerate.
4576 * configure: Regenerate.
4577
4578 2012-03-21 Cary Coutant <ccoutant@google.com>
4579
4580 * Makefile.am: Add gdb-index.cc, gdb-index.h.
4581 * Makefile.in: Regenerate.
4582 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
4583 (Sized_elf_reloc_mapper::symbol_section): New function.
4584 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
4585 (make_elf_reloc_mapper): New function.
4586 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
4587 (Dwarf_abbrev_table::do_read_abbrevs): New function.
4588 (Dwarf_abbrev_table::do_get_abbrev): New function.
4589 (Dwarf_ranges_table::read_ranges_table): New function.
4590 (Dwarf_ranges_table::read_range_list): New function.
4591 (Dwarf_pubnames_table::read_section): New function.
4592 (Dwarf_pubnames_table::read_header): New function.
4593 (Dwarf_pubnames_table::next_name): New function.
4594 (Dwarf_die::Dwarf_die): New function.
4595 (Dwarf_die::read_attributes): New function.
4596 (Dwarf_die::skip_attributes): New function.
4597 (Dwarf_die::set_name): New function.
4598 (Dwarf_die::set_linkage_name): New function.
4599 (Dwarf_die::attribute): New function.
4600 (Dwarf_die::string_attribute): New function.
4601 (Dwarf_die::int_attribute): New function.
4602 (Dwarf_die::uint_attribute): New function.
4603 (Dwarf_die::ref_attribute): New function.
4604 (Dwarf_die::child_offset): New function.
4605 (Dwarf_die::sibling_offset): New function.
4606 (Dwarf_info_reader::check_buffer): New function.
4607 (Dwarf_info_reader::parse): New function.
4608 (Dwarf_info_reader::do_parse): New function.
4609 (Dwarf_info_reader::do_read_string_table): New function.
4610 (Dwarf_info_reader::lookup_reloc): New function.
4611 (Dwarf_info_reader::get_string): New function.
4612 (Dwarf_info_reader::visit_compilation_unit): New function.
4613 (Dwarf_info_reader::visit_type_unit): New function.
4614 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
4615 Sized_elf_reloc_mapper.
4616 (Sized_dwarf_line_info::symbol_section): Remove function.
4617 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
4618 (Sized_dwarf_line_info::read_line_mappings): Remove object
4619 parameter, adjust callers.
4620 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
4621 * dwarf_reader.h: Include <sys/types.h>.
4622 (class Track_relocs): Remove forward declaration.
4623 (class Elf_reloc_mapper): New class.
4624 (class Sized_elf_reloc_mapper): New class.
4625 (class Dwarf_abbrev_table): New class.
4626 (class Dwarf_range_list): New class.
4627 (class Dwarf_ranges_table): New class.
4628 (class Dwarf_pubnames_table): New class.
4629 (class Dwarf_die): New class.
4630 (class Dwarf_info_reader): New class.
4631 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
4632 (Sized_dwarf_line_info::symbol_section): Remove member function.
4633 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
4634 base class.
4635 * gdb-index.cc: New source file.
4636 * gdb-index.h: New source file.
4637 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
4638 and .debug_types sections, call Layout::add_to_gdb_index.
4639 (Sized_relobj_incr::do_section_name): Implement.
4640 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
4641 return type; Implement.
4642 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
4643 return type.
4644 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
4645 parameter list and return type.
4646 (Sized_incr_dynobj::do_section_contents): Likewise.
4647 * layout.cc: Include gdb-index.h.
4648 (Layout::Layout): Initialize gdb_index_data_.
4649 (Layout::init_fixed_output_section): Check for .gdb_index section.
4650 (Layout::add_to_gdb_index): New function. Instantiate.
4651 * layout.h: Add forward declaration for class Gdb_index.
4652 (Layout::add_to_gdb_index): New member function.
4653 (Layout::gdb_index_data_): New data member.
4654 * main.cc: Include gdb-index.h.
4655 (main): Print statistics for gdb index.
4656 * object.cc (Object::section_contents): Move code into
4657 do_section_contents.
4658 (need_decompressed_section): Check for sections needed when building
4659 gdb index.
4660 (build_compressed_section_map): Likewise.
4661 (Sized_relobj_file::do_read_symbols): Need local symbols when building
4662 gdb index.
4663 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
4664 sections; call Layout::add_to_gdb_index.
4665 (Sized_relobj_file::do_decompressed_section_contents): Call
4666 do_section_contents directly.
4667 * object.h (Object::do_section_contents): Adjust parameter list and
4668 return type.
4669 (Object::do_decompressed_section_contents): Call do_section_contents
4670 directly.
4671 (Sized_relobj_file::do_section_contents): Adjust parameter list and
4672 return type.
4673 * options.h (class General_options): Add --gdb-index option.
4674 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
4675 list and return type.
4676 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
4677 * reloc.h (Track_relocs::checkpoint): New function.
4678 (Track_relocs::reset): New function.
4679
4680 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
4681 New test cases.
4682 * testsuite/Makefile.in: Regenerate.
4683 * testsuite/gdb_index_test.cc: New test source file.
4684 * testsuite/gdb_index_test_1.sh: New test source file.
4685 * testsuite/gdb_index_test_2.sh: New test source file.
4686
4687 2012-03-19 Doug Kwan <dougkwan@google.com>
4688
4689 * arm.cc (Target_arm::do_define_standard_symbols): New method.
4690 (Target_arm::do_finalize_sections): Remove code which defines
4691 __exidx_start and __exidx_end. Make symbol table parameter
4692 anonymous as it is not used.
4693 * gold.cc (queue_middle_tasks): Call target hook to define any
4694 target-specific symbols.
4695 * target.h (Target::define_standard_symbols): New method.
4696 (Target::do_define_standard_symbols): Same.
4697 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
4698 * testsuite/Makefile.in: Regenerate.
4699 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
4700 and __exidx_end.
4701 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
4702 relocations are generated for __exidx_start and __exidx_end.
4703
4704 2012-03-16 Doug Kwan <dougkwan@google.com>
4705
4706 * testsuite/Makefile.am: Disable test initpri3b.
4707 * testsuite/Makefile.in: Regenerate.
4708
4709 2012-03-15 Doug Kwan <dougkwan@google.com>
4710
4711 * arm.cc (Target_arm::got_section): Make .got section read-only
4712 if -z now is given.
4713
4714 2012-03-15 Ian Lance Taylor <iant@google.com>
4715
4716 PR gold/13850
4717 * layout.cc (Layout::make_output_section): Correctly mark
4718 SHT_INIT_ARRAY, et. al., as relro.
4719
4720 2012-03-14 Doug Kwan <dougkwan@google.com>
4721
4722 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
4723 dynamic relocations for protected symbols in shared objects.
4724
4725 2012-03-13 Ian Lance Taylor <iant@google.com>
4726
4727 * resolve.cc (Symbol_table::resolve): When merging common symbols,
4728 keep the larger alignment.
4729
4730 2012-03-12 Cary Coutant <ccoutant@google.com>
4731
4732 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
4733 handling of DW_LNE_define_file.
4734
4735 2012-03-12 Cary Coutant <ccoutant@google.com>
4736
4737 * reduced_debug_output.cc
4738 (Output_reduced_debug_info_section::get_die_end): Add new FORM
4739 codes to switch.
4740
4741 2012-02-29 Cary Coutant <ccoutant@google.com>
4742
4743 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
4744
4745 2012-02-29 Cary Coutant <ccoutant@google.com>
4746
4747 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4748 Call Object::decompressed_section_contents.
4749 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
4750 New dtor.
4751 (Sized_dwarf_line_info::buffer_start_): New data member.
4752 * merge.cc (Output_merge_data::do_add_input_section): Call
4753 Object::decompressed_section_contents.
4754 (Output_merge_string::do_add_input_section): Likewise.
4755 * object.cc (need_decompressed_section): New function.
4756 (build_compressed_section_map): Decompress sections needed later.
4757 (Sized_relobj_file::do_decompressed_section_contents): New function.
4758 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4759 * object.h (Object::decompressed_section_contents): New function.
4760 (Object::discard_decompressed_sections): New function.
4761 (Object::do_decompressed_section_contents): New function.
4762 (Object::do_discard_decompressed_sections): New function.
4763 (Compressed_section_info): New type.
4764 (Compressed_section_map): Include decompressed section contents.
4765 (Sized_relobj_file::do_decompressed_section_contents): New function.
4766 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4767
4768 2012-02-16 Cary Coutant <ccoutant@google.com>
4769
4770 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
4771 * testsuite/Makefile.in: Regenerate.
4772
4773 2012-02-14 Cary Coutant <ccoutant@google.com>
4774
4775 * options.cc (General_options::finalize): Disallow -pie and -static.
4776
4777 2012-02-03 Doug Kwan <dougkwan@google.com>
4778
4779 * arm.cc (Arm_relocate_functions::abs8,
4780 Arm_relocate_functions::abs16): Use
4781 Bits::has_signed_unsigned_overflow32.
4782 (Arm_relocate_functions::thm_abs8): Correct range of
4783 overflow check.
4784 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
4785 in assertions.
4786
4787 2012-02-02 Doug Kwan <dougkwan@google.com>
4788
4789 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
4790 position independent outputs, not just shared objects.
4791
4792 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
4793
4794 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
4795 * configure: Regenerated.
4796
4797 2012-01-27 Ian Lance Taylor <iant@google.com>
4798
4799 * reloc.h (Bits): New class with static functions, copied from
4800 namespace utils in arm.cc.
4801 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
4802 instead.
4803
4804 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4805
4806 * incremental.cc (write_info_blocks): Correct relocation offset.
4807
4808 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4809
4810 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
4811 (Relocate::tls_gd_to_le): Likewise.
4812
4813 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4814
4815 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
4816
4817 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4818
4819 * configure.ac: Check if -mcmodel=medium works.
4820 * configure: Regenerated.
4821
4822 2012-01-24 Cary Coutant <ccoutant@google.com>
4823
4824 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
4825 definition and ...
4826 (read_unsigned_LEB_128_x): ... this new function.
4827 (read_signed_LEB_128): Replaced with inline definition and ...
4828 (read_signed_LEB_128_x): ... this new function.
4829 * int_encoding.h (read_unsigned_LEB_128_x): New function.
4830 (read_unsigned_LEB_128): Add inline definition.
4831 (read_signed_LEB_128_x): New function.
4832 (read_signed_LEB_128): Add inline definition.
4833 * testsuite/Makefile.am (leb128_unittest): New unit test.
4834 * testsuite/Makefile.in: Regenerate.
4835 * testsuite/leb128_unittest.cc: New unit test.
4836
4837 2012-01-23 Ian Lance Taylor <iant@google.com>
4838
4839 PR gold/13617
4840 * i386.cc (Target_i386::do_code_fill): When using a jmp
4841 instruction, pad with nop instructions.
4842 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4843
4844 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
4845
4846 * x86_64.cc (gc_process_relocs): Add typename on types used in
4847 template.
4848 (scan_relocs): Likewise.
4849 (relocate_section): Likewise.
4850 (apply_relocation): Likewise.
4851
4852 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
4853
4854 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
4855 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
4856 under x32.
4857
4858 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
4859
4860 * x86_64.cc: Initial support for x32.
4861
4862 2012-01-03 Cary Coutant <ccoutant@google.com>
4863
4864 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
4865 Use abstract base class for GOT.
4866 * gold/output.h (class Output_data_got_base): New abstract base class.
4867 (class Output_data_got): Derive from new base class, adjust ctors.
4868 (Output_data_got::reserve_slot): Make virtual; rename to
4869 do_reserve_slot; Adjust callers.
4870 * gold/target.h (Sized_target::init_got_plt_for_update): Return
4871 pointer to abstract base class.
4872 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
4873
4874 2011-12-18 Ian Lance Taylor <iant@google.com>
4875
4876 * object.h (Relobj::local_symbol_value): New function.
4877 (Relobj::local_plt_offset): New function.
4878 (Relobj::local_has_got_offset): New function.
4879 (Relobj::local_got_offset): New function.
4880 (Relobj::set_local_got_offset): New function.
4881 (Relobj::do_local_symbol_value): New pure virtual function.
4882 (Relobj::do_local_plt_offset): Likewise.
4883 (Relobj::do_local_has_got_offset): Likewise.
4884 (Relobj::do_local_got_offset): Likewise.
4885 (Relobj::do_set_local_got_offset): Likewise.
4886 (Sized_relobj::do_local_has_got_offset): Rename from
4887 local_has_got_offset.
4888 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
4889 (Sized_relobj::do_set_local_got_offset): Rename from
4890 set_local_got_offset.
4891 (Sized_relobj_file::do_local_plt_offset): Rename from
4892 local_plt_offset.
4893 (Sized_relobj_file::do_local_symbol_value): New function.
4894 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
4895 local_plt_offset.
4896 * output.cc (Output_data_got::Got_entry::write): Change object to
4897 Relobj. Use local_symbol_value.
4898 (Output_data_got::add_global_with_rel): Change rel_dyn to
4899 Output_data_reloc_generic*. Use add_global_generic.
4900 (Output_data_got::add_global_with_rela): Remove. Change all
4901 callers to use add_global_with_rel.
4902 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
4903 Output_data_reloc_generic*. Use add_global_generic.
4904 (Output_data_got::add_global_pair_with_rela): Remove. Change all
4905 callers to use add_global_pair_with_rel.
4906 (Output_data_got::add_local): Change object to Relobj*.
4907 (Output_data_got::add_local_plt): Likewise.
4908 (Output_data_got::add_local_with_rel): Change object to Relobj*,
4909 change rel_dyn to Output_data_reloc_generic*. Use
4910 add_local_generic.
4911 (Output_data_got::add_local_with_rela): Remove. Change all
4912 callers to use all_local_with_rel.
4913 (Output_data_got::add_local_pair_with_rel): Change object to
4914 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
4915 add_output_section_generic.
4916 (Output_data_got::add_local_pair_with_rela): Remove. Change all
4917 callers to use add_local_pair_with_rel.
4918 (Output_data_got::reserve_local): Change object to Relobj*.
4919 * output.h: (class Output_data_reloc_generic): Add pure virtual
4920 declarations for add_global_generic, add_local_generic,
4921 add_output_section_generic.
4922 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
4923 functions for Output_data_reloc_generic. Update declarations for
4924 changes listed in output.cc.
4925 (class Output_data_got): Change template parameter to got_size.
4926 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
4927 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
4928 function.
4929 (Sized_relobj_incr::do_local_plt_offset): New function.
4930 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
4931 add_global_generic.
4932
4933 2011-12-17 Cary Coutant <ccoutant@google.com>
4934
4935 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
4936 * resolve.cc (Symbol_table::resolve): Likewise.
4937 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
4938 arrays.
4939 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4940
4941 2011-12-16 Ian Lance Taylor <iant@google.com>
4942
4943 * output.h (Output_data_reloc_generic::add): Only call
4944 add_dynamic_reloc if this is a dynamic reloc section.
4945
4946 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
4947
4948 PR gold/13505
4949 * target-reloc.h (apply_relocation): Replace <64, false> with
4950 <size, big_endian>.
4951
4952 2011-11-25 Nick Clifton <nickc@redhat.com>
4953
4954 * po/it.po: New Italian translation.
4955
4956 2011-11-17 Sterling Augustine <saugustine@google.com>
4957
4958 * script.cc (script_include_directive): Implement.
4959 (read_script_file): New local variables name and search_path. Update
4960 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
4961 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
4962 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
4963
4964 2011-11-11 Sterling Augustine <saugustine@google.com>
4965
4966 * yyscript.y (section_cmd): Add support for INCLUDE directive.
4967 (file_or_sections_cmd): Likewise.
4968
4969 2011-11-11 Doug Kwan <dougkwan@google.com>
4970
4971 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
4972 if --just-symbols is given.
4973
4974 2011-11-10 Doug Kwan <dougkwan@google.com>
4975
4976 PR gold/13362
4977 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
4978 when processing data relocs.
4979 * reloc.h (Relocate_functions::rel_unaligned): New method.
4980 (Relocate_functions::pcrel_unaligned): Ditto.
4981 (Relocate_functions::rel32_unaligned): Ditto.
4982 (Relocate_functions::pcrel32_unaligned): Ditto.
4983
4984 2011-11-09 Doug Kwan <dougkwan@google.com>
4985
4986 PR gold/13362
4987 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
4988 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
4989 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
4990 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4991 (Relocate_functions::rel_unaligned): New.
4992 (Relocate_functions::rel32_unaligned): New.
4993 * target-reloc.h (relocate_for_relocatable): Add code to handle
4994 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4995 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
4996 arm_unaligned_reloc_r): New targets.
4997 * testsuite/Makefile.in: Regenerate.
4998 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
4999 linking.
5000
5001 2011-11-02 Ian Lance Taylor <iant@google.com>
5002
5003 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
5004 NATIVE_LINKER.
5005 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
5006 * options.cc (General_options::finalize): Use library search path
5007 from configure script if specified. If not native and no sysroot,
5008 only search TOOLLIBDIR.
5009 * options.h (Search_directory::Search_directory): Change name to
5010 const std::string&.
5011 (General_options::add_to_library_path_with_sysroot): Change arg to
5012 const std::string&.
5013 * configure, Makefile.in, config.in: Rebuild.
5014
5015 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5016
5017 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
5018 we are working around the ARM1176 Erratum.
5019 * options.h (General_options::fix_arm1176): Add option.
5020 * testsuite/Makefile.am: Add testcases, and keep current ones
5021 working.
5022 * testsuite/Makefile.in: Regenerate.
5023 * testsuite/arm_fix_1176.s: New file.
5024 * testsuite/arm_fix_1176.sh: Likewise.
5025
5026 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5027
5028 * arm.cc (Target_arm::Target_arm): Remove initialisation of
5029 may_use_blx_.
5030 (Target_arm::may_use_blx): Remove method.
5031 (Target_arm::set_may_use_blx): Likewise.
5032 (Target_arm::may_use_v4t_interworking): New method.
5033 (Target_arm::may_use_v5t_interworking): Likewise.
5034 (Target_arm::may_use_blx_): Remove member variable.
5035 (Arm_relocate_functions::arm_branch_common): Check for v5T
5036 interworking.
5037 (Arm_relocate_functions::thumb_branch_common): Likewise.
5038 (Reloc_stub::stub_type_for_reloc): Likewise.
5039 (Target_arm::do_finalize_sections): Correct interworking checks.
5040 * testsuite/Makefile.am: Add new tests.
5041 * testsuite/Makefile.in: Regenerate.
5042 * testsuite/arm_farcall_arm_arm.s: New test.
5043 * testsuite/arm_farcall_arm_arm.sh: Likewise.
5044 * testsuite/arm_farcall_arm_thumb.s: Likewise.
5045 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
5046 * testsuite/arm_farcall_thumb_arm.s: Likewise.
5047 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
5048 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
5049 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
5050
5051 2011-10-31 Cary Coutant <ccoutant@google.com>
5052
5053 PR gold/13023
5054 * expression.cc (Expression::eval_with_dot): Add
5055 is_section_dot_assignment parameter.
5056 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
5057 absolute and assigning to dot within a section.
5058 * script-sections.cc
5059 (Output_section_element_assignment::set_section_addresses): Pass
5060 dot_section to set_if_absolute.
5061 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
5062 as is_section_dot_assignment flag to eval_with_dot.
5063 (Output_section_element_dot_assignment::set_section_addresses):
5064 Likewise.
5065 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
5066 parameter. Also set value if relative to dot_section; set the
5067 symbol's output_section.
5068 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
5069 parameter. Adjust all callers.
5070 (Expression::eval_maybe_dot): Likewise.
5071 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
5072 Adjust all callers.
5073 * testsuite/script_test_2.t: Test assignment of an absolute value
5074 to dot within an output section element.
5075
5076 2011-10-31 Cary Coutant <ccoutant@google.com>
5077
5078 * options.h (class General_options): Add --[no-]gnu-unique options.
5079 * symtab.cc (Symbol_table::sized_write_globals): Convert
5080 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
5081
5082 2011-10-31 Cary Coutant <ccoutant@google.com>
5083
5084 PR gold/13359
5085 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
5086 unnecessary assertion.
5087 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
5088
5089 2011-10-31 Sriraman Tallam <tmsriram@google.com>
5090
5091 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5092 gc_mark_symbol.
5093 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5094 gc_mark_symbol.
5095 Change to just keep the section associated with symbol.
5096 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
5097 they are externally visible and --export-dynamic is turned on.
5098 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
5099
5100 2011-10-19 Ian Lance Taylor <iant@google.com>
5101
5102 PR gold/13163
5103 * script-sections.cc
5104 (Output_section_element_dot_assignment::needs_output_section): New
5105 function.
5106
5107 2011-10-19 Ian Lance Taylor <iant@google.com>
5108
5109 PR gold/13204
5110 * layout.cc (Layout::segment_precedes): Don't assert failure if a
5111 --section-start option was seen.
5112 * options.h (General_options::any_section_start): New function.
5113
5114 2011-10-18 David S. Miller <davem@davemloft.net>
5115
5116 PR binutils/13301
5117 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
5118 member to track relocation locations that have moved during TLS
5119 reloc optimizations.
5120 (Target_sparc::Relocate::Relocate): Initialize to NULL.
5121 (Target_sparc::Relocate::relocate): Adjust view down by 4
5122 bytes if it matches reloc_adjust_addr_.
5123 (Target_sparc::Relocate::relocate_tls): Always move the
5124 __tls_get_addr call delay slot instruction forward 4 bytes when
5125 performing relaxation.
5126
5127 2011-10-18 Cary Coutant <ccoutant@google.com>
5128
5129 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
5130 (Output_file::map_no_anonymous): Check for non-zero
5131 return code from posix_fallocate.
5132
5133 2011-10-17 Cary Coutant <ccoutant@google.com>
5134
5135 PR gold/13245
5136 * plugin.cc (is_visible_from_outside): Check for symbols
5137 referenced from dynamic objects.
5138 * resolve.cc (Symbol_table::resolve): Don't count references
5139 from dynamic objects as references from real ELF files.
5140 * testsuite/plugin_test_2.sh: Adjust expected result.
5141
5142 2011-10-17 Cary Coutant <ccoutant@google.com>
5143
5144 * gold.cc: Include timer.h.
5145 (queue_middle_tasks): Stamp time.
5146 (queue_final_tasks): Likewise.
5147 * main.cc (main): Store timer in parameters. Print timers
5148 for each pass.
5149 * parameters.cc (Parameters::Parameters): Initialize timer_.
5150 (Parameters::set_timer): New function.
5151 (set_parameters_timer): New function.
5152 * parameters.h (Parameters::set_timer): New function.
5153 (Parameters::timer): New function.
5154 (Parameters::timer_): New data member.
5155 (set_parameters_timer): New function.
5156 * timer.cc (Timer::stamp): New function.
5157 (Timer::get_pass_time): New function.
5158 * timer.h (Timer::stamp): New function.
5159 (Timer::get_pass_time): New function.
5160 (Timer::pass_times_): New data member.
5161
5162 2011-10-17 Cary Coutant <ccoutant@google.com>
5163
5164 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
5165 task for members of lib groups.
5166
5167 2011-10-17 Cary Coutant <ccoutant@google.com>
5168
5169 PR gold/13288
5170 * fileread.cc (File_read::find_view): Add assert.
5171 (File_read::make_view): Move bounds check (replace with assert)...
5172 (File_read::find_or_make_view): ... to here.
5173
5174 2011-10-12 Cary Coutant <ccoutant@google.com>
5175
5176 * output.cc (Output_file::open_base_file): Handle case where
5177 ::read returns less than requested size.
5178
5179 2011-10-10 Cary Coutant <ccoutant@google.com>
5180
5181 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
5182 Initialize defined_count_.
5183 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
5184 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
5185 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
5186 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
5187 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
5188 * incremental.h (Sized_relobj_incr::defined_count_): New data
5189 member.
5190 (Sized_incr_dynobj::defined_count_): New data member.
5191 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
5192 Return zeroes instead of internal error.
5193
5194 2011-10-10 Cary Coutant <ccoutant@google.com>
5195
5196 PR gold/13249
5197 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
5198 (Output_reloc::symbol_value): Return PLT offset if flag is set.
5199 * output.h (class Output_reloc): Add use_plt_offset flag.
5200 (Output_reloc::type_): Adjust size of bit field.
5201 (Output_reloc::use_plt_offset_): New bit field.
5202 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
5203 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
5204 flag. Adjust all callers.
5205 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
5206 creating RELATIVE relocations.
5207
5208 2011-10-10 Nick Clifton <nickc@redhat.com>
5209
5210 * po/es.po: Updated Spanish translation.
5211 * po/fi.po: Updated Finnish translation.
5212
5213 2011-10-03 Diego Novillo <dnovillo@google.com>
5214
5215 * options.cc (parse_uint): Fix dereference of RETVAL.
5216
5217 2011-09-29 Sriraman Tallam <tmsriram@google.com>
5218
5219 * layout.h (section_order_map_): New member.
5220 (get_section_order_map): New member function.
5221 * output.cc (Output_section::add_input_section): Check for patterns
5222 only when --section-ordering-file is specified.
5223 * gold.cc (queue_middle_tasks): Delay updating order of sections till
5224 output_sections have been formed.
5225 * layout.cc (Layout_Layout): Initialize section_order_map_.
5226 * plugin.cc (update_section_order): Store order in order_map. Do not
5227 update the order.
5228 * testsuite/Makefile.am: Add test case for plugin_final_layout.
5229 * testsuite/Makefile.in: Regenerate.
5230 * testsuite/plugin_section_order.c: New file.
5231 * testsuite/plugin_final_layout.cc: New file.
5232 * testsuite/plugin_final_layout.sh: New file.
5233
5234 2011-09-29 Cary Coutant <ccoutant@google.com>
5235
5236 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
5237 Check for NULL.
5238 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
5239 symbols during incremental update.
5240 (Symbol_table::add_from_dynobj): Likewise.
5241
5242 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5243 Ian Lance Taylor <iant@google.com>
5244
5245 * symtab.cc (Symbol_table::define_special_symbol): Always
5246 canonicalize version string.
5247
5248 2011-09-26 Cary Coutant <ccoutant@google.com>
5249
5250 * gold.cc (queue_initial_tasks): Move option checks ...
5251 * options.cc (General_options::finalize): ... to here. Disable
5252 some options; make others fatal.
5253
5254 2011-09-26 Cary Coutant <ccoutant@google.com>
5255
5256 gcc PR lto/47247
5257 * plugin.cc (get_symbols_v2): New function.
5258 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
5259 (is_referenced_from_outside): New function.
5260 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
5261 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
5262 (get_symbols): Pass version parameter.
5263 (get_symbols_v2): New function.
5264 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
5265 parameter.
5266 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
5267 (onload): Add LDPT_GET_SYMBOLS_V2.
5268 (all_symbols_read_hook): Use get_symbols_v2; check for
5269 LDPR_PREVAILING_DEF_IRONLY_EXP.
5270 * testsuite/plugin_test_3.sh: Update expected results.
5271
5272 2011-09-23 Simon Baldwin <simonb@google.com>
5273
5274 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
5275 configuration options.
5276 * configure: Regenerate.
5277 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
5278 * Makefile.in: Regenerate.
5279 * testsuite/Makefile.in: Regenerate.
5280
5281 2011-09-19 Sriraman Tallam <tmsriram@google.com>
5282
5283 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
5284
5285 2011-09-19 Cary Coutant <ccoutant@google.com>
5286
5287 * incremental.cc (can_incremental_update): Fix typo in comment.
5288 * incremental.h (can_incremental_update): Likewise.
5289
5290 2011-09-18 Cary Coutant <ccoutant@google.com>
5291
5292 * incremental.cc (can_incremental_update): New function.
5293 * incremental.h (can_incremental_update): New function.
5294 * layout.cc (Layout::init_fixed_output_section): Call it.
5295 (Layout::make_output_section): Don't allow patch space in .eh_frame.
5296 * object.cc (Sized_relobj_file::do_layout): Call
5297 can_incremental_update.
5298
5299 2011-09-13 Cary Coutant <ccoutant@google.com>
5300
5301 * configure.ac: Check for glibc support for gnu_indirect_function
5302 support with static linking, setting automake conditional
5303 IFUNC_STATIC.
5304 * Makefile.in: Regenerate.
5305 * configure: Regenerate.
5306
5307 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
5308 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
5309 for IFUNC_STATIC.
5310 * testsuite/Makefile.in: Regenerate.
5311
5312 2011-09-13 Cary Coutant <ccoutant@google.com>
5313
5314 * incremental.cc (Sized_relobj_incr::do_layout): Call
5315 report_comdat_group for kept comdat sections.
5316 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
5317 * testsuite/Makefile.in: Regenerate.
5318 * testsuite/incr_comdat_test_1.cc: New source file.
5319 * testsuite/incr_comdat_test_2_v1.cc: New source file.
5320 * testsuite/incr_comdat_test_2_v2.cc: New source file.
5321 * testsuite/incr_comdat_test_2_v3.cc: New source file.
5322
5323 2011-09-13 Ian Lance Taylor <iant@google.com>
5324
5325 * object.cc (Sized_relobj_file::do_layout): Remove unused local
5326 variable external_symbols_offset.
5327
5328 2011-09-12 Ian Lance Taylor <iant@google.com>
5329
5330 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
5331 triggered if object has no symbols.
5332
5333 2011-09-09 David S. Miller <davem@davemloft.net>
5334
5335 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
5336 (Output_fill_debug_line::do_write): Likewise.
5337
5338 2011-08-29 Cary Coutant <ccoutant@google.com>
5339
5340 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
5341 casts to match formatting specs.
5342 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
5343
5344 2011-08-26 Cary Coutant <ccoutant@google.com>
5345
5346 * layout.cc (Free_list::allocate): Provide guarantee of minimum
5347 remaining hole size when allocating.
5348 (Layout::make_output_section): Set fill methods for debug sections.
5349 * layout.h (Free_list::Free_list_node): Move from private to
5350 public.
5351 (Free_list::set_min_hole_size): New function.
5352 (Free_list::begin, Free_list::end): New functions.
5353 (Free_list::min_hole_): New data member.
5354 * output.cc: Include dwarf.h.
5355 (Output_fill_debug_info::do_minimum_hole_size): New function.
5356 (Output_fill_debug_info::do_write): New function.
5357 (Output_fill_debug_line::do_minimum_hole_size): New function.
5358 (Output_fill_debug_line::do_write): New function.
5359 (Output_section::Output_section): Initialize new data member.
5360 (Output_section::set_final_data_size): Ensure patch space is larger
5361 than minimum hole size.
5362 (Output_section::do_write): Fill holes in debug sections.
5363 * output.h (Output_fill): New class.
5364 (Output_fill_debug_info): New class.
5365 (Output_fill_debug_line): New class.
5366 (Output_section::set_free_space_fill): New function.
5367 (Output_section::free_space_fill_): New data member.
5368 * testsuite/Makefile.am (incremental_test_3): Add
5369 --incremental-patch option.
5370 (incremental_test_4): Likewise.
5371 (incremental_test_5): Likewise.
5372 (incremental_test_6): Likewise.
5373 (incremental_copy_test): Likewise.
5374 (incremental_common_test_1): Likewise.
5375 * testsuite/Makefile.in: Regenerate.
5376
5377 2011-08-26 Nick Clifton <nickc@redhat.com>
5378
5379 * po/es.po: Updated Spanish translation.
5380
5381 2011-08-01 Cary Coutant <ccoutant@google.com>
5382
5383 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
5384 * gold/testsuite/Makefile.in: Regenerate.
5385 * gold/testsuite/justsyms_exec.c: New source file.
5386 * gold/testsuite/justsyms_lib.c: New source file.
5387
5388 2011-08-01 Cary Coutant <ccoutant@google.com>
5389
5390 * layout.cc (Layout::set_segment_offsets): Don't realign text
5391 segment if -Ttext was specified.
5392 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
5393 file type.
5394 * object.h (Sized_relobj_file::e_type): New function.
5395 (Sized_relobj_file::e_type_): New data member.
5396 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
5397 base address for ET_EXEC files.
5398 * target.cc (Target::do_make_elf_object_implementation): Allow
5399 ET_EXEC files with --just-symbols option.
5400
5401 2011-07-28 Cary Coutant <ccoutant@google.com>
5402
5403 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
5404 Add thread_number parameter.
5405 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
5406 * workqueue-threads.cc
5407 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
5408 current thread if its thread number is greater than desired thread
5409 count.
5410 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
5411 Add thread_number parameter.
5412 (Workqueue::should_cancel_thread): Likewise.
5413 (Workqueue::find_runnable_or_wait): Pass thread_number to
5414 should_cancel_thread.
5415 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
5416 parameter.
5417
5418 2011-07-22 Sriraman Tallam <tmsriram@google.com>
5419
5420 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
5421 only after checking if it cannot be forced local.
5422 * symtab.h (is_externally_visible): Check if the symbol is not forced
5423 local.
5424
5425 2011-07-15 Ian Lance Taylor <iant@google.com>
5426
5427 * options.h (class General_options): Add --print-output-format.
5428 Move -EL next to -EB, for better --help output.
5429 * target-select.cc: Include <cstdio>, "options.h", and
5430 "parameters.h".
5431 (Target_selector::do_target_bfd_name): New function.
5432 (print_output_format): New function.
5433 * target-select.h (class Target_selector): Update declarations.
5434 (Target_selector::target_bfd_name): New function.
5435 (print_output_format): Declare.
5436 * main.cc: Include "target-select.h".
5437 (main): Handle --print-output-format.
5438 * gold.cc: Include "target-select.h".
5439 (queue_initial_tasks): Handle --print-output-format when there are
5440 no input files.
5441 * parameters.cc (parameters_force_valid_target): Give a better
5442 error message if -EB/-EL does not match target.
5443 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
5444 function.
5445
5446 2011-07-15 Ian Lance Taylor <iant@google.com>
5447
5448 * i386.cc (class Output_data_plt_i386): Add layout_ field.
5449 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
5450 (Output_data_plt_i386::do_write): Write address of .dynamic
5451 section to first entry in .got.plt section.
5452 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
5453 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5454 Initialize layout_.
5455 (Output_data_plt_x86_64::do_write): Write address of .dynamic
5456 section to first entry in .got.plt section.
5457 * layout.h (Layout::dynamic_section): New function.
5458
5459 2011-07-13 Sriraman Tallam <tmsriram@google.com>
5460
5461 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
5462 to claim_file call.
5463 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
5464 input_section_position_, and input_section_glob_.
5465 (read_layout_from_file): Call function section_ordering_specified.
5466 * layout.h (is_section_ordering_specified): New function.
5467 (section_ordering_specified): New function.
5468 (section_ordering_specified_): New boolean member.
5469 * main.cc(main): Call load_plugins after layout object is defined.
5470 * output.cc (Output_section::add_input_section): Use
5471 function section_ordering_specified to check if section ordering is
5472 needed.
5473 * output.cc (Output_section::add_relaxed_input_section): Use
5474 function section_ordering_specified to check if section ordering is
5475 needed.
5476 (Output_section::update_section_layout): New function.
5477 (Output_section::sort_attached_input_sections): Check if input section
5478 must be reordered.
5479 * output.h (Output_section::update_section_layout): New function.
5480 * plugin.cc (get_section_count): New function.
5481 (get_section_type): New function.
5482 (get_section_name): New function.
5483 (get_section_contents): New function.
5484 (update_section_order): New function.
5485 (allow_section_ordering): New function.
5486 (Plugin::load): Add the new interfaces to the transfer vector.
5487 (Plugin_manager::load_plugins): New parameter.
5488 (Plugin_manager::all_symbols_read): New parameter.
5489 (Plugin_manager::claim_file): New parameter. Save the elf object for
5490 unclaimed objects.
5491 (Plugin_manager::get_elf_object): New function.
5492 (Plugin_manager::get_view): Change to directly use the bool to check
5493 if get_view is called from claim_file_hook.
5494 * plugin.h (input_objects): New function
5495 (Plugin__manager::load_plugins): New parameter.
5496 (Plugin_manager::claim_file): New parameter.
5497 (Plugin_manager::get_elf_object): New function.
5498 (Plugin_manager::in_claim_file_handler): New function.
5499 (Plugin_manager::in_claim_file_handler_): New member.
5500 (layout): New function.
5501 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
5502 handler with an extra parameter. Make the elf object before calling
5503 claim_file handler.
5504 * testsuite/plugin_test.c (get_section_count): New function pointer.
5505 (get_section_type): New function pointer.
5506 (get_section_name): New function pointer.
5507 (get_section_contents): New function pointer.
5508 (update_section_order): New function pointer.
5509 (allow_section_ordering): New function pointer.
5510 (onload): Check if the new interfaces exist.
5511
5512 2011-07-13 Ian Lance Taylor <iant@google.com>
5513
5514 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
5515 relro section.
5516 * x86_64.cc (Target_x86_64::got_section): Likewise.
5517 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
5518 (relro_now_test_SOURCES): New variable.
5519 (relro_now_test_DEPENDENCIES): New variable.
5520 (relro_now_test_LDFLAGS): New variable.
5521 (relro_now_test_LDADD): New variable.
5522 (relro_now_test.so): New target.
5523 * testsuite/Makefile.in: Rebuild.
5524
5525 2011-07-12 Ian Lance Taylor <iant@google.com>
5526
5527 PR gold/12980
5528 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
5529 GLOB_DAT relocation rather than a RELATIVE relocation for a
5530 protected symbol when creating a shared library.
5531 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5532 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
5533 * testsuite/protected_main_1.cc (main): Test that protected
5534 function has same address.
5535
5536 2011-07-11 Ian Lance Taylor <iant@google.com>
5537
5538 PR gold/12979
5539 * options.h (class General_options): Add -Bgroup.
5540 * options.cc (General_options::finalize): If -Bgroup is set,
5541 default to --unresolved-symbols=report-all.
5542 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
5543 * target-reloc.h (issue_undefined_symbol_error): Handle
5544 --unresolved-symbols=report-all.
5545
5546 2011-07-08 Ian Lance Taylor <iant@google.com>
5547
5548 PR gold/11985
5549 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
5550 if linker script discards key sections.
5551 (Layout::create_dynamic_symtab): Likewise.
5552 (Layout::assign_local_dynsym_offsets): Likewise.
5553 (Layout::sized_create_version_sections): Likewise.
5554 (Layout::create_interp): Likewise.
5555 (Layout::finish_dynamic_section): Likewise.
5556 (Layout::set_dynamic_symbol_size): Likewise.
5557
5558 2011-07-08 Ian Lance Taylor <iant@google.com>
5559
5560 PR gold/12386
5561 * options.h (class General_options): Add --unresolved-symbols.
5562 * target-reloc.h (issue_undefined_symbol_error): Check
5563 --unresolved-symbols. Add comments.
5564
5565 2011-07-08 Ian Lance Taylor <iant@google.com>
5566
5567 * testsuite/odr_violation2.cc (Ordering::operator()): Make
5568 expression more complex.
5569
5570 2011-07-08 Ian Lance Taylor <iant@google.com>
5571
5572 PR gold/11317
5573 * target-reloc.h (issue_undefined_symbol_error): New inline
5574 function, broken out of relocate_section.
5575 (relocate_section): Call issue_undefined_symbol_error.
5576 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5577 there is no TLS segment if we are about to issue an undefined
5578 symbol error.
5579 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5580
5581 2011-07-08 Ian Lance Taylor <iant@google.com>
5582
5583 PR gold/12279
5584 * resolve.cc (Symbol_table::should_override): Add fromtype
5585 parameter. Change all callers. Give error when linking together
5586 TLS and non-TLS symbol.
5587 (Symbol_table::should_override_with_special): Add fromtype
5588 parameter. Change all callers.
5589 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5590 there is no TLS segment if we have reported some errors.
5591 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5592
5593 2011-07-08 Ian Lance Taylor <iant@google.com>
5594
5595 PR gold/12372
5596 * target.h (Target::plt_address_for_global): New function.
5597 (Target::plt_address_for_local): New function.
5598 (Target::plt_section_for_global): Remove.
5599 (Target::plt_section_for_local): Remove.
5600 (Target::do_plt_address_for_global): New virtual function.
5601 (Target::do_plt_address_for_local): New virtual function.
5602 (Target::do_plt_section_for_global): Remove.
5603 (Target::do_plt_section_for_local): Remove.
5604 (Target::register_global_plt_entry): Add Symbol_table and Layout
5605 parameters.
5606 * output.cc (Output_data_got::Got_entry::write): Use
5607 plt_address_for_global and plt_address_for_local.
5608 * layout.cc (Layout::add_target_dynamic_tags): Use size and
5609 address of output section.
5610 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
5611 got_irelative_, and irelative_count_ fields. Update
5612 declarations.
5613 (Output_data_plt_i386::has_irelative_section): New function.
5614 (Output_data_plt_i386::entry_count): Add irelative_count_.
5615 (Output_data_plt_i386::set_final_data_size): Likewise.
5616 (class Target_i386): Add got_irelative_ and rel_irelative_
5617 fields. Update declarations.
5618 (Target_i386::Target_i386): Initialize new fields.
5619 (Target_i386::do_plt_address_for_global): New function replacing
5620 do_plt_section_for_global.
5621 (Target_i386::do_plt_address_for_local): New function replacing
5622 do_plt_section_for_local.
5623 (Target_i386::got_section): Create got_irelative_.
5624 (Target_i386::rel_irelative_section): New function.
5625 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
5626 fields. Don't define __rel_iplt_{start,end}.
5627 (Output_data_plt_i386::add_entry): Add symtab and layout
5628 parameters. Change all callers. Use different PLT and GOT for
5629 IFUNC symbols.
5630 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
5631 layout parameters. Change all callers. Use different PLT and
5632 GOT.
5633 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
5634 (Output_data_plt_i386::rel_irelative): New function.
5635 (Output_data_plt_i386::address_for_global): New function.
5636 (Output_data_plt_i386::address_for_local): New function.
5637 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
5638 IRELATIVE GOT when changing IFUNC GOT entries.
5639 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
5640 reloc.
5641 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
5642 if we didn't create an IRELATIVE GOT.
5643 (Target_i386::Relocate::relocate): Use plt_address_for_global and
5644 plt_address_for_local.
5645 (Target_i386::do_dynsym_value): Use plt_address_for_global.
5646 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
5647 got_irelative_, and irelative_count_ fields. Update
5648 declarations.
5649 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5650 Initialize new fields. Remove symtab parameter. Change all
5651 callers.
5652 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
5653 irelative_count_.
5654 (Output_data_plt_x86_64::has_irelative_section): New function.
5655 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
5656 (class Target_x86_64): Add got_irelative_ and rel_irelative_
5657 fields. Update declarations.
5658 (Target_x86_64::Target_x86_64): Initialize new fields.
5659 (Target_x86_64::do_plt_address_for_global): New function replacing
5660 do_plt_section_for_global.
5661 (Target_x86_64::do_plt_address_for_local): New function replacing
5662 do_plt_section_for_local.
5663 (Target_x86_64::got_section): Create got_irelative_.
5664 (Target_x86_64::rela_irelative_section): New function.
5665 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
5666 all callers. Don't create __rel_iplt_{start,end}.
5667 (Output_data_plt_x86_64::add_entry): Add symtab and layout
5668 parameters. Change all callers. Use different PLT and GOT for
5669 IFUNC symbols.
5670 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
5671 layout parameters. Change all callers. Use different PLT and
5672 GOT.
5673 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
5674 parameters. Change all callers. Use different PLT and GOT for
5675 IFUNC symbols.
5676 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
5677 (Output_data_plt_x86_64::rela_irelative): New function.
5678 (Output_data_plt_x86_64::address_for_global): New function.
5679 (Output_data_plt_x86_64::address_for_local): New function.
5680 (Output_data_plt_x86_64::set_final_data_size): Likewise.
5681 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
5682 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
5683 (Target_x86_64::register_global_plt_entry): Add symtab and layout
5684 parameters.
5685 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
5686 reloc.
5687 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
5688 symbols if we didn't create an IRELATIVE GOT.
5689 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
5690 plt_address_for_local.
5691 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
5692 * testsuite/ifuncvar1.c: New test file.
5693 * testsuite/ifuncvar2.c: New test file.
5694 * testsuite/ifuncvar3.c: New test file.
5695 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
5696 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
5697 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
5698 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
5699 * testsuite/Makefile.in: Rebuild.
5700
5701 2011-07-07 Cary Coutant <ccoutant@google.com>
5702
5703 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
5704 (two_file_test_1_ndebug.o): Likewise.
5705 (two_file_test_1b_ndebug.o): Likewise.
5706 (two_file_test_2_ndebug.o): Likewise.
5707 (two_file_test_main_ndebug.o): Likewise.
5708 (incremental_test_2): Link with no-debug versions.
5709
5710 2011-07-06 Cary Coutant <ccoutant@google.com>
5711
5712 * gold/incremental.cc
5713 (Output_section_incremental_inputs::write_info_blocks): Check for
5714 hidden and internal symbols.
5715
5716 2011-07-06 Cary Coutant <ccoutant@google.com>
5717
5718 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
5719 Check disposition for startup file.
5720 (Incremental_inputs::report_command_line): Ignore
5721 --incremental-startup-unchanged option.
5722 * options.cc (General_options::parse_incremental_startup_unchanged):
5723 New function.
5724 (General_options::General_options): Initialize new data member.
5725 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
5726 (General_options): Add --incremental-startup-unchanged option.
5727 (General_options::incremental_startup_disposition): New function.
5728 (General_options::incremental_startup_disposition_): New data member.
5729
5730 2011-07-06 Cary Coutant <ccoutant@google.com>
5731
5732 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
5733 input file index to Script_info ctor.
5734 (Sized_incremental_binary::do_file_has_changed): Find the
5735 command-line argument for files named in scripts.
5736 * incremental.h (Script_info::Script_info): New ctor
5737 with input file index.
5738 (Script_info::input_file_index): New function.
5739 (Script_info::input_file_index_): New data member.
5740 (Incremental_binary::get_library): Add const.
5741 (Incremental_binary::get_script_info): Add const.
5742 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
5743 * testsuite/Makefile.am (incremental_test_5): New test case.
5744 (incremental_test_6): New test case.
5745 * testsuite/Makefile.in: Regenerate.
5746
5747 2011-07-06 Cary Coutant <ccoutant@google.com>
5748
5749 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
5750 debug output when command lines differ.
5751
5752 2011-07-06 Cary Coutant <ccoutant@google.com>
5753
5754 * incremental.cc (Incremental_inputs::report_command_line): Ignore
5755 --incremental-patch option.
5756 * layout.cc (Free_list::allocate): Extend allocation beyond original
5757 end if enabled.
5758 (Layout::make_output_section): Mark sections that should get
5759 patch space.
5760 * options.cc (parse_percent): New function.
5761 * options.h (parse_percent): New function.
5762 (DEFINE_percent): New macro.
5763 (General_options): Add --incremental-patch option.
5764 * output.cc (Output_section::Output_section): Initialize new data
5765 members.
5766 (Output_section::add_input_section): Print section name when out
5767 of patch space.
5768 (Output_section::add_output_section_data): Likewise.
5769 (Output_section::set_final_data_size): Add patch space when
5770 doing --incremental-full.
5771 (Output_section::do_reset_address_and_file_offset): Remove patch
5772 space.
5773 (Output_segment::set_section_list_addresses): Print debug output
5774 only if --incremental-update.
5775 * output.h (Output_section::set_is_patch_space_allowed): New function.
5776 (Output_section::is_patch_space_allowed_): New data member.
5777 (Output_section::patch_space_): New data member.
5778 * parameters.cc (Parameters::incremental_full): New function.
5779 * parameters.h (Parameters::incremental_full): New function
5780 * testsuite/Makefile.am (incremental_test_2): Add test for
5781 --incremental-patch option.
5782 * testsuite/Makefile.in: Regenerate.
5783 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
5784 (t18): Remove function body.
5785
5786 2011-07-05 Doug Kwan <dougkwan@google.com>
5787
5788 PR gold/12771
5789 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
5790 Arm_Address type for relocation result.
5791 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
5792 overflow check.
5793 (Arm_relocate_functions::abs32): Use unaligned access.
5794 (Arm_relocate_functions::rel32): Ditto.
5795 (Arm_relocate_functions::prel31): Ditto.
5796 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
5797 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
5798 static data relocations.
5799 * testsuite/Makefile.in: Regnerate.
5800 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
5801
5802 2011-07-05 Ian Lance Taylor <iant@google.com>
5803
5804 PR gold/12392
5805 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
5806 symbols if necessary.
5807 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5808
5809 2011-07-05 Ian Lance Taylor <iant@google.com>
5810
5811 PR gold/12952
5812 * resolve.cc (Symbol::override_base_with_special): Simply override
5813 version with special symbol version, ignoring previous version.
5814
5815 2011-07-05 Ian Lance Taylor <iant@google.com>
5816
5817 * object.cc (Sized_relobj_file::include_section_group): Add
5818 information to comment about signature location.
5819
5820 2011-07-02 Ian Lance Taylor <iant@google.com>
5821
5822 PR gold/12957
5823 * options.h (class General_options): Add -f and -F.
5824 * options.cc (General_options::finalize): Fatal error if -f/-F
5825 are used without -shared.
5826 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
5827
5828 2011-07-02 Ian Lance Taylor <iant@google.com>
5829
5830 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
5831
5832 2011-07-01 Ian Lance Taylor <iant@google.com>
5833
5834 PR gold/12525
5835 PR gold/12952
5836 * resolve.cc (Symbol::override_base_with_special): Don't override
5837 the version if the overriding symbol has a different name.
5838 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
5839 all callers. If we give an error about an undefined version,
5840 define the base version if necessary.
5841 * dynobj.h (class Versions): Update declaration.
5842 * testsuite/weak_alias_test_5.cc: New file.
5843 * testsuite/weak_alias_test.script: New file.
5844 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
5845 and versioned_alias have the right value, and call t2.
5846 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
5847 weak_alias_test_5.so.
5848 (weak_alias_test_LDADD): Likewise.
5849 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
5850 * testsuite/Makefile.in: Rebuild.
5851
5852 2011-07-01 Ian Lance Taylor <iant@google.com>
5853
5854 PR gold/12525
5855 * options.h (class General_options): Support -z notext.
5856 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
5857 -Wl,-z,notext.
5858 (two_file_shared_nonpic.so): Likewise.
5859 (two_file_shared_mixed.so): Likewise.
5860 (two_file_shared_mixed_1.so): Likewise.
5861 (weak_undef_lib_nonpic.so): Likewise.
5862 (alt/weak_undef_lib_nonpic.so): Likewise.
5863 (tls_test_shared_nonpic.so): Likewise.
5864 * testsuite/Makefile.in: Rebuild.
5865
5866 2011-07-01 Ian Lance Taylor <iant@google.com>
5867
5868 PR gold/12525
5869 * configure.ac: Test whether static linking works, setting
5870 the automake conditional HAVE_STATIC.
5871 * testsuite/Makefile.am: Disable tests using -static if
5872 HAVE_STATIC is not true.
5873 * configure, testsuite/Makefile.in: Rebuild.
5874
5875 2011-07-01 Ian Lance Taylor <iant@google.com>
5876
5877 PR gold/12525
5878 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
5879 Assert if we see DW_EH_PE_indirect.
5880 * target.h (Target::ehframe_datarel_base): New function.
5881 (Target::do_ehframe_datarel_base): New target function.
5882 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
5883 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
5884 function.
5885
5886 2011-07-01 Ian Lance Taylor <iant@google.com>
5887
5888 PR gold/12571
5889 * options.h (class General_options): Add
5890 --ld-generated-unwind-info.
5891 * ehframe.cc (Fde::write): Add address parameter. Change all
5892 callers. If associated with PLT, fill in address and size.
5893 (Cie::set_output_offset): Only add merge mapping if there is an
5894 object.
5895 (Cie::write): Add address parameter. Change all callers.
5896 (Eh_frame::add_ehframe_for_plt): New function.
5897 * ehframe.h (class Fde): Update declarations. Move shndx_ and
5898 input_offset_ fields into union u_, with new plt field.
5899 (Fde::Fde): Adjust for new union field.
5900 (Fde::Fde) [Output_data version]: New constructor.
5901 (Fde::add_mapping): Only add merge mapping if there is an object.
5902 (class Cie): Update declarations.
5903 (class Eh_frame): Declare add_ehframe_for_plt.
5904 * layout.cc (Layout::layout_eh_frame): Break out code into
5905 make_eh_frame_section, and call it.
5906 (Layout::make_eh_frame_section): New function.
5907 (Layout::add_eh_frame_for_plt): New function.
5908 * layout.h (class Layout): Update declarations.
5909 * merge.cc (Merge_map::add_mapping): Add assertion.
5910 * i386.cc: Include "dwarf.h".
5911 (class Output_data_plt_i386): Make first_plt_entry,
5912 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
5913 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5914 and plt_eh_frame_fde.
5915 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
5916 boundary. Call add_eh_frame_for_plt if appropriate.
5917 * x86_64.cc: Include "dwarf.h".
5918 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
5919 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
5920 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5921 and plt_eh_frame_fde.
5922 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
5923 appropriate.
5924
5925 2011-06-29 Ian Lance Taylor <iant@google.com>
5926
5927 PR gold/12629
5928 * object.cc (Sized_relobj_file::layout_section): Change shdr
5929 parameter to be const.
5930 (Sized_relobj_file::layout_eh_frame_section): New function, broken
5931 out of do_layout.
5932 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
5933 appropriate. Call layout_eh_frame_section.
5934 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
5935 sections.
5936 * object.h (class Sized_relobj_file): Update declarations.
5937
5938 2011-06-29 Ian Lance Taylor <iant@google.com>
5939
5940 PR gold/12652
5941 * script.cc (Token::integer_value): Accept trailing M/m/K/k
5942 modifier.
5943 (Lex::gather_token): Accept trailing M/m/K/k for integers.
5944
5945 2011-06-29 Ian Lance Taylor <iant@google.com>
5946
5947 PR gold/12675
5948 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
5949 SHT_X86_64_UNWIND.
5950 * layout.cc (Layout::layout_eh_frame): Likewise.
5951
5952 2011-06-29 Ian Lance Taylor <iant@google.com>
5953
5954 PR gold/12695
5955 * layout.cc (Layout::symtab_section_shndx): New function.
5956 * layout.h (class Layout): Declare symtab_section_shndx.
5957 * output.cc (Output_section::write_header): Call it.
5958
5959 2011-06-29 Ian Lance Taylor <iant@google.com>
5960
5961 PR gold/12818
5962 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
5963 symbols which are not used in a relocation.
5964
5965 2011-06-28 Ian Lance Taylor <iant@google.com>
5966
5967 PR gold/12898
5968 * layout.cc (Layout::segment_precedes): Don't crash if a linker
5969 script create indistinguishable segments.
5970 (Layout::set_segment_offsets): Use stable_sort when sorting
5971 segments. Pass this to Compare_segments constructor.
5972 * layout.h (class Layout): Make segment_precedes non-static.
5973 (class Compare_segments): Change from struct to class. Add
5974 layout_ field. Add constructor.
5975 * script-sections.cc
5976 (Script_sections::attach_sections_using_phdrs_clause): Rename
5977 local orphan to is_orphan. Don't report failure to put empty
5978 section in segment. On attachment failure, report name of
5979 section, and attach to first PT_LOAD segment.
5980
5981 2011-06-28 Ian Lance Taylor <iant@google.com>
5982
5983 PR gold/12934
5984 * target-select.cc (Target_selector::Target_selector): Add
5985 emulation parameter. Change all callers.
5986 (select_target_by_bfd_name): Rename from select_target_by_name.
5987 Change all callers.
5988 (select_target_by_emulation): New function.
5989 (supported_emulation_names): New function.
5990 * target-select.h (class Target_selector): Add emulation_ field.
5991 Update declarations.
5992 (Target_selector::recognize_by_bfd_name): Rename from
5993 recognize_by_name. Change all callers.
5994 (Target_selector::supported_bfd_names): Rename from
5995 supported_names. Change all callers.
5996 (Target_selector::recognize_by_emulation): New function.
5997 (Target_selector::supported_emulations): New function.
5998 (Target_selector::emulation): New function.
5999 (Target_selector::do_recognize_by_bfd_name): Rename from
6000 do_recognize_by_name. Change all callers.
6001 (Target_selector::do_supported_bfd_names): Rename from
6002 do_supported_names. Change all callers.
6003 (Target_selector::do_recognize_by_emulation): New function.
6004 (Target_selector::do_supported_emulations): New function.
6005 (select_target_by_bfd_name): Change name in declaration.
6006 (select_target_by_emulation): Declare.
6007 (supported_emulation_names): Declare.
6008 * parameters.cc (parameters_force_valid_target): Try to find
6009 target based on emulation from -m option.
6010 * options.h (class General_options): Change doc string for -m.
6011 * options.cc (help): Print emulations.
6012 (General_options::parse_V): Likewise.
6013 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
6014 Add emulation parameter. Change all callers.
6015
6016 2011-06-28 Ian Lance Taylor <iant@google.com>
6017
6018 * target.h (class Target): Add osabi_ field.
6019 (Target::osabi): New function.
6020 (Target::set_osabi): New function.
6021 (Target::Target): Initialize osabi_.
6022 (Target::do_adjust_elf_header): Make pure virtual.
6023 (Sized_target::do_adjust_elf_header): Declare.
6024 * target.cc (Sized_target::do_adjust_elf_header): New function.
6025 (class Sized_target): Instantiate all versions.
6026 * freebsd.h (class Target_freebsd): Remove.
6027 (Target_selector_freebsd::do_recognize): Call set_osabi on
6028 Target.
6029 (Target_selector_freebsd::do_recognize_by_name): Likewise.
6030 (Target_selector_freebsd::set_osabi): Remove.
6031 * i386.cc (class Target_i386): Inherit from Sized_target rather
6032 than Target_freebsd.
6033 * x86_64.cc (class Target_x86_64): Likewise.
6034
6035 2011-06-28 Ian Lance Taylor <iant@google.com>
6036
6037 * target.h (Target::can_check_for_function_pointers): Rewrite.
6038 Make non-virtual.
6039 (Target::can_icf_inline_merge_sections): Likewise.
6040 (Target::section_may_have_icf_unsafe_poineters): Likewise.
6041 (Target::Target_info): Add can_icf_inline_merge_sections field.
6042 (Target::do_can_check_for_function_pointers): New virtual
6043 function.
6044 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
6045 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
6046 from can_check_for_function_pointers, move in file.
6047 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
6048 section_may_have_icf_unsafe_poineters, move in file.
6049 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
6050 * i386.cc (Target_i386::do_can_check_for_function_pointers):
6051 Rename from can_check_for_function_pointers, move in file.
6052 (Target_i386::can_icf_inline_merge_sections): Remove.
6053 (Target_i386::i386_info): Initialize
6054 can_icf_inline_merge_sections.
6055 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
6056 Initialize can_icf_inline_merge_sections.
6057 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
6058 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
6059 Rename from can_check_for_function_pointers, move in file.
6060 (Target_x86_64::can_icf_inline_merge_sections): Remove.
6061 (Target_x86_64::x86_64_info): Initialize
6062 can_icf_inline_merge_sections.
6063 * testsuite/testfile.cc (Target_test::test_target_info):
6064 Likewise.
6065 * icf.cc (get_section_contents): Correct formatting.
6066
6067 2011-06-27 Ian Lance Taylor <iant@google.com>
6068
6069 * symtab.cc (Symbol::versioned_name): New function.
6070 (Symbol_table::add_to_final_symtab): Use versioned_name when
6071 appropriate.
6072 (Symbol_table::sized_write_symbol): Likewise.
6073 * symtab.h (class Symbol): Declare versioned_name.
6074 * stringpool.h (class Stringpool_template): Add variant of add
6075 which takes a std::basic_string.
6076 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
6077 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
6078 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
6079 (ver_test_12.o): New target.
6080 * testsuite/Makefile.in: Rebuild.
6081
6082 2011-06-27 Doug Kwan <dougkwan@google.com>
6083
6084 * arm.cc (Arm_relocate_functions::thm_jump8,
6085 Arm_relocate_functions::thm_jump11): Use a wider signed
6086 type to compute offset.
6087 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
6088 arm_thm_jump8.
6089 * testsuite/Makefile.in: Regenerate.
6090 * testsuite/arm_branch_in_range.sh: Check test results of
6091 arm_thm_jump11 and arm_thm_jump8.
6092 * testsuite/arm_thm_jump11.s: New test source file.
6093 * testsuite/arm_thm_jump11.t: New linker script.
6094 * testsuite/arm_thm_jump8.s: New test source file.
6095 * testsuite/arm_thm_jump8.t: New linker script.
6096
6097 2011-06-24 Ian Lance Taylor <iant@google.com>
6098
6099 * layout.cc: Include "object.h".
6100 (ctors_sections_in_init_array): New static variable.
6101 (Layout::is_ctors_in_init_array): New function.
6102 (Layout::layout): Add entry to ctors_sections_in_init_array if
6103 appropriate.
6104 * layout.h (class Layout): Declare is_ctors_in_init_array.
6105 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
6106 is_ctors_reverse_view is set.
6107 (Sized_relobj_file::write_sections): Add layout parameter. Change
6108 all callers. Set is_ctors_reverse_view field of View_size.
6109 (Sized_relobj_file::reverse_words): New function.
6110 * object.h (Sized_relobj_file::View_size): Add
6111 is_ctors_reverse_view field.
6112 (class Sized_relobj_file): Update declarations.
6113 * testsuite/initpri3.c: New test.
6114 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
6115 initpri3b.
6116 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
6117 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
6118 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
6119 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
6120 * testsuite/Makefile.in: Rebuild.
6121
6122 2011-06-24 Cary Coutant <ccoutant@google.com>
6123
6124 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
6125 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
6126 (debug_msg_cdebug.err): New targets.
6127 * testsuite/Makefile.in: Regenerate.
6128 * testsuite/debug_msg.sh: Check output of link with compressed debug.
6129 Fix checks for link with shared library.
6130
6131 2011-06-24 Doug Kwan <dougkwan@google.com>
6132
6133 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
6134 skip empty text sections.
6135 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
6136
6137 2011-06-22 Ian Lance Taylor <iant@google.com>
6138
6139 PR gold/12910
6140 * options.h (class General_options): Add --ctors-in-init-array.
6141 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
6142 friends as SHT_PROGBITS for merging sections.
6143 (Layout::layout): Remove special handling of .init_array and
6144 friends. Don't sort if doing relocatable link. Sort for .ctors
6145 and .dtors if ctors_in_init_array.
6146 (Layout::make_output_section): Force correct section types for
6147 .init_array and friends. Don't sort if doing relocatable link,
6148 Don't sort .ctors and .dtors if ctors_in_init_array.
6149 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
6150 (Layout::output_section_name): Add relobj parameter. Change all
6151 callers. Handle .ctors. and .dtors. in code rather than table.
6152 Handle .ctors and .dtors if ctors_in_init_array.
6153 (Layout::match_file_name): New function, moved from output.cc.
6154 * layout.h (class Layout): Update declarations.
6155 * output.cc: Include "layout.h".
6156 (Input_section_sort_entry::get_priority): New function.
6157 (Input_section_sort_entry::match_file_name): Just call
6158 Layout::match_file_name.
6159 (Output_section::Input_section_sort_init_fini_compare::operator()):
6160 Handle .ctors and .dtors. Sort by explicit priority rather than
6161 by name.
6162 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
6163 * testsuite/initpri2.c: New test.
6164 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
6165 (check_PROGRAMS): Add initpri2.
6166 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
6167 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
6168 * configure, testsuite/Makefile.in: Rebuild.
6169
6170 2011-06-19 Ian Lance Taylor <iant@google.com>
6171
6172 PR gold/12880
6173 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
6174 .interp section to a PT_INTERP segment even if we have seen a
6175 --dynamic-linker option. Don't do it if we have seen a PHDRS
6176 clause in a linker script.
6177 (Layout::finalize): Don't create a .interp section if we've
6178 already create a PT_INTERP segment.
6179 (Layout::create_interp): Always call choose_output_section (revert
6180 patch of 2011-06-17). Don't create PT_INTERP segment.
6181 * script-sections.cc
6182 (Script_sections::create_note_and_tls_segments): Add a .interp
6183 section to a PT_INTERP segment even if we have seen a
6184 --dynamic-linker option.
6185
6186 2011-06-18 Ian Lance Taylor <iant@google.com>
6187
6188 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
6189 merely because a non-PT_LOAD segment has a dynamic reloc.
6190
6191 2011-06-18 Ian Lance Taylor <iant@google.com>
6192
6193 * layout.cc (Layout::finish_dynamic_section): Don't create
6194 DT_FLAGS entry if not needed.
6195
6196 2011-06-18 Ian Lance Taylor <iant@google.com>
6197
6198 PR gold/12745
6199 * layout.cc (Layout::layout_eh_frame): Correct handling of
6200 writable .eh_frame section.
6201
6202 2011-06-17 Ian Lance Taylor <iant@google.com>
6203
6204 PR gold/12893
6205 * resolve.cc (Symbol_table::resolve): Don't give an error if a
6206 symbol is redefined with the exact same object and value.
6207
6208 2011-06-17 Ian Lance Taylor <iant@google.com>
6209
6210 PR gold/12880
6211 * layout.h (class Layout): Add interp_segment_ field.
6212 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
6213 (Layout::attach_allocated_section_to_segment): If making shared
6214 library, put .interp section in PT_INTERP segment.
6215 (Layout::finalize): Also call create_interp if -dynamic-linker
6216 option was used.
6217 (Layout::create_interp): Assert that there is no PT_INTERP
6218 segment. If not using a SECTIONS clause, use make_output_section.
6219 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
6220 * script-sections.cc
6221 (Script_sections::create_note_and_tls_segments): If making shared
6222 library, put .interp section in PT_INTERP segment.
6223
6224 2011-06-17 Ian Lance Taylor <iant@google.com>
6225
6226 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
6227 when making a shared library.
6228
6229 2011-06-17 Ian Lance Taylor <iant@google.com>
6230
6231 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
6232 parameter. Change all callers. Don't issue warning about PC32
6233 against locally defined symbol.
6234
6235 2011-06-16 Ian Lance Taylor <iant@google.com>
6236
6237 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
6238 occurs in same object.
6239
6240 2011-06-14 Alan Modra <amodra@gmail.com>
6241
6242 * po/POTFILES.in: Regenerate.
6243
6244 2011-06-09 Ian Lance Taylor <iant@google.com>
6245
6246 * script-sections.cc
6247 (Orphan_output_section::set_section_addresses): For a relocatable
6248 link set address to 0.
6249
6250 2011-06-09 Cary Coutant <ccoutant@google.com>
6251
6252 PR gold/12804
6253 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
6254 used with --compress-debug-sections.
6255 * gold/object.cc (Sized_relobj_file::do_layout): Report
6256 uncompressed size of compressed input sections.
6257
6258 2011-06-08 Cary Coutant <ccoutant@google.com>
6259
6260 PR gold/12804
6261 * testsuite/two_file_test_2_v1.cc: Change initialization of
6262 v2 to keep it in .data.
6263
6264 2011-06-07 Cary Coutant <ccoutant@google.com>
6265
6266 * common.cc (Symbol_table::do_allocate_commons_list): Call
6267 gold_fallback.
6268 * errors.cc (Errors::fatal): Adjust call to gold_exit.
6269 (Errors::fallback): New function.
6270 (gold_fallback): New function.
6271 * errors.h (Errors::fallback): New function.
6272 * gold.cc (gold_exit): Change status parameter to enum; adjust
6273 all callers.
6274 (queue_initial_tasks): Call gold_fallback.
6275 * gold.h: Include cstdlib.
6276 (Exit_status): New enum type.
6277 (gold_exit): Change status parameter to enum.
6278 (gold_fallback): New function.
6279 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
6280 (Layout::create_symtab_sections): Likewise.
6281 (Layout::create_shdrs): Likewise.
6282 * main.cc (main): Adjust call to gold_exit.
6283 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
6284 (Output_data_got::add_got_entry_pair): Likewise.
6285 (Output_section::add_input_section): Likewise.
6286 (Output_section::add_output_section_data): Likewise.
6287 (Output_segment::set_section_list_addresses): Likewise.
6288 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
6289
6290 2011-06-07 Cary Coutant <ccoutant@google.com>
6291
6292 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
6293 for incremental links.
6294 * output.cc (Output_segment::set_section_list_addresses): Remove
6295 FIXME and test for TLS or BSS.
6296
6297 2011-06-07 Cary Coutant <ccoutant@google.com>
6298
6299 * testsuite/Makefile.am: Add incremental_copy_test,
6300 incremental_common_test_1.
6301 * testsuite/Makefile.in: Regenerate.
6302 * testsuite/common_test_1_v1.c: New source file.
6303 * testsuite/common_test_1_v2.c: New source file.
6304 * testsuite/copy_test_v1.cc: New source file.
6305
6306 2011-06-07 Cary Coutant <ccoutant@google.com>
6307
6308 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
6309 update, allocate common from bss section's free list.
6310 * incremental-dump.cc (dump_incremental_inputs): Print flag for
6311 linker-defined symbols.
6312 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
6313 Skip GOT and PLT entries that are no longer referenced.
6314 (Output_section_incremental_inputs::write_info_blocks): Mark
6315 linker-defined symbols.
6316 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
6317 * output.cc (Output_section::allocate): New function.
6318 * output.h (Output_section::allocate): New function.
6319 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
6320 linker-defined symbols.
6321 (Symbol::override_base_with_special): Copy is_predefined_ flag.
6322 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
6323 (Symbol::init_base_output_data): Likewise.
6324 (Symbol::init_base_output_segment): Likewise.
6325 (Symbol::init_base_constant): Likewise.
6326 (Sized_symbol::init_output_data): Likewise.
6327 (Sized_symbol::init_output_segment): Likewise.
6328 (Sized_symbol::init_constant): Likewise.
6329 (Symbol_table::do_define_in_output_data): Likewise.
6330 (Symbol_table::do_define_in_output_segment): Likewise.
6331 (Symbol_table::do_define_as_constant): Likewise.
6332 * symtab.h (Symbol::is_predefined): New function.
6333 (Symbol::init_base_output_data): Add is_predefined parameter.
6334 (Symbol::init_base_output_segment): Likewise.
6335 (Symbol::init_base_constant): Likewise.
6336 (Symbol::is_predefined_): New data member.
6337 (Sized_symbol::init_output_data): Add is_predefined parameter.
6338 (Sized_symbol::init_output_segment): Likewise.
6339 (Sized_symbol::init_constant): Likewise.
6340 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
6341
6342 2011-06-07 Cary Coutant <ccoutant@google.com>
6343
6344 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
6345 instead of emit_copy_reloc.
6346 (Copy_relocs::emit_copy_reloc): Refactor.
6347 (Copy_relocs::make_copy_reloc): New function.
6348 (Copy_relocs::add_copy_reloc): Remove.
6349 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
6350 section.
6351 (Copy_relocs::make_copy_reloc): New function.
6352 (Copy_relocs::add_copy_reloc): Remove.
6353 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
6354 unchanged input files.
6355 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
6356 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
6357 Reserve BSS space for COPY relocations.
6358 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6359 (Output_section_incremental_inputs::write_info_blocks): Record
6360 whether a symbol is copied from a shared object.
6361 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
6362 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
6363 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
6364 (Incremental_input_entry_reader::get_output_symbol_index): Add
6365 is_copy parameter.
6366 (Incremental_binary::emit_copy_relocs): New function.
6367 (Incremental_binary::do_emit_copy_relocs): New function.
6368 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6369 new data member.
6370 (Sized_incremental_binary::add_copy_reloc): New function.
6371 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6372 (Sized_incremental_binary::Copy_reloc): New struct.
6373 (Sized_incremental_binary::Copy_relocs): New typedef.
6374 (Sized_incremental_binary::copy_relocs_): New data member.
6375 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
6376 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
6377 * target.h (Sized_target::emit_copy_reloc): New function.
6378 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
6379
6380 2011-06-02 Cary Coutant <ccoutant@google.com>
6381
6382 PR gold/12163
6383 * gold/archive.cc (Archive::Archive): Initialize new data member.
6384 (Archive::include_all_members): Return if archive has already been
6385 included.
6386 * gold/archive.h (Archive::include_all_members_): New data member.
6387
6388 2011-06-02 Nick Clifton <nickc@redhat.com>
6389
6390 * dynobj.h: Fix spelling mistake in comment.
6391 * output.cc: Likewise.
6392
6393 2011-05-31 Doug Kwan <dougkwan@google.com>
6394 Asier Llano
6395
6396 PR gold/12826
6397 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
6398 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
6399 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
6400 redundant arm_exidx_test.so.
6401 * testsuite/Makefile.in: Regenerate.
6402 (check_SCRIPTS): Add pr12826.sh
6403 (check_DATA): Add pr12826.stdout
6404 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
6405 * testsuite/pr12826.sh: New file.
6406 * testsuite/pr12826_1.s: Ditto.
6407 * testsuite/pr12826_1.s: Ditto.
6408
6409 2011-05-30 Ian Lance Taylor <iant@google.com>
6410
6411 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
6412 sections.
6413
6414 2011-05-29 Ian Lance Taylor <iant@google.com>
6415
6416 PR gold/12804
6417 * testsuite/Makefile.am: Use different file name for two_file_test
6418 temporary file for each incremental test.
6419 * testsuite/Makefile.in: Rebuild.
6420
6421 2011-05-29 Ian Lance Taylor <iant@google.com>
6422
6423 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
6424 binary input file is empty.
6425
6426 2011-05-27 Ian Lance Taylor <iant@google.com>
6427
6428 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
6429 (ver_test_9.so): Likewise.
6430 * testsuite/Makefile.in: Rebuild.
6431
6432 2011-05-26 Cary Coutant <ccoutant@google.com>
6433
6434 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
6435 * incremental.cc (Incremental_inputs::report_input_section): Fix
6436 comment, indentation.
6437 (Incremental_inputs::report_comdat_group): New function.
6438 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6439 of data for incremental input file entry.
6440 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
6441 group count, COMDAT group signatures.
6442 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
6443 an unchanged input file.
6444 * incremental.h (Incremental_object_entry::Incremental_object_entry):
6445 Initialize new data member.
6446 (Incremental_object_entry::add_comdat_group): New function.
6447 (Incremental_object_entry::get_comdat_group_count): New function.
6448 (Incremental_object_entry::get_comdat_signature_key): New function.
6449 (Incremental_object_entry::groups_): New data member.
6450 (Incremental_inputs::report_comdat_group): New function.
6451 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
6452 data for incremental input file entry.
6453 (Incremental_input_entry_reader::get_comdat_group_count): New function.
6454 (Incremental_input_entry_reader::get_input_section): Adjust size of
6455 data for incremental input file entry.
6456 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
6457 (Incremental_input_entry_reader::get_comdat_group_signature): New
6458 function.
6459 * object.cc (Sized_relobj::include_section_group): Report kept
6460 COMDAT groups for incremental links.
6461
6462 2011-05-24 David Meyer <pdox@google.com>
6463
6464 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
6465 with name parameter. Add found_name parameter.
6466 * fileread.cc (Input_file::find_file): Adjust code accordingly.
6467 * dirsearch.h (class Dirsearch): Update declaration.
6468
6469 2011-05-24 Ian Lance Taylor <iant@google.com>
6470
6471 * archive.cc (Library_base::should_include_member): Pull in object
6472 from archive if it defines the entry symbol.
6473 * parameters.cc (Parameters::entry): New function.
6474 * parameters.h (class Parameters): Declare entry.
6475 * output.h (class Output_file_header): Remove entry_ field.
6476 * output.cc (Output_file_header::Output_file_header): Remove entry
6477 parameter. Change all callers.
6478 (Output_file_header::entry): Use parameters->entry.
6479 * gold.cc (queue_middle_tasks): Likewise.
6480 * plugin.cc (Plugin_hook::run): Likewise.
6481
6482 2011-05-24 Cary Coutant <ccoutant@google.com>
6483
6484 * gold.cc (queue_initial_tasks): Pass incremental base filename
6485 to Output_file::open_base_file; don't print error message.
6486 * incremental-dump.cc (main): Adjust call to
6487 Output_file::open_for_modification.
6488 * incremental-dump.cc (main): Likewise.
6489 * incremental.cc (Incremental_inputs::report_command_line):
6490 Ignore --incremental-base option when comparing command lines.
6491 Ignore parameter when given as separate argument.
6492 * options.h (class General_options): Add --incremental-base.
6493 * output.cc (Output_file::Output_file):
6494 (Output_file::open_base_file): Add base_name and writable parameters;
6495 read base file into new file; print error message here.
6496 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6497 callers.
6498 * output.h (Output_file::open_for_modification): Rename to...
6499 (Output_file::open_base_file): ...this; add base_name and
6500 writable parameters; adjust all callers.
6501 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6502 callers.
6503 * testsuite/Makefile.am (incremental_test_4): Test
6504 --incremental-base.
6505 * testsuite/Makefile.in: Regenerate.
6506
6507 2011-05-24 Cary Coutant <ccoutant@google.com>
6508
6509 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
6510 incremental_test_4.
6511 * testsuite/Makefile.in: Regenerate.
6512 * testsuite/two_file_test_1_v1.cc: New test source file.
6513 * testsuite/two_file_test_1b_v1.cc: New test source file.
6514 * testsuite/two_file_test_2_v1.cc: New test source file.
6515
6516 2011-05-24 Cary Coutant <ccoutant@google.com>
6517
6518 * dynobj.h (Dynobj::do_dynobj): New function.
6519 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
6520 flag and soname for shared objects.
6521 * incremental.cc (Incremental_inputs::report_object): Make
6522 either Incremental_object_entry or Incremental_dynobj_entry; add
6523 soname to string table.
6524 (Incremental_inputs::report_input_section): Add assertion.
6525 (Output_section_incremental_inputs::set_final_data_size): Adjust
6526 type of input file entry for shared libraries; adjust size of
6527 shared library info entry.
6528 (Output_section_incremental_inputs::write_input_files): Write
6529 as_needed flag for shared libraries.
6530 (Output_section_incremental_inputs::write_info_blocks): Adjust type
6531 of input file entry for shared libraries; write soname.
6532 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
6533 soname from incremental info.
6534 * incremental.h (enum Incremental_input_flags): Add
6535 INCREMENTAL_INPUT_AS_NEEDED.
6536 (Incremental_input_entry::Incremental_input_entry): Initialize new
6537 data member.
6538 (Incremental_input_entry::set_as_needed): New function.
6539 (Incremental_input_entry::as_needed): New function.
6540 (Incremental_input_entry::do_dynobj_entry): New function.
6541 (Incremental_input_entry::as_needed_): New data member.
6542 (Incremental_object_entry::Incremental_object_entry): Don't check
6543 for shared library.
6544 (Incremental_object_entry::do_type): Likewise.
6545 (class Incremental_dynobj_entry): New class.
6546 (Incremental_input_entry_reader::as_needed): New function.
6547 (Incremental_input_entry_reader::get_soname): New function.
6548 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
6549 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
6550 size of shared library info entry.
6551 * layout.cc (Layout::finish_dynamic_section): Don't test for
6552 incremental link when adding DT_NEEDED entries.
6553 * object.h (Object::Object): Initialize new data member.
6554 (Object::dynobj): New function.
6555 (Object::set_as_needed): New function.
6556 (Object::as_needed): New function.
6557 (Object::do_dynobj): New function.
6558 (Object::as_needed_): New data member.
6559
6560 2011-05-24 Cary Coutant <ccoutant@google.com>
6561
6562 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
6563 info; adjust display of GOT entries.
6564 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6565 vector of input objects; remove file_status_.
6566 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
6567 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
6568 got_plt reader; call target hooks to reserve GOT entries.
6569 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6570 of input file info header and GOT info entry.
6571 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
6572 relocation info.
6573 (Got_plt_view_info::got_descriptor): Remove.
6574 (Got_plt_view_info::sym_index): New data member.
6575 (Got_plt_view_info::input_index): New data member.
6576 (Local_got_offset_visitor::visit): Write input file index.
6577 (Global_got_offset_visitor::visit): Write 0 for input file index.
6578 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
6579 with sym_index and input_index.
6580 (Output_section_incremental_inputs::write_got_plt): Adjust size of
6581 incremental info GOT entry; replace got_descriptor with input_index.
6582 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
6583 map from input file index to object.
6584 (Sized_relobj_incr::do_layout): Replace direct data member reference
6585 with accessor function.
6586 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
6587 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
6588 Adjust size of input file info header.
6589 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
6590 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
6591 (Incremental_input_entry_reader::get_input_section): Adjust size of
6592 input file info header.
6593 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
6594 of incremental info GOT entry.
6595 (Incremental_got_plt_reader::get_got_desc): Remove.
6596 (Incremental_got_plt_reader::get_got_symndx): New function.
6597 (Incremental_got_plt_reader::get_got_input_index): New function.
6598 (Sized_incremental_binary::Sized_incremental_binary): Remove
6599 file_status_; add input_objects_.
6600 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
6601 (Sized_incremental_binary::set_file_is_unchanged): Remove.
6602 (Sized_incremental_binary::file_is_unchanged): Remove.
6603 (Sized_incremental_binary::set_input_object): New function.
6604 (Sized_incremental_binary::input_object): New function.
6605 (Sized_incremental_binary::file_status_): Remove.
6606 (Sized_incremental_binary::input_objects_): New data member.
6607 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
6608 references.
6609 (Sized_relobj_incr::invalid_address): Move to base class.
6610 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
6611 class.
6612 (Sized_relobj_incr::do_output_section_offset): Likewise.
6613 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
6614 (Sized_relobj_incr::section_offsets_): Likewise.
6615 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
6616 function.
6617 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
6618 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
6619 with accessor function.
6620 (Sized_relobj_file::do_layout): Likewise.
6621 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
6622 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
6623 (Sized_relobj_file::compute_final_local_value): Replace refs to
6624 section_offsets_ with accessor function.
6625 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
6626 * object.h (Relobj::Relobj): Initialize new data members.
6627 (Relobj::add_dyn_reloc): New function.
6628 (Relobj::first_dyn_reloc): New function.
6629 (Relobj::dyn_reloc_count): New function.
6630 (Relobj::first_dyn_reloc_): New data member.
6631 (Relobj::dyn_reloc_count_): New data member.
6632 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
6633 references.
6634 (Sized_relobj::Address): New typedef.
6635 (Sized_relobj::invalid_address): Move here from child class.
6636 (Sized_relobj::Sized_relobj): Initialize new data members.
6637 (Sized_relobj::sized_relobj): New function.
6638 (Sized_relobj::is_output_section_offset_invalid): Move here from
6639 child class.
6640 (Sized_relobj::get_output_section_offset): Likewise.
6641 (Sized_relobj::local_has_got_offset): Likewise.
6642 (Sized_relobj::local_got_offset): Likewise.
6643 (Sized_relobj::set_local_got_offset): Likewise.
6644 (Sized_relobj::do_for_all_local_got_entries): Likewise.
6645 (Sized_relobj::clear_got_offsets): New function.
6646 (Sized_relobj::section_offsets): Move here from child class.
6647 (Sized_relobj::do_output_section_offset): Likewise.
6648 (Sized_relobj::do_set_section_offset): Likewise.
6649 (Sized_relobj::Local_got_offsets): Likewise.
6650 (Sized_relobj::local_got_offsets_): Likewise.
6651 (Sized_relobj::section_offsets_): Likewise.
6652 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
6653 references.
6654 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
6655 class.
6656 (Sized_relobj_file::sized_relobj): New function
6657 (Sized_relobj_file::local_has_got_offset): Move to base class.
6658 (Sized_relobj_file::local_got_offset): Likewise.
6659 (Sized_relobj_file::set_local_got_offset): Likewise.
6660 (Sized_relobj_file::get_output_section_offset): Likewise.
6661 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
6662 (Sized_relobj_file::do_output_section_offset): Likewise.
6663 (Sized_relobj_file::do_set_section_offset): Likewise.
6664 (Sized_relobj_file::Local_got_offsets): Likewise.
6665 (Sized_relobj_file::local_got_offsets_): Likewise.
6666 (Sized_relobj_file::section_offsets_): Likewise.
6667 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
6668 (all constructors).
6669 (set_needs_dynsym_index): Convert relobj to derived class pointer.
6670 (Output_reloc::get_symbol_index): Likewise.
6671 (Output_reloc::local_section_offset): Likewise.
6672 (Output_reloc::get_address): Likewise.
6673 (Output_reloc::symbol_value): Likewise.
6674 (Output_data_got::reserve_slot): Move to class definition.
6675 (Output_data_got::reserve_local): New function.
6676 (Output_data_got::reserve_slot_for_global): Remove.
6677 (Output_data_got::reserve_global): New function.
6678 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
6679 (all constructors, two instantiations).
6680 (Output_reloc::get_relobj): New function (two instantiations).
6681 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
6682 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
6683 (Output_data_reloc::add_global): Adjust type of relobj.
6684 (Output_data_reloc::add_global_relative): Likewise.
6685 (Output_data_reloc::add_symbolless_global_addend): Likewise.
6686 (Output_data_reloc::add_local): Likewise.
6687 (Output_data_reloc::add_local_relative): Likewise.
6688 (Output_data_reloc::add_symbolless_local_addend): Likewise.
6689 (Output_data_reloc::add_local_section): Likewise.
6690 (Output_data_reloc::add_output_section): Likewise.
6691 (Output_data_reloc::add_absolute): Likewise.
6692 (Output_data_reloc::add_target_specific): Likewise.
6693 (Output_data_got::reserve_slot): Move definition here.
6694 (Output_data_got::reserve_local): New function.
6695 (Output_data_got::reserve_global): New function.
6696 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
6697 section_offsets_ with accessor function.
6698 (Sized_relobj_file::write_sections): Likewise.
6699 (Sized_relobj_file::do_relocate_sections): Likewise.
6700 * target.h (Sized_target::reserve_local_got_entry): New function.
6701 (Sized_target::reserve_global_got_entry): New function.
6702 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
6703 (Target_x86_64::reserve_global_got_entry): New function.
6704 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
6705
6706 2011-05-23 Cary Coutant <ccoutant@google.com>
6707
6708 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
6709 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
6710 bit when checking got_type.
6711 * incremental.cc (Sized_incremental_binary::setup_readers):
6712 Store symbol table and string table locations; initialize bit vector
6713 of file status flags.
6714 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
6715 unchanged files.
6716 (Sized_incremental_binary::do_process_got_plt): New function.
6717 (Sized_incremental_binary::get_symtab_view): Use stored locations.
6718 (Output_section_incremental_inputs::set_final_data_size): Record
6719 file index for each input file.
6720 (Output_section_incremental_inputs::write_got_plt): Store file index
6721 instead of input entry offset for each GOT entry.
6722 * incremental.h
6723 (Incremental_input_entry::Incremental_input_entry): Initialize new
6724 data member.
6725 (Incremental_input_entry::set_offset): Store file index.
6726 (Incremental_input_entry::get_file_index): New function.
6727 (Incremental_input_entry::file_index_): New data member.
6728 (Incremental_binary::process_got_plt): New function.
6729 (Incremental_binary::do_process_got_plt): New function.
6730 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6731 data members.
6732 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
6733 (Sized_incremental_binary::set_file_is_unchanged): New function.
6734 (Sized_incremental_binary::file_is_unchanged): New function.
6735 (Sized_incremental_binary::do_process_got_plt): New function.
6736 (Sized_incremental_binary::file_status_): New data member.
6737 (Sized_incremental_binary::main_symtab_loc_): New data member.
6738 (Sized_incremental_binary::main_strtab_loc_): New data member.
6739 * output.cc (Output_data_got::Got_entry::write): Add case
6740 RESERVED_CODE.
6741 (Output_data_got::add_global): Call add_got_entry.
6742 (Output_data_got::add_global_plt): Likewise.
6743 (Output_data_got::add_global_with_rel): Likewise.
6744 (Output_data_got::add_global_with_rela): Likewise.
6745 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
6746 (Output_data_got::add_global_pair_with_rela): Likewise.
6747 (Output_data_got::add_local): Call add_got_entry.
6748 (Output_data_got::add_local_plt): Likewise.
6749 (Output_data_got::add_local_with_rel): Likewise.
6750 (Output_data_got::add_local_with_rela): Likewise.
6751 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
6752 (Output_data_got::add_local_pair_with_rela): Likewise.
6753 (Output_data_got::reserve_slot): New function.
6754 (Output_data_got::reserve_slot_for_global): New function.
6755 (Output_data_got::add_got_entry): New function.
6756 (Output_data_got::add_got_entry_pair): New function.
6757 (Output_section::add_output_section_data): Edit FIXME.
6758 * output.h
6759 (Output_section_data_build::Output_section_data_build): New
6760 constructor with size parameter.
6761 (Output_data_space::Output_data_space): Likewise.
6762 (Output_data_got::Output_data_got): Initialize new data member; new
6763 constructor with size parameter.
6764 (Output_data_got::add_constant): Call add_got_entry.
6765 (Output_data_got::reserve_slot): New function.
6766 (Output_data_got::reserve_slot_for_global): New function.
6767 (class Output_data_got::Got_entry): Add RESERVED_CODE.
6768 (Output_data_got::add_got_entry): New function.
6769 (Output_data_got::add_got_entry_pair): New function.
6770 (Output_data_got::free_list_): New data member.
6771 * target.h (Sized_target::init_got_plt_for_update): New function.
6772 (Sized_target::register_global_plt_entry): New function.
6773 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
6774 Initialize new data member; call init; add constructor with PLT count.
6775 (Output_data_plt_x86_64::init): New function.
6776 (Output_data_plt_x86_64::add_relocation): New function.
6777 (Output_data_plt_x86_64::reserve_slot): New function.
6778 (Output_data_plt_x86_64::free_list_): New data member.
6779 (Target_x86_64::init_got_plt_for_update): New function.
6780 (Target_x86_64::register_global_plt_entry): New function.
6781 (Output_data_plt_x86_64::add_entry): Allocate from free list for
6782 incremental updates.
6783 (Output_data_plt_x86_64::add_relocation): New function.
6784 * testsuite/object_unittest.cc (Object_test): Set default options.
6785
6786 2011-05-16 Ian Lance Taylor <iant@google.com>
6787
6788 * options.h (class General_options): Make -i a synonym for -r.
6789
6790 2011-05-16 Ian Lance Taylor <iant@google.com>
6791
6792 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
6793
6794 2011-05-10 Cary Coutant <ccoutant@google.com>
6795
6796 * object.cc (Sized_relobj::do_count_local_symbols): Check for
6797 strip_all (-s).
6798
6799 2011-05-06 Ian Lance Taylor <iant@google.com>
6800
6801 * layout.cc (Layout::layout): If the output section flags change,
6802 update the ordering.
6803
6804 2011-04-25 Cary Coutant <ccoutant@google.com>
6805
6806 * incremental-dump.cc (dump_incremental_inputs): Print local
6807 symbol info for each input file.
6808 * incremental.cc
6809 (Output_section_incremental_inputs::set_final_data_size): Add local
6810 symbol info to input file entries in incremental info.
6811 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6812 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
6813 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
6814 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
6815 implementation.
6816 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
6817 (Sized_incr_relobj::do_relocate): Write the local symbols.
6818 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
6819 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
6820 Adjust size of input file header.
6821 (Incremental_inputs_reader::get_local_symbol_offset): New function.
6822 (Incremental_inputs_reader::get_local_symbol_count): New function.
6823 (Incremental_inputs_reader::get_input_section): Adjust size of input
6824 file header.
6825 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
6826 (Sized_incr_relobj::This): New typedef.
6827 (Sized_incr_relobj::sym_size): New const data member.
6828 (Sized_incr_relobj::Local_symbol): New struct.
6829 (Sized_incr_relobj::do_output_local_symbol_count): New function.
6830 (Sized_incr_relobj::do_local_symbol_offset): New function.
6831 (Sized_incr_relobj::local_symbol_count_): New data member.
6832 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
6833 (Sized_incr_relobj::local_symbol_index_): New data member.
6834 (Sized_incr_relobj::local_symbol_offset_): New data member.
6835 (Sized_incr_relobj::local_dynsym_offset_): New data member.
6836 (Sized_incr_relobj::local_symbols_): New data member.
6837 * object.h (Relobj::output_local_symbol_count): New function.
6838 (Relobj::local_symbol_offset): New function.
6839 (Relobj::do_output_local_symbol_count): New function.
6840 (Relobj::do_local_symbol_offset): New function.
6841 (Sized_relobj::do_output_local_symbol_count): New function.
6842 (Sized_relobj::do_local_symbol_offset): New function.
6843
6844 2011-04-22 Vladimir Simonov <sv@sw.ru>
6845
6846 * descriptors.cc (set_close_on_exec): New function.
6847 (Descriptors::open): Use set_close_on_exec.
6848 * output.cc (S_ISLNK): Define if not defined.
6849
6850 2011-04-22 Cary Coutant <ccoutant@google.com>
6851
6852 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6853 global symbol map.
6854 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6855 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
6856 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
6857 relocations.
6858 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
6859 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
6860 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
6861 * incremental.h
6862 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
6863 function.
6864 (Incremental_binary::apply_incremental_relocs): New function.
6865 (Incremental_binary::do_apply_incremental_relocs): New function.
6866 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6867 data member.
6868 (Sized_incremental_binary::add_global_symbol): New function.
6869 (Sized_incremental_binary::global_symbol): New function.
6870 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6871 (Sized_incremental_binary::symbol_map_): New data member.
6872 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
6873 * target.h (Sized_target::apply_relocation): New function.
6874 * target-reloc.h (apply_relocation): New function.
6875 * x86_64.cc (Target_x86_64::apply_relocation): New function.
6876
6877 2011-04-22 Doug Kwan <dougkwan@google.com>
6878
6879 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
6880 flag of a SHT_ARM_EXIDX section.
6881 * testsuite/Makefile.am (arm_exidx_test): New test rules.
6882 * testsuite/Makefile.in: Regenerate.
6883 * testsuite/arm_exidx_test.s: New file.
6884 * testsuite/arm_exidx_test.sh: Same.
6885
6886 2011-04-20 Cary Coutant <ccoutant@google.com>
6887
6888 PR gold/12689
6889 * archive.h (Incremental_archive_entry::Archive_member):
6890 Initialize arg_serial_ (second constructor).
6891
6892 2011-04-17 Ian Lance Taylor <iant@google.com>
6893
6894 * object.cc (Relocate_info::location): Simplify location string.
6895 * errors.cc (Errors::error_at_location): Don't print program
6896 name.
6897 (Errors::warning_at_location): Likewise.
6898 (Errors::undefined_symbol): Likewise.
6899 * testsuite/debug_msg.sh: Update accordingly.
6900
6901 2011-04-14 Cary Coutant <ccoutant@google.com>
6902
6903 * gold/layout.cc (Layout::symtab_section_offset): New function.
6904 * gold/layout.h (Layout::symtab_section_offset): New function.
6905 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
6906
6907 2011-04-12 Ian Lance Taylor <iant@google.com>
6908
6909 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
6910 with MREMAP_MAYMOVE.
6911 * output.h (class Output_file): Add map_is_allocated_ field.
6912 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
6913 not available, provide stubs. If mremap is not available, #define
6914 it to gold_mremap.
6915 (MREMAP_MAYMOVE): Define if not defined.
6916 (Output_file::Output_file): Initialize map_is_allocated_.
6917 (Output_file::resize): Check map_is_allocated_.
6918 (Output_file::map_anonymous): If mmap fails, use malloc.
6919 (Output_file::unmap): Don't do anything for an anonymous map.
6920 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
6921 is not available, provide stubs.
6922 (File_read::View::~View): Use free rather than delete[].
6923 (File_read::make_view): Use malloc rather than new[]. If mmap
6924 fails, use malloc.
6925 (File_read::find_or_make_view): Use malloc rather than new[].
6926 * gold.h: Remove HAVE_REMAP code.
6927 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
6928 exists. Rename mremap to gold_mremap. If mmap is not available
6929 don't do anything.
6930 * configure, config.in: Rebuild.
6931
6932 2011-04-11 Ian Lance Taylor <iant@google.com>
6933
6934 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
6935 initialize local variable v.
6936
6937 2011-04-11 Cary Coutant <ccoutant@google.com>
6938
6939 * archive.cc (Archive::include_member): Adjust call to
6940 report_object.
6941 (Add_archive_symbols::run): Track argument serial numbers.
6942 (Lib_group::include_member): Likewise.
6943 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
6944 * archive.h (Incremental_archive_entry::Archive_member):
6945 Initialize arg_serial_.
6946 (Archive_member::arg_serial_): New data member.
6947 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
6948 (Sized_dynobj::do_add_symbols): Track symbols when doing an
6949 incremental link.
6950 (Sized_dynobj::do_for_all_local_got_entries): New function.
6951 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
6952 function.
6953 * fileread.cc (get_mtime): New function.
6954 * fileread.h (get_mtime): New function.
6955 * gold.cc (queue_initial_tasks): Check for incremental update.
6956 (process_incremental_input): New function.
6957 (queue_middle_tasks): Don't force valid target for incremental
6958 update.
6959 * incremental-dump.cc (find_input_containing_global): Adjust
6960 size of symbol info entry.
6961 (dump_incremental_inputs): Dump argument serial number and
6962 in_system_directory flag; bias shndx by 1; print symbol names
6963 when dumping per-file symbol lists; use new symbol info readers.
6964 * incremental.cc
6965 (Output_section_incremental_inputs:update_data_size): New function.
6966 (Sized_incremental_binary::setup_readers): Setup input readers
6967 for each input file; build maps for files added from libraries
6968 and scripts.
6969 (Sized_incremental_binary::check_input_args): New function.
6970 (Sized_incremental_binary::do_check_inputs): Build map of argument
6971 serial numbers to input arguments.
6972 (Sized_incremental_binary::do_file_has_changed): Rename
6973 do_file_is_unchanged to this; compare file modification times.
6974 (Sized_incremental_binary::do_init_layout): New function.
6975 (Sized_incremental_binary::do_reserve_layout): New function.
6976 (Sized_incremental_binary::do_get_input_reader): Remove.
6977 (Sized_incremental_binary::get_symtab_view): New function.
6978 (Incremental_checker::can_incrementally_link_output_file): Remove.
6979 (Incremental_inputs::report_command_line): Exclude --debug options.
6980 (Incremental_inputs::report_archive_begin): Add parameter; track
6981 argument serial numbers; don't put input file entry for archive
6982 before archive members.
6983 (Incremental_inputs::report_archive_end): Put input file entry
6984 for archive after archive members.
6985 (Incremental_inputs::report_object): Add parameter; track argument
6986 serial numbers and in_system_directory flag.
6987 (Incremental_inputs::report_script): Add parameter; track argument
6988 serial numbers.
6989 (Output_section_incremental_inputs::set_final_data_size): Adjust
6990 size of symbol info entry; check for forwarding symbols.
6991 (Output_section_incremental_inputs::write_input_files): Write
6992 in_system_directory flag and argument serial number.
6993 (Output_section_incremental_inputs::write_info_blocks): Map section
6994 indices between incremental info and original input file; store
6995 input section index for each symbol.
6996 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
6997 change operator() to visit().
6998 (class Global_got_offset_visitor): Likewise.
6999 (class Global_symbol_visitor_got_plt):
7000 (Output_section_incremental_inputs::write_got_plt): Use new visitor
7001 classes.
7002 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
7003 (Sized_incr_relobj::do_read_symbols): New function.
7004 (Sized_incr_relobj::do_layout): New function.
7005 (Sized_incr_relobj::do_layout_deferred_sections): New function.
7006 (Sized_incr_relobj::do_add_symbols): New function.
7007 (Sized_incr_relobj::do_should_include_member): New function.
7008 (Sized_incr_relobj::do_for_all_global_symbols): New function.
7009 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
7010 (Sized_incr_relobj::do_section_size): New function.
7011 (Sized_incr_relobj::do_section_name): New function.
7012 (Sized_incr_relobj::do_section_contents): New function.
7013 (Sized_incr_relobj::do_section_flags): New function.
7014 (Sized_incr_relobj::do_section_entsize): New function.
7015 (Sized_incr_relobj::do_section_address): New function.
7016 (Sized_incr_relobj::do_section_type): New function.
7017 (Sized_incr_relobj::do_section_link): New function.
7018 (Sized_incr_relobj::do_section_info): New function.
7019 (Sized_incr_relobj::do_section_addralign): New function.
7020 (Sized_incr_relobj::do_initialize_xindex): New function.
7021 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
7022 (Sized_incr_relobj::do_read_relocs): New function.
7023 (Sized_incr_relobj::do_gc_process_relocs): New function.
7024 (Sized_incr_relobj::do_scan_relocs): New function.
7025 (Sized_incr_relobj::do_count_local_symbols): New function.
7026 (Sized_incr_relobj::do_finalize_local_symbols): New function.
7027 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
7028 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
7029 (Sized_incr_relobj::do_relocate): New function.
7030 (Sized_incr_relobj::do_set_section_offset): New function.
7031 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
7032 (Sized_incr_dynobj::do_read_symbols): New function.
7033 (Sized_incr_dynobj::do_layout): New function.
7034 (Sized_incr_dynobj::do_add_symbols): New function.
7035 (Sized_incr_dynobj::do_should_include_member): New function.
7036 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
7037 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
7038 (Sized_incr_dynobj::do_section_size): New function.
7039 (Sized_incr_dynobj::do_section_name): New function.
7040 (Sized_incr_dynobj::do_section_contents): New function.
7041 (Sized_incr_dynobj::do_section_flags): New function.
7042 (Sized_incr_dynobj::do_section_entsize): New function.
7043 (Sized_incr_dynobj::do_section_address): New function.
7044 (Sized_incr_dynobj::do_section_type): New function.
7045 (Sized_incr_dynobj::do_section_link): New function.
7046 (Sized_incr_dynobj::do_section_info): New function.
7047 (Sized_incr_dynobj::do_section_addralign): New function.
7048 (Sized_incr_dynobj::do_initialize_xindex): New function.
7049 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
7050 (make_sized_incremental_object): New function.
7051 (Incremental_library::copy_unused_symbols): New function.
7052 (Incremental_library::do_for_all_unused_symbols): New function.
7053 * incremental.h (enum Incremental_input_flags): New type.
7054 (class Incremental_checker): Remove.
7055 (Incremental_input_entry::Incremental_input_entry): Add argument
7056 serial number.
7057 (Incremental_input_entry::arg_serial): New function.
7058 (Incremental_input_entry::set_is_in_system_directory): New function.
7059 (Incremental_input_entry::is_in_system_directory): New function.
7060 (Incremental_input_entry::arg_serial_): New data member.
7061 (Incremental_input_entry::is_in_system_directory_): New data member.
7062 (class Script_info): Move here from script.h.
7063 (Script_info::Script_info): Add filename parameter.
7064 (Script_info::filename): New function.
7065 (Script_info::filename_): New data member.
7066 (Incremental_script_entry::Incremental_script_entry): Add argument
7067 serial number.
7068 (Incremental_object_entry::Incremental_object_entry): Likewise.
7069 (Incremental_object_entry::add_input_section): Build list of input
7070 sections with map to original shndx.
7071 (Incremental_object_entry::get_input_section_index): New function.
7072 (Incremental_object_entry::shndx_): New data member.
7073 (Incremental_object_entry::name_key_): Rename; adjust all refs.
7074 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
7075 (Incremental_archive_entry::Incremental_archive_entry): Add argument
7076 serial number.
7077 (Incremental_inputs::report_archive_begin): Likewise.
7078 (Incremental_inputs::report_object): Likewise.
7079 (Incremental_inputs::report_script): Likewise.
7080 (class Incremental_global_symbol_reader): New class.
7081 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
7082 and store flags and input file type.
7083 (Incremental_input_entry_reader::arg_serial): New function.
7084 (Incremental_input_entry_reader::type): Extract type from flags.
7085 (Incremental_input_entry_reader::is_in_system_directory): New function.
7086 (Incremental_input_entry_reader::get_input_section_count): Call
7087 accessor function for type.
7088 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
7089 function for type; adjust size of global symbol entry.
7090 (Incremental_input_entry_reader::get_global_symbol_count): Call
7091 accessor function for type.
7092 (Incremental_input_entry_reader::get_object_count): Likewise.
7093 (Incremental_input_entry_reader::get_object_offset): Likewise.
7094 (Incremental_input_entry_reader::get_member_count): Likewise.
7095 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
7096 (Incremental_input_entry_reader::get_member_offset): Likewise.
7097 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
7098 (Incremental_input_entry_reader::Global_symbol_info): Remove.
7099 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
7100 (Incremental_input_entry_reader::get_global_symbol_reader): New
7101 function.
7102 (Incremental_input_entry_reader::get_output_symbol_index): New
7103 function.
7104 (Incremental_input_entry_reader::type_): Remove.
7105 (Incremental_input_entry_reader::flags_): New data member.
7106 (Incremental_inputs_reader::input_file_offset): New function.
7107 (Incremental_inputs_reader::input_file_index): New function.
7108 (Incremental_inputs_reader::input_file): Call input_file_offset.
7109 (Incremental_inputs_reader::input_file_at_offset): New function.
7110 (Incremental_relocs_reader::get_r_type): Reformat.
7111 (Incremental_relocs_reader::get_r_shndx): Reformat.
7112 (Incremental_relocs_reader::get_r_offset): Reformat.
7113 (Incremental_relocs_reader::data): New function.
7114 (Incremental_binary::Incremental_binary): Initialize new data members.
7115 (Incremental_binary::check_inputs): Add cmdline parameter.
7116 (Incremental_binary::file_is_unchanged): Remove.
7117 (Input_reader::arg_serial): New function.
7118 (Input_reader::get_unused_symbol_count): New function.
7119 (Input_reader::get_unused_symbol): New function.
7120 (Input_reader::do_arg_serial): New function.
7121 (Input_reader::do_get_unused_symbol_count): New function.
7122 (Input_reader::do_get_unused_symbol): New function.
7123 (Incremental_binary::input_file_count): New function.
7124 (Incremental_binary::get_input_reader): Change signature to use
7125 index instead of filename.
7126 (Incremental_binary::file_has_changed): New function.
7127 (Incremental_binary::get_input_argument): New function.
7128 (Incremental_binary::get_library): New function.
7129 (Incremental_binary::get_script_info): New function.
7130 (Incremental_binary::init_layout): New function.
7131 (Incremental_binary::reserve_layout): New function.
7132 (Incremental_binary::output_file): New function.
7133 (Incremental_binary::do_check_inputs): New function.
7134 (Incremental_binary::do_file_is_unchanged): Remove.
7135 (Incremental_binary::do_file_has_changed): New function.
7136 (Incremental_binary::do_init_layout): New function.
7137 (Incremental_binary::do_reserve_layout): New function.
7138 (Incremental_binary::do_input_file_count): New function.
7139 (Incremental_binary::do_get_input_reader): Change signature.
7140 (Incremental_binary::input_args_map_): New data member.
7141 (Incremental_binary::library_map_): New data member.
7142 (Incremental_binary::script_map_): New data member.
7143 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7144 new data members.
7145 (Sized_incremental_binary::output_section): New function.
7146 (Sized_incremental_binary::inputs_reader): Add const.
7147 (Sized_incremental_binary::symtab_reader): Add const.
7148 (Sized_incremental_binary::relocs_reader): Add const.
7149 (Sized_incremental_binary::got_plt_reader): Add const.
7150 (Sized_incremental_binary::get_symtab_view): New function.
7151 (Sized_incremental_binary::Inputs_reader): New typedef.
7152 (Sized_incremental_binary::Input_entry_reader): New typedef.
7153 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
7154 (Sized_incremental_binary::do_file_is_unchanged): Remove.
7155 (Sized_incremental_binary::do_file_has_changed): New function.
7156 (Sized_incremental_binary::do_init_layout): New function.
7157 (Sized_incremental_binary::do_reserve_layout): New function.
7158 (Sized_input_reader::Inputs_reader): Remove.
7159 (Sized_input_reader::Input_entry_reader): Remove.
7160 (Sized_input_reader::do_arg_serial): New function.
7161 (Sized_input_reader::do_get_unused_symbol_count): New function.
7162 (Sized_input_reader::do_get_unused_symbol): New function.
7163 (Sized_incremental_binary::do_input_file_count): New function.
7164 (Sized_incremental_binary::do_get_input_reader): Change signature;
7165 use index instead of filename.
7166 (Sized_incremental_binary::section_map_): New data member.
7167 (Sized_incremental_binary::input_entry_readers_): New data member.
7168 (class Sized_incr_relobj): New class.
7169 (class Sized_incr_dynobj): New class.
7170 (make_sized_incremental_object): New function.
7171 (class Incremental_library): New class.
7172 * layout.cc (Free_list::num_lists): New static data member.
7173 (Free_list::num_nodes): New static data member.
7174 (Free_list::num_removes): New static data member.
7175 (Free_list::num_remove_visits): New static data member.
7176 (Free_list::num_allocates): New static data member.
7177 (Free_list::num_allocate_visits): New static data member.
7178 (Free_list::init): New function.
7179 (Free_list::remove): New function.
7180 (Free_list::allocate): New function.
7181 (Free_list::dump): New function.
7182 (Free_list::print_stats): New function.
7183 (Layout_task_runner::run): Resize output file for incremental updates.
7184 (Layout::Layout): Initialize new data members.
7185 (Layout::set_incremental_base): New function.
7186 (Layout::init_fixed_output_section): New function.
7187 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
7188 incremental updates.
7189 (Layout::create_gold_note): Do not create gold note section for
7190 incremental updates.
7191 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
7192 for incremental updates.
7193 (Layout::set_section_offsets): For incremental updates, allocate space
7194 from free list.
7195 (Layout::create_symtab_sections): Layout with offsets relative to
7196 start of section; for incremental updates, allocate space from free
7197 list.
7198 (Layout::create_shdrs): For incremental updates, allocate space from
7199 free list.
7200 (Layout::finish_dynamic_section): For incremental updates, do not
7201 check --as-needed (fixed in subsequent patch).
7202 * layout.h (class Free_list): New class.
7203 (Layout::set_incremental_base): New function.
7204 (Layout::incremental_base): New function.
7205 (Layout::init_fixed_output_section): New function.
7206 (Layout::allocate): New function.
7207 (Layout::incremental_base_): New data member.
7208 (Layout::free_list_): New data member.
7209 * main.cc (main): Print Free_list statistics.
7210 * object.cc (Relobj::finalize_incremental_relocs): Add
7211 clear_counts parameter; clear counts only when clear_counts is set.
7212 (Sized_relobj::Sized_relobj): Initialize new base class.
7213 (Sized_relobj::do_layout): Don't report special sections.
7214 (Sized_relobj::do_for_all_local_got_entries): New function.
7215 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
7216 symtab_off to all symbol table offsets.
7217 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
7218 * object.h (class Got_offset_list): Move to top of file.
7219 (Object::Object): Allow case where input_file == NULL.
7220 (Object::~Object): Likewise.
7221 (Object::input_file): Assert that input_file != NULL.
7222 (Object::lock): Allow case where input_file == NULL.
7223 (Object::unlock): Likewise.
7224 (Object::is_locked): Likewise.
7225 (Object::token): Likewise.
7226 (Object::release): Likewise.
7227 (Object::is_incremental): New function.
7228 (Object::get_mtime): New function.
7229 (Object::for_all_local_got_entries): New function.
7230 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
7231 (Object::set_is_in_system_directory): New function.
7232 (Object::is_in_system_directory): New function.
7233 (Object::do_is_incremental): New function.
7234 (Object::do_get_mtime): New function.
7235 (Object::do_for_all_local_got_entries): New function.
7236 (Object::is_in_system_directory_): New data member.
7237 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
7238 (class Sized_relobj_base): New class.
7239 (class Sized_relobj): Derive from Sized_relobj_base.
7240 (class Sized_relobj::Symbols): Redeclare from base class.
7241 (class Sized_relobj::local_got_offset_list): Remove.
7242 (class Sized_relobj::Output_sections): Redeclare from base class.
7243 (class Sized_relobj::do_for_all_local_got_entries): New function.
7244 (class Sized_relobj::write_local_symbols): Add offset parameter.
7245 (class Sized_relobj::local_symbol_offset_): Update comment.
7246 (class Sized_relobj::local_dynsym_offset_): Update comment.
7247 * options.cc (Input_arguments::add_file): Remove const.
7248 * options.h (Input_file_argument::Input_file_argument):
7249 Initialize arg_serial_ (all constructors).
7250 (Input_file_argument::set_arg_serial): New function.
7251 (Input_file_argument::arg_serial): New function.
7252 (Input_file_argument::arg_serial_): New data member.
7253 (Input_arguments::Input_arguments): Initialize file_count_.
7254 (Input_arguments::add_file): Remove const.
7255 (Input_arguments::number_of_input_files): New function.
7256 (Input_arguments::file_count_): New data member.
7257 (Command_line::number_of_input_files): Call
7258 Input_arguments::number_of_input_files.
7259 * output.cc (Output_segment_headers::Output_segment_headers):
7260 Set current size.
7261 (Output_section::Input_section::current_data_size): New function.
7262 (Output_section::Output_section): Initialize new data members.
7263 (Output_section::add_input_section): Don't do merge sections for
7264 an incremental link; allocate space from free list for an
7265 incremental update.
7266 (Output_section::add_output_section_data): Allocate space from
7267 free list for an incremental update.
7268 (Output_section::update_data_size): New function.
7269 (Output_section::set_fixed_layout): New function.
7270 (Output_section::reserve): New function.
7271 (Output_segment::set_section_addresses): Remove const.
7272 (Output_segment::set_section_list_addresses): Remove const; allocate
7273 space from free list for an incremental update.
7274 (Output_segment::set_offset): Adjust size of RELRO segment for an
7275 incremental update.
7276 * output.h (Output_data::current_data_size): Move here from
7277 child classes.
7278 (Output_data::pre_finalize_data_size): New function.
7279 (Output_data::update_data_size): New function.
7280 (Output_section_headers::update_data_size): new function.
7281 (Output_section_data_build::current_data_size): Move to Output_data.
7282 (Output_data_strtab::update_data_size): New function.
7283 (Output_section::current_data_size): Move to Output_data.
7284 (Output_section::set_fixed_layout): New function.
7285 (Output_section::has_fixed_layout): New function.
7286 (Output_section::reserve): New function.
7287 (Output_section::update_data_size): New function.
7288 (Output_section::has_fixed_layout_): New data member.
7289 (Output_section::free_list_): New data member.
7290 (Output_segment::set_section_addresses): Remove const.
7291 (Output_segment::set_section_list_addresses): Remove const.
7292 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
7293 New function.
7294 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
7295 New function.
7296 * readsyms.cc (Read_symbols::do_read_symbols): Add library
7297 parameter when calling Add_symbols constructor; store argument
7298 serial number for members of a lib group.
7299 (Add_symbols::locks): Allow case where token == NULL.
7300 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
7301 (Read_member::~Read_member): New function.
7302 (Read_member::is_runnable): New function.
7303 (Read_member::locks): New function.
7304 (Read_member::run): New function.
7305 (Check_script::~Check_script): New function.
7306 (Check_script::is_runnable): New function.
7307 (Check_script::locks): New function.
7308 (Check_script::run): New function.
7309 (Check_library::~Check_library): New function.
7310 (Check_library::is_runnable): New function.
7311 (Check_library::locks): New function.
7312 (Check_library::run): New function.
7313 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
7314 (Add_symbols::library_): New data member.
7315 (class Read_member): New class.
7316 (class Check_script): New class.
7317 (class Check_library): New class.
7318 * reloc.cc (Read_relocs::is_runnable): Allow case where
7319 token == NULL.
7320 (Read_relocs::locks): Likewise.
7321 (Scan_relocs::locks): Likewise.
7322 (Relocate_task::locks): Likewise.
7323 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
7324 to clear counters.
7325 (Sized_relobj::incremental_relocs_scan): Fix comment.
7326 (Sized_relobj::do_relocate): Pass output file offset to
7327 write_local_symbols.
7328 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
7329 from class declaration.
7330 * script.cc (read_input_script): Allocate Script_info; pass
7331 argument serial number to report_script.
7332 * script.h (class Script_info): Move to incremental.h.
7333 * symtab.cc (Symbol_table::add_from_incrobj): New function.
7334 * symtab.h (Symbol_table::add_from_incrobj): New function.
7335 (Symbol_table::set_file_offset): New function.
7336
7337 2011-04-05 Cary Coutant <ccoutant@google.com>
7338
7339 * incremental-dump.cc (dump_incremental_inputs): Change signature
7340 to take a Sized_incremental_binary; change caller. Use readers
7341 in Sized_incremental_binary.
7342 * incremental.cc
7343 (Sized_incremental_binary::find_incremental_inputs_sections):
7344 Rename do_find_incremental_inputs_sections to this.
7345 (Sized_incremental_binary::setup_readers): New function.
7346 (Sized_incremental_binary::do_check_inputs): Check
7347 has_incremental_info_ flag; move setup code to setup_readers;
7348 use input readers.
7349 (Sized_incremental_binary::do_file_is_unchanged): New function.
7350 (Sized_incremental_binary::do_get_input_reader): New function.
7351 * incremental.h (class Incremental_binary): Move to end of file.
7352 (Incremental_binary::file_is_unchanged): New function.
7353 (Incremental_binary::do_file_is_unchanged): New function.
7354 (Incremental_binary::Input_reader): New class.
7355 (Incremental_binary::get_input_reader): New function.
7356 (class Sized_incremental_binary): Move to end of file.
7357 (Sized_incremental_binary::Sized_incremental_binary): Setup the
7358 input section reader classes.
7359 (Sized_incremental_binary::has_incremental_info): New function.
7360 (Sized_incremental_binary::inputs_reader): New function.
7361 (Sized_incremental_binary::symtab_reader): New function.
7362 (Sized_incremental_binary::relocs_reader): New function.
7363 (Sized_incremental_binary::got_plt_reader): New function.
7364 (Sized_incremental_binary::do_file_is_unchanged): New function.
7365 (Sized_incremental_binary::Sized_input_reader): New class.
7366 (Sized_incremental_binary::get_input_reader): New function.
7367 (Sized_incremental_binary::find_incremental_inputs_sections):
7368 Rename do_find_incremental_inputs_sections to this.
7369 (Sized_incremental_binary::setup_readers): New function.
7370 (Sized_incremental_binary::has_incremental_info_): New data member.
7371 (Sized_incremental_binary::inputs_reader_): New data member.
7372 (Sized_incremental_binary::symtab_reader_): New data member.
7373 (Sized_incremental_binary::relocs_reader_): New data member.
7374 (Sized_incremental_binary::got_plt_reader_): New data member.
7375 (Sized_incremental_binary::current_input_file_): New data member.
7376
7377 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
7378
7379 PR gold/12640
7380 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
7381 violation.
7382
7383 2011-03-30 Cary Coutant <ccoutant@google.com>
7384
7385 * archive.cc (Archive::include_member): Adjust call to report_object.
7386 (Add_archive_symbols::run): Add script_info to call to
7387 report_archive_begin.
7388 (Lib_group::include_member): Adjust call to report_object.
7389 (Add_lib_group_symbols::run): Adjust call to report_object.
7390 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
7391 blocks. Add object count for script input files.
7392 * incremental.cc (Incremental_inputs::report_archive_begin): Add
7393 script_info parameter; change all callers.
7394 (Incremental_inputs::report_object): Add script_info parameter;
7395 change all callers.
7396 (Incremental_inputs::report_script): Store backpointer to
7397 incremental info entry.
7398 (Output_section_incremental_inputs::set_final_data_size): Record
7399 additional information for scripts.
7400 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7401 * incremental.h (Incremental_script_entry::add_object): New function.
7402 (Incremental_script_entry::get_object_count): New function.
7403 (Incremental_script_entry::get_object): New function.
7404 (Incremental_script_entry::objects_): New data member; adjust
7405 constructor.
7406 (Incremental_inputs::report_archive_begin): Add script_info parameter.
7407 (Incremental_inputs::report_object): Add script_info parameter.
7408 (Incremental_inputs_reader::get_object_count): New function.
7409 (Incremental_inputs_reader::get_object_offset): New function.
7410 * options.cc (Input_arguments::add_file): Return reference to
7411 new input argument.
7412 * options.h (Input_argument::set_script_info): New function.
7413 (Input_argument::script_info): New function.
7414 (Input_argument::script_info_): New data member; adjust all
7415 constructors.
7416 (Input_file_group::add_file): Return reference to new input argument.
7417 (Input_file_lib::add_file): Likewise.
7418 (Input_arguments::add_file): Likewise.
7419 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
7420 * script.cc (Parser_closure::Parser_closure): Add script_info
7421 parameter; adjust all callers.
7422 (Parser_closure::script_info): New function.
7423 (Parser_closure::script_info_): New data member.
7424 (read_input_script): Report scripts earlier to incremental info.
7425 (script_add_file): Set script_info in Input_argument.
7426 (script_add_library): Likewise.
7427 * script.h (Script_options::Script_info): Rewrite class.
7428
7429 2011-03-29 Cary Coutant <ccoutant@google.com>
7430
7431 * archive.cc (Library_base::should_include_member): Move
7432 method here from class Archive.
7433 (Archive::Archive): Initialize base class.
7434 (Archive::should_include_member): Move to base class.
7435 (Archive::do_for_all_unused_symbols): New function.
7436 (Add_archive_symbols::run): Remove redundant access to
7437 incremental_inputs.
7438 (Lib_group::Lib_group): Initialize base class.
7439 (Lib_group::do_filename): New function.
7440 (Lib_group::include_member): Pass pointer to Lib_group to
7441 report_object.
7442 (Lib_group::do_for_all_unused_symbols): New function.
7443 (Add_lib_group_symbols::run): Report archive information for
7444 incremental links.
7445 * archive.h (class Library_base): New base class.
7446 (class Archive): Derive from Library_base.
7447 (Archive::filename): Move to base class.
7448 (Archive::set_incremental_info): Likewise.
7449 (Archive::incremental_info): Likewise.
7450 (Archive::Should_include): Likewise.
7451 (Archive::should_include_member): Likewise.
7452 (Archive::Armap_entry): Remove.
7453 (Archive::Unused_symbol_iterator): Remove.
7454 (Archive::unused_symbols_begin): Remove.
7455 (Archive::unused_symbols_end): Remove.
7456 (Archive::do_filename): New function.
7457 (Archive::do_get_mtime): New function.
7458 (Archive::do_for_all_unused_symbols): New function.
7459 (Archive::task_): Move to base class.
7460 (Archive::incremental_info_): Likewise.
7461 (class Lib_group): Derive from Library_base.
7462 (Lib_group::do_filename): New function.
7463 (Lib_group::do_get_mtime): New function.
7464 (Lib_group::do_for_all_unused_symbols): New function.
7465 (Lib_group::task_): Move to base class.
7466 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
7467 function.
7468 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
7469 function.
7470 * incremental.cc (Incremental_inputs::report_archive_begin):
7471 Use Library_base; call library's get_mtime; add incremental inputs
7472 entry before members.
7473 (class Unused_symbol_visitor): New class.
7474 (Incremental_inputs::report_archive_end): Use Library_base; use
7475 visitor class to record unused symbols; don't add incremental inputs
7476 entry after members.
7477 (Incremental_inputs::report_object): Use Library_base.
7478 * incremental.h
7479 (Incremental_archive_entry::Incremental_archive_entry): Remove
7480 unused Archive parameter.
7481 (Incremental_inputs::report_archive_begin): Use Library_base.
7482 (Incremental_inputs::report_archive_end): Likewise.
7483 (Incremental_inputs::report_object): Likewise.
7484 * object.cc (Sized_relobj::do_for_all_global_symbols): New
7485 function.
7486 * object.h (Object::for_all_global_symbols): New function.
7487 (Object::do_for_all_global_symbols): New function.
7488 (Sized_relobj::do_for_all_global_symbols): New function.
7489 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
7490 function.
7491 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
7492 function.
7493
7494 2011-03-27 Ian Lance Taylor <iant@google.com>
7495
7496 * archive.cc (Archive::interpret_header): Return -1 if something
7497 goes wrong. Change callers accordingly.
7498
7499 2011-03-25 Cary Coutant <ccoutant@google.com>
7500
7501 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
7502 * testsuite/Makefile.in: Regenerate.
7503
7504 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
7505
7506 * plugin.cc (get_view): New.
7507 (Plugin::load): Pass get_view to the plugin.
7508 (Plugin_manager::get_view): New.
7509
7510 2011-03-21 Ian Lance Taylor <iant@google.com>
7511
7512 * testsuite/final_layout.sh: Rewrite to not use dc.
7513 * testsuite/relro_test.sh: Fail if dc is not present.
7514
7515 2011-03-21 Sriraman Tallam <tmsriram@google.com>
7516
7517 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
7518 Change == to -eq.
7519 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
7520 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
7521 Change == to -eq.
7522 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
7523 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
7524
7525 2011-03-14 Ian Lance Taylor <iant@google.com>
7526
7527 * script-sections.cc (Sort_output_sections::script_compare):
7528 Rename from is_before, change return type.
7529 (Sort_output_sections::operator()): Adjust accordingly.
7530
7531 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
7532
7533 PR gold/12572
7534 * testsuite/odr_violation2.cc: Add comment to make all error line
7535 numbers double digits.
7536 * testsuite/debug_msg.sh: Adjust expected errors.
7537
7538 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
7539
7540 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
7541 but mark earlier ones as non-canonical
7542 (offset_to_iterator): Update search target and example
7543 (do_addr2line): Return extra lines in a vector*
7544 (format_file_lineno): Extract from do_addr2line
7545 (one_addr2line): Add vector* out-param
7546 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
7547 when a lineno entry appeared last for its instruction
7548 (Dwarf_line_info): Add vector* out-param
7549 * object.cc (Relocate_info): Pass NULL for the vector* out-param
7550 * symtab.cc (Odr_violation_compare): Include the lineno in the
7551 comparison again.
7552 (linenos_from_loc): New. Combine the canonical line for an
7553 address with its other lines.
7554 (True_if_intersect): New. Helper functor to make
7555 std::set_intersection a query.
7556 (detect_odr_violations): Compare sets of lines instead of just
7557 one line for each function. This became less deterministic, but
7558 has fewer false positives.
7559 * symtab.h: Declarations.
7560 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
7561 mix an optimized and non-optimized object in the same binary
7562 (odr_violation2.so): Same.
7563 * testsuite/Makefile.in: Regenerate from Makefile.am.
7564 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
7565 * testsuite/debug_msg.sh: Update line numbers and add
7566 assertions.
7567 * testsuite/odr_violation1.cc: Use OdrDerived, in a
7568 non-optimized context.
7569 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
7570 isn't inlined, and use OdrDerived in an optimized context.
7571 * testsuite/odr_header1.h: Defines OdrDerived, where
7572 optimization will change the
7573 first-instruction-in-the-destructor's file and line number.
7574 * testsuite/odr_header2.h: Defines OdrBase.
7575
7576 2011-03-09 Ian Lance Taylor <iant@google.com>
7577
7578 * fileread.cc (File_read::clear_views): Don't delete the whole
7579 file view.
7580
7581 2011-03-08 Ian Lance Taylor <iant@google.com>
7582
7583 PR gold/12525
7584 * fileread.cc: #include <climits>.
7585 (GOLD_IOV_MAX): Define.
7586 (File_read::read_multiple): Limit number of entries by iov_max.
7587 * fileread.h (class File_read): Always set max_readv_entries to
7588 128.
7589
7590 2011-03-07 Ian Lance Taylor <iant@google.com>
7591
7592 PR gold/12525
7593 * options.h (class General_options): Add -dy and -dn.
7594
7595 2011-03-02 Cary Coutant <ccoutant@google.com>
7596
7597 * testsuite/script_test_9.t: Add TLS segment.
7598
7599 2011-03-02 Simon Baldwin <simonb@google.com>
7600
7601 * configure.ac: Add check for gnu_indirect_function support in
7602 the toolchain building binutils.
7603 * configure: Rebuild.
7604
7605 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
7606
7607 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
7608 plugin only symbols.
7609 (Symbol_table::sized_finalize_symbol) Mark symbol only present
7610 in plugin files as not needed in the symbol table.
7611
7612 2011-02-11 Sriraman Tallam <tmsriram@google.com>
7613
7614 * output.cc (Output_section::add_input_section): Delay fill
7615 generation for section ordering.
7616
7617 2011-02-09 Ian Lance Taylor <iant@google.com>
7618
7619 PR gold/12316
7620 * object.h (class Sized_relobj): Remove clear_local_symbols.
7621 * reloc.cc (Sized_relobj::do_relocate): Don't call
7622 clear_local_symbols.
7623
7624 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
7625
7626 * plugin.cc (is_visible_from_outside): Return true for symbols
7627 in the -u option.
7628
7629 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
7630
7631 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
7632 filename.
7633
7634 2011-02-02 Sriraman Tallam <tmsriram@google.com>
7635
7636 * icf.h (is_section_foldable_candidate): Change type of parameter
7637 to std::string.
7638 * icf.cc (Icf::find_identical_sections): Change type of local variable
7639 section_name to be std::string.
7640 (is_function_ctor_or_dtor): Change type of parameter to std::string.
7641
7642 2011-01-25 Ian Lance Taylor <iant@google.com>
7643
7644 * script.cc (script_add_extern): Rewrite to use
7645 add_symbol_reference.
7646
7647 2011-01-25 Doug Kwan <dougkwan@google.com>
7648
7649 * icf.cc (get_section_contents): Always lock section's object.
7650
7651 2011-01-24 Ian Lance Taylor <iant@google.com>
7652
7653 * options.h (class General_options): Accept
7654 --no-detect-odr-violations.
7655
7656 2011-01-24 Ian Lance Taylor <iant@google.com>
7657
7658 * version.cc (version_string): Bump to 1.11.
7659
7660 2011-01-24 Ian Lance Taylor <iant@google.com>
7661
7662 * plugin.cc (class Plugin_rescan): Define new class.
7663 (Plugin_manager::claim_file): Set any_claimed_.
7664 (Plugin_manager::save_archive): New function.
7665 (Plugin_manager::save_input_group): New function.
7666 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
7667 necessary.
7668 (Plugin_manager::new_undefined_symbol): New function.
7669 (Plugin_manager::rescan): New function.
7670 (Plugin_manager::rescannable_defines): New function.
7671 (Plugin_manager::add_input_file): Set any_added_.
7672 * plugin.h (class Plugin_manager): define new fields rescannable_,
7673 undefined_symbols_, any_claimed_, and any_added_. Declare
7674 Plugin_rescan as friend. Declare new functions.
7675 (Plugin_manager::Rescannable): Define type.
7676 (Plugin_manager::Rescannable_list): Define type.
7677 (Plugin_manager::Undefined_symbol_list): Define type.
7678 (Plugin_manager::Plugin_manager): Initialize new fields.
7679 * archive.cc (Archive::defines_symbol): New function.
7680 (Add_archive_symbols::run): Pass archive to plugins if any.
7681 * archive.h (class Archive): Declare defines_symbol.
7682 * readsyms.cc (Input_group::~Input_group): New function.
7683 (Finish_group::run): Pass input_group to plugins if any.
7684 * readsyms.h (class Input_group): Declare destructor.
7685 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
7686 any.
7687
7688 2011-01-10 Ian Lance Taylor <iant@google.com>
7689
7690 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
7691 section as relro.
7692 (Layout::set_segment_offsets): Reset increase_relro before calling
7693 set_section_addresses a second time.
7694
7695 2011-01-04 Cary Coutant <ccoutant@google.com>
7696
7697 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
7698 sections before NOBITS sections.
7699
7700 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
7701
7702 * version.cc (print_version): Update copyright to 2011.
7703
7704 2010-12-23 Cary Coutant <ccoutant@google.com>
7705
7706 * output.h (Output_data_reloc::add_output_section): Pass OD instead
7707 of OS to this->add. Add OD parameter to second form of the function.
7708
7709 2010-12-20 Ian Lance Taylor <iant@google.com>
7710
7711 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
7712 second of two consecutive entries with same offset.
7713
7714 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7715
7716 * testsuite/Makefile.am (ifuncmain2static_LDADD)
7717 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
7718 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
7719 to avoid unneeded links against $(LDADD).
7720 * testsuite/Makefile.in: Regenerate.
7721
7722 2010-12-15 Ian Lance Taylor <iant@google.com>
7723
7724 PR gold/12324
7725 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
7726 for R_X86_64_32 and R_X86_64_PC32.
7727 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
7728 ver_matching_def_pic.o.
7729 (ver_matching_def_pic.o): New target.
7730
7731 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7732
7733 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
7734 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
7735 Move definition before File_read::View member definitions.
7736 (File_read::View::~View): Initialize and hold lock before
7737 updating current_mapped_bytes.
7738
7739 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7740
7741 * dwarf_reader.cc: Remove outdated comment.
7742 * gold-threads.cc: Fix typo in error message.
7743 * archive.cc: Fix typos in comments.
7744 * archive.h: Likewise.
7745 * arm-reloc-property.cc: Likewise.
7746 * arm-reloc-property.h: Likewise.
7747 * arm-reloc.def: Likewise.
7748 * arm.cc: Likewise.
7749 * attributes.h: Likewise.
7750 * cref.cc: Likewise.
7751 * ehframe.cc: Likewise.
7752 * fileread.h: Likewise.
7753 * gold.h: Likewise.
7754 * i386.cc: Likewise.
7755 * icf.cc: Likewise.
7756 * incremental.h: Likewise.
7757 * int_encoding.cc: Likewise.
7758 * layout.h: Likewise.
7759 * main.cc: Likewise.
7760 * merge.h: Likewise.
7761 * object.cc: Likewise.
7762 * object.h: Likewise.
7763 * options.cc: Likewise.
7764 * readsyms.cc: Likewise.
7765 * reduced_debug_output.cc: Likewise.
7766 * reloc.cc: Likewise.
7767 * script-sections.cc: Likewise.
7768 * sparc.cc: Likewise.
7769 * symtab.h: Likewise.
7770 * target-reloc.h: Likewise.
7771 * target.cc: Likewise.
7772 * target.h: Likewise.
7773 * timer.cc: Likewise.
7774 * timer.h: Likewise.
7775 * x86_64.cc: Likewise.
7776
7777 2010-12-09 Cary Coutant <ccoutant@google.com>
7778
7779 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
7780 stack.
7781 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
7782 parameter; change all callers.
7783 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
7784 * options.h (warn_execstack): New option.
7785
7786 2010-12-07 Doug Kwan <dougkwan@google.com>
7787
7788 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
7789 like function call relocations.
7790
7791 2010-12-07 Ian Lance Taylor <iant@google.com>
7792
7793 * archive.cc (Archive::get_elf_object_for_member): Permit
7794 punconfigured to be NULL.
7795 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
7796 (Archive::include_member): Pass NULL to get_elf_object_for_member
7797 if we searched for the archive and this is the first included
7798 object.
7799
7800 2010-12-01 Ian Lance Taylor <iant@google.com>
7801
7802 * dwarf_reader.h (class Sized_dwarf_line_info): Add
7803 track_relocs_type_ field.
7804 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7805 Set track_relocs_type_.
7806 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
7807 contents when using RELA relocs.
7808 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
7809 reloc_map_.
7810 * reloc.cc (Track_relocs::next_addend): New function.
7811 * reloc.h (class Track_relocs): Declare next_addend.
7812
7813 2010-12-01 Ian Lance Taylor <iant@google.com>
7814
7815 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
7816 virtual destructor.
7817
7818 2010-12-01 Ian Lance Taylor <iant@google.com>
7819
7820 * README: Update compilers known to work and fail.
7821
7822 2010-11-23 Matthias Klose <doko@ubuntu.com>
7823
7824 * configure.in: For --enable-gold, handle value `default' instead of
7825 `both*'. Always install ld as ld.bfd, install as ld if gold is
7826 not the default.
7827 * configure: Regenerate.
7828
7829 2010-11-18 Doug Kwan <dougkwan@google.com>
7830
7831 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
7832 and right_alignment to be zero. Store result alignment only if it is
7833 greater than existing alignment.
7834
7835 2010-11-16 Cary Coutant <ccoutant@google.com>
7836
7837 PR gold/12220
7838 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7839 Check for ".zdebug_line".
7840
7841 2010-11-16 Doug Kwan <dougkwan@google.com>
7842 Cary Coutant <ccoutant@google.com>
7843
7844 * output.h (Output_segment::set_section_addresses): Pass increase_relro
7845 by reference; adjust all callers.
7846 * output.cc (Output_segment::set_section_addresses): Adjust references
7847 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
7848 list is empty.
7849 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
7850 end at page boundary.
7851
7852 2010-11-16 Cary Coutant <ccoutant@google.com>
7853
7854 PR gold/12220
7855 * layout.cc (Layout::choose_output_section): Transform names of
7856 compressed sections even when using a script with a SECTIONS clause.
7857 (Layout::output_section_name): Remove code to transform
7858 compressed debug section names.
7859 * output.cc (Output_section::add_input_section): Use uncompressed
7860 section size when tracking input sections.
7861
7862 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
7863
7864 * symtab.h (Symbol::NON_PIC_REF): Remove.
7865 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
7866 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
7867 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
7868 (Symbol::use_plt_offset): Take a flags argument and pass it
7869 directly to needs_dynamic_reloc. Restrict check for undefined
7870 weak symbols to function calls.
7871 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
7872 (Target_arm::Scan::global): Use it.
7873 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
7874 (Target_arm::Relocate::relocate): Likewise.
7875 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
7876 parameter with an r_type parameter. Use get_reference_flags
7877 to get the flags.
7878 (Target_arm::Relocate::relocate): Update accordingly.
7879 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
7880 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
7881 (Target_i386::Scan::global): Likewise.
7882 (Target_i386::Relocate::relocate): Likewise.
7883 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
7884 parameter with an r_type parameter. Use get_reference_flags
7885 to get the flags.
7886 (Target_i386::Relocate::relocate): Update accordingly.
7887 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
7888 (Target_powerpc::Scan::global): Use it.
7889 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
7890 (Target_powerpc::Relocate::relocate): Likewise.
7891 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
7892 (Target_sparc::Scan::global): Use it.
7893 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
7894 (Target_sparc::Relocate::relocate): Likewise.
7895 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
7896 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
7897 (Target_x86_64::Scan::global): Likewise.
7898 (Target_x86_64::Relocate::relocate): Likewise.
7899
7900 2010-11-08 Doug Kwan <dougkwan@google.com>
7901 Cary Coutant <ccoutant@google.com>
7902
7903 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
7904 (Arm_exidx_merge_section::section_contents_): New data member.
7905 (Arm_input_section::Arm_input_section): Initialize original_contents_.
7906 (Arm_input_section::~Arm_input_section): De-allocate memory.
7907 (Arm_input_section::original_contents_): New data member.
7908 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
7909 in parameters instead of calling Object::section_contents without
7910 locking.
7911 (Arm_output_section::group_section): New parameter TASK. Pass it
7912 to callees that need locking objects.
7913 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
7914 to lock EXIDX input sections. Fix a formatting issue. Call
7915 Arm_exidx_merged_section::build_contents to create merged section
7916 contents.
7917 (Arm_output_section::create_stub_group): New parameter TASK. Use it
7918 to lock object of stub table owner.
7919 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
7920 TEXT_SIZE to initialize data member TEXT_SIZE_.
7921 (Arm_exidx_input_section::addralign): Fix typo in comment.
7922 (Arm_exidx_input_section::text_size): New method.
7923 (Target_arm::do_relax): New parameter TASK. Pass it to callees
7924 that require locking objects. Lock objects before scanning for stubs
7925 and updating local symbols.
7926 (Arm_input_section<big_endian>::init): Copy contents of original
7927 input section.
7928 (Arm_input_section<big_endian>::do_write): Use saved contents of
7929 original input section instead of calling Object::section_contents
7930 without locking.
7931 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
7932 size without calling Object::section_size().
7933 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
7934 for size. Allocate a buffer for merged EXIDX entries.
7935 (Arm_exidx_merged_section::build_contents): New method.
7936 (Arm_exidx_merged_section::do_write): Move merge section contents
7937 building code to Arm_exidx_merged_section::build_contetns. Write
7938 out contetns in buffer instead of building it on the fly.
7939 (Arm_relobj::make_exidx_input_section): Also pass text section size
7940 to Arm_exidx_input_section constructor.
7941 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
7942 (Arm_dynobj::do_read_symbols): Fix memory leak.
7943 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
7944 * target.h: (class Task): Add forward declaration.
7945 (Target::relax): Add new parameter TASK and pass it to
7946 Target::do_relax().
7947 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
7948
7949 2010-11-05 Cary Coutant <ccoutant@google.com>
7950
7951 PR gold/10708
7952 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
7953 object when reading from the file.
7954 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
7955 second layout pass.
7956 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
7957 when reading section contents.
7958 (get_section_contents): Likewise.
7959 (icf::find_identical_sections): Likewise.
7960 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
7961 object when reading from the file.
7962 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
7963 the object when doing deferred section layout.
7964
7965 2010-11-03 Nick Clifton <nickc@redhat.com>
7966
7967 PR gold/12001
7968 * script.h (class Symbol_assignment: name): New member. Returns
7969 the name of the symbol.
7970 * scrfipt.cc (Script_options::is_pending_assignment): New member.
7971 Returns true if the given symbol name is on the list of
7972 assignments wating to be processed.
7973 * archive.cc (should_incldue_member): If the symbol is undefined,
7974 check to see if it is on the list of symbols pending assignment.
7975
7976 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
7977
7978 * script-sections.cc (Script_sections::find_memory_region): Check
7979 for a NULL output section pointer.
7980
7981 2010-10-29 Doug Kwan <dougkwan@google.com>
7982
7983 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
7984 Output_section::add_relaxed_input_section.
7985 * output.cc (Output_section::add_relaxed_input_section): Add new
7986 arguments LAYOUT and NAME. Set section order index.
7987 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7988 Copy section order index.
7989 * output.h (Output_section::add_relaxed_input_section): Add new
7990 arguments LAYOUT and NAME.
7991
7992 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7993
7994 * testsuite/Makefile.am: Move gcctestdir/ld rule to
7995 NATIVE_OR_CROSS_LINKER.
7996 * testsuite/Makefile.in: Regenerate.
7997
7998 2010-10-20 Doug Kwan <dougkwan@google.com>
7999
8000 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
8001 without SHF_LINK_ORDER flags.
8002 * layout.cc (Layout::choose_output_section): Do not filter
8003 SHF_LINK_ORDER flag in a relocatable link.
8004
8005 2010-10-17 Cary Coutant <ccoutant@google.com>
8006
8007 * output.h (Output_segment::set_section_addresses): Change function
8008 signature. Update all callers.
8009 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
8010 sections.
8011 (Output_segment::set_section_addresses): Align after last TLS
8012 section. Add padding before last relro section instead of after.
8013
8014 2010-10-17 Doug Kwan <dougkwan@google.com>
8015
8016 * gold/arm.cc (Target_arm::got_section): Use correct order and set
8017 GOT output section to be writable.
8018
8019 2010-10-14 Cary Coutant <ccoutant@google.com>
8020
8021 * debug.h (DEBUG_INCREMENTAL): New flag.
8022 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
8023 * gold.cc (queue_initial_tasks): Check parameters for incremental link
8024 mode.
8025 * incremental.cc (report_command_line): Ignore all forms of
8026 --incremental.
8027 * layout.cc (Layout::Layout): Check parameters for incremental link
8028 mode.
8029 * options.cc (General_options::parse_incremental): New function.
8030 (General_options::parse_no_incremental): New function.
8031 (General_options::parse_incremental_full): New function.
8032 (General_options::parse_incremental_update): New function.
8033 (General_options::incremental_mode_): New data member.
8034 (General_options::finalize): Check incremental_mode_.
8035 * options.h (General_options): Update help text for --incremental.
8036 Add --no-incremental, --incremental-full, --incremental-update.
8037 (General_options::Incremental_mode): New enum type.
8038 (General_options::incremental_mode): New function.
8039 (General_options::incremental_mode_): New data member.
8040 * parameters.cc (Parameters::incremental_mode_): New data member.
8041 (Parameters::set_options): Set incremental_mode_.
8042 (Parameters::set_incremental_full): New function.
8043 (Parameters::incremental): New function.
8044 (Parameters::incremental_update): New function.
8045 (set_parameters_incremental_full): New function.
8046 * parameters.h (Parameters::set_incremental_full): New function.
8047 (Parameters::incremental): New function.
8048 (Parameters::incremental_update): New function.
8049 (Parameters::incremental_mode_): New data member.
8050 (set_parameters_incremental_full): New function.
8051 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
8052 incremental link mode.
8053 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
8054 (Sized_relobj::do_relocate_sections): Likewise.
8055 * testsuite/Makefile.am (incremental_test): Use --incremental-full
8056 option.
8057 * testsuite/Makefile.in: Regenerate.
8058 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8059
8060 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8061
8062 * script-sections.h (class Script_sections): Make
8063 Sections_elements typedef public.
8064 * script-sections.cc (class Sort_output_sections): Add elements_
8065 field. Add constructor which sets it; change all callers.
8066 (Sort_output_sections::is_before): New function.
8067 (Sort_output_sections::operator()): Call is_before.
8068 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
8069 conditional.
8070 * testsuite/script_test_10.sh: New test. Test script section
8071 order.
8072 * testsuite/script_test_10.t: Likewise.
8073 * testsuite/script_test_10.s: Likewise.
8074 * testsuite/Makefile.am: Wrap the cross linker tests and the
8075 common tests into NATIVE_OR_CROSS_LINKER.
8076 (check_SCRIPTS): Add script_test_10.sh.
8077 (check_DATA): Add script_test_10.stdout.
8078 (script_test_10.o, script_test_10): New targets.
8079 (script_test_10.stdout): New target.
8080 * configure, testsuite/Makefile.in: Regenerate.
8081
8082 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8083
8084 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
8085 error for the deprecated relocations.
8086 (Target_arm::Scan::global): Likewise.
8087 (Target_arm::Relocate::relocate): Likewise.
8088
8089 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
8090
8091 * fileread.cc (Input_file::find_file): Initialize *found_name
8092 and *namep when using the fallback search for case 4.
8093
8094 2010-10-11 Cary Coutant <ccoutant@google.com>
8095
8096 * options.h (class General_options): Redefine -z lazy as an alias for
8097 the negation of -z now.
8098
8099 2010-10-11 Ian Lance Taylor <iant@google.com>
8100
8101 * resolve.cc (symbol_to_bits): Report the value of the unsupported
8102 binding.
8103
8104 2010-10-06 Nick Clifton <nickc@redhat.com>
8105
8106 * script-sections.cc(class Memory_region): Remove
8107 current_lma_offset_ field. Rename current_vma_offset_ to
8108 current_offset_. Add last_section_ field.
8109 (Memory_region::get_current_vma_address): Rename to
8110 get_current_address.
8111 (Memory_region::get_current_lma_address): Delete.
8112 (Memory_region::increment_vma_offset): Rename to
8113 increment_offset.
8114 (Memory_region::increment_lma_offset): Delete.
8115 (Memory_region::attributes_compatible): New method. Returns
8116 true if the provided section is compatible with the region.
8117 (Memory_region::get_last_section): New method. Returns the last
8118 section to use the region.
8119 (Memory_region::set_last_section): New method. Stores the last
8120 section to use the region.
8121 (Script_sections::block_in_region): New method. Returns true if
8122 a block of memory is contained within a region.
8123 (Script_sections::find_memory_region): New method. Locates a
8124 memory region to be used to set a VMA or LMA address.
8125 (Output_section_definition::set_section_addresses): Add code to
8126 check for addresses set by memory regions.
8127 (Output_segment::set_section_addresses): Remove memory region
8128 walking code.
8129 (Script_sections::create_segment): Add a warning if a header
8130 segment is created outside of any region.
8131 * script-sections.h (class Script_sections): Add prototypes for
8132 find_memory_region and block_in_region methods.
8133 * testsuite/memory_test.s: Use .long instead of .word.
8134 * testsuite/memory_test.t: Add some more output sections.
8135 * testsuite/memory_test.sh: Update expected output.
8136
8137 2010-10-02 Doug Kwan <dougkwan@google.com>
8138
8139 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
8140 defintion to symtab.h
8141 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
8142 declaration to defintion.
8143
8144 2010-10-01 Nick Clifton <nickc@redhat.com>
8145
8146 * expression.cc (eval): Replace dummy argument with NULL.
8147 (eval_maybe_dot): Check for a NULL result section pointer.
8148 (Symbol_expression::value): Likewise.
8149 (Dot_expression::value): Likewise.
8150 (BINARY_EXPRESSION): Likewise.
8151 (Max_expression::value): Likewise.
8152 (Min_expression::value): Likewise.
8153 (Absolute_expression::value): Likewise.
8154 (Addr_expression::value_from_output_section): Likewise.
8155 (Loaddddr_expression::value_from_output_section): Likewise.
8156 (Segment_start_expression::value): Likewise.
8157 * script-sections.cc
8158 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
8159 argument with NULL.
8160 (Sections_elememt_dot_assignment::set_section_addresses):
8161 Likewise.
8162 (Output_data_expression::do_write_to_buffer): Likewise.
8163 (Output_section_definition::finalize_symbols): Likewise.
8164 (Output_section_definition::set_section_addresses): Likewise.
8165
8166 2010-09-30 Doug Kwan <dougkwan@google.com>
8167
8168 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
8169
8170 2010-09-28 Sriraman Tallam <tmsriram@google.com>
8171
8172 * target.h (Target::can_icf_inline_merge_sections): New virtual
8173 function.
8174 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
8175 virtual function.
8176 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
8177 virtual function.
8178 * icf.cc (get_section_contents): Inline merge sections only when
8179 target allows it.
8180
8181 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8182
8183 * configure: Regenerate.
8184
8185 2010-09-17 Ian Lance Taylor <iant@google.com>
8186
8187 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
8188 * testsuite/Makefile.am (memory_test.o): New target.
8189 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
8190 memory_test.t.
8191 * testsuite/Makefile.in: Rebuild.
8192
8193 2010-09-17 Doug Kwan <dougkwan@google.com>
8194
8195 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
8196 defintion if relocation uses GOT entries of the symbol.
8197 * testsuite/icf_safe_test.sh: Fix test.
8198 * testsuite/icf_safe_so_test.sh: Fix test.
8199
8200 2010-09-16 Cary Coutant <ccoutant@google.com>
8201
8202 * script_sections.cc (class Memory_region): Remove "NULL" from
8203 vector initializations.
8204
8205 2010-09-15 Cary Coutant <ccoutant@google.com>
8206
8207 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
8208 Resolve forwarding symbols.
8209
8210 2010-09-15 Doug Kwan <dougkwan@google.com>
8211
8212 * gold/testsuite/script_test_3.t: Add ARM special sections.
8213 * gold/testsuite/script_test_4.t: Same.
8214 * gold/testsuite/script_test_5.t: Same.
8215 * gold/testsuite/script_test_6.t: Same.
8216 * gold/testsuite/script_test_7.t: Same.
8217 * gold/testsuite/script_test_7.t: Same.
8218 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
8219
8220 2010-09-14 Cary Coutant <ccoutant@google.com>
8221
8222 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
8223 (Target_x86_64::Relocate::relocate_tls): Replace check for
8224 saw_tls_block_reloc_ with test for executable section.
8225
8226 2010-09-12 Cary Coutant <ccoutant@google.com>
8227
8228 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
8229 position-independent executables to shared libraries need dynamic
8230 relocations.
8231 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
8232 position-independent executables.
8233 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
8234 * testsuite/Makefile.in: Regenerate.
8235
8236 2010-09-10 Nick Clifton <nickc@redhat.com>
8237
8238 PR gold/11997
8239 * testsuite/memory_test.t: Discard any sections that are not
8240 needed.
8241
8242 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
8243
8244 PR gold/11996
8245 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
8246 "This::" to work around a bug in gcc 4.2.
8247
8248 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
8249
8250 2010-09-09 Rafael Espindola <espindola@google.com>
8251
8252 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
8253 sections with different PF_X flags in the same segment.
8254 (Layout::find_first_load_seg): Search all segments to find the first
8255 one.
8256 * options.h (rosegment): New.
8257
8258 2010-09-08 Rafael Espindola <espindola@google.com>
8259
8260 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
8261
8262 2010-09-08 Doug Kwan <dougkwan@google.com>
8263
8264 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
8265 (Arm_relobj::do_relocate_sections): Add new parameter for output
8266 file to match the parent.
8267 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
8268 of local symbols instead of input values. Update code to track
8269 changes in gold::relocate_section.
8270 * object.cc (Sized_relobj::compute_final_local_value): New methods.
8271 (Sized_relobj::compute_final_local_value_internal): New methods.
8272 (Sized_relobj::do_finalize_local_symbols): Move code from loop
8273 body into private version of Sized_relobj::compute_final_local_value.
8274 Call the inline method.
8275 * object.h (Symbol_value::Symbol_value): Define destructor. Free
8276 merged symbol value if there is one.
8277 (Symbol_value::has_output_value): New method defintiion.
8278 (Sized_relobj::Compute_final_local_value_status): New enum type.
8279 (Sized_relobj::compute_final_local_value): New methods.
8280 (Sized_relobj::compute_final_local_value_internal): New methods.
8281 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
8282 and arm_cortex_a8.sh.
8283 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
8284 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
8285 New tests.
8286 * Makefile.in: Regenerate.
8287 * testsuite/arm_bl_out_of_range.s: Update test.
8288 * testsuite/thumb_bl_out_of_range.s: Ditto.
8289 * testsuite/thumb_blx_out_of_range.s: Ditto.
8290 * testsuite/arm_branch_out_of_range.sh: New file.
8291 * testsuite/arm_cortex_a8.sh: Ditto.
8292 * testsuite/arm_cortex_a8_b.s: Ditto.
8293 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
8294 * testsuite/arm_cortex_a8_b_local.s: Ditto.
8295 * testsuite/arm_cortex_a8_bl.s: Ditto.
8296 * testsuite/arm_cortex_a8_blx.s: Ditto.
8297 * testsuite/arm_cortex_a8_local.s: Ditto.
8298 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
8299 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
8300
8301 2010-09-08 Rafael Espindola <espindola@google.com>
8302
8303 * Makefile.am (memory_test.stdout): Run readelf with -W.
8304 * Makefile.in: Regenerate.
8305 * testsuite/memory_test.sh: Make the regexps accept both 32 and
8306 64 bit output.
8307
8308 2010-09-08 Rafael Espindola <espindola@google.com>
8309
8310 * script-sections.cc (Script_sections::add_memory_region): Convert
8311 field precision to int.
8312 * script.cc (script_set_section_region, script_set_section_region):
8313 Convert field precision to int.
8314
8315 2010-09-08 Rafael Espindola <espindola@google.com>
8316
8317 * arm.cc (do_finalize_sections): Create the __exidx_start and
8318 __exdix_end symbols even when the section is missing.
8319
8320 2010-09-08 Nick Clifton <nickc@redhat.com>
8321
8322 * README: Remove claim that MEMORY is not supported.
8323 * expression.cc (script_exp_function_origin)
8324 (script_exp_function_length): Move from here to ...
8325 * script.cc: ... here.
8326 (script_set_section_region, script_add_memory)
8327 (script_parse_memory_attr, script_include_directive): New
8328 functions.
8329 * script-sections.cc
8330 (class Memory_region): New class.
8331 (class Output_section_definition): Add set_memory_region,
8332 set_section_vma, set_section_lma and get_section_name methods.
8333 (class Script_Sections): Add add_memory_region,
8334 find_memory_region, find_memory_region_origin,
8335 find_memory_region_length and set_memory_region methods.
8336 Have set_section_addresses method walk the list of set memory
8337 regions.
8338 Extend the print methos to display memory regions.
8339 * script-sections.h: Add prototypes for new methods.
8340 Add enum for MEMORY region attributes.
8341 * yyscript.y: Add support for parsing MEMORY regions.
8342 * script-c.h: Add prototypes for new functions.
8343 * testsuite/Makefile.am: Add test of MEMORY region functionality.
8344 * testsuite/Makefile.in: Regenerate.
8345 * testsuite/memory_test.sh: New script.
8346 * testsuite/memory_test.s: New assembler source file.
8347 * testsuite/memory_test.t: New linker script.
8348
8349 2010-08-27 Doug Kwan <dougkwan@google.com>
8350
8351 * gold/resolve.cc (Symbol_table::should_override): Let a weak
8352 reference override an existing dynamic weak reference.
8353 * testsuite/Makefile.am: Add new test dyn_weak_ref.
8354 * testsuite/Makefile.in: Regenerate.
8355 * testsuite/dyn_weak_ref.sh: New file.
8356 * testsuite/dyn_weak_ref_1.c: Ditto.
8357 * testsuite/dyn_weak_ref_2.c: Ditto.
8358
8359 2010-08-27 Ian Lance Taylor <iant@google.com>
8360
8361 * incremental.h (class Incremental_input_entry): Add virtual
8362 destructor.
8363
8364 2010-08-27 Ian Lance Taylor <iant@google.com>
8365
8366 * testsuite/start_lib_test_3.c: Mark t3 as used.
8367
8368 2010-08-27 Nick Clifton <nickc@redhat.com>
8369
8370 * options.cc (version_script): Fix small typo in previous
8371 whitespace tidyup.
8372
8373 2010-08-25 Nick Clifton <nickc@redhat.com>
8374
8375 * archive.cc: Formatting fixes: Remove whitespace between
8376 typename and following asterisk. Remove whitespace between
8377 function name and opening parenthesis.
8378 * archive.h: Likewise.
8379 * arm.cc: Likewise.
8380 * attributes.cc: Likewise.
8381 * attributes.h: Likewise.
8382 * common.cc: Likewise.
8383 * copy-relocs.cc: Likewise.
8384 * dirsearch.h: Likewise.
8385 * dynobj.cc: Likewise.
8386 * ehframe.cc: Likewise.
8387 * ehframe.h: Likewise.
8388 * expression.cc: Likewise.
8389 * fileread.cc: Likewise.
8390 * fileread.h: Likewise.
8391 * gc.h: Likewise.
8392 * gold-threads.cc: Likewise.
8393 * gold.cc: Likewise.
8394 * i386.cc: Likewise.
8395 * icf.h: Likewise.
8396 * incremental-dump.cc: Likewise.
8397 * incremental.cc: Likewise.
8398 * layout.cc: Likewise.
8399 * layout.h: Likewise.
8400 * main.cc: Likewise.
8401 * merge.cc: Likewise.
8402 * merge.h: Likewise.
8403 * object.cc: Likewise.
8404 * object.h: Likewise.
8405 * options.cc: Likewise.
8406 * options.h: Likewise.
8407 * output.cc: Likewise.
8408 * output.h: Likewise.
8409 * plugin.cc: Likewise.
8410 * plugin.h: Likewise.
8411 * powerpc.cc: Likewise.
8412 * reloc.cc: Likewise.
8413 * script-c.h: Likewise.
8414 * script-sections.cc: Likewise.
8415 * script.cc: Likewise.
8416 * stringpool.cc: Likewise.
8417 * symtab.cc: Likewise.
8418 * symtab.h: Likewise.
8419 * target.cc: Likewise.
8420 * timer.cc: Likewise.
8421 * timer.h: Likewise.
8422 * version.cc: Likewise.
8423 * x86_64.cc: Likewise.
8424
8425 2010-08-24 Nick Clifton <nickc@redhat.com>
8426
8427 PR 11899
8428 * layout.cc (segment_precedes): Sort segments by their physical
8429 addresses, if they have been set.
8430
8431 2010-08-23 Cary Coutant <ccoutant@google.com>
8432
8433 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
8434 symbols data.
8435 (Lib_group::include_member): Unlock object after deleting its
8436 symbols data.
8437 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
8438 the bug fixed here.
8439
8440 2010-08-19 Neil Vachharajani <nvachhar@google.com>
8441 Cary Coutant <ccoutant@google.com>
8442
8443 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
8444 constructor, and set_blocker.
8445 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
8446 readsyms_blocker_.
8447 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
8448 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
8449 * testsuite/Makefile.am (start_lib_test): New test case.
8450 * testsuite/Makefile.in: Regenerate.
8451 * testsuite/start_lib_test_main.c: New file.
8452 * testsuite/start_lib_test_1.c: New file.
8453 * testsuite/start_lib_test_2.c: New file.
8454 * testsuite/start_lib_test_3.c: New file.
8455
8456 2010-08-19 Ian Lance Taylor <iant@google.com>
8457
8458 * Makefile.in: Rebuild with automake 1.11.1.
8459 * aclocal.m4: Likewise.
8460 * testsuite/Makefile.in: Likewise.
8461
8462 2010-08-19 Ian Lance Taylor <iant@google.com>
8463
8464 PR 10893
8465 * i386.cc (class Output_data_plt_i386): Update declarations.
8466 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
8467 local_ifuncs_ fields.
8468 (Target_i386::do_plt_section_for_global): New function.
8469 (Target_i386::do_plt_section_for_local): New function.
8470 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
8471 parameter; change all callers. Initialize global_ifuncs_ and
8472 local_ifuncs_. If doing a static link define __rel_iplt_start and
8473 __rel_iplt_end.
8474 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
8475 (Output_data_plt_i386::add_local_ifunc_entry): New function.
8476 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
8477 symbols.
8478 (Target_i386::make_plt_section): New function, broken out of
8479 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
8480 (Target_i386::make_plt_entry): Call make_plt_section.
8481 (Target_i386::make_local_ifunc_plt_entry): New function.
8482 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
8483 (Target_i386::Scan::local): Handle IFUNC symbols. Add
8484 R_386_IRELATIVE to switch.
8485 (Target_i386::Scan::global): Likewise.
8486 (Target_i386::Relocate::relocate): Likewise.
8487 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
8488 switch.
8489 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
8490 (Target_x86_64::do_plt_section_for_global): New function.
8491 (Target_x86_64::do_plt_section_for_local): New function.
8492 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
8493 parameter; change all callers. If doing a static link define
8494 __rela_iplt_start and __rela_iplt_end.
8495 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
8496 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
8497 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
8498 to point to .plt.
8499 (Target_x86_64::make_local_ifunc_plt_entry): New function.
8500 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
8501 switch.
8502 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
8503 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
8504 R_X86_64_IRELATIVE to switch.
8505 (Target_x86_64::Scan::global): Likewise.
8506 (Target_x86_64::Relocate::relocate): Likewise.
8507 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
8508 switch.
8509 * target.h (class Target): Add plt_section_for_global and
8510 plt_section_for_local functions. Add do_plt_section_for_global
8511 and do_plt_section_for_local virtual functions.
8512 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
8513 clarifying comments.
8514 (Symbol::use_plt_offset): Handle IFUNC symbol.
8515 * object.cc (Sized_relobj::Sized_relobj): Initialize
8516 local_plt_offsets_.
8517 (Sized_relobj::local_has_plt_offset): New function.
8518 (Sized_relobj::local_plt_offset): New function.
8519 (Sized_relobj::set_local_plt_offset): New function.
8520 (Sized_relobj::do_count): Handle IFUNC symbol.
8521 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
8522 a bit away from input_shndx_ field. Add set_is_func_symbol and
8523 is_ifunc_symbol functions.
8524 (class Sized_relobj): Update declarations. Remove Tls_got_entry
8525 and Local_tls_got_offsets. Define Local_plt_offsets. Add
8526 local_plt_offsets_ field.
8527 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
8528 * output.h (class Output_section_data): Add non-const
8529 output_section function.
8530 (class Output_data_got): Update declarations.
8531 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
8532 Add use_plt_offset parameter to global and local constructors.
8533 Change all callers. Change local_sym_index_ field to 31 bits.
8534 Change GSYM_CODE and CONSTANT_CODE accordingly.
8535 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
8536 doing a static link don't set sh_link field.
8537 (Output_data_got::Got_entry::write): Use PLT offset if
8538 appropriate.
8539 (Output_data_got::add_global_plt): New function.
8540 (Output_data_got::add_local_plt): New function.
8541 * target-reloc.h (relocate_section): Handle IFUNC symbol.
8542 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
8543 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
8544 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
8545 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
8546 IFUNC conditional.
8547 * testsuite/ifunc-sel.h: New file.
8548 * testsuite/ifuncmain1.c: New file.
8549 * testsuite/ifuncmain1vis.c: New file.
8550 * testsuite/ifuncmod1.c: New file.
8551 * testsuite/ifuncdep2.c: New file.
8552 * testsuite/ifuncmain2.c: New file.
8553 * testsuite/ifuncmain3.c: New file.
8554 * testsuite/ifuncmod3.c: New file.
8555 * testsuite/ifuncmain4.c: New file.
8556 * testsuite/ifuncmain5.c: New file.
8557 * testsuite/ifuncmod5.c: New file.
8558 * testsuite/ifuncmain6pie.c: New file.
8559 * testsuite/ifuncmod6.c: New file.
8560 * testsuite/ifuncmain7.c: New file.
8561 * configure, testsuite/Makefile.in: Rebuild.
8562
8563 2010-08-18 Ian Lance Taylor <iant@google.com>
8564
8565 * incremental.cc
8566 (Output_section_incremental_inputs::write_input_files): Add cast
8567 to avoid signed/unsigned comparison warning.
8568 (Output_section_incremental_inputs::write_info_blocks): Likewise.
8569
8570 2010-08-12 Cary Coutant <ccoutant@google.com>
8571
8572 * common.cc (Sort_commons::operator()): Remove unnecessary code.
8573
8574 2010-08-13 Ian Lance Taylor <iant@google.com>
8575
8576 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
8577
8578 2010-08-12 Cary Coutant <ccoutant@google.com>
8579 Doug Kwan <dougkwan@google.com>
8580
8581 * resolve.cc (Symbol_table::should_override): When a weak dynamic
8582 defintion overrides non-weak undef, remember that the original undef
8583 is not weak.
8584 * symtab.cc (Symbol_table::sized_write_global): For undef without
8585 an original weak binding, set binding to global in output.
8586 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
8587 * testsuite/Makefile.in: Regenerate.
8588 * testsuite/strong_ref_weak_def.sh: New file.
8589 * testsuite/strong_ref_weak_def_1.c: Ditto.
8590 * testsuite/strong_ref_weak_def_2.c: Ditto.
8591
8592 2010-08-12 Cary Coutant <ccoutant@google.com>
8593
8594 * testsuite/incremental_test.sh: Rewrite.
8595 * testsuite/incremental_test_1.c: Rewrite.
8596 * testsuite/incremental_test_2.c: Rewrite.
8597
8598 2010-08-12 Cary Coutant <ccoutant@google.com>
8599
8600 * arm.cc (Target_arm::got_size): Add const.
8601 (Target_arm::got_entry_count): New function.
8602 (Target_arm::plt_entry_count): New function.
8603 (Target_arm::first_plt_entry_offset): New function.
8604 (Target_arm::plt_entry_size): New function.
8605 (Output_data_plt_arm::entry_count): New function.
8606 (Output_data_plt_arm::first_plt_entry_offset): New function.
8607 (Output_data_plt_arm::get_plt_entry_size): New function.
8608 * i386.cc (Target_i386::got_size): Add const.
8609 (Target_i386::got_entry_count): New function.
8610 (Target_i386::plt_entry_count): New function.
8611 (Target_i386::first_plt_entry_offset): New function.
8612 (Target_i386::plt_entry_size): New function.
8613 (Output_data_plt_i386::entry_count): New function.
8614 (Output_data_plt_i386::first_plt_entry_offset): New function.
8615 (Output_data_plt_i386::get_plt_entry_size): New function.
8616 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
8617 find_incremental_inputs_sections. Dump incremental_got_plt section.
8618 * incremental.cc: Include target.h.
8619 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
8620 parameter. Adjust all callers. Find incremental_got_plt section.
8621 (Incremental_inputs::create_data_sections): Create incremental_got_plt
8622 section.
8623 (Output_section_incremental_inputs::set_final_data_size): Calculate
8624 size of incremental_got_plt section.
8625 (Output_section_incremental_inputs::do_write): Write the
8626 incremental_got_plt section.
8627 (Got_plt_view_info): New struct.
8628 (Local_got_offset_visitor): New class.
8629 (Global_got_offset_visitor): New class.
8630 (Global_symbol_visitor_got_plt): New class.
8631 (Output_section_incremental_inputs::write_got_plt): New function.
8632 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
8633 Add parameter. Adjust all callers.
8634 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8635 (Incremental_inputs::got_plt_section): New function.
8636 (Incremental_inputs::got_plt_section_): New data member.
8637 (Incremental_got_plt_reader): New class.
8638 * layout.cc (Layout::create_incremental_info_sections): Add the
8639 incremental_got_plt section.
8640 * object.h (Got_offset_list::get_list): New function.
8641 (Got offset_list::for_all_got_offsets): New function.
8642 (Sized_relobj::local_got_offset_list): New function.
8643 * powerpc.cc (Target_powerpc::got_size): Add const.
8644 (Target_powerpc::got_entry_count): New function.
8645 (Target_powerpc::plt_entry_count): New function.
8646 (Target_powerpc::first_plt_entry_offset): New function.
8647 (Target_powerpc::plt_entry_size): New function.
8648 (Output_data_plt_powerpc::entry_count): New function.
8649 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
8650 (Output_data_plt_powerpc::get_plt_entry_size): New function.
8651 * sparc.cc (Target_sparc::got_size): Add const.
8652 (Target_sparc::got_entry_count): New function.
8653 (Target_sparc::plt_entry_count): New function.
8654 (Target_sparc::first_plt_entry_offset): New function.
8655 (Target_sparc::plt_entry_size): New function.
8656 (Output_data_plt_sparc::entry_count): New function.
8657 (Output_data_plt_sparc::first_plt_entry_offset): New function.
8658 (Output_data_plt_sparc::get_plt_entry_size): New function.
8659 * symtab.h (Symbol::got_offset_list): New function.
8660 (Symbol_table::for_all_symbols): New function.
8661 * target.h (Sized_target::got_entry_count): New function.
8662 (Sized_target::plt_entry_count): New function.
8663 (Sized_target::plt_entry_size): New function.
8664 * x86_64.cc (Target_x86_64::got_size): Add const.
8665 (Target_x86_64::got_entry_count): New function.
8666 (Target_x86_64::plt_entry_count): New function.
8667 (Target_x86_64::first_plt_entry_offset): New function.
8668 (Target_x86_64::plt_entry_size): New function.
8669 (Output_data_plt_x86_64::entry_count): New function.
8670 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
8671 (Output_data_plt_x86_64::get_plt_entry_size): New function.
8672
8673 2010-08-12 Cary Coutant <ccoutant@google.com>
8674
8675 * archive.cc: Include incremental.h.
8676 (Archive::Archive): Initialize incremental_info_.
8677 (Archive::include_member): Record archive members in incremental info.
8678 (Add_archive_symbols::run): Record begin and end of an archive in
8679 incremental info.
8680 (Lib_group::include_member): Record objects in incremental info.
8681 * archive.h (Incremental_archive_entry): Forward declaration.
8682 (Archive::set_incremental_info): New member function.
8683 (Archive::incremental_info): New member function.
8684 (Archive::Unused_symbol_iterator): New class.
8685 (Archive::unused_symbols_begin): New member function.
8686 (Archive::unused_symbols_end): New member function.
8687 (Archive::incremental_info_): New data member.
8688 * incremental-dump.cc (find_input_containing_global): New function.
8689 (dump_incremental_inputs): Dump new incremental info sections.
8690 * incremental.cc: Include symtab.h.
8691 (Output_section_incremental_inputs): New class.
8692 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
8693 new incremental info sections.
8694 (Sized_incremental_binary::do_check_inputs): Likewise.
8695 (Incremental_inputs::report_archive): Remove.
8696 (Incremental_inputs::report_archive_begin): New function.
8697 (Incremental_inputs::report_archive_end): New function.
8698 (Incremental_inputs::report_object): New function.
8699 (Incremental_inputs::finalize_inputs): Remove.
8700 (Incremental_inputs::report_input_section): New function.
8701 (Incremental_inputs::report_script): Rewrite.
8702 (Incremental_inputs::finalize): Do nothing but finalize string table.
8703 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8704 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8705 (Incremental_inputs::create_data_sections): New function.
8706 (Incremental_inputs::relocs_entsize): New function.
8707 (Output_section_incremental_inputs::set_final_data_size): New function.
8708 (Output_section_incremental_inputs::do_write): New function.
8709 (Output_section_incremental_inputs::write_header): New function.
8710 (Output_section_incremental_inputs::write_input_files): New function.
8711 (Output_section_incremental_inputs::write_info_blocks): New function.
8712 (Output_section_incremental_inputs::write_symtab): New function.
8713 * incremental.h (Incremental_script_entry): Forward declaration.
8714 (Incremental_object_entry): Forward declaration.
8715 (Incremental_archive_entry): Forward declaration.
8716 (Incremental_inputs): Forward declaration.
8717 (Incremental_inputs_header_data): Remove.
8718 (Incremental_inputs_header): Remove.
8719 (Incremental_inputs_header_write): Remove.
8720 (Incremental_inputs_entry_data): Remove.
8721 (Incremental_inputs_entry): Remove.
8722 (Incremental_inputs_entry_write): Remove.
8723 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
8724 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
8725 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8726 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
8727 Likewise.
8728 (Incremental_input_entry): New class.
8729 (Incremental_script_entry): New class.
8730 (Incremental_object_entry): New class.
8731 (Incremental_archive_entry): New class.
8732 (Incremental_inputs::Incremental_inputs): Initialize new data members.
8733 (Incremental_inputs::report_inputs): Remove.
8734 (Incremental_inputs::report_archive): Remove.
8735 (Incremental_inputs::report_archive_begin): New function.
8736 (Incremental_inputs::report_archive_end): New function.
8737 (Incremental_inputs::report_object): Change prototype.
8738 (Incremental_inputs::report_input_section): New function.
8739 (Incremental_inputs::report_script): Change prototype.
8740 (Incremental_inputs::get_reloc_count): New function.
8741 (Incremental_inputs::set_reloc_count): New function.
8742 (Incremental_inputs::create_data_sections): New function.
8743 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8744 (Incremental_inputs::inputs_section): New function.
8745 (Incremental_inputs::symtab_section): New function.
8746 (Incremental_inputs::relocs_section): New function.
8747 (Incremental_inputs::get_stringpool): Add const.
8748 (Incremental_inputs::command_line): Add const.
8749 (Incremental_inputs::inputs): Remove.
8750 (Incremental_inputs::command_line_key): New function.
8751 (Incremental_inputs::input_file_count): New function.
8752 (Incremental_inputs::input_files): New function.
8753 (Incremental_inputs::relocs_entsize): New function.
8754 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8755 (Incremental_inputs::finalize_inputs): Remove.
8756 (Incremental_inputs::Input_info): Remove.
8757 (Incremental_inputs::lock_): Remove.
8758 (Incremental_inputs::inputs_): Change type.
8759 (Incremental_inputs::inputs_map_): Remove.
8760 (Incremental_inputs::current_object_entry_): New data member.
8761 (Incremental_inputs::inputs_section_): New data member.
8762 (Incremental_inputs::symtab_section_): New data member.
8763 (Incremental_inputs::relocs_section_): New data member.
8764 (Incremental_inputs::reloc_count_): New data member.
8765 (Incremental_inputs_reader): New class.
8766 (Incremental_symtab_reader): New class.
8767 (Incremental_relocs_reader): New class.
8768 * layout.cc (Layout::finalize): Move finalization of incremental info
8769 and creation of incremental info sections to follow finalization of
8770 symbol table. Set offsets for postprocessing sections.
8771 (Layout::create_incremental_info_sections): Call
8772 Incremental_inputs::create_data_sections. Add incremental symtab
8773 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
8774 sections to layout after input sections.
8775 * layout.h (struct Timespec): Forward declaration.
8776 (Layout::incremental_inputs): Add const.
8777 (Layout::create_incremental_info_sections): Add parameter.
8778 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
8779 * object.cc: Include incremental.h.
8780 (Relobj::finalize_incremental_relocs): New function.
8781 (Sized_relobj::do_layout): Record input sections in incremental info.
8782 * object.h (Object::output_section): New function.
8783 (Object::output_section_offset): Moved from Relobj.
8784 (Object::get_incremental_reloc_base): New function.
8785 (Object::get_incremental_reloc_count): New function.
8786 (Object::do_output_section): New function.
8787 (Object::do_output_section_offset): Moved from Relobj.
8788 (Object::do_get_incremental_reloc_base): New function.
8789 (Object::do_get_incremental_reloc_count): New function.
8790 (Object::Object): Initialize new data members.
8791 (Relobj::output_section): Renamed do_output_section and moved to
8792 protected.
8793 (Relobj::output_section_offset): Moved to Object.
8794 (Relobj::do_get_incremental_reloc_base): New function.
8795 (Relobj::do_get_incremental_reloc_count): New function.
8796 (Relobj::allocate_incremental_reloc_counts): New function.
8797 (Relobj::count_incremental_reloc): New function.
8798 (Relobj::finalize_incremental_relocs): New function.
8799 (Relobj::next_incremental_reloc_index): New function.
8800 (Relobj::reloc_counts_): New data member.
8801 (Relobj::reloc_bases_): New data member.
8802 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
8803 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
8804 (Sized_relobj::incremental_relocs_scan): New function.
8805 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8806 (Sized_relobj::incremental_relocs_write): New function.
8807 (Sized_relobj::incremental_relocs_write_reltype): New function.
8808 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
8809 incremental link.
8810 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
8811 archives and object files elsewhere.
8812 (Add_symbols::run): Report object files here.
8813 (Finish_group::run): Report end of archive at end of group.
8814 * reloc.cc: Include layout.h, incremental.h.
8815 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
8816 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
8817 (Sized_relobj::incremental_relocs_scan): New function.
8818 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8819 (Sized_relobj::do_relocate_sections): Write incremental relocations.
8820 (Sized_relobj::incremental_relocs_write): New function.
8821 (Sized_relobj::incremental_relocs_write_reltype): New function.
8822 * script.cc (read_input_script): Rewrite test for incremental link.
8823 Change call to Incremental_inputs::report_script.
8824 * symtab.h (Symbol_table::first_global_index): New function.
8825 (Symbol_table::output_count): New function.
8826
8827 2010-08-12 Doug Kwan <dougkwan@google.com>
8828
8829 * arm.cc (Target_arm::merge_object_attributes): Check command line
8830 options --no-wchar-size-warning and --no-enum-size-warning.
8831 * options.h (General_options): Add ld-compatible options
8832 --no-enum-size-warning and --no-wchar-size-warning.
8833
8834 2010-08-04 Ian Lance Taylor <iant@google.com>
8835
8836 * x86_64.cc (Target_x86_64::Scan::local): Use
8837 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
8838 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
8839 (Target_x86_64::Scan::global): Likewise.
8840 (Target_x86_64::Relocate::relocate): Likewise.
8841 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
8842 Likewise.
8843
8844 2010-08-03 Cary Coutant <ccoutant@google.com>
8845
8846 * merge.cc (Output_merge_string::do_add_input_section): Count strings
8847 to reserve space in merged_strings vector. Keep total input size
8848 for stats.
8849 (Output_merge_string::do_print_merge_stats): Print total input size.
8850 * merge.h (Output_merge_string): Add input_size_ field.
8851 * stringpool.cc (Stringpool_template::string_length): Move
8852 implementations out of Stringpool_template class and place in
8853 stringpool.h.
8854 * stringpool.h (string_length): Move out of Stringpool_template.
8855
8856 2010-08-03 Ian Lance Taylor <iant@google.com>
8857
8858 PR 11712
8859 * layout.cc (relaxation_loop_body): If address of load segment is
8860 set, adjust address to include headers if possible.
8861
8862 2010-08-03 Ian Lance Taylor <iant@google.com>
8863
8864 * version.cc (version_string): Bump to 1.10.
8865
8866 2010-08-03 Ian Lance Taylor <iant@google.com>
8867
8868 PR 11805
8869 * layout.h (enum Output_section_order): Define.
8870 (class Layout): Update declarations.
8871 * layout.cc (Layout::get_output_section): Add order parameter.
8872 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
8873 is_first_non_relro parameters. Change all callers.
8874 (Layout::choose_output_section): Likewise.
8875 (Layout::add_output_section_data): Likewise.
8876 (Layout::make_output_section): Likewise. Set order.
8877 (Layout::default_section_order): New function.
8878 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
8879 * output.cc (Output_section::Output_section): Initialize order_.
8880 Don't initialize deleted fields.
8881 (Output_segment::Output_segment): Don't initialize deleted
8882 fields.
8883 (Output_segment::add_output_section_to_load): New function
8884 replacing add_output_section. Change all callers to call this or
8885 add_output_section_to_nonload.
8886 (Output_segment::add_output_section_to_nonload): New function.
8887 (Output_segment::remove_output_section): Rewrite.
8888 (Output_segment::add_initial_output_data): Likewise.
8889 (Output_segment::has_any_data_sections): Likewise.
8890 (Output_segment::is_first_section_relro): Likewise.
8891 (Output_segment::maximum_alignment): Likewise.
8892 (Output_segment::has_dynamic_reloc): New function replacing
8893 dynamic_reloc_count. Change all callers.
8894 (Output_segment::has_dynamic_reloc_list): New function replacing
8895 dynamic_reloc_count_list. Change all callers.
8896 (Output_segment::set_section_addresses): Rewrite.
8897 (Output_segment::set_offset): Rewrite.
8898 (Output_segment::find_first_and_last_list): Remove.
8899 (Output_segment::set_tls_offsets): Rewrite.
8900 (Output_segment::first_section_load_address): Likewise.
8901 (Output_segment::output_section_count): Likewise.
8902 (Output_segment::section_with_lowest_load_address): Likewise.
8903 (Output_segment::write_section_headers): Likewise.
8904 (Output_segment::print_sections_to_map): Likewise.
8905 * output.h (class Output_data): Remove dynamic_reloc_count_
8906 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
8907 (Output_data::add_dynamic_reloc): Rewrite.
8908 (Output_data::has_dynamic_reloc): New function.
8909 (Output_data::dynamic_reloc_count): Remove.
8910 (class Output_section): Add order_ field. Remvoe is_relro_local_,
8911 is_last_relro_, is_first_non_relro_, is_interp_,
8912 is_dynamic_linker_section_ fields. Add order and set_order
8913 functions. Remove is_relro_local, set_is_relro_local,
8914 is_last_relro, set_is_last_relro, is_first_non_relro,
8915 set_is_first_non_relro functions, is_interp, set_is_interp,
8916 is_dynamic_linker_section, and set_is_dynamic_linker_section
8917 functions.
8918 (class Output_segment): Change Output_data_list from std::list to
8919 std:;vector. Add output_lists_ field. Remove output_data_ and
8920 output_bss_ fields. Update declarations.
8921
8922 2010-08-02 Ian Lance Taylor <iant@google.com>
8923
8924 * arm.cc (Target_arm::gc_process_relocs): Use typename.
8925 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
8926 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
8927
8928 2010-08-02 Ian Lance Taylor <iant@google.com>
8929
8930 PR 11855
8931 * script.cc (Script_options::Script_options): Initialize
8932 symbol_definitions_ and symbol_references_.
8933 (Script_options::add_symbol_assignment): Update
8934 symbol_definitions_ and symbol_references_.
8935 (Script_options::add_symbol_reference): New function.
8936 (script_symbol): New function.
8937 * script.h (class Script_options): Add symbol_definitions_ and
8938 symbol_references_ fields.
8939 (Script_options::referenced_const_iterator): New type.
8940 (Script_options::referenced_begin): New function.
8941 (Script_options::referenced_end): New function.
8942 (Script_options::is_referenced): New function.
8943 (Script_options::any_unreferenced): New function.
8944 * script-c.h (script_symbol): Declare.
8945 * yyscript.y (exp): Call script_symbol.
8946 * symtab.cc: Include "script.h".
8947 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
8948 Change all callers. Check symbols referenced by scripts.
8949 (Symbol_table::add_undefined_symbols_from_command_line): Add
8950 layout parameter. Change all callers.
8951 (Symbol_table::do_add_undefined_symbols_from_command_line):
8952 Likewise. Break out loop body. Check symbols referenced by
8953 scripts.
8954 (Symbol_table::add_undefined_symbol_from_command_line): New
8955 function broken out of
8956 do_add_undefined_symbols_from_command_line.
8957 * symtab.h (class Symbol_table): Update declarations.
8958 * archive.cc: Include "layout.h".
8959 (Archive::should_include_member): Add layout parameter. Change
8960 all callers. Check for symbol mentioned in expression.
8961 * archive.h (class Archive): Update declaration.
8962 * object.cc (Sized_relobj::do_should_include_member): Add layout
8963 parameter.
8964 * object.h (Object::should_include_member): Add layout parameter.
8965 Change all callers.
8966 (Object::do_should_include_member): Add layout parameter.
8967 (class Sized_relobj): Update declaration.
8968 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
8969 parameter.
8970 * dynobj.h (class Sized_dynobj): Update declaration.
8971 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
8972 layout parameter.
8973 * plugin.h (class Sized_pluginobj): Update declaration.
8974
8975 2010-08-02 Ian Lance Taylor <iant@google.com>
8976
8977 PR 11866
8978 * output.cc (Output_segment::set_offset): Search for the first and
8979 last sections rather than assuming that the list is in order.
8980 (Output_segment::find_first_and_last_list): New function.
8981 * output.h (class Output_segment): Update declarations.
8982 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
8983 (relro_strip_test_SOURCES): New variable.
8984 (relro_strip_test_DEPENDENCIES): New variable.
8985 (relro_strip_test_LDFLAGS): New variable.
8986 (relro_strip_test_LDADD): New variable.
8987 (relro_strip_test.so): New target.
8988
8989 2010-08-02 Ian Lance Taylor <iant@google.com>
8990
8991 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
8992 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
8993 (Target_i386::got_tlsdesc_section): New function.
8994 (Target_i386::got_section): Create space for GOT entries for
8995 TLSDESC relocations.
8996 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
8997 R_386_TLS_GOTDESC.
8998 (Target_i386::Scan::global): Likewise.
8999 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
9000 using TLSDESC GOT.
9001 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
9002 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
9003 (Target_x86_64::got_tlsdesc_section): New function.
9004 (Target_x86_64::got_section): Create space for GOT entries for
9005 TLSDESC relocations.
9006 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
9007 R_386_TLS_GOTDESC.
9008 (Target_x86_64::Scan::global): Likewise.
9009 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
9010 using TLSDESC GOT.
9011
9012 2010-08-02 Ian Lance Taylor <iant@google.com>
9013
9014 * testsuite/final_layout.sh: Use dc to convert from hex to
9015 decimal.
9016
9017 2010-07-29 Sriraman Tallam <tmsriram@google.com>
9018
9019 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
9020 paramter to the call to gold::gc_process_relocs.
9021 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
9022 paramter to the call to gold::gc_process_relocs.
9023 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
9024 parameter to the call to gold::gc_process_relocs.
9025 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
9026 template parameter to the call to gold::gc_process_relocs.
9027 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
9028 paramter to the call to gold::gc_process_relocs.
9029 * gc.h (get_embedded_addend_size): New function.
9030 (gc_process_relocs): Save the size of the reloc for use by ICF.
9031 * icf.cc (get_section_contents): Get the addend from the text section
9032 for SHT_REL relocation sections.
9033 * icf.h (Icf::Reloc_addend_size_info): New typedef.
9034 (Icf::Reloc_info): Add new member reloc_addend_size_info.
9035 * int_encoding.h (read_from_pointer): New overloaded function.
9036 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
9037 * testsuite/icf_sht_rel_addend_test.sh: New file.
9038 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
9039 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
9040
9041 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9042
9043 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
9044 * Makefile.in: Regenerate.
9045 * testsuite/Makefile.in: Regenerate.
9046
9047 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
9048
9049 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
9050 * gold/testsuite/debug_msg.cc: Likewise.
9051 * gold/testsuite/odr_violation1.cc
9052 * gold/testsuite/odr_violation2.cc
9053
9054 2010-07-21 Cary Coutant <ccoutant@google.com>
9055
9056 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
9057 string, and length fields.
9058 (Output_merge_string::Merged_strings_list): New type.
9059 (Output_merge_string::Merged_strings_lists): New typedef.
9060 (Output_merge_string): Replace merged_strings_ with
9061 merged_strings_lists_.
9062 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
9063 Merged_strings_list per input object and section. Don't store pointer
9064 to the string. Don't store length with each merged string entry.
9065 (Output_merge_string::finalize_merged_data): Loop over list of merged
9066 strings lists. Recompute length of each merged string.
9067
9068 2010-07-15 Cary Coutant <ccoutant@google.com>
9069
9070 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
9071 here.
9072
9073 2010-07-14 Ian Lance Taylor <iant@google.com>
9074
9075 * descriptors.cc (Descriptors::open): Report correct name in error
9076 message.
9077
9078 2010-07-13 Doug Kwan <dougkwan@google.com>
9079
9080 * arm.cc (Arm_input_section::Arm_input_section): For a
9081 SHT_ARM_EXIDX section, always keeps the input sections.
9082 (Arm_input_section::set_exidx_section_link): New method.
9083 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
9084 has_errors_ to false.
9085 (Arm_exidx_input_section::has_errors,
9086 Arm_exidx_input_section::set_has_errors): New methods.
9087 (Arm_exidx_input_section::has_errors_): New data member.
9088 (Arm_relobj::get_exidx_shndx_list): New method.
9089 (Arm_output_section::append_text_sections_to_list): Do not skip
9090 section without SHF_EXECINSTR.
9091 (Arm_output_section::fix_exidx_coverage): Skip input sections with
9092 errors.
9093 (Arm_relobj::make_exidx_input_section): Add new parameter for text
9094 section header. Make error messages more verbose. Check for
9095 a non-executable section linked to an EXIDX section.
9096 (Arm_relobj::do_read_symbols): Remove error checking, which has been
9097 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
9098 check that there is no deferred EXIDX section if we exit early.
9099 Instead of not making an EXIDX section in case of an error, make one
9100 and set the has_errors flag of it.
9101 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
9102 in a relocatable link.
9103 (Target_arm::do_relax): Look for the EXIDX output section instead of
9104 assuming that it is called .ARM.exidx.
9105 (Target_arm::fix_exidx_coverage): Add a new parameter for input
9106 section list. Do not check for SHF_EXECINSTR section flags but
9107 skip any input section with errors.
9108 * output.cc (Output_section::Output_section): Initialize
9109 always_keeps_input_sections_ to false.
9110 (Output_section::add_input_section): Check for
9111 always_keeps_input_sections_.
9112 * output.h (Output_section::always_keeps_input_sections,
9113 Output_section::set_always_keeps_input_sections): New methods.
9114 (Output_section::always_keeps_input_sections): New data member.
9115
9116 2010-07-13 Rafael Espindola <espindola@google.com>
9117
9118 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
9119 * fileread.h (Input_file): Add try_extra_search_path and find_file.
9120
9121 2010-07-13 Philip Herron <herron.philip@googlemail.com>
9122 Ian Lance Taylor <iant@google.com>
9123
9124 * output.h (Output_section_lookup_maps::add_merge_section):
9125 Correct check of whether value was inserted.
9126 (Output_section_lookup_maps::add_merge_input_section): Likewise.
9127 (Output_section_lookup_maps::add_relaxed_input_section):
9128 Likewise.
9129 * arm.cc (Target_arm::got_section): Remove used local os.
9130 * i386.cc (Target_i386::got_section): Likewise.
9131 * x86_64.cc (Target_x86_64::got_section): Likewise.
9132 * sparc.cc (Target_sparc::got_section): Likewise.
9133 (Target_sparc::relocate): Remove unused local have_got_offset.
9134 * powerpc.cc (Target_powerpc::relocate): Likewise.
9135
9136 2010-07-13 Ian Lance Taylor <iant@google.com>
9137
9138 * compressed_output.cc (zlib_decompress): Fix signature in
9139 !HAVE_ZLIB_H case.
9140
9141 * archive.cc (Archive::include_member): Unlock an external member
9142 of a thin archive. Don't bother to delete an object we know is
9143 NULL.
9144
9145 2010-07-12 Cary Coutant <ccoutant@google.com>
9146
9147 * compressed_output.cc (zlib_decompress): New function.
9148 (get_uncompressed_size): New function.
9149 (decompress_input_section): New function.
9150 * compressed_output.h (get_uncompressed_size): New function.
9151 (decompress_input_section): New function.
9152 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
9153 Handle compressed debug sections.
9154 * layout.cc (is_compressed_debug_section): New function.
9155 (Layout::output_section_name): Map compressed section names to
9156 canonical names.
9157 * layout.h (is_compressed_debug_section): New function.
9158 (is_debug_info_section): Recognize compressed debug sections.
9159 * merge.cc: Include compressed_output.h.
9160 (Output_merge_data::do_add_input_section): Handle compressed
9161 debug sections.
9162 (Output_merge_string::do_add_input_section): Handle compressed
9163 debug sections.
9164 * object.cc: Include compressed_output.h.
9165 (Sized_relobj::Sized_relobj): Initialize new data members.
9166 (build_compressed_section_map): New function.
9167 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
9168 * object.h (Object::section_is_compressed): New method.
9169 (Object::do_section_is_compressed): New method.
9170 (Sized_relobj::Compressed_section_map): New type.
9171 (Sized_relobj::do_section_is_compressed): New method.
9172 (Sized_relobj::compressed_sections_): New data member.
9173 * output.cc (Output_section::add_input_section): Handle compressed
9174 debug sections.
9175 * reloc.cc: Include compressed_output.h.
9176 (Sized_relobj::write_sections): Handle compressed debug sections.
9177
9178 2010-07-08 Cary Coutant <ccoutant@google.com>
9179
9180 * resolve.cc (Symbol_table::resolve): Remember whether undef was
9181 weak when resolving to a dynamic def.
9182 (Symbol_table::should_override): Add adjust_dyndef flag; set it
9183 for weak undef/dynamic def cases. Adjust callers.
9184 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
9185 undef_binding_weak_.
9186 (Symbol_table::sized_write_globals): Adjust symbol binding.
9187 (Symbol_table::sized_write_symbol): Add binding parameter.
9188 * symtab.h (Symbol::set_undef_binding): New method.
9189 (Symbol::is_undef_binding_weak): New method.
9190 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
9191 (Symbol_table::should_override): Add new parameter.
9192 (Symbol_table::sized_write_symbol): Add new parameter.
9193
9194 * testsuite/weak_undef_file1.cc: Add new test case.
9195 * testsuite/weak_undef_file2.cc: Fix header comment.
9196 * testsuite/weak_undef_test.cc: Add new test case.
9197
9198 2010-06-29 Doug Kwan <dougkwan@google.com>
9199
9200 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
9201 Initialize USE_SYMBOL_.
9202 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
9203 definition.
9204 (Arm_reloc_property::uses_symbol_): New data member declaration.
9205 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
9206 uses symbol value and symbol is undefined but not weakly undefined.
9207
9208 2010-06-28 Rafael Espindola <espindola@google.com>
9209
9210 * plugin.cc (Plugin::load): Use dlerror.
9211
9212 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
9213
9214 * symtab.cc (detect_odr_violations): When reporting an ODR
9215 violation, report an object where the symbol is defined.
9216
9217 2010-06-25 Doug Kwan <dougkwan@google.com>
9218
9219 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
9220 (Target_arm::section_may_have_icf_unsafe_pointers): New method
9221 definition.
9222 (Target_arm::Scan::local_reloc_may_be_function_pointer,
9223 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
9224 target hook to detect function points.
9225 (Target_arm::Scan::possible_function_pointer_reloc): New method.
9226 * icf.h (Icf::check_section_for_function_pointers): Change type of
9227 parameter SECTION_NAME to const reference to std::string. Use
9228 target hook to determine if section may have unsafe pointers.
9229 * target.h (Target::section_may_have_icf_unsafe_pointers): New
9230 method definition.
9231
9232 2010-06-21 Rafael Espindola <espindola@google.com>
9233
9234 * fileread.cc (Input_file::find_fie): New
9235 (Input_file::open): Use Input_file::find_fie.
9236 * fileread.h (Input_file::find_fie): New
9237 * plugin.cc (set_extra_library_path): New.
9238 (Plugin::load): Add set_extra_library_path to the transfer vector.
9239 (Plugin_manager::set_extra_library_path): New.
9240 (Plugin_manager::add_input_file): Use the extra search path if set.
9241 (set_extra_library_path(): New.
9242 * plugin.h (Plugin_manager): Add set_extra_library_path and
9243 extra_search_path_.
9244
9245 2010-06-19 Cary Coutant <ccoutant@google.com>
9246
9247 * layout.cc (gdb_sections): Add .debug_types.
9248 (lines_only_debug_sections): Likewise.
9249
9250 2010-06-18 Rafael Espindola <espindola@google.com>
9251
9252 * plugin.cc (add_input_file,add_input_library)
9253 (Plugin_manager::add_input_file): Make filename arguments const.
9254 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
9255 const.
9256
9257 2010-06-16 Doug Kwan <dougkwan@google.com>
9258
9259 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
9260 .ARM.attributes section if we have not merged any input
9261 attributes sections.
9262
9263 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9264
9265 * arm.cc: Allow combining objects with no EABI version
9266 information.
9267
9268 2010-06-15 Rafael Espindola <espindola@google.com>
9269
9270 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
9271
9272 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9273
9274 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
9275 (struct iovec): Correct !HAVE_READV definition.
9276
9277 2010-06-10 Cary Coutant <ccoutant@google.com>
9278
9279 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
9280 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
9281 reloc sections.
9282 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
9283
9284 PR 11683
9285 * symtab.h (Symbol::is_placeholder): New member function.
9286 * target-reloc.h (relocate_section): Check for placeholder symbols.
9287
9288 * testsuite/Makefile.am (plugin_test_8): New test.
9289 (plugin_test_9): New test.
9290 * testsuite/Makefile.in: Regenerate.
9291
9292 2010-06-09 Nick Clifton <nickc@redhat.com>
9293
9294 * yyscript.y (input_list_element): Allow strings prefixed with
9295 the '-' character. Treat these as libraries.
9296 * script.cc (script_add_library): New function. Adds a library
9297 specified by "-l<name>" found in an input script.
9298 * script-c.h: Add prototype for script_add_library.
9299
9300 2010-06-07 Doug Kwan <dougkwan@google.com>
9301
9302 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
9303 Restrict stub-group size to be within long conditional branch
9304 range when working around cortex-A8 erratum.
9305
9306 2010-06-07 Damien Diederen <dd@crosstwine.com>
9307
9308 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
9309 #ifdef typo.
9310
9311 2010-06-03 Sriraman Tallam <tmsriram@google.com>
9312
9313 PR gold/11658
9314 * output.cc
9315 (Output_section::Input_section_sort_entry::compare_section_ordering):
9316 Change to return non-zero correctly.
9317 (Output_section::Input_section_sort_section_order_index_compare
9318 ::operator()): Change to fix ambiguity in comparisons.
9319
9320 2010-06-01 Sriraman Tallam <tmsriram@google.com>
9321
9322 * gold.h (is_wildcard_string): New function.
9323 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
9324 (Layout::layout_eh_frame): Ditto.
9325 (Layout::find_section_order_index): New method.
9326 (Layout::read_layout_from_file): New method.
9327 * layout.h (Layout::find_section_order_index): New method.
9328 (Layout::read_layout_from_file): New method.
9329 (Layout::input_section_position_): New private member.
9330 (Layout::input_section_glob_): New private member.
9331 * main.cc (main): Call read_layout_from_file here.
9332 * options.h (--section-ordering-file): New option.
9333 * output.cc (Output_section::input_section_order_specified_): New
9334 member.
9335 (Output_section::Output_section): Initialize new member.
9336 (Output_section::add_input_section): Add new parameter.
9337 Keep input sections when --section-ordering-file is used.
9338 (Output_section::set_final_data_size): Sort input sections when
9339 section ordering file is specified.
9340 (Output_section::Input_section_sort_entry): Add new parameter.
9341 Check sorting type.
9342 (Output_section::Input_section_sort_entry::compare_section_ordering):
9343 New method.
9344 (Output_section::Input_section_sort_compare::operator()): Change to
9345 consider section_order_index.
9346 (Output_section::Input_section_sort_init_fini_compare::operator()):
9347 Change to consider section_order_index.
9348 (Output_section::Input_section_sort_section_order_index_compare
9349 ::operator()): New method.
9350 (Output_section::sort_attached_input_sections): Change to sort
9351 according to section order when specified.
9352 (Output_section::add_input_section<32, true>): Add new parameter.
9353 (Output_section::add_input_section<64, true>): Add new parameter.
9354 (Output_section::add_input_section<32, false>): Add new parameter.
9355 (Output_section::add_input_section<64, false>): Add new parameter.
9356 * output.h (Output_section::add_input_section): Add new parameter.
9357 (Output_section::input_section_order_specified): New
9358 method.
9359 (Output_section::set_input_section_order_specified): New method.
9360 (Input_section::Input_section): Initialize section_order_index_.
9361 (Input_section::section_order_index): New method.
9362 (Input_section::set_section_order_index): New method.
9363 (Input_section::section_order_index_): New member.
9364 (Input_section::Input_section_sort_section_order_index_compare): New
9365 struct.
9366 (Output_section::input_section_order_specified_): New member.
9367 * script-sections.cc (is_wildcard_string): Delete and move modified
9368 method to gold.h.
9369 (Output_section_element_input::Output_section_element_input): Modify
9370 call to is_wildcard_string.
9371 (Output_section_element_input::Input_section_pattern
9372 ::Input_section_pattern): Ditto.
9373 (Output_section_element_input::Output_section_element_input): Ditto.
9374 * testsuite/Makefile.am (final_layout): New test case.
9375 * testsuite/Makefile.in: Regenerate.
9376 * testsuite/final_layout.cc: New file.
9377 * testsuite/final_layout.sh: New file.
9378
9379 2010-06-01 Rafael Espindola <espindola@google.com>
9380
9381 * plugin.cc (Plugin::load): Pass the output name to the plugin.
9382
9383 2010-06-01 Rafael Espindola <espindola@google.com>
9384
9385 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
9386 visibility of symbols.
9387
9388 2010-05-27 Doug Kwan <dougkwan@google.com>
9389
9390 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
9391 from start of output section instead of address for a local symbol
9392 in a merged or relaxed section when doing a relocatable link.
9393
9394 2010-05-26 Rafael Espindola <espindola@google.com>
9395
9396 PR 11604
9397 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
9398 adding sections the garbage collector removed.
9399 * gold/testsuite/Makefile.am: Add test.
9400 * gold/testsuite/Makefile.in: Regenerate.
9401 * gold/testsuite/plugin_test_7.sh: New.
9402 * gold/testsuite/plugin_test_7_1.c: New.
9403 * gold/testsuite/plugin_test_7_2.c: New.
9404
9405 2010-05-26 Rafael Espindola <espindola@google.com>
9406
9407 * script-sections.cc (Output_section_definition::set_section_addresses):
9408 Check for --section-start.
9409
9410 2010-05-26 Doug Kwan <dougkwan@google.com>
9411
9412 * arm.cc (Arm_scan_relocatable_relocs): New class.
9413 (Target_arm::relocate_special_relocatable): New method.
9414 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
9415 (Arm_relocate_functions::thumb_branch_common): Same.
9416 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
9417 instead of Default_scan_relocatable_relocs.
9418 * target-reloc.h (relocate_for_relocatable): Let target handle
9419 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
9420 * target.h (Sized_target::relocate_special_relocatable): New method.
9421
9422 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9423
9424 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
9425
9426 2010-05-23 Doug Kwan <dougkwan@google.com>
9427
9428 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
9429 instead of a cast.
9430 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
9431 with a direct branch, not a conditional branch, to a stub.
9432 * merge.cc (Output_merge_base::record_input_section): New method
9433 defintion.
9434 (Output_merge_data::do_add_input_section): Record input section if
9435 keeps-input-sections flag is set.
9436 (Output_merge_string::do_add_input_section): Ditto.
9437 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
9438 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
9439 INPUT_SECTIONS_.
9440 (Output_merge_base::keeps_input_sections,
9441 Output_merge_base::set_keeps_input_sections,
9442 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
9443 method definitions.
9444 (Output_merge_base::Input_sections): New type declaration.
9445 (Output_merge_base::input_sections_begin,
9446 Output_merge_base::input_sections_end,
9447 Output_merge_base::do_set_keeps_input_sections): New method definitions.
9448 (Output_merge_base::bool keeps_input_sections_,
9449 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
9450 Output_merge_base::input_sections_): New data members.
9451 (Output_merge_data::do_set_keeps_input_sections): New method
9452 defintion.
9453 (Output_merge_string::do_set_keeps_input_sections): Ditto.
9454 * output.cc (Output_section::Input_section::relobj): Move method
9455 defintion from class declaration to here and handle merge sections.
9456 (Output_section::Input_section::shndx): Ditto.
9457 (Output_section::Output_section): Remove initializations of removed
9458 data members and initialize new data member LOOKUP_MAPS_.
9459 (Output_section::add_input_section): Set keeps-input-sections flag
9460 for a newly created merge output section as appropriate. Adjust code
9461 to use Output_section_lookup_maps class.
9462 (Output_section::add_relaxed_input_section): Adjst code for lookup
9463 maps code refactoring.
9464 (Output_section::add_merge_input_section): Add a new parameter
9465 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
9466 class. If adding input section to a newly created merge output
9467 section fails, remove the new merge section.
9468 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
9469 Adjust code for use of the Output_section_lookup_maps class.
9470 (Output_section::find_merge_section): Ditto.
9471 (Output_section::build_lookup_maps): New method defintion.
9472 (Output_section::find_relaxed_input_section): Adjust code to use
9473 Output_section_lookup_maps class.
9474 (Output_section::get_input_sections): Export merge sections. Adjust
9475 code to use Output_section_lookup_maps class.
9476 (Output_section:::add_script_input_section): Adjust code to use
9477 Output_section_lookup_maps class. Update lookup maps for merge
9478 sections also.
9479 (Output_section::discard_states): Use Output_section_lookup_maps.
9480 (Output_section::restore_states): Same.
9481 * output.h (Merge_section_properties): Move class defintion out of
9482 Output_section.
9483 (Output_section_lookup_maps): New class.
9484 (Output_section::Input_section::is_merge_section): New method
9485 defintion.
9486 (Output_section::Input_section::relobj): Move defintion out of class
9487 defintion. Declare method only.
9488 (Output_section::Input_section::shndx): Ditto.
9489 (Output_section::Input_section::output_merge_base): New method defintion.
9490 (Output_section::Input_section::u2_.pomb): New union field.
9491 (Output_section::Merge_section_by_properties_map,
9492 Output_section::Output_section_data_by_input_section_map,
9493 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
9494 Remove types.
9495 (Output_section::add_merge_input_section): Add new parameter
9496 KEEPS_INPUT_SECTIONS.
9497 (Output_section::build_lookup_maps): New method declaration.
9498 (Output_section::merge_section_map_,
9499 Output_section::merge_section_by_properties_map_,
9500 Output_section::relaxed_input_section_map_,
9501 Output_section::is_relaxed_input_section_map_valid_): Remove data
9502 members.
9503 (Output_section::lookup_maps_): New data member.
9504
9505 2010-05-21 Doug Kwan <dougkwan@google.com>
9506
9507 PR gold/11619
9508 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
9509 avoid a compilation error.
9510
9511 2010-05-19 Rafael Espindola <espindola@google.com>
9512
9513 * script-sections.cc (Output_section_definition::allocate_to_segment):
9514 Update the phdrs_list even when the output section is NULL.
9515 * testsuite/Makefile.am: Add test.
9516 * testsuite/Makefile.in: Regenerate.
9517 * testsuite/script_test_9.cc: New.
9518 * testsuite/script_test_9.sh: New.
9519 * testsuite/script_test_9.t: New.
9520
9521 2010-05-19 Doug Kwan <dougkwan@google.com>
9522
9523 * arm.cc (Arm_input_section::original_size): New method.
9524 (Arm_input_section::do_addralign): Add a cast.
9525 (Arm_input_section::do_output_offset): Remove static cast.
9526 (Arm_input_section::original_addralign,
9527 Arm_input_section::original_size_): Change type to uint32_t.
9528 (Arm_input_section::init): Add safe casts for section alignment
9529 and size.
9530 (Arm_input_section::set_final_data_size): Do not set address and
9531 offset of stub table.
9532 (Arm_output_section::fix_exidx_coverage): Change use of of
9533 Output_section::Simple_input_section to that of
9534 Output_section::Input_section.
9535 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
9536 except for the first pass.
9537 * output.cc (Output_section::get_input_sections): Change type of
9538 input_sections to std::list<Input_section>.
9539 (Output_section::add_script_input_section): Rename from
9540 Output_section::add_simple_input_section. Change type of SIS
9541 parameter from Simple_input_section to Input_section.
9542 * output.h (Output_section::Simple_input_section): Remove class.
9543 (Output_section::Input_section): Change class visibility to public.
9544 (Output_section::Input_section::addralign): Use stored alignments
9545 for special input sections if set.
9546 (Output_section::Input_section::set_addralign): New method.
9547 (Output_section::get_input_sections): Change parameter type from
9548 list of Simple_input_section to list of Input_section.
9549 (Output_section::add_script_input_section): Rename from
9550 Output_section::add_simple_input_section. Change first parameter's
9551 type from Simple_input_section to Input_section and remove the
9552 second and third parameters.
9553 * script-sections.cc (Input_section::Input_section_list): Change
9554 type to list of Output_section::Input_section/
9555 (Input_section_info::Input_section_info): Change parameter type of
9556 INPUT_SECTION to Output_section::Input_section.
9557 (Input_section_info::input_section): Change return type.
9558 (Input_section_info::input_section_): Change type to
9559 Output_section::Input_section.
9560 (Output_section_element_input::set_section_addresses): Adjust code
9561 to use Output_section::Input_section instead of
9562 Output_section::Simple_input_section. Adjust code for renaming
9563 of Output_section::add_simple_input_section.
9564 (Orphan_output_section::set_section_addresses): Ditto.
9565
9566 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9567
9568 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
9569 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
9570
9571 2010-05-18 Rafael Espindola <espindola@google.com>
9572
9573 * options.cc (General_options::finalize): Handle -nostdlib.
9574 * options.h (nostdlib): New option.
9575 * script.cc (script_add_search_dir): Handle -nostdlib.
9576
9577 2010-05-12 Doug Kwan <dougkwan@google.com>
9578
9579 * arm.cc (Target_arm::do_finalize_sections): Create an empty
9580 attributes section only if there no attributes section after merging.
9581 (Target_arm::merge_object_attributes): Move value of
9582 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
9583 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
9584 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
9585 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
9586 and arm_attr_merge_7.stdout.
9587 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
9588 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
9589 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
9590 arm_attr_merge_7b.o): New rules.
9591 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
9592 arm_attr_merge_7
9593 * testsuite/Makefile.in: Regenerate.
9594 * testsuite/arm_attr_merge.sh: New file.
9595 * testsuite/arm_attr_merge_[67][ab].s: Same.
9596
9597 2010-05-05 Nick Clifton <nickc@redhat.com>
9598
9599 * po/es.po: Updated Spanish translation.
9600
9601 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9602
9603 * Makefile.am (install-exec-local): Properly install gold as
9604 default cross linker.
9605 * Makefile.in: Regenerated.
9606
9607 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9608 Nick Clifton <nickc@redhat.com>
9609
9610 * configure.ac (install_as_default): Define and set to false
9611 unless --enable-gold or --enable-gold=both/gold has been
9612 specified.
9613 * configure: Regenerate.
9614
9615 * Makefile.am (install-exec-local): Install the executable as
9616 'ld.gold'. If install_as_default is true then also install it as
9617 'ld'.
9618 * Makefile.in: Regenerated.
9619
9620 2010-04-24 Ian Lance Taylor <iant@google.com>
9621
9622 * layout.cc (Layout::layout_reloc): In relocatable link don't
9623 combine reloc sections for grouped sections.
9624
9625 2010-04-23 Sriraman Tallam <tmsriram@google.com>
9626
9627 * gc.h (gc_process_relocs): Pass information on relocs pointing to
9628 sections that are not ordinary to icf.
9629 * icf.cc (get_section_contents): Handle relocation pointing to section
9630 with no object or shndx information.
9631 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
9632 * testsuite/Makefile.in: Regenerate.
9633 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
9634 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
9635
9636 2010-04-22 Ian Lance Taylor <iant@google.com>
9637
9638 * expression.cc (Expression::Expression_eval_info): Add
9639 result_alignment_pointer field.
9640 (Expression::eval_with_dot): Add result_alignment_pointer
9641 parameter. Change all callers.
9642 (Expression::eval_maybe_dot): Likewise.
9643 (class Binary_expression): Add alignment_pointer parameter to
9644 left_value and right_value. Change all callers.
9645 (BINARY_EXPRESSION): Set result alignment.
9646 (class Trinary_expression): Add alignment_pointer parameter to
9647 arg2_value and arg3_value. Change all callers.
9648 (Trinary_cond::value): Set result alignment.
9649 (Max_expression::value, Min_expression::value): Likewise.
9650 (Align_expression::value): Likewise.
9651 * script-sections.cc (class Sections_element): Add dot_alignment
9652 parameter to set_section_addresses virtual function. Update
9653 instantiations.
9654 (class Output_section_element): Likewise.
9655 (Script_sections::create_segments): Add dot_alignment parameter.
9656 Change all callers.
9657 (Script_sections::create_segments_from_phdrs_clause): Likewise.
9658 (Script_sections::set_phdrs_clause_addresses): Likewise.
9659 * script-sections.h: Update declarations.
9660 * script.h: Update declarations.
9661 * output.h (Output_segment::set_minimum_p_align): Don't decrease
9662 min_p_align.
9663 * testsuite/script_test_3.t: Set large alignment.
9664 * testsuite/script_test_3.sh: Make sure that at least one LOAD
9665 segment has expected alignment.
9666
9667 2010-04-22 Nick Clifton <nickc@redhat.com>
9668
9669 * po/gold.pot: Updated by the Translation project.
9670 * po/vi.po: Updated Vietnamese translation.
9671
9672 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
9673
9674 * testsuite/Makefile.am (check_PROGRAMS): Add
9675 icf_virtual_function_folding_test.
9676 * testsuite/Makefile.in: Regenerated.
9677
9678 2010-04-15 Andrew Haley <aph@redhat.com>
9679
9680 * options.h (merge_exidx_entries): New option.
9681 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
9682 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
9683 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
9684 (Target_arm::merge_exidx_entries): New function.
9685 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
9686 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
9687 to Arm_exidx_fixup constructor.
9688 Add new arg, merge_exidx_entries.
9689 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
9690 Arm_output_section::fix_exidx_coverage.
9691
9692 2010-04-18 Sriraman Tallam <tmsriram@google.com>
9693
9694 * icf.cc (get_section_contents): Check for preemptible functions.
9695 Ignore addend when appropriate.
9696 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
9697 section folded.
9698 (add_from_relobj): Check for section folded.
9699 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
9700 * symtab.h (should_add_dynsym_entry): Add new parameter.
9701 * target-reloc.h (scan_relocs): Check for section folded.
9702 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
9703 Check reloc types for function pointers in shared objects.
9704 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
9705 case.
9706 (icf_preemptible_functions_test): New test case.
9707 (icf_string_merge_test): New test case.
9708 * testsuite.Makefile.in: Regenerate.
9709 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
9710 bar_glob. Refactor code.
9711 * testsuite/icf_preemptible_functions_test.cc: New file.
9712 * testsuite/icf_preemptible_functions_test.sh: New file.
9713 * testsuite/icf_string_merge_test.cc: New file.
9714 * testsuite/icf_string_merge_test.sh: New file.
9715 * testsuite/icf_virtual_function_folding_test.cc: New file.
9716 * testsuite/icf_virtual_function_folding_test.sh: New file.
9717
9718 2010-04-14 Doug Kwan <dougkwan@google.com>
9719
9720 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
9721 for local symbol recounting if we remove a section due to ICF.
9722 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
9723 there are no regular objects in input.
9724
9725 2010-04-13 Doug Kwan <dougkwan@google.com>
9726
9727 * arm.cc (Arm_input_section::set_final_data_size): Compute
9728 accurate final data size instead of using current data size.
9729
9730 2010-04-09 Doug Kwan <dougkwan@google.com>
9731
9732 * layout.cc (Layout::choose_output_section): Handle script section
9733 types.
9734 (Layout::make_output_section_for_script): Add section type parameter.
9735 Handle script section types.
9736 * layout.h (Layout::make_output_section_for_script): Add section
9737 type parameter.
9738 * output.cc (Output_section::Output_section): Initialize data member
9739 is_noload_.
9740 (Output_section::do_reset_address_and_file_offset): Do not set address
9741 to 0 if section is a NOLOAD section.
9742 * output.h (Output_section::is_noload): New method.
9743 (Output_section::set_is_noload): Ditto.
9744 (Output_section::is_noload_): New data member.
9745 * script-c.h (Script_section_type): New enum type.
9746 (struct Parser_output_section_header): Add new file section_type.
9747 * script-sections.cc (Sections_element::output_section_name): Add
9748 parameter for returning script section type.
9749 (Output_section_definition::output_section_name): Ditto.
9750 (Output_section_definition::section_type)P; New method.
9751 (Output_section_definiton::script_section_type_name): Ditto.
9752 (Output_section_definition::script_section_type_): New data member.
9753 (Output_section_definition::Output_section_definition): Initialize
9754 data member Output_section_definition::script_section_type_.
9755 (Output_section_definition::create_sections): Pass script section type
9756 to Layout::make_output_section_for_script.
9757 (Output_section_definition::output_section_name): Return script
9758 section type to caller.
9759 (Output_section_definition::set_section_address): Do not advance
9760 dot value and load address if section type is NOLOAD. Set address
9761 of NOLOAD sections regardless of section flags.
9762 (Output_section_definition::print): Print section type if it is
9763 not SCRIPT_SECTION_TYPE_NONE.
9764 (Output_section_definition::section_type): New method.
9765 (Output_section_definition::script_section_type_name): Ditto.
9766 (Script_sections::output_section_name): Add new parameter
9767 PSECTION_TYPE for returning script section type. Pass it to
9768 section elements. Handle discard sections.
9769 (Sort_output_sections::operator()): Handle NOLOAD sections.
9770 * script-sections.h (Script_sections::Section_type): New enum type.
9771 (Script_sections::output_section_name): Add a new parameter for
9772 returning script section type.
9773 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
9774 INFO and NOLOAD.
9775 * yyscript.y (union): Add new field SECTION_TYPE.
9776 (COPY, DSECT, INFO, NOLOAD): New tokens.
9777 (opt_address_and_section_type): Change type to output_section_header.
9778 (section_type): New non-terminal
9779 (section_header): Handle section type.
9780 (opt_address_and_section_type): Return section type value.
9781
9782 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
9783
9784 * testsuite/plugin_common_test_1.c (foo): Add prototype.
9785 * testsuite/plugin_common_test_2.c (foo): Likewise.
9786
9787 2010-04-08 Doug Kwan <dougkwan@google.com>
9788
9789 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
9790 Output_merge_data.
9791 * output.cc (Output_section::add_merge_input_section): Simplify
9792 code and return status of Output_merge_base::add_input_section.
9793 Update merge section map only if Output_merge_base::add_input_section
9794 returns true.
9795
9796 2010-04-07 Doug Kwan <dougkwan@google.com>
9797
9798 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
9799 if section is marked as containing instructions but has no mapping
9800 symbols.
9801 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
9802 correct section index.
9803 (Arm_relobj::find_linked_text_section): Ditto.
9804
9805 2010-04-07 Cary Coutant <ccoutant@google.com>
9806
9807 * archive.cc (include_member): Destroy Read_symbols_data object before
9808 releasing file.
9809 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
9810 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
9811 (Read_symbols_data::~Read_symbols_data) New destructor.
9812 (Section_relocs::Section_relocs) New constructor.
9813 (Section_relocs::~Section_relocs) New destructor.
9814 (Read_relocs_data::Read_relocs_data) New constructor.
9815 (Read_relocs_data::~Read_relocs_data) New destructor.
9816 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
9817 pointers to NULL after deleting.
9818
9819 2010-04-07 Doug Kwan <dougkwan@google.com>
9820
9821 * arm.cc: Replace "endianity" with "endianness" in comments.
9822 (Arm_exidx_cantunwind): Ditto.
9823 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
9824 (Arm_relobj::merge_flags_and_attributes): New method.
9825 (Arm_relobj::merge_flags_and_attributes_): New data member.
9826 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
9827 (Arm_relobj::scan_sections_for_stubs): Ditto.
9828 (Arm_relobj::do_read_symbols): Check to see if we really want to
9829 merge processor-specific flags and attributes. Exit early if
9830 an object is empty except for section names and the undefined symbol.
9831 (Target_arm::do_finalize_sections): Move check for ELF format to
9832 Arm_relobj::do_read_symbols. Merge processor specific flags and
9833 attributes from a regular object only when we have determined that
9834 it is aapropriate. Do not create an .ARM.attributes section in
9835 output if there is no regular input object.
9836 (Target_arm::merge_processor_specific_flags): Check
9837 --warn-mismatch before printing any error.
9838 (Target_arm::merge_object_attributes): Ditto.
9839 * gold.cc (queue_middle_tasks): Handle the case in which there is
9840 no regular object in input.
9841 * options.cc (General_options::parse_EB): New method.
9842 (General_options::parse_EL): Same.
9843 (General_options::General_options): Initialize endianness_.
9844 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
9845 New options.
9846 (General_options::Endianness): New enum.
9847 (General_options::endianness): New method.
9848 (General_options::endianness_): New data member.
9849 * parameters.cc (Parameters::set_options): Check target endianness.
9850 (Parameters::set_target_once): Ditto.
9851 (Parameters::check_target_endianness): New method.
9852 (parameters_force_valid_target): If either -EL or -EB is specified,
9853 use it to define endianness of default target.
9854 * parameters.h (Parameters::check_target_endianness): New method
9855 declaration.
9856 * target.h (class Target): Change "endianity" to "endianness"
9857 in comments.
9858
9859 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9860
9861 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
9862 * configure: Regenerate.
9863 * Makefile.in: Regenerate.
9864 * testsuite/Makefile.in: Regenerate.
9865
9866 2010-04-06 Cary Coutant <ccoutant@google.com>
9867
9868 gcc PR lto/42757
9869 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
9870 prevailing definitions of common symbols.
9871 * testsuite/plugin_test_6.sh: New test case.
9872 * testsuite/plugin_common_test_1.c: New test case.
9873 * testsuite/plugin_common_test_2.c: New test case.
9874 * testsuite/Makefile.am (plugin_test_6): New test case.
9875 * testsuite/Makefile.in: Regenerate.
9876
9877 2010-04-06 Nick Clifton <nickc@redhat.com>
9878
9879 * po/vi.po: New Vietnamese translation.
9880
9881 2010-03-30 Doug Kwan <dougkwan@google.com>
9882
9883 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
9884
9885 2010-03-25 Doug Kwan <dougkwan@google.com>
9886
9887 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
9888 to avoid a conversion warning on a 32-bit host.
9889
9890 2010-03-24 Ian Lance Taylor <iant@google.com>
9891
9892 * testsuite/script_test_3.t: Add a TLS segment.
9893 * testsuite/Makefile.am (check_PROGRAMS): Add
9894 tls_phdrs_script_test.
9895 (tls_phdrs_script_test_SOURCES): Define.
9896 (tls_phdrs_script_test_DEPENDENCIES): Define.
9897 (tls_phdrs_script_test_LDFLAGS): Define.
9898 (tls_phdrs_script_test_LDADD): Define.
9899 * testsuite/Makefile.in: Rebuild.
9900
9901 2010-03-23 Cary Coutant <ccoutant@google.com>
9902
9903 * fileread.cc (find_or_make_view): Fix comment.
9904
9905 2010-03-23 Ian Lance Taylor <iant@google.com>
9906
9907 * script-sections.cc (class Orphan_section_placement): Define
9908 PLACE_TLS and PLACE_TLS_BSS.
9909 (Orphan_section_placement::Orphan_section_placement): Initialize
9910 new places.
9911 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
9912 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
9913 (tls_script_test_SOURCES): Define.
9914 (tls_script_test_DEPENDENCIES): Define.
9915 (tls_script_test_LDFLAGS): Define.
9916 (tls_script_test_LDADD): Define.
9917 * testsuite/Makefile.in: Rebuild.
9918
9919 2010-03-22 Doug Kwan <dougkwan@google.com>
9920
9921 * arm.cc (Arm_relocate_functions::abs8,
9922 Arm_relocate_functions::abs16): Use correct check for overflow
9923 specified in the ARM ELF specs.
9924 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
9925 target of a BLX instruction specially.
9926 (Reloc_stub::stub_type_for_reloc): Ditto.
9927 (Relocate::relocate): Use symbolic names instead of numeric relocation
9928 codes to report error.
9929 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
9930 workaround.
9931 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
9932 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
9933 thumb2_blx_out_of_range.stdout
9934 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
9935 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
9936 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
9937 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
9938 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
9939 thumb2_blx_in_range, thumb2_blx_in_range.o,
9940 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
9941 thumb2_blx_out_of_range.o): New rules.
9942 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
9943 thumb2_blx_in_range and thumb2_blx_out_of_range.
9944 * testsuite/Makefile.in: Regenerate.
9945 * arm_branch_in_range.sh: Add tests for THUMB BLX.
9946 * testsuite/thumb_blx_in_range.s: New file.
9947 * testsuite/thumb_blx_out_of_range.s: New file.
9948
9949 2010-03-22 Rafael Espindola <espindola@google.com>
9950
9951 * archive.cc (Should_include): Move to archive.h.
9952 (should_include_member): Make it a member of Archive.
9953 (Lib_group): New.
9954 (Add_lib_group_symbols): New.
9955 * archive.h: Include options.h.
9956 (Archive_member): Moved from Archive.
9957 (Should_include): Moved from archive.cc.
9958 (Lib_group): New.
9959 (Add_lib_group_symbols): New.
9960 * dynobj.cc (do_should_include_member): New.
9961 * dynobj.h (do_should_include_member): New.
9962 * gold.cc (queue_initial_tasks): Update call to queue.
9963 * main.cc (main): Print lib group stats.
9964 * object.cc (do_should_include_member): New.
9965 * object.h: Include archive.h.
9966 (Object::should_include_member): New.
9967 (Object::do_should_include_member): New.
9968 (Sized_relobj::do_should_include_member): New.
9969 * options.cc (General_options::parse_start_lib): New.
9970 (General_options::parse_end_lib): New.
9971 (Input_arguments::add_file): Handle lib groups.
9972 (Input_arguments::start_group): Check we are not in a lib.
9973 (Input_arguments::start_lib): New.
9974 (Input_arguments::end_lib): New.
9975 * options.h (General_options): Add start_lib and end_lib.
9976 (Input_argument::lib_): New.
9977 (Input_argument::lib): New.
9978 (Input_argument::is_lib): New.
9979 (Input_file_lib): New.
9980 (Input_arguments::in_lib_): New.
9981 (Input_arguments::in_lib): New.
9982 (Input_arguments::start_lib): New.
9983 (Input_arguments::end_lib_): New.
9984 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
9985 in unused members as preempted.
9986 (Sized_pluginobj::do_should_include_member): New.
9987 * plugin.h (Sized_pluginobj::do_should_include_member): New.
9988 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
9989 return the blocker.
9990 (Read_symbols::do_whole_lib_group): New.
9991 (Read_symbols::do_lib_group): New.
9992 (Read_symbols::do_read_symbols): Handle lib groups.
9993 (Read_symbols::get_name): Handle lib groups.
9994 * readsyms.h (Read_symbols): Add an archive member pointer.
9995 (Read_symbols::do_whole_lib_group): New.
9996 (Read_symbols::do_lib_group): New.
9997 (Read_symbols::member_): New.
9998 * script.cc (read_input_script): Update call to queue_soon.
9999
10000 2010-03-19 Doug Kwan <dougkwan@google.com>
10001
10002 * arm.cc (Stub_table::Stub_table): Initialize new data members
10003 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10004 (Stub_table::add_reloc_stub): Assign stub offset and update
10005 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10006 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
10007 New data members.
10008 (Stub_table::update_data_size_and_addralign): Use
10009 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
10010 instead of going over all reloc stubs.
10011 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
10012 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10013 Stringpool_template::offset_ to size of Stringpool_char.
10014 (Stringpool_template::new_key_offset): Remove code to initialize
10015 Stringpool_template::offset_.
10016 * stringpool.h (Stringpool_template::set_no_zero_null): Set
10017 Stringpool_template::offset_ to zero.
10018
10019 2010-03-15 Doug Kwan <dougkwan@google.com>
10020
10021 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10022 offset_.
10023 (Stringpool_template::new_key_offset): New method.
10024 (Stringpool_template::add_string): Assign offsets when adding new
10025 strings.
10026 (Stringpool_template::set_string_offsets): Do not set string offsets
10027 when not optimizing.
10028 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
10029 member size_.
10030 (Chunked_vector::clear): Clear size_.
10031 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
10032 (Chunked_vector::size): Return size_.
10033 (Chunked_vector::push_back): Use size_ to find insert position.
10034 (Chunked_vector::size_): New data member.
10035 (Stringpool_template::set_no_zero_null): Assert string set is empty.
10036 (Stringpool_template::new_key_offset): New method declaration.
10037 (Stringpool_template::offset_): New data member.
10038
10039 2010-03-15 Rafael Espindola <espindola@google.com>
10040
10041 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
10042 Add_symbols' constructor.
10043 * readsyms.h (Add_symbols): Remove the input_group member.
10044
10045 2010-03-10 Ian Lance Taylor <iant@google.com>
10046
10047 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
10048 target to ask whether a reference to a symbol requires a stack
10049 split.
10050 * target.h (Target::is_call_to_non_split): New function.
10051 (Target::do_is_call_to_non_split): Declare virtual function.
10052 * target.cc: Include "symtab.h".
10053 (Target::do_is_call_to_non_split): New function.
10054 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
10055
10056 2010-03-10 Cary Coutant <ccoutant@google.com>
10057
10058 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
10059 (File_read::open[1]): Remove initial mapping of whole_file_view_.
10060 (File_read::open[2]): Add whole_file_view_ to list of views.
10061 (File_read::make_view): Remove test of whole_file_view_.
10062 (File_read::find_or_make_view): Create whole_file_view_ if
10063 necessary.
10064 (File_read::clear_views): Replace bool parameter with enum;
10065 adjust all callers. Don't delete views with permanent data;
10066 do delete cached views and views from archives if
10067 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
10068 if clearing the corresponding view.
10069 * fileread.h (File_read::Clear_views_mode): New enum.
10070 (File_read::View::is_permanent_view): New method.
10071 (File_read::clear_views): Replace bool parameter
10072 with enum; adjust all callers.
10073 * options.h (General_options): Change keep_files_mapped option;
10074 add map_whole_files.
10075 * readsyms.cc (Add_symbols::run): Delete sd_ object before
10076 releasing the file.
10077 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
10078 the file.
10079
10080 2010-03-10 David S. Miller <davem@davemloft.net>
10081
10082 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
10083
10084 2010-03-09 Sriraman Tallam <tmsriram@google.com>
10085
10086 * icf.cc (get_section_contents): Add '@' marker after processing the
10087 merge reloc.
10088
10089 2010-03-08 Doug Kwan <dougkwan@google.com>
10090
10091 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
10092 due to a conversion warning.
10093 (Arm_relobj::update_output_local_symbol_count): Check for local
10094 symbol with unset output index.
10095
10096 2010-03-05 Ian Lance Taylor <iant@google.com>
10097
10098 * options.h (class General_options): Add --spare-dynamic-tags.
10099 * output.cc (Output_data_dynamic::set_final_data_size): Implement
10100 --spare-dynamic-tags.
10101
10102 2010-03-05 Ian Lance Taylor <iant@google.com>
10103
10104 * incremental.cc: Include "libiberty.h".
10105
10106 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
10107
10108 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
10109 function, is_info_ member.
10110 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
10111 (Versions::Versions): Update caller.
10112 (Versions::define_base_version): Likewise.
10113 (Versions::add_def): Likewise.
10114
10115 2010-03-03 Sriraman Tallam <tmsriram@google.com>
10116
10117 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
10118 (Scan::possible_function_pointer_reloc): New function.
10119 (Scan::local_reloc_may_be_function_pointer): Change to call
10120 possible_function_pointer_reloc.
10121 (Scan::global_reloc_may_be_function_pointer): Ditto.
10122 * icf.h (Icf::check_section_for_function_pointers): Change to reject
10123 relocations in ".data.rel.ro._ZTV" section.
10124 * testsuite/icf_safe_so_test.sh: Change to pass i386.
10125 * testsuite/icf_safe_so_test.cc: Ditto.
10126 * testsuite/icf_safe_test.cc: Ditto.
10127 * testsuite/icf_safe_test.sh: Ditto.
10128
10129 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10130 Ian Lance Taylor <iant@google.com>
10131
10132 * target-reloc.h (relocate_section): Check the symbol table index
10133 for -1U before setting the local symbol index.
10134 (scan_relocatable_relocs): If copying the relocation, record that
10135 the local symbol is required.
10136 * object.h (Symbol_value::is_output_symtab_index_set): New
10137 function.
10138 (Symbol_value::may_be_discarded_from_output_symtab): New
10139 function.
10140 (Symbol_value::has_output_symtab_entry): New function.
10141 (Symbol_value::needs_output_symtab_entry): Remove.
10142 (Symbol_value::output_symtab_index): Make sure the symbol index is
10143 set.
10144 (Symbol_value::set_output_symtab_index): Make sure the symbol
10145 index is not set. Make sure the new index is valid.
10146 (Symbol_value::set_must_have_output_symtab_entry): New function.
10147 (Symbol_value::has_output_dynsym_entry): New function.
10148 (Symbol_value::set_output_dynsym_index): Make sure the new index
10149 is valid.
10150 (Sized_relobj::set_must_have_output_symtab_entry): New function.
10151 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
10152 local symbol if permitted.
10153 (Sized_relobj::do_finalize_local_symbols): Call
10154 is_output_symtab_index_set rather than needs_output_symtab_entry.
10155 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
10156 rather than needs_output_symtab_entry. Call
10157 has_output_dynsym_entry rather than needs_output_dynsym_entry.
10158 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
10159 is_output_symtab_index_set rather than needs_output_symtab_entry.
10160 * testsuite/discard_locals_relocatable_test.c: New file.
10161 * testsuite/discard_locals_test.sh: Test -r.
10162 * testsuite/Makefile.am (check_DATA): Add
10163 discard_locals_relocatable_test1.syms,
10164 discard_local_relocatable_test2.syms.
10165 (MOSTLYCLEANFILES): Likewise. Also add
10166 discard_locals_relocatable_test1.lout and
10167 discard_locals_relocatable_test2.out.
10168 (discard_locals_relocatable_test1.syms): New target.
10169 (discard_locals_relocatable_test.o): New target.
10170 (discard_locals_relocatable_test1.out): New target.
10171 (discard_locals_relocatable_test2.syms): New target.
10172 (discard_locals_relocatable_test2.out): New target.
10173 (various): Add missing ../ld-new dependencies.
10174 * testsuite/Makefile.in: Rebuild.
10175
10176 2010-03-03 Nick Clifton <nickc@redhat.com>
10177
10178 * po/fi.po: New Finnish translation.
10179
10180 2010-03-01 Doug Kwan <dougkwan@google.com>
10181
10182 * layout.cc (Layout::Layout): Force section types of .init_array*,
10183 .preinit_array* and .fini_array* sections.
10184 * output.cc (Output_section::Input_section_sort_entry::has_priority):
10185 Fix check of return value of std::string::find.().
10186 (Output_section::Input_section_sort_compare::operator()): Remove
10187 comment about .init_array.
10188 (Output_section::Input_section_sort_init_fini_compare::operator()):
10189 New method.
10190 (Output_section::sort_attached_input_sections): Handle .init_array
10191 and .fini_array specially.
10192 * output.h (Output_section::Inut_section_sort_compare): Update
10193 comment.
10194 (Output_section::Input_section_sort_init_fini_compare): New struct.
10195
10196 2010-02-26 Doug Kwan <dougkwan@google.com>
10197
10198 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
10199 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
10200 * testsuite/debug_msg.sh: Avoid matching source line number for
10201 use of global variable undef_int.
10202
10203 2010-02-26 Doug Kwan <dougkwan@google.com>
10204
10205 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
10206 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
10207 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
10208 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
10209 * options.cc (General_options::General_options): Initialize member
10210 fix_v4bx_.
10211 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
10212 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
10213 and rm_no_fix_v4bx.stdout
10214 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
10215 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
10216 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
10217 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
10218 and arm_no_fix_v4bx.
10219 * Makefile.in: Regenerate.
10220 * testsuite/arm_fix_v4bx.s: New file.
10221 * testsuite/arm_fix_v4bx.sh: Ditto.
10222
10223 2010-02-24 Doug Kwan <dougkwan@google.com>
10224
10225 * arm.cc (Target_arm::got_section): Make the .got section the first
10226 non RELRO section in the data segment.
10227 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
10228 suffixes of section names.
10229
10230 2010-02-24 Doug Kwan <dougkwan@google.com>
10231
10232 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
10233 flags and attributes merging if an input file is a binary file.
10234 * fileread.cc (Input_file::open): Record format of original file.
10235 * fileread.h (Input_file::Format): New enum type.
10236 (Input_file::Input_file): Initialize data member format_.
10237 (Input_file::format): New method definition.
10238 (Input_file::format_):: New data member.
10239
10240 2010-02-24 Doug Kwan <dougkwan@google.com>
10241
10242 * arm.cc (Arm_output_data_got): New class.
10243 (ARM_TCB_SIZE): New constant
10244 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
10245 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
10246 If user uses a script with a SECTIONS clause, issue only a warning
10247 for a misplaced EXIDX input section. Otherwise, issue an error.
10248 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
10249 garbage collection.
10250 (Target_arm::got_mode_index_entry): Handle static linking.
10251 (Target_arm::Scan::local): Ditto.
10252 (Target_arm::Scan::global): Ditto.
10253 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
10254 all incorrectly implemented relocations.
10255 (Target_arm::fix_exidx_coverage): Pass layout to
10256 Arm_output_section::fix_exidx_coverage.
10257 * layout.cc (Layout::section_name_mapping): Remove trailing dots
10258 from ".ARM.exidx." and ".ARM.extab.".
10259
10260 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10261
10262 * arm.cc (Target_arm::do_finalize_sections): Create attribute
10263 section if it does not already exist.
10264 * attributes.cc (Attributes_section_data::Attributes_section_data):
10265 Don't crash if size is zero.
10266
10267 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10268 Ian Lance Taylor <iant@google.com>
10269
10270 * gold.cc (queue_middle_tasks): If no input files were opened,
10271 exit.
10272 * workqueue.h (Task_function::Task_function): Assert that there is
10273 a blocker.
10274
10275 2010-02-22 Doug Kwan <dougkwan@google.com>
10276
10277 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
10278 * icf.cc (get_section_contents): Cast snprintf arguments to long long
10279 types to avoid warnings due to different uint64_t implementations
10280 on different hosts.
10281
10282 2010-02-21 Doug Kwan <dougkwan@google.com>
10283
10284 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
10285 handling of the maximum backward branch offset.
10286 (Arm_relocate_functions::thumb_branch_common): Ditto.
10287 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
10288 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
10289 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
10290 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
10291 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
10292 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
10293 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
10294 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
10295 thumb_bl_out_of_range thumb_bl_out_of_range.o,
10296 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
10297 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
10298 thumb2_bl_out_of_range.o): New rules.
10299 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
10300 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
10301 thumb2_bl_out_of_range
10302 * testsuite/Makefile.in: Regenerate.
10303 * testsuite/arm_bl_in_range.s: New file.
10304 * testsuite/arm_bl_out_of_range.s: Ditto.
10305 * testsuite/arm_branch_in_range.sh: Ditto.
10306 * testsuite/arm_branch_range.t: Ditto.
10307 * testsuite/thumb2_branch_range.t: Ditto.
10308 * testsuite/thumb_bl_in_range.s: Ditto.
10309 * testsuite/thumb_bl_out_of_range.s: Ditto.
10310 * testsuite/thumb_branch_range.t: Ditto.
10311
10312 2010-02-20 Sriraman Tallam <tmsriram@google.com>
10313
10314 * gc.h (gc_process_relocs): Change vectors to point to the new list.
10315 Add reloc offset information.
10316 * icf.cc (get_section_contents): Change iterators to point to the new
10317 vectors. Add reloc offset information to the contents.
10318 * icf.h (Icf::Sections_reachable_info): New typedef.
10319 (Icf::Sections_reachable_list): New typedef.
10320 (Icf::Offset_info): New typedef.
10321 (Icf::Reloc_info): New struct typedef.
10322 (Icf::Reloc_info_list): New typedef.
10323 (Icf::symbol_reloc_list): Delete method.
10324 (Icf::addend_reloc_list): Delete method.
10325 (Icf::section_reloc_list): Delete method.
10326 (Icf::reloc_info_list): New method.
10327 (Icf::reloc_info_list_): New member.
10328
10329 2010-02-19 Doug Kwan <dougkwan@google.com>
10330
10331 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
10332 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
10333 * arm.cc (Arm_relocation_functions): New forward declaration.
10334 (Target_arm::Target_arm): Initialize new data members
10335 got_mod_index_offset_ and tls_base_symbol_defined_.
10336 (Target_arm::Relocate::relocate_tls): New method.
10337 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
10338 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
10339 New methods.
10340 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
10341 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
10342 (Target_arm::got_mod_index_offset_,
10343 Target_arm::tls_base_symbol_defined_): New data members.
10344 (Target_arm::Scan::local, Target::Scan::global,
10345 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
10346 relocations.
10347
10348 2010-02-18 Doug Kwan <dougkwan@google.com>
10349
10350 * arm.cc (Arm_relobj::find_linked_text_section): New method.
10351 (Arm_relobj::make_exidx_input_section): Pass section index of linked
10352 text section as a parameter becuase some broken tools may not set
10353 the link in section header.
10354 (Target_arm::has_got_section): New method.
10355 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
10356 without any mapping symbol as data only. Remove warning.
10357 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
10358 link in its section header, try to discover the link by inspecting the
10359 REL31 relocation at the beginning of the section.
10360 (Target_arm::Scan::check_non_pic): Report name of offending relocation
10361 in error message.
10362 (Target_arm::Scan::global): Treat any reference to the symbol
10363 _GLOBAL_OFFSET_TABLE_ as a GOT access.
10364
10365 2010-02-12 Sriraman Tallam <tmsriram@google.com>
10366
10367 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
10368 (Scan::global_reloc_may_be_function_pointer): New function.
10369 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10370 (Scan::global_reloc_may_be_function_pointer): New function.
10371 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10372 (Scan::global_reloc_may_be_function_pointer): New function.
10373 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
10374 (Scan::global_reloc_may_be_function_pointer): New function.
10375 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
10376 (Scan::global_reloc_may_be_function_pointer): New function.
10377 (Scan::possible_function_pointer_reloc): New function.
10378 (Target_x86_64::can_check_for_function_pointers): New function.
10379 * gc.h (gc_process_relocs): Scan relocation types to determine if
10380 function pointers were taken for targets that support it.
10381 * icf.cc (Icf::find_identical_sections): Include functions for
10382 folding in safe ICF whose pointer is not taken.
10383 * icf.h (Secn_fptr_taken_set): New typedef.
10384 (fptr_section_id_): New member.
10385 (section_has_function_pointers): New function.
10386 (set_section_has_function_pointers): New function.
10387 (check_section_for_function_pointers): New function.
10388 * options.h: Fix comment for safe ICF option.
10389 * target.h (can_check_for_function_pointers): New function.
10390 * testsuite/Makefile.am: Add icf_safe_so_test test case.
10391 Modify icf_safe_test for X86-64.
10392 * testsuite/Makefile.in: Regenerate.
10393 * testsuite/icf_safe_so_test.cc: New file.
10394 * testsuite/icf_safe_so_test.sh: New file.
10395 * testsuite/icf_safe_test.cc (kept_func_3): New function.
10396 (main): Change to take pointer to function kept_func_3.
10397 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
10398 folding is done correctly for X86-64.
10399
10400 2010-02-12 David S. Miller <davem@davemloft.net>
10401
10402 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
10403 is_symbolless parameter.
10404 (Output_reloc<SHT_REL>::is_symbolless): New.
10405 (Output_reloc<SHT_REL>::is_symbolless_): New.
10406 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
10407 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
10408 (Output_reloc<SHT_RELA>::is_symbolless): New.
10409 (Output_data_reloc::add_global): Handle is_symbolless.
10410 (Output_data_reloc::add_global_relative): Likewise.
10411 (Output_data_reloc::add_local): Likewise.
10412 (Output_data_reloc::add_local_relative): Likewise.
10413 (Output_data_reloc::add_symbolless_global_addend): New.
10414 (Output_data_reloc::add_symbolless_local_addend): New.
10415 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
10416 is_symbolless.
10417 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
10418 instead of ->is_relative_
10419 (Output_reloc::write): Likewise.
10420 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
10421 (Output_reloc::write_rel): Simplify.
10422
10423 * sparc.cc (Target_sparc::Scan::local): Use
10424 ->add_symbolless_local_addend as needed.
10425 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
10426 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
10427 based upon relocation offset.
10428
10429 2010-02-11 Doug Kwan <dougkwan@google.com>
10430
10431 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
10432 (Target_arm::Scan::global): Ditto. Also remove a comment before the
10433 beginning of function.
10434 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
10435 and MOVT_ABS relocations. Those are non issued in scanning. Fix
10436 parameter is_32bit in calls to should_apply_static_reloc.
10437 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
10438 (check_DATA): Add arm_abs_global.stdout.
10439 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
10440 arm_abs_global.stdout): New rules.
10441 (MOSTLLYCLEANFILES): Add arm_abs_global
10442 * Makefile.in: Regenerate.
10443 * testsuite/arm_abs_global.s: New file.
10444 * testsuite/arm_abs_global.sh: Ditto.
10445 * testsuite/arm_abs_lib.s: Ditto.
10446
10447 2010-02-11 Ian Lance Taylor <iant@google.com>
10448
10449 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
10450 Read_relocs task.
10451 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
10452 Allocate_commons_task first.
10453 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
10454 task, rather than symtab_lock_.
10455 (Gc_process_relocs::~Gc_process_relocs): New function.
10456 (Gc_process_relocs::is_runnable): Check this_blocker_.
10457 (Gc_process_relocs::locks): Use next_blocker_ rather than
10458 blocker_.
10459 (Scan_relocs::~Scan_relocs): New function.
10460 (Scan_relocs::is_runnable): Check this_blocker_ rather than
10461 symtab_lock_.
10462 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
10463 next_blocker_.
10464 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
10465 fields. Add this_blocker_ and next_blocker_ fields. Adjust
10466 constructor accordingly.
10467 (class Gc_process_relocs): Likewise.
10468 (class Scan_relocs): Likewise.
10469 * common.h (class Allocate_commons_task): Remove symtab_lock_
10470 field, and corresponding constructor parameter.
10471 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
10472 symtab_lock_.
10473 (Allocate_commons_task::locks): Likewise.
10474
10475 2010-02-11 Ian Lance Taylor <iant@google.com>
10476
10477 * gold-threads.h (class Once): Define.
10478 (class Initialize_lock): Rewrite as child of Once.
10479 * gold-threads.cc (class Once_initialize): Define.
10480 (once_pointer_control): New static variable.
10481 (once_pointer, once_arg): New static variables.
10482 (c_run_once): New static function.
10483 (Once::Once, Once::run_once, Once::internal_run): New functions.
10484 (class Initialize_lock_once): Remove.
10485 (initialize_lock_control): Remove.
10486 (initialize_lock_pointer): Remove.
10487 (initialize_lock_once): Remove.
10488 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
10489 (Initialize_lock::initialize): Rewrite.
10490 (Initialize_lock::do_run_once): New function.
10491 * archive.cc (Archive::interpret_header): Only clear name if it is
10492 not already empty.
10493 * fileread.cc: Include "gold-threads.h"
10494 (file_counts_lock): New static variable.
10495 (file_counts_initialize_lock): Likewise.
10496 (File_read::release): Only increment counts when using --stats.
10497 Use a lock around the increment.
10498 * parameters.cc (class Set_parameters_target_once): Define.
10499 (set_parameters_target_once): New static variable.
10500 (Parameters::Parameters): Move here from parameters.h.
10501 (Parameters::set_target): Rewrite.
10502 (Parameters::set_target_once): New function.
10503 (Parameters::clear_target): Move here and rewrite.
10504 * parameters.h (class Parameters): Update declarations. Add
10505 set_parameters_target_once_ field.
10506 (Parameters::Parameters): Move to parameters.cc.
10507 (Parameters::clear_target): Likewise.
10508 * readsyms.cc (Read_symbols::do_group): Create a Start_group
10509 task.
10510 (Start_group::~Start_group): New function.
10511 (Start_group::is_runnable): New function.
10512 (Start_group::locks, Start_group::run): New functions.
10513 (Finish_group::run): Change saw_undefined to size_t.
10514 * readsyms.h (class Start_group): Define.
10515 (class Finish_group): Change saw_undefined_ field to size_t.
10516 (Finish_group::Finish_group): Remove saw_undefined and
10517 this_blocker parameters. Change all callers.
10518 (Finish_group::set_saw_undefined): New function.
10519 (Finish_group::set_blocker): New function.
10520 * symtab.h (class Symbol_table): Change saw_undefined to return
10521 size_t. Change saw_undefined_ field to size_t.
10522 * target-select.cc (Set_target_once::do_run_once): New function.
10523 (Target_selector::Target_selector): Initialize set_target_once_
10524 field. Don't initialize lock_ and initialize_lock_ fields.
10525 (Target_selector::instantiate_target): Rewrite.
10526 (Target_selector::set_target): New function.
10527 * target-select.h (class Set_target_once): Define.
10528 (class Target_selector): Update declarations. Make
10529 Set_target_once a friend. Remove lock_ and initialize_lock_
10530 fields. Add set_target_once_ field.
10531
10532 2010-02-10 Ian Lance Taylor <iant@google.com>
10533
10534 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
10535 queueing any tasks.
10536 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
10537 (queue_middle_tasks): Add all blockers before queueing any tasks.
10538 (queue_final_tasks): Likewise.
10539 * token.h (Task_token::add_blockers): New function.
10540 * object.h (Input_objects::number_of_relobjs): New function.
10541
10542 2010-02-10 Ian Lance Taylor <iant@google.com>
10543
10544 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
10545 shared, not if not position independent.
10546 * x86_64.cc (Relocate::relocate_tls): Likewise.
10547 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
10548 (tls_pie_pic_test): New target.
10549 * testsuite/Makefile.in: Rebuild.
10550
10551 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
10552 (tls_test_main_pie.o, tls_test_pie.o): New targets.
10553 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
10554 * testsuite/Makefile.in: Rebuild.
10555
10556 2010-02-09 David S. Miller <davem@davemloft.net>
10557
10558 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
10559 R_SPARC_RELATIVE using ->add_local_relative().
10560 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
10561
10562 * output.h (Output_data_dynamic::add_section_size): New method
10563 that takes two Output_data objects.
10564 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
10565 entry param. Handle it in initializers.
10566 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
10567 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
10568 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
10569 arg.
10570 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
10571 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
10572 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
10573 for dynrel_includes_plt.
10574 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10575 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10576 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
10577 before .rela.plt
10578 (Target_sparc::do_finalize_sections): Update to pass true for
10579 dynrel_includes_plt.
10580 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
10581 output before .rela.plt
10582 (Target_powerpc::do_finalize_sections): Update to pass true for
10583 dynrel_includes_plt when 32-bit.
10584
10585 2010-02-08 Doug Kwan <dougkwan@google.com>
10586
10587 * arm.cc (Arm_relobj::simple_input_section_output_address): New
10588 method.
10589 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
10590 Arm_relobj::scan_section_for_cortex_a8_stubs,
10591 Arm_relobj::do_relocation_section): Instead of calling
10592 Output_section::output_address, use faster
10593 Arm_relobj::simple_input_section_output_address.
10594
10595 2010-02-08 David S. Miller <davem@davemloft.net>
10596
10597 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
10598 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
10599 relocation helper function.
10600
10601 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
10602 just like R_SPARC_GOT{10,13,22}.
10603 (Target_sparc::Scan::local): Likewise.
10604 (Target_sparc::Relocate:relocate): Likewise.
10605
10606 2010-02-06 Ian Lance Taylor <iant@google.com>
10607
10608 * configure.ac: Rewrite targetobjs duplicate removal code to use
10609 only shell constructs.
10610 * configure: Rebuild.
10611
10612 2010-02-05 Doug Kwan <dougkwan@google.com>
10613
10614 PR 11247
10615 * arm.cc (Arm_relobj::section_is_scannable): New method.
10616 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
10617 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
10618
10619 2010-02-04 Doug Kwan <dougkwan@google.com>
10620
10621 PR 11247
10622 * arm-reloc-property.cc (cstdio): Include.
10623 * configure.ac (targetobjs): Remove duplicates.
10624 * configure: Regenerate.
10625 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
10626 big and little endian version for a given address size.
10627
10628 2010-02-03 Doug Kwan <dougkwan@google.com>
10629
10630 * arm-reloc-property.cc
10631 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10632 definition.
10633 * arm-reloc-property.h
10634 (Arm_reloc_property_table::get_implemented_static_reloc_property):
10635 New method definition.
10636 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10637 declaration.
10638 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
10639 overflow to N.
10640 (GOT_PREL): Change implemented to Y.
10641 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
10642 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
10643 (Arm_relocate_functions::movw_abs_nc): Remove method.
10644 (Arm_relocate_functions::movt_abs): Ditto.
10645 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
10646 (Arm_relocate_functions::thm_movt_abs): Ditto.
10647 (Arm_relocate_functions::movw_rel_nc): Ditto.
10648 (Arm_relocate_functions::movw_rel): Ditto.
10649 (Arm_relocate_functions::movt_rel): Ditto.
10650 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
10651 (Arm_relocate_functions:thm_movw_rel): Ditto.
10652 (Arm_relocate_functions:thm_movt_rel): Ditto.
10653 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
10654 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
10655 New method definitions.
10656 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
10657 (Arm_relocation_functions::arm_grp_ldr): Ditto.
10658 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
10659 (Arm_relocation_functions::arm_grp_ldc): Ditto.
10660 (Target_arm::Relocate::relocate): Check for non-static or
10661 unimplemented relocation code and exit early. Change calls to
10662 Target_arm::reloc_uses_thumb_bit and
10663 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
10664 instead. Refactor code to handle similar relocations to increase
10665 code sharing. Remove check for unsupported relocation code in switch
10666 statement.
10667 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
10668 relocation property table to find out size. Change error message to
10669 print out the name of a relocation code instead of the numeric value.
10670 (Target_arm::scan_reloc_for_stub): Use relocation property table
10671 instead of calling Target_arm::reloc_uses_thumb_bit().
10672
10673 2010-02-02 Doug Kwan <dougkwan@google.com>
10674
10675 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
10676 types of relaxed input section.
10677
10678 2010-02-02 Doug Kwan <dougkwan@google.com>
10679
10680 * Makefile.am (HFILES): Add arm-reloc-property.h.
10681 (DEFFILES): New.
10682 (TARGETSOURCES): Add arm-reloc-property.cc
10683 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
10684 (libgold_a_SOURCES): $(DEFFILES)
10685 * Makefile.in: Regenerate.
10686 * arm-reloc-property.cc: New file.
10687 * arm-reloc-property.h: New file.
10688 * arm-reloc.def: New file.
10689 * arm.cc: Update comments.
10690 (arm-reloc-property.h): New included header.
10691 (arm_reloc_property_table): New global variable.
10692 (Target_arm::do_select_as_default_target): New method definition.
10693 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
10694 arm-reloc-property to targ_extra_obj.
10695 * parameters.cc (set_parameters_target): Call
10696 Target::select_as_default_target().
10697 * target.h (Target::select_as_default_target): New method definition.
10698 (Target::do_select_as_default_target): Same.
10699
10700 2010-02-01 Doug Kwan <dougkwan@google.com>
10701
10702 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
10703 first_output_text_section_.
10704 (Arm_exidx_fixup::first_output_text_section): New method definition.
10705 (Arm_exidx_fixup::first_output_text_section_): New data member.
10706 (Arm_exidx_fixup::process_exidx_section): Record the first text
10707 output section seen.
10708 (Arm_output_section::fix_exidx_coverage): Set correct linked section
10709 and entsize in output section header.
10710
10711 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10712
10713 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
10714 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
10715 (Arm_relocate_functions::thm_alu11): New Method.
10716 (Arm_relocate_functions::thm_pc8): New Method.
10717 (Arm_relocate_functions::thm_pc12): New Method.
10718 (Target_arm::Scan::local): Handle the relocations.
10719 (Target_arm::Scan::global): Likewise.
10720 (Target_arm::Relocate::relocate): Likewise.
10721 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10722
10723 2010-01-29 Doug Kwan <dougkwan@google.com>
10724
10725 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
10726 of relocation types as ld.
10727
10728 2010-01-29 Doug Kwan <dougkwan@google.com>
10729
10730 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
10731 to public.
10732 (Arm_relocate_functions::thumb_branch_common): Ditto.
10733 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
10734 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
10735 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
10736 Arm_relocate_functions::jump24): Remove.
10737 (Target_arm::Relocate::relocate): Adjust code to call
10738 Arm_relocation_functions::arm_branch_common and
10739 Arm_relocation_functions::thumb_branch_common instead of their removed
10740 wrappers. Merge switch-cases together to reduce source code size.
10741
10742 2010-01-29 Doug Kwan <dougkwan@google.com>
10743
10744 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
10745 output_local_symbol_count_needs_update_.
10746 (Arm_relobj::output_local_symbol_count_needs_update,
10747 Arm_relobj::set_output_local_symbol_count_needs_update,
10748 Arm_relobj::update_output_local_symbol_count): New methods.
10749 (Arm_relobj::output_local_symbol_count_needs_update_): New data
10750 member.
10751 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
10752 of pointed function as in a R_ARM_PREL31 relocation.
10753 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
10754 for output local symbol count updating.
10755 (Target_arm::do_relax): Update output local symbol counts in objects
10756 if necessary.
10757 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
10758
10759 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10760
10761 * arm.cc: Added support for the ARM relocations:
10762 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
10763 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
10764 (Arm_relocate_functions::movw_rel_nc): Renamed (was
10765 movw_prel_nc).
10766 (Arm_relocate_functions::movw_rel): New method.
10767 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
10768 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
10769 thm_movw_prel_nc).
10770 (Arm_relocate_functions::thm_movw_rel): New method.
10771 (Arm_relocate_functions::thm_movt_rel): Renamed (was
10772 thm_movt_prel).
10773 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
10774 relocations.
10775 (Target_arm::Scan::global): Likewise.
10776 (Target_arm::Relocate::relocate): Likewise.
10777 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10778 Likewise.
10779
10780 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10781
10782 * arm.cc: Added support for ARM group relocations.
10783 (Target_arm::reloc_needs_sym_origin): New method.
10784 (Arm_relocate_functions::calc_grp_kn): New method.
10785 (Arm_relocate_functions::calc_grp_residual): New method.
10786 (Arm_relocate_functions::calc_grp_gn): New method.
10787 (Arm_relocate_functions::arm_grp_alu): New Method.
10788 (Arm_relocate_functions::arm_grp_ldr): New Method.
10789 (Arm_relocate_functions::arm_grp_ldrs): New Method.
10790 (Arm_relocate_functions::arm_grp_ldc): New Method.
10791 (Target_arm::Scan::local): Handle the ARM group relocations.
10792 (Target_arm::Scan::global): Likewise.
10793 (Target_arm::Relocate::relocate): Likewise.
10794 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10795 Likewise.
10796
10797 2010-01-26 Doug Kwan <dougkwan@google.com>
10798
10799 * arm.cc (set): Include.
10800 (class Arm_exidx_fixup): Change type of last_input_section_ to const
10801 pointer type.
10802 (Arm_output_section::Text_section_list): New type.
10803 (Arm_output_section::append_text_sections_to_list): New method.
10804 (Arm_output_section::fix_exidx_coverage): Ditto.
10805 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
10806 (Arm_relobj::convert_input_section_to_relaxed_section): Use
10807 Relobj::set_section_offset() instead of
10808 Sized_relobj::invalidate_section_offset().
10809 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
10810 parameter for section headers. Ignore relocation sections for
10811 unallocated sections and EXIDX sections.
10812 (Target_arm::fix_exidx_coverage): New method.
10813 (Target_arm::output_section_address_less_than): New type.
10814 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
10815 linked text section instead of the EXIDX section.
10816 (Arm_output_section::create_stub_group): Add an assertion to check
10817 that this is not an EXIDX output section.
10818 (Arm_output_section::append_text_sections_to_list): New method.
10819 (Arm_output_section::fix_exidx_coverage): Ditto.
10820 (Arm_relobj::scan_sections_for_stubs): Adjust call to
10821 Arm_relobj::section_needs_reloc_stub_scanning.
10822 (Target_arm::do_relax): Fix EXIDX output section coverage in the
10823 first pass.
10824 (Target_arm::fix_exidx_coverage): New method.
10825 * object.h (Relobj::set_output_section): New method.
10826 (Sized_relobj::invalidate_section_offset): Remove method.
10827 (Sized_relobj::do_invalidate_section_offset): Remove method.
10828 (Sized_relobj::do_set_section_offset): Handle offset value -1.
10829
10830 2010-01-25 Doug Kwan <dougkwan@google.com>
10831
10832 * arm.cc (Arm_exidx_merged_section::do_output_offset):
10833 Fix warning due to signed and unsigned comparison on a 32-bit host.
10834
10835 2010-01-22 Doug Kwan <dougkwan@google.com>
10836
10837 * arm.cc (Target_arm::do_relax): Record an output section for section
10838 offset adjustment it contains any stub table that has changed.
10839 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
10840 offsets in an output section if necessary.
10841 * output.cc (Output_section::Output_section): Initialize
10842 section_offsets_need_adjustments_.
10843 (Output_section::add_input_section_for_script): Renamed to
10844 Output_section::add_simple_input_section.
10845 (Output_section::save_states): Add a comment.
10846 (Output_section::discard_states): New method defintion.
10847 (Output_section::adjust_section_offsets): Same.
10848 * output.h (Output_section::add_input_section_for_script): Renamed to
10849 Output_section::add_simple_input_section.
10850 (Output_section::discard_states): New method declaration.
10851 (Output_section::adjust_section_offsets): Same.
10852 (Output_section::section_offsets_need_adjustment,
10853 Output_section::set_section_offsets_need_adjustment): New method
10854 definitions.
10855 (Output_section::section_offsets_need_adjustment_): New data member.
10856 * script-sections.cc
10857 (Output_section_element_input::set_section_address): Adjust code for
10858 renaming of Output_section::add_input_section_for_script.
10859 (Orphan_output_section::set_section_address): Same.
10860
10861 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10862
10863 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
10864 Fix_v4bx enum values .
10865 * gold/options.h (General_options): New option definitions.
10866 (General_options::fix_v4bx): New method.
10867 (General_options::Fix_v4bx): New enum.
10868 * gold/options.cc (General_options::parse_fix_v4bx): New method.
10869 (General_options::parse_fix_v4bx_interworking): New method.
10870
10871 2010-01-22 Doug Kwan <dougkwan@google.com>
10872
10873 * arm.cc (Arm_exidx_fixup): New class.
10874
10875 2010-01-21 Doug Kwan <dougkwan@google.com>
10876
10877 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
10878 classes.
10879 (Arm_exidx_section_offset_map): New type.
10880
10881 2010-01-21 Doug Kwan <dougkwan@google.com>
10882
10883 * arm.cc (Arm_exidx_input_section): New class.
10884 (Arm_relobj::exidx_input_section_by_link,
10885 Arm_relobj::exidx_input_section_by_shndx,
10886 Arm_relobj::make_exidx_input_section): New methods.
10887 (read_arm_attributes_section): Remove.
10888 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
10889 information about them.
10890 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
10891 to here.
10892
10893 2010-01-20 Doug Kwan <dougkwan@google.com>
10894
10895 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
10896 Input_section_specifier to Section_id.
10897 (Target_arm::new_arm_input_section: Adjust code for change of key
10898 type.
10899 (Target_arm::find_arm_input_section): Ditto.
10900 * gc.h (object.h): Include for Section_id nand Section_id_hash.
10901 (Section_id): Remove.
10902 (Garbage_collection::Section_id_hash): Remove.
10903 * icf.h (object.h): Include for Section_id nand Section_id_hash.
10904 (Section_id): Remove.
10905 (Icf::Section_id_hash): Remove.
10906 * object.h (Section_id, Const_section_id, Section_id_hash,
10907 Const_section_id_hash): New type definitions.
10908 * output.cc (Output_section::add_relaxed_input_section): Change to
10909 use Const_section_id instead of Input_section_specifier as key type.
10910 (Output_section::add_merge_input_section): Ditto.
10911 (Output_section::build_relaxation_map): Change to use Section_id
10912 instead of Input_section_specifier as key type.
10913 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
10914 Ditto.
10915 (Output_section::convert_input_sections_to_relaxed_sections): Change
10916 to use Const_section_id instead of Input_section_specifier as key type.
10917 (Output_section::find_merge_section): Ditto.
10918 (Output_section::find_relaxed_input_section): Ditto.
10919 * output.h (Input_section_specifier): Remove class.
10920 (Output_section::Output_section_data_by_input_section_map): Change
10921 key type to Const_section_id.
10922 (Output_section::Output_relaxed_input_section_by_input_section_map):
10923 Ditto.
10924 (Output_section::Relaxation_map): Change key type to Section_id.
10925
10926 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10927
10928 * gold/arm.cc: Added support for R_ARM_V4BX relocation
10929 (class Arm_v4bx_stub): New class.
10930 (DEF_STUBS): Updated definition to support v4_veneer_bx.
10931 (Stub_factory::make_arm_v4bx_stub): New method.
10932 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
10933 (Stub_table::empty): Handle v4bx stubs.
10934 (Stub_table::add_arm_v4bx_stub): New method.
10935 (Stub_table::find_arm_v4bx_stub): New method.
10936 (Arm_relocate_functions::v4bx): New method.
10937 (Target_arm::fix_v4bx): New method.
10938 (Target_arm::Target_arm): Handle R_ARM_V4BX.
10939 (Stub_table::relocate_stubs): Likewise.
10940 (Stub_table::do_write): Likewise.
10941 (Stub_table::update_data_size_and_addralign): Likewise.
10942 (Stub_table::finalize_stubs): Likewise.
10943 (Target_arm::Scan::local): Likewise.
10944 (Target_arm::Scan::global): Likewise.
10945 (Target_arm::do_finalize_sections): Likewise.
10946 (Target_arm::Relocate::relocate): Likewise.
10947 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10948 Likewise.
10949 (Target_arm::scan_reloc_for_stub): Likewise.
10950 (Target_arm::scan_reloc_section_for_stubs): Likewise.
10951
10952 2010-01-19 Ian Lance Taylor <iant@google.com>
10953
10954 * output.cc (Output_section_headers::do_sized_write): Write large
10955 segment count to sh_info field.
10956 (Output_file_header::do_sized_write): For large segment count,
10957 write PN_XNUM to e_phnum field.
10958
10959 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10960
10961 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
10962 (Arm_relocate_functions::thm_jump8): New function.
10963 (Arm_relocate_functions::thm_jump11): New function.
10964 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
10965 R_ARM_THM_JUMP11.
10966 (Target_arm::Scan::global): Likewise.
10967 (Target_arm::Relocate::relocate): Likewise.
10968 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10969 Likewise.
10970
10971 2010-01-14 Doug Kwan <dougkwan@google.com>
10972
10973 * arm.cc (map, utility): Include headers.
10974 (Target_arm::apply_cortex_a8_workaround): New method.
10975 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
10976 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
10977 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
10978 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
10979 the --[no-]fix-cortex-a8 command line options.
10980 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
10981 (Target_arm::relocate_stub): Use addend in instruction template.
10982 * options.h (DEFINE_bool): Set the user-set flag.
10983 (General_options): Add --[no-]-fix-cortex options.
10984 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
10985 : Update fast look-up map after conversion.
10986
10987 2010-01-14 Sriraman Tallam <tmsriram@google.com>
10988
10989 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
10990 in the first pass of do_layout.
10991
10992 2010-01-13 Doug Kwan <dougkwan@google.com>
10993
10994 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10995 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
10996 apparent compiler problem of not folding static constant integral
10997 data members of elfcpp::Elf_sizes<32>.
10998
10999 2010-01-13 Doug Kwan <dougkwan@google.com>
11000
11001 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11002 Arm_relobj::section_needs_cortex_a8_stub_scanning,
11003 Arm_relobj::scan_section_for_cortex_a8_erratum,
11004 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
11005 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
11006 sections to scan for relocation stubs into a new method
11007 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
11008 relocation and Cortex-A8 stub scanning.
11009 (Target_arm::do_relax): Force stubs to be after stubbed sections
11010 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
11011 the beginning of a new relaxation pass. Update a comment.
11012 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
11013
11014 2010-01-12 Ian Lance Taylor <iant@google.com>
11015
11016 * target-reloc.h (visibility_error): New inline function.
11017 (relocate_section): Call visibility_error.
11018 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
11019 (MOSTLYCLEANFILES): Likewise.
11020 (protected_4_pic.o, protected_3.err): New targets.
11021 * testsuite/protected_4.cc: New file.
11022
11023 2010-01-12 Doug Kwan <dougkwan@google.com>
11024
11025 * arm.cc (Cortex_a8_reloc): New class.
11026 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
11027 and cortex_a8_relocs_info_.
11028 (Target_arm::fix_cortex_a8): New method definition.
11029 (Target_arm::Cortex_a8_relocs_info): New type.
11030 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
11031 New data member declarations.
11032 (Target_arm::scan_reloc_for_stub): Record information about
11033 relocations for THUMB branches that might be exempted from the
11034 Cortex-A8 workaround.
11035 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
11036 at the beginning of a relaxation pass.
11037
11038 2010-01-12 Doug Kwan <dougkwan@google.com>
11039
11040 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
11041 (Arm_relobj::Mapping_symbol_position,
11042 Arm_reloj::Mapping_symbol_position_less,
11043 Arm_relobj::Mapping_symbols_info): New types.
11044 (Target_arm::is_mapping_symbol_name): New method definition.
11045 (Arm_relobj::do_count_local_symbols): Save information about mapping
11046 symbols.
11047
11048 2010-01-11 Doug Kwan <dougkwan@google.com>
11049
11050 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
11051 Arm_relocate_functions::thumb32_branch_upper,
11052 Arm_relocate_functions::thumb32_branch_lower,
11053 Arm_relocate_functions::thumb32_cond_branch_offset,
11054 Arm_relocate_functions::thumb32_cond_branch_upper,
11055 Arm_relocate_functions::thumb32_cond_branch_lower,
11056 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
11057 branch offset encoding.
11058 (Arm_relocate_functions::thumb_branch_common): Use new branch
11059 offset encoding methods to avoid code duplication.
11060 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
11061 (Stub_addend_reader::operator()): Use new branch encoding method
11062 to avoid code duplication.
11063
11064 2010-01-11 Doug Kwan <dougkwan@google.com>
11065
11066 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
11067 (Target_arm::do_finalize_sections): Define special EXIDX section
11068 symbols only if referenced.
11069 * gc.h (Garbage_collection::add_reference): New method.
11070 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
11071 code duplication.
11072
11073 2010-01-11 Ian Lance Taylor <iant@google.com>
11074
11075 * script.cc (Version_script_info::build_expression_list_lookup):
11076 Change complaing about duplicate wildcard match from error to
11077 warning.
11078
11079 * script.cc (class Lazy_demangler): Recreate--revert part of patch
11080 of 2009-12-30.
11081 (Version_script_info::Version_script_info): Initialize globs_,
11082 default_version_, default_is_global_, and exact_. Don't
11083 initialize globals_ or locals_.
11084 (Version_script_info::build_lookup_tables): Build local symbols
11085 first.
11086 (Version_script_info::unquote): New function.
11087 (Version_script_info::add_exact_match): New function.
11088 (Version_script_info::build_expression_list_lookup): Remove lookup
11089 parameter. Add is_global parameter. Change all callers. Handle
11090 wildcard pattern specially. Unquote pattern. Call
11091 add_exact_match.
11092 (Version_script_info::get_name_to_match): New function.
11093 (Version_script_info::get_symbol_version): New function.
11094 (Version_script_info::get_symbol_version_helper): Remove.
11095 (Version_script_info::check_unmatched_names): Call unquote.
11096 * script.h (class Version_script_info): Change get_symbol_version
11097 to be non-inline and add is_global parameter; change all callers.
11098 Rewrite symbol_is_local. Update declarations. Define struct
11099 Version_tree_match, Exact, Globs. Don't define struct Lookup.
11100 Remove globals_ and locals_ members. Add exact_, globs_,
11101 default_version_, is_global_.
11102 (Version_script_info::Glob): Remove pattern, add expression and
11103 is_global. Update constructor. Change all callers.
11104 * dynobj.cc (Versions::finalize): Mark the version symbol as the
11105 default version.
11106 (Versions::symbol_section_contents): If a symbol is undefined, or
11107 defined in a dynamic object, set the version index to
11108 VER_NDX_LOCAL.
11109 * symtab.cc (Symbol_table::add_from_relobj): Don't call
11110 symbol_is_local.
11111 (Symbol_table::add_from_pluginobj): Likewise.
11112 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
11113
11114 2010-01-11 Doug Kwan <dougkwan@google.com>
11115
11116 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
11117 (incremental_dump_LDADD): Add linking option for libintl.
11118 * Makefile.in: Regenerate.
11119
11120 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
11121
11122 PR gold/11144
11123 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
11124 instead of -Ds.
11125 * testsuite/Makefile.in: Regenerated.
11126
11127 2010-01-10 Doug Kwan <dougkwan@google.com>
11128
11129 * options.h (DEFINE_var): Use parentheses around argument varname__
11130 in macro body to avoid any unintended subsequent substitutions.
11131
11132 2010-01-10 Ian Lance Taylor <iant@google.com>
11133
11134 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
11135 candidates before doing symbol resolution.
11136
11137 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
11138 ODR candidates if only one is weak.
11139
11140 2010-01-08 Ian Lance Taylor <iant@google.com>
11141
11142 * script.cc (Version_script_info::build_expression_list_lookup):
11143 Don't warn about ambiguous version, just record the ambiguity.
11144 (Version_script_info::get_symbol_version_helper): Give error if
11145 version is ambiguous.
11146
11147 2010-01-08 Doug Kwan <dougkwan@google.com>
11148
11149 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
11150 prev_data_size_ and prev_addralign_. Remove initializer for
11151 deleted data member has_been_changed_.
11152 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
11153 to determine if the table is empty.
11154 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
11155 Remove.
11156 (Stub_table::add_reloc_stub): Define method in class definition
11157 instead of just declaring it there.
11158 (Stub_table::add_cortex_a8_stub): New method definition.
11159 (Stub_table::update_data_size_and_addralign): Ditto.
11160 (Stub_table::finalize_stubs): Ditto.
11161 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
11162 (Stub_table::do_addralign_): Return address alignment in the
11163 (Stub_table::do_reset_address_and_file_offset): Define method in
11164 class definition instead of declaring it there. Set current data
11165 size to be the data size of the previous pass.
11166 (Stub_table::set_final_data_size): Use current data size as the
11167 final data size.
11168 (Stub_table::relocate_stub): Change parameter type of stub from
11169 Reloc_stub pointer to Stub pointer.
11170 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
11171 (Stub_table::Cortex_a8_stub_list): New typedef.
11172 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
11173 Stub_table::prev_addralign_): New data member.
11174 (Arm_relobj::Arm_relobj): Initialize data member
11175 section_has_cortex_a8_workaround_.
11176 (Arm_relobj::section_has_cortex_a8_workaround,
11177 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
11178 definitions.
11179 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
11180 declarations.
11181 (Target_arm::relocate_stub): Change parameter type of stub from
11182 Reloc_stub pointer to Stub pointer.
11183 (Insn_template::size, Insn_template::alignment): Handle
11184 THUMB16_SPECIAL_TYPE.
11185 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
11186 Stub_table::update_data_size_and_addralign,
11187 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
11188 definitions.
11189 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
11190 (Stub_table::do_write): Ditto.
11191 (Target_arm::do_relax): Adjust code for changes in Stub_table.
11192
11193 2010-01-08 Ian Lance Taylor <iant@google.com>
11194
11195 PR 11108
11196 * symtab.h (class Symbol): Remove fields is_target_special_ and
11197 has_plt_offset_. Add field is_defined_in_discarded_section_.
11198 (Symbol::is_defined_in_discarded_section): New function.
11199 (Symbol::set_is_defined_in_discarded_section): New function.
11200 (Symbol::has_plt_offset): Rewrite.
11201 (Symbol::set_plt_offset): Verify that new offset is not -1U.
11202 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
11203 Don't initialize is_target_special_ or has_plt_offset_.
11204 Initialize is_defined_in_discarded_section_.
11205 (Symbol_table::add_from_relobj): If appropriate, set
11206 is_defined_in_discarded_section.
11207 * resolve.cc (Symbol::override_base_with_special): Don't test
11208 is_target_special_. Change has_plt_offset_ to has_plt_offset().
11209 * target-reloc.h (relocate_section): Do special handling for
11210 symbols defined in discarded sections for global symbols as well
11211 as local symbols.
11212
11213 2010-01-08 Ian Lance Taylor <iant@google.com>
11214
11215 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
11216 the SHT_SYMTAB case.
11217
11218 2010-01-08 Ian Lance Taylor <iant@google.com>
11219
11220 * object.cc (Sized_relobj::do_layout): Don't get confused if
11221 layout_eh_frame returns NULL.
11222
11223 2010-01-08 Ian Lance Taylor <iant@google.com>
11224
11225 PR 11084
11226 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
11227 dynamic symbol table, use the normal symbol table.
11228 (Sized_dynobj::do_read_symbols): Remove assertion about type of
11229 symbol table.
11230
11231 2010-01-08 Ian Lance Taylor <iant@google.com>
11232
11233 PR 11072
11234 * layout.cc (Layout::include_section): Remove .gnu_debuglink
11235 sections.
11236
11237 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
11238
11239 * version.cc (print_version): Change to "Copyright 2010".
11240
11241 2010-01-08 Ian Lance Taylor <iant@google.com>
11242
11243 PR 10287
11244 PR 11063
11245 * i386.cc (class Target_i386): Change return type of plt_section
11246 to be non-const.
11247 (class Output_data_plt_i386): Add tls_desc_rel_ field.
11248 (Output_data_plt_i386::Output_data_plt_i386): Initialize
11249 tls_desc_rel_ field.
11250 (Output_data_plt_i386::rel_tls_desc): New function.
11251 (Target_i386::rel_tls_desc_section): New function.
11252 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
11253 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
11254 R_386_TLS_DESC reloc in rel_tls_desc_section.
11255 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
11256 Define struct Tlsdesc_info.
11257 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
11258 (Target_x86_64::do_reloc_symbol_index): New function.
11259 (Target_x86_64::add_tlsdesc_info): New function.
11260 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
11261 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
11262 tlsdesc_rel_ field.
11263 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
11264 all callers.
11265 (Output_data_plt_x86_64::rela_tlsdesc): New function.
11266 (Target_x86_64::rela_tlsdesc_section): New function.
11267 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
11268 handling.
11269 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
11270 (Target_x86_64::do_reloc_addend): New function.
11271 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
11272 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
11273 declarations. Define TARGET_CODE. Add arg field to u1_ union.
11274 (Output_reloc::type): New function.
11275 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
11276 (Output_reloc::is_target_specific): New function.
11277 (Output_reloc::target_arg): New function.
11278 (class Output_reloc) [SHT_RELA]: Add four new constructors for
11279 absolute relocs and target specific relocs.
11280 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
11281 add_target_specific.
11282 (class Output_data_reloc) [SHT_RELA]: Likewise.
11283 * output.cc (Output_reloc::Output_reloc): Add four new versions
11284 for absolute relocs and target specific relocs.
11285 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
11286 (Output_reloc::get_symbol_index): Likewise.
11287 (Output_reloc::local_section_offset): Check that local_sym_index_
11288 is not TARGET_CODE or 0.
11289 (Output_reloc::symbol_value): Likewise.
11290 (Output_reloc::write) [SHT_RELA]: Call target for target specific
11291 reloc.
11292 * target.h (class Target): Add reloc_symbol_index and reloc_addend
11293 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
11294 functions.
11295 * layout.cc (add_target_dynamic_tags): Use output section for
11296 DT_PLTRELSZ and DT_JMPREL.
11297
11298 2010-01-07 Ian Lance Taylor <iant@google.com>
11299
11300 PR 11061
11301 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
11302 function.
11303 (class Output_data_reloc_generic): Define.
11304 (class Output_data_reloc_base): Change base class to
11305 Output_data_reloc_generic. Change add() method to call
11306 bump_relative_reloc_count for a relative reloc. Remove
11307 sort_relocs_ field.
11308 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
11309 to sort_relocs().
11310 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
11311 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
11312 appropriate.
11313 * layout.h (class Layout): Update declaration.
11314
11315 2010-01-07 Ian Lance Taylor <iant@google.com>
11316
11317 * output.h (class Output_data): Add const version of
11318 output_section and do_output_section.
11319 (class Output_section_data): Add const version of
11320 do_output_section.
11321 (class Output_section): Likewise.
11322 * layout.cc (Layout::add_target_dynamic_tags): New function.
11323 * layout.h (class Layout): Update declarations.
11324 * arm.cc (Target_arm::do_finalize_sections): Use
11325 add_target_dynamic_tags.
11326 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11327 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11328 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11329 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11330
11331 2010-01-07 Ian Lance Taylor <iant@google.com>
11332
11333 PR 11042
11334 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
11335 object as needed.
11336
11337 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
11338 Ian Lance Taylor <iant@google.com>
11339
11340 PR 11019
11341 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
11342 Xindex::read_symtab_xindex.
11343
11344 2010-01-07 Doug Kwan <dougkwan@google.com>
11345
11346 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
11347 (Insn_template::thumb16_bcond_insn): New method declaration.
11348 (Insn_template): Fix spelling.
11349 (Stub::thumb16_special): New method declaration.
11350 (Stub::do_write): Define virtual method which was previously pure
11351 virtual.
11352 (Stub::do_thumb16_special): New method declaration.
11353 (Stub::do_fixed_endian_write): New template member.
11354 (Reloc_stub::do_write): Remove.
11355 (Reloc_stub::do_fixed_endian_write): Remove.
11356 (Cortex_a8_stub): New class definition.
11357 (Stub_factory::make_cortex_a8_stub): New method definition.
11358 (Stub_factory::Stub_factory): Add missing static storage class
11359 qualifier for elf32_arm_stub_a8_veneer_blx.
11360
11361 2010-01-07 Ian Lance Taylor <iant@google.com>
11362
11363 PR 10980
11364 * options.h (class General_options): Add --warn-unresolved-symbols
11365 and --error-unresolved-symbols.
11366 * errors.cc (Errors::undefined_symbol): Implement
11367 --warn-unresolved-symbols.
11368
11369 * options.h (class General_options): Add -z text and -z textoff.
11370 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
11371
11372 2010-01-06 Sriraman Tallam <tmsriram@google.com>
11373
11374 * gc.h (Garbage_collection::Cident_section_map): New typedef.
11375 (Garbage_collection::cident_sections): New function.
11376 (Garbage_collection::add_cident_section): New function.
11377 (Garbage_collection::cident_sections_): New member.
11378 (gc_process_relocs): Add references to sections whose names are C
11379 identifiers.
11380 * gold.h (cident_section_start_prefix): New constant.
11381 (cident_section_stop_prefix): New constant.
11382 (is_cident): New function.
11383 * layout.cc (Layout::define_section_symbols): Replace string constants
11384 with the newly defined constants.
11385 * object.cc (Sized_relobj::do_layout): Track sections whose names are
11386 C identifiers.
11387 * testsuite/Makefile.am: Add gc_orphan_section_test.
11388 * testsuite/Makefile.in: Regenerate.
11389 * testsuite/gc_orphan_section_test.cc: New file.
11390 * testsuite/gc_orphan_section_test.sh: New file.
11391
11392 2010-01-06 Ian Lance Taylor <iant@google.com>
11393
11394 PR 10980
11395 * options.h (class General_options): Add --warn-shared-textrel.
11396 * layout.cc (Layout::finish_dynamic_section): Implement
11397 --warn-shared-textrel.
11398
11399 PR 10980
11400 * options.h (class General_options): Add --warn-multiple-gp.
11401
11402 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11403
11404 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
11405 $(THREADSLIB) and $(LIBDL).
11406 * Makefile.in: Rebuild.
11407
11408 2010-01-06 Ian Lance Taylor <iant@google.com>
11409
11410 PR 10980
11411 * options.cc (General_options::parse_section_start): New function.
11412 (General_options::section_start): New function.
11413 (General_options::General_options): Initialize all members.
11414 * options.h: Include <map>
11415 (class General_options): Add --section-start. Add section_starts_
11416 member.
11417 * layout.cc (Layout::attach_allocated_section_to_segment): If
11418 --section-start was used, set the address of the segment. Remove
11419 local sort_sections.
11420 (Layout::relaxation_loop_body): If the address of the load segment
11421 has been set by --section-start, don't use it.
11422 * output.h (Output_segment::update_flags_for_output_section): New
11423 function.
11424 * output.cc (Output_segment::add_output_section): Call
11425 update_flags_for_output_section.
11426
11427 2010-01-05 Ian Lance Taylor <iant@google.com>
11428
11429 PR 10980
11430 * options.h (class General_options): Add --undefined-version.
11431 * script.cc (struct Version_expression): Add was_matched_by_symbol
11432 field.
11433 (Version_script_info::matched_symbol): New function.
11434 (Version_script_info::get_symbol_version_helper): Call
11435 matched_symbol.
11436 (Version_script_info::check_unmatched_names): New function.
11437 * script.h (class Version_script_info): Update declarations.
11438 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
11439
11440 * options.h (class General_options): Use DEFINE_bool_alias for
11441 allow_multiple_definition.
11442 * resolve.cc (Symbol_table::should_override): Don't test
11443 allow_multiple_definition.
11444
11445 PR 10980
11446 * options.h (class General_options): Add --cref.
11447 * main.cc (main): Print cref table if --cref. Don't close mapfile
11448 until after printing cref table.
11449 * cref.cc: Include "symtab.h".
11450 (class Cref_inputs): Define Cref_table_compare and Cref_table.
11451 (Cref_table_compare::operator()): New function.
11452 (Cref_inputs::gather_cref): New function.
11453 (filecol): New static const.
11454 (Cref_inputs::print_cref): New function.
11455 (Cref::print_cref): New function.
11456 * cref.h: Include <cstdio>.
11457 (class Cref): Update declarations.
11458 * mapfile.h (Mapfile::file): New function.
11459 * object.h (class Object): Define Symbols. Declare virtual
11460 do_get_global_symbols.
11461 (Object::get_global_symbols): New function.
11462 * object.cc (Input_objects::add_object): Pass object to cref_ if
11463 --cref.
11464 (Input_objects::archive_start): Likewise.
11465 (Input_objects::archive_stop): Likewise.
11466 (Input_objects::print_cref): New function.
11467 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
11468 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
11469 --cref.
11470 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
11471 function.
11472 * plugin.h (class Sized_pluginobj): Update declarations.
11473
11474 2010-01-05 Ian Lance Taylor <iant@google.com>
11475
11476 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
11477 to is_default_version. Rename insdef to insdefault.
11478 (Symbol_table::add_from_relobj): Rename def to is_default_version
11479 and local to is_forced_local.
11480 (Symbol_table::add_from_pluginobj): Likewise.
11481 (Symbol_table::add_from_dynobj): Likewise.
11482 (Symbol_table::define_special_symbol): Rename insdef to
11483 insdefault.
11484
11485 2010-01-04 Ian Lance Taylor <iant@google.com>
11486
11487 PR 10980
11488 * options.h (class General_options): Add
11489 --allow-multiple-definition and -z muldefs.
11490 * resolve.cc (Symbol_table::should_override): Don't warn about a
11491 multiple symbol definition if --allow-multiple-definition or -z
11492 muldefs.
11493
11494 PR 10980
11495 * options.h (class General_options): Add --add-needed and
11496 --copy-dt-needed-entries. Tweak --as-needed help entry.
11497 * object.cc (Input_objects::check_dynamic_dependencies): Give an
11498 error if --copy-dt-needed-entries aka --add-needed is used and
11499 would cause a change in behaviour.
11500
11501 PR 10980
11502 * options.h (class General_options): Add -G as a short version of
11503 --shared. Add no-op options -assert, -g, and -i.
11504
11505 2010-01-04 Sriraman Tallam <tmsriram@google.com>
11506
11507 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
11508 check for .text or .gnu.linkonce.t sections.
11509 * icf.cc (Icf::find_identical_sections): Ditto.
11510 Change the detection for mangled function name within the section
11511 name.
11512 * icf.h (is_section_foldable_candidate): New function.
11513
11514 2009-12-30 Ian Lance Taylor <iant@google.com>
11515
11516 PR 10980
11517 * options.h (class General_options): Permit two dashes with
11518 --retain-symbols-file.
11519
11520 2009-12-30 Ian Lance Taylor <iant@google.com>
11521
11522 PR 10979
11523 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
11524 don't put the file header and segment headers in the text
11525 segment.
11526
11527 PR 10979
11528 * common.cc (Sort_commons::operator()): Stabilize sort when both
11529 entries are NULL.
11530 (Symbol_table::do_allocate_commons_list): When allocating common
11531 symbols, skip a symbol which is no longer common.
11532 * symtab.h (Symbol::is_common): Test whether the symbol comes from
11533 an object before checking its type.
11534 * testsuite/common_test_2.c: New file.
11535 * testsuite/common_test_3.c: New file.
11536 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
11537 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
11538 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
11539 (common_test_2_pic.o, common_test_2.so): New targets.
11540 (common_test_3_pic.o, common_test_3.so): New targets.
11541 * testsuite/Makefile.in: Rebuild.
11542
11543 PR 10979
11544 * script.cc (read_input_script): If we see a new SECTIONS clause,
11545 and we have added an input section, give an error.
11546 * layout.h (class Layout): Add have_added_input_section function.
11547 Add have_added_input_section_ field.
11548 * layout.cc (Layout::Layout): Initialize
11549 have_added_input_section_.
11550 (Layout::layout): Set have_added_input_section_.
11551 (Layout::layout_eh_frame): Likewise.
11552
11553 2009-12-30 Ian Lance Taylor <iant@google.com>
11554
11555 PR 10931
11556 * options.h (class General_options): Add --sort-common option.
11557 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
11558 * common.cc (Sort_common): Add sort_order parameter to
11559 constructor. Add sort_order_ field.
11560 (Sort_commons::operator): Check sort_order_.
11561 (Symbol_table::allocate_commons): Determine the sort order.
11562 (Symbol_table::do_allocate_commons): Add sort_order parameter.
11563 Change all callers.
11564 (Symbol_table::do_allocate_commons_list): Likewise.
11565
11566 2009-12-30 Ian Lance Taylor <iant@google.com>
11567
11568 PR 10916
11569 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
11570 symbols from this object, don't change the visibility of an
11571 undefined symbol.
11572 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
11573
11574 2009-12-30 Ian Lance Taylor <iant@google.com>
11575
11576 PR 10861
11577 * script.h (class Version_script_info): Define Language enum.
11578 Update declarations. Define Glob, Exact, and Lookup types. Add
11579 new fields globals_, locals_, and is_finalized_.
11580 * script.cc: Various formatting fixes.
11581 (class Parser_closure): Change language_stack_ from a vector of
11582 std::string to one of Version_script_info::Language. Adjust all
11583 uses accordingly.
11584 (class Lazy_demangler): Remove.
11585 (struct Version_expression): Change language from std::string to
11586 Version_script_info::Language.
11587 (Version_script_info::Version_script_info): New function.
11588 (Version_script_info::~Version_script_info): Don't call clear.
11589 (Version_script_info::finalize): New function.
11590 (Version_script_info::build_lookup_tables): New function.
11591 (Version_script_info::build_expression_list_lookup): New
11592 function.
11593 (Version_script_info::get_symbol_version_helper): Rewrite to use
11594 lookup tables.
11595 (Version_script_info::print_expression_list): Adjust to use
11596 Version_script_info::Language.
11597 (script_push_lex_into_version_mode): Check that the version script
11598 has not been finalized.
11599 (version_script_push_lang): Change language string to
11600 Version_script_info::Language.
11601 * options.cc (Command_line::version_script): New function.
11602 * options.h (class General_options): Add finalize_dynamic_list
11603 function. Change version_script from declaration to definition.
11604 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
11605 * testsuite/version_script.map: Remove duplicate def of foo.
11606 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
11607 version_script.map.
11608 * testsuite/Makefile.in: Rebuild.
11609
11610 2009-12-30 Ian Lance Taylor <iant@google.com>
11611
11612 PR 10843
11613 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
11614 if the input symbol index is 0, make the output symbol index 0.
11615
11616 2009-12-30 Ian Lance Taylor <iant@google.com>
11617
11618 PR 10670
11619 * options.h (class General_options): Add -x/--discard-all.
11620 * object.cc (Sized_relobj::do_count_local_symbols): Handle
11621 --discard-all. If the local symbol needs a dynamic entry, check
11622 that before handling --discard-locals.
11623
11624 2009-12-30 Ian Lance Taylor <iant@google.com>
11625
11626 PR 10450
11627 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
11628 flags to PF_R.
11629 (Output_segment::add_output_section): Don't change the flags if
11630 the type is PT_TLS.
11631
11632 PR 10450
11633 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
11634 GNU hash table if they need a dynamic value. Otherwise, don't add
11635 them if they are defined in a dynamic object or are forced local.
11636
11637 2009-12-29 Ian Lance Taylor <iant@google.com>
11638
11639 PR 10450
11640 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
11641 .gnu.hash table for a 32-bit target.
11642
11643 PR 10450
11644 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
11645 regular and a dynamic object only needs a dynamic symbol table
11646 entry if it is externally visible.
11647
11648 PR 10450
11649 * i386.cc (class Target_i386): Initialize global_offset_table_ in
11650 constructor. Add global_offset_table_ field.
11651 (Target_i386::got_section): Set global_offset_table_.
11652 (Target_i386::do_finalize_sections): Set global_offset_table_
11653 size.
11654 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
11655 in constructor. Add global_offset_table_ field.
11656 (Target_x86_64::got_section): Set global_offset_table_.
11657 (Target_x86_64::do_finalize_sections): Set global_offset_table_
11658 size.
11659
11660 * layout.cc (Layout::Layout): Initialize increase_relro_.
11661 (Layout::get_output_section): Add is_relro, is_last_relro, and
11662 is_first_non_relro parameters. Change all callers.
11663 (Layout::choose_output_section): Likewise.
11664 (Layout::add_output_section_data): Likewise.
11665 (Layout::make_output_section): Likewise.
11666 (Layout::set_segment_offsets): Clear increase_relro when using a
11667 linker script.
11668 * layout.h (class Layout): Add increase_relro method. Add
11669 increase_relro_ field. Update declarations.
11670 * output.cc (Output_section::Output_section): Initialize
11671 is_last_relro_ and is_first_non_relro_.
11672 (Output_segment::add_output_section): Group relro sections is
11673 do_sort is true. Handle is_last_relro and is_first_non_relro.
11674 (Output_segment::maximum_alignment): Remove relro handling.
11675 (Output_segment::set_section_addresses): Add increase_relro
11676 parameter. Change all callers. Add initial alignment to align
11677 relro sections on separate page. Remove old relro handling.
11678 (Output_segment::set_section_list_addresses): Remove in_relro
11679 parameter. Change all callers.
11680 (Output_segment::set_offset): Add increase parameter. Change all
11681 callers. Remove old relro handling.
11682 * output.h (class Output_section): Add new methods: is_last_relro,
11683 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
11684 Add is_last_relro_ and is_first_non_relro_ fields.
11685 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
11686 Create separate .got.plt section. Call increase_relro.
11687 * x86_64.cc (Target_x86_64::got_section): Likewise.
11688 * testsuite/relro_script_test.t: Add .got.plt.
11689
11690 PR 10450
11691 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
11692 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
11693 (Layout::finalize): Call set_dynamic_symbol_size.
11694 (Layout::set_dynamic_symbol_size): New function.
11695 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
11696 set_dynamic_symbol_size.
11697
11698 PR 10450
11699 * output.h (class Output_section): Add is_entsize_zero_ field.
11700 * output.cc (Output_section::Output_section): Initialize
11701 is_entsize_zero_.
11702 (Output_section::set_entsize): If two different entsizes are
11703 requested, force it to zero.
11704 (Output_section::add_input_section): Set flags for .debug_str
11705 before updating section flags. Set entsize.
11706 (Output_section::update_flags_for_input_section): Set SHF_MERGE
11707 and SHF_STRING if all input sections have those flags.
11708
11709 2009-12-29 Rafael Espindola <espindola@google.com>
11710
11711 * main.cc (main): Fix the sys time reporting.
11712 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
11713 reporting.
11714
11715 2009-12-29 Sriraman Tallam <tmsriram@google.com>
11716
11717 * options.cc (General_options::parse_version): Allow -v to exit
11718 without an error if there is nothing to link.
11719
11720 2009-12-29 Ian Lance Taylor <iant@google.com>
11721
11722 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
11723 using a version of gcc before 4.1.
11724 * configure: Rebuild.
11725
11726 2009-12-28 Chris Demetriou <cgd@google.com>
11727
11728 * attributes.cc (Output_attributes_section_data::do_write): Use
11729 std::vector::front rather than std::vector::data.
11730
11731 2009-12-28 Ian Lance Taylor <iant@google.com>
11732
11733 * symtab.h (class Symbol_table): Add enum Defined.
11734 * resolve.cc (Symbol_table::should_override): Add defined
11735 parameter. Change all callers. Test whether object is NULL
11736 before calling a method on it.
11737 (Symbol_table::report_resolve_problem): Add defined parameter.
11738 Change all callers.
11739 (Symbol_table::should_override_with_special): Likewise.
11740 * symtab.cc (Symbol_table::define_in_output_data): Add defined
11741 parameter. Change all callers.
11742 (Symbol_table::do_define_in_output_data): Likewise.
11743 (Symbol_table::define_in_output_segment): Likewise.
11744 (Symbol_table::do_define_in_output_segment): Likewise.
11745 (Symbol_table::define_as_constant): Likewise.
11746 (Symbol_table::do_define_as_constant): Likewise.
11747 * script.h (class Symbol_assignment): Add is_defsym parameter to
11748 constructor; change all callers.
11749 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
11750 parameter. Change all callers. Add is_defsym_ field.
11751 (class Parser_closure): Add parsing_defsym parameter to
11752 constructor; change all callers. Add parsing_defsym accessor
11753 function. Add parsing_defsym_ field.
11754
11755 2009-12-28 Ian Lance Taylor <iant@google.com>
11756
11757 * gold.cc (queue_middle_tasks): Fix formatting.
11758 * object.cc (Relobj::is_section_name_included): Likewise.
11759
11760 2009-12-23 Ian Lance Taylor <iant@google.com>
11761
11762 * i386.cc (Target_i386::do_calls_non_split): Recognize
11763 -fsplit-stack prologue for a function with a static chain.
11764 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
11765 -fsplit-stack prologue when using %r11.
11766
11767 2009-12-21 Sriraman Tallam <tmsriram@google.com>
11768
11769 * options.cc (General_options::parse_version): Make -v continue and do
11770 the link like GNU ld does.
11771
11772 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
11773
11774 * Makefile.am (CCFILES): Add timer.cc.
11775 (HFILES): Add timer.h.
11776 * configure.ac: Check for sysconf and times.
11777 * main.cc: include timer.h.
11778 (main): Use Timer instead of get_run_time.
11779 * timer.cc: New.
11780 * timer.h: New.
11781 * workqueue.cc: include timer.h.
11782 (Workqueue::find_and_run_task):
11783 Report user, sys and wall time.
11784 * Makefile.in: Regenerate.
11785 * config.in: Regenerate.
11786 * configure: Regenerate.
11787
11788 2009-12-16 Doug Kwan <dougkwan@google.com>
11789
11790 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
11791 sections.
11792 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
11793 relaxed input sections.
11794 * output.cc (Output_section::find_relaxed_input_section): Change
11795 return type to Output_relaxed_input_section pointer. Adjust code
11796 for new type of relaxed_input_section_map_.
11797 * output.h (Output_section::find_relaxed_input_section): Change
11798 return type to Output_relaxed_input_section pointer.
11799 (Output_section::Output_relaxed_input_section_by_input_section_map):
11800 New type.
11801 (Output_section::relaxed_input_section_map_): Change type to
11802 Output_section::Output_relaxed_input_section_by_input_section_map.
11803 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
11804 input section.
11805
11806 2009-12-15 Ian Lance Taylor <iant@google.com>
11807
11808 * layout.cc (Layout::create_shstrtab): Only write out after input
11809 sections if we are compressing debug sections.
11810
11811 2009-12-15 Ian Lance Taylor <iant@google.com>
11812
11813 * archive.cc (Archive::add_symbols): Only look up a symbol without
11814 a version if there is, in fact, a version.
11815
11816 2009-12-14 Ian Lance Taylor <iant@google.com>
11817
11818 Revert -Wshadow changes, all changes from:
11819 2009-12-11 Doug Kwan <dougkwan@google.com>
11820 2009-12-11 Nick Clifton <nickc@redhat.com>
11821 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
11822
11823 2009-12-11 Doug Kwan <dougkwan@google.com>
11824
11825 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
11826 due to -Wshadow.
11827 * attributes.cc (Object_attribute::size): Ditto.
11828 (Attributes_section_data::size): Ditto.
11829 (Attributes_section_data::Attributes_section_data): Ditto.
11830 (Output_attributes_section_data::do_write): Ditto.
11831 * attributes.h (Object_attribute::set_type): Ditto.
11832 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
11833
11834 2009-12-11 Nick Clifton <nickc@redhat.com>
11835
11836 * archive.cc: Fix shadowed variable warnings.
11837 * arm.cc: Likewise.
11838 * compressed_output.cc: Likewise.
11839 * compressed_output.h: Likewise.
11840 * configure: Likewise.
11841 * dwarf_reader.cc: Likewise.
11842 * dynobj.cc: Likewise.
11843 * dynobj.h: Likewise.
11844 * ehframe.cc: Likewise.
11845 * ehframe.h: Likewise.
11846 * errors.cc: Likewise.
11847 * expression.cc: Likewise.
11848 * fileread.cc: Likewise.
11849 * fileread.h: Likewise.
11850 * freebsd.h: Likewise.
11851 * i386.cc: Likewise.
11852 * icf.cc: Likewise.
11853 * incremental.h: Likewise.
11854 * layout.cc: Likewise.
11855 * layout.h: Likewise.
11856 * mapfile.cc: Likewise.
11857 * merge.cc: Likewise.
11858 * merge.h: Likewise.
11859 * object.cc: Likewise.
11860 * object.h: Likewise.
11861 * options.h: Likewise.
11862 * output.cc: Likewise.
11863 * output.h: Likewise.
11864 * parameters.cc: Likewise.
11865 * plugin.cc: Likewise.
11866 * powerpc.cc: Likewise.
11867 * reduced_debug_output.cc: Likewise.
11868 * reduced_debug_output.h: Likewise.
11869 * reloc.cc: Likewise.
11870 * reloc.h: Likewise.
11871 * resolve.cc: Likewise.
11872 * script-sections.cc: Likewise.
11873 * script.cc: Likewise.
11874 * script.h: Likewise.
11875 * sparc.cc: Likewise.
11876 * symtab.cc: Likewise.
11877 * symtab.h: Likewise.
11878 * target-select.cc: Likewise.
11879 * target-select.h: Likewise.
11880 * token.h: Likewise.
11881 * workqueue.cc: Likewise.
11882 * workqueue.h: Likewise.
11883 * x86_64.cc: Likewise.
11884
11885 2009-12-10 Doug Kwan <dougkwan@google.com>
11886
11887 * arm.cc (attributes.h): New include.
11888 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
11889 (Arm_relobj::~Arm_relobj): Delete object pointed by
11890 attributes_section_data_.
11891 (Arm_relobj::attributes_section_data): New method definition.
11892 (Arm_relobj::attributes_section_data_): New data member declaration.
11893 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
11894 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
11895 attributes_section_data_.
11896 (Arm_dynobj::attributes_section_data): New method definition.
11897 (Arm_dynobj::attributes_section_data_): New data member declaration.
11898 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
11899 initialization value of may_use_blx_ to false.
11900 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
11901 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
11902 object attributes to compute results instead of hard-coding.
11903 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
11904 Target_arm::get_secondary_compatible_arch,
11905 Target_arm::set_secondary_compatible_arch
11906 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11907 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
11908 New method declarations.
11909 (Target_arm::get_aeabi_object_attribute): New method definition.
11910 (Target_arm::attributes_section_data_): New data member declaration.
11911 (read_arm_attributes_section): New template definition.
11912 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
11913 (Arm_dynobj::do_read_symbols): Ditto.
11914 (Target_arm::do_finalize_sections): Merge attributes sections from
11915 input. Check for BLX use after attributes section merging.
11916 Fix __exidx_start and __exidx_end visibility. Create an
11917 .ARM.attributes section if necessary.
11918 (Target_arm::get_secondary_compatible_arch,
11919 Target_arm::set_secondary_compatible_arch,
11920 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11921 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
11922 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
11923 New method definitions.
11924
11925 2009-12-09 Ian Lance Taylor <iant@google.com>
11926
11927 * plugin.cc (Plugin::load): Don't cast from void* to a function
11928 pointer.
11929
11930 2009-12-09 Ian Lance Taylor <iant@google.com>
11931
11932 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
11933 information fields.
11934
11935 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
11936
11937 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
11938 Replace two_file_shared_1.so with two_file_shared_2.so.
11939 * testsuite/Makefile.in: Regenerated.
11940
11941 2009-12-08 Doug Kwan <dougkwan@google.com>
11942
11943 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
11944 (HFILES): Add attributes.h and int_encoding.h.
11945 * Makefile.in: Regenerate.
11946 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
11947 function definitions to int_encoding.cc
11948 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
11949 prototypes to int_encoding.h
11950 * reduced_debug_output.cc (int_encoding.h): New include.
11951 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
11952 function definitions to int_encoding.cc
11953 (insert_into_vector, read_from_pointer): Move template definitions to
11954 int_encoding.h
11955 * attributes.cc: New file.
11956 * attributes.h: New file.
11957 * int_encoding.cc: New file.
11958 * int_encoding.h: New file.
11959
11960 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
11961
11962 PR gold/11055
11963 * incremental-dump.cc (dump_incremental_inputs): New.
11964 (main): Use dump_incremental_inputs.
11965
11966 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
11967
11968 PR gold/10893
11969 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
11970 checking elfcpp::STT_FUNC.
11971 (Target_i386::Relocate::relocate): Likewise.
11972 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
11973
11974 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
11975 symbols from shared libraries into normal FUNC symbols.
11976
11977 * symtab.h (Symbol): Add is_func and use it.
11978
11979 2009-12-05 Doug Kwan <dougkwan@google.com>
11980
11981 * arm.cc (Target_arm::arm_info): Initialize new fields
11982 attributes_section and attributes_vendor.
11983 * i386.cc (Target_i386::i386_info): Same.
11984 * object.cc (Sized_relobj::do_layout): Skip attribute section.
11985 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
11986 fields attributes_section and attributes_vendor.
11987 * sparc.cc (Target_sparc::sparc_info): Same.
11988 * target.h (Target::attributes_section, Target::attributes_vendor,
11989 Target::is_attributes_section, Target::attribute_arg_type,
11990 Target::attributes_order): New method definitions.
11991 (Target::Target_info::attributes_section,
11992 Target::Target_info::attributes_vendor): New fields.
11993 (Target::do_attribute_arg_type, Target::do_attributes_order): New
11994 virtual method definitions.
11995 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
11996 attributes_section and attributes_vendor.
11997 * testsuite/testfile.cc (Target_test::test_target_info): Same.
11998
11999 2009-12-05 Doug Kwan <dougkwan@google.com>
12000
12001 * arm.cc: Update comments about interworking and stub generation.
12002 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
12003 considered as non-PIC.
12004 (Arm_relocate_functions::base_abs): Fix formatting.
12005 (Arm_relocate_functions::got_prel): Fix comment. Change interface
12006 of function to use GOT entry address instead of offset.
12007 (Target_arm::Scan::global): Issue an error if a symbol would need a
12008 PLT does not get one because it is untyped. Remove code to create
12009 dynamic symbols for relative branches.
12010 (Target_arm::Relocate::relocate: Use 0 instead of false since function
12011 takes unsigned integer instead of boolean.
12012
12013 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
12014
12015 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
12016 (two_file_test_LDADD): Likewise.
12017 (common_test_1_LDADD): Likewise.
12018 (exception_test_LDADD) Likewise.
12019 (weak_test_LDADD): Likewise.
12020 (many_sections_test_LDADD): Likewise.
12021 (initpri1_LDADD): Likewise.
12022 (script_test_1_LDADD): Likewise.
12023 (script_test_2_LDADD): Likewise.
12024 (justsyms_LDADD): Likewise.
12025 (binary_test_LDADD): Likewise.
12026 (large_LDADD): Likewise.
12027 * testsuite/Makefile.in: Regenerated.
12028
12029 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
12030
12031 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
12032 (Symbol_table::override_with_special): Likewise.
12033 (Symbol_table::add_from_object): Likewise.
12034
12035 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
12036
12037 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12038 Don't set the data_offset twice.
12039
12040 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
12041
12042 * testsuite/Makefile.in: Regenerate.
12043
12044 2009-12-03 Doug Kwan <dougkwan@google.com>
12045
12046 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
12047 (Target_arm::do_finalize_sections): Add parameter for symbol table
12048 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
12049 * i386.cc (Target_i386::do_finalize_sections): Add an additional
12050 parameter for symbol table pointer.
12051 * layout.cc (Layout::finalize): Call Target::finalize_sections with
12052 an additional parameter for a pointer to symbol table.
12053 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
12054 parameter for a symbol table pointer.
12055 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
12056 * target.h (Target::finalize_sections, Target::do_finalize_sections):
12057 Ditto.
12058 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
12059 parameter for a symbol table pointer.
12060
12061 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
12062
12063 * incremental.cc (Incremental_inputs_header)
12064 (Incremental_inputs_header_write, Incremental_inputs_entry)
12065 (Incremental_inputs_entry_write): Move ...
12066 * incremental.h (Incremental_inputs_header)
12067 (Incremental_inputs_header_write, Incremental_inputs_entry)
12068 (Incremental_inputs_entry_write): here.
12069
12070 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12071
12072 * incremental.cc (make_sized_incremental_binary): Set the target.
12073 Error if it is incompatible.
12074 * output.h (Output_file): Add filename method.
12075
12076 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12077
12078 * incremental.cc (Incremental_inputs_entry): Remove unused argument
12079 from the get_* methods.
12080
12081 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12082
12083 * incremental-dump.cc (main): Check that the offeset of a script is 0.
12084 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12085 Write 0 for the data_offset of scripts.
12086
12087 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
12088
12089 * testsuite/Makefile.am: Add the incremental_test.sh test.
12090 * testsuite/incremental_test.sh: New.
12091 * testsuite/incremental_test_1.c: New.
12092 * testsuite/incremental_test_2.c: New.
12093
12094 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
12095
12096 * incremental-dump.cc (main): Fix typos.
12097
12098 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
12099
12100 PR gold/11025
12101 * incremental-dump.cc (main): Use llu to print 64 bit values.
12102
12103 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
12104 H.J. Lu <hongjiu.lu@intel.com>
12105
12106 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
12107 $(LIBDL).
12108 (incremental_dump_LDADD): Likewise.
12109 * Makefile.in: Regenerated.
12110
12111 2009-11-25 Doug Kwan <dougkwan@google.com>
12112
12113 Revert:
12114
12115 2009-11-25 Doug Kwan <dougkwan@google.com>
12116
12117 * arm.cc (Target_arm::Target_arm): Move method definition
12118 outside of class definition. Add code to handle
12119 --target1-rel, --target1-abs and --target2= options.
12120 (Target_arm::get_reloc_reloc_type): Change method to be
12121 non-static and const.
12122 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
12123 New data member declaration.
12124 (Target_arm::Scan::local, Target_arm::Scan::global,
12125 Target_arm::Relocate::relocate,
12126 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12127 Adjust call to Target_arm::get_real_reloc_type.
12128 (Target_arm::get_real_reloc_type): Use command line options
12129 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12130 * options.h (--target1-rel, --target1-abs, --target2): New
12131 ARM-only options.
12132
12133 2009-11-25 Doug Kwan <dougkwan@google.com>
12134
12135 * arm.cc (Target_arm::Target_arm): Move method definition outside of
12136 class definition. Add code to handle --target1-rel, --target1-abs
12137 and --target2= options.
12138 (Target_arm::get_reloc_reloc_type): Change method to be non-static
12139 and const.
12140 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
12141 member declaration.
12142 (Target_arm::Scan::local, Target_arm::Scan::global,
12143 Target_arm::Relocate::relocate,
12144 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
12145 call to Target_arm::get_real_reloc_type.
12146 (Target_arm::get_real_reloc_type): Use command line options to
12147 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12148 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
12149 options.
12150
12151 2009-11-25 Doug Kwan <dougkwan@google.com>
12152
12153 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
12154 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
12155 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
12156 formatting.
12157 (Arm_relocate_functions::thm_call): Replace body with a call to
12158 Arm_relocate_functions::thumb_branch_common.
12159 (Arm_relocate_functions::thm_jump24,
12160 Arm_relocate_functions::thm_xpc22): New method definitions.
12161 (Arm_relocate_functions::thumb_branch_common): New method definition.
12162 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
12163 operator.
12164 (Target_arm::Relocate::relocate): Adjust call to thm_call.
12165 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
12166
12167 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
12168
12169 * Makefile.am: Build incremental-dump
12170 * Makefile.in: Regenerate.
12171 * incremental-dump.cc: New.
12172 * incremental.cc (Incremental_inputs_header_data,
12173 Incremental_inputs_entry_data): Move to incremental.h
12174 * incremental.h: (Incremental_inputs_header_data,
12175 Incremental_inputs_entry_data): Move from incremental.cc
12176
12177 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
12178
12179 * incremental.cc (Incremental_inputs_header,
12180 Incremental_inputs_header_write, Incremental_inputs_entry,
12181 Incremental_inputs_entry_write): Add a typedef with the data type.
12182
12183 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
12184
12185 * incremental.cc (Incremental_inputs_header,
12186 Incremental_inputs_header_write, Incremental_inputs_entry,
12187 Incremental_inputs_entry_write): Update comment about which
12188 type has the filed descriptions.
12189
12190 2009-11-15 Doug Kwan <dougkwan@google.com>
12191
12192 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
12193 (Arm_relocate_functions::arm_branch_common): Change method defintion
12194 in class definition to a method declaration and update list of formal
12195 parameters.
12196 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
12197 Arm_relocation_functions::jump24): Adjust call to
12198 Arm_relocate_functions::arm_branch_common. Update list of formal
12199 parameters.
12200 (Arm_relocate_functions::xpc25): New method definition.
12201 (Arm_relocate_functions::arm_branch_common): Move method defintion
12202 out from class definition. Use stubs for mode-switching and extending
12203 branch ranges.
12204 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
12205 specially. Change code to enable use of stubs in ARM branches.
12206
12207 2009-11-10 Doug Kwan <dougkwan@google.com>
12208
12209 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
12210 in method declaration.
12211 (Target_arm::relocate_stub): New method declaration.
12212 (Target_arm::default_target): Change to return a pointer instead of
12213 a const reference.
12214 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
12215 Target_arm::default_target.
12216 (Arm_Relobj::do_relocate_sections): Remove options paramater in
12217 method definition.
12218 (Target_arm::relocate_section): Adjust view.
12219 (Target_arm::relocate_stub): New method definition.
12220
12221 2009-11-10 Doug Kwan <dougkwan@google.com>
12222
12223 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
12224 a format warning.
12225 * incremental.cc (open_incremental_binary): Initialized local
12226 variables to avoid warnings.
12227 * object.cc (make_elf_object): Ditto.
12228 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
12229 a format warning.
12230
12231 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
12232
12233 PR gold/10930
12234 * testsuite/plugin_test.c: Include "config.h".
12235
12236 2009-11-09 Doug Kwan <dougkwan@google.com>
12237
12238 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
12239 (arm_symbol_value): Remove.
12240 (Arm_relocate_functions::arm_branch_common,
12241 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
12242 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
12243 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
12244 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
12245 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
12246 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
12247 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
12248 Arm_relocate_functions::thm_mobw_abs_nc,
12249 Arm_relocate_functions::thm_mov_abs,
12250 Arm_relocate_functions::movw_prel_nc,
12251 Arm_relocate_functions::thm_movt_abs,
12252 Arm_relocate_functions::movt_prel,
12253 Arm_relocate_functions::thm_movw_prel_nc,
12254 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
12255 (Target_arm::Relocate::relocate): Only decompose address into two
12256 parts if relocation type uses the thumb-bit and pass the actual
12257 bit instead of a flag indicating that the thumb-bit is used. Adjust
12258 calls to methods in Arm_relocate_functions for this change.
12259
12260 2009-11-08 Ian Lance Taylor <iant@google.com>
12261
12262 PR 10925
12263 * reloc.cc: Instantiate
12264 Sized_relobj::initialize_input_to_output_maps and
12265 Sized_relobj:free_input_to_output_maps.
12266
12267 2009-11-06 Ian Lance Taylor <iant@google.com>
12268
12269 PR 10876
12270 * defstd.cc (in_segment): Set only_if_ref true for "end".
12271
12272 2009-11-06 Doug Kwan <dougkwan@google.com>
12273
12274 * arm.cc (class Reloc_stub): Correct a comment.
12275 (Target_arm::Target_arm): Initialize arm_input_section_map_.
12276 (Target_arm::scan_section_for_stubs): New method declaration.
12277 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
12278 Change methods from private to protected.
12279 (Target_arm::do_may_relax): New method definition.
12280 (Target_arm::do_relax, Target_arm::group_sections,
12281 Target_arm::scan_reloc_for_stub,
12282 Target_arm::scan_reloc_section_for_stubs): New method declarations.
12283 (Target_arm::arm_input_section_map_): New data member declaration.
12284 (Target_arm::scan_reloc_for_stub,
12285 Target_arm::scan_reloc_section_for_stubs,
12286 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
12287 Target_arm::do_relax): New method definitions.
12288
12289 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
12290
12291 * configure.ac: Check for (struct stat)::st_mtim
12292 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
12293 * config.in: Regenerate.
12294 * configure: Regenerate.
12295
12296 2009-11-05 Ian Lance Taylor <iant@google.com>
12297
12298 PR 10910
12299 * output.cc (Output_segment::add_output_section): Add missing
12300 return statement.
12301
12302 2009-11-04 Ian Lance Taylor <iant@google.com>
12303
12304 PR 10880
12305 * object.h (class Object): Add is_needed and set_is_needed
12306 methods. Add is_needed_ field. Make bool fields into bitfields.
12307 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
12308 defined in a dynamic object and referenced by a regular object,
12309 set is_needed for the dynamic object.
12310 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
12311 if the file is marked with as_needed and it is not needed.
12312
12313 2009-11-04 Ian Lance Taylor <iant@google.com>
12314
12315 PR 10887
12316 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
12317 tags if data is discarded by linker script.
12318 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12319 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12320 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12321 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12322
12323 2009-11-04 Ian Lance Taylor <iant@google.com>
12324
12325 * layout.cc (Layout::get_output_section): Add is_interp and
12326 is_dynamic_linker_section parameters. Change all callers.
12327 (Layout::choose_output_section): Likewise.
12328 (Layout::make_output_section): Likewise.
12329 (Layout::add_output_section_data): Add is_dynamic_linker_section
12330 parameter. Change all callers.
12331 * layout.h (class Layout): Update declarations.
12332 * output.h (class Output_section): Add is_interp, set_is_interp,
12333 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
12334 Add is_interp_, is_dynamic_linker_section_ fields. Change
12335 generate_code_fills_at_write_ to a bitfield.
12336 * output.cc (Output_section::Output_sections): Initialize new
12337 fields.
12338 (Output_segment::add_output_section): Add do_sort parameter.
12339 Change all callers.
12340
12341 2009-11-03 Ian Lance Taylor <iant@google.com>
12342
12343 PR 10860
12344 * options.h (class General_options): Add --warn-common.
12345 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
12346 merging two common symbols.
12347 (Symbol_table::should_override): Handle --warn-common when merging
12348 a common symbol with a defined symbol. Use report_resolve_problem
12349 for multiple definitions.
12350 (Symbol_table::report_resolve_problem): New function.
12351 * symtab.h (class Symbol_table): Declare report_resolve_problem.
12352
12353 2009-11-03 Doug Kwan <dougkwan@google.com>
12354
12355 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
12356 stub_factory_.
12357 (Target_arm::stub_factory): New method definition.
12358 (Target_arm::new_arm_input_section,
12359 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
12360 Target_arm::reloc_uses_thumb_bit): New method declarations.
12361 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
12362 New type definitions.
12363 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
12364 member declarations.
12365 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
12366 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
12367 New method definitions.
12368
12369 2009-11-03 Ian Lance Taylor <iant@google.com>
12370
12371 * options.h (class General_options): Add --warn_constructors.
12372
12373 2009-11-03 Ian Lance Taylor <iant@google.com>
12374
12375 PR 10893
12376 * defstd.cc (in_section): Add entries for __rel_iplt_start,
12377 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
12378
12379 2009-11-03 Ian Lance Taylor <iant@google.com>
12380
12381 PR 10895
12382 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
12383 --msgid-bugs-address.
12384 (install-pdf): New target.
12385 (install-data_yes): Look up one directory to find mkinstalldirs.
12386
12387 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
12388
12389 * po/Make-in (.po.gmo): Don't generate .gmo files in source
12390 tree.
12391
12392 2009-10-30 Doug Kwan <dougkwan@google.com>
12393
12394 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
12395
12396 2009-10-30 Doug Kwan <dougkwan@google.com>
12397
12398 * arm.cc (Stub_addend_reader): New struct template definition
12399 and partial specializations.
12400 (Stub_addend_reader::operator()): New method definition for a
12401 partially specialized template.
12402
12403 2009-10-30 Doug Kwan <dougkwan@google.com>
12404
12405 * arm.cc (Arm_relobj::processor_specific_flags): New method
12406 definition.
12407 (Arm_relobj::do_read_symbols): New method declaration.
12408 (Arm_relobj::processor_specific_flags_): New data member declaration.
12409 (Arm_dynobj): New class definition.
12410 (Target_arm::do_finalize_sections): Add input_objects parameter.
12411 (Target_arm::do_adjust_elf_header): New method declaration.
12412 (Target_arm::are_eabi_versions_compatible,
12413 (Target_arm::merge_processor_specific_flags): New method declaration.
12414 (Target_arm::do_make_elf_object): New overloaded method definitions
12415 and declaration.
12416 (Arm_relobj::do_read_symbols): New method definition.
12417 (Arm_dynobj::do_read_symbols): Ditto.
12418 (Target_arm::do_finalize_sections): Add input_objects parameters.
12419 Merge processor-specific flags from all input objects.
12420 (Target_arm::are_eabi_versions_compatible,
12421 Target_arm::merge_processor_specific_flags,
12422 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
12423 New method definitions.
12424 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
12425 Input_objects pointer type parameter.
12426 * layout.cc (Layout::finalize): Pass input objects to target's.
12427 finalize_sections function.
12428 * output.cc (Output_file_header::do_sized_write): Set ELF file
12429 header's processor-specific flags.
12430 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
12431 Input_objects pointer type parameter.
12432 * sparc.cc (Target_sparc::do_finalize_sections): Same.
12433 * target.h (Input_objects): New forward class declaration.
12434 (Target::processor_specific_flags,
12435 Target::are_processor_specific_flags_sect): New method definitions.
12436 (Target::finalize_sections): Add input_objects parameter.
12437 (Target::Target): Initialize processor_specific_flags_ and
12438 are_processor_specific_flags_set_.
12439 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
12440 parameter.
12441 (Target::set_processor_specific_flags): New method definition.
12442 (Target::processor_specific_flags_,
12443 Target::are_processor_specific_flags_set_): New data member
12444 declarations.
12445 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
12446 Input_objects pointer type parameter.
12447
12448 2009-10-30 Doug Kwan <dougkwan@google.com>
12449
12450 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
12451
12452 2009-10-28 Ian Lance Taylor <iant@google.com>
12453
12454 * object.h (class Relobj): Drop options parameter from
12455 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
12456 do_scan_relocs, do_relocate. Change all callers.
12457 (class Sized_relobj): Drop options parameters from
12458 do_gc_process_relocs, do_scan_relocs, do_relocate,
12459 do_relocate_sections, relocate_sections, emit_relocs_scan,
12460 emit_relocs_scan_reltype. Change all callers.
12461 (struct Relocate_info): Remove options field and all references to
12462 it.
12463 * reloc.h (class Read_relocs): Remove options constructor
12464 parameter and options_ field. Change all callers.
12465 (class Gc_process_relocs, class Scan_relocs): Likewise.
12466 (class Relocate_task): Likewise.
12467 * target-reloc.h (scan_relocs): Remove options parameter. Change
12468 all callers.
12469 (scan_relocatable_relocs): Likewise.
12470 * target.h (class Sized_target): Remove options parameter from
12471 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
12472 all callers.
12473 * gc.h (gc_process_relocs): Remove options parameter. Change all
12474 callers.
12475 * arm.cc: Update functions to remove options parameters.
12476 * i386.cc: Likewise.
12477 * powerpc.cc: Likewise.
12478 * sparc.cc: Likewise.
12479 * x86_64.cc: Likewise.
12480 * testsuite/testfile.cc: Likewise.
12481
12482 2009-10-28 Doug Kwan <dougkwan@google.com>
12483
12484 * arm.cc (Arm_relobj): New class definition.
12485 (Arm_relobj::scan_sections_for_stubs,
12486 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
12487 New method definitions.
12488
12489 2009-10-28 Cary Coutant <ccoutant@google.com>
12490
12491 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
12492 (Plugin::cleanup_done_): New member.
12493 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
12494 (Plugin_manager::cleanup_done_): Remove.
12495 (Plugin_manager::add_input_file): Edit error message.
12496 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
12497 (Plugin_manager::cleanup): Remove use of cleanup_done_.
12498
12499 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
12500
12501 * fileread.cc: (File_read::View::~View): Use the new
12502 data_ownership_ filed.
12503 (File_read::~File_read): Dispose the new whole_file_view_.
12504 (File_read::open): Mmap the whole file if needed.
12505 (File_read::open): Use whole_file_view_ instead of contents_.
12506 (File_read::find_view): Use whole_file_view_ if applicable.
12507 (File_read::do_read): Use whole_file_view_ instead of contents_.
12508 (File_read::make_view): Use whole_file_view_ instead of contents_,
12509 update File_read::View::View call.
12510 (File_read::find_or_make_view): Update File_read::View::View
12511 call.
12512 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
12513 remove contents_
12514 (File_read::View::Data_ownership): New enum.
12515 (File_read::View::View): Replace bool mapped_ with Data_ownership
12516 argument.
12517 (File_read::View::mapped_): Remove (replaced by data_ownership_).
12518 (File_read::View::data_ownership_): New field.
12519 (File_read::contents_): Remove (replaced by whole_file_view_).
12520 (File_read::whole_file_view_): New field.
12521 * options.h (class General_options): Add --keep-files-mapped.
12522
12523 2009-10-27 Cary Coutant <ccoutant@google.com>
12524
12525 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
12526 * testsuite/Makefile.am (plugin_test_5): New test case.
12527 * testsuite/Makefile.in: Regenerate.
12528
12529 2009-10-25 Doug Kwan <dougkwan@google.com>
12530
12531 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
12532 from private to protected to allow access by child class.
12533 (Sized_relobj::do_relocate_sections): New method declaration.
12534 (Sized_relobj::relocate_sections): Virtualize.
12535 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
12536 Sized_relobj::relocate_sections. Instantiate template explicitly
12537 for different target sizes and endianity.
12538
12539 2009-10-24 Doug Kwan <dougkwan@google.com>
12540
12541 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
12542 (Arm_input_section::as_arm_input_section): New method.
12543 (Arm_output_section): New class definition.
12544 (Arm_output_section::create_stub_group,
12545 Arm_output_section::group_sections): New method definitions.
12546
12547 2009-10-22 Doug Kwan <dougkwan@google.com>
12548
12549 * arm.cc (Arm_input_section): New class definition.
12550 (Arm_input_section::init, Arm_input_section:do_write,
12551 Arm_input_section::set_final_data_size,
12552 Arm_input_section::do_reset_address_and_file_offset): New method
12553 definitions.
12554
12555 2009-10-21 Doug Kwan <dougkwan@google.com>
12556
12557 * arm.cc (Stub_table, Arm_input_section): New forward class
12558 declarations.
12559 (Stub_table): New class defintion.
12560 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
12561 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
12562 New method definition.
12563
12564 2009-10-21 Doug Kwan <dougkwan@google.com>
12565
12566 * arm.cc: Update copyright comments.
12567 (Target_arm): New forward class template declaration.
12568 (Arm_address): New type.
12569 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
12570 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
12571 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
12572 constants.
12573 (Insn_template): Same.
12574 (DEF_STUBS): New macro.
12575 (Stub_type): New enum type.
12576 (Stub_template): New class definition.
12577 (Stub): Same.
12578 (Reloc_stub): Same.
12579 (Stub_factory): Same.
12580 (Target_arm::Target_arm): Initialize may_use_blx_ and
12581 should_force_pic_veneer_.
12582 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
12583 Target_arm::should_force_pic_veneer,
12584 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
12585 Target_arm::using_thumb_only, Target_arm:;default_target): New
12586 method defintions.
12587 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
12588 New data member declarations.
12589 (Insn_template::size, Insn_template::alignment): New method defintions.
12590 (Stub_template::Stub_template): New method definition.
12591 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
12592 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
12593 (Stub_factory::Stub_factory): New method definition.
12594 * gold.h (string_hash): New template.
12595 * output.h (Input_section_specifier::hash_value): Use
12596 gold::string_hash.
12597 (Input_section_specifier::string_hash): Remove.
12598 * stringpool.cc (Stringpool_template::string_hash): Use
12599 gold::string_hash.
12600
12601 2009-10-20 Doug Kwan <dougkwan@google.com>
12602
12603 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
12604 symbols of relaxed input sections.
12605 * output.h (Output_section::find_relaxed_input_section): Make
12606 method public.
12607
12608 2009-10-16 Doug Kwan <dougkwan@google.com>
12609
12610 * dynobj.cc (Versions::Versions): Initialize version_script_.
12611 Only insert base version symbol definition for a shared object
12612 if version script defines any version versions.
12613 (Versions::define_base_version): New method definition.
12614 (Versions::add_def): Check that base version is not needed.
12615 (Versions::add_need): Define base version lazily.
12616 * dynobj.h (Versions::define_base_version): New method declaration.
12617 (Versions::needs_base_version_): New data member declaration.
12618 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
12619 (check_DATA): Add no_version_test.stdout.
12620 (libno_version_test.so, no_version_test.o no_version_test.stdout):
12621 New make rules.
12622 * testsuite/Makefile.in: Regenerate.
12623 * testsuite/no_version_test.c: New file.
12624 * testsuite/no_version_test.sh: Ditto.
12625
12626 2009-10-16 Doug Kwan <dougkwan@google.com>
12627
12628 * expression.cc (class Segment_start_expression): New class definition.
12629 (Segment_start_expression::value): New method definition.
12630 (script_exp_function_segment_start): Return a new
12631 Segment_start_expression.
12632 * gold/script-c.h (script_saw_segment_start_expression): New function
12633 prototype.
12634 * script-sections.cc (Script_sections::Script_sections): Initialize
12635 SAW_SEGMENT_START_EXPRESSION_ to false.
12636 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
12637 and -Tbbs options to specify section addresses if given in
12638 command line and no SEGMENT_START expression is seen in a script.
12639 * script-sections.h (Script_sections::saw_segment_start_expression,
12640 Script_sections::set_saw_segment_start_expression): New method
12641 definition.
12642 (Script_sections::saw_segment_start_expression_): New data member
12643 declaration.
12644 * script.cc (script_saw_segment_start_expression): New function.
12645 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
12646 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
12647 script_test_7.sh and script_test_8.sh.
12648 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
12649 script_test_8.stdout.
12650 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
12651 (script_test_6, script_test_6.stdout, script_test_7,
12652 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
12653 * Makefile.in: Regenerate.
12654 * testsuite/script_test_6.sh: New file.
12655 * testsuite/script_test_6.t: Same.
12656 * testsuite/script_test_7.sh: Same.
12657 * testsuite/script_test_7.t: Same.
12658 * testsuite/script_test_8.sh: Same.
12659
12660 2009-10-16 Doug Kwan <dougkwan@google.com>
12661
12662 * output.cc (Output_segment::set_section_list_address): Cast
12663 expressions to unsigned long long type to avoid format warnings.
12664
12665 2009-10-15 Ian Lance Taylor <iant@google.com>
12666
12667 * script.cc (Script_options::add_symbol_assignment): Always add a
12668 dot assignment to script_sections_.
12669 * script-sections.cc (Script_sections::add_dot_assignment):
12670 Initialize if necessary.
12671
12672 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
12673 program headers with no load segment if there is a linker script.
12674
12675 * layout.cc (Layout::set_segment_offsets): Align the file offset
12676 to the segment aligment for -N or -n with no load segment.
12677 * output.cc (Output_segment::add_output_section): Don't crash if
12678 the first section is a TLS section.
12679 (Output_segment::set_section_list_addresses): Print an error
12680 message if the address moves backward in a linker script.
12681 * script-sections.cc
12682 (Output_section_element_input::set_section_addresses): Don't
12683 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
12684 (Orphan_output_section::set_section_addresses): Likewise.
12685
12686 2009-10-15 Doug Kwan <dougkwan@google.com>
12687
12688 * layout.cc (Layout::finish_dynamic_section): Generate tags
12689 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
12690 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
12691 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
12692
12693 2009-10-14 Ian Lance Taylor <iant@google.com>
12694
12695 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
12696 fields.
12697 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
12698 data_shdr fields of relinfo.
12699 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
12700 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
12701 R_386_TLS_LDO_32, adjust based on section flags.
12702 (Target_i386::Relocate::fix_up_ldo): Remove.
12703
12704 2009-10-13 Ian Lance Taylor <iant@google.com>
12705
12706 Add support for -pie.
12707 * options.h (class General_options): Add -pie and
12708 --pic-executable.
12709 (General_options::output_is_position_independent): Test -pie.
12710 (General_options::output_is_executable): Return true if not shared
12711 and not relocatable.
12712 (General_options::output_is_pie): Remove.
12713 * options.cc (General_options::finalize): Reject incompatible uses
12714 of -pie.
12715 * gold.cc (queue_middle_tasks): A -pie link is not static.
12716 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
12717 * symtab.cc (Symbol::final_value_is_known): Return false if
12718 output_is_position_independent.
12719 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
12720 output_is_position_independent.
12721 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
12722 output_is_position_independent.
12723 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
12724 output_is_position_independent.
12725 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
12726 two_file_pie_test.
12727 (basic_pie_test.o, basic_pie_test): New targets.
12728 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
12729 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
12730 (two_file_pie_test): New target.
12731 * testsuite/Makefile.in: Rebuild.
12732 * README: Remove note saying that -pie is not supported.
12733
12734 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
12735
12736 * options.h (class General_options): Add -init and -fini.
12737 * layout.cc (Layout::finish_dynamic_section): Emit
12738 given init and fini functions.
12739
12740 2009-10-13 Sriraman Tallam <tmsriram@google.com>
12741
12742 * gc.h (gc_process_relocs): Check if icf is enabled using new
12743 function.
12744 * gold.cc (queue_initial_tasks): Likewise.
12745 (queue_middle_tasks): Likewise.
12746 * object.cc (do_layout): Likewise.
12747 * symtab.cc (is_section_folded): Likewise.
12748 * main.cc (main): Likewise.
12749 * reloc.cc (Read_relocs::run): Likewise.
12750 (Sized_relobj::do_scan_relocs): Likewise.
12751 * icf.cc (is_function_ctor_or_dtor): New function.
12752 (Icf::find_identical_sections): Check if function is ctor or dtor when
12753 safe icf is chosen.
12754 * options.h (General_options::icf): Change option to be an enum.
12755 (Icf_status): New enum.
12756 (icf_enabled): New method.
12757 (icf_safe_folding): New method.
12758 (set_icf_status): New method.
12759 (icf_status_): New variable.
12760 * (options.cc) (General_options::finalize): Set icf_status_.
12761 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
12762 icf_test and icf_keep_unique_test to use the --icf enum flag.
12763 * testsuite/icf_safe_test.sh: New file.
12764 * testsuite/icf_safe_test.cc: New file.
12765
12766 2009-10-12 Sriraman Tallam <tmsriram@google.com>
12767
12768 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
12769 includes to gc.h and icf.h.
12770 * arm.cc: Include gc.h.
12771 * gold.cc: Likewise.
12772 * i386.cc: Likewise.
12773 * powerpc.cc: Likewise.
12774 * sparc.cc: Likewise.
12775 * x86_64.cc: Likewise.
12776 * gc.h: Include icf.h.
12777
12778 2009-10-11 Ian Lance Taylor <iant@google.com>
12779
12780 * plugin.cc: Include "gold.h" before other header files.
12781
12782 2009-10-10 Chris Demetriou <cgd@google.com>
12783
12784 * options.h (Input_file_argument::Input_file_type): New enum.
12785 (Input_file_argument::is_lib_): Replace with...
12786 (Input_file_argument::type_): New member.
12787 (Input_file_argument::Input_file_argument): Take Input_file_type
12788 'type' rather than boolean 'is_lib' as second argument.
12789 (Input_file_argument::is_lib): Use type_.
12790 (Input_file_argument::is_searched_file): New function.
12791 (Input_file_argument::may_need_search): Handle is_searched_file.
12792 * options.cc (General_options::parse_library): Support -l:filename.
12793 (General_options::parse_just_symbols): Update for Input_file_argument
12794 changes.
12795 (Command_line::process): Likewise.
12796 * archive.cc (Archive::get_file_and_offset): Likewise.
12797 * plugin.cc (Plugin_manager::release_input_file): Likewise.
12798 * script.cc (read_script_file, script_add_file): Likewise.
12799 * fileread.cc (Input_file::Input_file): Likewise.
12800 (Input_file::will_search_for): Handle is_searched_file.
12801 (Input_file::open): Likewise.
12802 * readsyms.cc (Read_symbols::get_name): Likewise.
12803 * testsuite/Makefile.am (searched_file_test): New test.
12804 * testsuite/Makefile.in: Regenerate.
12805 * testsuite/searched_file_test.cc: New file.
12806 * testsuite/searched_file_test_lib.cc: New file.
12807
12808 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12809 Ian Lance Taylor <iant@google.com>
12810
12811 * descriptor.cc: Include <cstdio> and "binary-io.h".
12812 (Descriptors::open): Open the files in binary mode always.
12813 * script.cc (Lex::get_token): Treat \r as whitespace.
12814
12815 2009-10-09 Ian Lance Taylor <iant@google.com>
12816
12817 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
12818
12819 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12820 Ian Lance Taylor <iant@google.com>
12821
12822 * configure.ac: Check for readv function also.
12823 * fileread.cc (readv): Define if not HAVE_READV.
12824 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
12825 does not exist.
12826 * config.in: Regenerate.
12827 * configure: Regenerate.
12828
12829 2009-10-09 Doug Kwan <dougkwan@google.com>
12830
12831 * layout.cc (Layout::make_output_section): Call target hook to make
12832 ordinary output section.
12833 (Layout::finalize): Adjust parameter list of call the
12834 Target::may_relax().
12835 * layout.h (class Layout::section_list): New method.
12836 * merge.h (Output_merge_base::entsize): Change visibility to public.
12837 (Output_merge_base::is_string, Output_merge_base::do_is_string):
12838 New methods.
12839 (Output_merge_string::do_is_string): New method.
12840 * object.cc (Sized_relobj::do_setup): renamed from
12841 Sized_relobj::set_up.
12842 * object.h (Sized_relobj::adjust_shndx,
12843 Sized_relobj::initializ_input_to_output_maps,
12844 Sized_relobj::free_input_to_output_maps): Change visibilities to
12845 protected.
12846 (Sized_relobj::setup): Virtualize.
12847 (Sized_relobj::do_setup): New method declaration.
12848 (Sized_relobj::invalidate_section_offset,
12849 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
12850 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
12851 * options.cc (parse_int): New function.
12852 * options.h (parse_int): New declaration.
12853 (DEFINE_int): New macro.
12854 (stub_group_size): New option.
12855 * output.cc (Output_section::Output_section): Initialize memebers
12856 merge_section_map_, merge_section_by_properties_map_,
12857 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
12858 (Output_section::add_input_section): Handled deferred code-fill
12859 generation and remove an old comment.
12860 (Output_section::add_relaxed_input_section): New method definition.
12861 (Output_section::add_merge_input_section): Use merge section by
12862 properties map to speed to search. Update merge section maps
12863 as appropriate.
12864 (Output_section::build_relaxation_map): New method definition.
12865 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
12866 Same.
12867 (Output_section::relax_input_section): Renamed to
12868 Output_section::convert_input_sections_to_relaxed_sections and change
12869 interface to take a vector of pointers to relaxed sections.
12870 (Output_section::find_merge_section,
12871 Output_section::find_relaxed_input_section): New method definitions.
12872 (Output_section::is_input_address_mapped,
12873 Output_section::output_offset, Output_section::output_address):
12874 Use output section data maps to speed up searching.
12875 (Output_section::find_starting_output_address): Add comments.
12876 (Output_section::do_write,
12877 Output_section::write_to_postprocessing_buffer): Do code-fill
12878 generation as appropriate.
12879 (Output_section::get_input_sections): Invalidate relaxed input section
12880 map.
12881 (Output_section::restore_states): Adjust type of checkpoint .
12882 Invalidate relaxed input section map.
12883 * output.h (Output_merge_base): New class declaration.
12884 (Input_section_specifier): New class defintion.
12885 (class Output_relaxed_input_section) Change base class to
12886 Output_section_data_build.
12887 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
12888 base class initializer.
12889 (Output_section::add_relaxed_input_section): New method declaration.
12890 (Output_section::Input_section): Change visibility to protected.
12891 (Output_section::Input_section::relobj,
12892 Output_section::Input_section::shndx): Handle relaxed input sections.
12893 Output_section::input_sections) Change visibility to protected. Also
12894 define overload to return a non-const pointer.
12895 (Output_section::Merge_section_properties): New class defintion.
12896 (Output_section::Merge_section_by_properties_map,
12897 Output_section::Output_section_data_by_input_section_map,
12898 Output_section::Relaxation_map): New types.
12899 (Output_section::relax_input_section): Rename method to
12900 Output_section::convert_input_sections_to_relaxed_sections and change
12901 interface to take a vector of relaxed section pointers.
12902 (Output_section::find_merge_section,
12903 Output_section::find_relaxed_input_section,
12904 Output_section::build_relaxation_map,
12905 Output_section::convert_input_sections_in_list_to_relaxed_sections):
12906 New method declarations.
12907 (Output_section::merge_section_map_
12908 Output_section::merge_section_by_properties_map_,
12909 Output_section::relaxed_input_section_map_,
12910 Output_section::is_relaxed_input_section_map_valid_,
12911 Output_section::generate_code_fills_at_write_): New data members.
12912 * script-sections.cc
12913 (Output_section_element_input::set_section_addresses): Call
12914 current_data_size and addralign methods of relaxed input sections.
12915 (Orphan_output_section::set_section_addresses): Call current_data_size
12916 and addralign methods of relaxed input sections.
12917 * symtab.cc (Symbol_table::compute_final_value): Extract template
12918 from the body of Symbol_table::sized_finalize_symbol.
12919 (Symbol_table::sized_finalized_symbol): Call
12920 Symbol_table::compute_final_value.
12921 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
12922 (Symbol_table::compute_final_value): New templated method declaration.
12923 * target.cc (Target::do_make_output_section): New method defintion.
12924 * target.h (Target::make_output_section): New method declaration.
12925 (Target::relax): Add more parameters for input objects, symbol table
12926 and layout. Adjust call to do_relax.
12927 (Target::do_make_output_section): New method declaration.
12928 (Target::do_relax): Add parameters for input objects, symbol table
12929 and layout.
12930
12931 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12932
12933 * pread.c: Include stdio.h.
12934
12935 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12936
12937 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
12938 defined.
12939
12940 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12941
12942 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
12943 Change read_shndx type to unsigned int.
12944 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12945 int.
12946 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12947 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
12948 Change read_shndx type to unsigned int.
12949 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12950 int.
12951 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12952 * layout.cc (Layout::create_symtab_sections): Cast the result of
12953 local_symcount * symsize to off_t in the gold_assert.
12954
12955 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12956
12957 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
12958 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
12959 R_ARM_BASE_ABS.
12960 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
12961 (Arm_relocate_functions::thm_abs5): New function.
12962 (Arm_relocate_functions::abs12): New function.
12963 (Arm_relocate_functions::abs16): New function.
12964 (Arm_relocate_functions::base_abs): New function.
12965 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
12966 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
12967 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
12968 R_ARM_BASE_ABS.
12969 (Scan::global): Likewise.
12970 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
12971 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
12972 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
12973 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
12974 R_ARM_BASE_ABS.
12975
12976 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12977
12978 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
12979 (Arm_relocate_functions::movt_prel): New function.
12980 (Arm_relocate_functions::thm_movw_prel_nc): New function.
12981 (Arm_relocate_functions::thm_movt_prel): New function.
12982 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
12983 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
12984 (Scan::global, Relocate::relocate): Likewise.
12985 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12986
12987 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12988
12989 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
12990 Incremental_checker.
12991 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
12992 unsigned int.
12993 (class Incremental_inputs_header): New class.
12994 (Incremental_inputs_header_writer): Edit comment.
12995 (Incremental_inputs_entry): New class.
12996 (Incremental_inputs_entry_writer): Edit comment.
12997 (Sized_incremental_binary::do_find_incremental_inputs_section):
12998 Add *strtab_shndx parameter, fill it.
12999 (Sized_incremental_binary::do_check_inputs): New method.
13000 (Incremental_checker::can_incrementally_link_output_file): Use
13001 Sized_incremental_binary::check_inputs.
13002 (Incremental_inputs::report_command_line): Save command line in
13003 command_line_.
13004 * incremental.h:
13005 (Incremental_binary::find_incremental_inputs_section): New
13006 method.
13007 (Incremental_binary::do_find_incremental_inputs_section): Add
13008 strtab_shndx parameter.
13009 (Incremental_binary::do_check_inputs): New pure virtual method.
13010 (Sized_incremental_binary::do_check_inputs): Declare.
13011 (Incremental_checker::Incremental_checker): Add incremental_inputs
13012 parameter, use it to initialize incremental_inputs_.
13013 (Incremental_checker::incremental_inputs_): New field.
13014 (Incremental_checker::command_line): New method.
13015 (Incremental_checker::inputs): New method.
13016 (Incremental_checker::command_line_): New field.
13017
13018 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13019
13020 * incremental.cc: Include <cstdarg> and "target-select.h".
13021 (vexplain_no_incremental): New function.
13022 (explain_no_incremental): New function.
13023 (Incremental_binary::error): New method.
13024 (Sized_incremental_binary::do_find_incremental_inputs_section): New
13025 method.
13026 (make_sized_incremental_binary): New function.
13027 (open_incremental_binary): New function.
13028 (can_incrementally_link_file): Add checks if output is ELF and has
13029 inputs section.
13030 * incremental.h: Include "elfcpp_file.h" and "output.h".
13031 (Incremental_binary): New class.
13032 (Sized_incremental_binary): New class.
13033 (open_incremental_binary): Declare.
13034 * object.cc (is_elf_object): Use
13035 elfcpp::Elf_recognizer::is_elf_file.
13036 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
13037 * output.h (Output_file::filesize): New method.
13038
13039 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13040
13041 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
13042 New function.
13043 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
13044 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
13045 function.
13046 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
13047 function.
13048 (Arm_relocate_functions::movw_abs_nc): New function.
13049 (Arm_relocate_functions::movt_abs): New function.
13050 (Arm_relocate_functions::thm_movw_abs_nc): New function.
13051 (Arm_relocate_functions::thm_movt_abs): New function.
13052 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
13053 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
13054 (Scan::global): Likewise.
13055 (Relocate::relocate): Likewise.
13056 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13057
13058 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13059
13060 * arm.cc (Arm_relocate_functions::got_prel) New function.
13061 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
13062 (Relocate::relocate): Likewise.
13063 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13064
13065 2009-10-06 Ian Lance Taylor <iant@google.com>
13066
13067 * options.h (class General_options): Define
13068 split_stack_adjust_size parameter.
13069 * object.h (class Object): Add uses_split_stack_ and
13070 has_no_split_stack_ fields. Add uses_split_stack and
13071 has_no_split_stack accessor functions. Declare
13072 handle_split_stack_section.
13073 (class Reloc_symbol_changes): Define.
13074 (class Sized_relobj): Define Function_offsets. Declare
13075 split_stack_adjust, split_stack_adjust_reltype, and
13076 find_functions.
13077 * object.cc (Object::handle_split_stack_section): New function.
13078 (Sized_relobj::do_layout): Call handle_split_stack_section.
13079 * dynobj.cc (Sized_dynobj::do_layout): Call
13080 handle_split_stack_section.
13081 * reloc.cc (Sized_relobj::relocate_sections): Call
13082 split_stack_adjust for executable sections in split_stack
13083 objects. Pass reloc_map to relocate_section.
13084 (Sized_relobj::split_stack_adjust): New function.
13085 (Sized_relobj::split_stack_adjust_reltype): New function.
13086 (Sized_relobj::find_functions): New function.
13087 * target-reloc.h: Include "object.h".
13088 (relocate_section): Add reloc_symbol_changes parameter. Change
13089 all callers.
13090 * target.h (class Target): Add calls_non_split method. Declare
13091 do_calls_non_split virtual method. Declare match_view and
13092 set_view_to_nop.
13093 * target.cc: Include "elfcpp.h".
13094 (Target::do_calls_non_split): New function.
13095 (Target::match_view): New function.
13096 (Target::set_view_to_nop): New function.
13097 * gold.cc (queue_middle_tasks): Give an error if mixing
13098 split-stack and non-split-stack objects with -r.
13099 * i386.cc (Target_i386::relocate_section): Add
13100 reloc_symbol_changes parameter.
13101 (Target_i386::do_calls_non_split): New function.
13102 * x86_64.cc (Target_x86_64::relocate_section): Add
13103 reloc_symbol_changes parameter.
13104 (Target_x86_64::do_calls_non_split): New function.
13105 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
13106 parameter.
13107 * powerpc.cc (Target_powerpc::relocate_section): Add
13108 reloc_symbol_changes parameter.
13109 * sparc.cc (Target_sparc::relocate_section): Add
13110 reloc_symbol_changes parameter.
13111 * configure.ac: Call AM_CONDITIONAL for the default target.
13112 * configure: Rebuild.
13113 * testsuite/Makefile.am (TEST_AS): New variable.
13114 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
13115 (check_DATA): Add split_i386 and split_x86_64 files.
13116 (SPLIT_DEFSYMS): Define.
13117 (split_i386_[1234n].o): New targets.
13118 (split_i386_[124]): New targets.
13119 (split_i386_[1234r].stdout): New targets.
13120 (split_x86_64_[1234n].o): New targets.
13121 (split_x86_64_[124]): New targets.
13122 (split_x86_64_[1234r].stdout): New targets.
13123 (MOSTLYCLEANFILES): Add new executables.
13124 * testsuite/split_i386.sh: New file.
13125 * testsuite/split_x86_64.sh: New file.
13126 * testsuite/split_i386_1.s: New file.
13127 * testsuite/split_i386_2.s: New file.
13128 * testsuite/split_i386_3.s: New file.
13129 * testsuite/split_i386_4.s: New file.
13130 * testsuite/split_i386_n.s: New file.
13131 * testsuite/split_x86_64_1.s: New file.
13132 * testsuite/split_x86_64_2.s: New file.
13133 * testsuite/split_x86_64_3.s: New file.
13134 * testsuite/split_x86_64_4.s: New file.
13135 * testsuite/split_x86_64_n.s: New file.
13136 * testsuite/testfile.cc (Target_test): Update relocation_section
13137 function.
13138 * testsuite/Makefile.in: Rebuild.
13139
13140 2009-10-06 Ian Lance Taylor <iant@google.com>
13141
13142 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
13143 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
13144 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
13145 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
13146 the address on ldo_addrs_.
13147 (Target_i386::Relocate::fix_up_ldo): New function.
13148
13149 2009-10-06 Rafael Espindola <espindola@google.com>
13150
13151 * plugin.cc (add_input_library): New.
13152 (Plugin::load): Add add_input_library to tv.
13153 (Plugin_manager::add_input_file): Add the is_lib argument.
13154 (add_input_file): Update call to Plugin_manager::add_input_file.
13155 (add_input_library): New.
13156 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
13157
13158 2009-09-30 Doug Kwan <dougkwan@google.com>
13159
13160 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
13161 symbol and call Symbol::may_need_copy_reloc to determine if
13162 a copy reloc is needed.
13163 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
13164 nocopyreloc is given in command line.
13165 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
13166 given in command line.
13167 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
13168 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
13169 of the removed Target_i386::may_need_copy_reloc.
13170 * options.h (copyreloc): New option with default value false.
13171 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13172 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
13173 instead of the removed Target_powerpc::may_need_copy_reloc.
13174 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13175 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
13176 instead of the removed Target_sparc::may_need_copy_reloc.
13177 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
13178 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
13179 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
13180 instead of the removed Target_x86_64::may_need_copy_reloc.
13181
13182 2009-09-30 Ian Lance Taylor <iant@google.com>
13183
13184 * object.h (class Object): Remove target_ field, and target,
13185 sized_target, and set_target methods.
13186 (Object::sized_target): Remove.
13187 (class Sized_relobj): Update declarations. Remove sized_target.
13188 * object.cc (Sized_relobj::setup): Remove target parameter.
13189 Change all callers.
13190 (Input_objects::add_object): Don't do anything with the target.
13191 (make_elf_sized_object): Add punconfigured parameter. Change all
13192 callers. Set or test parameter target.
13193 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
13194 Change all callers.
13195 * parameters.cc (Parameters::set_target): Change parameter type to
13196 be non-const.
13197 (Parameters::default_target): Remove.
13198 (set_parameters_target): Change parameter type to be non-const.
13199 (parameters_force_valid_target): New function.
13200 (parameters_clear_target): New function.
13201 * parameters.h (class Parameters): Update declarations. Remove
13202 default_target method. Add sized_target and clear_target
13203 methods. Change target_ to be non-const.
13204 (set_parameters_target): Update declaration.
13205 (parameters_force_valid_target): Declare.
13206 (parameters_clear_target): Declare.
13207 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
13208 as NULL if we aren't searching.
13209 (Add_symbols::run): Don't check for compatible target.
13210 * fileread.cc (Input_file::open_binary): Call
13211 parameters_force_valid_target.
13212 * gold.cc (queue_middle_tasks): Likewise.
13213 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
13214 set_target on object.
13215 * dynobj.h (class Sized_dynobj): Update declarations.
13216 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
13217 make_elf_object returns NULL.
13218 (Archive::include_member): Don't check whether object target is
13219 compatible.
13220 * output.cc (Output_section::add_input_section): Get target from
13221 parameters.
13222 (Output_section::relax_input_section): Likewise.
13223 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
13224 parameters.
13225 (Sized_relobj::do_scan_relocs): Likewise.
13226 (Sized_relobj::relocate_sections): Likewise.
13227 * resolve.cc (Symbol_table::resolve): Likewise.
13228 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
13229 parameter. Change all callers.
13230 (Symbol_table::add_from_object): Get target from parameters.
13231 (Symbol_table::add_from_relobj): Don't check object target.
13232 (Symbol_table::add_from_dynobj): Likewise.
13233 (Symbol_table::define_special_symbol): Get target from
13234 parameters.
13235 * symtab.h (class Symbol_table): Update declaration.
13236 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
13237 parameter. Change all callers. Clear parameter target.
13238 (Binary_test): Test target here.
13239 * testsuite/object_unittest.cc (gold_testsuite): Remove
13240 target_test_pointer parameter. Change all callers.
13241 (Object_test): Test target here.
13242
13243 2009-09-26 Ian Lance Taylor <iant@google.com>
13244
13245 * testsuite/initpri1.c: Don't try to use constructor priorities if
13246 compiling with gcc before 4.3.
13247
13248 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
13249
13250 * testsuite/retain_symbols_file_test.sh (check_present): Change
13251 output file name to retain_symbols_file_test.stdout.
13252 (check_absent): Likewise.
13253
13254 2009-09-18 Craig Silverstein <csilvers@google.com>
13255
13256 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
13257 * options.cc: Include <cerrno> and <fstream>.
13258 (General_options::finalize): Parse -retain-symbols-file tag.
13259 * options.h: New flag.
13260 (General_options): New method should_retain_symbol, new
13261 variable symbols_to_retain.
13262 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
13263 should_retain_symbol map.
13264 * testsuite/Makefile.am (retain_symbols_file_test): New test.
13265 * testsuite/Makefile.in: Regenerate.
13266 * testsuite/retain_symbols_file_test.sh: New file.
13267
13268 2009-09-18 Nick Clifton <nickc@redhat.com>
13269
13270 * po/es.po: Updated Spanish translation.
13271
13272 2009-09-17 Doug Kwan <dougkwan@google.com>
13273
13274 * debug.h (DEBUG_RELAXATION): New constant.
13275 (DEBUG_ALL): Add DEBUG_RELAXATION.
13276 (debug_string_to_enum): Add relaxation debug option.
13277 * layout.cc
13278 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
13279 Layout::Relaxation_debug_check::read_sections,
13280 Layout::Relaxation_debug_check::read_sections): New method definitions.
13281 (Layout::Layout): Initialize data members
13282 record_output_section_data_from_scrips_,
13283 script_output_section_data_list_ and relaxation_debug_check_.
13284 (Layout::save_segments, Layout::restore_segments,
13285 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13286 Layout::relaxation_loop_body): New method definitions.
13287 (Layout::finalize): Support relaxation. Move section layout code to
13288 Layout::relaxation_loop_body.
13289 (Layout::set_asection_address_from_script): Move code for orphan
13290 section placement out.
13291 (Layout::place_orphan_sections_in_script): New method definition.
13292 * layout.h (Output_segment_headers, Output_file_header):
13293 New forward class declarations.
13294 (Layout::~Layout): Define.
13295 (Layout::new_output_section_data_from_script): New method definition.
13296 (Layout::place_orphan_sections_in_script): New method declaration.
13297 (Layout::Segment_states): New type declaration.
13298 (Layout::save_segments, Layout::restore_segments,
13299 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13300 Layout::relaxation_loop_body): New method declarations.
13301 (Layout::Output_section_data_list): New type declaration.
13302 (Layout::Relaxation_debug_check): New class definition.
13303 (Layout::record_output_section_data_from_script_,
13304 Layout::script_output_section_data_list_, Layout::segment_states_,
13305 Layout::relaxation_debug_check_): New data members.
13306 * output.cc: (Output_section_headers::do_size): New method definition.
13307 (Output_section_headers::Output_section_headers): Move size
13308 computation to Output_section_headers::do_size.
13309 (Output_segment_headers::do_size): New method definition.
13310 (Output_file_header::Output_file_header): Move size computation to
13311 Output_file_header::do_size and call it.
13312 (Output_file_header::do_size): New method definition.
13313 (Output_data_group::Output_data_group): Adjust call to
13314 Output_section_data.
13315 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
13316 (Output_symtab_xindex::do_write): Add array bound check.
13317 (Output_section::Input_section::print_to_mapfile): Handle
13318 RELAXED_INPUT_SECTION_CODE.
13319 (Output_section::Output_section): Initialize data member checkpoint_.
13320 (Output_section::~Output_section): Delete checkpoint object pointed
13321 by checkpoint_.
13322 (Output_section::add_input_section): Always add an Input_section if
13323 relaxing.
13324 (Output_section::add_merge_input_section): Add assert.
13325 (Output_section::relax_input_section): New method definition.
13326 (Output_section::set_final_data_size): Set load address to zero for
13327 an unallocated section.
13328 (Output_section::do_address_and_file_offset_have_reset_values):
13329 New method definition.
13330 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
13331 Handle relaxed input section.
13332 (Output_section::sort_attached_input_sections): Checkpoint input
13333 section list lazily.
13334 (Output_section::get_input_sections): Change type of input_sections to
13335 list of Simple_input_section pointers. Checkpoint input section list
13336 lazily. Also handle relaxed input sections.
13337 (Output_section::add_input_section_for_script): Take a reference to
13338 a Simple_input_section object instead of Relobj pointer and section
13339 index as parameter. Handle relaxed input sections.
13340 (Output_section::save_states, Output_section::restore_states): New
13341 method definitions.
13342 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
13343 (Output_data::is_data_size_fixed): New method definition.
13344 (Output_data::reset_addresss_and_file_offset): Do not reset data size
13345 if it is fixed.
13346 (Output_data::address_and_file_offset_have_reset_values): New method
13347 definition.
13348 (Output_data::do_address_and_file_offset_have_reset_values): New method
13349 definition.
13350 (Output_data::set_data_size): Check that data size is not fixed.
13351 (Output_data::fix_data_size): New method definition.
13352 (Output_data::is_data_size_fixed_): New data member.
13353 (Output_section_headers::set_final_data_size): New method definition.
13354 (Output_section_headers::do_size): New method declaration.
13355 (Output_segment_headers::set_final_data_size): New method definition.
13356 (Output_segment_headers::do_size): New method declaration.
13357 (Output_file_header::set_final_data_size)::New method definition.
13358 (Output_file_header::do_size)::New method declaration.
13359 (Output_section_data::Output_section_data): Add new parameter
13360 is_data_size_fixed and use it to fix data size.
13361 (Output_data_const::Output_data_const): Adjust call to base class
13362 constructor and fix data size.
13363 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
13364 base class constructor and fix data size.
13365 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
13366 base class constructor and fix data size.
13367 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
13368 class constructor and fix data size.
13369 (Output_data_group::set_final_data_size): New method definition.
13370 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
13371 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
13372 class constructor and fix data size.
13373 (Output_relaxed_input_section): New class definition.
13374 (Output_section::Simple_input_section): New class definition.
13375 (Output_section::get_input_sections): Adjust parameter list.
13376 (Output_section::add_input_section_for_script): Same.
13377 (Output_section::save_states, Output_section::restore_states,
13378 Output_section::do_address_and_file_offset_have_reset_values,
13379 (Output_section::Input_section::Input_section): Handle
13380 RELAXED_INPUT_SECTION_CODE. Add new overload for
13381 Output_relaxed_input_section.
13382 (Output_section::Input_section::is_input_section,
13383 Output_section::Input_section::set_output_section): Handle relaxed
13384 input section.
13385 (Output_section::Input_section::is_relaxed_input_section,
13386 Output_section::Input_section::output_section_data,
13387 Output_section::Input_section::relaxed_input_section): New method
13388 definitions.
13389 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
13390 value.
13391 (Output_section::Input_section::u1_): Update comments.
13392 (Output_section::Input_section::u2_): Add new union member poris.
13393 (Output_section::Checkpoint_output_section): New classs definition.
13394 (Output_section::relax_input_section): New method declaration.
13395 (Output_section::checkpoint_): New data member.
13396 (Output_segment): Update comments.
13397 (Output_segment::Output_segment): Un-privatize copy constructor.
13398 (Output_segment::operator=): Un-privatize.
13399 * script-sections.cc (Output_section_element::Input_section_list):
13400 Change element type to Output_section::Simple_input_section.
13401 (Output_section_element_dot_assignment::set_section_addresses):
13402 Register output section data for relaxation clean up.
13403 (Output_data_exression::Output_data_expression): Adjust call to base
13404 constructor to fix data size.
13405 (Output_section_element_data::set_section_addresses): Register
13406 Output_data_expression object for relaxation clean up.
13407 (struct Input_section_info): Replace Relobj pointer and section index
13408 pair with Output_section::Simple_input_section and Convert struct to a
13409 class.
13410 (Input_section_sorter::operator()): Adjust access to
13411 Input_section_info data member to use accessors.
13412 (Output_section_element_input::set_section_addresses): Use layout
13413 parameter. Adjust code to use Output_section::Simple_input_section
13414 and Input_secction_info classes. Register filler for relaxation
13415 clean up.
13416 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
13417 and section index pair with Output_section::Simple_input_section
13418 class. Adjust code accordingly.
13419 (Phdrs_element::release_segment): New method definition.
13420 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
13421 segment list.
13422 (Script_sections::release_segments): New method definition.
13423 * gold/script-sections.h (Script_sections::release_segments): New
13424 method declaration.
13425 * gold/target.h (Target::may_relax, Target::relax,
13426 Target::do_may_relax, Target::do_relax): New method definitions.
13427
13428 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13429
13430 * arm.cc (has_signed_unsigned_overflow): New function.
13431 (Arm_relocate_functions::abs8): New function.
13432 (Target_arm::Scan::local): Handle R_ARM_ABS8.
13433 (Target_arm::Scan::global): Likewise.
13434 (Target_arm::relocate::relocate): Likewise.
13435 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
13436 Likewise.
13437
13438 2009-09-16 Cary Coutant <ccoutant@google.com>
13439
13440 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
13441 * testsuite/Makefile.in: Regenerate.
13442
13443 2009-09-11 Nick Clifton <nickc@redhat.com>
13444
13445 * po/gold.pot: Updated by the Translation project.
13446
13447 2009-09-08 Cary Coutant <ccoutant@google.com>
13448
13449 * output.cc (Output_file::open): Add execute permission to empty file.
13450 * testsuite/Makefile.am (permission_test): New test.
13451 * testsuite/Makefile.in: Regenerate.
13452
13453 2009-09-02 Ian Lance Taylor <iant@google.com>
13454
13455 * output.cc (Output_file::resize): Call map_no_anonymous rather
13456 than map.
13457
13458 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
13459
13460 * gold.cc: Include "incremental.h".
13461 (queue_initial_tasks): Call Incremental_checker methods.
13462 * incremental.cc: Include "output.h".
13463 (Incremental_checker::can_incrementally_link_output_file): New
13464 method.
13465 * incremental.h (Incremental_checker): New class.
13466
13467 * output.cc (Output_file::open_for_modification): New method.
13468 (Output_file::map_anonymous): Changed return type to bool. Record
13469 map in base_ field.
13470 (Output_file::map_no_anonymous): New method, broken out of map.
13471 (Output_file::map): Use map_no_anonymous and map_anonymous.
13472 * output.h (class Output_file): Update declarations.
13473
13474 2009-08-24 Cary Coutant <ccoutant@google.com>
13475
13476 * options.h (Command_line::Pre_options): New class.
13477 (Command_line::pre_options): New member.
13478 * options.cc (gold::options::ready_to_register): New variable.
13479 (One_option::register_option): Do nothing if not registering options.
13480 Assert if same short option registered twice.
13481 (General_options::General_options): Turn off option registration when
13482 done constructing.
13483 (Command_line::Pre_options::Pre_options): New constructor.
13484
13485 2009-08-24 Cary Coutant <ccoutant@google.com>
13486
13487 * options.h (General_options::no_keep_memory): Remove incorrect
13488 short option.
13489
13490 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13491
13492 * Makefile.am (am__skiplex, am__skipyacc): New.
13493 * Makefile.in: Regenerate.
13494
13495 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13496
13497 * Makefile.am (AM_CPPFLAGS): Renamed from ...
13498 (INCLUDES): ... this.
13499 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
13500 (AM_CPPFLAGS): Renamed from ...
13501 (INCLUDE): ... this.
13502 * Makefile.in, testsuite/Makefile.in: Regenerate.
13503
13504 * Makefile.in: Regenerate.
13505 * aclocal.m4: Likewise.
13506 * config.in: Likewise.
13507 * configure: Likewise.
13508 * testsuite/Makefile.in: Likewise.
13509
13510 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13511 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13512 * Makefile.in: Regenerate.
13513 * testsuite/Makefile.in: Regenerate.
13514
13515 2009-08-19 Cary Coutant <ccoutant@google.com>
13516
13517 * resolve.cc (Symbol_table::resolve): Don't complain about defined
13518 symbols in shared libraries overridden by hidden or internal symbols
13519 in the main program.
13520
13521 2009-08-19 Chris Demetriou <cgd@google.com>
13522
13523 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
13524 checking source file names in error messages.
13525
13526 2009-08-18 Doug Kwan <dougkwan@google.com>
13527
13528 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
13529 an elcpp::Ehdr as parameter. Adjust call to set_target.
13530 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
13531 an elfcpp::Ehdr as parameter.
13532 * object.cc (Object::set_target): Remove the version that looks up
13533 a target and sets it.
13534 (Sized_relobj::setup): Take a Target object instead of
13535 an elfcpp::Ehdr as parameter. Adjust call to set_target.
13536 (make_elf_sized_object): Find target and ask target to
13537 make an ELF object.
13538 * object.h: (Object::set_target): Remove the version that looks up
13539 a target and sets it.
13540 (Sized_relobj::setup): Take a Target object instead of
13541 an elfcpp:Ehdr as parameter.
13542 * target.cc: Include dynobj.h.
13543 (Target::do_make_elf_object_implementation): New.
13544 (Target::do_make_elf_object): New.
13545 * target.h (Target::make_elf_object): New template declaration.
13546 (Target::do_make_elf_object): New method declarations.
13547 (Target::do_make_elf_object_implementation): New template declaration.
13548
13549 2009-08-14 Ian Lance Taylor <iant@google.com>
13550
13551 * gold.h (FUNCTION_NAME): Define.
13552 (gold_unreachable): Use FUNCTION_NAME.
13553
13554 2009-08-12 Sriraman Tallam <tmsriram@google.com>
13555
13556 * icf.cc (Icf::find_identical_sections): Issue a warning when a
13557 symbol in the --keep-unique list is not found.
13558
13559 2009-08-12 Sriraman Tallam <tmsriram@google.com>
13560
13561 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
13562 been maked as --keep-unique.
13563 (Icf::unfold_section): New function.
13564 * icf.h (Icf::unfold_section): New function.
13565 * options.h (General_options::keep_unique): New option.
13566 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
13567 * testsuite/Makefile.in: Regenerate.
13568 * testsuite/icf_keep_unique_test.sh: New file.
13569 * testsuite/icf_keep_unique_test.cc: New file.
13570
13571 2009-08-12 Cary Coutant <ccoutant@google.com>
13572
13573 PR 10471
13574 * resolve.cc (Symbol_table::resolve): Check for references from
13575 dynamic objects to hidden and internal symbols.
13576 * testsuite/Makefile.am (hidden_test.sh): New test.
13577 * testsuite/Makefile.in: Regenerate.
13578 * testsuite/hidden_test.sh: New script.
13579 * testsuite/hidden_test_1.c: New test source.
13580 * testsuite/hidden_test_main.c: New test source.
13581
13582 2009-08-11 Doug Kwan <dougkwan@google.com>
13583
13584 * arm.cc: Update comments.
13585 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
13586 segment to locate the .ARM.exidx section if present.
13587
13588 2009-08-09 Doug Kwan <dougkwan@google.com>
13589
13590 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
13591 patch.
13592
13593 2009-08-07 Sriraman Tallam <tmsriram@google.com>
13594 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
13595 compiler warnings.
13596
13597 2009-08-06 Sriraman Tallam <tmsriram@google.com>
13598
13599 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
13600 valid tls_segment only for non-debug-section relocations.
13601 * testsuite/Makefile.am: Add gc_tls_test.
13602 * testsuite/Makefile.in: Regenerate.
13603 * testsuite/gc_tls_test.cc: New file.
13604 * testsuite/gc_tls_test.sh: New file.
13605
13606 2009-08-05 Sriraman Tallam <tmsriram@google.com>
13607
13608 * icf.cc: New file.
13609 * icf.h: New file.
13610 * Makefile.am (CCFILES): Add icf.cc.
13611 (HFILES): Add icf.h
13612 * Makefile.in: Regenerate.
13613 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
13614 * gc.h (gc_process_relocs): Populate lists used by icf to contain
13615 section, symbol and addend information for the relocs.
13616 * gold.cc (queue_middle_tasks): Call identical code folding.
13617 * gold.h: Add defines for multimap.
13618 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
13619 to the call of finalize_local_symbols.
13620 * main.cc (main): Create object of class Icf.
13621 * object.cc (Sized_relobj::do_layout): Allow this function to be
13622 called twice during icf.
13623 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
13624 to sections marked as identical by icf.
13625 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
13626 when available.
13627 (Sized_relobj::do_section_entsize): New function.
13628 * object.h (Object::section_entsize): New function.
13629 (Object::do_section_entsize): New pure virtual function.
13630 (Relobj::finalize_local_symbols): Add new parameter.
13631 (Relobj::do_section_entsize): New function.
13632 * options.h (General_options::icf): New option.
13633 (General_options::icf_iterations): New option.
13634 (General_options::print_icf_sections): New option.
13635 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
13636 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
13637 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
13638 icf.
13639 * symtab.cc (Symbol_table::is_section_folded): New function.
13640 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
13641 to sections marked as identical by icf.
13642 * symtab.h (Symbol_table::set_icf): New function.
13643 (Symbol_table::icf): New function.
13644 (Symbol_table::is_section_folded): New function.
13645 (Symbol_table::icf_): New data member.
13646 * target-reloc.h (relocate_section): Ignore sections folded by icf.
13647 * testsuite/Makefile.am: Add commands to build icf_test.
13648 * testsuite/Makefile.in: Regenerate.
13649 * testsuite/icf_test.sh: New file.
13650 * testsuite/icf_test.cc: New file.
13651
13652 2009-07-24 Chris Demetriou <cgd@google.com>
13653
13654 * layout.cc (is_compressible_debug_section): Fix incorrect
13655 comment about compressed section names.
13656
13657 2009-07-20 Ian Lance Taylor <ian@airs.com>
13658
13659 PR 10419
13660 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
13661
13662 2009-07-16 Ian Lance Taylor <iant@google.com>
13663
13664 PR 10400
13665 * layout.h: #include <map>.
13666 (class Kept_section): Change from struct to class. Add accessors
13667 and setters. Add section size to Comdat_group mapping. Change
13668 Comdat_group to std::map. Add is_comdat_ field. Add
13669 linkonce_size field in union.
13670 (class Layout): Update declaration of find_or_add_kept_section.
13671 Don't declare find_kept_object.
13672 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
13673 parameter. Add object, shndx, is_comdat, and is_group_name
13674 parameters. Change all callers. Adjust for new Kept_section.
13675 (Layout::find_kept_object): Remove.
13676 * object.cc (Sized_relobj::include_section_group): Update use of
13677 Kept_section. Rename secnum to shndx. Only record
13678 Kept_comdat_section if sections are the same size.
13679 (Sized_relobj::include_linkonce_section): Update use of
13680 Kept_section. Only record Kept_comdat_section if sections are the
13681 same size. Set size of linkonce section.
13682 (Sized_relobj::map_to_kept_section): Update call to
13683 get_kept_comdat_section.
13684 * object.h (class Sized_relobj): Rename fields in
13685 Kept_comdat_section to drop trailing underscores; change object
13686 field to Relobj*. Change Kept_comdat_section_table to store
13687 struct rather than pointer.
13688 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
13689 Add kept_object and kept_shndx parameters. Change all callers.
13690 (Sized_relobj::get_kept_comdat_section): Change return type to
13691 bool. Add kept_object and kept_shndx parameters. Change all
13692 callers.
13693 * plugin.cc (Pluginobj::include_comdat_group): Update call to
13694 Layout::find_or_add_kept_section.
13695
13696 2009-07-09 Ian Lance Taylor <iant@google.com>
13697
13698 * merge.cc (Object_merge_map::initialize_input_to_output_map):
13699 Reserve space in the hash table.
13700
13701 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
13702
13703 * fileread.cc (File_read::get_mtime): New method.
13704 * fileread.h (Timespec): New structure.
13705 (File_read::get_mtime): New method.
13706 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
13707 Renamed from timestamp_nsec.
13708 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
13709 Elf_Xword.
13710 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
13711 timestamp_nsec.
13712 (Incremental_inputs::report_archive): Save mtime; style fix.
13713 (Incremental_inputs::report_obejct): Save mtime; style fix.
13714 (Incremental_inputs::report_script): Save mtime; style fix.
13715 (Incremental_inputs::finalize_inputs): Style fix.
13716 (Incremental_inputs::finalize): Style fix.
13717 (Incremental_inputs::create_input_section_data): Store inputs
13718 mtime.
13719 * incremental.h (Incremental_inputs::report_script): Add mtime
13720 argument.
13721 (Incremental_inputs::Input_info::Input_info): Intialize only one
13722 union member.
13723 (Incremental_inputs::Input_info::archive): Move to nameless
13724 union.
13725 (Incremental_inputs::Input_info::obejct): Move to nameless union.
13726 (Incremental_inputs::Input_info::script): Move to nameless union.
13727 (Incremental_inputs::mtime): New field.
13728 * script.cc (read_input_script): Pass file mtime to
13729 Incremental_input.
13730 * script.h (Script_info::inputs): Style fix.
13731
13732 2009-07-01 Ian Lance Taylor <ian@airs.com>
13733
13734 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
13735 instead of 32.
13736
13737 2009-06-24 Ian Lance Taylor <iant@google.com>
13738
13739 PR 10156
13740 * layout.cc (Layout::choose_output_section): If we find an
13741 existing section, update the flags.
13742 (Layout::create_notes): New function, broken out of
13743 Layout::finalize.
13744 (Layout::finalize): Don't create note sections.
13745 (Layout::create_note): Don't crash if linker script discards
13746 section.
13747 (Layout::create_gold_note): Likewise.
13748 (Layout::create_build_id): Likewise. Don't set
13749 after_input_sections on the section.
13750 (Layout::create_executable_stack_info): Remove target parameter.
13751 Change caller.
13752 * layout.h (class Layout): Declare create_notes. Update
13753 declaration of create_executable_stack_info.
13754 * gold.cc (queue_middle_tasks): Call create_notes.
13755 * output.cc (Output_section::update_flags_for_input_section): Move
13756 here from output.h. If SHF_ALLOC flag is newly set, mark address
13757 invalid.
13758 * output.h (Output_data::mark_address_invalid): New function.
13759 (class Output_section): Only declare, not define,
13760 update_flags_for_input_section. Remove set_flags.
13761
13762 2009-06-24 Ian Lance Taylor <iant@google.com>
13763
13764 * script-sections.cc (Output_section_definition::
13765 set_section_addresses): Rename shadowing local load_address to
13766 laddr.
13767
13768 2009-06-24 Ian Lance Taylor <iant@google.com>
13769
13770 PR 10244
13771 * reloc.cc (relocate_sections): Skip empty relocation sections.
13772
13773 2009-06-23 Ian Lance Taylor <iant@google.com>
13774
13775 PR 10156
13776 * layout.cc (Layout::create_note): Use choose_output_section
13777 rather than make_output_section.
13778
13779 2009-06-23 Ian Lance Taylor <iant@google.com>
13780
13781 PR 10237
13782 * options.cc (General_options::parse_V): Set printed_version_.
13783 (General_options::General_options): Initialize printed_version_.
13784 * options.h (class General_options): Add printed_version_ field.
13785 * gold.cc (queue_initial_tasks): If there are no input files,
13786 don't give a fatal error if we printed the version information.
13787 (queue_middle_tasks): If using -r with a shared object, give a
13788 fatal error rather than an ordinary error.
13789
13790 2009-06-23 Ian Lance Taylor <iant@google.com>
13791
13792 PR 10219
13793 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
13794 (Layout::make_output_section): Set have_stabstr_section_ if we see
13795 a .stab*str section.
13796 (Layout::finalize): Call link_stabs_sections.
13797 (Layout::link_stabs_sections): New file.
13798 * layout.h (class Layout): Add have_stabstr_section_ field.
13799 Declare link_stabs_sections.
13800
13801 2009-06-23 Doug Kwan <dougkwan@google.com>
13802
13803 * Makefile.am (libgold_a_LIBADD): New.
13804 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
13805 * Makefile.in: Regenerate.
13806 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
13807 * configure: Regenerate.
13808 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
13809 * fileread.cc: Include sys/state.h
13810 * gold.h: Declare memmem and strndup if found missing.
13811 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
13812
13813 2009-06-23 Ian Lance Taylor <iant@google.com>
13814
13815 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
13816 * configure: Rebuild.
13817
13818 2009-06-23 Ian Lance Taylor <iant@google.com>
13819
13820 PR 10147
13821 * object.cc (Object::section_contents): Don't try to get a view if
13822 the section has length zero.
13823 (Object::handle_gnu_warning_section): If the section is empty, use
13824 the name of the section as the warning.
13825
13826 2009-06-23 Ian Lance Taylor <iant@google.com>
13827
13828 PR 10133
13829 * stringpool.h (class Stringpool_template): Add optimize_ field.
13830 (Stringpool_template::set_optimize): New function.
13831 * stringpool.cc (Stringpool_template::Stringpool_template):
13832 Initialize optimize_ field.
13833 (Stringpool_template::set_string_offsets): Test local optimize
13834 fild rather than parameter.
13835 * layout.cc (Layout::Layout): Call set_optimize on the section
13836 name stringpool.
13837
13838 2009-06-22 Ian Lance Taylor <iant@google.com>
13839
13840 PR 10030
13841 * yyscript.y: Parse TARGET.
13842 * script.cc (script_set_target): New function.
13843 * script-c.h (script_set_target): Declare.
13844 * options.cc (General_options::string_to_object_format): Rename
13845 from string_to_object_format in anonymous namespace. Change
13846 callers.
13847 * options.h (class General_options): Declare
13848 string_to_object_format.
13849
13850 2009-06-22 Ian Lance Taylor <iant@google.com>
13851
13852 * script-sections.cc (Script_sections::create_segments): Don't put
13853 program headers in a PT_LOAD segment if -n or -N.
13854
13855 2009-06-22 Ian Lance Taylor <iant@google.com>
13856
13857 PR 10141
13858 * options.h (class General_options): Add -z lazy and -z now. Sort
13859 -z options into alphabetical order.
13860 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
13861
13862 2009-06-21 Ian Lance Taylor <iant@google.com>
13863
13864 * layout.cc (Layout::make_output_section): Call
13865 Target::new_output_section.
13866 (Layout::attach_allocated_section_to_segment): Put large section
13867 sections in a separate load segment with the large segment flag
13868 set.
13869 (Layout::segment_precedes): Sort large data segments after other
13870 load segments.
13871 (align_file_offset): New static function.
13872 (Layout::set_segment_offsets): Use align_file_offset.
13873 * output.h (class Output_section): Add is_small_section_ and
13874 is_large_section_ fields.
13875 (Output_section::is_small_section): New function.
13876 (Output_section::set_is_small_section): New function.
13877 (Output_section::is_large_section): New function.
13878 (Output_section::set_is_large_section): New function.
13879 (Output_section::is_large_data_section): New function.
13880 (class Output_segment): Add is_large_data_segment_ field.
13881 (Output_segment::is_large_data_segment): New function.
13882 (Output_segment::set_is_large_data_segment): New function.
13883 * output.cc (Output_section::Output_section): Initialize new
13884 fields.
13885 (Output_segment::Output_segment): Likewise.
13886 (Output_segment::add_output_section): Add assertion that large
13887 data sections always go in large data segments. Force small data
13888 sections to the end of the list of data sections. Force small BSS
13889 sections to the start of the list of BSS sections. For large BSS
13890 sections to the end of the list of BSS sections.
13891 * symtab.h (class Symbol): Declare is_common_shndx.
13892 (Symbol::is_defined): Check Symbol::is_common_shndx.
13893 (Symbol::is_common): Likewise.
13894 (class Symbol_table): Define enum Commons_section_type. Update
13895 declarations. Add small_commons_ and large_commons_ fields.
13896 * symtab.cc (Symbol::is_common_shndx): New function.
13897 (Symbol_table::Symbol_table): Initialize new fields.
13898 (Symbol_table::add_from_object): Put small and large common
13899 symbols in the right list.
13900 (Symbol_table::sized_finalized_symbol): Check
13901 Symbol::is_common_shndx.
13902 (Symbol_table::sized_write_globals): Likewise.
13903 * common.cc (Symbol_table::do_allocate_commons): Allocate new
13904 common symbol lists. Don't call do_allocate_commons_list if the
13905 list is empty.
13906 (Symbol_table::do_allocate_commons_list): Remove is_tls
13907 parameter. Add comons_section_type parameter. Change all
13908 callers. Handle small and large common symbols.
13909 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
13910 Symbol::is_common_shndx.
13911 * resolve.cc (symbol_to_bits): Likewise.
13912 * target.h (Target::small_common_shndx): New function.
13913 (Target::small_common_section_flags): New function.
13914 (Target::large_common_shndx): New function.
13915 (Target::large_common_section_flags): New function.
13916 (Target::new_output_section): New function.
13917 (Target::Target_info): Add small_common_shndx, large_common_shndx,
13918 small_common_section_flags, and large_common_section_flags
13919 fields.
13920 (Target::do_new_output_section): New virtual function.
13921 * arm.cc (Target_arm::arm_info): Initialize new fields.
13922 * i386.cc (Target_i386::i386_info): Likewise.
13923 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
13924 Likewise.
13925 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
13926 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13927 (Target_x86_64::do_new_output_section): New function.
13928 * configure.ac: Define conditional MCMODEL_MEDIUM.
13929 * testsuite/Makefile.am (check_PROGRAMS): Add large.
13930 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
13931 (large_LDFLAGS): Define.
13932 * testsuite/large.c: New file.
13933 * testsuite/testfile.cc (Target_test::test_target_info):
13934 Initialize new fields.
13935 * configure, testsuite/Makefile.in: Rebuild.
13936
13937 2009-06-05 Doug Kwan <dougkwan@google.com>
13938
13939 * Makefile.am (CCFILES): Add target.cc.
13940 * Makefile.in: Regenerate.
13941 * i386.cc (class Target_i386): Define new virtual method to
13942 override do_is_local_label_name in parent.
13943 * object.cc (Sized_relobj::do_count_local_symbols): Discard
13944 local symbols if --discard-locals or -X is given.
13945 * options.h (class General_options): Declare new options
13946 '--discard-locals' and '-X' for discarding locals.
13947 * target.h (class Target): Define new methods is_local_label_name.
13948 Declare new virtual method do_is_local_label_name.
13949 * target.cc: New file.
13950 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
13951 (check_SCRIPTS): Add discard_locals_test.sh.
13952 (check_DATA): Add discard_local_tests.syms.
13953 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
13954 (discard_local_tests.syms, discard_locals_test.o): New make rules.
13955 * testsuite/Makefile.in: Regenerate.
13956 * testsuite/discard_locals_test.c: New file.
13957 * testsuite/discard_locals_test.sh: Same.
13958
13959 2009-06-05 Doug Kwan <dougkwan@google.com>
13960
13961 * object.cc (Sized_relobj::Sized_relobj): Initialize
13962 discarded_eh_frame_shndx_ to -1U.
13963 (Sized_relobj::do_layout): Record index of a discard .eh_frame
13964 section.
13965 (Sized_relobj::do_count_local_symbols): Skip local symbols in
13966 a discarded .eh_frame section.
13967 (Sized_relobj::do_finalize_local_symbols): Ditto.
13968 * object.h (class Sized_relobj): Declare new member
13969 discarded_eh_frame_shndx_.
13970 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
13971 (local_labels_test.o, local_labels_test): New rules.
13972 * testsuite/Makefile.in: Regenerate.
13973
13974 2009-06-04 Doug Kwan <dougkwan@google.com>
13975
13976 * layout.cc (Layout::section_name_mapping): Add mapping for
13977 special ARM sections.
13978
13979 2009-06-03 Doug Kwan <dougkwan@google.com>
13980
13981 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
13982 (utils::has_overflow): Same.
13983
13984 2009-06-03 Ian Lance Taylor <iant@google.com>
13985
13986 * layout.cc (Layout::section_name_mapping): New array, replacing
13987 Layout::linkonce_mapping.
13988 (Layout::section_name_mapping_count): New variable, replacing
13989 Layout::linkonce_mapping_count.
13990 (Layout::linkonce_output_name): Remove.
13991 (Layout::output_section_name): Rewrite.
13992 * layout.h (class Layout): Rename Linkonce_mapping to
13993 Section_name_mapping, linkonce_mapping to section_name_mapping,
13994 linkonce_mapping_count to section_name_mapping_count. Don't
13995 declare linkonce_output_name.
13996
13997 2009-06-03 Doug Kwan <dougkwan@google.com>
13998
13999 * gold/arm.cc (namespace utils): New.
14000 (Target_arm::reloc_is_non_pic): Define new method.
14001 (class Arm_relocate_functions): New.
14002 (Target_arm::Relocate::relocate): Handle relocation types used by
14003 Android.
14004
14005 2009-06-03 Ian Lance Taylor <iant@google.com>
14006
14007 * arm.cc (Target_arm::scan::global): Use || instead of |.
14008
14009 2009-06-02 Doug Kwan <dougkwan@google.com>
14010
14011 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
14012 issued_non_pic_error_.
14013 (class Target_arm::Scan): Declare new method check_non_pic.
14014 Define new method symbol_needs_plt_entry.
14015 Declare new data member issued_non_pic_error_.
14016 (class Target_arm::Relocate): Declare new method
14017 should_apply_static_reloc.
14018 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
14019 (Target_arm::Scan::check_non_pic): Define new method.
14020 (Target_arm::Scan::local): Handle a small subset of reloc types used
14021 by Android.
14022 (Target_arm::Scan::local): Same.
14023 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
14024
14025 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
14026
14027 * incremental.cc (Incremental_inputs::report_command_line): Filter
14028 out --incremental-* options.
14029
14030 2009-05-29 Doug Kwan <dougkwan@google.com>
14031
14032 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
14033 template class.
14034 (class Target_arm): Update comment.
14035 (Target_arm::Target_arm): Initialize new data members GOT_,
14036 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
14037 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
14038 and Target_arm::rel_dyn_section.
14039 Declare new_enum Target_arm::Got_type.
14040 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
14041 and DYNBSS_.
14042 Update commments for member do_dynsym_value.
14043 (Target_arm::got_size, Target_arm::plt_section,
14044 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
14045 new methods inside class defintion.
14046 (Target_arm::got_section): Define new method.
14047 (Target_arm::rel_dyn_section): Same.
14048 (Output_data_plt_arm): New template class.
14049 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
14050 (Output_data_plt_arm:do_adjust_output_section): Define new method.
14051 (Output_data_plt_arm::add_entry): Same.
14052 (Output_data_plt_arm::first_plt_entry): Define new
14053 static data member for PLT instruction template.
14054 (Output_data_plt_arm::plt_entry): Same.
14055 (Output_data_plt_arm::do_write): Define new method.
14056 (Target_arm::make_plt_entry): Same.
14057 (Target_arm::do_finalize_sections): Same.
14058 (Target_arm::do_dynsym_value): Same.
14059
14060 2009-05-28 Doug Kwan <dougkwan@google.com>
14061
14062 * Makefile.am (TARGETSOURCES): Add arm.cc.
14063 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
14064 * Makefile.in: Regenerate.
14065 * arm.cc: New file.
14066 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
14067
14068 2009-05-26 Doug Kwan <dougkwan@google.com>
14069
14070 * options.cc (General_options::parse_exclude_libs). Fix a comment.
14071 (General_options::check_excluded_libs): Strip off directories in
14072 archive name before matching like GNU ld does.
14073 * testsuite/Makefile.am (MOSTLYCLEANFILES,
14074 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
14075 (exclude_libs_test_LDFLAGS): Add linker option
14076 -Wl,--exclude-libs,libexclude_libs_test_3
14077 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
14078 an explicit archive without using -l.
14079 (alt/libexclude_libs_test_3.a): New make rule.
14080 * testsuite/Makefile.in: Regenerate.
14081 * testsuite/exclude_libs_test.c : Declare lib3_default().
14082 (main): Call it.
14083 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
14084 * exclude_libs_test_3.c: New file.
14085
14086 2009-05-26 Nick Clifton <nickc@redhat.com>
14087
14088 * po/id.po: New Indonesian translation.
14089 * po/gold.pot: Updated template file.
14090
14091 2009-05-22 Sriraman Tallam <tmsriram@google.com>
14092
14093 * testsuite/Makefile.am: Add -ffunction-sections to compile
14094 gc_comdat_test files. Add -Wl,--gc-sections to build
14095 gc_comdat_test.
14096 * testsuite/Makefile.in: Regenerate.
14097 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
14098
14099 2009-05-21 Sriraman Tallam <tmsriram@google.com>
14100
14101 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
14102 kept comdat section was garbage collected.
14103 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
14104 * testsuite/Makefile.in: Regenerate.
14105 * testsuite/gc_comdat_test.sh: New file.
14106 * testsuite/gc_comdat_test_1.cc: New file.
14107 * testsuite/gc_comdat_test_2.cc: New file.
14108
14109 2009-05-19 Doug Kwan <dougkwan@google.com>
14110
14111 * archive.cc (Archive::Archive): Move constructor from archive.h
14112 to here. Initialize no_export_.
14113 (Archive::get_elf_object_for_member): Set no_export flag of object.
14114 * archive.h (Archive::Archive): Move constructor body to
14115 archive.cc.
14116 (Archive::no_export): New method.
14117 (Archive::no_export_): New field.
14118 * object.h (Object::Object): Initialize no_export_ to false.
14119 (Object::no_export, Object::set_no_export): New methods.
14120 (Object::no_export_): New field.
14121 * options.cc (General_options::parse_exclude_libs): New method.
14122 (General_options::check_excluded_libs) Same.
14123 * options.h (exclude_libs): New option.
14124 (General_options::check_excluded_libs): New method declaration.
14125 (General_options::excluded_libs_): New field.
14126 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
14127 default or protected visibility if an object has no-export flag set.
14128 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
14129 (check_SCRIPTS): Add exclude_libs_test.sh.
14130 (check_DATA): Add exclude_libs_test.syms.
14131 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
14132 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
14133 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
14134 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
14135 (exclude_libs_test.syms, libexclude_libs_test_1.a,
14136 libexclude_libs_test_2.a): New rules.
14137 * testsuite/Makefile.in: Regenerate.
14138 * testsuite/exclude_libs_test.c: New file.
14139 * testsuite/exclude_libs_test.sh: Ditto.
14140 * testsuite/exclude_libs_test_1.c: Ditto.
14141 * testsuite/exclude_libs_test_2.c: Ditto.
14142
14143 2009-05-15 Ian Lance Taylor <iant@google.com>
14144
14145 * configure.ac: Check for declarations for cases where libiberty.h
14146 checks HAVE_DECL_xxx.
14147 * configure, config.in: Rebuild.
14148
14149 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
14150
14151 * gold.h (Incremental_argument_list): Remove (invalid) forward
14152 declaration.
14153 * incremental.cc (Incremental_inputs::report_achive): New method.
14154 (Incremental_inputs::report_object): New method.
14155 (Incremental_inputs::report_script): New method.
14156 (Incremental_inputs::finalize_inputs): New method.
14157 (Incremental_inputs::finalize): Call finalize_inputs().
14158 (Incremental_inputs::sized_create_incremental_inputs_section_data):
14159 Create inputs entries.
14160 * incremental.h (Incremental_input_type): New enum.
14161 (Incremental_inputs::Incremental_input): Initialize new fields.
14162 (Incremental_inputs::report_inputs): New method.
14163 (Incremental_inputs::report_achive): New method.
14164 (Incremental_inputs::report_object): New method.
14165 (Incremental_inputs::report_script): New method.
14166 (Incremental_inputs::finalize_inputs): New method.
14167 (Incremental_inputs::Input_info): New struct.
14168 (Incremental_inputs::Input_info_map): New typedef.
14169 (Incremental_inputs::lock_): New field.
14170 (Incremental_inputs::Inputs_): New field.
14171 (Incremental_inputs::Inputs_map): New field.
14172 * main.cc (main): Call Incremental_input::report_inputs.
14173 * options.h (Input_argument_list): Typedef moved from
14174 Input_arguments.
14175 (Input_file_group::Files): Remove, use ::Input_argument_list.
14176 (Input_file_group::Input_argument_list): Remove, use
14177 ::Input_argument_list.
14178 * plugin.cc (Plugin_manager::add_input_file): Add error in
14179 incremental build.
14180 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
14181 functions.
14182 * script.cc (read_input_script): Call
14183 Incremental_input::report_script.
14184 * script.h (Script_info): New class.
14185
14186 2009-04-27 Ian Lance Taylor <iant@google.com>
14187
14188 * x86_64.cc (do_adjust_output_section): Set entsize to
14189 plt_entry_size.
14190
14191 2009-04-23 Elliott Hughes <enh@google.com>
14192
14193 * output.cc (Output_file::close): After short writes, continue
14194 writing from the correct offset in the buffer being written.
14195
14196 2009-04-23 Chris Demetriou <cgd@google.com>
14197
14198 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
14199 * configure: Regenerate.
14200 * config.in: Regenerate.
14201 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
14202 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
14203
14204 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
14205
14206 * incremental.cc (Incremental_inputs_header_data): Renamed from
14207 Incremental_input_header_data.
14208 (Incremental_inputs_header_data::data_size): New field.
14209 (Incremental_inputs_header_data::put_input_file_count): Renamed
14210 from input_file_count.
14211 (Incremental_inputs_header_data::put_command_line_offset): Renamed
14212 from command_line_offset.
14213 (Incremental_inputs_header_data::put_reserved): Renamed from
14214 put_reserved.
14215 (Incremental_inputs_entry_data): Renamed from
14216 Incremental_input_entry_data.
14217 (Incremental_inputs_entry_data::data_size): New field.
14218 (Incremental_inputs::report_command_line): New method.
14219 (Incremental_inputs::finalize): New method.
14220 (Incremental_inputs::create_incremental_inputs_data): New method.
14221 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
14222 * incremental.h: New file.
14223 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
14224 (Layout::finalize): Create incremental inputs section in
14225 incremental builds.
14226 (Layout::create_incremental_info_sections): New method.
14227 * layout.h (Layout::incremental_inputs): New method.
14228 (Layout::create_incremental_info_sections): New method.
14229 (Layout::incremental_inputs_): New field.
14230 * main.cc (main): Notify Incremental_input of the command line.
14231
14232 2009-04-01 Ian Lance Taylor <iant@google.com>
14233 Mikolaj Zalewski <mikolajz@google.com>
14234
14235 * gold.h (reserve_unordered_map): Define, three versions, one for
14236 each version of Unordered_map.
14237 * layout.cc (Layout::Layout): Remove options parameter. Add
14238 number_of_input_files parameter. Don't initialize options_.
14239 Initialize number_of_input_files_ and resized_signatures_. Move
14240 sections_are_attached_.
14241 (Layout::layout_group): Reserve space for group_signatures_.
14242 (Layout::find_or_add_kept_section): Change name parameter to be a
14243 reference. Resize signatures_ map when it gets large enough.
14244 (Layout::layout_eh_frame): Use parameters->options() instead of
14245 this->options_.
14246 (Layout::make_output_section): Likewise.
14247 (Layout::attach_allocated_section_to_segment): Likewise.
14248 (Layout::finalize, Layout::create_executable_stack): Likewise.
14249 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
14250 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
14251 * layout.h (class Layout): Update declarations. Remove options_
14252 field. Add number_of_input_files_ and resized_signatures_
14253 fields. Move sections_are_attached_ field.
14254 * main.cc (main): Pass number of input files to Layout
14255 constructor. Don't pass options.
14256
14257 2009-03-30 Ian Lance Taylor <iant@google.com>
14258
14259 * ffsll.c (ffsll): Correct implementation.
14260
14261 2009-03-27 Ian Lance Taylor <iant@google.com>
14262
14263 * ffsll.c: New file.
14264 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
14265 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
14266 * ftruncate.c (ftruncate): Declare before definition.
14267 * mremap.c (mremap): Likewise.
14268 * pread.c (pread): Likewise.
14269 * configure, Makefile.in, config.in: Rebuild.
14270
14271 * mremap.c: New file.
14272 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
14273 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
14274 (mremap): Declare if HAVE_MREMAP is not defined.
14275 * configure, Makefile.in, config.in: Rebuild.
14276
14277 2009-03-27 Cary Coutant <ccoutant@google.com>
14278
14279 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
14280 position independent.
14281 * sparc.cc (Target_sparc::check_non_pic): Likewise.
14282 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
14283
14284 2009-03-24 Cary Coutant <ccoutant@google.com>
14285
14286 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
14287 an executable.
14288 (needs_dynamic_reloc): Likewise.
14289
14290 2009-03-24 Ian Lance Taylor <iant@google.com>
14291
14292 * yyscript.y (file_cmd): Recognize EXTERN.
14293 (extern_name_list, extern_name_list_body): New nonterminals.
14294 * script.cc (script_add_extern): Define.
14295 * script-c.h (script_add_extern): Declare.
14296
14297 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
14298
14299 * object.cc (is_elf_object): Define.
14300 * object.h (is_elf_object): Declare.
14301 * archive.cc (Archive::get_elf_object_for_member): Call
14302 is_elf_object.
14303 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
14304
14305 2009-03-24 Elliott Hughes <enh@google.com>
14306
14307 * output.cc (Output_file::map_anonymous): Define.
14308 (Output_file::map): Use map_anonymous. If the regular mmap fails,
14309 try an anonymous one. Report the size if the mmap fails.
14310 * output.h (class Output_file): Declare map_anonymous.
14311
14312 2009-03-24 Ian Lance Taylor <iant@google.com>
14313
14314 * target-select.cc (instantiate_target): Don't acquire the lock if
14315 the instantiated_target_ field has already been set.
14316
14317 2009-03-23 Ian Lance Taylor <iant@google.com>
14318
14319 * gold-threads.h (class Initialize_lock): Define.
14320 * gold-threads.cc (class Initialize_lock_once): Define.
14321 (initialize_lock_control): New static variable.
14322 (initialize_lock_pointer): New static variable.
14323 (initialize_lock_once): New static function.
14324 (Initialize_lock::Initialize_lock): Define.
14325 (Initialize_lock::initialize): Define.
14326 * target-select.h: Include "gold-threads.h".
14327 (class Target_selector): Add lock_ and initialize_lock_ fields.
14328 Don't define instantiate_target, just declare it.
14329 * target-select.cc (Target_selector::Target_selector): Initialize
14330 new fields.
14331 (Target_selector::instantiate_target): Define.
14332 * descriptors.h: Include "gold-threads.h".
14333 (class Descriptors): Add initialize_lock_ field.
14334 * descriptors.cc (Descriptors::Descriptors): Initialize new
14335 field.
14336 (Descriptors::open): Use initialize_lock_ field
14337 * errors.h (class Errors): Add initialize_lock_ field.
14338 * errors.cc (Errors::Errors): Initialize new field.
14339 (Errors::initialize_lock): Use initialize_lock_ field.
14340 * powerpc.cc (class Target_selector_powerpc): Remove
14341 instantiated_target_ field. In do_recognize call
14342 instantiate_target rather than do_instantiate_target. In
14343 do_instantiate_target just allocate a new target.
14344 * sparc.cc (class Target_selector_sparc): Likewise.
14345
14346 * freebsd.h: New file.
14347 * i386.cc: Include "freebsd.h".
14348 (Target_i386): Derive from Target_freebsd rather than
14349 Sized_target.
14350 (Target_selector_i386): Derive from Target_selector_freebsd rather
14351 than Target_selector.
14352 * x86_64.cc: Include "freebsd.h".
14353 (Target_x86_64): Derive from Target_freebsd rather than
14354 Sized_target.
14355 (Target_selector_x86_64): Derive from Target_selector_freebsd
14356 rather than Target_selector.
14357 * target.h (class Target): Add adjust_elf_header and
14358 do_adjust_elf_header.
14359 * output.cc (Output_file_header:: do_sized_write): Call target
14360 adjust_elf_header routine.
14361 * configure.tgt: Set targ_osabi.
14362 * configure.ac: Define GOLD_DEFAULT_OSABI.
14363 * parameters.cc (Parameters::default_target): Pass
14364 GOLD_DEFAULT_OSABI to select_target.
14365 * target-select.h (class Target_selector): Make instantiate_target
14366 protected rather than private.
14367 * Makefile.am (HFILES): Add freebsd.h.
14368 * configure, Makefile.in, config.in: Rebuild.
14369
14370 * merge.cc (do_add_input_section): Correct pend value. Change
14371 message about last entry not being null terminated from error to
14372 warning.
14373
14374 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
14375
14376 * incremental.cc: New file.
14377 * Makefile.am (CCFILES): Add incremental.cc.
14378 * Makefile.in: Rebuild.
14379
14380 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
14381
14382 * layout.cc (Layout::output_section_name): Preserve names
14383 of '.note.' sections.
14384
14385 2009-03-19 Ian Lance Taylor <iant@google.com>
14386
14387 * descriptors.cc (Descriptors::open): Check that the options are
14388 valid before using them.
14389
14390 2009-03-18 Ian Lance Taylor <iant@google.com>
14391
14392 * script-sections.h: Include <list>.
14393 (class Script_sections): Change Sections_elements from std::vector
14394 to std::list. Typedef public Elements_iterator. Add
14395 orphan_section_placement_, data_segment_align_start_, and
14396 saw_data_segment_align_ fields. Remove data_segment_align_index_
14397 field.
14398 * script-sections.cc (class Orphan_section_placement): New class.
14399 (class Sections_element): Add virtual functions is_relro and
14400 orphan_section_init. Remove virtual function place_orphan_here.
14401 (class Output_section_definition): Add is_relro and
14402 orphan_section_init. Remove place_orphan_here.
14403 (class Orphan_output_section): Likewise.
14404 (Script_sections::Script_sections): Update for field changes.
14405 (Script_sections::data_segment_align): Set saw_data_segment_align_
14406 and data_segment_align_start_, not data_segment_align_index.
14407 (Script_sections::data_segment_relro_end): Check
14408 saw_data_segment_align_. Use data_segment_align_start_ rather
14409 than data_segment_align_index_.
14410 (Script_sections::place_orphan): Rewrite to use
14411 Orphan_section_placement.
14412
14413 2009-03-17 Ian Lance Taylor <iant@google.com>
14414
14415 * archive.cc (Archive::add_symbols): Check for a version attached
14416 to the symbol name in the archive map.
14417 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
14418 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
14419 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
14420 (ver_test_11.a): New target.
14421 * testsuite/Makefile.in: Rebuild.
14422
14423 * configure.ac: Check for chsize and posix_fallocate. Replace
14424 ftruncate.
14425 * ftruncate.c: New file, from gnulib.
14426 * output.cc (posix_fallocate): Define dummy version if not
14427 HAVE_POSIX_FALLOCATE.
14428 (Output_file::map): Call posix_fallocate rather than lseek and
14429 write.
14430 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
14431 * configure, Makefile.in, config.in: Rebuild.
14432
14433 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
14434
14435 * layout.h (Layout::create_note): Add section_name parameter.
14436 * layout.cc (Layout::create_note): Likewise.
14437 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
14438
14439 2009-03-17 Ian Lance Taylor <iant@google.com>
14440
14441 * descriptors.cc: Include "options.h".
14442 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
14443 (Descriptors::open): Always use O_CLOEXEC when opening a new
14444 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
14445 then set FD_CLOEXEC.
14446
14447 * sparc.cc (class Target_sparc): Add has_got_section.
14448 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
14449 make sure we have a GOT section.
14450
14451 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
14452 (Target_sparc::Scan::local): Likewise.
14453 (Target_sparc::Scan::global): Likewise.
14454 (Target_sparc::Relocate::relocate): Likewise.
14455 (Target_sparc::Relocate::relocate_tls): Likewise.
14456
14457 * symtab.cc (Symbol_table::define_default_version): New function,
14458 broken out of add_from_object.
14459 (Symbol_table::add_from_object): Call define_default_version.
14460 (Symbol_table::define_special_symbol): Add resolve_oldsym
14461 parameter. Change all callers. If the version for a symbol comes
14462 from a version script, resolve it with the symbol with the same
14463 name with no version. Also add the symbol without a version if
14464 appropriate.
14465 (do_define_in_output_data): If resolving with oldsym, don't delete
14466 sym.
14467 (do_define_in_output_segment): Likewise.
14468 (do_define_as_constant): Likewise.
14469 * symtab.h (class Symbol_table): Update declarations.
14470
14471 2009-03-13 Ian Lance Taylor <iant@google.com>
14472
14473 * readsyms.cc (Read_symbols::incompatible_warning): New function.
14474 (Read_symbols::requeue): New function.
14475 (Read_symbols::do_read_symbols): If make_elf_object fails because
14476 the target type is not configured, and the file was searched for,
14477 issue a warning and retry with the next directory.
14478 (Add_symbols::run): If the file has an incompatible format, and
14479 it was searched for, requeue the Read_symbols task. On error,
14480 release the object.
14481 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
14482 dirindex parameter to constructor. Change all callers. Declare
14483 incompatible_warning and requeue.
14484 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
14485 input_argument_ and input_group_ fields. Add them to
14486 constructor. Change all callers.
14487 (class Read_script): Add dirindex_ field. Add it to constructor.
14488 Change all callers.
14489 * archive.cc (Archive::setup): Remove input_objects parameter.
14490 Change all callers.
14491 (Archive::get_file_and_offset): Likewise.
14492 (Archive::read_all_symbols): Likewise.
14493 (Archive::read_symbols): Likewise.
14494 (Archive::get_elf_object_for_member): Remove input_objects
14495 parameter. Add punconfigured parameter. Change all callers.
14496 (Archive::add_symbols): Change return type to bool. Check return
14497 value of include_member.
14498 (Archive::include_all_members): Likewise.
14499 (Archive::include_member): Change return type to bool. Return
14500 false if first included object has incompatible target. Set
14501 included_member_ field.
14502 (Add_archive_symbols::run): If add_symbols returns false, requeue
14503 Read_symbols task.
14504 * archive.h (class Archive): Add included_member_ field.
14505 Initialize it in constructor. Add input_file and searched_for
14506 methods. Update declarations.
14507 (class Add_archive_symbols): Add dirpath_, dirindex_, and
14508 input_argument_ fields. Add them to constructor. Change all
14509 callers.
14510 * script.cc: Include "target-select.h".
14511 (class Parser_closure): Add skip_on_incompatible_target_ and
14512 found_incompatible_target_ fields. Add
14513 skip_on_incompatible_target parameter to constructor. Change all
14514 callers. Add methods skip_on_incompatible_target,
14515 clear_skip_on_incompatible_target, found_incompatible_target, and
14516 set_found_incompatible_target.
14517 (read_input_script): Add dirindex parameter. Change all callers.
14518 If parser finds an incompatible target, requeue Read_symbols
14519 task.
14520 (script_set_symbol): Clear skip_on_incompatible_target in
14521 closure.
14522 (script_add_assertion, script_parse_option): Likewise.
14523 (script_start_sections, script_add_phdr): Likewise.
14524 (script_check_output_format): New function.
14525 * script.h (read_input_script): Update declaration.
14526 * script-c.h (script_check_output_format): Declare.
14527 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
14528 (ignore_cmd): Remove OUTPUT_FORMAT.
14529 * fileread.cc (Input_file::Input_file): Add explicit this.
14530 (Input_file::will_search_for): New function.
14531 (Input_file::open): Add pindex parameter. Change all callers.
14532 * fileread.h (class Input_file): Add input_file_argument method.
14533 Declare will_search_for. Update declarations.
14534 * object.cc (make_elf_object): Add punconfigured parameter.
14535 Change all callers.
14536 * object.h (class Object): Make input_file public. Add
14537 searched_for method.
14538 (make_elf_object): Update declaration.
14539 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
14540 restart search.
14541 * dirsearch.h (class Dirsearch): Update declaration.
14542 * options.h (class General_options): Add --warn-search-mismatch.
14543 * parameters.cc (Parameters::is_compatible_target): New function.
14544 * parameters.h (class Parameters): Declare is_compatible_target.
14545 * workqueue.cc (Workqueue::add_blocker): New function.
14546 * workqueue.h (class Workqueue): Declare add_blocker.
14547
14548 * fileread.cc (Input_file::open): Remove options parameter.
14549 Change all callers.
14550 (Input_file::open_binary): Likewise.
14551 * script.cc (read_input_script): Likewise.
14552 * readsyms.h (class Read_symbols): Remove options_ field. Remove
14553 options parameter from constructor. Change all callers.
14554 (class Read_script): Likewise.
14555 * fileread.h (class Input_file): Update declarations.
14556 * script.h (read_input_script): Update declaration.
14557
14558 2009-03-10 Nick Clifton <nickc@redhat.com>
14559
14560 * po/es.po: New Spanish translation.
14561
14562 2009-03-06 Cary Coutant <ccoutant@google.com>
14563
14564 * options.cc (parse_short_option): Keep dash_z from registering itself.
14565
14566 2009-03-03 Ian Lance Taylor <iant@google.com>
14567
14568 PR 9918
14569 * target-reloc.h (relocate_section): Pass output_section to
14570 relocate.
14571 * i386.cc (Target_i386::should_apply_static_reloc): Add
14572 output_section parameter. Change all callers.
14573 (Target_i386::Relocate::relocate): Add output_section parameter.
14574 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14575 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
14576 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
14577 * testsuite/two_file_shared.sh: New script.
14578 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
14579 (check_DATA): Add two_file_shared.dbg.
14580 (two_file_shared.dbg): New target.
14581 * testsuite/Makefile.in: Rebuild.
14582
14583 2009-03-01 Ian Lance Taylor <iant@google.com>
14584
14585 * configure.ac: Check for byteswap.h.
14586 * configure: Rebuild.
14587 * config.in: Rebuild.
14588
14589 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
14590
14591 * layout.cc (Layout::find_or_add_kept_section): New function.
14592 (Layout::add_comdat): Removed.
14593 * layout.h (struct Kept_section): Move out of class Layout.
14594 Remove trailing underscores from field names. Add group_sections
14595 field. Rename group_ field to is_group. Change all uses.
14596 (class Layout): Declare find_or_add_kept_section, not add_comdat.
14597 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
14598 comdat_groups_ field.
14599 (Sized_relobj::include_section_group): Use
14600 find_or_add_kept_section and Kept_section::group_sections.
14601 (Sized_relobj::include_linkonce_section): Likewise.
14602 * object.cc (class Sized_relobj): Don't define Comdat_group or
14603 Comdat_group_table. Remove find_comdat_group and
14604 add_comdat_group. Remove comdat_groups_ field.
14605 * plugin.cc (include_comdat_group): Use
14606 Layout::find_or_add_kept_section.
14607
14608 2009-02-28 Ian Lance Taylor <iant@google.com>
14609
14610 * README: --gc-sections and map files are now supported. Document
14611 some build requirements.
14612
14613 PR 6992
14614 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
14615 relocatable link set the value of the section symbol to zero.
14616 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
14617 relocatable link don't include the section address in the local
14618 symbol value.
14619
14620 2009-02-27 Ian Lance Taylor <iant@google.com>
14621
14622 PR 6811
14623 * options.h (class Search_directory): Add is_system_directory.
14624 (class General_options): Declare is_in_system_directory.
14625 * options.cc (get_relative_sysroot): Make static.
14626 (get_default_sysroot): Make static.
14627 (General_optoins::is_in_system_directory): New function.
14628 * fileread.cc (Input_file::is_in_system_directory): New function.
14629 * fileread.h (class Input_file): Declare is_in_system_directory.
14630 * object.h (class Object): Add is_in_system_directory.
14631 (class Input_objects): Remove system_library_directory_ field.
14632 * object.cc (Input_objects::add_object): Don't set
14633 system_library_directory_.
14634 (input_objects::found_in_system_library_directory): Remove.
14635 * symtab.cc (Symbol_table::write_globals): Remove input_objects
14636 parameter. Change all callers.
14637 (Symbol_table::sized_write_globals): Likewise.
14638 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
14639 Call Object::is_in_system_directory.
14640 * symtab.h (class Symbol_table): Update declarations.
14641
14642 PR 5990
14643 * descriptors.h (Open_descriptor): Add is_on_stack field.
14644 * descriptors.cc (Descriptors::open): If the descriptor is on the
14645 top of the stack, remove it. Initialize is_on_stack field.
14646 (Descriptors::release): Only add pod to stack if it is not on the
14647 stack already.
14648 (Descriptors::close_some_descriptor): Clear stack_next and
14649 is_on_stack fields.
14650
14651 PR 7091
14652 * output.cc (Output_section::find_starting_output_address): Rename
14653 from starting_output_address; add PADDR parameter; change return
14654 type.
14655 * output.h (class Output_section): Declare
14656 find_starting_output_address instead of starting_output_address.
14657 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
14658 section symbol for which we can't find a merge section.
14659
14660 PR 9836
14661 * symtab.cc (Symbol_table::add_from_object): If the visibility is
14662 hidden or internal, force the symbol to be local.
14663 * resolve.cc (Symbol::override_visibility): Define.
14664 (Symbol::override_base): Use override_visibility.
14665 (Symbol_table::resolve): Likewise.
14666 (Symbol::override_base_with_special): Likewise.
14667 (Symbol_table::override_with_special): If the visibility is hidden
14668 or internal, force the symbol to be local.
14669 * symtab.h (class Symbol): Add set_visibility and
14670 override_visibility.
14671 * testsuite/ver_test_1.sh: New file.
14672 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
14673 (check_DATA): Add ver_test_1.syms.
14674 (ver_test_1.syms): New target.
14675 * testsuite/Makefile.in: Rebuild.
14676
14677 2009-02-25 Cary Coutant <ccoutant@google.com>
14678
14679 * layout.cc (Layout::choose_output_section): Don't rename sections
14680 when using a linker script that has a SECTIONS clause.
14681 * Makefile.in: Regenerate.
14682
14683 * testsuite/Makefile.am (script_test_5.sh): New test case.
14684 * testsuite/Makefile.in: Regenerate.
14685 * testsuite/script_test_5.cc: New file.
14686 * testsuite/script_test_5.sh: New file.
14687 * testsuite/script_test_5.t: New file.
14688
14689 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
14690
14691 * archive.cc (Archive::include_member): Update calls to add_symbols.
14692 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
14693 the Layout argument.
14694 * dynobj.h (do_add_symbols): Add the Layout argument.
14695 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
14696 Layout argument.
14697 * object.h (Object::add_symbols): Add the Layout argument.
14698 (Object::do_add_symbols): Add the Layout argument.
14699 (Sized_relobj::do_add_symbols): Add the Layout argument.
14700 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
14701 Unify the two versions.
14702 (Add_plugin_symbols): Remove.
14703 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
14704 (Sized_pluginobj::do_add_symbols): Unify the two versions.
14705 (Add_plugin_symbols): Remove.
14706 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
14707 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
14708 (Add_symbols::run): Make it work with Pulginobj.
14709
14710 2009-02-06 Ian Lance Taylor <iant@google.com>
14711
14712 * object.cc (Sized_relobj::do_layout): Make info message start
14713 with lower case letter.
14714
14715 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
14716
14717 * binary.cc: Fix file comment.
14718
14719 * options.h (enum Incremental_disposition): Define.
14720 (class General_options): Add new options: --incremental,
14721 --incremental_changed, --incremental_unchanged,
14722 --incremental_unknown. Add incremental_disposition_ and
14723 implicit_incremental_ fields.
14724 (General_options::incremental_disposition): New function.
14725 (class Position_dependent_options): Add incremental_disposition
14726 option.
14727 (Position_dependent_options::copy_from_options): Set incremental
14728 dispositions.
14729 * options.cc (General_options::parse_incremental_changed): New
14730 function.
14731 (General_options::parse_incremental_unchanged): New function.
14732 (General_options::parse_incremental_unknown): New function.
14733 (General_options::General_options): Initialize new fields
14734 incremental_disposition_ and implicit_incremental_.
14735 (General_options::finalize): Check for uasge of --incremental-*
14736 without --incremental.
14737
14738 2009-02-06 Chris Demetriou <cgd@google.com>
14739
14740 * gold.h (gold_undefined_symbol): Change to take only a Symbol
14741 pointer and to report location as the file name associated with
14742 the symbol.
14743 (gold_undefined_symbol_at_location): New function to replace the
14744 old gold_undefined_symbol functionality.
14745 * target-reloc.h (relocate_section): Update to use
14746 gold_undefined_symbol_at_location.
14747 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14748 Call gold_undefined_symbol function rather than gold_error.
14749 * errors.h (Errors::undefined_symbol): Take location as a
14750 string, rather than calculating it from a relocation.
14751 * errors.cc (Errors::fatal): Print "fatal error:" before the
14752 formatted message.
14753 (Errors::error, Errors::error_at_location): Print "error: "
14754 before the formatted message.
14755 (Errors::undefined_symbol): Take location as a string, rather
14756 than calculating it from a relocation.
14757 (gold_undefined_symbol_at_location): New function akin to
14758 old gold_undefined_symbol, calculates location from relocation.
14759 (gold_undefined_symbol): Change to take only a Symbol pointer
14760 and to report location as the file name associated with the symbol.
14761 * testsuite/debug_msg.sh: Update for changed error messages.
14762 * testsuite/undef_symbol.sh: Likewise.
14763
14764 2009-02-04 Duncan Sands <baldrick@free.fr>
14765
14766 PR 9812
14767 * reduced_debug_output.h
14768 (Output_reduced_debug_abbrev_section::failed): Use format for
14769 gold_warning.
14770 (Output_reduced_debug_info_section::faild): Likewise.
14771
14772 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
14773
14774 * script.cc (Lazy_demangler): New class.
14775 (Version_script_info::get_symbol_version_helper): Demangle a
14776 symbol only once.
14777
14778 2009-01-29 Cary Coutant <ccoutant@google.com>
14779
14780 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
14781 to __tls_get_addr.
14782 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14783
14784 2009-01-28 Ian Lance Taylor <iant@google.com>
14785
14786 * version.cc (version_string): Bump to 1.9.
14787
14788 * gold.h: Include <cstring> and <stdint.h>.
14789 * version.cc: Include <cstdio>.
14790 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
14791 warning.
14792 * reduced_debug_output.cc (insert_into_vector): Rename from
14793 Insert_into_vector; change all callers. Use Swap_unaligned to
14794 avoid aliasing issue; remove union since it is unnecessary.
14795
14796 2009-01-27 Sriraman Tallam <tmsriram@google.com>
14797
14798 * Makefile.am (CCFILES): Add gc.cc.
14799 (HFILES): Add gc.h.
14800 * Makefile.in: Regenerate.
14801 * gold.cc (Gc_runner): New class.
14802 (queue_initial_tasks): Call garbage collection related tasks
14803 when corresponding options are invoked.
14804 (queue_middle_gc_tasks): New function.
14805 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
14806 processed early before laying out sections during garbage collection.
14807 * gold.h (queue_middle_gc_tasks): New function.
14808 (is_prefix_of): Move from "layout.cc".
14809 * i386.cc (Target_i386::gc_process_relocs): New function.
14810 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
14811 * main.cc (main): Create object of class "Garbage_collection".
14812 * object.cc (Relobj::copy_symbols_data): New function.
14813 (Relobj::is_section_name_included): New function.
14814 (Sized_relobj::do_layout): Allow this function to be called twice
14815 during garbage collection and defer layout of section during the
14816 first call.
14817 * object.h (Relobj::get_symbols_data): New function.
14818 (Relobj::is_section_name_included): New function.
14819 (Relobj::copy_symbols_data): New function.
14820 (Relobj::set_symbols_data): New function.
14821 (Relobj::get_relocs_data): New function.
14822 (Relobj::set_relocs_data): New function.
14823 (Relobj::is_output_section_offset_invalid): New pure virtual function.
14824 (Relobj::gc_process_relocs): New function.
14825 (Relobj::do_gc_process_relocs): New pure virtual function.
14826 (Relobj::sd_): New data member.
14827 (Sized_relobj::is_output_section_offset_invalid): New function.
14828 (Sized_relobj::do_gc_process_relocs): New function.
14829 * options.h (General_options::gc_sections): Modify to not be a no-op.
14830 (General_options::print_gc_sections): New option.
14831 * plugin.cc (Plugin_finish::run): Remove function call to
14832 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
14833 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
14834 * reloc.cc (Read_relocs::run): Add task to process relocs and
14835 determine unreferenced sections when doing garbage collection.
14836 (Gc_process_relocs): New class.
14837 (Sized_relobj::do_gc_process_relocs): New function.
14838 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
14839 sections that are garbage collected.
14840 * reloc.h (Gc_process_relocs): New class.
14841 * sparc.cc (Target_sparc::gc_process_relocs): New function.
14842 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
14843 symbols whose corresponding sections are garbage collected.
14844 (Symbol_table::Symbol_table): Add new parameter for the garbage
14845 collection object.
14846 (Symbol_table::gc_mark_undef_symbols): New function.
14847 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14848 (Symbol_table::gc_mark_dyn_syms): New function.
14849 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
14850 as garbage.
14851 (Symbol_table::add_from_object): Likewise.
14852 (Symbol_table::add_from_relobj): When building shared objects, do not
14853 treat externally visible symbols as garbage.
14854 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
14855 table information for static and relocatable links.
14856 * symtab.h (Symbol_table::set_gc): New function.
14857 (Symbol_table::gc): New function.
14858 (Symbol_table::gc_mark_undef_symbols): New function.
14859 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14860 (Symbol_table::gc_mark_dyn_syms): New function.
14861 (Symbol_table::gc_): New data member.
14862 * target.h (Sized_target::gc_process_relocs): New pure virtual
14863 function.
14864 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
14865 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
14866
14867 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
14868
14869 * options.h (General_options::gc_sections): Define as a no-op for now.
14870 (General_options::no_keep_memory): Ditto.
14871 (General_options::Bshareable): Define.
14872 * options.cc (General_options::finalize): Honor -Bshareable.
14873
14874 2009-01-20 Andreas Schwab <schwab@suse.de>
14875
14876 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
14877 read the value in the contents, since we don't use it. Use the
14878 template endianness when writing.
14879 (Relocate::relocate): Use it for R_PPC_REL16_HA.
14880
14881 2009-01-19 Andreas Schwab <schwab@suse.de>
14882
14883 * configure.tgt (powerpc64-*): Fix targ_obj.
14884
14885 2009-01-15 Ian Lance Taylor <iant@google.com>
14886
14887 * object.cc (Sized_relobj::write_local_symbols): Don't write out
14888 local symbols when stripping all symbols.
14889
14890 2009-01-14 Cary Coutant <ccoutant@google.com>
14891
14892 * output.cc (Output_reloc): Add explicit instantiations.
14893
14894 2009-01-14 Cary Coutant <ccoutant@google.com>
14895
14896 * archive.cc (Archive::get_elf_object_for_member): Remove call
14897 to File_read::claim_for_plugin.
14898 * descriptors.cc (Descriptors::open): Remove reference to
14899 is_claimed.
14900 (Descriptors::claim_for_plugin): Remove.
14901 * descriptors.h (Descriptors::claim_for_plugin): Remove.
14902 (Descriptors::is_claimed): Remove.
14903 (claim_descriptor_for_plugin): Remove.
14904 * fileread.cc (File_read::claim_for_plugin): Remove.
14905 * fileread.h (File_read::claim_for_plugin): Remove.
14906 (File_read::descriptor): Reopen descriptor if necessary.
14907 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
14908 (Plugin_manager::all_symbols_read): Add task parameter. Change
14909 all callers.
14910 (Plugin_manager::get_input_file): New function.
14911 (Plugin_manager::release_input_file): New function.
14912 (Pluginobj::Pluginobj): Add filesize parameter and initialize
14913 corresponding data member.
14914 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
14915 and pass to base constructor. Change all callers.
14916 (get_input_file, release_input_file): New functions.
14917 (make_sized_plugin_object): Add filesize parameter. Change all callers.
14918 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
14919 (Plugin_manager::all_symbols_read): Add task parameter.
14920 (Plugin_manager::get_input_file): New function.
14921 (Plugin_manager::release_input_file): New function.
14922 (Plugin_manager::task_): New data member.
14923 (Pluginobj::Pluginobj): Add filesize parameter.
14924 (Pluginobj::filename): New function.
14925 (Pluginobj::descriptor): New function.
14926 (Pluginobj::filesize): New function.
14927 (Pluginobj::filesize_): New data member.
14928 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
14929 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
14930 File_read::claim_for_plugin; use Object::unlock to unlock the file.
14931
14932 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
14933 with archive libraries.
14934 * testsuite/Makefile.in: Regenerate.
14935 * testsuite/plugin_test.c (struct sym_info): New type.
14936 (get_input_file, release_input_file): New static variables.
14937 (onload): Capture new transfer vector entries.
14938 (claim_file_hook): Stop reading at end of file according to filesize.
14939 Factor out parsing of readelf output into separate function.
14940 (all_symbols_read_hook): Exercise get_input_file and release_input_file
14941 APIs and get the source file name from the symbol table. Convert
14942 source file name to corresponding object file name. Print info
14943 message when adding new input files.
14944 (parse_readelf_line): New function.
14945 * testsuite/plugin_test_1.sh: Add checks for new info messages.
14946 * testsuite/plugin_test_2.sh: Likewise.
14947 * testsuite/plugin_test_3.sh: Likewise.
14948 * testsuite/plugin_test_4.sh: New test case.
14949
14950 2009-01-07 Ian Lance Taylor <iant@google.com>
14951
14952 * version.cc (version_string): Bump to 1.8.
14953
14954 2008-12-23 Cary Coutant <ccoutant@google.com>
14955
14956 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
14957 * plugin.cc (Plugin_manager::finish): Rename as
14958 layout_deferred_objects. Move cleanup to separate function.
14959 (Plugin_manager::cleanup): New function.
14960 (Plugin_finish::run): Call layout_deferred_objects and cleanup
14961 separately.
14962 * plugin.h (Plugin_manager::finish): Rename as
14963 layout_deferred_objects.
14964 (Plugin_manager::cleanup): New function.
14965 (Plugin_manager::cleanup_done): New field.
14966
14967 2008-12-23 Cary Coutant <ccoutant@google.com>
14968
14969 * plugin.cc (is_visible_from_outside): New function.
14970 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
14971 so we don't return "IR only" status for exported symbols or -r links.
14972
14973 * testsuite/Makefile.am (plugin_test_3): New test case.
14974 * testsuite/Makefile.in: Regenerate.
14975 * testsuite/plugin_test_3.sh: New file.
14976
14977 2008-12-22 Cary Coutant <ccoutant@google.com>
14978
14979 * object.cc (Sized_relobj::layout_section): New function.
14980 (Sized_relobj::do_layout): Defer layout of input sections until after
14981 plugin has provided replacement files.
14982 (Sized_relobj::do_layout_deferred_sections): New function.
14983 * object.h (Relobj::set_section_offset): Remove virtual keyword.
14984 (Relobj::layout_deferred_sections): New function.
14985 (Relobj::do_layout_deferred_sections): New function.
14986 (Sized_relobj::do_layout_deferred_sections): New function.
14987 (Sized_relobj::layout_section): New function.
14988 (Sized_relobj::Deferred_layout): New structure.
14989 (Sized_relobj::deferred_layout_): New field.
14990 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
14991 Change all callers. Layout deferred sections.
14992 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
14993 references.
14994 (Plugin_hook::run): Move code from do_plugin_hook inline.
14995 (Plugin_hook::do_plugin_hook): Remove.
14996 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
14997 (Plugin_manager::finish): Renamed, was cleanup.
14998 (Plugin_manager::should_defer_layout): New function.
14999 (Plugin_manager::add_deferred_layout_object): New function.
15000 (Plugin_manager::Deferred_layout_list): New type.
15001 (Plugin_manager::deferred_layout_objects_): New field.
15002 (Plugin_hook::do_plugin_hook): Remove.
15003
15004 2008-12-17 Ian Lance Taylor <iant@google.com>
15005
15006 * options.h (class General_options): Add --no case for
15007 --export-dynamic.
15008
15009 2008-12-16 Cary Coutant <ccoutant@google.com>
15010
15011 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
15012 vector.
15013 (Plugin_manager::claim_file): Create plugin object even if
15014 plugin did not call the add_symbols callback.
15015 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
15016 asking for more symbols than were added.
15017 * testsuite/Makefile.am (plugin_test_1): Add test case with
15018 no global symbols.
15019 (empty.syms): New target.
15020 * testsuite/Makefile.in: Regenerate.
15021 * testsuite/plugin_test.c (claim_file_hook): Add new debug
15022 message. Don't call add_symbols if no globals.
15023 (all_symbols_read_hook): Don't provide replacement for empty
15024 claimed file.
15025
15026 2008-12-12 Ian Lance Taylor <iant@google.com>
15027
15028 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
15029 r_type == 0 for a local symbol with r_sym == 0.
15030 (scan_relocatable_relocs): Pass r_sym to
15031 local_non_section_strategy.
15032 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
15033 r_sym parameter.
15034
15035 * configure.ac: Update test for TLS descriptors: they are
15036 supported as of glibc 2.9.
15037 * configure: Rebuild.
15038
15039 2008-12-11 Ian Lance Taylor <iant@google.com>
15040
15041 PR 7091
15042 * target-reloc.h (Default_scan_relocatable_relocs): For each
15043 function, map r_type == 0 to RELOC_DISCARD.
15044
15045 2008-12-10 Cary Coutant <ccoutant@google.com>
15046
15047 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
15048 object to override a kept COMDAT group from a plugin object.
15049
15050 2008-12-09 Ian Lance Taylor <iant@google.com>
15051
15052 PR 7088
15053 * yyscript.y (file_cmd): Handle INPUT.
15054
15055 * testsuite/initpri1.c: Change all declarations to be full
15056 prototypes by adding void, to avoid compiler warnings.
15057
15058 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
15059
15060 * options.cc (General_options::parse_plugin_opt): New.
15061 (General_options::add_plugin): The argument now is just the filename.
15062 (General_options::add_plugin_option): New.
15063 * options.h (plugin_opt): New.
15064 (add_plugin): Change argument name.
15065 (add_plugin_option): New.
15066 * plugin.cc (Plugin::load): Don't parse the plugin option.
15067 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
15068 (Plugin::add_option): New.
15069 (Plugin::args_): Change type.
15070 (Plugin::filename_): New.
15071 (Plugin_manager::add_plugin_option): New.
15072 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
15073 * testsuite/Makefile.in: Regenerate.
15074
15075 2008-12-05 Cary Coutant <ccoutant@google.com>
15076
15077 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
15078 Handle --strip-lto-sections option.
15079 * options.h (strip_lto_sections): New option.
15080
15081 2008-12-01 Cary Coutant <ccoutant@google.com>
15082
15083 * plugin.cc (ld_plugin_message): Change format parameter to const.
15084 Fix mismatch between new[] and delete.
15085
15086 2008-11-14 Cary Coutant <ccoutant@google.com>
15087
15088 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
15089 instead of -1U.
15090
15091 2008-11-05 Craig Silverstein <csilvers@google.com>
15092
15093 * options.cc (General_options::parse_dynamic_list): New function.
15094 * options.h (General_options): New flags dynamic_list,
15095 dynamic_list_data, dynamic_list_cpp_new, and
15096 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
15097 (General_options::in_dynamic_list): New function.
15098 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
15099 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
15100 (Lex::can_continue_name): Likewise.
15101 (yylex): Likewise.
15102 (read_script_file): New parameter script_options.
15103 (read_dynamic_list): New function.
15104 (Script_options::define_dynamic_list): New function.
15105 (dynamic_list_keyword_parsecodes): New variable.
15106 (dynamic_list_keywords): New variable.
15107 * script.h (Script_options::define_dynamic_list): New function
15108 prototype.
15109 (read_dynamic_list): New function prototype.
15110 * symtab.cc (strprefix): New macro.
15111 (Symbol::should_add_dynsym_entry): Support dynamic_list,
15112 dynamic_list_data, dynamic_list_cpp_new, and
15113 dynamic_list_cpp_typeinfo.
15114 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
15115 (dynamic_list_expr): New rule.
15116 (dynamic_list_nodes): Likewise.
15117 (dynamic_list_node): Likewise.
15118 * testsuite/Makefile.am (dynamic_list): New test.
15119 * testsuite/Makefile.in: Regenerated.
15120 * testsuite/dynamic_list.t: New file.
15121 * testsuite/dynamic_list.sh: New file.
15122
15123 2008-11-05 Craig Silverstein <csilvers@google.com>
15124
15125 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
15126 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
15127 (t11_last): Likewise.
15128 * testsuite/ver_test_6.c (main): Likewise.
15129
15130 2008-10-07 Cary Coutant <ccoutant@google.com>
15131
15132 * options.c (General_options::finalize): Add check for -static and
15133 -shared.
15134 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
15135 is not empty.
15136
15137 2008-10-02 Cary Coutant <ccoutant@google.com>
15138
15139 * plugin.cc (make_sized_plugin_object): Fix conditional
15140 compilation to work when not all targets are enabled.
15141
15142 2008-09-29 Cary Coutant <ccoutant@google.com>
15143
15144 * archive.cc (Archive::get_file_and_offset): Use filename instead
15145 of name to get library path.
15146 (Archive::include_member): Unlock external member of a thin archive.
15147
15148 * testsuite/Makefile.am (TEST_AR): New variable.
15149 (thin_archive_test_1): New test.
15150 (thin_archive_test_2): New test.
15151 * testsuite/Makefile.in: Regenerate.
15152 * testsuite/thin_archive_main.cc: New file.
15153 * testsuite/thin_archive_test_1.cc: New file.
15154 * testsuite/thin_archive_test_2.cc: New file.
15155 * testsuite/thin_archive_test_3.cc: New file.
15156 * testsuite/thin_archive_test_4.cc: New file.
15157
15158 2008-09-29 Cary Coutant <ccoutant@google.com>
15159
15160 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
15161 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
15162 instead of -1U.
15163 (Sized_relobj::do_finalize_local_symbols): Likewise.
15164 (Sized_relobj::map_to_kept_section): Likewise.
15165 * object.h (Sized_relobj::invalid_address): New constant.
15166 (Sized_relobj::do_output_section_offset): Check for invalid_address
15167 and return -1ULL.
15168 * output.cc (Output_reloc::local_section_offset): Use constant
15169 invalid_address instead of -1U.
15170 (Output_reloc::get_address): Likewise.
15171 (Output_section::output_address): Change -1U to -1ULL.
15172 * output.h (Output_reloc::invalid_address): New constant.
15173 * reloc.cc (Sized_relobj::write_sections): Use constant
15174 invalid_address instead of -1U.
15175 (Sized_relobj::relocate_sections): Likewise.
15176 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
15177 values for merge sections.
15178 * target-reloc.h (relocate_for_relocatable): Use constant
15179 invalid_address instead of -1U.
15180
15181 2008-09-19 Cary Coutant <ccoutant@google.com>
15182
15183 Add plugin functionality for link-time optimization (LTO).
15184 * configure.ac (plugins): Add --enable-plugins option.
15185 * configure: Regenerate.
15186 * config.in: Regenerate.
15187 * Makefile.am (LIBDL): New variable.
15188 (CCFILES): Add plugin.cc.
15189 (HFILES): Add plugin.h.
15190 (ldadd_var): Add LIBDL.
15191 * Makefile.in: Regenerate.
15192
15193 * archive.cc: Include "plugin.h".
15194 (Archive::setup): Don't preread archive symbols when using a plugin.
15195 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
15196 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
15197 files.
15198 (Archive::include_member): Add symbols from plugin objects.
15199 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
15200 * descriptors.cc (Descriptors::open): Check for file descriptors
15201 abandoned by plugins.
15202 (Descriptors::claim_for_plugin): New function.
15203 * descriptors.h (Descriptors::claim_for_plugin): New function.
15204 (Open_descriptor::is_claimed): New field.
15205 (claim_descriptor_for_plugin): New function.
15206 * fileread.cc (File_read::claim_for_plugin): New function.
15207 * fileread.h (File_read::claim_for_plugin): New function.
15208 (File_read::descriptor): New function.
15209 * gold.cc: Include "plugin.h".
15210 (queue_initial_tasks): Add task to call plugin hooks for generating
15211 new object files.
15212 * main.cc: Include "plugin.h".
15213 (main): Load plugin libraries.
15214 * object.h (Pluginobj): Declare.
15215 (Object::pluginobj): New function.
15216 (Object::do_pluginobj): New function.
15217 (Object::set_target): New function.
15218 * options.cc: Include "plugin.h".
15219 (General_options::parse_plugin): New function.
15220 (General_options::General_options): Initialize plugins_ field.
15221 (General_options::add_plugin): New function.
15222 * options.h (Plugin_manager): Declare.
15223 (General_options): Add --plugin option.
15224 (General_options::has_plugins): New function.
15225 (General_options::plugins): New function.
15226 (General_options::add_plugin): New function.
15227 (General_options::plugins_): New field.
15228 * plugin.cc: New file.
15229 * plugin.h: New file.
15230 * readsyms.cc: Include "plugin.h".
15231 (Read_symbols::do_read_symbols): Check for archive before checking
15232 for ELF file. Call plugin hooks to claim files.
15233 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
15234 from a real object file; force override when processing replacement
15235 files.
15236 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
15237 (Symbol::init_base_object): Likewise.
15238 (Symbol::init_base_output_data): Likewise.
15239 (Symbol::init_base_output_segment): Likewise.
15240 (Symbol::init_base_constant): Likewise.
15241 (Symbol::init_base_undefined): Likewise.
15242 (Symbol::output_section): Assert that object is not a plugin.
15243 (Symbol_table::add_from_pluginobj): New function.
15244 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
15245 undefined.
15246 (Symbol_table::sized_write_globals): Likewise.
15247 (Symbol_table::add_from_pluginobj): Instantiate template.
15248 * symtab.h (Sized_pluginobj): Declare.
15249 (Symbol::in_real_elf): New function.
15250 (Symbol::set_in_real_elf): New function.
15251 (Symbol::in_real_elf_): New field.
15252 (Symbol_table::add_from_pluginobj): New function.
15253
15254 * testsuite/Makefile.am (AM_CFLAGS): New variable.
15255 (LIBDL): New variable.
15256 (LDADD): Add LIBDL.
15257 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
15258 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
15259 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
15260 (MOSTLYCLEANFILES): Likewise.
15261 * testsuite/Makefile.in: Regenerate.
15262 * testsuite/plugin_test.c: New file.
15263 * testsuite/plugin_test_1.sh: New file.
15264 * testsuite/plugin_test_2.sh: New file.
15265
15266 2008-09-16 Ian Lance Taylor <iant@google.com>
15267
15268 * target-reloc.h (relocate_section): Check whether a symbol is
15269 defined by the ABI before reporting an undefined symbol error.
15270 * target.h (Target::is_defined_by_abi): Make parameter const.
15271 (Target::do_is_defined_by_abi): Likewise.
15272 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
15273 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
15274 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
15275 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
15276 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
15277 * testsuite/Makefile.in: Rebuild.
15278
15279 * fileread.cc (make_view): Add casts to avoid warning.
15280
15281 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
15282
15283 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
15284 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15285
15286 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
15287
15288 * options.h (General_options::output_is_executable): New.
15289 (General_options::output_is_pie): New.
15290 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
15291 for shared libraries.
15292 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15293
15294 2008-09-11 Chris Demetriou <cgd@google.com>
15295
15296 * options.h (origin): New -z option.
15297 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
15298 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
15299 in DT_FLAGS_1.
15300
15301 2008-09-05 Cary Coutant <ccoutant@google.com>
15302
15303 * fileread.cc (File_read::make_view): Add check for attempt to map
15304 beyond end of file.
15305
15306 2008-09-05 Cary Coutant <ccoutant@google.com>
15307
15308 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
15309 explicit instantiations.
15310
15311 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
15312
15313 PR gold/6858
15314 * options.cc (General_options::finalize): Allow undefined symbols
15315 in shlibs if linking -shared.
15316
15317 PR gold/6859
15318 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
15319 symbols as not needing a dynsym entry.
15320
15321 2008-08-20 Craig Silverstein <csilvers@google.com>
15322
15323 * fileread.cc (File_read::open): Do not lock the file unless it
15324 was successfully opened.
15325
15326 2008-08-14 Cary Coutant <ccoutant@google.com>
15327
15328 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
15329 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
15330 * testsuite/tls_test.cc (struct int128): 128-bit struct
15331 for testing TLS relocs with non-zero addend.
15332 (v12): New TLS variable.
15333 (t12): New test.
15334 (t_last): Add check for v12.
15335 * testsuite/tls_test.h (t12): New function.
15336 * testsuite/tls_test_main.cc (thread_routine): Call new test.
15337
15338 2008-08-13 Ian Lance Taylor <iant@google.com>
15339
15340 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
15341 set tls_segment_ or relro_segment_.
15342 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
15343 when appropriate.
15344 * output.h (Output_section::clear_is_relro): New function.
15345 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
15346 sections specially even when output_data_ is empty.
15347 (Output_segment::maximum_alignment): When first section is relro,
15348 only force alignment for PT_LOAD segments.
15349 * script.cc (script_data_segment_align): New function.
15350 (script_data_segment_relro_end): New function.
15351 * script-c.h (script_data_segment_align): Declare.
15352 (script_data_segment_relro_end): Declare.
15353 * script-sections.h (class Script_sections): Declare
15354 data_segment_align and data_segment_relro_end. Add fields
15355 segment_align_index_ and saw_relro_end_.
15356 * script-sections.cc (class Sections_element): Add set_is_relro
15357 virtual function. Add new bool* parameter to place_orphan_here.
15358 Add get_output_section virtual function.
15359 (class Output_section_definition): Add set_is_relro. Add new
15360 bool* parameter to place_orphan_here. Add get_output_section.
15361 Add is_relro_ field.
15362 (Output_section_definition::Output_section_definition): Initialize
15363 evaluated_address_, evaluated_load_address, evaluated_addralign_,
15364 and is_relro_ fields.
15365 (Output_section_definition::place_orphan_here): Add is_relro
15366 parameter.
15367 (Output_section_definition::set_section_addresses): Set relro for
15368 output section.
15369 (Output_section_definition::alternate_constraint): Likewise.
15370 (class Orphan_output_section): Add new bool* parameter to
15371 place_orphan_here. Add get_output_section.
15372 (Orphan_output_section::place_orphan_here): Add is_relro
15373 parameter.
15374 (Script_sections::Script_sections): Initialize
15375 data_segment_align_index_ and saw_relro_end_.
15376 (Script_sections::data_segment_align): New function.
15377 (Script_sections::data_segment_relro_end): New function.
15378 (Script_sections::place_orphan): Set or clear is_relro.
15379 (Script_sections::set_section_addresses): Force alignment of first
15380 TLS section.
15381 * yyscript.y (exp): Call script_data_segment_align and
15382 script_data_segment_relro_end.
15383 * testsuite/relro_script_test.t: New file.
15384 * testsuite/relro_test.cc (using_script): Declare.
15385 (t1, t2): Test using_script.
15386 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
15387 (relro_script_test_SOURCES): Define.
15388 (relro_script_test_DEPENDENCIES): Define.
15389 (relro_script_test_LDFLAGS): Define.
15390 (relro_script_test_LDADD): Define.
15391 (relro_script_test.so): New target.
15392 * testsuite/Makefile.in: Rebuild.
15393
15394 2008-08-06 Cary Coutant <ccoutant@google.com>
15395
15396 * archive.cc (Archive::total_archives, Archive::total_members)
15397 (Archive::total_members_loaded): New variables.
15398 (Archive::setup): Add parameter. Add option to preread
15399 archive symbols.
15400 (Archive::read_armap): Add counter.
15401 (Archive::get_file_and_offset): New function.
15402 (Archive::get_elf_object_for_member): New function.
15403 (Archive::read_all_symbols): New function.
15404 (Archive::read_symbols): New function.
15405 (Archive::add_symbols): Add counters.
15406 (Archive::include_all_members): Use armap to find members if it's
15407 already built.
15408 (Archive::include_member): Skip reading symbols if already read.
15409 Factored code into Archive::get_file_and_offset and
15410 Archive::get_elf_object_for_member. Changed call to
15411 Mapfile::report_include_archive_member.
15412 (Archive::print_stats): New function.
15413 * archive.h: Declare Object and Read_symbols_data classes.
15414 (Archive::Archive): Add initializers for new members.
15415 (Archive::setup): Add parameter.
15416 (Archive::print_stats): New function.
15417 (Archive::total_archives, Archive::total_members)
15418 (Archive::total_members_loaded): New variables.
15419 (Archive::get_file_and_offset): New function.
15420 (Archive::get_elf_object_for_member): New function.
15421 (Archive::read_all_symbols): New function.
15422 (Archive::read_symbols): New function.
15423 (Archive::Archive_member): New class.
15424 (Archive::members_): New member.
15425 (Archive::num_members_): New member.
15426 * main.cc: Include archive.h.
15427 (main): Call Archive::print_stats.
15428 * mapfile.cc (Mapfile::report_include_archive_member): Delete
15429 archive parameter; member_name is now the fully-decorated name.
15430 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
15431 * options.h: (General_options): Add --preread-archive-symbols option.
15432 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
15433 Archive::setup.
15434
15435 2008-08-04 Ian Lance Taylor <iant@google.com>
15436
15437 * symtab.h (Symbol::use_plt_offset): New function.
15438 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
15439 * powerpc.cc (Relocate::relocate): Likewise.
15440 * sparc.cc (Relocate::relocate): Likewise.
15441 * x86_64.cc (Relocate::relocate): Likewise.
15442 * testsuite/weak_plt.sh: New test.
15443 * testsuite/weak_plt_main.cc: New test.
15444 * testsuite/weak_plt_shared.cc: New test.
15445 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
15446 (check_PROGRAMS): Add weak_plt.
15447 (check_DATA): Add weak_plt_shared.so.
15448 (weak_plt_main_pic.o, weak_plt): New targets.
15449 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
15450 * testsuite/Makefile.in: Rebuild.
15451
15452 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
15453 gcctestdir/ld.
15454 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
15455 * testsuite/Makefile.in: Rebuild.
15456
15457 2008-08-04 Alan Modra <amodra@bigpond.net.au>
15458
15459 * Makefile.am (POTFILES.in): Set LC_ALL=C.
15460 * Makefile.in: Regenerate.
15461 * po/POTFILES.in: Regenerate.
15462
15463 2008-07-29 Ian Lance Taylor <iant@google.com>
15464
15465 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
15466 symbols before other symbols.
15467 * testsuite/script_test_2.cc (test_addr): Declare.
15468 (test_addr_alias): Declare.
15469 (main): Check that test_addr and test_addr_alias have the right
15470 values.
15471 * testsuite/script_test_2.t: Define test_addr_alias and
15472 test_addr.
15473
15474 2008-07-24 Ian Lance Taylor <iant@google.com>
15475
15476 PR 5990
15477 * descriptors.cc: New file.
15478 * descriptors.h: New file.
15479 * gold-threads.h (class Hold_optional_lock): New class.
15480 * fileread.cc: Include "descriptors.h".
15481 (File_read::~File_read): Release descriptor rather than closing
15482 it.
15483 (File_read::open) [file]: Call open_descriptor rather than open.
15484 Set is_descriptor_opened_.
15485 (File_read::open) [memory]: Assert that descriptor is not open.
15486 (File_read::reopen_descriptor): New function.
15487 (File_read::release): Release descriptor.
15488 (File_read::do_read): Make non-const. Reopen descriptor.
15489 (File_read::read): Make non-const.
15490 (File_read::make_view): Reopen descriptor.
15491 (File_read::do_readv): Likewise.
15492 * fileread.h (class File_read): Add is_descriptor_opened_ field.
15493 Update declarations.
15494 * layout.cc: Include "descriptors.h".
15495 (Layout::create_build_id): Use open_descriptor rather than open.
15496 * output.cc: Include "descriptors.h".
15497 (Output_file::open): Use open_descriptor rather than open.
15498 * archive.cc (Archive::const_iterator): Change Archive to be
15499 non-const.
15500 (Archive::begin, Archive::end): Make non-const.
15501 (Archive::count_members): Likewise.
15502 * archive.h (class Archive): Update declarations.
15503 * object.h (Object::read): Make non-const.
15504 * Makefile.am (CCFILES): Add descriptors.cc.
15505 (HFILES): Add descriptors.h.
15506 * Makefile.in: Rebuild.
15507
15508 PR 6716
15509 * gold.h: Always include <clocale>. Add Solaris workarounds
15510 following code in binutils/sysdep.h.
15511
15512 PR 6048
15513 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
15514 this->eh_frame_hdr_ is NULL before using it.
15515
15516 * dynobj.cc (Versions::Versions): Update comment.
15517
15518 * dynobj.cc (Versions::Versions): If there is an soname, use it as
15519 the base version name.
15520
15521 * stringpool.cc (Stringpool_template::add_with_length): Set key to
15522 array size plus one.
15523 (Stringpool_template::set_string_offsets): Subtract one from key
15524 before using it as an array index.
15525 (Stringpool_template::get_offset_with_length): Likewise.
15526 (Stringpool_template::write_to_buffer): Likewise.
15527 * stringpool.h (Stringpool_template::get_offset_from_key):
15528 Likewise.
15529
15530 2008-07-23 Ian Lance Taylor <iant@google.com>
15531
15532 PR 6658
15533 * object.h (Merged_symbol_value::value): Do our best to handle a
15534 negative addend.
15535
15536 PR 6647
15537 * script.cc (Version_script_info::get_versions): Don't add empty
15538 version tag to return value.
15539 (Version_script_info::get_symbol_version_helper): Change return
15540 type to bool. Add pversion parameter. Change all callers.
15541 (script_register_vers_node): Don't require a non-NULL tag.
15542 * script.h (class Version_script_info): Update declarations.
15543 (Version_script_info::get_symbol_version): Change return type to
15544 bool. Add version parameter. Change all callers.
15545 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
15546 handling. Handle an empty version from a version script.
15547 (Symbol_table::define_special_symbol): Likewise.
15548 * testsuite/ver_test_10.script: New file.
15549 * testsuite/ver_test_10.sh: New file.
15550 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
15551 (check_DATA): Add ver_test_10.syms.
15552 (ver_test_10.syms, ver_test_10.so): New target.
15553 * testsuite/Makefile.in: Rebuild.
15554
15555 2008-07-23 Simon Baldwin <simonb@google.com>
15556
15557 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
15558 to zero for undefined symbols from dynamic libraries.
15559
15560 2008-07-23 Ian Lance Taylor <iant@google.com>
15561
15562 * symtab.cc (Symbol_table::resolve): Remove version parameter.
15563 Change all callers.
15564 * symtab.h (class Symbol_table): Update declaration.
15565 * testsuite/ver_test_9.cc: New file.
15566 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
15567 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
15568 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
15569 (ver_test_9.so, ver_test_9.o): New targets.
15570 * testsuite/Makefile.in: Rebuild.
15571
15572 2008-07-22 Ian Lance Taylor <iant@google.com>
15573
15574 * options.h (class General_options): Define --check-sections.
15575 * layout.cc (Layout::set_segment_offsets): Handle
15576 --check-sections.
15577
15578 * options.h (class General_options): Define -n/--nmagic and
15579 -N/--omagic.
15580 * options.cc (General_options::finalize): For -n/--nmagic or
15581 -N/--omagic, set -static.
15582 * layout.cc (Layout::attach_allocated_section_to_segment): If
15583 -N/--omagic, don't put read-only and read-write sections in
15584 different segments.
15585 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
15586 finding a read-only segment.
15587 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
15588 don't set the minimum segment alignment to the common page size,
15589 and don't set the file offset to the address modulo the page size.
15590 * script-sections.cc (Script_sections::create_segments): If
15591 -n/--omagic, don't put read-only and read-write sections in
15592 different segments.
15593
15594 * cref.cc: New file.
15595 * cref.h: New file.
15596 * options.h (class General_options): Add --print-symbol-counts.
15597 * main.cc (main): Issue defined symbol report if requested.
15598 * archive.cc (Archive::interpret_header): Make into a const member
15599 function.
15600 (Archive::add_symbols): Call Input_objects::archive_start and
15601 archive_stop.
15602 (Archive::const_iterator): Define new class.
15603 (Archive::begin, Archive::end): New functions.
15604 (Archive::include_all_members): Rewrite to use iterator.
15605 (Archive::count_members): New function.
15606 * archive.h (class Archive): Update declarations.
15607 (Archive::filename): New function.
15608 * object.cc: Include "cref.h".
15609 (Sized_relobj::Sized_relobj): Initialize defined_count_.
15610 (Sized_relobj::do_get_global_symbol_counts): New function.
15611 (Input_objects::add_object): Add object to cross-referencer.
15612 (Input_objects::archive_start): New function.
15613 (Input_objects::archive_stop): New function.
15614 (Input_objects::print_symbol_counts): New function.
15615 * object.h: Declare Cref and Archive.
15616 (Object::get_global_symbol_counts): New function.
15617 (Object::do_get_global_symbol_counts): New pure virtual function.
15618 (class Sized_relobj): Add defined_count_ field. Update
15619 declarations.
15620 (class Input_objects): Add cref_ field. Update constructor.
15621 Update declarations.
15622 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
15623 defined_count_.
15624 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
15625 symbol counts.
15626 (Sized_dynobj::do_get_global_symbol_counts): New function.
15627 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
15628 defined_count_. Update declarations. Define Symbols typedef.
15629 * symtab.cc (Symbol_table::add_from_relobj): Add defined
15630 parameter. Change all callers.
15631 (Symbol_table::add_from_dynobj): Add sympointers and defined
15632 parameters. Change all callers.
15633 * symtab.h (class Symbol_table): Update declarations.
15634 * Makefile.am (CCFILES): Add cref.cc.
15635 (HFILES): Add cref.h.
15636 * Makefile.in: Rebuild.
15637
15638 2008-07-22 Simon Baldwin <simonb@google.com>
15639
15640 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
15641 to zero when writing undefined symbols.
15642
15643 2008-07-22 Ian Lance Taylor <iant@google.com>
15644
15645 * output.cc (Output_section::add_input_section): Don't try to
15646 merge empty merge sections.
15647
15648 2008-07-21 Craig Silverstein <csilvers@google.com>
15649
15650 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15651 Include symbol version in error message.
15652
15653 2008-07-20 Chris Demetriou <cgd@google.com>
15654
15655 * configure.ac (gold_cv_c_random_seed): New configured variable.
15656 (RANDOM_SEED_CFLAGS): New substituted variable.
15657 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
15658 * configure: Rebuild.
15659 * Makefile.in: Likewise.
15660 * testsuite/Makefile.in: Likewise.
15661
15662 2008-07-18 Ian Lance Taylor <iant@google.com>
15663
15664 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
15665 where we see NAME/NULL and NAME/VERSION as separate symbols.
15666 * testsuite/ver_test_main.cc (main): Call t4.
15667 (t4, t4_2a): Define.
15668 * testsuite/ver_test_2.cc (t4_2): Define.
15669 * testsuite/ver_test_2.script: Put t4_2a in VER2.
15670 * testsuite/ver_test_4.cc (t4_2a): Define.
15671 * testsuite/ver_test_4.script: Put t4_2a in VER2.
15672 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
15673
15674 2008-07-17 Ian Lance Taylor <iant@google.com>
15675
15676 * dynobj.cc (Versions::add_def): If we give an error about a
15677 missing version, go ahead and create the version anyhow.
15678
15679 2008-07-10 Ian Lance Taylor <iant@google.com>
15680
15681 Handle output sections with more than 0x7fffffff bytes.
15682 * object.h (class Relobj): Change map_to_output_ to
15683 output_sections_, and just keep a section pointer. Change all
15684 uses. Move comdat group support to Sized_relobj.
15685 (Relobj::is_section_specially_mapped): Remove.
15686 (Relobj::output_section): Remove poff parameter. Change all
15687 callers.
15688 (Relobj::output_section_offset): New function.
15689 (Relobj::set_section_offset): Rewrite.
15690 (Relobj::map_to_output): Remove.
15691 (Relobj::output_sections): New function.
15692 (Relobj::do_output_section_offset): New pure virtual function.
15693 (Relobj::do_set_section_offset): Likewise.
15694 (class Sized_relobj): Add section_offsets_ field. Add comdat
15695 group support from Relobj. Update declarations.
15696 (Sized_relobj::get_output_section_offset): New function.
15697 (Sized_relobj::do_output_section_offset): New function.
15698 (Sized_relobj::do_set_section_offset): New function.
15699 * object.cc (Relobj::output_section_address): Remove.
15700 (Sized_relobj::Sized_relobj): Initialize new fields.
15701 (Sized_relobj::include_section_group): Cast find_kept_object to
15702 Sized_relobj.
15703 (Sized_relobj::include_linkonce_section): Likewise.
15704 (Sized_relobj::do_layout): Use separate arrays for output section
15705 and output offset.
15706 (Sized_relobj::do_count_local_symbols): Change map_to_output to
15707 output_sections.
15708 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
15709 output_sections and section_offsets.
15710 (Sized_relobj::write_local_symbols): Likewise.
15711 (map_to_kept_section): Compute output address directly.
15712 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
15713 output_sections and section_offsets.
15714 (Sized_relobj::write_sections): Likewise.
15715 (Sized_relobj::relocate_sections): Likewise.
15716 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
15717 * output.h (class Output_reloc): Update declarations. Change
15718 u2_.relobj to Sized_relobj*.
15719 (class Output_data_reloc): Change add functions to use
15720 Sized_relobj*.
15721 * output.cc (Output_reloc::Output_reloc): Change relobj to
15722 Sized_relobj*.
15723 (Output_reloc::local_section_offset): Change return type to
15724 Elf_Addr. Use get_output_section_offset.
15725 (Output_reloc::get_address): Likewise.
15726 (Output_section::is_input_address_mapped): Don't call
15727 is_section_specially_mapped.
15728 (Output_section::output_offset): Likewise.
15729 (Output_section::output_address): Likewise.
15730 (Output_section::starting_output_address): Likewise.
15731 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
15732 parameter to Sized_relobj*.
15733 (Copy_relocs::need_copy_reloc): Likewise.
15734 (Copy_relocs::save): Likewise.
15735 * copy-relocs.h (class Copy_relocs): Update declarations.
15736 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
15737 Sized_relobj*. Change relobj_ field to Sized_relobj*.
15738 * target-reloc.h (relocate_for_relocatable): Change
15739 offset_in_output_section type to Elf_Addr. Change code that uses
15740 it as well.
15741 * layout.cc (Layout::layout): Always set *off.
15742 * mapfile.cc (Mapfile::print_input_section): Use
15743 output_section_offset.
15744 * i386.cc (Target_i386::copy_reloc): Change object parameter to
15745 Sized_relobj*.
15746 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
15747 * sparc.cc (Target_sparc::copy_reloc): Likewise.
15748 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
15749
15750 2008-07-03 Ian Lance Taylor <iant@google.com>
15751
15752 * layout.cc (Layout::include_section): Do not discard unrecognized
15753 SHT_STRTAB sections.
15754
15755 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
15756
15757 * script.cc (Lex::can_continue_name): Make '?' allowable in
15758 version-script names.
15759 * testsuite/version_script.map: Change glob pattern to use '?'
15760
15761 2008-06-30 Manish Singh <yosh@gimp.org>
15762
15763 PR 6585
15764 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
15765 Correct typo.
15766
15767 2008-06-30 Ian Lance Taylor <iant@google.com>
15768
15769 PR 6660
15770 PR 6682
15771 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
15772 versions]: Don't try to read the value in the contents, since we
15773 don't use it. Use the template endianness when writing.
15774
15775 2008-06-25 Cary Coutant <ccoutant@google.com>
15776
15777 * fileread.cc (File_read::make_view): Assert on zero-length view.
15778 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
15779 symbol table when there are no symbols to read.
15780
15781 2008-06-23 Craig Silverstein <csilvers@google.com>
15782
15783 * version.cc (version_string): Bump to 1.7
15784
15785 2008-06-18 Craig Silverstein <csilvers@google.com>
15786
15787 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
15788 constant 0xFFFF to type Valtype.
15789 (Powerpc_relocate_functions::rel16_ha): Likewise.
15790
15791 2008-06-17 Ian Lance Taylor <iant@google.com>
15792
15793 * output.h (Output_section::Input_section): Initialize p2align_ to
15794 zero for Output_section_data constructors.
15795 (Output_section::Input_section::addralign): If not an input
15796 section, return the alignment of the Output_section_data.
15797 * testsuite/copy_test.cc: New file.
15798 * testsuite/copy_test_1.cc: New file.
15799 * testsuite/copy_test_2.cc: New file.
15800 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
15801 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
15802 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
15803 (copy_test_1_pic.o, copy_test_1.so): New targets.
15804 (copy_test_2_pic.o, copy_test_2.so): New targets.
15805 * testsuite/Makefile.in: Rebuild.
15806
15807 * script-sections.cc (Script_sections::place_orphan): Initialize
15808 local variable exact.
15809
15810 2008-06-13 David Edelsohn <edelsohn@gnu.org>
15811
15812 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
15813
15814 2008-06-12 David Edelsohn <edelsohn@gnu.org>
15815 David S. Miller <davem@davemloft.net>
15816
15817 * powerpc.cc: New file.
15818 * Makefile.am (TARGETSOURCES): Add powerpc.cc
15819 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
15820 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
15821 * Makefile.in: Rebuild.
15822
15823 2008-06-09 Ian Lance Taylor <iant@google.com>
15824
15825 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
15826 <exception>.
15827 (throwing, orig_terminate): New static variables.
15828 (terminate_handler): New static function.
15829 (t2): Set terminate handler.
15830
15831 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
15832
15833 PR 6584
15834 * binary.cc (Binary_to_elf::sized_convert): Fix .data
15835 alignment.
15836
15837 2008-05-30 Cary Coutant <ccoutant@google.com>
15838
15839 * archive.cc (Archive::include_all_members) Correct to step
15840 over symbol table and extended name table in thin archives.
15841
15842 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
15843
15844 PR 6407
15845 * target-reloc.h (relocate_for_relocatable): Fix new_offset
15846 calculation.
15847
15848 2008-05-28 Caleb Howe <cshowe@google.com>
15849
15850 * reduced_debug_output.cc: New file.
15851 * reduced_debug_output.h: New file.
15852 * options.h (class General_options): Add --strip-debug-non-line.
15853 * options.cc (General_options::finalize): Add strip_debug_non_line
15854 to the strip heirarchy.
15855 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
15856 fields.
15857 * layout.cc: Include "reduced_debug_output.h".
15858 (Layout::Layout): Initialize new fields.
15859 (line_only_debug_sections): New static array.
15860 (is_lines_only_debug_sections): New static inline function.
15861 (Layout::include_section): Handle --strip-debug-non-line.
15862 (Layout::make_output_section): If --strip-debug-non-line, build
15863 new output sections for .debug_abbrev and .debug_info.
15864 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
15865 gold. Warn about possible overflow.
15866 (read_signed_LEB_128): Likewise.
15867 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
15868 (read_signed_LEB_128): Declare.
15869 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
15870 (HFILES): Add reduced_debug_output.h.
15871 * Makefile.in: Rebuild.
15872
15873 2008-05-21 Ian Lance Taylor <iant@google.com>
15874
15875 * mapfile.cc: New file.
15876 * mapfile.h: New file.
15877 * options.h (class General_options): Add -M/--print-map and -Map.
15878 * options.cc (General_options::finalize): Make -M equivalent to
15879 -Map -.
15880 * main.cc: Include <cstdio> and "mapfile.h".
15881 (main): Open mapfile if requested.
15882 * gold.cc (class Middle_runner): Add mapfile_ field. Update
15883 constructor. Change caller.
15884 (queue_initial_tasks): Add mapfile parameter. Change caller.
15885 (queue_middle_tasks): Likewise.
15886 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
15887 declarations.
15888 * archive.cc: Include "mapfile.h".
15889 (Archive::add_symbols): Add mapfile parameter. Change all
15890 callers. Pass mapfile, symbol, and reason to include_member.
15891 (Archive::include_all_members): Add mapfile parameter. Change all
15892 callers.
15893 (Archive::include_member): Add mapfile, sym, and why parameters.
15894 Change all callers. Report inclusion to map file.
15895 * archive.h: Include "fileread.h".
15896 (class Archive): Update declarations.
15897 (Archive::file): New const method.
15898 (class Add_archive_symbols): Add mapfile_ field. Update
15899 constructor. Change all callers.
15900 * readsyms.h (class Read_symbols): Likewise.
15901 (class Finish_group): Likewise.
15902 (class Read_script): Likewise.
15903 * common.cc: Include "mapfile.h".
15904 (Symbol_table::allocate_commons): Add mapfile parameter. Change
15905 all callers.
15906 (Symbol_table::do_allocate_commons): Likewise.
15907 (Symbol_table::do_allocate_commons_list): Likewise. Report common
15908 symbol allocation to mapfile.
15909 * common.h (class Allocate_commons_task): Add mapfile_ field.
15910 Update constructor. Change all callers.
15911 * symtab.h (class Symbol_table): Update declarations.
15912 * layout.cc: Include "mapfile.h".
15913 (Layout_task_runner::run): Print information to mapfile.
15914 (Layout::create_gold_note): Change Output_data_fixed_space to
15915 Output_data_zero_fill.
15916 (Layout::create_build_id): Likewise.
15917 (Layout::print_to_mapfile): New function.
15918 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
15919 constructor. Change caller.
15920 (class Layout): Declare print_to_mapfile.
15921 * output.cc (Output_section::Input_section::print_to_mapfile): New
15922 function.
15923 (Output_section::add_input_section): If producing a map, always
15924 add to input_sections_ list.
15925 (Output_section::do_print_to_mapfile): New function.
15926 (Output_segment::print_sections_to_mapfile): New function.
15927 (Output_segment::print_section_list_to_mapfile): New function.
15928 * output.h: Include "mapfile.h".
15929 (Output_data::print_to_mapfile): New function.
15930 (Output_data::do_print_to_mapfile): New virtual function.
15931 (Output_segment_headers::do_print_to_mapfile): New function.
15932 (Output_file_header::do_print_to_mapfile): New function.
15933 (Output_data_const::do_print_to_mapfile): New function.
15934 (class Output_data_const_buffer): Add map_name_ field. Update
15935 constructor. Change all callers. Add do_print_to_mapfile
15936 function.
15937 (class Output_data_fixed_space): Likewise.
15938 (class Output_data_space): Likewise.
15939 (class Output_data_zero_fill): New class.
15940 (Output_data_strtab::do_print_to_mapfile): New function.
15941 (Output_data_reloc_base::do_print_to_mapfile): New function.
15942 (Output_relocatable_relocs::do_print_to_mapfile): New function.
15943 (Output_data_group::do_print_to_mapfile): New function.
15944 (Output_data_got::do_print_to_mapfile): New function.
15945 (Output_data_dynamic::do_print_to_mapfile): New function.
15946 (Output_symtab_xindex::do_print_to_mapfile): New function.
15947 (class Output_section): Declare do_print_to_mapflie. Declare
15948 print_to_mapfile in Input_section.
15949 (class Output_segment): Declare new functions.
15950 * object.h (Sized_relobj::symbol_count): New function.
15951 * script-sections.cc
15952 (Output_section_element_dot_assignment::set_section_addresses):
15953 Change Output_data_fixed_space to Output_data_zero_fill.
15954 (Output_data_expression::do_print_to_mapfile): New function.
15955 * script.cc (read_input_script): Add mapfile parameter. Change
15956 all callers.
15957 * script.h (read_input_script): Update declaration.
15958 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
15959 (Eh_frame::do_print_to_mapfile): New function.
15960 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
15961 (Output_merge_string::do_print_to_mapfile): New function.
15962 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
15963 function.
15964 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
15965 function.
15966 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
15967 function.
15968 * Makefile.am (CCFILES): Add mapfile.cc.
15969 (HFILES): Add mapfile.h.
15970 * Makefile.in: Rebuild.
15971
15972 2008-05-19 Ian Lance Taylor <iant@google.com>
15973
15974 * options.h (class General_options): Add -z relro.
15975 * layout.cc (Layout::Layout): Initialize relro_segment_.
15976 (Layout::add_output_section_data): Return the output section.
15977 (Layout::make_output_section): Rcognize relro sections and mark
15978 them appropriately.
15979 (Layout::attach_allocated_section_to_segment): Put relro sections
15980 in a PT_GNU_RELRO segment.
15981 (Layout::create_initial_dynamic_sections): Mark the .dynamic
15982 section as relro.
15983 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
15984 PT_TLS segments.
15985 (Layout::linkonce_mapping): Map d.rel.ro.local to
15986 .data.rel.ro.local.
15987 (Layout::output_section_name): Us .data.rel.ro.local for any
15988 section which begins with that.
15989 * layout.h (class Layout): Update add_output_section_data
15990 declaration. Add relro_segment_ field.
15991 * output.cc (Output_section::Output_section): Initialize is_relro_
15992 and is_relro_local_ fields.
15993 (Output_segment::add_output_section): Group relro sections.
15994 (Output_segment::is_first_section_relro): New function.
15995 (Output_segment::maximum_alignment): If there is a relro section,
15996 align the segment to the common page size.
15997 (Output_segment::set_section_addresses): Track whether we are
15998 looking at relro sections. If the last section is a relro
15999 section, align to the common page size.
16000 (Output_segment::set_section_list_addresses): Add in_relro
16001 parameter. Change all callers. Align to the page size when
16002 moving from relro to non-relro section.
16003 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
16004 segment.
16005 * output.h (class Output_section): Add is_relro_ and
16006 is_relro_local_ fields.
16007 (Output_section::is_relro): New function.
16008 (Output_section::set_is_relro): New function.
16009 (Output_section::is_relro_local): New function.
16010 (Output_section::set_is_relro_local): New function.
16011 (class Output_segment): Update declarations.
16012 * i386.cc (Target_i386::got_section): Mark .got section as relro.
16013 * sparc.cc (Target_sparc::got_section): Likewise.
16014 * x86_64.cc (Target_x86_64::got_section): Likewise.
16015 * testsuite/relro_test_main.cc: New file.
16016 * testsuite/relro_test.cc: New file.
16017 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
16018 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
16019 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
16020 (relro_test.so, relro_test_pic.o): New targets.
16021 * testsuite/Makefile.in: Rebuild.
16022
16023 2008-05-16 Ian Lance Taylor <iant@google.com>
16024
16025 * output.cc (Output_segment::add_output_section): Remove front
16026 parameter.
16027 * output.h (class Output_segment): Remove
16028 add_initial_output_section and overloaded add_output_section.
16029 Update declaration of remaining add_output_section.
16030 * layout.cc (Layout::create_interp): Call add_output_section
16031 rather than add_initial_output_section.
16032 (Layout::finish_dynamic_section): Likewise.
16033
16034 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
16035 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
16036 know the dynamic type.
16037 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
16038 field. Initialize it in constructor.
16039 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
16040 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
16041 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
16042 reloc.
16043
16044 * output.cc (Output_reloc::get_address): Change return type to
16045 Elf_Addr.
16046 * output.h (class Output_reloc): Update get_address declaration.
16047 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
16048 for section addresses.
16049
16050 2008-05-09 Ian Lance Taylor <iant@google.com>
16051
16052 PR 6493
16053 * gold.cc (gold_nomem): Use return value of write.
16054
16055 2008-05-08 Ian Lance Taylor <iant@google.com>
16056
16057 * symtab.c (Symbol::init_base_output_data): Add version
16058 parameter. Change all callers.
16059 (Symbol::init_base_output_segment): Likewise.
16060 (Symbol::init_base_constant): Likewise.
16061 (Symbol::init_base_undefined): Likewise.
16062 (Sized_symbol::init_output_data): Likewise.
16063 (Sized_symbol::init_output_segment): Likewise.
16064 (Sized_symbol::init_constant): Likewise.
16065 (Sized_symbol::init_undefined): Likewise.
16066 (Symbol_table::do_define_in_output_data): If the new symbol has a
16067 version, mark it as the default.
16068 (Symbol_table::do_define_in_output_segment): Likewise.
16069 (Symbol_table::do_define_as_constant): Likewise.
16070 * symtab.h (class Symbol): Update declarations.
16071 (class Sized_symbol): Likewise.
16072 * resolve.cc (Symbol::override_version): New function.
16073 (Symbol::override_base): Call override_version.
16074 (Symbol::override_base_with_special): Likewise.
16075 * testsuite/ver_script_8.script: New file.
16076 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
16077 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
16078 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
16079 (ver_test_8_1.so, ver_test_8_2.so): New targets.
16080
16081 2008-05-06 Ian Lance Taylor <iant@google.com>
16082
16083 PR 6049
16084 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
16085 functions.
16086 (class General_options): Remove existing --undefined, and add
16087 --no-undefined instead. Add new --undefined as synonym for -u.
16088 * archive.cc (Archive::add_symbols): Check whether symbol was
16089 named with -u.
16090 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
16091 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
16092 all uses. Add IS_UNDEFINED. Update declarations to split
16093 different versions of init_base. Declare init_base_undefined.
16094 (Symbol::is_defined): Handle IS_UNDEFINED.
16095 (Symbol::is_undefined): Likewise.
16096 (Symbol::is_weak_undefined): Call is_undefined.
16097 (Symbol::is_absolute): Handle IS_CONSTANT.
16098 (class Sized_symbol): Update declarations to split different
16099 versions of init. Declare init_undefined.
16100 (class Symbol_table): Declare new functions.
16101 * symtab.cc (Symbol::init_base_object): Rename from init_base.
16102 Change all callers.
16103 (Symbol::init_base_output_data): Likewise.
16104 (Symbol::init_base_output_segment): Likewise.
16105 (Symbol::init_base_constant): Likewise.
16106 (Symbol::init_base_undefined): New function.
16107 (Sized_symbol::init_object): Rename from init. Change all
16108 callers.
16109 (Sized_symbol::init_output_data): Likewise.
16110 (Sized_symbol::init_output_segment): Likewise.
16111 (Sized_symbol::init_constant): Likewise.
16112 (Sized_symbol::init_undefined): New function.
16113 (Symbol_table::add_undefined_symbols_from_command_line): New
16114 function.
16115 (Symbol_table::do_add_undefined_symbols_from_command_line): New
16116 function.
16117 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
16118 (Symbol::output_section): Likewise.
16119 (Symbol::set_output_section): Likewise.
16120 (Symbol_table::sized_finalize_symbol): Likewise.
16121 (Symbol_table::sized_write_globals): Likewise.
16122 * resolve.cc (Symbol_table::should_override): Likewise.
16123 (Symbol::override_base_with_special): Likewise.
16124
16125 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
16126 symbol, change it to have default visibility.
16127 * testsuite/protected_1.cc: New file.
16128 * testsuite/protected_2.cc: New file.
16129 * testsuite/protected_3.cc: New file.
16130 * testsuite/protected_main_1.cc: New file.
16131 * testsuite/protected_main_2.cc: New file.
16132 * testsuite/protected_main_3.cc: New file.
16133 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
16134 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
16135 (protected_1_LDFLAGS, protected_1_LDADD): Define.
16136 (protected_1.so): New target.
16137 (protected_1_pic.o, protected_2_pic.o): New targets.
16138 (protected_3_pic.o): New target.
16139 (check_PROGRAMS): Add protected_2.
16140 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
16141 (protected_2_LDFLAGS, protected_2_LDADD): Define.
16142 * testsuite/Makefile.in: Rebuild.
16143
16144 * options.h (DEFINE_var): Add set_user_set_##varname__.
16145 (DEFINE_bool_alias): New macro.
16146 (class General_options): Define -Bstatic using DEFINE_bool_alias
16147 rather than DEFINE_special. Add --undefined as an alias for -z
16148 defs.
16149 * options.cc (General_options::parse_Bstatic): Remove.
16150
16151 * options.h (class General_options): Add --fatal-warnings.
16152 * main.cc (main): Implement --fatal-warnings.
16153 * errors.h (Errors::warning_count): New function.
16154
16155 * options.h (class General_options): Add -Bsymbolic-functions.
16156 * symtab.h (Symbol::is_preemptible): Check for
16157 -Bsymbolic-functions.
16158
16159 2008-05-05 Ian Lance Taylor <iant@google.com>
16160
16161 * options.h (DEFINE_bool): For DASH_Z, create the negative option
16162 as noVARNAME rather than no-VARNAME.
16163 (class General_options): Add option -z combreloc.
16164 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
16165 get_address.
16166 (Output_reloc::sort_before) [SHT_REL]: New function.
16167 (Output_reloc::sort_before) [SHT_RELA]: New function.
16168 (class Output_data_reloc_base): Add sort_relocs_ field. Define
16169 Sort_relocs_comparison.
16170 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
16171 parameter. Change all callers.
16172 (Output_data_reloc::Output_data_reloc) [both versions]: Add
16173 sort_relocs parameter. Change all callers.
16174 * output.cc (Output_reloc::get_address): New function, broken out
16175 of write_rel.
16176 (Output_reloc::write_rel): Call it.
16177 (Output_reloc::compare): New function.
16178 (Output_data_reloc_base::do_write): Optionally sort relocs.
16179
16180 * configure.ac: If targ_extra_obj is set, link it in.
16181 * configure.tgt: Initialize all variables.
16182 (x86_64*): Set targ_extra_obj and targ_extra_size.
16183 * configure: Rebuild.
16184
16185 * object.cc (Sized_relobj::include_section_group): Adjust section
16186 indexes read from group data. Build vector to pass to
16187 layout_group.
16188 * layout.cc (Layout::layout_group): Add flags and shndxes
16189 parameters. Remove contents parameter. Change caller. Update
16190 explicit instantiations.
16191 * layout.h (class Layout): Update layout_group declaration.
16192 * output.cc (Output_data_group::Output_data_group): Add flags and
16193 input_shndxes parameters. Remove contents parameter. Change
16194 caller.
16195 (Output_data_group::do_write): Change input_sections_ to
16196 input_shndxes_.
16197 * output.h (class Output_data_group): Update constructor
16198 declaration. Rename input_sections_ to input_shndxes_.
16199 * testsuite/many_sections_test.cc: Add template.
16200
16201 2008-04-30 Cary Coutant <ccoutant@google.com>
16202
16203 * target-reloc.h (relocate_section): Fix dead-pointer bug.
16204
16205 * layout.cc (Layout::include_section): Refactored check for debug
16206 info section.
16207 (Layout::add_comdat): Add new parameters. Change type
16208 of signature parameter. Add object and shndx to signatures table.
16209 (Layout::find_kept_object): New function.
16210 * layout.h: Include <cstring>.
16211 (Layout::is_debug_info_section): New function.
16212 (Layout::add_comdat): Add new parameters.
16213 (Layout::find_kept_object): New function.
16214 (Layout::Kept_section): New struct.
16215 (Layout::Signatures): Change type of map range.
16216 * object.cc (Relobj::output_section_address): New function.
16217 (Sized_relobj::include_section_group): Add new parameters. Change
16218 calls to Layout::add_comdat. Change to build table of kept comdat
16219 groups and table mapping discarded sections to kept sections.
16220 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
16221 (Sized_relobj::do_layout): Change calls to include_section_group and
16222 include_linkonce_section.
16223 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
16224 value to zero when section is discarded.
16225 (Sized_relobj::map_to_kept_section): New function.
16226 * object.h (Relobj::output_section_address): New function.
16227 (Relobj::Comdat_group): New type.
16228 (Relobj::find_comdat_group): New function.
16229 (Relobj::Comdat_group_table): New type.
16230 (Relobj::Kept_comdat_section): New type.
16231 (Relobj::Kept_comdat_section_table): New type.
16232 (Relobj::add_comdat_group): New function.
16233 (Relobj::set_kept_comdat_section): New function.
16234 (Relobj::get_kept_comdat_section): New function.
16235 (Relobj::comdat_groups_): New field.
16236 (Relobj::kept_comdat_sections_): New field.
16237 (Symbol_value::input_value): Update comment.
16238 (Sized_relobj::map_to_kept_section) New function.
16239 (Sized_relobj::include_linkonce_section): Add new parameter.
16240 * target-reloc.h (Comdat_behavior): New type.
16241 (get_comdat_behavior): New function.
16242 (relocate_section): Add code to map a discarded section to the
16243 corresponding kept section when applying a relocation.
16244
16245 2008-04-30 Craig Silverstein <csilvers@google.com>
16246
16247 * dwarf_reader.cc (next_generation_count): New static var.
16248 (Addr2line_cache_entry): New struct.
16249 (addr2line_cache): New static var.
16250 (Dwarf_line_info::one_addr2line): Added caching.
16251 (Dwarf_line_info::clear_addr2line_cache): New function.
16252 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
16253 cache-size parameter.
16254 (Dwarf_line_info::one_addr2line_cache): New function.
16255 * symtab.cc (Symbol_table::detect_odr_violations): Pass
16256 new cache-size argument to one_addr2line(), and clear cache.
16257
16258 2008-04-28 Cary Coutant <ccoutant@google.com>
16259
16260 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
16261 R_386_PC8 relocations.
16262
16263 2008-04-23 Ian Lance Taylor <iant@google.com>
16264
16265 * object.cc (Sized_relobj::include_section_group): Check for
16266 invalid section group.
16267
16268 * object.cc (make_elf_object): Correct test for 64-bit ELF file
16269 header size.
16270
16271 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
16272 than read for file header.
16273 * archive.cc (Archive::include_member): Likewise.
16274
16275 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
16276
16277 * aclocal.m4: Regenerate.
16278 * configure: Regenerate.
16279
16280 2008-04-19 Ian Lance Taylor <iant@google.com>
16281
16282 * version.cc (version_string): Bump to 1.6.
16283
16284 * testsuite/Makefile.am (many_sections_r_test): New target.
16285 (many_sections_r_test_SOURCES): Remove.
16286 (many_sections_r_test_DEPENDENCIES): Remove.
16287 (many_sections_r_test_LDFLAGS): Remove.
16288 (many_sections_r_test_LDADD): Remove.
16289
16290 * object.cc (Sized_relobj::do_add_symbols): Always pass
16291 local_symbol_count_ to add_from_relobj.
16292
16293 * testsuite/Makefile.am (many_sections_check.h): Only check one in
16294 every thousand variables.
16295 * testsuite/Makefile.in: Rebuild.
16296
16297 * object.cc (Xindex::initialize_symtab_xindex): New function.
16298 (Xindex::read_symtab_xindex): New function.
16299 (Xindex::sym_xindex_to_shndx): New function.
16300 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
16301 available.
16302 (Sized_relobj::do_initialize_xindex): New function.
16303 (Sized_relobj::do_read_symbols): Adjust section links.
16304 (Sized_relobj::symbol_section_and_value): Add is_ordinary
16305 parameter. Change all callers.
16306 (Sized_relobj::include_section_group): Adjust section links and
16307 symbol section indexes.
16308 (Sized_relobj::do_layout): Adjust section links.
16309 (Sized_relobj::do_count_local_symbols): Adjust section links and
16310 symbol section indexes.
16311 (Sized_relobj::do_finalize_local_symbols): Distinguish between
16312 ordinary and special symbols.
16313 (Sized_relobj::write_local_symbols): Add symtab_xindex and
16314 dynsym_xindex parameters. Change all callers. Adjust section
16315 links. Use SHN_XINDEX when needed.
16316 (Sized_relobj::get_symbol_location_info): Adjust section links.
16317 Don't get fooled by special symbols.
16318 * object.h (class Xindex): Define.
16319 (class Object): Add xindex_ parameter. Declare virtual functoin
16320 do_initialize_xindex.
16321 (Object::adjust_sym_shndx): New function.
16322 (Object::set_xindex): New protected function.
16323 (class Symbol_value): Add is_ordinary_shndx_ field.
16324 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
16325 (Symbol_value::value): Assert ordinary section.
16326 (Symbol_value::initialize_input_to_output_map): Likewise.
16327 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
16328 Change all callers.
16329 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
16330 all callers.
16331 (class Sized_relobj): Update declarations.
16332 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
16333 parameter. Change all callers.
16334 (Sized_relobj::adjust_shndx): New function.
16335 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
16336 field.
16337 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
16338 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
16339 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
16340 (Sized_dynobj::read_dynsym_section): Adjust section links.
16341 (Sized_dynobj::read_dynamic): Likewise.
16342 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
16343 section links.
16344 (Sized_dynobj::do_initialize_xindex): New function.
16345 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
16346 do_initialize_xindex.
16347 (Sized_dynobj::adjust_shndx): New function.
16348 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
16349 dynsym_xindex_ fields.
16350 (Layout::finalize): Add a call to set_section_indexes before
16351 creating the symtab sections.
16352 (Layout::set_section_indexes): Don't do anything if the section
16353 already has a section index.
16354 (Layout::create_symtab_sections): Add shnum parameter. Change
16355 caller. Create .symtab_shndx section if needed.
16356 (Layout::create_shdrs): Add shstrtab_section parameter. Change
16357 caller.
16358 (Layout::allocated_output_section_count): New function.
16359 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
16360 needed.
16361 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
16362 fields. Update declarations.
16363 (Layout::symtab_xindex): New function.
16364 (Layout::dynsym_xindex): New function.
16365 (class Write_symbols_task): Add layout_ field.
16366 (Write_symbols_task::Write_symbols_task): Add layout parameter.
16367 Change caller.
16368 * output.cc (Output_section_headers::Output_section_headers): Add
16369 shstrtab_section parameter. Change all callers.
16370 (Output_section_headers::do_sized_write): Store overflow values
16371 for section count and section string table section index in
16372 section header zero.
16373 (Output_file_header::do_sized_write): Check for overflow of
16374 section count and section string table section index.
16375 (Output_symtab_xindex::do_write): New function.
16376 (Output_symtab_xindex::endian_do_write): New function.
16377 * output.h (class Output_section_headers): Add shstrtab_section_.
16378 Update declarations.
16379 (class Output_symtab_xindex): Define.
16380 (Output_section::has_out_shndx): New function.
16381 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
16382 field.
16383 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
16384 Change all callers.
16385 (Sized_symbol::init): Likewise.
16386 (Symbol::output_section): Check for ordinary symbol.
16387 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
16388 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
16389 callers.
16390 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
16391 Change all callers. Simplify handling of symbols from sections
16392 not included in the link.
16393 (Symbol_table::add_from_dynobj): Handle ordinary symbol
16394 distinction.
16395 (Weak_alias_sorter::operator()): Assert that symbols are
16396 ordinary.
16397 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
16398 distinction.
16399 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
16400 parameters. Change all callers.
16401 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
16402 symbol distinction. Use SHN_XINDEX when needed.
16403 (Symbol_table::write_section_symbol): Add symtab_xindex
16404 parameter. Change all callers.
16405 (Symbol_table::sized_write_section_symbol): Likewise. Use
16406 SHN_XINDEX when needed.
16407 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
16408 declarations.
16409 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
16410 (Symbol::is_defined): Check is_ordinary.
16411 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
16412 (Symbol::is_absolute, Symbol::is_common): Likewise.
16413 (class Sized_symbol): Update declarations.
16414 (class Symbol_table): Update declarations.
16415 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
16416 parameters. Change all callers.
16417 (Sized_symbol::override): Likewise.
16418 (Symbol_table::override): Likewise.
16419 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
16420 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
16421 is_ordinary, and orig_st_shndx parameters. Change all callers.
16422 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
16423 to be in an ordinary section.
16424 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
16425 object and is_ordinary parameters. Change all callers.
16426 (Sized_dwarf_line_info::read_relocs): Add object parameter.
16427 Change all callers. Don't add undefined or non-ordinary symbols
16428 to reloc_map_.
16429 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
16430 Change all callers.
16431 * dwarf_reader.h (class Sized_dwarf_line_info): Update
16432 declarations.
16433 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
16434 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
16435 (Sized_relobj::relocate_sections): Likewise.
16436 * target-reloc.h (scan_relocs): Adjust section symbol index.
16437 (scan_relocatable_relocs): Likewise.
16438 * i386.cc (Scan::local): Check for ordinary symbols.
16439 * sparc.cc (Scan::local): Likewise.
16440 * x86_64.cc (Scan::local): Likewise.
16441 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
16442 to symbol_section_and_value.
16443 * testsuite/many_sections_test.cc: New file.
16444 * testsuite/Makefile.am (BUILT_SOURCES): Define.
16445 (check_PROGRAMS): Add many_sections_test.
16446 (many_sections_test_SOURCES): Define.
16447 (many_sections_test_DEPENDENCIES): Define.
16448 (many_sections_test_LDFLAGS): Define.
16449 (BUILT_SOURCES): Add many_sections_define.h.
16450 (many_sections_define.h): New target.
16451 (BUILT_SOURCES): Add many_sections_check.h.
16452 (many_sections_check.h): New target.
16453 (check_PROGRAMS): Add many_sections_r_test.
16454 (many_sections_r_test_SOURCES): Define.
16455 (many_sections_r_test_DEPENDENCIES): Define.
16456 (many_sections_r_test_LDFLAGS): Define.
16457 (many_sections_r_test_LDADD): Define.
16458 (many_sections_r_test.o): New target.
16459 * testsuite/Makefile.in: Rebuild.
16460
16461 2008-04-17 Cary Coutant <ccoutant@google.com>
16462
16463 * errors.cc (Errors::info): New function.
16464 (gold_info): New function.
16465 * errors.h (Errors::info): New function.
16466 * gold.h (gold_info): New function.
16467 * object.cc (Input_objects::add_object): Print trace output.
16468 * options.cc (options::parse_set): New function.
16469 (General_options::parse_wrap): Deleted.
16470 (General_options::General_options): Deleted initializer.
16471 * options.h (options::String_set): New typedef.
16472 (options::parse_set): New function.
16473 (DEFINE_set): New macro.
16474 (General_options::wrap): Changed to use DEFINE_set. Changed
16475 callers of any_wrap_symbols and is_wrap_symbol.
16476 (General_options::trace, General_options::trace_symbol):
16477 New options.
16478 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
16479 (General_options::wrap_symbols_): Deleted.
16480 * symtab.cc (Symbol_table::add_from_object): Print trace output.
16481
16482 2008-04-17 David S. Miller <davem@davemloft.net>
16483
16484 * options.cc (General_options::parse_V): New function.
16485 * options.h: Add entries for -V and -Qy.
16486
16487 2008-04-17 Ian Lance Taylor <iant@google.com>
16488
16489 * common.cc (Symbol_table::allocate_commons): Remove options
16490 parameter. Change caller.
16491 (Symbol_table::do_allocate_commons): Remove options parameter.
16492 Change caller. Just call do_allocate_commons_list twice.
16493 (Symbol_table::do_allocate_commons_list): New function, broken out
16494 of do_allocate_commons.
16495 * common.h (class Allocate_commons_task): Remove options_ field.
16496 Update constructor.
16497 * symtab.cc (Symbol_table::Symbol_table): Initialize
16498 tls_commons_.
16499 (Symbol_table::add_from_object): Put TLS common symbols on
16500 tls_commons_ list.
16501 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
16502 which are IN_OUTPUT_DATA.
16503 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
16504 allocate_commons and do_allocate_commons declarations. Declare
16505 do_allocate_commons_list.
16506 * gold.cc (queue_middle_tasks): Update creation of
16507 Allocate_commons_task to not pass options.
16508 * testsuite/Makefile.am (INCLUDES): Add -I.. .
16509 (TLS_TEST_C_FLAGS): New variable.
16510 (tls_test_c_pic.o): New target.
16511 (tls_test_shared.so): Link in tls_test_c_pic.o.
16512 (tls_test_c_pic_ie.o): New target.
16513 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
16514 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
16515 (tls_test_c.o): New target.
16516 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
16517 (tls_pic_test_LDADD): Likewise.
16518 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
16519 (tls_shared_gd_to_ie_test_LDADD): Likewise.
16520 (tls_test_c_gnu2.o): New target.
16521 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
16522 tls_test_c_gnu2.o.
16523 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
16524 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
16525 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
16526 * testsuite/tls_test.cc: Include "config.h".
16527 (t_last): Call t11_last.
16528 * testsuite/tls_test.h (t11, t11_last): Declare.
16529 * testsuite/tls_test_c.c: New file.
16530 * testsuite/tls_test_main.cc (thread_routine): Call t11.
16531 * configure.ac: Check for OpenMP support.
16532 * configure, config.in, Makefile.in: Rebuild.
16533 * testsuite/Makefile.in: Rebuild.
16534
16535 2008-04-16 Cary Coutant <ccoutant@google.com>
16536
16537 * i386.cc (Target_i386::define_tls_base_symbol): New function.
16538 (Target_i386::tls_base_symbol_defined_): New field.
16539 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16540 (Target_i386::Scan::global): Likewise.
16541 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
16542 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
16543 (Target_x86_64::tls_base_symbol_defined_): New field.
16544 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16545 (Target_x86_64::Scan::global): Likewise.
16546
16547 2008-04-16 Cary Coutant <ccoutant@google.com>
16548
16549 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
16550 (Symbol::needs_plt_entry): Allow weak undefined symbols.
16551 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
16552 building shared libraries.
16553 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
16554 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
16555 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
16556 * testsuite/Makefile.in: Rebuild.
16557 * testsuite/weak_undef.h: New file.
16558 * testsuite/weak_undef_file1.cc: Add extra test cases.
16559 * testsuite/weak_undef_file2.cc: Likewise.
16560 * testsuite/weak_undef_test.cc: Likewise.
16561
16562 2008-04-16 David S. Miller <davem@davemloft.net>
16563
16564 * sparc.cc (Target_sparc::Scan): Change from struct to class.
16565 Add issued_non_pic_error_ field. Declare check_non_pic.
16566 (Target_sparc::Scan::check_non_pic): New function.
16567 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
16568 (Target_sparc::Scan::global): Likewise.
16569
16570 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
16571 * configure: Rebuild.
16572
16573 * options.h (DEFINE_enable): New macro.
16574 (new_dtags): New enable option.
16575 (initfirst, interpose, loadfltr, nodefaultlib,
16576 nodelete, nodlopen, nodump): New -z options.
16577 * layout.cc (Layout:finish_dynamic_section): If new
16578 dtags enabled, emit DT_RUNPATH. Also, emit a
16579 DT_FLAGS_1 containing any specified -z flags.
16580
16581 2008-04-16 Ian Lance Taylor <iant@google.com>
16582
16583 * copy-relocs.cc: New file.
16584 * copy-relocs.h: New file.
16585 * reloc.cc: Remove Copy_relocs code.
16586 * reloc.h: Likewise.
16587 * reloc-types.h (struct Reloc_types) [both versions]: Add
16588 get_reloc_addend_noerror.
16589 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
16590 variants of add_global which take an addend which must be zero.
16591 * i386.cc: Include "copy-relocs.h".
16592 (class Target_i386): Change type of copy_relocs_ to variable,
16593 update initializer.
16594 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
16595 Change all callers.
16596 (Target_i386::do_finalize_sections): Change handling of
16597 copy_relocs_.
16598 * sparc.cc: Include "copy-relocs.h".
16599 (class Target_sparc): Change type of copy_relocs_ to variable,
16600 update initializer.
16601 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
16602 Change all callers.
16603 (Target_sparc::do_finalize_sections): Change handling of
16604 copy_relocs_.
16605 * x86_64.cc: Include "copy-relocs.h".
16606 (class Target_x86_64): Change type of copy_relocs_ to variable,
16607 update initializer.
16608 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
16609 class. Change all callers.
16610 (Target_x86_64::do_finalize_sections): Change handling of
16611 copy_relocs_.
16612 * Makefile.am (CCFILES): Add copy-relocs.cc.
16613 (HFILES): Add copy-relocs.h.
16614
16615 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
16616
16617 * testsuite/script_test_4.sh: Permit leading zeroes.
16618
16619 2008-04-15 Ian Lance Taylor <iant@google.com>
16620
16621 * script-sections.cc (Script_sections::create_segments): Use
16622 header_size_adjustment even when there is enough room for the
16623 headers.
16624 * testsuite/script_test_4.sh: New file.
16625 * testsuite/script_test_4.t: New file.
16626 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
16627 (check_DATA): Add script_test_4.stdout.
16628 (MOSTLYCLEANFILES): Likewise.
16629 (script_test_4): New target.
16630 (script_test_4.stdout): New target.
16631 * testsuite/Makefile.in: Rebuild.
16632
16633 * sparc.cc: Add definitions for Output_data_plt_sparc class
16634 constants.
16635
16636 2008-04-14 David S. Miller <davem@davemloft.net>
16637
16638 * sparc.cc: New file.
16639 * Makefile.am (TARGETSOURCES): Add sparc.cc
16640 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
16641 * configure.tgt: Document targ_extra_size and
16642 targ_extra_big_endian. Add entries for sparc-* and
16643 sparc64-*.
16644 * configure.ac: Handle targ_extra_size and
16645 targ_extra_big_endian.
16646 * Makefile.in: Rebuild.
16647 * configure: Likewise.
16648 * po/POTFILES.in: Likewise.
16649 * po/gold.pot: Likewise.
16650
16651 2008-04-14 Ian Lance Taylor <iant@google.com>
16652
16653 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
16654 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
16655 in the name/type/flags to section mapping. Don't call
16656 allocate_output_section.
16657 (Layout::choose_output_section): Change parameter from adjust_name
16658 to is_input_section. Don't permit input sections after sections
16659 are attached to segments. Don't call allocate_output_section.
16660 (Layout::layout_eh_frame): Call update_flags_for_input_section,
16661 not write_enable_output_section.
16662 (Layout::make_output_section): Don't push to
16663 unattached_section_list_ nor call attach_to_segment. Call
16664 attach_section_to_segment if sections are attached.
16665 (Layout::attach_sections_to_segments): New function.
16666 (Layout::attach_section_to_segment): New function.
16667 (Layout::attach_allocated_section_to_segment): Rename from
16668 attach_to_segment. Remove flags parameter.
16669 (Layout::allocate_output_section): Remove function.
16670 (Layout::write_enable_output_section): Remove function.
16671 * layout.h (class Layout): Update for above changes. Add new
16672 field sections_are_attached_.
16673 * output.h (Output_section::update_flags_for_input_section): New
16674 function.
16675 * output.cc (Output_section::add_input_section): Call
16676 update_flags_for_input_section.
16677 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
16678
16679 2008-04-11 Cary Coutant <ccoutant@google.com>
16680
16681 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
16682 thought unnecessary.
16683 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
16684
16685 2008-04-11 Ian Lance Taylor <iant@google.com>
16686
16687 * output.h (class Output_section_data): Remove inline definition
16688 of set_addralign.
16689 * output.cc (Output_section_data::set_addralign): New function.
16690
16691 2008-04-11 Cary Coutant <ccoutant@google.com>
16692
16693 Add support for TLS descriptors for i386 and x86_64.
16694 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
16695 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
16696 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
16697 GOT_TYPE_TLS_DESC.
16698 (Target_i386::got_mod_index_entry): Remove unnecessary code.
16699 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
16700 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
16701 relocations.
16702 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
16703 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
16704 Fix problem with initial-exec relocations.
16705 (Target_i386::Relocate::relocate_tls): Likewise.
16706 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
16707 relaxation.
16708 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
16709 support for section-plus-offset dynamic table entries.
16710 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
16711 (Output_data_dynamic::Dynamic_entry): Add support for
16712 section-plus-offset dynamic table entries.
16713 (Output_data_dynamic::Classification): Likewise.
16714 (Output_data_dynamic::classification_): Renamed offset_.
16715 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
16716 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
16717 (Target_x86_64::make_plt_section): New function.
16718 (Target_x86_64::reserve_tlsdesc_entries): New function.
16719 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
16720 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
16721 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
16722 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
16723 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
16724 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
16725 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
16726 add extra PLT entry for TLS descriptors.
16727 (Output_data_plt_x86_64::got_): New field.
16728 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
16729 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
16730 fields.
16731 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
16732 descriptors.
16733 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
16734 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
16735 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
16736 R_386_TLS_DESC_CALL relocations.
16737 (Target_x86_64::Scan::global): Likewise.
16738 (Target_x86_64::do_finalize_sections): Add dynamic table entries
16739 for TLS descriptors.
16740 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
16741 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
16742 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
16743 GD-to-IE relaxation.
16744 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
16745 and TLS_DESCRIPTORS.
16746 * Makefile.in: Rebuild.
16747 * configure: Rebuild.
16748 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
16749 (tls_test_shared2.so): New target.
16750 (tls_shared_gd_to_ie_test_SOURCES): New variable.
16751 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
16752 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
16753 (tls_shared_gd_to_ie_test_LDADD): New variable.
16754 (tls_shared_gnu2_gd_to_ie_test): New target.
16755 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
16756 New targets.
16757 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
16758 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
16759 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
16760 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
16761 (tls_shared_gnu2_test): New target.
16762 (tls_test_gnu2_shared.so): New target.
16763 (tls_shared_gnu2_test_SOURCES): New variable.
16764 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
16765 (tls_shared_gnu2_test_LDFLAGS): New variable.
16766 (tls_shared_gnu2_test_LDADD): New variable.
16767 * testsuite/Makefile.in: Rebuild.
16768 * testsuite/Makefile.
16769
16770 2008-04-11 Ian Lance Taylor <iant@google.com>
16771
16772 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
16773 justsyms.t.
16774 * testsuite/Makefile.in: Rebuild.
16775
16776 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
16777 long.
16778 * testsuite/script_test_2.cc (main): Adjust test.
16779
16780 2008-04-11 David S. Miller <davem@davemloft.net>
16781 Ian Lance Taylor <iant@google.com>
16782
16783 * options.h (General_options): Add entries for '-Y' and
16784 '-relax'.
16785 * options.cc (General_options:finalize): If -Y was used, add those
16786 entries to the library path instead of the default "/lib" and
16787 "/usr/lib".
16788
16789 2008-04-11 David S. Miller <davem@davemloft.net>
16790
16791 * testsuite/justsyms.t: Start at 0x100.
16792 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
16793 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
16794 long.
16795 * testsuite/script_test_2.cc: Adjust string and section length
16796 checks.
16797
16798 2008-04-09 Ian Lance Taylor <iant@google.com>
16799
16800 PR gold/5996
16801 * script-sections.cc (Sections_element::allocate_to_segment): Add
16802 orphan parameter.
16803 (Output_section_definition::allocate_to_segment): Likewise.
16804 (Orphan_output_section::allocate_to_segment): Likewise.
16805 (Script_sections::attach_sections_using_phdrs_clause): Don't
16806 propagate non-PT_LOAD segments to orphan sections.
16807 * testsuite/Makefile.am (script_test_3.stdout): Generate using
16808 readelf rather than objdump.
16809 * testsuite/script_test_3.sh: Adjust accordingly. Test that
16810 .interp section and PT_INTERP segment are the same size.
16811 * testsuite/Makefile.in: Rebuild.
16812
16813 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
16814 aliases for symbols defined in the same object.
16815 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
16816 (weak_alias_test_SOURCES): New variable.
16817 (weak_alias_test_DEPENDENCIES): New variable.
16818 (weak_alias_test_LDFLAGS): New variable.
16819 (weak_alias_test_LDADD): New variable.
16820 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
16821 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
16822 (weak_alias_test_3.o): New target.
16823 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
16824 * testsuite/weak_alias_test_main.cc: New file.
16825 * testsuite/weak_alias_test_1.cc: New file.
16826 * testsuite/weak_alias_test_2.cc: New file.
16827 * testsuite/weak_alias_test_3.cc: New file.
16828
16829 2008-04-08 Ian Lance Taylor <iant@google.com>
16830
16831 * options.h (class General_options): Add --noinhibit-exec option.
16832 * main.cc (main): Check --noinhibit-exec.
16833
16834 * options.h (class General_options): Define --wrap as a special
16835 option. Add wrap_symbols_ field.
16836 (General_options::any_wrap_symbols): New function.
16837 (General_options::is_wrap_symbol): New function.
16838 * options.cc (General_options::parse_wrap): New function.
16839 (General_options::General_options): Initialize wrap_symbols_.
16840 * symtab.cc (Symbol_table::wrap_symbol): New function.
16841 (Symbol_table::add_from_object): Handle --wrap.
16842 * symtab.h (class Symbol_table): Declare wrap_symbol.
16843 * target.h (Target::wrap_char): New function.
16844 (Target::Target_info): Add wrap_char field.
16845 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
16846 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
16847 * testsuite/testfile.cc (Target_test::test_target_info):
16848 Likewise.
16849
16850 * errors.cc (Errors::undefined_symbol): Mention symbol version if
16851 there is one.
16852
16853 * layout.h (class Layout): Add added_eh_frame_data_ field.
16854 * layout.cc (Layout::Layout): Initialize new field.
16855 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
16856 output section until we find a section we merged successfully.
16857 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
16858 that the size be non-zero.
16859
16860 * merge.cc (Object_merge_map::get_output_offset): Remove inline
16861 qualifier.
16862
16863 2008-04-08 Craig Silverstein <csilvers@google.com>
16864
16865 * configure.ac: Export new conditional variable HAVE_ZLIB.
16866 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
16867 on HAVE_ZLIB.
16868 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
16869 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16870
16871 2008-04-07 Ian Lance Taylor <iant@google.com>
16872
16873 * version.cc (version_string): Set to "1.5".
16874
16875 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
16876 Add issued_non_pic_error_ field. Declare check_non_pic.
16877 (Target_x86_64::Scan::check_non_pic): New function.
16878 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
16879 (Target_x86_64::Scan::global): Likewise.
16880
16881 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
16882 addend parameter. Change caller. Handle merge sections.
16883 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
16884 Address to Addend. Don't add in the result of
16885 local_section_offset, pass down the addend and use the returned
16886 value.
16887 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
16888 Update declarations of local_section_offset and symbol_value.
16889 * testsuite/two_file_test_1.cc (t18): New function.
16890 * testsuite/two_file_test_2.cc (f18): New function.
16891 * testsuite/two_file_test_main.cc (main): Call t18.
16892 * testsuite/two_file_test.h (t18, f18): Declare.
16893
16894 * configure.ac: Don't test for objdump, c++filt, or readelf.
16895 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
16896 conditionals.
16897 (TEST_READELF): New variable.
16898 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
16899 (check_PROGRAMS): Add two_file_strip_test.
16900 (two_file_strip_test): New target.
16901 (check_PROGRAMS): Add two_file_same_shared_strip_test.
16902 (two_file_same_shared_strip_test_SOURCES): New variable.
16903 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
16904 (two_file_same_shared_strip_test_LDFLAGS): New variable.
16905 (two_file_same_shared_strip_test_LDADD): New variable.
16906 (two_file_shared_strip.so): New target.
16907 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
16908 (ver_test_5.syms, ver_test_7.syms): Likewise.
16909 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
16910 (strip_test_3.stdout): Use TEST_OBJDUMP.
16911 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16912
16913 2008-04-04 Cary Coutant <ccoutant@google.com>
16914
16915 * symtab.h (Symbol::is_weak_undefined): New function.
16916 (Symbol::is_strong_undefined): New function.
16917 (Symbol::is_absolute): New function.
16918 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
16919 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
16920 absolute symbols.
16921 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
16922 (weak_undef_test): New target.
16923 * testsuite/Makefile.in: Rebuild.
16924 * testsuite/weak_undef_file1.cc: New file.
16925 * testsuite/weak_undef_file2.cc: New file.
16926 * testsuite/weak_undef_test.cc: New file.
16927
16928 2008-04-03 Craig Silverstein <csilvers@google.com>
16929
16930 * compressed_output.h (class Output_compressed_section): Use
16931 unsigned buffer.
16932 * compressed_output.cc (zlib_compress): Use unsigned buffers,
16933 add zlib header.
16934 (zlib_compressed_suffix): Removed.
16935 (Output_compressed_section::set_final_data_size): Use unsigned
16936 buffers.
16937 * testsuite/Makefile.am (flagstest_compress_debug_sections):
16938 Fix linker invocation.
16939 (flagstest_o_specialfile_and_compress_debug_sections):
16940 Likewise.
16941 * testsuite/Makefile.in: Regenerated.
16942
16943 2008-04-02 David S. Miller <davem@davemloft.net>
16944
16945 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
16946 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
16947
16948 2008-04-02 Craig Silverstein <csilvers@google.com>
16949
16950 * TODO: New file.
16951
16952 2008-04-02 Ian Lance Taylor <iant@google.com>
16953
16954 * fileread.cc (File_read::find_view): Add byteshift and vshifted
16955 parameters. Update for new key type to views_. Change all
16956 callers.
16957 (File_read::read): Adjust for byteshift in returned view.
16958 (File_read::add_view): New function, broken out of
16959 find_and_make_view.
16960 (File_read::make_view): New function, broken out of
16961 find_and_make_view.
16962 (File_read::find_or_make_view): Add offset and aligned
16963 parameters. Rewrite accordingly. Change all callers.
16964 (File_read::get_view): Add offset and aligned parameters. Adjust
16965 for byteshift in return value.
16966 (File_read::get_lasting_view): Likewise.
16967 * fileread.h (class File_read): Update declarations.
16968 (class File_read::View): Add byteshift_ field. Add byteshift to
16969 constructor. Add byteshift method.
16970 * archive.h (Archive::clear_uncached_views): New function.
16971 (Archive::get_view): Add aligned parameter. Change all callers.
16972 * object.h (Object::get_view): Add aligned parameter. Change all
16973 callers.
16974 (Object::get_lasting_view): Likewise.
16975
16976 * fileread.cc (File_read::release): Don't call clear_views if
16977 there are multiple objects.
16978 * fileread.h (File_read::clear_uncached_views): New function.
16979 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
16980 on the archive.
16981
16982 2008-03-31 Cary Coutant <ccoutant@google.com>
16983
16984 Add thin archive support.
16985 * archive.cc (Archive::armagt): New const.
16986 (Archive::setup): Remove task parameter and calls to unlock.
16987 (Archive::unlock_nested_archives): New function.
16988 (Archive::read_header): Add nested_off parameter. Change
16989 all callers.
16990 (Archive::interpret_header): Likewise.
16991 (Archive::include_all_members): Change to handle thin
16992 archives.
16993 (Archive::include_member): Likewise.
16994 * archive.h (Archive::Archive): Add new parameters and
16995 initializers.
16996 (Archive::armagt): New const.
16997 (Archive::setup): Remove task parameter.
16998 (Archive::unlock_nested_archives): New function.
16999 (Archive::read_header): Add nested_off parameter.
17000 (Archive::interpret_header): Likewise.
17001 (Archive::Nested_archive_table): New typedef.
17002 (Archive::is_thin_archive_): New field.
17003 (Archive::nested_archives_): New field.
17004 (Archive::options_): New field.
17005 (Archive::dirpath_): New field.
17006 (Archive::task_): New field.
17007 * readsyms.cc (Read_symbols::do_read_symbols): Add check
17008 for thin archives. Pass additional parameters to
17009 Archive::Archive. Unlock the archive file after calling
17010 Archive::setup.
17011
17012 2008-03-29 Ian Lance Taylor <iant@google.com>
17013
17014 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
17015 version symbol to be local.
17016 * testsuite/ver_test_4.sh: New file.
17017 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
17018 (check_DATA): Add ver_test_4.syms.
17019 (ver_test_4.syms): New target.
17020 * testsuite/Makefile.in: Rebuild.
17021
17022 * output.cc
17023 (Output_section::Input_section_sort_entry::has_priority): New
17024 function.
17025 (Output_section::Input_section_sort_entry::match_file_name): New
17026 function.
17027 (Output_section::Input_section_sort_entry::match_section_name):
17028 Remove.
17029 (Output_section::Input_section_sort_entry::match_section_name_prefix):
17030 Remove.
17031 (Output_section::Input_section_sort_entry::match_section_file):
17032 Remove.
17033 (Output_section::Input_section_sort_compare::operator()): Rewrite
17034 using new Input_section_sort_entry functions. Sort crtbegin and
17035 crtend first. Sort sections with no priority before sections with
17036 a priority.
17037 * testsuite/initpri1.c (d3): Check j != 4.
17038 (cd5): New constructor/destructor function.
17039 (main): Check j != 2.
17040
17041 * symtab.cc (Symbol_table::add_from_object): If we don't use the
17042 new symbol when resolving, don't call set_is_default.
17043 * testsuite/ver_test_7.cc: New file.
17044 * testsuite/ver_test_7.sh: New file.
17045 * testsuite/Makefile.am (ver_test_7.so): New target.
17046 (ver_test_7.o): New target.
17047 (check_SCRIPTS): Add ver_test_7.sh.
17048 (check_DATA): Add ver_test_7.syms.
17049 (ver_test_7.syms): New target.
17050
17051 2008-03-28 Ian Lance Taylor <iant@google.com>
17052
17053 * layout.cc (Layout::layout): If we see an input section with a
17054 name that needs sorting, set the must_sort flag for the output
17055 section.
17056 (Layout::make_output_section): If the name of the output section
17057 indicates that it might require sorting, set the may_sort flag.
17058 * output.h (Output_section::may_sort_attached_input_sections): New
17059 function.
17060 (Output_section::set_may_sort_attached_input_sections): New
17061 function.
17062 (Output_section::must_sort_attached_input_sections): New
17063 function.
17064 (Output_section::set_must_sort_attached_input_sections): New
17065 function.
17066 (class Output_section): Declare Input_section_sort_entry. Define
17067 Input_section_sort_compare. Declare
17068 sort_attached_input_sections. Add new fields:
17069 may_sort_attached_input_sections_,
17070 must_sort_attached_input_sections_,
17071 attached_input_sections_are_sorted_.
17072 * output.cc (Output_section::Output_section): Initialize new
17073 fields.
17074 (Output_section::add_input_section): Add an entry to
17075 input_sections_ if may_sort or must_sort are true.
17076 (Output_section::set_final_data_size): Call
17077 sort_attached_input_sections if necessary.
17078 (Output_section::Input_section_sort_entry): Define new class.
17079 (Output_section::Input_section_sort_compare::operator()): New
17080 function.
17081 (Output_section::sort_attached_input_sections): New function.
17082 * configure.ac: Check whether the compiler supports constructor
17083 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
17084 * testsuite/initpri1.c: New file.
17085 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
17086 CONSTRUCTOR_PRIORITY.
17087 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
17088 (initpri1_LDFLAGS): New variable.
17089 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17090
17091 2008-03-27 Ian Lance Taylor <iant@google.com>
17092
17093 * common.cc (Sort_commons::operator): Correct sorting algorithm.
17094 * testsuite/common_test_1.c: New file.
17095 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
17096 (common_test_1_SOURCES): New variable.
17097 (common_test_1_DEPENDENCIES): New variable.
17098 (common_test_1_LDFLAGS): New variable.
17099
17100 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
17101 and commons_ correctly when NAME/VERSION does not override
17102 NAME/NULL.
17103 * testsuite/ver_test_6.c: New file.
17104 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
17105 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
17106 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
17107
17108 2008-03-26 Ian Lance Taylor <iant@google.com>
17109
17110 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
17111 of an undefined symbol from a version script.
17112 * testsuite/Makefile.am (ver_test_5.so): New target.
17113 (ver_test_5.o): New target.
17114 (check_SCRIPTS): Add ver_test_5.sh.
17115 (check_DATA): Add ver_test_5.syms.
17116 (ver_test_5.syms): New target.
17117 * testsuite/ver_test_5.cc: New file.
17118 * testsuite/ver_test_5.script: New file.
17119 * testsuite/ver_test_5.sh: New file.
17120 * Makefile.in, testsuite/Makefile.in: Rebuild.
17121
17122 PR gold/5986
17123 Fix problems building gold with gcc 4.3.0.
17124 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
17125 (gold_error_at_location, gold_warning_at_location): Use it.
17126 * configure.ac: Check whether we can compile and use a template
17127 function with a printf attribute.
17128 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
17129 when jumping over bytes.
17130 * object.cc: Instantiate Object::read_section_data.
17131 * debug.h: Include <cstring>
17132 * dwarf_reader.cc: Include <algorithm>
17133 * main.cc: Include <cstring>.
17134 * options.cc: Include <cstring>.
17135 * output.cc: Include <cstring>.
17136 * script.cc: Include <cstring>.
17137 * script.h: Include <string>.
17138 * symtab.cc: Include <cstring> and <algorithm>.
17139 * target-select.cc: Include <cstring>.
17140 * version.cc: Include <string>.
17141 * testsuite/testmain.cc: Include <cstdlib>.
17142 * configure, config.in: Rebuild.
17143
17144 2008-03-25 Ian Lance Taylor <iant@google.com>
17145
17146 * options.cc: Include "../bfd/bfdver.h".
17147 (options::help): Print bug reporting address.
17148
17149 * version.cc (print_version): Adjust output for current value of
17150 BFD_VERSION_STRING.
17151
17152 * NEWS: New file.
17153
17154 * options.cc (options::help): Print list of supported targets.
17155 * target-select.h: Include <vector>.
17156 (class Target_selector): Make machine_, size_, and is_big_endian_
17157 fields const. Add bfd_name_ and instantiated_target_ fields.
17158 (Target_selector::Target_selector): Add bfd_name parameter.
17159 (Target_selector::recognize): Make non-virtual, call
17160 do_recognize.
17161 (Target_selector::recognize_by_name): Make non-virtual, call
17162 do_recognize_by_name.
17163 (Target_selector::supported_names): New function.
17164 (Target_selector::bfd_name): New function.
17165 (Target_selector::do_instantiate_target): New pure virtual
17166 function.
17167 (Target_selector::do_recognize): New virtual function.
17168 (Target_selector::do_recognize_by_name): New virtual function.
17169 (Target_selector::instantiate_target): New private function.
17170 (supported_target_names): Declare.
17171 * target-select.cc (Target_selector::Target_selector): Update for
17172 new parameter and fields.
17173 (select_target_by_name): Check that the name matches before
17174 calling recognize_by_name.
17175 (supported_target_names): New function.
17176 * i386.cc (class Target_selector_i386): Update Target_selector
17177 constructor call. Remove recognize and recognize_by_name. Add
17178 do_instantiate_target.
17179 * x86_64.cc (class Target_selector_x86_64): Likewise.
17180 * testsuite/testfile.cc (class Target_selector_test): Update for
17181 changes to Target_selector.
17182
17183 * README: Rewrite, with some notes on unsupported features.
17184
17185 2008-03-24 Cary Coutant <ccoutant@google.com>
17186
17187 * i386.cc (Target_i386::Got_type): New enum declaration.
17188 (Target_i386::Scan::local): Updated callers of Output_data_got
17189 member functions.
17190 (Target_i386::Scan::global): Likewise.
17191 (Target_i386::Relocate::relocate): Likewise.
17192 (Target_i386::Relocate::relocate_tls): Likewise.
17193 * object.h (Got_offset_list): New class.
17194 (Sized_relobj::local_has_got_offset): Added got_type parameter.
17195 (Sized_relobj::local_got_offset): Likewise.
17196 (Sized_relobj::set_local_got_offset): Likewise.
17197 (Sized_relobj::local_has_tls_got_offset): Removed.
17198 (Sized_relobj::local_tls_got_offset): Removed.
17199 (Sized_relobj::set_local_tls_got_offset): Removed.
17200 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
17201 * output.cc (Output_data_got::add_global): Added got_type parameter.
17202 (Output_data_got::add_global_with_rel): Likewise.
17203 (Output_data_got::add_global_with_rela): Likewise.
17204 (Output_data_got::add_global_pair_with_rel): New function.
17205 (Output_data_got::add_global_pair_with_rela): New function.
17206 (Output_data_got::add_local): Added got_type parameter.
17207 (Output_data_got::add_local_with_rel): Likewise.
17208 (Output_data_got::add_local_with_rela): Likewise.
17209 (Output_data_got::add_local_pair_with_rel): New function.
17210 (Output_data_got::add_local_pair_with_rela): New function.
17211 (Output_data_got::add_global_tls): Removed.
17212 (Output_data_got::add_global_tls_with_rel): Removed.
17213 (Output_data_got::add_global_tls_with_rela): Removed.
17214 (Output_data_got::add_local_tls): Removed.
17215 (Output_data_got::add_local_tls_with_rel): Removed.
17216 (Output_data_got::add_local_tls_with_rela): Removed.
17217 * output.h (Output_data_got::add_global): Added got_type parameter.
17218 (Output_data_got::add_global_with_rel): Likewise.
17219 (Output_data_got::add_global_with_rela): Likewise.
17220 (Output_data_got::add_global_pair_with_rel): New function.
17221 (Output_data_got::add_global_pair_with_rela): New function.
17222 (Output_data_got::add_local): Added got_type parameter.
17223 (Output_data_got::add_local_with_rel): Likewise.
17224 (Output_data_got::add_local_with_rela): Likewise.
17225 (Output_data_got::add_local_pair_with_rel): New function.
17226 (Output_data_got::add_local_pair_with_rela): New function.
17227 (Output_data_got::add_global_tls): Removed.
17228 (Output_data_got::add_global_tls_with_rel): Removed.
17229 (Output_data_got::add_global_tls_with_rela): Removed.
17230 (Output_data_got::add_local_tls): Removed.
17231 (Output_data_got::add_local_tls_with_rel): Removed.
17232 (Output_data_got::add_local_tls_with_rela): Removed.
17233 * resolve.cc (Symbol::override_base_with_special): Removed
17234 reference to has_got_offset_ field.
17235 * symtab.cc (Symbol::init_fields): Replaced initialization
17236 of got_offset_ with got_offsets_. Removed initialization
17237 of has_got_offset_
17238 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
17239 (Symbol::got_offset): Likewise.
17240 (Symbol::set_got_offset): Likewise.
17241 (Symbol::has_tls_got_offset): Removed.
17242 (Symbol::tls_got_offset): Removed.
17243 (Symbol::set_tls_got_offset): Removed.
17244 (Symbol::got_offset_): Removed.
17245 (Symbol::tls_mod_got_offset_): Removed.
17246 (Symbol::tls_pair_got_offset_): Removed.
17247 (Symbol::got_offsets_): New field.
17248 (Symbol::has_got_offset): Removed.
17249 (Symbol::has_tls_mod_got_offset): Removed.
17250 (Symbol::has_tls_pair_got_offset): Removed.
17251 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
17252 (Target_x86_64::Scan::local): Updated callers of Output_data_got
17253 member functions.
17254 (Target_x86_64::Scan::global): Likewise.
17255 (Target_x86_64::Relocate::relocate): Likewise.
17256 (Target_x86_64::Relocate::relocate_tls): Likewise.
17257
17258 2008-03-25 Ben Elliston <bje@au.ibm.com>
17259
17260 * yyscript.y: Fix spelling error in comment.
17261
17262 2008-03-24 Ian Lance Taylor <iant@google.com>
17263
17264 * options.h (class General_options): Define build_id option.
17265 * layout.h (class Layout): Declare write_build_id, create_note,
17266 create_build_id. Add build_id_note_ member.
17267 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
17268 "libiberty.h", "md5.h", "sha1.h".
17269 (Layout::Layout): Initialize eh_frame_data_,
17270 eh_frame_hdr_section_, and build_id_note_.
17271 (Layout::finalize): Call create_build_id.
17272 (Layout::create_note): New function, broken out of
17273 Layout::create_gold_note.
17274 (Layout::create_gold_note): Call create_note.
17275 (Layout::create_build_id): New function.
17276 (Layout::write_build_id): New function.
17277 (Close_task_runner::run): Call write_build_id.
17278
17279 * x86_64.cc: Correct license to GPLv3.
17280
17281 2008-03-23 Ian Lance Taylor <iant@google.com>
17282
17283 * options.cc: Include "demangle.h".
17284 (parse_optional_string): New function.
17285 (parse_long_option): Handle takes_optional_argument.
17286 (parse_short_option): Update dash_z initializer. Handle
17287 takes_optional_argument.
17288 (General_options::General_options): Initialize do_demangle_.
17289 (General_options::finalize): Set do_demangle_. Handle demangling
17290 style.
17291 * options.h (parse_optional_string): Declare.
17292 (struct One_option): Add optional_arg field. Update constructor.
17293 Update call constructor calls. Add takes_optional_argument
17294 function.
17295 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
17296 (DEFINE_optional_string): Define.
17297 (General_options::demangle): Change from DEFINE_bool to
17298 DEFINE_optional_string.
17299 (General_options::no_demangle): New function.
17300 (General_options::do_demangle): New function.
17301 (General_options::set_do_demangle): New function.
17302 (General_options::execstack_status_): Move definition to end of
17303 class definition.
17304 (General_options::static_): Likewise.
17305 (General_options::do_demangle_): New field.
17306 * object.cc (big_endian>::get_symbol_location_info): Call
17307 Options::do_demangle, not Options::demangle.
17308 * symtab.cc (demangle): Likewise.
17309
17310 2008-03-22 Ian Lance Taylor <iant@google.com>
17311
17312 * gold.h: Include <cstddef> and <sys/types.h>
17313 * options.h: Include <cstring>.
17314
17315 2008-03-21 Ian Lance Taylor <iant@google.com>
17316
17317 * Added source code to GNU binutils.
17318 \f
17319 Copyright (C) 2008-2015 Free Software Foundation, Inc.
17320
17321 Copying and distribution of this file, with or without modification,
17322 are permitted in any medium without royalty provided the copyright
17323 notice and this notice are preserved.
17324
17325 Local Variables:
17326 mode: change-log
17327 left-margin: 8
17328 fill-column: 74
17329 version-control: never
17330 End: