Fix =thread-exited not showing up when detaching (PR 15564)
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
9c7fe3c5
CC
12015-06-03 Cary Coutant <ccoutant@gmail.com>
2
3 PR gold/17819
4 * gold.cc (queue_final_tasks): When --build-id=tree, queue a
5 separate task to schedule the build id computation.
6 * layout.cc (Hash_task::Hash_task): Remove build_id_blocker,
7 add Output_file and offset.
8 (Hash_task::run): Get and release the input views.
9 (Hash_task::is_runnable): Always return NULL (always runnable).
10 (Layout::queue_build_id_tasks): Remove.
11 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
12 parameters; use them instead of class members.
13 (Build_id_task_runner::run): New function.
14 (Close_task_runner::run): Pass array_of_hashes and size_of_hashes
15 to write_build_id.
16 * layout.h (Layout::queue_build_id_tasks): Remove.
17 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
18 parameters.
19 (Layout::array_of_hashes_): Remove.
20 (Layout::size_of_array_of_hashes_): Remove.
21 (Layout::input_view_): Remove.
22 (Build_id_task_runner): New class.
23 (Close_task_runner::Close_task_runner): Add array_of_hashes and
24 size_of_hashes parameters.
25 (Close_task_runner::array_of_hashes_): New data member.
26 (Close_task_runner::size_of_hashes_): New data member.
27 * testsuite/Makefile.am
28 (flagstest_compress_debug_sections_and_build_id_tree): New test.
29 * testsuite/Makefile.in: Regenerate.
30
400f8944
RÁE
312015-06-01 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
32
33 * merge.cc (get_input_merge_map): Update for data structure change.
34 (get_or_make_input_merge_map): Update for data structure change.
35 * merge.h (Object_merge_map): Use a std::vector<std::pair>> instead of
36 a std::map. Remove first_shnum_, first_map_, second_shnum_, second_map_.
37
bbec1a5d
AM
382015-05-16 Alan Modra <amodra@gmail.com>
39
40 * reloc.cc (Sized_relobj_file::find_functions): Use function_location.
41 * powerpc.cc (Target_powerpc::do_calls_non_split): New function.
42 (addi_12_1, addis_2_12, addis_12_1, cmpld_7_12_0): New constants.
43 (lis_0): Rename from lis_0_0.
44
efc6fa12
CC
452015-04-29 Cary Coutant <cary@google.com>
46 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
47
48 * gc.h (Garbage_collection::is_section_garbage): Change Object*
49 to Relobj*.
50 (Garbage_collection::add_reference): Likewise.
51 (Garbage_collection::gc_process_relocs): Likewise. Don't push
52 object/shndx pair onto *secvec for dynamic objects. Don't follow
53 relocations pointing to dynamic objects for GC.
54 * icf.cc (Icf::find_identical_sections): Change Object* to Relobj*.
55 (Icf::unfold_section): Likewise.
56 (Icf::is_section_folded): Likewise.
57 (Icf::get_folded_section): Likewise.
58 * icf.h: (Icf::get_folded_section): Likewise.
59 (Icf::unfold_section): Likewise.
60 (Icf::is_section_folded): Likewise.
61 (Icf::section_has_function_pointers): Likewise.
62 (Icf::set_section_has_function_pointers): Likewise.
63 * object.h (Section_id): Likewise.
64 (Const_section_id): Likewise.
65 * output.cc (Output_section::update_section_layout): Likewise.
66 * output.h: (Output_section_lookup_maps::find_relaxed_input_section):
67 Likewise.
68 * plugin.cc (update_section_order): Likewise.
69 (unique_segment_for_sections): Likewise.
70 * powerpc.cc (Powerpc_relobj::add_reference): Likewise.
71 (Target_powerpc::do_gc_add_reference): Likewise.
72 (Target_powerpc::gc_process_relocs): Likewise.
73 (Target_powerpc::do_gc_add_reference): Likewise.
74 * symtab.cc (Symbol_table::is_section_folded): Likewise.
75 (Symbol_table::gc_mark_symbol): Likewise.
76 * symtab.h: (Symbol_table::is_section_folded): Likewise.
77 * target.h: (Sized_target::gc_add_reference): Likewise.
78 (Sized_target::do_gc_add_reference): Likewise.
79
f9d3ecaa
NC
802015-04-29 Nick Clifton <nickc@redhat.com>
81
82 * po/fi.po: Updated Finnish translation.
83
faa2211d
AM
842015-04-28 Alan Modra <amodra@gmail.com>
85
86 * powerpc.cc (Target_powerpc::do_dynsym_value): Use Address rather
87 than unsigned int for find_global_entry result temp. Compare
88 against invalid_address.
89 (Target_powerpc::do_plt_address_for_global): Likewise.
90 (Target_powerpc::Relocate::relocate): Likewise. Don't assert
91 on plt call stub existence for debug info. Do assert for plt
92 and global entry stub existence if an alloc section.
93
6ec65f28
AM
942015-04-28 Alan Modra <amodra@gmail.com>
95
96 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
97 on missing global entry stub due to bogus debug info.
98
7a2a1c79
HS
992015-04-27 Han Shen <shenhan@google.com>
100
101 * options.h (--fix-cortex-a53-843419): Rename option.
102 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
103 option.
104 (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
105
cfbf0e3c
RÁE
1062015-04-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
107
108 PR gold/18327
109 * output.cc (Output_section::is_input_address_mapped): Assume a missing
110 entry is mapped.
111 * testsuite/Makefile.am: Add the eh_test test.
112 * testsuite/Makefile.in: Regenerate.
113 * testsuite/eh_test_a.cc: New test.
114 * testsuite/eh_test_b.cc: New test.
115
6ec65f28
AM
1162015-04-23 Sriraman Tallam <tmsriram@google.com>
117
a100d66f
ST
118 * options.h (--weak-unresolved-symbols): New option.
119 * symtab.cc (Symbol_table::sized_write_globals): Change symbol
120 binding to weak with new option.
121 * symtab.h (is_weak_undefined): Check for new option.
122 (is_strong_undefined): Check for new option.
123 * testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
124 * testsuite/Makefile.in: Regenerate.
125 * testsuite/weak_unresolved_symbols_test.cc: New file.
126
4b889c30
IC
1272015-04-20 Ian Coolidge <icoolidge@google.com>
128
129 * symtab.cc (Symbol::should_add_dynsym_entry): Return true for
130 GNU_UNIQUE.
131
4277535c
RÁE
1322015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
133
134 * gc.cc (Garbage_collection::do_transitive_closure): Use back and
135 push_back.
136 * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
137 * object.cc (Sized_relobj_file::do_layout): Use push_back.
138 * powerpc.cc (process_gc_mark): Use push_back.
139 (Target_powerpc::do_gc_mark_symbol): Use push_back.
140 * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
141
7a2a1c79 1422015-04-16 Han Shen <shenhan@google.com>
5019d64a 143
6ec65f28
AM
144 * aarch64.cc (AArch64_insn_utilities): New utility class.
145 (AArch64_relobj::Mapping_symbol_position): New struct.
146 (AArch64_relobj::Mapping_symbol_info): New typedef.
147 (AArch64_relobj::do_count_local_symbols): New function overriding
148 parent's implementation.
149 (AArch64_relobj::mapping_symbol_info_): New member
150 (AArch64_relobj::scan_erratum_843419): New method.
151 (Target_aarch64::scan_erratum_843419_span): New method.
152 (Target_aarch64::is_erratum_843419_sequence): New method.
153 * options.h (fix_cortex_a53): New option.
5019d64a 154
a6a17750
CC
1552015-04-09 Cary Coutant <ccoutant@google.com>
156
157 * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
158 in a PIE link.
159 * testsuite/Makefile.am (tls_pie_test.sh): New test.
160 * testsuite/Makefile.in: Regenerate.
161 * testsuite/tls_pie_test.sh: New.
162
437ddf0c
CC
1632015-04-09 Cary Coutant <ccoutant@google.com>
164
165 * debug.h (DEBUG_LOCATION): New.
166 (DEBUG_ALL): Include DEBUG_LOCATION.
167 (debug_string_to_enum): Add DEBUG_LOCATION.
168 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
169 output to print correct context.
170 (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
171 up to 4 more locations at the beginning of the function.
172 * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
173 result before sorting list of line numbers.
174 * testsuite/debug_msg.sh: Allow range of line numbers for
175 canonical results on optimized code.
176
24491327
HS
1772015-04-07 HC Yen <hc.yen@mediatek.com>
178
179 Add AArch32 support for gold linker.
180 gold/
181 * arm.cc: Add V8 arch combine table.
182
7fa5525f
RÁE
1832015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
184
185 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
186
5368dcf2
RÁE
1872015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
188
189 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
190 to find by using the return value of insert.
191
9dbb4b02
RÁE
1922015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
193
194 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
195 constructor call.
196
1fa29f10
IT
1972015-04-06 Ilya Tocar <ilya.tocar@intel.com>
198
199 PR gold/17641
200 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
201 (Target_x86_64::Scan::local): Don't create GOT entry, when we
202 can convert mov to lea.
203 (Target_x86_64::Scan::global): Ditto.
204 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
205 %reg to lea foo(%rip), %reg if possible.
206 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
207 * testsuite/x86_64_mov_to_lea1.s: New.
208 * testsuite/x86_64_mov_to_lea2.s: Ditto.
209 * testsuite/x86_64_mov_to_lea3.s: Ditto.
210 * testsuite/x86_64_mov_to_lea4.s: Ditto.
211 * testsuite/x86_64_mov_to_lea.sh: Ditto.
212
39f3de7c
L
2132015-04-02 H.J. Lu <hongjiu.lu@intel.com>
214
215 * configure: Regenerated.
216
c4fc4724
IT
2172015-04-01 Ilya Tocar <ilya.tocar@intel.com>
218
219 PR gold/17640
220 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
221 (Target_i386::Scan::local): Don't create GOT entry, when we
222 can convert GOT to GOTOFF.
223 (Target_i386::Scan::global): Ditto.
224 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
225 lea foo@GOTOFF(%reg), %reg if possible.
226 * testsuite/Makefile.am (i386_mov_to_lea): New test.
227 * testsuite/i386_mov_to_lea1.s: New.
228 * testsuite/i386_mov_to_lea2.s: Ditto.
229 * testsuite/i386_mov_to_lea3.s: Ditto.
230 * testsuite/i386_mov_to_lea4.s: Ditto.
231 * testsuite/i386_mov_to_lea5.s: Ditto.
232 * testsuite/i386_mov_to_lea.sh: Ditto.
233
918357b9
L
2342015-04-01 H.J. Lu <hongjiu.lu@intel.com>
235
236 * Makefile.am (ZLIB): New.
237 (ZLIBINC): Likewise.
238 (AM_CFLAGS): Add $(ZLIBINC).
239 (AM_CXXFLAGS): Likewise.
240 (ldadd_varldadd_var): Add $(ZLIB).
241 (incremental_dump_LDADD): Likewise.
242 (dwp_LDADD): Likewise.
243 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
244 <zlib.h>.
245 (zlib_compress): Don't check HAVE_ZLIB_H.
246 (zlib_decompress): Likewise.
247 * options.h (compress_debug_sections): Likewise.
248 * configure.ac (AM_CONDITIONAL): Removed.
249 * testsuite/Makefile.am (ZLIB): New.
250 (LDADD): Add $(ZLIB).
251 Don't check HAVE_ZLIB.
252 * Makefile.in: Regenerated.
253 * config.in: Likewise.
254 * configure: Likewise.
255 * testsuite/Makefile.in: Likewise.
256
6b0ad2eb
JY
2572015-03-30 Jing Yu <jingyu@google.com>
258
259 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
260 TLSLD_ADD_DTPREL_LO12_NC.
261 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
262 _TLS_MODULE_BASE_ point to the start of tls segment.
263 (Target_aarch64::optimize_tls_reloc): Add cases for
264 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
265 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
266 (Target_aarch64::Scan::local): Likewise.
267 (Target_aarch64::Scan::global): Likewise.
268 (Target_aarch64::Relocate::relocate): Likewise.
269 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
270 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
271 relocations.
272
0916f9e7
RÁE
2732015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
274
275 * merge.cc (Object_merge_map::add_mapping): call
276 Object_merge_map::Input_merge_map::add_mapping.
277 (Object_merge_map::Input_merge_map::add_mapping): New.
278 (Output_merge_data::do_add_input_section): Call
279 get_or_make_input_merge_map before a loop.
280 (Output_merge_string<Char_type>::finalize_merged_data): Call
281 get_or_make_input_merge_map before a loop.
282 * merge.h (Object_merge_map): Make Input_merge_map public.
283 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
284 (Relobj::get_or_create_merge_map): New.
285 * object.h (Relobj::get_or_create_merge_map): New.
286
282c9750
AM
2872015-03-24 Alan Modra <amodra@gmail.com>
288
289 PR 18147
290 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
291 relocation errors for branches to strong undefined symbols.
292
67f95b96
RÁE
2932015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
294
295 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
296 (Object_merge_map::is_merge_section_for): Remove.
297 (Object_merge_map::find_merge_section): New.
298 * merge.h (Object_merge_map::is_merge_section_for): Remove.
299 (Object_merge_map::find_merge_section): New.
300 (Object_merge_map::get_input_merge_map): Add a const version.
301 * object.cc (Relobj::is_merge_section_for): Remove.
302 (Relobj::find_merge_section): New.
303 * object.h (Relobj::is_merge_section_for): Remove.
304 (Relobj::find_merge_section): New.
305 * output.cc
306 (Output_section::Input_section::is_merge_section_for): Remove.
307 (Output_section::add_merge_input_section): Don't call
308 add_merge_input_section.
309 (Output_section::find_merge_section): Return const. Use
310 object->find_merge_section.
311 (Output_section::build_lookup_maps): Don't build a map for
312 merge sections.
313 (Output_section::is_input_address_mapped): Return false if
314 section is not found.
315 (Output_section::find_starting_output_address): Use
316 find_merge_section instead of is_merge_section_for.
317 (Output_section::add_script_input_section): Don't build a map for
318 merge sections.
319 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
320 (Output_section_lookup_maps::find_merge_section): Remove.
321 (Output_section_lookup_maps::add_merge_input_section) Remove.
322 (Output_section::find_merge_section): Return const.
323
152f7024
CC
3242015-03-22 Cary Coutant <cary@google.com>
325
326 PR gold/18106
327 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
328 non-SIB form of lea, with nop after the call.
329
bccffdfd
CC
3302015-03-21 Cary Coutant <cary@google.com>
331
332 PR gold/14217
333 * output.cc (Output_segment::is_first_section_relro): Don't ignore
334 .tdata section.
335 (Output_segment::set_section_addresses): Don't align size of relro
336 segment for .tbss.
337
1c582fe7
CC
3382015-03-21 Cary Coutant <cary@google.com>
339
340 PR gold/18010
341 * stringpool.cc (Stringpool_template): Don't optimize if section
342 alignment is greater than sizeof(char).
343
410da591
CC
3442015-03-21 Cary Coutant <cary@google.com>
345
346 PR gold/18048
347 * script-c.h (script_include_directive): Add first_token parameter.
348 * script.cc (script_include_directive): Add first_token parameter, and
349 pass it to read_script_file.
350 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
351 (PARSING_MEMORY_DEF): New tokens.
352 (top): Add new productions for INCLUDE files.
353 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
354 Pass PARSING_LINKER_SCRIPT to script_include_directive.
355 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
356 (section_cmd): Pass PARSING_SECTION_CMDS.
357 (file_or_sections_cmd): Remove.
358 (memory_def): Pass PARSING_MEMORY_DEF.
359 * testsuite/Makefile.am (memory_test_2): New test.
360 * testsuite/Makefile.in: Regenerate.
361 * testsuite/memory_test_inc.t: New script file.
362 * testsuite/memory_test_inc_1.t.src: New script file.
363 * testsuite/memory_test_inc_2.t.src: New script file.
364 * testsuite/memory_test_inc_3.t.src: New script file.
365
0d5bbdb0
CC
3662015-03-21 Cary Coutant <cary@google.com>
367
368 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
369 (Sized_relobj_dwo::setup): Build compressed section map.
370 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
371 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
372 section map.
373 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
374 compressed_sections_ field.
375 (build_compressed_section_map): Take Object instead of
376 Sized_relobj_file parameter; add decompress_if_needed parameter.
377 (Sized_relobj_file::do_find_special_sections): Store compressed
378 section map in parent Object.
379 (Sized_relobj_file::do_decompressed_section_contents): Move
380 implementation to Object::decompressed_section_contents.
381 (Sized_relobj_file::do_discard_decompressed_sections): Move
382 implementation to Object::discard_decompressed_sections.
383 * object.h (build_compressed_section_map): Declare.
384 (Object::Object): Add compressed_sections_ field.
385 (Object::section_is_compressed): Move implementation here.
386 (Object::decompressed_section_contents): De-virtualize.
387 (Object::discard_decompressed_sections): De-virtualize.
388 (Object::do_section_is_compressed): Delete.
389 (Object::do_decompressed_section_contents): Delete.
390 (Object::set_compressed_sections): New method.
391 (Object::compressed_sections): New method.
392 (Object::compressed_sections_): New data member.
393 (Compressed_section_info, Compressed_section_map): Move to top of file.
394 (Sized_relobj_file::do_section_is_compressed): Delete.
395 (Sized_relobj_file::do_decompressed_section_contents): Delete.
396 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
397 (Sized_relobj_file::compressed_sections_): Move to Object class.
398
bd9e0d46
CC
3992015-03-21 Cary Coutant <ccoutant@google.com>
400
401 PR gold/18152
402 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
403 deferred objects.
404
943c8b43
CC
4052015-03-11 Cary Coutant <ccoutant@google.com>
406
407 * options.cc (General_options::finalize): Don't allow -z relro
408 with incremental linking.
409 * testsuite/Makefile.am (incremental_test): Add -z norelro.
410 (incremental_test_2): Likewise.
411 (incremental_test_3): Likewise.
412 (incremental_test_4): Likewise.
413 (incremental_test_5): Likewise.
414 (incremental_test_6): Likewise.
415 (incremental_copy_test): Likewise.
416 (incremental_common_test_1): Likewise.
417 (incremental_comdat_test_1): Likewise.
418 * testsuite/Makefile.in: Regenerate.
419
e1663197
CC
4202015-03-09 Cary Coutant <ccoutant@google.com>
421
422 PR gold/14675
423 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
424 return enum indicating whether .eh_frame section is empty, optimizable,
425 unrecognized, or an end marker. Adjust explicit instantiations.
426 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
427 (Eh_frame::add_ehframe_input_section): Change return type.
428 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
429 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
430 to the .eh_frame output section until we see the end marker.
431 (Layout::finalize_eh_frame_section): New.
432 * layout.h: (Layout::finalize_eh_frame_section): New.
433
beb8418f
L
4342015-03-05 H.J. Lu <hongjiu.lu@intel.com>
435
436 * output.cc (Relobj::initialize_input_to_output_map<size>):
437 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
438
48c73428
CC
4392015-03-04 Cary Coutant <ccoutant@google.com>
440
441 * parameters.cc (Parameters::set_target_once): Call
442 Target::select_as_default_target just once from here...
443 (set_parameters_target): ...instead of from here.
444
4452015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
dbe40a88
RÁE
446
447 * ehframe.cc (Cie::set_output_offset): Pass in and use a
448 Output_section_data instead of a Merge_map.
449 (Eh_frame::Eh_frame): Don't initialize merge_map_.
450 (Eh_frame::read_cie): Use add_merge_mapping instead of
451 Merge_map::add_mapping.
452 (Eh_frame::read_fde): Ditto.
453 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
454 (Eh_frame::do_output_offset): Use merge_output_offset istead of
455 merge_map_->get_output_offset.
456 (Eh_frame::do_is_merge_section_for): Delete.
457 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
458 instead of a Merge_map.
459 (Cie::set_output_offset): Pass in a Output_section_data instead of a
460 Merge_map.
461 (Eh_frame::do_is_merge_section_for): Delete.
462 (Eh_frame::merge_map_): Delete.
463 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
464 and use a Output_section_data instead of a Merge_map.
465 (Object_merge_map::add_mapping): Ditto.
466 (Object_merge_map::get_output_offset): Remove the merge_map argument.
467 (Object_merge_map::is_merge_section_for): Pass in and use a
468 Output_section_data instead of a Merge_map.
469 (Merge_map): Delete.
470 (Output_merge_base::do_output_offset): Use merge_output_offset instead
471 of merge_map_.get_output_offset.
472 (Output_merge_base::do_is_merge_section_for): Delete.
473 (Output_merge_data::do_add_input_section): Use
474 object->add_merge_mapping instead of add_mapping.
475 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
476 * merge.h (Merge_map): Delete forward declaration.
477 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
478 instead of a Merge_map.
479 (Object_merge_map::get_output_offset): Remove the merge_map argument.
480 (Object_merge_map::is_merge_section_for): Pass in and use a
481 Output_section_data instead of a Merge_map.
482 (Input_merge_map::Object_merge_map::merge_map): Replace with
483 output_data.
484 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
485 Output_section_data instead of a Merge_map.
486 (Merge_map): Delete.
487 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
488 (Output_merge_base::do_is_merge_section_for): Delete.
489 (Output_merge_base::add_mapping): Delete.
490 (Output_merge_base::merge_map_): Delete.
491 * object.cc (Relobj::initialize_input_to_output_map): New.
492 (Relobj::initialize_input_to_output_map): New.
493 (Relobj::merge_output_offset): New.
494 (Relobj::is_merge_section_for): New.
495 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
496 bits.
497 * object.h (Relobj::merge_map): Delete.
498 (initialize_input_to_output_map): New.
499 (set_merge_map): Delete.
500 (add_merge_mapping): New.
501 (merge_output_offset): New.
502 (is_merge_section_for): New.
503 * output.cc (Output_section::Input_section::is_merge_section_for):
504 Use object->is_merge_section_for.
505 * output.h (Output_section_data::is_merge_section_for): Delete.
506 (Output_section_data::do_is_merge_section_for): Delete.
507 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
508 Use object->initialize_input_to_output_map.
509 (Merged_symbol_value<size>::value_from_output_section): Use
510 object->merge_output_offset.
511
48c73428 5122015-03-02 Peter Collingbourne <pcc@google.com>
2c7b626c
CC
513 Cary Coutant <ccoutant@google.com>
514
515 * output.cc (Output_section::add_merge_input_section): Do not
516 attempt to merge sections with an entsize of 0.
517
48c73428 5182015-03-02 Khem Raj <raj.khem@gmail.com>
5b07cd84
CC
519
520 * attributes.h (class Output_attributes_section_data ): Add
521 do_print_to_mapfile function.
522
ec86f434
AM
5232015-02-24 Alan Modra <amodra@gmail.com>
524
525 PR 18010
526 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
527 complain if value is not a multiple of four.
528 (Target_powerpc::Relocate::relocate): Correct handling of
529 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
530
be66981e
L
5312015-02-21 H.J. Lu <hongjiu.lu@intel.com>
532
533 * configure.ac (default_size): Set to 32 for x32.
534 * configure: Regenerated.
535
e3ee8ed4
AM
5362015-02-18 Alan Modra <amodra@gmail.com>
537
538 PR 17954
539 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
540 visibility.
541
3a935c6c
RÁE
5422015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
543
544 * gc.h (Garbage_collection::add_reference): Don't use find.
545
e0a1e121
RÁE
5462015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
547
548 * object.cc (write_local_symbols): avoid std::vector copy.
549
45a4fb1a
RÁE
5502015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
551
552 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
553
2d9afefe
MW
5542015-02-09 Mark Wielaard <mjw@redhat.com>
555
556 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
557 DW_LANG_Fortran03 and DW_LANG_Fortran08.
558
e9c1bdad
CC
5592015-02-16 Cary Coutant <ccoutant@google.com>
560
561 PR gold/13577
562 PR gold/16992
563 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
564 DF_SYMBOLIC if --dynamic-list option is used.
565 * options.cc (General_options::finalize): --dynamic-list is not
566 mutually exclusive with -Bsymbolic.
567 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
568 listed in --dynamic-list.
569 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
570 -Bsymbolic-functions.
571 * testsuite/Makefile.in: Regenerate.
572
0ed4b0bf
CC
5732015-02-16 Cary Coutant <ccoutant@google.com>
574
575 PR gold/17971
576 * incremental.cc: Remove redundant include of "output.h".
577
1a920511
JY
5782015-02-12 Jing Yu <jingyu@google.com>
579
580 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
581 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
582 New relocation.
583 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
584 TLSLE_MOVW_* relocations.
585 (Target_aarch64::Scan::global): Likewise.
586 (Target_aarch64::Relocate::relocate): Likewise.
587 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
588 for new TLSLE_MOVW_* relocations.
589
07f107f3
WN
5902015-02-11 Will Newton <will.newton@linaro.org>
591
592 PR gold/13321
593 * arm.cc (Target_arm::make_plt_section): Create an ARM
594 state mapping symbol at the start of the PLT.
595
e051a5b5
L
5962015-02-09 H.J. Lu <hongjiu.lu@intel.com>
597
598 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
599 Replace two_file_shared_2.so with two_file_shared_1.so.
600 * testsuite/Makefile.in: Regenerated.
601
dddcc5b9
AM
6022015-02-09 Alan Modra <amodra@gmail.com>
603
604 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
605 plugin_test_thin.a and defsym_test.
606 * testsuite/Makefile.in: Regenerate.
607
b39b8b9d
RÁE
6082015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
609
610 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
611 body.
612
b66d1c52
CC
6132015-02-04 Peter Collingbourne <pcc@google.com>
614
615 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
616 forwarding symbols when computing symbol resolution info for plugins.
617 * plugin.h (Plugin_manager::symtab): New method.
618 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
619
23081de0
CC
6202015-02-03 Cary Coutant <ccoutant@google.com>
621 Peter Collingbourne <pcc@google.com>
622
623 PR gold/15660
624 * archive.cc (Thin_archive_object_unlocker): New class.
625 (Archive::include_member): Unlock external members of thin archives.
626 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
627 (plugin_test_2): Likewise.
628 (plugin_test_3): Likewise.
629 (plugin_test_4): Likewise.
630 (plugin_test_5): Likewise.
631 (plugin_test_6): Likewise.
632 (plugin_test_7): Likewise.
633 (plugin_test_8): Likewise.
634 (plugin_test_9): Likewise.
635 (plugin_test_10): Likewise.
636 (plugin_test_11): New test case.
637 * testsuite/Makefile.in: Regenerate.
638 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
639 file to decide whether to claim file.
640 (all_symbols_read_hook): Likewise.
641 * testsuite/plugin_test_1.sh: Adjust expected output.
642 * testsuite/plugin_test_2.sh: Likewise.
643 * testsuite/plugin_test_3.sh: Likewise.
644 * testsuite/plugin_test_6.sh: Likewise.
645 * testsuite/plugin_test_tls.sh: Likewise.
646 * testsuite/plugin_test_11.sh: New testcase.
647
6482015-02-03 Cary Coutant <ccoutant@google.com>
649
650 * descriptors.cc (Descriptors::open): Set artificially-low limit for
651 file descriptors when debugging enabled. Add debug output.
652 (Descriptors::release): Add debug output.
653 (Descriptors::close_some_descriptor): Likewise.
654 (Descriptors::close_all): Likewise.
655 * fileread.cc (File_read::lock): Likewise.
656 (File_read::unlock): Likewise.
657
24dd5808
CC
6582015-02-02 Cary Coutant <ccoutant@google.com>
659
660 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
661 executable output file.
662
fa89cc82
HS
6632015-01-22 Han Shen <shenhan@google.com>
664
665 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
666 (Target_arm::do_plt_address_for_global): New method.
667 (Target_arm::do_plt_address_for_local): New method.
668 (Target_arm::rel_irelative_section): New method.
669 (Target_arm::make_data_plt): Add more parameters for plt ctor.
670 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
671 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
672 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
673 (Target_arm::Scan::check_non_pic): Add ifunc support.
674 (Target_arm::Scan::local): Add ifunc support.
675 (Target_arm::Scan::global): Add ifunc support.
676 (Target_arm::make_plt_section): New method.
677 (Target_arm::make_plt_entry): Change to call to make_plt_section.
678 (Target_arm::make_local_ifunc_plt_entry): New method.
679 (Target_arm::got_irelative_): New member.
680 (Target_arm::rel_irelative_): New member.
681 (Target_arm::got_section): Add creation for got_irelative_.
682 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
683 (Target_arm::Relocate::relocate): Properly set local ifunc address.
684 (Target_arm::do_dynsym_value): Properly set global ifunc address.
685 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
686 (Output_data_plt_arm::IRelative_data): New type.
687 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
688 (Output_data_plt_arm::add_entry): Add more parameters.
689 (Output_data_plt_arm::add_relocation): New method.
690 (Output_data_plt_arm::add_local_ifunc_entry): New method.
691 (Output_data_plt_arm::rel_irelative): New method.
692 (Output_data_plt_arm::entry_count): Modified.
693 (Output_data_plt_arm::address_for_global): New method.
694 (Output_data_plt_arm::address_for_local): New method.
23081de0 695gold/
fa89cc82
HS
696 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
697 (Output_data_plt_arm::insert_irelative_data): New method.
698 (Output_data_plt_arm::irelative_rel_): New member.
699 (Output_data_plt_arm::got_): New member.
700 (Output_data_plt_arm::got_irelative_): New member.
701 (Output_data_plt_arm::irelative_count_): New member.
702 (Output_data_plt_arm::IRelative_data_vec): New typedef.
703 (Output_data_plt_arm::irelative_data_vec_): New member.
704 (Output_data_plt_arm::do_write): Write out irelative entries.
705 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
706 more parameters to ctor.
707 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
708 more parameters to ctor.
709 * output.h (Output_data_reloc::add_local_relative): New method.
710 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
711
0f81d3f0
AM
7122015-01-29 Alan Modra <amodra@gmail.com>
713
714 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
715 and GOT_TLSGD to LE optimization.
716
65d92137
CC
7172015-01-28 Cary Coutant <ccoutant@google.com>
718
719 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
720 for undef TLS symbols.
721 (Target_x86_64::Relocate::relocate_tls): Likewise.
722 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
723
5485698a
CC
7242015-01-25 Cary Coutant <ccoutant@google.com>
725
726 * output.cc (Output_segment::set_section_addresses): Fix calculation
727 of size of relro segment.
728
b01a4b04
AM
7292015-01-22 Alan Modra <amodra@gmail.com>
730
731 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
732 condition for need of ifunc plt entry.
733 (Target_powerpc::Scan::global <got relocs>): Likewise.
734
3d0064a9
CC
7352015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
736
737 * mips.cc (reloc_high): Add r_sym.
738 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
739 reloc_high constructor.
740 (Mips_relocate_functions::relgot16_local): Likewise.
741 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
742 r_type to decide whether LO16 matches HI16.
743 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
744 rello16 and relgot16_local.
745
a5cd8f05
CC
7462015-01-09 Cary Coutant <ccoutant@google.com>
747
748 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
749 unless alignment is larger than page size.
750
4fc1b9d4
L
7512015-01-06 H.J. Lu <hongjiu.lu@intel.com>
752 Cary Coutant <ccoutant@google.com>
753
754 PR gold/17729
755 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
756 (DEFAULT_TARGET_X32): Set for x32.
757 * x86_64.cc (cmp_insn_32): New.
758 (lea_r10_insn_32): Likewise.
759 (lea_r11_insn_32): Likewise.
760 (cmp_insn_64): Likewise.
761 (lea_r10_insn_64): Likewise.
762 (lea_r11_insn_64): Likewise.
763 (Target_x86_64<size>::do_calls_non_split): Handle x32.
764 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
765 (check_DATA): Add split_x32 files.
766 (split_x32_[1234n].o): New targets.
767 (split_x32_[124]): New targets.
768 (split_x32_[1234r].stdout): New targets.
769 * testsuite/split_x32.sh: New file.
770 * testsuite/split_x32_1.s: Likewise.
771 * testsuite/split_x32_2.s: Likewise.
772 * testsuite/split_x32_3.s: Likewise.
773 * testsuite/split_x32_4.s: Likewise.
774 * testsuite/split_x32_n.s: Likewise.
775 * configure: Regenerated.
776 * testsuite/Makefile.in: Likewise.
777
e749cab8
L
7782015-01-06 H.J. Lu <hongjiu.lu@intel.com>
779
780 PR gold/17809
781 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
782 x32.
783
af759df0
AM
7842015-01-02 Alan Modra <amodra@gmail.com>
785
786 * version.cc (print_version): Just print current year.
787 * dwp.cc (print_version): Likewise.
788
b90efa5b
AM
7892015-01-01 Alan Modra <amodra@gmail.com>
790
791 Update year range in copyright notice of all files.
792
f12d1e8a
AM
7932014-12-25 Alan Modra <amodra@gmail.com>
794
795 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
796 new enums.
797 (Target_arm::merge_object_attributes, ): Likewise.
798
5c294fee
TG
7992014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
800
801 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
802 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
803 AEABI_VFP_args_vfp to check that.
804 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
805 value and replace hardcoded values by enum values.
806
e30880c2
CC
8072014-12-22 Cary Coutant <ccoutant@google.com>
808
809 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
810
bd040da1
L
8112014-12-20 H.J. Lu <hongjiu.lu@intel.com>
812
813 PR gold/14608
814 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
815 to "return i * i * 3;".
816
e02a4046
CC
8172014-12-16 Cary Coutant <ccoutant@google.com>
818
819 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
820 (Mapfile::print_output_data): Use current_data_size() to avoid
821 assert for sections requiring postprocessing; if address is not valid,
822 print 0.
823 (Mapfile::print_output_section): Use current_data_size(); print note
824 that addresses and sizes are before compression.
825
add6016b
L
8262014-12-14 H.J. Lu <hongjiu.lu@intel.com>
827
828 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
829 Cast current_group_size to unsigned long when reporting error.
830
0bf32ea9
JY
8312014-12-10 Jing Yu <jingyu@google.com>
832
833 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
834 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
835 Update error message.
836 (Target_aarch64::do_relax): Use absolute value of option
837 stub_group_size. Replace local variable with class member
838 stub_group_size_.
839
cbcb23fa
AM
8402014-12-04 Alan Modra <amodra@gmail.com>
841
842 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
843 addend of PLTREL24 reloc when not generating a plt stub. Make
844 max_branch_offset an "Address".
fbad6518 845 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
846 (Target_powerpc::Relocate::relocate): Likewise.
847
1611bc4a
AM
8482014-12-04 Alan Modra <amodra@gmail.com>
849
850 PR 17670
851 * symtab.cc (Symbol::set_undefined): Remove assertion.
852 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
853 on symbols defined in discarded sections, instead return false.
854 Rearrange params, update all callers.
855 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
856 branches to syms in discarded sections.
857 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
858 undefined and flag as discarded.
859 (Target_powerpc::Relocate::relocate): Localize variable.
860
4759c34e
L
8612014-12-03 H.J. Lu <hongjiu.lu@intel.com>
862
863 PR gold/17675
864 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
865 * testsuite/Makefile.in: Regenerated.
866
1f98a074
AM
8672014-12-03 Alan Modra <amodra@gmail.com>
868
869 PR 17566
870 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
871 when adding dynamic relocations against section symbols.
872
fb257835
DI
8732014-12-01 Dimitry Ivanov <dimitry@google.com>
874
875 * layout.cc (Layout::finish_dynamic_section): When '-z global'
876 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
877 * options.h (General_options): New -z option (global).
878
d8e60314
CC
8792014-12-01 Cary Coutant <ccoutant@google.com>
880
881 PR gold/17578
882 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
883 is given.
884 (Layout::create_executable_stack_info): Warn when -z noexecstack is
885 given but some inputs require executable stack.
886
982bbd97
CC
8872014-11-26 Cary Coutant <ccoutant@google.com>
888
889 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
890 .debug_str_offsets; strip .debug_gnu_pubnames and
891 .debug_gnu_pubtypes.
892 (lines_only_debug_sections): Strip all four new sections.
893
bb779192
HS
8942014-11-26 Jing Yu <jingyu@google.com>
895
896 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
897 register to be x0 when to relax TLSDESC_LD64_LO12.
898
a3e60ddb
AM
8992014-11-26 Alan Modra <amodra@gmail.com>
900
901 * powerpc.cc (struct Stub_table_owner): New.
902 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
903 unsigned int vector. Update all references.
904 (powerpc_relobj::set_stub_table): Take an unsigned int param
905 rather than a Stub_table. Update callers.
906 (Powerpc_relobj::clear_stub_table): New function.
907 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
908 stub_group_size_ vars.
909 (Target_powerpc::new_stub_table): Delete.
910 (max_branch_delta): New function, extracted from..
911 (Target_powerpc::Relocate::relocate): ..here..
912 (Target_powerpc::Branch_info::make_stub): ..and here. Return
913 status on whether stub created successfully.
914 (Stub_control::Stub_control): Add "no_size_errors" param. Move
915 default sizing to..
916 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
917 reduce on relax failure.
918 (Target_powerpc::group_sections): Add "no_size_errors" param.
919 Use stub_group_size_. Set up group info in a temp vector,
920 before building Stub_table vector. Account for input sections
921 possibly already converted to relaxed sections.
922 (Stub_table::init): Delete. Merge into..
923 (Stub_table::Stub_table): ..here.
924 (Stub_table::can_reach_stub): New function.
925 (Stub_table::add_plt_call_entry): Add "from" parameter and
926 return true iff stub could be reached.
927 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
928 param too.
929 (Stub_table::clear_stubs): Add "all" param.
930
a20605cf
AM
9312014-11-26 Alan Modra <amodra@gmail.com>
932
933 * powerpc.cc (Stub_control::set_output_and_owner): New function.
934 (Target_powerpc::group_sections): Use it.
935
43b64deb
CC
9362014-11-25 Cary Coutant <ccoutant@google.com>
937
938 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
939 (Binary_to_elf::write_symbol): Add st_size parameter.
940 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
941
c924eb67
CC
9422014-11-25 Cary Coutant <ccoutant@google.com>
943
944 PR gold/17639
945 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
946 (Sized_relobj_file::do_layout): Handle deferred sections properly
947 during GC pass 1. Don't add reloc sections to deferred list twice.
948 * object.h (Sized_relobj_file::is_deferred_layout): New function.
949 (Sized_relobj_file::is_deferred_layout_): New data member.
950
9d585188
L
9512014-11-21 H.J. Lu <hongjiu.lu@intel.com>
952
953 PR gold/17619
954 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
955 Check PC-relative offset overflow in PLT entry.
956
3ffaac20
AM
9572014-11-21 Alan Modra <amodra@gmail.com>
958
959 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
960 for undefined weaks.
961
0cfb0717
AM
9622014-11-20 Alan Modra <amodra@gmail.com>
963
964 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
965 from --stub-group-size parameter divided by 1024.
966 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
967 template parameter. Update all uses.
968 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
969 has_stub_value. Set for long branches. Don't report overflow for
970 branch to undefined weak symbols. Print info message on
971 overflowing branch to stub.
972
f9dffbf0
AM
9732014-11-20 Alan Modra <amodra@gmail.com>
974
975 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
976
e88ba8d5
L
9772014-11-13 H.J. Lu <hongjiu.lu@intel.com>
978
979 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
980 entry for R_X86_64_GOTPLT64.
981 (Target_x86_64<size>::Relocate::relocate): Update comments for
982 R_X86_64_GOTPLT64.
983
d37ffe25
ED
9842014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
985
986 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
987 * plugin.h: add lock definition
988
9726c3c1
HS
9892014-10-29 Han Shen <shenhan@google.com>
990 Jing Yu <jingyu@google.com>
991
992 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
993 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
994 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
995 Symbol::TLS_REF.
996 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
997 method.
998 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
999 (Target_aarch64::tls_ld_to_le): New method.
1000 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
1001 for 64bit targets.
1002 (Output_data_plt_aarch64::irelative_rel_): New data member.
1003 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
1004 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
1005 (Output_data_plt_aarch64::add_relocation): New method.
1006 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
1007 offset. Add got_irelative size to got size.
1008 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
1009 type string with the new typename.
1010 (AArch64_relocate_functions::update_adr): Replace parameter x with
1011 immed.
1012 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
1013 (AArch64_relocate_functions::reloc_common): New method.
1014 (AArch64_relocate_funcsions::rela_general): Extract common part out
1015 into reloc_common method.
1016 (AArch64_relocate_functions::rela_general): Likewise.
1017 (AArch64_relocate_functions::pcrela_general): Likewise.
1018 (AArch64_relocate_functions::adr): New method.
1019 (AArch64_relocate_functions::adrp): Calculate immed before calling
1020 update_adr.
1021 (AArch64_relocate_functions::adrp): Likewise.
1022 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
1023 comparing x to 0. Calculate immed from ~x when x < 0.
1024 (Target_aarch64::optimize_tls_reloc): Add new cases for
1025 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1026 TLSLD_MOVW_DTPREL_G0_NC.
1027 (Target_aarch64::possible_function_pointer_reloc): Implement this
1028 method.
1029 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
1030 comment.
1031 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
1032 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1033 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1034 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
1035 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1036 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1037 (Target_aarch64::make_plt_entry): Call add_entry with two more
1038 parameters.
1039 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1040 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
1041 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1042 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1043 (Target_aarch64::Relocate::relocate_tls): Add cases for
1044 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1045 TLSLD_MOVW_DTPREL_G0_NC.
1046 * testsuite/icf_safe_so_test.cc: Correct test comment.
1047 * testsuite/icf_safe_test.sh: Add AArch64 arch.
1048
80272b8c
AM
10492014-10-22 Alan Modra <amodra@gmail.com>
1050
1051 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
1052 thread_starter.
1053
998a69f4
AS
10542014-10-18 Andreas Schwab <schwab@linux-m68k.org>
1055
1056 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
1057
aed56ec5
CC
10582014-10-17 Cary Coutant <ccoutant@google.com>
1059
1060 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1061 Add "typename" keyword.
1062
bb779192 10632014-10-15 Han Shen <shenhan@google.com>
83a01957
HS
1064 Jing Yu <jingyu@google.com>
1065
1066 Patch for gold aarch64 backend to support relaxation.
1067 * aarch64-reloc.def: Change format.
1068 * aarch64.cc (class Reloc_stub): New class.
1069 (class Stub_table): New class.
1070 (class AArch64_relobj): New class.
1071 (class AArch64_input_section): New class.
1072 (class AArch64_output_section): New class.
1073 (Target_aarch64::new_stub_table): New method.
1074 (Target_aarch64::new_aarch64_input_section): New method.
1075 (Target_aarch64::find_aarch64_input_section): New method.
1076 (Target_aarch64::scan_section_for_stubs): New method.
1077 (Target_aarch64::scan_reloc_section_for_stubs): New method.
1078 (Target_aarch64::relocate_stub): New method.
1079 (Target_aarch64::current_target): New method.
1080 (Target_aarch64::do_make_elf_object): New method.
1081 (Target_aarch64::do_may_relax): New method.
1082 (Target_aarch64::do_relax): New method.
1083 (Target_aarch64::group_sections): New method.
1084 (Target_aarch64::scan_reloc_for_stub): New method.
1085 (Target_aarch64::do_make_output_section): New method.
1086 (Target_aarch64::stub_tables_): New data member.
1087 (Target_aarch64::aarch64_input_section_map_): New data member.
1088 (AArch64_relocate_functions::maybe_apply_stub): New method.
1089
db4c9594
CC
10902014-09-30 Cary Coutant <ccoutant@google.com>
1091
1092 PR gold/17432
1093 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
1094
cd6da036
KC
10952014-09-30 Kito Cheng <kito@0xlab.org>
1096
1097 PR gold/13597
1098 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
1099 hash table before sysv-style hash table.
1100
5f772412
ST
11012014-09-29 Sriraman Tallam <tmsriram@google.com>
1102
1103 * options.h (--pic-executable): Add negative to alias to -no-pie.
1104
5efeedf6
CC
11052014-09-26 Cary Coutant <ccoutant@google.com>
1106
1107 PR gold/16773
1108 * object.cc (Sized_relobj_file): Compute value of section symbols
1109 for TLS sections the same as TLS symbols.
1110
1707f183
CC
11112014-09-25 Cary Coutant <ccoutant@google.com>
1112
1113 PR gold/17432
1114 * resolve.cc (Symbol_table::resolve): Override common placeholder
1115 symbols, but adjust sizes.
1116 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
1117 symbols to common lists.
1118
00cac886
AM
11192014-09-24 Alan Modra <amodra@gmail.com>
1120
1121 * po/POTFILES.in: Regenerate.
1122
635aa30e
CC
11232014-09-23 Taiju Tsuiki <tzik@google.com>
1124 Cary Coutant <ccoutant@google.com>
1125
71b9b91b 1126 PR gold/14860
635aa30e
CC
1127 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
1128 on input_sections_blocker.
1129 * layout.cc (Write_sections_task::locks): Unblock
1130 input_sections_blocker_.
1131 * layout.h (Write_sections_task::Write_sections_task): Add
1132 input_sections_blocker.
1133 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
1134 to DEPENDENCIES.
1135 * testsuite/Makefile.in: Regenerate.
1136
c0c71592
RÁE
11372014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1138
1139 * testsuite/Makefile.am (plugin_test_10): New test.
1140 * testsuite/Makefile.in: Regenerate
1141 * testsuite/plugin_common_test_2.c (c1): Align to 8.
1142 * testsuite/plugin_test_10.sh: New file.
1143
6168c2a1
RÁE
11442014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1145
1146 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
1147 * resolve.cc (Symbol_table::resolve): Don't override common symbols
1148 during the replacement phase.
1149
3a531937
JY
11502014-09-17 Han Shen <shenhan@google.com>
1151 Jing Yu <jingyu@google.com>
1152
1153 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
1154 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
1155 * aarch64.cc (Target_aarch64): Add data members
1156 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
1157 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
1158 constructor.
1159 (Target_aarch64::do_reloc_symbol_index): New method.
1160 (Target_aarch64::do_reloc_addend): New method.
1161 (Target_aarch64::add_tlsdesc_info): New method.
1162 (Target_aarch64::do_dynsym_value): New method.
1163 (Target_aarch64::do_make_data_plt): Add new parameters: got,
1164 got_irelative. Pass them to Output_data_plt_aarch64_standard.
1165 (Target_aarch64::make_data_plt): Add new parameters: got,
1166 got_irelative. Pass them to do_make_data_plt.
1167 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
1168 (Target_aarch64::Relocate:tls_gd_to_le): New method.
1169 (Target_aarch64::Relocate:tls_ie_to_le): New method.
1170 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
1171 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
1172 (Target_aarch64::got_tlsdesc_section): New method.
1173 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1174 (Target_aarch64::define_tls_base_symbol): New method.
1175 (Target_aarch64::reserve_tlsdesc_entries): New method.
1176 (Target_aarch64::got_mod_index_entry): New method.
1177 (Target_aarch64::rela_tlsdesc_section): New method.
1178 (Target_aarch64::rela_irelative_section): New method.
1179 (Target_aarch64::Tlsdesc_info): New struct.
1180 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
1181 relocations and tlsdesc relocations.
1182 (Target_aarch64::optimize_tls_reloc): Implement method.
1183 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
1184 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
1185 in constructor.
1186 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
1187 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
1188 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
1189 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
1190 (Output_data_plt_aarch64::rela_tlsdesc): New method.
1191 (Output_data_plt_aarch64::rela_irelative): New method.
1192 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
1193 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
1194 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
1195 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
1196 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
1197 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
1198 (Output_data_plt_aarch64_standard): New member variables:
1199 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
1200 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
1201 New parameter: got, got_irelative.
1202 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
1203 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
1204 (Output_data_plt_aarch64::do_write): Replace got_address with
1205 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
1206 (AArch64_relocate_functions::update_movnz): New method.
1207 (AArch64_relocate_functions): Correct format.
1208 (AArch64_relocate_functions::movnz): New method.
1209 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
1210 before the switch. Add new cases to switch.
00cac886 1211 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
1212 tlsgd tlsdesc cases.
1213 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
1214 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
1215 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
1216 Call reloc_name_in_error_message to print unsupported reloc.
1217 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
1218 make_data_plt.
1219 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
1220 relocs. Fill in some more dynamic tags.
1221 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
1222 Skip call tls_get_addr when tlsgd is relaxed.
1223 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
1224 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
1225 tlsdesc->ie relaxation.
1226
62661c93
SS
12272014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1228
1229 * mips.cc (Target_mips_nacl): New class.
1230 (Target_selector_mips_nacl): New class.
1231 (target_selector_mips32): Rename from target_selector_mips32be and use
1232 Target_selector_mips_nacl instead of Target_selector_mips.
1233 (target_selector_mips32el): Rename from target_selector_mips32 and use
1234 Target_selector_mips_nacl instead of Target_selector_mips.
1235 (target_selector_mips64): Rename from target_selector_mips64be and use
1236 Target_selector_mips_nacl instead of Target_selector_mips.
1237 (target_selector_mips64el): Rename from target_selector_mips64 and use
1238 Target_selector_mips_nacl instead of Target_selector_mips.
1239 (Target_mips::mips_info): Add const attribute.
1240
54674d38
CC
12412014-09-02 Cary Coutant <ccoutant@google.com>
1242
1243 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
1244 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
1245 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
1246 (Sized_incr_dynobj::do_section_name): Likewise.
1247 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
1248 (Sized_incr_dynobj::do_section_name): Likewise.
1249 * object.h (Object::section_name): Likewise.
1250 (Object::do_section_name): Likewise.
1251 (Sized_relobj_file::do_section_name): Likewise.
1252 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
1253 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
1254
9860cbcf
CC
12552014-09-02 Cary Coutant <ccoutant@google.com>
1256
1257 PR gold/17005
1258 * ehframe.cc (Fde::write): Add output_offset parameter.
1259 (Cie::write): Likewise.
1260 (Eh_frame::set_final_data_size): Account for offset within output
1261 section.
1262 (Eh_frame::do_sized_write): Likewise.
1263 * ehframe.h (Fde::write): Add output_offset parameter.
1264 (Cie::write): Likewise.
1265 * output.cc (Output_section::Input_section_sort_entry): Remove
1266 section_has_name_; add output_section_name parameter. Use
1267 output section name for non-input sections.
1268 (Output_section::Input_section_sort_entry::section_has_name): Remove.
1269 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
1270 (Output_section::Input_section_sort_compare): Remove logic for
1271 sections without names.
1272 (Output_section::Input_section_sort_init_fini_compare): Likewise.
1273 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
1274 Likewise.
1275 (Output_section::Input_section_sort_section_name_compare): Likewise.
1276
8e33481e
HS
12772014-08-29 Han Shen <shenhan@google.com>
1278 Jing Yu <jingyu@google.com>
1279
1280 * aarch64-reloc-property.cc
1281 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
1282 reference reloc property in the table.
1283 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
1284 3 other entries.
1285 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
1286 2 new overloaded methods.
1287 (Output_data_got_aarch64::do_write): Add code to write out
1288 static relocs.
1289 (class Output_data_got_aarch64::Static_reloc): New class to wrap
1290 static relocs.
1291 (Output_data_got_aarch64::static_relocs): New vector to
1292 hold static relocs.
1293 (Target_aarch64::TCB_SIZE): New const static memeber.
1294 (Target_aarch64::tcb_size): New method.
1295 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
1296 (Target_aarch64::Relocate::relocate_tls): New method.
1297 (Target_aarch64::Scan::local): Add code handling new reloc types.
1298 (Target_aarch64::Scan::global): Add code handling new reloc types.
1299
81233653
ST
13002014-08-13 Sriraman Tallam <tmsriram@google.com>
1301
1302 * options.h (-no-pie): Add option.
1303
9363c7c3
JY
13042014-08-08 Jing Yu <jingyu@google.com>
1305 Han Shen <shenhan@google.com>
1306
1307 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
1308 (DEFFILES): add aarch64-reloc.def.
1309 (TARGETSOURCES): Add aarch64-reloc-property.cc.
1310 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
1311 * Makefile.in: Regenerate.
1312 * aarch64-reloc-property.cc: New file.
1313 * aarch64-reloc-property.h: New file.
1314 * aarch64-reloc.def: New file.
1315 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
1316 with tab to make the format consistent.
1317 (Output_data_got_aarch64::symbol_table_): New method.
1318 (Target_aarch64::do_plt_address_for_global): New method.
1319 (Target_aarch64::do_plt_address_for_local): New method.
1320 (Target_aarch64::do_select_as_default_target): New method.
1321 (Target_aarch64::do_make_data_plt): New method.
1322 (Target_aarch64::make_data_plt): New method.
1323 (Output_data_plt_aarch64::has_irelative_section): New method.
1324 (Output_data_plt_aarch64::address_for_global): New method.
1325 (Output_data_plt_aarch64::address_for_local): New method.
1326 (Output_data_plt_aarch64::irelative_rel_): New parameter.
1327 (Output_data_plt_aarch64::add_entry): Implement contents.
1328 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
1329 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
1330 the got_pov entry to plt0.
1331 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
1332 Implement contents.
1333 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
1334 (AArch64_howto): New struct.
1335 (aarch64_howto[]): New static const array.
1336 (AArch64_relocate_functions): New class.
1337 (Target_aarch64::Scan::get_reference_flags): Remove method.
1338 (Target_aarch64::Scan::local): Implement to support a few relocations.
1339 (Target_aarch64::Scan::global): Implement to support a few relocations.
1340 (Target_aarch64::make_plt_section): Implement contents.
1341 (Target_aarch64::make_plt_entry): Implement contents.
1342 (Target_aarch64::do_finalize_sections): Implement contents.
1343 (Target_aarch64::Relocate::relocate): Implement a few relocations.
1344 (Target_aarch64::relocate_section): Implement contents.
1345
ad9fe6c1
AM
13462014-08-06 Alan Modra <amodra@gmail.com>
1347
1348 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
1349
7cd4e5b7
AM
13502014-08-06 Alan Modra <amodra@gmail.com>
1351
1352 PR 13227
1353 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
1354
5ad9b0a7
ST
13552014-07-21 Sriraman Tallam <tmsriram@google.com>
1356
1357 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 1358 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 1359
e051745c
CC
13602014-07-08 Cary Coutant <ccoutant@google.com>
1361
1362 * expression.cc (struct Expression::Expression_eval_info): Add
1363 new fields type_pointer, vis_pointer, and nonvis_pointer.
1364 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
1365 nonvis_pointer parameters. Adjust all calls.
1366 (Symbol_expression::value): Update type, visibility, and nonvis bits
1367 in caller.
1368 * script.cc (Symbol_assignment::sized_finalize): Update type,
1369 visibility, and remaining st_other bits for new symbol.
1370 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
1371 vis_pointer, and nonvis_pointer parameters.
1372 * symtab.h (Symbol::set_type): New method.
1373
1374 * testsuite/Makefile.am (defsym_test): New test.
1375 * testsuite/Makefile.in: Regenerate.
1376 * testsuite/defsym_test.c: New file.
1377 * testsuite/defsym_test.sh: New file.
1378
f35c4853
CC
13792014-07-08 Cary Coutant <ccoutant@google.com>
1380
1381 PR gold/15639
1382 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
1383 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
1384 (Sized_dynobj::base_read_symbols): ...new method.
1385 * object.h (Sized_relobj_file::base_read_symbols): New method.
1386 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
1387 (Sized_relobj_file::base_read_symbols): ...new method.
1388 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
1389 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
1390 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
1391
2900af2d
AM
13922014-07-04 Alan Modra <amodra@gmail.com>
1393
1394 * po/POTFILES.in: Regenerate.
1395
053a4d68
JY
13962014-07-02 Jing Yu <jingyu@google.com>
1397
1398 * aarch64.cc: New file
1399 * Makefile.am (TARGETSOURCES): Add aarch64.cc
1400 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
1401 * Makefile.in: Regenerate.
1402 * configure.tgt: Add entries for aarch64*.
1403 * configure.ac: Likewise.
1404 * configure: Likewise.
1405
7b549045
AM
14062014-06-27 Alan Modra <amodra@gmail.com>
1407
1408 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
1409
cb818dbf
CC
14102014-06-24 Cary Coutant <ccoutant@google.com>
1411
1412 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
1413 sections.
1414 (Dwo_file::sized_read_unit_index): Likewise.
1415
9810d34d
SS
14162014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1417
1418 * mips.cc: New file.
1419 * Makefile.am (TARGETSOURCES): Add mips.cc
1420 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
1421 * configure.tgt: Add entries for mips*.
1422 * configure.ac: Likewise.
1423 * Makefile.in: Regenerate.
1424 * configure: Likewise.
1425
9baa787b
CC
14262014-06-09 Cary Coutant <ccoutant@google.com>
1427
1428 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
1429 unit_length is within section bounds.
1430
8f89af0a
CC
14312014-06-09 Cary Coutant <ccoutant@google.com>
1432
1433 PR gold/16980
1434 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
1435 map.
1436
a47622ac
AM
14372014-06-07 Alan Modra <amodra@gmail.com>
1438
1439 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
1440
4320c691
CC
14412014-06-06 Cary Coutant <ccoutant@google.com>
1442
1443 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
1444 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
1445 (Dwarf_pubnames_table::read_header): Likewise.
1446 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
1447 .debug_gnu_pubtypes.
1448
270c9937
JB
14492014-06-05 Joel Brobecker <brobecker@adacore.com>
1450
1451 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
1452 * Makefile.in, configure: Regenerate.
1453
397998fc
AM
14542014-06-03 Alan Modra <amodra@gmail.com>
1455
1456 * powerpc.cc (addis_12_2): Define.
1457 (Stub_table::do_write): Support fusion on ELFv2 stubs.
1458
61f5c66f
AM
14592014-06-03 Alan Modra <amodra@gmail.com>
1460
1461 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
1462 st_other output.
1463
f6971787
AM
14642014-06-02 Alan Modra <amodra@gmail.com>
1465
1466 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
1467 Only ignore relocs on ELFv1.
1468 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
1469
f6fb8322
CC
14702014-05-30 Cary Coutant <ccoutant@google.com>
1471
1472 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
1473 * testsuite/Makefile.in: Regenerate.
1474 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
1475
c23dd342
L
14762014-05-27 H.J. Lu <hongjiu.lu@intel.com>
1477
1478 PR gold/16945
1479 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
1480 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
1481
5fe7ffdc
AM
14822014-05-15 Alan Modra <amodra@gmail.com>
1483
1484 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
1485 Compare FDE contents with DW_CFA_nop rather than 0.
1486
a82bef93
ST
14872014-05-13 Sriraman Tallam <tmsriram@google.com>
1488
1489 * symtab.h (may_need_copy_reloc): Remove check for position independent
1490 code.
1491 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
1492 position independence before pc absolute may_need_copy_reloc call.
1493 Add check for executable output befor pc relative may_need_copy_reloc
1494 call.
1495 * i386.cc: Ditto.
1496 * arm.cc: Ditto.
1497 * sparc.cc: Ditto.
1498 * tilegx.cc: Ditto.
1499 * powerpc.cc: Add check for no position independence before
1500 may_need_copy_reloc calls.
1501 * testsuite/pie_copyrelocs_test.cc: New file.
1502 * testsuite/pie_copyrelocs_shared_test.cc: New file.
1503 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 1504 * Makefile.in: Regenerate.
a82bef93 1505
53c66605
ML
15062014-05-08 Martin Liška <mliska@suse.cz>
1507
1508 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
1509
57b2284c
CC
15102014-05-06 Cary Coutant <ccoutant@google.com>
1511
1512 PR gold/16900
1513 * i386.cc (Output_data_got_plt_i386): New class.
1514 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
1515 parameter. Change all callers.
1516 (Output_data_plt_i386::layout_): Remove.
1517 (Output_data_plt_i386::got_plt_): Change type.
1518 (Target_i386::got_plt_): Change type. Change all references.
1519 (Target_i386::got_section): Create instance of new class.
1520 (Output_data_got_plt_i386::do_write): New function.
1521 * x86_64.cc (Output_data_got_plt_x86_64): New class.
1522 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
1523 parameter. Change all callers.
1524 (Output_data_plt_x86_64::layout_): Remove.
1525 (Output_data_plt_x86_64::got_plt_): Change type.
1526 (Target_x86_64::got_plt_): Change type. Change all references.
1527 (Target_x86_64::got_section): Create instance of new class.
1528 (Output_data_got_plt_x86_64::do_write): New function.
1529 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
1530 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
1531 class.
1532
6b97515d 15332014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 1534
6b97515d
CC
1535 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
1536 if we have pubnames/pubtypes.
1537
d1bddd3c
CC
15382014-05-02 Cary Coutant <ccoutant@google.com>
1539
5fe7ffdc
AM
1540 * defstd.cc (in_segment): Define __ehdr_start here...
1541 * layout.cc (Layout::finalize): ...Instead of here. Set the
1542 output segment when known.
1543 * resolve.cc (Symbol::override_base_with_special): Remember
1544 the original binding.
1545 * symtab.cc (Symbol::set_output_segment): New function.
1546 (Symbol::set_undefined): New function.
1547 * symtab.h (Symbol::is_weak_undefined): Check original undef
1548 binding.
1549 (Symbol::is_strong_undefined): New function.
1550 (Symbol::set_output_segment): New function.
1551 (Symbol::set_undefined): New function.
1552 * target-reloc.h (is_strong_undefined): Remove.
1553 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
1554 Check for hidden undefs.
1555 (relocate_section): Call Symbol::is_strong_undefined.
1556
1557 * testsuite/Makefile.am (ehdr_start_test_1)
1558 (ehdr_start_test_2, ehdr_start_test_3)
1559 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
1560 * testsuite/Makefile.in: Regenerate.
1561 * testsuite/ehdr_start_def.cc: New source file.
1562 * testsuite/ehdr_start_test.cc: New source file.
1563 * testsuite/ehdr_start_test.t: New linker script.
1564 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 1565
7849f6d8
CC
15662014-04-23 Cary Coutant <ccoutant@google.com>
1567
bf2cc635 1568 PR gold/16870
7849f6d8
CC
1569 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
1570
99fd8cff
CC
15712014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1572
1573 * layout.cc (Layout::include_section): Allow a target to decide
1574 whether to include a section.
1575 * target.h (Target::should_include_section): New function.
1576 (Target::do_should_include_section): New function.
1577
91f43acd
CC
15782014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1579
1580 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
1581 inline into ...
1582 (Copy_relocs::emit): ... here.
1583 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
1584 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
1585 (Copy_reloc_entry::entries_): Change from private to protected.
1586
c4eb27e1
ST
15872014-04-02 Sriraman Tallam <tmsriram@google.com>
1588
1589 * icf.cc (get_section_contents): Replace copies of reloc
1590 vectors with const references.
1591
ae447ddd
CC
15922014-04-02 Cary Coutant <ccoutant@google.com>
1593
1594 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
1595 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
1596 * configure: Regenerate.
1597 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
1598 -fno-use-linker-plugin.
1599 (LINK1, CXXLINK1): Add it to the link command.
1600 * testsuite/Makefile.in: Regenerate.
1601
fa47fa92
AM
16022014-03-12 Alan Modra <amodra@gmail.com>
1603
1604 * Makefile.in: Regenerate.
1605
9b12c500
CC
16062014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1607
1608 * symtab.h (Symbol::set_nonvis): New function.
1609
beacaa96
CC
16102014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1611
1612 * symtab.cc (Sized_symbol<32>::init_output_data):
1613 Instantiate the template.
1614 (Sized_symbol<64>::init_output_data): Likewise.
1615
800d9823
CC
16162014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1617
1618 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
1619 adjust dynamic symbol value.
1620 * target.h (Target::adjust_dyn_symbol): New function.
1621 (Target::do_adjust_dyn_symbol): New function.
1622
918fc1f8 16232014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 1624
918fc1f8
CC
1625 * output.cc (Output_data_dynamic::Dynamic_entry::write):
1626 Get the value of DYNAMIC_CUSTOM dynamic entry.
1627 * output.h (Output_data_dynamic::add_custom): New function.
1628 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
1629 dynamic entry.
1630 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
1631 * target.h (Target::dynamic_tag_custom_value): New function.
1632 (Target::do_dynamic_tag_custom_value): New function.
1633
98ff9231
CC
16342014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1635
1636 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
1637 dynsym indexes.
1638 * target.h (Target::has_custom_set_dynsym_indexes): New function.
1639 (Target::do_has_custom_set_dynsym_indexes): New function.
1640 (Target::set_dynsym_indexes): New function.
1641 (Target::do_set_dynsym_indexes): New function.
1642
b80eed39
AM
16432014-03-07 Alan Modra <amodra@gmail.com>
1644
1645 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
1646 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
1647 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
1648 (Powerpc_relocate_functions::has_overflow_bitfield,
1649 overflowed): Use the above.
1650 (Target_powerpc::Relocate::relocate): Correct overflow checking
1651 for a number of relocations. Modify overflow test for 16-bit
1652 fields in instructions to signed/unsigned according to whether
1653 the field takes a signed or unsigned value.
1654
4b95cf5c
AM
16552014-03-05 Alan Modra <amodra@gmail.com>
1656
1657 Update copyright years.
1658
45965137
AM
16592014-03-05 Alan Modra <amodra@gmail.com>
1660
1661 * powerpc.cc (Target_powerpc::Scan::local, global): Support
1662 R_PPC64_ADDR64_LOCAL.
1663 (Target_powerpc::Relocate::relocate): Likewise.
1664
2c80b753
AM
16652014-03-03 Alan Modra <amodra@gmail.com>
1666
1667 * dwp.cc (print_version): Update copyright year to current.
1668
c1c69e83
AM
16692014-02-10 Alan Modra <amodra@gmail.com>
1670
1671 * po/gold.pot: Regenerate.
1672
dd0c4e70
CC
16732014-02-06 Cary Coutant <ccoutant@google.com>
1674
1675 Fix problem where -u is ignored when a weak undef is seen.
1676
1677 * archive.cc (Library_base::should_include_member): Reorder
1678 code to check for -u option if a weak undef has already been seen.
1679 * testsuite/Makefile.am (weak_undef_test_2): New test case.
1680 * testsuite/Makefile.in: Regenerate.
1681 * testsuite/weak_undef_file3.cc: New file.
1682 * testsuite/weak_undef_file4.cc: New file.
1683 * testsuite/weak_undef_test_2.cc: New file.
1684
1a221d3d
CC
16852014-02-05 Cary Coutant <ccoutant@google.com>
1686
1687 Fix issues with gold undefined symbol diagnostics.
1688
1689 PR binutils/15435
1690 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
1691 check to here.
1692 * target-reloc.h (is_strong_undefined): New function.
1693 (relocate_section): Move undef vtable symbol check from here.
1694 Check for is_strong_undefined.
1695
e889f0a4 16962014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 1697
e889f0a4
CC
1698 Fix problems with the --dynamic-list option.
1699
1700 PR gold/13577
1701 * options.cc (General_options::parse_dynamic_list):
1702 Set have_dynamic_list_.
1703 (General_options::General_options): Initialize have_dynamic_list_.
1704 (General_options::finalize): Turn off -Bsymbolic and
1705 -Bsymbolic-functions if --dynamic-list provided.
1706 * options.h (General_options::have_dynamic_list): New function.
1707 (General_options::have_dynamic_list_): New data member.
1708 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
1709 correctly.
5fe7ffdc 1710
e889f0a4
CC
1711 PR gold/16530
1712 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
1713 in --dynamic-list, mark it.
5fe7ffdc 1714
e889f0a4
CC
1715 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
1716 (dynamic_list_2): New test case.
1717 * testsuite/Makefile.in: Regenerate.
1718 * testsuite/dynamic_list_2.cc: New file.
1719 * testsuite/dynamic_list_2.t: New file.
1720 * testsuite/dynamic_list_lib1.cc: New file.
1721 * testsuite/dynamic_list_lib2.cc: New file.
1722 * testsuite/gc_dynamic_list_test.c: New file.
1723 * testsuite/gc_dynamic_list_test.sh: New file.
1724 * testsuite/gc_dynamic_list_test.t: New file.
1725
ec673e64
CC
17262014-01-28 Cary Coutant <ccoutant@google.com>
1727
1728 Add .gdb_index version 7 support.
1729
1730 * gold/dwarf_reader.cc: include <utility> (for make_pair).
1731 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
1732 debug sections.
1733 (Dwarf_ranges_table::read_ranges_table): Likewise.
1734 (Dwarf_pubnames_table::read_section): Check for GNU-style
1735 sections, and for compressed debug sections.
1736 (Dwarf_pubnames_table::read_header): Compute end address of table.
1737 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
1738 for end of list by offset, not by offset == 0.
1739 (Dwarf_info_reader::do_read_string_table): Check for compressed
1740 debug sections.
1741 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1742 Initialize new data members.
1743 (Dwarf_pubnames_table::next_name): return flag_byte.
1744 (Dwarf_pubnames_table::end_of_table_): New data member.
1745 (Dwarf_pubnames_table::is_gnu_style_): New data member.
1746 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
1747 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
1748 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
1749 read skeleton type unit DIEs.
1750 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
1751 (Gdb_index::do_write): Write flag_byte.
1752 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
1753 (Gdb_index::Cu_vector): Store flags along with cu indexes.
1754 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
1755 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
1756
221fd5d5
L
17572014-01-08 H.J. Lu <hongjiu.lu@intel.com>
1758
1759 * version.cc (print_version): Update copyright year to 2014.
1760
6c09fb0b
ILT
17612013-12-19 Dimitry Andric <dimitry@andric.com>
1762
1763 * stringpool.cc (Stringpool_template::reserve): Add
1764 HAVE_UNORDERED_MAP case.
1765 * stringpool.cc (Stringpool_template::print_stats): Likewise.
1766
8356f2d0
CC
17672013-12-18 Cary Coutant <ccoutant@google.com>
1768
1769 * configure.ac: Check for <unordered_set> and <unordered_map>.
1770 * config.in: Regenerate.
1771 * configure: Regenerate.
1772 * system.h: Use <unordered_set> and <unordered_map> if available.
1773
f2c7d7ee
RM
17742013-12-10 Roland McGrath <mcgrathr@google.com>
1775
1776 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
1777 with $(INSTALL_PROGRAM_ENV).
1778 * Makefile.in: Regenerate.
1779
6632e8cc
CC
17802013-11-22 Cary Coutant <ccoutant@google.com>
1781
1782 * configure.ac: Add check for which library is needed for
1783 dlopen.
1784 * configure: Regenerate.
1785
0c075858
CC
17862013-11-22 Cary Coutant <ccoutant@google.com>
1787
1788 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
1789 assembler.
1790 * testsuite/Makefile.in: Regenerate.
1791
f49fe902
L
17922013-11-17 H.J. Lu <hongjiu.lu@intel.com>
1793
1794 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
1795 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
1796 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
1797 (Target_x86_64<size>::Scan::local): Likewise.
1798 (Target_x86_64<size>::Scan::global): Likewise.
1799 (Target_x86_64<size>::Relocate::relocate): Likewise.
1800 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
1801 Likewise.
1802 (Target_x86_64<size>::Scan::check_non_pic(): Handle
1803 R_X86_64_PC32_BND.
1804
1805 * testsuite/Makefile.am (check_PROGRAMS): Add
1806 exception_x86_64_bnd_test.
1807 (exception_x86_64_bnd_test_SOURCES): New macro.
1808 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
1809 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
1810 (exception_x86_64_bnd_test_LDADD): Likewise.
1811 (exception_x86_64_bnd_1.o): New rule.
1812 (exception_x86_64_bnd_2.o): Likewise.
1813 * testsuite/Makefile.in: Regenerated.
1814
9055360d
AM
18152013-11-15 Alan Modra <amodra@gmail.com>
1816
1817 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
1818 accessor.
1819 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
1820 Only call ppc64_local_entry_offset for 64-bit. Restrict
1821 symval_for_branch lookup to ELFv1.
1822 (Stub_table::add_plt_call_entry): Use unsigned int off.
1823 (Output_data_glink::Address, invalid_address): New.
1824 (Output_data_glink::add_eh_frame): Move out of line. Add
1825 support for ELFv2.
1826 (Output_data_glink::add_global_entry, find_global_entry,
1827 global_entry_address): New functions.
1828 (Output_data_glink::global_entry_stubs_, end_branch_table_,
1829 ge_size): New variables.
1830 (Output_data_glink::set_final_data_size): Add global entry
1831 stub sizing.
1832 (Output_data_glink::do_write): Write global entry stubs.
1833 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
1834 parameter. Return true for ELFv2. Adjust callers.
1835 (Target_powerpc::Scan::local, global): Restrict opd lookup to
1836 ELFv1. Similarly for ifunc and dynamic relocation processing
1837 specific to ELFv1. Recognize that symbols are defined on
1838 their plt entries for ELFv2.
1839 (Target_powerpc::symval_for_branch): Assert if called for
1840 ELFv2 or ppc32.
1841 (Target_powerpc::Relocate::relocate): Use global entry plt
1842 stub for symbol value if such exists on ELFv2.
1843 (Target_powerpc::Relocate::relocate): Don't call
1844 symval_for_branch when ELFv2. Do adjust for local entry
1845 offset when ELFv2.
1846 (Target_powerpc::do_dynsym_value): Set symbols to global entry
1847 plt stub for ELFv2.
1848 (Target_powerpc::do_plt_address_for_global): Similarly.
1849
cafdd569
CC
18502013-11-14 Cary Coutant <ccoutant@google.com>
1851
1852 Revert patch -- this did not fix the problem, and there is
1853 no race there.
1854
1855 2013-11-14 Cary Coutant <ccoutant@google.com>
1856
1857 PR gold/14860
1858 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1859 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1860 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1861 updating fde_offsets_.
1862 (Eh_frame_hdr::lock_): New data member.
1863
94e49e16
CC
18642013-11-14 Cary Coutant <ccoutant@google.com>
1865
1866 * dwp.cc (Dwo_file_entry): New type.
1867 (File_list): Use Dwo_file_entry.
1868 (Dwo_file::verify): New function.
1869 (Dwo_file::verify_dwo_list): New function.
1870 (Dwo_file::sized_verify_dwo_list): New function.
1871 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
1872 list.
1873 (Dwp_options): New enum type.
1874 (dwp_options): Add --verify-only.
1875 (usage): Likewise.
1876 (main): Likewise.
1877 * dwp.h (gold_info): Add declaration.
1878
7cdd7d57
CC
18792013-11-14 Cary Coutant <ccoutant@google.com>
1880
1881 PR gold/14860
1882 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1883 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1884 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1885 updating fde_offsets_.
1886 (Eh_frame_hdr::lock_): New data member.
1887
1d946cb3
CC
18882013-11-06 Cary Coutant <ccoutant@google.com>
1889
1890 PR gold/15758
1891 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
1892 before reloc sections.
1893
4f65b40e
AM
18942013-11-04 Alan Modra <amodra@gmail.com>
1895
1896 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
1897 (Symbol::needs_dynamic_reloc): Test new flag.
1898 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
1899 (Target_powerpc::Scan::get_reference_flags): Add target param.
1900 Return FUNC_DESC_ABI for 64-bit ELFv1.
1901 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
1902 call.
1903 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
1904 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
1905
908794a9
CC
19062013-10-31 Cary Coutant <ccoutant@google.com>
1907
1908 Restore support for dwp v2 DWARF package file format.
1909
1910 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1911 tu_length parameter. Adjust all callers.
1912 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1913 * dwp.cc: Include dwarf.h.
1914 (Section_bounds): New struct type.
1915 (Unit_set): New struct type.
1916 (Dwo_file::Dwo_file): Initialize new data member.
1917 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1918 Combine and rename to...
1919 (Dwo_file::read_unit_index): ...this.
1920 (Dwo_file::sized_read_compunit_index)
1921 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1922 (Dwo_file::sized_read_unit_index): ...this.
1923 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1924 parameters; add section_id parameter.
1925 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1926 (Dwo_file::add_unit_set): ...this.
1927 (Dwo_file::shndx_map_): Remove.
1928 (Dwo_file::sect_offsets_): New data member.
1929 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1930 (Dwp_output_file::add_section): Rename to...
1931 (Dwp_output_file::add_contribution): ...this.
1932 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1933 (Dwp_output_file::add_tu_set): Likewise.
1934 (Dwp_output_file::Contribution): New type.
1935 (Dwp_output_file::Section::contributions): New data member.
1936 (Dwp_output_file::Cu_or_tu_set): Remove.
1937 (Dwp_output_file::Section::Section): New ctor.
1938 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1939 (Dwp_output_file::Dwp_index::Section_table): New type.
1940 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1941 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1942 parameter.
1943 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1944 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1945 (Dwp_output_file::Dwp_index::section_table): New member function.
1946 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1947 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1948 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1949 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1950 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1951 (Dwp_output_file::Dwp_index::section_table_): New data member.
1952 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1953 (Dwp_output_file::add_output_section): New member function.
1954 (Dwp_output_file::write_new_section): New member function.
1955 (Dwp_output_file::write_contributions): New member function.
1956 (Dwp_output_file::section_id_map_): New data member.
1957 (class Dwo_id_info_reader): Remove.
1958 (class Unit_reader): New class.
1959 (get_dwarf_section_name): New function.
1960 (Dwo_file::read_executable): Adjust initializations of class data.
1961 (Dwo_file::read): Add support for v2 package file format.
1962 (Dwo_file::read_unit_index): Likewise.
1963 (Dwo_file::sized_read_unit_index): Likewise.
1964 (Dwo_file::copy_section): Likewise.
1965 (Dwo_file::add_unit_set): Likewise.
1966 (Dwp_output_file::add_output_section): Likewise.
1967 (Dwp_output_file::add_contribution): Likewise.
1968 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1969 for empty slot.
1970 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1971 file format.
1972 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1973 slot.
1974 (Dwp_output_file::initialize): Remove unused function.
1975 (Dwp_output_file::finalize): Add support for v2 package file format.
1976 (Dwp_output_file::write_index): Likewise.
1977 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1978 function prototype.
1979
2500c017
CC
19802013-10-31 Cary Coutant <ccoutant@google.com>
1981
1982 * configure.ac: Fix check for -fmerge-constants.
1983 * configure.ac: Regenerate.
1984
dd0845d7
RM
19852013-10-30 Roland McGrath <mcgrathr@google.com>
1986
1987 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
1988 Correct 9-byte nop sequence to match what the assembler generates.
1989
b4f7960d
AM
19902013-10-30 Alan Modra <amodra@gmail.com>
1991
1992 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
1993 ppc64_local_entry_offset, ppc64_local_entry_offset,
1994 do_read_symbols): New functions.
1995 (Powerpc_relobj::e_flags_, st_other_): New vars.
1996 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
1997 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
1998 (Powerpc_relobj::e_flags_): New var.
1999 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
2000 and adjust for ELFv2.
2001 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
2002 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
2003 (Powerpc_dynobj::do_find_special_sections): Likewise.
2004 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
2005 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
2006 to ELFv2 local entry.
2007 (Target_powerpc::do_relax): No thread safe barriers needed for
2008 ELFv2.
2009 (Output_data_plt_powerpc::initial_plt_entry_size_,
2010 plt_entry_size): Delete. Replace all uses with
2011 first_plt_entry_offset() and plt_entry_size().
2012 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
2013 reserved_size parm. Update callers.
2014 (Output_data_plt_powerpc::entry_count): Update.
2015 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
2016 and use Target_powerpc::first_plt_entry_offset().
2017 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
2018 rename to plt_entry_size.
2019 (Output_data_plt_powerpc::add_ifunc_entry,
2020 add_local_ifunc_entry): Adjust reloc for ELFv2.
2021 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
2022 (glink_eh_frame_fde_64v2): New.
2023 (Stub_table::plt_call_size): Support ELFv2 sizing.
2024 (Output_data_glink::add_eh_frame): Use the new FDE.
2025 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
2026 (Stub_table::do_write): Write ELFv2 stubs and glink.
2027 (Target_powerpc::Relocate::relocate): Replaces nop after call
2028 with ld 2,24(1) and adjust local offset destination for ELFv2.
2029
f9c6b907
AM
20302013-10-30 Alan Modra <amodra@gmail.com>
2031
2032 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
2033 (Target_powerpc::Scan::global, local): Likewise.
2034 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
2035 on all ppc64 @h and @ha relocs.
2036
e84fe78f
AM
20372013-10-14 Alan Modra <amodra@gmail.com>
2038
2039 * output.h (Output_data_got::add_constant): Tidy.
2040 (Output_data_got::add_constant_pair): New function.
2041 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
2042 methods used so as to first call reserve_ent().
2043
679e4abf
RM
20442013-10-11 Roland McGrath <mcgrathr@google.com>
2045
44dcb735
RM
2046 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
2047 add_got_entry and add_got_entry_pair.
2048
13323c49
RM
2049 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
2050 (HAVE_PUBNAMES): Likewise.
2051 * configure: Regenerate.
2052
1496b446
RM
2053 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
2054 * testsuite/Makefile.in: Regenerate.
2055
cc84c10b
RM
2056 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
2057 Remove const from declaration.
2058 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
2059 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
2060 * output.h (Output_file_header): Remove const from member target_
2061 and corresponding constructor argument.
2062 * output.cc (Output_file_header::Output_file_header): Update prototype.
2063 (Output_file_header::do_sized_write): Use this->target_ in place
2064 of parameters()->target().
2065
52f66a2c
RM
2066 * testsuite/undef_symbol.cc (Foo::get_a): New method.
2067
2b64b551
RM
2068 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
2069 * configure: Regenerate.
2070 * Makefile.in: Regenerate.
2071 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
2072 * testsuite/merge_string_literals_2.c: Likewise.
2073 * testsuite/Makefile.am
2074 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
2075 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
2076 literal -fmerge-constants.
2077 * testsuite/Makefile.in: Regenerate.
2078
43819297
RM
2079 * i386.cc (Target_i386): Remove unused member dynbss_.
2080 * arm.cc (Target_arm): Likewise.
2081 * powerpc.cc (Target_powerpc): Likewise.
2082 * sparc.cc (Target_sparc): Likewise.
2083 * tilegx.cc (Target_tilegx): Likewise.
2084 * x86_64.cc (Target_x86_64): Likewise.
2085 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
2086 type_signature_, type_offset_.
2087 * plugin.h (Plugin_hook): Remove unused member layout_.
2088 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
2089 mapfile_.
2090 (Read_member): Remove unused members input_objects_, symtab_,
2091 mapfile_, layout_.
2092 (Check_library): Remove unused member symtab_.
2093 * archive.h (Lib_group): Remove unused member lib_.
2094 * archive.cc (Lib_group::Lib_group): Update initializer.
2095 * incremental.h (Incremental_binary): Remove unused member target_.
2096 (Incremental_script_entry): Removed unused member script_.
2097 * layout.h (Write_symbols_task): Remove unused member input_objects_.
2098 * icf.h (Icf): Remove unused member num_tracked_relocs.
2099
39d9ead7
RM
2100 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
2101 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
2102 its only use.
2103 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
2104
679e4abf
RM
2105 * archive.h: Use struct rather than class for forward declaration
2106 of Read_symbols_data.
2107
54de2ea6
CC
21082013-10-07 Cary Coutant <ccoutant@google.com>
2109
2110 PR gold/16010
2111 * testsuite/Makefile.am (icf_test): Fix dependencies.
2112 (icf_safe_test): Likewise.
2113 (icf_safe_so_test): Likewise.
2114 (large_symbol_alignment): Add empty _LDADD rule.
2115 * testsuite/Makefile.in: Regenerate.
2116
b14016f0
L
21172013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
2118
2119 PR gold/15927
2120 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
2121 relocation for R_X86_64_32 on x32.
2122
eb426534
RM
21232013-08-27 Roland McGrath <mcgrathr@google.com>
2124
2125 * output.cc (Output_segment::set_section_addresses): Take new
2126 Target* argument. If target->isolate_execinstr() and the segment
2127 is executable and starts at a target->abi_pagesize() boundary,
2128 pad its end out to a target->abi_pagesize() boundary with code fill.
2129 * output.h (Output_segment::set_section_addresses): Update decl.
2130 * layout.h (Layout::check_output_data_for_reset_values): Take new
2131 argument RELAX_OUTPUTS.
2132 (Layout): New member relax_output_list_.
2133 (Layout::add_relax_output): New method.
2134 * layout.cc (Layout::Layout): Update constructor.
2135 (Layout::reset_relax_output): New method.
2136 (Layout::clean_up_after_relaxation): Call it.
2137 (Layout::prepare_for_relaxation): Update caller.
2138 (Layout::set_segment_offsets): Update callers of set_section_addresses.
2139 Call reset_relax_output before re-processing segments for
2140 isolate_execinstr case.
2141 (Layout::write_data): Handle relax_output_list_.
2142 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
2143 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
2144
9aff4b7a
NC
21452013-08-23 Yuri Chornoivan <yurchor@ukr.net>
2146
2147 PR binutils/15834
2148 * object.h: Fix typos.
2149
93f8221c
RM
21502013-08-16 Roland McGrath <mcgrathr@google.com>
2151
2152 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
2153 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
2154
e44c3715
CC
21552013-08-07 Cary Coutant <ccoutant@google.com>
2156
2157 Revert support for v2 DWP files:
2158
2159 2013-03-01 Cary Coutant <ccoutant@google.com>
2160
2161 Add dwp support for v2 DWARF package file format.
2162 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2163 tu_length parameter. Adjust all callers.
2164 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2165 * dwp.cc: Include dwarf.h.
2166 (Section_bounds): New struct type.
2167 (Unit_set): New struct type.
2168 (Dwo_file::Dwo_file): Initialize new data member.
2169 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2170 Combine and rename to...
2171 (Dwo_file::read_unit_index): ...this.
2172 (Dwo_file::sized_read_compunit_index)
2173 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2174 (Dwo_file::sized_read_unit_index): ...this.
2175 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2176 parameters; add section_id parameter.
2177 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2178 (Dwo_file::add_unit_set): ...this.
2179 (Dwo_file::shndx_map_): Remove.
2180 (Dwo_file::sect_offsets_): New data member.
2181 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2182 (Dwp_output_file::add_section): Rename to...
2183 (Dwp_output_file::add_contribution): ...this.
2184 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2185 (Dwp_output_file::add_tu_set): Likewise.
2186 (Dwp_output_file::Contribution): New type.
2187 (Dwp_output_file::Section::contributions): New data member.
2188 (Dwp_output_file::Cu_or_tu_set): Remove.
2189 (Dwp_output_file::Section::Section): New ctor.
2190 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2191 (Dwp_output_file::Dwp_index::Section_table): New type.
2192 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2193 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2194 parameter.
2195 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2196 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2197 (Dwp_output_file::Dwp_index::section_table): New member function.
2198 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2199 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2200 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2201 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2202 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2203 (Dwp_output_file::Dwp_index::section_table_): New data member.
2204 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2205 (Dwp_output_file::add_output_section): New member function.
2206 (Dwp_output_file::write_new_section): New member function.
2207 (Dwp_output_file::write_contributions): New member function.
2208 (Dwp_output_file::section_id_map_): New data member.
2209 (class Dwo_id_info_reader): Remove.
2210 (class Unit_reader): New class.
2211 (get_dwarf_section_name): New function.
2212 (Dwo_file::read_executable): Adjust initializations of class data.
2213 (Dwo_file::read): Add support for v2 package file format.
2214 (Dwo_file::read_unit_index): Likewise.
2215 (Dwo_file::sized_read_unit_index): Likewise.
2216 (Dwo_file::copy_section): Likewise.
2217 (Dwo_file::add_unit_set): Likewise.
2218 (Dwp_output_file::add_output_section): Likewise.
2219 (Dwp_output_file::add_contribution): Likewise.
2220 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2221 for empty slot.
2222 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2223 file format.
2224 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2225 slot.
2226 (Dwp_output_file::initialize): Remove unused function.
2227 (Dwp_output_file::finalize): Add support for v2 package file format.
2228 (Dwp_output_file::write_index): Likewise.
2229 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2230 function prototype.
2231
c6905c28
CC
22322013-07-31 Cary Coutant <ccoutant@google.com>
2233
2234 * object.cc (Sized_relobj::do_output_section_address): New function.
2235 (Sized_relobj): Instantiate explicitly.
2236 * object.h (Object::output_section_address): New function.
2237 (Object::do_output_section_address): New function.
2238 (Sized_relobj::do_output_section_address): New function.
2239 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
2240
22412013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 2242 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
2243
2244 * parameters.cc (Parameters::entry): Return target-specific entry
2245 symbol name.
2246 * target.h (Target::entry_symbol_name): New function.
2247 (Target_info::entry_symbol_name): New data member.
2248
2249 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
2250 * i386.cc (Target_i386::i386_info): Likewise.
2251 (Target_i386_nacl::i386_nacl_info): Likewise.
2252 * sparc.cc (Target_sparc::sparc_info): Likewise.
2253 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
2254 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
2255 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
2256 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2257
234d4ab8
SA
22582013-07-22 Sterling Augustine <saugustine@google.com>
2259
2260 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
2261 Convert parameter shndx to local variable. Add parameters symtab
2262 and symtab_size. Scan over section names. Find relocation
2263 section corresponding to current section. Create and initialize
2264 reloc_mapper_ and reloc_type_.
2265 (Dwarf_pubnames_table::read_header): Add assertion. Change
2266 unit_length to off_t. Initialize member unit_length_. Fill in field
2267 cu_offset_.
2268 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2269 Initialize new fields unit_length_ and cu_offset_.
2270 (Dwarf_pubnames_table::read_section): Update prototype.
2271 (Dwarf_pubnames_table::cu_offset): New member function.
2272 (Dwarf_pubnames_table::subsection_size): Likewise.
2273 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
2274 New fields.
2275 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
2276 member functions public.
2277 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
2278 Update comment. Rework logic. Move repeated parts to...
2279 (Gdb_index_info_reader::read_pubtable): ...here. New function.
2280 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
2281 pubtypes_table_, and stmt_list_offset.
2282 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2283 Gdb_index::find_pubtype_offset,
2284 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
2285 (Gdb_index::pubnames_read): Update prototype and rework logic.
2286 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
2287 Forward declare.
2288 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2289 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
2290 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
2291 Gdb_index::map_pubtable_to_dies):
2292 Declare functions.
2293 (Gdb_index::pubnames_read): Update declaration.
2294 (Gdb_index::Pubname_offset_map): New type.
2295 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
2296 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
2297 Gdb_index::stmt_list_offset): Declare.
2298 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
2299 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
2300 Gdb_index::pubtypes_offset_): Remove.
2301
a3ed37d8
RM
23022013-07-19 Roland McGrath <mcgrathr@google.com>
2303
2304 * options.h (General_options): Add -Trodata-segment option.
2305 * parameters.cc (Parameters::check_rodata_segment): New function.
2306 (Parameters::set_target_once): Call it.
2307 * parameters.h (Parameters): Declare it (private member function).
2308 * layout.cc (load_seg_unusable_for_headers): New function, broken
2309 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
2310 then validate rodata segment rather than text segment.
2311 (relaxation_loop_body): Call that.
2312 (is_text_segment): New function. Don't admit a non-executable
2313 segment if TARGET->isolate_execinstr().
2314 (set_segment_offsets): Call it. Honor -Trodata-segment option.
2315
eb5b4ded
CC
23162013-07-15 Shawn Landden <shawnlandden@gmail.com>
2317
2318 PR gold/15070
2319 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
2320 * nacl.h (Sniff_file::View::View): Request aligned view.
2321
4d5effb9
CC
23222013-07-11 Cary Coutant <ccoutant@google.com>
2323
2324 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
2325 correct BRLT entry size.
2326
ba8ca3e7
AM
23272013-07-03 Alan Modra <amodra@gmail.com>
2328
2329 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
2330 comment.
2331
267257d2
CC
23322013-07-01 Cary Coutant <ccoutant@google.com>
2333
2334 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
2335 reloc_type_.
2336 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
2337 (Dwarf_ranges_table::lookup_reloc): New function.
2338 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
2339 reloc_type_.
2340 (Dwarf_ranges_table::lookup_reloc): New function.
2341 (Dwarf_ranges_table::reloc_type_): New data member.
2342
06f30c9d
CC
23432013-06-27 Jing Yu <jingyu@google.com>
2344
2345 PR gold/15662
2346 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
2347 function.
2348 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
2349 (Target_powerpc::do_relax): Call the above.
2350
a2d7bf59
AM
23512013-06-27 Cary Coutant <ccoutant@google.com>
2352
2353 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
2354 on garbage collected .opd section.
2355
23562013-06-27 Alan Modra <amodra@gmail.com>
2357
2358 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
2359 is non-zero.
2360 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
2361 (Target_powerpc::do_function_location): Likewise for loc->shndx.
2362
32364e50
CC
23632013-06-14 Cary Coutant <ccoutant@google.com>
2364
2365 * resolve.cc (Symbol::override_base): Don't override st_type
2366 from plugin placeholder symbols.
2367 (Symbol_table::resolve): Likewise.
2368 (Symbol_table::should_override): Don't complain about TLS mismatch
2369 if the TO symbol is a plugin placeholder.
2370 * testsuite/Makefile.am (plugin_test_tls): New test.
2371 * testsuite/Makefile.in: Regenerate.
2372 * testsuite/plugin_test_tls.sh: New test script.
2373 * testsuite/two_file_test_2_tls.cc: New test source.
2374 * testsuite/two_file_test_tls.cc: New test source.
2375
7fb47cc9
CC
23762013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
2377
2378 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
2379 the maximum segment alignment is larger than the page size.
2380 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
2381 correctly aligns the symbols with large alignemnt.
2382 * testsuite/Makefile.in: Regenerate.
2383 * testsuite/large_symbol_alignment.cc: New file.
2384
6934001a
CC
23852013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
2386 Sriraman Tallam <tmsriram@google.com>
2387
2388 * options.h (sort_section): New option.
2389 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
2390 Rename from Input_section_sort_section_name_special_ordering_compare.
2391 (Input_section_sort_section_name_compare): New struct.
2392 * output.cc (Output_section::Input_section_sort_section_name_compare::
2393 operator()): New function.
2394 (Output_section::sort_attached_input_sections): Use new sort function
2395 for .text if --sort-section=name is specified.
2396 * layout.cc (Layout::make_output_section):
2397 Add sorting by name when --sort-section=name is specified.
2398 * testsuite/Makefile.am (text_section_grouping): Test option
2399 --sort-section=name.
2400 * testsuite/Makefile.in: Regenerate.
2401 * testsuite/section_sorting_name.cc: New file.
2402 * testsuite/section_sorting_name.sh: New file.
2403
93acabad
CC
24042013-05-21 Cary Coutant <ccoutant@google.com>
2405
2406 * symtab.h (Symbol::is_cxx_vtable): New function.
2407 * target-reloc.h (relocate_section): Check for vtable symbol.
2408 * testsuite/Makefile.am (missing_key_func.sh): New test case.
2409 * testsuite/Makefile.in: Regenerate.
2410 * testsuite/missing_key_func.cc: New test source.
2411 * testsuite/missing_key_func.sh: New test script.
2412
60e8b3fc
CC
24132013-05-21 Cary Coutant <ccoutant@google.com>
2414
2b64b551
RM
2415 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
2416 type of enclosing symbol.
2417 (Relocate_info::location): Check symbol type when describing symbol.
2418 * object.h (Symbol_location_info): Remove unused line_number;
2419 add enclosing_symbol_type.
2420 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 2421
9df9de2c
CC
24222013-05-13 Cary Coutant <ccoutant@google.com>
2423
2b64b551
RM
2424 * configure.ac: Export DEFAULT_TARGET.
2425 * configure: Regenerate.
2426 * Makefile.in: Regenerate.
2427 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
2428 * testsuite/Makefile.in: Regenerate.
2429 * testsuite/debug_msg.sh: Delete duplicate tests.
2430 Don't check undef_int error message match for powerpc where the
2431 source file and line number aren't available.
9df9de2c 2432
bbc5ae17
RM
24332013-05-10 Roland McGrath <mcgrathr@google.com>
2434
2435 * options.h (General_options): Add --rosegment-gap option.
2436 * options.cc (finalize): --rosegment-gap implies --rosegment.
2437 * layout.cc (set_segment_offsets): Let user option override
2438 target->rosegment_gap().
2439
0c6e6c39
RM
24402013-05-10 Roland McGrath <mcgrathr@google.com>
2441
2442 * options.h (General_options): Remove leading space from help
2443 messages for -nostdlib and --rosegment.
2444
cde7cb01
MR
24452013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
2446
2447 PR ld/15365
2448 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
2449
f31ae5b8
AM
24502013-05-03 Alan Modra <amodra@gmail.com>
2451
2452 * merge.cc (Output_merge_string::do_add_input_section): Correct
2453 scan for number of strings. Rename vars to avoid shadowing.
2454 Include missing terminator in input_size_.
2455
d3a7cd45
L
24562013-05-01 H.J. Lu <hongjiu.lu@intel.com>
2457
2458 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
2459 Restore empty string handling.
2460
6ad3daba
CC
24612013-05-01 Cary Coutant <ccoutant@google.com>
2462
2463 * stringpool.cc (Stringpool_template::new_key_offset): Fix
2464 uninitialized warning.
2465
e31908b6
CC
24662013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
2467
2468 * output.cc (Output_section::add_merge_input_section): Allow
2469 to merge sections if the alignment is more than character size.
2470 * merge.h (Output_merge_string::Output_merge_string): Remove
2471 assert.
2472 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
2473 only not-null strings. Check the alignment of strings.
2474 * stringpool.h
2475 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
2476 alignment as the argument.
2477 (Stringpool_template<Stringpool_char>::addralign_): New class member.
2478 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
2479 Align non-zero length strings according to the addralign_.
2480 (Stringpool_template<Stringpool_char>::set_string_offsets):
2481 Updating offsets according to the given alignment.
2482 * testsuite/Makefile.am (text_section_grouping): Test if string
2483 literals are getting merged.
2484 * testsuite/Makefile.in: Regenerate.
2485 * testsuite/merge_string_literals_1.c: New file.
2486 * testsuite/merge_string_literals_2.c: Ditto.
2487 * testsuite/merge_string_literals.sh: Ditto.
2488
0e804863
ILT
24892013-04-26 Ian Lance Taylor <iant@google.com>
2490
2491 * target-reloc.h (relocate_section): If the reloc offset is out of
2492 range, pass VIEW as NULL to relocate.relocate.
2493 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
2494 * i386.cc (Target_i386::Relocate::relocate): Likewise.
2495 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
2496 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
2497 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
2498 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
2499
e7c5ea40
CC
25002013-04-26 Geoff Pike <gpike@chromium.org>
2501
2502 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
2503 * layout.cc (Hash_task): New class.
2504 (Layout::queue_build_id_tasks): New function.
2505 (Layout::write_build_id): Handle single-thread portion of build ID
2506 computation. (In some cases, all of it is single-threaded.) Replace
2507 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
2508 functionality in fewer lines of code.
2509 * layout.h (Layout::queue_build_id_tasks): New function declaration.
2510 * options.h (General_options): make "--build-id" default to tree
2511 rather than sha1. Add two new options related to --build-id=tree:
2512 --build-id-chunk-size-for-treehash and
2513 --build-id-min-file-size-for-treehash.
2514 * Makefile.am: add testing of --build-id=tree and related new options
2515 (these tests will be invoked by "make check").
2516 * Makefile.in: Regenerate.
2517
49926cd0
AM
25182013-04-25 Alan Modra <amodra@gmail.com>
2519
2520 * configure.tgt: Add powerpcle and powerpc64le.
2521
a4034750
AM
25222013-04-22 Alan Modra <amodra@gmail.com>
2523
2524 PR gold/15355
2525 * layout.cc (Layout::segment_precedes): Allow more than one
2526 segment with the same type and flags.
2527
e79c84aa
CC
25282013-04-15 Cary Coutant <ccoutant@google.com>
2529
2530 * layout.cc (Layout::set_relocatable_section_offsets): Don't
2531 allocate space in file for BSS sections.
2532
2199fbe7
CC
25332013-04-15 Cary Coutant <ccoutant@google.com>
2534
2535 * script-sections.cc (Orphan_output_section): Reset address
2536 to zero after each orphaned section for relocatable links.
2537
502e8a84
CC
25382013-04-15 Cary Coutant <ccoutant@google.com>
2539
a4034750
AM
2540 * symtab.cc (Symbol_table::sized_write_globals): Subtract
2541 section starting address for relocatable link.
2542 * testsuite/Makefile.am (script_test_11): New test.
2543 * testsuite/Makefile.in: Regenerate.
2544 * testsuite/script_test_11.c: New source file.
2545 * testsuite/script_test_11.t: New linker script.
502e8a84 2546
0cfdc767
AM
25472013-04-13 Alan Modra <amodra@gmail.com>
2548
2549 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
2550 owner when sections are not adjacent and exceed group size.
2551 (Target_powerpc::group_sections): Handle corner case.
2552 (Target_powerpc::Branch_info::make_stub): Handle case where
2553 stub table doesn't exist due to branches in non-exec sections.
2554 (Target_powerpc::Relocate::relocate): Likewise.
2555
6830ee24
AM
25562013-04-11 Alan Modra <amodra@gmail.com>
2557
2558 PR gold/15354
2559 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
2560 .branch_lt to match bfd ld. Adjust comments throughout file.
2561
54a3d865
ILT
25622013-04-04 Ian Lance Taylor <iant@google.com>
2563
2564 GCC PR c++/56840
2565 * object.cc (do_layout_deferred_sections): Handle .eh_frame
2566 sections before checking whether they are included in the link.
2567
9993ba11
ST
25682013-03-29 Sriraman Tallam <tmsriram@google.com>
2569
2570 * archive.cc (Archive::get_elf_object_for_member): Create the elf
2571 object before calling the plugin claim_file handler. Pass the elf
2572 object of the archive to the plugin. Delete the elf object if the
2573 plugin claims the file.
2574
ebacd51e
AM
25752013-03-21 Alan Modra <amodra@gmail.com>
2576
2577 * layout.cc (Layout::set_segment_offsets): Accept writable .text
2578 segment when omagic.
2579
117be58f
AM
25802013-03-21 Alan Modra <amodra@gmail.com>
2581
2582 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
2583 comparison warning.
2584 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
2585 uninitialized" warning.
2586
32e2b61d
AM
25872013-03-20 Alan Modra <amodra@gmail.com>
2588
2589 * symtab.h (Symbol::clear_version): New function.
2590 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
2591 is_needed by weak references. Clear version for symbols defined
2592 in as-needed objects that are not needed.
2593
b3ccdeb5
AM
25942013-03-15 Alan Modra <amodra@gmail.com>
2595
2596 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
2597 static and public. Add report_err param. Return false for data refs.
2598 (Target_powerpc::rela_dyn_section): New overloaded function.
2599 (Target_powerpc::plt_, iplt_): Elucidate.
2600 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
2601 (Output_data_plt_powerpc::do_write): Don't write .iplt.
2602 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
2603 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
2604 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
2605 push_branch and make_plt_entry for ifunc syms when
2606 reloc_needs_plt_for_ifunc.
2607 (Target_powerpc::Relocate::relocate): Don't use plt entry value
2608 for ifunc unless reloc_needs_plt_for_ifunc.
2609
ad3d8a2f
AM
26102013-03-15 Alan Modra <amodra@gmail.com>
2611
2612 * gc.h (gc_process_relocs): Don't look through function descriptors.
2613 * icf.cc (get_section_contents): Do so here instead.
2614
4d9aa155
AM
26152013-03-13 Alan Modra <amodra@gmail.com>
2616
2617 * powerpc.cc (is_branch_reloc): Forward declare.
2618 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
2619 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
2620 false for 64-bit, true for 32-bit non-branch relocs.
2621 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
2622 * testsuite/Makefile.am (icf_test): Use linker map file instead of
2623 nm output.
2624 (icf_safe_test): Generate linker map file as well as nm output.
2625 (icf_safe_so_test): Likewise.
2626 * testsuite/Makefile.in: Regenerate.
2627 * testsuite/icf_test.sh: Parse linker map file to determine
2628 section folding.
2629 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
2630 * testsuite/icf_safe_so_test.sh: Likewise.
2631 (X86_32_or_ARM_specific_safe_fold): Merge into..
2632 (arch_specific_safe_fold): ..this.
2633 (X86_64_specific_safe_fold): Delete unused function.
2634
57420c20
AM
26352013-03-12 Alan Modra <amodra@gmail.com>
2636
2637 * gc.h (gc_process_relocs): Look through function descriptors
2638 to determine shndx, symvalue and addend used by ICF. Tidy
2639 variable duplication.
2640
dc3714f3
AM
26412013-03-11 Alan Modra <amodra@gmail.com>
2642
2643 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
2644 * layout.cc (Layout_task_runner::run): ..to here.
2645 * symtab.h (struct Symbol_location): Extract from..
2646 (class Symbol_table): ..here.
2647 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
2648 * target.h (class Target): Add function_location and
2649 do_function_location functions.
2650 (class Sized_target): Add do_function_location.
2651 * object.h (class Sized_relobj_file): Move find_shdr..
2652 (class Object): ..to here.
2653 * object.cc: Likewise. Update to suit. Instantiate.
2654 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
2655 * powerpc.cc (class Powerpc_dynobj): New.
2656 (Target_powerpc::do_function_location): New function.
2657 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
2658 (Powerpc_dynobj::do_read_symbols): New function.
2659 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
2660
956b03bb
ILT
26612013-03-08 Ian Lance Taylor <iant@google.com>
2662
2663 * options.cc (General_options::string_to_object_format): Accept
2664 "default".
2665
4bead2d5
AM
26662013-03-08 Alan Modra <amodra@gmail.com>
2667
2668 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
2669 pointer to Post_fde.
2670 (struct Post_fde): Move definition to here..
2671 * ehframe.cc (struct Post_fde): ..from here.
2672 (Cie::write): Don't alloc Post_fde.
2673 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
2674
02e60bf7
AM
26752013-03-07 Alan Modra <amodra@gmail.com>
2676
2677 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
2678 relocation referencing .LC0.
2679 * testsuite/discard_locals_test.sh: Remove FIXMEs.
2680
8343f03a
AM
26812013-03-07 Alan Modra <amodra@gmail.com>
2682
2683 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
2684 always_inline. Add assembly for powerpc to avoid GOT.
2685
3366d57c
AM
26862013-03-07 Alan Modra <amodra@gmail.com>
2687
2688 * testsuite/script_test_10.sh: Don't test .bss section
2689 header number.
2690
6c77229c
AM
26912013-03-06 Alan Modra <amodra@gmail.com>
2692
2693 * powerpc.cc (class Powerpc_relobj): Move some member functions.
2694 (Target_powerpc::symval_for_branch): Add symtab param. Update
2695 all callers. Handle folded sections.
2696 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
2697 to Powerpc_relobj.
2698 (Global_symbol_visitor_opd::operator()): Likewise.
2699
a39e4af6
AM
27002013-03-04 Alan Modra <amodra@gmail.com>
2701
2702 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
2703 * testsuite/Makefile.in: Regenerate.
2704
d5834edb
CC
27052013-03-01 Cary Coutant <ccoutant@google.com>
2706
2707 Add dwp support for v2 DWARF package file format.
2708 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2709 tu_length parameter. Adjust all callers.
2710 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2711 * dwp.cc: Include dwarf.h.
2712 (Section_bounds): New struct type.
2713 (Unit_set): New struct type.
2714 (Dwo_file::Dwo_file): Initialize new data member.
2715 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2716 Combine and rename to...
2717 (Dwo_file::read_unit_index): ...this.
2718 (Dwo_file::sized_read_compunit_index)
2719 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2720 (Dwo_file::sized_read_unit_index): ...this.
2721 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2722 parameters; add section_id parameter.
2723 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2724 (Dwo_file::add_unit_set): ...this.
2725 (Dwo_file::shndx_map_): Remove.
2726 (Dwo_file::sect_offsets_): New data member.
2727 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2728 (Dwp_output_file::add_section): Rename to...
2729 (Dwp_output_file::add_contribution): ...this.
2730 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2731 (Dwp_output_file::add_tu_set): Likewise.
2732 (Dwp_output_file::Contribution): New type.
2733 (Dwp_output_file::Section::contributions): New data member.
2734 (Dwp_output_file::Cu_or_tu_set): Remove.
2735 (Dwp_output_file::Section::Section): New ctor.
2736 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2737 (Dwp_output_file::Dwp_index::Section_table): New type.
2738 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2739 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2740 parameter.
2741 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2742 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2743 (Dwp_output_file::Dwp_index::section_table): New member function.
2744 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2745 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2746 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2747 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2748 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2749 (Dwp_output_file::Dwp_index::section_table_): New data member.
2750 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2751 (Dwp_output_file::add_output_section): New member function.
2752 (Dwp_output_file::write_new_section): New member function.
2753 (Dwp_output_file::write_contributions): New member function.
2754 (Dwp_output_file::section_id_map_): New data member.
2755 (class Dwo_id_info_reader): Remove.
2756 (class Unit_reader): New class.
2757 (get_dwarf_section_name): New function.
2758 (Dwo_file::read_executable): Adjust initializations of class data.
2759 (Dwo_file::read): Add support for v2 package file format.
2760 (Dwo_file::read_unit_index): Likewise.
2761 (Dwo_file::sized_read_unit_index): Likewise.
2762 (Dwo_file::copy_section): Likewise.
2763 (Dwo_file::add_unit_set): Likewise.
2764 (Dwp_output_file::add_output_section): Likewise.
2765 (Dwp_output_file::add_contribution): Likewise.
2766 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2767 for empty slot.
2768 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2769 file format.
2770 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2771 slot.
2772 (Dwp_output_file::initialize): Remove unused function.
2773 (Dwp_output_file::finalize): Add support for v2 package file format.
2774 (Dwp_output_file::write_index): Likewise.
2775 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2776 function prototype.
2777
a68a081d
CC
27782013-03-01 Cary Coutant <ccoutant@google.com>
2779
2780 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
2781 function into class definition in header file.
2782 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
2783 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
2784 New function.
2785 (Dwarf_info_reader::check_buffer): Move here from .cc file.
2786
9d5781f8
AM
27872013-02-28 Alan Modra <amodra@gmail.com>
2788
2789 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
2790 * target.cc (Target::do_plt_fde_location): New function.
2791 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
2792 accessor function, and constructor param.
2793 (struct Post_fde, Post_fdes): Declare.
2794 (Cie::write): Add post_fdes param.
2795 * ehframe.cc (Fde::write): Use plt_fde_location.
2796 (struct Post_fde): Define.
2797 (Cie::write): Stash FDEs added post merge mapping.
2798 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
2799 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
2800 (Eh_frame::do_sized_write): Arrange to write post map FDES after
2801 other FDEs.
2802 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
2803 (Target_powerpc::has_glink): New function.
2804 (Target_powerpc::do_relax): Add eh_frame info for stubs.
2805 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
2806 glink_eh_frame_fde_32, default_fde): New data.
2807 (Stub_table::eh_frame_added_): New var.
2808 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
2809 Make const.
2810 (Stub_table::add_eh_frame): New function.
2811 (Output_data_glink::add_eh_frame): New function.
2812 (Target_powerpc::make_glink_section): Call add_eh_frame.
2813
214383dd
ILT
28142013-02-15 Ian Lance Taylor <iant@google.com>
2815
2816 * options.h (DEFINE_uint64_alias): Define.
2817 (class General_options): Add -Ttext-segment as an alias for
2818 -Ttext.
2819
91c2b899
AM
28202013-02-15 Alan Modra <amodra@gmail.com>
2821
2822 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
2823 (Stub_table::do_write): ..here, two places.
2824 (Stub_table::plt_call_size): Use it here too.
2825
20e2a8aa
ILT
28262013-02-11 Ian Lance Taylor <iant@google.com>
2827
2828 * descriptors.cc (Descriptors::close_all): New function.
2829 * descriptors.h (class Descriptors): Declare close_all.
2830 (close_all_descriptors): New inline function.
2831 * plugin.cc: Include "descriptors.h".
2832 (Plugin_manager::cleanup): Call close_all_descriptors.
2833
8952bc69
AM
28342013-02-06 Alan Modra <amodra@gmail.com>
2835
2836 * README: Update coding style link.
2837
29bd8b6b
CC
28382013-01-28 Cary Coutant <ccoutant@google.com>
2839
a4034750
AM
2840 * dwp.cc (File_list): New typedef.
2841 (Dwo_name_info_reader): New class.
2842 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
2843 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
2844 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
2845 (Dwo_file::read_executable): New function.
2846 (Dwo_file::read): Move common setup code to ...
2847 (Dwo_file::make_object): ... here.
2848 (dwp_options): Add --exec/-e.
2849 (usage): Likewise.
2850 (main): Likewise.
29bd8b6b 2851
c6ac678d
ST
28522013-01-24 Sriraman Tallam <tmsriram@google.com>
2853
2854 * layout.cc (Layout::layout): Check for option text_reorder.
2855 (Layout::make_output_section): Ditto.
2856 * options.h (text_reorder): New option.
2857 * output.cc (Input_section_sort_compare): Remove special ordering
2858 of section names.
2859 (Output_section::
2860 Input_section_sort_section_name_special_ordering_compare::
2861 operator()): New function.
2862 (Output_section::sort_attached_input_sections): Use new sort function
2863 for .text.
2864 * output.h (Input_section_sort_section_name_special_ordering_compare):
2865 New struct.
2866 * testsuite/Makefile.am (text_section_grouping): Test option
2867 --no-text-reorder
2868 * testsuite/Makefile.in: Regenerate.
2869 * testsuite/text_section_grouping.sh: Check order of functions without
2870 default text reordering.
2871
50701cc1
MF
28722013-01-18 Mike Frysinger <vapier@gentoo.org>
2873
2874 * options.h (General_options): Change default to true for new_dtags.
2875
b1b00fcc
MF
28762013-01-18 Mike Frysinger <vapier@gentoo.org>
2877
2878 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
2879 when enable_new_dtags is false. Only add DT_RUNPATH when
2880 enable_new_dtags is true.
2881
ec5b8187
AM
28822013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
2883
2884 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
2885 used in declaration and definition consistent.
2886 (Target_powerpc::symval_for_branch): Ditto.
2887
a880d4c4
ST
28882013-01-16 Sriraman Tallam <tmsriram@google.com>
2889
2890 * testsuite/plugin_final_layout.cc: Fix comment.
2891
7c381248
ST
28922013-01-16 Sriraman Tallam <tmsriram@google.com>
2893
2894 * layout.cc (Layout::layout): Do not do default sorting for
2895 text sections when section ordering is specified.
2896 (make_output_section): Ditto.
2897 * testsuite/plugin_final_layout.cc: Name the function sections
2898 to catch reordering issues.
2899
e2458743
AM
29002013-01-15 Alan Modra <amodra@gmail.com>
2901
2902 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
2903 plt-thread-safe.
2904
431ed302
AM
29052013-01-15 Alan Modra <amodra@gmail.com>
2906
2907 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
2908 * testsuite/Makefile.in: Regenerate.
2909
0ec6429b
AM
29102013-01-14 Alan Modra <amodra@gmail.com>
2911
2912 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
2913 * testsuite/Makefile.in: Regenerate.
2914
0bf402d5
ILT
29152013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
2916
36af3926 2917 PR bfd/14430
0bf402d5
ILT
2918 Fix mingw gold build with plugins enabled
2919 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
2920 * configure.ac: Export DLOPEN_LIBS and add headers check.
2921 * plugin.cc: Handle non-dlfcn case.
2922 * Makefile.in: Regenerate.
2923 * config.in: Regenerate.
2924 * configure: Regenerate.
2925 * testsuite/Makefile.in: Regenerate.
2926
9e9143bc
ST
29272013-01-09 Sriraman Tallam <tmsriram@google.com>
2928
2929 * output.h (sort_attached_input_sections): Change to be public.
2930 * script-sections.cc
2931 (Output_section_definition::set_section_addresses): Sort
2932 attached input sections according to section order before linker
2933 script assigns section addresses.
2934 (Orphan_output_section::set_section_addresses): Sort
2935 attached input sections according to section order before linker
2936 script assigns section addresses.
2937 * Makefile.am (final_layout.sh): Use a simple linker script to
2938 check if section ordering still works.
2939 * Makefile.in: Regenerate.
2940
679af368
ILT
29412013-01-09 Ben Cheng <bccheng@google.com>
2942
2943 * arm.cc (Target_arm::attributes_accept_div): New function.
2944 (Target_arm::attributes_forbid_div): New function.
2945 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
2946 attribute using the same new functions as what bfd/elf32_arm.c
2947 does.
2948
3136a00e
CC
29492013-01-07 Cary Coutant <ccoutant@google.com>
2950
2951 PR gold/14993
2952 * output.cc (Output_section::add_input_section): For incremental
2953 updates, don't track input sections that are allocated from patch
2954 space.
2955
f2a6224b
L
29562013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2957 Ian Lance Taylor <iant@google.com>
2958
2959 PR gold/14897
2960 * configure.ac (--enable-ld): Removed.
2961 (install_as_default): Set to yes only for --enable-gold=default
2962 or --disable-ld.
2963 * configure: Regenerated.
2964
4f46f626
L
29652013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2966
2967 * options.h (General_options): Add -fuse-ld= for GCC linker
2968 option compatibility.
2969
26e4ef59
CC
29702013-01-04 Cary Coutant <ccoutant@google.com>
2971
2972 * configure.ac: Fix typo restoring CXXFLAGS.
2973 * configure: Regenerate.
2974
3d587466
CC
29752013-01-04 Cary Coutant <ccoutant@google.com>
2976
4f46f626
L
2977 * testsuite/Makefile.am (CXXLINK_S): New macro.
2978 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
2979 * testsuite/Makefile.in: Regenerate.
3d587466 2980
44db6695
L
29812013-01-02 H.J. Lu <hongjiu.lu@intel.com>
2982
2983 * version.cc (print_version): Update copyright year to 2013.
2984
edcac0c1
ILT
29852012-12-20 Ian Lance Taylor <iant@google.com>
2986
2987 * layout.cc (Layout::special_ordering_of_input_section): New
2988 function.
2989 (Layout::layout): If input section requires special ordering, must
2990 sort input sections.
2991 (Layout::make_output_section): May sort .text input sections.
2992 (Layout::is_section_name_prefix_grouped): Remove.
2993 * layout.h (class Layout): Declare
2994 special_ordering_of_input_section. Don't declare
2995 is_section_name_prefix_grouped.
2996 * output.cc (Output_section::add_input_section): Revert last
2997 change.
2998 (Output_section::Input_section_sort::match_file_name): Don't crash
2999 if called on output section data.
3000 (Output_section::Input_section_sort_compare): Sort based on
3001 special ordering.
3002 (Output_section::Input_section_sort_section_order_index_compare):
3003 Revert last patch.
3004 (Output_section::sort_attached_input_sections): Likewise.
3005
28f2a4ac
ST
30062012-12-18 Sriraman Tallam <tmsriram@google.com>
3007
edcac0c1 3008 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
3009 * layout.h (Layout::is_section_name_prefix_grouped): New function.
3010 * output.cc (Output_section::add_input_section): Check if section
3011 name contains special prefix. Keep input sections to sort such
3012 sections.
3013 (Output_section::Input_section_sort_section_order_index_compare
3014 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
3015 (Output_section::sort_attached_input_sections): Add condition to
3016 Input_section_entry constructor call.
28f2a4ac
ST
3017 * testsuite/Makefile.am (text_section_grouping): New test.
3018 * testsuite/Makefile.in: Regenerate.
3019 * testsuite/text_section_grouping.cc: New file.
3020 * testsuite/text_section_grouping.sh: New file.
3021
5bf135a7
NC
30222012-12-17 Nick Clifton <nickc@redhat.com>
3023
3024 * Makefile.am: Add copyright notice.
3025 * NEWS: Likewise.
3026 * README: Likewise.
3027 * configure.ac: Likewise.
3028 * ftruncate.c: Likewise.
3029 * Makefile.in: Regenerate.
3030
59965708
CC
30312012-12-14 Cary Coutant <ccoutant@google.com>
3032
a4034750
AM
3033 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
3034 --no-as-needed flag.
3035 (exception_separate_shared_12_test): Likewise.
3036 (incremental_copy_test): Likewise.
3037 * testsuite/Makefile.in: Regenerate.
59965708 3038
2a77e2ab
CC
30392012-12-14 Cary Coutant <ccoutant@google.com>
3040
3041 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
3042 (Dwp_output_file::Dwp_index::enter_set): Add assert.
3043
e3deeb9c
AM
30442012-12-12 Alan Modra <amodra@gmail.com>
3045
3046 * powerpc.cc (class Track_tls): New.
3047 (class Relocate, class Scan): Inherit Track_tls.
3048 (Target_powerpc::Scan::local, global): Track tls optimization
3049 and avoid creating plt entry for __tls_get_addr if all uses
3050 are optimized away.
3051 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
3052
d8f5a274
AM
30532012-12-12 Alan Modra <amodra@gmail.com>
3054
3055 * options.h (General_options): Add --toc-sort/--no-toc-sort.
3056 Replace no_toc_optimize with toc_optimize.
3057 * output.h (Output_section::input_sections): Provide non-const variant.
3058 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
3059 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
3060 accessors.
3061 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
3062 (class Sort_toc_sections): New.
3063 (Target_powerpc::do_finalize_sections): Sort toc sections.
3064 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
3065
4c8a1de1
RM
30662012-12-10 Roland McGrath <mcgrathr@google.com>
3067
3068 * testsuite/binary_unittest.cc (read_all): New function.
3069 (Sized_binary_test): Use it instead of ::read.
3070 * fileread.cc (do_read): Don't assume pread always reads the whole
3071 amount in a single call.
3072
edc27beb
AM
30732012-12-10 Alan Modra <amodra@gmail.com>
3074
3075 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
3076 Set EM_PPC64 or EM_PPC here.
3077 (Target_selector_powerpc::do_recognize): Delete.
3078
906b9150
AM
30792012-12-10 Alan Modra <amodra@gmail.com>
3080
3081 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
3082 stub_table_.
3083 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
3084
418c15ae
RM
30852012-12-07 Roland McGrath <mcgrathr@google.com>
3086
3087 * testsuite/binary_unittest.cc (Sized_binary_test):
3088 Use open_descriptor rather than ::open.
3089
decdd3bc
AM
30902012-12-07 Alan Modra <amodra@gmail.com>
3091
3092 * powerpc.cc (Stub_table::do_write): Delete redundant Address
3093 typedef and invalid_address constant.
3094 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
3095 instantiate constants.
3096
db399005
ILT
30972012-12-06 Roland McGrath <mcgrathr@google.com>
3098
3099 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
3100 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
3101 * aclocal.m4: Regenerate.
3102 * configure: Regenerate.
3103 * Makefile.in: Regenerate.
3104 * testsuite/Makefile.in: Regenerate.
3105
aba6bc71
AM
31062012-12-07 Alan Modra <amodra@gmail.com>
3107
3108 * options.h (General_options): Add no_toc_optimize.
3109 * powerpc.cc (ok_lo_toc_insn): New function.
3110 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
3111
9e69ed50
AM
31122012-12-06 Alan Modra <amodra@gmail.com>
3113
3114 * options.h (General_options): Add plt_align, plt_static_chain,
3115 plt_thread_safe. Update stub_group_size help text.
3116 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
3117 for new plt_thread_safe_ var.
3118 (use_plt_offset): Correct comments.
3119 (Target_powerpc::do_relax): Look for thread creation symbols to
3120 determine default plt_thread_safe value. Clear plt call stubs
3121 as well as branch stubs each iteration.
3122 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
3123 insn constants.
3124 (l, hi, ha, write_insn): Move earlier.
3125 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
3126 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
3127 plt stubs too.
3128 (Stub_table::update_size): Adjust.
3129 (Stub_table::prev_size, set_prev_size): Delete.
3130 (Stub_table::stub_align): Let --plt-align affect result.
3131 (Stub_table::plt_call_size): Calculate sizes for various stubs.
3132 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
3133 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
3134 (Stub_table::do_write): Support more stub variants.
3135
f43ba157
AM
31362012-12-04 Alan Modra <amodra@gmail.com>
3137
3138 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
3139 (Target_powerpc::do_define_standard_symbols): New function.
3140
34171bc5
AM
31412012-12-03 Alan Modra <amodra@gmail.com>
3142
3143 * output.h: Formatting, whitespace.
3144
dc9589e9 31452012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
3146
3147 * layout.h (Layout::get_executable_sections): Declare.
3148 * layout.cc (Layout::get_executable_sections): New function.
3149 * arm.cc (Target_arm::group_sections): Use it.
3150 (Arm_output_section::group_sections): Delete now redundant test.
3151 * output.cc (Output_reloc::Output_reloc): Add is_relative.
3152 param to handle relative relocs.
3153 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
3154 (Output_data_reloc::add_absolute): Adjust.
3155 (Output_data_reloc::add_relative): New function.
3156 (Output_data::reset_data_size): New function.
3157 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
3158 (Output_section::set_addralign): New function.
3159 (Output_section::checkpoint_set_addralign): New function.
3160 (Output_section::clear_section_offsets_need_adjustment): New function.
3161 (Output_section::input_sections): Make public.
3162 * powerpc.cc (class Output_data_brlt_powerpc): New.
3163 (class Stub_table, class Stub_control): New.
3164 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
3165 stub_table_, set_stub_table, stub_table): New vectors and accessor
3166 functions.
3167 (Target_powerpc::do_may_relax, do_relax, push_branch,
3168 new_stub_table, stub_tables, brlt_section, group_sections,
3169 add_branch_lookup_table, find_branch_lookup_table,
3170 write_branch_lookup_table, make_brlt_section): New functions.
3171 (Target_powerpc::struct Sort_sections, class Branch_info): New.
3172 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
3173 branch_info_): New vars.
3174 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
3175 make call stubs here.
3176 (Output_data_glink): Remove all call stub handling from this class.
3177 (Target_powerpc::Scan::local, global): Save interesting branch
3178 relocs and relocs for ifunc. Adjust calls to plt entry functions.
3179 (Target_powerpc::do_finalize_sections): Only make reg save/restore
3180 functions on final link.
3181 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
3182 Handle long branch destinations too.
3183 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
3184 do_plt_address_for_local): Adjust lookup of plt call stubs.
3185
627b30b7
AM
31862012-11-30 Alan Modra <amodra@gmail.com>
3187
3188 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
3189 relocs against protected symbols when building 32-bit shared libs.
3190
40b469d7
AM
31912012-11-30 Alan Modra <amodra@gmail.com>
3192
3193 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
3194 param. Call got_section() to make .got. Update all callers
3195 and their callers and so on.
3196
bb66a627
AM
31972012-11-30 Alan Modra <amodra@gmail.com>
3198
3199 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
3200 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
3201 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
3202 value if it already exists.
3203
d2cf1c6c
L
32042012-11-19 H.J. Lu <hongjiu.lu@intel.com>
3205
3206 PR gold/14858
3207 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
3208
edccdf7c
RM
32092012-11-14 Roland McGrath <mcgrathr@google.com>
3210
3211 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
3212 than bfc instruction for data sandboxing.
3213
6febeb74
AM
32142012-11-08 Alan Modra <amodra@gmail.com>
3215
3216 * po/POTFILES.in: Regenerate.
3217
0a6f1bf2
AM
32182012-11-05 Alan Modra <amodra@gmail.com>
3219
3220 * configure.ac: Apply 2012-09-10 change to config.in here.
3221 * configure: Regenerate.
3222
26a4e9cb
AM
32232012-11-05 Alan Modra <amodra@gmail.com>
3224
3225 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
3226 (struct Opd_ent): Use "Address" rather than "Offset".
3227 (Output_data_got_powerpc::got_base_offset): Return Valtype.
3228 (Target_powerpc::got_section): Make public.
3229 (Target_powerpc::scan_relocs): Move code setting symbols..
3230 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
3231 Create _SDA_BASE_ only when referenced.
3232
cc928013
RM
32332012-11-02 Roland McGrath <mcgrathr@google.com>
3234
3235 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
3236 from last change.
3237
50ed5eb1
RM
32382012-11-01 Roland McGrath <mcgrathr@google.com>
3239
62fe925a
RM
3240 * target.h (Sized_target::relocate_relocs): Use Elf_Off
3241 for offset_in_output_section parameter.
3242 (Sized_target::relocate_special_relocatable): Likewise.
3243 * arm.cc (Target_arm::relocate_relocs): Likewise.
3244 (Target_arm::relocate_special_relocatable): Likewise.
3245 * i386.cc (Target_i386::relocate_relocs): Likewise.
3246 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
3247 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
3248 * target-reloc.h (relocate_relocs): Likewise.
3249 * testsuite/testfile.cc (Target_test): Likewise.
3250 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
3251 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
3252
3253 * system.h: Move inclusion of <clocale> to after <libintl.h> in
3254 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
3255
3256 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
3257 parameter, which is unused in the [!F_SETFD] case.
3258
50ed5eb1
RM
3259 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
3260 SYMNDX to off_t before comparing it to this->data_size().
3261 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
3262 * incremental.cc (Output_section_incremental_inputs::do_write):
3263 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
3264
2cadc0bf
RM
3265 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
3266
3bfcb652
NC
32672012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
3268
3269 * gold.cc (Target_arm::do_adjust_elf_header): Add the
3270 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
3271 in EABI_VER5.
3272
c1a8d56e
CC
32732012-10-29 Cary Coutant <ccoutant@google.com>
3274
3275 * dwp.cc (usage): Add file and exit status parameters;
3276 add --help and --version options.
3277 (print_version): New function.
3278 (main): Add --help and --version options.
3279
b2490a7b
L
32802012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3281
3282 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
3283 final_layout_sequence.txt.
3284 * testsuite/Makefile.in: Regenerated.
3285
aa543512
L
32862012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3287
3288 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
3289 COMPILE generated by automake.
3290 (LINK1): Likewise.
3291 (CXXCOMPILE1): Likewise.
3292 (CXXLINK1): Likewise.
3293 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
3294 (LINK): Likewise.
3295 (CXXCOMPILE): Likewise.
3296 (CXXLINK): Likewise.
3297 * testsuite/Makefile.in: Regenerated.
3298
d361fafb
L
32992012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3300
3301 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
3302 on bad fwrite return.
3303
598c7410
L
33042012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3305
3306 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
3307 on val.
3308
35c813e2
CC
33092012-10-23 Cary Coutant <ccoutant@google.com>
3310
3311 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
3312 * testsuite/Makefile.in: Regenerate.
3313 * testsuite/dwp_test.h: New source file.
3314 * testsuite/dwp_test_1.cc: New source file.
3315 * testsuite/dwp_test_1.s: New source file.
3316 * testsuite/dwp_test_1.sh: New source file.
3317 * testsuite/dwp_test_1b.cc: New source file.
3318 * testsuite/dwp_test_1b.s: New source file.
3319 * testsuite/dwp_test_2.cc: New source file.
3320 * testsuite/dwp_test_2.s: New source file.
3321 * testsuite/dwp_test_2.sh: New source file.
3322 * testsuite/dwp_test_main.cc: New source file.
3323 * testsuite/dwp_test_main.s: New source file.
3324
77429909
CC
33252012-10-23 Cary Coutant <ccoutant@google.com>
3326
3327 * dwp.h: New header file.
3328 * dwp.cc: New source file.
3329 * gold.h: Move shared declarations to system.h.
3330 * system.h: New header file.
3331 * Makefile.am: Add dwp.
3332 * Makefile.in: Regenerate.
3333
ed5d6712
CC
33342012-10-23 Cary Coutant <ccoutant@google.com>
3335
3336 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
3337 Dwarf_info_reader::read_from_pointer.
3338 (Dwarf_pubnames_table::read_header): Likewise.
3339 (Dwarf_pubnames_table::next_name): Likewise.
3340 (Dwarf_die::read_attributes): Likewise.
3341 (Dwarf_die::skip_attributes): Likewise.
3342 (Dwarf_info_reader::read_from_pointer): New function template.
3343 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
3344 (Dwarf_pubnames_table): Likewise.
3345 (Dwarf_info_reader::read_from_pointer): New function template.
3346 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
3347 Dwarf_pubnames_table ctor.
3348
8787852d
CC
33492012-10-23 Cary Coutant <ccoutant@google.com>
3350
3351 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
3352 abbrev_shndx.
3353 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
3354 abbrev_shndx_.
3355 (Dwarf_info_reader::set_abbrev_shndx): New method.
3356 (Dwarf_info_reader::abbrev_shndx_): New data member.
3357
9fc236f3
CC
33582012-10-23 Cary Coutant <ccoutant@google.com>
3359
3360 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
3361 from object, not parameters.
3362 (Dwarf_info_reader::parse): Likewise.
3363 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
3364 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
3365 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
3366 methods.
3367
effe8365
CC
33682012-10-23 Cary Coutant <ccoutant@google.com>
3369
3370 * fileread.cc (Input_file::Input_file): New constructor.
3371 * fileread.h (class Input_file): Add new constructor.
3372
1698990d
AM
33732012-10-18 Alan Modra <amodra@gmail.com>
3374
3375 PR gold/14727
3376 * object.cc (Relobj::is_section_name_included): Also match
3377 .sdata personality section.
3378
168a4726
AM
33792012-10-18 Alan Modra <amodra@gmail.com>
3380
3381 * target-reloc.h (class Default_comdat_behavior): New, package up..
3382 (get_comdat_behaviour): ..this.
3383 (relocate_section): Add Relocate_comdat_behavior template arg,
3384 adjust code to suit.
3385 * arm.cc (Target_arm::relocate_section): Adjust to suit.
3386 (Target_arm::scan_reloc_section): Likewise.
3387 * i386.cc (Target_i386::relocate_section): Likewise.
3388 * sparc.cc (Target_sparc::relocate_section): Likewise.
3389 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
3390 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
3391 * powerpc.cc (class Relocate_comdat_behavior): New.
3392 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
3393 gold::relocate_section with new template arg.
3394
acc276d8
AM
33952012-10-18 Alan Modra <amodra@gmail.com>
3396
3397 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
3398 dynamic relocs for GOT_TPREL got entries, without symbol if
3399 resolving locally.
3400 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
3401 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
3402 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
3403
e10f9870
AM
34042012-10-17 Alan Modra <amodra@gmail.com>
3405
3406 PR gold/14726
3407 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
3408
ae034989
ST
34092012-10-16 Sriraman Tallam <tmsriram@google.com>
3410
3411 * layout.cc (Layout::include_section): Keep sections marked
3412 SHF_EXCLUDE when doing relocatable links.
3413
f3a0ed29
AM
34142012-10-16 Alan Modra <amodra@gmail.com>
3415
3416 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
3417 (Target_powerpc::do_finalize_sections): Call it.
3418 (Output_data_save_res): New class and supporting functions.
3419 (Target_powerpc::symval_for_branch): Only look up .opd entry for
3420 normal symbols defined in object files.
3421
c6de8ed4
AM
34222012-10-12 Alan Modra <amodra@gmail.com>
3423
3424 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
3425 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
3426 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
3427 section if scan_opd_relocs not yet called.
3428 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
3429
03e25981
AM
34302012-10-12 Alan Modra <amodra@gmail.com>
3431
3432 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3433 add_local_ifunc_entry): Revert last change.
3434 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
3435
c9824451
AM
34362012-10-05 Alan Modra <amodra@gmail.com>
3437
3438 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
3439 do_plt_address_for_global): New functions.
3440 (Output_data_got_powerpc::do_write): Don't segfault when linking
3441 statically.
3442 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3443 add_local_ifunc_entry): Return true on adding entry..
3444 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
3445 glink->add_entry call. Remove unused symtab param. Adjust calls.
3446 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
3447 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
3448 set up symbols here.
3449 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
3450 syms here. Do so even when no .iplt. Don't segfault when linking
3451 statically.
3452 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
3453 new variants without reloc param.
3454 (Glink_sym_ent::Glink_sym_ent): Likewise.
3455 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
3456 reloc when refs will resolve to plt call stub.
3457 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
3458 R_PPC_PLTREL24 to resolve locally.
3459 (Target_powerpc::Scan::global): Correct ifunc handling.
3460 (Target_powerpc::Relocate::relocate): Correct local sym glink
3461 lookup. Don't destroy "value" when we have a plt call stub,
3462 and when checking plt call validity.
3463 (Target_powerpc::do_dynsym_value): Simplify.
3464
19fec8c1
AM
34652012-10-05 Alan Modra <amodra@gmail.com>
3466
3467 * i386.cc (Output_data_plt_i386::address_for_global,
3468 address_for_local): Add plt offset to returned value. Adjust uses.
3469 * sparc.cc (Output_data_plt_sparc::address_for_global,
3470 address_for_local): Likewise.
3471 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
3472 address_for_local): Likewise.
3473 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
3474 address_for_local): Likewise.
3475 * target.h (Target::plt_address_for_global, plt_address_for_local):
3476 Update comment.
3477 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
3478 (Output_data_got::Got_entry::write): Nor here.
3479 * output.h: Comment fix.
3480
e867b647
WL
34812012-10-02 Jiong Wang <jiwang@tilera.com>
3482
3483 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
3484 global_offset_table_ value for larget got.
3485 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
3486
e5d5f5ed
AM
34872012-09-29 Alan Modra <amodra@gmail.com>
3488
3489 * powerpc.cc (Target_powerpc::iplt_): New output section.
3490 (Target_powerpc::iplt_section, make_iplt_section,
3491 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
3492 (Target_powerpc::make_plt_entry): Handle ifunc syms.
3493 Target_powerpc::plt_entry_count): Count iplt entries too.
3494 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
3495 reloc section in constructor. New params.
3496 (Target_powerpc::make_plt_section): Create reloc section here instead.
3497 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
3498 functions.
3499 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
3500 (Output_data_glink::add_entry, find_entry): New functions to
3501 deal with local syms.
3502 (Glink_sym_ent): Add support for local syms.
3503 (Output_data_glink::do_write): Handle ifunc plt entries.
3504 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3505 (Target_powerpc::Scan::local, global): Handle ifunc syms.
3506 (Target_powerpc::Relocate::relocate): Likewise.
3507 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
3508
ec4dbad3
AM
35092012-09-25 Alan Modra <amodra@gmail.com>
3510
3511 * object.h (Sized_relobj_file::adjust_local_symbol,
3512 do_adjust_local_symbol): New functions.
3513 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
3514 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
3515 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
3516 and irregular opd entry spacing.
3517 (Powerpc_relobj::do_read_relocs): Add opd size checks.
3518 (Global_symbol_visitor_opd): New functor.
3519 (Target_powerpc::do_finalize_sections): Omit global symbols defined
3520 on deleted opd entries.
3521
5c0b3823
WL
35222012-09-15 Jiong Wang <jiwang@tilera.com>
3523
3524 * tilegx.cc: New file.
3525 * Makefile.am (TARGETSOURCES): Add tilegx.cc
3526 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
3527 * configure.tgt: Add entries for tilegx*.
3528 * configure.ac: Likewise.
3529 * Makefile.in: Rebuild.
3530 * configure: Likewise.
3531 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
3532 tilegx.
3533
bfdfa4cd
AM
35342012-09-13 Alan Modra <amodra@gmail.com>
3535
3536 * target-reloc.h (scan_relocs): Call scan.local for relocs
3537 against symbols in discarded sections. Pass is_discarded
3538 param.
3539 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
3540 Add is_discarded param.
3541 * powerpc (Target_powerpc::Scan::local): Likewise. Use
3542 is_discarded to flag opd entry as discarded. Don't emit dyn
3543 relocs on such entries.
3544 (Target_powerpc::Scan::global): Similarly detect and handle
3545 such opd entries.
3546 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
3547 opd_ent_. Update all uses.
3548 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
3549 (Target_powerpc::relocate_section): Zero out discarded opd
3550 entry relocs.
3551
d77a0555
ILT
35522012-09-12 Ian Lance Taylor <iant@google.com>
3553
3554 PR gold/14570
3555 * output.cc: Rename Output_data_got template parameter from size
3556 to got_size for all functions. Compile all variants of
3557 Output_data_got.
3558 (Output_data_got::Got_entry::write): Correct use of size for
3559 symbol value. Use local_is_tls rather than casting to
3560 Sized_relobj_file.
3561 * object.h (class Object): Add local_is_tls and do_local_is_tls.
3562 (class Sized_relobj_file): Add do_local_is_tls.
3563 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
3564
815a1205
AM
35652012-09-11 Alan Modra <amodra@gmail.com>
3566
3567 PR gold/14566
3568 * layout.cc (Layout::set_segment_offsets): When using
3569 common-page-size alignment, ensure we are on a new max-page-size
3570 page.
3571 * output.cc (Output_segment::set_section_addresses): Use
3572 abi_pagesize, not common_pagesize for relro boundary.
3573 (Output_segment::set_offset): Likewise.
3574
bd73a62d
AM
35752012-09-11 Alan Modra <amodra@gmail.com>
3576
3577 * output.h (Output_data_got::add_global_tls, add_local_tls,
3578 add_local_tls_pair): New functions.
3579 (Output_data_got::add_local_pair_with_rel): Remove second
3580 reloc param. Expand comment.
3581 (Output_data_got::Got_entry): Rename use_plt_offset_ to
3582 use_plt_or_tls_offset_, similarly for constructor param.
3583 (Output_data_got::Got_entry::write): Add got_index param.
3584 * output.cc (Output_data_got::add_global_tls, add_local_tls,
3585 add_local_tls_pair): New functions.
3586 (Output_data_got::Got_entry::write): Handle tls symbols
3587 with use_plt_or_tls_offset_ set specially.
3588 (Output_data_got::add_local_pair_with_rel): Only one reloc.
3589 (Output_data_got::do_write): Replace iterator with index, pass
3590 index to entry write function.
3591 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
3592 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
3593 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
3594 call.
3595 * i386.cc (Target_i386::Scan::local): Likewise.
3596 * sparc.cc (Target_sparc::Scan::local): Likewise.
3597 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
3598 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
3599 do_tls_offset_for_global): New functions.
3600 (Target_powerpc::Scan::local): Correct TLS relocations and got
3601 entry values.
3602 (Target_powerpc::Scan::global): Don't emit unnecessary
3603 dynamic relocations on TLS GOT entries.
3604
00716ab1
AM
36052012-09-10 Matthias Klose <doko@ubuntu.com>
3606
3607 * config.in: Disable sanity check for kfreebsd.
3608
c891b3f9
SA
36092012-09-10 Sterling Augustine <saugustine@google.com>
3610
3611 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
3612 (Gdb_index::pubtypes_read): New parameter.
3613 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
3614 to calls.
3615 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
3616 pubtypes_object_.
3617
e81fea4d
AM
36182012-09-09 Alan Modra <amodra@gmail.com>
3619
3620 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
3621 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
3622 * gc.h (gc_process_relocs): Call target gc_add_reference.
3623 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
3624 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
3625 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
3626 unnecessary cast.
3627 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
3628 to cater for when we don't need code offset. Update use.
3629 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
3630 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
3631 set_opd_valid): New functions.
3632 (Target_powerpc::do_gc_add_reference): New function.
3633 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
3634 stashed refs.
3635 (Target_powerpc::do_gc_mark_symbol): New function.
3636
d2d60eef
CC
36372012-09-06 Cary Coutant <ccoutant@google.com>
3638
3639 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
3640 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
3641 (Dwarf_die::skip_attributes): Likewise.
3642 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
3643 * testsuite/gdb_index_test.cc (inline_func_1): New function.
3644 (main): Call it.
3645 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
3646
32ed4573
L
36472012-09-05 H.J. Lu <hongjiu.lu@intel.com>
3648
3649 * testsuite/script_test_3.t: Add .got.plt output section
3650 statement.
3651 * testsuite/script_test_4.t: Likewise.
3652
f4baf0d4
AM
36532012-09-05 Alan Modra <amodra@gmail.com>
3654
3655 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
3656 update all uses and lose "enum" when using type.
3657
864a1b56
AM
36582012-09-05 Alan Modra <amodra@gmail.com>
3659
3660 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
3661 * configure: Regenerate.
3662 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
3663 (plugin_final_layout.stdout): Likewise.
3664 (memory_test): Set page sizes to 0x1000.
3665 * testsuite/Makefile.in: Regenerate.
3666 * testsuite/discard_locals_test.sh: Add FIXME comment.
3667 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
3668 * testsuite/pr14265.t: Add .got output section statement.
3669 * testsuite/script_test_2.t: Likewise.
3670 * testsuite/script_test_3.t: Likewise.
3671 * testsuite/script_test_4.t: Likewise.
3672 * testsuite/script_test_5.t: Likewise.
3673 * testsuite/script_test_6.t: Likewise.
3674 * testsuite/script_test_7.t: Likewise.
3675 * testsuite/script_test_9.t: Likewise.
3676
3ea0a085
AM
36772012-09-05 Alan Modra <amodra@gmail.com>
3678
3679 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
3680 (Powerpc_relocate_functions::Status): New typedef.
3681 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3682 (Target_powerpc::Scan::local): Handle REL64.
3683 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
3684 for REL32 and REL64.
3685 (Target_powerpc::symval_for_branch): New function, extracted from..
3686 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
3687 checks. Report overflow errors.
3688
7404fe1b
AM
36892012-09-05 Alan Modra <amodra@gmail.com>
3690
3691 * object.h (Sized_relobj_file::emit_relocs): Delete.
3692 (Sized_relobj_file::emit_relocs_reltype): Delete.
3693 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
3694 relocate_relocs for --emit-relocs.
3695 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
3696 * output.h: Update comment.
3697 (Output_segment::first_section): New function.
3698 (Output_segment::first_section_load_address): Use first_section.
3699 * output.cc (Output_segment::first_section): New function extracted..
3700 (Output_segment::first_section_load_address): ..from here. Delete.
3701 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
3702 * target.h (Sized_target::relocate_for_relocatable): Likewise.
3703 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
3704 adjust call to target.h function.
3705 * i386.cc (Target_i386): Likewise.
3706 * sparc.cc (Target_sparc): Likewise.
3707 * x86_64.cc (Target_x86_64): Likewise.
3708 * powerpc.cc (Target_powerpc): Likewise.
3709 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
3710 first tls section has section symbol for optimised local dynamic
3711 output relocs.
3712 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
3713 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
3714 optimised tls code.
3715 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
3716 Rename to relocate_relocs. Update error message.
3717
957564c9
AS
37182012-09-04 Andreas Schwab <schwab@linux-m68k.org>
3719
3720 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
3721 --just-symbols.
3722
dd93cd0a
AM
37232012-08-31 Alan Modra <amodra@gmail.com>
3724
3725 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
3726 (Powerpc_relobj::toc_base_offset): New stub function.
3727 (Target_powerpc): Add tp_offset, dtp_offset. Rename
3728 got_mod_index_offset to tlsld_got_offset. Update all refs.
3729 (Target_powerpc::Relocate::enum skip_tls): New.
3730 (Target_powerpc::call_tls_get_addr_): New var.
3731 (Target_powerpc::is_branch_reloc): Move to file scope.
3732 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
3733 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
3734 New functions.
3735 (Target_powerpc::enum Got_type): Delete old values, add new ones.
3736 (powerpc_info): Correct common_pagesize for ppc64.
3737 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
3738 (Powerpc_relocate_functions): Add overflow check enums and functions.
3739 Add non-shift version of rela, rela_ua. Delete all rel public
3740 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
3741 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
3742 addr16_ha3, addr14 functions.
3743 (Output_data_got_powerpc::add_constant_pair): New function.
3744 (Output_data_got_powerpc::got_base_offset): Likewise.
3745 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
3746 (instruction constants): Sort, add some more.
3747 (Output_data_glink::do_write): Add and use Address typedef. Use
3748 object->toc_base_offset() stub for 64-bit.
3749 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
3750 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3751 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
3752 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
3753 Always treat .opd relocs as against locally defined symbol.
3754 Correct condition for RELATIVE relocs.
3755 (Target_powerpc::do_finalize_sections): Test for NULL sections.
3756 (Target_powerpc::Relocate::relocate): Use plt call stub as value
3757 for 32-bit syms with a plt entry. Correct ppc64 toc base
3758 calculations. Handle TLS relocs, and more. Add overflow
3759 checking and adjust for Powerpc_relocate_functions changes.
3760 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
3761 Reinstate --emit-relocs code with FIXME.
3762
a1373b60
AM
37632012-08-30 Alan Modra <amodra@gmail.com>
3764
3765 * layout.cc (Layout::set_segment_offsets): Set p_align to
3766 abi_pagesize, not common_pagesize.
3767 (Layout::relaxation_loop_body): Similarly use abi_pagesize
3768 to determine whether file header can go in segment.
3769
703d02da
AM
37702012-08-30 Alan Modra <amodra@gmail.com>
3771
3772 * output.h (Output_reloc::Output_reloc <output section>): Add
3773 is_relative param. Adjust calls.
3774 (Output_reloc::add_output_section_relative): New functions.
3775 * output.cc (Output_reloc::Output_reloc <output section>): Handle
3776 is_relative.
3777 (Output_reloc::symbol_value): Handle SECTION_CODE.
3778
16164a6b
ST
37792012-08-24 Sriraman Tallam <tmsriram@google.com>
3780
3781 * gold.cc (queue_middle_tasks): Call layout again when unique
3782 segments for sections is desired.
3783 * layout.cc (Layout::Layout): Initialize new members.
3784 (Layout::get_output_section_flags): New function.
3785 (Layout::choose_output_section): Call get_output_section_flags.
3786 (Layout::layout): Make output section for mapping to a unique segment.
3787 (Layout::insert_section_segment_map): New function.
3788 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 3789 output sections marked so.
16164a6b
ST
3790 (Layout::segment_precedes): Check for unique segments when sorting.
3791 * layout.h (Layout::Unique_segment_info): New struct.
3792 (Layout::Section_segment_map): New typedef.
3793 (Layout::insert_section_segment_map): New function.
3794 (Layout::get_output_section_flags): New function.
3795 (Layout::is_unique_segment_for_sections_specified): New function.
3796 (Layout::set_unique_segment_for_sections_specified): New function.
3797 (Layout::unique_segment_for_sections_specified_): New member.
3798 (Layout::section_segment_map_): New member.
3799 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
3800 Rename is_gc_pass_one to is_pass_one.
3801 Rename is_gc_pass_two to is_pass_two.
3802 Rename is_gc_or_icf to is_two_pass.
3803 Check for which pass based on whether symbols data is present.
3804 Make it two pass when unique segments for sections is desired.
3805 * output.cc (Output_section::Output_section): Initialize new
3806 members.
3807 * output.h (Output_section::is_unique_segment): New function.
3808 (Output_section::set_is_unique_segment): New function.
3809 (Output_section::is_unique_segment_): New member.
3810 (Output_section::extra_segment_flags): New function.
3811 (Output_section::set_extra_segment_flags): New function.
3812 (Output_section::extra_segment_flags_): New member.
3813 (Output_section::segment_alignment): New function.
3814 (Output_section::set_segment_alignment): New function.
3815 (Output_section::segment_alignment_): New member.
3816 (Output_segment::Output_segment): Initialize is_unique_segment_.
3817 (Output_segment::is_unique_segment): New function.
3818 (Output_segment::set_is_unique_segment): New function.
3819 (Output_segment::is_unique_segment_): New member.
3820 * plugin.cc (allow_unique_segment_for_sections): New function.
3821 (unique_segment_for_sections): New function.
3822 (Plugin::load): Add new functions to transfer vector.
3823 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
3824 * Makefile.in: Regenerate.
3825 * testsuite/plugin_final_layout.sh: Check if unique segment
3826 functionality works.
3827 * testsuite/plugin_section_order.c (onload): Check if new interfaces
3828 are available.
3829 (allow_unique_segment_for_sections): New global.
3830 (unique_segment_for_sections): New global.
3831 (claim_file_hook): Call allow_unique_segment_for_sections.
3832 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 3833
1e2bee4f
CC
38342012-08-22 Cary Coutant <ccoutant@google.com>
3835
3836 * layout.cc (Layout::include_section): Don't assert on GROUP
3837 sections with --emit-relocs.
3838
1d5dfe78
CC
38392012-08-21 Cary Coutant <ccoutant@google.com>
3840
3841 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
3842 if --export-dynamic-symbol names an undef symbol.
3843
c9269dff
AM
38442012-08-18 Alan Modra <amodra@gmail.com>
3845
3846 * powerpc.cc: Formatting and white space.
3847 (Powerpc_relobj): Rename got2_section_ to special_.
3848 Add opd_ent_shndx_ and opd_ent_off_ vectors.
3849 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
3850 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
3851 (Target_powerpc): Add Address typedef and invalid_address. Use
3852 throughout.
3853 (Target_powerpc::is_branch_reloc): New function.
3854 (Powerpc_relocate_functions): Add Address typedef, use throughout.
3855 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
3856 for dst_mask, value and addend.
3857 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
3858 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
3859 (Output_data_glink::do_write): Correct toc base. Don't try to use
3860 uint16_t for 24-bit offset. Use get_output_section_offset and
3861 check return.
3862 (Target_powerpc::Scan::local): Handle more relocs.
3863 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
3864 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
3865 Plug in toc restoring insn after plt calls. Translate branches
3866 to function descriptor symbols to corresponding entry point.
3867 (Target_powerpc::relocate_for_relocatable): Check return from
3868 get_output_section_offset.
3869 * symtab.h: Comment typo.
3870
b1759dce
ILT
38712012-08-14 Ian Lance Taylor <iant@google.com>
3872
3873 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
3874 unsupported_relocal_local to call unsupported_reloc_global.
3875
b9b2ae8b
NC
38762012-08-14 Nick Clifton <nickc@redhat.com>
3877
3878 PR ld/14265
3879 * script-sections.cc (Sections_element::output_section_name): Add
3880 keep return parameter.
3881 (Output_section_element::match_name): Add keep return parameter.
3882 Return the value of the keep_ member.
3883 * script-sections.h (class Output_section): Update
3884 output_section_name prototype.
3885 * layout.cc (Layout::keep_input_section): New public member
3886 function.
3887 (Layout::choose_output_section): Pass keep parameter to
3888 output_section_name.
3889 * layout.h (class Layout): Add keep_input_section.
3890 * object.cc (Sized_relobj_file::do_layout): Check for kept input
3891 sections.
3892 * testsuite/Makefile.am: Add a test.
3893 * testsuite/Makefile.in: Regenerate.
3894 * testsuite/pr14265.c: Source file for the test.
3895 * testsuite/pr14265.t: Linker script for the test.
3896 * testsuite/pr14265.sh: Shell script for the test.
3897
921b5322
AM
38982012-08-14 Alan Modra <amodra@gmail.com>
3899
3900 * target.h (Target::output_section_name): New function.
3901 (Target::do_output_section_name): New function.
3902 * layout.cc (Layout::choose_output_section): Call the above.
3903 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
3904
6ce78956
AM
39052012-08-14 Alan Modra <amodra@gmail.com>
3906
3907 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
3908 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
3909 for replace_constant call.
3910 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
3911 (Output_data_glink::do_print_to_mapfile): New function.
3912 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
3913 (Target_powerpc::Relocate::relocate): Likewise.
3914
d1a8cabd
AM
39152012-08-14 Alan Modra <amodra@gmail.com>
3916
3917 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
3918 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
3919 (Output_data_glink::add_entry,find_entry): Remove shndx param.
3920 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
3921 all references to shndx_. Handle special case for R_PPC_PLTREL24
3922 here.
3923 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
3924 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
3925 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
3926 here.
3927 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
3928 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
3929
d83ce4e3
AM
39302012-08-12 Alan Modra <amodra@gmail.com>
3931
3932 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
3933 (glink insn constants): Use uint32_t.
3934 (Output_data_glink::add_entry): Use insert, not [] operator.
3935
cf43a2fe
AM
39362012-08-11 Alan Modra <amodra@gmail.com>
3937
3938 * object.h (Sized_relobj_file::find_shdr): New function.
3939 (Sized_relobj_file::find_special_sections): New function.
3940 * object.cc (Sized_relobj_file::find_shdr): New function.
3941 (Sized_relobj_file::find_eh_frame): Use find_shdr.
3942 (Sized_relobj_file::find_special_sections): New function, split out..
3943 (Sized_relobj_file::do_read_symbols): ..from here.
3944 * output.h (Output_data_got::replace_constant): New function.
3945 (Output_data_got::num_entries): New function.
3946 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
3947 (Output_data_got::got_offset): Protected rather than private.
3948 (Output_data_got::replace_got_entry): New function.
3949 * output.cc (Output_data_got::replace_got_entry): New function.
3950 * powerpc.cc (class Powerpc_relobj): New.
3951 (class Powerpc_relocate_functions): Delete all psymval variants or
3952 convert to value,addend type. Delete pcrela, pcrela_unaligned.
3953 Implement _ha functions using corresponding _hi function.
3954 (Powerpc_relobj::find_special_sections): New function.
3955 (Target_powerpc::do_make_elf_object): New function.
3956 (class Output_data_got_powerpc): New.
3957 (class Output_data_glink): New.
3958 (class Powerpc_scan_relocatable_reloc): New.
3959 Many more changes througout file.
3960
3c892704
NC
39612012-08-09 Nick Clifton <nickc@redhat.com>
3962
3963 * po/vi.po: Updated Vietnamese translation.
3964
82435b3b
ILT
39652012-08-07 Ian Lance Taylor <iant@google.com>
3966
3967 * layout.cc (Layout::add_target_dynamic_tags): If
3968 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
3969 plt_rel.
3970
a6dc81d2
NC
39712012-07-30 Nick Clifton <nickc@redhat.com>
3972
3973 * po/gold.pot: Updated template.
3974 * po/es.po: Updated Spanish translation.
3975
f1415016
CC
39762012-07-18 Cary Coutant <ccoutant@google.com>
3977
3978 PR gold/14344
3979 * configure.ac: Add check for -gpubnames support.
3980 * configure: Regenerate.
3981 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
3982 support; force -gno-pubnames.
3983 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
3984 support.
3985 (gdb_index_test_4): New test.
3986 * testsuite/Makefile.in: Regenerate.
3987 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
3988 * testsuite/gdb_index_test_2.sh: Likewise.
3989 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
3990 * testsuite/gdb_index_test_4.sh: New script.
3991 * testsuite/gdb_index_test_comm.sh: New script with common code;
3992 don't look for space after colon.
3993
b7fd7c37
ST
39942012-07-16 Sriraman Tallam <tmsriram@google.com>
3995
3996 * gold.cc (queue_middle_tasks): Update function order only after
3997 deferred objects due to plugins are processed.
3998
1f3212db
ILT
39992012-07-11 Ian Lance Taylor <iant@google.com>
4000
4001 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
4002 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
4003 (Target_arm::scan_reloc_for_stub): Likewise.
4004 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
4005 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
4006 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
4007 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
4008 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
4009
81c82a68
ILT
40102012-07-10 Dodji Seketeli <dodji@redhat.com>
4011 Ian Lance Taylor <iant@google.com>
4012
4013 PR gold/14309
4014 * configure.ac: Test whether std::tr1::hash<off_t> works.
4015 * gold.h: Add a specialization for std::tr1::hash<off_t> if
4016 needed.
4017 * output.h (class Output_fill): Add virtual destructor.
4018 * configure, config.in: Rebuild.
4019
eabc84f4
RM
40202012-06-22 Roland McGrath <mcgrathr@google.com>
4021
4022 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
4023
370e30b6
RÁE
40242012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
4025
4026 * plugin.cc (Plugin::load): Handle position independent executables.
4027
fb1b895d
CC
40282012-06-06 Cary Coutant <ccoutant@google.com>
4029
4030 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
4031 add .debug_macro.
4032 (lines_only_debug_sections): Likewise.
4033 (gdb_fast_lookup_sections): New static array.
4034 (is_gdb_debug_section): Rename formal parameter.
4035 (is_lines_only_debug_section): Likewise.
4036 (is_gdb_fast_lookup_section): New function.
4037 (Layout::include_section): Check for ".zdebug_" prefix; pass
4038 section name suffix to is_gdb_debug_section, et al.; check for
4039 fast-lookup sections when building .gdb_index.
4040 * options.h (--strip-debug-gdb): Update GDB version number.
4041
7c0640fa
CC
40422012-06-06 Cary Coutant <ccoutant@google.com>
4043
4044 * configure.ac: Add check for fallocate.
4045 * configure: Regenerate.
4046 * config.in: Regenerate.
4047
4048 * options.h (class General_options): Add --mmap-output-file and
4049 --posix-fallocate options.
4050 * output.cc: (posix_fallocate): Remove; replace with...
4051 (gold_fallocate): New function.
4052 (Output_file::map_no_anonymous): Call gold_fallocate.
4053 (Output_file::map): Check --mmap-output-file option.
4054
2a49eb69
DK
40552012-06-05 Jing Yu <jingyu@google.com>
4056
4057 * gold.h (textdomain): Add do {} to empty while(0).
4058 (bindtextdomain): Likewise.
4059
fad072ac
CC
40602012-06-04 Cary Coutant <ccoutant@google.com>
4061
4062 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
4063 has_dynsym_index.
4064
8cc69fb6
ST
40652012-05-25 Sriraman Tallam <tmsriram@google.com>
4066
4067 * symtab.cc (Symbol_table::define_special_symbol):
4068 Initialize *poldsym to prevent uninitialized variable errors.
4069
1be75daa
CC
40702012-05-23 Cary Coutant <ccoutant@google.com>
4071
4072 * layout.cc (Layout::section_name_mapping): Add rules to handle
4073 exact match on .data.rel.ro.local or .data.rel.ro.
4074 (Layout::output_section_name): Check for exact matches.
4075
9b689de0
CC
40762012-05-23 Cary Coutant <ccoutant@google.com>
4077
4078 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
4079 more carefully.
4080
b24fdbf5
CC
40812012-05-22 Cary Coutant <ccoutant@google.com>
4082
4083 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
4084 object before exporting symbol.
4085
e550e1a2
L
40862012-05-21 H.J. Lu <hongjiu.lu@intel.com>
4087
4088 * testsuite/tls_test.cc: Include "config.h" first.
4089 * testsuite/tls_test_c.c: Likewise.
4090
df7b86aa
NC
40912012-05-17 Daniel Richard G. <skunk@iskunk.org>
4092 Nick Clifton <nickc@redhat.com>
4093
4094 PR 14072
4095 * configure.in: Add check that sysdep.h has been included before
4096 any system header files.
4097 * configure: Regenerate.
4098 * config.in: Regenerate.
4099
1007b503
CC
41002012-05-14 Cary Coutant <ccoutant@google.com>
4101
4102 * layout.cc (Layout::make_output_section): Mark .tdata section
4103 as RELRO.
4104 * testsuite/relro_test.cc: Add a TLS variable.
4105
fd885f3a
L
41062012-05-10 H.J. Lu <hongjiu.lu@intel.com>
4107
4108 PR gold/14091
4109 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
4110 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
4111 R_X86_64_64.
4112
80f5885c
CC
41132012-05-08 Cary Coutant <ccoutant@google.com>
4114
4115 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
4116 (lines_only_debug_sections): Likewise.
4117
2e702c99
RM
41182012-05-02 Roland McGrath <mcgrathr@google.com>
4119
4120 * nacl.cc: New file.
4121 * nacl.h: New file.
4122 * Makefile.am (CCFILES, HFILES): Add them.
4123 * Makefile.in: Regenerate.
4124 * i386.cc (Output_data_plt_i386_nacl): New class.
4125 (Output_data_plt_i386_nacl_exec): New class.
4126 (Output_data_plt_i386_nacl_dyn): New class.
4127 (Target_i386_nacl): New class.
4128 (Target_selector_i386_nacl): New class.
4129 (target_selector_i386): Use it instead of Target_selector_i386.
4130 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
4131 (Target_x86_64_nacl): New class.
4132 (Target_selector_x86_64_nacl): New class.
4133 (target_selector_x86_64, target_selector_x32): Use it instead of
4134 Target_selector_x86_64.
4135 * arm.cc (Output_data_plt_arm_nacl): New class.
4136 (Target_arm_nacl): New class.
4137 (Target_selector_arm_nacl): New class.
4138 (target_selector_arm, target_selector_armbe): Use it instead of
4139 Target_selector_arm.
4140
4141 * target-select.cc (select_target): Take new Input_file* and off_t
4142 arguments, pass them on to recognize method of selector.
4143 * object.cc (make_elf_sized_object): Update caller.
4144 * parameters.cc (parameters_force_valid_target): Likewise.
4145 * incremental.cc (make_sized_incremental_binary): Likewise.
4146 * target-select.h: Update decl.
4147 (Target_selector::recognize): Take new Input_file* argument,
4148 pass it on to do_recognize.
4149 (Target_selector::do_recognize): Take new Input_file* argument.
4150 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
4151 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
4152 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
4153 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
4154
4155 * target.h (Target::Target_info): New members isolate_execinstr
4156 and rosegment_gap.
4157 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
4158 * arm.cc (Target_arm::arm_info): Update initializer.
4159 * i386.cc (Target_i386::i386_info): Likewise.
4160 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
4161 * sparc.cc (Target_sparc::sparc_info): Likewise.
4162 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
4163 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
4164 * layout.cc (Layout::attach_allocated_section_to_segment):
4165 Take new const Target* argument. If target->isolate_execinstr(), act
4166 like --rosegment.
4167 (Layout::find_first_load_seg): Take new const Target* argument;
4168 if target->isolate_execinstr(), reject PF_X segments.
4169 (Layout::relaxation_loop_body): Update caller.
4170 (Layout::set_segment_offsets): If target->isolate_execinstr(),
4171 reset file offset to zero when we hit LOAD_SEG, and then do a second
4172 loop over the segments before LOAD_SEG to reassign offsets after
4173 addresses have been determined. Handle target->rosegment_gap().
4174 (Layout::attach_section_to_segment): Take new const Target* argument;
4175 pass it to attach_allocated_section_to_segment.
4176 (Layout::make_output_section): Update caller.
4177 (Layout::attach_sections_to_segments): Take new const Target* argument;
4178 pass it to attach_section_to_segment.
4179 * gold.cc (queue_middle_tasks): Update caller.
4180 * layout.h (Layout): Update method decls with new arguments.
4181
4182 * arm.cc (Target_arm::Target_arm): Take optional argument for the
4183 Target_info pointer to use.
4184 (Target_arm::do_make_data_plt): New virtual method.
4185 (Target_arm::make_data_plt): New method that calls it.
4186 (Target_arm::make_plt_entry): Use it.
4187 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
4188 for the section alignment.
4189 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
4190 method.
4191 (Output_data_plt_arm::first_plt_entry_offset): Call it.
4192 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
4193 method.
4194 (Output_data_plt_arm::get_plt_entry_size): Call it.
4195 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
4196 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
4197 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
4198 method.
4199 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
4200 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
4201 method instead of sizeof(plt_entry).
4202 (Output_data_plt_arm::add_entry): Likewise.
4203 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
4204 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
4205 than static method.
4206 (Target_arm::plt_entry_size): Likewise.
4207 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
4208 Move to ...
4209 (Output_data_plt_arm_standard): ... here, new class.
4210 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
4211 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
4212 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
4213
4214 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4215 Take additional argument for the PLT entry size.
4216 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
4217 Use get_plt_entry_size method rather than plt_entry_size variable.
4218 (Output_data_plt_x86_64::reserve_slot): Likewise.
4219 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
4220 (Output_data_plt_x86_64::add_entry): Likewise.
4221 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
4222 (Output_data_plt_x86_64::address_for_global): Likewise.
4223 (Output_data_plt_x86_64::address_for_local): Likewise.
4224 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4225 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
4226 Make method non-static.
4227 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
4228 method.
4229 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
4230 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
4231 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
4232 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
4233 virtual method.
4234 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
4235 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
4236 virtual method.
4237 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
4238 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
4239 virtual method.
4240 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
4241 (Output_data_plt_x86_64::plt_entry_size)
4242 (Output_data_plt_x86_64::first_plt_entry)
4243 (Output_data_plt_x86_64::plt_entry)
4244 (Output_data_plt_x86_64::tlsdesc_plt_entry)
4245 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
4246 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
4247 (Output_data_plt_x86_64_standard): ... here, new class.
4248 (Target_x86_64::Target_x86_64): Take optional argument for the
4249 Target_info pointer to use.
4250 (Target_x86_64::do_make_data_plt): New virtual method.
4251 (Target_x86_64::make_data_plt): New method to call it.
4252 (Target_x86_64::init_got_plt_for_update): Use that.
4253 Call this->plt_->add_eh_frame method here.
4254 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
4255 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
4256 rather than static method.
4257 (Target_x86_64::plt_entry_size): Likewise.
4258 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
4259 rather than plt_entry_size variable. Move guts of PLT filling to...
4260 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
4261 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
4262 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
4263
4264 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
4265 additional argument for the section alignment.
4266 Don't do add_eh_frame_for_plt here.
4267 (Output_data_plt_i386::first_plt_entry_offset): Make the method
4268 non-static. Use get_plt_entry_size method rather than plt_entry_size
4269 variable.
4270 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
4271 method.
4272 (Output_data_plt_i386::get_plt_entry_size): Call it.
4273 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
4274 (Output_data_plt_i386::add_eh_frame): New method to call it.
4275 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
4276 method.
4277 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
4278 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
4279 method.
4280 (Output_data_plt_i386::fill_plt_entry): New method to call it.
4281 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
4282 method instead of plt_entry_size.
4283 (Output_data_plt_i386::plt_entry_size)
4284 (Output_data_plt_i386::plt_eh_frame_fde_size)
4285 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
4286 (Output_data_plt_i386_standard): ... here, new class.
4287 (Output_data_plt_i386_exec): New class.
4288 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
4289 (Output_data_plt_i386_exec::first_plt_entry): ... here.
4290 (Output_data_plt_i386::exec_plt_entry): Move to ...
4291 (Output_data_plt_i386_exec::plt_entry): ... here.
4292 (Output_data_plt_i386_dyn): New class.
4293 (Output_data_plt_i386::first_plt_entry): Move to ...
4294 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
4295 (Output_data_plt_i386::dyn_plt_entry): Move to ...
4296 (Output_data_plt_i386_dyn::plt_entry): ... here.
4297 (Target_i386::Target_i386): Take optional argument for the Target_info
4298 pointer to use.
4299 (Target_i386::do_make_data_plt): New virtual method.
4300 (Target_i386::make_data_plt): New method to call it.
4301 (Target_i386::make_plt_section): Use that.
4302 Call this->plt_->add_eh_frame method here.
4303 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
4304 rather than plt_entry_size variable.
4305 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
4306 (Output_data_plt_i386::address_for_local): Likewise.
4307 (Output_data_plt_i386::do_write): Likewise.
4308 Move guts of PLT filling to...
4309 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
4310 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
4311 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
4312 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
4313
b9b9f2ee
CC
43142012-05-01 Cary Coutant <ccoutant@google.com>
4315
4316 * dwarf_reader.cc (Dwarf_die::read_attributes)
4317 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
4318 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
4319 * reduced_debug_output.cc
4320 (Output_reduced_debug_info_section::get_die_end): Remove
4321 DW_FORM_GNU_ref_index. Add default case.
4322
57923f48
MW
43232012-04-26 Mark Wielaard <mjw@redhat.com>
4324
4325 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
4326 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
4327 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
4328 DW_AT_high_pc as offset from DW_AT_low_pc.
4329
4330 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
4331 * testsuite/Makefile.in: Regenerate.
4332 * testsuite/gdb_index_test_3.c: New test source file.
4333 * testsuite/gdb_index_test_3.sh: New test source file.
4334
2c54b4f4
ILT
43352012-04-25 Ian Lance Taylor <iant@google.com>
4336
4337 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
4338 pointer.
4339 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
4340 as a class, not a struct.
4341 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
4342 (Target_arm::apply_cortex_a8_workaround): Likewise.
4343 * gc.h: Declare Reloc_types as a struct, not a class.
4344 * object.h: Declare Symbols_data as a struct.
4345 * reloc.h: Declare Read_relocs_data as a struct.
4346 * target.h: Declare Relocate_info as a struct.
4347
a5a5f7a3
DM
43482012-04-24 David S. Miller <davem@davemloft.net>
4349
4350 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
4351 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
4352 and R_SPARC_WPLT30.
4353
f038d496
CC
43542012-04-24 Cary Coutant <ccoutant@google.com>
4355
4356 * incremental-dump.cc (find_input_containing_global): Replace
4357 magic number with symbolic constant.
4358 (dump_incremental_inputs): Update version number.
4359 * incremental.cc (Output_section_incremental_inputs): Update version
4360 number; import symbolic constants from Incremental_inputs_reader.
4361 (Incremental_inputs::create_data_sections): Align relocations
4362 section correctly for 64-bit targets.
4363 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
4364 constants; add padding.
4365 (Output_section_incremental_inputs::write_header): Add assert for
4366 header_size.
4367 (Output_section_incremental_inputs::write_input_files): Add assert
4368 for input_entry_size.
4369 (Output_section_incremental_inputs::write_info_blocks): Add padding;
4370 add assert for object_info_size, input_section_entry_size,
4371 global_sym_entry_size.
4372 * incremental.h (Incremental_inputs_reader): Add symbolic constants
4373 for data structure sizes; use them.
4374 (Incremental_input_entry_reader): Import symbolic constants from
4375 Incremental_inputs_reader; use them.
4376
a4d85145
DM
43772012-04-23 David S. Miller <davem@davemloft.net>
4378
4379 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
4380 and elf_flags_set_.
4381 (Target_sparc::Target_sparc): Initialize new fields.
4382 (Target_sparc::do_make_elf_object): New function.
4383 (Target_sparc::do_adjust_elf_header): New function.
4384
1d509098
CC
43852012-04-23 Cary Coutant <ccoutant@google.com>
4386
4387 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
4388 CU range table of gdb index.
4389
7ebeff7f
DM
43902012-04-20 David S. Miller <davem@davemloft.net>
4391
4392 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
4393 instead of false.
4394
13cf9988
DM
43952012-04-16 David S. Miller <davem@davemloft.net>
4396
2a1079e8
DM
4397 * sparc.cc (Target_sparc::got_address): New function.
4398 (Sparc_relocate_functions::gdop_hix22): New function.
4399 (Sparc_relocate_functions::gdop_lox10): New function.
4400 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
4401 relocs.
4402 (Target_sparc::Scan::local): Likewise if the global symbol is not
4403 preemptible and is not IFUNC.
4404 (Target_sparc::Relocate::relocate): Perform GOTDATA code
4405 transformations for local and non-preemptible non-IFUNC global
4406 symbols.
4407
0bc964fc
DM
4408 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
4409 writing out 64-bit part of ranges.
4410
661d7a80
DM
4411 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
4412 -fpic and -fpie respectively.
4413 * Makefile.in: Regenerate.
4414
8c2bf391
DM
4415 * sparc.cc (class Target_sparc): Add rela_ifunc_.
4416 (Target_sparc::Target_sparc): Initialize new field.
4417 (Target_sparc::do_plt_section_for_global): New function.
4418 (Target_sparc::do_plt_section_for_local): New function.
4419 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
4420 (Target_sparc::make_plt_section): New function, broken out of
4421 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
4422 (Target_sparc::make_plt_entry): Call make_plt_section.
4423 (Target_sparc::make_local_ifunc_plt_entry): New function.
4424 (Target_sparc::rela_ifunc_section): New function.
4425 (Target_sparc::plt_section): Remove const.
4426 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
4427 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
4428 and ifunc_count_ fields.
4429 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
4430 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
4431 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
4432 (Output_data_plt_sparc::rela_ifunc): New function.
4433 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
4434 (Output_data_plt_sparc::has_ifunc_section): New function.
4435 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
4436 (Output_data_plt_sparc::address_for_global): New function.
4437 (Output_data_plt_sparc::address_for_local): New function.
4438 (Output_data_plt_sparc::plt_index_to_offset): New function.
4439 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
4440 and entry_count.
4441 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
4442 entry_count.
4443 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
4444 R_SPARC_JMP_IREL to switch.
4445 (Target_sparc::Scan::check_non_pic): Likewise.
4446 (Target_sparc::Scan::local): Handle IFUNC symbols.
4447 (Target_sparc::Scan::local): Likewise.
4448 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
4449 and plt_address_for_local.
4450 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
4451 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
4452
13cf9988
DM
4453 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
4454 (class Output_data_reloc): Adjust calls to Output_reloc_type.
4455 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
4456 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
4457 global relocs too.
4458 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
4459 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
4460 calls.
4461 * sparc.cc (Target_sparc::Scan::global): Likewise.
4462 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4463
31821be0
CC
44642012-04-16 Cary Coutant <ccoutant@google.com>
4465
4466 * archive.cc (Library_base::should_include_member): Check for
4467 --export-dynamic-symbol.
4468 * options.h (class General_options): Add --export-dynamic-symbol.
4469 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
4470 --export-dynamic-symbol.
4471 (Symbol_table::gc_mark_undef_symbols): Likewise.
4472 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
4473
2615994e
DM
44742012-04-12 David S. Miller <davem@davemloft.net>
4475
4476 * sparc.cc (Reloc::wdisp10): New relocation method.
4477 (Reloc::h34): Likewise.
4478 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
4479 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
4480 R_SPARC_WDISP10.
4481 (Target_sparc::Scan::local): Likewise.
4482 (Target_sparc::Scan::global): Likewise.
4483 (Target_sparc::Relocate::relocate): Likewise.
4484
6782735d
CC
44852012-04-09 Cary Coutant <ccoutant@google.com>
4486
4487 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
4488 low_pc == 0.
4489
8c7a0b00
ILT
44902012-04-06 Ian Lance Taylor <iant@google.com>
4491
4492 * timer.cc: #include <unistd.h>.
4493
58797674
RM
44942012-04-06 Roland McGrath <mcgrathr@google.com>
4495
4496 * configure.in (AC_CHECK_HEADERS): Add locale.h.
4497 * config.in: Regenerate.
4498 * configure: Regenerate.
4499
44350750
NC
45002012-04-05 Nick Clifton <nickc@redhat.com>
4501
4502 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
4503 (AM_LC_MESSAGES): Add.
4504 * aclocal.m4: Regenerate.
4505 * config.in: Regenerate.
4506 * configure: Regenerate.
4507
c1027032
CC
45082012-03-21 Cary Coutant <ccoutant@google.com>
4509
4510 * Makefile.am: Add gdb-index.cc, gdb-index.h.
4511 * Makefile.in: Regenerate.
4512 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
4513 (Sized_elf_reloc_mapper::symbol_section): New function.
4514 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
4515 (make_elf_reloc_mapper): New function.
4516 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
4517 (Dwarf_abbrev_table::do_read_abbrevs): New function.
4518 (Dwarf_abbrev_table::do_get_abbrev): New function.
4519 (Dwarf_ranges_table::read_ranges_table): New function.
4520 (Dwarf_ranges_table::read_range_list): New function.
4521 (Dwarf_pubnames_table::read_section): New function.
4522 (Dwarf_pubnames_table::read_header): New function.
4523 (Dwarf_pubnames_table::next_name): New function.
4524 (Dwarf_die::Dwarf_die): New function.
4525 (Dwarf_die::read_attributes): New function.
4526 (Dwarf_die::skip_attributes): New function.
4527 (Dwarf_die::set_name): New function.
4528 (Dwarf_die::set_linkage_name): New function.
4529 (Dwarf_die::attribute): New function.
4530 (Dwarf_die::string_attribute): New function.
4531 (Dwarf_die::int_attribute): New function.
4532 (Dwarf_die::uint_attribute): New function.
4533 (Dwarf_die::ref_attribute): New function.
4534 (Dwarf_die::child_offset): New function.
4535 (Dwarf_die::sibling_offset): New function.
4536 (Dwarf_info_reader::check_buffer): New function.
4537 (Dwarf_info_reader::parse): New function.
4538 (Dwarf_info_reader::do_parse): New function.
4539 (Dwarf_info_reader::do_read_string_table): New function.
4540 (Dwarf_info_reader::lookup_reloc): New function.
4541 (Dwarf_info_reader::get_string): New function.
4542 (Dwarf_info_reader::visit_compilation_unit): New function.
4543 (Dwarf_info_reader::visit_type_unit): New function.
4544 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
4545 Sized_elf_reloc_mapper.
4546 (Sized_dwarf_line_info::symbol_section): Remove function.
4547 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
4548 (Sized_dwarf_line_info::read_line_mappings): Remove object
4549 parameter, adjust callers.
4550 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
4551 * dwarf_reader.h: Include <sys/types.h>.
4552 (class Track_relocs): Remove forward declaration.
4553 (class Elf_reloc_mapper): New class.
4554 (class Sized_elf_reloc_mapper): New class.
4555 (class Dwarf_abbrev_table): New class.
4556 (class Dwarf_range_list): New class.
4557 (class Dwarf_ranges_table): New class.
4558 (class Dwarf_pubnames_table): New class.
4559 (class Dwarf_die): New class.
4560 (class Dwarf_info_reader): New class.
4561 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
4562 (Sized_dwarf_line_info::symbol_section): Remove member function.
4563 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
4564 base class.
4565 * gdb-index.cc: New source file.
4566 * gdb-index.h: New source file.
4567 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
4568 and .debug_types sections, call Layout::add_to_gdb_index.
4569 (Sized_relobj_incr::do_section_name): Implement.
4570 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
4571 return type; Implement.
4572 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
4573 return type.
4574 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
4575 parameter list and return type.
4576 (Sized_incr_dynobj::do_section_contents): Likewise.
4577 * layout.cc: Include gdb-index.h.
4578 (Layout::Layout): Initialize gdb_index_data_.
4579 (Layout::init_fixed_output_section): Check for .gdb_index section.
4580 (Layout::add_to_gdb_index): New function. Instantiate.
4581 * layout.h: Add forward declaration for class Gdb_index.
4582 (Layout::add_to_gdb_index): New member function.
4583 (Layout::gdb_index_data_): New data member.
4584 * main.cc: Include gdb-index.h.
4585 (main): Print statistics for gdb index.
4586 * object.cc (Object::section_contents): Move code into
4587 do_section_contents.
4588 (need_decompressed_section): Check for sections needed when building
4589 gdb index.
4590 (build_compressed_section_map): Likewise.
4591 (Sized_relobj_file::do_read_symbols): Need local symbols when building
4592 gdb index.
4593 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
4594 sections; call Layout::add_to_gdb_index.
4595 (Sized_relobj_file::do_decompressed_section_contents): Call
4596 do_section_contents directly.
4597 * object.h (Object::do_section_contents): Adjust parameter list and
4598 return type.
4599 (Object::do_decompressed_section_contents): Call do_section_contents
4600 directly.
4601 (Sized_relobj_file::do_section_contents): Adjust parameter list and
4602 return type.
4603 * options.h (class General_options): Add --gdb-index option.
4604 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
4605 list and return type.
4606 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
4607 * reloc.h (Track_relocs::checkpoint): New function.
4608 (Track_relocs::reset): New function.
4609
4610 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
4611 New test cases.
4612 * testsuite/Makefile.in: Regenerate.
4613 * testsuite/gdb_index_test.cc: New test source file.
4614 * testsuite/gdb_index_test_1.sh: New test source file.
4615 * testsuite/gdb_index_test_2.sh: New test source file.
4616
647f1574
DK
46172012-03-19 Doug Kwan <dougkwan@google.com>
4618
4619 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 4620 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
4621 __exidx_start and __exidx_end. Make symbol table parameter
4622 anonymous as it is not used.
4623 * gold.cc (queue_middle_tasks): Call target hook to define any
4624 target-specific symbols.
4625 * target.h (Target::define_standard_symbols): New method.
4626 (Target::do_define_standard_symbols): Same.
4627 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
4628 * testsuite/Makefile.in: Regenerate.
4629 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
4630 and __exidx_end.
4631 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
4632 relocations are generated for __exidx_start and __exidx_end.
4633
7c6109da
DK
46342012-03-16 Doug Kwan <dougkwan@google.com>
4635
4636 * testsuite/Makefile.am: Disable test initpri3b.
4637 * testsuite/Makefile.in: Regenerate.
4638
7b8957f8
DK
46392012-03-15 Doug Kwan <dougkwan@google.com>
4640
4641 * arm.cc (Target_arm::got_section): Make .got section read-only
4642 if -z now is given.
4643
14dc9ef7
ILT
46442012-03-15 Ian Lance Taylor <iant@google.com>
4645
4646 PR gold/13850
4647 * layout.cc (Layout::make_output_section): Correctly mark
4648 SHT_INIT_ARRAY, et. al., as relro.
4649
fa40b62a
DK
46502012-03-14 Doug Kwan <dougkwan@google.com>
4651
4652 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
4653 dynamic relocations for protected symbols in shared objects.
4654
fd325007
ILT
46552012-03-13 Ian Lance Taylor <iant@google.com>
4656
4657 * resolve.cc (Symbol_table::resolve): When merging common symbols,
4658 keep the larger alignment.
4659
e8dd54e1
CC
46602012-03-12 Cary Coutant <ccoutant@google.com>
4661
4662 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
4663 handling of DW_LNE_define_file.
4664
feb5f3b0
CC
46652012-03-12 Cary Coutant <ccoutant@google.com>
4666
4667 * reduced_debug_output.cc
4668 (Output_reduced_debug_info_section::get_die_end): Add new FORM
4669 codes to switch.
4670
a1fb4256
CC
46712012-02-29 Cary Coutant <ccoutant@google.com>
4672
4673 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
4674
5dd8762a
CC
46752012-02-29 Cary Coutant <ccoutant@google.com>
4676
4677 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4678 Call Object::decompressed_section_contents.
4679 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
4680 New dtor.
4681 (Sized_dwarf_line_info::buffer_start_): New data member.
4682 * merge.cc (Output_merge_data::do_add_input_section): Call
4683 Object::decompressed_section_contents.
4684 (Output_merge_string::do_add_input_section): Likewise.
4685 * object.cc (need_decompressed_section): New function.
4686 (build_compressed_section_map): Decompress sections needed later.
4687 (Sized_relobj_file::do_decompressed_section_contents): New function.
4688 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4689 * object.h (Object::decompressed_section_contents): New function.
4690 (Object::discard_decompressed_sections): New function.
4691 (Object::do_decompressed_section_contents): New function.
4692 (Object::do_discard_decompressed_sections): New function.
4693 (Compressed_section_info): New type.
4694 (Compressed_section_map): Include decompressed section contents.
4695 (Sized_relobj_file::do_decompressed_section_contents): New function.
4696 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4697
7b5de7ee
CC
46982012-02-16 Cary Coutant <ccoutant@google.com>
4699
4700 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
4701 * testsuite/Makefile.in: Regenerate.
4702
f9fa4a63
CC
47032012-02-14 Cary Coutant <ccoutant@google.com>
4704
4705 * options.cc (General_options::finalize): Disallow -pie and -static.
4706
2c175ebc
DK
47072012-02-03 Doug Kwan <dougkwan@google.com>
4708
4709 * arm.cc (Arm_relocate_functions::abs8,
4710 Arm_relocate_functions::abs16): Use
4711 Bits::has_signed_unsigned_overflow32.
4712 (Arm_relocate_functions::thm_abs8): Correct range of
4713 overflow check.
4714 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
4715 in assertions.
4716
90cff06f
DK
47172012-02-02 Doug Kwan <dougkwan@google.com>
4718
4719 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
4720 position independent outputs, not just shared objects.
4721
63887f3d
L
47222012-01-30 H.J. Lu <hongjiu.lu@intel.com>
4723
4724 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
4725 * configure: Regenerated.
4726
bef2b434
ILT
47272012-01-27 Ian Lance Taylor <iant@google.com>
4728
4729 * reloc.h (Bits): New class with static functions, copied from
4730 namespace utils in arm.cc.
4731 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
4732 instead.
4733
c335b55d
L
47342012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4735
4736 * incremental.cc (write_info_blocks): Correct relocation offset.
4737
41194d9f
L
47382012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4739
4740 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
4741 (Relocate::tls_gd_to_le): Likewise.
4742
1bae613c
L
47432012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4744
4745 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
4746
24482ca0
L
47472012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4748
4749 * configure.ac: Check if -mcmodel=medium works.
4750 * configure: Regenerated.
4751
c2c7840a
CC
47522012-01-24 Cary Coutant <ccoutant@google.com>
4753
4754 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
4755 definition and ...
4756 (read_unsigned_LEB_128_x): ... this new function.
4757 (read_signed_LEB_128): Replaced with inline definition and ...
4758 (read_signed_LEB_128_x): ... this new function.
4759 * int_encoding.h (read_unsigned_LEB_128_x): New function.
4760 (read_unsigned_LEB_128): Add inline definition.
4761 (read_signed_LEB_128_x): New function.
4762 (read_signed_LEB_128): Add inline definition.
4763 * testsuite/Makefile.am (leb128_unittest): New unit test.
4764 * testsuite/Makefile.in: Regenerate.
4765 * testsuite/leb128_unittest.cc: New unit test.
4766
833de760 47672012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
4768
4769 PR gold/13617
4770 * i386.cc (Target_i386::do_code_fill): When using a jmp
4771 instruction, pad with nop instructions.
4772 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4773
618d6666
L
47742012-01-22 H.J. Lu <hongjiu.lu@intel.com>
4775
4776 * x86_64.cc (gc_process_relocs): Add typename on types used in
4777 template.
4778 (scan_relocs): Likewise.
4779 (relocate_section): Likewise.
4780 (apply_relocation): Likewise.
4781
3660ff06
L
47822012-01-10 H.J. Lu <hongjiu.lu@intel.com>
4783
4784 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
4785 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
4786 under x32.
4787
fc51264f
L
47882012-01-09 H.J. Lu <hongjiu.lu@intel.com>
4789
4790 * x86_64.cc: Initial support for x32.
4791
dd74ae06
CC
47922012-01-03 Cary Coutant <ccoutant@google.com>
4793
4794 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
4795 Use abstract base class for GOT.
4796 * gold/output.h (class Output_data_got_base): New abstract base class.
4797 (class Output_data_got): Derive from new base class, adjust ctors.
4798 (Output_data_got::reserve_slot): Make virtual; rename to
4799 do_reserve_slot; Adjust callers.
4800 * gold/target.h (Sized_target::init_got_plt_for_update): Return
4801 pointer to abstract base class.
4802 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
4803
83896202
ILT
48042011-12-18 Ian Lance Taylor <iant@google.com>
4805
4806 * object.h (Relobj::local_symbol_value): New function.
4807 (Relobj::local_plt_offset): New function.
4808 (Relobj::local_has_got_offset): New function.
4809 (Relobj::local_got_offset): New function.
4810 (Relobj::set_local_got_offset): New function.
4811 (Relobj::do_local_symbol_value): New pure virtual function.
4812 (Relobj::do_local_plt_offset): Likewise.
4813 (Relobj::do_local_has_got_offset): Likewise.
4814 (Relobj::do_local_got_offset): Likewise.
4815 (Relobj::do_set_local_got_offset): Likewise.
4816 (Sized_relobj::do_local_has_got_offset): Rename from
4817 local_has_got_offset.
4818 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
4819 (Sized_relobj::do_set_local_got_offset): Rename from
4820 set_local_got_offset.
4821 (Sized_relobj_file::do_local_plt_offset): Rename from
4822 local_plt_offset.
4823 (Sized_relobj_file::do_local_symbol_value): New function.
4824 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
4825 local_plt_offset.
4826 * output.cc (Output_data_got::Got_entry::write): Change object to
4827 Relobj. Use local_symbol_value.
4828 (Output_data_got::add_global_with_rel): Change rel_dyn to
4829 Output_data_reloc_generic*. Use add_global_generic.
4830 (Output_data_got::add_global_with_rela): Remove. Change all
4831 callers to use add_global_with_rel.
4832 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
4833 Output_data_reloc_generic*. Use add_global_generic.
4834 (Output_data_got::add_global_pair_with_rela): Remove. Change all
4835 callers to use add_global_pair_with_rel.
4836 (Output_data_got::add_local): Change object to Relobj*.
4837 (Output_data_got::add_local_plt): Likewise.
4838 (Output_data_got::add_local_with_rel): Change object to Relobj*,
4839 change rel_dyn to Output_data_reloc_generic*. Use
4840 add_local_generic.
4841 (Output_data_got::add_local_with_rela): Remove. Change all
4842 callers to use all_local_with_rel.
4843 (Output_data_got::add_local_pair_with_rel): Change object to
4844 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
4845 add_output_section_generic.
4846 (Output_data_got::add_local_pair_with_rela): Remove. Change all
4847 callers to use add_local_pair_with_rel.
4848 (Output_data_got::reserve_local): Change object to Relobj*.
4849 * output.h: (class Output_data_reloc_generic): Add pure virtual
4850 declarations for add_global_generic, add_local_generic,
4851 add_output_section_generic.
4852 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
4853 functions for Output_data_reloc_generic. Update declarations for
4854 changes listed in output.cc.
4855 (class Output_data_got): Change template parameter to got_size.
4856 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
4857 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
4858 function.
4859 (Sized_relobj_incr::do_local_plt_offset): New function.
4860 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
4861 add_global_generic.
4862
76677ad0
CC
48632011-12-17 Cary Coutant <ccoutant@google.com>
4864
4865 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
4866 * resolve.cc (Symbol_table::resolve): Likewise.
4867 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
4868 arrays.
4869 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4870
8b8dd8d5
ILT
48712011-12-16 Ian Lance Taylor <iant@google.com>
4872
4873 * output.h (Output_data_reloc_generic::add): Only call
4874 add_dynamic_reloc if this is a dynamic reloc section.
4875
d55525b9
L
48762011-12-15 H.J. Lu <hongjiu.lu@intel.com>
4877
4878 PR gold/13505
4879 * target-reloc.h (apply_relocation): Replace <64, false> with
4880 <size, big_endian>.
4881
ff81c7c1
NC
48822011-11-25 Nick Clifton <nickc@redhat.com>
4883
4884 * po/it.po: New Italian translation.
4885
628f39be
SA
48862011-11-17 Sterling Augustine <saugustine@google.com>
4887
4888 * script.cc (script_include_directive): Implement.
4889 (read_script_file): New local variables name and search_path. Update
4890 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
4891 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
4892 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
4893
98ef3ea4
SA
48942011-11-11 Sterling Augustine <saugustine@google.com>
4895
4896 * yyscript.y (section_cmd): Add support for INCLUDE directive.
4897 (file_or_sections_cmd): Likewise.
4898
f4a8b6d7
DK
48992011-11-11 Doug Kwan <dougkwan@google.com>
4900
4901 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
4902 if --just-symbols is given.
4903
29ab395d
DK
49042011-11-10 Doug Kwan <dougkwan@google.com>
4905
4906 PR gold/13362
4907 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
4908 when processing data relocs.
4909 * reloc.h (Relocate_functions::rel_unaligned): New method.
4910 (Relocate_functions::pcrel_unaligned): Ditto.
4911 (Relocate_functions::rel32_unaligned): Ditto.
4912 (Relocate_functions::pcrel32_unaligned): Ditto.
4913
2c339f71
DK
49142011-11-09 Doug Kwan <dougkwan@google.com>
4915
4916 PR gold/13362
4917 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
4918 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
4919 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
4920 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4921 (Relocate_functions::rel_unaligned): New.
4922 (Relocate_functions::rel32_unaligned): New.
4923 * target-reloc.h (relocate_for_relocatable): Add code to handle
4924 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4925 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
4926 arm_unaligned_reloc_r): New targets.
4927 * testsuite/Makefile.in: Regenerate.
4928 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
4929 linking.
4930
3f3cddf1
ILT
49312011-11-02 Ian Lance Taylor <iant@google.com>
4932
4933 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
4934 NATIVE_LINKER.
4935 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
4936 * options.cc (General_options::finalize): Use library search path
4937 from configure script if specified. If not native and no sysroot,
4938 only search TOOLLIBDIR.
4939 * options.h (Search_directory::Search_directory): Change name to
4940 const std::string&.
4941 (General_options::add_to_library_path_with_sysroot): Change arg to
4942 const std::string&.
4943 * configure, Makefile.in, config.in: Rebuild.
4944
a8e2273b
ILT
49452011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4946
4947 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
4948 we are working around the ARM1176 Erratum.
4949 * options.h (General_options::fix_arm1176): Add option.
4950 * testsuite/Makefile.am: Add testcases, and keep current ones
4951 working.
4952 * testsuite/Makefile.in: Regenerate.
4953 * testsuite/arm_fix_1176.s: New file.
4954 * testsuite/arm_fix_1176.sh: Likewise.
4955
cd6eab1c
ILT
49562011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4957
4958 * arm.cc (Target_arm::Target_arm): Remove initialisation of
4959 may_use_blx_.
4960 (Target_arm::may_use_blx): Remove method.
4961 (Target_arm::set_may_use_blx): Likewise.
4962 (Target_arm::may_use_v4t_interworking): New method.
4963 (Target_arm::may_use_v5t_interworking): Likewise.
4964 (Target_arm::may_use_blx_): Remove member variable.
4965 (Arm_relocate_functions::arm_branch_common): Check for v5T
4966 interworking.
4967 (Arm_relocate_functions::thumb_branch_common): Likewise.
4968 (Reloc_stub::stub_type_for_reloc): Likewise.
4969 (Target_arm::do_finalize_sections): Correct interworking checks.
4970 * testsuite/Makefile.am: Add new tests.
4971 * testsuite/Makefile.in: Regenerate.
4972 * testsuite/arm_farcall_arm_arm.s: New test.
4973 * testsuite/arm_farcall_arm_arm.sh: Likewise.
4974 * testsuite/arm_farcall_arm_thumb.s: Likewise.
4975 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
4976 * testsuite/arm_farcall_thumb_arm.s: Likewise.
4977 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
4978 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
4979 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
4980
286adcf4
CC
49812011-10-31 Cary Coutant <ccoutant@google.com>
4982
4983 PR gold/13023
4984 * expression.cc (Expression::eval_with_dot): Add
4985 is_section_dot_assignment parameter.
4986 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
4987 absolute and assigning to dot within a section.
4988 * script-sections.cc
4989 (Output_section_element_assignment::set_section_addresses): Pass
4990 dot_section to set_if_absolute.
4991 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
4992 as is_section_dot_assignment flag to eval_with_dot.
4993 (Output_section_element_dot_assignment::set_section_addresses):
4994 Likewise.
4995 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
4996 parameter. Also set value if relative to dot_section; set the
4997 symbol's output_section.
4998 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
4999 parameter. Adjust all callers.
5000 (Expression::eval_maybe_dot): Likewise.
5001 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
5002 Adjust all callers.
5003 * testsuite/script_test_2.t: Test assignment of an absolute value
5004 to dot within an output section element.
5005
9634ed06
CC
50062011-10-31 Cary Coutant <ccoutant@google.com>
5007
5008 * options.h (class General_options): Add --[no-]gnu-unique options.
5009 * symtab.cc (Symbol_table::sized_write_globals): Convert
5010 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
5011
de4101c7
CC
50122011-10-31 Cary Coutant <ccoutant@google.com>
5013
5014 PR gold/13359
5015 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
5016 unnecessary assertion.
5017 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
5018
7257cc92
ST
50192011-10-31 Sriraman Tallam <tmsriram@google.com>
5020
5021 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5022 gc_mark_symbol.
5023 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5024 gc_mark_symbol.
5025 Change to just keep the section associated with symbol.
5026 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
5027 they are externally visible and --export-dynamic is turned on.
5028 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
5029
bfc34b3f
ILT
50302011-10-19 Ian Lance Taylor <iant@google.com>
5031
5032 PR gold/13163
5033 * script-sections.cc
5034 (Output_section_element_dot_assignment::needs_output_section): New
5035 function.
5036
ea0d8c47
ILT
50372011-10-19 Ian Lance Taylor <iant@google.com>
5038
5039 PR gold/13204
5040 * layout.cc (Layout::segment_precedes): Don't assert failure if a
5041 --section-start option was seen.
5042 * options.h (General_options::any_section_start): New function.
5043
abd242a9
DM
50442011-10-18 David S. Miller <davem@davemloft.net>
5045
5046 PR binutils/13301
5047 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
5048 member to track relocation locations that have moved during TLS
5049 reloc optimizations.
5050 (Target_sparc::Relocate::Relocate): Initialize to NULL.
5051 (Target_sparc::Relocate::relocate): Adjust view down by 4
5052 bytes if it matches reloc_adjust_addr_.
5053 (Target_sparc::Relocate::relocate_tls): Always move the
5054 __tls_get_addr call delay slot instruction forward 4 bytes when
5055 performing relaxation.
5056
bab9090f
CC
50572011-10-18 Cary Coutant <ccoutant@google.com>
5058
5059 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
5060 (Output_file::map_no_anonymous): Check for non-zero
5061 return code from posix_fallocate.
5062
f7c5b166
CC
50632011-10-17 Cary Coutant <ccoutant@google.com>
5064
5065 PR gold/13245
5066 * plugin.cc (is_visible_from_outside): Check for symbols
5067 referenced from dynamic objects.
5068 * resolve.cc (Symbol_table::resolve): Don't count references
5069 from dynamic objects as references from real ELF files.
5070 * testsuite/plugin_test_2.sh: Adjust expected result.
5071
b490c0bb
CC
50722011-10-17 Cary Coutant <ccoutant@google.com>
5073
5074 * gold.cc: Include timer.h.
5075 (queue_middle_tasks): Stamp time.
5076 (queue_final_tasks): Likewise.
5077 * main.cc (main): Store timer in parameters. Print timers
5078 for each pass.
5079 * parameters.cc (Parameters::Parameters): Initialize timer_.
5080 (Parameters::set_timer): New function.
5081 (set_parameters_timer): New function.
5082 * parameters.h (Parameters::set_timer): New function.
5083 (Parameters::timer): New function.
5084 (Parameters::timer_): New data member.
5085 (set_parameters_timer): New function.
5086 * timer.cc (Timer::stamp): New function.
5087 (Timer::get_pass_time): New function.
5088 * timer.h (Timer::stamp): New function.
5089 (Timer::get_pass_time): New function.
5090 (Timer::pass_times_): New data member.
5091
f475cf7b
CC
50922011-10-17 Cary Coutant <ccoutant@google.com>
5093
5094 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
5095 task for members of lib groups.
5096
cdd7e244
CC
50972011-10-17 Cary Coutant <ccoutant@google.com>
5098
5099 PR gold/13288
4f95c8b4 5100 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
5101 (File_read::make_view): Move bounds check (replace with assert)...
5102 (File_read::find_or_make_view): ... to here.
5103
dfb45471
CC
51042011-10-12 Cary Coutant <ccoutant@google.com>
5105
4f95c8b4 5106 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
5107 ::read returns less than requested size.
5108
53bbcc1b
CC
51092011-10-10 Cary Coutant <ccoutant@google.com>
5110
4f95c8b4 5111 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
5112 Initialize defined_count_.
5113 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
5114 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
5115 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
5116 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
5117 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 5118 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
5119 member.
5120 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 5121 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
5122 Return zeroes instead of internal error.
5123
397b129b
CC
51242011-10-10 Cary Coutant <ccoutant@google.com>
5125
5126 PR gold/13249
4f95c8b4 5127 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 5128 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 5129 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
5130 (Output_reloc::type_): Adjust size of bit field.
5131 (Output_reloc::use_plt_offset_): New bit field.
5132 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
5133 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
5134 flag. Adjust all callers.
4f95c8b4 5135 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
5136 creating RELATIVE relocations.
5137
d5698657
NC
51382011-10-10 Nick Clifton <nickc@redhat.com>
5139
5140 * po/es.po: Updated Spanish translation.
5141 * po/fi.po: Updated Finnish translation.
5142
6a59a5c2
DN
51432011-10-03 Diego Novillo <dnovillo@google.com>
5144
5145 * options.cc (parse_uint): Fix dereference of RETVAL.
5146
f0558624
ST
51472011-09-29 Sriraman Tallam <tmsriram@google.com>
5148
5149 * layout.h (section_order_map_): New member.
5150 (get_section_order_map): New member function.
5151 * output.cc (Output_section::add_input_section): Check for patterns
5152 only when --section-ordering-file is specified.
5153 * gold.cc (queue_middle_tasks): Delay updating order of sections till
5154 output_sections have been formed.
5155 * layout.cc (Layout_Layout): Initialize section_order_map_.
5156 * plugin.cc (update_section_order): Store order in order_map. Do not
5157 update the order.
5158 * testsuite/Makefile.am: Add test case for plugin_final_layout.
5159 * testsuite/Makefile.in: Regenerate.
5160 * testsuite/plugin_section_order.c: New file.
5161 * testsuite/plugin_final_layout.cc: New file.
5162 * testsuite/plugin_final_layout.sh: New file.
5163
a7dac153
CC
51642011-09-29 Cary Coutant <ccoutant@google.com>
5165
4f95c8b4 5166 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 5167 Check for NULL.
4f95c8b4 5168 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
5169 symbols during incremental update.
5170 (Symbol_table::add_from_dynobj): Likewise.
5171
eebd87a5
ILT
51722011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5173 Ian Lance Taylor <iant@google.com>
5174
5175 * symtab.cc (Symbol_table::define_special_symbol): Always
5176 canonicalize version string.
5177
403a3331
CC
51782011-09-26 Cary Coutant <ccoutant@google.com>
5179
4f95c8b4
CC
5180 * gold.cc (queue_initial_tasks): Move option checks ...
5181 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
5182 some options; make others fatal.
5183
235061c2
CC
51842011-09-26 Cary Coutant <ccoutant@google.com>
5185
5186 gcc PR lto/47247
5187 * plugin.cc (get_symbols_v2): New function.
5188 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
5189 (is_referenced_from_outside): New function.
5190 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
5191 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
5192 (get_symbols): Pass version parameter.
5193 (get_symbols_v2): New function.
5194 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
5195 parameter.
5196 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
5197 (onload): Add LDPT_GET_SYMBOLS_V2.
5198 (all_symbols_read_hook): Use get_symbols_v2; check for
5199 LDPR_PREVAILING_DEF_IRONLY_EXP.
5200 * testsuite/plugin_test_3.sh: Update expected results.
5201
dc87f620
ILT
52022011-09-23 Simon Baldwin <simonb@google.com>
5203
5204 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
5205 configuration options.
5206 * configure: Regenerate.
5207 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
5208 * Makefile.in: Regenerate.
5209 * testsuite/Makefile.in: Regenerate.
5210
a8279f82
ST
52112011-09-19 Sriraman Tallam <tmsriram@google.com>
5212
5213 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
5214
0c9350c8
CC
52152011-09-19 Cary Coutant <ccoutant@google.com>
5216
5217 * incremental.cc (can_incremental_update): Fix typo in comment.
5218 * incremental.h (can_incremental_update): Likewise.
5219
aa06ae28
CC
52202011-09-18 Cary Coutant <ccoutant@google.com>
5221
5222 * incremental.cc (can_incremental_update): New function.
5223 * incremental.h (can_incremental_update): New function.
5224 * layout.cc (Layout::init_fixed_output_section): Call it.
5225 (Layout::make_output_section): Don't allow patch space in .eh_frame.
5226 * object.cc (Sized_relobj_file::do_layout): Call
5227 can_incremental_update.
5228
ebb300b2
CC
52292011-09-13 Cary Coutant <ccoutant@google.com>
5230
5231 * configure.ac: Check for glibc support for gnu_indirect_function
5232 support with static linking, setting automake conditional
5233 IFUNC_STATIC.
5234 * Makefile.in: Regenerate.
5235 * configure: Regenerate.
5236
5237 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
5238 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
5239 for IFUNC_STATIC.
5240 * testsuite/Makefile.in: Regenerate.
5241
1206d0d5
CC
52422011-09-13 Cary Coutant <ccoutant@google.com>
5243
5244 * incremental.cc (Sized_relobj_incr::do_layout): Call
5245 report_comdat_group for kept comdat sections.
5246 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
5247 * testsuite/Makefile.in: Regenerate.
5248 * testsuite/incr_comdat_test_1.cc: New source file.
5249 * testsuite/incr_comdat_test_2_v1.cc: New source file.
5250 * testsuite/incr_comdat_test_2_v2.cc: New source file.
5251 * testsuite/incr_comdat_test_2_v3.cc: New source file.
5252
40b29874
ILT
52532011-09-13 Ian Lance Taylor <iant@google.com>
5254
5255 * object.cc (Sized_relobj_file::do_layout): Remove unused local
5256 variable external_symbols_offset.
5257
1b045aac
ILT
52582011-09-12 Ian Lance Taylor <iant@google.com>
5259
5260 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
5261 triggered if object has no symbols.
5262
24c6c55a
DM
52632011-09-09 David S. Miller <davem@davemloft.net>
5264
5265 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
5266 (Output_fill_debug_line::do_write): Likewise.
5267
66570254
CC
52682011-08-29 Cary Coutant <ccoutant@google.com>
5269
5270 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
5271 casts to match formatting specs.
5272 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
5273
8ea8cd50
CC
52742011-08-26 Cary Coutant <ccoutant@google.com>
5275
5276 * layout.cc (Free_list::allocate): Provide guarantee of minimum
5277 remaining hole size when allocating.
5278 (Layout::make_output_section): Set fill methods for debug sections.
5279 * layout.h (Free_list::Free_list_node): Move from private to
5280 public.
5281 (Free_list::set_min_hole_size): New function.
5282 (Free_list::begin, Free_list::end): New functions.
5283 (Free_list::min_hole_): New data member.
5284 * output.cc: Include dwarf.h.
5285 (Output_fill_debug_info::do_minimum_hole_size): New function.
5286 (Output_fill_debug_info::do_write): New function.
5287 (Output_fill_debug_line::do_minimum_hole_size): New function.
5288 (Output_fill_debug_line::do_write): New function.
5289 (Output_section::Output_section): Initialize new data member.
5290 (Output_section::set_final_data_size): Ensure patch space is larger
5291 than minimum hole size.
5292 (Output_section::do_write): Fill holes in debug sections.
5293 * output.h (Output_fill): New class.
5294 (Output_fill_debug_info): New class.
5295 (Output_fill_debug_line): New class.
5296 (Output_section::set_free_space_fill): New function.
5297 (Output_section::free_space_fill_): New data member.
5298 * testsuite/Makefile.am (incremental_test_3): Add
5299 --incremental-patch option.
5300 (incremental_test_4): Likewise.
5301 (incremental_test_5): Likewise.
5302 (incremental_test_6): Likewise.
5303 (incremental_copy_test): Likewise.
5304 (incremental_common_test_1): Likewise.
5305 * testsuite/Makefile.in: Regenerate.
5306
7cf80422
NC
53072011-08-26 Nick Clifton <nickc@redhat.com>
5308
5309 * po/es.po: Updated Spanish translation.
5310
c3f7b0e5
CC
53112011-08-01 Cary Coutant <ccoutant@google.com>
5312
5313 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
5314 * gold/testsuite/Makefile.in: Regenerate.
5315 * gold/testsuite/justsyms_exec.c: New source file.
5316 * gold/testsuite/justsyms_lib.c: New source file.
5317
9590bf25
CC
53182011-08-01 Cary Coutant <ccoutant@google.com>
5319
5320 * layout.cc (Layout::set_segment_offsets): Don't realign text
5321 segment if -Ttext was specified.
5322 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
5323 file type.
5324 * object.h (Sized_relobj_file::e_type): New function.
5325 (Sized_relobj_file::e_type_): New data member.
5326 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
5327 base address for ET_EXEC files.
5328 * target.cc (Target::do_make_elf_object_implementation): Allow
5329 ET_EXEC files with --just-symbols option.
5330
dcd8d12e
CC
53312011-07-28 Cary Coutant <ccoutant@google.com>
5332
5333 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
5334 Add thread_number parameter.
5335 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
5336 * workqueue-threads.cc
5337 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
5338 current thread if its thread number is greater than desired thread
5339 count.
5340 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
5341 Add thread_number parameter.
5342 (Workqueue::should_cancel_thread): Likewise.
5343 (Workqueue::find_runnable_or_wait): Pass thread_number to
5344 should_cancel_thread.
5345 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
5346 parameter.
5347
804eb480
ST
53482011-07-22 Sriraman Tallam <tmsriram@google.com>
5349
5350 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
5351 only after checking if it cannot be forced local.
5352 * symtab.h (is_externally_visible): Check if the symbol is not forced
5353 local.
5354
f1ddb600
ILT
53552011-07-15 Ian Lance Taylor <iant@google.com>
5356
5357 * options.h (class General_options): Add --print-output-format.
5358 Move -EL next to -EB, for better --help output.
5359 * target-select.cc: Include <cstdio>, "options.h", and
5360 "parameters.h".
5361 (Target_selector::do_target_bfd_name): New function.
5362 (print_output_format): New function.
5363 * target-select.h (class Target_selector): Update declarations.
5364 (Target_selector::target_bfd_name): New function.
5365 (print_output_format): Declare.
5366 * main.cc: Include "target-select.h".
5367 (main): Handle --print-output-format.
5368 * gold.cc: Include "target-select.h".
5369 (queue_initial_tasks): Handle --print-output-format when there are
5370 no input files.
5371 * parameters.cc (parameters_force_valid_target): Give a better
5372 error message if -EB/-EL does not match target.
5373 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
5374 function.
5375
7d172687
ILT
53762011-07-15 Ian Lance Taylor <iant@google.com>
5377
5378 * i386.cc (class Output_data_plt_i386): Add layout_ field.
5379 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
5380 (Output_data_plt_i386::do_write): Write address of .dynamic
5381 section to first entry in .got.plt section.
5382 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
5383 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5384 Initialize layout_.
5385 (Output_data_plt_x86_64::do_write): Write address of .dynamic
5386 section to first entry in .got.plt section.
5387 * layout.h (Layout::dynamic_section): New function.
5388
e9552f7e
ST
53892011-07-13 Sriraman Tallam <tmsriram@google.com>
5390
5391 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
5392 to claim_file call.
5393 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
5394 input_section_position_, and input_section_glob_.
5395 (read_layout_from_file): Call function section_ordering_specified.
5396 * layout.h (is_section_ordering_specified): New function.
5397 (section_ordering_specified): New function.
5398 (section_ordering_specified_): New boolean member.
5399 * main.cc(main): Call load_plugins after layout object is defined.
5400 * output.cc (Output_section::add_input_section): Use
5401 function section_ordering_specified to check if section ordering is
5402 needed.
5403 * output.cc (Output_section::add_relaxed_input_section): Use
5404 function section_ordering_specified to check if section ordering is
5405 needed.
5406 (Output_section::update_section_layout): New function.
5407 (Output_section::sort_attached_input_sections): Check if input section
5408 must be reordered.
5409 * output.h (Output_section::update_section_layout): New function.
5410 * plugin.cc (get_section_count): New function.
5411 (get_section_type): New function.
5412 (get_section_name): New function.
5413 (get_section_contents): New function.
5414 (update_section_order): New function.
58797674 5415 (allow_section_ordering): New function.
e9552f7e
ST
5416 (Plugin::load): Add the new interfaces to the transfer vector.
5417 (Plugin_manager::load_plugins): New parameter.
5418 (Plugin_manager::all_symbols_read): New parameter.
5419 (Plugin_manager::claim_file): New parameter. Save the elf object for
5420 unclaimed objects.
5421 (Plugin_manager::get_elf_object): New function.
5422 (Plugin_manager::get_view): Change to directly use the bool to check
5423 if get_view is called from claim_file_hook.
5424 * plugin.h (input_objects): New function
5425 (Plugin__manager::load_plugins): New parameter.
5426 (Plugin_manager::claim_file): New parameter.
5427 (Plugin_manager::get_elf_object): New function.
5428 (Plugin_manager::in_claim_file_handler): New function.
5429 (Plugin_manager::in_claim_file_handler_): New member.
5430 (layout): New function.
5431 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
5432 handler with an extra parameter. Make the elf object before calling
5433 claim_file handler.
5434 * testsuite/plugin_test.c (get_section_count): New function pointer.
5435 (get_section_type): New function pointer.
5436 (get_section_name): New function pointer.
5437 (get_section_contents): New function pointer.
5438 (update_section_order): New function pointer.
5439 (allow_section_ordering): New function pointer.
5440 (onload): Check if the new interfaces exist.
5441
9446efde
ILT
54422011-07-13 Ian Lance Taylor <iant@google.com>
5443
5444 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
5445 relro section.
5446 * x86_64.cc (Target_x86_64::got_section): Likewise.
5447 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
5448 (relro_now_test_SOURCES): New variable.
5449 (relro_now_test_DEPENDENCIES): New variable.
5450 (relro_now_test_LDFLAGS): New variable.
5451 (relro_now_test_LDADD): New variable.
5452 (relro_now_test.so): New target.
5453 * testsuite/Makefile.in: Rebuild.
5454
07aa62f2
ILT
54552011-07-12 Ian Lance Taylor <iant@google.com>
5456
5457 PR gold/12980
5458 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
5459 GLOB_DAT relocation rather than a RELATIVE relocation for a
5460 protected symbol when creating a shared library.
5461 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5462 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
5463 * testsuite/protected_main_1.cc (main): Test that protected
5464 function has same address.
5465
e2153196
ILT
54662011-07-11 Ian Lance Taylor <iant@google.com>
5467
5468 PR gold/12979
5469 * options.h (class General_options): Add -Bgroup.
5470 * options.cc (General_options::finalize): If -Bgroup is set,
5471 default to --unresolved-symbols=report-all.
5472 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
5473 * target-reloc.h (issue_undefined_symbol_error): Handle
5474 --unresolved-symbols=report-all.
5475
6daf5215
ILT
54762011-07-08 Ian Lance Taylor <iant@google.com>
5477
5478 PR gold/11985
5479 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
5480 if linker script discards key sections.
5481 (Layout::create_dynamic_symtab): Likewise.
5482 (Layout::assign_local_dynsym_offsets): Likewise.
5483 (Layout::sized_create_version_sections): Likewise.
5484 (Layout::create_interp): Likewise.
5485 (Layout::finish_dynamic_section): Likewise.
5486 (Layout::set_dynamic_symbol_size): Likewise.
5487
beabb2c6
ILT
54882011-07-08 Ian Lance Taylor <iant@google.com>
5489
5490 PR gold/12386
5491 * options.h (class General_options): Add --unresolved-symbols.
5492 * target-reloc.h (issue_undefined_symbol_error): Check
5493 --unresolved-symbols. Add comments.
5494
9c16daf1
ILT
54952011-07-08 Ian Lance Taylor <iant@google.com>
5496
5497 * testsuite/odr_violation2.cc (Ordering::operator()): Make
5498 expression more complex.
5499
191f1a2d
ILT
55002011-07-08 Ian Lance Taylor <iant@google.com>
5501
5502 PR gold/11317
5503 * target-reloc.h (issue_undefined_symbol_error): New inline
5504 function, broken out of relocate_section.
5505 (relocate_section): Call issue_undefined_symbol_error.
5506 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5507 there is no TLS segment if we are about to issue an undefined
5508 symbol error.
5509 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5510
62855347
ILT
55112011-07-08 Ian Lance Taylor <iant@google.com>
5512
5513 PR gold/12279
5514 * resolve.cc (Symbol_table::should_override): Add fromtype
5515 parameter. Change all callers. Give error when linking together
5516 TLS and non-TLS symbol.
5517 (Symbol_table::should_override_with_special): Add fromtype
5518 parameter. Change all callers.
5519 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5520 there is no TLS segment if we have reported some errors.
5521 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5522
67181c72
ILT
55232011-07-08 Ian Lance Taylor <iant@google.com>
5524
5525 PR gold/12372
5526 * target.h (Target::plt_address_for_global): New function.
5527 (Target::plt_address_for_local): New function.
5528 (Target::plt_section_for_global): Remove.
5529 (Target::plt_section_for_local): Remove.
5530 (Target::do_plt_address_for_global): New virtual function.
5531 (Target::do_plt_address_for_local): New virtual function.
5532 (Target::do_plt_section_for_global): Remove.
5533 (Target::do_plt_section_for_local): Remove.
5534 (Target::register_global_plt_entry): Add Symbol_table and Layout
5535 parameters.
5536 * output.cc (Output_data_got::Got_entry::write): Use
5537 plt_address_for_global and plt_address_for_local.
5538 * layout.cc (Layout::add_target_dynamic_tags): Use size and
5539 address of output section.
5540 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
5541 got_irelative_, and irelative_count_ fields. Update
5542 declarations.
5543 (Output_data_plt_i386::has_irelative_section): New function.
5544 (Output_data_plt_i386::entry_count): Add irelative_count_.
5545 (Output_data_plt_i386::set_final_data_size): Likewise.
5546 (class Target_i386): Add got_irelative_ and rel_irelative_
5547 fields. Update declarations.
5548 (Target_i386::Target_i386): Initialize new fields.
5549 (Target_i386::do_plt_address_for_global): New function replacing
5550 do_plt_section_for_global.
5551 (Target_i386::do_plt_address_for_local): New function replacing
5552 do_plt_section_for_local.
5553 (Target_i386::got_section): Create got_irelative_.
5554 (Target_i386::rel_irelative_section): New function.
5555 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
5556 fields. Don't define __rel_iplt_{start,end}.
5557 (Output_data_plt_i386::add_entry): Add symtab and layout
5558 parameters. Change all callers. Use different PLT and GOT for
5559 IFUNC symbols.
5560 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
5561 layout parameters. Change all callers. Use different PLT and
5562 GOT.
5563 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
5564 (Output_data_plt_i386::rel_irelative): New function.
5565 (Output_data_plt_i386::address_for_global): New function.
5566 (Output_data_plt_i386::address_for_local): New function.
5567 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
5568 IRELATIVE GOT when changing IFUNC GOT entries.
5569 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
5570 reloc.
5571 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
5572 if we didn't create an IRELATIVE GOT.
5573 (Target_i386::Relocate::relocate): Use plt_address_for_global and
5574 plt_address_for_local.
5575 (Target_i386::do_dynsym_value): Use plt_address_for_global.
5576 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
5577 got_irelative_, and irelative_count_ fields. Update
5578 declarations.
5579 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5580 Initialize new fields. Remove symtab parameter. Change all
5581 callers.
5582 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
5583 irelative_count_.
5584 (Output_data_plt_x86_64::has_irelative_section): New function.
5585 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
5586 (class Target_x86_64): Add got_irelative_ and rel_irelative_
5587 fields. Update declarations.
5588 (Target_x86_64::Target_x86_64): Initialize new fields.
5589 (Target_x86_64::do_plt_address_for_global): New function replacing
5590 do_plt_section_for_global.
5591 (Target_x86_64::do_plt_address_for_local): New function replacing
5592 do_plt_section_for_local.
5593 (Target_x86_64::got_section): Create got_irelative_.
5594 (Target_x86_64::rela_irelative_section): New function.
5595 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
5596 all callers. Don't create __rel_iplt_{start,end}.
5597 (Output_data_plt_x86_64::add_entry): Add symtab and layout
5598 parameters. Change all callers. Use different PLT and GOT for
5599 IFUNC symbols.
5600 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
5601 layout parameters. Change all callers. Use different PLT and
5602 GOT.
5603 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
5604 parameters. Change all callers. Use different PLT and GOT for
5605 IFUNC symbols.
5606 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
5607 (Output_data_plt_x86_64::rela_irelative): New function.
5608 (Output_data_plt_x86_64::address_for_global): New function.
5609 (Output_data_plt_x86_64::address_for_local): New function.
5610 (Output_data_plt_x86_64::set_final_data_size): Likewise.
5611 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
5612 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
5613 (Target_x86_64::register_global_plt_entry): Add symtab and layout
5614 parameters.
5615 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
5616 reloc.
5617 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
5618 symbols if we didn't create an IRELATIVE GOT.
5619 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
5620 plt_address_for_local.
5621 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
5622 * testsuite/ifuncvar1.c: New test file.
5623 * testsuite/ifuncvar2.c: New test file.
5624 * testsuite/ifuncvar3.c: New test file.
5625 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
5626 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
5627 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
5628 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
5629 * testsuite/Makefile.in: Rebuild.
5630
33c15b45
CC
56312011-07-07 Cary Coutant <ccoutant@google.com>
5632
5633 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
5634 (two_file_test_1_ndebug.o): Likewise.
5635 (two_file_test_1b_ndebug.o): Likewise.
5636 (two_file_test_2_ndebug.o): Likewise.
5637 (two_file_test_main_ndebug.o): Likewise.
5638 (incremental_test_2): Link with no-debug versions.
5639
f48b5fb7
CC
56402011-07-06 Cary Coutant <ccoutant@google.com>
5641
5642 * gold/incremental.cc
5643 (Output_section_incremental_inputs::write_info_blocks): Check for
5644 hidden and internal symbols.
5645
221597a5
CC
56462011-07-06 Cary Coutant <ccoutant@google.com>
5647
5648 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
5649 Check disposition for startup file.
5650 (Incremental_inputs::report_command_line): Ignore
5651 --incremental-startup-unchanged option.
5652 * options.cc (General_options::parse_incremental_startup_unchanged):
5653 New function.
5654 (General_options::General_options): Initialize new data member.
5655 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
5656 (General_options): Add --incremental-startup-unchanged option.
5657 (General_options::incremental_startup_disposition): New function.
5658 (General_options::incremental_startup_disposition_): New data member.
5659
e24719f6
CC
56602011-07-06 Cary Coutant <ccoutant@google.com>
5661
5662 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
5663 input file index to Script_info ctor.
5664 (Sized_incremental_binary::do_file_has_changed): Find the
5665 command-line argument for files named in scripts.
5666 * incremental.h (Script_info::Script_info): New ctor
5667 with input file index.
5668 (Script_info::input_file_index): New function.
5669 (Script_info::input_file_index_): New data member.
5670 (Incremental_binary::get_library): Add const.
5671 (Incremental_binary::get_script_info): Add const.
5672 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
5673 * testsuite/Makefile.am (incremental_test_5): New test case.
5674 (incremental_test_6): New test case.
5675 * testsuite/Makefile.in: Regenerate.
5676
8f7c81e8
CC
56772011-07-06 Cary Coutant <ccoutant@google.com>
5678
5679 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
5680 debug output when command lines differ.
5681
9fbd3822
CC
56822011-07-06 Cary Coutant <ccoutant@google.com>
5683
5684 * incremental.cc (Incremental_inputs::report_command_line): Ignore
5685 --incremental-patch option.
5686 * layout.cc (Free_list::allocate): Extend allocation beyond original
5687 end if enabled.
5688 (Layout::make_output_section): Mark sections that should get
5689 patch space.
5690 * options.cc (parse_percent): New function.
5691 * options.h (parse_percent): New function.
5692 (DEFINE_percent): New macro.
5693 (General_options): Add --incremental-patch option.
5694 * output.cc (Output_section::Output_section): Initialize new data
5695 members.
5696 (Output_section::add_input_section): Print section name when out
5697 of patch space.
5698 (Output_section::add_output_section_data): Likewise.
5699 (Output_section::set_final_data_size): Add patch space when
5700 doing --incremental-full.
5701 (Output_section::do_reset_address_and_file_offset): Remove patch
5702 space.
5703 (Output_segment::set_section_list_addresses): Print debug output
5704 only if --incremental-update.
5705 * output.h (Output_section::set_is_patch_space_allowed): New function.
5706 (Output_section::is_patch_space_allowed_): New data member.
5707 (Output_section::patch_space_): New data member.
5708 * parameters.cc (Parameters::incremental_full): New function.
5709 * parameters.h (Parameters::incremental_full): New function
5710 * testsuite/Makefile.am (incremental_test_2): Add test for
5711 --incremental-patch option.
5712 * testsuite/Makefile.in: Regenerate.
5713 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
5714 (t18): Remove function body.
5715
f6cccc2c
DK
57162011-07-05 Doug Kwan <dougkwan@google.com>
5717
5718 PR gold/12771
5719 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
5720 Arm_Address type for relocation result.
5721 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
5722 overflow check.
5723 (Arm_relocate_functions::abs32): Use unaligned access.
5724 (Arm_relocate_functions::rel32): Ditto.
5725 (Arm_relocate_functions::prel31): Ditto.
5726 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
5727 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
5728 static data relocations.
5729 * testsuite/Makefile.in: Regnerate.
5730 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
5731
28a13fec
ILT
57322011-07-05 Ian Lance Taylor <iant@google.com>
5733
5734 PR gold/12392
5735 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
5736 symbols if necessary.
5737 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5738
24d47b34
ILT
57392011-07-05 Ian Lance Taylor <iant@google.com>
5740
5741 PR gold/12952
5742 * resolve.cc (Symbol::override_base_with_special): Simply override
5743 version with special symbol version, ignoring previous version.
5744
41f9cbbe
ILT
57452011-07-05 Ian Lance Taylor <iant@google.com>
5746
5747 * object.cc (Sized_relobj_file::include_section_group): Add
5748 information to comment about signature location.
5749
886288f1
ILT
57502011-07-02 Ian Lance Taylor <iant@google.com>
5751
5752 PR gold/12957
5753 * options.h (class General_options): Add -f and -F.
5754 * options.cc (General_options::finalize): Fatal error if -f/-F
5755 are used without -shared.
5756 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
5757
ae3a6d4f
ILT
57582011-07-02 Ian Lance Taylor <iant@google.com>
5759
5760 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
5761
21131061
ILT
57622011-07-01 Ian Lance Taylor <iant@google.com>
5763
5764 PR gold/12525
5765 PR gold/12952
5766 * resolve.cc (Symbol::override_base_with_special): Don't override
5767 the version if the overriding symbol has a different name.
5768 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
5769 all callers. If we give an error about an undefined version,
5770 define the base version if necessary.
5771 * dynobj.h (class Versions): Update declaration.
5772 * testsuite/weak_alias_test_5.cc: New file.
5773 * testsuite/weak_alias_test.script: New file.
5774 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
5775 and versioned_alias have the right value, and call t2.
5776 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
5777 weak_alias_test_5.so.
5778 (weak_alias_test_LDADD): Likewise.
5779 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
5780 * testsuite/Makefile.in: Rebuild.
5781
611062c0
ILT
57822011-07-01 Ian Lance Taylor <iant@google.com>
5783
5784 PR gold/12525
5785 * options.h (class General_options): Support -z notext.
5786 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
5787 -Wl,-z,notext.
5788 (two_file_shared_nonpic.so): Likewise.
5789 (two_file_shared_mixed.so): Likewise.
5790 (two_file_shared_mixed_1.so): Likewise.
5791 (weak_undef_lib_nonpic.so): Likewise.
5792 (alt/weak_undef_lib_nonpic.so): Likewise.
5793 (tls_test_shared_nonpic.so): Likewise.
5794 * testsuite/Makefile.in: Rebuild.
5795
328c7c2f
ILT
57962011-07-01 Ian Lance Taylor <iant@google.com>
5797
5798 PR gold/12525
5799 * configure.ac: Test whether static linking works, setting
5800 the automake conditional HAVE_STATIC.
5801 * testsuite/Makefile.am: Disable tests using -static if
5802 HAVE_STATIC is not true.
5803 * configure, testsuite/Makefile.in: Rebuild.
5804
02d7cd44
ILT
58052011-07-01 Ian Lance Taylor <iant@google.com>
5806
5807 PR gold/12525
5808 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
5809 Assert if we see DW_EH_PE_indirect.
5810 * target.h (Target::ehframe_datarel_base): New function.
5811 (Target::do_ehframe_datarel_base): New target function.
5812 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
5813 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
5814 function.
5815
07a60597
ILT
58162011-07-01 Ian Lance Taylor <iant@google.com>
5817
5818 PR gold/12571
5819 * options.h (class General_options): Add
5820 --ld-generated-unwind-info.
5821 * ehframe.cc (Fde::write): Add address parameter. Change all
5822 callers. If associated with PLT, fill in address and size.
5823 (Cie::set_output_offset): Only add merge mapping if there is an
5824 object.
5825 (Cie::write): Add address parameter. Change all callers.
5826 (Eh_frame::add_ehframe_for_plt): New function.
5827 * ehframe.h (class Fde): Update declarations. Move shndx_ and
5828 input_offset_ fields into union u_, with new plt field.
5829 (Fde::Fde): Adjust for new union field.
5830 (Fde::Fde) [Output_data version]: New constructor.
5831 (Fde::add_mapping): Only add merge mapping if there is an object.
5832 (class Cie): Update declarations.
5833 (class Eh_frame): Declare add_ehframe_for_plt.
5834 * layout.cc (Layout::layout_eh_frame): Break out code into
5835 make_eh_frame_section, and call it.
5836 (Layout::make_eh_frame_section): New function.
5837 (Layout::add_eh_frame_for_plt): New function.
5838 * layout.h (class Layout): Update declarations.
5839 * merge.cc (Merge_map::add_mapping): Add assertion.
5840 * i386.cc: Include "dwarf.h".
5841 (class Output_data_plt_i386): Make first_plt_entry,
5842 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
5843 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5844 and plt_eh_frame_fde.
5845 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
5846 boundary. Call add_eh_frame_for_plt if appropriate.
5847 * x86_64.cc: Include "dwarf.h".
5848 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
5849 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
5850 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5851 and plt_eh_frame_fde.
5852 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
5853 appropriate.
5854
14788a3f
ILT
58552011-06-29 Ian Lance Taylor <iant@google.com>
5856
5857 PR gold/12629
5858 * object.cc (Sized_relobj_file::layout_section): Change shdr
5859 parameter to be const.
5860 (Sized_relobj_file::layout_eh_frame_section): New function, broken
5861 out of do_layout.
5862 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
5863 appropriate. Call layout_eh_frame_section.
5864 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
5865 sections.
5866 * object.h (class Sized_relobj_file): Update declarations.
5867
6c21fce1
ILT
58682011-06-29 Ian Lance Taylor <iant@google.com>
5869
37e41b03 5870 PR gold/12652
6c21fce1
ILT
5871 * script.cc (Token::integer_value): Accept trailing M/m/K/k
5872 modifier.
5873 (Lex::gather_token): Accept trailing M/m/K/k for integers.
5874
4d5e4e62
ILT
58752011-06-29 Ian Lance Taylor <iant@google.com>
5876
5877 PR gold/12675
5878 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
5879 SHT_X86_64_UNWIND.
5880 * layout.cc (Layout::layout_eh_frame): Likewise.
5881
886f533a
ILT
58822011-06-29 Ian Lance Taylor <iant@google.com>
5883
5884 PR gold/12695
5885 * layout.cc (Layout::symtab_section_shndx): New function.
5886 * layout.h (class Layout): Declare symtab_section_shndx.
5887 * output.cc (Output_section::write_header): Call it.
5888
f3ae1b28
ILT
58892011-06-29 Ian Lance Taylor <iant@google.com>
5890
5891 PR gold/12818
5892 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
5893 symbols which are not used in a relocation.
5894
aecf301f
ILT
58952011-06-28 Ian Lance Taylor <iant@google.com>
5896
5897 PR gold/12898
5898 * layout.cc (Layout::segment_precedes): Don't crash if a linker
5899 script create indistinguishable segments.
5900 (Layout::set_segment_offsets): Use stable_sort when sorting
5901 segments. Pass this to Compare_segments constructor.
5902 * layout.h (class Layout): Make segment_precedes non-static.
5903 (class Compare_segments): Change from struct to class. Add
5904 layout_ field. Add constructor.
5905 * script-sections.cc
5906 (Script_sections::attach_sections_using_phdrs_clause): Rename
5907 local orphan to is_orphan. Don't report failure to put empty
5908 section in segment. On attachment failure, report name of
5909 section, and attach to first PT_LOAD segment.
5910
03ef7571
ILT
59112011-06-28 Ian Lance Taylor <iant@google.com>
5912
5913 PR gold/12934
5914 * target-select.cc (Target_selector::Target_selector): Add
5915 emulation parameter. Change all callers.
5916 (select_target_by_bfd_name): Rename from select_target_by_name.
5917 Change all callers.
5918 (select_target_by_emulation): New function.
5919 (supported_emulation_names): New function.
5920 * target-select.h (class Target_selector): Add emulation_ field.
5921 Update declarations.
5922 (Target_selector::recognize_by_bfd_name): Rename from
5923 recognize_by_name. Change all callers.
5924 (Target_selector::supported_bfd_names): Rename from
5925 supported_names. Change all callers.
5926 (Target_selector::recognize_by_emulation): New function.
5927 (Target_selector::supported_emulations): New function.
5928 (Target_selector::emulation): New function.
5929 (Target_selector::do_recognize_by_bfd_name): Rename from
5930 do_recognize_by_name. Change all callers.
5931 (Target_selector::do_supported_bfd_names): Rename from
5932 do_supported_names. Change all callers.
5933 (Target_selector::do_recognize_by_emulation): New function.
5934 (Target_selector::do_supported_emulations): New function.
5935 (select_target_by_bfd_name): Change name in declaration.
5936 (select_target_by_emulation): Declare.
5937 (supported_emulation_names): Declare.
5938 * parameters.cc (parameters_force_valid_target): Try to find
5939 target based on emulation from -m option.
5940 * options.h (class General_options): Change doc string for -m.
5941 * options.cc (help): Print emulations.
5942 (General_options::parse_V): Likewise.
5943 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
5944 Add emulation parameter. Change all callers.
5945
200b2bb9
ILT
59462011-06-28 Ian Lance Taylor <iant@google.com>
5947
5948 * target.h (class Target): Add osabi_ field.
5949 (Target::osabi): New function.
5950 (Target::set_osabi): New function.
5951 (Target::Target): Initialize osabi_.
5952 (Target::do_adjust_elf_header): Make pure virtual.
5953 (Sized_target::do_adjust_elf_header): Declare.
5954 * target.cc (Sized_target::do_adjust_elf_header): New function.
5955 (class Sized_target): Instantiate all versions.
5956 * freebsd.h (class Target_freebsd): Remove.
5957 (Target_selector_freebsd::do_recognize): Call set_osabi on
5958 Target.
5959 (Target_selector_freebsd::do_recognize_by_name): Likewise.
5960 (Target_selector_freebsd::set_osabi): Remove.
5961 * i386.cc (class Target_i386): Inherit from Sized_target rather
5962 than Target_freebsd.
5963 * x86_64.cc (class Target_x86_64): Likewise.
5964
b3ce541e
ILT
59652011-06-28 Ian Lance Taylor <iant@google.com>
5966
5967 * target.h (Target::can_check_for_function_pointers): Rewrite.
5968 Make non-virtual.
5969 (Target::can_icf_inline_merge_sections): Likewise.
5970 (Target::section_may_have_icf_unsafe_poineters): Likewise.
5971 (Target::Target_info): Add can_icf_inline_merge_sections field.
5972 (Target::do_can_check_for_function_pointers): New virtual
5973 function.
5974 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
5975 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
5976 from can_check_for_function_pointers, move in file.
5977 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
5978 section_may_have_icf_unsafe_poineters, move in file.
5979 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
5980 * i386.cc (Target_i386::do_can_check_for_function_pointers):
5981 Rename from can_check_for_function_pointers, move in file.
5982 (Target_i386::can_icf_inline_merge_sections): Remove.
5983 (Target_i386::i386_info): Initialize
5984 can_icf_inline_merge_sections.
5985 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
5986 Initialize can_icf_inline_merge_sections.
5987 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
5988 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
5989 Rename from can_check_for_function_pointers, move in file.
5990 (Target_x86_64::can_icf_inline_merge_sections): Remove.
5991 (Target_x86_64::x86_64_info): Initialize
5992 can_icf_inline_merge_sections.
5993 * testsuite/testfile.cc (Target_test::test_target_info):
5994 Likewise.
5995 * icf.cc (get_section_contents): Correct formatting.
5996
6d1c4efb
ILT
59972011-06-27 Ian Lance Taylor <iant@google.com>
5998
5999 * symtab.cc (Symbol::versioned_name): New function.
6000 (Symbol_table::add_to_final_symtab): Use versioned_name when
6001 appropriate.
6002 (Symbol_table::sized_write_symbol): Likewise.
6003 * symtab.h (class Symbol): Declare versioned_name.
6004 * stringpool.h (class Stringpool_template): Add variant of add
6005 which takes a std::basic_string.
6006 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
6007 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
6008 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
6009 (ver_test_12.o): New target.
6010 * testsuite/Makefile.in: Rebuild.
6011
57eb9b50
DK
60122011-06-27 Doug Kwan <dougkwan@google.com>
6013
6014 * arm.cc (Arm_relocate_functions::thm_jump8,
6015 Arm_relocate_functions::thm_jump11): Use a wider signed
6016 type to compute offset.
6017 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
6018 arm_thm_jump8.
6019 * testsuite/Makefile.in: Regenerate.
6020 * testsuite/arm_branch_in_range.sh: Check test results of
6021 arm_thm_jump11 and arm_thm_jump8.
6022 * testsuite/arm_thm_jump11.s: New test source file.
6023 * testsuite/arm_thm_jump11.t: New linker script.
6024 * testsuite/arm_thm_jump8.s: New test source file.
6025 * testsuite/arm_thm_jump8.t: New linker script.
6026
487b39df
ILT
60272011-06-24 Ian Lance Taylor <iant@google.com>
6028
6029 * layout.cc: Include "object.h".
6030 (ctors_sections_in_init_array): New static variable.
6031 (Layout::is_ctors_in_init_array): New function.
6032 (Layout::layout): Add entry to ctors_sections_in_init_array if
6033 appropriate.
6034 * layout.h (class Layout): Declare is_ctors_in_init_array.
6035 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
6036 is_ctors_reverse_view is set.
6037 (Sized_relobj_file::write_sections): Add layout parameter. Change
6038 all callers. Set is_ctors_reverse_view field of View_size.
6039 (Sized_relobj_file::reverse_words): New function.
6040 * object.h (Sized_relobj_file::View_size): Add
6041 is_ctors_reverse_view field.
6042 (class Sized_relobj_file): Update declarations.
6043 * testsuite/initpri3.c: New test.
6044 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
6045 initpri3b.
6046 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
6047 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
6048 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
6049 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
6050 * testsuite/Makefile.in: Rebuild.
6051
472076e4
CC
60522011-06-24 Cary Coutant <ccoutant@google.com>
6053
6054 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
6055 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
6056 (debug_msg_cdebug.err): New targets.
6057 * testsuite/Makefile.in: Regenerate.
6058 * testsuite/debug_msg.sh: Check output of link with compressed debug.
6059 Fix checks for link with shared library.
6060
a60af0db
DK
60612011-06-24 Doug Kwan <dougkwan@google.com>
6062
6063 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
6064 skip empty text sections.
6065 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
6066
5393d741
ILT
60672011-06-22 Ian Lance Taylor <iant@google.com>
6068
6069 PR gold/12910
6070 * options.h (class General_options): Add --ctors-in-init-array.
6071 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
6072 friends as SHT_PROGBITS for merging sections.
6073 (Layout::layout): Remove special handling of .init_array and
6074 friends. Don't sort if doing relocatable link. Sort for .ctors
6075 and .dtors if ctors_in_init_array.
6076 (Layout::make_output_section): Force correct section types for
6077 .init_array and friends. Don't sort if doing relocatable link,
6078 Don't sort .ctors and .dtors if ctors_in_init_array.
6079 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
6080 (Layout::output_section_name): Add relobj parameter. Change all
6081 callers. Handle .ctors. and .dtors. in code rather than table.
6082 Handle .ctors and .dtors if ctors_in_init_array.
6083 (Layout::match_file_name): New function, moved from output.cc.
6084 * layout.h (class Layout): Update declarations.
6085 * output.cc: Include "layout.h".
6086 (Input_section_sort_entry::get_priority): New function.
6087 (Input_section_sort_entry::match_file_name): Just call
6088 Layout::match_file_name.
6089 (Output_section::Input_section_sort_init_fini_compare::operator()):
6090 Handle .ctors and .dtors. Sort by explicit priority rather than
6091 by name.
6092 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
6093 * testsuite/initpri2.c: New test.
6094 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
6095 (check_PROGRAMS): Add initpri2.
6096 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
6097 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
6098 * configure, testsuite/Makefile.in: Rebuild.
6099
e1f74f98
ILT
61002011-06-19 Ian Lance Taylor <iant@google.com>
6101
6102 PR gold/12880
6103 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
6104 .interp section to a PT_INTERP segment even if we have seen a
6105 --dynamic-linker option. Don't do it if we have seen a PHDRS
6106 clause in a linker script.
6107 (Layout::finalize): Don't create a .interp section if we've
6108 already create a PT_INTERP segment.
6109 (Layout::create_interp): Always call choose_output_section (revert
6110 patch of 2011-06-17). Don't create PT_INTERP segment.
6111 * script-sections.cc
6112 (Script_sections::create_note_and_tls_segments): Add a .interp
6113 section to a PT_INTERP segment even if we have seen a
6114 --dynamic-linker option.
6115
766f91bb
ILT
61162011-06-18 Ian Lance Taylor <iant@google.com>
6117
6118 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
6119 merely because a non-PT_LOAD segment has a dynamic reloc.
6120
0d212c3a
ILT
61212011-06-18 Ian Lance Taylor <iant@google.com>
6122
6123 * layout.cc (Layout::finish_dynamic_section): Don't create
6124 DT_FLAGS entry if not needed.
6125
911a5072
ILT
61262011-06-18 Ian Lance Taylor <iant@google.com>
6127
6128 PR gold/12745
6129 * layout.cc (Layout::layout_eh_frame): Correct handling of
6130 writable .eh_frame section.
6131
534b4e5f
ILT
61322011-06-17 Ian Lance Taylor <iant@google.com>
6133
6134 PR gold/12893
6135 * resolve.cc (Symbol_table::resolve): Don't give an error if a
6136 symbol is redefined with the exact same object and value.
6137
10b4f102
ILT
61382011-06-17 Ian Lance Taylor <iant@google.com>
6139
6140 PR gold/12880
6141 * layout.h (class Layout): Add interp_segment_ field.
6142 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
6143 (Layout::attach_allocated_section_to_segment): If making shared
6144 library, put .interp section in PT_INTERP segment.
6145 (Layout::finalize): Also call create_interp if -dynamic-linker
6146 option was used.
6147 (Layout::create_interp): Assert that there is no PT_INTERP
6148 segment. If not using a SECTIONS clause, use make_output_section.
6149 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
6150 * script-sections.cc
6151 (Script_sections::create_note_and_tls_segments): If making shared
6152 library, put .interp section in PT_INTERP segment.
6153
a29b0dad
ILT
61542011-06-17 Ian Lance Taylor <iant@google.com>
6155
e588ea8d
ILT
6156 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
6157 when making a shared library.
6158
61592011-06-17 Ian Lance Taylor <iant@google.com>
6160
6161 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
6162 parameter. Change all callers. Don't issue warning about PC32
6163 against locally defined symbol.
a29b0dad 6164
9d3b0698
ILT
61652011-06-16 Ian Lance Taylor <iant@google.com>
6166
6167 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
6168 occurs in same object.
6169
85b0f90c
AM
61702011-06-14 Alan Modra <amodra@gmail.com>
6171
6172 * po/POTFILES.in: Regenerate.
6173
a94907d9
ILT
61742011-06-09 Ian Lance Taylor <iant@google.com>
6175
6176 * script-sections.cc
6177 (Orphan_output_section::set_section_addresses): For a relocatable
6178 link set address to 0.
6179
4fb3a1c3
CC
61802011-06-09 Cary Coutant <ccoutant@google.com>
6181
6182 PR gold/12804
6183 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
6184 used with --compress-debug-sections.
6185 * gold/object.cc (Sized_relobj_file::do_layout): Report
6186 uncompressed size of compressed input sections.
6187
61220854
CC
61882011-06-08 Cary Coutant <ccoutant@google.com>
6189
6190 PR gold/12804
6191 * testsuite/two_file_test_2_v1.cc: Change initialization of
6192 v2 to keep it in .data.
6193
e6455dfb
CC
61942011-06-07 Cary Coutant <ccoutant@google.com>
6195
6196 * common.cc (Symbol_table::do_allocate_commons_list): Call
6197 gold_fallback.
6198 * errors.cc (Errors::fatal): Adjust call to gold_exit.
6199 (Errors::fallback): New function.
6200 (gold_fallback): New function.
6201 * errors.h (Errors::fallback): New function.
6202 * gold.cc (gold_exit): Change status parameter to enum; adjust
6203 all callers.
6204 (queue_initial_tasks): Call gold_fallback.
6205 * gold.h: Include cstdlib.
6206 (Exit_status): New enum type.
6207 (gold_exit): Change status parameter to enum.
6208 (gold_fallback): New function.
6209 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
6210 (Layout::create_symtab_sections): Likewise.
6211 (Layout::create_shdrs): Likewise.
6212 * main.cc (main): Adjust call to gold_exit.
6213 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
6214 (Output_data_got::add_got_entry_pair): Likewise.
6215 (Output_section::add_input_section): Likewise.
6216 (Output_section::add_output_section_data): Likewise.
6217 (Output_segment::set_section_list_addresses): Likewise.
6218 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
6219
fb0e076f
CC
62202011-06-07 Cary Coutant <ccoutant@google.com>
6221
6222 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
6223 for incremental links.
6224 * output.cc (Output_segment::set_section_list_addresses): Remove
6225 FIXME and test for TLS or BSS.
6226
a5ee4d5d
CC
62272011-06-07 Cary Coutant <ccoutant@google.com>
6228
6229 * testsuite/Makefile.am: Add incremental_copy_test,
6230 incremental_common_test_1.
6231 * testsuite/Makefile.in: Regenerate.
6232 * testsuite/common_test_1_v1.c: New source file.
6233 * testsuite/common_test_1_v2.c: New source file.
6234 * testsuite/copy_test_v1.cc: New source file.
6235
5146f448
CC
62362011-06-07 Cary Coutant <ccoutant@google.com>
6237
6238 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
6239 update, allocate common from bss section's free list.
6240 * incremental-dump.cc (dump_incremental_inputs): Print flag for
6241 linker-defined symbols.
6242 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
6243 Skip GOT and PLT entries that are no longer referenced.
6244 (Output_section_incremental_inputs::write_info_blocks): Mark
6245 linker-defined symbols.
6246 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
6247 * output.cc (Output_section::allocate): New function.
6248 * output.h (Output_section::allocate): New function.
6249 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
6250 linker-defined symbols.
6251 (Symbol::override_base_with_special): Copy is_predefined_ flag.
6252 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
6253 (Symbol::init_base_output_data): Likewise.
6254 (Symbol::init_base_output_segment): Likewise.
6255 (Symbol::init_base_constant): Likewise.
6256 (Sized_symbol::init_output_data): Likewise.
6257 (Sized_symbol::init_output_segment): Likewise.
6258 (Sized_symbol::init_constant): Likewise.
6259 (Symbol_table::do_define_in_output_data): Likewise.
6260 (Symbol_table::do_define_in_output_segment): Likewise.
6261 (Symbol_table::do_define_as_constant): Likewise.
6262 * symtab.h (Symbol::is_predefined): New function.
6263 (Symbol::init_base_output_data): Add is_predefined parameter.
6264 (Symbol::init_base_output_segment): Likewise.
6265 (Symbol::init_base_constant): Likewise.
6266 (Symbol::is_predefined_): New data member.
6267 (Sized_symbol::init_output_data): Add is_predefined parameter.
6268 (Sized_symbol::init_output_segment): Likewise.
6269 (Sized_symbol::init_constant): Likewise.
6270 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
6271
26d3c67d
CC
62722011-06-07 Cary Coutant <ccoutant@google.com>
6273
6274 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
6275 instead of emit_copy_reloc.
6276 (Copy_relocs::emit_copy_reloc): Refactor.
6277 (Copy_relocs::make_copy_reloc): New function.
6278 (Copy_relocs::add_copy_reloc): Remove.
6279 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
6280 section.
6281 (Copy_relocs::make_copy_reloc): New function.
6282 (Copy_relocs::add_copy_reloc): Remove.
6283 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
6284 unchanged input files.
6285 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
6286 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
6287 Reserve BSS space for COPY relocations.
6288 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6289 (Output_section_incremental_inputs::write_info_blocks): Record
6290 whether a symbol is copied from a shared object.
6291 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
6292 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
6293 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
6294 (Incremental_input_entry_reader::get_output_symbol_index): Add
6295 is_copy parameter.
6296 (Incremental_binary::emit_copy_relocs): New function.
6297 (Incremental_binary::do_emit_copy_relocs): New function.
6298 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6299 new data member.
6300 (Sized_incremental_binary::add_copy_reloc): New function.
6301 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6302 (Sized_incremental_binary::Copy_reloc): New struct.
6303 (Sized_incremental_binary::Copy_relocs): New typedef.
6304 (Sized_incremental_binary::copy_relocs_): New data member.
6305 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
6306 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
6307 * target.h (Sized_target::emit_copy_reloc): New function.
6308 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
6309
7cdb37d9
CC
63102011-06-02 Cary Coutant <ccoutant@google.com>
6311
6312 PR gold/12163
6313 * gold/archive.cc (Archive::Archive): Initialize new data member.
6314 (Archive::include_all_members): Return if archive has already been
6315 included.
6316 * gold/archive.h (Archive::include_all_members_): New data member.
6317
cc643b88
NC
63182011-06-02 Nick Clifton <nickc@redhat.com>
6319
6320 * dynobj.h: Fix spelling mistake in comment.
6321 * output.cc: Likewise.
6322
f62a3ca7 63232011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 6324 Asier Llano
f62a3ca7
DK
6325
6326 PR gold/12826
cc643b88 6327 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
6328 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
6329 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
6330 redundant arm_exidx_test.so.
6331 * testsuite/Makefile.in: Regenerate.
6332 (check_SCRIPTS): Add pr12826.sh
6333 (check_DATA): Add pr12826.stdout
6334 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
6335 * testsuite/pr12826.sh: New file.
6336 * testsuite/pr12826_1.s: Ditto.
6337 * testsuite/pr12826_1.s: Ditto.
6338
8dbe1edc
ILT
63392011-05-30 Ian Lance Taylor <iant@google.com>
6340
6341 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
6342 sections.
6343
c49875be
ILT
63442011-05-29 Ian Lance Taylor <iant@google.com>
6345
6346 PR gold/12804
6347 * testsuite/Makefile.am: Use different file name for two_file_test
6348 temporary file for each incremental test.
6349 * testsuite/Makefile.in: Rebuild.
6350
69d53f7a
ILT
63512011-05-29 Ian Lance Taylor <iant@google.com>
6352
6353 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
6354 binary input file is empty.
6355
41d0ab5f
ILT
63562011-05-27 Ian Lance Taylor <iant@google.com>
6357
6358 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
6359 (ver_test_9.so): Likewise.
6360 * testsuite/Makefile.in: Rebuild.
6361
89d8a36b
CC
63622011-05-26 Cary Coutant <ccoutant@google.com>
6363
6364 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
6365 * incremental.cc (Incremental_inputs::report_input_section): Fix
6366 comment, indentation.
6367 (Incremental_inputs::report_comdat_group): New function.
6368 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6369 of data for incremental input file entry.
6370 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
6371 group count, COMDAT group signatures.
6372 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
6373 an unchanged input file.
6374 * incremental.h (Incremental_object_entry::Incremental_object_entry):
6375 Initialize new data member.
6376 (Incremental_object_entry::add_comdat_group): New function.
6377 (Incremental_object_entry::get_comdat_group_count): New function.
6378 (Incremental_object_entry::get_comdat_signature_key): New function.
6379 (Incremental_object_entry::groups_): New data member.
6380 (Incremental_inputs::report_comdat_group): New function.
6381 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
6382 data for incremental input file entry.
6383 (Incremental_input_entry_reader::get_comdat_group_count): New function.
6384 (Incremental_input_entry_reader::get_input_section): Adjust size of
6385 data for incremental input file entry.
6386 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
6387 (Incremental_input_entry_reader::get_comdat_group_signature): New
6388 function.
6389 * object.cc (Sized_relobj::include_section_group): Report kept
6390 COMDAT groups for incremental links.
6391
1706a06f
ILT
63922011-05-24 David Meyer <pdox@google.com>
6393
6394 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
6395 with name parameter. Add found_name parameter.
6396 * fileread.cc (Input_file::find_file): Adjust code accordingly.
6397 * dirsearch.h (class Dirsearch): Update declaration.
6398
a10ae760
ILT
63992011-05-24 Ian Lance Taylor <iant@google.com>
6400
6401 * archive.cc (Library_base::should_include_member): Pull in object
6402 from archive if it defines the entry symbol.
6403 * parameters.cc (Parameters::entry): New function.
6404 * parameters.h (class Parameters): Declare entry.
6405 * output.h (class Output_file_header): Remove entry_ field.
6406 * output.cc (Output_file_header::Output_file_header): Remove entry
6407 parameter. Change all callers.
6408 (Output_file_header::entry): Use parameters->entry.
6409 * gold.cc (queue_middle_tasks): Likewise.
6410 * plugin.cc (Plugin_hook::run): Likewise.
6411
aa92d6ed
CC
64122011-05-24 Cary Coutant <ccoutant@google.com>
6413
6414 * gold.cc (queue_initial_tasks): Pass incremental base filename
6415 to Output_file::open_base_file; don't print error message.
6416 * incremental-dump.cc (main): Adjust call to
6417 Output_file::open_for_modification.
6418 * incremental-dump.cc (main): Likewise.
6419 * incremental.cc (Incremental_inputs::report_command_line):
6420 Ignore --incremental-base option when comparing command lines.
6421 Ignore parameter when given as separate argument.
6422 * options.h (class General_options): Add --incremental-base.
6423 * output.cc (Output_file::Output_file):
6424 (Output_file::open_base_file): Add base_name and writable parameters;
6425 read base file into new file; print error message here.
6426 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6427 callers.
6428 * output.h (Output_file::open_for_modification): Rename to...
6429 (Output_file::open_base_file): ...this; add base_name and
6430 writable parameters; adjust all callers.
6431 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6432 callers.
6433 * testsuite/Makefile.am (incremental_test_4): Test
6434 --incremental-base.
6435 * testsuite/Makefile.in: Regenerate.
6436
2eedd706
CC
64372011-05-24 Cary Coutant <ccoutant@google.com>
6438
6439 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
6440 incremental_test_4.
6441 * testsuite/Makefile.in: Regenerate.
6442 * testsuite/two_file_test_1_v1.cc: New test source file.
6443 * testsuite/two_file_test_1b_v1.cc: New test source file.
6444 * testsuite/two_file_test_2_v1.cc: New test source file.
6445
0f1c85a6
CC
64462011-05-24 Cary Coutant <ccoutant@google.com>
6447
6448 * dynobj.h (Dynobj::do_dynobj): New function.
6449 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
6450 flag and soname for shared objects.
6451 * incremental.cc (Incremental_inputs::report_object): Make
6452 either Incremental_object_entry or Incremental_dynobj_entry; add
6453 soname to string table.
6454 (Incremental_inputs::report_input_section): Add assertion.
6455 (Output_section_incremental_inputs::set_final_data_size): Adjust
6456 type of input file entry for shared libraries; adjust size of
6457 shared library info entry.
6458 (Output_section_incremental_inputs::write_input_files): Write
6459 as_needed flag for shared libraries.
6460 (Output_section_incremental_inputs::write_info_blocks): Adjust type
6461 of input file entry for shared libraries; write soname.
6462 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
6463 soname from incremental info.
6464 * incremental.h (enum Incremental_input_flags): Add
6465 INCREMENTAL_INPUT_AS_NEEDED.
6466 (Incremental_input_entry::Incremental_input_entry): Initialize new
6467 data member.
6468 (Incremental_input_entry::set_as_needed): New function.
6469 (Incremental_input_entry::as_needed): New function.
6470 (Incremental_input_entry::do_dynobj_entry): New function.
6471 (Incremental_input_entry::as_needed_): New data member.
6472 (Incremental_object_entry::Incremental_object_entry): Don't check
6473 for shared library.
6474 (Incremental_object_entry::do_type): Likewise.
6475 (class Incremental_dynobj_entry): New class.
6476 (Incremental_input_entry_reader::as_needed): New function.
6477 (Incremental_input_entry_reader::get_soname): New function.
6478 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
6479 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
6480 size of shared library info entry.
58797674 6481 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
6482 incremental link when adding DT_NEEDED entries.
6483 * object.h (Object::Object): Initialize new data member.
6484 (Object::dynobj): New function.
6485 (Object::set_as_needed): New function.
6486 (Object::as_needed): New function.
6487 (Object::do_dynobj): New function.
6488 (Object::as_needed_): New data member.
6489
6fa2a40b
CC
64902011-05-24 Cary Coutant <ccoutant@google.com>
6491
6492 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
6493 info; adjust display of GOT entries.
6494 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6495 vector of input objects; remove file_status_.
6496 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
6497 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
6498 got_plt reader; call target hooks to reserve GOT entries.
6499 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6500 of input file info header and GOT info entry.
6501 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
6502 relocation info.
6503 (Got_plt_view_info::got_descriptor): Remove.
6504 (Got_plt_view_info::sym_index): New data member.
6505 (Got_plt_view_info::input_index): New data member.
6506 (Local_got_offset_visitor::visit): Write input file index.
6507 (Global_got_offset_visitor::visit): Write 0 for input file index.
6508 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
6509 with sym_index and input_index.
6510 (Output_section_incremental_inputs::write_got_plt): Adjust size of
6511 incremental info GOT entry; replace got_descriptor with input_index.
6512 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
6513 map from input file index to object.
6514 (Sized_relobj_incr::do_layout): Replace direct data member reference
6515 with accessor function.
6516 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
6517 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
6518 Adjust size of input file info header.
6519 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
6520 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
6521 (Incremental_input_entry_reader::get_input_section): Adjust size of
6522 input file info header.
6523 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
6524 of incremental info GOT entry.
6525 (Incremental_got_plt_reader::get_got_desc): Remove.
6526 (Incremental_got_plt_reader::get_got_symndx): New function.
6527 (Incremental_got_plt_reader::get_got_input_index): New function.
6528 (Sized_incremental_binary::Sized_incremental_binary): Remove
6529 file_status_; add input_objects_.
6530 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
6531 (Sized_incremental_binary::set_file_is_unchanged): Remove.
6532 (Sized_incremental_binary::file_is_unchanged): Remove.
6533 (Sized_incremental_binary::set_input_object): New function.
6534 (Sized_incremental_binary::input_object): New function.
6535 (Sized_incremental_binary::file_status_): Remove.
6536 (Sized_incremental_binary::input_objects_): New data member.
6537 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
6538 references.
6539 (Sized_relobj_incr::invalid_address): Move to base class.
6540 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
6541 class.
6542 (Sized_relobj_incr::do_output_section_offset): Likewise.
6543 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
6544 (Sized_relobj_incr::section_offsets_): Likewise.
6545 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
6546 function.
6547 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
6548 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
6549 with accessor function.
6550 (Sized_relobj_file::do_layout): Likewise.
6551 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
6552 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
6553 (Sized_relobj_file::compute_final_local_value): Replace refs to
6554 section_offsets_ with accessor function.
6555 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
6556 * object.h (Relobj::Relobj): Initialize new data members.
6557 (Relobj::add_dyn_reloc): New function.
6558 (Relobj::first_dyn_reloc): New function.
6559 (Relobj::dyn_reloc_count): New function.
6560 (Relobj::first_dyn_reloc_): New data member.
6561 (Relobj::dyn_reloc_count_): New data member.
6562 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
6563 references.
6564 (Sized_relobj::Address): New typedef.
6565 (Sized_relobj::invalid_address): Move here from child class.
6566 (Sized_relobj::Sized_relobj): Initialize new data members.
6567 (Sized_relobj::sized_relobj): New function.
6568 (Sized_relobj::is_output_section_offset_invalid): Move here from
6569 child class.
6570 (Sized_relobj::get_output_section_offset): Likewise.
6571 (Sized_relobj::local_has_got_offset): Likewise.
6572 (Sized_relobj::local_got_offset): Likewise.
6573 (Sized_relobj::set_local_got_offset): Likewise.
6574 (Sized_relobj::do_for_all_local_got_entries): Likewise.
6575 (Sized_relobj::clear_got_offsets): New function.
6576 (Sized_relobj::section_offsets): Move here from child class.
6577 (Sized_relobj::do_output_section_offset): Likewise.
6578 (Sized_relobj::do_set_section_offset): Likewise.
6579 (Sized_relobj::Local_got_offsets): Likewise.
6580 (Sized_relobj::local_got_offsets_): Likewise.
6581 (Sized_relobj::section_offsets_): Likewise.
6582 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
6583 references.
6584 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
6585 class.
6586 (Sized_relobj_file::sized_relobj): New function
6587 (Sized_relobj_file::local_has_got_offset): Move to base class.
6588 (Sized_relobj_file::local_got_offset): Likewise.
6589 (Sized_relobj_file::set_local_got_offset): Likewise.
6590 (Sized_relobj_file::get_output_section_offset): Likewise.
6591 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
6592 (Sized_relobj_file::do_output_section_offset): Likewise.
6593 (Sized_relobj_file::do_set_section_offset): Likewise.
6594 (Sized_relobj_file::Local_got_offsets): Likewise.
6595 (Sized_relobj_file::local_got_offsets_): Likewise.
6596 (Sized_relobj_file::section_offsets_): Likewise.
6597 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
6598 (all constructors).
6599 (set_needs_dynsym_index): Convert relobj to derived class pointer.
6600 (Output_reloc::get_symbol_index): Likewise.
6601 (Output_reloc::local_section_offset): Likewise.
6602 (Output_reloc::get_address): Likewise.
6603 (Output_reloc::symbol_value): Likewise.
6604 (Output_data_got::reserve_slot): Move to class definition.
6605 (Output_data_got::reserve_local): New function.
6606 (Output_data_got::reserve_slot_for_global): Remove.
6607 (Output_data_got::reserve_global): New function.
6608 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
6609 (all constructors, two instantiations).
6610 (Output_reloc::get_relobj): New function (two instantiations).
6611 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
6612 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
6613 (Output_data_reloc::add_global): Adjust type of relobj.
6614 (Output_data_reloc::add_global_relative): Likewise.
6615 (Output_data_reloc::add_symbolless_global_addend): Likewise.
6616 (Output_data_reloc::add_local): Likewise.
6617 (Output_data_reloc::add_local_relative): Likewise.
6618 (Output_data_reloc::add_symbolless_local_addend): Likewise.
6619 (Output_data_reloc::add_local_section): Likewise.
6620 (Output_data_reloc::add_output_section): Likewise.
6621 (Output_data_reloc::add_absolute): Likewise.
6622 (Output_data_reloc::add_target_specific): Likewise.
6623 (Output_data_got::reserve_slot): Move definition here.
6624 (Output_data_got::reserve_local): New function.
6625 (Output_data_got::reserve_global): New function.
6626 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
6627 section_offsets_ with accessor function.
6628 (Sized_relobj_file::write_sections): Likewise.
6629 (Sized_relobj_file::do_relocate_sections): Likewise.
6630 * target.h (Sized_target::reserve_local_got_entry): New function.
6631 (Sized_target::reserve_global_got_entry): New function.
6632 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
6633 (Target_x86_64::reserve_global_got_entry): New function.
6634 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
6635
4829d394
CC
66362011-05-23 Cary Coutant <ccoutant@google.com>
6637
6638 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
6639 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
6640 bit when checking got_type.
6641 * incremental.cc (Sized_incremental_binary::setup_readers):
6642 Store symbol table and string table locations; initialize bit vector
6643 of file status flags.
6644 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
6645 unchanged files.
6646 (Sized_incremental_binary::do_process_got_plt): New function.
6647 (Sized_incremental_binary::get_symtab_view): Use stored locations.
6648 (Output_section_incremental_inputs::set_final_data_size): Record
6649 file index for each input file.
6650 (Output_section_incremental_inputs::write_got_plt): Store file index
6651 instead of input entry offset for each GOT entry.
6652 * incremental.h
6653 (Incremental_input_entry::Incremental_input_entry): Initialize new
6654 data member.
6655 (Incremental_input_entry::set_offset): Store file index.
6656 (Incremental_input_entry::get_file_index): New function.
6657 (Incremental_input_entry::file_index_): New data member.
6658 (Incremental_binary::process_got_plt): New function.
6659 (Incremental_binary::do_process_got_plt): New function.
6660 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6661 data members.
6662 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
6663 (Sized_incremental_binary::set_file_is_unchanged): New function.
6664 (Sized_incremental_binary::file_is_unchanged): New function.
6665 (Sized_incremental_binary::do_process_got_plt): New function.
6666 (Sized_incremental_binary::file_status_): New data member.
6667 (Sized_incremental_binary::main_symtab_loc_): New data member.
6668 (Sized_incremental_binary::main_strtab_loc_): New data member.
6669 * output.cc (Output_data_got::Got_entry::write): Add case
6670 RESERVED_CODE.
6671 (Output_data_got::add_global): Call add_got_entry.
6672 (Output_data_got::add_global_plt): Likewise.
6673 (Output_data_got::add_global_with_rel): Likewise.
6674 (Output_data_got::add_global_with_rela): Likewise.
6675 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
6676 (Output_data_got::add_global_pair_with_rela): Likewise.
6677 (Output_data_got::add_local): Call add_got_entry.
6678 (Output_data_got::add_local_plt): Likewise.
6679 (Output_data_got::add_local_with_rel): Likewise.
6680 (Output_data_got::add_local_with_rela): Likewise.
6681 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
6682 (Output_data_got::add_local_pair_with_rela): Likewise.
6683 (Output_data_got::reserve_slot): New function.
6684 (Output_data_got::reserve_slot_for_global): New function.
6685 (Output_data_got::add_got_entry): New function.
6686 (Output_data_got::add_got_entry_pair): New function.
6687 (Output_section::add_output_section_data): Edit FIXME.
6688 * output.h
6689 (Output_section_data_build::Output_section_data_build): New
6690 constructor with size parameter.
6691 (Output_data_space::Output_data_space): Likewise.
6692 (Output_data_got::Output_data_got): Initialize new data member; new
6693 constructor with size parameter.
6694 (Output_data_got::add_constant): Call add_got_entry.
6695 (Output_data_got::reserve_slot): New function.
6696 (Output_data_got::reserve_slot_for_global): New function.
6697 (class Output_data_got::Got_entry): Add RESERVED_CODE.
6698 (Output_data_got::add_got_entry): New function.
6699 (Output_data_got::add_got_entry_pair): New function.
6700 (Output_data_got::free_list_): New data member.
6701 * target.h (Sized_target::init_got_plt_for_update): New function.
6702 (Sized_target::register_global_plt_entry): New function.
6703 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
6704 Initialize new data member; call init; add constructor with PLT count.
6705 (Output_data_plt_x86_64::init): New function.
6706 (Output_data_plt_x86_64::add_relocation): New function.
6707 (Output_data_plt_x86_64::reserve_slot): New function.
6708 (Output_data_plt_x86_64::free_list_): New data member.
6709 (Target_x86_64::init_got_plt_for_update): New function.
6710 (Target_x86_64::register_global_plt_entry): New function.
6711 (Output_data_plt_x86_64::add_entry): Allocate from free list for
6712 incremental updates.
6713 (Output_data_plt_x86_64::add_relocation): New function.
6714 * testsuite/object_unittest.cc (Object_test): Set default options.
6715
ec69d6da
ILT
67162011-05-16 Ian Lance Taylor <iant@google.com>
6717
6718 * options.h (class General_options): Make -i a synonym for -r.
6719
732e31de
ILT
67202011-05-16 Ian Lance Taylor <iant@google.com>
6721
6722 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
6723
403676b5
CC
67242011-05-10 Cary Coutant <ccoutant@google.com>
6725
6726 * object.cc (Sized_relobj::do_count_local_symbols): Check for
6727 strip_all (-s).
6728
5b7b7d6e
ILT
67292011-05-06 Ian Lance Taylor <iant@google.com>
6730
6731 * layout.cc (Layout::layout): If the output section flags change,
6732 update the ordering.
6733
f0f9babf
CC
67342011-04-25 Cary Coutant <ccoutant@google.com>
6735
6736 * incremental-dump.cc (dump_incremental_inputs): Print local
6737 symbol info for each input file.
6738 * incremental.cc
6739 (Output_section_incremental_inputs::set_final_data_size): Add local
6740 symbol info to input file entries in incremental info.
6741 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6742 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
6743 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
6744 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
6745 implementation.
6746 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
6747 (Sized_incr_relobj::do_relocate): Write the local symbols.
6748 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
6749 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
6750 Adjust size of input file header.
6751 (Incremental_inputs_reader::get_local_symbol_offset): New function.
6752 (Incremental_inputs_reader::get_local_symbol_count): New function.
6753 (Incremental_inputs_reader::get_input_section): Adjust size of input
6754 file header.
6755 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
6756 (Sized_incr_relobj::This): New typedef.
6757 (Sized_incr_relobj::sym_size): New const data member.
6758 (Sized_incr_relobj::Local_symbol): New struct.
6759 (Sized_incr_relobj::do_output_local_symbol_count): New function.
6760 (Sized_incr_relobj::do_local_symbol_offset): New function.
6761 (Sized_incr_relobj::local_symbol_count_): New data member.
6762 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
6763 (Sized_incr_relobj::local_symbol_index_): New data member.
6764 (Sized_incr_relobj::local_symbol_offset_): New data member.
6765 (Sized_incr_relobj::local_dynsym_offset_): New data member.
6766 (Sized_incr_relobj::local_symbols_): New data member.
6767 * object.h (Relobj::output_local_symbol_count): New function.
6768 (Relobj::local_symbol_offset): New function.
6769 (Relobj::do_output_local_symbol_count): New function.
6770 (Relobj::do_local_symbol_offset): New function.
6771 (Sized_relobj::do_output_local_symbol_count): New function.
6772 (Sized_relobj::do_local_symbol_offset): New function.
6773
d0a9ace3
ILT
67742011-04-22 Vladimir Simonov <sv@sw.ru>
6775
6776 * descriptors.cc (set_close_on_exec): New function.
6777 (Descriptors::open): Use set_close_on_exec.
6778 * output.cc (S_ISLNK): Define if not defined.
6779
94a3fc8b
CC
67802011-04-22 Cary Coutant <ccoutant@google.com>
6781
6782 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6783 global symbol map.
6784 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6785 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
6786 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
6787 relocations.
6788 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
6789 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
6790 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
6791 * incremental.h
6792 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
6793 function.
6794 (Incremental_binary::apply_incremental_relocs): New function.
6795 (Incremental_binary::do_apply_incremental_relocs): New function.
6796 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6797 data member.
6798 (Sized_incremental_binary::add_global_symbol): New function.
6799 (Sized_incremental_binary::global_symbol): New function.
6800 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6801 (Sized_incremental_binary::symbol_map_): New data member.
6802 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
6803 * target.h (Sized_target::apply_relocation): New function.
6804 * target-reloc.h (apply_relocation): New function.
6805 * x86_64.cc (Target_x86_64::apply_relocation): New function.
6806
c87e4302
DK
68072011-04-22 Doug Kwan <dougkwan@google.com>
6808
6809 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
6810 flag of a SHT_ARM_EXIDX section.
2e702c99 6811 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
6812 * testsuite/Makefile.in: Regenerate.
6813 * testsuite/arm_exidx_test.s: New file.
6814 * testsuite/arm_exidx_test.sh: Same.
6815
e7782cf6
CC
68162011-04-20 Cary Coutant <ccoutant@google.com>
6817
6818 PR gold/12689
6819 * archive.h (Incremental_archive_entry::Archive_member):
6820 Initialize arg_serial_ (second constructor).
6821
308ecdc7
ILT
68222011-04-17 Ian Lance Taylor <iant@google.com>
6823
6824 * object.cc (Relocate_info::location): Simplify location string.
6825 * errors.cc (Errors::error_at_location): Don't print program
6826 name.
6827 (Errors::warning_at_location): Likewise.
6828 (Errors::undefined_symbol): Likewise.
6829 * testsuite/debug_msg.sh: Update accordingly.
6830
bec5b579
CC
68312011-04-14 Cary Coutant <ccoutant@google.com>
6832
6833 * gold/layout.cc (Layout::symtab_section_offset): New function.
6834 * gold/layout.h (Layout::symtab_section_offset): New function.
6835 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
6836
88597d34
ILT
68372011-04-12 Ian Lance Taylor <iant@google.com>
6838
6839 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
6840 with MREMAP_MAYMOVE.
6841 * output.h (class Output_file): Add map_is_allocated_ field.
6842 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
6843 not available, provide stubs. If mremap is not available, #define
6844 it to gold_mremap.
6845 (MREMAP_MAYMOVE): Define if not defined.
6846 (Output_file::Output_file): Initialize map_is_allocated_.
6847 (Output_file::resize): Check map_is_allocated_.
6848 (Output_file::map_anonymous): If mmap fails, use malloc.
6849 (Output_file::unmap): Don't do anything for an anonymous map.
6850 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
6851 is not available, provide stubs.
6852 (File_read::View::~View): Use free rather than delete[].
6853 (File_read::make_view): Use malloc rather than new[]. If mmap
6854 fails, use malloc.
6855 (File_read::find_or_make_view): Use malloc rather than new[].
6856 * gold.h: Remove HAVE_REMAP code.
6857 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
6858 exists. Rename mremap to gold_mremap. If mmap is not available
6859 don't do anything.
6860 * configure, config.in: Rebuild.
6861
11e361bc
ILT
68622011-04-11 Ian Lance Taylor <iant@google.com>
6863
6864 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
6865 initialize local variable v.
6866
cdc29364
CC
68672011-04-11 Cary Coutant <ccoutant@google.com>
6868
6869 * archive.cc (Archive::include_member): Adjust call to
6870 report_object.
6871 (Add_archive_symbols::run): Track argument serial numbers.
6872 (Lib_group::include_member): Likewise.
6873 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
6874 * archive.h (Incremental_archive_entry::Archive_member):
6875 Initialize arg_serial_.
6876 (Archive_member::arg_serial_): New data member.
6877 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
6878 (Sized_dynobj::do_add_symbols): Track symbols when doing an
6879 incremental link.
6880 (Sized_dynobj::do_for_all_local_got_entries): New function.
6881 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
6882 function.
6883 * fileread.cc (get_mtime): New function.
6884 * fileread.h (get_mtime): New function.
6885 * gold.cc (queue_initial_tasks): Check for incremental update.
6886 (process_incremental_input): New function.
6887 (queue_middle_tasks): Don't force valid target for incremental
6888 update.
6889 * incremental-dump.cc (find_input_containing_global): Adjust
6890 size of symbol info entry.
6891 (dump_incremental_inputs): Dump argument serial number and
6892 in_system_directory flag; bias shndx by 1; print symbol names
6893 when dumping per-file symbol lists; use new symbol info readers.
6894 * incremental.cc
6895 (Output_section_incremental_inputs:update_data_size): New function.
6896 (Sized_incremental_binary::setup_readers): Setup input readers
6897 for each input file; build maps for files added from libraries
6898 and scripts.
6899 (Sized_incremental_binary::check_input_args): New function.
6900 (Sized_incremental_binary::do_check_inputs): Build map of argument
6901 serial numbers to input arguments.
6902 (Sized_incremental_binary::do_file_has_changed): Rename
6903 do_file_is_unchanged to this; compare file modification times.
6904 (Sized_incremental_binary::do_init_layout): New function.
6905 (Sized_incremental_binary::do_reserve_layout): New function.
6906 (Sized_incremental_binary::do_get_input_reader): Remove.
6907 (Sized_incremental_binary::get_symtab_view): New function.
6908 (Incremental_checker::can_incrementally_link_output_file): Remove.
6909 (Incremental_inputs::report_command_line): Exclude --debug options.
6910 (Incremental_inputs::report_archive_begin): Add parameter; track
6911 argument serial numbers; don't put input file entry for archive
6912 before archive members.
6913 (Incremental_inputs::report_archive_end): Put input file entry
6914 for archive after archive members.
6915 (Incremental_inputs::report_object): Add parameter; track argument
6916 serial numbers and in_system_directory flag.
6917 (Incremental_inputs::report_script): Add parameter; track argument
6918 serial numbers.
6919 (Output_section_incremental_inputs::set_final_data_size): Adjust
6920 size of symbol info entry; check for forwarding symbols.
6921 (Output_section_incremental_inputs::write_input_files): Write
6922 in_system_directory flag and argument serial number.
6923 (Output_section_incremental_inputs::write_info_blocks): Map section
6924 indices between incremental info and original input file; store
6925 input section index for each symbol.
6926 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
6927 change operator() to visit().
6928 (class Global_got_offset_visitor): Likewise.
6929 (class Global_symbol_visitor_got_plt):
6930 (Output_section_incremental_inputs::write_got_plt): Use new visitor
6931 classes.
6932 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
6933 (Sized_incr_relobj::do_read_symbols): New function.
6934 (Sized_incr_relobj::do_layout): New function.
6935 (Sized_incr_relobj::do_layout_deferred_sections): New function.
6936 (Sized_incr_relobj::do_add_symbols): New function.
6937 (Sized_incr_relobj::do_should_include_member): New function.
6938 (Sized_incr_relobj::do_for_all_global_symbols): New function.
6939 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
6940 (Sized_incr_relobj::do_section_size): New function.
6941 (Sized_incr_relobj::do_section_name): New function.
6942 (Sized_incr_relobj::do_section_contents): New function.
6943 (Sized_incr_relobj::do_section_flags): New function.
6944 (Sized_incr_relobj::do_section_entsize): New function.
6945 (Sized_incr_relobj::do_section_address): New function.
6946 (Sized_incr_relobj::do_section_type): New function.
6947 (Sized_incr_relobj::do_section_link): New function.
6948 (Sized_incr_relobj::do_section_info): New function.
6949 (Sized_incr_relobj::do_section_addralign): New function.
6950 (Sized_incr_relobj::do_initialize_xindex): New function.
6951 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
6952 (Sized_incr_relobj::do_read_relocs): New function.
6953 (Sized_incr_relobj::do_gc_process_relocs): New function.
6954 (Sized_incr_relobj::do_scan_relocs): New function.
6955 (Sized_incr_relobj::do_count_local_symbols): New function.
6956 (Sized_incr_relobj::do_finalize_local_symbols): New function.
6957 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
6958 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
6959 (Sized_incr_relobj::do_relocate): New function.
6960 (Sized_incr_relobj::do_set_section_offset): New function.
6961 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
6962 (Sized_incr_dynobj::do_read_symbols): New function.
6963 (Sized_incr_dynobj::do_layout): New function.
6964 (Sized_incr_dynobj::do_add_symbols): New function.
6965 (Sized_incr_dynobj::do_should_include_member): New function.
6966 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
6967 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
6968 (Sized_incr_dynobj::do_section_size): New function.
6969 (Sized_incr_dynobj::do_section_name): New function.
6970 (Sized_incr_dynobj::do_section_contents): New function.
6971 (Sized_incr_dynobj::do_section_flags): New function.
6972 (Sized_incr_dynobj::do_section_entsize): New function.
6973 (Sized_incr_dynobj::do_section_address): New function.
6974 (Sized_incr_dynobj::do_section_type): New function.
6975 (Sized_incr_dynobj::do_section_link): New function.
6976 (Sized_incr_dynobj::do_section_info): New function.
6977 (Sized_incr_dynobj::do_section_addralign): New function.
6978 (Sized_incr_dynobj::do_initialize_xindex): New function.
6979 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
6980 (make_sized_incremental_object): New function.
6981 (Incremental_library::copy_unused_symbols): New function.
6982 (Incremental_library::do_for_all_unused_symbols): New function.
6983 * incremental.h (enum Incremental_input_flags): New type.
6984 (class Incremental_checker): Remove.
6985 (Incremental_input_entry::Incremental_input_entry): Add argument
6986 serial number.
6987 (Incremental_input_entry::arg_serial): New function.
6988 (Incremental_input_entry::set_is_in_system_directory): New function.
6989 (Incremental_input_entry::is_in_system_directory): New function.
6990 (Incremental_input_entry::arg_serial_): New data member.
6991 (Incremental_input_entry::is_in_system_directory_): New data member.
6992 (class Script_info): Move here from script.h.
6993 (Script_info::Script_info): Add filename parameter.
6994 (Script_info::filename): New function.
6995 (Script_info::filename_): New data member.
6996 (Incremental_script_entry::Incremental_script_entry): Add argument
6997 serial number.
6998 (Incremental_object_entry::Incremental_object_entry): Likewise.
6999 (Incremental_object_entry::add_input_section): Build list of input
7000 sections with map to original shndx.
7001 (Incremental_object_entry::get_input_section_index): New function.
7002 (Incremental_object_entry::shndx_): New data member.
7003 (Incremental_object_entry::name_key_): Rename; adjust all refs.
7004 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
7005 (Incremental_archive_entry::Incremental_archive_entry): Add argument
7006 serial number.
7007 (Incremental_inputs::report_archive_begin): Likewise.
7008 (Incremental_inputs::report_object): Likewise.
7009 (Incremental_inputs::report_script): Likewise.
7010 (class Incremental_global_symbol_reader): New class.
7011 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
7012 and store flags and input file type.
7013 (Incremental_input_entry_reader::arg_serial): New function.
7014 (Incremental_input_entry_reader::type): Extract type from flags.
7015 (Incremental_input_entry_reader::is_in_system_directory): New function.
7016 (Incremental_input_entry_reader::get_input_section_count): Call
7017 accessor function for type.
7018 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
7019 function for type; adjust size of global symbol entry.
7020 (Incremental_input_entry_reader::get_global_symbol_count): Call
7021 accessor function for type.
7022 (Incremental_input_entry_reader::get_object_count): Likewise.
7023 (Incremental_input_entry_reader::get_object_offset): Likewise.
7024 (Incremental_input_entry_reader::get_member_count): Likewise.
7025 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
7026 (Incremental_input_entry_reader::get_member_offset): Likewise.
7027 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
7028 (Incremental_input_entry_reader::Global_symbol_info): Remove.
7029 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
7030 (Incremental_input_entry_reader::get_global_symbol_reader): New
7031 function.
7032 (Incremental_input_entry_reader::get_output_symbol_index): New
7033 function.
7034 (Incremental_input_entry_reader::type_): Remove.
7035 (Incremental_input_entry_reader::flags_): New data member.
7036 (Incremental_inputs_reader::input_file_offset): New function.
7037 (Incremental_inputs_reader::input_file_index): New function.
7038 (Incremental_inputs_reader::input_file): Call input_file_offset.
7039 (Incremental_inputs_reader::input_file_at_offset): New function.
7040 (Incremental_relocs_reader::get_r_type): Reformat.
7041 (Incremental_relocs_reader::get_r_shndx): Reformat.
7042 (Incremental_relocs_reader::get_r_offset): Reformat.
7043 (Incremental_relocs_reader::data): New function.
7044 (Incremental_binary::Incremental_binary): Initialize new data members.
7045 (Incremental_binary::check_inputs): Add cmdline parameter.
7046 (Incremental_binary::file_is_unchanged): Remove.
7047 (Input_reader::arg_serial): New function.
7048 (Input_reader::get_unused_symbol_count): New function.
7049 (Input_reader::get_unused_symbol): New function.
7050 (Input_reader::do_arg_serial): New function.
7051 (Input_reader::do_get_unused_symbol_count): New function.
7052 (Input_reader::do_get_unused_symbol): New function.
7053 (Incremental_binary::input_file_count): New function.
7054 (Incremental_binary::get_input_reader): Change signature to use
7055 index instead of filename.
7056 (Incremental_binary::file_has_changed): New function.
7057 (Incremental_binary::get_input_argument): New function.
7058 (Incremental_binary::get_library): New function.
7059 (Incremental_binary::get_script_info): New function.
7060 (Incremental_binary::init_layout): New function.
7061 (Incremental_binary::reserve_layout): New function.
7062 (Incremental_binary::output_file): New function.
7063 (Incremental_binary::do_check_inputs): New function.
7064 (Incremental_binary::do_file_is_unchanged): Remove.
7065 (Incremental_binary::do_file_has_changed): New function.
7066 (Incremental_binary::do_init_layout): New function.
7067 (Incremental_binary::do_reserve_layout): New function.
7068 (Incremental_binary::do_input_file_count): New function.
7069 (Incremental_binary::do_get_input_reader): Change signature.
7070 (Incremental_binary::input_args_map_): New data member.
7071 (Incremental_binary::library_map_): New data member.
7072 (Incremental_binary::script_map_): New data member.
7073 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7074 new data members.
7075 (Sized_incremental_binary::output_section): New function.
7076 (Sized_incremental_binary::inputs_reader): Add const.
7077 (Sized_incremental_binary::symtab_reader): Add const.
7078 (Sized_incremental_binary::relocs_reader): Add const.
7079 (Sized_incremental_binary::got_plt_reader): Add const.
7080 (Sized_incremental_binary::get_symtab_view): New function.
7081 (Sized_incremental_binary::Inputs_reader): New typedef.
7082 (Sized_incremental_binary::Input_entry_reader): New typedef.
7083 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
7084 (Sized_incremental_binary::do_file_is_unchanged): Remove.
7085 (Sized_incremental_binary::do_file_has_changed): New function.
7086 (Sized_incremental_binary::do_init_layout): New function.
7087 (Sized_incremental_binary::do_reserve_layout): New function.
7088 (Sized_input_reader::Inputs_reader): Remove.
7089 (Sized_input_reader::Input_entry_reader): Remove.
7090 (Sized_input_reader::do_arg_serial): New function.
7091 (Sized_input_reader::do_get_unused_symbol_count): New function.
7092 (Sized_input_reader::do_get_unused_symbol): New function.
7093 (Sized_incremental_binary::do_input_file_count): New function.
7094 (Sized_incremental_binary::do_get_input_reader): Change signature;
7095 use index instead of filename.
7096 (Sized_incremental_binary::section_map_): New data member.
7097 (Sized_incremental_binary::input_entry_readers_): New data member.
7098 (class Sized_incr_relobj): New class.
7099 (class Sized_incr_dynobj): New class.
7100 (make_sized_incremental_object): New function.
7101 (class Incremental_library): New class.
7102 * layout.cc (Free_list::num_lists): New static data member.
7103 (Free_list::num_nodes): New static data member.
7104 (Free_list::num_removes): New static data member.
7105 (Free_list::num_remove_visits): New static data member.
7106 (Free_list::num_allocates): New static data member.
7107 (Free_list::num_allocate_visits): New static data member.
7108 (Free_list::init): New function.
7109 (Free_list::remove): New function.
7110 (Free_list::allocate): New function.
7111 (Free_list::dump): New function.
7112 (Free_list::print_stats): New function.
7113 (Layout_task_runner::run): Resize output file for incremental updates.
7114 (Layout::Layout): Initialize new data members.
7115 (Layout::set_incremental_base): New function.
7116 (Layout::init_fixed_output_section): New function.
7117 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
7118 incremental updates.
7119 (Layout::create_gold_note): Do not create gold note section for
7120 incremental updates.
7121 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
7122 for incremental updates.
7123 (Layout::set_section_offsets): For incremental updates, allocate space
7124 from free list.
7125 (Layout::create_symtab_sections): Layout with offsets relative to
7126 start of section; for incremental updates, allocate space from free
7127 list.
7128 (Layout::create_shdrs): For incremental updates, allocate space from
7129 free list.
7130 (Layout::finish_dynamic_section): For incremental updates, do not
7131 check --as-needed (fixed in subsequent patch).
7132 * layout.h (class Free_list): New class.
7133 (Layout::set_incremental_base): New function.
7134 (Layout::incremental_base): New function.
7135 (Layout::init_fixed_output_section): New function.
7136 (Layout::allocate): New function.
7137 (Layout::incremental_base_): New data member.
7138 (Layout::free_list_): New data member.
7139 * main.cc (main): Print Free_list statistics.
7140 * object.cc (Relobj::finalize_incremental_relocs): Add
7141 clear_counts parameter; clear counts only when clear_counts is set.
7142 (Sized_relobj::Sized_relobj): Initialize new base class.
7143 (Sized_relobj::do_layout): Don't report special sections.
7144 (Sized_relobj::do_for_all_local_got_entries): New function.
7145 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
7146 symtab_off to all symbol table offsets.
7147 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
7148 * object.h (class Got_offset_list): Move to top of file.
7149 (Object::Object): Allow case where input_file == NULL.
7150 (Object::~Object): Likewise.
7151 (Object::input_file): Assert that input_file != NULL.
7152 (Object::lock): Allow case where input_file == NULL.
7153 (Object::unlock): Likewise.
7154 (Object::is_locked): Likewise.
7155 (Object::token): Likewise.
7156 (Object::release): Likewise.
7157 (Object::is_incremental): New function.
7158 (Object::get_mtime): New function.
7159 (Object::for_all_local_got_entries): New function.
7160 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
7161 (Object::set_is_in_system_directory): New function.
7162 (Object::is_in_system_directory): New function.
7163 (Object::do_is_incremental): New function.
7164 (Object::do_get_mtime): New function.
7165 (Object::do_for_all_local_got_entries): New function.
7166 (Object::is_in_system_directory_): New data member.
7167 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
7168 (class Sized_relobj_base): New class.
7169 (class Sized_relobj): Derive from Sized_relobj_base.
7170 (class Sized_relobj::Symbols): Redeclare from base class.
7171 (class Sized_relobj::local_got_offset_list): Remove.
7172 (class Sized_relobj::Output_sections): Redeclare from base class.
7173 (class Sized_relobj::do_for_all_local_got_entries): New function.
7174 (class Sized_relobj::write_local_symbols): Add offset parameter.
7175 (class Sized_relobj::local_symbol_offset_): Update comment.
7176 (class Sized_relobj::local_dynsym_offset_): Update comment.
7177 * options.cc (Input_arguments::add_file): Remove const.
7178 * options.h (Input_file_argument::Input_file_argument):
7179 Initialize arg_serial_ (all constructors).
7180 (Input_file_argument::set_arg_serial): New function.
7181 (Input_file_argument::arg_serial): New function.
7182 (Input_file_argument::arg_serial_): New data member.
7183 (Input_arguments::Input_arguments): Initialize file_count_.
7184 (Input_arguments::add_file): Remove const.
7185 (Input_arguments::number_of_input_files): New function.
7186 (Input_arguments::file_count_): New data member.
7187 (Command_line::number_of_input_files): Call
7188 Input_arguments::number_of_input_files.
7189 * output.cc (Output_segment_headers::Output_segment_headers):
7190 Set current size.
7191 (Output_section::Input_section::current_data_size): New function.
7192 (Output_section::Output_section): Initialize new data members.
7193 (Output_section::add_input_section): Don't do merge sections for
7194 an incremental link; allocate space from free list for an
7195 incremental update.
7196 (Output_section::add_output_section_data): Allocate space from
7197 free list for an incremental update.
7198 (Output_section::update_data_size): New function.
7199 (Output_section::set_fixed_layout): New function.
7200 (Output_section::reserve): New function.
7201 (Output_segment::set_section_addresses): Remove const.
7202 (Output_segment::set_section_list_addresses): Remove const; allocate
7203 space from free list for an incremental update.
7204 (Output_segment::set_offset): Adjust size of RELRO segment for an
7205 incremental update.
7206 * output.h (Output_data::current_data_size): Move here from
7207 child classes.
7208 (Output_data::pre_finalize_data_size): New function.
7209 (Output_data::update_data_size): New function.
7210 (Output_section_headers::update_data_size): new function.
7211 (Output_section_data_build::current_data_size): Move to Output_data.
7212 (Output_data_strtab::update_data_size): New function.
7213 (Output_section::current_data_size): Move to Output_data.
7214 (Output_section::set_fixed_layout): New function.
7215 (Output_section::has_fixed_layout): New function.
7216 (Output_section::reserve): New function.
7217 (Output_section::update_data_size): New function.
7218 (Output_section::has_fixed_layout_): New data member.
7219 (Output_section::free_list_): New data member.
7220 (Output_segment::set_section_addresses): Remove const.
7221 (Output_segment::set_section_list_addresses): Remove const.
7222 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
7223 New function.
7224 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
7225 New function.
7226 * readsyms.cc (Read_symbols::do_read_symbols): Add library
7227 parameter when calling Add_symbols constructor; store argument
7228 serial number for members of a lib group.
7229 (Add_symbols::locks): Allow case where token == NULL.
7230 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
7231 (Read_member::~Read_member): New function.
7232 (Read_member::is_runnable): New function.
7233 (Read_member::locks): New function.
7234 (Read_member::run): New function.
7235 (Check_script::~Check_script): New function.
7236 (Check_script::is_runnable): New function.
7237 (Check_script::locks): New function.
7238 (Check_script::run): New function.
7239 (Check_library::~Check_library): New function.
7240 (Check_library::is_runnable): New function.
7241 (Check_library::locks): New function.
7242 (Check_library::run): New function.
7243 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
7244 (Add_symbols::library_): New data member.
7245 (class Read_member): New class.
7246 (class Check_script): New class.
7247 (class Check_library): New class.
7248 * reloc.cc (Read_relocs::is_runnable): Allow case where
7249 token == NULL.
7250 (Read_relocs::locks): Likewise.
7251 (Scan_relocs::locks): Likewise.
7252 (Relocate_task::locks): Likewise.
7253 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
7254 to clear counters.
7255 (Sized_relobj::incremental_relocs_scan): Fix comment.
7256 (Sized_relobj::do_relocate): Pass output file offset to
7257 write_local_symbols.
7258 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
7259 from class declaration.
7260 * script.cc (read_input_script): Allocate Script_info; pass
7261 argument serial number to report_script.
7262 * script.h (class Script_info): Move to incremental.h.
7263 * symtab.cc (Symbol_table::add_from_incrobj): New function.
7264 * symtab.h (Symbol_table::add_from_incrobj): New function.
7265 (Symbol_table::set_file_offset): New function.
7266
b961d0d7
CC
72672011-04-05 Cary Coutant <ccoutant@google.com>
7268
7269 * incremental-dump.cc (dump_incremental_inputs): Change signature
7270 to take a Sized_incremental_binary; change caller. Use readers
7271 in Sized_incremental_binary.
7272 * incremental.cc
7273 (Sized_incremental_binary::find_incremental_inputs_sections):
7274 Rename do_find_incremental_inputs_sections to this.
7275 (Sized_incremental_binary::setup_readers): New function.
7276 (Sized_incremental_binary::do_check_inputs): Check
7277 has_incremental_info_ flag; move setup code to setup_readers;
7278 use input readers.
7279 (Sized_incremental_binary::do_file_is_unchanged): New function.
7280 (Sized_incremental_binary::do_get_input_reader): New function.
7281 * incremental.h (class Incremental_binary): Move to end of file.
7282 (Incremental_binary::file_is_unchanged): New function.
7283 (Incremental_binary::do_file_is_unchanged): New function.
7284 (Incremental_binary::Input_reader): New class.
7285 (Incremental_binary::get_input_reader): New function.
7286 (class Sized_incremental_binary): Move to end of file.
7287 (Sized_incremental_binary::Sized_incremental_binary): Setup the
7288 input section reader classes.
7289 (Sized_incremental_binary::has_incremental_info): New function.
7290 (Sized_incremental_binary::inputs_reader): New function.
7291 (Sized_incremental_binary::symtab_reader): New function.
7292 (Sized_incremental_binary::relocs_reader): New function.
7293 (Sized_incremental_binary::got_plt_reader): New function.
7294 (Sized_incremental_binary::do_file_is_unchanged): New function.
7295 (Sized_incremental_binary::Sized_input_reader): New class.
7296 (Sized_incremental_binary::get_input_reader): New function.
7297 (Sized_incremental_binary::find_incremental_inputs_sections):
7298 Rename do_find_incremental_inputs_sections to this.
7299 (Sized_incremental_binary::setup_readers): New function.
7300 (Sized_incremental_binary::has_incremental_info_): New data member.
7301 (Sized_incremental_binary::inputs_reader_): New data member.
7302 (Sized_incremental_binary::symtab_reader_): New data member.
7303 (Sized_incremental_binary::relocs_reader_): New data member.
7304 (Sized_incremental_binary::got_plt_reader_): New data member.
7305 (Sized_incremental_binary::current_input_file_): New data member.
7306
a869183f
PP
73072011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
7308
7309 PR gold/12640
7310 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
7311 violation.
7312
73132011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
7314
7315 * archive.cc (Archive::include_member): Adjust call to report_object.
7316 (Add_archive_symbols::run): Add script_info to call to
7317 report_archive_begin.
7318 (Lib_group::include_member): Adjust call to report_object.
7319 (Add_lib_group_symbols::run): Adjust call to report_object.
7320 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
7321 blocks. Add object count for script input files.
7322 * incremental.cc (Incremental_inputs::report_archive_begin): Add
7323 script_info parameter; change all callers.
7324 (Incremental_inputs::report_object): Add script_info parameter;
7325 change all callers.
7326 (Incremental_inputs::report_script): Store backpointer to
7327 incremental info entry.
7328 (Output_section_incremental_inputs::set_final_data_size): Record
7329 additional information for scripts.
7330 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7331 * incremental.h (Incremental_script_entry::add_object): New function.
7332 (Incremental_script_entry::get_object_count): New function.
7333 (Incremental_script_entry::get_object): New function.
7334 (Incremental_script_entry::objects_): New data member; adjust
7335 constructor.
7336 (Incremental_inputs::report_archive_begin): Add script_info parameter.
7337 (Incremental_inputs::report_object): Add script_info parameter.
7338 (Incremental_inputs_reader::get_object_count): New function.
7339 (Incremental_inputs_reader::get_object_offset): New function.
7340 * options.cc (Input_arguments::add_file): Return reference to
7341 new input argument.
7342 * options.h (Input_argument::set_script_info): New function.
7343 (Input_argument::script_info): New function.
7344 (Input_argument::script_info_): New data member; adjust all
7345 constructors.
7346 (Input_file_group::add_file): Return reference to new input argument.
7347 (Input_file_lib::add_file): Likewise.
7348 (Input_arguments::add_file): Likewise.
7349 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
7350 * script.cc (Parser_closure::Parser_closure): Add script_info
7351 parameter; adjust all callers.
7352 (Parser_closure::script_info): New function.
7353 (Parser_closure::script_info_): New data member.
7354 (read_input_script): Report scripts earlier to incremental info.
7355 (script_add_file): Set script_info in Input_argument.
7356 (script_add_library): Likewise.
7357 * script.h (Script_options::Script_info): Rewrite class.
7358
a869183f 73592011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
7360
7361 * archive.cc (Library_base::should_include_member): Move
7362 method here from class Archive.
7363 (Archive::Archive): Initialize base class.
7364 (Archive::should_include_member): Move to base class.
7365 (Archive::do_for_all_unused_symbols): New function.
7366 (Add_archive_symbols::run): Remove redundant access to
7367 incremental_inputs.
7368 (Lib_group::Lib_group): Initialize base class.
7369 (Lib_group::do_filename): New function.
7370 (Lib_group::include_member): Pass pointer to Lib_group to
7371 report_object.
7372 (Lib_group::do_for_all_unused_symbols): New function.
7373 (Add_lib_group_symbols::run): Report archive information for
7374 incremental links.
7375 * archive.h (class Library_base): New base class.
7376 (class Archive): Derive from Library_base.
7377 (Archive::filename): Move to base class.
7378 (Archive::set_incremental_info): Likewise.
7379 (Archive::incremental_info): Likewise.
7380 (Archive::Should_include): Likewise.
7381 (Archive::should_include_member): Likewise.
7382 (Archive::Armap_entry): Remove.
7383 (Archive::Unused_symbol_iterator): Remove.
7384 (Archive::unused_symbols_begin): Remove.
7385 (Archive::unused_symbols_end): Remove.
7386 (Archive::do_filename): New function.
7387 (Archive::do_get_mtime): New function.
7388 (Archive::do_for_all_unused_symbols): New function.
7389 (Archive::task_): Move to base class.
7390 (Archive::incremental_info_): Likewise.
7391 (class Lib_group): Derive from Library_base.
7392 (Lib_group::do_filename): New function.
7393 (Lib_group::do_get_mtime): New function.
7394 (Lib_group::do_for_all_unused_symbols): New function.
7395 (Lib_group::task_): Move to base class.
7396 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
7397 function.
7398 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
7399 function.
7400 * incremental.cc (Incremental_inputs::report_archive_begin):
7401 Use Library_base; call library's get_mtime; add incremental inputs
7402 entry before members.
7403 (class Unused_symbol_visitor): New class.
7404 (Incremental_inputs::report_archive_end): Use Library_base; use
7405 visitor class to record unused symbols; don't add incremental inputs
7406 entry after members.
7407 (Incremental_inputs::report_object): Use Library_base.
7408 * incremental.h
7409 (Incremental_archive_entry::Incremental_archive_entry): Remove
7410 unused Archive parameter.
7411 (Incremental_inputs::report_archive_begin): Use Library_base.
7412 (Incremental_inputs::report_archive_end): Likewise.
7413 (Incremental_inputs::report_object): Likewise.
7414 * object.cc (Sized_relobj::do_for_all_global_symbols): New
7415 function.
7416 * object.h (Object::for_all_global_symbols): New function.
7417 (Object::do_for_all_global_symbols): New function.
7418 (Sized_relobj::do_for_all_global_symbols): New function.
7419 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
7420 function.
7421 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
7422 function.
7423
61ab3e40
ILT
74242011-03-27 Ian Lance Taylor <iant@google.com>
7425
7426 * archive.cc (Archive::interpret_header): Return -1 if something
7427 goes wrong. Change callers accordingly.
7428
30e1f9e6
CC
74292011-03-25 Cary Coutant <ccoutant@google.com>
7430
7431 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
7432 * testsuite/Makefile.in: Regenerate.
7433
9370ce59 74342011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
7435
7436 * plugin.cc (get_view): New.
7437 (Plugin::load): Pass get_view to the plugin.
7438 (Plugin_manager::get_view): New.
7439
9312bb0a
ILT
74402011-03-21 Ian Lance Taylor <iant@google.com>
7441
7442 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 7443 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 7444
7e12ba9e
ST
74452011-03-21 Sriraman Tallam <tmsriram@google.com>
7446
7447 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
7448 Change == to -eq.
7449 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
7450 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
7451 Change == to -eq.
7452 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
7453 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
7454
fd7a005d
ILT
74552011-03-14 Ian Lance Taylor <iant@google.com>
7456
7457 * script-sections.cc (Sort_output_sections::script_compare):
7458 Rename from is_before, change return type.
7459 (Sort_output_sections::operator()): Adjust accordingly.
7460
ed16fd1b
ILT
74612011-03-11 Jeffrey Yasskin <jyasskin@google.com>
7462
7463 PR gold/12572
7464 * testsuite/odr_violation2.cc: Add comment to make all error line
7465 numbers double digits.
7466 * testsuite/debug_msg.sh: Adjust expected errors.
7467
71ff8986
ILT
74682011-03-09 Jeffrey Yasskin <jyasskin@google.com>
7469
7470 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
7471 but mark earlier ones as non-canonical
7472 (offset_to_iterator): Update search target and example
7473 (do_addr2line): Return extra lines in a vector*
7474 (format_file_lineno): Extract from do_addr2line
7475 (one_addr2line): Add vector* out-param
7476 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
7477 when a lineno entry appeared last for its instruction
7478 (Dwarf_line_info): Add vector* out-param
7479 * object.cc (Relocate_info): Pass NULL for the vector* out-param
7480 * symtab.cc (Odr_violation_compare): Include the lineno in the
7481 comparison again.
7482 (linenos_from_loc): New. Combine the canonical line for an
7483 address with its other lines.
7484 (True_if_intersect): New. Helper functor to make
7485 std::set_intersection a query.
7486 (detect_odr_violations): Compare sets of lines instead of just
7487 one line for each function. This became less deterministic, but
7488 has fewer false positives.
7489 * symtab.h: Declarations.
7490 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
7491 mix an optimized and non-optimized object in the same binary
7492 (odr_violation2.so): Same.
7493 * testsuite/Makefile.in: Regenerate from Makefile.am.
7494 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
7495 * testsuite/debug_msg.sh: Update line numbers and add
7496 assertions.
7497 * testsuite/odr_violation1.cc: Use OdrDerived, in a
7498 non-optimized context.
7499 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
7500 isn't inlined, and use OdrDerived in an optimized context.
7501 * testsuite/odr_header1.h: Defines OdrDerived, where
7502 optimization will change the
7503 first-instruction-in-the-destructor's file and line number.
7504 * testsuite/odr_header2.h: Defines OdrBase.
7505
a19fefdc
ILT
75062011-03-09 Ian Lance Taylor <iant@google.com>
7507
7508 * fileread.cc (File_read::clear_views): Don't delete the whole
7509 file view.
7510
ecb351e9
ILT
75112011-03-08 Ian Lance Taylor <iant@google.com>
7512
7513 PR gold/12525
7514 * fileread.cc: #include <climits>.
7515 (GOLD_IOV_MAX): Define.
7516 (File_read::read_multiple): Limit number of entries by iov_max.
7517 * fileread.h (class File_read): Always set max_readv_entries to
7518 128.
7519
b821d13c
ILT
75202011-03-07 Ian Lance Taylor <iant@google.com>
7521
7522 PR gold/12525
7523 * options.h (class General_options): Add -dy and -dn.
7524
89243142
CC
75252011-03-02 Cary Coutant <ccoutant@google.com>
7526
7527 * testsuite/script_test_9.t: Add TLS segment.
7528
d0773f31
ILT
75292011-03-02 Simon Baldwin <simonb@google.com>
7530
7531 * configure.ac: Add check for gnu_indirect_function support in
7532 the toolchain building binutils.
7533 * configure: Rebuild.
7534
9370ce59 75352011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
7536
7537 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
7538 plugin only symbols.
7539 (Symbol_table::sized_finalize_symbol) Mark symbol only present
7540 in plugin files as not needed in the symbol table.
7541
4cf7a849
ST
75422011-02-11 Sriraman Tallam <tmsriram@google.com>
7543
7544 * output.cc (Output_section::add_input_section): Delay fill
7545 generation for section ordering.
7546
b578bd7d
ILT
75472011-02-09 Ian Lance Taylor <iant@google.com>
7548
7549 PR gold/12316
7550 * object.h (class Sized_relobj): Remove clear_local_symbols.
7551 * reloc.cc (Sized_relobj::do_relocate): Don't call
7552 clear_local_symbols.
7553
9370ce59 75542011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
7555
7556 * plugin.cc (is_visible_from_outside): Return true for symbols
7557 in the -u option.
7558
55382fb7
ILT
75592011-02-04 Jeffrey Yasskin <jyasskin@google.com>
7560
7561 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
7562 filename.
7563
4e271fff
ST
75642011-02-02 Sriraman Tallam <tmsriram@google.com>
7565
7566 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 7567 to std::string.
4e271fff 7568 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 7569 section_name to be std::string.
4e271fff
ST
7570 (is_function_ctor_or_dtor): Change type of parameter to std::string.
7571
d433c3ac
ILT
75722011-01-25 Ian Lance Taylor <iant@google.com>
7573
7574 * script.cc (script_add_extern): Rewrite to use
7575 add_symbol_reference.
7576
880473a6
DK
75772011-01-25 Doug Kwan <dougkwan@google.com>
7578
d433c3ac 7579 * icf.cc (get_section_contents): Always lock section's object.
880473a6 7580
f30f86fa
ILT
75812011-01-24 Ian Lance Taylor <iant@google.com>
7582
7583 * options.h (class General_options): Accept
7584 --no-detect-odr-violations.
7585
8e51a0b9
ILT
75862011-01-24 Ian Lance Taylor <iant@google.com>
7587
7588 * version.cc (version_string): Bump to 1.11.
7589
0f3b89d8
ILT
75902011-01-24 Ian Lance Taylor <iant@google.com>
7591
7592 * plugin.cc (class Plugin_rescan): Define new class.
7593 (Plugin_manager::claim_file): Set any_claimed_.
7594 (Plugin_manager::save_archive): New function.
7595 (Plugin_manager::save_input_group): New function.
7596 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
7597 necessary.
7598 (Plugin_manager::new_undefined_symbol): New function.
7599 (Plugin_manager::rescan): New function.
7600 (Plugin_manager::rescannable_defines): New function.
7601 (Plugin_manager::add_input_file): Set any_added_.
7602 * plugin.h (class Plugin_manager): define new fields rescannable_,
7603 undefined_symbols_, any_claimed_, and any_added_. Declare
7604 Plugin_rescan as friend. Declare new functions.
7605 (Plugin_manager::Rescannable): Define type.
7606 (Plugin_manager::Rescannable_list): Define type.
7607 (Plugin_manager::Undefined_symbol_list): Define type.
7608 (Plugin_manager::Plugin_manager): Initialize new fields.
7609 * archive.cc (Archive::defines_symbol): New function.
7610 (Add_archive_symbols::run): Pass archive to plugins if any.
7611 * archive.h (class Archive): Declare defines_symbol.
7612 * readsyms.cc (Input_group::~Input_group): New function.
7613 (Finish_group::run): Pass input_group to plugins if any.
7614 * readsyms.h (class Input_group): Declare destructor.
7615 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
7616 any.
7617
3bb951e5
ILT
76182011-01-10 Ian Lance Taylor <iant@google.com>
7619
7620 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
7621 section as relro.
7622 (Layout::set_segment_offsets): Reset increase_relro before calling
7623 set_section_addresses a second time.
7624
0aa45fac
CC
76252011-01-04 Cary Coutant <ccoutant@google.com>
7626
7627 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
7628 sections before NOBITS sections.
7629
0db46eb4
L
76302011-01-01 H.J. Lu <hongjiu.lu@intel.com>
7631
7632 * version.cc (print_version): Update copyright to 2011.
7633
829c9745
CC
76342010-12-23 Cary Coutant <ccoutant@google.com>
7635
7636 * output.h (Output_data_reloc::add_output_section): Pass OD instead
7637 of OS to this->add. Add OD parameter to second form of the function.
7638
7500420b
ILT
76392010-12-20 Ian Lance Taylor <iant@google.com>
7640
7641 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
7642 second of two consecutive entries with same offset.
7643
f8e9a930
RW
76442010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7645
7646 * testsuite/Makefile.am (ifuncmain2static_LDADD)
7647 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
7648 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
7649 to avoid unneeded links against $(LDADD).
7650 * testsuite/Makefile.in: Regenerate.
7651
2fbb4320
ILT
76522010-12-15 Ian Lance Taylor <iant@google.com>
7653
7654 PR gold/12324
7655 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
7656 for R_X86_64_32 and R_X86_64_PC32.
7657 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
7658 ver_matching_def_pic.o.
7659 (ver_matching_def_pic.o): New target.
7660
fedb228d
RW
76612010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7662
7663 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
7664 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
7665 Move definition before File_read::View member definitions.
7666 (File_read::View::~View): Initialize and hold lock before
7667 updating current_mapped_bytes.
7668
9b547ce6
RW
76692010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7670
7671 * dwarf_reader.cc: Remove outdated comment.
7672 * gold-threads.cc: Fix typo in error message.
7673 * archive.cc: Fix typos in comments.
7674 * archive.h: Likewise.
7675 * arm-reloc-property.cc: Likewise.
7676 * arm-reloc-property.h: Likewise.
7677 * arm-reloc.def: Likewise.
7678 * arm.cc: Likewise.
7679 * attributes.h: Likewise.
7680 * cref.cc: Likewise.
7681 * ehframe.cc: Likewise.
7682 * fileread.h: Likewise.
7683 * gold.h: Likewise.
7684 * i386.cc: Likewise.
7685 * icf.cc: Likewise.
7686 * incremental.h: Likewise.
7687 * int_encoding.cc: Likewise.
7688 * layout.h: Likewise.
7689 * main.cc: Likewise.
7690 * merge.h: Likewise.
7691 * object.cc: Likewise.
7692 * object.h: Likewise.
7693 * options.cc: Likewise.
7694 * readsyms.cc: Likewise.
7695 * reduced_debug_output.cc: Likewise.
7696 * reloc.cc: Likewise.
7697 * script-sections.cc: Likewise.
7698 * sparc.cc: Likewise.
7699 * symtab.h: Likewise.
7700 * target-reloc.h: Likewise.
7701 * target.cc: Likewise.
7702 * target.h: Likewise.
7703 * timer.cc: Likewise.
7704 * timer.h: Likewise.
7705 * x86_64.cc: Likewise.
7706
83e17bd5
CC
77072010-12-09 Cary Coutant <ccoutant@google.com>
7708
7709 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
7710 stack.
7711 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
7712 parameter; change all callers.
7713 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
7714 * options.h (warn_execstack): New option.
7715
017257f8
DK
77162010-12-07 Doug Kwan <dougkwan@google.com>
7717
7718 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
7719 like function call relocations.
7720
c20cbc06
ILT
77212010-12-07 Ian Lance Taylor <iant@google.com>
7722
7723 * archive.cc (Archive::get_elf_object_for_member): Permit
7724 punconfigured to be NULL.
7725 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
7726 (Archive::include_member): Pass NULL to get_elf_object_for_member
7727 if we searched for the archive and this is the first included
7728 object.
7729
4dbfafcc
ILT
77302010-12-01 Ian Lance Taylor <iant@google.com>
7731
7732 * dwarf_reader.h (class Sized_dwarf_line_info): Add
7733 track_relocs_type_ field.
7734 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7735 Set track_relocs_type_.
7736 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
7737 contents when using RELA relocs.
7738 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
7739 reloc_map_.
7740 * reloc.cc (Track_relocs::next_addend): New function.
7741 * reloc.h (class Track_relocs): Declare next_addend.
7742
e5e19edd
ILT
77432010-12-01 Ian Lance Taylor <iant@google.com>
7744
7745 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
7746 virtual destructor.
7747
9a5ce24c
ILT
77482010-12-01 Ian Lance Taylor <iant@google.com>
7749
7750 * README: Update compilers known to work and fail.
7751
c7791212
NC
77522010-11-23 Matthias Klose <doko@ubuntu.com>
7753
7754 * configure.in: For --enable-gold, handle value `default' instead of
7755 `both*'. Always install ld as ld.bfd, install as ld if gold is
7756 not the default.
7757 * configure: Regenerate.
7758
0ad220c9
DK
77592010-11-18 Doug Kwan <dougkwan@google.com>
7760
7761 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
7762 and right_alignment to be zero. Store result alignment only if it is
7763 greater than existing alignment.
7764
ab8056e0
CC
77652010-11-16 Cary Coutant <ccoutant@google.com>
7766
7767 PR gold/12220
7768 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7769 Check for ".zdebug_line".
7770
fd064a5b
CC
77712010-11-16 Doug Kwan <dougkwan@google.com>
7772 Cary Coutant <ccoutant@google.com>
7773
7774 * output.h (Output_segment::set_section_addresses): Pass increase_relro
7775 by reference; adjust all callers.
7776 * output.cc (Output_segment::set_section_addresses): Adjust references
7777 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
7778 list is empty.
7779 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
7780 end at page boundary.
7781
6fc6ea19
CC
77822010-11-16 Cary Coutant <ccoutant@google.com>
7783
7784 PR gold/12220
7785 * layout.cc (Layout::choose_output_section): Transform names of
7786 compressed sections even when using a script with a SECTIONS clause.
7787 (Layout::output_section_name): Remove code to transform
7788 compressed debug section names.
7789 * output.cc (Output_section::add_input_section): Use uncompressed
7790 section size when tracking input sections.
7791
95a2c8d6
RS
77922010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
7793
7794 * symtab.h (Symbol::NON_PIC_REF): Remove.
7795 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
7796 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
7797 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
7798 (Symbol::use_plt_offset): Take a flags argument and pass it
7799 directly to needs_dynamic_reloc. Restrict check for undefined
7800 weak symbols to function calls.
7801 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
7802 (Target_arm::Scan::global): Use it.
7803 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
7804 (Target_arm::Relocate::relocate): Likewise.
7805 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
7806 parameter with an r_type parameter. Use get_reference_flags
7807 to get the flags.
7808 (Target_arm::Relocate::relocate): Update accordingly.
7809 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
7810 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
7811 (Target_i386::Scan::global): Likewise.
7812 (Target_i386::Relocate::relocate): Likewise.
7813 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
7814 parameter with an r_type parameter. Use get_reference_flags
7815 to get the flags.
7816 (Target_i386::Relocate::relocate): Update accordingly.
7817 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
7818 (Target_powerpc::Scan::global): Use it.
7819 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
7820 (Target_powerpc::Relocate::relocate): Likewise.
7821 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
7822 (Target_sparc::Scan::global): Use it.
7823 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
7824 (Target_sparc::Relocate::relocate): Likewise.
7825 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
7826 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
7827 (Target_x86_64::Scan::global): Likewise.
7828 (Target_x86_64::Relocate::relocate): Likewise.
7829
f625ae50
DK
78302010-11-08 Doug Kwan <dougkwan@google.com>
7831 Cary Coutant <ccoutant@google.com>
7832
7833 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
7834 (Arm_exidx_merge_section::section_contents_): New data member.
7835 (Arm_input_section::Arm_input_section): Initialize original_contents_.
7836 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 7837 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
7838 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
7839 in parameters instead of calling Object::section_contents without
7840 locking.
7841 (Arm_output_section::group_section): New parameter TASK. Pass it
7842 to callees that need locking objects.
7843 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
7844 to lock EXIDX input sections. Fix a formatting issue. Call
7845 Arm_exidx_merged_section::build_contents to create merged section
7846 contents.
7847 (Arm_output_section::create_stub_group): New parameter TASK. Use it
7848 to lock object of stub table owner.
7849 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
7850 TEXT_SIZE to initialize data member TEXT_SIZE_.
7851 (Arm_exidx_input_section::addralign): Fix typo in comment.
7852 (Arm_exidx_input_section::text_size): New method.
7853 (Target_arm::do_relax): New parameter TASK. Pass it to callees
7854 that require locking objects. Lock objects before scanning for stubs
7855 and updating local symbols.
7856 (Arm_input_section<big_endian>::init): Copy contents of original
7857 input section.
2e702c99 7858 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
7859 original input section instead of calling Object::section_contents
7860 without locking.
7861 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
7862 size without calling Object::section_size().
7863 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
7864 for size. Allocate a buffer for merged EXIDX entries.
7865 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 7866 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
7867 building code to Arm_exidx_merged_section::build_contetns. Write
7868 out contetns in buffer instead of building it on the fly.
7869 (Arm_relobj::make_exidx_input_section): Also pass text section size
7870 to Arm_exidx_input_section constructor.
7871 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
7872 (Arm_dynobj::do_read_symbols): Fix memory leak.
7873 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
7874 * target.h: (class Task): Add forward declaration.
7875 (Target::relax): Add new parameter TASK and pass it to
7876 Target::do_relax().
7877 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
7878
5f9bcf58
CC
78792010-11-05 Cary Coutant <ccoutant@google.com>
7880
7881 PR gold/10708
7882 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
7883 object when reading from the file.
7884 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
7885 second layout pass.
7886 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
7887 when reading section contents.
7888 (get_section_contents): Likewise.
7889 (icf::find_identical_sections): Likewise.
7890 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
7891 object when reading from the file.
7892 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
7893 the object when doing deferred section layout.
7894
e597fa08
NC
78952010-11-03 Nick Clifton <nickc@redhat.com>
7896
7897 PR gold/12001
7898 * script.h (class Symbol_assignment: name): New member. Returns
7899 the name of the symbol.
7900 * scrfipt.cc (Script_options::is_pending_assignment): New member.
7901 Returns true if the given symbol name is on the list of
7902 assignments wating to be processed.
7903 * archive.cc (should_incldue_member): If the symbol is undefined,
7904 check to see if it is on the list of symbols pending assignment.
7905
3f9a3278
ILT
79062010-11-03 Ryan Mansfield <rmansfield@qnx.com>
7907
7908 * script-sections.cc (Script_sections::find_memory_region): Check
7909 for a NULL output section pointer.
7910
d06fb4d1
DK
79112010-10-29 Doug Kwan <dougkwan@google.com>
7912
7913 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
7914 Output_section::add_relaxed_input_section.
7915 * output.cc (Output_section::add_relaxed_input_section): Add new
7916 arguments LAYOUT and NAME. Set section order index.
7917 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7918 Copy section order index.
7919 * output.h (Output_section::add_relaxed_input_section): Add new
7920 arguments LAYOUT and NAME.
7921
90e24de5
ILT
79222010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7923
7924 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 7925 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
7926 * testsuite/Makefile.in: Regenerate.
7927
c9484ea5
DK
79282010-10-20 Doug Kwan <dougkwan@google.com>
7929
7930 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
7931 without SHF_LINK_ORDER flags.
7932 * layout.cc (Layout::choose_output_section): Do not filter
7933 SHF_LINK_ORDER flag in a relocatable link.
7934
5bc2f5be
CC
79352010-10-17 Cary Coutant <ccoutant@google.com>
7936
7937 * output.h (Output_segment::set_section_addresses): Change function
7938 signature. Update all callers.
7939 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
7940 sections.
7941 (Output_segment::set_section_addresses): Align after last TLS
7942 section. Add padding before last relro section instead of after.
7943
0c91cf04
DK
79442010-10-17 Doug Kwan <dougkwan@google.com>
7945
7946 * gold/arm.cc (Target_arm::got_section): Use correct order and set
7947 GOT output section to be writable.
7948
8c21d9d3
CC
79492010-10-14 Cary Coutant <ccoutant@google.com>
7950
7951 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
7952 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
7953 * gold.cc (queue_initial_tasks): Check parameters for incremental link
7954 mode.
7955 * incremental.cc (report_command_line): Ignore all forms of
7956 --incremental.
7957 * layout.cc (Layout::Layout): Check parameters for incremental link
7958 mode.
7959 * options.cc (General_options::parse_incremental): New function.
7960 (General_options::parse_no_incremental): New function.
7961 (General_options::parse_incremental_full): New function.
7962 (General_options::parse_incremental_update): New function.
7963 (General_options::incremental_mode_): New data member.
7964 (General_options::finalize): Check incremental_mode_.
7965 * options.h (General_options): Update help text for --incremental.
7966 Add --no-incremental, --incremental-full, --incremental-update.
7967 (General_options::Incremental_mode): New enum type.
7968 (General_options::incremental_mode): New function.
7969 (General_options::incremental_mode_): New data member.
7970 * parameters.cc (Parameters::incremental_mode_): New data member.
7971 (Parameters::set_options): Set incremental_mode_.
7972 (Parameters::set_incremental_full): New function.
7973 (Parameters::incremental): New function.
7974 (Parameters::incremental_update): New function.
7975 (set_parameters_incremental_full): New function.
7976 * parameters.h (Parameters::set_incremental_full): New function.
7977 (Parameters::incremental): New function.
7978 (Parameters::incremental_update): New function.
7979 (Parameters::incremental_mode_): New data member.
7980 (set_parameters_incremental_full): New function.
7981 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
7982 incremental link mode.
7983 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
7984 (Sized_relobj::do_relocate_sections): Likewise.
7985 * testsuite/Makefile.am (incremental_test): Use --incremental-full
7986 option.
7987 * testsuite/Makefile.in: Regenerate.
7988 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 7989
bb32aa18 79902010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
7991
7992 * script-sections.h (class Script_sections): Make
7993 Sections_elements typedef public.
7994 * script-sections.cc (class Sort_output_sections): Add elements_
7995 field. Add constructor which sets it; change all callers.
7996 (Sort_output_sections::is_before): New function.
7997 (Sort_output_sections::operator()): Call is_before.
7998 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
7999 conditional.
8000 * testsuite/script_test_10.sh: New test. Test script section
8001 order.
8002 * testsuite/script_test_10.t: Likewise.
8003 * testsuite/script_test_10.s: Likewise.
8004 * testsuite/Makefile.am: Wrap the cross linker tests and the
8005 common tests into NATIVE_OR_CROSS_LINKER.
8006 (check_SCRIPTS): Add script_test_10.sh.
8007 (check_DATA): Add script_test_10.stdout.
8008 (script_test_10.o, script_test_10): New targets.
8009 (script_test_10.stdout): New target.
8010 * configure, testsuite/Makefile.in: Regenerate.
8011
3cef7179
ILT
80122010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8013
8014 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
8015 error for the deprecated relocations.
8016 (Target_arm::Scan::global): Likewise.
8017 (Target_arm::Relocate::relocate): Likewise.
8018
7411e9a8
RS
80192010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
8020
8021 * fileread.cc (Input_file::find_file): Initialize *found_name
8022 and *namep when using the fallback search for case 4.
8023
6a9da32a
CC
80242010-10-11 Cary Coutant <ccoutant@google.com>
8025
8026 * options.h (class General_options): Redefine -z lazy as an alias for
8027 the negation of -z now.
8028
ac897c20
ILT
80292010-10-11 Ian Lance Taylor <iant@google.com>
8030
8031 * resolve.cc (symbol_to_bits): Report the value of the unsupported
8032 binding.
8033
ea5cae92
NC
80342010-10-06 Nick Clifton <nickc@redhat.com>
8035
8036 * script-sections.cc(class Memory_region): Remove
8037 current_lma_offset_ field. Rename current_vma_offset_ to
8038 current_offset_. Add last_section_ field.
8039 (Memory_region::get_current_vma_address): Rename to
8040 get_current_address.
8041 (Memory_region::get_current_lma_address): Delete.
8042 (Memory_region::increment_vma_offset): Rename to
8043 increment_offset.
8044 (Memory_region::increment_lma_offset): Delete.
8045 (Memory_region::attributes_compatible): New method. Returns
8046 true if the provided section is compatible with the region.
8047 (Memory_region::get_last_section): New method. Returns the last
8048 section to use the region.
8049 (Memory_region::set_last_section): New method. Stores the last
8050 section to use the region.
8051 (Script_sections::block_in_region): New method. Returns true if
8052 a block of memory is contained within a region.
8053 (Script_sections::find_memory_region): New method. Locates a
8054 memory region to be used to set a VMA or LMA address.
8055 (Output_section_definition::set_section_addresses): Add code to
8056 check for addresses set by memory regions.
8057 (Output_segment::set_section_addresses): Remove memory region
8058 walking code.
8059 (Script_sections::create_segment): Add a warning if a header
8060 segment is created outside of any region.
8061 * script-sections.h (class Script_sections): Add prototypes for
8062 find_memory_region and block_in_region methods.
8063 * testsuite/memory_test.s: Use .long instead of .word.
8064 * testsuite/memory_test.t: Add some more output sections.
8065 * testsuite/memory_test.sh: Update expected output.
8066
a9bfd952
DK
80672010-10-02 Doug Kwan <dougkwan@google.com>
8068
8069 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
8070 defintion to symtab.h
8071 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
8072 declaration to defintion.
8073
bacff3ab
NC
80742010-10-01 Nick Clifton <nickc@redhat.com>
8075
8076 * expression.cc (eval): Replace dummy argument with NULL.
8077 (eval_maybe_dot): Check for a NULL result section pointer.
8078 (Symbol_expression::value): Likewise.
8079 (Dot_expression::value): Likewise.
8080 (BINARY_EXPRESSION): Likewise.
8081 (Max_expression::value): Likewise.
8082 (Min_expression::value): Likewise.
8083 (Absolute_expression::value): Likewise.
8084 (Addr_expression::value_from_output_section): Likewise.
8085 (Loaddddr_expression::value_from_output_section): Likewise.
8086 (Segment_start_expression::value): Likewise.
8087 * script-sections.cc
8088 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
8089 argument with NULL.
8090 (Sections_elememt_dot_assignment::set_section_addresses):
8091 Likewise.
8092 (Output_data_expression::do_write_to_buffer): Likewise.
8093 (Output_section_definition::finalize_symbols): Likewise.
8094 (Output_section_definition::set_section_addresses): Likewise.
8095
f81bc8b5
DK
80962010-09-30 Doug Kwan <dougkwan@google.com>
8097
8098 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
8099
c95e9f27
ST
81002010-09-28 Sriraman Tallam <tmsriram@google.com>
8101
8102 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 8103 function.
c95e9f27
ST
8104 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
8105 virtual function.
8106 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
8107 virtual function.
8108 * icf.cc (get_section_contents): Inline merge sections only when
8109 target allows it.
8110
3cac54d2
RW
81112010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8112
8113 * configure: Regenerate.
8114
2904037a
ILT
81152010-09-17 Ian Lance Taylor <iant@google.com>
8116
8117 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
8118 * testsuite/Makefile.am (memory_test.o): New target.
8119 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
8120 memory_test.t.
8121 * testsuite/Makefile.in: Rebuild.
2904037a 8122
bca7fb63
DK
81232010-09-17 Doug Kwan <dougkwan@google.com>
8124
8125 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
8126 defintion if relocation uses GOT entries of the symbol.
8127 * testsuite/icf_safe_test.sh: Fix test.
8128 * testsuite/icf_safe_so_test.sh: Fix test.
8129
4ef28648
CC
81302010-09-16 Cary Coutant <ccoutant@google.com>
8131
8132 * script_sections.cc (class Memory_region): Remove "NULL" from
8133 vector initializations.
8134
793990de
CC
81352010-09-15 Cary Coutant <ccoutant@google.com>
8136
8137 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
8138 Resolve forwarding symbols.
8139
81e015e2
DK
81402010-09-15 Doug Kwan <dougkwan@google.com>
8141
8142 * gold/testsuite/script_test_3.t: Add ARM special sections.
8143 * gold/testsuite/script_test_4.t: Same.
8144 * gold/testsuite/script_test_5.t: Same.
8145 * gold/testsuite/script_test_6.t: Same.
8146 * gold/testsuite/script_test_7.t: Same.
8147 * gold/testsuite/script_test_7.t: Same.
8148 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
8149
36171d64
CC
81502010-09-14 Cary Coutant <ccoutant@google.com>
8151
8152 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
8153 (Target_x86_64::Relocate::relocate_tls): Replace check for
8154 saw_tls_block_reloc_ with test for executable section.
8155
d89051bd
CC
81562010-09-12 Cary Coutant <ccoutant@google.com>
8157
8158 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
8159 position-independent executables to shared libraries need dynamic
8160 relocations.
8161 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
8162 position-independent executables.
8163 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
8164 * testsuite/Makefile.in: Regenerate.
8165
fca41f0f
NC
81662010-09-10 Nick Clifton <nickc@redhat.com>
8167
8168 PR gold/11997
8169 * testsuite/memory_test.t: Discard any sections that are not
8170 needed.
8171
6695e4b3
L
81722010-09-09 H.J. Lu <hongjiu.lu@intel.com>
8173
8174 PR gold/11996
8175 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
8176 "This::" to work around a bug in gcc 4.2.
8177
8178 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
8179
0f72bf6f
RÁE
81802010-09-09 Rafael Espindola <espindola@google.com>
8181
8182 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
8183 sections with different PF_X flags in the same segment.
8184 (Layout::find_first_load_seg): Search all segments to find the first
8185 one.
8186 * options.h (rosegment): New.
8187
81882010-09-08 Rafael Espindola <espindola@google.com>
a6577478 8189
05a79166 8190 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 8191
aa98ff75
DK
81922010-09-08 Doug Kwan <dougkwan@google.com>
8193
8194 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
8195 (Arm_relobj::do_relocate_sections): Add new parameter for output
8196 file to match the parent.
8197 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
8198 of local symbols instead of input values. Update code to track
8199 changes in gold::relocate_section.
8200 * object.cc (Sized_relobj::compute_final_local_value): New methods.
8201 (Sized_relobj::compute_final_local_value_internal): New methods.
8202 (Sized_relobj::do_finalize_local_symbols): Move code from loop
8203 body into private version of Sized_relobj::compute_final_local_value.
8204 Call the inline method.
8205 * object.h (Symbol_value::Symbol_value): Define destructor. Free
8206 merged symbol value if there is one.
8207 (Symbol_value::has_output_value): New method defintiion.
8208 (Sized_relobj::Compute_final_local_value_status): New enum type.
8209 (Sized_relobj::compute_final_local_value): New methods.
8210 (Sized_relobj::compute_final_local_value_internal): New methods.
8211 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
8212 and arm_cortex_a8.sh.
8213 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
8214 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
8215 New tests.
8216 * Makefile.in: Regenerate.
8217 * testsuite/arm_bl_out_of_range.s: Update test.
8218 * testsuite/thumb_bl_out_of_range.s: Ditto.
8219 * testsuite/thumb_blx_out_of_range.s: Ditto.
8220 * testsuite/arm_branch_out_of_range.sh: New file.
8221 * testsuite/arm_cortex_a8.sh: Ditto.
8222 * testsuite/arm_cortex_a8_b.s: Ditto.
8223 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
8224 * testsuite/arm_cortex_a8_b_local.s: Ditto.
8225 * testsuite/arm_cortex_a8_bl.s: Ditto.
8226 * testsuite/arm_cortex_a8_blx.s: Ditto.
8227 * testsuite/arm_cortex_a8_local.s: Ditto.
8228 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
8229 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
8230
05a79166
L
82312010-09-08 Rafael Espindola <espindola@google.com>
8232
8233 * Makefile.am (memory_test.stdout): Run readelf with -W.
8234 * Makefile.in: Regenerate.
8235 * testsuite/memory_test.sh: Make the regexps accept both 32 and
8236 64 bit output.
8237
33dbc701
RÁE
82382010-09-08 Rafael Espindola <espindola@google.com>
8239
8240 * script-sections.cc (Script_sections::add_memory_region): Convert
8241 field precision to int.
8242 * script.cc (script_set_section_region, script_set_section_region):
8243 Convert field precision to int.
8244
731ca54a
RÁE
82452010-09-08 Rafael Espindola <espindola@google.com>
8246
8247 * arm.cc (do_finalize_sections): Create the __exidx_start and
8248 __exdix_end symbols even when the section is missing.
8249
7f8cd844
NC
82502010-09-08 Nick Clifton <nickc@redhat.com>
8251
8252 * README: Remove claim that MEMORY is not supported.
8253 * expression.cc (script_exp_function_origin)
8254 (script_exp_function_length): Move from here to ...
8255 * script.cc: ... here.
8256 (script_set_section_region, script_add_memory)
8257 (script_parse_memory_attr, script_include_directive): New
8258 functions.
8259 * script-sections.cc
8260 (class Memory_region): New class.
8261 (class Output_section_definition): Add set_memory_region,
8262 set_section_vma, set_section_lma and get_section_name methods.
8263 (class Script_Sections): Add add_memory_region,
8264 find_memory_region, find_memory_region_origin,
8265 find_memory_region_length and set_memory_region methods.
8266 Have set_section_addresses method walk the list of set memory
8267 regions.
8268 Extend the print methos to display memory regions.
8269 * script-sections.h: Add prototypes for new methods.
8270 Add enum for MEMORY region attributes.
8271 * yyscript.y: Add support for parsing MEMORY regions.
8272 * script-c.h: Add prototypes for new functions.
8273 * testsuite/Makefile.am: Add test of MEMORY region functionality.
8274 * testsuite/Makefile.in: Regenerate.
8275 * testsuite/memory_test.sh: New script.
8276 * testsuite/memory_test.s: New assembler source file.
8277 * testsuite/memory_test.t: New linker script.
8278
a4649286
DK
82792010-08-27 Doug Kwan <dougkwan@google.com>
8280
8281 * gold/resolve.cc (Symbol_table::should_override): Let a weak
8282 reference override an existing dynamic weak reference.
8283 * testsuite/Makefile.am: Add new test dyn_weak_ref.
8284 * testsuite/Makefile.in: Regenerate.
8285 * testsuite/dyn_weak_ref.sh: New file.
8286 * testsuite/dyn_weak_ref_1.c: Ditto.
8287 * testsuite/dyn_weak_ref_2.c: Ditto.
8288
b56648ad
ILT
82892010-08-27 Ian Lance Taylor <iant@google.com>
8290
8291 * incremental.h (class Incremental_input_entry): Add virtual
8292 destructor.
8293
809313cb
ILT
82942010-08-27 Ian Lance Taylor <iant@google.com>
8295
8296 * testsuite/start_lib_test_3.c: Mark t3 as used.
8297
11e32464
NC
82982010-08-27 Nick Clifton <nickc@redhat.com>
8299
8300 * options.cc (version_script): Fix small typo in previous
8301 whitespace tidyup.
8302
ca09d69a
NC
83032010-08-25 Nick Clifton <nickc@redhat.com>
8304
8305 * archive.cc: Formatting fixes: Remove whitespace between
8306 typename and following asterisk. Remove whitespace between
8307 function name and opening parenthesis.
8308 * archive.h: Likewise.
8309 * arm.cc: Likewise.
8310 * attributes.cc: Likewise.
8311 * attributes.h: Likewise.
8312 * common.cc: Likewise.
8313 * copy-relocs.cc: Likewise.
8314 * dirsearch.h: Likewise.
8315 * dynobj.cc: Likewise.
8316 * ehframe.cc: Likewise.
8317 * ehframe.h: Likewise.
8318 * expression.cc: Likewise.
8319 * fileread.cc: Likewise.
8320 * fileread.h: Likewise.
8321 * gc.h: Likewise.
8322 * gold-threads.cc: Likewise.
8323 * gold.cc: Likewise.
8324 * i386.cc: Likewise.
8325 * icf.h: Likewise.
8326 * incremental-dump.cc: Likewise.
8327 * incremental.cc: Likewise.
8328 * layout.cc: Likewise.
8329 * layout.h: Likewise.
8330 * main.cc: Likewise.
8331 * merge.cc: Likewise.
8332 * merge.h: Likewise.
8333 * object.cc: Likewise.
8334 * object.h: Likewise.
8335 * options.cc: Likewise.
8336 * options.h: Likewise.
8337 * output.cc: Likewise.
8338 * output.h: Likewise.
8339 * plugin.cc: Likewise.
8340 * plugin.h: Likewise.
8341 * powerpc.cc: Likewise.
8342 * reloc.cc: Likewise.
8343 * script-c.h: Likewise.
8344 * script-sections.cc: Likewise.
8345 * script.cc: Likewise.
8346 * stringpool.cc: Likewise.
8347 * symtab.cc: Likewise.
8348 * symtab.h: Likewise.
8349 * target.cc: Likewise.
8350 * timer.cc: Likewise.
8351 * timer.h: Likewise.
8352 * version.cc: Likewise.
8353 * x86_64.cc: Likewise.
8354
b8fa8750
NC
83552010-08-24 Nick Clifton <nickc@redhat.com>
8356
8357 PR 11899
8358 * layout.cc (segment_precedes): Sort segments by their physical
8359 addresses, if they have been set.
8360
9919d93b
CC
83612010-08-23 Cary Coutant <ccoutant@google.com>
8362
8363 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
8364 symbols data.
8365 (Lib_group::include_member): Unlock object after deleting its
8366 symbols data.
8367 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
8368 the bug fixed here.
8369
97b4be1c
CC
83702010-08-19 Neil Vachharajani <nvachhar@google.com>
8371 Cary Coutant <ccoutant@google.com>
8372
8373 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
8374 constructor, and set_blocker.
8375 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
8376 readsyms_blocker_.
8377 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
8378 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
8379 * testsuite/Makefile.am (start_lib_test): New test case.
8380 * testsuite/Makefile.in: Regenerate.
8381 * testsuite/start_lib_test_main.c: New file.
8382 * testsuite/start_lib_test_1.c: New file.
8383 * testsuite/start_lib_test_2.c: New file.
8384 * testsuite/start_lib_test_3.c: New file.
8385
dd0b1884
ILT
83862010-08-19 Ian Lance Taylor <iant@google.com>
8387
8388 * Makefile.in: Rebuild with automake 1.11.1.
8389 * aclocal.m4: Likewise.
8390 * testsuite/Makefile.in: Likewise.
8391
7223e9ca
ILT
83922010-08-19 Ian Lance Taylor <iant@google.com>
8393
8394 PR 10893
8395 * i386.cc (class Output_data_plt_i386): Update declarations.
8396 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
8397 local_ifuncs_ fields.
8398 (Target_i386::do_plt_section_for_global): New function.
8399 (Target_i386::do_plt_section_for_local): New function.
8400 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
8401 parameter; change all callers. Initialize global_ifuncs_ and
8402 local_ifuncs_. If doing a static link define __rel_iplt_start and
8403 __rel_iplt_end.
8404 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
8405 (Output_data_plt_i386::add_local_ifunc_entry): New function.
8406 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
8407 symbols.
8408 (Target_i386::make_plt_section): New function, broken out of
8409 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
8410 (Target_i386::make_plt_entry): Call make_plt_section.
8411 (Target_i386::make_local_ifunc_plt_entry): New function.
8412 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
8413 (Target_i386::Scan::local): Handle IFUNC symbols. Add
8414 R_386_IRELATIVE to switch.
8415 (Target_i386::Scan::global): Likewise.
8416 (Target_i386::Relocate::relocate): Likewise.
8417 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
8418 switch.
8419 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
8420 (Target_x86_64::do_plt_section_for_global): New function.
8421 (Target_x86_64::do_plt_section_for_local): New function.
8422 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
8423 parameter; change all callers. If doing a static link define
8424 __rela_iplt_start and __rela_iplt_end.
8425 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
8426 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
8427 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
8428 to point to .plt.
8429 (Target_x86_64::make_local_ifunc_plt_entry): New function.
8430 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
8431 switch.
8432 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
8433 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
8434 R_X86_64_IRELATIVE to switch.
8435 (Target_x86_64::Scan::global): Likewise.
8436 (Target_x86_64::Relocate::relocate): Likewise.
8437 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
8438 switch.
8439 * target.h (class Target): Add plt_section_for_global and
8440 plt_section_for_local functions. Add do_plt_section_for_global
8441 and do_plt_section_for_local virtual functions.
8442 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
8443 clarifying comments.
8444 (Symbol::use_plt_offset): Handle IFUNC symbol.
8445 * object.cc (Sized_relobj::Sized_relobj): Initialize
8446 local_plt_offsets_.
8447 (Sized_relobj::local_has_plt_offset): New function.
8448 (Sized_relobj::local_plt_offset): New function.
8449 (Sized_relobj::set_local_plt_offset): New function.
8450 (Sized_relobj::do_count): Handle IFUNC symbol.
8451 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
8452 a bit away from input_shndx_ field. Add set_is_func_symbol and
8453 is_ifunc_symbol functions.
8454 (class Sized_relobj): Update declarations. Remove Tls_got_entry
8455 and Local_tls_got_offsets. Define Local_plt_offsets. Add
8456 local_plt_offsets_ field.
8457 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
8458 * output.h (class Output_section_data): Add non-const
8459 output_section function.
8460 (class Output_data_got): Update declarations.
8461 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
8462 Add use_plt_offset parameter to global and local constructors.
8463 Change all callers. Change local_sym_index_ field to 31 bits.
8464 Change GSYM_CODE and CONSTANT_CODE accordingly.
8465 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
8466 doing a static link don't set sh_link field.
8467 (Output_data_got::Got_entry::write): Use PLT offset if
8468 appropriate.
8469 (Output_data_got::add_global_plt): New function.
8470 (Output_data_got::add_local_plt): New function.
8471 * target-reloc.h (relocate_section): Handle IFUNC symbol.
8472 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
8473 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
8474 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
8475 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
8476 IFUNC conditional.
8477 * testsuite/ifunc-sel.h: New file.
8478 * testsuite/ifuncmain1.c: New file.
8479 * testsuite/ifuncmain1vis.c: New file.
8480 * testsuite/ifuncmod1.c: New file.
8481 * testsuite/ifuncdep2.c: New file.
8482 * testsuite/ifuncmain2.c: New file.
8483 * testsuite/ifuncmain3.c: New file.
8484 * testsuite/ifuncmod3.c: New file.
8485 * testsuite/ifuncmain4.c: New file.
8486 * testsuite/ifuncmain5.c: New file.
8487 * testsuite/ifuncmod5.c: New file.
8488 * testsuite/ifuncmain6pie.c: New file.
8489 * testsuite/ifuncmod6.c: New file.
8490 * testsuite/ifuncmain7.c: New file.
8491 * configure, testsuite/Makefile.in: Rebuild.
8492
56f75c03
ILT
84932010-08-18 Ian Lance Taylor <iant@google.com>
8494
8495 * incremental.cc
8496 (Output_section_incremental_inputs::write_input_files): Add cast
8497 to avoid signed/unsigned comparison warning.
8498 (Output_section_incremental_inputs::write_info_blocks): Likewise.
8499
55455f89
CC
85002010-08-12 Cary Coutant <ccoutant@google.com>
8501
8502 * common.cc (Sort_commons::operator()): Remove unnecessary code.
8503
e2054bcb
ILT
85042010-08-13 Ian Lance Taylor <iant@google.com>
8505
8506 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
8507
74f67560
DK
85082010-08-12 Cary Coutant <ccoutant@google.com>
8509 Doug Kwan <dougkwan@google.com>
8510
8511 * resolve.cc (Symbol_table::should_override): When a weak dynamic
8512 defintion overrides non-weak undef, remember that the original undef
8513 is not weak.
8514 * symtab.cc (Symbol_table::sized_write_global): For undef without
8515 an original weak binding, set binding to global in output.
8516 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
8517 * testsuite/Makefile.in: Regenerate.
8518 * testsuite/strong_ref_weak_def.sh: New file.
8519 * testsuite/strong_ref_weak_def_1.c: Ditto.
8520 * testsuite/strong_ref_weak_def_2.c: Ditto.
8521
d1238d12
CC
85222010-08-12 Cary Coutant <ccoutant@google.com>
8523
8524 * testsuite/incremental_test.sh: Rewrite.
8525 * testsuite/incremental_test_1.c: Rewrite.
8526 * testsuite/incremental_test_2.c: Rewrite.
8527
0e70b911
CC
85282010-08-12 Cary Coutant <ccoutant@google.com>
8529
8530 * arm.cc (Target_arm::got_size): Add const.
8531 (Target_arm::got_entry_count): New function.
8532 (Target_arm::plt_entry_count): New function.
8533 (Target_arm::first_plt_entry_offset): New function.
8534 (Target_arm::plt_entry_size): New function.
8535 (Output_data_plt_arm::entry_count): New function.
8536 (Output_data_plt_arm::first_plt_entry_offset): New function.
8537 (Output_data_plt_arm::get_plt_entry_size): New function.
8538 * i386.cc (Target_i386::got_size): Add const.
8539 (Target_i386::got_entry_count): New function.
8540 (Target_i386::plt_entry_count): New function.
8541 (Target_i386::first_plt_entry_offset): New function.
8542 (Target_i386::plt_entry_size): New function.
8543 (Output_data_plt_i386::entry_count): New function.
8544 (Output_data_plt_i386::first_plt_entry_offset): New function.
8545 (Output_data_plt_i386::get_plt_entry_size): New function.
8546 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
8547 find_incremental_inputs_sections. Dump incremental_got_plt section.
8548 * incremental.cc: Include target.h.
8549 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
8550 parameter. Adjust all callers. Find incremental_got_plt section.
8551 (Incremental_inputs::create_data_sections): Create incremental_got_plt
8552 section.
8553 (Output_section_incremental_inputs::set_final_data_size): Calculate
8554 size of incremental_got_plt section.
8555 (Output_section_incremental_inputs::do_write): Write the
8556 incremental_got_plt section.
8557 (Got_plt_view_info): New struct.
8558 (Local_got_offset_visitor): New class.
8559 (Global_got_offset_visitor): New class.
8560 (Global_symbol_visitor_got_plt): New class.
8561 (Output_section_incremental_inputs::write_got_plt): New function.
8562 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
8563 Add parameter. Adjust all callers.
8564 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8565 (Incremental_inputs::got_plt_section): New function.
8566 (Incremental_inputs::got_plt_section_): New data member.
8567 (Incremental_got_plt_reader): New class.
8568 * layout.cc (Layout::create_incremental_info_sections): Add the
8569 incremental_got_plt section.
8570 * object.h (Got_offset_list::get_list): New function.
8571 (Got offset_list::for_all_got_offsets): New function.
8572 (Sized_relobj::local_got_offset_list): New function.
8573 * powerpc.cc (Target_powerpc::got_size): Add const.
8574 (Target_powerpc::got_entry_count): New function.
8575 (Target_powerpc::plt_entry_count): New function.
8576 (Target_powerpc::first_plt_entry_offset): New function.
8577 (Target_powerpc::plt_entry_size): New function.
8578 (Output_data_plt_powerpc::entry_count): New function.
8579 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
8580 (Output_data_plt_powerpc::get_plt_entry_size): New function.
8581 * sparc.cc (Target_sparc::got_size): Add const.
8582 (Target_sparc::got_entry_count): New function.
8583 (Target_sparc::plt_entry_count): New function.
8584 (Target_sparc::first_plt_entry_offset): New function.
8585 (Target_sparc::plt_entry_size): New function.
8586 (Output_data_plt_sparc::entry_count): New function.
8587 (Output_data_plt_sparc::first_plt_entry_offset): New function.
8588 (Output_data_plt_sparc::get_plt_entry_size): New function.
8589 * symtab.h (Symbol::got_offset_list): New function.
8590 (Symbol_table::for_all_symbols): New function.
8591 * target.h (Sized_target::got_entry_count): New function.
8592 (Sized_target::plt_entry_count): New function.
8593 (Sized_target::plt_entry_size): New function.
8594 * x86_64.cc (Target_x86_64::got_size): Add const.
8595 (Target_x86_64::got_entry_count): New function.
8596 (Target_x86_64::plt_entry_count): New function.
8597 (Target_x86_64::first_plt_entry_offset): New function.
8598 (Target_x86_64::plt_entry_size): New function.
8599 (Output_data_plt_x86_64::entry_count): New function.
8600 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
8601 (Output_data_plt_x86_64::get_plt_entry_size): New function.
8602
09ec0418
CC
86032010-08-12 Cary Coutant <ccoutant@google.com>
8604
8605 * archive.cc: Include incremental.h.
8606 (Archive::Archive): Initialize incremental_info_.
8607 (Archive::include_member): Record archive members in incremental info.
8608 (Add_archive_symbols::run): Record begin and end of an archive in
8609 incremental info.
8610 (Lib_group::include_member): Record objects in incremental info.
8611 * archive.h (Incremental_archive_entry): Forward declaration.
8612 (Archive::set_incremental_info): New member function.
8613 (Archive::incremental_info): New member function.
8614 (Archive::Unused_symbol_iterator): New class.
8615 (Archive::unused_symbols_begin): New member function.
8616 (Archive::unused_symbols_end): New member function.
8617 (Archive::incremental_info_): New data member.
8618 * incremental-dump.cc (find_input_containing_global): New function.
8619 (dump_incremental_inputs): Dump new incremental info sections.
8620 * incremental.cc: Include symtab.h.
8621 (Output_section_incremental_inputs): New class.
8622 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
8623 new incremental info sections.
8624 (Sized_incremental_binary::do_check_inputs): Likewise.
8625 (Incremental_inputs::report_archive): Remove.
8626 (Incremental_inputs::report_archive_begin): New function.
8627 (Incremental_inputs::report_archive_end): New function.
8628 (Incremental_inputs::report_object): New function.
8629 (Incremental_inputs::finalize_inputs): Remove.
8630 (Incremental_inputs::report_input_section): New function.
8631 (Incremental_inputs::report_script): Rewrite.
8632 (Incremental_inputs::finalize): Do nothing but finalize string table.
8633 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8634 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8635 (Incremental_inputs::create_data_sections): New function.
8636 (Incremental_inputs::relocs_entsize): New function.
8637 (Output_section_incremental_inputs::set_final_data_size): New function.
8638 (Output_section_incremental_inputs::do_write): New function.
8639 (Output_section_incremental_inputs::write_header): New function.
8640 (Output_section_incremental_inputs::write_input_files): New function.
8641 (Output_section_incremental_inputs::write_info_blocks): New function.
8642 (Output_section_incremental_inputs::write_symtab): New function.
8643 * incremental.h (Incremental_script_entry): Forward declaration.
8644 (Incremental_object_entry): Forward declaration.
8645 (Incremental_archive_entry): Forward declaration.
8646 (Incremental_inputs): Forward declaration.
8647 (Incremental_inputs_header_data): Remove.
8648 (Incremental_inputs_header): Remove.
8649 (Incremental_inputs_header_write): Remove.
8650 (Incremental_inputs_entry_data): Remove.
8651 (Incremental_inputs_entry): Remove.
8652 (Incremental_inputs_entry_write): Remove.
8653 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
8654 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
8655 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8656 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
8657 Likewise.
8658 (Incremental_input_entry): New class.
8659 (Incremental_script_entry): New class.
8660 (Incremental_object_entry): New class.
8661 (Incremental_archive_entry): New class.
8662 (Incremental_inputs::Incremental_inputs): Initialize new data members.
8663 (Incremental_inputs::report_inputs): Remove.
8664 (Incremental_inputs::report_archive): Remove.
8665 (Incremental_inputs::report_archive_begin): New function.
8666 (Incremental_inputs::report_archive_end): New function.
8667 (Incremental_inputs::report_object): Change prototype.
8668 (Incremental_inputs::report_input_section): New function.
8669 (Incremental_inputs::report_script): Change prototype.
8670 (Incremental_inputs::get_reloc_count): New function.
8671 (Incremental_inputs::set_reloc_count): New function.
8672 (Incremental_inputs::create_data_sections): New function.
8673 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8674 (Incremental_inputs::inputs_section): New function.
8675 (Incremental_inputs::symtab_section): New function.
8676 (Incremental_inputs::relocs_section): New function.
8677 (Incremental_inputs::get_stringpool): Add const.
8678 (Incremental_inputs::command_line): Add const.
8679 (Incremental_inputs::inputs): Remove.
8680 (Incremental_inputs::command_line_key): New function.
8681 (Incremental_inputs::input_file_count): New function.
8682 (Incremental_inputs::input_files): New function.
8683 (Incremental_inputs::relocs_entsize): New function.
8684 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8685 (Incremental_inputs::finalize_inputs): Remove.
8686 (Incremental_inputs::Input_info): Remove.
8687 (Incremental_inputs::lock_): Remove.
8688 (Incremental_inputs::inputs_): Change type.
8689 (Incremental_inputs::inputs_map_): Remove.
8690 (Incremental_inputs::current_object_entry_): New data member.
8691 (Incremental_inputs::inputs_section_): New data member.
8692 (Incremental_inputs::symtab_section_): New data member.
8693 (Incremental_inputs::relocs_section_): New data member.
8694 (Incremental_inputs::reloc_count_): New data member.
8695 (Incremental_inputs_reader): New class.
8696 (Incremental_symtab_reader): New class.
8697 (Incremental_relocs_reader): New class.
8698 * layout.cc (Layout::finalize): Move finalization of incremental info
8699 and creation of incremental info sections to follow finalization of
8700 symbol table. Set offsets for postprocessing sections.
8701 (Layout::create_incremental_info_sections): Call
8702 Incremental_inputs::create_data_sections. Add incremental symtab
8703 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
8704 sections to layout after input sections.
8705 * layout.h (struct Timespec): Forward declaration.
8706 (Layout::incremental_inputs): Add const.
8707 (Layout::create_incremental_info_sections): Add parameter.
8708 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
8709 * object.cc: Include incremental.h.
8710 (Relobj::finalize_incremental_relocs): New function.
8711 (Sized_relobj::do_layout): Record input sections in incremental info.
8712 * object.h (Object::output_section): New function.
8713 (Object::output_section_offset): Moved from Relobj.
8714 (Object::get_incremental_reloc_base): New function.
8715 (Object::get_incremental_reloc_count): New function.
8716 (Object::do_output_section): New function.
8717 (Object::do_output_section_offset): Moved from Relobj.
8718 (Object::do_get_incremental_reloc_base): New function.
8719 (Object::do_get_incremental_reloc_count): New function.
8720 (Object::Object): Initialize new data members.
8721 (Relobj::output_section): Renamed do_output_section and moved to
8722 protected.
8723 (Relobj::output_section_offset): Moved to Object.
8724 (Relobj::do_get_incremental_reloc_base): New function.
8725 (Relobj::do_get_incremental_reloc_count): New function.
8726 (Relobj::allocate_incremental_reloc_counts): New function.
8727 (Relobj::count_incremental_reloc): New function.
8728 (Relobj::finalize_incremental_relocs): New function.
8729 (Relobj::next_incremental_reloc_index): New function.
8730 (Relobj::reloc_counts_): New data member.
8731 (Relobj::reloc_bases_): New data member.
8732 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
8733 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
8734 (Sized_relobj::incremental_relocs_scan): New function.
8735 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8736 (Sized_relobj::incremental_relocs_write): New function.
8737 (Sized_relobj::incremental_relocs_write_reltype): New function.
8738 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
8739 incremental link.
8740 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
8741 archives and object files elsewhere.
8742 (Add_symbols::run): Report object files here.
8743 (Finish_group::run): Report end of archive at end of group.
8744 * reloc.cc: Include layout.h, incremental.h.
8745 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
8746 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
8747 (Sized_relobj::incremental_relocs_scan): New function.
8748 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8749 (Sized_relobj::do_relocate_sections): Write incremental relocations.
8750 (Sized_relobj::incremental_relocs_write): New function.
8751 (Sized_relobj::incremental_relocs_write_reltype): New function.
8752 * script.cc (read_input_script): Rewrite test for incremental link.
8753 Change call to Incremental_inputs::report_script.
8754 * symtab.h (Symbol_table::first_global_index): New function.
8755 (Symbol_table::output_count): New function.
8756
ce0d1972
DK
87572010-08-12 Doug Kwan <dougkwan@google.com>
8758
8759 * arm.cc (Target_arm::merge_object_attributes): Check command line
8760 options --no-wchar-size-warning and --no-enum-size-warning.
8761 * options.h (General_options): Add ld-compatible options
8762 --no-enum-size-warning and --no-wchar-size-warning.
8763
6e5710ce
ILT
87642010-08-04 Ian Lance Taylor <iant@google.com>
8765
8766 * x86_64.cc (Target_x86_64::Scan::local): Use
8767 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
8768 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
8769 (Target_x86_64::Scan::global): Likewise.
8770 (Target_x86_64::Relocate::relocate): Likewise.
8771 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
8772 Likewise.
8773
fef830db
CC
87742010-08-03 Cary Coutant <ccoutant@google.com>
8775
8776 * merge.cc (Output_merge_string::do_add_input_section): Count strings
8777 to reserve space in merged_strings vector. Keep total input size
8778 for stats.
8779 (Output_merge_string::do_print_merge_stats): Print total input size.
8780 * merge.h (Output_merge_string): Add input_size_ field.
8781 * stringpool.cc (Stringpool_template::string_length): Move
8782 implementations out of Stringpool_template class and place in
8783 stringpool.h.
8784 * stringpool.h (string_length): Move out of Stringpool_template.
8785
1e3811b0
ILT
87862010-08-03 Ian Lance Taylor <iant@google.com>
8787
8788 PR 11712
8789 * layout.cc (relaxation_loop_body): If address of load segment is
8790 set, adjust address to include headers if possible.
8791
7af0c620
ILT
87922010-08-03 Ian Lance Taylor <iant@google.com>
8793
8794 * version.cc (version_string): Bump to 1.10.
8795
22f0da72
ILT
87962010-08-03 Ian Lance Taylor <iant@google.com>
8797
8798 PR 11805
8799 * layout.h (enum Output_section_order): Define.
8800 (class Layout): Update declarations.
8801 * layout.cc (Layout::get_output_section): Add order parameter.
8802 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
8803 is_first_non_relro parameters. Change all callers.
8804 (Layout::choose_output_section): Likewise.
8805 (Layout::add_output_section_data): Likewise.
8806 (Layout::make_output_section): Likewise. Set order.
8807 (Layout::default_section_order): New function.
8808 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
8809 * output.cc (Output_section::Output_section): Initialize order_.
8810 Don't initialize deleted fields.
8811 (Output_segment::Output_segment): Don't initialize deleted
8812 fields.
8813 (Output_segment::add_output_section_to_load): New function
8814 replacing add_output_section. Change all callers to call this or
8815 add_output_section_to_nonload.
8816 (Output_segment::add_output_section_to_nonload): New function.
8817 (Output_segment::remove_output_section): Rewrite.
8818 (Output_segment::add_initial_output_data): Likewise.
8819 (Output_segment::has_any_data_sections): Likewise.
8820 (Output_segment::is_first_section_relro): Likewise.
8821 (Output_segment::maximum_alignment): Likewise.
8822 (Output_segment::has_dynamic_reloc): New function replacing
8823 dynamic_reloc_count. Change all callers.
8824 (Output_segment::has_dynamic_reloc_list): New function replacing
8825 dynamic_reloc_count_list. Change all callers.
8826 (Output_segment::set_section_addresses): Rewrite.
8827 (Output_segment::set_offset): Rewrite.
8828 (Output_segment::find_first_and_last_list): Remove.
8829 (Output_segment::set_tls_offsets): Rewrite.
8830 (Output_segment::first_section_load_address): Likewise.
8831 (Output_segment::output_section_count): Likewise.
8832 (Output_segment::section_with_lowest_load_address): Likewise.
8833 (Output_segment::write_section_headers): Likewise.
8834 (Output_segment::print_sections_to_map): Likewise.
8835 * output.h (class Output_data): Remove dynamic_reloc_count_
8836 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
8837 (Output_data::add_dynamic_reloc): Rewrite.
8838 (Output_data::has_dynamic_reloc): New function.
8839 (Output_data::dynamic_reloc_count): Remove.
8840 (class Output_section): Add order_ field. Remvoe is_relro_local_,
8841 is_last_relro_, is_first_non_relro_, is_interp_,
8842 is_dynamic_linker_section_ fields. Add order and set_order
8843 functions. Remove is_relro_local, set_is_relro_local,
8844 is_last_relro, set_is_last_relro, is_first_non_relro,
8845 set_is_first_non_relro functions, is_interp, set_is_interp,
8846 is_dynamic_linker_section, and set_is_dynamic_linker_section
8847 functions.
8848 (class Output_segment): Change Output_data_list from std::list to
8849 std:;vector. Add output_lists_ field. Remove output_data_ and
8850 output_bss_ fields. Update declarations.
8851
3ff2ccb0
ILT
88522010-08-02 Ian Lance Taylor <iant@google.com>
8853
8854 * arm.cc (Target_arm::gc_process_relocs): Use typename.
8855 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
8856 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
8857
88a4108b
ILT
88582010-08-02 Ian Lance Taylor <iant@google.com>
8859
8860 PR 11855
8861 * script.cc (Script_options::Script_options): Initialize
8862 symbol_definitions_ and symbol_references_.
8863 (Script_options::add_symbol_assignment): Update
8864 symbol_definitions_ and symbol_references_.
8865 (Script_options::add_symbol_reference): New function.
8866 (script_symbol): New function.
8867 * script.h (class Script_options): Add symbol_definitions_ and
8868 symbol_references_ fields.
8869 (Script_options::referenced_const_iterator): New type.
8870 (Script_options::referenced_begin): New function.
8871 (Script_options::referenced_end): New function.
8872 (Script_options::is_referenced): New function.
8873 (Script_options::any_unreferenced): New function.
8874 * script-c.h (script_symbol): Declare.
8875 * yyscript.y (exp): Call script_symbol.
8876 * symtab.cc: Include "script.h".
8877 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
8878 Change all callers. Check symbols referenced by scripts.
8879 (Symbol_table::add_undefined_symbols_from_command_line): Add
8880 layout parameter. Change all callers.
8881 (Symbol_table::do_add_undefined_symbols_from_command_line):
8882 Likewise. Break out loop body. Check symbols referenced by
8883 scripts.
8884 (Symbol_table::add_undefined_symbol_from_command_line): New
8885 function broken out of
8886 do_add_undefined_symbols_from_command_line.
8887 * symtab.h (class Symbol_table): Update declarations.
8888 * archive.cc: Include "layout.h".
8889 (Archive::should_include_member): Add layout parameter. Change
8890 all callers. Check for symbol mentioned in expression.
8891 * archive.h (class Archive): Update declaration.
8892 * object.cc (Sized_relobj::do_should_include_member): Add layout
8893 parameter.
8894 * object.h (Object::should_include_member): Add layout parameter.
8895 Change all callers.
8896 (Object::do_should_include_member): Add layout parameter.
8897 (class Sized_relobj): Update declaration.
8898 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
8899 parameter.
8900 * dynobj.h (class Sized_dynobj): Update declaration.
8901 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
8902 layout parameter.
8903 * plugin.h (class Sized_pluginobj): Update declaration.
8904
5f1ab67a
ILT
89052010-08-02 Ian Lance Taylor <iant@google.com>
8906
8907 PR 11866
8908 * output.cc (Output_segment::set_offset): Search for the first and
8909 last sections rather than assuming that the list is in order.
8910 (Output_segment::find_first_and_last_list): New function.
8911 * output.h (class Output_segment): Update declarations.
8912 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
8913 (relro_strip_test_SOURCES): New variable.
8914 (relro_strip_test_DEPENDENCIES): New variable.
8915 (relro_strip_test_LDFLAGS): New variable.
8916 (relro_strip_test_LDADD): New variable.
8917 (relro_strip_test.so): New target.
8918
a8df5856
ILT
89192010-08-02 Ian Lance Taylor <iant@google.com>
8920
8921 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
8922 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
8923 (Target_i386::got_tlsdesc_section): New function.
8924 (Target_i386::got_section): Create space for GOT entries for
8925 TLSDESC relocations.
8926 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
8927 R_386_TLS_GOTDESC.
8928 (Target_i386::Scan::global): Likewise.
8929 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
8930 using TLSDESC GOT.
8931 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
8932 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
8933 (Target_x86_64::got_tlsdesc_section): New function.
8934 (Target_x86_64::got_section): Create space for GOT entries for
8935 TLSDESC relocations.
8936 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
8937 R_386_TLS_GOTDESC.
8938 (Target_x86_64::Scan::global): Likewise.
8939 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
8940 using TLSDESC GOT.
8941
0c10a0a6
ILT
89422010-08-02 Ian Lance Taylor <iant@google.com>
8943
8944 * testsuite/final_layout.sh: Use dc to convert from hex to
8945 decimal.
8946
41cbeecc
ST
89472010-07-29 Sriraman Tallam <tmsriram@google.com>
8948
8949 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
8950 paramter to the call to gold::gc_process_relocs.
8951 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
8952 paramter to the call to gold::gc_process_relocs.
8953 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
8954 parameter to the call to gold::gc_process_relocs.
8955 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
8956 template parameter to the call to gold::gc_process_relocs.
8957 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
8958 paramter to the call to gold::gc_process_relocs.
8959 * gc.h (get_embedded_addend_size): New function.
8960 (gc_process_relocs): Save the size of the reloc for use by ICF.
8961 * icf.cc (get_section_contents): Get the addend from the text section
8962 for SHT_REL relocation sections.
8963 * icf.h (Icf::Reloc_addend_size_info): New typedef.
8964 (Icf::Reloc_info): Add new member reloc_addend_size_info.
8965 * int_encoding.h (read_from_pointer): New overloaded function.
8966 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
8967 * testsuite/icf_sht_rel_addend_test.sh: New file.
8968 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
8969 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
8970
6ea55b82
RW
89712010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8972
8973 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
8974 * Makefile.in: Regenerate.
8975 * testsuite/Makefile.in: Regenerate.
8976
9691462b
ILT
89772010-07-27 Jeffrey Yasskin <jyasskin@google.com>
8978
8979 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
8980 * gold/testsuite/debug_msg.cc: Likewise.
8981 * gold/testsuite/odr_violation1.cc
8982 * gold/testsuite/odr_violation2.cc
8983
76897331
CC
89842010-07-21 Cary Coutant <ccoutant@google.com>
8985
8986 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
8987 string, and length fields.
8988 (Output_merge_string::Merged_strings_list): New type.
8989 (Output_merge_string::Merged_strings_lists): New typedef.
8990 (Output_merge_string): Replace merged_strings_ with
8991 merged_strings_lists_.
8992 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
8993 Merged_strings_list per input object and section. Don't store pointer
8994 to the string. Don't store length with each merged string entry.
8995 (Output_merge_string::finalize_merged_data): Loop over list of merged
8996 strings lists. Recompute length of each merged string.
8997
78384e8f
CC
89982010-07-15 Cary Coutant <ccoutant@google.com>
8999
9000 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
9001 here.
9002
783659f9
ILT
90032010-07-14 Ian Lance Taylor <iant@google.com>
9004
9005 * descriptors.cc (Descriptors::open): Report correct name in error
9006 message.
9007
131687b4
DK
90082010-07-13 Doug Kwan <dougkwan@google.com>
9009
9010 * arm.cc (Arm_input_section::Arm_input_section): For a
9011 SHT_ARM_EXIDX section, always keeps the input sections.
9012 (Arm_input_section::set_exidx_section_link): New method.
9013 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
9014 has_errors_ to false.
9015 (Arm_exidx_input_section::has_errors,
9016 Arm_exidx_input_section::set_has_errors): New methods.
9017 (Arm_exidx_input_section::has_errors_): New data member.
9018 (Arm_relobj::get_exidx_shndx_list): New method.
9019 (Arm_output_section::append_text_sections_to_list): Do not skip
9020 section without SHF_EXECINSTR.
9021 (Arm_output_section::fix_exidx_coverage): Skip input sections with
9022 errors.
2e702c99 9023 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
9024 section header. Make error messages more verbose. Check for
9025 a non-executable section linked to an EXIDX section.
9026 (Arm_relobj::do_read_symbols): Remove error checking, which has been
9027 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
9028 check that there is no deferred EXIDX section if we exit early.
9029 Instead of not making an EXIDX section in case of an error, make one
9030 and set the has_errors flag of it.
9031 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
9032 in a relocatable link.
9033 (Target_arm::do_relax): Look for the EXIDX output section instead of
9034 assuming that it is called .ARM.exidx.
2e702c99 9035 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
9036 section list. Do not check for SHF_EXECINSTR section flags but
9037 skip any input section with errors.
9038 * output.cc (Output_section::Output_section): Initialize
9039 always_keeps_input_sections_ to false.
9040 (Output_section::add_input_section): Check for
9041 always_keeps_input_sections_.
9042 * output.h (Output_section::always_keeps_input_sections,
9043 Output_section::set_always_keeps_input_sections): New methods.
9044 (Output_section::always_keeps_input_sections): New data member.
9045
69517287
RÁE
90462010-07-13 Rafael Espindola <espindola@google.com>
9047
9048 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
9049 * fileread.h (Input_file): Add try_extra_search_path and find_file.
9050
82742395
ILT
90512010-07-13 Philip Herron <herron.philip@googlemail.com>
9052 Ian Lance Taylor <iant@google.com>
9053
9054 * output.h (Output_section_lookup_maps::add_merge_section):
9055 Correct check of whether value was inserted.
9056 (Output_section_lookup_maps::add_merge_input_section): Likewise.
9057 (Output_section_lookup_maps::add_relaxed_input_section):
9058 Likewise.
9059 * arm.cc (Target_arm::got_section): Remove used local os.
9060 * i386.cc (Target_i386::got_section): Likewise.
9061 * x86_64.cc (Target_x86_64::got_section): Likewise.
9062 * sparc.cc (Target_sparc::got_section): Likewise.
9063 (Target_sparc::relocate): Remove unused local have_got_offset.
9064 * powerpc.cc (Target_powerpc::relocate): Likewise.
9065
f2d707b5
ILT
90662010-07-13 Ian Lance Taylor <iant@google.com>
9067
241531d6
ILT
9068 * compressed_output.cc (zlib_decompress): Fix signature in
9069 !HAVE_ZLIB_H case.
9070
f2d707b5
ILT
9071 * archive.cc (Archive::include_member): Unlock an external member
9072 of a thin archive. Don't bother to delete an object we know is
9073 NULL.
9074
a2e47362
CC
90752010-07-12 Cary Coutant <ccoutant@google.com>
9076
9077 * compressed_output.cc (zlib_decompress): New function.
9078 (get_uncompressed_size): New function.
9079 (decompress_input_section): New function.
9080 * compressed_output.h (get_uncompressed_size): New function.
9081 (decompress_input_section): New function.
9082 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
9083 Handle compressed debug sections.
9084 * layout.cc (is_compressed_debug_section): New function.
9085 (Layout::output_section_name): Map compressed section names to
9086 canonical names.
9087 * layout.h (is_compressed_debug_section): New function.
9088 (is_debug_info_section): Recognize compressed debug sections.
9089 * merge.cc: Include compressed_output.h.
9090 (Output_merge_data::do_add_input_section): Handle compressed
9091 debug sections.
9092 (Output_merge_string::do_add_input_section): Handle compressed
9093 debug sections.
9094 * object.cc: Include compressed_output.h.
9095 (Sized_relobj::Sized_relobj): Initialize new data members.
9096 (build_compressed_section_map): New function.
9097 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
9098 * object.h (Object::section_is_compressed): New method.
9099 (Object::do_section_is_compressed): New method.
9100 (Sized_relobj::Compressed_section_map): New type.
9101 (Sized_relobj::do_section_is_compressed): New method.
9102 (Sized_relobj::compressed_sections_): New data member.
9103 * output.cc (Output_section::add_input_section): Handle compressed
9104 debug sections.
9105 * reloc.cc: Include compressed_output.h.
9106 (Sized_relobj::write_sections): Handle compressed debug sections.
9107
ce279a62
CC
91082010-07-08 Cary Coutant <ccoutant@google.com>
9109
9110 * resolve.cc (Symbol_table::resolve): Remember whether undef was
9111 weak when resolving to a dynamic def.
9112 (Symbol_table::should_override): Add adjust_dyndef flag; set it
9113 for weak undef/dynamic def cases. Adjust callers.
9114 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
9115 undef_binding_weak_.
9116 (Symbol_table::sized_write_globals): Adjust symbol binding.
9117 (Symbol_table::sized_write_symbol): Add binding parameter.
9118 * symtab.h (Symbol::set_undef_binding): New method.
9119 (Symbol::is_undef_binding_weak): New method.
9120 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
9121 (Symbol_table::should_override): Add new parameter.
9122 (Symbol_table::sized_write_symbol): Add new parameter.
9123
9124 * testsuite/weak_undef_file1.cc: Add new test case.
9125 * testsuite/weak_undef_file2.cc: Fix header comment.
9126 * testsuite/weak_undef_test.cc: Add new test case.
9127
b2286c10
DK
91282010-06-29 Doug Kwan <dougkwan@google.com>
9129
9130 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
9131 Initialize USE_SYMBOL_.
9132 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
9133 definition.
9134 (Arm_reloc_property::uses_symbol_): New data member declaration.
9135 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
9136 uses symbol value and symbol is undefined but not weakly undefined.
9137
4802450a
RÁE
91382010-06-28 Rafael Espindola <espindola@google.com>
9139
9140 * plugin.cc (Plugin::load): Use dlerror.
9141
e5ca47ba
ILT
91422010-06-26 Jeffrey Yaskin <jyasskin@google.com>
9143
9144 * symtab.cc (detect_odr_violations): When reporting an ODR
9145 violation, report an object where the symbol is defined.
9146
8a75a161
DK
91472010-06-25 Doug Kwan <dougkwan@google.com>
9148
9149 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
9150 (Target_arm::section_may_have_icf_unsafe_pointers): New method
9151 definition.
9152 (Target_arm::Scan::local_reloc_may_be_function_pointer,
9153 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
9154 target hook to detect function points.
9155 (Target_arm::Scan::possible_function_pointer_reloc): New method.
9156 * icf.h (Icf::check_section_for_function_pointers): Change type of
9157 parameter SECTION_NAME to const reference to std::string. Use
9158 target hook to determine if section may have unsafe pointers.
9159 * target.h (Target::section_may_have_icf_unsafe_pointers): New
9160 method definition.
9161
42218b9f
RÁE
91622010-06-21 Rafael Espindola <espindola@google.com>
9163
9164 * fileread.cc (Input_file::find_fie): New
9165 (Input_file::open): Use Input_file::find_fie.
9166 * fileread.h (Input_file::find_fie): New
9167 * plugin.cc (set_extra_library_path): New.
9168 (Plugin::load): Add set_extra_library_path to the transfer vector.
9169 (Plugin_manager::set_extra_library_path): New.
9170 (Plugin_manager::add_input_file): Use the extra search path if set.
9171 (set_extra_library_path(): New.
9172 * plugin.h (Plugin_manager): Add set_extra_library_path and
9173 extra_search_path_.
9174
a0506cca
CC
91752010-06-19 Cary Coutant <ccoutant@google.com>
9176
9177 * layout.cc (gdb_sections): Add .debug_types.
9178 (lines_only_debug_sections): Likewise.
9179
6508b958
RÁE
91802010-06-18 Rafael Espindola <espindola@google.com>
9181
9182 * plugin.cc (add_input_file,add_input_library)
9183 (Plugin_manager::add_input_file): Make filename arguments const.
9184 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
9185 const.
9186
3e235302
DK
91872010-06-16 Doug Kwan <dougkwan@google.com>
9188
9189 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
9190 .ARM.attributes section if we have not merged any input
9191 attributes sections.
9192
106e8a6c
DK
91932010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9194
9195 * arm.cc: Allow combining objects with no EABI version
9196 information.
9197
91ff43fe
RÁE
91982010-06-15 Rafael Espindola <espindola@google.com>
9199
9200 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
9201
68ed838c
ILT
92022010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9203
9204 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
9205 (struct iovec): Correct !HAVE_READV definition.
9206
f3a2388f
CC
92072010-06-10 Cary Coutant <ccoutant@google.com>
9208
9209 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
9210 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
9211 reloc sections.
9212 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
9213
9214 PR 11683
9215 * symtab.h (Symbol::is_placeholder): New member function.
9216 * target-reloc.h (relocate_section): Check for placeholder symbols.
9217
9218 * testsuite/Makefile.am (plugin_test_8): New test.
9219 (plugin_test_9): New test.
9220 * testsuite/Makefile.in: Regenerate.
9221
e1df38aa
NC
92222010-06-09 Nick Clifton <nickc@redhat.com>
9223
9224 * yyscript.y (input_list_element): Allow strings prefixed with
9225 the '-' character. Treat these as libraries.
9226 * script.cc (script_add_library): New function. Adds a library
9227 specified by "-l<name>" found in an input script.
9228 * script-c.h: Add prototype for script_add_library.
9229
25bbe950
DK
92302010-06-07 Doug Kwan <dougkwan@google.com>
9231
9232 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
9233 Restrict stub-group size to be within long conditional branch
9234 range when working around cortex-A8 erratum.
9235
0f32ea4c
ILT
92362010-06-07 Damien Diederen <dd@crosstwine.com>
9237
9238 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
9239 #ifdef typo.
9240
8fe2a369
ST
92412010-06-03 Sriraman Tallam <tmsriram@google.com>
9242
9243 PR gold/11658
9244 * output.cc
9245 (Output_section::Input_section_sort_entry::compare_section_ordering):
9246 Change to return non-zero correctly.
9247 (Output_section::Input_section_sort_section_order_index_compare
9248 ::operator()): Change to fix ambiguity in comparisons.
9249
6e9ba2ca
ST
92502010-06-01 Sriraman Tallam <tmsriram@google.com>
9251
9252 * gold.h (is_wildcard_string): New function.
9253 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
9254 (Layout::layout_eh_frame): Ditto.
9255 (Layout::find_section_order_index): New method.
9256 (Layout::read_layout_from_file): New method.
9257 * layout.h (Layout::find_section_order_index): New method.
9258 (Layout::read_layout_from_file): New method.
9259 (Layout::input_section_position_): New private member.
9260 (Layout::input_section_glob_): New private member.
9261 * main.cc (main): Call read_layout_from_file here.
9262 * options.h (--section-ordering-file): New option.
9263 * output.cc (Output_section::input_section_order_specified_): New
9264 member.
9265 (Output_section::Output_section): Initialize new member.
9266 (Output_section::add_input_section): Add new parameter.
9267 Keep input sections when --section-ordering-file is used.
9268 (Output_section::set_final_data_size): Sort input sections when
9269 section ordering file is specified.
9270 (Output_section::Input_section_sort_entry): Add new parameter.
9271 Check sorting type.
9272 (Output_section::Input_section_sort_entry::compare_section_ordering):
9273 New method.
9274 (Output_section::Input_section_sort_compare::operator()): Change to
9275 consider section_order_index.
9276 (Output_section::Input_section_sort_init_fini_compare::operator()):
9277 Change to consider section_order_index.
9278 (Output_section::Input_section_sort_section_order_index_compare
9279 ::operator()): New method.
9280 (Output_section::sort_attached_input_sections): Change to sort
9281 according to section order when specified.
e1df38aa
NC
9282 (Output_section::add_input_section<32, true>): Add new parameter.
9283 (Output_section::add_input_section<64, true>): Add new parameter.
9284 (Output_section::add_input_section<32, false>): Add new parameter.
9285 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
9286 * output.h (Output_section::add_input_section): Add new parameter.
9287 (Output_section::input_section_order_specified): New
9288 method.
9289 (Output_section::set_input_section_order_specified): New method.
9290 (Input_section::Input_section): Initialize section_order_index_.
9291 (Input_section::section_order_index): New method.
9292 (Input_section::set_section_order_index): New method.
9293 (Input_section::section_order_index_): New member.
9294 (Input_section::Input_section_sort_section_order_index_compare): New
9295 struct.
9296 (Output_section::input_section_order_specified_): New member.
9297 * script-sections.cc (is_wildcard_string): Delete and move modified
9298 method to gold.h.
9299 (Output_section_element_input::Output_section_element_input): Modify
9300 call to is_wildcard_string.
9301 (Output_section_element_input::Input_section_pattern
9302 ::Input_section_pattern): Ditto.
9303 (Output_section_element_input::Output_section_element_input): Ditto.
9304 * testsuite/Makefile.am (final_layout): New test case.
9305 * testsuite/Makefile.in: Regenerate.
9306 * testsuite/final_layout.cc: New file.
9307 * testsuite/final_layout.sh: New file.
9308
3537c84b
RÁE
93092010-06-01 Rafael Espindola <espindola@google.com>
9310
9311 * plugin.cc (Plugin::load): Pass the output name to the plugin.
9312
105b6afd
RÁE
93132010-06-01 Rafael Espindola <espindola@google.com>
9314
9315 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
9316 visibility of symbols.
9317
29e11421
DK
93182010-05-27 Doug Kwan <dougkwan@google.com>
9319
9320 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
9321 from start of output section instead of address for a local symbol
9322 in a merged or relaxed section when doing a relocatable link.
9323
5e0f337e
RÁE
93242010-05-26 Rafael Espindola <espindola@google.com>
9325
703d02da 9326 PR 11604
5e0f337e
RÁE
9327 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
9328 adding sections the garbage collector removed.
9329 * gold/testsuite/Makefile.am: Add test.
9330 * gold/testsuite/Makefile.in: Regenerate.
9331 * gold/testsuite/plugin_test_7.sh: New.
9332 * gold/testsuite/plugin_test_7_1.c: New.
9333 * gold/testsuite/plugin_test_7_2.c: New.
9334
f4187277
RÁE
93352010-05-26 Rafael Espindola <espindola@google.com>
9336
9337 * script-sections.cc (Output_section_definition::set_section_addresses):
9338 Check for --section-start.
9339
5c388529
DK
93402010-05-26 Doug Kwan <dougkwan@google.com>
9341
9342 * arm.cc (Arm_scan_relocatable_relocs): New class.
9343 (Target_arm::relocate_special_relocatable): New method.
9344 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
9345 (Arm_relocate_functions::thumb_branch_common): Same.
9346 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
9347 instead of Default_scan_relocatable_relocs.
9348 * target-reloc.h (relocate_for_relocatable): Let target handle
9349 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
9350 * target.h (Sized_target::relocate_special_relocatable): New method.
9351
bca1c3ae
ILT
93522010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9353
9354 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
9355
0439c796
DK
93562010-05-23 Doug Kwan <dougkwan@google.com>
9357
9358 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
9359 instead of a cast.
9360 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
9361 with a direct branch, not a conditional branch, to a stub.
9362 * merge.cc (Output_merge_base::record_input_section): New method
9363 defintion.
9364 (Output_merge_data::do_add_input_section): Record input section if
9365 keeps-input-sections flag is set.
9366 (Output_merge_string::do_add_input_section): Ditto.
9367 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
9368 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
9369 INPUT_SECTIONS_.
9370 (Output_merge_base::keeps_input_sections,
9371 Output_merge_base::set_keeps_input_sections,
9372 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
9373 method definitions.
9374 (Output_merge_base::Input_sections): New type declaration.
9375 (Output_merge_base::input_sections_begin,
9376 Output_merge_base::input_sections_end,
9377 Output_merge_base::do_set_keeps_input_sections): New method definitions.
9378 (Output_merge_base::bool keeps_input_sections_,
9379 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
9380 Output_merge_base::input_sections_): New data members.
9381 (Output_merge_data::do_set_keeps_input_sections): New method
9382 defintion.
9383 (Output_merge_string::do_set_keeps_input_sections): Ditto.
9384 * output.cc (Output_section::Input_section::relobj): Move method
9385 defintion from class declaration to here and handle merge sections.
9386 (Output_section::Input_section::shndx): Ditto.
9387 (Output_section::Output_section): Remove initializations of removed
9388 data members and initialize new data member LOOKUP_MAPS_.
9389 (Output_section::add_input_section): Set keeps-input-sections flag
9390 for a newly created merge output section as appropriate. Adjust code
9391 to use Output_section_lookup_maps class.
9392 (Output_section::add_relaxed_input_section): Adjst code for lookup
9393 maps code refactoring.
2e702c99 9394 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
9395 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
9396 class. If adding input section to a newly created merge output
9397 section fails, remove the new merge section.
9398 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 9399 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 9400 (Output_section::find_merge_section): Ditto.
0439c796 9401 (Output_section::build_lookup_maps): New method defintion.
2e702c99 9402 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
9403 Output_section_lookup_maps class.
9404 (Output_section::get_input_sections): Export merge sections. Adjust
9405 code to use Output_section_lookup_maps class.
9406 (Output_section:::add_script_input_section): Adjust code to use
9407 Output_section_lookup_maps class. Update lookup maps for merge
9408 sections also.
9409 (Output_section::discard_states): Use Output_section_lookup_maps.
9410 (Output_section::restore_states): Same.
9411 * output.h (Merge_section_properties): Move class defintion out of
9412 Output_section.
9413 (Output_section_lookup_maps): New class.
9414 (Output_section::Input_section::is_merge_section): New method
9415 defintion.
9416 (Output_section::Input_section::relobj): Move defintion out of class
9417 defintion. Declare method only.
9418 (Output_section::Input_section::shndx): Ditto.
9419 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 9420 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
9421 (Output_section::Merge_section_by_properties_map,
9422 Output_section::Output_section_data_by_input_section_map,
9423 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
9424 Remove types.
2e702c99 9425 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
9426 KEEPS_INPUT_SECTIONS.
9427 (Output_section::build_lookup_maps): New method declaration.
9428 (Output_section::merge_section_map_,
9429 Output_section::merge_section_by_properties_map_,
9430 Output_section::relaxed_input_section_map_,
9431 Output_section::is_relaxed_input_section_map_valid_): Remove data
9432 members.
9433 (Output_section::lookup_maps_): New data member.
9434
76295588
L
94352010-05-21 Doug Kwan <dougkwan@google.com>
9436
9437 PR gold/11619
9438 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
9439 avoid a compilation error.
9440
d103a984
RÁE
94412010-05-19 Rafael Espindola <espindola@google.com>
9442
9443 * script-sections.cc (Output_section_definition::allocate_to_segment):
9444 Update the phdrs_list even when the output section is NULL.
9445 * testsuite/Makefile.am: Add test.
9446 * testsuite/Makefile.in: Regenerate.
9447 * testsuite/script_test_9.cc: New.
9448 * testsuite/script_test_9.sh: New.
9449 * testsuite/script_test_9.t: New.
9450
6625d24e
DK
94512010-05-19 Doug Kwan <dougkwan@google.com>
9452
9453 * arm.cc (Arm_input_section::original_size): New method.
9454 (Arm_input_section::do_addralign): Add a cast.
9455 (Arm_input_section::do_output_offset): Remove static cast.
9456 (Arm_input_section::original_addralign,
9457 Arm_input_section::original_size_): Change type to uint32_t.
9458 (Arm_input_section::init): Add safe casts for section alignment
9459 and size.
9460 (Arm_input_section::set_final_data_size): Do not set address and
9461 offset of stub table.
9462 (Arm_output_section::fix_exidx_coverage): Change use of of
9463 Output_section::Simple_input_section to that of
9464 Output_section::Input_section.
9465 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
9466 except for the first pass.
9467 * output.cc (Output_section::get_input_sections): Change type of
9468 input_sections to std::list<Input_section>.
9469 (Output_section::add_script_input_section): Rename from
9470 Output_section::add_simple_input_section. Change type of SIS
9471 parameter from Simple_input_section to Input_section.
9472 * output.h (Output_section::Simple_input_section): Remove class.
9473 (Output_section::Input_section): Change class visibility to public.
9474 (Output_section::Input_section::addralign): Use stored alignments
9475 for special input sections if set.
9476 (Output_section::Input_section::set_addralign): New method.
9477 (Output_section::get_input_sections): Change parameter type from
9478 list of Simple_input_section to list of Input_section.
9479 (Output_section::add_script_input_section): Rename from
9480 Output_section::add_simple_input_section. Change first parameter's
9481 type from Simple_input_section to Input_section and remove the
9482 second and third parameters.
9483 * script-sections.cc (Input_section::Input_section_list): Change
9484 type to list of Output_section::Input_section/
9485 (Input_section_info::Input_section_info): Change parameter type of
9486 INPUT_SECTION to Output_section::Input_section.
9487 (Input_section_info::input_section): Change return type.
9488 (Input_section_info::input_section_): Change type to
9489 Output_section::Input_section.
9490 (Output_section_element_input::set_section_addresses): Adjust code
9491 to use Output_section::Input_section instead of
9492 Output_section::Simple_input_section. Adjust code for renaming
9493 of Output_section::add_simple_input_section.
9494 (Orphan_output_section::set_section_addresses): Ditto.
9495
e1e82ea4
RW
94962010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9497
9498 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
9499 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
9500
91e75c8a
RÁE
95012010-05-18 Rafael Espindola <espindola@google.com>
9502
9503 * options.cc (General_options::finalize): Handle -nostdlib.
9504 * options.h (nostdlib): New option.
9505 * script.cc (script_add_search_dir): Handle -nostdlib.
9506
da59ad79
DK
95072010-05-12 Doug Kwan <dougkwan@google.com>
9508
9509 * arm.cc (Target_arm::do_finalize_sections): Create an empty
9510 attributes section only if there no attributes section after merging.
9511 (Target_arm::merge_object_attributes): Move value of
e1df38aa 9512 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
9513 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
9514 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
9515 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
9516 and arm_attr_merge_7.stdout.
9517 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
9518 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
9519 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
9520 arm_attr_merge_7b.o): New rules.
9521 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
9522 arm_attr_merge_7
9523 * testsuite/Makefile.in: Regenerate.
9524 * testsuite/arm_attr_merge.sh: New file.
9525 * testsuite/arm_attr_merge_[67][ab].s: Same.
9526
3e01a7fd
NC
95272010-05-05 Nick Clifton <nickc@redhat.com>
9528
9529 * po/es.po: Updated Spanish translation.
9530
7ad2014a
L
95312010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9532
9533 * Makefile.am (install-exec-local): Properly install gold as
9534 default cross linker.
9535 * Makefile.in: Regenerated.
9536
4fda8867
NC
95372010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9538 Nick Clifton <nickc@redhat.com>
9539
9540 * configure.ac (install_as_default): Define and set to false
9541 unless --enable-gold or --enable-gold=both/gold has been
9542 specified.
9543 * configure: Regenerate.
9544
9545 * Makefile.am (install-exec-local): Install the executable as
9546 'ld.gold'. If install_as_default is true then also install it as
9547 'ld'.
9548 * Makefile.in: Regenerated.
9549
bd288ea2
ILT
95502010-04-24 Ian Lance Taylor <iant@google.com>
9551
9552 * layout.cc (Layout::layout_reloc): In relocatable link don't
9553 combine reloc sections for grouped sections.
9554
ef38fd8a
ST
95552010-04-23 Sriraman Tallam <tmsriram@google.com>
9556
9557 * gc.h (gc_process_relocs): Pass information on relocs pointing to
9558 sections that are not ordinary to icf.
9559 * icf.cc (get_section_contents): Handle relocation pointing to section
9560 with no object or shndx information.
9561 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
9562 * testsuite/Makefile.in: Regenerate.
9563 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
9564 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
9565
f6973bdc
ILT
95662010-04-22 Ian Lance Taylor <iant@google.com>
9567
9568 * expression.cc (Expression::Expression_eval_info): Add
9569 result_alignment_pointer field.
9570 (Expression::eval_with_dot): Add result_alignment_pointer
9571 parameter. Change all callers.
9572 (Expression::eval_maybe_dot): Likewise.
9573 (class Binary_expression): Add alignment_pointer parameter to
9574 left_value and right_value. Change all callers.
9575 (BINARY_EXPRESSION): Set result alignment.
9576 (class Trinary_expression): Add alignment_pointer parameter to
9577 arg2_value and arg3_value. Change all callers.
9578 (Trinary_cond::value): Set result alignment.
9579 (Max_expression::value, Min_expression::value): Likewise.
9580 (Align_expression::value): Likewise.
9581 * script-sections.cc (class Sections_element): Add dot_alignment
9582 parameter to set_section_addresses virtual function. Update
9583 instantiations.
9584 (class Output_section_element): Likewise.
9585 (Script_sections::create_segments): Add dot_alignment parameter.
9586 Change all callers.
9587 (Script_sections::create_segments_from_phdrs_clause): Likewise.
9588 (Script_sections::set_phdrs_clause_addresses): Likewise.
9589 * script-sections.h: Update declarations.
9590 * script.h: Update declarations.
9591 * output.h (Output_segment::set_minimum_p_align): Don't decrease
9592 min_p_align.
9593 * testsuite/script_test_3.t: Set large alignment.
9594 * testsuite/script_test_3.sh: Make sure that at least one LOAD
9595 segment has expected alignment.
9596
9c9c98a5
NC
95972010-04-22 Nick Clifton <nickc@redhat.com>
9598
9599 * po/gold.pot: Updated by the Translation project.
9600 * po/vi.po: Updated Vietnamese translation.
9601
2253bfba
L
96022010-04-22 H.J. Lu <hongjiu.lu@intel.com>
9603
9604 * testsuite/Makefile.am (check_PROGRAMS): Add
9605 icf_virtual_function_folding_test.
9606 * testsuite/Makefile.in: Regenerated.
9607
85fdf906
AH
96082010-04-15 Andrew Haley <aph@redhat.com>
9609
9610 * options.h (merge_exidx_entries): New option.
9611 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
9612 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
9613 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
9614 (Target_arm::merge_exidx_entries): New function.
9615 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
9616 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
9617 to Arm_exidx_fixup constructor.
9618 Add new arg, merge_exidx_entries.
9619 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
9620 Arm_output_section::fix_exidx_coverage.
9621
ce97fa81
ST
96222010-04-18 Sriraman Tallam <tmsriram@google.com>
9623
9624 * icf.cc (get_section_contents): Check for preemptible functions.
9625 Ignore addend when appropriate.
9626 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
9627 section folded.
9628 (add_from_relobj): Check for section folded.
9629 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
9630 * symtab.h (should_add_dynsym_entry): Add new parameter.
9631 * target-reloc.h (scan_relocs): Check for section folded.
9632 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
9633 Check reloc types for function pointers in shared objects.
9634 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
9635 case.
9636 (icf_preemptible_functions_test): New test case.
9637 (icf_string_merge_test): New test case.
9638 * testsuite.Makefile.in: Regenerate.
9639 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
9640 bar_glob. Refactor code.
9641 * testsuite/icf_preemptible_functions_test.cc: New file.
9642 * testsuite/icf_preemptible_functions_test.sh: New file.
9643 * testsuite/icf_string_merge_test.cc: New file.
9644 * testsuite/icf_string_merge_test.sh: New file.
9645 * testsuite/icf_virtual_function_folding_test.cc: New file.
9646 * testsuite/icf_virtual_function_folding_test.sh: New file.
9647
04ceb17c
DK
96482010-04-14 Doug Kwan <dougkwan@google.com>
9649
9650 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
9651 for local symbol recounting if we remove a section due to ICF.
9652 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
9653 there are no regular objects in input.
9654
153e7da4
DK
96552010-04-13 Doug Kwan <dougkwan@google.com>
9656
9657 * arm.cc (Arm_input_section::set_final_data_size): Compute
9658 accurate final data size instead of using current data size.
9659
4dbd9faf
DK
96602010-04-09 Doug Kwan <dougkwan@google.com>
9661
9662 * layout.cc (Layout::choose_output_section): Handle script section
9663 types.
9664 (Layout::make_output_section_for_script): Add section type parameter.
9665 Handle script section types.
9666 * layout.h (Layout::make_output_section_for_script): Add section
9667 type parameter.
9668 * output.cc (Output_section::Output_section): Initialize data member
9669 is_noload_.
9670 (Output_section::do_reset_address_and_file_offset): Do not set address
9671 to 0 if section is a NOLOAD section.
9672 * output.h (Output_section::is_noload): New method.
9673 (Output_section::set_is_noload): Ditto.
9674 (Output_section::is_noload_): New data member.
9675 * script-c.h (Script_section_type): New enum type.
9676 (struct Parser_output_section_header): Add new file section_type.
9677 * script-sections.cc (Sections_element::output_section_name): Add
9678 parameter for returning script section type.
9679 (Output_section_definition::output_section_name): Ditto.
9680 (Output_section_definition::section_type)P; New method.
9681 (Output_section_definiton::script_section_type_name): Ditto.
9682 (Output_section_definition::script_section_type_): New data member.
9683 (Output_section_definition::Output_section_definition): Initialize
9684 data member Output_section_definition::script_section_type_.
9685 (Output_section_definition::create_sections): Pass script section type
9686 to Layout::make_output_section_for_script.
9687 (Output_section_definition::output_section_name): Return script
9688 section type to caller.
9689 (Output_section_definition::set_section_address): Do not advance
9690 dot value and load address if section type is NOLOAD. Set address
9691 of NOLOAD sections regardless of section flags.
9692 (Output_section_definition::print): Print section type if it is
9693 not SCRIPT_SECTION_TYPE_NONE.
9694 (Output_section_definition::section_type): New method.
9695 (Output_section_definition::script_section_type_name): Ditto.
9696 (Script_sections::output_section_name): Add new parameter
9697 PSECTION_TYPE for returning script section type. Pass it to
9698 section elements. Handle discard sections.
9699 (Sort_output_sections::operator()): Handle NOLOAD sections.
9700 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 9701 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
9702 returning script section type.
9703 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
9704 INFO and NOLOAD.
9705 * yyscript.y (union): Add new field SECTION_TYPE.
9706 (COPY, DSECT, INFO, NOLOAD): New tokens.
9707 (opt_address_and_section_type): Change type to output_section_header.
9708 (section_type): New non-terminal
9709 (section_header): Handle section type.
2253bfba 9710 (opt_address_and_section_type): Return section type value.
4dbd9faf 9711
721ea635
L
97122010-04-09 H.J. Lu <hongjiu.lu@intel.com>
9713
9714 * testsuite/plugin_common_test_1.c (foo): Add prototype.
9715 * testsuite/plugin_common_test_2.c (foo): Likewise.
9716
6bf924b0
DK
97172010-04-08 Doug Kwan <dougkwan@google.com>
9718
9719 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
9720 Output_merge_data.
9721 * output.cc (Output_section::add_merge_input_section): Simplify
9722 code and return status of Output_merge_base::add_input_section.
e1df38aa 9723 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
9724 returns true.
9725
24af6f92
DK
97262010-04-07 Doug Kwan <dougkwan@google.com>
9727
9728 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
9729 if section is marked as containing instructions but has no mapping
9730 symbols.
9731 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
9732 correct section index.
9733 (Arm_relobj::find_linked_text_section): Ditto.
9734
00698fc5
CC
97352010-04-07 Cary Coutant <ccoutant@google.com>
9736
9737 * archive.cc (include_member): Destroy Read_symbols_data object before
9738 releasing file.
9739 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
9740 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
9741 (Read_symbols_data::~Read_symbols_data) New destructor.
9742 (Section_relocs::Section_relocs) New constructor.
9743 (Section_relocs::~Section_relocs) New destructor.
9744 (Read_relocs_data::Read_relocs_data) New constructor.
9745 (Read_relocs_data::~Read_relocs_data) New destructor.
9746 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
9747 pointers to NULL after deleting.
9748
7296d933
DK
97492010-04-07 Doug Kwan <dougkwan@google.com>
9750
9751 * arm.cc: Replace "endianity" with "endianness" in comments.
9752 (Arm_exidx_cantunwind): Ditto.
9753 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
9754 (Arm_relobj::merge_flags_and_attributes): New method.
9755 (Arm_relobj::merge_flags_and_attributes_): New data member.
9756 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
9757 (Arm_relobj::scan_sections_for_stubs): Ditto.
9758 (Arm_relobj::do_read_symbols): Check to see if we really want to
9759 merge processor-specific flags and attributes. Exit early if
9760 an object is empty except for section names and the undefined symbol.
9761 (Target_arm::do_finalize_sections): Move check for ELF format to
9762 Arm_relobj::do_read_symbols. Merge processor specific flags and
9763 attributes from a regular object only when we have determined that
9764 it is aapropriate. Do not create an .ARM.attributes section in
9765 output if there is no regular input object.
9766 (Target_arm::merge_processor_specific_flags): Check
9767 --warn-mismatch before printing any error.
9768 (Target_arm::merge_object_attributes): Ditto.
9769 * gold.cc (queue_middle_tasks): Handle the case in which there is
9770 no regular object in input.
9771 * options.cc (General_options::parse_EB): New method.
9772 (General_options::parse_EL): Same.
9773 (General_options::General_options): Initialize endianness_.
9774 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
9775 New options.
9776 (General_options::Endianness): New enum.
9777 (General_options::endianness): New method.
9778 (General_options::endianness_): New data member.
9779 * parameters.cc (Parameters::set_options): Check target endianness.
9780 (Parameters::set_target_once): Ditto.
9781 (Parameters::check_target_endianness): New method.
9782 (parameters_force_valid_target): If either -EL or -EB is specified,
9783 use it to define endianness of default target.
9784 * parameters.h (Parameters::check_target_endianness): New method
9785 declaration.
9786 * target.h (class Target): Change "endianity" to "endianness"
9787 in comments.
9788
efc8d4f2
RW
97892010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9790
9791 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
9792 * configure: Regenerate.
9793 * Makefile.in: Regenerate.
9794 * testsuite/Makefile.in: Regenerate.
9795
be234d88
CC
97962010-04-06 Cary Coutant <ccoutant@google.com>
9797
9798 gcc PR lto/42757
9799 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
9800 prevailing definitions of common symbols.
9801 * testsuite/plugin_test_6.sh: New test case.
9802 * testsuite/plugin_common_test_1.c: New test case.
9803 * testsuite/plugin_common_test_2.c: New test case.
9804 * testsuite/Makefile.am (plugin_test_6): New test case.
9805 * testsuite/Makefile.in: Regenerate.
9806
bd32c6bd
NC
98072010-04-06 Nick Clifton <nickc@redhat.com>
9808
9809 * po/vi.po: New Vietnamese translation.
9810
323c532f
DK
98112010-03-30 Doug Kwan <dougkwan@google.com>
9812
9813 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
9814
4fcd97eb
DK
98152010-03-25 Doug Kwan <dougkwan@google.com>
9816
9817 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
9818 to avoid a conversion warning on a 32-bit host.
9819
4ebf39db
ILT
98202010-03-24 Ian Lance Taylor <iant@google.com>
9821
9822 * testsuite/script_test_3.t: Add a TLS segment.
9823 * testsuite/Makefile.am (check_PROGRAMS): Add
9824 tls_phdrs_script_test.
9825 (tls_phdrs_script_test_SOURCES): Define.
9826 (tls_phdrs_script_test_DEPENDENCIES): Define.
9827 (tls_phdrs_script_test_LDFLAGS): Define.
9828 (tls_phdrs_script_test_LDADD): Define.
9829 * testsuite/Makefile.in: Rebuild.
9830
4a599bdd
CC
98312010-03-23 Cary Coutant <ccoutant@google.com>
9832
9833 * fileread.cc (find_or_make_view): Fix comment.
9834
6c93b22c
ILT
98352010-03-23 Ian Lance Taylor <iant@google.com>
9836
9837 * script-sections.cc (class Orphan_section_placement): Define
9838 PLACE_TLS and PLACE_TLS_BSS.
9839 (Orphan_section_placement::Orphan_section_placement): Initialize
9840 new places.
9841 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
9842 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
9843 (tls_script_test_SOURCES): Define.
9844 (tls_script_test_DEPENDENCIES): Define.
9845 (tls_script_test_LDFLAGS): Define.
9846 (tls_script_test_LDADD): Define.
9847 * testsuite/Makefile.in: Rebuild.
9848
a2c7281b
DK
98492010-03-22 Doug Kwan <dougkwan@google.com>
9850
9851 * arm.cc (Arm_relocate_functions::abs8,
9852 Arm_relocate_functions::abs16): Use correct check for overflow
9853 specified in the ARM ELF specs.
9854 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
9855 target of a BLX instruction specially.
9856 (Reloc_stub::stub_type_for_reloc): Ditto.
9857 (Relocate::relocate): Use symbolic names instead of numeric relocation
9858 codes to report error.
9859 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
9860 workaround.
9861 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
9862 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
9863 thumb2_blx_out_of_range.stdout
9864 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
9865 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
9866 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
9867 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
9868 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
9869 thumb2_blx_in_range, thumb2_blx_in_range.o,
9870 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
9871 thumb2_blx_out_of_range.o): New rules.
2e702c99 9872 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
9873 thumb2_blx_in_range and thumb2_blx_out_of_range.
9874 * testsuite/Makefile.in: Regenerate.
9875 * arm_branch_in_range.sh: Add tests for THUMB BLX.
9876 * testsuite/thumb_blx_in_range.s: New file.
9877 * testsuite/thumb_blx_out_of_range.s: New file.
9878
b0193076
RÁE
98792010-03-22 Rafael Espindola <espindola@google.com>
9880
9881 * archive.cc (Should_include): Move to archive.h.
9882 (should_include_member): Make it a member of Archive.
9883 (Lib_group): New.
9884 (Add_lib_group_symbols): New.
9885 * archive.h: Include options.h.
9886 (Archive_member): Moved from Archive.
9887 (Should_include): Moved from archive.cc.
9888 (Lib_group): New.
9889 (Add_lib_group_symbols): New.
9890 * dynobj.cc (do_should_include_member): New.
9891 * dynobj.h (do_should_include_member): New.
9892 * gold.cc (queue_initial_tasks): Update call to queue.
9893 * main.cc (main): Print lib group stats.
9894 * object.cc (do_should_include_member): New.
9895 * object.h: Include archive.h.
9896 (Object::should_include_member): New.
9897 (Object::do_should_include_member): New.
9898 (Sized_relobj::do_should_include_member): New.
9899 * options.cc (General_options::parse_start_lib): New.
9900 (General_options::parse_end_lib): New.
9901 (Input_arguments::add_file): Handle lib groups.
9902 (Input_arguments::start_group): Check we are not in a lib.
9903 (Input_arguments::start_lib): New.
9904 (Input_arguments::end_lib): New.
9905 * options.h (General_options): Add start_lib and end_lib.
9906 (Input_argument::lib_): New.
9907 (Input_argument::lib): New.
9908 (Input_argument::is_lib): New.
9909 (Input_file_lib): New.
9910 (Input_arguments::in_lib_): New.
9911 (Input_arguments::in_lib): New.
9912 (Input_arguments::start_lib): New.
9913 (Input_arguments::end_lib_): New.
9914 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
9915 in unused members as preempted.
9916 (Sized_pluginobj::do_should_include_member): New.
9917 * plugin.h (Sized_pluginobj::do_should_include_member): New.
9918 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
9919 return the blocker.
9920 (Read_symbols::do_whole_lib_group): New.
9921 (Read_symbols::do_lib_group): New.
9922 (Read_symbols::do_read_symbols): Handle lib groups.
9923 (Read_symbols::get_name): Handle lib groups.
9924 * readsyms.h (Read_symbols): Add an archive member pointer.
9925 (Read_symbols::do_whole_lib_group): New.
9926 (Read_symbols::do_lib_group): New.
9927 (Read_symbols::member_): New.
9928 * script.cc (read_input_script): Update call to queue_soon.
9929
d099120c
DK
99302010-03-19 Doug Kwan <dougkwan@google.com>
9931
9932 * arm.cc (Stub_table::Stub_table): Initialize new data members
9933 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9934 (Stub_table::add_reloc_stub): Assign stub offset and update
9935 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9936 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
9937 New data members.
2e702c99 9938 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
9939 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
9940 instead of going over all reloc stubs.
2e702c99 9941 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
9942 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9943 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 9944 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
9945 Stringpool_template::offset_.
9946 * stringpool.h (Stringpool_template::set_no_zero_null): Set
9947 Stringpool_template::offset_ to zero.
9948
1aa37384
DK
99492010-03-15 Doug Kwan <dougkwan@google.com>
9950
9951 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9952 offset_.
9953 (Stringpool_template::new_key_offset): New method.
9954 (Stringpool_template::add_string): Assign offsets when adding new
9955 strings.
9956 (Stringpool_template::set_string_offsets): Do not set string offsets
9957 when not optimizing.
9958 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
9959 member size_.
2e702c99
RM
9960 (Chunked_vector::clear): Clear size_.
9961 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
9962 (Chunked_vector::size): Return size_.
9963 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 9964 (Chunked_vector::size_): New data member.
1aa37384
DK
9965 (Stringpool_template::set_no_zero_null): Assert string set is empty.
9966 (Stringpool_template::new_key_offset): New method declaration.
9967 (Stringpool_template::offset_): New data member.
9968
b672b057
RÁE
99692010-03-15 Rafael Espindola <espindola@google.com>
9970
9971 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
9972 Add_symbols' constructor.
9973 * readsyms.h (Add_symbols): Remove the input_group member.
9974
b6848d3c
ILT
99752010-03-10 Ian Lance Taylor <iant@google.com>
9976
9977 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
9978 target to ask whether a reference to a symbol requires a stack
9979 split.
9980 * target.h (Target::is_call_to_non_split): New function.
9981 (Target::do_is_call_to_non_split): Declare virtual function.
9982 * target.cc: Include "symtab.h".
9983 (Target::do_is_call_to_non_split): New function.
9984 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
9985
a2a5469e
CC
99862010-03-10 Cary Coutant <ccoutant@google.com>
9987
9988 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
9989 (File_read::open[1]): Remove initial mapping of whole_file_view_.
9990 (File_read::open[2]): Add whole_file_view_ to list of views.
9991 (File_read::make_view): Remove test of whole_file_view_.
9992 (File_read::find_or_make_view): Create whole_file_view_ if
9993 necessary.
9994 (File_read::clear_views): Replace bool parameter with enum;
9995 adjust all callers. Don't delete views with permanent data;
9996 do delete cached views and views from archives if
9997 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
9998 if clearing the corresponding view.
9999 * fileread.h (File_read::Clear_views_mode): New enum.
10000 (File_read::View::is_permanent_view): New method.
10001 (File_read::clear_views): Replace bool parameter
10002 with enum; adjust all callers.
10003 * options.h (General_options): Change keep_files_mapped option;
10004 add map_whole_files.
10005 * readsyms.cc (Add_symbols::run): Delete sd_ object before
10006 releasing the file.
10007 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
10008 the file.
10009
8861f32b
DM
100102010-03-10 David S. Miller <davem@davemloft.net>
10011
10012 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
10013
d62d0f5f
ST
100142010-03-09 Sriraman Tallam <tmsriram@google.com>
10015
10016 * icf.cc (get_section_contents): Add '@' marker after processing the
10017 merge reloc.
10018
9177756d
DK
100192010-03-08 Doug Kwan <dougkwan@google.com>
10020
10021 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
10022 due to a conversion warning.
10023 (Arm_relobj::update_output_local_symbol_count): Check for local
10024 symbol with unset output index.
10025
9e9e071b
ILT
100262010-03-05 Ian Lance Taylor <iant@google.com>
10027
10028 * options.h (class General_options): Add --spare-dynamic-tags.
10029 * output.cc (Output_data_dynamic::set_final_data_size): Implement
10030 --spare-dynamic-tags.
10031
a81ee015
ILT
100322010-03-05 Ian Lance Taylor <iant@google.com>
10033
10034 * incremental.cc: Include "libiberty.h".
10035
44ec90b9
RO
100362010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
10037
10038 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
10039 function, is_info_ member.
10040 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
10041 (Versions::Versions): Update caller.
10042 (Versions::define_base_version): Likewise.
10043 (Versions::add_def): Likewise.
10044
0897ed3b
ST
100452010-03-03 Sriraman Tallam <tmsriram@google.com>
10046
10047 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
10048 (Scan::possible_function_pointer_reloc): New function.
10049 (Scan::local_reloc_may_be_function_pointer): Change to call
10050 possible_function_pointer_reloc.
10051 (Scan::global_reloc_may_be_function_pointer): Ditto.
10052 * icf.h (Icf::check_section_for_function_pointers): Change to reject
10053 relocations in ".data.rel.ro._ZTV" section.
10054 * testsuite/icf_safe_so_test.sh: Change to pass i386.
10055 * testsuite/icf_safe_so_test.cc: Ditto.
10056 * testsuite/icf_safe_test.cc: Ditto.
10057 * testsuite/icf_safe_test.sh: Ditto.
10058
d3bbad62
ILT
100592010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10060 Ian Lance Taylor <iant@google.com>
10061
10062 * target-reloc.h (relocate_section): Check the symbol table index
10063 for -1U before setting the local symbol index.
10064 (scan_relocatable_relocs): If copying the relocation, record that
10065 the local symbol is required.
10066 * object.h (Symbol_value::is_output_symtab_index_set): New
10067 function.
10068 (Symbol_value::may_be_discarded_from_output_symtab): New
10069 function.
10070 (Symbol_value::has_output_symtab_entry): New function.
10071 (Symbol_value::needs_output_symtab_entry): Remove.
10072 (Symbol_value::output_symtab_index): Make sure the symbol index is
10073 set.
10074 (Symbol_value::set_output_symtab_index): Make sure the symbol
10075 index is not set. Make sure the new index is valid.
10076 (Symbol_value::set_must_have_output_symtab_entry): New function.
10077 (Symbol_value::has_output_dynsym_entry): New function.
10078 (Symbol_value::set_output_dynsym_index): Make sure the new index
10079 is valid.
10080 (Sized_relobj::set_must_have_output_symtab_entry): New function.
10081 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
10082 local symbol if permitted.
10083 (Sized_relobj::do_finalize_local_symbols): Call
10084 is_output_symtab_index_set rather than needs_output_symtab_entry.
10085 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
10086 rather than needs_output_symtab_entry. Call
10087 has_output_dynsym_entry rather than needs_output_dynsym_entry.
10088 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
10089 is_output_symtab_index_set rather than needs_output_symtab_entry.
10090 * testsuite/discard_locals_relocatable_test.c: New file.
10091 * testsuite/discard_locals_test.sh: Test -r.
10092 * testsuite/Makefile.am (check_DATA): Add
10093 discard_locals_relocatable_test1.syms,
10094 discard_local_relocatable_test2.syms.
10095 (MOSTLYCLEANFILES): Likewise. Also add
10096 discard_locals_relocatable_test1.lout and
10097 discard_locals_relocatable_test2.out.
10098 (discard_locals_relocatable_test1.syms): New target.
10099 (discard_locals_relocatable_test.o): New target.
10100 (discard_locals_relocatable_test1.out): New target.
10101 (discard_locals_relocatable_test2.syms): New target.
10102 (discard_locals_relocatable_test2.out): New target.
10103 (various): Add missing ../ld-new dependencies.
10104 * testsuite/Makefile.in: Rebuild.
10105
7e8ccf26
NC
101062010-03-03 Nick Clifton <nickc@redhat.com>
10107
10108 * po/fi.po: New Finnish translation.
10109
2a0ff005
DK
101102010-03-01 Doug Kwan <dougkwan@google.com>
10111
10112 * layout.cc (Layout::Layout): Force section types of .init_array*,
10113 .preinit_array* and .fini_array* sections.
10114 * output.cc (Output_section::Input_section_sort_entry::has_priority):
10115 Fix check of return value of std::string::find.().
10116 (Output_section::Input_section_sort_compare::operator()): Remove
10117 comment about .init_array.
10118 (Output_section::Input_section_sort_init_fini_compare::operator()):
10119 New method.
10120 (Output_section::sort_attached_input_sections): Handle .init_array
10121 and .fini_array specially.
10122 * output.h (Output_section::Inut_section_sort_compare): Update
10123 comment.
10124 (Output_section::Input_section_sort_init_fini_compare): New struct.
10125
c3e4ae29
DK
101262010-02-26 Doug Kwan <dougkwan@google.com>
10127
10128 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
10129 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
10130 * testsuite/debug_msg.sh: Avoid matching source line number for
10131 use of global variable undef_int.
10132
2fd9ae7a
DK
101332010-02-26 Doug Kwan <dougkwan@google.com>
10134
10135 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
10136 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
10137 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
10138 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
10139 * options.cc (General_options::General_options): Initialize member
10140 fix_v4bx_.
10141 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
10142 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
10143 and rm_no_fix_v4bx.stdout
10144 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
10145 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
10146 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
10147 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
10148 and arm_no_fix_v4bx.
10149 * Makefile.in: Regenerate.
10150 * testsuite/arm_fix_v4bx.s: New file.
10151 * testsuite/arm_fix_v4bx.sh: Ditto.
10152
67ec7d0b
DK
101532010-02-24 Doug Kwan <dougkwan@google.com>
10154
10155 * arm.cc (Target_arm::got_section): Make the .got section the first
10156 non RELRO section in the data segment.
10157 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
10158 suffixes of section names.
10159
10165461
DK
101602010-02-24 Doug Kwan <dougkwan@google.com>
10161
10162 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
10163 flags and attributes merging if an input file is a binary file.
10164 * fileread.cc (Input_file::open): Record format of original file.
10165 * fileread.h (Input_file::Format): New enum type.
2e702c99 10166 (Input_file::Input_file): Initialize data member format_.
10165461
DK
10167 (Input_file::format): New method definition.
10168 (Input_file::format_):: New data member.
10169
4a54abbb
DK
101702010-02-24 Doug Kwan <dougkwan@google.com>
10171
10172 * arm.cc (Arm_output_data_got): New class.
10173 (ARM_TCB_SIZE): New constant
10174 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
10175 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
10176 If user uses a script with a SECTIONS clause, issue only a warning
10177 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 10178 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
10179 garbage collection.
10180 (Target_arm::got_mode_index_entry): Handle static linking.
10181 (Target_arm::Scan::local): Ditto.
10182 (Target_arm::Scan::global): Ditto.
10183 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
10184 all incorrectly implemented relocations.
e1df38aa 10185 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
10186 Arm_output_section::fix_exidx_coverage.
10187 * layout.cc (Layout::section_name_mapping): Remove trailing dots
10188 from ".ARM.exidx." and ".ARM.extab.".
10189
ca419a6f
ILT
101902010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10191
10192 * arm.cc (Target_arm::do_finalize_sections): Create attribute
10193 section if it does not already exist.
10194 * attributes.cc (Attributes_section_data::Attributes_section_data):
10195 Don't crash if size is zero.
10196
135b9c78
ILT
101972010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10198 Ian Lance Taylor <iant@google.com>
10199
10200 * gold.cc (queue_middle_tasks): If no input files were opened,
10201 exit.
10202 * workqueue.h (Task_function::Task_function): Assert that there is
10203 a blocker.
10204
bb0bfe4f
DK
102052010-02-22 Doug Kwan <dougkwan@google.com>
10206
10207 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
10208 * icf.cc (get_section_contents): Cast snprintf arguments to long long
10209 types to avoid warnings due to different uint64_t implementations
10210 on different hosts.
10211
2a2b6d42
DK
102122010-02-21 Doug Kwan <dougkwan@google.com>
10213
10214 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
10215 handling of the maximum backward branch offset.
2e702c99 10216 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
10217 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
10218 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 10219 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
10220 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
10221 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
10222 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
10223 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
10224 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
10225 thumb_bl_out_of_range thumb_bl_out_of_range.o,
10226 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
10227 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
10228 thumb2_bl_out_of_range.o): New rules.
10229 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
10230 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
10231 thumb2_bl_out_of_range
10232 * testsuite/Makefile.in: Regenerate.
10233 * testsuite/arm_bl_in_range.s: New file.
10234 * testsuite/arm_bl_out_of_range.s: Ditto.
10235 * testsuite/arm_branch_in_range.sh: Ditto.
10236 * testsuite/arm_branch_range.t: Ditto.
10237 * testsuite/thumb2_branch_range.t: Ditto.
10238 * testsuite/thumb_bl_in_range.s: Ditto.
10239 * testsuite/thumb_bl_out_of_range.s: Ditto.
10240 * testsuite/thumb_branch_range.t: Ditto.
10241
b487ad64
ST
102422010-02-20 Sriraman Tallam <tmsriram@google.com>
10243
10244 * gc.h (gc_process_relocs): Change vectors to point to the new list.
10245 Add reloc offset information.
10246 * icf.cc (get_section_contents): Change iterators to point to the new
10247 vectors. Add reloc offset information to the contents.
10248 * icf.h (Icf::Sections_reachable_info): New typedef.
10249 (Icf::Sections_reachable_list): New typedef.
10250 (Icf::Offset_info): New typedef.
10251 (Icf::Reloc_info): New struct typedef.
10252 (Icf::Reloc_info_list): New typedef.
10253 (Icf::symbol_reloc_list): Delete method.
10254 (Icf::addend_reloc_list): Delete method.
10255 (Icf::section_reloc_list): Delete method.
10256 (Icf::reloc_info_list): New method.
10257 (Icf::reloc_info_list_): New member.
10258
f96accdf
DK
102592010-02-19 Doug Kwan <dougkwan@google.com>
10260
10261 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
10262 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
10263 * arm.cc (Arm_relocation_functions): New forward declaration.
10264 (Target_arm::Target_arm): Initialize new data members
10265 got_mod_index_offset_ and tls_base_symbol_defined_.
10266 (Target_arm::Relocate::relocate_tls): New method.
10267 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
10268 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
10269 New methods.
2e702c99 10270 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
10271 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
10272 (Target_arm::got_mod_index_offset_,
10273 Target_arm::tls_base_symbol_defined_): New data members.
10274 (Target_arm::Scan::local, Target::Scan::global,
10275 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
10276 relocations.
10277
c8761b9a
DK
102782010-02-18 Doug Kwan <dougkwan@google.com>
10279
10280 * arm.cc (Arm_relobj::find_linked_text_section): New method.
10281 (Arm_relobj::make_exidx_input_section): Pass section index of linked
10282 text section as a parameter becuase some broken tools may not set
10283 the link in section header.
10284 (Target_arm::has_got_section): New method.
10285 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
10286 without any mapping symbol as data only. Remove warning.
10287 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
10288 link in its section header, try to discover the link by inspecting the
10289 REL31 relocation at the beginning of the section.
10290 (Target_arm::Scan::check_non_pic): Report name of offending relocation
10291 in error message.
10292 (Target_arm::Scan::global): Treat any reference to the symbol
10293 _GLOBAL_OFFSET_TABLE_ as a GOT access.
10294
21bb3914
ST
102952010-02-12 Sriraman Tallam <tmsriram@google.com>
10296
10297 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
10298 (Scan::global_reloc_may_be_function_pointer): New function.
10299 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10300 (Scan::global_reloc_may_be_function_pointer): New function.
10301 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10302 (Scan::global_reloc_may_be_function_pointer): New function.
10303 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
10304 (Scan::global_reloc_may_be_function_pointer): New function.
10305 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
10306 (Scan::global_reloc_may_be_function_pointer): New function.
10307 (Scan::possible_function_pointer_reloc): New function.
10308 (Target_x86_64::can_check_for_function_pointers): New function.
10309 * gc.h (gc_process_relocs): Scan relocation types to determine if
10310 function pointers were taken for targets that support it.
10311 * icf.cc (Icf::find_identical_sections): Include functions for
10312 folding in safe ICF whose pointer is not taken.
10313 * icf.h (Secn_fptr_taken_set): New typedef.
10314 (fptr_section_id_): New member.
10315 (section_has_function_pointers): New function.
10316 (set_section_has_function_pointers): New function.
10317 (check_section_for_function_pointers): New function.
10318 * options.h: Fix comment for safe ICF option.
10319 * target.h (can_check_for_function_pointers): New function.
10320 * testsuite/Makefile.am: Add icf_safe_so_test test case.
10321 Modify icf_safe_test for X86-64.
10322 * testsuite/Makefile.in: Regenerate.
10323 * testsuite/icf_safe_so_test.cc: New file.
10324 * testsuite/icf_safe_so_test.sh: New file.
10325 * testsuite/icf_safe_test.cc (kept_func_3): New function.
10326 (main): Change to take pointer to function kept_func_3.
10327 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
10328 folding is done correctly for X86-64.
10329
0da6fa6c
DM
103302010-02-12 David S. Miller <davem@davemloft.net>
10331
10332 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
10333 is_symbolless parameter.
10334 (Output_reloc<SHT_REL>::is_symbolless): New.
10335 (Output_reloc<SHT_REL>::is_symbolless_): New.
10336 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
10337 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
10338 (Output_reloc<SHT_RELA>::is_symbolless): New.
10339 (Output_data_reloc::add_global): Handle is_symbolless.
10340 (Output_data_reloc::add_global_relative): Likewise.
10341 (Output_data_reloc::add_local): Likewise.
10342 (Output_data_reloc::add_local_relative): Likewise.
10343 (Output_data_reloc::add_symbolless_global_addend): New.
10344 (Output_data_reloc::add_symbolless_local_addend): New.
10345 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
10346 is_symbolless.
10347 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
10348 instead of ->is_relative_
10349 (Output_reloc::write): Likewise.
10350 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
10351 (Output_reloc::write_rel): Simplify.
10352
10353 * sparc.cc (Target_sparc::Scan::local): Use
10354 ->add_symbolless_local_addend as needed.
10355 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
10356 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
10357 based upon relocation offset.
10358
e4782e83
DK
103592010-02-11 Doug Kwan <dougkwan@google.com>
10360
10361 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
10362 (Target_arm::Scan::global): Ditto. Also remove a comment before the
10363 beginning of function.
10364 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
10365 and MOVT_ABS relocations. Those are non issued in scanning. Fix
10366 parameter is_32bit in calls to should_apply_static_reloc.
10367 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
10368 (check_DATA): Add arm_abs_global.stdout.
10369 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
10370 arm_abs_global.stdout): New rules.
10371 (MOSTLLYCLEANFILES): Add arm_abs_global
10372 * Makefile.in: Regenerate.
10373 * testsuite/arm_abs_global.s: New file.
10374 * testsuite/arm_abs_global.sh: Ditto.
10375 * testsuite/arm_abs_lib.s: Ditto.
10376
93ceb764
ILT
103772010-02-11 Ian Lance Taylor <iant@google.com>
10378
10379 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
10380 Read_relocs task.
10381 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
10382 Allocate_commons_task first.
10383 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
10384 task, rather than symtab_lock_.
10385 (Gc_process_relocs::~Gc_process_relocs): New function.
10386 (Gc_process_relocs::is_runnable): Check this_blocker_.
10387 (Gc_process_relocs::locks): Use next_blocker_ rather than
10388 blocker_.
10389 (Scan_relocs::~Scan_relocs): New function.
10390 (Scan_relocs::is_runnable): Check this_blocker_ rather than
10391 symtab_lock_.
10392 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
10393 next_blocker_.
10394 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
10395 fields. Add this_blocker_ and next_blocker_ fields. Adjust
10396 constructor accordingly.
10397 (class Gc_process_relocs): Likewise.
10398 (class Scan_relocs): Likewise.
10399 * common.h (class Allocate_commons_task): Remove symtab_lock_
10400 field, and corresponding constructor parameter.
10401 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
10402 symtab_lock_.
10403 (Allocate_commons_task::locks): Likewise.
10404
114dfbe1
ILT
104052010-02-11 Ian Lance Taylor <iant@google.com>
10406
10407 * gold-threads.h (class Once): Define.
10408 (class Initialize_lock): Rewrite as child of Once.
10409 * gold-threads.cc (class Once_initialize): Define.
10410 (once_pointer_control): New static variable.
10411 (once_pointer, once_arg): New static variables.
10412 (c_run_once): New static function.
10413 (Once::Once, Once::run_once, Once::internal_run): New functions.
10414 (class Initialize_lock_once): Remove.
10415 (initialize_lock_control): Remove.
10416 (initialize_lock_pointer): Remove.
10417 (initialize_lock_once): Remove.
10418 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
10419 (Initialize_lock::initialize): Rewrite.
10420 (Initialize_lock::do_run_once): New function.
10421 * archive.cc (Archive::interpret_header): Only clear name if it is
10422 not already empty.
10423 * fileread.cc: Include "gold-threads.h"
10424 (file_counts_lock): New static variable.
10425 (file_counts_initialize_lock): Likewise.
10426 (File_read::release): Only increment counts when using --stats.
10427 Use a lock around the increment.
10428 * parameters.cc (class Set_parameters_target_once): Define.
10429 (set_parameters_target_once): New static variable.
10430 (Parameters::Parameters): Move here from parameters.h.
10431 (Parameters::set_target): Rewrite.
10432 (Parameters::set_target_once): New function.
10433 (Parameters::clear_target): Move here and rewrite.
10434 * parameters.h (class Parameters): Update declarations. Add
10435 set_parameters_target_once_ field.
10436 (Parameters::Parameters): Move to parameters.cc.
10437 (Parameters::clear_target): Likewise.
10438 * readsyms.cc (Read_symbols::do_group): Create a Start_group
10439 task.
10440 (Start_group::~Start_group): New function.
10441 (Start_group::is_runnable): New function.
10442 (Start_group::locks, Start_group::run): New functions.
10443 (Finish_group::run): Change saw_undefined to size_t.
10444 * readsyms.h (class Start_group): Define.
10445 (class Finish_group): Change saw_undefined_ field to size_t.
10446 (Finish_group::Finish_group): Remove saw_undefined and
10447 this_blocker parameters. Change all callers.
10448 (Finish_group::set_saw_undefined): New function.
10449 (Finish_group::set_blocker): New function.
10450 * symtab.h (class Symbol_table): Change saw_undefined to return
10451 size_t. Change saw_undefined_ field to size_t.
10452 * target-select.cc (Set_target_once::do_run_once): New function.
10453 (Target_selector::Target_selector): Initialize set_target_once_
10454 field. Don't initialize lock_ and initialize_lock_ fields.
10455 (Target_selector::instantiate_target): Rewrite.
10456 (Target_selector::set_target): New function.
10457 * target-select.h (class Set_target_once): Define.
10458 (class Target_selector): Update declarations. Make
10459 Set_target_once a friend. Remove lock_ and initialize_lock_
10460 fields. Add set_target_once_ field.
10461
fa17a3f4
ILT
104622010-02-10 Ian Lance Taylor <iant@google.com>
10463
10464 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
10465 queueing any tasks.
10466 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
10467 (queue_middle_tasks): Add all blockers before queueing any tasks.
10468 (queue_final_tasks): Likewise.
10469 * token.h (Task_token::add_blockers): New function.
10470 * object.h (Input_objects::number_of_relobjs): New function.
10471
c7177d31
ILT
104722010-02-10 Ian Lance Taylor <iant@google.com>
10473
5de0e392
ILT
10474 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
10475 shared, not if not position independent.
10476 * x86_64.cc (Relocate::relocate_tls): Likewise.
10477 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
10478 (tls_pie_pic_test): New target.
10479 * testsuite/Makefile.in: Rebuild.
10480
c7177d31
ILT
10481 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
10482 (tls_test_main_pie.o, tls_test_pie.o): New targets.
10483 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
10484 * testsuite/Makefile.in: Rebuild.
10485
684b268a
DM
104862010-02-09 David S. Miller <davem@davemloft.net>
10487
10488 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
10489 R_SPARC_RELATIVE using ->add_local_relative().
10490 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
10491
612a8d3d
DM
10492 * output.h (Output_data_dynamic::add_section_size): New method
10493 that takes two Output_data objects.
10494 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
10495 entry param. Handle it in initializers.
10496 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
10497 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
10498 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
10499 arg.
10500 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
10501 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
10502 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
10503 for dynrel_includes_plt.
10504 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10505 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10506 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
10507 before .rela.plt
10508 (Target_sparc::do_finalize_sections): Update to pass true for
10509 dynrel_includes_plt.
10510 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
10511 output before .rela.plt
10512 (Target_powerpc::do_finalize_sections): Update to pass true for
10513 dynrel_includes_plt when 32-bit.
10514
cb1be87e
DK
105152010-02-08 Doug Kwan <dougkwan@google.com>
10516
10517 * arm.cc (Arm_relobj::simple_input_section_output_address): New
10518 method.
10519 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
10520 Arm_relobj::scan_section_for_cortex_a8_stubs,
10521 Arm_relobj::do_relocation_section): Instead of calling
10522 Output_section::output_address, use faster
10523 Arm_relobj::simple_input_section_output_address.
10524
705b5121
DM
105252010-02-08 David S. Miller <davem@davemloft.net>
10526
10527 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
10528 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
10529 relocation helper function.
10530
024c4466
DM
10531 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
10532 just like R_SPARC_GOT{10,13,22}.
10533 (Target_sparc::Scan::local): Likewise.
10534 (Target_sparc::Relocate:relocate): Likewise.
10535
9109c078
ILT
105362010-02-06 Ian Lance Taylor <iant@google.com>
10537
10538 * configure.ac: Rewrite targetobjs duplicate removal code to use
10539 only shell constructs.
10540 * configure: Rebuild.
10541
cf846138
DK
105422010-02-05 Doug Kwan <dougkwan@google.com>
10543
10544 PR 11247
10545 * arm.cc (Arm_relobj::section_is_scannable): New method.
10546 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
10547 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
10548
6cfaf60b
DK
105492010-02-04 Doug Kwan <dougkwan@google.com>
10550
10551 PR 11247
10552 * arm-reloc-property.cc (cstdio): Include.
10553 * configure.ac (targetobjs): Remove duplicates.
10554 * configure: Regenerate.
10555 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
10556 big and little endian version for a given address size.
10557
5c57f1be
DK
105582010-02-03 Doug Kwan <dougkwan@google.com>
10559
10560 * arm-reloc-property.cc
10561 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10562 definition.
10563 * arm-reloc-property.h
10564 (Arm_reloc_property_table::get_implemented_static_reloc_property):
10565 New method definition.
10566 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10567 declaration.
10568 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
10569 overflow to N.
10570 (GOT_PREL): Change implemented to Y.
10571 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
10572 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
10573 (Arm_relocate_functions::movw_abs_nc): Remove method.
10574 (Arm_relocate_functions::movt_abs): Ditto.
10575 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
10576 (Arm_relocate_functions::thm_movt_abs): Ditto.
10577 (Arm_relocate_functions::movw_rel_nc): Ditto.
10578 (Arm_relocate_functions::movw_rel): Ditto.
10579 (Arm_relocate_functions::movt_rel): Ditto.
10580 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
10581 (Arm_relocate_functions:thm_movw_rel): Ditto.
10582 (Arm_relocate_functions:thm_movt_rel): Ditto.
10583 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
10584 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
10585 New method definitions.
10586 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
10587 (Arm_relocation_functions::arm_grp_ldr): Ditto.
10588 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
10589 (Arm_relocation_functions::arm_grp_ldc): Ditto.
10590 (Target_arm::Relocate::relocate): Check for non-static or
10591 unimplemented relocation code and exit early. Change calls to
10592 Target_arm::reloc_uses_thumb_bit and
10593 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
10594 instead. Refactor code to handle similar relocations to increase
10595 code sharing. Remove check for unsupported relocation code in switch
10596 statement.
10597 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
10598 relocation property table to find out size. Change error message to
10599 print out the name of a relocation code instead of the numeric value.
10600 (Target_arm::scan_reloc_for_stub): Use relocation property table
10601 instead of calling Target_arm::reloc_uses_thumb_bit().
10602
218c5831
DK
106032010-02-02 Doug Kwan <dougkwan@google.com>
10604
10605 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
10606 types of relaxed input section.
10607
0d31c79d
DK
106082010-02-02 Doug Kwan <dougkwan@google.com>
10609
10610 * Makefile.am (HFILES): Add arm-reloc-property.h.
10611 (DEFFILES): New.
2e702c99
RM
10612 (TARGETSOURCES): Add arm-reloc-property.cc
10613 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
10614 (libgold_a_SOURCES): $(DEFFILES)
10615 * Makefile.in: Regenerate.
10616 * arm-reloc-property.cc: New file.
10617 * arm-reloc-property.h: New file.
10618 * arm-reloc.def: New file.
10619 * arm.cc: Update comments.
10620 (arm-reloc-property.h): New included header.
10621 (arm_reloc_property_table): New global variable.
10622 (Target_arm::do_select_as_default_target): New method definition.
10623 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
10624 arm-reloc-property to targ_extra_obj.
10625 * parameters.cc (set_parameters_target): Call
10626 Target::select_as_default_target().
10627 * target.h (Target::select_as_default_target): New method definition.
10628 (Target::do_select_as_default_target): Same.
10629
546c7457
DK
106302010-02-01 Doug Kwan <dougkwan@google.com>
10631
10632 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
10633 first_output_text_section_.
10634 (Arm_exidx_fixup::first_output_text_section): New method definition.
10635 (Arm_exidx_fixup::first_output_text_section_): New data member.
10636 (Arm_exidx_fixup::process_exidx_section): Record the first text
10637 output section seen.
10638 (Arm_output_section::fix_exidx_coverage): Set correct linked section
10639 and entsize in output section header.
10640
11b861d5
DK
106412010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10642
10643 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
10644 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
10645 (Arm_relocate_functions::thm_alu11): New Method.
10646 (Arm_relocate_functions::thm_pc8): New Method.
10647 (Arm_relocate_functions::thm_pc12): New Method.
10648 (Target_arm::Scan::local): Handle the relocations.
10649 (Target_arm::Scan::global): Likewise.
10650 (Target_arm::Relocate::relocate): Likewise.
10651 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10652
c9a2c125
DK
106532010-01-29 Doug Kwan <dougkwan@google.com>
10654
10655 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
10656 of relocation types as ld.
10657
1521477a
DK
106582010-01-29 Doug Kwan <dougkwan@google.com>
10659
10660 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
10661 to public.
10662 (Arm_relocate_functions::thumb_branch_common): Ditto.
10663 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
10664 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
10665 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
10666 Arm_relocate_functions::jump24): Remove.
10667 (Target_arm::Relocate::relocate): Adjust code to call
10668 Arm_relocation_functions::arm_branch_common and
10669 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 10670 wrappers. Merge switch-cases together to reduce source code size.
1521477a 10671
e7eca48c
DK
106722010-01-29 Doug Kwan <dougkwan@google.com>
10673
10674 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
10675 output_local_symbol_count_needs_update_.
10676 (Arm_relobj::output_local_symbol_count_needs_update,
10677 Arm_relobj::set_output_local_symbol_count_needs_update,
10678 Arm_relobj::update_output_local_symbol_count): New methods.
10679 (Arm_relobj::output_local_symbol_count_needs_update_): New data
10680 member.
10681 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
10682 of pointed function as in a R_ARM_PREL31 relocation.
10683 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
10684 for output local symbol count updating.
10685 (Target_arm::do_relax): Update output local symbol counts in objects
10686 if necessary.
10687 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
10688
02961d7e
ILT
106892010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10690
10691 * arm.cc: Added support for the ARM relocations:
10692 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
10693 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
10694 (Arm_relocate_functions::movw_rel_nc): Renamed (was
10695 movw_prel_nc).
10696 (Arm_relocate_functions::movw_rel): New method.
10697 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
10698 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
10699 thm_movw_prel_nc).
10700 (Arm_relocate_functions::thm_movw_rel): New method.
10701 (Arm_relocate_functions::thm_movt_rel): Renamed (was
10702 thm_movt_prel).
10703 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
10704 relocations.
10705 (Target_arm::Scan::global): Likewise.
10706 (Target_arm::Relocate::relocate): Likewise.
10707 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10708 Likewise.
10709
b10d2873
ILT
107102010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10711
10712 * arm.cc: Added support for ARM group relocations.
10713 (Target_arm::reloc_needs_sym_origin): New method.
10714 (Arm_relocate_functions::calc_grp_kn): New method.
10715 (Arm_relocate_functions::calc_grp_residual): New method.
10716 (Arm_relocate_functions::calc_grp_gn): New method.
10717 (Arm_relocate_functions::arm_grp_alu): New Method.
10718 (Arm_relocate_functions::arm_grp_ldr): New Method.
10719 (Arm_relocate_functions::arm_grp_ldrs): New Method.
10720 (Arm_relocate_functions::arm_grp_ldc): New Method.
10721 (Target_arm::Scan::local): Handle the ARM group relocations.
10722 (Target_arm::Scan::global): Likewise.
10723 (Target_arm::Relocate::relocate): Likewise.
10724 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10725 Likewise.
10726
2b328d4e
DK
107272010-01-26 Doug Kwan <dougkwan@google.com>
10728
10729 * arm.cc (set): Include.
10730 (class Arm_exidx_fixup): Change type of last_input_section_ to const
10731 pointer type.
2e702c99 10732 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
10733 (Arm_output_section::append_text_sections_to_list): New method.
10734 (Arm_output_section::fix_exidx_coverage): Ditto.
10735 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 10736 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
10737 Relobj::set_section_offset() instead of
10738 Sized_relobj::invalidate_section_offset().
2e702c99 10739 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
10740 parameter for section headers. Ignore relocation sections for
10741 unallocated sections and EXIDX sections.
10742 (Target_arm::fix_exidx_coverage): New method.
10743 (Target_arm::output_section_address_less_than): New type.
10744 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
10745 linked text section instead of the EXIDX section.
10746 (Arm_output_section::create_stub_group): Add an assertion to check
10747 that this is not an EXIDX output section.
10748 (Arm_output_section::append_text_sections_to_list): New method.
10749 (Arm_output_section::fix_exidx_coverage): Ditto.
10750 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 10751 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
10752 (Target_arm::do_relax): Fix EXIDX output section coverage in the
10753 first pass.
10754 (Target_arm::fix_exidx_coverage): New method.
10755 * object.h (Relobj::set_output_section): New method.
10756 (Sized_relobj::invalidate_section_offset): Remove method.
10757 (Sized_relobj::do_invalidate_section_offset): Remove method.
10758 (Sized_relobj::do_set_section_offset): Handle offset value -1.
10759
c7f3c371
DK
107602010-01-25 Doug Kwan <dougkwan@google.com>
10761
10762 * arm.cc (Arm_exidx_merged_section::do_output_offset):
10763 Fix warning due to signed and unsigned comparison on a 32-bit host.
10764
8923b24c
DK
107652010-01-22 Doug Kwan <dougkwan@google.com>
10766
10767 * arm.cc (Target_arm::do_relax): Record an output section for section
10768 offset adjustment it contains any stub table that has changed.
10769 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
10770 offsets in an output section if necessary.
10771 * output.cc (Output_section::Output_section): Initialize
10772 section_offsets_need_adjustments_.
10773 (Output_section::add_input_section_for_script): Renamed to
10774 Output_section::add_simple_input_section.
10775 (Output_section::save_states): Add a comment.
10776 (Output_section::discard_states): New method defintion.
10777 (Output_section::adjust_section_offsets): Same.
10778 * output.h (Output_section::add_input_section_for_script): Renamed to
10779 Output_section::add_simple_input_section.
10780 (Output_section::discard_states): New method declaration.
10781 (Output_section::adjust_section_offsets): Same.
10782 (Output_section::section_offsets_need_adjustment,
10783 Output_section::set_section_offsets_need_adjustment): New method
10784 definitions.
10785 (Output_section::section_offsets_need_adjustment_): New data member.
10786 * script-sections.cc
10787 (Output_section_element_input::set_section_address): Adjust code for
10788 renaming of Output_section::add_input_section_for_script.
10789 (Orphan_output_section::set_section_address): Same.
10790
9b2fd367
DK
107912010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10792
10793 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
10794 Fix_v4bx enum values .
10795 * gold/options.h (General_options): New option definitions.
10796 (General_options::fix_v4bx): New method.
10797 (General_options::Fix_v4bx): New enum.
10798 * gold/options.cc (General_options::parse_fix_v4bx): New method.
10799 (General_options::parse_fix_v4bx_interworking): New method.
10800
80d0d023
DK
108012010-01-22 Doug Kwan <dougkwan@google.com>
10802
10803 * arm.cc (Arm_exidx_fixup): New class.
10804
af2cdeae
DK
108052010-01-21 Doug Kwan <dougkwan@google.com>
10806
10807 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
10808 classes.
10809 (Arm_exidx_section_offset_map): New type.
10810
993d07c1
DK
108112010-01-21 Doug Kwan <dougkwan@google.com>
10812
10813 * arm.cc (Arm_exidx_input_section): New class.
10814 (Arm_relobj::exidx_input_section_by_link,
10815 Arm_relobj::exidx_input_section_by_shndx,
10816 Arm_relobj::make_exidx_input_section): New methods.
10817 (read_arm_attributes_section): Remove.
10818 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
10819 information about them.
10820 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
10821 to here.
10822
5ac169d4
DK
108232010-01-20 Doug Kwan <dougkwan@google.com>
10824
10825 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
10826 Input_section_specifier to Section_id.
10827 (Target_arm::new_arm_input_section: Adjust code for change of key
10828 type.
10829 (Target_arm::find_arm_input_section): Ditto.
10830 * gc.h (object.h): Include for Section_id nand Section_id_hash.
10831 (Section_id): Remove.
10832 (Garbage_collection::Section_id_hash): Remove.
10833 * icf.h (object.h): Include for Section_id nand Section_id_hash.
10834 (Section_id): Remove.
10835 (Icf::Section_id_hash): Remove.
10836 * object.h (Section_id, Const_section_id, Section_id_hash,
10837 Const_section_id_hash): New type definitions.
10838 * output.cc (Output_section::add_relaxed_input_section): Change to
10839 use Const_section_id instead of Input_section_specifier as key type.
10840 (Output_section::add_merge_input_section): Ditto.
10841 (Output_section::build_relaxation_map): Change to use Section_id
10842 instead of Input_section_specifier as key type.
2e702c99 10843 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
10844 Ditto.
10845 (Output_section::convert_input_sections_to_relaxed_sections): Change
10846 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 10847 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
10848 (Output_section::find_relaxed_input_section): Ditto.
10849 * output.h (Input_section_specifier): Remove class.
10850 (Output_section::Output_section_data_by_input_section_map): Change
10851 key type to Const_section_id.
10852 (Output_section::Output_relaxed_input_section_by_input_section_map):
10853 Ditto.
10854 (Output_section::Relaxation_map): Change key type to Section_id.
10855
a2162063
ILT
108562010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10857
10858 * gold/arm.cc: Added support for R_ARM_V4BX relocation
10859 (class Arm_v4bx_stub): New class.
10860 (DEF_STUBS): Updated definition to support v4_veneer_bx.
10861 (Stub_factory::make_arm_v4bx_stub): New method.
10862 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
10863 (Stub_table::empty): Handle v4bx stubs.
10864 (Stub_table::add_arm_v4bx_stub): New method.
10865 (Stub_table::find_arm_v4bx_stub): New method.
10866 (Arm_relocate_functions::v4bx): New method.
10867 (Target_arm::fix_v4bx): New method.
10868 (Target_arm::Target_arm): Handle R_ARM_V4BX.
10869 (Stub_table::relocate_stubs): Likewise.
10870 (Stub_table::do_write): Likewise.
10871 (Stub_table::update_data_size_and_addralign): Likewise.
10872 (Stub_table::finalize_stubs): Likewise.
10873 (Target_arm::Scan::local): Likewise.
10874 (Target_arm::Scan::global): Likewise.
10875 (Target_arm::do_finalize_sections): Likewise.
10876 (Target_arm::Relocate::relocate): Likewise.
10877 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10878 Likewise.
10879 (Target_arm::scan_reloc_for_stub): Likewise.
10880 (Target_arm::scan_reloc_section_for_stubs): Likewise.
10881
5696ab0b
ILT
108822010-01-19 Ian Lance Taylor <iant@google.com>
10883
10884 * output.cc (Output_section_headers::do_sized_write): Write large
10885 segment count to sh_info field.
10886 (Output_file_header::do_sized_write): For large segment count,
10887 write PN_XNUM to e_phnum field.
10888
800d0f56
ILT
108892010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10890
10891 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
10892 (Arm_relocate_functions::thm_jump8): New function.
10893 (Arm_relocate_functions::thm_jump11): New function.
10894 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
10895 R_ARM_THM_JUMP11.
10896 (Target_arm::Scan::global): Likewise.
10897 (Target_arm::Relocate::relocate): Likewise.
10898 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10899 Likewise.
10900
41263c05
DK
109012010-01-14 Doug Kwan <dougkwan@google.com>
10902
10903 * arm.cc (map, utility): Include headers.
10904 (Target_arm::apply_cortex_a8_workaround): New method.
10905 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
10906 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
10907 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
10908 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
10909 the --[no-]fix-cortex-a8 command line options.
10910 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
10911 (Target_arm::relocate_stub): Use addend in instruction template.
10912 * options.h (DEFINE_bool): Set the user-set flag.
10913 (General_options): Add --[no-]-fix-cortex options.
10914 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 10915 : Update fast look-up map after conversion.
41263c05 10916
459e9b03
ST
109172010-01-14 Sriraman Tallam <tmsriram@google.com>
10918
10919 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
10920 in the first pass of do_layout.
10921
b521dfe4
DK
109222010-01-13 Doug Kwan <dougkwan@google.com>
10923
10924 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10925 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
10926 apparent compiler problem of not folding static constant integral
10927 data members of elfcpp::Elf_sizes<32>.
10928
44272192
DK
109292010-01-13 Doug Kwan <dougkwan@google.com>
10930
10931 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10932 Arm_relobj::section_needs_cortex_a8_stub_scanning,
10933 Arm_relobj::scan_section_for_cortex_a8_erratum,
10934 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
10935 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
10936 sections to scan for relocation stubs into a new method
10937 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
10938 relocation and Cortex-A8 stub scanning.
10939 (Target_arm::do_relax): Force stubs to be after stubbed sections
10940 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 10941 the beginning of a new relaxation pass. Update a comment.
44272192
DK
10942 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
10943
44b71ece
ILT
109442010-01-12 Ian Lance Taylor <iant@google.com>
10945
10946 * target-reloc.h (visibility_error): New inline function.
10947 (relocate_section): Call visibility_error.
10948 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
10949 (MOSTLYCLEANFILES): Likewise.
10950 (protected_4_pic.o, protected_3.err): New targets.
10951 * testsuite/protected_4.cc: New file.
10952
a120bc7f
DK
109532010-01-12 Doug Kwan <dougkwan@google.com>
10954
10955 * arm.cc (Cortex_a8_reloc): New class.
10956 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
10957 and cortex_a8_relocs_info_.
10958 (Target_arm::fix_cortex_a8): New method definition.
10959 (Target_arm::Cortex_a8_relocs_info): New type.
10960 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
10961 New data member declarations.
10962 (Target_arm::scan_reloc_for_stub): Record information about
10963 relocations for THUMB branches that might be exempted from the
10964 Cortex-A8 workaround.
10965 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
10966 at the beginning of a relaxation pass.
10967
20138696
DK
109682010-01-12 Doug Kwan <dougkwan@google.com>
10969
10970 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
10971 (Arm_relobj::Mapping_symbol_position,
10972 Arm_reloj::Mapping_symbol_position_less,
10973 Arm_relobj::Mapping_symbols_info): New types.
10974 (Target_arm::is_mapping_symbol_name): New method definition.
10975 (Arm_relobj::do_count_local_symbols): Save information about mapping
10976 symbols.
10977
089d69dc
DK
109782010-01-11 Doug Kwan <dougkwan@google.com>
10979
10980 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
10981 Arm_relocate_functions::thumb32_branch_upper,
10982 Arm_relocate_functions::thumb32_branch_lower,
10983 Arm_relocate_functions::thumb32_cond_branch_offset,
10984 Arm_relocate_functions::thumb32_cond_branch_upper,
10985 Arm_relocate_functions::thumb32_cond_branch_lower,
10986 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
10987 branch offset encoding.
10988 (Arm_relocate_functions::thumb_branch_common): Use new branch
10989 offset encoding methods to avoid code duplication.
10990 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
10991 (Stub_addend_reader::operator()): Use new branch encoding method
10992 to avoid code duplication.
10993
99e5bff2
DK
109942010-01-11 Doug Kwan <dougkwan@google.com>
10995
10996 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
10997 (Target_arm::do_finalize_sections): Define special EXIDX section
10998 symbols only if referenced.
10999 * gc.h (Garbage_collection::add_reference): New method.
11000 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
11001 code duplication.
11002
98e090bd
ILT
110032010-01-11 Ian Lance Taylor <iant@google.com>
11004
d0a91bd8
ILT
11005 * script.cc (Version_script_info::build_expression_list_lookup):
11006 Change complaing about duplicate wildcard match from error to
11007 warning.
11008
98e090bd
ILT
11009 * script.cc (class Lazy_demangler): Recreate--revert part of patch
11010 of 2009-12-30.
11011 (Version_script_info::Version_script_info): Initialize globs_,
11012 default_version_, default_is_global_, and exact_. Don't
11013 initialize globals_ or locals_.
11014 (Version_script_info::build_lookup_tables): Build local symbols
11015 first.
11016 (Version_script_info::unquote): New function.
11017 (Version_script_info::add_exact_match): New function.
11018 (Version_script_info::build_expression_list_lookup): Remove lookup
11019 parameter. Add is_global parameter. Change all callers. Handle
11020 wildcard pattern specially. Unquote pattern. Call
11021 add_exact_match.
11022 (Version_script_info::get_name_to_match): New function.
11023 (Version_script_info::get_symbol_version): New function.
11024 (Version_script_info::get_symbol_version_helper): Remove.
11025 (Version_script_info::check_unmatched_names): Call unquote.
11026 * script.h (class Version_script_info): Change get_symbol_version
11027 to be non-inline and add is_global parameter; change all callers.
11028 Rewrite symbol_is_local. Update declarations. Define struct
11029 Version_tree_match, Exact, Globs. Don't define struct Lookup.
11030 Remove globals_ and locals_ members. Add exact_, globs_,
11031 default_version_, is_global_.
11032 (Version_script_info::Glob): Remove pattern, add expression and
11033 is_global. Update constructor. Change all callers.
11034 * dynobj.cc (Versions::finalize): Mark the version symbol as the
11035 default version.
11036 (Versions::symbol_section_contents): If a symbol is undefined, or
11037 defined in a dynamic object, set the version index to
11038 VER_NDX_LOCAL.
11039 * symtab.cc (Symbol_table::add_from_relobj): Don't call
11040 symbol_is_local.
11041 (Symbol_table::add_from_pluginobj): Likewise.
11042 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
11043
d56962d3
DK
110442010-01-11 Doug Kwan <dougkwan@google.com>
11045
11046 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
11047 (incremental_dump_LDADD): Add linking option for libintl.
11048 * Makefile.in: Regenerate.
11049
94e6ee91
L
110502010-01-11 H.J. Lu <hongjiu.lu@intel.com>
11051
11052 PR gold/11144
11053 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
11054 instead of -Ds.
11055 * testsuite/Makefile.in: Regenerated.
11056
e96c574b
DK
110572010-01-10 Doug Kwan <dougkwan@google.com>
11058
11059 * options.h (DEFINE_var): Use parentheses around argument varname__
11060 in macro body to avoid any unintended subsequent substitutions.
11061
7198066b
ILT
110622010-01-10 Ian Lance Taylor <iant@google.com>
11063
ba4d53bf
ILT
11064 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
11065 candidates before doing symbol resolution.
11066
7198066b
ILT
11067 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
11068 ODR candidates if only one is weak.
11069
a2beed37
ILT
110702010-01-08 Ian Lance Taylor <iant@google.com>
11071
11072 * script.cc (Version_script_info::build_expression_list_lookup):
11073 Don't warn about ambiguous version, just record the ambiguity.
11074 (Version_script_info::get_symbol_version_helper): Give error if
11075 version is ambiguous.
11076
2fb7225c
DK
110772010-01-08 Doug Kwan <dougkwan@google.com>
11078
11079 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
11080 prev_data_size_ and prev_addralign_. Remove initializer for
11081 deleted data member has_been_changed_.
11082 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
11083 to determine if the table is empty.
11084 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
11085 Remove.
11086 (Stub_table::add_reloc_stub): Define method in class definition
11087 instead of just declaring it there.
11088 (Stub_table::add_cortex_a8_stub): New method definition.
11089 (Stub_table::update_data_size_and_addralign): Ditto.
11090 (Stub_table::finalize_stubs): Ditto.
11091 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
11092 (Stub_table::do_addralign_): Return address alignment in the
11093 (Stub_table::do_reset_address_and_file_offset): Define method in
11094 class definition instead of declaring it there. Set current data
11095 size to be the data size of the previous pass.
11096 (Stub_table::set_final_data_size): Use current data size as the
11097 final data size.
11098 (Stub_table::relocate_stub): Change parameter type of stub from
11099 Reloc_stub pointer to Stub pointer.
11100 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
11101 (Stub_table::Cortex_a8_stub_list): New typedef.
11102 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
11103 Stub_table::prev_addralign_): New data member.
11104 (Arm_relobj::Arm_relobj): Initialize data member
11105 section_has_cortex_a8_workaround_.
11106 (Arm_relobj::section_has_cortex_a8_workaround,
11107 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
11108 definitions.
11109 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
11110 declarations.
11111 (Target_arm::relocate_stub): Change parameter type of stub from
11112 Reloc_stub pointer to Stub pointer.
11113 (Insn_template::size, Insn_template::alignment): Handle
11114 THUMB16_SPECIAL_TYPE.
11115 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
11116 Stub_table::update_data_size_and_addralign,
11117 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
11118 definitions.
11119 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
11120 (Stub_table::do_write): Ditto.
11121 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 11122
880cd20d
ILT
111232010-01-08 Ian Lance Taylor <iant@google.com>
11124
11125 PR 11108
11126 * symtab.h (class Symbol): Remove fields is_target_special_ and
11127 has_plt_offset_. Add field is_defined_in_discarded_section_.
11128 (Symbol::is_defined_in_discarded_section): New function.
11129 (Symbol::set_is_defined_in_discarded_section): New function.
11130 (Symbol::has_plt_offset): Rewrite.
11131 (Symbol::set_plt_offset): Verify that new offset is not -1U.
11132 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
11133 Don't initialize is_target_special_ or has_plt_offset_.
11134 Initialize is_defined_in_discarded_section_.
11135 (Symbol_table::add_from_relobj): If appropriate, set
11136 is_defined_in_discarded_section.
11137 * resolve.cc (Symbol::override_base_with_special): Don't test
11138 is_target_special_. Change has_plt_offset_ to has_plt_offset().
11139 * target-reloc.h (relocate_section): Do special handling for
11140 symbols defined in discarded sections for global symbols as well
11141 as local symbols.
11142
2703e3eb
ILT
111432010-01-08 Ian Lance Taylor <iant@google.com>
11144
11145 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
11146 the SHT_SYMTAB case.
11147
339d40a3
ILT
111482010-01-08 Ian Lance Taylor <iant@google.com>
11149
11150 * object.cc (Sized_relobj::do_layout): Don't get confused if
11151 layout_eh_frame returns NULL.
11152
abecea76
ILT
111532010-01-08 Ian Lance Taylor <iant@google.com>
11154
11155 PR 11084
11156 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
11157 dynamic symbol table, use the normal symbol table.
11158 (Sized_dynobj::do_read_symbols): Remove assertion about type of
11159 symbol table.
11160
6b7dd3f3
ILT
111612010-01-08 Ian Lance Taylor <iant@google.com>
11162
11163 PR 11072
11164 * layout.cc (Layout::include_section): Remove .gnu_debuglink
11165 sections.
11166
36c50e63
L
111672010-01-08 H.J. Lu <hongjiu.lu@intel.com>
11168
11169 * version.cc (print_version): Change to "Copyright 2010".
11170
e291e7b9
ILT
111712010-01-08 Ian Lance Taylor <iant@google.com>
11172
11173 PR 10287
11174 PR 11063
11175 * i386.cc (class Target_i386): Change return type of plt_section
11176 to be non-const.
11177 (class Output_data_plt_i386): Add tls_desc_rel_ field.
11178 (Output_data_plt_i386::Output_data_plt_i386): Initialize
11179 tls_desc_rel_ field.
11180 (Output_data_plt_i386::rel_tls_desc): New function.
11181 (Target_i386::rel_tls_desc_section): New function.
11182 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
11183 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
11184 R_386_TLS_DESC reloc in rel_tls_desc_section.
11185 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
11186 Define struct Tlsdesc_info.
11187 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
11188 (Target_x86_64::do_reloc_symbol_index): New function.
11189 (Target_x86_64::add_tlsdesc_info): New function.
11190 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
11191 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
11192 tlsdesc_rel_ field.
11193 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
11194 all callers.
11195 (Output_data_plt_x86_64::rela_tlsdesc): New function.
11196 (Target_x86_64::rela_tlsdesc_section): New function.
11197 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
11198 handling.
11199 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
11200 (Target_x86_64::do_reloc_addend): New function.
11201 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
11202 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
11203 declarations. Define TARGET_CODE. Add arg field to u1_ union.
11204 (Output_reloc::type): New function.
11205 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
11206 (Output_reloc::is_target_specific): New function.
11207 (Output_reloc::target_arg): New function.
11208 (class Output_reloc) [SHT_RELA]: Add four new constructors for
11209 absolute relocs and target specific relocs.
11210 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
11211 add_target_specific.
11212 (class Output_data_reloc) [SHT_RELA]: Likewise.
11213 * output.cc (Output_reloc::Output_reloc): Add four new versions
11214 for absolute relocs and target specific relocs.
11215 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
11216 (Output_reloc::get_symbol_index): Likewise.
11217 (Output_reloc::local_section_offset): Check that local_sym_index_
11218 is not TARGET_CODE or 0.
11219 (Output_reloc::symbol_value): Likewise.
11220 (Output_reloc::write) [SHT_RELA]: Call target for target specific
11221 reloc.
11222 * target.h (class Target): Add reloc_symbol_index and reloc_addend
11223 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
11224 functions.
11225 * layout.cc (add_target_dynamic_tags): Use output section for
11226 DT_PLTRELSZ and DT_JMPREL.
11227
3a44184e
ILT
112282010-01-07 Ian Lance Taylor <iant@google.com>
11229
11230 PR 11061
11231 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
11232 function.
11233 (class Output_data_reloc_generic): Define.
11234 (class Output_data_reloc_base): Change base class to
11235 Output_data_reloc_generic. Change add() method to call
11236 bump_relative_reloc_count for a relative reloc. Remove
11237 sort_relocs_ field.
11238 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
11239 to sort_relocs().
11240 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
11241 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
11242 appropriate.
11243 * layout.h (class Layout): Update declaration.
11244
ea715a34
ILT
112452010-01-07 Ian Lance Taylor <iant@google.com>
11246
11247 * output.h (class Output_data): Add const version of
11248 output_section and do_output_section.
11249 (class Output_section_data): Add const version of
11250 do_output_section.
11251 (class Output_section): Likewise.
11252 * layout.cc (Layout::add_target_dynamic_tags): New function.
11253 * layout.h (class Layout): Update declarations.
11254 * arm.cc (Target_arm::do_finalize_sections): Use
11255 add_target_dynamic_tags.
11256 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11257 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11258 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11259 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11260
659948a4
ILT
112612010-01-07 Ian Lance Taylor <iant@google.com>
11262
11263 PR 11042
11264 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
11265 object as needed.
11266
9d3b86f6
ILT
112672010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
11268 Ian Lance Taylor <iant@google.com>
11269
11270 PR 11019
11271 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
11272 Xindex::read_symtab_xindex.
11273
bb0d3eb0
DK
112742010-01-07 Doug Kwan <dougkwan@google.com>
11275
11276 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
11277 (Insn_template::thumb16_bcond_insn): New method declaration.
11278 (Insn_template): Fix spelling.
11279 (Stub::thumb16_special): New method declaration.
11280 (Stub::do_write): Define virtual method which was previously pure
11281 virtual.
11282 (Stub::do_thumb16_special): New method declaration.
11283 (Stub::do_fixed_endian_write): New template member.
11284 (Reloc_stub::do_write): Remove.
11285 (Reloc_stub::do_fixed_endian_write): Remove.
11286 (Cortex_a8_stub): New class definition.
11287 (Stub_factory::make_cortex_a8_stub): New method definition.
11288 (Stub_factory::Stub_factory): Add missing static storage class
11289 qualifier for elf32_arm_stub_a8_veneer_blx.
11290
ffeef7df
ILT
112912010-01-07 Ian Lance Taylor <iant@google.com>
11292
dc3f80fe
ILT
11293 PR 10980
11294 * options.h (class General_options): Add --warn-unresolved-symbols
11295 and --error-unresolved-symbols.
11296 * errors.cc (Errors::undefined_symbol): Implement
11297 --warn-unresolved-symbols.
11298
ffeef7df
ILT
11299 * options.h (class General_options): Add -z text and -z textoff.
11300 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
11301
f1ec9ded
ST
113022010-01-06 Sriraman Tallam <tmsriram@google.com>
11303
11304 * gc.h (Garbage_collection::Cident_section_map): New typedef.
11305 (Garbage_collection::cident_sections): New function.
11306 (Garbage_collection::add_cident_section): New function.
11307 (Garbage_collection::cident_sections_): New member.
11308 (gc_process_relocs): Add references to sections whose names are C
11309 identifiers.
11310 * gold.h (cident_section_start_prefix): New constant.
11311 (cident_section_stop_prefix): New constant.
11312 (is_cident): New function.
11313 * layout.cc (Layout::define_section_symbols): Replace string constants
11314 with the newly defined constants.
11315 * object.cc (Sized_relobj::do_layout): Track sections whose names are
11316 C identifiers.
11317 * testsuite/Makefile.am: Add gc_orphan_section_test.
11318 * testsuite/Makefile.in: Regenerate.
11319 * testsuite/gc_orphan_section_test.cc: New file.
11320 * testsuite/gc_orphan_section_test.sh: New file.
11321
6eda8c29
ILT
113222010-01-06 Ian Lance Taylor <iant@google.com>
11323
b9674e17
ILT
11324 PR 10980
11325 * options.h (class General_options): Add --warn-shared-textrel.
11326 * layout.cc (Layout::finish_dynamic_section): Implement
11327 --warn-shared-textrel.
11328
6eda8c29
ILT
11329 PR 10980
11330 * options.h (class General_options): Add --warn-multiple-gp.
11331
32dcd44e
ILT
113322010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11333
11334 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
11335 $(THREADSLIB) and $(LIBDL).
11336 * Makefile.in: Rebuild.
11337
a192ba05
ILT
113382010-01-06 Ian Lance Taylor <iant@google.com>
11339
11340 PR 10980
11341 * options.cc (General_options::parse_section_start): New function.
11342 (General_options::section_start): New function.
11343 (General_options::General_options): Initialize all members.
11344 * options.h: Include <map>
11345 (class General_options): Add --section-start. Add section_starts_
11346 member.
11347 * layout.cc (Layout::attach_allocated_section_to_segment): If
11348 --section-start was used, set the address of the segment. Remove
11349 local sort_sections.
11350 (Layout::relaxation_loop_body): If the address of the load segment
11351 has been set by --section-start, don't use it.
11352 * output.h (Output_segment::update_flags_for_output_section): New
11353 function.
11354 * output.cc (Output_segment::add_output_section): Call
11355 update_flags_for_output_section.
11356
dde3f402
ILT
113572010-01-05 Ian Lance Taylor <iant@google.com>
11358
62dfdd4d
ILT
11359 PR 10980
11360 * options.h (class General_options): Add --undefined-version.
11361 * script.cc (struct Version_expression): Add was_matched_by_symbol
11362 field.
11363 (Version_script_info::matched_symbol): New function.
11364 (Version_script_info::get_symbol_version_helper): Call
11365 matched_symbol.
11366 (Version_script_info::check_unmatched_names): New function.
11367 * script.h (class Version_script_info): Update declarations.
11368 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
11369
9c4ae156
ILT
11370 * options.h (class General_options): Use DEFINE_bool_alias for
11371 allow_multiple_definition.
11372 * resolve.cc (Symbol_table::should_override): Don't test
11373 allow_multiple_definition.
11374
dde3f402
ILT
11375 PR 10980
11376 * options.h (class General_options): Add --cref.
11377 * main.cc (main): Print cref table if --cref. Don't close mapfile
11378 until after printing cref table.
11379 * cref.cc: Include "symtab.h".
11380 (class Cref_inputs): Define Cref_table_compare and Cref_table.
11381 (Cref_table_compare::operator()): New function.
11382 (Cref_inputs::gather_cref): New function.
11383 (filecol): New static const.
11384 (Cref_inputs::print_cref): New function.
11385 (Cref::print_cref): New function.
11386 * cref.h: Include <cstdio>.
11387 (class Cref): Update declarations.
11388 * mapfile.h (Mapfile::file): New function.
11389 * object.h (class Object): Define Symbols. Declare virtual
11390 do_get_global_symbols.
11391 (Object::get_global_symbols): New function.
11392 * object.cc (Input_objects::add_object): Pass object to cref_ if
11393 --cref.
11394 (Input_objects::archive_start): Likewise.
11395 (Input_objects::archive_stop): Likewise.
11396 (Input_objects::print_cref): New function.
11397 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
11398 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
11399 --cref.
11400 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
11401 function.
11402 * plugin.h (class Sized_pluginobj): Update declarations.
11403
8781f709
ILT
114042010-01-05 Ian Lance Taylor <iant@google.com>
11405
11406 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
11407 to is_default_version. Rename insdef to insdefault.
11408 (Symbol_table::add_from_relobj): Rename def to is_default_version
11409 and local to is_forced_local.
11410 (Symbol_table::add_from_pluginobj): Likewise.
11411 (Symbol_table::add_from_dynobj): Likewise.
11412 (Symbol_table::define_special_symbol): Rename insdef to
11413 insdefault.
11414
fe35d28d
ILT
114152010-01-04 Ian Lance Taylor <iant@google.com>
11416
30bc8c46
ILT
11417 PR 10980
11418 * options.h (class General_options): Add
11419 --allow-multiple-definition and -z muldefs.
11420 * resolve.cc (Symbol_table::should_override): Don't warn about a
11421 multiple symbol definition if --allow-multiple-definition or -z
11422 muldefs.
11423
7eaea549
ILT
11424 PR 10980
11425 * options.h (class General_options): Add --add-needed and
11426 --copy-dt-needed-entries. Tweak --as-needed help entry.
11427 * object.cc (Input_objects::check_dynamic_dependencies): Give an
11428 error if --copy-dt-needed-entries aka --add-needed is used and
11429 would cause a change in behaviour.
11430
fe35d28d
ILT
11431 PR 10980
11432 * options.h (class General_options): Add -G as a short version of
11433 --shared. Add no-op options -assert, -g, and -i.
11434
55a2bb35
ST
114352010-01-04 Sriraman Tallam <tmsriram@google.com>
11436
11437 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
11438 check for .text or .gnu.linkonce.t sections.
11439 * icf.cc (Icf::find_identical_sections): Ditto.
11440 Change the detection for mangled function name within the section
11441 name.
11442 * icf.h (is_section_foldable_candidate): New function.
11443
719328e1
ILT
114442009-12-30 Ian Lance Taylor <iant@google.com>
11445
11446 PR 10980
11447 * options.h (class General_options): Permit two dashes with
11448 --retain-symbols-file.
11449
d7bb5745
ILT
114502009-12-30 Ian Lance Taylor <iant@google.com>
11451
403a15dd
ILT
11452 PR 10979
11453 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
11454 don't put the file header and segment headers in the text
11455 segment.
11456
eda294df
ILT
11457 PR 10979
11458 * common.cc (Sort_commons::operator()): Stabilize sort when both
11459 entries are NULL.
11460 (Symbol_table::do_allocate_commons_list): When allocating common
11461 symbols, skip a symbol which is no longer common.
11462 * symtab.h (Symbol::is_common): Test whether the symbol comes from
11463 an object before checking its type.
11464 * testsuite/common_test_2.c: New file.
11465 * testsuite/common_test_3.c: New file.
11466 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
11467 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
11468 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
11469 (common_test_2_pic.o, common_test_2.so): New targets.
11470 (common_test_3_pic.o, common_test_3.so): New targets.
11471 * testsuite/Makefile.in: Rebuild.
11472
d7bb5745
ILT
11473 PR 10979
11474 * script.cc (read_input_script): If we see a new SECTIONS clause,
11475 and we have added an input section, give an error.
11476 * layout.h (class Layout): Add have_added_input_section function.
11477 Add have_added_input_section_ field.
11478 * layout.cc (Layout::Layout): Initialize
11479 have_added_input_section_.
11480 (Layout::layout): Set have_added_input_section_.
11481 (Layout::layout_eh_frame): Likewise.
11482
fc59c572
ILT
114832009-12-30 Ian Lance Taylor <iant@google.com>
11484
11485 PR 10931
11486 * options.h (class General_options): Add --sort-common option.
11487 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
11488 * common.cc (Sort_common): Add sort_order parameter to
11489 constructor. Add sort_order_ field.
11490 (Sort_commons::operator): Check sort_order_.
11491 (Symbol_table::allocate_commons): Determine the sort order.
11492 (Symbol_table::do_allocate_commons): Add sort_order parameter.
11493 Change all callers.
11494 (Symbol_table::do_allocate_commons_list): Likewise.
11495
1c74fab0
ILT
114962009-12-30 Ian Lance Taylor <iant@google.com>
11497
11498 PR 10916
11499 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
11500 symbols from this object, don't change the visibility of an
11501 undefined symbol.
11502 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
11503
6affe781
ILT
115042009-12-30 Ian Lance Taylor <iant@google.com>
11505
11506 PR 10861
11507 * script.h (class Version_script_info): Define Language enum.
11508 Update declarations. Define Glob, Exact, and Lookup types. Add
11509 new fields globals_, locals_, and is_finalized_.
11510 * script.cc: Various formatting fixes.
11511 (class Parser_closure): Change language_stack_ from a vector of
11512 std::string to one of Version_script_info::Language. Adjust all
11513 uses accordingly.
11514 (class Lazy_demangler): Remove.
11515 (struct Version_expression): Change language from std::string to
11516 Version_script_info::Language.
11517 (Version_script_info::Version_script_info): New function.
11518 (Version_script_info::~Version_script_info): Don't call clear.
11519 (Version_script_info::finalize): New function.
11520 (Version_script_info::build_lookup_tables): New function.
11521 (Version_script_info::build_expression_list_lookup): New
11522 function.
11523 (Version_script_info::get_symbol_version_helper): Rewrite to use
11524 lookup tables.
11525 (Version_script_info::print_expression_list): Adjust to use
11526 Version_script_info::Language.
11527 (script_push_lex_into_version_mode): Check that the version script
11528 has not been finalized.
11529 (version_script_push_lang): Change language string to
11530 Version_script_info::Language.
11531 * options.cc (Command_line::version_script): New function.
11532 * options.h (class General_options): Add finalize_dynamic_list
11533 function. Change version_script from declaration to definition.
11534 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
11535 * testsuite/version_script.map: Remove duplicate def of foo.
11536 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
11537 version_script.map.
11538 * testsuite/Makefile.in: Rebuild.
11539
818bf354
ILT
115402009-12-30 Ian Lance Taylor <iant@google.com>
11541
11542 PR 10843
11543 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
11544 if the input symbol index is 0, make the output symbol index 0.
11545
ebcc8304
ILT
115462009-12-30 Ian Lance Taylor <iant@google.com>
11547
11548 PR 10670
11549 * options.h (class General_options): Add -x/--discard-all.
11550 * object.cc (Sized_relobj::do_count_local_symbols): Handle
11551 --discard-all. If the local symbol needs a dynamic entry, check
11552 that before handling --discard-locals.
11553
176fe33f
ILT
115542009-12-30 Ian Lance Taylor <iant@google.com>
11555
bb321bb1
ILT
11556 PR 10450
11557 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
11558 flags to PF_R.
11559 (Output_segment::add_output_section): Don't change the flags if
11560 the type is PT_TLS.
11561
176fe33f
ILT
11562 PR 10450
11563 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
11564 GNU hash table if they need a dynamic value. Otherwise, don't add
11565 them if they are defined in a dynamic object or are forced local.
11566
e8cd95c7
ILT
115672009-12-29 Ian Lance Taylor <iant@google.com>
11568
1b81fb71
ILT
11569 PR 10450
11570 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
11571 .gnu.hash table for a 32-bit target.
11572
8d6d383d
ILT
11573 PR 10450
11574 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
11575 regular and a dynamic object only needs a dynamic symbol table
11576 entry if it is externally visible.
11577
e785ec03
ILT
11578 PR 10450
11579 * i386.cc (class Target_i386): Initialize global_offset_table_ in
11580 constructor. Add global_offset_table_ field.
11581 (Target_i386::got_section): Set global_offset_table_.
11582 (Target_i386::do_finalize_sections): Set global_offset_table_
11583 size.
11584 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
11585 in constructor. Add global_offset_table_ field.
11586 (Target_x86_64::got_section): Set global_offset_table_.
11587 (Target_x86_64::do_finalize_sections): Set global_offset_table_
11588 size.
11589
1a2dff53
ILT
11590 * layout.cc (Layout::Layout): Initialize increase_relro_.
11591 (Layout::get_output_section): Add is_relro, is_last_relro, and
11592 is_first_non_relro parameters. Change all callers.
11593 (Layout::choose_output_section): Likewise.
11594 (Layout::add_output_section_data): Likewise.
11595 (Layout::make_output_section): Likewise.
11596 (Layout::set_segment_offsets): Clear increase_relro when using a
11597 linker script.
11598 * layout.h (class Layout): Add increase_relro method. Add
11599 increase_relro_ field. Update declarations.
11600 * output.cc (Output_section::Output_section): Initialize
11601 is_last_relro_ and is_first_non_relro_.
11602 (Output_segment::add_output_section): Group relro sections is
11603 do_sort is true. Handle is_last_relro and is_first_non_relro.
11604 (Output_segment::maximum_alignment): Remove relro handling.
11605 (Output_segment::set_section_addresses): Add increase_relro
11606 parameter. Change all callers. Add initial alignment to align
11607 relro sections on separate page. Remove old relro handling.
11608 (Output_segment::set_section_list_addresses): Remove in_relro
11609 parameter. Change all callers.
11610 (Output_segment::set_offset): Add increase parameter. Change all
11611 callers. Remove old relro handling.
11612 * output.h (class Output_section): Add new methods: is_last_relro,
11613 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
11614 Add is_last_relro_ and is_first_non_relro_ fields.
11615 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
11616 Create separate .got.plt section. Call increase_relro.
11617 * x86_64.cc (Target_x86_64::got_section): Likewise.
11618 * testsuite/relro_script_test.t: Add .got.plt.
11619
f0ba79e2
ILT
11620 PR 10450
11621 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
11622 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
11623 (Layout::finalize): Call set_dynamic_symbol_size.
11624 (Layout::set_dynamic_symbol_size): New function.
11625 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
11626 set_dynamic_symbol_size.
11627
e8cd95c7
ILT
11628 PR 10450
11629 * output.h (class Output_section): Add is_entsize_zero_ field.
11630 * output.cc (Output_section::Output_section): Initialize
11631 is_entsize_zero_.
11632 (Output_section::set_entsize): If two different entsizes are
11633 requested, force it to zero.
11634 (Output_section::add_input_section): Set flags for .debug_str
11635 before updating section flags. Set entsize.
11636 (Output_section::update_flags_for_input_section): Set SHF_MERGE
11637 and SHF_STRING if all input sections have those flags.
11638
3e1b9a8a
RÁE
116392009-12-29 Rafael Espindola <espindola@google.com>
11640
11641 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
11642 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
11643 reporting.
3e1b9a8a 11644
3dcad376
ST
116452009-12-29 Sriraman Tallam <tmsriram@google.com>
11646
11647 * options.cc (General_options::parse_version): Allow -v to exit
11648 without an error if there is nothing to link.
11649
084e2665
ILT
116502009-12-29 Ian Lance Taylor <iant@google.com>
11651
11652 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
11653 using a version of gcc before 4.1.
11654 * configure: Rebuild.
11655
250acde3
CD
116562009-12-28 Chris Demetriou <cgd@google.com>
11657
11658 * attributes.cc (Output_attributes_section_data::do_write): Use
11659 std::vector::front rather than std::vector::data.
11660
99fff23b
ILT
116612009-12-28 Ian Lance Taylor <iant@google.com>
11662
11663 * symtab.h (class Symbol_table): Add enum Defined.
11664 * resolve.cc (Symbol_table::should_override): Add defined
11665 parameter. Change all callers. Test whether object is NULL
11666 before calling a method on it.
11667 (Symbol_table::report_resolve_problem): Add defined parameter.
11668 Change all callers.
11669 (Symbol_table::should_override_with_special): Likewise.
11670 * symtab.cc (Symbol_table::define_in_output_data): Add defined
11671 parameter. Change all callers.
11672 (Symbol_table::do_define_in_output_data): Likewise.
11673 (Symbol_table::define_in_output_segment): Likewise.
11674 (Symbol_table::do_define_in_output_segment): Likewise.
11675 (Symbol_table::define_as_constant): Likewise.
11676 (Symbol_table::do_define_as_constant): Likewise.
11677 * script.h (class Symbol_assignment): Add is_defsym parameter to
11678 constructor; change all callers.
11679 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
11680 parameter. Change all callers. Add is_defsym_ field.
11681 (class Parser_closure): Add parsing_defsym parameter to
11682 constructor; change all callers. Add parsing_defsym accessor
11683 function. Add parsing_defsym_ field.
11684
556bd683
ILT
116852009-12-28 Ian Lance Taylor <iant@google.com>
11686
11687 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 11688 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 11689
1782c879
ILT
116902009-12-23 Ian Lance Taylor <iant@google.com>
11691
11692 * i386.cc (Target_i386::do_calls_non_split): Recognize
11693 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
11694 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
11695 -fsplit-stack prologue when using %r11.
1782c879 11696
329ca2b1
ST
116972009-12-21 Sriraman Tallam <tmsriram@google.com>
11698
11699 * options.cc (General_options::parse_version): Make -v continue and do
11700 the link like GNU ld does.
11701
d675ff46
RÁE
117022009-12-17 Rafael Avila de Espindola <espindola@google.com>
11703
11704 * Makefile.am (CCFILES): Add timer.cc.
11705 (HFILES): Add timer.h.
11706 * configure.ac: Check for sysconf and times.
11707 * main.cc: include timer.h.
11708 (main): Use Timer instead of get_run_time.
11709 * timer.cc: New.
11710 * timer.h: New.
11711 * workqueue.cc: include timer.h.
11712 (Workqueue::find_and_run_task):
11713 Report user, sys and wall time.
11714 * Makefile.in: Regenerate.
11715 * config.in: Regenerate.
11716 * configure: Regenerate.
11717
d6344fb5
DK
117182009-12-16 Doug Kwan <dougkwan@google.com>
11719
11720 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
11721 sections.
11722 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
11723 relaxed input sections.
11724 * output.cc (Output_section::find_relaxed_input_section): Change
11725 return type to Output_relaxed_input_section pointer. Adjust code
11726 for new type of relaxed_input_section_map_.
11727 * output.h (Output_section::find_relaxed_input_section): Change
11728 return type to Output_relaxed_input_section pointer.
11729 (Output_section::Output_relaxed_input_section_by_input_section_map):
11730 New type.
11731 (Output_section::relaxed_input_section_map_): Change type to
11732 Output_section::Output_relaxed_input_section_by_input_section_map.
11733 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
11734 input section.
11735
0e0d5469
ILT
117362009-12-15 Ian Lance Taylor <iant@google.com>
11737
11738 * layout.cc (Layout::create_shstrtab): Only write out after input
11739 sections if we are compressing debug sections.
11740
0649a889
ILT
117412009-12-15 Ian Lance Taylor <iant@google.com>
11742
11743 * archive.cc (Archive::add_symbols): Only look up a symbol without
11744 a version if there is, in fact, a version.
11745
2ea97941
ILT
117462009-12-14 Ian Lance Taylor <iant@google.com>
11747
11748 Revert -Wshadow changes, all changes from:
11749 2009-12-11 Doug Kwan <dougkwan@google.com>
11750 2009-12-11 Nick Clifton <nickc@redhat.com>
11751 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
11752
b0eec2cc
DK
117532009-12-11 Doug Kwan <dougkwan@google.com>
11754
11755 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
11756 due to -Wshadow.
11757 * attributes.cc (Object_attribute::size): Ditto.
11758 (Attributes_section_data::size): Ditto.
11759 (Attributes_section_data::Attributes_section_data): Ditto.
11760 (Output_attributes_section_data::do_write): Ditto.
11761 * attributes.h (Object_attribute::set_type): Ditto.
11762 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
11763
91d6fa6a
NC
117642009-12-11 Nick Clifton <nickc@redhat.com>
11765
11766 * archive.cc: Fix shadowed variable warnings.
11767 * arm.cc: Likewise.
11768 * compressed_output.cc: Likewise.
11769 * compressed_output.h: Likewise.
11770 * configure: Likewise.
11771 * dwarf_reader.cc: Likewise.
11772 * dynobj.cc: Likewise.
11773 * dynobj.h: Likewise.
11774 * ehframe.cc: Likewise.
11775 * ehframe.h: Likewise.
11776 * errors.cc: Likewise.
11777 * expression.cc: Likewise.
11778 * fileread.cc: Likewise.
11779 * fileread.h: Likewise.
11780 * freebsd.h: Likewise.
11781 * i386.cc: Likewise.
11782 * icf.cc: Likewise.
11783 * incremental.h: Likewise.
11784 * layout.cc: Likewise.
11785 * layout.h: Likewise.
11786 * mapfile.cc: Likewise.
11787 * merge.cc: Likewise.
11788 * merge.h: Likewise.
11789 * object.cc: Likewise.
11790 * object.h: Likewise.
11791 * options.h: Likewise.
11792 * output.cc: Likewise.
11793 * output.h: Likewise.
11794 * parameters.cc: Likewise.
11795 * plugin.cc: Likewise.
11796 * powerpc.cc: Likewise.
11797 * reduced_debug_output.cc: Likewise.
11798 * reduced_debug_output.h: Likewise.
11799 * reloc.cc: Likewise.
11800 * reloc.h: Likewise.
11801 * resolve.cc: Likewise.
11802 * script-sections.cc: Likewise.
11803 * script.cc: Likewise.
11804 * script.h: Likewise.
11805 * sparc.cc: Likewise.
11806 * symtab.cc: Likewise.
11807 * symtab.h: Likewise.
11808 * target-select.cc: Likewise.
11809 * target-select.h: Likewise.
11810 * token.h: Likewise.
11811 * workqueue.cc: Likewise.
11812 * workqueue.h: Likewise.
11813 * x86_64.cc: Likewise.
11814
a0351a69
DK
118152009-12-10 Doug Kwan <dougkwan@google.com>
11816
11817 * arm.cc (attributes.h): New include.
11818 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
11819 (Arm_relobj::~Arm_relobj): Delete object pointed by
11820 attributes_section_data_.
11821 (Arm_relobj::attributes_section_data): New method definition.
11822 (Arm_relobj::attributes_section_data_): New data member declaration.
11823 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
11824 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
11825 attributes_section_data_.
11826 (Arm_dynobj::attributes_section_data): New method definition.
11827 (Arm_dynobj::attributes_section_data_): New data member declaration.
11828 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
11829 initialization value of may_use_blx_ to false.
2e702c99 11830 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
11831 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
11832 object attributes to compute results instead of hard-coding.
11833 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
11834 Target_arm::get_secondary_compatible_arch,
11835 Target_arm::set_secondary_compatible_arch
11836 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11837 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
11838 New method declarations.
11839 (Target_arm::get_aeabi_object_attribute): New method definition.
11840 (Target_arm::attributes_section_data_): New data member declaration.
11841 (read_arm_attributes_section): New template definition.
11842 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
11843 (Arm_dynobj::do_read_symbols): Ditto.
11844 (Target_arm::do_finalize_sections): Merge attributes sections from
11845 input. Check for BLX use after attributes section merging.
11846 Fix __exidx_start and __exidx_end visibility. Create an
11847 .ARM.attributes section if necessary.
11848 (Target_arm::get_secondary_compatible_arch,
11849 Target_arm::set_secondary_compatible_arch,
11850 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11851 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 11852 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
11853 New method definitions.
11854
b59befec
ILT
118552009-12-09 Ian Lance Taylor <iant@google.com>
11856
11857 * plugin.cc (Plugin::load): Don't cast from void* to a function
11858 pointer.
11859
1276bc89
ILT
118602009-12-09 Ian Lance Taylor <iant@google.com>
11861
11862 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
11863 information fields.
11864
2f2de248
L
118652009-12-09 H.J. Lu <hongjiu.lu@intel.com>
11866
11867 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
11868 Replace two_file_shared_1.so with two_file_shared_2.so.
11869 * testsuite/Makefile.in: Regenerated.
11870
4f787271
DK
118712009-12-08 Doug Kwan <dougkwan@google.com>
11872
11873 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
11874 (HFILES): Add attributes.h and int_encoding.h.
11875 * Makefile.in: Regenerate.
11876 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
11877 function definitions to int_encoding.cc
11878 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
11879 prototypes to int_encoding.h
11880 * reduced_debug_output.cc (int_encoding.h): New include.
11881 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
11882 function definitions to int_encoding.cc
11883 (insert_into_vector, read_from_pointer): Move template definitions to
11884 int_encoding.h
11885 * attributes.cc: New file.
11886 * attributes.h: New file.
11887 * int_encoding.cc: New file.
11888 * int_encoding.h: New file.
11889
20b52f1a
RÁE
118902009-12-07 Rafael Avila de Espindola <espindola@google.com>
11891
11892 PR gold/11055
11893 * incremental-dump.cc (dump_incremental_inputs): New.
11894 (main): Use dump_incremental_inputs.
11895
53d7974c
L
118962009-12-07 H.J. Lu <hongjiu.lu@intel.com>
11897
11898 PR gold/10893
11899 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
11900 checking elfcpp::STT_FUNC.
11901 (Target_i386::Relocate::relocate): Likewise.
11902 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
11903
11904 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
11905 symbols from shared libraries into normal FUNC symbols.
11906
11907 * symtab.h (Symbol): Add is_func and use it.
11908
05a352e6
DK
119092009-12-05 Doug Kwan <dougkwan@google.com>
11910
11911 * arm.cc (Target_arm::arm_info): Initialize new fields
11912 attributes_section and attributes_vendor.
11913 * i386.cc (Target_i386::i386_info): Same.
11914 * object.cc (Sized_relobj::do_layout): Skip attribute section.
11915 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
11916 fields attributes_section and attributes_vendor.
53d7974c 11917 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
11918 * target.h (Target::attributes_section, Target::attributes_vendor,
11919 Target::is_attributes_section, Target::attribute_arg_type,
11920 Target::attributes_order): New method definitions.
11921 (Target::Target_info::attributes_section,
11922 Target::Target_info::attributes_vendor): New fields.
11923 (Target::do_attribute_arg_type, Target::do_attributes_order): New
11924 virtual method definitions.
11925 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
11926 attributes_section and attributes_vendor.
11927 * testsuite/testfile.cc (Target_test::test_target_info): Same.
11928
f4e5969c
DK
119292009-12-05 Doug Kwan <dougkwan@google.com>
11930
11931 * arm.cc: Update comments about interworking and stub generation.
11932 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
11933 considered as non-PIC.
11934 (Arm_relocate_functions::base_abs): Fix formatting.
11935 (Arm_relocate_functions::got_prel): Fix comment. Change interface
11936 of function to use GOT entry address instead of offset.
11937 (Target_arm::Scan::global): Issue an error if a symbol would need a
11938 PLT does not get one because it is untyped. Remove code to create
11939 dynamic symbols for relative branches.
11940 (Target_arm::Relocate::relocate: Use 0 instead of false since function
11941 takes unsigned integer instead of boolean.
11942
1abce4a6
L
119432009-12-05 H.J. Lu <hongjiu.lu@intel.com>
11944
11945 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
11946 (two_file_test_LDADD): Likewise.
11947 (common_test_1_LDADD): Likewise.
11948 (exception_test_LDADD) Likewise.
11949 (weak_test_LDADD): Likewise.
11950 (many_sections_test_LDADD): Likewise.
11951 (initpri1_LDADD): Likewise.
11952 (script_test_1_LDADD): Likewise.
11953 (script_test_2_LDADD): Likewise.
11954 (justsyms_LDADD): Likewise.
11955 (binary_test_LDADD): Likewise.
11956 (large_LDADD): Likewise.
11957 * testsuite/Makefile.in: Regenerated.
11958
adcf2816 119592009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 11960
adcf2816
L
11961 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
11962 (Symbol_table::override_with_special): Likewise.
11963 (Symbol_table::add_from_object): Likewise.
11964
28e67f5d
RÁE
119652009-12-04 Rafael Avila de Espindola <espindola@google.com>
11966
11967 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11968 Don't set the data_offset twice.
11969
ae10a101
RÁE
119702009-12-04 Rafael Avila de Espindola <espindola@google.com>
11971
11972 * testsuite/Makefile.in: Regenerate.
11973
f59f41f3
DK
119742009-12-03 Doug Kwan <dougkwan@google.com>
11975
11976 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
11977 (Target_arm::do_finalize_sections): Add parameter for symbol table
11978 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
11979 * i386.cc (Target_i386::do_finalize_sections): Add an additional
11980 parameter for symbol table pointer.
11981 * layout.cc (Layout::finalize): Call Target::finalize_sections with
11982 an additional parameter for a pointer to symbol table.
11983 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
11984 parameter for a symbol table pointer.
11985 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
11986 * target.h (Target::finalize_sections, Target::do_finalize_sections):
11987 Ditto.
11988 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
11989 parameter for a symbol table pointer.
11990
ca55d848
RÁE
119912009-12-03 Rafael Avila de Espindola <espindola@google.com>
11992
11993 * incremental.cc (Incremental_inputs_header)
11994 (Incremental_inputs_header_write, Incremental_inputs_entry)
11995 (Incremental_inputs_entry_write): Move ...
11996 * incremental.h (Incremental_inputs_header)
11997 (Incremental_inputs_header_write, Incremental_inputs_entry)
11998 (Incremental_inputs_entry_write): here.
11999
3aec4f9c
RÁE
120002009-12-02 Rafael Avila de Espindola <espindola@google.com>
12001
12002 * incremental.cc (make_sized_incremental_binary): Set the target.
12003 Error if it is incompatible.
12004 * output.h (Output_file): Add filename method.
12005
9c0ae74d
RÁE
120062009-12-02 Rafael Avila de Espindola <espindola@google.com>
12007
12008 * incremental.cc (Incremental_inputs_entry): Remove unused argument
12009 from the get_* methods.
12010
a45500ae
RÁE
120112009-12-02 Rafael Avila de Espindola <espindola@google.com>
12012
12013 * incremental-dump.cc (main): Check that the offeset of a script is 0.
12014 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12015 Write 0 for the data_offset of scripts.
12016
325e6408
RÁE
120172009-12-02 Rafael Avila de Espindola <espindola@google.com>
12018
12019 * testsuite/Makefile.am: Add the incremental_test.sh test.
12020 * testsuite/incremental_test.sh: New.
12021 * testsuite/incremental_test_1.c: New.
12022 * testsuite/incremental_test_2.c: New.
12023
954c3e2e
RÁE
120242009-12-01 Rafael Avila de Espindola <espindola@google.com>
12025
703d02da 12026 * incremental-dump.cc (main): Fix typos.
954c3e2e 12027
f8086623
RÁE
120282009-11-27 Rafael Avila de Espindola <espindola@google.com>
12029
12030 PR gold/11025
12031 * incremental-dump.cc (main): Use llu to print 64 bit values.
12032
3b0dd6ac
L
120332009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
12034 H.J. Lu <hongjiu.lu@intel.com>
12035
12036 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
12037 $(LIBDL).
12038 (incremental_dump_LDADD): Likewise.
12039 * Makefile.in: Regenerated.
12040
a6d1ef57 120412009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 12042
a6d1ef57
DK
12043 Revert:
12044
12045 2009-11-25 Doug Kwan <dougkwan@google.com>
12046
12047 * arm.cc (Target_arm::Target_arm): Move method definition
12048 outside of class definition. Add code to handle
12049 --target1-rel, --target1-abs and --target2= options.
12050 (Target_arm::get_reloc_reloc_type): Change method to be
12051 non-static and const.
12052 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
12053 New data member declaration.
12054 (Target_arm::Scan::local, Target_arm::Scan::global,
12055 Target_arm::Relocate::relocate,
12056 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12057 Adjust call to Target_arm::get_real_reloc_type.
12058 (Target_arm::get_real_reloc_type): Use command line options
12059 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12060 * options.h (--target1-rel, --target1-abs, --target2): New
12061 ARM-only options.
12062
50aeb7d4
DK
120632009-11-25 Doug Kwan <dougkwan@google.com>
12064
12065 * arm.cc (Target_arm::Target_arm): Move method definition outside of
12066 class definition. Add code to handle --target1-rel, --target1-abs
12067 and --target2= options.
12068 (Target_arm::get_reloc_reloc_type): Change method to be non-static
12069 and const.
12070 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
12071 member declaration.
12072 (Target_arm::Scan::local, Target_arm::Scan::global,
12073 Target_arm::Relocate::relocate,
12074 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
12075 call to Target_arm::get_real_reloc_type.
12076 (Target_arm::get_real_reloc_type): Use command line options to
12077 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12078 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
12079 options.
12080
51938283
DK
120812009-11-25 Doug Kwan <dougkwan@google.com>
12082
12083 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
12084 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
12085 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
12086 formatting.
12087 (Arm_relocate_functions::thm_call): Replace body with a call to
12088 Arm_relocate_functions::thumb_branch_common.
12089 (Arm_relocate_functions::thm_jump24,
12090 Arm_relocate_functions::thm_xpc22): New method definitions.
12091 (Arm_relocate_functions::thumb_branch_common): New method definition.
12092 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
12093 operator.
12094 (Target_arm::Relocate::relocate): Adjust call to thm_call.
12095 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
12096
e2b8f3c4
RÁE
120972009-11-24 Rafael Avila de Espindola <espindola@google.com>
12098
12099 * Makefile.am: Build incremental-dump
12100 * Makefile.in: Regenerate.
12101 * incremental-dump.cc: New.
12102 * incremental.cc (Incremental_inputs_header_data,
12103 Incremental_inputs_entry_data): Move to incremental.h
12104 * incremental.h: (Incremental_inputs_header_data,
12105 Incremental_inputs_entry_data): Move from incremental.cc
12106
bcba9aec
RÁE
121072009-11-24 Rafael Avila de Espindola <espindola@google.com>
12108
12109 * incremental.cc (Incremental_inputs_header,
12110 Incremental_inputs_header_write, Incremental_inputs_entry,
12111 Incremental_inputs_entry_write): Add a typedef with the data type.
12112
7c3afe08
RÁE
121132009-11-24 Rafael Avila de Espindola <espindola@google.com>
12114
12115 * incremental.cc (Incremental_inputs_header,
12116 Incremental_inputs_header_write, Incremental_inputs_entry,
12117 Incremental_inputs_entry_write): Update comment about which
12118 type has the filed descriptions.
12119
d204b6e9
DK
121202009-11-15 Doug Kwan <dougkwan@google.com>
12121
12122 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
12123 (Arm_relocate_functions::arm_branch_common): Change method defintion
12124 in class definition to a method declaration and update list of formal
12125 parameters.
12126 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
12127 Arm_relocation_functions::jump24): Adjust call to
12128 Arm_relocate_functions::arm_branch_common. Update list of formal
12129 parameters.
12130 (Arm_relocate_functions::xpc25): New method definition.
12131 (Arm_relocate_functions::arm_branch_common): Move method defintion
12132 out from class definition. Use stubs for mode-switching and extending
12133 branch ranges.
12134 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
12135 specially. Change code to enable use of stubs in ARM branches.
12136
43d12afe
DK
121372009-11-10 Doug Kwan <dougkwan@google.com>
12138
12139 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
12140 in method declaration.
12141 (Target_arm::relocate_stub): New method declaration.
12142 (Target_arm::default_target): Change to return a pointer instead of
12143 a const reference.
12144 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
12145 Target_arm::default_target.
12146 (Arm_Relobj::do_relocate_sections): Remove options paramater in
12147 method definition.
12148 (Target_arm::relocate_section): Adjust view.
12149 (Target_arm::relocate_stub): New method definition.
12150
ac33a407
DK
121512009-11-10 Doug Kwan <dougkwan@google.com>
12152
12153 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
12154 a format warning.
12155 * incremental.cc (open_incremental_binary): Initialized local
12156 variables to avoid warnings.
12157 * object.cc (make_elf_object): Ditto.
12158 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
12159 a format warning.
e1df38aa 12160
88ee28e9
L
12161009-11-09 H.J. Lu <hongjiu.lu@intel.com>
12162
12163 PR gold/10930
12164 * testsuite/plugin_test.c: Include "config.h".
12165
2daedcd6
DK
121662009-11-09 Doug Kwan <dougkwan@google.com>
12167
12168 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
12169 (arm_symbol_value): Remove.
12170 (Arm_relocate_functions::arm_branch_common,
12171 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
12172 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
12173 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
12174 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
12175 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
12176 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
12177 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
12178 Arm_relocate_functions::thm_mobw_abs_nc,
12179 Arm_relocate_functions::thm_mov_abs,
12180 Arm_relocate_functions::movw_prel_nc,
12181 Arm_relocate_functions::thm_movt_abs,
12182 Arm_relocate_functions::movt_prel,
12183 Arm_relocate_functions::thm_movw_prel_nc,
12184 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
12185 (Target_arm::Relocate::relocate): Only decompose address into two
12186 parts if relocation type uses the thumb-bit and pass the actual
12187 bit instead of a flag indicating that the thumb-bit is used. Adjust
12188 calls to methods in Arm_relocate_functions for this change.
12189
1276bc89 121902009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
12191
12192 PR 10925
12193 * reloc.cc: Instantiate
12194 Sized_relobj::initialize_input_to_output_maps and
12195 Sized_relobj:free_input_to_output_maps.
12196
e53ad1b5
ILT
121972009-11-06 Ian Lance Taylor <iant@google.com>
12198
12199 PR 10876
12200 * defstd.cc (in_segment): Set only_if_ref true for "end".
12201
eb44217c
DK
122022009-11-06 Doug Kwan <dougkwan@google.com>
12203
12204 * arm.cc (class Reloc_stub): Correct a comment.
12205 (Target_arm::Target_arm): Initialize arm_input_section_map_.
12206 (Target_arm::scan_section_for_stubs): New method declaration.
12207 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
12208 Change methods from private to protected.
12209 (Target_arm::do_may_relax): New method definition.
12210 (Target_arm::do_relax, Target_arm::group_sections,
12211 Target_arm::scan_reloc_for_stub,
12212 Target_arm::scan_reloc_section_for_stubs): New method declarations.
12213 (Target_arm::arm_input_section_map_): New data member declaration.
12214 (Target_arm::scan_reloc_for_stub,
12215 Target_arm::scan_reloc_section_for_stubs,
12216 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
12217 Target_arm::do_relax): New method definitions.
12218
5d329b7d
ILT
122192009-11-06 Mikolaj Zalewski <mikolaj@google.com>
12220
12221 * configure.ac: Check for (struct stat)::st_mtim
12222 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
12223 * config.in: Regenerate.
12224 * configure: Regenerate.
12225
96a0d71b
ILT
122262009-11-05 Ian Lance Taylor <iant@google.com>
12227
12228 PR 10910
12229 * output.cc (Output_segment::add_output_section): Add missing
12230 return statement.
12231
594c8e5e
ILT
122322009-11-04 Ian Lance Taylor <iant@google.com>
12233
12234 PR 10880
12235 * object.h (class Object): Add is_needed and set_is_needed
12236 methods. Add is_needed_ field. Make bool fields into bitfields.
12237 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
12238 defined in a dynamic object and referenced by a regular object,
12239 set is_needed for the dynamic object.
12240 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
12241 if the file is marked with as_needed and it is not needed.
12242
22b127cc
ILT
122432009-11-04 Ian Lance Taylor <iant@google.com>
12244
12245 PR 10887
12246 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
12247 tags if data is discarded by linker script.
12248 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12249 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12250 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12251 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12252
f5c870d2
ILT
122532009-11-04 Ian Lance Taylor <iant@google.com>
12254
12255 * layout.cc (Layout::get_output_section): Add is_interp and
12256 is_dynamic_linker_section parameters. Change all callers.
12257 (Layout::choose_output_section): Likewise.
12258 (Layout::make_output_section): Likewise.
12259 (Layout::add_output_section_data): Add is_dynamic_linker_section
12260 parameter. Change all callers.
12261 * layout.h (class Layout): Update declarations.
12262 * output.h (class Output_section): Add is_interp, set_is_interp,
12263 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
12264 Add is_interp_, is_dynamic_linker_section_ fields. Change
12265 generate_code_fills_at_write_ to a bitfield.
12266 * output.cc (Output_section::Output_sections): Initialize new
12267 fields.
12268 (Output_segment::add_output_section): Add do_sort parameter.
12269 Change all callers.
12270
1ae4d23b
ILT
122712009-11-03 Ian Lance Taylor <iant@google.com>
12272
12273 PR 10860
12274 * options.h (class General_options): Add --warn-common.
12275 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
12276 merging two common symbols.
12277 (Symbol_table::should_override): Handle --warn-common when merging
12278 a common symbol with a defined symbol. Use report_resolve_problem
12279 for multiple definitions.
12280 (Symbol_table::report_resolve_problem): New function.
12281 * symtab.h (class Symbol_table): Declare report_resolve_problem.
12282
55da9579
DK
122832009-11-03 Doug Kwan <dougkwan@google.com>
12284
12285 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
12286 stub_factory_.
12287 (Target_arm::stub_factory): New method definition.
12288 (Target_arm::new_arm_input_section,
12289 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
12290 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 12291 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
12292 New type definitions.
12293 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
12294 member declarations.
12295 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
12296 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
12297 New method definitions.
12298
37a9ac43
ILT
122992009-11-03 Ian Lance Taylor <iant@google.com>
12300
12301 * options.h (class General_options): Add --warn_constructors.
12302
b3d6a3d4
ILT
123032009-11-03 Ian Lance Taylor <iant@google.com>
12304
12305 PR 10893
12306 * defstd.cc (in_section): Add entries for __rel_iplt_start,
12307 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
12308
934b01dd
ILT
123092009-11-03 Ian Lance Taylor <iant@google.com>
12310
12311 PR 10895
12312 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
12313 --msgid-bugs-address.
12314 (install-pdf): New target.
12315 (install-data_yes): Look up one directory to find mkinstalldirs.
12316
03c1939b
L
123172009-11-03 H.J. Lu <hongjiu.lu@intel.com>
12318
12319 * po/Make-in (.po.gmo): Don't generate .gmo files in source
12320 tree.
12321
ebd95253
DK
123222009-10-30 Doug Kwan <dougkwan@google.com>
12323
12324 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
12325
e9bbb538
DK
123262009-10-30 Doug Kwan <dougkwan@google.com>
12327
12328 * arm.cc (Stub_addend_reader): New struct template definition
12329 and partial specializations.
12330 (Stub_addend_reader::operator()): New method definition for a
12331 partially specialized template.
12332
d5b40221
DK
123332009-10-30 Doug Kwan <dougkwan@google.com>
12334
12335 * arm.cc (Arm_relobj::processor_specific_flags): New method
12336 definition.
12337 (Arm_relobj::do_read_symbols): New method declaration.
12338 (Arm_relobj::processor_specific_flags_): New data member declaration.
12339 (Arm_dynobj): New class definition.
12340 (Target_arm::do_finalize_sections): Add input_objects parameter.
12341 (Target_arm::do_adjust_elf_header): New method declaration.
12342 (Target_arm::are_eabi_versions_compatible,
12343 (Target_arm::merge_processor_specific_flags): New method declaration.
12344 (Target_arm::do_make_elf_object): New overloaded method definitions
12345 and declaration.
12346 (Arm_relobj::do_read_symbols): New method definition.
12347 (Arm_dynobj::do_read_symbols): Ditto.
12348 (Target_arm::do_finalize_sections): Add input_objects parameters.
12349 Merge processor-specific flags from all input objects.
12350 (Target_arm::are_eabi_versions_compatible,
12351 Target_arm::merge_processor_specific_flags,
12352 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
12353 New method definitions.
12354 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
12355 Input_objects pointer type parameter.
12356 * layout.cc (Layout::finalize): Pass input objects to target's.
12357 finalize_sections function.
12358 * output.cc (Output_file_header::do_sized_write): Set ELF file
12359 header's processor-specific flags.
12360 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
12361 Input_objects pointer type parameter.
12362 * sparc.cc (Target_sparc::do_finalize_sections): Same.
12363 * target.h (Input_objects): New forward class declaration.
12364 (Target::processor_specific_flags,
12365 Target::are_processor_specific_flags_sect): New method definitions.
12366 (Target::finalize_sections): Add input_objects parameter.
12367 (Target::Target): Initialize processor_specific_flags_ and
12368 are_processor_specific_flags_set_.
12369 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
12370 parameter.
12371 (Target::set_processor_specific_flags): New method definition.
12372 (Target::processor_specific_flags_,
12373 Target::are_processor_specific_flags_set_): New data member
12374 declarations.
12375 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
12376 Input_objects pointer type parameter.
12377
ebabffbd
DK
123782009-10-30 Doug Kwan <dougkwan@google.com>
12379
12380 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
12381
ad0f2072
ILT
123822009-10-28 Ian Lance Taylor <iant@google.com>
12383
12384 * object.h (class Relobj): Drop options parameter from
12385 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
12386 do_scan_relocs, do_relocate. Change all callers.
12387 (class Sized_relobj): Drop options parameters from
12388 do_gc_process_relocs, do_scan_relocs, do_relocate,
12389 do_relocate_sections, relocate_sections, emit_relocs_scan,
12390 emit_relocs_scan_reltype. Change all callers.
12391 (struct Relocate_info): Remove options field and all references to
12392 it.
12393 * reloc.h (class Read_relocs): Remove options constructor
12394 parameter and options_ field. Change all callers.
12395 (class Gc_process_relocs, class Scan_relocs): Likewise.
12396 (class Relocate_task): Likewise.
12397 * target-reloc.h (scan_relocs): Remove options parameter. Change
12398 all callers.
12399 (scan_relocatable_relocs): Likewise.
12400 * target.h (class Sized_target): Remove options parameter from
12401 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
12402 all callers.
12403 * gc.h (gc_process_relocs): Remove options parameter. Change all
12404 callers.
12405 * arm.cc: Update functions to remove options parameters.
12406 * i386.cc: Likewise.
12407 * powerpc.cc: Likewise.
12408 * sparc.cc: Likewise.
12409 * x86_64.cc: Likewise.
12410 * testsuite/testfile.cc: Likewise.
12411
8ffa3667
DK
124122009-10-28 Doug Kwan <dougkwan@google.com>
12413
12414 * arm.cc (Arm_relobj): New class definition.
e1df38aa 12415 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
12416 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
12417 New method definitions.
12418
40f36857
CC
124192009-10-28 Cary Coutant <ccoutant@google.com>
12420
12421 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
12422 (Plugin::cleanup_done_): New member.
12423 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
12424 (Plugin_manager::cleanup_done_): Remove.
12425 (Plugin_manager::add_input_file): Edit error message.
12426 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
12427 (Plugin_manager::cleanup): Remove use of cleanup_done_.
12428
2c849493
ILT
124292009-10-27 Mikolaj Zalewski <mikolajz@google.com>
12430
12431 * fileread.cc: (File_read::View::~View): Use the new
12432 data_ownership_ filed.
12433 (File_read::~File_read): Dispose the new whole_file_view_.
12434 (File_read::open): Mmap the whole file if needed.
12435 (File_read::open): Use whole_file_view_ instead of contents_.
12436 (File_read::find_view): Use whole_file_view_ if applicable.
12437 (File_read::do_read): Use whole_file_view_ instead of contents_.
12438 (File_read::make_view): Use whole_file_view_ instead of contents_,
12439 update File_read::View::View call.
12440 (File_read::find_or_make_view): Update File_read::View::View
12441 call.
12442 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
12443 remove contents_
12444 (File_read::View::Data_ownership): New enum.
12445 (File_read::View::View): Replace bool mapped_ with Data_ownership
12446 argument.
12447 (File_read::View::mapped_): Remove (replaced by data_ownership_).
12448 (File_read::View::data_ownership_): New field.
12449 (File_read::contents_): Remove (replaced by whole_file_view_).
12450 (File_read::whole_file_view_): New field.
12451 * options.h (class General_options): Add --keep-files-mapped.
12452
24998053
CC
124532009-10-27 Cary Coutant <ccoutant@google.com>
12454
12455 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
12456 * testsuite/Makefile.am (plugin_test_5): New test case.
12457 * testsuite/Makefile.in: Regenerate.
12458
72adc4fa
DK
124592009-10-25 Doug Kwan <dougkwan@google.com>
12460
12461 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
12462 from private to protected to allow access by child class.
12463 (Sized_relobj::do_relocate_sections): New method declaration.
12464 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 12465 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
12466 Sized_relobj::relocate_sections. Instantiate template explicitly
12467 for different target sizes and endianity.
12468
07f508a2
DK
124692009-10-24 Doug Kwan <dougkwan@google.com>
12470
12471 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
12472 (Arm_input_section::as_arm_input_section): New method.
12473 (Arm_output_section): New class definition.
12474 (Arm_output_section::create_stub_group,
12475 Arm_output_section::group_sections): New method definitions.
12476
10ad9fe5
DK
124772009-10-22 Doug Kwan <dougkwan@google.com>
12478
12479 * arm.cc (Arm_input_section): New class definition.
12480 (Arm_input_section::init, Arm_input_section:do_write,
12481 Arm_input_section::set_final_data_size,
12482 Arm_input_section::do_reset_address_and_file_offset): New method
12483 definitions.
12484
56ee5e00
DK
124852009-10-21 Doug Kwan <dougkwan@google.com>
12486
12487 * arm.cc (Stub_table, Arm_input_section): New forward class
12488 declarations.
12489 (Stub_table): New class defintion.
12490 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
12491 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
12492 New method definition.
12493
b569affa
DK
124942009-10-21 Doug Kwan <dougkwan@google.com>
12495
12496 * arm.cc: Update copyright comments.
12497 (Target_arm): New forward class template declaration.
12498 (Arm_address): New type.
12499 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
12500 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
12501 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
12502 constants.
12503 (Insn_template): Same.
12504 (DEF_STUBS): New macro.
12505 (Stub_type): New enum type.
12506 (Stub_template): New class definition.
12507 (Stub): Same.
12508 (Reloc_stub): Same.
12509 (Stub_factory): Same.
12510 (Target_arm::Target_arm): Initialize may_use_blx_ and
12511 should_force_pic_veneer_.
12512 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
12513 Target_arm::should_force_pic_veneer,
12514 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
12515 Target_arm::using_thumb_only, Target_arm:;default_target): New
12516 method defintions.
12517 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
12518 New data member declarations.
12519 (Insn_template::size, Insn_template::alignment): New method defintions.
12520 (Stub_template::Stub_template): New method definition.
12521 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
12522 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
12523 (Stub_factory::Stub_factory): New method definition.
12524 * gold.h (string_hash): New template.
12525 * output.h (Input_section_specifier::hash_value): Use
12526 gold::string_hash.
12527 (Input_section_specifier::string_hash): Remove.
12528 * stringpool.cc (Stringpool_template::string_hash): Use
12529 gold::string_hash.
12530
6c172549
DK
125312009-10-20 Doug Kwan <dougkwan@google.com>
12532
12533 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
12534 symbols of relaxed input sections.
12535 * output.h (Output_section::find_relaxed_input_section): Make
12536 method public.
12537
c5617f2f
DK
125382009-10-16 Doug Kwan <dougkwan@google.com>
12539
12540 * dynobj.cc (Versions::Versions): Initialize version_script_.
12541 Only insert base version symbol definition for a shared object
12542 if version script defines any version versions.
12543 (Versions::define_base_version): New method definition.
12544 (Versions::add_def): Check that base version is not needed.
12545 (Versions::add_need): Define base version lazily.
12546 * dynobj.h (Versions::define_base_version): New method declaration.
12547 (Versions::needs_base_version_): New data member declaration.
12548 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
12549 (check_DATA): Add no_version_test.stdout.
12550 (libno_version_test.so, no_version_test.o no_version_test.stdout):
12551 New make rules.
12552 * testsuite/Makefile.in: Regenerate.
12553 * testsuite/no_version_test.c: New file.
12554 * testsuite/no_version_test.sh: Ditto.
12555
3c12dcdb
DK
125562009-10-16 Doug Kwan <dougkwan@google.com>
12557
12558 * expression.cc (class Segment_start_expression): New class definition.
12559 (Segment_start_expression::value): New method definition.
12560 (script_exp_function_segment_start): Return a new
12561 Segment_start_expression.
12562 * gold/script-c.h (script_saw_segment_start_expression): New function
12563 prototype.
12564 * script-sections.cc (Script_sections::Script_sections): Initialize
12565 SAW_SEGMENT_START_EXPRESSION_ to false.
12566 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
12567 and -Tbbs options to specify section addresses if given in
12568 command line and no SEGMENT_START expression is seen in a script.
12569 * script-sections.h (Script_sections::saw_segment_start_expression,
12570 Script_sections::set_saw_segment_start_expression): New method
12571 definition.
12572 (Script_sections::saw_segment_start_expression_): New data member
12573 declaration.
12574 * script.cc (script_saw_segment_start_expression): New function.
12575 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
12576 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
12577 script_test_7.sh and script_test_8.sh.
12578 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
12579 script_test_8.stdout.
12580 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
12581 (script_test_6, script_test_6.stdout, script_test_7,
12582 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
12583 * Makefile.in: Regenerate.
12584 * testsuite/script_test_6.sh: New file.
12585 * testsuite/script_test_6.t: Same.
12586 * testsuite/script_test_7.sh: Same.
12587 * testsuite/script_test_7.t: Same.
12588 * testsuite/script_test_8.sh: Same.
12589
64b1ae37
DK
125902009-10-16 Doug Kwan <dougkwan@google.com>
12591
12592 * output.cc (Output_segment::set_section_list_address): Cast
12593 expressions to unsigned long long type to avoid format warnings.
12594
661be1e2
ILT
125952009-10-15 Ian Lance Taylor <iant@google.com>
12596
12edd763 12597 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 12598 dot assignment to script_sections_.
12edd763
ILT
12599 * script-sections.cc (Script_sections::add_dot_assignment):
12600 Initialize if necessary.
12601
68b6574b
ILT
12602 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
12603 program headers with no load segment if there is a linker script.
12604
661be1e2
ILT
12605 * layout.cc (Layout::set_segment_offsets): Align the file offset
12606 to the segment aligment for -N or -n with no load segment.
12607 * output.cc (Output_segment::add_output_section): Don't crash if
12608 the first section is a TLS section.
12609 (Output_segment::set_section_list_addresses): Print an error
12610 message if the address moves backward in a linker script.
12611 * script-sections.cc
12612 (Output_section_element_input::set_section_addresses): Don't
12613 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
12614 (Orphan_output_section::set_section_addresses): Likewise.
12615
f15f61a7
DK
126162009-10-15 Doug Kwan <dougkwan@google.com>
12617
12618 * layout.cc (Layout::finish_dynamic_section): Generate tags
12619 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
12620 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
12621 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
12622
82bb573a
ILT
126232009-10-14 Ian Lance Taylor <iant@google.com>
12624
12625 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
12626 fields.
12627 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
12628 data_shdr fields of relinfo.
12629 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
12630 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
12631 R_386_TLS_LDO_32, adjust based on section flags.
12632 (Target_i386::Relocate::fix_up_ldo): Remove.
12633
374ad285
ILT
126342009-10-13 Ian Lance Taylor <iant@google.com>
12635
12636 Add support for -pie.
12637 * options.h (class General_options): Add -pie and
12638 --pic-executable.
12639 (General_options::output_is_position_independent): Test -pie.
12640 (General_options::output_is_executable): Return true if not shared
12641 and not relocatable.
12642 (General_options::output_is_pie): Remove.
12643 * options.cc (General_options::finalize): Reject incompatible uses
12644 of -pie.
12645 * gold.cc (queue_middle_tasks): A -pie link is not static.
12646 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
12647 * symtab.cc (Symbol::final_value_is_known): Return false if
12648 output_is_position_independent.
12649 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
12650 output_is_position_independent.
12651 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
12652 output_is_position_independent.
12653 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
12654 output_is_position_independent.
12655 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
12656 two_file_pie_test.
12657 (basic_pie_test.o, basic_pie_test): New targets.
12658 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
12659 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
12660 (two_file_pie_test): New target.
12661 * testsuite/Makefile.in: Rebuild.
12662 * README: Remove note saying that -pie is not supported.
12663
c6585162
ILT
126642009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
12665
12666 * options.h (class General_options): Add -init and -fini.
12667 * layout.cc (Layout::finish_dynamic_section): Emit
12668 given init and fini functions.
12669
032ce4e9
ST
126702009-10-13 Sriraman Tallam <tmsriram@google.com>
12671
12672 * gc.h (gc_process_relocs): Check if icf is enabled using new
12673 function.
12674 * gold.cc (queue_initial_tasks): Likewise.
12675 (queue_middle_tasks): Likewise.
12676 * object.cc (do_layout): Likewise.
12677 * symtab.cc (is_section_folded): Likewise.
12678 * main.cc (main): Likewise.
12679 * reloc.cc (Read_relocs::run): Likewise.
12680 (Sized_relobj::do_scan_relocs): Likewise.
12681 * icf.cc (is_function_ctor_or_dtor): New function.
12682 (Icf::find_identical_sections): Check if function is ctor or dtor when
12683 safe icf is chosen.
12684 * options.h (General_options::icf): Change option to be an enum.
12685 (Icf_status): New enum.
12686 (icf_enabled): New method.
12687 (icf_safe_folding): New method.
12688 (set_icf_status): New method.
12689 (icf_status_): New variable.
12690 * (options.cc) (General_options::finalize): Set icf_status_.
12691 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
12692 icf_test and icf_keep_unique_test to use the --icf enum flag.
12693 * testsuite/icf_safe_test.sh: New file.
e1df38aa 12694 * testsuite/icf_safe_test.cc: New file.
032ce4e9 12695
f345227a
ST
126962009-10-12 Sriraman Tallam <tmsriram@google.com>
12697
12698 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
12699 includes to gc.h and icf.h.
12700 * arm.cc: Include gc.h.
12701 * gold.cc: Likewise.
12702 * i386.cc: Likewise.
12703 * powerpc.cc: Likewise.
12704 * sparc.cc: Likewise.
12705 * x86_64.cc: Likewise.
12706 * gc.h: Include icf.h.
12707
1c7814ed
ILT
127082009-10-11 Ian Lance Taylor <iant@google.com>
12709
12710 * plugin.cc: Include "gold.h" before other header files.
12711
ae3b5189
CD
127122009-10-10 Chris Demetriou <cgd@google.com>
12713
12714 * options.h (Input_file_argument::Input_file_type): New enum.
12715 (Input_file_argument::is_lib_): Replace with...
12716 (Input_file_argument::type_): New member.
12717 (Input_file_argument::Input_file_argument): Take Input_file_type
12718 'type' rather than boolean 'is_lib' as second argument.
12719 (Input_file_argument::is_lib): Use type_.
12720 (Input_file_argument::is_searched_file): New function.
12721 (Input_file_argument::may_need_search): Handle is_searched_file.
12722 * options.cc (General_options::parse_library): Support -l:filename.
12723 (General_options::parse_just_symbols): Update for Input_file_argument
12724 changes.
12725 (Command_line::process): Likewise.
12726 * archive.cc (Archive::get_file_and_offset): Likewise.
12727 * plugin.cc (Plugin_manager::release_input_file): Likewise.
12728 * script.cc (read_script_file, script_add_file): Likewise.
12729 * fileread.cc (Input_file::Input_file): Likewise.
12730 (Input_file::will_search_for): Handle is_searched_file.
12731 (Input_file::open): Likewise.
12732 * readsyms.cc (Read_symbols::get_name): Likewise.
12733 * testsuite/Makefile.am (searched_file_test): New test.
12734 * testsuite/Makefile.in: Regenerate.
12735 * testsuite/searched_file_test.cc: New file.
12736 * testsuite/searched_file_test_lib.cc: New file.
12737
f3048a1d
ILT
127382009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12739 Ian Lance Taylor <iant@google.com>
12740
12741 * descriptor.cc: Include <cstdio> and "binary-io.h".
12742 (Descriptors::open): Open the files in binary mode always.
12743 * script.cc (Lex::get_token): Treat \r as whitespace.
12744
d4780e57
ILT
127452009-10-09 Ian Lance Taylor <iant@google.com>
12746
12747 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
12748
d9a893b8
ILT
127492009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12750 Ian Lance Taylor <iant@google.com>
12751
12752 * configure.ac: Check for readv function also.
12753 * fileread.cc (readv): Define if not HAVE_READV.
12754 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
12755 does not exist.
12756 * config.in: Regenerate.
12757 * configure: Regenerate.
12758
c0a62865
DK
127592009-10-09 Doug Kwan <dougkwan@google.com>
12760
12761 * layout.cc (Layout::make_output_section): Call target hook to make
12762 ordinary output section.
12763 (Layout::finalize): Adjust parameter list of call the
12764 Target::may_relax().
12765 * layout.h (class Layout::section_list): New method.
12766 * merge.h (Output_merge_base::entsize): Change visibility to public.
12767 (Output_merge_base::is_string, Output_merge_base::do_is_string):
12768 New methods.
12769 (Output_merge_string::do_is_string): New method.
12770 * object.cc (Sized_relobj::do_setup): renamed from
12771 Sized_relobj::set_up.
12772 * object.h (Sized_relobj::adjust_shndx,
12773 Sized_relobj::initializ_input_to_output_maps,
12774 Sized_relobj::free_input_to_output_maps): Change visibilities to
12775 protected.
12776 (Sized_relobj::setup): Virtualize.
12777 (Sized_relobj::do_setup): New method declaration.
12778 (Sized_relobj::invalidate_section_offset,
12779 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
12780 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
12781 * options.cc (parse_int): New function.
12782 * options.h (parse_int): New declaration.
12783 (DEFINE_int): New macro.
12784 (stub_group_size): New option.
12785 * output.cc (Output_section::Output_section): Initialize memebers
12786 merge_section_map_, merge_section_by_properties_map_,
12787 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
12788 (Output_section::add_input_section): Handled deferred code-fill
12789 generation and remove an old comment.
12790 (Output_section::add_relaxed_input_section): New method definition.
12791 (Output_section::add_merge_input_section): Use merge section by
12792 properties map to speed to search. Update merge section maps
12793 as appropriate.
12794 (Output_section::build_relaxation_map): New method definition.
12795 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
12796 Same.
12797 (Output_section::relax_input_section): Renamed to
12798 Output_section::convert_input_sections_to_relaxed_sections and change
12799 interface to take a vector of pointers to relaxed sections.
12800 (Output_section::find_merge_section,
12801 Output_section::find_relaxed_input_section): New method definitions.
12802 (Output_section::is_input_address_mapped,
12803 Output_section::output_offset, Output_section::output_address):
12804 Use output section data maps to speed up searching.
12805 (Output_section::find_starting_output_address): Add comments.
12806 (Output_section::do_write,
12807 Output_section::write_to_postprocessing_buffer): Do code-fill
12808 generation as appropriate.
12809 (Output_section::get_input_sections): Invalidate relaxed input section
12810 map.
12811 (Output_section::restore_states): Adjust type of checkpoint .
12812 Invalidate relaxed input section map.
12813 * output.h (Output_merge_base): New class declaration.
12814 (Input_section_specifier): New class defintion.
12815 (class Output_relaxed_input_section) Change base class to
12816 Output_section_data_build.
12817 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
12818 base class initializer.
12819 (Output_section::add_relaxed_input_section): New method declaration.
12820 (Output_section::Input_section): Change visibility to protected.
2e702c99 12821 (Output_section::Input_section::relobj,
c0a62865
DK
12822 Output_section::Input_section::shndx): Handle relaxed input sections.
12823 Output_section::input_sections) Change visibility to protected. Also
12824 define overload to return a non-const pointer.
12825 (Output_section::Merge_section_properties): New class defintion.
12826 (Output_section::Merge_section_by_properties_map,
12827 Output_section::Output_section_data_by_input_section_map,
12828 Output_section::Relaxation_map): New types.
12829 (Output_section::relax_input_section): Rename method to
12830 Output_section::convert_input_sections_to_relaxed_sections and change
12831 interface to take a vector of relaxed section pointers.
12832 (Output_section::find_merge_section,
12833 Output_section::find_relaxed_input_section,
12834 Output_section::build_relaxation_map,
12835 Output_section::convert_input_sections_in_list_to_relaxed_sections):
12836 New method declarations.
12837 (Output_section::merge_section_map_
12838 Output_section::merge_section_by_properties_map_,
12839 Output_section::relaxed_input_section_map_,
12840 Output_section::is_relaxed_input_section_map_valid_,
12841 Output_section::generate_code_fills_at_write_): New data members.
12842 * script-sections.cc
12843 (Output_section_element_input::set_section_addresses): Call
12844 current_data_size and addralign methods of relaxed input sections.
12845 (Orphan_output_section::set_section_addresses): Call current_data_size
12846 and addralign methods of relaxed input sections.
12847 * symtab.cc (Symbol_table::compute_final_value): Extract template
12848 from the body of Symbol_table::sized_finalize_symbol.
12849 (Symbol_table::sized_finalized_symbol): Call
12850 Symbol_table::compute_final_value.
12851 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
12852 (Symbol_table::compute_final_value): New templated method declaration.
12853 * target.cc (Target::do_make_output_section): New method defintion.
12854 * target.h (Target::make_output_section): New method declaration.
12855 (Target::relax): Add more parameters for input objects, symbol table
12856 and layout. Adjust call to do_relax.
12857 (Target::do_make_output_section): New method declaration.
12858 (Target::do_relax): Add parameters for input objects, symbol table
12859 and layout.
12860
d446d6c4
ILT
128612009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12862
12863 * pread.c: Include stdio.h.
12864
bc06c745
ILT
128652009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12866
12867 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
12868 defined.
12869
75aea3d0
ILT
128702009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12871
12872 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
12873 Change read_shndx type to unsigned int.
12874 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12875 int.
12876 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12877 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
12878 Change read_shndx type to unsigned int.
12879 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12880 int.
12881 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12882 * layout.cc (Layout::create_symtab_sections): Cast the result of
12883 local_symcount * symsize to off_t in the gold_assert.
12884
be8fcb75
ILT
128852009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12886
12887 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
12888 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
12889 R_ARM_BASE_ABS.
12890 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
12891 (Arm_relocate_functions::thm_abs5): New function.
12892 (Arm_relocate_functions::abs12): New function.
12893 (Arm_relocate_functions::abs16): New function.
12894 (Arm_relocate_functions::base_abs): New function.
12895 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
12896 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
12897 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
12898 R_ARM_BASE_ABS.
12899 (Scan::global): Likewise.
12900 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
12901 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
12902 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
12903 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
12904 R_ARM_BASE_ABS.
12905
c2a122b6
ILT
129062009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12907
12908 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
12909 (Arm_relocate_functions::movt_prel): New function.
12910 (Arm_relocate_functions::thm_movw_prel_nc): New function.
12911 (Arm_relocate_functions::thm_movt_prel): New function.
12912 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
12913 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
12914 (Scan::global, Relocate::relocate): Likewise.
12915 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12916
c4aa1e2d
ILT
129172009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12918
12919 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
12920 Incremental_checker.
12921 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
12922 unsigned int.
12923 (class Incremental_inputs_header): New class.
12924 (Incremental_inputs_header_writer): Edit comment.
12925 (Incremental_inputs_entry): New class.
12926 (Incremental_inputs_entry_writer): Edit comment.
12927 (Sized_incremental_binary::do_find_incremental_inputs_section):
12928 Add *strtab_shndx parameter, fill it.
12929 (Sized_incremental_binary::do_check_inputs): New method.
12930 (Incremental_checker::can_incrementally_link_output_file): Use
12931 Sized_incremental_binary::check_inputs.
12932 (Incremental_inputs::report_command_line): Save command line in
12933 command_line_.
12934 * incremental.h:
12935 (Incremental_binary::find_incremental_inputs_section): New
12936 method.
12937 (Incremental_binary::do_find_incremental_inputs_section): Add
12938 strtab_shndx parameter.
12939 (Incremental_binary::do_check_inputs): New pure virtual method.
12940 (Sized_incremental_binary::do_check_inputs): Declare.
12941 (Incremental_checker::Incremental_checker): Add incremental_inputs
12942 parameter, use it to initialize incremental_inputs_.
12943 (Incremental_checker::incremental_inputs_): New field.
12944 (Incremental_checker::command_line): New method.
12945 (Incremental_checker::inputs): New method.
12946 (Incremental_checker::command_line_): New field.
12947
c549a694
ILT
129482009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12949
12950 * incremental.cc: Include <cstdarg> and "target-select.h".
12951 (vexplain_no_incremental): New function.
12952 (explain_no_incremental): New function.
12953 (Incremental_binary::error): New method.
12954 (Sized_incremental_binary::do_find_incremental_inputs_section): New
12955 method.
12956 (make_sized_incremental_binary): New function.
12957 (open_incremental_binary): New function.
12958 (can_incrementally_link_file): Add checks if output is ELF and has
12959 inputs section.
12960 * incremental.h: Include "elfcpp_file.h" and "output.h".
12961 (Incremental_binary): New class.
12962 (Sized_incremental_binary): New class.
12963 (open_incremental_binary): Declare.
12964 * object.cc (is_elf_object): Use
12965 elfcpp::Elf_recognizer::is_elf_file.
12966 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
12967 * output.h (Output_file::filesize): New method.
12968
fd3c5f0b
ILT
129692009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12970
12971 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
12972 New function.
12973 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
12974 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
12975 function.
12976 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
12977 function.
12978 (Arm_relocate_functions::movw_abs_nc): New function.
12979 (Arm_relocate_functions::movt_abs): New function.
12980 (Arm_relocate_functions::thm_movw_abs_nc): New function.
12981 (Arm_relocate_functions::thm_movt_abs): New function.
12982 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
12983 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
12984 (Scan::global): Likewise.
12985 (Relocate::relocate): Likewise.
12986 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12987
7f5309a5
ILT
129882009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12989
12990 * arm.cc (Arm_relocate_functions::got_prel) New function.
12991 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
12992 (Relocate::relocate): Likewise.
12993 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12994
364c7fa5
ILT
129952009-10-06 Ian Lance Taylor <iant@google.com>
12996
12997 * options.h (class General_options): Define
12998 split_stack_adjust_size parameter.
12999 * object.h (class Object): Add uses_split_stack_ and
13000 has_no_split_stack_ fields. Add uses_split_stack and
13001 has_no_split_stack accessor functions. Declare
13002 handle_split_stack_section.
13003 (class Reloc_symbol_changes): Define.
13004 (class Sized_relobj): Define Function_offsets. Declare
13005 split_stack_adjust, split_stack_adjust_reltype, and
13006 find_functions.
13007 * object.cc (Object::handle_split_stack_section): New function.
13008 (Sized_relobj::do_layout): Call handle_split_stack_section.
13009 * dynobj.cc (Sized_dynobj::do_layout): Call
13010 handle_split_stack_section.
13011 * reloc.cc (Sized_relobj::relocate_sections): Call
13012 split_stack_adjust for executable sections in split_stack
13013 objects. Pass reloc_map to relocate_section.
13014 (Sized_relobj::split_stack_adjust): New function.
13015 (Sized_relobj::split_stack_adjust_reltype): New function.
13016 (Sized_relobj::find_functions): New function.
13017 * target-reloc.h: Include "object.h".
13018 (relocate_section): Add reloc_symbol_changes parameter. Change
13019 all callers.
13020 * target.h (class Target): Add calls_non_split method. Declare
13021 do_calls_non_split virtual method. Declare match_view and
13022 set_view_to_nop.
13023 * target.cc: Include "elfcpp.h".
13024 (Target::do_calls_non_split): New function.
13025 (Target::match_view): New function.
13026 (Target::set_view_to_nop): New function.
13027 * gold.cc (queue_middle_tasks): Give an error if mixing
13028 split-stack and non-split-stack objects with -r.
13029 * i386.cc (Target_i386::relocate_section): Add
13030 reloc_symbol_changes parameter.
13031 (Target_i386::do_calls_non_split): New function.
13032 * x86_64.cc (Target_x86_64::relocate_section): Add
13033 reloc_symbol_changes parameter.
13034 (Target_x86_64::do_calls_non_split): New function.
13035 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
13036 parameter.
13037 * powerpc.cc (Target_powerpc::relocate_section): Add
13038 reloc_symbol_changes parameter.
13039 * sparc.cc (Target_sparc::relocate_section): Add
13040 reloc_symbol_changes parameter.
13041 * configure.ac: Call AM_CONDITIONAL for the default target.
13042 * configure: Rebuild.
13043 * testsuite/Makefile.am (TEST_AS): New variable.
13044 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
13045 (check_DATA): Add split_i386 and split_x86_64 files.
13046 (SPLIT_DEFSYMS): Define.
13047 (split_i386_[1234n].o): New targets.
13048 (split_i386_[124]): New targets.
13049 (split_i386_[1234r].stdout): New targets.
13050 (split_x86_64_[1234n].o): New targets.
13051 (split_x86_64_[124]): New targets.
13052 (split_x86_64_[1234r].stdout): New targets.
13053 (MOSTLYCLEANFILES): Add new executables.
13054 * testsuite/split_i386.sh: New file.
13055 * testsuite/split_x86_64.sh: New file.
13056 * testsuite/split_i386_1.s: New file.
13057 * testsuite/split_i386_2.s: New file.
13058 * testsuite/split_i386_3.s: New file.
13059 * testsuite/split_i386_4.s: New file.
13060 * testsuite/split_i386_n.s: New file.
13061 * testsuite/split_x86_64_1.s: New file.
13062 * testsuite/split_x86_64_2.s: New file.
13063 * testsuite/split_x86_64_3.s: New file.
13064 * testsuite/split_x86_64_4.s: New file.
13065 * testsuite/split_x86_64_n.s: New file.
13066 * testsuite/testfile.cc (Target_test): Update relocation_section
13067 function.
13068 * testsuite/Makefile.in: Rebuild.
13069
e8a9fcda
ILT
130702009-10-06 Ian Lance Taylor <iant@google.com>
13071
13072 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
13073 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
13074 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
13075 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
13076 the address on ldo_addrs_.
13077 (Target_i386::Relocate::fix_up_ldo): New function.
13078
e99daf92
ILT
130792009-10-06 Rafael Espindola <espindola@google.com>
13080
13081 * plugin.cc (add_input_library): New.
13082 (Plugin::load): Add add_input_library to tv.
13083 (Plugin_manager::add_input_file): Add the is_lib argument.
13084 (add_input_file): Update call to Plugin_manager::add_input_file.
13085 (add_input_library): New.
13086 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
13087
966d4097
DK
130882009-09-30 Doug Kwan <dougkwan@google.com>
13089
13090 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
13091 symbol and call Symbol::may_need_copy_reloc to determine if
13092 a copy reloc is needed.
13093 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
13094 nocopyreloc is given in command line.
13095 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
13096 given in command line.
13097 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
13098 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
13099 of the removed Target_i386::may_need_copy_reloc.
13100 * options.h (copyreloc): New option with default value false.
13101 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13102 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
13103 instead of the removed Target_powerpc::may_need_copy_reloc.
13104 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13105 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
13106 instead of the removed Target_sparc::may_need_copy_reloc.
13107 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
13108 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
13109 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
13110 instead of the removed Target_x86_64::may_need_copy_reloc.
13111
029ba973
ILT
131122009-09-30 Ian Lance Taylor <iant@google.com>
13113
13114 * object.h (class Object): Remove target_ field, and target,
13115 sized_target, and set_target methods.
13116 (Object::sized_target): Remove.
13117 (class Sized_relobj): Update declarations. Remove sized_target.
13118 * object.cc (Sized_relobj::setup): Remove target parameter.
13119 Change all callers.
13120 (Input_objects::add_object): Don't do anything with the target.
13121 (make_elf_sized_object): Add punconfigured parameter. Change all
13122 callers. Set or test parameter target.
13123 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
13124 Change all callers.
13125 * parameters.cc (Parameters::set_target): Change parameter type to
13126 be non-const.
13127 (Parameters::default_target): Remove.
13128 (set_parameters_target): Change parameter type to be non-const.
13129 (parameters_force_valid_target): New function.
13130 (parameters_clear_target): New function.
13131 * parameters.h (class Parameters): Update declarations. Remove
13132 default_target method. Add sized_target and clear_target
13133 methods. Change target_ to be non-const.
13134 (set_parameters_target): Update declaration.
13135 (parameters_force_valid_target): Declare.
13136 (parameters_clear_target): Declare.
13137 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
13138 as NULL if we aren't searching.
13139 (Add_symbols::run): Don't check for compatible target.
13140 * fileread.cc (Input_file::open_binary): Call
13141 parameters_force_valid_target.
13142 * gold.cc (queue_middle_tasks): Likewise.
13143 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
13144 set_target on object.
13145 * dynobj.h (class Sized_dynobj): Update declarations.
13146 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
13147 make_elf_object returns NULL.
13148 (Archive::include_member): Don't check whether object target is
13149 compatible.
13150 * output.cc (Output_section::add_input_section): Get target from
13151 parameters.
13152 (Output_section::relax_input_section): Likewise.
13153 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
13154 parameters.
13155 (Sized_relobj::do_scan_relocs): Likewise.
13156 (Sized_relobj::relocate_sections): Likewise.
13157 * resolve.cc (Symbol_table::resolve): Likewise.
13158 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
13159 parameter. Change all callers.
13160 (Symbol_table::add_from_object): Get target from parameters.
13161 (Symbol_table::add_from_relobj): Don't check object target.
13162 (Symbol_table::add_from_dynobj): Likewise.
13163 (Symbol_table::define_special_symbol): Get target from
13164 parameters.
13165 * symtab.h (class Symbol_table): Update declaration.
13166 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
13167 parameter. Change all callers. Clear parameter target.
13168 (Binary_test): Test target here.
13169 * testsuite/object_unittest.cc (gold_testsuite): Remove
13170 target_test_pointer parameter. Change all callers.
13171 (Object_test): Test target here.
13172
a6a22b83
ILT
131732009-09-26 Ian Lance Taylor <iant@google.com>
13174
13175 * testsuite/initpri1.c: Don't try to use constructor priorities if
13176 compiling with gcc before 4.3.
13177
6a8f49fe
ILT
131782009-09-22 Mikolaj Zalewski <mikolajz@google.com>
13179
13180 * testsuite/retain_symbols_file_test.sh (check_present): Change
13181 output file name to retain_symbols_file_test.stdout.
13182 (check_absent): Likewise.
13183
8c604651
CS
131842009-09-18 Craig Silverstein <csilvers@google.com>
13185
13186 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
13187 * options.cc: Include <cerrno> and <fstream>.
13188 (General_options::finalize): Parse -retain-symbols-file tag.
13189 * options.h: New flag.
13190 (General_options): New method should_retain_symbol, new
13191 variable symbols_to_retain.
13192 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
13193 should_retain_symbol map.
13194 * testsuite/Makefile.am (retain_symbols_file_test): New test.
13195 * testsuite/Makefile.in: Regenerate.
13196 * testsuite/retain_symbols_file_test.sh: New file.
13197
ca58b19f
NC
131982009-09-18 Nick Clifton <nickc@redhat.com>
13199
13200 * po/es.po: Updated Spanish translation.
13201
20e6d0d6
DK
132022009-09-17 Doug Kwan <dougkwan@google.com>
13203
13204 * debug.h (DEBUG_RELAXATION): New constant.
13205 (DEBUG_ALL): Add DEBUG_RELAXATION.
13206 (debug_string_to_enum): Add relaxation debug option.
13207 * layout.cc
13208 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
13209 Layout::Relaxation_debug_check::read_sections,
13210 Layout::Relaxation_debug_check::read_sections): New method definitions.
13211 (Layout::Layout): Initialize data members
13212 record_output_section_data_from_scrips_,
13213 script_output_section_data_list_ and relaxation_debug_check_.
13214 (Layout::save_segments, Layout::restore_segments,
13215 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13216 Layout::relaxation_loop_body): New method definitions.
13217 (Layout::finalize): Support relaxation. Move section layout code to
13218 Layout::relaxation_loop_body.
13219 (Layout::set_asection_address_from_script): Move code for orphan
13220 section placement out.
13221 (Layout::place_orphan_sections_in_script): New method definition.
13222 * layout.h (Output_segment_headers, Output_file_header):
13223 New forward class declarations.
13224 (Layout::~Layout): Define.
13225 (Layout::new_output_section_data_from_script): New method definition.
13226 (Layout::place_orphan_sections_in_script): New method declaration.
13227 (Layout::Segment_states): New type declaration.
13228 (Layout::save_segments, Layout::restore_segments,
13229 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13230 Layout::relaxation_loop_body): New method declarations.
13231 (Layout::Output_section_data_list): New type declaration.
13232 (Layout::Relaxation_debug_check): New class definition.
13233 (Layout::record_output_section_data_from_script_,
13234 Layout::script_output_section_data_list_, Layout::segment_states_,
13235 Layout::relaxation_debug_check_): New data members.
13236 * output.cc: (Output_section_headers::do_size): New method definition.
13237 (Output_section_headers::Output_section_headers): Move size
13238 computation to Output_section_headers::do_size.
13239 (Output_segment_headers::do_size): New method definition.
e1df38aa 13240 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
13241 Output_file_header::do_size and call it.
13242 (Output_file_header::do_size): New method definition.
13243 (Output_data_group::Output_data_group): Adjust call to
13244 Output_section_data.
13245 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
13246 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 13247 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
13248 RELAXED_INPUT_SECTION_CODE.
13249 (Output_section::Output_section): Initialize data member checkpoint_.
13250 (Output_section::~Output_section): Delete checkpoint object pointed
13251 by checkpoint_.
13252 (Output_section::add_input_section): Always add an Input_section if
13253 relaxing.
13254 (Output_section::add_merge_input_section): Add assert.
13255 (Output_section::relax_input_section): New method definition.
13256 (Output_section::set_final_data_size): Set load address to zero for
13257 an unallocated section.
13258 (Output_section::do_address_and_file_offset_have_reset_values):
13259 New method definition.
13260 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
13261 Handle relaxed input section.
13262 (Output_section::sort_attached_input_sections): Checkpoint input
13263 section list lazily.
13264 (Output_section::get_input_sections): Change type of input_sections to
13265 list of Simple_input_section pointers. Checkpoint input section list
13266 lazily. Also handle relaxed input sections.
13267 (Output_section::add_input_section_for_script): Take a reference to
13268 a Simple_input_section object instead of Relobj pointer and section
13269 index as parameter. Handle relaxed input sections.
13270 (Output_section::save_states, Output_section::restore_states): New
13271 method definitions.
13272 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
13273 (Output_data::is_data_size_fixed): New method definition.
13274 (Output_data::reset_addresss_and_file_offset): Do not reset data size
13275 if it is fixed.
13276 (Output_data::address_and_file_offset_have_reset_values): New method
13277 definition.
13278 (Output_data::do_address_and_file_offset_have_reset_values): New method
13279 definition.
13280 (Output_data::set_data_size): Check that data size is not fixed.
13281 (Output_data::fix_data_size): New method definition.
13282 (Output_data::is_data_size_fixed_): New data member.
13283 (Output_section_headers::set_final_data_size): New method definition.
13284 (Output_section_headers::do_size): New method declaration.
13285 (Output_segment_headers::set_final_data_size): New method definition.
13286 (Output_segment_headers::do_size): New method declaration.
13287 (Output_file_header::set_final_data_size)::New method definition.
13288 (Output_file_header::do_size)::New method declaration.
13289 (Output_section_data::Output_section_data): Add new parameter
13290 is_data_size_fixed and use it to fix data size.
13291 (Output_data_const::Output_data_const): Adjust call to base class
13292 constructor and fix data size.
13293 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
13294 base class constructor and fix data size.
13295 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
13296 base class constructor and fix data size.
13297 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
13298 class constructor and fix data size.
13299 (Output_data_group::set_final_data_size): New method definition.
13300 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
13301 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
13302 class constructor and fix data size.
13303 (Output_relaxed_input_section): New class definition.
13304 (Output_section::Simple_input_section): New class definition.
13305 (Output_section::get_input_sections): Adjust parameter list.
13306 (Output_section::add_input_section_for_script): Same.
13307 (Output_section::save_states, Output_section::restore_states,
13308 Output_section::do_address_and_file_offset_have_reset_values,
13309 (Output_section::Input_section::Input_section): Handle
13310 RELAXED_INPUT_SECTION_CODE. Add new overload for
13311 Output_relaxed_input_section.
13312 (Output_section::Input_section::is_input_section,
13313 Output_section::Input_section::set_output_section): Handle relaxed
13314 input section.
13315 (Output_section::Input_section::is_relaxed_input_section,
13316 Output_section::Input_section::output_section_data,
13317 Output_section::Input_section::relaxed_input_section): New method
13318 definitions.
13319 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
13320 value.
13321 (Output_section::Input_section::u1_): Update comments.
13322 (Output_section::Input_section::u2_): Add new union member poris.
13323 (Output_section::Checkpoint_output_section): New classs definition.
13324 (Output_section::relax_input_section): New method declaration.
13325 (Output_section::checkpoint_): New data member.
13326 (Output_segment): Update comments.
13327 (Output_segment::Output_segment): Un-privatize copy constructor.
13328 (Output_segment::operator=): Un-privatize.
13329 * script-sections.cc (Output_section_element::Input_section_list):
13330 Change element type to Output_section::Simple_input_section.
13331 (Output_section_element_dot_assignment::set_section_addresses):
13332 Register output section data for relaxation clean up.
13333 (Output_data_exression::Output_data_expression): Adjust call to base
13334 constructor to fix data size.
13335 (Output_section_element_data::set_section_addresses): Register
13336 Output_data_expression object for relaxation clean up.
13337 (struct Input_section_info): Replace Relobj pointer and section index
13338 pair with Output_section::Simple_input_section and Convert struct to a
13339 class.
13340 (Input_section_sorter::operator()): Adjust access to
e1df38aa 13341 Input_section_info data member to use accessors.
20e6d0d6
DK
13342 (Output_section_element_input::set_section_addresses): Use layout
13343 parameter. Adjust code to use Output_section::Simple_input_section
13344 and Input_secction_info classes. Register filler for relaxation
13345 clean up.
13346 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
13347 and section index pair with Output_section::Simple_input_section
13348 class. Adjust code accordingly.
13349 (Phdrs_element::release_segment): New method definition.
13350 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
13351 segment list.
13352 (Script_sections::release_segments): New method definition.
13353 * gold/script-sections.h (Script_sections::release_segments): New
13354 method declaration.
13355 * gold/target.h (Target::may_relax, Target::relax,
13356 Target::do_may_relax, Target::do_relax): New method definitions.
13357
5e445df6
ILT
133582009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13359
13360 * arm.cc (has_signed_unsigned_overflow): New function.
13361 (Arm_relocate_functions::abs8): New function.
13362 (Target_arm::Scan::local): Handle R_ARM_ABS8.
13363 (Target_arm::Scan::global): Likewise.
13364 (Target_arm::relocate::relocate): Likewise.
13365 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
13366 Likewise.
13367
8c604651 133682009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
13369
13370 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
13371 * testsuite/Makefile.in: Regenerate.
13372
1e9cc1c2
NC
133732009-09-11 Nick Clifton <nickc@redhat.com>
13374
13375 * po/gold.pot: Updated by the Translation project.
13376
6a89f575
CC
133772009-09-08 Cary Coutant <ccoutant@google.com>
13378
13379 * output.cc (Output_file::open): Add execute permission to empty file.
13380 * testsuite/Makefile.am (permission_test): New test.
13381 * testsuite/Makefile.in: Regenerate.
13382
fdcac5af
ILT
133832009-09-02 Ian Lance Taylor <iant@google.com>
13384
13385 * output.cc (Output_file::resize): Call map_no_anonymous rather
13386 than map.
13387
44453f85
ILT
133882009-09-01 Mikolaj Zalewski <mikolajz@google.com>
13389
13390 * gold.cc: Include "incremental.h".
13391 (queue_initial_tasks): Call Incremental_checker methods.
13392 * incremental.cc: Include "output.h".
13393 (Incremental_checker::can_incrementally_link_output_file): New
13394 method.
13395 * incremental.h (Incremental_checker): New class.
13396
13397 * output.cc (Output_file::open_for_modification): New method.
13398 (Output_file::map_anonymous): Changed return type to bool. Record
13399 map in base_ field.
13400 (Output_file::map_no_anonymous): New method, broken out of map.
13401 (Output_file::map): Use map_no_anonymous and map_anonymous.
13402 * output.h (class Output_file): Update declarations.
13403
293c1386
CC
134042009-08-24 Cary Coutant <ccoutant@google.com>
13405
13406 * options.h (Command_line::Pre_options): New class.
13407 (Command_line::pre_options): New member.
13408 * options.cc (gold::options::ready_to_register): New variable.
13409 (One_option::register_option): Do nothing if not registering options.
13410 Assert if same short option registered twice.
13411 (General_options::General_options): Turn off option registration when
13412 done constructing.
13413 (Command_line::Pre_options::Pre_options): New constructor.
13414
f773f3d2
CC
134152009-08-24 Cary Coutant <ccoutant@google.com>
13416
06a73cfe
CC
13417 * options.h (General_options::no_keep_memory): Remove incorrect
13418 short option.
f773f3d2 13419
a15af8e2
RW
134202009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13421
13422 * Makefile.am (am__skiplex, am__skipyacc): New.
13423 * Makefile.in: Regenerate.
13424
c462b41b
RW
134252009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13426
14ec8efd
RW
13427 * Makefile.am (AM_CPPFLAGS): Renamed from ...
13428 (INCLUDES): ... this.
13429 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
13430 (AM_CPPFLAGS): Renamed from ...
13431 (INCLUDE): ... this.
13432 * Makefile.in, testsuite/Makefile.in: Regenerate.
13433
81ecdfbb
RW
13434 * Makefile.in: Regenerate.
13435 * aclocal.m4: Likewise.
13436 * config.in: Likewise.
13437 * configure: Likewise.
13438 * testsuite/Makefile.in: Likewise.
13439
c462b41b
RW
13440 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13441 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13442 * Makefile.in: Regenerate.
13443 * testsuite/Makefile.in: Regenerate.
13444
2da73f13
CC
134452009-08-19 Cary Coutant <ccoutant@google.com>
13446
13447 * resolve.cc (Symbol_table::resolve): Don't complain about defined
13448 symbols in shared libraries overridden by hidden or internal symbols
13449 in the main program.
13450
2db70501
CD
134512009-08-19 Chris Demetriou <cgd@google.com>
13452
13453 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
13454 checking source file names in error messages.
13455
f733487b
DK
134562009-08-18 Doug Kwan <dougkwan@google.com>
13457
13458 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
13459 an elcpp::Ehdr as parameter. Adjust call to set_target.
13460 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
13461 an elfcpp::Ehdr as parameter.
13462 * object.cc (Object::set_target): Remove the version that looks up
13463 a target and sets it.
13464 (Sized_relobj::setup): Take a Target object instead of
13465 an elfcpp::Ehdr as parameter. Adjust call to set_target.
13466 (make_elf_sized_object): Find target and ask target to
13467 make an ELF object.
13468 * object.h: (Object::set_target): Remove the version that looks up
13469 a target and sets it.
13470 (Sized_relobj::setup): Take a Target object instead of
13471 an elfcpp:Ehdr as parameter.
13472 * target.cc: Include dynobj.h.
13473 (Target::do_make_elf_object_implementation): New.
2e702c99 13474 (Target::do_make_elf_object): New.
f733487b
DK
13475 * target.h (Target::make_elf_object): New template declaration.
13476 (Target::do_make_elf_object): New method declarations.
13477 (Target::do_make_elf_object_implementation): New template declaration.
13478
cc70f101
ILT
134792009-08-14 Ian Lance Taylor <iant@google.com>
13480
13481 * gold.h (FUNCTION_NAME): Define.
13482 (gold_unreachable): Use FUNCTION_NAME.
13483
ef5e0cb1
ST
134842009-08-12 Sriraman Tallam <tmsriram@google.com>
13485
13486 * icf.cc (Icf::find_identical_sections): Issue a warning when a
13487 symbol in the --keep-unique list is not found.
13488
48c187ce
ST
134892009-08-12 Sriraman Tallam <tmsriram@google.com>
13490
13491 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
13492 been maked as --keep-unique.
13493 (Icf::unfold_section): New function.
13494 * icf.h (Icf::unfold_section): New function.
13495 * options.h (General_options::keep_unique): New option.
13496 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
13497 * testsuite/Makefile.in: Regenerate.
13498 * testsuite/icf_keep_unique_test.sh: New file.
13499 * testsuite/icf_keep_unique_test.cc: New file.
13500
645afe0c
CC
135012009-08-12 Cary Coutant <ccoutant@google.com>
13502
13503 PR 10471
13504 * resolve.cc (Symbol_table::resolve): Check for references from
13505 dynamic objects to hidden and internal symbols.
13506 * testsuite/Makefile.am (hidden_test.sh): New test.
13507 * testsuite/Makefile.in: Regenerate.
13508 * testsuite/hidden_test.sh: New script.
13509 * testsuite/hidden_test_1.c: New test source.
13510 * testsuite/hidden_test_main.c: New test source.
13511
11af873f
DK
135122009-08-11 Doug Kwan <dougkwan@google.com>
13513
13514 * arm.cc: Update comments.
13515 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
13516 segment to locate the .ARM.exidx section if present.
13517
b9f7d72d
DK
135182009-08-09 Doug Kwan <dougkwan@google.com>
13519
13520 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
13521 patch.
13522
ddd3c53c
ST
135232009-08-07 Sriraman Tallam <tmsriram@google.com>
13524 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
13525 compiler warnings.
13526
27721062
ST
135272009-08-06 Sriraman Tallam <tmsriram@google.com>
13528
13529 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
13530 valid tls_segment only for non-debug-section relocations.
13531 * testsuite/Makefile.am: Add gc_tls_test.
13532 * testsuite/Makefile.in: Regenerate.
13533 * testsuite/gc_tls_test.cc: New file.
13534 * testsuite/gc_tls_test.sh: New file.
13535
ef15dade 135362009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 13537
ef15dade
ST
13538 * icf.cc: New file.
13539 * icf.h: New file.
13540 * Makefile.am (CCFILES): Add icf.cc.
13541 (HFILES): Add icf.h
13542 * Makefile.in: Regenerate.
13543 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
13544 * gc.h (gc_process_relocs): Populate lists used by icf to contain
13545 section, symbol and addend information for the relocs.
13546 * gold.cc (queue_middle_tasks): Call identical code folding.
13547 * gold.h: Add defines for multimap.
13548 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
13549 to the call of finalize_local_symbols.
13550 * main.cc (main): Create object of class Icf.
13551 * object.cc (Sized_relobj::do_layout): Allow this function to be
13552 called twice during icf.
13553 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
13554 to sections marked as identical by icf.
13555 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
13556 when available.
13557 (Sized_relobj::do_section_entsize): New function.
13558 * object.h (Object::section_entsize): New function.
13559 (Object::do_section_entsize): New pure virtual function.
13560 (Relobj::finalize_local_symbols): Add new parameter.
13561 (Relobj::do_section_entsize): New function.
13562 * options.h (General_options::icf): New option.
13563 (General_options::icf_iterations): New option.
13564 (General_options::print_icf_sections): New option.
13565 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
13566 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
13567 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
13568 icf.
13569 * symtab.cc (Symbol_table::is_section_folded): New function.
13570 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
13571 to sections marked as identical by icf.
13572 * symtab.h (Symbol_table::set_icf): New function.
13573 (Symbol_table::icf): New function.
13574 (Symbol_table::is_section_folded): New function.
13575 (Symbol_table::icf_): New data member.
13576 * target-reloc.h (relocate_section): Ignore sections folded by icf.
13577 * testsuite/Makefile.am: Add commands to build icf_test.
13578 * testsuite/Makefile.in: Regenerate.
13579 * testsuite/icf_test.sh: New file.
13580 * testsuite/icf_test.cc: New file.
13581
c3b65ac4
CD
135822009-07-24 Chris Demetriou <cgd@google.com>
13583
13584 * layout.cc (is_compressible_debug_section): Fix incorrect
13585 comment about compressed section names.
13586
1caf2c51
ILT
135872009-07-20 Ian Lance Taylor <ian@airs.com>
13588
13589 PR 10419
13590 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
13591
1ef4d87f
ILT
135922009-07-16 Ian Lance Taylor <iant@google.com>
13593
13594 PR 10400
13595 * layout.h: #include <map>.
13596 (class Kept_section): Change from struct to class. Add accessors
13597 and setters. Add section size to Comdat_group mapping. Change
13598 Comdat_group to std::map. Add is_comdat_ field. Add
13599 linkonce_size field in union.
13600 (class Layout): Update declaration of find_or_add_kept_section.
13601 Don't declare find_kept_object.
13602 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
13603 parameter. Add object, shndx, is_comdat, and is_group_name
13604 parameters. Change all callers. Adjust for new Kept_section.
13605 (Layout::find_kept_object): Remove.
13606 * object.cc (Sized_relobj::include_section_group): Update use of
13607 Kept_section. Rename secnum to shndx. Only record
13608 Kept_comdat_section if sections are the same size.
13609 (Sized_relobj::include_linkonce_section): Update use of
13610 Kept_section. Only record Kept_comdat_section if sections are the
13611 same size. Set size of linkonce section.
13612 (Sized_relobj::map_to_kept_section): Update call to
13613 get_kept_comdat_section.
13614 * object.h (class Sized_relobj): Rename fields in
13615 Kept_comdat_section to drop trailing underscores; change object
13616 field to Relobj*. Change Kept_comdat_section_table to store
13617 struct rather than pointer.
13618 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
13619 Add kept_object and kept_shndx parameters. Change all callers.
13620 (Sized_relobj::get_kept_comdat_section): Change return type to
13621 bool. Add kept_object and kept_shndx parameters. Change all
13622 callers.
13623 * plugin.cc (Pluginobj::include_comdat_group): Update call to
13624 Layout::find_or_add_kept_section.
13625
37c3b7b0
ILT
136262009-07-09 Ian Lance Taylor <iant@google.com>
13627
13628 * merge.cc (Object_merge_map::initialize_input_to_output_map):
13629 Reserve space in the hash table.
13630
98fa85cb
ILT
136312009-07-06 Mikolaj Zalewski <mikolajz@google.com>
13632
13633 * fileread.cc (File_read::get_mtime): New method.
13634 * fileread.h (Timespec): New structure.
13635 (File_read::get_mtime): New method.
13636 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
13637 Renamed from timestamp_nsec.
13638 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
13639 Elf_Xword.
e1df38aa 13640 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 13641 timestamp_nsec.
e1df38aa 13642 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
13643 (Incremental_inputs::report_obejct): Save mtime; style fix.
13644 (Incremental_inputs::report_script): Save mtime; style fix.
13645 (Incremental_inputs::finalize_inputs): Style fix.
13646 (Incremental_inputs::finalize): Style fix.
13647 (Incremental_inputs::create_input_section_data): Store inputs
13648 mtime.
13649 * incremental.h (Incremental_inputs::report_script): Add mtime
13650 argument.
13651 (Incremental_inputs::Input_info::Input_info): Intialize only one
13652 union member.
13653 (Incremental_inputs::Input_info::archive): Move to nameless
13654 union.
13655 (Incremental_inputs::Input_info::obejct): Move to nameless union.
13656 (Incremental_inputs::Input_info::script): Move to nameless union.
13657 (Incremental_inputs::mtime): New field.
13658 * script.cc (read_input_script): Pass file mtime to
13659 Incremental_input.
13660 * script.h (Script_info::inputs): Style fix.
13661
c9d70757
ILT
136622009-07-01 Ian Lance Taylor <ian@airs.com>
13663
13664 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
13665 instead of 32.
13666
9c547ec3
ILT
136672009-06-24 Ian Lance Taylor <iant@google.com>
13668
13669 PR 10156
13670 * layout.cc (Layout::choose_output_section): If we find an
13671 existing section, update the flags.
13672 (Layout::create_notes): New function, broken out of
13673 Layout::finalize.
13674 (Layout::finalize): Don't create note sections.
13675 (Layout::create_note): Don't crash if linker script discards
13676 section.
13677 (Layout::create_gold_note): Likewise.
13678 (Layout::create_build_id): Likewise. Don't set
13679 after_input_sections on the section.
13680 (Layout::create_executable_stack_info): Remove target parameter.
13681 Change caller.
13682 * layout.h (class Layout): Declare create_notes. Update
13683 declaration of create_executable_stack_info.
13684 * gold.cc (queue_middle_tasks): Call create_notes.
13685 * output.cc (Output_section::update_flags_for_input_section): Move
13686 here from output.h. If SHF_ALLOC flag is newly set, mark address
13687 invalid.
13688 * output.h (Output_data::mark_address_invalid): New function.
13689 (class Output_section): Only declare, not define,
13690 update_flags_for_input_section. Remove set_flags.
13691
55458500
ILT
136922009-06-24 Ian Lance Taylor <iant@google.com>
13693
13694 * script-sections.cc (Output_section_definition::
13695 set_section_addresses): Rename shadowing local load_address to
13696 laddr.
13697
1307d6cd
ILT
136982009-06-24 Ian Lance Taylor <iant@google.com>
13699
13700 PR 10244
13701 * reloc.cc (relocate_sections): Skip empty relocation sections.
13702
ec3f783e
ILT
137032009-06-23 Ian Lance Taylor <iant@google.com>
13704
13705 PR 10156
13706 * layout.cc (Layout::create_note): Use choose_output_section
13707 rather than make_output_section.
13708
459c9f1c
ILT
137092009-06-23 Ian Lance Taylor <iant@google.com>
13710
13711 PR 10237
13712 * options.cc (General_options::parse_V): Set printed_version_.
13713 (General_options::General_options): Initialize printed_version_.
13714 * options.h (class General_options): Add printed_version_ field.
13715 * gold.cc (queue_initial_tasks): If there are no input files,
13716 don't give a fatal error if we printed the version information.
13717 (queue_middle_tasks): If using -r with a shared object, give a
13718 fatal error rather than an ordinary error.
13719
1518dc8f
ILT
137202009-06-23 Ian Lance Taylor <iant@google.com>
13721
13722 PR 10219
13723 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
13724 (Layout::make_output_section): Set have_stabstr_section_ if we see
13725 a .stab*str section.
13726 (Layout::finalize): Call link_stabs_sections.
13727 (Layout::link_stabs_sections): New file.
13728 * layout.h (class Layout): Add have_stabstr_section_ field.
13729 Declare link_stabs_sections.
13730
3d857b98
DK
137312009-06-23 Doug Kwan <dougkwan@google.com>
13732
13733 * Makefile.am (libgold_a_LIBADD): New.
13734 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 13735 * Makefile.in: Regenerate.
3d857b98
DK
13736 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
13737 * configure: Regenerate.
13738 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
13739 * fileread.cc: Include sys/state.h
13740 * gold.h: Declare memmem and strndup if found missing.
13741 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
13742
0639a6f6
ILT
137432009-06-23 Ian Lance Taylor <iant@google.com>
13744
13745 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
13746 * configure: Rebuild.
13747
8d63875c
ILT
137482009-06-23 Ian Lance Taylor <iant@google.com>
13749
13750 PR 10147
13751 * object.cc (Object::section_contents): Don't try to get a view if
13752 the section has length zero.
13753 (Object::handle_gnu_warning_section): If the section is empty, use
13754 the name of the section as the warning.
13755
f7c8a183
ILT
137562009-06-23 Ian Lance Taylor <iant@google.com>
13757
13758 PR 10133
13759 * stringpool.h (class Stringpool_template): Add optimize_ field.
13760 (Stringpool_template::set_optimize): New function.
13761 * stringpool.cc (Stringpool_template::Stringpool_template):
13762 Initialize optimize_ field.
13763 (Stringpool_template::set_string_offsets): Test local optimize
13764 fild rather than parameter.
13765 * layout.cc (Layout::Layout): Call set_optimize on the section
13766 name stringpool.
13767
e6a307ba
ILT
137682009-06-22 Ian Lance Taylor <iant@google.com>
13769
13770 PR 10030
13771 * yyscript.y: Parse TARGET.
13772 * script.cc (script_set_target): New function.
13773 * script-c.h (script_set_target): Declare.
13774 * options.cc (General_options::string_to_object_format): Rename
13775 from string_to_object_format in anonymous namespace. Change
13776 callers.
13777 * options.h (class General_options): Declare
13778 string_to_object_format.
13779
3ee173de
ILT
137802009-06-22 Ian Lance Taylor <iant@google.com>
13781
13782 * script-sections.cc (Script_sections::create_segments): Don't put
13783 program headers in a PT_LOAD segment if -n or -N.
13784
137852009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
13786
13787 PR 10141
13788 * options.h (class General_options): Add -z lazy and -z now. Sort
13789 -z options into alphabetical order.
13790 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
13791
cd6739a1 137922009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
13793
13794 * layout.cc (Layout::make_output_section): Call
13795 Target::new_output_section.
13796 (Layout::attach_allocated_section_to_segment): Put large section
13797 sections in a separate load segment with the large segment flag
13798 set.
13799 (Layout::segment_precedes): Sort large data segments after other
13800 load segments.
13801 (align_file_offset): New static function.
13802 (Layout::set_segment_offsets): Use align_file_offset.
13803 * output.h (class Output_section): Add is_small_section_ and
13804 is_large_section_ fields.
13805 (Output_section::is_small_section): New function.
13806 (Output_section::set_is_small_section): New function.
13807 (Output_section::is_large_section): New function.
13808 (Output_section::set_is_large_section): New function.
13809 (Output_section::is_large_data_section): New function.
13810 (class Output_segment): Add is_large_data_segment_ field.
13811 (Output_segment::is_large_data_segment): New function.
13812 (Output_segment::set_is_large_data_segment): New function.
13813 * output.cc (Output_section::Output_section): Initialize new
13814 fields.
13815 (Output_segment::Output_segment): Likewise.
13816 (Output_segment::add_output_section): Add assertion that large
13817 data sections always go in large data segments. Force small data
13818 sections to the end of the list of data sections. Force small BSS
13819 sections to the start of the list of BSS sections. For large BSS
13820 sections to the end of the list of BSS sections.
13821 * symtab.h (class Symbol): Declare is_common_shndx.
13822 (Symbol::is_defined): Check Symbol::is_common_shndx.
13823 (Symbol::is_common): Likewise.
13824 (class Symbol_table): Define enum Commons_section_type. Update
13825 declarations. Add small_commons_ and large_commons_ fields.
13826 * symtab.cc (Symbol::is_common_shndx): New function.
13827 (Symbol_table::Symbol_table): Initialize new fields.
13828 (Symbol_table::add_from_object): Put small and large common
13829 symbols in the right list.
13830 (Symbol_table::sized_finalized_symbol): Check
13831 Symbol::is_common_shndx.
13832 (Symbol_table::sized_write_globals): Likewise.
13833 * common.cc (Symbol_table::do_allocate_commons): Allocate new
13834 common symbol lists. Don't call do_allocate_commons_list if the
13835 list is empty.
13836 (Symbol_table::do_allocate_commons_list): Remove is_tls
13837 parameter. Add comons_section_type parameter. Change all
13838 callers. Handle small and large common symbols.
13839 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
13840 Symbol::is_common_shndx.
13841 * resolve.cc (symbol_to_bits): Likewise.
13842 * target.h (Target::small_common_shndx): New function.
13843 (Target::small_common_section_flags): New function.
13844 (Target::large_common_shndx): New function.
13845 (Target::large_common_section_flags): New function.
13846 (Target::new_output_section): New function.
13847 (Target::Target_info): Add small_common_shndx, large_common_shndx,
13848 small_common_section_flags, and large_common_section_flags
13849 fields.
13850 (Target::do_new_output_section): New virtual function.
13851 * arm.cc (Target_arm::arm_info): Initialize new fields.
13852 * i386.cc (Target_i386::i386_info): Likewise.
13853 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
13854 Likewise.
13855 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
13856 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13857 (Target_x86_64::do_new_output_section): New function.
13858 * configure.ac: Define conditional MCMODEL_MEDIUM.
13859 * testsuite/Makefile.am (check_PROGRAMS): Add large.
13860 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
13861 (large_LDFLAGS): Define.
13862 * testsuite/large.c: New file.
13863 * testsuite/testfile.cc (Target_test::test_target_info):
13864 Initialize new fields.
13865 * configure, testsuite/Makefile.in: Rebuild.
13866
bb04269c
DK
138672009-06-05 Doug Kwan <dougkwan@google.com>
13868
13869 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 13870 * Makefile.in: Regenerate.
bb04269c
DK
13871 * i386.cc (class Target_i386): Define new virtual method to
13872 override do_is_local_label_name in parent.
13873 * object.cc (Sized_relobj::do_count_local_symbols): Discard
13874 local symbols if --discard-locals or -X is given.
13875 * options.h (class General_options): Declare new options
13876 '--discard-locals' and '-X' for discarding locals.
13877 * target.h (class Target): Define new methods is_local_label_name.
13878 Declare new virtual method do_is_local_label_name.
13879 * target.cc: New file.
13880 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
13881 (check_SCRIPTS): Add discard_locals_test.sh.
13882 (check_DATA): Add discard_local_tests.syms.
13883 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
13884 (discard_local_tests.syms, discard_locals_test.o): New make rules.
13885 * testsuite/Makefile.in: Regenerate.
13886 * testsuite/discard_locals_test.c: New file.
13887 * testsuite/discard_locals_test.sh: Same.
13888
805bb01c
DK
138892009-06-05 Doug Kwan <dougkwan@google.com>
13890
13891 * object.cc (Sized_relobj::Sized_relobj): Initialize
13892 discarded_eh_frame_shndx_ to -1U.
13893 (Sized_relobj::do_layout): Record index of a discard .eh_frame
13894 section.
13895 (Sized_relobj::do_count_local_symbols): Skip local symbols in
13896 a discarded .eh_frame section.
13897 (Sized_relobj::do_finalize_local_symbols): Ditto.
13898 * object.h (class Sized_relobj): Declare new member
13899 discarded_eh_frame_shndx_.
13900 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
13901 (local_labels_test.o, local_labels_test): New rules.
13902 * testsuite/Makefile.in: Regenerate.
13903
1dcd334d
DK
139042009-06-04 Doug Kwan <dougkwan@google.com>
13905
13906 * layout.cc (Layout::section_name_mapping): Add mapping for
13907 special ARM sections.
13908
96d49306
DK
139092009-06-03 Doug Kwan <dougkwan@google.com>
13910
13911 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
13912 (utils::has_overflow): Same.
13913
dff16297
ILT
139142009-06-03 Ian Lance Taylor <iant@google.com>
13915
13916 * layout.cc (Layout::section_name_mapping): New array, replacing
13917 Layout::linkonce_mapping.
13918 (Layout::section_name_mapping_count): New variable, replacing
13919 Layout::linkonce_mapping_count.
13920 (Layout::linkonce_output_name): Remove.
13921 (Layout::output_section_name): Rewrite.
13922 * layout.h (class Layout): Rename Linkonce_mapping to
13923 Section_name_mapping, linkonce_mapping to section_name_mapping,
13924 linkonce_mapping_count to section_name_mapping_count. Don't
13925 declare linkonce_output_name.
13926
c121c671
DK
139272009-06-03 Doug Kwan <dougkwan@google.com>
13928
13929 * gold/arm.cc (namespace utils): New.
13930 (Target_arm::reloc_is_non_pic): Define new method.
13931 (class Arm_relocate_functions): New.
13932 (Target_arm::Relocate::relocate): Handle relocation types used by
13933 Android.
13934
07800fab
ILT
139352009-06-03 Ian Lance Taylor <iant@google.com>
13936
13937 * arm.cc (Target_arm::scan::global): Use || instead of |.
13938
c121c671
DK
139392009-06-02 Doug Kwan <dougkwan@google.com>
13940
13941 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
13942 issued_non_pic_error_.
13943 (class Target_arm::Scan): Declare new method check_non_pic.
13944 Define new method symbol_needs_plt_entry.
13945 Declare new data member issued_non_pic_error_.
13946 (class Target_arm::Relocate): Declare new method
13947 should_apply_static_reloc.
13948 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
13949 (Target_arm::Scan::check_non_pic): Define new method.
13950 (Target_arm::Scan::local): Handle a small subset of reloc types used
13951 by Android.
13952 (Target_arm::Scan::local): Same.
13953 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
13954
b19b0c6d
ILT
139552009-05-31 Mikolaj Zalewski <mikolajz@google.com>
13956
13957 * incremental.cc (Incremental_inputs::report_command_line): Filter
13958 out --incremental-* options.
13959
94cdfcff
DK
139602009-05-29 Doug Kwan <dougkwan@google.com>
13961
13962 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
13963 template class.
13964 (class Target_arm): Update comment.
13965 (Target_arm::Target_arm): Initialize new data members GOT_,
13966 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
13967 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
13968 and Target_arm::rel_dyn_section.
13969 Declare new_enum Target_arm::Got_type.
13970 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
13971 and DYNBSS_.
13972 Update commments for member do_dynsym_value.
13973 (Target_arm::got_size, Target_arm::plt_section,
13974 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
13975 new methods inside class defintion.
13976 (Target_arm::got_section): Define new method.
13977 (Target_arm::rel_dyn_section): Same.
13978 (Output_data_plt_arm): New template class.
13979 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
13980 (Output_data_plt_arm:do_adjust_output_section): Define new method.
13981 (Output_data_plt_arm::add_entry): Same.
13982 (Output_data_plt_arm::first_plt_entry): Define new
13983 static data member for PLT instruction template.
13984 (Output_data_plt_arm::plt_entry): Same.
13985 (Output_data_plt_arm::do_write): Define new method.
13986 (Target_arm::make_plt_entry): Same.
13987 (Target_arm::do_finalize_sections): Same.
13988 (Target_arm::do_dynsym_value): Same.
13989
4a657b0d
DK
139902009-05-28 Doug Kwan <dougkwan@google.com>
13991
13992 * Makefile.am (TARGETSOURCES): Add arm.cc.
13993 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
13994 * Makefile.in: Regenerate.
13995 * arm.cc: New file.
13996 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
13997
e7ae8c36
DK
139982009-05-26 Doug Kwan <dougkwan@google.com>
13999
14000 * options.cc (General_options::parse_exclude_libs). Fix a comment.
14001 (General_options::check_excluded_libs): Strip off directories in
14002 archive name before matching like GNU ld does.
14003 * testsuite/Makefile.am (MOSTLYCLEANFILES,
14004 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
14005 (exclude_libs_test_LDFLAGS): Add linker option
14006 -Wl,--exclude-libs,libexclude_libs_test_3
14007 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
14008 an explicit archive without using -l.
14009 (alt/libexclude_libs_test_3.a): New make rule.
14010 * testsuite/Makefile.in: Regenerate.
14011 * testsuite/exclude_libs_test.c : Declare lib3_default().
14012 (main): Call it.
14013 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
14014 * exclude_libs_test_3.c: New file.
14015
f12e7348
NC
140162009-05-26 Nick Clifton <nickc@redhat.com>
14017
14018 * po/id.po: New Indonesian translation.
14019 * po/gold.pot: Updated template file.
14020
4daadc0d
ST
140212009-05-22 Sriraman Tallam <tmsriram@google.com>
14022
e1df38aa 14023 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
14024 gc_comdat_test files. Add -Wl,--gc-sections to build
14025 gc_comdat_test.
14026 * testsuite/Makefile.in: Regenerate.
14027 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
14028
531813ad
ST
140292009-05-21 Sriraman Tallam <tmsriram@google.com>
14030
14031 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
14032 kept comdat section was garbage collected.
14033 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
14034 * testsuite/Makefile.in: Regenerate.
14035 * testsuite/gc_comdat_test.sh: New file.
14036 * testsuite/gc_comdat_test_1.cc: New file.
14037 * testsuite/gc_comdat_test_2.cc: New file.
14038
65514900
CC
140392009-05-19 Doug Kwan <dougkwan@google.com>
14040
14041 * archive.cc (Archive::Archive): Move constructor from archive.h
14042 to here. Initialize no_export_.
14043 (Archive::get_elf_object_for_member): Set no_export flag of object.
14044 * archive.h (Archive::Archive): Move constructor body to
14045 archive.cc.
14046 (Archive::no_export): New method.
14047 (Archive::no_export_): New field.
14048 * object.h (Object::Object): Initialize no_export_ to false.
14049 (Object::no_export, Object::set_no_export): New methods.
14050 (Object::no_export_): New field.
14051 * options.cc (General_options::parse_exclude_libs): New method.
14052 (General_options::check_excluded_libs) Same.
14053 * options.h (exclude_libs): New option.
14054 (General_options::check_excluded_libs): New method declaration.
14055 (General_options::excluded_libs_): New field.
14056 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
14057 default or protected visibility if an object has no-export flag set.
14058 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
14059 (check_SCRIPTS): Add exclude_libs_test.sh.
14060 (check_DATA): Add exclude_libs_test.syms.
14061 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
14062 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
14063 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
14064 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
14065 (exclude_libs_test.syms, libexclude_libs_test_1.a,
14066 libexclude_libs_test_2.a): New rules.
14067 * testsuite/Makefile.in: Regenerate.
14068 * testsuite/exclude_libs_test.c: New file.
14069 * testsuite/exclude_libs_test.sh: Ditto.
14070 * testsuite/exclude_libs_test_1.c: Ditto.
14071 * testsuite/exclude_libs_test_2.c: Ditto.
14072
1b77ea50
ILT
140732009-05-15 Ian Lance Taylor <iant@google.com>
14074
14075 * configure.ac: Check for declarations for cases where libiberty.h
14076 checks HAVE_DECL_xxx.
14077 * configure, config.in: Rebuild.
14078
072fe7ce
ILT
140792009-05-15 Mikolaj Zalewski <mikolajz@google.com>
14080
14081 * gold.h (Incremental_argument_list): Remove (invalid) forward
14082 declaration.
14083 * incremental.cc (Incremental_inputs::report_achive): New method.
14084 (Incremental_inputs::report_object): New method.
14085 (Incremental_inputs::report_script): New method.
14086 (Incremental_inputs::finalize_inputs): New method.
14087 (Incremental_inputs::finalize): Call finalize_inputs().
14088 (Incremental_inputs::sized_create_incremental_inputs_section_data):
14089 Create inputs entries.
14090 * incremental.h (Incremental_input_type): New enum.
14091 (Incremental_inputs::Incremental_input): Initialize new fields.
14092 (Incremental_inputs::report_inputs): New method.
14093 (Incremental_inputs::report_achive): New method.
14094 (Incremental_inputs::report_object): New method.
14095 (Incremental_inputs::report_script): New method.
14096 (Incremental_inputs::finalize_inputs): New method.
14097 (Incremental_inputs::Input_info): New struct.
14098 (Incremental_inputs::Input_info_map): New typedef.
14099 (Incremental_inputs::lock_): New field.
14100 (Incremental_inputs::Inputs_): New field.
14101 (Incremental_inputs::Inputs_map): New field.
14102 * main.cc (main): Call Incremental_input::report_inputs.
14103 * options.h (Input_argument_list): Typedef moved from
14104 Input_arguments.
14105 (Input_file_group::Files): Remove, use ::Input_argument_list.
14106 (Input_file_group::Input_argument_list): Remove, use
14107 ::Input_argument_list.
14108 * plugin.cc (Plugin_manager::add_input_file): Add error in
14109 incremental build.
14110 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
14111 functions.
14112 * script.cc (read_input_script): Call
14113 Incremental_input::report_script.
14114 * script.h (Script_info): New class.
14115
b0481b0b
ILT
141162009-04-27 Ian Lance Taylor <iant@google.com>
14117
14118 * x86_64.cc (do_adjust_output_section): Set entsize to
14119 plt_entry_size.
14120
b22a5a41 141212009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
14122
14123 * output.cc (Output_file::close): After short writes, continue
14124 writing from the correct offset in the buffer being written.
14125
40fde488
CD
141262009-04-23 Chris Demetriou <cgd@google.com>
14127
14128 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
14129 * configure: Regenerate.
14130 * config.in: Regenerate.
14131 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
14132 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
14133
3ce2c28e
ILT
141342009-04-21 Mikolaj Zalewski <mikolajz@google.com>
14135
14136 * incremental.cc (Incremental_inputs_header_data): Renamed from
14137 Incremental_input_header_data.
14138 (Incremental_inputs_header_data::data_size): New field.
14139 (Incremental_inputs_header_data::put_input_file_count): Renamed
14140 from input_file_count.
14141 (Incremental_inputs_header_data::put_command_line_offset): Renamed
14142 from command_line_offset.
14143 (Incremental_inputs_header_data::put_reserved): Renamed from
14144 put_reserved.
14145 (Incremental_inputs_entry_data): Renamed from
14146 Incremental_input_entry_data.
14147 (Incremental_inputs_entry_data::data_size): New field.
14148 (Incremental_inputs::report_command_line): New method.
14149 (Incremental_inputs::finalize): New method.
14150 (Incremental_inputs::create_incremental_inputs_data): New method.
14151 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
14152 * incremental.h: New file.
14153 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 14154 (Layout::finalize): Create incremental inputs section in
3ce2c28e 14155 incremental builds.
703d02da 14156 (Layout::create_incremental_info_sections): New method.
3ce2c28e 14157 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
14158 (Layout::create_incremental_info_sections): New method.
14159 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
14160 * main.cc (main): Notify Incremental_input of the command line.
14161
e55bde5e
ILT
141622009-04-01 Ian Lance Taylor <iant@google.com>
14163 Mikolaj Zalewski <mikolajz@google.com>
14164
14165 * gold.h (reserve_unordered_map): Define, three versions, one for
14166 each version of Unordered_map.
14167 * layout.cc (Layout::Layout): Remove options parameter. Add
14168 number_of_input_files parameter. Don't initialize options_.
14169 Initialize number_of_input_files_ and resized_signatures_. Move
14170 sections_are_attached_.
14171 (Layout::layout_group): Reserve space for group_signatures_.
14172 (Layout::find_or_add_kept_section): Change name parameter to be a
14173 reference. Resize signatures_ map when it gets large enough.
14174 (Layout::layout_eh_frame): Use parameters->options() instead of
14175 this->options_.
14176 (Layout::make_output_section): Likewise.
14177 (Layout::attach_allocated_section_to_segment): Likewise.
14178 (Layout::finalize, Layout::create_executable_stack): Likewise.
14179 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
14180 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
14181 * layout.h (class Layout): Update declarations. Remove options_
14182 field. Add number_of_input_files_ and resized_signatures_
14183 fields. Move sections_are_attached_ field.
14184 * main.cc (main): Pass number of input files to Layout
14185 constructor. Don't pass options.
14186
154b857c
ILT
141872009-03-30 Ian Lance Taylor <iant@google.com>
14188
14189 * ffsll.c (ffsll): Correct implementation.
14190
2f35ab9b
ILT
141912009-03-27 Ian Lance Taylor <iant@google.com>
14192
fd03461a
ILT
14193 * ffsll.c: New file.
14194 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
14195 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
14196 * ftruncate.c (ftruncate): Declare before definition.
14197 * mremap.c (mremap): Likewise.
14198 * pread.c (pread): Likewise.
14199 * configure, Makefile.in, config.in: Rebuild.
14200
2f35ab9b
ILT
14201 * mremap.c: New file.
14202 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
14203 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
14204 (mremap): Declare if HAVE_MREMAP is not defined.
14205 * configure, Makefile.in, config.in: Rebuild.
14206
33aea2fd
CC
142072009-03-27 Cary Coutant <ccoutant@google.com>
14208
14209 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
14210 position independent.
14211 * sparc.cc (Target_sparc::check_non_pic): Likewise.
14212 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
14213
6d479619
CC
142142009-03-24 Cary Coutant <ccoutant@google.com>
14215
14216 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
14217 an executable.
14218 (needs_dynamic_reloc): Likewise.
14219
afc06bb8
ILT
142202009-03-24 Ian Lance Taylor <iant@google.com>
14221
14222 * yyscript.y (file_cmd): Recognize EXTERN.
14223 (extern_name_list, extern_name_list_body): New nonterminals.
14224 * script.cc (script_add_extern): Define.
14225 * script-c.h (script_add_extern): Declare.
14226
f6060a4d
ILT
142272009-03-24 Rafael Avila de Espindola <espindola@google.com>
14228
14229 * object.cc (is_elf_object): Define.
14230 * object.h (is_elf_object): Declare.
14231 * archive.cc (Archive::get_elf_object_for_member): Call
14232 is_elf_object.
33aea2fd 14233 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 14234
26736d8e
ILT
142352009-03-24 Elliott Hughes <enh@google.com>
14236
14237 * output.cc (Output_file::map_anonymous): Define.
14238 (Output_file::map): Use map_anonymous. If the regular mmap fails,
14239 try an anonymous one. Report the size if the mmap fails.
14240 * output.h (class Output_file): Declare map_anonymous.
14241
22fd9730
ILT
142422009-03-24 Ian Lance Taylor <iant@google.com>
14243
14244 * target-select.cc (instantiate_target): Don't acquire the lock if
14245 the instantiated_target_ field has already been set.
14246
cb010894
ILT
142472009-03-23 Ian Lance Taylor <iant@google.com>
14248
7f055c20
ILT
14249 * gold-threads.h (class Initialize_lock): Define.
14250 * gold-threads.cc (class Initialize_lock_once): Define.
14251 (initialize_lock_control): New static variable.
14252 (initialize_lock_pointer): New static variable.
14253 (initialize_lock_once): New static function.
14254 (Initialize_lock::Initialize_lock): Define.
14255 (Initialize_lock::initialize): Define.
14256 * target-select.h: Include "gold-threads.h".
14257 (class Target_selector): Add lock_ and initialize_lock_ fields.
14258 Don't define instantiate_target, just declare it.
14259 * target-select.cc (Target_selector::Target_selector): Initialize
14260 new fields.
14261 (Target_selector::instantiate_target): Define.
14262 * descriptors.h: Include "gold-threads.h".
14263 (class Descriptors): Add initialize_lock_ field.
14264 * descriptors.cc (Descriptors::Descriptors): Initialize new
14265 field.
14266 (Descriptors::open): Use initialize_lock_ field
14267 * errors.h (class Errors): Add initialize_lock_ field.
14268 * errors.cc (Errors::Errors): Initialize new field.
14269 (Errors::initialize_lock): Use initialize_lock_ field.
14270 * powerpc.cc (class Target_selector_powerpc): Remove
14271 instantiated_target_ field. In do_recognize call
14272 instantiate_target rather than do_instantiate_target. In
14273 do_instantiate_target just allocate a new target.
14274 * sparc.cc (class Target_selector_sparc): Likewise.
14275
36959681
ILT
14276 * freebsd.h: New file.
14277 * i386.cc: Include "freebsd.h".
14278 (Target_i386): Derive from Target_freebsd rather than
14279 Sized_target.
14280 (Target_selector_i386): Derive from Target_selector_freebsd rather
14281 than Target_selector.
14282 * x86_64.cc: Include "freebsd.h".
14283 (Target_x86_64): Derive from Target_freebsd rather than
14284 Sized_target.
14285 (Target_selector_x86_64): Derive from Target_selector_freebsd
14286 rather than Target_selector.
14287 * target.h (class Target): Add adjust_elf_header and
14288 do_adjust_elf_header.
14289 * output.cc (Output_file_header:: do_sized_write): Call target
14290 adjust_elf_header routine.
14291 * configure.tgt: Set targ_osabi.
14292 * configure.ac: Define GOLD_DEFAULT_OSABI.
14293 * parameters.cc (Parameters::default_target): Pass
14294 GOLD_DEFAULT_OSABI to select_target.
14295 * target-select.h (class Target_selector): Make instantiate_target
14296 protected rather than private.
14297 * Makefile.am (HFILES): Add freebsd.h.
14298 * configure, Makefile.in, config.in: Rebuild.
14299
cb010894
ILT
14300 * merge.cc (do_add_input_section): Correct pend value. Change
14301 message about last entry not being null terminated from error to
14302 warning.
14303
0e879927
ILT
143042009-03-20 Mikolaj Zalewski <mikolajz@google.com>
14305
14306 * incremental.cc: New file.
14307 * Makefile.am (CCFILES): Add incremental.cc.
14308 * Makefile.in: Rebuild.
14309
41105937
PP
143102009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
14311
14312 * layout.cc (Layout::output_section_name): Preserve names
14313 of '.note.' sections.
e1df38aa 14314
60439920
ILT
143152009-03-19 Ian Lance Taylor <iant@google.com>
14316
14317 * descriptors.cc (Descriptors::open): Check that the options are
14318 valid before using them.
14319
0d371ad3
ILT
143202009-03-18 Ian Lance Taylor <iant@google.com>
14321
14322 * script-sections.h: Include <list>.
14323 (class Script_sections): Change Sections_elements from std::vector
14324 to std::list. Typedef public Elements_iterator. Add
14325 orphan_section_placement_, data_segment_align_start_, and
14326 saw_data_segment_align_ fields. Remove data_segment_align_index_
14327 field.
14328 * script-sections.cc (class Orphan_section_placement): New class.
14329 (class Sections_element): Add virtual functions is_relro and
14330 orphan_section_init. Remove virtual function place_orphan_here.
14331 (class Output_section_definition): Add is_relro and
14332 orphan_section_init. Remove place_orphan_here.
14333 (class Orphan_output_section): Likewise.
14334 (Script_sections::Script_sections): Update for field changes.
14335 (Script_sections::data_segment_align): Set saw_data_segment_align_
14336 and data_segment_align_start_, not data_segment_align_index.
14337 (Script_sections::data_segment_relro_end): Check
14338 saw_data_segment_align_. Use data_segment_align_start_ rather
14339 than data_segment_align_index_.
14340 (Script_sections::place_orphan): Rewrite to use
14341 Orphan_section_placement.
14342
9201d894
ILT
143432009-03-17 Ian Lance Taylor <iant@google.com>
14344
9c5b8369
ILT
14345 * archive.cc (Archive::add_symbols): Check for a version attached
14346 to the symbol name in the archive map.
14347 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
14348 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
14349 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
14350 (ver_test_11.a): New target.
14351 * testsuite/Makefile.in: Rebuild.
14352
9201d894
ILT
14353 * configure.ac: Check for chsize and posix_fallocate. Replace
14354 ftruncate.
14355 * ftruncate.c: New file, from gnulib.
14356 * output.cc (posix_fallocate): Define dummy version if not
14357 HAVE_POSIX_FALLOCATE.
14358 (Output_file::map): Call posix_fallocate rather than lseek and
14359 write.
14360 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
14361 * configure, Makefile.in, config.in: Rebuild.
14362
ef4ab7a8 143632009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 14364
ef4ab7a8
PP
14365 * layout.h (Layout::create_note): Add section_name parameter.
14366 * layout.cc (Layout::create_note): Likewise.
14367 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 14368
8c500701
ILT
143692009-03-17 Ian Lance Taylor <iant@google.com>
14370
e85b18e1
ILT
14371 * descriptors.cc: Include "options.h".
14372 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
14373 (Descriptors::open): Always use O_CLOEXEC when opening a new
14374 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
14375 then set FD_CLOEXEC.
14376
9efe6174
ILT
14377 * sparc.cc (class Target_sparc): Add has_got_section.
14378 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
14379 make sure we have a GOT section.
14380
14381 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
14382 (Target_sparc::Scan::local): Likewise.
14383 (Target_sparc::Scan::global): Likewise.
14384 (Target_sparc::Relocate::relocate): Likewise.
14385 (Target_sparc::Relocate::relocate_tls): Likewise.
14386
8c500701
ILT
14387 * symtab.cc (Symbol_table::define_default_version): New function,
14388 broken out of add_from_object.
14389 (Symbol_table::add_from_object): Call define_default_version.
14390 (Symbol_table::define_special_symbol): Add resolve_oldsym
14391 parameter. Change all callers. If the version for a symbol comes
14392 from a version script, resolve it with the symbol with the same
14393 name with no version. Also add the symbol without a version if
14394 appropriate.
14395 (do_define_in_output_data): If resolving with oldsym, don't delete
14396 sym.
14397 (do_define_in_output_segment): Likewise.
14398 (do_define_as_constant): Likewise.
14399 * symtab.h (class Symbol_table): Update declarations.
14400
f1ed28fb
ILT
144012009-03-13 Ian Lance Taylor <iant@google.com>
14402
15f8229b
ILT
14403 * readsyms.cc (Read_symbols::incompatible_warning): New function.
14404 (Read_symbols::requeue): New function.
14405 (Read_symbols::do_read_symbols): If make_elf_object fails because
14406 the target type is not configured, and the file was searched for,
14407 issue a warning and retry with the next directory.
14408 (Add_symbols::run): If the file has an incompatible format, and
14409 it was searched for, requeue the Read_symbols task. On error,
14410 release the object.
14411 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
14412 dirindex parameter to constructor. Change all callers. Declare
14413 incompatible_warning and requeue.
14414 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
14415 input_argument_ and input_group_ fields. Add them to
14416 constructor. Change all callers.
14417 (class Read_script): Add dirindex_ field. Add it to constructor.
14418 Change all callers.
14419 * archive.cc (Archive::setup): Remove input_objects parameter.
14420 Change all callers.
14421 (Archive::get_file_and_offset): Likewise.
14422 (Archive::read_all_symbols): Likewise.
14423 (Archive::read_symbols): Likewise.
14424 (Archive::get_elf_object_for_member): Remove input_objects
14425 parameter. Add punconfigured parameter. Change all callers.
14426 (Archive::add_symbols): Change return type to bool. Check return
14427 value of include_member.
14428 (Archive::include_all_members): Likewise.
14429 (Archive::include_member): Change return type to bool. Return
14430 false if first included object has incompatible target. Set
14431 included_member_ field.
14432 (Add_archive_symbols::run): If add_symbols returns false, requeue
14433 Read_symbols task.
14434 * archive.h (class Archive): Add included_member_ field.
14435 Initialize it in constructor. Add input_file and searched_for
14436 methods. Update declarations.
14437 (class Add_archive_symbols): Add dirpath_, dirindex_, and
14438 input_argument_ fields. Add them to constructor. Change all
14439 callers.
14440 * script.cc: Include "target-select.h".
14441 (class Parser_closure): Add skip_on_incompatible_target_ and
14442 found_incompatible_target_ fields. Add
14443 skip_on_incompatible_target parameter to constructor. Change all
14444 callers. Add methods skip_on_incompatible_target,
14445 clear_skip_on_incompatible_target, found_incompatible_target, and
14446 set_found_incompatible_target.
14447 (read_input_script): Add dirindex parameter. Change all callers.
14448 If parser finds an incompatible target, requeue Read_symbols
14449 task.
14450 (script_set_symbol): Clear skip_on_incompatible_target in
14451 closure.
14452 (script_add_assertion, script_parse_option): Likewise.
14453 (script_start_sections, script_add_phdr): Likewise.
14454 (script_check_output_format): New function.
14455 * script.h (read_input_script): Update declaration.
14456 * script-c.h (script_check_output_format): Declare.
14457 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
14458 (ignore_cmd): Remove OUTPUT_FORMAT.
14459 * fileread.cc (Input_file::Input_file): Add explicit this.
14460 (Input_file::will_search_for): New function.
14461 (Input_file::open): Add pindex parameter. Change all callers.
14462 * fileread.h (class Input_file): Add input_file_argument method.
14463 Declare will_search_for. Update declarations.
14464 * object.cc (make_elf_object): Add punconfigured parameter.
14465 Change all callers.
14466 * object.h (class Object): Make input_file public. Add
14467 searched_for method.
14468 (make_elf_object): Update declaration.
14469 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
14470 restart search.
14471 * dirsearch.h (class Dirsearch): Update declaration.
14472 * options.h (class General_options): Add --warn-search-mismatch.
14473 * parameters.cc (Parameters::is_compatible_target): New function.
14474 * parameters.h (class Parameters): Declare is_compatible_target.
14475 * workqueue.cc (Workqueue::add_blocker): New function.
14476 * workqueue.h (class Workqueue): Declare add_blocker.
14477
f1ed28fb
ILT
14478 * fileread.cc (Input_file::open): Remove options parameter.
14479 Change all callers.
14480 (Input_file::open_binary): Likewise.
14481 * script.cc (read_input_script): Likewise.
14482 * readsyms.h (class Read_symbols): Remove options_ field. Remove
14483 options parameter from constructor. Change all callers.
14484 (class Read_script): Likewise.
14485 * fileread.h (class Input_file): Update declarations.
14486 * script.h (read_input_script): Update declaration.
14487
34dd024a
NC
144882009-03-10 Nick Clifton <nickc@redhat.com>
14489
14490 * po/es.po: New Spanish translation.
14491
6d71b17c
CC
144922009-03-06 Cary Coutant <ccoutant@google.com>
14493
14494 * options.cc (parse_short_option): Keep dash_z from registering itself.
14495
031cdbed
ILT
144962009-03-03 Ian Lance Taylor <iant@google.com>
14497
14498 PR 9918
14499 * target-reloc.h (relocate_section): Pass output_section to
14500 relocate.
14501 * i386.cc (Target_i386::should_apply_static_reloc): Add
14502 output_section parameter. Change all callers.
14503 (Target_i386::Relocate::relocate): Add output_section parameter.
14504 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14505 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
14506 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
14507 * testsuite/two_file_shared.sh: New script.
14508 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
14509 (check_DATA): Add two_file_shared.dbg.
14510 (two_file_shared.dbg): New target.
14511 * testsuite/Makefile.in: Rebuild.
14512
15d5fa16
ILT
145132009-03-01 Ian Lance Taylor <iant@google.com>
14514
14515 * configure.ac: Check for byteswap.h.
14516 * configure: Rebuild.
14517 * config.in: Rebuild.
14518
8a4c0b0d
ILT
145192009-03-01 Mikolaj Zalewski <mikolajz@google.com>
14520
14521 * layout.cc (Layout::find_or_add_kept_section): New function.
14522 (Layout::add_comdat): Removed.
14523 * layout.h (struct Kept_section): Move out of class Layout.
14524 Remove trailing underscores from field names. Add group_sections
14525 field. Rename group_ field to is_group. Change all uses.
14526 (class Layout): Declare find_or_add_kept_section, not add_comdat.
14527 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
14528 comdat_groups_ field.
14529 (Sized_relobj::include_section_group): Use
14530 find_or_add_kept_section and Kept_section::group_sections.
14531 (Sized_relobj::include_linkonce_section): Likewise.
14532 * object.cc (class Sized_relobj): Don't define Comdat_group or
14533 Comdat_group_table. Remove find_comdat_group and
14534 add_comdat_group. Remove comdat_groups_ field.
14535 * plugin.cc (include_comdat_group): Use
14536 Layout::find_or_add_kept_section.
14537
b4ecf66b
ILT
145382009-02-28 Ian Lance Taylor <iant@google.com>
14539
14359ca0
ILT
14540 * README: --gc-sections and map files are now supported. Document
14541 some build requirements.
14542
b4ecf66b
ILT
14543 PR 6992
14544 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
14545 relocatable link set the value of the section symbol to zero.
14546 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
14547 relocatable link don't include the section address in the local
14548 symbol value.
14549
0602e05a
ILT
145502009-02-27 Ian Lance Taylor <iant@google.com>
14551
fd9d194f
ILT
14552 PR 6811
14553 * options.h (class Search_directory): Add is_system_directory.
14554 (class General_options): Declare is_in_system_directory.
14555 * options.cc (get_relative_sysroot): Make static.
14556 (get_default_sysroot): Make static.
14557 (General_optoins::is_in_system_directory): New function.
14558 * fileread.cc (Input_file::is_in_system_directory): New function.
14559 * fileread.h (class Input_file): Declare is_in_system_directory.
14560 * object.h (class Object): Add is_in_system_directory.
14561 (class Input_objects): Remove system_library_directory_ field.
14562 * object.cc (Input_objects::add_object): Don't set
14563 system_library_directory_.
14564 (input_objects::found_in_system_library_directory): Remove.
14565 * symtab.cc (Symbol_table::write_globals): Remove input_objects
14566 parameter. Change all callers.
14567 (Symbol_table::sized_write_globals): Likewise.
14568 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
14569 Call Object::is_in_system_directory.
14570 * symtab.h (class Symbol_table): Update declarations.
14571
61edd21f
ILT
14572 PR 5990
14573 * descriptors.h (Open_descriptor): Add is_on_stack field.
14574 * descriptors.cc (Descriptors::open): If the descriptor is on the
14575 top of the stack, remove it. Initialize is_on_stack field.
14576 (Descriptors::release): Only add pod to stack if it is not on the
14577 stack already.
14578 (Descriptors::close_some_descriptor): Clear stack_next and
14579 is_on_stack fields.
14580
e29e076a
ILT
14581 PR 7091
14582 * output.cc (Output_section::find_starting_output_address): Rename
14583 from starting_output_address; add PADDR parameter; change return
14584 type.
14585 * output.h (class Output_section): Declare
14586 find_starting_output_address instead of starting_output_address.
14587 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
14588 section symbol for which we can't find a merge section.
14589
0602e05a
ILT
14590 PR 9836
14591 * symtab.cc (Symbol_table::add_from_object): If the visibility is
14592 hidden or internal, force the symbol to be local.
14593 * resolve.cc (Symbol::override_visibility): Define.
14594 (Symbol::override_base): Use override_visibility.
14595 (Symbol_table::resolve): Likewise.
14596 (Symbol::override_base_with_special): Likewise.
14597 (Symbol_table::override_with_special): If the visibility is hidden
14598 or internal, force the symbol to be local.
14599 * symtab.h (class Symbol): Add set_visibility and
14600 override_visibility.
14601 * testsuite/ver_test_1.sh: New file.
14602 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
14603 (check_DATA): Add ver_test_1.syms.
14604 (ver_test_1.syms): New target.
14605 * testsuite/Makefile.in: Rebuild.
14606
401a9a73
CC
146072009-02-25 Cary Coutant <ccoutant@google.com>
14608
14609 * layout.cc (Layout::choose_output_section): Don't rename sections
14610 when using a linker script that has a SECTIONS clause.
14611 * Makefile.in: Regenerate.
14612
14613 * testsuite/Makefile.am (script_test_5.sh): New test case.
14614 * testsuite/Makefile.in: Regenerate.
14615 * testsuite/script_test_5.cc: New file.
14616 * testsuite/script_test_5.sh: New file.
14617 * testsuite/script_test_5.t: New file.
14618
f488e4b0
CC
146192009-02-13 Rafael Avila de Espindola <espindola@google.com>
14620
14621 * archive.cc (Archive::include_member): Update calls to add_symbols.
14622 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
14623 the Layout argument.
14624 * dynobj.h (do_add_symbols): Add the Layout argument.
14625 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
14626 Layout argument.
14627 * object.h (Object::add_symbols): Add the Layout argument.
14628 (Object::do_add_symbols): Add the Layout argument.
14629 (Sized_relobj::do_add_symbols): Add the Layout argument.
14630 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
14631 Unify the two versions.
14632 (Add_plugin_symbols): Remove.
14633 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
14634 (Sized_pluginobj::do_add_symbols): Unify the two versions.
14635 (Add_plugin_symbols): Remove.
14636 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
14637 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
14638 (Add_symbols::run): Make it work with Pulginobj.
14639
89dd1680
ILT
146402009-02-06 Ian Lance Taylor <iant@google.com>
14641
14642 * object.cc (Sized_relobj::do_layout): Make info message start
14643 with lower case letter.
14644
266d0a74
ILT
146452009-02-06 Mikolaj Zalewski <mikolajz@google.com>
14646
602b464e
ILT
14647 * binary.cc: Fix file comment.
14648
266d0a74
ILT
14649 * options.h (enum Incremental_disposition): Define.
14650 (class General_options): Add new options: --incremental,
14651 --incremental_changed, --incremental_unchanged,
14652 --incremental_unknown. Add incremental_disposition_ and
14653 implicit_incremental_ fields.
14654 (General_options::incremental_disposition): New function.
14655 (class Position_dependent_options): Add incremental_disposition
14656 option.
14657 (Position_dependent_options::copy_from_options): Set incremental
14658 dispositions.
14659 * options.cc (General_options::parse_incremental_changed): New
14660 function.
2e702c99
RM
14661 (General_options::parse_incremental_unchanged): New function.
14662 (General_options::parse_incremental_unknown): New function.
14663 (General_options::General_options): Initialize new fields
266d0a74 14664 incremental_disposition_ and implicit_incremental_.
2e702c99 14665 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
14666 without --incremental.
14667
f073bbf7
CD
146682009-02-06 Chris Demetriou <cgd@google.com>
14669
14670 * gold.h (gold_undefined_symbol): Change to take only a Symbol
14671 pointer and to report location as the file name associated with
14672 the symbol.
14673 (gold_undefined_symbol_at_location): New function to replace the
14674 old gold_undefined_symbol functionality.
14675 * target-reloc.h (relocate_section): Update to use
14676 gold_undefined_symbol_at_location.
14677 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14678 Call gold_undefined_symbol function rather than gold_error.
14679 * errors.h (Errors::undefined_symbol): Take location as a
14680 string, rather than calculating it from a relocation.
14681 * errors.cc (Errors::fatal): Print "fatal error:" before the
14682 formatted message.
14683 (Errors::error, Errors::error_at_location): Print "error: "
14684 before the formatted message.
14685 (Errors::undefined_symbol): Take location as a string, rather
14686 than calculating it from a relocation.
14687 (gold_undefined_symbol_at_location): New function akin to
14688 old gold_undefined_symbol, calculates location from relocation.
14689 (gold_undefined_symbol): Change to take only a Symbol pointer
14690 and to report location as the file name associated with the symbol.
14691 * testsuite/debug_msg.sh: Update for changed error messages.
14692 * testsuite/undef_symbol.sh: Likewise.
14693
8e94a90c
ILT
146942009-02-04 Duncan Sands <baldrick@free.fr>
14695
14696 PR 9812
14697 * reduced_debug_output.h
14698 (Output_reduced_debug_abbrev_section::failed): Use format for
14699 gold_warning.
14700 (Output_reduced_debug_info_section::faild): Likewise.
14701
88a0e15b
ILT
147022009-01-31 Mikolaj Zalewski <mikolajz@google.com>
14703
14704 * script.cc (Lazy_demangler): New class.
2e702c99 14705 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
14706 symbol only once.
14707
5efc7cd2
CC
147082009-01-29 Cary Coutant <ccoutant@google.com>
14709
14710 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
14711 to __tls_get_addr.
14712 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14713
e0ebcf42
ILT
147142009-01-28 Ian Lance Taylor <iant@google.com>
14715
5efc7cd2 14716 * version.cc (version_string): Bump to 1.9.
75fe7426 14717
e0ebcf42
ILT
14718 * gold.h: Include <cstring> and <stdint.h>.
14719 * version.cc: Include <cstdio>.
14720 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
14721 warning.
14722 * reduced_debug_output.cc (insert_into_vector): Rename from
14723 Insert_into_vector; change all callers. Use Swap_unaligned to
14724 avoid aliasing issue; remove union since it is unnecessary.
14725
8e2813be 147262009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
14727
14728 * Makefile.am (CCFILES): Add gc.cc.
14729 (HFILES): Add gc.h.
14730 * Makefile.in: Regenerate.
14731 * gold.cc (Gc_runner): New class.
14732 (queue_initial_tasks): Call garbage collection related tasks
14733 when corresponding options are invoked.
14734 (queue_middle_gc_tasks): New function.
14735 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
14736 processed early before laying out sections during garbage collection.
14737 * gold.h (queue_middle_gc_tasks): New function.
14738 (is_prefix_of): Move from "layout.cc".
14739 * i386.cc (Target_i386::gc_process_relocs): New function.
14740 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
14741 * main.cc (main): Create object of class "Garbage_collection".
14742 * object.cc (Relobj::copy_symbols_data): New function.
14743 (Relobj::is_section_name_included): New function.
e1df38aa
NC
14744 (Sized_relobj::do_layout): Allow this function to be called twice
14745 during garbage collection and defer layout of section during the
6d03d481
ST
14746 first call.
14747 * object.h (Relobj::get_symbols_data): New function.
14748 (Relobj::is_section_name_included): New function.
14749 (Relobj::copy_symbols_data): New function.
14750 (Relobj::set_symbols_data): New function.
14751 (Relobj::get_relocs_data): New function.
14752 (Relobj::set_relocs_data): New function.
14753 (Relobj::is_output_section_offset_invalid): New pure virtual function.
14754 (Relobj::gc_process_relocs): New function.
14755 (Relobj::do_gc_process_relocs): New pure virtual function.
14756 (Relobj::sd_): New data member.
14757 (Sized_relobj::is_output_section_offset_invalid): New function.
14758 (Sized_relobj::do_gc_process_relocs): New function.
14759 * options.h (General_options::gc_sections): Modify to not be a no-op.
14760 (General_options::print_gc_sections): New option.
14761 * plugin.cc (Plugin_finish::run): Remove function call to
14762 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
14763 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
14764 * reloc.cc (Read_relocs::run): Add task to process relocs and
14765 determine unreferenced sections when doing garbage collection.
14766 (Gc_process_relocs): New class.
14767 (Sized_relobj::do_gc_process_relocs): New function.
14768 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
14769 sections that are garbage collected.
14770 * reloc.h (Gc_process_relocs): New class.
14771 * sparc.cc (Target_sparc::gc_process_relocs): New function.
14772 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
14773 symbols whose corresponding sections are garbage collected.
14774 (Symbol_table::Symbol_table): Add new parameter for the garbage
14775 collection object.
14776 (Symbol_table::gc_mark_undef_symbols): New function.
14777 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14778 (Symbol_table::gc_mark_dyn_syms): New function.
14779 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
14780 as garbage.
14781 (Symbol_table::add_from_object): Likewise.
14782 (Symbol_table::add_from_relobj): When building shared objects, do not
14783 treat externally visible symbols as garbage.
14784 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
14785 table information for static and relocatable links.
14786 * symtab.h (Symbol_table::set_gc): New function.
14787 (Symbol_table::gc): New function.
14788 (Symbol_table::gc_mark_undef_symbols): New function.
14789 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14790 (Symbol_table::gc_mark_dyn_syms): New function.
14791 (Symbol_table::gc_): New data member.
e1df38aa 14792 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
14793 function.
14794 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
14795 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
14796
3b293544
CF
147972009-01-20 Chris Faylor <me.sourceware@sourceware.org>
14798
14799 * options.h (General_options::gc_sections): Define as a no-op for now.
14800 (General_options::no_keep_memory): Ditto.
14801 (General_options::Bshareable): Define.
14802 * options.cc (General_options::finalize): Honor -Bshareable.
14803
83d22aa8
AS
148042009-01-20 Andreas Schwab <schwab@suse.de>
14805
14806 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
14807 read the value in the contents, since we don't use it. Use the
14808 template endianness when writing.
14809 (Relocate::relocate): Use it for R_PPC_REL16_HA.
14810
cd536b21
AS
148112009-01-19 Andreas Schwab <schwab@suse.de>
14812
14813 * configure.tgt (powerpc64-*): Fix targ_obj.
14814
99e9a495
ILT
148152009-01-15 Ian Lance Taylor <iant@google.com>
14816
14817 * object.cc (Sized_relobj::write_local_symbols): Don't write out
14818 local symbols when stripping all symbols.
14819
bbbfea06
CC
148202009-01-14 Cary Coutant <ccoutant@google.com>
14821
99e9a495 14822 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 14823
0f7c0701
CC
148242009-01-14 Cary Coutant <ccoutant@google.com>
14825
14826 * archive.cc (Archive::get_elf_object_for_member): Remove call
14827 to File_read::claim_for_plugin.
14828 * descriptors.cc (Descriptors::open): Remove reference to
14829 is_claimed.
14830 (Descriptors::claim_for_plugin): Remove.
14831 * descriptors.h (Descriptors::claim_for_plugin): Remove.
14832 (Descriptors::is_claimed): Remove.
14833 (claim_descriptor_for_plugin): Remove.
14834 * fileread.cc (File_read::claim_for_plugin): Remove.
14835 * fileread.h (File_read::claim_for_plugin): Remove.
14836 (File_read::descriptor): Reopen descriptor if necessary.
14837 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
14838 (Plugin_manager::all_symbols_read): Add task parameter. Change
14839 all callers.
14840 (Plugin_manager::get_input_file): New function.
14841 (Plugin_manager::release_input_file): New function.
14842 (Pluginobj::Pluginobj): Add filesize parameter and initialize
14843 corresponding data member.
14844 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
14845 and pass to base constructor. Change all callers.
14846 (get_input_file, release_input_file): New functions.
14847 (make_sized_plugin_object): Add filesize parameter. Change all callers.
14848 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
14849 (Plugin_manager::all_symbols_read): Add task parameter.
14850 (Plugin_manager::get_input_file): New function.
14851 (Plugin_manager::release_input_file): New function.
14852 (Plugin_manager::task_): New data member.
14853 (Pluginobj::Pluginobj): Add filesize parameter.
14854 (Pluginobj::filename): New function.
14855 (Pluginobj::descriptor): New function.
14856 (Pluginobj::filesize): New function.
14857 (Pluginobj::filesize_): New data member.
14858 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
14859 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
14860 File_read::claim_for_plugin; use Object::unlock to unlock the file.
14861
14862 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
14863 with archive libraries.
14864 * testsuite/Makefile.in: Regenerate.
14865 * testsuite/plugin_test.c (struct sym_info): New type.
14866 (get_input_file, release_input_file): New static variables.
14867 (onload): Capture new transfer vector entries.
14868 (claim_file_hook): Stop reading at end of file according to filesize.
14869 Factor out parsing of readelf output into separate function.
14870 (all_symbols_read_hook): Exercise get_input_file and release_input_file
14871 APIs and get the source file name from the symbol table. Convert
14872 source file name to corresponding object file name. Print info
14873 message when adding new input files.
14874 (parse_readelf_line): New function.
14875 * testsuite/plugin_test_1.sh: Add checks for new info messages.
14876 * testsuite/plugin_test_2.sh: Likewise.
14877 * testsuite/plugin_test_3.sh: Likewise.
14878 * testsuite/plugin_test_4.sh: New test case.
14879
62a6d109
ILT
148802009-01-07 Ian Lance Taylor <iant@google.com>
14881
14882 * version.cc (version_string): Bump to 1.8.
14883
483620e8
CC
148842008-12-23 Cary Coutant <ccoutant@google.com>
14885
14886 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
14887 * plugin.cc (Plugin_manager::finish): Rename as
14888 layout_deferred_objects. Move cleanup to separate function.
14889 (Plugin_manager::cleanup): New function.
14890 (Plugin_finish::run): Call layout_deferred_objects and cleanup
14891 separately.
14892 * plugin.h (Plugin_manager::finish): Rename as
14893 layout_deferred_objects.
14894 (Plugin_manager::cleanup): New function.
14895 (Plugin_manager::cleanup_done): New field.
14896
d66a9eb3
CC
148972008-12-23 Cary Coutant <ccoutant@google.com>
14898
14899 * plugin.cc (is_visible_from_outside): New function.
14900 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
14901 so we don't return "IR only" status for exported symbols or -r links.
14902
14903 * testsuite/Makefile.am (plugin_test_3): New test case.
14904 * testsuite/Makefile.in: Regenerate.
14905 * testsuite/plugin_test_3.sh: New file.
14906
5995b570
CC
149072008-12-22 Cary Coutant <ccoutant@google.com>
14908
14909 * object.cc (Sized_relobj::layout_section): New function.
14910 (Sized_relobj::do_layout): Defer layout of input sections until after
14911 plugin has provided replacement files.
14912 (Sized_relobj::do_layout_deferred_sections): New function.
14913 * object.h (Relobj::set_section_offset): Remove virtual keyword.
14914 (Relobj::layout_deferred_sections): New function.
14915 (Relobj::do_layout_deferred_sections): New function.
14916 (Sized_relobj::do_layout_deferred_sections): New function.
14917 (Sized_relobj::layout_section): New function.
14918 (Sized_relobj::Deferred_layout): New structure.
14919 (Sized_relobj::deferred_layout_): New field.
14920 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
14921 Change all callers. Layout deferred sections.
14922 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
14923 references.
14924 (Plugin_hook::run): Move code from do_plugin_hook inline.
14925 (Plugin_hook::do_plugin_hook): Remove.
14926 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
14927 (Plugin_manager::finish): Renamed, was cleanup.
14928 (Plugin_manager::should_defer_layout): New function.
14929 (Plugin_manager::add_deferred_layout_object): New function.
14930 (Plugin_manager::Deferred_layout_list): New type.
14931 (Plugin_manager::deferred_layout_objects_): New field.
14932 (Plugin_hook::do_plugin_hook): Remove.
14933
ee769c88
ILT
149342008-12-17 Ian Lance Taylor <iant@google.com>
14935
14936 * options.h (class General_options): Add --no case for
14937 --export-dynamic.
14938
abc8dcba
CC
149392008-12-16 Cary Coutant <ccoutant@google.com>
14940
14941 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
14942 vector.
14943 (Plugin_manager::claim_file): Create plugin object even if
14944 plugin did not call the add_symbols callback.
14945 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
14946 asking for more symbols than were added.
14947 * testsuite/Makefile.am (plugin_test_1): Add test case with
14948 no global symbols.
14949 (empty.syms): New target.
14950 * testsuite/Makefile.in: Regenerate.
14951 * testsuite/plugin_test.c (claim_file_hook): Add new debug
14952 message. Don't call add_symbols if no globals.
14953 (all_symbols_read_hook): Don't provide replacement for empty
14954 claimed file.
14955
b0074644
ILT
149562008-12-12 Ian Lance Taylor <iant@google.com>
14957
68943102
ILT
14958 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
14959 r_type == 0 for a local symbol with r_sym == 0.
14960 (scan_relocatable_relocs): Pass r_sym to
14961 local_non_section_strategy.
14962 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
14963 r_sym parameter.
14964
b0074644
ILT
14965 * configure.ac: Update test for TLS descriptors: they are
14966 supported as of glibc 2.9.
14967 * configure: Rebuild.
14968
c2508178
ILT
149692008-12-11 Ian Lance Taylor <iant@google.com>
14970
14971 PR 7091
14972 * target-reloc.h (Default_scan_relocatable_relocs): For each
14973 function, map r_type == 0 to RELOC_DISCARD.
14974
2756a258
CC
149752008-12-10 Cary Coutant <ccoutant@google.com>
14976
14977 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
14978 object to override a kept COMDAT group from a plugin object.
14979
bb6f53d3
ILT
149802008-12-09 Ian Lance Taylor <iant@google.com>
14981
fbc558e1
ILT
14982 PR 7088
14983 * yyscript.y (file_cmd): Handle INPUT.
14984
bb6f53d3
ILT
14985 * testsuite/initpri1.c: Change all declarations to be full
14986 prototypes by adding void, to avoid compiler warnings.
14987
4674ecfc
CC
149882008-12-05 Rafael Avila de Espindola <espindola@google.com>
14989
14990 * options.cc (General_options::parse_plugin_opt): New.
14991 (General_options::add_plugin): The argument now is just the filename.
14992 (General_options::add_plugin_option): New.
14993 * options.h (plugin_opt): New.
14994 (add_plugin): Change argument name.
14995 (add_plugin_option): New.
14996 * plugin.cc (Plugin::load): Don't parse the plugin option.
14997 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
14998 (Plugin::add_option): New.
14999 (Plugin::args_): Change type.
15000 (Plugin::filename_): New.
15001 (Plugin_manager::add_plugin_option): New.
15002 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
15003 * testsuite/Makefile.in: Regenerate.
15004
fd06b4aa
CC
150052008-12-05 Cary Coutant <ccoutant@google.com>
15006
15007 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
15008 Handle --strip-lto-sections option.
15009 * options.h (strip_lto_sections): New option.
15010
6c52134c
CC
150112008-12-01 Cary Coutant <ccoutant@google.com>
15012
15013 * plugin.cc (ld_plugin_message): Change format parameter to const.
15014 Fix mismatch between new[] and delete.
15015
a45248e0
CC
150162008-11-14 Cary Coutant <ccoutant@google.com>
15017
15018 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
15019 instead of -1U.
15020
c82fbeee
CS
150212008-11-05 Craig Silverstein <csilvers@google.com>
15022
15023 * options.cc (General_options::parse_dynamic_list): New function.
15024 * options.h (General_options): New flags dynamic_list,
15025 dynamic_list_data, dynamic_list_cpp_new, and
15026 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
15027 (General_options::in_dynamic_list): New function.
15028 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
15029 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
15030 (Lex::can_continue_name): Likewise.
15031 (yylex): Likewise.
15032 (read_script_file): New parameter script_options.
15033 (read_dynamic_list): New function.
15034 (Script_options::define_dynamic_list): New function.
15035 (dynamic_list_keyword_parsecodes): New variable.
15036 (dynamic_list_keywords): New variable.
15037 * script.h (Script_options::define_dynamic_list): New function
15038 prototype.
15039 (read_dynamic_list): New function prototype.
15040 * symtab.cc (strprefix): New macro.
15041 (Symbol::should_add_dynsym_entry): Support dynamic_list,
15042 dynamic_list_data, dynamic_list_cpp_new, and
15043 dynamic_list_cpp_typeinfo.
15044 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
15045 (dynamic_list_expr): New rule.
15046 (dynamic_list_nodes): Likewise.
15047 (dynamic_list_node): Likewise.
15048 * testsuite/Makefile.am (dynamic_list): New test.
15049 * testsuite/Makefile.in: Regenerated.
15050 * testsuite/dynamic_list.t: New file.
15051 * testsuite/dynamic_list.sh: New file.
15052
e0bb29a5
CS
150532008-11-05 Craig Silverstein <csilvers@google.com>
15054
15055 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
15056 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
15057 (t11_last): Likewise.
15058 * testsuite/ver_test_6.c (main): Likewise.
15059
4e1e25e0
CC
150602008-10-07 Cary Coutant <ccoutant@google.com>
15061
15062 * options.c (General_options::finalize): Add check for -static and
15063 -shared.
15064 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
15065 is not empty.
15066
92f03fcb
CC
150672008-10-02 Cary Coutant <ccoutant@google.com>
15068
15069 * plugin.cc (make_sized_plugin_object): Fix conditional
15070 compilation to work when not all targets are enabled.
15071
fbd8a257
CC
150722008-09-29 Cary Coutant <ccoutant@google.com>
15073
15074 * archive.cc (Archive::get_file_and_offset): Use filename instead
15075 of name to get library path.
15076 (Archive::include_member): Unlock external member of a thin archive.
15077
15078 * testsuite/Makefile.am (TEST_AR): New variable.
15079 (thin_archive_test_1): New test.
15080 (thin_archive_test_2): New test.
81636b3f
CC
15081 * testsuite/Makefile.in: Regenerate.
15082 * testsuite/thin_archive_main.cc: New file.
15083 * testsuite/thin_archive_test_1.cc: New file.
15084 * testsuite/thin_archive_test_2.cc: New file.
15085 * testsuite/thin_archive_test_3.cc: New file.
15086 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 15087
eff45813
CC
150882008-09-29 Cary Coutant <ccoutant@google.com>
15089
15090 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
15091 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
15092 instead of -1U.
15093 (Sized_relobj::do_finalize_local_symbols): Likewise.
15094 (Sized_relobj::map_to_kept_section): Likewise.
15095 * object.h (Sized_relobj::invalid_address): New constant.
15096 (Sized_relobj::do_output_section_offset): Check for invalid_address
15097 and return -1ULL.
15098 * output.cc (Output_reloc::local_section_offset): Use constant
15099 invalid_address instead of -1U.
15100 (Output_reloc::get_address): Likewise.
15101 (Output_section::output_address): Change -1U to -1ULL.
15102 * output.h (Output_reloc::invalid_address): New constant.
15103 * reloc.cc (Sized_relobj::write_sections): Use constant
15104 invalid_address instead of -1U.
15105 (Sized_relobj::relocate_sections): Likewise.
15106 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
15107 values for merge sections.
15108 * target-reloc.h (relocate_for_relocatable): Use constant
15109 invalid_address instead of -1U.
15110
89fc3421
CC
151112008-09-19 Cary Coutant <ccoutant@google.com>
15112
15113 Add plugin functionality for link-time optimization (LTO).
15114 * configure.ac (plugins): Add --enable-plugins option.
15115 * configure: Regenerate.
15116 * config.in: Regenerate.
15117 * Makefile.am (LIBDL): New variable.
15118 (CCFILES): Add plugin.cc.
15119 (HFILES): Add plugin.h.
15120 (ldadd_var): Add LIBDL.
15121 * Makefile.in: Regenerate.
15122
15123 * archive.cc: Include "plugin.h".
15124 (Archive::setup): Don't preread archive symbols when using a plugin.
15125 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
15126 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
15127 files.
15128 (Archive::include_member): Add symbols from plugin objects.
15129 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
15130 * descriptors.cc (Descriptors::open): Check for file descriptors
15131 abandoned by plugins.
15132 (Descriptors::claim_for_plugin): New function.
15133 * descriptors.h (Descriptors::claim_for_plugin): New function.
15134 (Open_descriptor::is_claimed): New field.
15135 (claim_descriptor_for_plugin): New function.
15136 * fileread.cc (File_read::claim_for_plugin): New function.
15137 * fileread.h (File_read::claim_for_plugin): New function.
15138 (File_read::descriptor): New function.
15139 * gold.cc: Include "plugin.h".
15140 (queue_initial_tasks): Add task to call plugin hooks for generating
15141 new object files.
15142 * main.cc: Include "plugin.h".
15143 (main): Load plugin libraries.
15144 * object.h (Pluginobj): Declare.
15145 (Object::pluginobj): New function.
15146 (Object::do_pluginobj): New function.
15147 (Object::set_target): New function.
15148 * options.cc: Include "plugin.h".
15149 (General_options::parse_plugin): New function.
15150 (General_options::General_options): Initialize plugins_ field.
15151 (General_options::add_plugin): New function.
15152 * options.h (Plugin_manager): Declare.
15153 (General_options): Add --plugin option.
15154 (General_options::has_plugins): New function.
15155 (General_options::plugins): New function.
15156 (General_options::add_plugin): New function.
15157 (General_options::plugins_): New field.
15158 * plugin.cc: New file.
15159 * plugin.h: New file.
15160 * readsyms.cc: Include "plugin.h".
15161 (Read_symbols::do_read_symbols): Check for archive before checking
15162 for ELF file. Call plugin hooks to claim files.
15163 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
15164 from a real object file; force override when processing replacement
15165 files.
15166 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
15167 (Symbol::init_base_object): Likewise.
15168 (Symbol::init_base_output_data): Likewise.
15169 (Symbol::init_base_output_segment): Likewise.
15170 (Symbol::init_base_constant): Likewise.
15171 (Symbol::init_base_undefined): Likewise.
15172 (Symbol::output_section): Assert that object is not a plugin.
15173 (Symbol_table::add_from_pluginobj): New function.
15174 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
15175 undefined.
15176 (Symbol_table::sized_write_globals): Likewise.
15177 (Symbol_table::add_from_pluginobj): Instantiate template.
15178 * symtab.h (Sized_pluginobj): Declare.
15179 (Symbol::in_real_elf): New function.
15180 (Symbol::set_in_real_elf): New function.
15181 (Symbol::in_real_elf_): New field.
15182 (Symbol_table::add_from_pluginobj): New function.
15183
15184 * testsuite/Makefile.am (AM_CFLAGS): New variable.
15185 (LIBDL): New variable.
15186 (LDADD): Add LIBDL.
15187 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
15188 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
15189 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
15190 (MOSTLYCLEANFILES): Likewise.
15191 * testsuite/Makefile.in: Regenerate.
15192 * testsuite/plugin_test.c: New file.
15193 * testsuite/plugin_test_1.sh: New file.
15194 * testsuite/plugin_test_2.sh: New file.
15195
de31bda5
ILT
151962008-09-16 Ian Lance Taylor <iant@google.com>
15197
9c2d0ef9
ILT
15198 * target-reloc.h (relocate_section): Check whether a symbol is
15199 defined by the ABI before reporting an undefined symbol error.
15200 * target.h (Target::is_defined_by_abi): Make parameter const.
15201 (Target::do_is_defined_by_abi): Likewise.
15202 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
15203 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
15204 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
15205 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
15206 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
15207 * testsuite/Makefile.in: Rebuild.
15208
de31bda5
ILT
15209 * fileread.cc (make_view): Add casts to avoid warning.
15210
9fa33bee
AO
152112008-09-16 Alexandre Oliva <aoliva@redhat.com>
15212
15213 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
15214 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15215
183fd0e3
AO
152162008-09-16 Alexandre Oliva <aoliva@redhat.com>
15217
15218 * options.h (General_options::output_is_executable): New.
15219 (General_options::output_is_pie): New.
15220 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
15221 for shared libraries.
15222 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15223
7be8330a
CD
152242008-09-11 Chris Demetriou <cgd@google.com>
15225
15226 * options.h (origin): New -z option.
15227 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
15228 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
15229 in DT_FLAGS_1.
15230
a9caad02
CC
152312008-09-05 Cary Coutant <ccoutant@google.com>
15232
15233 * fileread.cc (File_read::make_view): Add check for attempt to map
15234 beyond end of file.
15235
ae6dce4d
CC
152362008-09-05 Cary Coutant <ccoutant@google.com>
15237
15238 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
15239 explicit instantiations.
15240
d7ab2a47
KVH
152412008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
15242
15243 PR gold/6858
15244 * options.cc (General_options::finalize): Allow undefined symbols
15245 in shlibs if linking -shared.
15246
15247 PR gold/6859
15248 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
15249 symbols as not needing a dynsym entry.
15250
1e52a9c1
CS
152512008-08-20 Craig Silverstein <csilvers@google.com>
15252
15253 * fileread.cc (File_read::open): Do not lock the file unless it
15254 was successfully opened.
15255
d85c80a3
CC
152562008-08-14 Cary Coutant <ccoutant@google.com>
15257
15258 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
15259 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
15260 * testsuite/tls_test.cc (struct int128): 128-bit struct
15261 for testing TLS relocs with non-zero addend.
15262 (v12): New TLS variable.
15263 (t12): New test.
15264 (t_last): Add check for v12.
15265 * testsuite/tls_test.h (t12): New function.
15266 * testsuite/tls_test_main.cc (thread_routine): Call new test.
15267
2d924fd9
ILT
152682008-08-13 Ian Lance Taylor <iant@google.com>
15269
15270 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
15271 set tls_segment_ or relro_segment_.
15272 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
15273 when appropriate.
15274 * output.h (Output_section::clear_is_relro): New function.
15275 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
15276 sections specially even when output_data_ is empty.
15277 (Output_segment::maximum_alignment): When first section is relro,
15278 only force alignment for PT_LOAD segments.
15279 * script.cc (script_data_segment_align): New function.
15280 (script_data_segment_relro_end): New function.
15281 * script-c.h (script_data_segment_align): Declare.
15282 (script_data_segment_relro_end): Declare.
15283 * script-sections.h (class Script_sections): Declare
15284 data_segment_align and data_segment_relro_end. Add fields
15285 segment_align_index_ and saw_relro_end_.
15286 * script-sections.cc (class Sections_element): Add set_is_relro
15287 virtual function. Add new bool* parameter to place_orphan_here.
15288 Add get_output_section virtual function.
15289 (class Output_section_definition): Add set_is_relro. Add new
15290 bool* parameter to place_orphan_here. Add get_output_section.
15291 Add is_relro_ field.
15292 (Output_section_definition::Output_section_definition): Initialize
15293 evaluated_address_, evaluated_load_address, evaluated_addralign_,
15294 and is_relro_ fields.
15295 (Output_section_definition::place_orphan_here): Add is_relro
15296 parameter.
15297 (Output_section_definition::set_section_addresses): Set relro for
15298 output section.
15299 (Output_section_definition::alternate_constraint): Likewise.
15300 (class Orphan_output_section): Add new bool* parameter to
15301 place_orphan_here. Add get_output_section.
15302 (Orphan_output_section::place_orphan_here): Add is_relro
15303 parameter.
15304 (Script_sections::Script_sections): Initialize
15305 data_segment_align_index_ and saw_relro_end_.
15306 (Script_sections::data_segment_align): New function.
15307 (Script_sections::data_segment_relro_end): New function.
15308 (Script_sections::place_orphan): Set or clear is_relro.
15309 (Script_sections::set_section_addresses): Force alignment of first
15310 TLS section.
15311 * yyscript.y (exp): Call script_data_segment_align and
15312 script_data_segment_relro_end.
15313 * testsuite/relro_script_test.t: New file.
15314 * testsuite/relro_test.cc (using_script): Declare.
15315 (t1, t2): Test using_script.
15316 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
15317 (relro_script_test_SOURCES): Define.
15318 (relro_script_test_DEPENDENCIES): Define.
15319 (relro_script_test_LDFLAGS): Define.
15320 (relro_script_test_LDADD): Define.
15321 (relro_script_test.so): New target.
15322 * testsuite/Makefile.in: Rebuild.
15323
f827c9a9
CC
153242008-08-06 Cary Coutant <ccoutant@google.com>
15325
15326 * archive.cc (Archive::total_archives, Archive::total_members)
15327 (Archive::total_members_loaded): New variables.
15328 (Archive::setup): Add parameter. Add option to preread
15329 archive symbols.
15330 (Archive::read_armap): Add counter.
15331 (Archive::get_file_and_offset): New function.
15332 (Archive::get_elf_object_for_member): New function.
15333 (Archive::read_all_symbols): New function.
15334 (Archive::read_symbols): New function.
15335 (Archive::add_symbols): Add counters.
15336 (Archive::include_all_members): Use armap to find members if it's
15337 already built.
15338 (Archive::include_member): Skip reading symbols if already read.
15339 Factored code into Archive::get_file_and_offset and
15340 Archive::get_elf_object_for_member. Changed call to
15341 Mapfile::report_include_archive_member.
15342 (Archive::print_stats): New function.
15343 * archive.h: Declare Object and Read_symbols_data classes.
15344 (Archive::Archive): Add initializers for new members.
15345 (Archive::setup): Add parameter.
15346 (Archive::print_stats): New function.
15347 (Archive::total_archives, Archive::total_members)
15348 (Archive::total_members_loaded): New variables.
15349 (Archive::get_file_and_offset): New function.
15350 (Archive::get_elf_object_for_member): New function.
15351 (Archive::read_all_symbols): New function.
15352 (Archive::read_symbols): New function.
15353 (Archive::Archive_member): New class.
15354 (Archive::members_): New member.
15355 (Archive::num_members_): New member.
15356 * main.cc: Include archive.h.
15357 (main): Call Archive::print_stats.
15358 * mapfile.cc (Mapfile::report_include_archive_member): Delete
15359 archive parameter; member_name is now the fully-decorated name.
15360 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
15361 * options.h: (General_options): Add --preread-archive-symbols option.
15362 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
15363 Archive::setup.
15364
de4c45bd
ILT
153652008-08-04 Ian Lance Taylor <iant@google.com>
15366
15367 * symtab.h (Symbol::use_plt_offset): New function.
15368 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
15369 * powerpc.cc (Relocate::relocate): Likewise.
15370 * sparc.cc (Relocate::relocate): Likewise.
15371 * x86_64.cc (Relocate::relocate): Likewise.
15372 * testsuite/weak_plt.sh: New test.
15373 * testsuite/weak_plt_main.cc: New test.
15374 * testsuite/weak_plt_shared.cc: New test.
15375 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
15376 (check_PROGRAMS): Add weak_plt.
15377 (check_DATA): Add weak_plt_shared.so.
15378 (weak_plt_main_pic.o, weak_plt): New targets.
15379 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
15380 * testsuite/Makefile.in: Rebuild.
15381
15382 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
15383 gcctestdir/ld.
15384 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
15385 * testsuite/Makefile.in: Rebuild.
15386
323ee3f4
AM
153872008-08-04 Alan Modra <amodra@bigpond.net.au>
15388
15389 * Makefile.am (POTFILES.in): Set LC_ALL=C.
15390 * Makefile.in: Regenerate.
15391 * po/POTFILES.in: Regenerate.
15392
7c07ecec
ILT
153932008-07-29 Ian Lance Taylor <iant@google.com>
15394
15395 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
15396 symbols before other symbols.
15397 * testsuite/script_test_2.cc (test_addr): Declare.
15398 (test_addr_alias): Declare.
15399 (main): Check that test_addr and test_addr_alias have the right
cd536b21 15400 values.
7c07ecec
ILT
15401 * testsuite/script_test_2.t: Define test_addr_alias and
15402 test_addr.
15403
5778530e
ILT
154042008-07-24 Ian Lance Taylor <iant@google.com>
15405
2a00e4fb
ILT
15406 PR 5990
15407 * descriptors.cc: New file.
15408 * descriptors.h: New file.
15409 * gold-threads.h (class Hold_optional_lock): New class.
15410 * fileread.cc: Include "descriptors.h".
15411 (File_read::~File_read): Release descriptor rather than closing
15412 it.
15413 (File_read::open) [file]: Call open_descriptor rather than open.
15414 Set is_descriptor_opened_.
15415 (File_read::open) [memory]: Assert that descriptor is not open.
15416 (File_read::reopen_descriptor): New function.
15417 (File_read::release): Release descriptor.
15418 (File_read::do_read): Make non-const. Reopen descriptor.
15419 (File_read::read): Make non-const.
15420 (File_read::make_view): Reopen descriptor.
15421 (File_read::do_readv): Likewise.
15422 * fileread.h (class File_read): Add is_descriptor_opened_ field.
15423 Update declarations.
15424 * layout.cc: Include "descriptors.h".
15425 (Layout::create_build_id): Use open_descriptor rather than open.
15426 * output.cc: Include "descriptors.h".
15427 (Output_file::open): Use open_descriptor rather than open.
15428 * archive.cc (Archive::const_iterator): Change Archive to be
15429 non-const.
15430 (Archive::begin, Archive::end): Make non-const.
15431 (Archive::count_members): Likewise.
15432 * archive.h (class Archive): Update declarations.
15433 * object.h (Object::read): Make non-const.
15434 * Makefile.am (CCFILES): Add descriptors.cc.
15435 (HFILES): Add descriptors.h.
15436 * Makefile.in: Rebuild.
15437
801647d1
ILT
15438 PR 6716
15439 * gold.h: Always include <clocale>. Add Solaris workarounds
15440 following code in binutils/sysdep.h.
15441
5edd166e
ILT
15442 PR 6048
15443 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
15444 this->eh_frame_hdr_ is NULL before using it.
15445
c89ad728
ILT
15446 * dynobj.cc (Versions::Versions): Update comment.
15447
aa86f06b
ILT
15448 * dynobj.cc (Versions::Versions): If there is an soname, use it as
15449 the base version name.
15450
5778530e
ILT
15451 * stringpool.cc (Stringpool_template::add_with_length): Set key to
15452 array size plus one.
15453 (Stringpool_template::set_string_offsets): Subtract one from key
15454 before using it as an array index.
15455 (Stringpool_template::get_offset_with_length): Likewise.
15456 (Stringpool_template::write_to_buffer): Likewise.
15457 * stringpool.h (Stringpool_template::get_offset_from_key):
15458 Likewise.
15459
057ead22
ILT
154602008-07-23 Ian Lance Taylor <iant@google.com>
15461
7f649c59
ILT
15462 PR 6658
15463 * object.h (Merged_symbol_value::value): Do our best to handle a
15464 negative addend.
15465
057ead22
ILT
15466 PR 6647
15467 * script.cc (Version_script_info::get_versions): Don't add empty
15468 version tag to return value.
15469 (Version_script_info::get_symbol_version_helper): Change return
15470 type to bool. Add pversion parameter. Change all callers.
15471 (script_register_vers_node): Don't require a non-NULL tag.
15472 * script.h (class Version_script_info): Update declarations.
15473 (Version_script_info::get_symbol_version): Change return type to
15474 bool. Add version parameter. Change all callers.
15475 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
15476 handling. Handle an empty version from a version script.
15477 (Symbol_table::define_special_symbol): Likewise.
15478 * testsuite/ver_test_10.script: New file.
15479 * testsuite/ver_test_10.sh: New file.
15480 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
15481 (check_DATA): Add ver_test_10.syms.
15482 (ver_test_10.syms, ver_test_10.so): New target.
15483 * testsuite/Makefile.in: Rebuild.
15484
58e54ac2
CD
154852008-07-23 Simon Baldwin <simonb@google.com>
15486
15487 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
15488 to zero for undefined symbols from dynamic libraries.
15489
95d14cd3
ILT
154902008-07-23 Ian Lance Taylor <iant@google.com>
15491
15492 * symtab.cc (Symbol_table::resolve): Remove version parameter.
15493 Change all callers.
15494 * symtab.h (class Symbol_table): Update declaration.
15495 * testsuite/ver_test_9.cc: New file.
15496 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
15497 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
15498 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
15499 (ver_test_9.so, ver_test_9.o): New targets.
15500 * testsuite/Makefile.in: Rebuild.
15501
92de84a6
ILT
155022008-07-22 Ian Lance Taylor <iant@google.com>
15503
34810851
ILT
15504 * options.h (class General_options): Define --check-sections.
15505 * layout.cc (Layout::set_segment_offsets): Handle
15506 --check-sections.
15507
af6156ef
ILT
15508 * options.h (class General_options): Define -n/--nmagic and
15509 -N/--omagic.
15510 * options.cc (General_options::finalize): For -n/--nmagic or
15511 -N/--omagic, set -static.
15512 * layout.cc (Layout::attach_allocated_section_to_segment): If
15513 -N/--omagic, don't put read-only and read-write sections in
15514 different segments.
15515 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
15516 finding a read-only segment.
15517 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
15518 don't set the minimum segment alignment to the common page size,
15519 and don't set the file offset to the address modulo the page size.
15520 * script-sections.cc (Script_sections::create_segments): If
15521 -n/--omagic, don't put read-only and read-write sections in
15522 different segments.
15523
92de84a6
ILT
15524 * cref.cc: New file.
15525 * cref.h: New file.
15526 * options.h (class General_options): Add --print-symbol-counts.
15527 * main.cc (main): Issue defined symbol report if requested.
15528 * archive.cc (Archive::interpret_header): Make into a const member
15529 function.
15530 (Archive::add_symbols): Call Input_objects::archive_start and
15531 archive_stop.
15532 (Archive::const_iterator): Define new class.
15533 (Archive::begin, Archive::end): New functions.
15534 (Archive::include_all_members): Rewrite to use iterator.
15535 (Archive::count_members): New function.
15536 * archive.h (class Archive): Update declarations.
15537 (Archive::filename): New function.
15538 * object.cc: Include "cref.h".
15539 (Sized_relobj::Sized_relobj): Initialize defined_count_.
15540 (Sized_relobj::do_get_global_symbol_counts): New function.
15541 (Input_objects::add_object): Add object to cross-referencer.
15542 (Input_objects::archive_start): New function.
15543 (Input_objects::archive_stop): New function.
15544 (Input_objects::print_symbol_counts): New function.
15545 * object.h: Declare Cref and Archive.
15546 (Object::get_global_symbol_counts): New function.
15547 (Object::do_get_global_symbol_counts): New pure virtual function.
15548 (class Sized_relobj): Add defined_count_ field. Update
15549 declarations.
15550 (class Input_objects): Add cref_ field. Update constructor.
15551 Update declarations.
15552 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
15553 defined_count_.
15554 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
15555 symbol counts.
15556 (Sized_dynobj::do_get_global_symbol_counts): New function.
15557 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
15558 defined_count_. Update declarations. Define Symbols typedef.
15559 * symtab.cc (Symbol_table::add_from_relobj): Add defined
15560 parameter. Change all callers.
15561 (Symbol_table::add_from_dynobj): Add sympointers and defined
15562 parameters. Change all callers.
15563 * symtab.h (class Symbol_table): Update declarations.
15564 * Makefile.am (CCFILES): Add cref.cc.
15565 (HFILES): Add cref.h.
15566 * Makefile.in: Rebuild.
15567
3f7c5e1d
CD
155682008-07-22 Simon Baldwin <simonb@google.com>
15569
15570 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
15571 to zero when writing undefined symbols.
15572
e0b64032
ILT
155732008-07-22 Ian Lance Taylor <iant@google.com>
15574
15575 * output.cc (Output_section::add_input_section): Don't try to
15576 merge empty merge sections.
15577
096b02cf
CS
155782008-07-21 Craig Silverstein <csilvers@google.com>
15579
15580 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15581 Include symbol version in error message.
cd536b21 15582
1d1f116d
CD
155832008-07-20 Chris Demetriou <cgd@google.com>
15584
cd536b21 15585 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
15586 (RANDOM_SEED_CFLAGS): New substituted variable.
15587 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
15588 * configure: Rebuild.
15589 * Makefile.in: Likewise.
15590 * testsuite/Makefile.in: Likewise.
15591
a18f591e
ILT
155922008-07-18 Ian Lance Taylor <iant@google.com>
15593
15594 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
15595 where we see NAME/NULL and NAME/VERSION as separate symbols.
15596 * testsuite/ver_test_main.cc (main): Call t4.
15597 (t4, t4_2a): Define.
15598 * testsuite/ver_test_2.cc (t4_2): Define.
15599 * testsuite/ver_test_2.script: Put t4_2a in VER2.
15600 * testsuite/ver_test_4.cc (t4_2a): Define.
15601 * testsuite/ver_test_4.script: Put t4_2a in VER2.
15602 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
15603
c6e3f6ed
ILT
156042008-07-17 Ian Lance Taylor <iant@google.com>
15605
15606 * dynobj.cc (Versions::add_def): If we give an error about a
15607 missing version, go ahead and create the version anyhow.
15608
ef9beddf
ILT
156092008-07-10 Ian Lance Taylor <iant@google.com>
15610
15611 Handle output sections with more than 0x7fffffff bytes.
15612 * object.h (class Relobj): Change map_to_output_ to
15613 output_sections_, and just keep a section pointer. Change all
15614 uses. Move comdat group support to Sized_relobj.
15615 (Relobj::is_section_specially_mapped): Remove.
15616 (Relobj::output_section): Remove poff parameter. Change all
15617 callers.
15618 (Relobj::output_section_offset): New function.
15619 (Relobj::set_section_offset): Rewrite.
15620 (Relobj::map_to_output): Remove.
15621 (Relobj::output_sections): New function.
15622 (Relobj::do_output_section_offset): New pure virtual function.
15623 (Relobj::do_set_section_offset): Likewise.
15624 (class Sized_relobj): Add section_offsets_ field. Add comdat
15625 group support from Relobj. Update declarations.
15626 (Sized_relobj::get_output_section_offset): New function.
15627 (Sized_relobj::do_output_section_offset): New function.
15628 (Sized_relobj::do_set_section_offset): New function.
15629 * object.cc (Relobj::output_section_address): Remove.
15630 (Sized_relobj::Sized_relobj): Initialize new fields.
15631 (Sized_relobj::include_section_group): Cast find_kept_object to
15632 Sized_relobj.
15633 (Sized_relobj::include_linkonce_section): Likewise.
15634 (Sized_relobj::do_layout): Use separate arrays for output section
15635 and output offset.
15636 (Sized_relobj::do_count_local_symbols): Change map_to_output to
15637 output_sections.
15638 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
15639 output_sections and section_offsets.
15640 (Sized_relobj::write_local_symbols): Likewise.
15641 (map_to_kept_section): Compute output address directly.
15642 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
15643 output_sections and section_offsets.
15644 (Sized_relobj::write_sections): Likewise.
15645 (Sized_relobj::relocate_sections): Likewise.
15646 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
15647 * output.h (class Output_reloc): Update declarations. Change
15648 u2_.relobj to Sized_relobj*.
15649 (class Output_data_reloc): Change add functions to use
15650 Sized_relobj*.
15651 * output.cc (Output_reloc::Output_reloc): Change relobj to
15652 Sized_relobj*.
15653 (Output_reloc::local_section_offset): Change return type to
15654 Elf_Addr. Use get_output_section_offset.
15655 (Output_reloc::get_address): Likewise.
15656 (Output_section::is_input_address_mapped): Don't call
15657 is_section_specially_mapped.
15658 (Output_section::output_offset): Likewise.
15659 (Output_section::output_address): Likewise.
15660 (Output_section::starting_output_address): Likewise.
15661 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
15662 parameter to Sized_relobj*.
15663 (Copy_relocs::need_copy_reloc): Likewise.
15664 (Copy_relocs::save): Likewise.
15665 * copy-relocs.h (class Copy_relocs): Update declarations.
15666 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
15667 Sized_relobj*. Change relobj_ field to Sized_relobj*.
15668 * target-reloc.h (relocate_for_relocatable): Change
15669 offset_in_output_section type to Elf_Addr. Change code that uses
15670 it as well.
15671 * layout.cc (Layout::layout): Always set *off.
15672 * mapfile.cc (Mapfile::print_input_section): Use
15673 output_section_offset.
15674 * i386.cc (Target_i386::copy_reloc): Change object parameter to
15675 Sized_relobj*.
15676 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
15677 * sparc.cc (Target_sparc::copy_reloc): Likewise.
15678 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
15679
5cb66f97
ILT
156802008-07-03 Ian Lance Taylor <iant@google.com>
15681
15682 * layout.cc (Layout::include_section): Do not discard unrecognized
15683 SHT_STRTAB sections.
15684
afe47622
CS
156852008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
15686
15687 * script.cc (Lex::can_continue_name): Make '?' allowable in
15688 version-script names.
15689 * testsuite/version_script.map: Change glob pattern to use '?'
15690
5adf9721
ILT
156912008-06-30 Manish Singh <yosh@gimp.org>
15692
15693 PR 6585
15694 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
15695 Correct typo.
15696
e6fde208
ILT
156972008-06-30 Ian Lance Taylor <iant@google.com>
15698
15699 PR 6660
15700 PR 6682
15701 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
15702 versions]: Don't try to read the value in the contents, since we
15703 don't use it. Use the template endianness when writing.
15704
3f2e6a2d
CC
157052008-06-25 Cary Coutant <ccoutant@google.com>
15706
15707 * fileread.cc (File_read::make_view): Assert on zero-length view.
15708 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
15709 symbol table when there are no symbols to read.
15710
c43d3a48
CS
157112008-06-23 Craig Silverstein <csilvers@google.com>
15712
15713 * version.cc (version_string): Bump to 1.7
15714
5f494ea0
CS
157152008-06-18 Craig Silverstein <csilvers@google.com>
15716
15717 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
15718 constant 0xFFFF to type Valtype.
15719 (Powerpc_relocate_functions::rel16_ha): Likewise.
15720
c42e122e
ILT
157212008-06-17 Ian Lance Taylor <iant@google.com>
15722
f34787f8
ILT
15723 * output.h (Output_section::Input_section): Initialize p2align_ to
15724 zero for Output_section_data constructors.
15725 (Output_section::Input_section::addralign): If not an input
15726 section, return the alignment of the Output_section_data.
15727 * testsuite/copy_test.cc: New file.
15728 * testsuite/copy_test_1.cc: New file.
15729 * testsuite/copy_test_2.cc: New file.
15730 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
15731 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
15732 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
15733 (copy_test_1_pic.o, copy_test_1.so): New targets.
15734 (copy_test_2_pic.o, copy_test_2.so): New targets.
15735 * testsuite/Makefile.in: Rebuild.
15736
c42e122e
ILT
15737 * script-sections.cc (Script_sections::place_orphan): Initialize
15738 local variable exact.
15739
ce3ac18a
DE
157402008-06-13 David Edelsohn <edelsohn@gnu.org>
15741
15742 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
15743
42cacb20
DE
157442008-06-12 David Edelsohn <edelsohn@gnu.org>
15745 David S. Miller <davem@davemloft.net>
15746
15747 * powerpc.cc: New file.
15748 * Makefile.am (TARGETSOURCES): Add powerpc.cc
15749 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
15750 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
15751 * Makefile.in: Rebuild.
15752
7b308235
ILT
157532008-06-09 Ian Lance Taylor <iant@google.com>
15754
15755 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
15756 <exception>.
15757 (throwing, orig_terminate): New static variables.
15758 (terminate_handler): New static function.
15759 (t2): Set terminate handler.
15760
f0b886e3
ILT
157612008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
15762
15763 PR 6584
cd536b21 15764 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
15765 alignment.
15766
3e90f135
CC
157672008-05-30 Cary Coutant <ccoutant@google.com>
15768
15769 * archive.cc (Archive::include_all_members) Correct to step
15770 over symbol table and extended name table in thin archives.
15771
e09ad04a
ILT
157722008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
15773
15774 PR 6407
15775 * target-reloc.h (relocate_for_relocatable): Fix new_offset
15776 calculation.
15777
62b01cb5
ILT
157782008-05-28 Caleb Howe <cshowe@google.com>
15779
15780 * reduced_debug_output.cc: New file.
15781 * reduced_debug_output.h: New file.
92de84a6 15782 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
15783 * options.cc (General_options::finalize): Add strip_debug_non_line
15784 to the strip heirarchy.
15785 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
15786 fields.
15787 * layout.cc: Include "reduced_debug_output.h".
15788 (Layout::Layout): Initialize new fields.
15789 (line_only_debug_sections): New static array.
15790 (is_lines_only_debug_sections): New static inline function.
15791 (Layout::include_section): Handle --strip-debug-non-line.
15792 (Layout::make_output_section): If --strip-debug-non-line, build
15793 new output sections for .debug_abbrev and .debug_info.
15794 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
15795 gold. Warn about possible overflow.
15796 (read_signed_LEB_128): Likewise.
15797 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
15798 (read_signed_LEB_128): Declare.
15799 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
15800 (HFILES): Add reduced_debug_output.h.
15801 * Makefile.in: Rebuild.
15802
7d9e3d98
ILT
158032008-05-21 Ian Lance Taylor <iant@google.com>
15804
15805 * mapfile.cc: New file.
15806 * mapfile.h: New file.
15807 * options.h (class General_options): Add -M/--print-map and -Map.
15808 * options.cc (General_options::finalize): Make -M equivalent to
15809 -Map -.
15810 * main.cc: Include <cstdio> and "mapfile.h".
15811 (main): Open mapfile if requested.
15812 * gold.cc (class Middle_runner): Add mapfile_ field. Update
15813 constructor. Change caller.
15814 (queue_initial_tasks): Add mapfile parameter. Change caller.
15815 (queue_middle_tasks): Likewise.
15816 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
15817 declarations.
15818 * archive.cc: Include "mapfile.h".
15819 (Archive::add_symbols): Add mapfile parameter. Change all
15820 callers. Pass mapfile, symbol, and reason to include_member.
15821 (Archive::include_all_members): Add mapfile parameter. Change all
15822 callers.
15823 (Archive::include_member): Add mapfile, sym, and why parameters.
15824 Change all callers. Report inclusion to map file.
15825 * archive.h: Include "fileread.h".
15826 (class Archive): Update declarations.
15827 (Archive::file): New const method.
15828 (class Add_archive_symbols): Add mapfile_ field. Update
15829 constructor. Change all callers.
15830 * readsyms.h (class Read_symbols): Likewise.
15831 (class Finish_group): Likewise.
15832 (class Read_script): Likewise.
15833 * common.cc: Include "mapfile.h".
15834 (Symbol_table::allocate_commons): Add mapfile parameter. Change
15835 all callers.
15836 (Symbol_table::do_allocate_commons): Likewise.
15837 (Symbol_table::do_allocate_commons_list): Likewise. Report common
15838 symbol allocation to mapfile.
15839 * common.h (class Allocate_commons_task): Add mapfile_ field.
15840 Update constructor. Change all callers.
15841 * symtab.h (class Symbol_table): Update declarations.
15842 * layout.cc: Include "mapfile.h".
15843 (Layout_task_runner::run): Print information to mapfile.
15844 (Layout::create_gold_note): Change Output_data_fixed_space to
15845 Output_data_zero_fill.
15846 (Layout::create_build_id): Likewise.
15847 (Layout::print_to_mapfile): New function.
15848 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
15849 constructor. Change caller.
15850 (class Layout): Declare print_to_mapfile.
15851 * output.cc (Output_section::Input_section::print_to_mapfile): New
15852 function.
15853 (Output_section::add_input_section): If producing a map, always
15854 add to input_sections_ list.
15855 (Output_section::do_print_to_mapfile): New function.
15856 (Output_segment::print_sections_to_mapfile): New function.
15857 (Output_segment::print_section_list_to_mapfile): New function.
15858 * output.h: Include "mapfile.h".
15859 (Output_data::print_to_mapfile): New function.
15860 (Output_data::do_print_to_mapfile): New virtual function.
15861 (Output_segment_headers::do_print_to_mapfile): New function.
15862 (Output_file_header::do_print_to_mapfile): New function.
15863 (Output_data_const::do_print_to_mapfile): New function.
15864 (class Output_data_const_buffer): Add map_name_ field. Update
15865 constructor. Change all callers. Add do_print_to_mapfile
15866 function.
15867 (class Output_data_fixed_space): Likewise.
15868 (class Output_data_space): Likewise.
15869 (class Output_data_zero_fill): New class.
15870 (Output_data_strtab::do_print_to_mapfile): New function.
15871 (Output_data_reloc_base::do_print_to_mapfile): New function.
15872 (Output_relocatable_relocs::do_print_to_mapfile): New function.
15873 (Output_data_group::do_print_to_mapfile): New function.
15874 (Output_data_got::do_print_to_mapfile): New function.
15875 (Output_data_dynamic::do_print_to_mapfile): New function.
15876 (Output_symtab_xindex::do_print_to_mapfile): New function.
15877 (class Output_section): Declare do_print_to_mapflie. Declare
15878 print_to_mapfile in Input_section.
15879 (class Output_segment): Declare new functions.
15880 * object.h (Sized_relobj::symbol_count): New function.
15881 * script-sections.cc
15882 (Output_section_element_dot_assignment::set_section_addresses):
15883 Change Output_data_fixed_space to Output_data_zero_fill.
15884 (Output_data_expression::do_print_to_mapfile): New function.
15885 * script.cc (read_input_script): Add mapfile parameter. Change
15886 all callers.
15887 * script.h (read_input_script): Update declaration.
15888 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
15889 (Eh_frame::do_print_to_mapfile): New function.
15890 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
15891 (Output_merge_string::do_print_to_mapfile): New function.
15892 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
15893 function.
15894 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
15895 function.
15896 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
15897 function.
15898 * Makefile.am (CCFILES): Add mapfile.cc.
15899 (HFILES): Add mapfile.h.
15900 * Makefile.in: Rebuild.
15901
9f1d377b
ILT
159022008-05-19 Ian Lance Taylor <iant@google.com>
15903
15904 * options.h (class General_options): Add -z relro.
15905 * layout.cc (Layout::Layout): Initialize relro_segment_.
15906 (Layout::add_output_section_data): Return the output section.
15907 (Layout::make_output_section): Rcognize relro sections and mark
15908 them appropriately.
15909 (Layout::attach_allocated_section_to_segment): Put relro sections
15910 in a PT_GNU_RELRO segment.
15911 (Layout::create_initial_dynamic_sections): Mark the .dynamic
15912 section as relro.
15913 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
15914 PT_TLS segments.
15915 (Layout::linkonce_mapping): Map d.rel.ro.local to
15916 .data.rel.ro.local.
15917 (Layout::output_section_name): Us .data.rel.ro.local for any
15918 section which begins with that.
15919 * layout.h (class Layout): Update add_output_section_data
15920 declaration. Add relro_segment_ field.
15921 * output.cc (Output_section::Output_section): Initialize is_relro_
15922 and is_relro_local_ fields.
15923 (Output_segment::add_output_section): Group relro sections.
15924 (Output_segment::is_first_section_relro): New function.
15925 (Output_segment::maximum_alignment): If there is a relro section,
15926 align the segment to the common page size.
15927 (Output_segment::set_section_addresses): Track whether we are
15928 looking at relro sections. If the last section is a relro
15929 section, align to the common page size.
15930 (Output_segment::set_section_list_addresses): Add in_relro
15931 parameter. Change all callers. Align to the page size when
15932 moving from relro to non-relro section.
15933 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
15934 segment.
15935 * output.h (class Output_section): Add is_relro_ and
15936 is_relro_local_ fields.
15937 (Output_section::is_relro): New function.
15938 (Output_section::set_is_relro): New function.
15939 (Output_section::is_relro_local): New function.
15940 (Output_section::set_is_relro_local): New function.
15941 (class Output_segment): Update declarations.
15942 * i386.cc (Target_i386::got_section): Mark .got section as relro.
15943 * sparc.cc (Target_sparc::got_section): Likewise.
15944 * x86_64.cc (Target_x86_64::got_section): Likewise.
15945 * testsuite/relro_test_main.cc: New file.
15946 * testsuite/relro_test.cc: New file.
15947 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
15948 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
15949 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
15950 (relro_test.so, relro_test_pic.o): New targets.
15951 * testsuite/Makefile.in: Rebuild.
15952
a984ee1d
ILT
159532008-05-16 Ian Lance Taylor <iant@google.com>
15954
01676dcd
ILT
15955 * output.cc (Output_segment::add_output_section): Remove front
15956 parameter.
15957 * output.h (class Output_segment): Remove
15958 add_initial_output_section and overloaded add_output_section.
15959 Update declaration of remaining add_output_section.
15960 * layout.cc (Layout::create_interp): Call add_output_section
15961 rather than add_initial_output_section.
15962 (Layout::finish_dynamic_section): Likewise.
15963
497897f9
ILT
15964 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
15965 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
15966 know the dynamic type.
15967 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
15968 field. Initialize it in constructor.
15969 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
15970 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
15971 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
15972 reloc.
15973
a984ee1d
ILT
15974 * output.cc (Output_reloc::get_address): Change return type to
15975 Elf_Addr.
15976 * output.h (class Output_reloc): Update get_address declaration.
15977 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
15978 for section addresses.
15979
55ba0940
ILT
159802008-05-09 Ian Lance Taylor <iant@google.com>
15981
15982 PR 6493
15983 * gold.cc (gold_nomem): Use return value of write.
15984
75517b77
ILT
159852008-05-08 Ian Lance Taylor <iant@google.com>
15986
15987 * symtab.c (Symbol::init_base_output_data): Add version
15988 parameter. Change all callers.
15989 (Symbol::init_base_output_segment): Likewise.
15990 (Symbol::init_base_constant): Likewise.
15991 (Symbol::init_base_undefined): Likewise.
15992 (Sized_symbol::init_output_data): Likewise.
15993 (Sized_symbol::init_output_segment): Likewise.
15994 (Sized_symbol::init_constant): Likewise.
15995 (Sized_symbol::init_undefined): Likewise.
15996 (Symbol_table::do_define_in_output_data): If the new symbol has a
15997 version, mark it as the default.
15998 (Symbol_table::do_define_in_output_segment): Likewise.
15999 (Symbol_table::do_define_as_constant): Likewise.
16000 * symtab.h (class Symbol): Update declarations.
16001 (class Sized_symbol): Likewise.
16002 * resolve.cc (Symbol::override_version): New function.
c42e122e 16003 (Symbol::override_base): Call override_version.
75517b77
ILT
16004 (Symbol::override_base_with_special): Likewise.
16005 * testsuite/ver_script_8.script: New file.
16006 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
16007 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
16008 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
16009 (ver_test_8_1.so, ver_test_8_2.so): New targets.
16010
f1f70eae
ILT
160112008-05-06 Ian Lance Taylor <iant@google.com>
16012
f3e9c5c5
ILT
16013 PR 6049
16014 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
16015 functions.
16016 (class General_options): Remove existing --undefined, and add
16017 --no-undefined instead. Add new --undefined as synonym for -u.
16018 * archive.cc (Archive::add_symbols): Check whether symbol was
16019 named with -u.
16020 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
16021 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
16022 all uses. Add IS_UNDEFINED. Update declarations to split
16023 different versions of init_base. Declare init_base_undefined.
16024 (Symbol::is_defined): Handle IS_UNDEFINED.
16025 (Symbol::is_undefined): Likewise.
16026 (Symbol::is_weak_undefined): Call is_undefined.
16027 (Symbol::is_absolute): Handle IS_CONSTANT.
16028 (class Sized_symbol): Update declarations to split different
16029 versions of init. Declare init_undefined.
16030 (class Symbol_table): Declare new functions.
16031 * symtab.cc (Symbol::init_base_object): Rename from init_base.
16032 Change all callers.
16033 (Symbol::init_base_output_data): Likewise.
16034 (Symbol::init_base_output_segment): Likewise.
16035 (Symbol::init_base_constant): Likewise.
16036 (Symbol::init_base_undefined): New function.
16037 (Sized_symbol::init_object): Rename from init. Change all
16038 callers.
16039 (Sized_symbol::init_output_data): Likewise.
16040 (Sized_symbol::init_output_segment): Likewise.
16041 (Sized_symbol::init_constant): Likewise.
16042 (Sized_symbol::init_undefined): New function.
16043 (Symbol_table::add_undefined_symbols_from_command_line): New
16044 function.
16045 (Symbol_table::do_add_undefined_symbols_from_command_line): New
16046 function.
16047 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
16048 (Symbol::output_section): Likewise.
16049 (Symbol::set_output_section): Likewise.
16050 (Symbol_table::sized_finalize_symbol): Likewise.
16051 (Symbol_table::sized_write_globals): Likewise.
16052 * resolve.cc (Symbol_table::should_override): Likewise.
16053 (Symbol::override_base_with_special): Likewise.
16054
8bdcdf2c
ILT
16055 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
16056 symbol, change it to have default visibility.
16057 * testsuite/protected_1.cc: New file.
16058 * testsuite/protected_2.cc: New file.
16059 * testsuite/protected_3.cc: New file.
16060 * testsuite/protected_main_1.cc: New file.
16061 * testsuite/protected_main_2.cc: New file.
16062 * testsuite/protected_main_3.cc: New file.
16063 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
16064 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
16065 (protected_1_LDFLAGS, protected_1_LDADD): Define.
16066 (protected_1.so): New target.
16067 (protected_1_pic.o, protected_2_pic.o): New targets.
16068 (protected_3_pic.o): New target.
16069 (check_PROGRAMS): Add protected_2.
16070 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
16071 (protected_2_LDFLAGS, protected_2_LDADD): Define.
16072 * testsuite/Makefile.in: Rebuild.
16073
2b706932
ILT
16074 * options.h (DEFINE_var): Add set_user_set_##varname__.
16075 (DEFINE_bool_alias): New macro.
16076 (class General_options): Define -Bstatic using DEFINE_bool_alias
16077 rather than DEFINE_special. Add --undefined as an alias for -z
16078 defs.
16079 * options.cc (General_options::parse_Bstatic): Remove.
16080
d82a5bcc
ILT
16081 * options.h (class General_options): Add --fatal-warnings.
16082 * main.cc (main): Implement --fatal-warnings.
16083 * errors.h (Errors::warning_count): New function.
16084
f1f70eae
ILT
16085 * options.h (class General_options): Add -Bsymbolic-functions.
16086 * symtab.h (Symbol::is_preemptible): Check for
16087 -Bsymbolic-functions.
16088
8825ac63
ILT
160892008-05-05 Ian Lance Taylor <iant@google.com>
16090
d98bc257
ILT
16091 * options.h (DEFINE_bool): For DASH_Z, create the negative option
16092 as noVARNAME rather than no-VARNAME.
16093 (class General_options): Add option -z combreloc.
16094 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
16095 get_address.
16096 (Output_reloc::sort_before) [SHT_REL]: New function.
16097 (Output_reloc::sort_before) [SHT_RELA]: New function.
16098 (class Output_data_reloc_base): Add sort_relocs_ field. Define
16099 Sort_relocs_comparison.
16100 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
16101 parameter. Change all callers.
16102 (Output_data_reloc::Output_data_reloc) [both versions]: Add
16103 sort_relocs parameter. Change all callers.
16104 * output.cc (Output_reloc::get_address): New function, broken out
16105 of write_rel.
16106 (Output_reloc::write_rel): Call it.
16107 (Output_reloc::compare): New function.
16108 (Output_data_reloc_base::do_write): Optionally sort relocs.
16109
60b2b4e7
ILT
16110 * configure.ac: If targ_extra_obj is set, link it in.
16111 * configure.tgt: Initialize all variables.
16112 (x86_64*): Set targ_extra_obj and targ_extra_size.
16113 * configure: Rebuild.
16114
8825ac63
ILT
16115 * object.cc (Sized_relobj::include_section_group): Adjust section
16116 indexes read from group data. Build vector to pass to
16117 layout_group.
16118 * layout.cc (Layout::layout_group): Add flags and shndxes
16119 parameters. Remove contents parameter. Change caller. Update
16120 explicit instantiations.
16121 * layout.h (class Layout): Update layout_group declaration.
16122 * output.cc (Output_data_group::Output_data_group): Add flags and
16123 input_shndxes parameters. Remove contents parameter. Change
16124 caller.
16125 (Output_data_group::do_write): Change input_sections_ to
16126 input_shndxes_.
16127 * output.h (class Output_data_group): Update constructor
16128 declaration. Rename input_sections_ to input_shndxes_.
16129 * testsuite/many_sections_test.cc: Add template.
16130
e94cf127
CC
161312008-04-30 Cary Coutant <ccoutant@google.com>
16132
4418b2d5
CC
16133 * target-reloc.h (relocate_section): Fix dead-pointer bug.
16134
e94cf127
CC
16135 * layout.cc (Layout::include_section): Refactored check for debug
16136 info section.
16137 (Layout::add_comdat): Add new parameters. Change type
16138 of signature parameter. Add object and shndx to signatures table.
16139 (Layout::find_kept_object): New function.
16140 * layout.h: Include <cstring>.
16141 (Layout::is_debug_info_section): New function.
16142 (Layout::add_comdat): Add new parameters.
16143 (Layout::find_kept_object): New function.
16144 (Layout::Kept_section): New struct.
16145 (Layout::Signatures): Change type of map range.
16146 * object.cc (Relobj::output_section_address): New function.
16147 (Sized_relobj::include_section_group): Add new parameters. Change
16148 calls to Layout::add_comdat. Change to build table of kept comdat
16149 groups and table mapping discarded sections to kept sections.
16150 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
16151 (Sized_relobj::do_layout): Change calls to include_section_group and
16152 include_linkonce_section.
16153 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
16154 value to zero when section is discarded.
16155 (Sized_relobj::map_to_kept_section): New function.
16156 * object.h (Relobj::output_section_address): New function.
16157 (Relobj::Comdat_group): New type.
16158 (Relobj::find_comdat_group): New function.
16159 (Relobj::Comdat_group_table): New type.
16160 (Relobj::Kept_comdat_section): New type.
16161 (Relobj::Kept_comdat_section_table): New type.
16162 (Relobj::add_comdat_group): New function.
16163 (Relobj::set_kept_comdat_section): New function.
16164 (Relobj::get_kept_comdat_section): New function.
16165 (Relobj::comdat_groups_): New field.
16166 (Relobj::kept_comdat_sections_): New field.
16167 (Symbol_value::input_value): Update comment.
16168 (Sized_relobj::map_to_kept_section) New function.
16169 (Sized_relobj::include_linkonce_section): Add new parameter.
16170 * target-reloc.h (Comdat_behavior): New type.
16171 (get_comdat_behavior): New function.
16172 (relocate_section): Add code to map a discarded section to the
16173 corresponding kept section when applying a relocation.
16174
e4e5049b
CS
161752008-04-30 Craig Silverstein <csilvers@google.com>
16176
16177 * dwarf_reader.cc (next_generation_count): New static var.
16178 (Addr2line_cache_entry): New struct.
16179 (addr2line_cache): New static var.
16180 (Dwarf_line_info::one_addr2line): Added caching.
16181 (Dwarf_line_info::clear_addr2line_cache): New function.
16182 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
16183 cache-size parameter.
16184 (Dwarf_line_info::one_addr2line_cache): New function.
16185 * symtab.cc (Symbol_table::detect_odr_violations): Pass
16186 new cache-size argument to one_addr2line(), and clear cache.
16187
d09e9154
CC
161882008-04-28 Cary Coutant <ccoutant@google.com>
16189
16190 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
16191 R_386_PC8 relocations.
16192
7ef73768
ILT
161932008-04-23 Ian Lance Taylor <iant@google.com>
16194
55438702
ILT
16195 * object.cc (Sized_relobj::include_section_group): Check for
16196 invalid section group.
16197
c165fb93
ILT
16198 * object.cc (make_elf_object): Correct test for 64-bit ELF file
16199 header size.
16200
7ef73768
ILT
16201 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
16202 than read for file header.
16203 * archive.cc (Archive::include_member): Likewise.
16204
6194aaab
L
162052008-04-23 Paolo Bonzini <bonzini@gnu.org>
16206
16207 * aclocal.m4: Regenerate.
16208 * configure: Regenerate.
16209
d491d34e
ILT
162102008-04-19 Ian Lance Taylor <iant@google.com>
16211
5ea2bac6
ILT
16212 * version.cc (version_string): Bump to 1.6.
16213
7bc3e21a
ILT
16214 * testsuite/Makefile.am (many_sections_r_test): New target.
16215 (many_sections_r_test_SOURCES): Remove.
16216 (many_sections_r_test_DEPENDENCIES): Remove.
16217 (many_sections_r_test_LDFLAGS): Remove.
16218 (many_sections_r_test_LDADD): Remove.
16219
7fcd3aa9
ILT
16220 * object.cc (Sized_relobj::do_add_symbols): Always pass
16221 local_symbol_count_ to add_from_relobj.
16222
4c94d6ae
ILT
16223 * testsuite/Makefile.am (many_sections_check.h): Only check one in
16224 every thousand variables.
16225 * testsuite/Makefile.in: Rebuild.
16226
d491d34e
ILT
16227 * object.cc (Xindex::initialize_symtab_xindex): New function.
16228 (Xindex::read_symtab_xindex): New function.
16229 (Xindex::sym_xindex_to_shndx): New function.
16230 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
16231 available.
16232 (Sized_relobj::do_initialize_xindex): New function.
16233 (Sized_relobj::do_read_symbols): Adjust section links.
16234 (Sized_relobj::symbol_section_and_value): Add is_ordinary
16235 parameter. Change all callers.
16236 (Sized_relobj::include_section_group): Adjust section links and
16237 symbol section indexes.
16238 (Sized_relobj::do_layout): Adjust section links.
16239 (Sized_relobj::do_count_local_symbols): Adjust section links and
16240 symbol section indexes.
16241 (Sized_relobj::do_finalize_local_symbols): Distinguish between
16242 ordinary and special symbols.
16243 (Sized_relobj::write_local_symbols): Add symtab_xindex and
16244 dynsym_xindex parameters. Change all callers. Adjust section
16245 links. Use SHN_XINDEX when needed.
16246 (Sized_relobj::get_symbol_location_info): Adjust section links.
16247 Don't get fooled by special symbols.
16248 * object.h (class Xindex): Define.
16249 (class Object): Add xindex_ parameter. Declare virtual functoin
16250 do_initialize_xindex.
16251 (Object::adjust_sym_shndx): New function.
16252 (Object::set_xindex): New protected function.
16253 (class Symbol_value): Add is_ordinary_shndx_ field.
16254 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
16255 (Symbol_value::value): Assert ordinary section.
16256 (Symbol_value::initialize_input_to_output_map): Likewise.
16257 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
16258 Change all callers.
16259 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
16260 all callers.
16261 (class Sized_relobj): Update declarations.
16262 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
16263 parameter. Change all callers.
16264 (Sized_relobj::adjust_shndx): New function.
16265 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
16266 field.
16267 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
16268 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
16269 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
16270 (Sized_dynobj::read_dynsym_section): Adjust section links.
16271 (Sized_dynobj::read_dynamic): Likewise.
16272 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
16273 section links.
16274 (Sized_dynobj::do_initialize_xindex): New function.
16275 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
16276 do_initialize_xindex.
16277 (Sized_dynobj::adjust_shndx): New function.
16278 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
16279 dynsym_xindex_ fields.
16280 (Layout::finalize): Add a call to set_section_indexes before
16281 creating the symtab sections.
16282 (Layout::set_section_indexes): Don't do anything if the section
16283 already has a section index.
16284 (Layout::create_symtab_sections): Add shnum parameter. Change
16285 caller. Create .symtab_shndx section if needed.
16286 (Layout::create_shdrs): Add shstrtab_section parameter. Change
16287 caller.
16288 (Layout::allocated_output_section_count): New function.
16289 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
16290 needed.
16291 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
16292 fields. Update declarations.
16293 (Layout::symtab_xindex): New function.
16294 (Layout::dynsym_xindex): New function.
16295 (class Write_symbols_task): Add layout_ field.
16296 (Write_symbols_task::Write_symbols_task): Add layout parameter.
16297 Change caller.
16298 * output.cc (Output_section_headers::Output_section_headers): Add
16299 shstrtab_section parameter. Change all callers.
16300 (Output_section_headers::do_sized_write): Store overflow values
16301 for section count and section string table section index in
16302 section header zero.
16303 (Output_file_header::do_sized_write): Check for overflow of
16304 section count and section string table section index.
16305 (Output_symtab_xindex::do_write): New function.
16306 (Output_symtab_xindex::endian_do_write): New function.
16307 * output.h (class Output_section_headers): Add shstrtab_section_.
16308 Update declarations.
16309 (class Output_symtab_xindex): Define.
16310 (Output_section::has_out_shndx): New function.
16311 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
16312 field.
16313 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
16314 Change all callers.
16315 (Sized_symbol::init): Likewise.
16316 (Symbol::output_section): Check for ordinary symbol.
16317 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
16318 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
16319 callers.
16320 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
16321 Change all callers. Simplify handling of symbols from sections
16322 not included in the link.
16323 (Symbol_table::add_from_dynobj): Handle ordinary symbol
16324 distinction.
16325 (Weak_alias_sorter::operator()): Assert that symbols are
16326 ordinary.
16327 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
16328 distinction.
16329 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
16330 parameters. Change all callers.
16331 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
16332 symbol distinction. Use SHN_XINDEX when needed.
16333 (Symbol_table::write_section_symbol): Add symtab_xindex
16334 parameter. Change all callers.
16335 (Symbol_table::sized_write_section_symbol): Likewise. Use
16336 SHN_XINDEX when needed.
16337 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
16338 declarations.
16339 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
16340 (Symbol::is_defined): Check is_ordinary.
16341 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
16342 (Symbol::is_absolute, Symbol::is_common): Likewise.
16343 (class Sized_symbol): Update declarations.
16344 (class Symbol_table): Update declarations.
16345 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
16346 parameters. Change all callers.
16347 (Sized_symbol::override): Likewise.
16348 (Symbol_table::override): Likewise.
16349 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
16350 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
16351 is_ordinary, and orig_st_shndx parameters. Change all callers.
16352 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
16353 to be in an ordinary section.
16354 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
16355 object and is_ordinary parameters. Change all callers.
16356 (Sized_dwarf_line_info::read_relocs): Add object parameter.
16357 Change all callers. Don't add undefined or non-ordinary symbols
16358 to reloc_map_.
16359 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
16360 Change all callers.
16361 * dwarf_reader.h (class Sized_dwarf_line_info): Update
16362 declarations.
16363 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
16364 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
16365 (Sized_relobj::relocate_sections): Likewise.
16366 * target-reloc.h (scan_relocs): Adjust section symbol index.
16367 (scan_relocatable_relocs): Likewise.
16368 * i386.cc (Scan::local): Check for ordinary symbols.
16369 * sparc.cc (Scan::local): Likewise.
16370 * x86_64.cc (Scan::local): Likewise.
16371 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
16372 to symbol_section_and_value.
16373 * testsuite/many_sections_test.cc: New file.
16374 * testsuite/Makefile.am (BUILT_SOURCES): Define.
16375 (check_PROGRAMS): Add many_sections_test.
16376 (many_sections_test_SOURCES): Define.
16377 (many_sections_test_DEPENDENCIES): Define.
16378 (many_sections_test_LDFLAGS): Define.
16379 (BUILT_SOURCES): Add many_sections_define.h.
16380 (many_sections_define.h): New target.
16381 (BUILT_SOURCES): Add many_sections_check.h.
16382 (many_sections_check.h): New target.
16383 (check_PROGRAMS): Add many_sections_r_test.
16384 (many_sections_r_test_SOURCES): Define.
16385 (many_sections_r_test_DEPENDENCIES): Define.
16386 (many_sections_r_test_LDFLAGS): Define.
16387 (many_sections_r_test_LDADD): Define.
16388 (many_sections_r_test.o): New target.
16389 * testsuite/Makefile.in: Rebuild.
16390
c5818ff1
CC
163912008-04-17 Cary Coutant <ccoutant@google.com>
16392
16393 * errors.cc (Errors::info): New function.
16394 (gold_info): New function.
16395 * errors.h (Errors::info): New function.
16396 * gold.h (gold_info): New function.
16397 * object.cc (Input_objects::add_object): Print trace output.
16398 * options.cc (options::parse_set): New function.
16399 (General_options::parse_wrap): Deleted.
16400 (General_options::General_options): Deleted initializer.
16401 * options.h (options::String_set): New typedef.
16402 (options::parse_set): New function.
16403 (DEFINE_set): New macro.
16404 (General_options::wrap): Changed to use DEFINE_set. Changed
16405 callers of any_wrap_symbols and is_wrap_symbol.
16406 (General_options::trace, General_options::trace_symbol):
16407 New options.
16408 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
16409 (General_options::wrap_symbols_): Deleted.
16410 * symtab.cc (Symbol_table::add_from_object): Print trace output.
16411
b5be4a7c
DM
164122008-04-17 David S. Miller <davem@davemloft.net>
16413
16414 * options.cc (General_options::parse_V): New function.
16415 * options.h: Add entries for -V and -Qy.
16416
155a0dd7
ILT
164172008-04-17 Ian Lance Taylor <iant@google.com>
16418
16419 * common.cc (Symbol_table::allocate_commons): Remove options
16420 parameter. Change caller.
16421 (Symbol_table::do_allocate_commons): Remove options parameter.
16422 Change caller. Just call do_allocate_commons_list twice.
16423 (Symbol_table::do_allocate_commons_list): New function, broken out
16424 of do_allocate_commons.
16425 * common.h (class Allocate_commons_task): Remove options_ field.
16426 Update constructor.
16427 * symtab.cc (Symbol_table::Symbol_table): Initialize
16428 tls_commons_.
16429 (Symbol_table::add_from_object): Put TLS common symbols on
16430 tls_commons_ list.
16431 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
16432 which are IN_OUTPUT_DATA.
16433 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
16434 allocate_commons and do_allocate_commons declarations. Declare
16435 do_allocate_commons_list.
16436 * gold.cc (queue_middle_tasks): Update creation of
16437 Allocate_commons_task to not pass options.
16438 * testsuite/Makefile.am (INCLUDES): Add -I.. .
16439 (TLS_TEST_C_FLAGS): New variable.
16440 (tls_test_c_pic.o): New target.
16441 (tls_test_shared.so): Link in tls_test_c_pic.o.
16442 (tls_test_c_pic_ie.o): New target.
16443 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
16444 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
16445 (tls_test_c.o): New target.
16446 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
16447 (tls_pic_test_LDADD): Likewise.
16448 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
16449 (tls_shared_gd_to_ie_test_LDADD): Likewise.
16450 (tls_test_c_gnu2.o): New target.
16451 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
16452 tls_test_c_gnu2.o.
16453 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
16454 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
16455 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
16456 * testsuite/tls_test.cc: Include "config.h".
16457 (t_last): Call t11_last.
16458 * testsuite/tls_test.h (t11, t11_last): Declare.
16459 * testsuite/tls_test_c.c: New file.
16460 * testsuite/tls_test_main.cc (thread_routine): Call t11.
16461 * configure.ac: Check for OpenMP support.
16462 * configure, config.in, Makefile.in: Rebuild.
16463 * testsuite/Makefile.in: Rebuild.
16464
edfbb029
CC
164652008-04-16 Cary Coutant <ccoutant@google.com>
16466
16467 * i386.cc (Target_i386::define_tls_base_symbol): New function.
16468 (Target_i386::tls_base_symbol_defined_): New field.
16469 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16470 (Target_i386::Scan::global): Likewise.
16471 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
16472 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
16473 (Target_x86_64::tls_base_symbol_defined_): New field.
16474 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16475 (Target_x86_64::Scan::global): Likewise.
16476
f3c69fca
CC
164772008-04-16 Cary Coutant <ccoutant@google.com>
16478
16479 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
16480 (Symbol::needs_plt_entry): Allow weak undefined symbols.
16481 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
16482 building shared libraries.
16483 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
16484 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
16485 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
16486 * testsuite/Makefile.in: Rebuild.
16487 * testsuite/weak_undef.h: New file.
16488 * testsuite/weak_undef_file1.cc: Add extra test cases.
16489 * testsuite/weak_undef_file2.cc: Likewise.
16490 * testsuite/weak_undef_test.cc: Likewise.
16491
7c414435
DM
164922008-04-16 David S. Miller <davem@davemloft.net>
16493
32b769e1
DM
16494 * sparc.cc (Target_sparc::Scan): Change from struct to class.
16495 Add issued_non_pic_error_ field. Declare check_non_pic.
16496 (Target_sparc::Scan::check_non_pic): New function.
16497 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
16498 (Target_sparc::Scan::global): Likewise.
16499
11936fb1
DM
16500 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
16501 * configure: Rebuild.
16502
7c414435
DM
16503 * options.h (DEFINE_enable): New macro.
16504 (new_dtags): New enable option.
16505 (initfirst, interpose, loadfltr, nodefaultlib,
16506 nodelete, nodlopen, nodump): New -z options.
16507 * layout.cc (Layout:finish_dynamic_section): If new
16508 dtags enabled, emit DT_RUNPATH. Also, emit a
16509 DT_FLAGS_1 containing any specified -z flags.
16510
85c7bf8b
ILT
165112008-04-16 Ian Lance Taylor <iant@google.com>
16512
12c0daef
ILT
16513 * copy-relocs.cc: New file.
16514 * copy-relocs.h: New file.
16515 * reloc.cc: Remove Copy_relocs code.
16516 * reloc.h: Likewise.
16517 * reloc-types.h (struct Reloc_types) [both versions]: Add
16518 get_reloc_addend_noerror.
16519 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
16520 variants of add_global which take an addend which must be zero.
16521 * i386.cc: Include "copy-relocs.h".
16522 (class Target_i386): Change type of copy_relocs_ to variable,
16523 update initializer.
16524 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
16525 Change all callers.
16526 (Target_i386::do_finalize_sections): Change handling of
16527 copy_relocs_.
16528 * sparc.cc: Include "copy-relocs.h".
16529 (class Target_sparc): Change type of copy_relocs_ to variable,
16530 update initializer.
16531 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
16532 Change all callers.
16533 (Target_sparc::do_finalize_sections): Change handling of
16534 copy_relocs_.
16535 * x86_64.cc: Include "copy-relocs.h".
16536 (class Target_x86_64): Change type of copy_relocs_ to variable,
16537 update initializer.
16538 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
16539 class. Change all callers.
16540 (Target_x86_64::do_finalize_sections): Change handling of
16541 copy_relocs_.
16542 * Makefile.am (CCFILES): Add copy-relocs.cc.
16543 (HFILES): Add copy-relocs.h.
16544
4f4995b6
ILT
16545 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
16546
85c7bf8b
ILT
16547 * testsuite/script_test_4.sh: Permit leading zeroes.
16548
4f2a9edd
ILT
165492008-04-15 Ian Lance Taylor <iant@google.com>
16550
e6188289
ILT
16551 * script-sections.cc (Script_sections::create_segments): Use
16552 header_size_adjustment even when there is enough room for the
16553 headers.
16554 * testsuite/script_test_4.sh: New file.
16555 * testsuite/script_test_4.t: New file.
16556 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
16557 (check_DATA): Add script_test_4.stdout.
16558 (MOSTLYCLEANFILES): Likewise.
16559 (script_test_4): New target.
16560 (script_test_4.stdout): New target.
16561 * testsuite/Makefile.in: Rebuild.
16562
4f2a9edd
ILT
16563 * sparc.cc: Add definitions for Output_data_plt_sparc class
16564 constants.
16565
f5314dd5
DM
165662008-04-14 David S. Miller <davem@davemloft.net>
16567
16568 * sparc.cc: New file.
16569 * Makefile.am (TARGETSOURCES): Add sparc.cc
16570 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
16571 * configure.tgt: Document targ_extra_size and
16572 targ_extra_big_endian. Add entries for sparc-* and
16573 sparc64-*.
16574 * configure.ac: Handle targ_extra_size and
16575 targ_extra_big_endian.
16576 * Makefile.in: Rebuild.
16577 * configure: Likewise.
16578 * po/POTFILES.in: Likewise.
16579 * po/gold.pot: Likewise.
16580
154e0e9a
ILT
165812008-04-14 Ian Lance Taylor <iant@google.com>
16582
16583 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
16584 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
16585 in the name/type/flags to section mapping. Don't call
16586 allocate_output_section.
16587 (Layout::choose_output_section): Change parameter from adjust_name
16588 to is_input_section. Don't permit input sections after sections
16589 are attached to segments. Don't call allocate_output_section.
16590 (Layout::layout_eh_frame): Call update_flags_for_input_section,
16591 not write_enable_output_section.
16592 (Layout::make_output_section): Don't push to
16593 unattached_section_list_ nor call attach_to_segment. Call
16594 attach_section_to_segment if sections are attached.
16595 (Layout::attach_sections_to_segments): New function.
16596 (Layout::attach_section_to_segment): New function.
16597 (Layout::attach_allocated_section_to_segment): Rename from
16598 attach_to_segment. Remove flags parameter.
16599 (Layout::allocate_output_section): Remove function.
16600 (Layout::write_enable_output_section): Remove function.
16601 * layout.h (class Layout): Update for above changes. Add new
16602 field sections_are_attached_.
16603 * output.h (Output_section::update_flags_for_input_section): New
16604 function.
16605 * output.cc (Output_section::add_input_section): Call
16606 update_flags_for_input_section.
16607 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
16608
009a67a2
CC
166092008-04-11 Cary Coutant <ccoutant@google.com>
16610
16611 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
16612 thought unnecessary.
16613 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
16614
759b1a24
ILT
166152008-04-11 Ian Lance Taylor <iant@google.com>
16616
16617 * output.h (class Output_section_data): Remove inline definition
16618 of set_addralign.
16619 * output.cc (Output_section_data::set_addralign): New function.
16620
c2b45e22
CC
166212008-04-11 Cary Coutant <ccoutant@google.com>
16622
16623 Add support for TLS descriptors for i386 and x86_64.
16624 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
16625 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
16626 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
16627 GOT_TYPE_TLS_DESC.
16628 (Target_i386::got_mod_index_entry): Remove unnecessary code.
16629 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
16630 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
16631 relocations.
16632 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
16633 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
16634 Fix problem with initial-exec relocations.
16635 (Target_i386::Relocate::relocate_tls): Likewise.
16636 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
16637 relaxation.
16638 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
16639 support for section-plus-offset dynamic table entries.
16640 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
16641 (Output_data_dynamic::Dynamic_entry): Add support for
16642 section-plus-offset dynamic table entries.
16643 (Output_data_dynamic::Classification): Likewise.
16644 (Output_data_dynamic::classification_): Renamed offset_.
16645 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
16646 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
16647 (Target_x86_64::make_plt_section): New function.
16648 (Target_x86_64::reserve_tlsdesc_entries): New function.
16649 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
16650 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
16651 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
16652 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
16653 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
16654 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
16655 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
16656 add extra PLT entry for TLS descriptors.
16657 (Output_data_plt_x86_64::got_): New field.
16658 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
16659 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
16660 fields.
16661 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
16662 descriptors.
16663 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
16664 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
16665 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
16666 R_386_TLS_DESC_CALL relocations.
16667 (Target_x86_64::Scan::global): Likewise.
16668 (Target_x86_64::do_finalize_sections): Add dynamic table entries
16669 for TLS descriptors.
16670 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
16671 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
16672 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
16673 GD-to-IE relaxation.
16674 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
16675 and TLS_DESCRIPTORS.
16676 * Makefile.in: Rebuild.
16677 * configure: Rebuild.
16678 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
16679 (tls_test_shared2.so): New target.
16680 (tls_shared_gd_to_ie_test_SOURCES): New variable.
16681 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
16682 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
16683 (tls_shared_gd_to_ie_test_LDADD): New variable.
16684 (tls_shared_gnu2_gd_to_ie_test): New target.
16685 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
16686 New targets.
16687 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
16688 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
16689 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
16690 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
16691 (tls_shared_gnu2_test): New target.
16692 (tls_test_gnu2_shared.so): New target.
16693 (tls_shared_gnu2_test_SOURCES): New variable.
16694 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
16695 (tls_shared_gnu2_test_LDFLAGS): New variable.
16696 (tls_shared_gnu2_test_LDADD): New variable.
16697 * testsuite/Makefile.in: Rebuild.
16698 * testsuite/Makefile.
16699
83bfb6b7
ILT
167002008-04-11 Ian Lance Taylor <iant@google.com>
16701
16702 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
16703 justsyms.t.
16704 * testsuite/Makefile.in: Rebuild.
16705
16706 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
16707 long.
16708 * testsuite/script_test_2.cc (main): Adjust test.
16709
706e1f5e
ILT
167102008-04-11 David S. Miller <davem@davemloft.net>
16711 Ian Lance Taylor <iant@google.com>
16712
16713 * options.h (General_options): Add entries for '-Y' and
16714 '-relax'.
16715 * options.cc (General_options:finalize): If -Y was used, add those
16716 entries to the library path instead of the default "/lib" and
16717 "/usr/lib".
16718
7c98e6bb
DM
167192008-04-11 David S. Miller <davem@davemloft.net>
16720
16721 * testsuite/justsyms.t: Start at 0x100.
16722 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
16723 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
16724 long.
16725 * testsuite/script_test_2.cc: Adjust string and section length
16726 checks.
7c98e6bb 16727
99a37bfd
ILT
167282008-04-09 Ian Lance Taylor <iant@google.com>
16729
2cefc357
ILT
16730 PR gold/5996
16731 * script-sections.cc (Sections_element::allocate_to_segment): Add
16732 orphan parameter.
16733 (Output_section_definition::allocate_to_segment): Likewise.
16734 (Orphan_output_section::allocate_to_segment): Likewise.
16735 (Script_sections::attach_sections_using_phdrs_clause): Don't
16736 propagate non-PT_LOAD segments to orphan sections.
16737 * testsuite/Makefile.am (script_test_3.stdout): Generate using
16738 readelf rather than objdump.
16739 * testsuite/script_test_3.sh: Adjust accordingly. Test that
16740 .interp section and PT_INTERP segment are the same size.
16741 * testsuite/Makefile.in: Rebuild.
16742
99a37bfd
ILT
16743 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
16744 aliases for symbols defined in the same object.
16745 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
16746 (weak_alias_test_SOURCES): New variable.
16747 (weak_alias_test_DEPENDENCIES): New variable.
16748 (weak_alias_test_LDFLAGS): New variable.
16749 (weak_alias_test_LDADD): New variable.
16750 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
16751 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
16752 (weak_alias_test_3.o): New target.
16753 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
16754 * testsuite/weak_alias_test_main.cc: New file.
16755 * testsuite/weak_alias_test_1.cc: New file.
16756 * testsuite/weak_alias_test_2.cc: New file.
16757 * testsuite/weak_alias_test_3.cc: New file.
16758
780e49c5
ILT
167592008-04-08 Ian Lance Taylor <iant@google.com>
16760
cdb0b8f5
ILT
16761 * options.h (class General_options): Add --noinhibit-exec option.
16762 * main.cc (main): Check --noinhibit-exec.
16763
0864d551
ILT
16764 * options.h (class General_options): Define --wrap as a special
16765 option. Add wrap_symbols_ field.
16766 (General_options::any_wrap_symbols): New function.
16767 (General_options::is_wrap_symbol): New function.
16768 * options.cc (General_options::parse_wrap): New function.
16769 (General_options::General_options): Initialize wrap_symbols_.
16770 * symtab.cc (Symbol_table::wrap_symbol): New function.
16771 (Symbol_table::add_from_object): Handle --wrap.
16772 * symtab.h (class Symbol_table): Declare wrap_symbol.
16773 * target.h (Target::wrap_char): New function.
16774 (Target::Target_info): Add wrap_char field.
16775 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
16776 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
16777 * testsuite/testfile.cc (Target_test::test_target_info):
16778 Likewise.
16779
789aa6de
ILT
16780 * errors.cc (Errors::undefined_symbol): Mention symbol version if
16781 there is one.
16782
2c38906f
ILT
16783 * layout.h (class Layout): Add added_eh_frame_data_ field.
16784 * layout.cc (Layout::Layout): Initialize new field.
16785 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
16786 output section until we find a section we merged successfully.
16787 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
16788 that the size be non-zero.
16789
780e49c5
ILT
16790 * merge.cc (Object_merge_map::get_output_offset): Remove inline
16791 qualifier.
16792
7fcd0256
ILT
167932008-04-08 Craig Silverstein <csilvers@google.com>
16794
16795 * configure.ac: Export new conditional variable HAVE_ZLIB.
16796 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
16797 on HAVE_ZLIB.
16798 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
16799 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16800
6835af53
ILT
168012008-04-07 Ian Lance Taylor <iant@google.com>
16802
e24f324c
ILT
16803 * version.cc (version_string): Set to "1.5".
16804
a036edd8
ILT
16805 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
16806 Add issued_non_pic_error_ field. Declare check_non_pic.
16807 (Target_x86_64::Scan::check_non_pic): New function.
16808 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
16809 (Target_x86_64::Scan::global): Likewise.
16810
624f8810
ILT
16811 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
16812 addend parameter. Change caller. Handle merge sections.
16813 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
16814 Address to Addend. Don't add in the result of
16815 local_section_offset, pass down the addend and use the returned
16816 value.
16817 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
16818 Update declarations of local_section_offset and symbol_value.
16819 * testsuite/two_file_test_1.cc (t18): New function.
16820 * testsuite/two_file_test_2.cc (f18): New function.
16821 * testsuite/two_file_test_main.cc (main): Call t18.
16822 * testsuite/two_file_test.h (t18, f18): Declare.
16823
6835af53
ILT
16824 * configure.ac: Don't test for objdump, c++filt, or readelf.
16825 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
16826 conditionals.
16827 (TEST_READELF): New variable.
16828 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
16829 (check_PROGRAMS): Add two_file_strip_test.
16830 (two_file_strip_test): New target.
16831 (check_PROGRAMS): Add two_file_same_shared_strip_test.
16832 (two_file_same_shared_strip_test_SOURCES): New variable.
16833 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
16834 (two_file_same_shared_strip_test_LDFLAGS): New variable.
16835 (two_file_same_shared_strip_test_LDADD): New variable.
16836 (two_file_shared_strip.so): New target.
16837 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
16838 (ver_test_5.syms, ver_test_7.syms): Likewise.
16839 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
16840 (strip_test_3.stdout): Use TEST_OBJDUMP.
16841 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16842
86925eef
CC
168432008-04-04 Cary Coutant <ccoutant@google.com>
16844
16845 * symtab.h (Symbol::is_weak_undefined): New function.
16846 (Symbol::is_strong_undefined): New function.
16847 (Symbol::is_absolute): New function.
16848 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
16849 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
16850 absolute symbols.
16851 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
16852 (weak_undef_test): New target.
16853 * testsuite/Makefile.in: Rebuild.
16854 * testsuite/weak_undef_file1.cc: New file.
16855 * testsuite/weak_undef_file2.cc: New file.
16856 * testsuite/weak_undef_test.cc: New file.
16857
126f3ece
ILT
168582008-04-03 Craig Silverstein <csilvers@google.com>
16859
16860 * compressed_output.h (class Output_compressed_section): Use
16861 unsigned buffer.
16862 * compressed_output.cc (zlib_compress): Use unsigned buffers,
16863 add zlib header.
16864 (zlib_compressed_suffix): Removed.
16865 (Output_compressed_section::set_final_data_size): Use unsigned
16866 buffers.
16867 * testsuite/Makefile.am (flagstest_compress_debug_sections):
16868 Fix linker invocation.
16869 (flagstest_o_specialfile_and_compress_debug_sections):
16870 Likewise.
16871 * testsuite/Makefile.in: Regenerated.
16872
deae2a14
DM
168732008-04-02 David S. Miller <davem@davemloft.net>
16874
16875 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
16876 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
16877
70752818
ILT
168782008-04-02 Craig Silverstein <csilvers@google.com>
16879
16880 * TODO: New file.
16881
39d0cb0e
ILT
168822008-04-02 Ian Lance Taylor <iant@google.com>
16883
16884 * fileread.cc (File_read::find_view): Add byteshift and vshifted
16885 parameters. Update for new key type to views_. Change all
16886 callers.
16887 (File_read::read): Adjust for byteshift in returned view.
16888 (File_read::add_view): New function, broken out of
16889 find_and_make_view.
16890 (File_read::make_view): New function, broken out of
16891 find_and_make_view.
16892 (File_read::find_or_make_view): Add offset and aligned
16893 parameters. Rewrite accordingly. Change all callers.
16894 (File_read::get_view): Add offset and aligned parameters. Adjust
16895 for byteshift in return value.
16896 (File_read::get_lasting_view): Likewise.
16897 * fileread.h (class File_read): Update declarations.
16898 (class File_read::View): Add byteshift_ field. Add byteshift to
16899 constructor. Add byteshift method.
16900 * archive.h (Archive::clear_uncached_views): New function.
16901 (Archive::get_view): Add aligned parameter. Change all callers.
16902 * object.h (Object::get_view): Add aligned parameter. Change all
16903 callers.
16904 (Object::get_lasting_view): Likewise.
16905
16906 * fileread.cc (File_read::release): Don't call clear_views if
16907 there are multiple objects.
16908 * fileread.h (File_read::clear_uncached_views): New function.
16909 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
16910 on the archive.
16911
a1207466
CC
169122008-03-31 Cary Coutant <ccoutant@google.com>
16913
16914 Add thin archive support.
16915 * archive.cc (Archive::armagt): New const.
16916 (Archive::setup): Remove task parameter and calls to unlock.
16917 (Archive::unlock_nested_archives): New function.
16918 (Archive::read_header): Add nested_off parameter. Change
16919 all callers.
16920 (Archive::interpret_header): Likewise.
16921 (Archive::include_all_members): Change to handle thin
16922 archives.
16923 (Archive::include_member): Likewise.
16924 * archive.h (Archive::Archive): Add new parameters and
16925 initializers.
16926 (Archive::armagt): New const.
16927 (Archive::setup): Remove task parameter.
16928 (Archive::unlock_nested_archives): New function.
16929 (Archive::read_header): Add nested_off parameter.
16930 (Archive::interpret_header): Likewise.
16931 (Archive::Nested_archive_table): New typedef.
16932 (Archive::is_thin_archive_): New field.
16933 (Archive::nested_archives_): New field.
16934 (Archive::options_): New field.
16935 (Archive::dirpath_): New field.
16936 (Archive::task_): New field.
16937 * readsyms.cc (Read_symbols::do_read_symbols): Add check
16938 for thin archives. Pass additional parameters to
16939 Archive::Archive. Unlock the archive file after calling
16940 Archive::setup.
cd536b21 16941
479f6503
ILT
169422008-03-29 Ian Lance Taylor <iant@google.com>
16943
686c8caf
ILT
16944 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
16945 version symbol to be local.
16946 * testsuite/ver_test_4.sh: New file.
16947 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
16948 (check_DATA): Add ver_test_4.syms.
16949 (ver_test_4.syms): New target.
16950 * testsuite/Makefile.in: Rebuild.
16951
ab794b6b
ILT
16952 * output.cc
16953 (Output_section::Input_section_sort_entry::has_priority): New
16954 function.
16955 (Output_section::Input_section_sort_entry::match_file_name): New
16956 function.
16957 (Output_section::Input_section_sort_entry::match_section_name):
16958 Remove.
16959 (Output_section::Input_section_sort_entry::match_section_name_prefix):
16960 Remove.
16961 (Output_section::Input_section_sort_entry::match_section_file):
16962 Remove.
16963 (Output_section::Input_section_sort_compare::operator()): Rewrite
16964 using new Input_section_sort_entry functions. Sort crtbegin and
16965 crtend first. Sort sections with no priority before sections with
16966 a priority.
16967 * testsuite/initpri1.c (d3): Check j != 4.
16968 (cd5): New constructor/destructor function.
16969 (main): Check j != 2.
16970
479f6503
ILT
16971 * symtab.cc (Symbol_table::add_from_object): If we don't use the
16972 new symbol when resolving, don't call set_is_default.
16973 * testsuite/ver_test_7.cc: New file.
16974 * testsuite/ver_test_7.sh: New file.
16975 * testsuite/Makefile.am (ver_test_7.so): New target.
16976 (ver_test_7.o): New target.
16977 (check_SCRIPTS): Add ver_test_7.sh.
16978 (check_DATA): Add ver_test_7.syms.
16979 (ver_test_7.syms): New target.
16980
2fd32231
ILT
169812008-03-28 Ian Lance Taylor <iant@google.com>
16982
16983 * layout.cc (Layout::layout): If we see an input section with a
16984 name that needs sorting, set the must_sort flag for the output
16985 section.
16986 (Layout::make_output_section): If the name of the output section
16987 indicates that it might require sorting, set the may_sort flag.
16988 * output.h (Output_section::may_sort_attached_input_sections): New
16989 function.
16990 (Output_section::set_may_sort_attached_input_sections): New
16991 function.
16992 (Output_section::must_sort_attached_input_sections): New
16993 function.
16994 (Output_section::set_must_sort_attached_input_sections): New
16995 function.
16996 (class Output_section): Declare Input_section_sort_entry. Define
16997 Input_section_sort_compare. Declare
16998 sort_attached_input_sections. Add new fields:
16999 may_sort_attached_input_sections_,
17000 must_sort_attached_input_sections_,
17001 attached_input_sections_are_sorted_.
17002 * output.cc (Output_section::Output_section): Initialize new
17003 fields.
17004 (Output_section::add_input_section): Add an entry to
17005 input_sections_ if may_sort or must_sort are true.
17006 (Output_section::set_final_data_size): Call
17007 sort_attached_input_sections if necessary.
17008 (Output_section::Input_section_sort_entry): Define new class.
17009 (Output_section::Input_section_sort_compare::operator()): New
17010 function.
17011 (Output_section::sort_attached_input_sections): New function.
17012 * configure.ac: Check whether the compiler supports constructor
17013 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
17014 * testsuite/initpri1.c: New file.
17015 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
17016 CONSTRUCTOR_PRIORITY.
17017 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
17018 (initpri1_LDFLAGS): New variable.
17019 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17020
18e6b24e
ILT
170212008-03-27 Ian Lance Taylor <iant@google.com>
17022
49bdd526
ILT
17023 * common.cc (Sort_commons::operator): Correct sorting algorithm.
17024 * testsuite/common_test_1.c: New file.
17025 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
17026 (common_test_1_SOURCES): New variable.
17027 (common_test_1_DEPENDENCIES): New variable.
17028 (common_test_1_LDFLAGS): New variable.
17029
18e6b24e
ILT
17030 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
17031 and commons_ correctly when NAME/VERSION does not override
17032 NAME/NULL.
17033 * testsuite/ver_test_6.c: New file.
17034 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
17035 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
17036 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
17037
04bf7072
ILT
170382008-03-26 Ian Lance Taylor <iant@google.com>
17039
5871526f
ILT
17040 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
17041 of an undefined symbol from a version script.
17042 * testsuite/Makefile.am (ver_test_5.so): New target.
17043 (ver_test_5.o): New target.
17044 (check_SCRIPTS): Add ver_test_5.sh.
17045 (check_DATA): Add ver_test_5.syms.
17046 (ver_test_5.syms): New target.
17047 * testsuite/ver_test_5.cc: New file.
17048 * testsuite/ver_test_5.script: New file.
17049 * testsuite/ver_test_5.sh: New file.
17050 * Makefile.in, testsuite/Makefile.in: Rebuild.
17051
04bf7072
ILT
17052 PR gold/5986
17053 Fix problems building gold with gcc 4.3.0.
17054 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
17055 (gold_error_at_location, gold_warning_at_location): Use it.
17056 * configure.ac: Check whether we can compile and use a template
17057 function with a printf attribute.
17058 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
17059 when jumping over bytes.
17060 * object.cc: Instantiate Object::read_section_data.
17061 * debug.h: Include <cstring>
17062 * dwarf_reader.cc: Include <algorithm>
17063 * main.cc: Include <cstring>.
17064 * options.cc: Include <cstring>.
17065 * output.cc: Include <cstring>.
17066 * script.cc: Include <cstring>.
17067 * script.h: Include <string>.
17068 * symtab.cc: Include <cstring> and <algorithm>.
17069 * target-select.cc: Include <cstring>.
17070 * version.cc: Include <string>.
17071 * testsuite/testmain.cc: Include <cstdlib>.
17072 * configure, config.in: Rebuild.
17073
874c5b28
ILT
170742008-03-25 Ian Lance Taylor <iant@google.com>
17075
819d6c3a
ILT
17076 * options.cc: Include "../bfd/bfdver.h".
17077 (options::help): Print bug reporting address.
17078
f4b2c6f5
ILT
17079 * version.cc (print_version): Adjust output for current value of
17080 BFD_VERSION_STRING.
17081
17082 * NEWS: New file.
17083
e96caa79
ILT
17084 * options.cc (options::help): Print list of supported targets.
17085 * target-select.h: Include <vector>.
17086 (class Target_selector): Make machine_, size_, and is_big_endian_
17087 fields const. Add bfd_name_ and instantiated_target_ fields.
17088 (Target_selector::Target_selector): Add bfd_name parameter.
17089 (Target_selector::recognize): Make non-virtual, call
17090 do_recognize.
17091 (Target_selector::recognize_by_name): Make non-virtual, call
17092 do_recognize_by_name.
17093 (Target_selector::supported_names): New function.
17094 (Target_selector::bfd_name): New function.
17095 (Target_selector::do_instantiate_target): New pure virtual
17096 function.
17097 (Target_selector::do_recognize): New virtual function.
17098 (Target_selector::do_recognize_by_name): New virtual function.
17099 (Target_selector::instantiate_target): New private function.
17100 (supported_target_names): Declare.
17101 * target-select.cc (Target_selector::Target_selector): Update for
17102 new parameter and fields.
17103 (select_target_by_name): Check that the name matches before
17104 calling recognize_by_name.
17105 (supported_target_names): New function.
17106 * i386.cc (class Target_selector_i386): Update Target_selector
17107 constructor call. Remove recognize and recognize_by_name. Add
17108 do_instantiate_target.
17109 * x86_64.cc (class Target_selector_x86_64): Likewise.
17110 * testsuite/testfile.cc (class Target_selector_test): Update for
17111 changes to Target_selector.
17112
874c5b28
ILT
17113 * README: Rewrite, with some notes on unsupported features.
17114
0a65a3a7
CC
171152008-03-24 Cary Coutant <ccoutant@google.com>
17116
17117 * i386.cc (Target_i386::Got_type): New enum declaration.
17118 (Target_i386::Scan::local): Updated callers of Output_data_got
17119 member functions.
17120 (Target_i386::Scan::global): Likewise.
17121 (Target_i386::Relocate::relocate): Likewise.
17122 (Target_i386::Relocate::relocate_tls): Likewise.
17123 * object.h (Got_offset_list): New class.
17124 (Sized_relobj::local_has_got_offset): Added got_type parameter.
17125 (Sized_relobj::local_got_offset): Likewise.
17126 (Sized_relobj::set_local_got_offset): Likewise.
17127 (Sized_relobj::local_has_tls_got_offset): Removed.
17128 (Sized_relobj::local_tls_got_offset): Removed.
17129 (Sized_relobj::set_local_tls_got_offset): Removed.
17130 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
17131 * output.cc (Output_data_got::add_global): Added got_type parameter.
17132 (Output_data_got::add_global_with_rel): Likewise.
17133 (Output_data_got::add_global_with_rela): Likewise.
17134 (Output_data_got::add_global_pair_with_rel): New function.
17135 (Output_data_got::add_global_pair_with_rela): New function.
17136 (Output_data_got::add_local): Added got_type parameter.
17137 (Output_data_got::add_local_with_rel): Likewise.
17138 (Output_data_got::add_local_with_rela): Likewise.
17139 (Output_data_got::add_local_pair_with_rel): New function.
17140 (Output_data_got::add_local_pair_with_rela): New function.
17141 (Output_data_got::add_global_tls): Removed.
17142 (Output_data_got::add_global_tls_with_rel): Removed.
17143 (Output_data_got::add_global_tls_with_rela): Removed.
17144 (Output_data_got::add_local_tls): Removed.
17145 (Output_data_got::add_local_tls_with_rel): Removed.
17146 (Output_data_got::add_local_tls_with_rela): Removed.
17147 * output.h (Output_data_got::add_global): Added got_type parameter.
17148 (Output_data_got::add_global_with_rel): Likewise.
17149 (Output_data_got::add_global_with_rela): Likewise.
17150 (Output_data_got::add_global_pair_with_rel): New function.
17151 (Output_data_got::add_global_pair_with_rela): New function.
17152 (Output_data_got::add_local): Added got_type parameter.
17153 (Output_data_got::add_local_with_rel): Likewise.
17154 (Output_data_got::add_local_with_rela): Likewise.
17155 (Output_data_got::add_local_pair_with_rel): New function.
17156 (Output_data_got::add_local_pair_with_rela): New function.
17157 (Output_data_got::add_global_tls): Removed.
17158 (Output_data_got::add_global_tls_with_rel): Removed.
17159 (Output_data_got::add_global_tls_with_rela): Removed.
17160 (Output_data_got::add_local_tls): Removed.
17161 (Output_data_got::add_local_tls_with_rel): Removed.
17162 (Output_data_got::add_local_tls_with_rela): Removed.
17163 * resolve.cc (Symbol::override_base_with_special): Removed
17164 reference to has_got_offset_ field.
17165 * symtab.cc (Symbol::init_fields): Replaced initialization
17166 of got_offset_ with got_offsets_. Removed initialization
17167 of has_got_offset_
53fcba31 17168 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
17169 (Symbol::got_offset): Likewise.
17170 (Symbol::set_got_offset): Likewise.
17171 (Symbol::has_tls_got_offset): Removed.
17172 (Symbol::tls_got_offset): Removed.
17173 (Symbol::set_tls_got_offset): Removed.
17174 (Symbol::got_offset_): Removed.
17175 (Symbol::tls_mod_got_offset_): Removed.
17176 (Symbol::tls_pair_got_offset_): Removed.
17177 (Symbol::got_offsets_): New field.
17178 (Symbol::has_got_offset): Removed.
17179 (Symbol::has_tls_mod_got_offset): Removed.
17180 (Symbol::has_tls_pair_got_offset): Removed.
17181 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
17182 (Target_x86_64::Scan::local): Updated callers of Output_data_got
17183 member functions.
17184 (Target_x86_64::Scan::global): Likewise.
17185 (Target_x86_64::Relocate::relocate): Likewise.
17186 (Target_x86_64::Relocate::relocate_tls): Likewise.
17187
bd52eafb
BE
171882008-03-25 Ben Elliston <bje@au.ibm.com>
17189
17190 * yyscript.y: Fix spelling error in comment.
17191
8b105e34
ILT
171922008-03-24 Ian Lance Taylor <iant@google.com>
17193
8ed814a9
ILT
17194 * options.h (class General_options): Define build_id option.
17195 * layout.h (class Layout): Declare write_build_id, create_note,
17196 create_build_id. Add build_id_note_ member.
17197 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
17198 "libiberty.h", "md5.h", "sha1.h".
17199 (Layout::Layout): Initialize eh_frame_data_,
17200 eh_frame_hdr_section_, and build_id_note_.
17201 (Layout::finalize): Call create_build_id.
17202 (Layout::create_note): New function, broken out of
17203 Layout::create_gold_note.
17204 (Layout::create_gold_note): Call create_note.
17205 (Layout::create_build_id): New function.
17206 (Layout::write_build_id): New function.
17207 (Close_task_runner::run): Call write_build_id.
17208
8b105e34
ILT
17209 * x86_64.cc: Correct license to GPLv3.
17210
086a1841
ILT
172112008-03-23 Ian Lance Taylor <iant@google.com>
17212
17213 * options.cc: Include "demangle.h".
17214 (parse_optional_string): New function.
17215 (parse_long_option): Handle takes_optional_argument.
17216 (parse_short_option): Update dash_z initializer. Handle
17217 takes_optional_argument.
17218 (General_options::General_options): Initialize do_demangle_.
17219 (General_options::finalize): Set do_demangle_. Handle demangling
17220 style.
17221 * options.h (parse_optional_string): Declare.
17222 (struct One_option): Add optional_arg field. Update constructor.
17223 Update call constructor calls. Add takes_optional_argument
17224 function.
17225 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
17226 (DEFINE_optional_string): Define.
17227 (General_options::demangle): Change from DEFINE_bool to
17228 DEFINE_optional_string.
17229 (General_options::no_demangle): New function.
17230 (General_options::do_demangle): New function.
17231 (General_options::set_do_demangle): New function.
17232 (General_options::execstack_status_): Move definition to end of
17233 class definition.
17234 (General_options::static_): Likewise.
17235 (General_options::do_demangle_): New field.
17236 * object.cc (big_endian>::get_symbol_location_info): Call
17237 Options::do_demangle, not Options::demangle.
17238 * symtab.cc (demangle): Likewise.
17239
cbb93e63
ILT
172402008-03-22 Ian Lance Taylor <iant@google.com>
17241
17242 * gold.h: Include <cstddef> and <sys/types.h>
17243 * options.h: Include <cstring>.
17244
ec531623
ILT
172452008-03-21 Ian Lance Taylor <iant@google.com>
17246
17247 * Added source code to GNU binutils.
752937aa 17248\f
b90efa5b 17249Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
17250
17251Copying and distribution of this file, with or without modification,
17252are permitted in any medium without royalty provided the copyright
17253notice and this notice are preserved.
17254
17255Local Variables:
17256mode: change-log
17257left-margin: 8
17258fill-column: 74
17259version-control: never
17260End:
This page took 1.090591 seconds and 4 git commands to generate.