Automatic date update in version.in
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
775ed62e
CC
12015-06-02 Cary Coutant <ccoutant@gmail.com>
2
3 * nacl.h (Sniff_file): Switch parameters to get_view to get an
4 aligned view.
5
9c7fe3c5
CC
62015-06-03 Cary Coutant <ccoutant@gmail.com>
7
8 PR gold/17819
9 * gold.cc (queue_final_tasks): When --build-id=tree, queue a
10 separate task to schedule the build id computation.
11 * layout.cc (Hash_task::Hash_task): Remove build_id_blocker,
12 add Output_file and offset.
13 (Hash_task::run): Get and release the input views.
14 (Hash_task::is_runnable): Always return NULL (always runnable).
15 (Layout::queue_build_id_tasks): Remove.
16 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
17 parameters; use them instead of class members.
18 (Build_id_task_runner::run): New function.
19 (Close_task_runner::run): Pass array_of_hashes and size_of_hashes
20 to write_build_id.
21 * layout.h (Layout::queue_build_id_tasks): Remove.
22 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
23 parameters.
24 (Layout::array_of_hashes_): Remove.
25 (Layout::size_of_array_of_hashes_): Remove.
26 (Layout::input_view_): Remove.
27 (Build_id_task_runner): New class.
28 (Close_task_runner::Close_task_runner): Add array_of_hashes and
29 size_of_hashes parameters.
30 (Close_task_runner::array_of_hashes_): New data member.
31 (Close_task_runner::size_of_hashes_): New data member.
32 * testsuite/Makefile.am
33 (flagstest_compress_debug_sections_and_build_id_tree): New test.
34 * testsuite/Makefile.in: Regenerate.
35
400f8944
RÁE
362015-06-01 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
37
38 * merge.cc (get_input_merge_map): Update for data structure change.
39 (get_or_make_input_merge_map): Update for data structure change.
40 * merge.h (Object_merge_map): Use a std::vector<std::pair>> instead of
41 a std::map. Remove first_shnum_, first_map_, second_shnum_, second_map_.
42
bbec1a5d
AM
432015-05-16 Alan Modra <amodra@gmail.com>
44
45 * reloc.cc (Sized_relobj_file::find_functions): Use function_location.
46 * powerpc.cc (Target_powerpc::do_calls_non_split): New function.
47 (addi_12_1, addis_2_12, addis_12_1, cmpld_7_12_0): New constants.
48 (lis_0): Rename from lis_0_0.
49
efc6fa12
CC
502015-04-29 Cary Coutant <cary@google.com>
51 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
52
53 * gc.h (Garbage_collection::is_section_garbage): Change Object*
54 to Relobj*.
55 (Garbage_collection::add_reference): Likewise.
56 (Garbage_collection::gc_process_relocs): Likewise. Don't push
57 object/shndx pair onto *secvec for dynamic objects. Don't follow
58 relocations pointing to dynamic objects for GC.
59 * icf.cc (Icf::find_identical_sections): Change Object* to Relobj*.
60 (Icf::unfold_section): Likewise.
61 (Icf::is_section_folded): Likewise.
62 (Icf::get_folded_section): Likewise.
63 * icf.h: (Icf::get_folded_section): Likewise.
64 (Icf::unfold_section): Likewise.
65 (Icf::is_section_folded): Likewise.
66 (Icf::section_has_function_pointers): Likewise.
67 (Icf::set_section_has_function_pointers): Likewise.
68 * object.h (Section_id): Likewise.
69 (Const_section_id): Likewise.
70 * output.cc (Output_section::update_section_layout): Likewise.
71 * output.h: (Output_section_lookup_maps::find_relaxed_input_section):
72 Likewise.
73 * plugin.cc (update_section_order): Likewise.
74 (unique_segment_for_sections): Likewise.
75 * powerpc.cc (Powerpc_relobj::add_reference): Likewise.
76 (Target_powerpc::do_gc_add_reference): Likewise.
77 (Target_powerpc::gc_process_relocs): Likewise.
78 (Target_powerpc::do_gc_add_reference): Likewise.
79 * symtab.cc (Symbol_table::is_section_folded): Likewise.
80 (Symbol_table::gc_mark_symbol): Likewise.
81 * symtab.h: (Symbol_table::is_section_folded): Likewise.
82 * target.h: (Sized_target::gc_add_reference): Likewise.
83 (Sized_target::do_gc_add_reference): Likewise.
84
f9d3ecaa
NC
852015-04-29 Nick Clifton <nickc@redhat.com>
86
87 * po/fi.po: Updated Finnish translation.
88
faa2211d
AM
892015-04-28 Alan Modra <amodra@gmail.com>
90
91 * powerpc.cc (Target_powerpc::do_dynsym_value): Use Address rather
92 than unsigned int for find_global_entry result temp. Compare
93 against invalid_address.
94 (Target_powerpc::do_plt_address_for_global): Likewise.
95 (Target_powerpc::Relocate::relocate): Likewise. Don't assert
96 on plt call stub existence for debug info. Do assert for plt
97 and global entry stub existence if an alloc section.
98
6ec65f28
AM
992015-04-28 Alan Modra <amodra@gmail.com>
100
101 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
102 on missing global entry stub due to bogus debug info.
103
7a2a1c79
HS
1042015-04-27 Han Shen <shenhan@google.com>
105
106 * options.h (--fix-cortex-a53-843419): Rename option.
107 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
108 option.
109 (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
110
cfbf0e3c
RÁE
1112015-04-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
112
113 PR gold/18327
114 * output.cc (Output_section::is_input_address_mapped): Assume a missing
115 entry is mapped.
116 * testsuite/Makefile.am: Add the eh_test test.
117 * testsuite/Makefile.in: Regenerate.
118 * testsuite/eh_test_a.cc: New test.
119 * testsuite/eh_test_b.cc: New test.
120
6ec65f28
AM
1212015-04-23 Sriraman Tallam <tmsriram@google.com>
122
a100d66f
ST
123 * options.h (--weak-unresolved-symbols): New option.
124 * symtab.cc (Symbol_table::sized_write_globals): Change symbol
125 binding to weak with new option.
126 * symtab.h (is_weak_undefined): Check for new option.
127 (is_strong_undefined): Check for new option.
128 * testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
129 * testsuite/Makefile.in: Regenerate.
130 * testsuite/weak_unresolved_symbols_test.cc: New file.
131
4b889c30
IC
1322015-04-20 Ian Coolidge <icoolidge@google.com>
133
134 * symtab.cc (Symbol::should_add_dynsym_entry): Return true for
135 GNU_UNIQUE.
136
4277535c
RÁE
1372015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
138
139 * gc.cc (Garbage_collection::do_transitive_closure): Use back and
140 push_back.
141 * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
142 * object.cc (Sized_relobj_file::do_layout): Use push_back.
143 * powerpc.cc (process_gc_mark): Use push_back.
144 (Target_powerpc::do_gc_mark_symbol): Use push_back.
145 * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
146
7a2a1c79 1472015-04-16 Han Shen <shenhan@google.com>
5019d64a 148
6ec65f28
AM
149 * aarch64.cc (AArch64_insn_utilities): New utility class.
150 (AArch64_relobj::Mapping_symbol_position): New struct.
151 (AArch64_relobj::Mapping_symbol_info): New typedef.
152 (AArch64_relobj::do_count_local_symbols): New function overriding
153 parent's implementation.
154 (AArch64_relobj::mapping_symbol_info_): New member
155 (AArch64_relobj::scan_erratum_843419): New method.
156 (Target_aarch64::scan_erratum_843419_span): New method.
157 (Target_aarch64::is_erratum_843419_sequence): New method.
158 * options.h (fix_cortex_a53): New option.
5019d64a 159
a6a17750
CC
1602015-04-09 Cary Coutant <ccoutant@google.com>
161
162 * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
163 in a PIE link.
164 * testsuite/Makefile.am (tls_pie_test.sh): New test.
165 * testsuite/Makefile.in: Regenerate.
166 * testsuite/tls_pie_test.sh: New.
167
437ddf0c
CC
1682015-04-09 Cary Coutant <ccoutant@google.com>
169
170 * debug.h (DEBUG_LOCATION): New.
171 (DEBUG_ALL): Include DEBUG_LOCATION.
172 (debug_string_to_enum): Add DEBUG_LOCATION.
173 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
174 output to print correct context.
175 (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
176 up to 4 more locations at the beginning of the function.
177 * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
178 result before sorting list of line numbers.
179 * testsuite/debug_msg.sh: Allow range of line numbers for
180 canonical results on optimized code.
181
24491327
HS
1822015-04-07 HC Yen <hc.yen@mediatek.com>
183
184 Add AArch32 support for gold linker.
185 gold/
186 * arm.cc: Add V8 arch combine table.
187
7fa5525f
RÁE
1882015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
189
190 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
191
5368dcf2
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 call
195 to find by using the return value of insert.
196
9dbb4b02
RÁE
1972015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
198
199 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
200 constructor call.
201
1fa29f10
IT
2022015-04-06 Ilya Tocar <ilya.tocar@intel.com>
203
204 PR gold/17641
205 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
206 (Target_x86_64::Scan::local): Don't create GOT entry, when we
207 can convert mov to lea.
208 (Target_x86_64::Scan::global): Ditto.
209 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
210 %reg to lea foo(%rip), %reg if possible.
211 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
212 * testsuite/x86_64_mov_to_lea1.s: New.
213 * testsuite/x86_64_mov_to_lea2.s: Ditto.
214 * testsuite/x86_64_mov_to_lea3.s: Ditto.
215 * testsuite/x86_64_mov_to_lea4.s: Ditto.
216 * testsuite/x86_64_mov_to_lea.sh: Ditto.
217
39f3de7c
L
2182015-04-02 H.J. Lu <hongjiu.lu@intel.com>
219
220 * configure: Regenerated.
221
c4fc4724
IT
2222015-04-01 Ilya Tocar <ilya.tocar@intel.com>
223
224 PR gold/17640
225 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
226 (Target_i386::Scan::local): Don't create GOT entry, when we
227 can convert GOT to GOTOFF.
228 (Target_i386::Scan::global): Ditto.
229 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
230 lea foo@GOTOFF(%reg), %reg if possible.
231 * testsuite/Makefile.am (i386_mov_to_lea): New test.
232 * testsuite/i386_mov_to_lea1.s: New.
233 * testsuite/i386_mov_to_lea2.s: Ditto.
234 * testsuite/i386_mov_to_lea3.s: Ditto.
235 * testsuite/i386_mov_to_lea4.s: Ditto.
236 * testsuite/i386_mov_to_lea5.s: Ditto.
237 * testsuite/i386_mov_to_lea.sh: Ditto.
238
918357b9
L
2392015-04-01 H.J. Lu <hongjiu.lu@intel.com>
240
241 * Makefile.am (ZLIB): New.
242 (ZLIBINC): Likewise.
243 (AM_CFLAGS): Add $(ZLIBINC).
244 (AM_CXXFLAGS): Likewise.
245 (ldadd_varldadd_var): Add $(ZLIB).
246 (incremental_dump_LDADD): Likewise.
247 (dwp_LDADD): Likewise.
248 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
249 <zlib.h>.
250 (zlib_compress): Don't check HAVE_ZLIB_H.
251 (zlib_decompress): Likewise.
252 * options.h (compress_debug_sections): Likewise.
253 * configure.ac (AM_CONDITIONAL): Removed.
254 * testsuite/Makefile.am (ZLIB): New.
255 (LDADD): Add $(ZLIB).
256 Don't check HAVE_ZLIB.
257 * Makefile.in: Regenerated.
258 * config.in: Likewise.
259 * configure: Likewise.
260 * testsuite/Makefile.in: Likewise.
261
6b0ad2eb
JY
2622015-03-30 Jing Yu <jingyu@google.com>
263
264 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
265 TLSLD_ADD_DTPREL_LO12_NC.
266 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
267 _TLS_MODULE_BASE_ point to the start of tls segment.
268 (Target_aarch64::optimize_tls_reloc): Add cases for
269 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
270 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
271 (Target_aarch64::Scan::local): Likewise.
272 (Target_aarch64::Scan::global): Likewise.
273 (Target_aarch64::Relocate::relocate): Likewise.
274 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
275 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
276 relocations.
277
0916f9e7
RÁE
2782015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
279
280 * merge.cc (Object_merge_map::add_mapping): call
281 Object_merge_map::Input_merge_map::add_mapping.
282 (Object_merge_map::Input_merge_map::add_mapping): New.
283 (Output_merge_data::do_add_input_section): Call
284 get_or_make_input_merge_map before a loop.
285 (Output_merge_string<Char_type>::finalize_merged_data): Call
286 get_or_make_input_merge_map before a loop.
287 * merge.h (Object_merge_map): Make Input_merge_map public.
288 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
289 (Relobj::get_or_create_merge_map): New.
290 * object.h (Relobj::get_or_create_merge_map): New.
291
282c9750
AM
2922015-03-24 Alan Modra <amodra@gmail.com>
293
294 PR 18147
295 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
296 relocation errors for branches to strong undefined symbols.
297
67f95b96
RÁE
2982015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
299
300 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
301 (Object_merge_map::is_merge_section_for): Remove.
302 (Object_merge_map::find_merge_section): New.
303 * merge.h (Object_merge_map::is_merge_section_for): Remove.
304 (Object_merge_map::find_merge_section): New.
305 (Object_merge_map::get_input_merge_map): Add a const version.
306 * object.cc (Relobj::is_merge_section_for): Remove.
307 (Relobj::find_merge_section): New.
308 * object.h (Relobj::is_merge_section_for): Remove.
309 (Relobj::find_merge_section): New.
310 * output.cc
311 (Output_section::Input_section::is_merge_section_for): Remove.
312 (Output_section::add_merge_input_section): Don't call
313 add_merge_input_section.
314 (Output_section::find_merge_section): Return const. Use
315 object->find_merge_section.
316 (Output_section::build_lookup_maps): Don't build a map for
317 merge sections.
318 (Output_section::is_input_address_mapped): Return false if
319 section is not found.
320 (Output_section::find_starting_output_address): Use
321 find_merge_section instead of is_merge_section_for.
322 (Output_section::add_script_input_section): Don't build a map for
323 merge sections.
324 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
325 (Output_section_lookup_maps::find_merge_section): Remove.
326 (Output_section_lookup_maps::add_merge_input_section) Remove.
327 (Output_section::find_merge_section): Return const.
328
152f7024
CC
3292015-03-22 Cary Coutant <cary@google.com>
330
331 PR gold/18106
332 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
333 non-SIB form of lea, with nop after the call.
334
bccffdfd
CC
3352015-03-21 Cary Coutant <cary@google.com>
336
337 PR gold/14217
338 * output.cc (Output_segment::is_first_section_relro): Don't ignore
339 .tdata section.
340 (Output_segment::set_section_addresses): Don't align size of relro
341 segment for .tbss.
342
1c582fe7
CC
3432015-03-21 Cary Coutant <cary@google.com>
344
345 PR gold/18010
346 * stringpool.cc (Stringpool_template): Don't optimize if section
347 alignment is greater than sizeof(char).
348
410da591
CC
3492015-03-21 Cary Coutant <cary@google.com>
350
351 PR gold/18048
352 * script-c.h (script_include_directive): Add first_token parameter.
353 * script.cc (script_include_directive): Add first_token parameter, and
354 pass it to read_script_file.
355 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
356 (PARSING_MEMORY_DEF): New tokens.
357 (top): Add new productions for INCLUDE files.
358 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
359 Pass PARSING_LINKER_SCRIPT to script_include_directive.
360 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
361 (section_cmd): Pass PARSING_SECTION_CMDS.
362 (file_or_sections_cmd): Remove.
363 (memory_def): Pass PARSING_MEMORY_DEF.
364 * testsuite/Makefile.am (memory_test_2): New test.
365 * testsuite/Makefile.in: Regenerate.
366 * testsuite/memory_test_inc.t: New script file.
367 * testsuite/memory_test_inc_1.t.src: New script file.
368 * testsuite/memory_test_inc_2.t.src: New script file.
369 * testsuite/memory_test_inc_3.t.src: New script file.
370
0d5bbdb0
CC
3712015-03-21 Cary Coutant <cary@google.com>
372
373 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
374 (Sized_relobj_dwo::setup): Build compressed section map.
375 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
376 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
377 section map.
378 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
379 compressed_sections_ field.
380 (build_compressed_section_map): Take Object instead of
381 Sized_relobj_file parameter; add decompress_if_needed parameter.
382 (Sized_relobj_file::do_find_special_sections): Store compressed
383 section map in parent Object.
384 (Sized_relobj_file::do_decompressed_section_contents): Move
385 implementation to Object::decompressed_section_contents.
386 (Sized_relobj_file::do_discard_decompressed_sections): Move
387 implementation to Object::discard_decompressed_sections.
388 * object.h (build_compressed_section_map): Declare.
389 (Object::Object): Add compressed_sections_ field.
390 (Object::section_is_compressed): Move implementation here.
391 (Object::decompressed_section_contents): De-virtualize.
392 (Object::discard_decompressed_sections): De-virtualize.
393 (Object::do_section_is_compressed): Delete.
394 (Object::do_decompressed_section_contents): Delete.
395 (Object::set_compressed_sections): New method.
396 (Object::compressed_sections): New method.
397 (Object::compressed_sections_): New data member.
398 (Compressed_section_info, Compressed_section_map): Move to top of file.
399 (Sized_relobj_file::do_section_is_compressed): Delete.
400 (Sized_relobj_file::do_decompressed_section_contents): Delete.
401 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
402 (Sized_relobj_file::compressed_sections_): Move to Object class.
403
bd9e0d46
CC
4042015-03-21 Cary Coutant <ccoutant@google.com>
405
406 PR gold/18152
407 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
408 deferred objects.
409
943c8b43
CC
4102015-03-11 Cary Coutant <ccoutant@google.com>
411
412 * options.cc (General_options::finalize): Don't allow -z relro
413 with incremental linking.
414 * testsuite/Makefile.am (incremental_test): Add -z norelro.
415 (incremental_test_2): Likewise.
416 (incremental_test_3): Likewise.
417 (incremental_test_4): Likewise.
418 (incremental_test_5): Likewise.
419 (incremental_test_6): Likewise.
420 (incremental_copy_test): Likewise.
421 (incremental_common_test_1): Likewise.
422 (incremental_comdat_test_1): Likewise.
423 * testsuite/Makefile.in: Regenerate.
424
e1663197
CC
4252015-03-09 Cary Coutant <ccoutant@google.com>
426
427 PR gold/14675
428 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
429 return enum indicating whether .eh_frame section is empty, optimizable,
430 unrecognized, or an end marker. Adjust explicit instantiations.
431 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
432 (Eh_frame::add_ehframe_input_section): Change return type.
433 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
434 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
435 to the .eh_frame output section until we see the end marker.
436 (Layout::finalize_eh_frame_section): New.
437 * layout.h: (Layout::finalize_eh_frame_section): New.
438
beb8418f
L
4392015-03-05 H.J. Lu <hongjiu.lu@intel.com>
440
441 * output.cc (Relobj::initialize_input_to_output_map<size>):
442 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
443
48c73428
CC
4442015-03-04 Cary Coutant <ccoutant@google.com>
445
446 * parameters.cc (Parameters::set_target_once): Call
447 Target::select_as_default_target just once from here...
448 (set_parameters_target): ...instead of from here.
449
4502015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
dbe40a88
RÁE
451
452 * ehframe.cc (Cie::set_output_offset): Pass in and use a
453 Output_section_data instead of a Merge_map.
454 (Eh_frame::Eh_frame): Don't initialize merge_map_.
455 (Eh_frame::read_cie): Use add_merge_mapping instead of
456 Merge_map::add_mapping.
457 (Eh_frame::read_fde): Ditto.
458 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
459 (Eh_frame::do_output_offset): Use merge_output_offset istead of
460 merge_map_->get_output_offset.
461 (Eh_frame::do_is_merge_section_for): Delete.
462 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
463 instead of a Merge_map.
464 (Cie::set_output_offset): Pass in a Output_section_data instead of a
465 Merge_map.
466 (Eh_frame::do_is_merge_section_for): Delete.
467 (Eh_frame::merge_map_): Delete.
468 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
469 and use a Output_section_data instead of a Merge_map.
470 (Object_merge_map::add_mapping): Ditto.
471 (Object_merge_map::get_output_offset): Remove the merge_map argument.
472 (Object_merge_map::is_merge_section_for): Pass in and use a
473 Output_section_data instead of a Merge_map.
474 (Merge_map): Delete.
475 (Output_merge_base::do_output_offset): Use merge_output_offset instead
476 of merge_map_.get_output_offset.
477 (Output_merge_base::do_is_merge_section_for): Delete.
478 (Output_merge_data::do_add_input_section): Use
479 object->add_merge_mapping instead of add_mapping.
480 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
481 * merge.h (Merge_map): Delete forward declaration.
482 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
483 instead of a Merge_map.
484 (Object_merge_map::get_output_offset): Remove the merge_map argument.
485 (Object_merge_map::is_merge_section_for): Pass in and use a
486 Output_section_data instead of a Merge_map.
487 (Input_merge_map::Object_merge_map::merge_map): Replace with
488 output_data.
489 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
490 Output_section_data instead of a Merge_map.
491 (Merge_map): Delete.
492 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
493 (Output_merge_base::do_is_merge_section_for): Delete.
494 (Output_merge_base::add_mapping): Delete.
495 (Output_merge_base::merge_map_): Delete.
496 * object.cc (Relobj::initialize_input_to_output_map): New.
497 (Relobj::initialize_input_to_output_map): New.
498 (Relobj::merge_output_offset): New.
499 (Relobj::is_merge_section_for): New.
500 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
501 bits.
502 * object.h (Relobj::merge_map): Delete.
503 (initialize_input_to_output_map): New.
504 (set_merge_map): Delete.
505 (add_merge_mapping): New.
506 (merge_output_offset): New.
507 (is_merge_section_for): New.
508 * output.cc (Output_section::Input_section::is_merge_section_for):
509 Use object->is_merge_section_for.
510 * output.h (Output_section_data::is_merge_section_for): Delete.
511 (Output_section_data::do_is_merge_section_for): Delete.
512 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
513 Use object->initialize_input_to_output_map.
514 (Merged_symbol_value<size>::value_from_output_section): Use
515 object->merge_output_offset.
516
48c73428 5172015-03-02 Peter Collingbourne <pcc@google.com>
2c7b626c
CC
518 Cary Coutant <ccoutant@google.com>
519
520 * output.cc (Output_section::add_merge_input_section): Do not
521 attempt to merge sections with an entsize of 0.
522
48c73428 5232015-03-02 Khem Raj <raj.khem@gmail.com>
5b07cd84
CC
524
525 * attributes.h (class Output_attributes_section_data ): Add
526 do_print_to_mapfile function.
527
ec86f434
AM
5282015-02-24 Alan Modra <amodra@gmail.com>
529
530 PR 18010
531 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
532 complain if value is not a multiple of four.
533 (Target_powerpc::Relocate::relocate): Correct handling of
534 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
535
be66981e
L
5362015-02-21 H.J. Lu <hongjiu.lu@intel.com>
537
538 * configure.ac (default_size): Set to 32 for x32.
539 * configure: Regenerated.
540
e3ee8ed4
AM
5412015-02-18 Alan Modra <amodra@gmail.com>
542
543 PR 17954
544 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
545 visibility.
546
3a935c6c
RÁE
5472015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
548
549 * gc.h (Garbage_collection::add_reference): Don't use find.
550
e0a1e121
RÁE
5512015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
552
553 * object.cc (write_local_symbols): avoid std::vector copy.
554
45a4fb1a
RÁE
5552015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
556
557 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
558
2d9afefe
MW
5592015-02-09 Mark Wielaard <mjw@redhat.com>
560
561 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
562 DW_LANG_Fortran03 and DW_LANG_Fortran08.
563
e9c1bdad
CC
5642015-02-16 Cary Coutant <ccoutant@google.com>
565
566 PR gold/13577
567 PR gold/16992
568 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
569 DF_SYMBOLIC if --dynamic-list option is used.
570 * options.cc (General_options::finalize): --dynamic-list is not
571 mutually exclusive with -Bsymbolic.
572 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
573 listed in --dynamic-list.
574 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
575 -Bsymbolic-functions.
576 * testsuite/Makefile.in: Regenerate.
577
0ed4b0bf
CC
5782015-02-16 Cary Coutant <ccoutant@google.com>
579
580 PR gold/17971
581 * incremental.cc: Remove redundant include of "output.h".
582
1a920511
JY
5832015-02-12 Jing Yu <jingyu@google.com>
584
585 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
586 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
587 New relocation.
588 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
589 TLSLE_MOVW_* relocations.
590 (Target_aarch64::Scan::global): Likewise.
591 (Target_aarch64::Relocate::relocate): Likewise.
592 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
593 for new TLSLE_MOVW_* relocations.
594
07f107f3
WN
5952015-02-11 Will Newton <will.newton@linaro.org>
596
597 PR gold/13321
598 * arm.cc (Target_arm::make_plt_section): Create an ARM
599 state mapping symbol at the start of the PLT.
600
e051a5b5
L
6012015-02-09 H.J. Lu <hongjiu.lu@intel.com>
602
603 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
604 Replace two_file_shared_2.so with two_file_shared_1.so.
605 * testsuite/Makefile.in: Regenerated.
606
dddcc5b9
AM
6072015-02-09 Alan Modra <amodra@gmail.com>
608
609 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
610 plugin_test_thin.a and defsym_test.
611 * testsuite/Makefile.in: Regenerate.
612
b39b8b9d
RÁE
6132015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
614
615 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
616 body.
617
b66d1c52
CC
6182015-02-04 Peter Collingbourne <pcc@google.com>
619
620 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
621 forwarding symbols when computing symbol resolution info for plugins.
622 * plugin.h (Plugin_manager::symtab): New method.
623 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
624
23081de0
CC
6252015-02-03 Cary Coutant <ccoutant@google.com>
626 Peter Collingbourne <pcc@google.com>
627
628 PR gold/15660
629 * archive.cc (Thin_archive_object_unlocker): New class.
630 (Archive::include_member): Unlock external members of thin archives.
631 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
632 (plugin_test_2): Likewise.
633 (plugin_test_3): Likewise.
634 (plugin_test_4): Likewise.
635 (plugin_test_5): Likewise.
636 (plugin_test_6): Likewise.
637 (plugin_test_7): Likewise.
638 (plugin_test_8): Likewise.
639 (plugin_test_9): Likewise.
640 (plugin_test_10): Likewise.
641 (plugin_test_11): New test case.
642 * testsuite/Makefile.in: Regenerate.
643 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
644 file to decide whether to claim file.
645 (all_symbols_read_hook): Likewise.
646 * testsuite/plugin_test_1.sh: Adjust expected output.
647 * testsuite/plugin_test_2.sh: Likewise.
648 * testsuite/plugin_test_3.sh: Likewise.
649 * testsuite/plugin_test_6.sh: Likewise.
650 * testsuite/plugin_test_tls.sh: Likewise.
651 * testsuite/plugin_test_11.sh: New testcase.
652
6532015-02-03 Cary Coutant <ccoutant@google.com>
654
655 * descriptors.cc (Descriptors::open): Set artificially-low limit for
656 file descriptors when debugging enabled. Add debug output.
657 (Descriptors::release): Add debug output.
658 (Descriptors::close_some_descriptor): Likewise.
659 (Descriptors::close_all): Likewise.
660 * fileread.cc (File_read::lock): Likewise.
661 (File_read::unlock): Likewise.
662
24dd5808
CC
6632015-02-02 Cary Coutant <ccoutant@google.com>
664
665 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
666 executable output file.
667
fa89cc82
HS
6682015-01-22 Han Shen <shenhan@google.com>
669
670 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
671 (Target_arm::do_plt_address_for_global): New method.
672 (Target_arm::do_plt_address_for_local): New method.
673 (Target_arm::rel_irelative_section): New method.
674 (Target_arm::make_data_plt): Add more parameters for plt ctor.
675 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
676 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
677 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
678 (Target_arm::Scan::check_non_pic): Add ifunc support.
679 (Target_arm::Scan::local): Add ifunc support.
680 (Target_arm::Scan::global): Add ifunc support.
681 (Target_arm::make_plt_section): New method.
682 (Target_arm::make_plt_entry): Change to call to make_plt_section.
683 (Target_arm::make_local_ifunc_plt_entry): New method.
684 (Target_arm::got_irelative_): New member.
685 (Target_arm::rel_irelative_): New member.
686 (Target_arm::got_section): Add creation for got_irelative_.
687 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
688 (Target_arm::Relocate::relocate): Properly set local ifunc address.
689 (Target_arm::do_dynsym_value): Properly set global ifunc address.
690 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
691 (Output_data_plt_arm::IRelative_data): New type.
692 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
693 (Output_data_plt_arm::add_entry): Add more parameters.
694 (Output_data_plt_arm::add_relocation): New method.
695 (Output_data_plt_arm::add_local_ifunc_entry): New method.
696 (Output_data_plt_arm::rel_irelative): New method.
697 (Output_data_plt_arm::entry_count): Modified.
698 (Output_data_plt_arm::address_for_global): New method.
699 (Output_data_plt_arm::address_for_local): New method.
23081de0 700gold/
fa89cc82
HS
701 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
702 (Output_data_plt_arm::insert_irelative_data): New method.
703 (Output_data_plt_arm::irelative_rel_): New member.
704 (Output_data_plt_arm::got_): New member.
705 (Output_data_plt_arm::got_irelative_): New member.
706 (Output_data_plt_arm::irelative_count_): New member.
707 (Output_data_plt_arm::IRelative_data_vec): New typedef.
708 (Output_data_plt_arm::irelative_data_vec_): New member.
709 (Output_data_plt_arm::do_write): Write out irelative entries.
710 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
711 more parameters to ctor.
712 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
713 more parameters to ctor.
714 * output.h (Output_data_reloc::add_local_relative): New method.
715 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
716
0f81d3f0
AM
7172015-01-29 Alan Modra <amodra@gmail.com>
718
719 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
720 and GOT_TLSGD to LE optimization.
721
65d92137
CC
7222015-01-28 Cary Coutant <ccoutant@google.com>
723
724 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
725 for undef TLS symbols.
726 (Target_x86_64::Relocate::relocate_tls): Likewise.
727 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
728
5485698a
CC
7292015-01-25 Cary Coutant <ccoutant@google.com>
730
731 * output.cc (Output_segment::set_section_addresses): Fix calculation
732 of size of relro segment.
733
b01a4b04
AM
7342015-01-22 Alan Modra <amodra@gmail.com>
735
736 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
737 condition for need of ifunc plt entry.
738 (Target_powerpc::Scan::global <got relocs>): Likewise.
739
3d0064a9
CC
7402015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
741
742 * mips.cc (reloc_high): Add r_sym.
743 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
744 reloc_high constructor.
745 (Mips_relocate_functions::relgot16_local): Likewise.
746 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
747 r_type to decide whether LO16 matches HI16.
748 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
749 rello16 and relgot16_local.
750
a5cd8f05
CC
7512015-01-09 Cary Coutant <ccoutant@google.com>
752
753 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
754 unless alignment is larger than page size.
755
4fc1b9d4
L
7562015-01-06 H.J. Lu <hongjiu.lu@intel.com>
757 Cary Coutant <ccoutant@google.com>
758
759 PR gold/17729
760 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
761 (DEFAULT_TARGET_X32): Set for x32.
762 * x86_64.cc (cmp_insn_32): New.
763 (lea_r10_insn_32): Likewise.
764 (lea_r11_insn_32): Likewise.
765 (cmp_insn_64): Likewise.
766 (lea_r10_insn_64): Likewise.
767 (lea_r11_insn_64): Likewise.
768 (Target_x86_64<size>::do_calls_non_split): Handle x32.
769 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
770 (check_DATA): Add split_x32 files.
771 (split_x32_[1234n].o): New targets.
772 (split_x32_[124]): New targets.
773 (split_x32_[1234r].stdout): New targets.
774 * testsuite/split_x32.sh: New file.
775 * testsuite/split_x32_1.s: Likewise.
776 * testsuite/split_x32_2.s: Likewise.
777 * testsuite/split_x32_3.s: Likewise.
778 * testsuite/split_x32_4.s: Likewise.
779 * testsuite/split_x32_n.s: Likewise.
780 * configure: Regenerated.
781 * testsuite/Makefile.in: Likewise.
782
e749cab8
L
7832015-01-06 H.J. Lu <hongjiu.lu@intel.com>
784
785 PR gold/17809
786 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
787 x32.
788
af759df0
AM
7892015-01-02 Alan Modra <amodra@gmail.com>
790
791 * version.cc (print_version): Just print current year.
792 * dwp.cc (print_version): Likewise.
793
b90efa5b
AM
7942015-01-01 Alan Modra <amodra@gmail.com>
795
796 Update year range in copyright notice of all files.
797
f12d1e8a
AM
7982014-12-25 Alan Modra <amodra@gmail.com>
799
800 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
801 new enums.
802 (Target_arm::merge_object_attributes, ): Likewise.
803
5c294fee
TG
8042014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
805
806 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
807 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
808 AEABI_VFP_args_vfp to check that.
809 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
810 value and replace hardcoded values by enum values.
811
e30880c2
CC
8122014-12-22 Cary Coutant <ccoutant@google.com>
813
814 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
815
bd040da1
L
8162014-12-20 H.J. Lu <hongjiu.lu@intel.com>
817
818 PR gold/14608
819 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
820 to "return i * i * 3;".
821
e02a4046
CC
8222014-12-16 Cary Coutant <ccoutant@google.com>
823
824 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
825 (Mapfile::print_output_data): Use current_data_size() to avoid
826 assert for sections requiring postprocessing; if address is not valid,
827 print 0.
828 (Mapfile::print_output_section): Use current_data_size(); print note
829 that addresses and sizes are before compression.
830
add6016b
L
8312014-12-14 H.J. Lu <hongjiu.lu@intel.com>
832
833 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
834 Cast current_group_size to unsigned long when reporting error.
835
0bf32ea9
JY
8362014-12-10 Jing Yu <jingyu@google.com>
837
838 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
839 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
840 Update error message.
841 (Target_aarch64::do_relax): Use absolute value of option
842 stub_group_size. Replace local variable with class member
843 stub_group_size_.
844
cbcb23fa
AM
8452014-12-04 Alan Modra <amodra@gmail.com>
846
847 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
848 addend of PLTREL24 reloc when not generating a plt stub. Make
849 max_branch_offset an "Address".
fbad6518 850 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
851 (Target_powerpc::Relocate::relocate): Likewise.
852
1611bc4a
AM
8532014-12-04 Alan Modra <amodra@gmail.com>
854
855 PR 17670
856 * symtab.cc (Symbol::set_undefined): Remove assertion.
857 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
858 on symbols defined in discarded sections, instead return false.
859 Rearrange params, update all callers.
860 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
861 branches to syms in discarded sections.
862 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
863 undefined and flag as discarded.
864 (Target_powerpc::Relocate::relocate): Localize variable.
865
4759c34e
L
8662014-12-03 H.J. Lu <hongjiu.lu@intel.com>
867
868 PR gold/17675
869 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
870 * testsuite/Makefile.in: Regenerated.
871
1f98a074
AM
8722014-12-03 Alan Modra <amodra@gmail.com>
873
874 PR 17566
875 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
876 when adding dynamic relocations against section symbols.
877
fb257835
DI
8782014-12-01 Dimitry Ivanov <dimitry@google.com>
879
880 * layout.cc (Layout::finish_dynamic_section): When '-z global'
881 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
882 * options.h (General_options): New -z option (global).
883
d8e60314
CC
8842014-12-01 Cary Coutant <ccoutant@google.com>
885
886 PR gold/17578
887 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
888 is given.
889 (Layout::create_executable_stack_info): Warn when -z noexecstack is
890 given but some inputs require executable stack.
891
982bbd97
CC
8922014-11-26 Cary Coutant <ccoutant@google.com>
893
894 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
895 .debug_str_offsets; strip .debug_gnu_pubnames and
896 .debug_gnu_pubtypes.
897 (lines_only_debug_sections): Strip all four new sections.
898
bb779192
HS
8992014-11-26 Jing Yu <jingyu@google.com>
900
901 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
902 register to be x0 when to relax TLSDESC_LD64_LO12.
903
a3e60ddb
AM
9042014-11-26 Alan Modra <amodra@gmail.com>
905
906 * powerpc.cc (struct Stub_table_owner): New.
907 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
908 unsigned int vector. Update all references.
909 (powerpc_relobj::set_stub_table): Take an unsigned int param
910 rather than a Stub_table. Update callers.
911 (Powerpc_relobj::clear_stub_table): New function.
912 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
913 stub_group_size_ vars.
914 (Target_powerpc::new_stub_table): Delete.
915 (max_branch_delta): New function, extracted from..
916 (Target_powerpc::Relocate::relocate): ..here..
917 (Target_powerpc::Branch_info::make_stub): ..and here. Return
918 status on whether stub created successfully.
919 (Stub_control::Stub_control): Add "no_size_errors" param. Move
920 default sizing to..
921 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
922 reduce on relax failure.
923 (Target_powerpc::group_sections): Add "no_size_errors" param.
924 Use stub_group_size_. Set up group info in a temp vector,
925 before building Stub_table vector. Account for input sections
926 possibly already converted to relaxed sections.
927 (Stub_table::init): Delete. Merge into..
928 (Stub_table::Stub_table): ..here.
929 (Stub_table::can_reach_stub): New function.
930 (Stub_table::add_plt_call_entry): Add "from" parameter and
931 return true iff stub could be reached.
932 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
933 param too.
934 (Stub_table::clear_stubs): Add "all" param.
935
a20605cf
AM
9362014-11-26 Alan Modra <amodra@gmail.com>
937
938 * powerpc.cc (Stub_control::set_output_and_owner): New function.
939 (Target_powerpc::group_sections): Use it.
940
43b64deb
CC
9412014-11-25 Cary Coutant <ccoutant@google.com>
942
943 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
944 (Binary_to_elf::write_symbol): Add st_size parameter.
945 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
946
c924eb67
CC
9472014-11-25 Cary Coutant <ccoutant@google.com>
948
949 PR gold/17639
950 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
951 (Sized_relobj_file::do_layout): Handle deferred sections properly
952 during GC pass 1. Don't add reloc sections to deferred list twice.
953 * object.h (Sized_relobj_file::is_deferred_layout): New function.
954 (Sized_relobj_file::is_deferred_layout_): New data member.
955
9d585188
L
9562014-11-21 H.J. Lu <hongjiu.lu@intel.com>
957
958 PR gold/17619
959 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
960 Check PC-relative offset overflow in PLT entry.
961
3ffaac20
AM
9622014-11-21 Alan Modra <amodra@gmail.com>
963
964 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
965 for undefined weaks.
966
0cfb0717
AM
9672014-11-20 Alan Modra <amodra@gmail.com>
968
969 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
970 from --stub-group-size parameter divided by 1024.
971 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
972 template parameter. Update all uses.
973 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
974 has_stub_value. Set for long branches. Don't report overflow for
975 branch to undefined weak symbols. Print info message on
976 overflowing branch to stub.
977
f9dffbf0
AM
9782014-11-20 Alan Modra <amodra@gmail.com>
979
980 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
981
e88ba8d5
L
9822014-11-13 H.J. Lu <hongjiu.lu@intel.com>
983
984 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
985 entry for R_X86_64_GOTPLT64.
986 (Target_x86_64<size>::Relocate::relocate): Update comments for
987 R_X86_64_GOTPLT64.
988
d37ffe25
ED
9892014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
990
991 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
992 * plugin.h: add lock definition
993
9726c3c1
HS
9942014-10-29 Han Shen <shenhan@google.com>
995 Jing Yu <jingyu@google.com>
996
997 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
998 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
999 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
1000 Symbol::TLS_REF.
1001 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
1002 method.
1003 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
1004 (Target_aarch64::tls_ld_to_le): New method.
1005 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
1006 for 64bit targets.
1007 (Output_data_plt_aarch64::irelative_rel_): New data member.
1008 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
1009 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
1010 (Output_data_plt_aarch64::add_relocation): New method.
1011 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
1012 offset. Add got_irelative size to got size.
1013 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
1014 type string with the new typename.
1015 (AArch64_relocate_functions::update_adr): Replace parameter x with
1016 immed.
1017 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
1018 (AArch64_relocate_functions::reloc_common): New method.
1019 (AArch64_relocate_funcsions::rela_general): Extract common part out
1020 into reloc_common method.
1021 (AArch64_relocate_functions::rela_general): Likewise.
1022 (AArch64_relocate_functions::pcrela_general): Likewise.
1023 (AArch64_relocate_functions::adr): New method.
1024 (AArch64_relocate_functions::adrp): Calculate immed before calling
1025 update_adr.
1026 (AArch64_relocate_functions::adrp): Likewise.
1027 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
1028 comparing x to 0. Calculate immed from ~x when x < 0.
1029 (Target_aarch64::optimize_tls_reloc): Add new cases for
1030 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1031 TLSLD_MOVW_DTPREL_G0_NC.
1032 (Target_aarch64::possible_function_pointer_reloc): Implement this
1033 method.
1034 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
1035 comment.
1036 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
1037 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1038 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1039 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
1040 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1041 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1042 (Target_aarch64::make_plt_entry): Call add_entry with two more
1043 parameters.
1044 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1045 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
1046 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1047 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1048 (Target_aarch64::Relocate::relocate_tls): Add cases for
1049 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1050 TLSLD_MOVW_DTPREL_G0_NC.
1051 * testsuite/icf_safe_so_test.cc: Correct test comment.
1052 * testsuite/icf_safe_test.sh: Add AArch64 arch.
1053
80272b8c
AM
10542014-10-22 Alan Modra <amodra@gmail.com>
1055
1056 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
1057 thread_starter.
1058
998a69f4
AS
10592014-10-18 Andreas Schwab <schwab@linux-m68k.org>
1060
1061 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
1062
aed56ec5
CC
10632014-10-17 Cary Coutant <ccoutant@google.com>
1064
1065 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1066 Add "typename" keyword.
1067
bb779192 10682014-10-15 Han Shen <shenhan@google.com>
83a01957
HS
1069 Jing Yu <jingyu@google.com>
1070
1071 Patch for gold aarch64 backend to support relaxation.
1072 * aarch64-reloc.def: Change format.
1073 * aarch64.cc (class Reloc_stub): New class.
1074 (class Stub_table): New class.
1075 (class AArch64_relobj): New class.
1076 (class AArch64_input_section): New class.
1077 (class AArch64_output_section): New class.
1078 (Target_aarch64::new_stub_table): New method.
1079 (Target_aarch64::new_aarch64_input_section): New method.
1080 (Target_aarch64::find_aarch64_input_section): New method.
1081 (Target_aarch64::scan_section_for_stubs): New method.
1082 (Target_aarch64::scan_reloc_section_for_stubs): New method.
1083 (Target_aarch64::relocate_stub): New method.
1084 (Target_aarch64::current_target): New method.
1085 (Target_aarch64::do_make_elf_object): New method.
1086 (Target_aarch64::do_may_relax): New method.
1087 (Target_aarch64::do_relax): New method.
1088 (Target_aarch64::group_sections): New method.
1089 (Target_aarch64::scan_reloc_for_stub): New method.
1090 (Target_aarch64::do_make_output_section): New method.
1091 (Target_aarch64::stub_tables_): New data member.
1092 (Target_aarch64::aarch64_input_section_map_): New data member.
1093 (AArch64_relocate_functions::maybe_apply_stub): New method.
1094
db4c9594
CC
10952014-09-30 Cary Coutant <ccoutant@google.com>
1096
1097 PR gold/17432
1098 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
1099
cd6da036
KC
11002014-09-30 Kito Cheng <kito@0xlab.org>
1101
1102 PR gold/13597
1103 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
1104 hash table before sysv-style hash table.
1105
5f772412
ST
11062014-09-29 Sriraman Tallam <tmsriram@google.com>
1107
1108 * options.h (--pic-executable): Add negative to alias to -no-pie.
1109
5efeedf6
CC
11102014-09-26 Cary Coutant <ccoutant@google.com>
1111
1112 PR gold/16773
1113 * object.cc (Sized_relobj_file): Compute value of section symbols
1114 for TLS sections the same as TLS symbols.
1115
1707f183
CC
11162014-09-25 Cary Coutant <ccoutant@google.com>
1117
1118 PR gold/17432
1119 * resolve.cc (Symbol_table::resolve): Override common placeholder
1120 symbols, but adjust sizes.
1121 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
1122 symbols to common lists.
1123
00cac886
AM
11242014-09-24 Alan Modra <amodra@gmail.com>
1125
1126 * po/POTFILES.in: Regenerate.
1127
635aa30e
CC
11282014-09-23 Taiju Tsuiki <tzik@google.com>
1129 Cary Coutant <ccoutant@google.com>
1130
71b9b91b 1131 PR gold/14860
635aa30e
CC
1132 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
1133 on input_sections_blocker.
1134 * layout.cc (Write_sections_task::locks): Unblock
1135 input_sections_blocker_.
1136 * layout.h (Write_sections_task::Write_sections_task): Add
1137 input_sections_blocker.
1138 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
1139 to DEPENDENCIES.
1140 * testsuite/Makefile.in: Regenerate.
1141
c0c71592
RÁE
11422014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1143
1144 * testsuite/Makefile.am (plugin_test_10): New test.
1145 * testsuite/Makefile.in: Regenerate
1146 * testsuite/plugin_common_test_2.c (c1): Align to 8.
1147 * testsuite/plugin_test_10.sh: New file.
1148
6168c2a1
RÁE
11492014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1150
1151 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
1152 * resolve.cc (Symbol_table::resolve): Don't override common symbols
1153 during the replacement phase.
1154
3a531937
JY
11552014-09-17 Han Shen <shenhan@google.com>
1156 Jing Yu <jingyu@google.com>
1157
1158 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
1159 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
1160 * aarch64.cc (Target_aarch64): Add data members
1161 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
1162 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
1163 constructor.
1164 (Target_aarch64::do_reloc_symbol_index): New method.
1165 (Target_aarch64::do_reloc_addend): New method.
1166 (Target_aarch64::add_tlsdesc_info): New method.
1167 (Target_aarch64::do_dynsym_value): New method.
1168 (Target_aarch64::do_make_data_plt): Add new parameters: got,
1169 got_irelative. Pass them to Output_data_plt_aarch64_standard.
1170 (Target_aarch64::make_data_plt): Add new parameters: got,
1171 got_irelative. Pass them to do_make_data_plt.
1172 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
1173 (Target_aarch64::Relocate:tls_gd_to_le): New method.
1174 (Target_aarch64::Relocate:tls_ie_to_le): New method.
1175 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
1176 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
1177 (Target_aarch64::got_tlsdesc_section): New method.
1178 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1179 (Target_aarch64::define_tls_base_symbol): New method.
1180 (Target_aarch64::reserve_tlsdesc_entries): New method.
1181 (Target_aarch64::got_mod_index_entry): New method.
1182 (Target_aarch64::rela_tlsdesc_section): New method.
1183 (Target_aarch64::rela_irelative_section): New method.
1184 (Target_aarch64::Tlsdesc_info): New struct.
1185 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
1186 relocations and tlsdesc relocations.
1187 (Target_aarch64::optimize_tls_reloc): Implement method.
1188 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
1189 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
1190 in constructor.
1191 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
1192 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
1193 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
1194 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
1195 (Output_data_plt_aarch64::rela_tlsdesc): New method.
1196 (Output_data_plt_aarch64::rela_irelative): New method.
1197 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
1198 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
1199 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
1200 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
1201 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
1202 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
1203 (Output_data_plt_aarch64_standard): New member variables:
1204 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
1205 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
1206 New parameter: got, got_irelative.
1207 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
1208 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
1209 (Output_data_plt_aarch64::do_write): Replace got_address with
1210 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
1211 (AArch64_relocate_functions::update_movnz): New method.
1212 (AArch64_relocate_functions): Correct format.
1213 (AArch64_relocate_functions::movnz): New method.
1214 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
1215 before the switch. Add new cases to switch.
00cac886 1216 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
1217 tlsgd tlsdesc cases.
1218 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
1219 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
1220 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
1221 Call reloc_name_in_error_message to print unsupported reloc.
1222 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
1223 make_data_plt.
1224 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
1225 relocs. Fill in some more dynamic tags.
1226 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
1227 Skip call tls_get_addr when tlsgd is relaxed.
1228 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
1229 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
1230 tlsdesc->ie relaxation.
1231
62661c93
SS
12322014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1233
1234 * mips.cc (Target_mips_nacl): New class.
1235 (Target_selector_mips_nacl): New class.
1236 (target_selector_mips32): Rename from target_selector_mips32be and use
1237 Target_selector_mips_nacl instead of Target_selector_mips.
1238 (target_selector_mips32el): Rename from target_selector_mips32 and use
1239 Target_selector_mips_nacl instead of Target_selector_mips.
1240 (target_selector_mips64): Rename from target_selector_mips64be and use
1241 Target_selector_mips_nacl instead of Target_selector_mips.
1242 (target_selector_mips64el): Rename from target_selector_mips64 and use
1243 Target_selector_mips_nacl instead of Target_selector_mips.
1244 (Target_mips::mips_info): Add const attribute.
1245
54674d38
CC
12462014-09-02 Cary Coutant <ccoutant@google.com>
1247
1248 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
1249 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
1250 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
1251 (Sized_incr_dynobj::do_section_name): Likewise.
1252 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
1253 (Sized_incr_dynobj::do_section_name): Likewise.
1254 * object.h (Object::section_name): Likewise.
1255 (Object::do_section_name): Likewise.
1256 (Sized_relobj_file::do_section_name): Likewise.
1257 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
1258 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
1259
9860cbcf
CC
12602014-09-02 Cary Coutant <ccoutant@google.com>
1261
1262 PR gold/17005
1263 * ehframe.cc (Fde::write): Add output_offset parameter.
1264 (Cie::write): Likewise.
1265 (Eh_frame::set_final_data_size): Account for offset within output
1266 section.
1267 (Eh_frame::do_sized_write): Likewise.
1268 * ehframe.h (Fde::write): Add output_offset parameter.
1269 (Cie::write): Likewise.
1270 * output.cc (Output_section::Input_section_sort_entry): Remove
1271 section_has_name_; add output_section_name parameter. Use
1272 output section name for non-input sections.
1273 (Output_section::Input_section_sort_entry::section_has_name): Remove.
1274 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
1275 (Output_section::Input_section_sort_compare): Remove logic for
1276 sections without names.
1277 (Output_section::Input_section_sort_init_fini_compare): Likewise.
1278 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
1279 Likewise.
1280 (Output_section::Input_section_sort_section_name_compare): Likewise.
1281
8e33481e
HS
12822014-08-29 Han Shen <shenhan@google.com>
1283 Jing Yu <jingyu@google.com>
1284
1285 * aarch64-reloc-property.cc
1286 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
1287 reference reloc property in the table.
1288 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
1289 3 other entries.
1290 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
1291 2 new overloaded methods.
1292 (Output_data_got_aarch64::do_write): Add code to write out
1293 static relocs.
1294 (class Output_data_got_aarch64::Static_reloc): New class to wrap
1295 static relocs.
1296 (Output_data_got_aarch64::static_relocs): New vector to
1297 hold static relocs.
1298 (Target_aarch64::TCB_SIZE): New const static memeber.
1299 (Target_aarch64::tcb_size): New method.
1300 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
1301 (Target_aarch64::Relocate::relocate_tls): New method.
1302 (Target_aarch64::Scan::local): Add code handling new reloc types.
1303 (Target_aarch64::Scan::global): Add code handling new reloc types.
1304
81233653
ST
13052014-08-13 Sriraman Tallam <tmsriram@google.com>
1306
1307 * options.h (-no-pie): Add option.
1308
9363c7c3
JY
13092014-08-08 Jing Yu <jingyu@google.com>
1310 Han Shen <shenhan@google.com>
1311
1312 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
1313 (DEFFILES): add aarch64-reloc.def.
1314 (TARGETSOURCES): Add aarch64-reloc-property.cc.
1315 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
1316 * Makefile.in: Regenerate.
1317 * aarch64-reloc-property.cc: New file.
1318 * aarch64-reloc-property.h: New file.
1319 * aarch64-reloc.def: New file.
1320 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
1321 with tab to make the format consistent.
1322 (Output_data_got_aarch64::symbol_table_): New method.
1323 (Target_aarch64::do_plt_address_for_global): New method.
1324 (Target_aarch64::do_plt_address_for_local): New method.
1325 (Target_aarch64::do_select_as_default_target): New method.
1326 (Target_aarch64::do_make_data_plt): New method.
1327 (Target_aarch64::make_data_plt): New method.
1328 (Output_data_plt_aarch64::has_irelative_section): New method.
1329 (Output_data_plt_aarch64::address_for_global): New method.
1330 (Output_data_plt_aarch64::address_for_local): New method.
1331 (Output_data_plt_aarch64::irelative_rel_): New parameter.
1332 (Output_data_plt_aarch64::add_entry): Implement contents.
1333 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
1334 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
1335 the got_pov entry to plt0.
1336 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
1337 Implement contents.
1338 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
1339 (AArch64_howto): New struct.
1340 (aarch64_howto[]): New static const array.
1341 (AArch64_relocate_functions): New class.
1342 (Target_aarch64::Scan::get_reference_flags): Remove method.
1343 (Target_aarch64::Scan::local): Implement to support a few relocations.
1344 (Target_aarch64::Scan::global): Implement to support a few relocations.
1345 (Target_aarch64::make_plt_section): Implement contents.
1346 (Target_aarch64::make_plt_entry): Implement contents.
1347 (Target_aarch64::do_finalize_sections): Implement contents.
1348 (Target_aarch64::Relocate::relocate): Implement a few relocations.
1349 (Target_aarch64::relocate_section): Implement contents.
1350
ad9fe6c1
AM
13512014-08-06 Alan Modra <amodra@gmail.com>
1352
1353 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
1354
7cd4e5b7
AM
13552014-08-06 Alan Modra <amodra@gmail.com>
1356
1357 PR 13227
1358 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
1359
5ad9b0a7
ST
13602014-07-21 Sriraman Tallam <tmsriram@google.com>
1361
1362 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 1363 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 1364
e051745c
CC
13652014-07-08 Cary Coutant <ccoutant@google.com>
1366
1367 * expression.cc (struct Expression::Expression_eval_info): Add
1368 new fields type_pointer, vis_pointer, and nonvis_pointer.
1369 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
1370 nonvis_pointer parameters. Adjust all calls.
1371 (Symbol_expression::value): Update type, visibility, and nonvis bits
1372 in caller.
1373 * script.cc (Symbol_assignment::sized_finalize): Update type,
1374 visibility, and remaining st_other bits for new symbol.
1375 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
1376 vis_pointer, and nonvis_pointer parameters.
1377 * symtab.h (Symbol::set_type): New method.
1378
1379 * testsuite/Makefile.am (defsym_test): New test.
1380 * testsuite/Makefile.in: Regenerate.
1381 * testsuite/defsym_test.c: New file.
1382 * testsuite/defsym_test.sh: New file.
1383
f35c4853
CC
13842014-07-08 Cary Coutant <ccoutant@google.com>
1385
1386 PR gold/15639
1387 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
1388 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
1389 (Sized_dynobj::base_read_symbols): ...new method.
1390 * object.h (Sized_relobj_file::base_read_symbols): New method.
1391 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
1392 (Sized_relobj_file::base_read_symbols): ...new method.
1393 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
1394 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
1395 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
1396
2900af2d
AM
13972014-07-04 Alan Modra <amodra@gmail.com>
1398
1399 * po/POTFILES.in: Regenerate.
1400
053a4d68
JY
14012014-07-02 Jing Yu <jingyu@google.com>
1402
1403 * aarch64.cc: New file
1404 * Makefile.am (TARGETSOURCES): Add aarch64.cc
1405 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
1406 * Makefile.in: Regenerate.
1407 * configure.tgt: Add entries for aarch64*.
1408 * configure.ac: Likewise.
1409 * configure: Likewise.
1410
7b549045
AM
14112014-06-27 Alan Modra <amodra@gmail.com>
1412
1413 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
1414
cb818dbf
CC
14152014-06-24 Cary Coutant <ccoutant@google.com>
1416
1417 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
1418 sections.
1419 (Dwo_file::sized_read_unit_index): Likewise.
1420
9810d34d
SS
14212014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1422
1423 * mips.cc: New file.
1424 * Makefile.am (TARGETSOURCES): Add mips.cc
1425 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
1426 * configure.tgt: Add entries for mips*.
1427 * configure.ac: Likewise.
1428 * Makefile.in: Regenerate.
1429 * configure: Likewise.
1430
9baa787b
CC
14312014-06-09 Cary Coutant <ccoutant@google.com>
1432
1433 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
1434 unit_length is within section bounds.
1435
8f89af0a
CC
14362014-06-09 Cary Coutant <ccoutant@google.com>
1437
1438 PR gold/16980
1439 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
1440 map.
1441
a47622ac
AM
14422014-06-07 Alan Modra <amodra@gmail.com>
1443
1444 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
1445
4320c691
CC
14462014-06-06 Cary Coutant <ccoutant@google.com>
1447
1448 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
1449 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
1450 (Dwarf_pubnames_table::read_header): Likewise.
1451 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
1452 .debug_gnu_pubtypes.
1453
270c9937
JB
14542014-06-05 Joel Brobecker <brobecker@adacore.com>
1455
1456 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
1457 * Makefile.in, configure: Regenerate.
1458
397998fc
AM
14592014-06-03 Alan Modra <amodra@gmail.com>
1460
1461 * powerpc.cc (addis_12_2): Define.
1462 (Stub_table::do_write): Support fusion on ELFv2 stubs.
1463
61f5c66f
AM
14642014-06-03 Alan Modra <amodra@gmail.com>
1465
1466 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
1467 st_other output.
1468
f6971787
AM
14692014-06-02 Alan Modra <amodra@gmail.com>
1470
1471 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
1472 Only ignore relocs on ELFv1.
1473 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
1474
f6fb8322
CC
14752014-05-30 Cary Coutant <ccoutant@google.com>
1476
1477 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
1478 * testsuite/Makefile.in: Regenerate.
1479 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
1480
c23dd342
L
14812014-05-27 H.J. Lu <hongjiu.lu@intel.com>
1482
1483 PR gold/16945
1484 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
1485 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
1486
5fe7ffdc
AM
14872014-05-15 Alan Modra <amodra@gmail.com>
1488
1489 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
1490 Compare FDE contents with DW_CFA_nop rather than 0.
1491
a82bef93
ST
14922014-05-13 Sriraman Tallam <tmsriram@google.com>
1493
1494 * symtab.h (may_need_copy_reloc): Remove check for position independent
1495 code.
1496 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
1497 position independence before pc absolute may_need_copy_reloc call.
1498 Add check for executable output befor pc relative may_need_copy_reloc
1499 call.
1500 * i386.cc: Ditto.
1501 * arm.cc: Ditto.
1502 * sparc.cc: Ditto.
1503 * tilegx.cc: Ditto.
1504 * powerpc.cc: Add check for no position independence before
1505 may_need_copy_reloc calls.
1506 * testsuite/pie_copyrelocs_test.cc: New file.
1507 * testsuite/pie_copyrelocs_shared_test.cc: New file.
1508 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 1509 * Makefile.in: Regenerate.
a82bef93 1510
53c66605
ML
15112014-05-08 Martin Liška <mliska@suse.cz>
1512
1513 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
1514
57b2284c
CC
15152014-05-06 Cary Coutant <ccoutant@google.com>
1516
1517 PR gold/16900
1518 * i386.cc (Output_data_got_plt_i386): New class.
1519 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
1520 parameter. Change all callers.
1521 (Output_data_plt_i386::layout_): Remove.
1522 (Output_data_plt_i386::got_plt_): Change type.
1523 (Target_i386::got_plt_): Change type. Change all references.
1524 (Target_i386::got_section): Create instance of new class.
1525 (Output_data_got_plt_i386::do_write): New function.
1526 * x86_64.cc (Output_data_got_plt_x86_64): New class.
1527 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
1528 parameter. Change all callers.
1529 (Output_data_plt_x86_64::layout_): Remove.
1530 (Output_data_plt_x86_64::got_plt_): Change type.
1531 (Target_x86_64::got_plt_): Change type. Change all references.
1532 (Target_x86_64::got_section): Create instance of new class.
1533 (Output_data_got_plt_x86_64::do_write): New function.
1534 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
1535 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
1536 class.
1537
6b97515d 15382014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 1539
6b97515d
CC
1540 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
1541 if we have pubnames/pubtypes.
1542
d1bddd3c
CC
15432014-05-02 Cary Coutant <ccoutant@google.com>
1544
5fe7ffdc
AM
1545 * defstd.cc (in_segment): Define __ehdr_start here...
1546 * layout.cc (Layout::finalize): ...Instead of here. Set the
1547 output segment when known.
1548 * resolve.cc (Symbol::override_base_with_special): Remember
1549 the original binding.
1550 * symtab.cc (Symbol::set_output_segment): New function.
1551 (Symbol::set_undefined): New function.
1552 * symtab.h (Symbol::is_weak_undefined): Check original undef
1553 binding.
1554 (Symbol::is_strong_undefined): New function.
1555 (Symbol::set_output_segment): New function.
1556 (Symbol::set_undefined): New function.
1557 * target-reloc.h (is_strong_undefined): Remove.
1558 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
1559 Check for hidden undefs.
1560 (relocate_section): Call Symbol::is_strong_undefined.
1561
1562 * testsuite/Makefile.am (ehdr_start_test_1)
1563 (ehdr_start_test_2, ehdr_start_test_3)
1564 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
1565 * testsuite/Makefile.in: Regenerate.
1566 * testsuite/ehdr_start_def.cc: New source file.
1567 * testsuite/ehdr_start_test.cc: New source file.
1568 * testsuite/ehdr_start_test.t: New linker script.
1569 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 1570
7849f6d8
CC
15712014-04-23 Cary Coutant <ccoutant@google.com>
1572
bf2cc635 1573 PR gold/16870
7849f6d8
CC
1574 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
1575
99fd8cff
CC
15762014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1577
1578 * layout.cc (Layout::include_section): Allow a target to decide
1579 whether to include a section.
1580 * target.h (Target::should_include_section): New function.
1581 (Target::do_should_include_section): New function.
1582
91f43acd
CC
15832014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1584
1585 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
1586 inline into ...
1587 (Copy_relocs::emit): ... here.
1588 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
1589 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
1590 (Copy_reloc_entry::entries_): Change from private to protected.
1591
c4eb27e1
ST
15922014-04-02 Sriraman Tallam <tmsriram@google.com>
1593
1594 * icf.cc (get_section_contents): Replace copies of reloc
1595 vectors with const references.
1596
ae447ddd
CC
15972014-04-02 Cary Coutant <ccoutant@google.com>
1598
1599 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
1600 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
1601 * configure: Regenerate.
1602 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
1603 -fno-use-linker-plugin.
1604 (LINK1, CXXLINK1): Add it to the link command.
1605 * testsuite/Makefile.in: Regenerate.
1606
fa47fa92
AM
16072014-03-12 Alan Modra <amodra@gmail.com>
1608
1609 * Makefile.in: Regenerate.
1610
9b12c500
CC
16112014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1612
1613 * symtab.h (Symbol::set_nonvis): New function.
1614
beacaa96
CC
16152014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1616
1617 * symtab.cc (Sized_symbol<32>::init_output_data):
1618 Instantiate the template.
1619 (Sized_symbol<64>::init_output_data): Likewise.
1620
800d9823
CC
16212014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1622
1623 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
1624 adjust dynamic symbol value.
1625 * target.h (Target::adjust_dyn_symbol): New function.
1626 (Target::do_adjust_dyn_symbol): New function.
1627
918fc1f8 16282014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 1629
918fc1f8
CC
1630 * output.cc (Output_data_dynamic::Dynamic_entry::write):
1631 Get the value of DYNAMIC_CUSTOM dynamic entry.
1632 * output.h (Output_data_dynamic::add_custom): New function.
1633 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
1634 dynamic entry.
1635 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
1636 * target.h (Target::dynamic_tag_custom_value): New function.
1637 (Target::do_dynamic_tag_custom_value): New function.
1638
98ff9231
CC
16392014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1640
1641 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
1642 dynsym indexes.
1643 * target.h (Target::has_custom_set_dynsym_indexes): New function.
1644 (Target::do_has_custom_set_dynsym_indexes): New function.
1645 (Target::set_dynsym_indexes): New function.
1646 (Target::do_set_dynsym_indexes): New function.
1647
b80eed39
AM
16482014-03-07 Alan Modra <amodra@gmail.com>
1649
1650 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
1651 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
1652 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
1653 (Powerpc_relocate_functions::has_overflow_bitfield,
1654 overflowed): Use the above.
1655 (Target_powerpc::Relocate::relocate): Correct overflow checking
1656 for a number of relocations. Modify overflow test for 16-bit
1657 fields in instructions to signed/unsigned according to whether
1658 the field takes a signed or unsigned value.
1659
4b95cf5c
AM
16602014-03-05 Alan Modra <amodra@gmail.com>
1661
1662 Update copyright years.
1663
45965137
AM
16642014-03-05 Alan Modra <amodra@gmail.com>
1665
1666 * powerpc.cc (Target_powerpc::Scan::local, global): Support
1667 R_PPC64_ADDR64_LOCAL.
1668 (Target_powerpc::Relocate::relocate): Likewise.
1669
2c80b753
AM
16702014-03-03 Alan Modra <amodra@gmail.com>
1671
1672 * dwp.cc (print_version): Update copyright year to current.
1673
c1c69e83
AM
16742014-02-10 Alan Modra <amodra@gmail.com>
1675
1676 * po/gold.pot: Regenerate.
1677
dd0c4e70
CC
16782014-02-06 Cary Coutant <ccoutant@google.com>
1679
1680 Fix problem where -u is ignored when a weak undef is seen.
1681
1682 * archive.cc (Library_base::should_include_member): Reorder
1683 code to check for -u option if a weak undef has already been seen.
1684 * testsuite/Makefile.am (weak_undef_test_2): New test case.
1685 * testsuite/Makefile.in: Regenerate.
1686 * testsuite/weak_undef_file3.cc: New file.
1687 * testsuite/weak_undef_file4.cc: New file.
1688 * testsuite/weak_undef_test_2.cc: New file.
1689
1a221d3d
CC
16902014-02-05 Cary Coutant <ccoutant@google.com>
1691
1692 Fix issues with gold undefined symbol diagnostics.
1693
1694 PR binutils/15435
1695 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
1696 check to here.
1697 * target-reloc.h (is_strong_undefined): New function.
1698 (relocate_section): Move undef vtable symbol check from here.
1699 Check for is_strong_undefined.
1700
e889f0a4 17012014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 1702
e889f0a4
CC
1703 Fix problems with the --dynamic-list option.
1704
1705 PR gold/13577
1706 * options.cc (General_options::parse_dynamic_list):
1707 Set have_dynamic_list_.
1708 (General_options::General_options): Initialize have_dynamic_list_.
1709 (General_options::finalize): Turn off -Bsymbolic and
1710 -Bsymbolic-functions if --dynamic-list provided.
1711 * options.h (General_options::have_dynamic_list): New function.
1712 (General_options::have_dynamic_list_): New data member.
1713 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
1714 correctly.
5fe7ffdc 1715
e889f0a4
CC
1716 PR gold/16530
1717 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
1718 in --dynamic-list, mark it.
5fe7ffdc 1719
e889f0a4
CC
1720 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
1721 (dynamic_list_2): New test case.
1722 * testsuite/Makefile.in: Regenerate.
1723 * testsuite/dynamic_list_2.cc: New file.
1724 * testsuite/dynamic_list_2.t: New file.
1725 * testsuite/dynamic_list_lib1.cc: New file.
1726 * testsuite/dynamic_list_lib2.cc: New file.
1727 * testsuite/gc_dynamic_list_test.c: New file.
1728 * testsuite/gc_dynamic_list_test.sh: New file.
1729 * testsuite/gc_dynamic_list_test.t: New file.
1730
ec673e64
CC
17312014-01-28 Cary Coutant <ccoutant@google.com>
1732
1733 Add .gdb_index version 7 support.
1734
1735 * gold/dwarf_reader.cc: include <utility> (for make_pair).
1736 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
1737 debug sections.
1738 (Dwarf_ranges_table::read_ranges_table): Likewise.
1739 (Dwarf_pubnames_table::read_section): Check for GNU-style
1740 sections, and for compressed debug sections.
1741 (Dwarf_pubnames_table::read_header): Compute end address of table.
1742 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
1743 for end of list by offset, not by offset == 0.
1744 (Dwarf_info_reader::do_read_string_table): Check for compressed
1745 debug sections.
1746 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1747 Initialize new data members.
1748 (Dwarf_pubnames_table::next_name): return flag_byte.
1749 (Dwarf_pubnames_table::end_of_table_): New data member.
1750 (Dwarf_pubnames_table::is_gnu_style_): New data member.
1751 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
1752 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
1753 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
1754 read skeleton type unit DIEs.
1755 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
1756 (Gdb_index::do_write): Write flag_byte.
1757 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
1758 (Gdb_index::Cu_vector): Store flags along with cu indexes.
1759 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
1760 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
1761
221fd5d5
L
17622014-01-08 H.J. Lu <hongjiu.lu@intel.com>
1763
1764 * version.cc (print_version): Update copyright year to 2014.
1765
6c09fb0b
ILT
17662013-12-19 Dimitry Andric <dimitry@andric.com>
1767
1768 * stringpool.cc (Stringpool_template::reserve): Add
1769 HAVE_UNORDERED_MAP case.
1770 * stringpool.cc (Stringpool_template::print_stats): Likewise.
1771
8356f2d0
CC
17722013-12-18 Cary Coutant <ccoutant@google.com>
1773
1774 * configure.ac: Check for <unordered_set> and <unordered_map>.
1775 * config.in: Regenerate.
1776 * configure: Regenerate.
1777 * system.h: Use <unordered_set> and <unordered_map> if available.
1778
f2c7d7ee
RM
17792013-12-10 Roland McGrath <mcgrathr@google.com>
1780
1781 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
1782 with $(INSTALL_PROGRAM_ENV).
1783 * Makefile.in: Regenerate.
1784
6632e8cc
CC
17852013-11-22 Cary Coutant <ccoutant@google.com>
1786
1787 * configure.ac: Add check for which library is needed for
1788 dlopen.
1789 * configure: Regenerate.
1790
0c075858
CC
17912013-11-22 Cary Coutant <ccoutant@google.com>
1792
1793 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
1794 assembler.
1795 * testsuite/Makefile.in: Regenerate.
1796
f49fe902
L
17972013-11-17 H.J. Lu <hongjiu.lu@intel.com>
1798
1799 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
1800 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
1801 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
1802 (Target_x86_64<size>::Scan::local): Likewise.
1803 (Target_x86_64<size>::Scan::global): Likewise.
1804 (Target_x86_64<size>::Relocate::relocate): Likewise.
1805 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
1806 Likewise.
1807 (Target_x86_64<size>::Scan::check_non_pic(): Handle
1808 R_X86_64_PC32_BND.
1809
1810 * testsuite/Makefile.am (check_PROGRAMS): Add
1811 exception_x86_64_bnd_test.
1812 (exception_x86_64_bnd_test_SOURCES): New macro.
1813 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
1814 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
1815 (exception_x86_64_bnd_test_LDADD): Likewise.
1816 (exception_x86_64_bnd_1.o): New rule.
1817 (exception_x86_64_bnd_2.o): Likewise.
1818 * testsuite/Makefile.in: Regenerated.
1819
9055360d
AM
18202013-11-15 Alan Modra <amodra@gmail.com>
1821
1822 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
1823 accessor.
1824 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
1825 Only call ppc64_local_entry_offset for 64-bit. Restrict
1826 symval_for_branch lookup to ELFv1.
1827 (Stub_table::add_plt_call_entry): Use unsigned int off.
1828 (Output_data_glink::Address, invalid_address): New.
1829 (Output_data_glink::add_eh_frame): Move out of line. Add
1830 support for ELFv2.
1831 (Output_data_glink::add_global_entry, find_global_entry,
1832 global_entry_address): New functions.
1833 (Output_data_glink::global_entry_stubs_, end_branch_table_,
1834 ge_size): New variables.
1835 (Output_data_glink::set_final_data_size): Add global entry
1836 stub sizing.
1837 (Output_data_glink::do_write): Write global entry stubs.
1838 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
1839 parameter. Return true for ELFv2. Adjust callers.
1840 (Target_powerpc::Scan::local, global): Restrict opd lookup to
1841 ELFv1. Similarly for ifunc and dynamic relocation processing
1842 specific to ELFv1. Recognize that symbols are defined on
1843 their plt entries for ELFv2.
1844 (Target_powerpc::symval_for_branch): Assert if called for
1845 ELFv2 or ppc32.
1846 (Target_powerpc::Relocate::relocate): Use global entry plt
1847 stub for symbol value if such exists on ELFv2.
1848 (Target_powerpc::Relocate::relocate): Don't call
1849 symval_for_branch when ELFv2. Do adjust for local entry
1850 offset when ELFv2.
1851 (Target_powerpc::do_dynsym_value): Set symbols to global entry
1852 plt stub for ELFv2.
1853 (Target_powerpc::do_plt_address_for_global): Similarly.
1854
cafdd569
CC
18552013-11-14 Cary Coutant <ccoutant@google.com>
1856
1857 Revert patch -- this did not fix the problem, and there is
1858 no race there.
1859
1860 2013-11-14 Cary Coutant <ccoutant@google.com>
1861
1862 PR gold/14860
1863 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1864 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1865 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1866 updating fde_offsets_.
1867 (Eh_frame_hdr::lock_): New data member.
1868
94e49e16
CC
18692013-11-14 Cary Coutant <ccoutant@google.com>
1870
1871 * dwp.cc (Dwo_file_entry): New type.
1872 (File_list): Use Dwo_file_entry.
1873 (Dwo_file::verify): New function.
1874 (Dwo_file::verify_dwo_list): New function.
1875 (Dwo_file::sized_verify_dwo_list): New function.
1876 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
1877 list.
1878 (Dwp_options): New enum type.
1879 (dwp_options): Add --verify-only.
1880 (usage): Likewise.
1881 (main): Likewise.
1882 * dwp.h (gold_info): Add declaration.
1883
7cdd7d57
CC
18842013-11-14 Cary Coutant <ccoutant@google.com>
1885
1886 PR gold/14860
1887 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1888 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1889 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1890 updating fde_offsets_.
1891 (Eh_frame_hdr::lock_): New data member.
1892
1d946cb3
CC
18932013-11-06 Cary Coutant <ccoutant@google.com>
1894
1895 PR gold/15758
1896 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
1897 before reloc sections.
1898
4f65b40e
AM
18992013-11-04 Alan Modra <amodra@gmail.com>
1900
1901 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
1902 (Symbol::needs_dynamic_reloc): Test new flag.
1903 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
1904 (Target_powerpc::Scan::get_reference_flags): Add target param.
1905 Return FUNC_DESC_ABI for 64-bit ELFv1.
1906 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
1907 call.
1908 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
1909 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
1910
908794a9
CC
19112013-10-31 Cary Coutant <ccoutant@google.com>
1912
1913 Restore support for dwp v2 DWARF package file format.
1914
1915 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1916 tu_length parameter. Adjust all callers.
1917 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1918 * dwp.cc: Include dwarf.h.
1919 (Section_bounds): New struct type.
1920 (Unit_set): New struct type.
1921 (Dwo_file::Dwo_file): Initialize new data member.
1922 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1923 Combine and rename to...
1924 (Dwo_file::read_unit_index): ...this.
1925 (Dwo_file::sized_read_compunit_index)
1926 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1927 (Dwo_file::sized_read_unit_index): ...this.
1928 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1929 parameters; add section_id parameter.
1930 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1931 (Dwo_file::add_unit_set): ...this.
1932 (Dwo_file::shndx_map_): Remove.
1933 (Dwo_file::sect_offsets_): New data member.
1934 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1935 (Dwp_output_file::add_section): Rename to...
1936 (Dwp_output_file::add_contribution): ...this.
1937 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1938 (Dwp_output_file::add_tu_set): Likewise.
1939 (Dwp_output_file::Contribution): New type.
1940 (Dwp_output_file::Section::contributions): New data member.
1941 (Dwp_output_file::Cu_or_tu_set): Remove.
1942 (Dwp_output_file::Section::Section): New ctor.
1943 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1944 (Dwp_output_file::Dwp_index::Section_table): New type.
1945 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1946 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1947 parameter.
1948 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1949 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1950 (Dwp_output_file::Dwp_index::section_table): New member function.
1951 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1952 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1953 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1954 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1955 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1956 (Dwp_output_file::Dwp_index::section_table_): New data member.
1957 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1958 (Dwp_output_file::add_output_section): New member function.
1959 (Dwp_output_file::write_new_section): New member function.
1960 (Dwp_output_file::write_contributions): New member function.
1961 (Dwp_output_file::section_id_map_): New data member.
1962 (class Dwo_id_info_reader): Remove.
1963 (class Unit_reader): New class.
1964 (get_dwarf_section_name): New function.
1965 (Dwo_file::read_executable): Adjust initializations of class data.
1966 (Dwo_file::read): Add support for v2 package file format.
1967 (Dwo_file::read_unit_index): Likewise.
1968 (Dwo_file::sized_read_unit_index): Likewise.
1969 (Dwo_file::copy_section): Likewise.
1970 (Dwo_file::add_unit_set): Likewise.
1971 (Dwp_output_file::add_output_section): Likewise.
1972 (Dwp_output_file::add_contribution): Likewise.
1973 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1974 for empty slot.
1975 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1976 file format.
1977 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1978 slot.
1979 (Dwp_output_file::initialize): Remove unused function.
1980 (Dwp_output_file::finalize): Add support for v2 package file format.
1981 (Dwp_output_file::write_index): Likewise.
1982 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1983 function prototype.
1984
2500c017
CC
19852013-10-31 Cary Coutant <ccoutant@google.com>
1986
1987 * configure.ac: Fix check for -fmerge-constants.
1988 * configure.ac: Regenerate.
1989
dd0845d7
RM
19902013-10-30 Roland McGrath <mcgrathr@google.com>
1991
1992 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
1993 Correct 9-byte nop sequence to match what the assembler generates.
1994
b4f7960d
AM
19952013-10-30 Alan Modra <amodra@gmail.com>
1996
1997 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
1998 ppc64_local_entry_offset, ppc64_local_entry_offset,
1999 do_read_symbols): New functions.
2000 (Powerpc_relobj::e_flags_, st_other_): New vars.
2001 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
2002 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
2003 (Powerpc_relobj::e_flags_): New var.
2004 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
2005 and adjust for ELFv2.
2006 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
2007 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
2008 (Powerpc_dynobj::do_find_special_sections): Likewise.
2009 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
2010 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
2011 to ELFv2 local entry.
2012 (Target_powerpc::do_relax): No thread safe barriers needed for
2013 ELFv2.
2014 (Output_data_plt_powerpc::initial_plt_entry_size_,
2015 plt_entry_size): Delete. Replace all uses with
2016 first_plt_entry_offset() and plt_entry_size().
2017 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
2018 reserved_size parm. Update callers.
2019 (Output_data_plt_powerpc::entry_count): Update.
2020 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
2021 and use Target_powerpc::first_plt_entry_offset().
2022 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
2023 rename to plt_entry_size.
2024 (Output_data_plt_powerpc::add_ifunc_entry,
2025 add_local_ifunc_entry): Adjust reloc for ELFv2.
2026 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
2027 (glink_eh_frame_fde_64v2): New.
2028 (Stub_table::plt_call_size): Support ELFv2 sizing.
2029 (Output_data_glink::add_eh_frame): Use the new FDE.
2030 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
2031 (Stub_table::do_write): Write ELFv2 stubs and glink.
2032 (Target_powerpc::Relocate::relocate): Replaces nop after call
2033 with ld 2,24(1) and adjust local offset destination for ELFv2.
2034
f9c6b907
AM
20352013-10-30 Alan Modra <amodra@gmail.com>
2036
2037 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
2038 (Target_powerpc::Scan::global, local): Likewise.
2039 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
2040 on all ppc64 @h and @ha relocs.
2041
e84fe78f
AM
20422013-10-14 Alan Modra <amodra@gmail.com>
2043
2044 * output.h (Output_data_got::add_constant): Tidy.
2045 (Output_data_got::add_constant_pair): New function.
2046 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
2047 methods used so as to first call reserve_ent().
2048
679e4abf
RM
20492013-10-11 Roland McGrath <mcgrathr@google.com>
2050
44dcb735
RM
2051 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
2052 add_got_entry and add_got_entry_pair.
2053
13323c49
RM
2054 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
2055 (HAVE_PUBNAMES): Likewise.
2056 * configure: Regenerate.
2057
1496b446
RM
2058 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
2059 * testsuite/Makefile.in: Regenerate.
2060
cc84c10b
RM
2061 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
2062 Remove const from declaration.
2063 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
2064 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
2065 * output.h (Output_file_header): Remove const from member target_
2066 and corresponding constructor argument.
2067 * output.cc (Output_file_header::Output_file_header): Update prototype.
2068 (Output_file_header::do_sized_write): Use this->target_ in place
2069 of parameters()->target().
2070
52f66a2c
RM
2071 * testsuite/undef_symbol.cc (Foo::get_a): New method.
2072
2b64b551
RM
2073 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
2074 * configure: Regenerate.
2075 * Makefile.in: Regenerate.
2076 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
2077 * testsuite/merge_string_literals_2.c: Likewise.
2078 * testsuite/Makefile.am
2079 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
2080 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
2081 literal -fmerge-constants.
2082 * testsuite/Makefile.in: Regenerate.
2083
43819297
RM
2084 * i386.cc (Target_i386): Remove unused member dynbss_.
2085 * arm.cc (Target_arm): Likewise.
2086 * powerpc.cc (Target_powerpc): Likewise.
2087 * sparc.cc (Target_sparc): Likewise.
2088 * tilegx.cc (Target_tilegx): Likewise.
2089 * x86_64.cc (Target_x86_64): Likewise.
2090 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
2091 type_signature_, type_offset_.
2092 * plugin.h (Plugin_hook): Remove unused member layout_.
2093 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
2094 mapfile_.
2095 (Read_member): Remove unused members input_objects_, symtab_,
2096 mapfile_, layout_.
2097 (Check_library): Remove unused member symtab_.
2098 * archive.h (Lib_group): Remove unused member lib_.
2099 * archive.cc (Lib_group::Lib_group): Update initializer.
2100 * incremental.h (Incremental_binary): Remove unused member target_.
2101 (Incremental_script_entry): Removed unused member script_.
2102 * layout.h (Write_symbols_task): Remove unused member input_objects_.
2103 * icf.h (Icf): Remove unused member num_tracked_relocs.
2104
39d9ead7
RM
2105 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
2106 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
2107 its only use.
2108 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
2109
679e4abf
RM
2110 * archive.h: Use struct rather than class for forward declaration
2111 of Read_symbols_data.
2112
54de2ea6
CC
21132013-10-07 Cary Coutant <ccoutant@google.com>
2114
2115 PR gold/16010
2116 * testsuite/Makefile.am (icf_test): Fix dependencies.
2117 (icf_safe_test): Likewise.
2118 (icf_safe_so_test): Likewise.
2119 (large_symbol_alignment): Add empty _LDADD rule.
2120 * testsuite/Makefile.in: Regenerate.
2121
b14016f0
L
21222013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
2123
2124 PR gold/15927
2125 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
2126 relocation for R_X86_64_32 on x32.
2127
eb426534
RM
21282013-08-27 Roland McGrath <mcgrathr@google.com>
2129
2130 * output.cc (Output_segment::set_section_addresses): Take new
2131 Target* argument. If target->isolate_execinstr() and the segment
2132 is executable and starts at a target->abi_pagesize() boundary,
2133 pad its end out to a target->abi_pagesize() boundary with code fill.
2134 * output.h (Output_segment::set_section_addresses): Update decl.
2135 * layout.h (Layout::check_output_data_for_reset_values): Take new
2136 argument RELAX_OUTPUTS.
2137 (Layout): New member relax_output_list_.
2138 (Layout::add_relax_output): New method.
2139 * layout.cc (Layout::Layout): Update constructor.
2140 (Layout::reset_relax_output): New method.
2141 (Layout::clean_up_after_relaxation): Call it.
2142 (Layout::prepare_for_relaxation): Update caller.
2143 (Layout::set_segment_offsets): Update callers of set_section_addresses.
2144 Call reset_relax_output before re-processing segments for
2145 isolate_execinstr case.
2146 (Layout::write_data): Handle relax_output_list_.
2147 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
2148 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
2149
9aff4b7a
NC
21502013-08-23 Yuri Chornoivan <yurchor@ukr.net>
2151
2152 PR binutils/15834
2153 * object.h: Fix typos.
2154
93f8221c
RM
21552013-08-16 Roland McGrath <mcgrathr@google.com>
2156
2157 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
2158 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
2159
e44c3715
CC
21602013-08-07 Cary Coutant <ccoutant@google.com>
2161
2162 Revert support for v2 DWP files:
2163
2164 2013-03-01 Cary Coutant <ccoutant@google.com>
2165
2166 Add dwp support for v2 DWARF package file format.
2167 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2168 tu_length parameter. Adjust all callers.
2169 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2170 * dwp.cc: Include dwarf.h.
2171 (Section_bounds): New struct type.
2172 (Unit_set): New struct type.
2173 (Dwo_file::Dwo_file): Initialize new data member.
2174 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2175 Combine and rename to...
2176 (Dwo_file::read_unit_index): ...this.
2177 (Dwo_file::sized_read_compunit_index)
2178 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2179 (Dwo_file::sized_read_unit_index): ...this.
2180 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2181 parameters; add section_id parameter.
2182 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2183 (Dwo_file::add_unit_set): ...this.
2184 (Dwo_file::shndx_map_): Remove.
2185 (Dwo_file::sect_offsets_): New data member.
2186 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2187 (Dwp_output_file::add_section): Rename to...
2188 (Dwp_output_file::add_contribution): ...this.
2189 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2190 (Dwp_output_file::add_tu_set): Likewise.
2191 (Dwp_output_file::Contribution): New type.
2192 (Dwp_output_file::Section::contributions): New data member.
2193 (Dwp_output_file::Cu_or_tu_set): Remove.
2194 (Dwp_output_file::Section::Section): New ctor.
2195 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2196 (Dwp_output_file::Dwp_index::Section_table): New type.
2197 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2198 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2199 parameter.
2200 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2201 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2202 (Dwp_output_file::Dwp_index::section_table): New member function.
2203 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2204 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2205 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2206 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2207 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2208 (Dwp_output_file::Dwp_index::section_table_): New data member.
2209 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2210 (Dwp_output_file::add_output_section): New member function.
2211 (Dwp_output_file::write_new_section): New member function.
2212 (Dwp_output_file::write_contributions): New member function.
2213 (Dwp_output_file::section_id_map_): New data member.
2214 (class Dwo_id_info_reader): Remove.
2215 (class Unit_reader): New class.
2216 (get_dwarf_section_name): New function.
2217 (Dwo_file::read_executable): Adjust initializations of class data.
2218 (Dwo_file::read): Add support for v2 package file format.
2219 (Dwo_file::read_unit_index): Likewise.
2220 (Dwo_file::sized_read_unit_index): Likewise.
2221 (Dwo_file::copy_section): Likewise.
2222 (Dwo_file::add_unit_set): Likewise.
2223 (Dwp_output_file::add_output_section): Likewise.
2224 (Dwp_output_file::add_contribution): Likewise.
2225 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2226 for empty slot.
2227 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2228 file format.
2229 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2230 slot.
2231 (Dwp_output_file::initialize): Remove unused function.
2232 (Dwp_output_file::finalize): Add support for v2 package file format.
2233 (Dwp_output_file::write_index): Likewise.
2234 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2235 function prototype.
2236
c6905c28
CC
22372013-07-31 Cary Coutant <ccoutant@google.com>
2238
2239 * object.cc (Sized_relobj::do_output_section_address): New function.
2240 (Sized_relobj): Instantiate explicitly.
2241 * object.h (Object::output_section_address): New function.
2242 (Object::do_output_section_address): New function.
2243 (Sized_relobj::do_output_section_address): New function.
2244 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
2245
22462013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 2247 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
2248
2249 * parameters.cc (Parameters::entry): Return target-specific entry
2250 symbol name.
2251 * target.h (Target::entry_symbol_name): New function.
2252 (Target_info::entry_symbol_name): New data member.
2253
2254 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
2255 * i386.cc (Target_i386::i386_info): Likewise.
2256 (Target_i386_nacl::i386_nacl_info): Likewise.
2257 * sparc.cc (Target_sparc::sparc_info): Likewise.
2258 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
2259 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
2260 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
2261 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2262
234d4ab8
SA
22632013-07-22 Sterling Augustine <saugustine@google.com>
2264
2265 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
2266 Convert parameter shndx to local variable. Add parameters symtab
2267 and symtab_size. Scan over section names. Find relocation
2268 section corresponding to current section. Create and initialize
2269 reloc_mapper_ and reloc_type_.
2270 (Dwarf_pubnames_table::read_header): Add assertion. Change
2271 unit_length to off_t. Initialize member unit_length_. Fill in field
2272 cu_offset_.
2273 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2274 Initialize new fields unit_length_ and cu_offset_.
2275 (Dwarf_pubnames_table::read_section): Update prototype.
2276 (Dwarf_pubnames_table::cu_offset): New member function.
2277 (Dwarf_pubnames_table::subsection_size): Likewise.
2278 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
2279 New fields.
2280 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
2281 member functions public.
2282 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
2283 Update comment. Rework logic. Move repeated parts to...
2284 (Gdb_index_info_reader::read_pubtable): ...here. New function.
2285 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
2286 pubtypes_table_, and stmt_list_offset.
2287 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2288 Gdb_index::find_pubtype_offset,
2289 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
2290 (Gdb_index::pubnames_read): Update prototype and rework logic.
2291 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
2292 Forward declare.
2293 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2294 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
2295 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
2296 Gdb_index::map_pubtable_to_dies):
2297 Declare functions.
2298 (Gdb_index::pubnames_read): Update declaration.
2299 (Gdb_index::Pubname_offset_map): New type.
2300 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
2301 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
2302 Gdb_index::stmt_list_offset): Declare.
2303 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
2304 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
2305 Gdb_index::pubtypes_offset_): Remove.
2306
a3ed37d8
RM
23072013-07-19 Roland McGrath <mcgrathr@google.com>
2308
2309 * options.h (General_options): Add -Trodata-segment option.
2310 * parameters.cc (Parameters::check_rodata_segment): New function.
2311 (Parameters::set_target_once): Call it.
2312 * parameters.h (Parameters): Declare it (private member function).
2313 * layout.cc (load_seg_unusable_for_headers): New function, broken
2314 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
2315 then validate rodata segment rather than text segment.
2316 (relaxation_loop_body): Call that.
2317 (is_text_segment): New function. Don't admit a non-executable
2318 segment if TARGET->isolate_execinstr().
2319 (set_segment_offsets): Call it. Honor -Trodata-segment option.
2320
eb5b4ded
CC
23212013-07-15 Shawn Landden <shawnlandden@gmail.com>
2322
2323 PR gold/15070
2324 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
2325 * nacl.h (Sniff_file::View::View): Request aligned view.
2326
4d5effb9
CC
23272013-07-11 Cary Coutant <ccoutant@google.com>
2328
2329 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
2330 correct BRLT entry size.
2331
ba8ca3e7
AM
23322013-07-03 Alan Modra <amodra@gmail.com>
2333
2334 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
2335 comment.
2336
267257d2
CC
23372013-07-01 Cary Coutant <ccoutant@google.com>
2338
2339 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
2340 reloc_type_.
2341 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
2342 (Dwarf_ranges_table::lookup_reloc): New function.
2343 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
2344 reloc_type_.
2345 (Dwarf_ranges_table::lookup_reloc): New function.
2346 (Dwarf_ranges_table::reloc_type_): New data member.
2347
06f30c9d
CC
23482013-06-27 Jing Yu <jingyu@google.com>
2349
2350 PR gold/15662
2351 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
2352 function.
2353 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
2354 (Target_powerpc::do_relax): Call the above.
2355
a2d7bf59
AM
23562013-06-27 Cary Coutant <ccoutant@google.com>
2357
2358 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
2359 on garbage collected .opd section.
2360
23612013-06-27 Alan Modra <amodra@gmail.com>
2362
2363 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
2364 is non-zero.
2365 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
2366 (Target_powerpc::do_function_location): Likewise for loc->shndx.
2367
32364e50
CC
23682013-06-14 Cary Coutant <ccoutant@google.com>
2369
2370 * resolve.cc (Symbol::override_base): Don't override st_type
2371 from plugin placeholder symbols.
2372 (Symbol_table::resolve): Likewise.
2373 (Symbol_table::should_override): Don't complain about TLS mismatch
2374 if the TO symbol is a plugin placeholder.
2375 * testsuite/Makefile.am (plugin_test_tls): New test.
2376 * testsuite/Makefile.in: Regenerate.
2377 * testsuite/plugin_test_tls.sh: New test script.
2378 * testsuite/two_file_test_2_tls.cc: New test source.
2379 * testsuite/two_file_test_tls.cc: New test source.
2380
7fb47cc9
CC
23812013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
2382
2383 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
2384 the maximum segment alignment is larger than the page size.
2385 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
2386 correctly aligns the symbols with large alignemnt.
2387 * testsuite/Makefile.in: Regenerate.
2388 * testsuite/large_symbol_alignment.cc: New file.
2389
6934001a
CC
23902013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
2391 Sriraman Tallam <tmsriram@google.com>
2392
2393 * options.h (sort_section): New option.
2394 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
2395 Rename from Input_section_sort_section_name_special_ordering_compare.
2396 (Input_section_sort_section_name_compare): New struct.
2397 * output.cc (Output_section::Input_section_sort_section_name_compare::
2398 operator()): New function.
2399 (Output_section::sort_attached_input_sections): Use new sort function
2400 for .text if --sort-section=name is specified.
2401 * layout.cc (Layout::make_output_section):
2402 Add sorting by name when --sort-section=name is specified.
2403 * testsuite/Makefile.am (text_section_grouping): Test option
2404 --sort-section=name.
2405 * testsuite/Makefile.in: Regenerate.
2406 * testsuite/section_sorting_name.cc: New file.
2407 * testsuite/section_sorting_name.sh: New file.
2408
93acabad
CC
24092013-05-21 Cary Coutant <ccoutant@google.com>
2410
2411 * symtab.h (Symbol::is_cxx_vtable): New function.
2412 * target-reloc.h (relocate_section): Check for vtable symbol.
2413 * testsuite/Makefile.am (missing_key_func.sh): New test case.
2414 * testsuite/Makefile.in: Regenerate.
2415 * testsuite/missing_key_func.cc: New test source.
2416 * testsuite/missing_key_func.sh: New test script.
2417
60e8b3fc
CC
24182013-05-21 Cary Coutant <ccoutant@google.com>
2419
2b64b551
RM
2420 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
2421 type of enclosing symbol.
2422 (Relocate_info::location): Check symbol type when describing symbol.
2423 * object.h (Symbol_location_info): Remove unused line_number;
2424 add enclosing_symbol_type.
2425 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 2426
9df9de2c
CC
24272013-05-13 Cary Coutant <ccoutant@google.com>
2428
2b64b551
RM
2429 * configure.ac: Export DEFAULT_TARGET.
2430 * configure: Regenerate.
2431 * Makefile.in: Regenerate.
2432 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
2433 * testsuite/Makefile.in: Regenerate.
2434 * testsuite/debug_msg.sh: Delete duplicate tests.
2435 Don't check undef_int error message match for powerpc where the
2436 source file and line number aren't available.
9df9de2c 2437
bbc5ae17
RM
24382013-05-10 Roland McGrath <mcgrathr@google.com>
2439
2440 * options.h (General_options): Add --rosegment-gap option.
2441 * options.cc (finalize): --rosegment-gap implies --rosegment.
2442 * layout.cc (set_segment_offsets): Let user option override
2443 target->rosegment_gap().
2444
0c6e6c39
RM
24452013-05-10 Roland McGrath <mcgrathr@google.com>
2446
2447 * options.h (General_options): Remove leading space from help
2448 messages for -nostdlib and --rosegment.
2449
cde7cb01
MR
24502013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
2451
2452 PR ld/15365
2453 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
2454
f31ae5b8
AM
24552013-05-03 Alan Modra <amodra@gmail.com>
2456
2457 * merge.cc (Output_merge_string::do_add_input_section): Correct
2458 scan for number of strings. Rename vars to avoid shadowing.
2459 Include missing terminator in input_size_.
2460
d3a7cd45
L
24612013-05-01 H.J. Lu <hongjiu.lu@intel.com>
2462
2463 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
2464 Restore empty string handling.
2465
6ad3daba
CC
24662013-05-01 Cary Coutant <ccoutant@google.com>
2467
2468 * stringpool.cc (Stringpool_template::new_key_offset): Fix
2469 uninitialized warning.
2470
e31908b6
CC
24712013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
2472
2473 * output.cc (Output_section::add_merge_input_section): Allow
2474 to merge sections if the alignment is more than character size.
2475 * merge.h (Output_merge_string::Output_merge_string): Remove
2476 assert.
2477 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
2478 only not-null strings. Check the alignment of strings.
2479 * stringpool.h
2480 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
2481 alignment as the argument.
2482 (Stringpool_template<Stringpool_char>::addralign_): New class member.
2483 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
2484 Align non-zero length strings according to the addralign_.
2485 (Stringpool_template<Stringpool_char>::set_string_offsets):
2486 Updating offsets according to the given alignment.
2487 * testsuite/Makefile.am (text_section_grouping): Test if string
2488 literals are getting merged.
2489 * testsuite/Makefile.in: Regenerate.
2490 * testsuite/merge_string_literals_1.c: New file.
2491 * testsuite/merge_string_literals_2.c: Ditto.
2492 * testsuite/merge_string_literals.sh: Ditto.
2493
0e804863
ILT
24942013-04-26 Ian Lance Taylor <iant@google.com>
2495
2496 * target-reloc.h (relocate_section): If the reloc offset is out of
2497 range, pass VIEW as NULL to relocate.relocate.
2498 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
2499 * i386.cc (Target_i386::Relocate::relocate): Likewise.
2500 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
2501 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
2502 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
2503 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
2504
e7c5ea40
CC
25052013-04-26 Geoff Pike <gpike@chromium.org>
2506
2507 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
2508 * layout.cc (Hash_task): New class.
2509 (Layout::queue_build_id_tasks): New function.
2510 (Layout::write_build_id): Handle single-thread portion of build ID
2511 computation. (In some cases, all of it is single-threaded.) Replace
2512 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
2513 functionality in fewer lines of code.
2514 * layout.h (Layout::queue_build_id_tasks): New function declaration.
2515 * options.h (General_options): make "--build-id" default to tree
2516 rather than sha1. Add two new options related to --build-id=tree:
2517 --build-id-chunk-size-for-treehash and
2518 --build-id-min-file-size-for-treehash.
2519 * Makefile.am: add testing of --build-id=tree and related new options
2520 (these tests will be invoked by "make check").
2521 * Makefile.in: Regenerate.
2522
49926cd0
AM
25232013-04-25 Alan Modra <amodra@gmail.com>
2524
2525 * configure.tgt: Add powerpcle and powerpc64le.
2526
a4034750
AM
25272013-04-22 Alan Modra <amodra@gmail.com>
2528
2529 PR gold/15355
2530 * layout.cc (Layout::segment_precedes): Allow more than one
2531 segment with the same type and flags.
2532
e79c84aa
CC
25332013-04-15 Cary Coutant <ccoutant@google.com>
2534
2535 * layout.cc (Layout::set_relocatable_section_offsets): Don't
2536 allocate space in file for BSS sections.
2537
2199fbe7
CC
25382013-04-15 Cary Coutant <ccoutant@google.com>
2539
2540 * script-sections.cc (Orphan_output_section): Reset address
2541 to zero after each orphaned section for relocatable links.
2542
502e8a84
CC
25432013-04-15 Cary Coutant <ccoutant@google.com>
2544
a4034750
AM
2545 * symtab.cc (Symbol_table::sized_write_globals): Subtract
2546 section starting address for relocatable link.
2547 * testsuite/Makefile.am (script_test_11): New test.
2548 * testsuite/Makefile.in: Regenerate.
2549 * testsuite/script_test_11.c: New source file.
2550 * testsuite/script_test_11.t: New linker script.
502e8a84 2551
0cfdc767
AM
25522013-04-13 Alan Modra <amodra@gmail.com>
2553
2554 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
2555 owner when sections are not adjacent and exceed group size.
2556 (Target_powerpc::group_sections): Handle corner case.
2557 (Target_powerpc::Branch_info::make_stub): Handle case where
2558 stub table doesn't exist due to branches in non-exec sections.
2559 (Target_powerpc::Relocate::relocate): Likewise.
2560
6830ee24
AM
25612013-04-11 Alan Modra <amodra@gmail.com>
2562
2563 PR gold/15354
2564 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
2565 .branch_lt to match bfd ld. Adjust comments throughout file.
2566
54a3d865
ILT
25672013-04-04 Ian Lance Taylor <iant@google.com>
2568
2569 GCC PR c++/56840
2570 * object.cc (do_layout_deferred_sections): Handle .eh_frame
2571 sections before checking whether they are included in the link.
2572
9993ba11
ST
25732013-03-29 Sriraman Tallam <tmsriram@google.com>
2574
2575 * archive.cc (Archive::get_elf_object_for_member): Create the elf
2576 object before calling the plugin claim_file handler. Pass the elf
2577 object of the archive to the plugin. Delete the elf object if the
2578 plugin claims the file.
2579
ebacd51e
AM
25802013-03-21 Alan Modra <amodra@gmail.com>
2581
2582 * layout.cc (Layout::set_segment_offsets): Accept writable .text
2583 segment when omagic.
2584
117be58f
AM
25852013-03-21 Alan Modra <amodra@gmail.com>
2586
2587 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
2588 comparison warning.
2589 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
2590 uninitialized" warning.
2591
32e2b61d
AM
25922013-03-20 Alan Modra <amodra@gmail.com>
2593
2594 * symtab.h (Symbol::clear_version): New function.
2595 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
2596 is_needed by weak references. Clear version for symbols defined
2597 in as-needed objects that are not needed.
2598
b3ccdeb5
AM
25992013-03-15 Alan Modra <amodra@gmail.com>
2600
2601 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
2602 static and public. Add report_err param. Return false for data refs.
2603 (Target_powerpc::rela_dyn_section): New overloaded function.
2604 (Target_powerpc::plt_, iplt_): Elucidate.
2605 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
2606 (Output_data_plt_powerpc::do_write): Don't write .iplt.
2607 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
2608 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
2609 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
2610 push_branch and make_plt_entry for ifunc syms when
2611 reloc_needs_plt_for_ifunc.
2612 (Target_powerpc::Relocate::relocate): Don't use plt entry value
2613 for ifunc unless reloc_needs_plt_for_ifunc.
2614
ad3d8a2f
AM
26152013-03-15 Alan Modra <amodra@gmail.com>
2616
2617 * gc.h (gc_process_relocs): Don't look through function descriptors.
2618 * icf.cc (get_section_contents): Do so here instead.
2619
4d9aa155
AM
26202013-03-13 Alan Modra <amodra@gmail.com>
2621
2622 * powerpc.cc (is_branch_reloc): Forward declare.
2623 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
2624 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
2625 false for 64-bit, true for 32-bit non-branch relocs.
2626 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
2627 * testsuite/Makefile.am (icf_test): Use linker map file instead of
2628 nm output.
2629 (icf_safe_test): Generate linker map file as well as nm output.
2630 (icf_safe_so_test): Likewise.
2631 * testsuite/Makefile.in: Regenerate.
2632 * testsuite/icf_test.sh: Parse linker map file to determine
2633 section folding.
2634 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
2635 * testsuite/icf_safe_so_test.sh: Likewise.
2636 (X86_32_or_ARM_specific_safe_fold): Merge into..
2637 (arch_specific_safe_fold): ..this.
2638 (X86_64_specific_safe_fold): Delete unused function.
2639
57420c20
AM
26402013-03-12 Alan Modra <amodra@gmail.com>
2641
2642 * gc.h (gc_process_relocs): Look through function descriptors
2643 to determine shndx, symvalue and addend used by ICF. Tidy
2644 variable duplication.
2645
dc3714f3
AM
26462013-03-11 Alan Modra <amodra@gmail.com>
2647
2648 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
2649 * layout.cc (Layout_task_runner::run): ..to here.
2650 * symtab.h (struct Symbol_location): Extract from..
2651 (class Symbol_table): ..here.
2652 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
2653 * target.h (class Target): Add function_location and
2654 do_function_location functions.
2655 (class Sized_target): Add do_function_location.
2656 * object.h (class Sized_relobj_file): Move find_shdr..
2657 (class Object): ..to here.
2658 * object.cc: Likewise. Update to suit. Instantiate.
2659 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
2660 * powerpc.cc (class Powerpc_dynobj): New.
2661 (Target_powerpc::do_function_location): New function.
2662 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
2663 (Powerpc_dynobj::do_read_symbols): New function.
2664 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
2665
956b03bb
ILT
26662013-03-08 Ian Lance Taylor <iant@google.com>
2667
2668 * options.cc (General_options::string_to_object_format): Accept
2669 "default".
2670
4bead2d5
AM
26712013-03-08 Alan Modra <amodra@gmail.com>
2672
2673 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
2674 pointer to Post_fde.
2675 (struct Post_fde): Move definition to here..
2676 * ehframe.cc (struct Post_fde): ..from here.
2677 (Cie::write): Don't alloc Post_fde.
2678 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
2679
02e60bf7
AM
26802013-03-07 Alan Modra <amodra@gmail.com>
2681
2682 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
2683 relocation referencing .LC0.
2684 * testsuite/discard_locals_test.sh: Remove FIXMEs.
2685
8343f03a
AM
26862013-03-07 Alan Modra <amodra@gmail.com>
2687
2688 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
2689 always_inline. Add assembly for powerpc to avoid GOT.
2690
3366d57c
AM
26912013-03-07 Alan Modra <amodra@gmail.com>
2692
2693 * testsuite/script_test_10.sh: Don't test .bss section
2694 header number.
2695
6c77229c
AM
26962013-03-06 Alan Modra <amodra@gmail.com>
2697
2698 * powerpc.cc (class Powerpc_relobj): Move some member functions.
2699 (Target_powerpc::symval_for_branch): Add symtab param. Update
2700 all callers. Handle folded sections.
2701 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
2702 to Powerpc_relobj.
2703 (Global_symbol_visitor_opd::operator()): Likewise.
2704
a39e4af6
AM
27052013-03-04 Alan Modra <amodra@gmail.com>
2706
2707 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
2708 * testsuite/Makefile.in: Regenerate.
2709
d5834edb
CC
27102013-03-01 Cary Coutant <ccoutant@google.com>
2711
2712 Add dwp support for v2 DWARF package file format.
2713 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2714 tu_length parameter. Adjust all callers.
2715 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2716 * dwp.cc: Include dwarf.h.
2717 (Section_bounds): New struct type.
2718 (Unit_set): New struct type.
2719 (Dwo_file::Dwo_file): Initialize new data member.
2720 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2721 Combine and rename to...
2722 (Dwo_file::read_unit_index): ...this.
2723 (Dwo_file::sized_read_compunit_index)
2724 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2725 (Dwo_file::sized_read_unit_index): ...this.
2726 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2727 parameters; add section_id parameter.
2728 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2729 (Dwo_file::add_unit_set): ...this.
2730 (Dwo_file::shndx_map_): Remove.
2731 (Dwo_file::sect_offsets_): New data member.
2732 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2733 (Dwp_output_file::add_section): Rename to...
2734 (Dwp_output_file::add_contribution): ...this.
2735 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2736 (Dwp_output_file::add_tu_set): Likewise.
2737 (Dwp_output_file::Contribution): New type.
2738 (Dwp_output_file::Section::contributions): New data member.
2739 (Dwp_output_file::Cu_or_tu_set): Remove.
2740 (Dwp_output_file::Section::Section): New ctor.
2741 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2742 (Dwp_output_file::Dwp_index::Section_table): New type.
2743 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2744 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2745 parameter.
2746 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2747 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2748 (Dwp_output_file::Dwp_index::section_table): New member function.
2749 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2750 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2751 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2752 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2753 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2754 (Dwp_output_file::Dwp_index::section_table_): New data member.
2755 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2756 (Dwp_output_file::add_output_section): New member function.
2757 (Dwp_output_file::write_new_section): New member function.
2758 (Dwp_output_file::write_contributions): New member function.
2759 (Dwp_output_file::section_id_map_): New data member.
2760 (class Dwo_id_info_reader): Remove.
2761 (class Unit_reader): New class.
2762 (get_dwarf_section_name): New function.
2763 (Dwo_file::read_executable): Adjust initializations of class data.
2764 (Dwo_file::read): Add support for v2 package file format.
2765 (Dwo_file::read_unit_index): Likewise.
2766 (Dwo_file::sized_read_unit_index): Likewise.
2767 (Dwo_file::copy_section): Likewise.
2768 (Dwo_file::add_unit_set): Likewise.
2769 (Dwp_output_file::add_output_section): Likewise.
2770 (Dwp_output_file::add_contribution): Likewise.
2771 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2772 for empty slot.
2773 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2774 file format.
2775 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2776 slot.
2777 (Dwp_output_file::initialize): Remove unused function.
2778 (Dwp_output_file::finalize): Add support for v2 package file format.
2779 (Dwp_output_file::write_index): Likewise.
2780 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2781 function prototype.
2782
a68a081d
CC
27832013-03-01 Cary Coutant <ccoutant@google.com>
2784
2785 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
2786 function into class definition in header file.
2787 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
2788 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
2789 New function.
2790 (Dwarf_info_reader::check_buffer): Move here from .cc file.
2791
9d5781f8
AM
27922013-02-28 Alan Modra <amodra@gmail.com>
2793
2794 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
2795 * target.cc (Target::do_plt_fde_location): New function.
2796 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
2797 accessor function, and constructor param.
2798 (struct Post_fde, Post_fdes): Declare.
2799 (Cie::write): Add post_fdes param.
2800 * ehframe.cc (Fde::write): Use plt_fde_location.
2801 (struct Post_fde): Define.
2802 (Cie::write): Stash FDEs added post merge mapping.
2803 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
2804 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
2805 (Eh_frame::do_sized_write): Arrange to write post map FDES after
2806 other FDEs.
2807 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
2808 (Target_powerpc::has_glink): New function.
2809 (Target_powerpc::do_relax): Add eh_frame info for stubs.
2810 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
2811 glink_eh_frame_fde_32, default_fde): New data.
2812 (Stub_table::eh_frame_added_): New var.
2813 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
2814 Make const.
2815 (Stub_table::add_eh_frame): New function.
2816 (Output_data_glink::add_eh_frame): New function.
2817 (Target_powerpc::make_glink_section): Call add_eh_frame.
2818
214383dd
ILT
28192013-02-15 Ian Lance Taylor <iant@google.com>
2820
2821 * options.h (DEFINE_uint64_alias): Define.
2822 (class General_options): Add -Ttext-segment as an alias for
2823 -Ttext.
2824
91c2b899
AM
28252013-02-15 Alan Modra <amodra@gmail.com>
2826
2827 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
2828 (Stub_table::do_write): ..here, two places.
2829 (Stub_table::plt_call_size): Use it here too.
2830
20e2a8aa
ILT
28312013-02-11 Ian Lance Taylor <iant@google.com>
2832
2833 * descriptors.cc (Descriptors::close_all): New function.
2834 * descriptors.h (class Descriptors): Declare close_all.
2835 (close_all_descriptors): New inline function.
2836 * plugin.cc: Include "descriptors.h".
2837 (Plugin_manager::cleanup): Call close_all_descriptors.
2838
8952bc69
AM
28392013-02-06 Alan Modra <amodra@gmail.com>
2840
2841 * README: Update coding style link.
2842
29bd8b6b
CC
28432013-01-28 Cary Coutant <ccoutant@google.com>
2844
a4034750
AM
2845 * dwp.cc (File_list): New typedef.
2846 (Dwo_name_info_reader): New class.
2847 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
2848 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
2849 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
2850 (Dwo_file::read_executable): New function.
2851 (Dwo_file::read): Move common setup code to ...
2852 (Dwo_file::make_object): ... here.
2853 (dwp_options): Add --exec/-e.
2854 (usage): Likewise.
2855 (main): Likewise.
29bd8b6b 2856
c6ac678d
ST
28572013-01-24 Sriraman Tallam <tmsriram@google.com>
2858
2859 * layout.cc (Layout::layout): Check for option text_reorder.
2860 (Layout::make_output_section): Ditto.
2861 * options.h (text_reorder): New option.
2862 * output.cc (Input_section_sort_compare): Remove special ordering
2863 of section names.
2864 (Output_section::
2865 Input_section_sort_section_name_special_ordering_compare::
2866 operator()): New function.
2867 (Output_section::sort_attached_input_sections): Use new sort function
2868 for .text.
2869 * output.h (Input_section_sort_section_name_special_ordering_compare):
2870 New struct.
2871 * testsuite/Makefile.am (text_section_grouping): Test option
2872 --no-text-reorder
2873 * testsuite/Makefile.in: Regenerate.
2874 * testsuite/text_section_grouping.sh: Check order of functions without
2875 default text reordering.
2876
50701cc1
MF
28772013-01-18 Mike Frysinger <vapier@gentoo.org>
2878
2879 * options.h (General_options): Change default to true for new_dtags.
2880
b1b00fcc
MF
28812013-01-18 Mike Frysinger <vapier@gentoo.org>
2882
2883 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
2884 when enable_new_dtags is false. Only add DT_RUNPATH when
2885 enable_new_dtags is true.
2886
ec5b8187
AM
28872013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
2888
2889 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
2890 used in declaration and definition consistent.
2891 (Target_powerpc::symval_for_branch): Ditto.
2892
a880d4c4
ST
28932013-01-16 Sriraman Tallam <tmsriram@google.com>
2894
2895 * testsuite/plugin_final_layout.cc: Fix comment.
2896
7c381248
ST
28972013-01-16 Sriraman Tallam <tmsriram@google.com>
2898
2899 * layout.cc (Layout::layout): Do not do default sorting for
2900 text sections when section ordering is specified.
2901 (make_output_section): Ditto.
2902 * testsuite/plugin_final_layout.cc: Name the function sections
2903 to catch reordering issues.
2904
e2458743
AM
29052013-01-15 Alan Modra <amodra@gmail.com>
2906
2907 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
2908 plt-thread-safe.
2909
431ed302
AM
29102013-01-15 Alan Modra <amodra@gmail.com>
2911
2912 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
2913 * testsuite/Makefile.in: Regenerate.
2914
0ec6429b
AM
29152013-01-14 Alan Modra <amodra@gmail.com>
2916
2917 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
2918 * testsuite/Makefile.in: Regenerate.
2919
0bf402d5
ILT
29202013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
2921
36af3926 2922 PR bfd/14430
0bf402d5
ILT
2923 Fix mingw gold build with plugins enabled
2924 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
2925 * configure.ac: Export DLOPEN_LIBS and add headers check.
2926 * plugin.cc: Handle non-dlfcn case.
2927 * Makefile.in: Regenerate.
2928 * config.in: Regenerate.
2929 * configure: Regenerate.
2930 * testsuite/Makefile.in: Regenerate.
2931
9e9143bc
ST
29322013-01-09 Sriraman Tallam <tmsriram@google.com>
2933
2934 * output.h (sort_attached_input_sections): Change to be public.
2935 * script-sections.cc
2936 (Output_section_definition::set_section_addresses): Sort
2937 attached input sections according to section order before linker
2938 script assigns section addresses.
2939 (Orphan_output_section::set_section_addresses): Sort
2940 attached input sections according to section order before linker
2941 script assigns section addresses.
2942 * Makefile.am (final_layout.sh): Use a simple linker script to
2943 check if section ordering still works.
2944 * Makefile.in: Regenerate.
2945
679af368
ILT
29462013-01-09 Ben Cheng <bccheng@google.com>
2947
2948 * arm.cc (Target_arm::attributes_accept_div): New function.
2949 (Target_arm::attributes_forbid_div): New function.
2950 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
2951 attribute using the same new functions as what bfd/elf32_arm.c
2952 does.
2953
3136a00e
CC
29542013-01-07 Cary Coutant <ccoutant@google.com>
2955
2956 PR gold/14993
2957 * output.cc (Output_section::add_input_section): For incremental
2958 updates, don't track input sections that are allocated from patch
2959 space.
2960
f2a6224b
L
29612013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2962 Ian Lance Taylor <iant@google.com>
2963
2964 PR gold/14897
2965 * configure.ac (--enable-ld): Removed.
2966 (install_as_default): Set to yes only for --enable-gold=default
2967 or --disable-ld.
2968 * configure: Regenerated.
2969
4f46f626
L
29702013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2971
2972 * options.h (General_options): Add -fuse-ld= for GCC linker
2973 option compatibility.
2974
26e4ef59
CC
29752013-01-04 Cary Coutant <ccoutant@google.com>
2976
2977 * configure.ac: Fix typo restoring CXXFLAGS.
2978 * configure: Regenerate.
2979
3d587466
CC
29802013-01-04 Cary Coutant <ccoutant@google.com>
2981
4f46f626
L
2982 * testsuite/Makefile.am (CXXLINK_S): New macro.
2983 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
2984 * testsuite/Makefile.in: Regenerate.
3d587466 2985
44db6695
L
29862013-01-02 H.J. Lu <hongjiu.lu@intel.com>
2987
2988 * version.cc (print_version): Update copyright year to 2013.
2989
edcac0c1
ILT
29902012-12-20 Ian Lance Taylor <iant@google.com>
2991
2992 * layout.cc (Layout::special_ordering_of_input_section): New
2993 function.
2994 (Layout::layout): If input section requires special ordering, must
2995 sort input sections.
2996 (Layout::make_output_section): May sort .text input sections.
2997 (Layout::is_section_name_prefix_grouped): Remove.
2998 * layout.h (class Layout): Declare
2999 special_ordering_of_input_section. Don't declare
3000 is_section_name_prefix_grouped.
3001 * output.cc (Output_section::add_input_section): Revert last
3002 change.
3003 (Output_section::Input_section_sort::match_file_name): Don't crash
3004 if called on output section data.
3005 (Output_section::Input_section_sort_compare): Sort based on
3006 special ordering.
3007 (Output_section::Input_section_sort_section_order_index_compare):
3008 Revert last patch.
3009 (Output_section::sort_attached_input_sections): Likewise.
3010
28f2a4ac
ST
30112012-12-18 Sriraman Tallam <tmsriram@google.com>
3012
edcac0c1 3013 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
3014 * layout.h (Layout::is_section_name_prefix_grouped): New function.
3015 * output.cc (Output_section::add_input_section): Check if section
3016 name contains special prefix. Keep input sections to sort such
3017 sections.
3018 (Output_section::Input_section_sort_section_order_index_compare
3019 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
3020 (Output_section::sort_attached_input_sections): Add condition to
3021 Input_section_entry constructor call.
28f2a4ac
ST
3022 * testsuite/Makefile.am (text_section_grouping): New test.
3023 * testsuite/Makefile.in: Regenerate.
3024 * testsuite/text_section_grouping.cc: New file.
3025 * testsuite/text_section_grouping.sh: New file.
3026
5bf135a7
NC
30272012-12-17 Nick Clifton <nickc@redhat.com>
3028
3029 * Makefile.am: Add copyright notice.
3030 * NEWS: Likewise.
3031 * README: Likewise.
3032 * configure.ac: Likewise.
3033 * ftruncate.c: Likewise.
3034 * Makefile.in: Regenerate.
3035
59965708
CC
30362012-12-14 Cary Coutant <ccoutant@google.com>
3037
a4034750
AM
3038 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
3039 --no-as-needed flag.
3040 (exception_separate_shared_12_test): Likewise.
3041 (incremental_copy_test): Likewise.
3042 * testsuite/Makefile.in: Regenerate.
59965708 3043
2a77e2ab
CC
30442012-12-14 Cary Coutant <ccoutant@google.com>
3045
3046 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
3047 (Dwp_output_file::Dwp_index::enter_set): Add assert.
3048
e3deeb9c
AM
30492012-12-12 Alan Modra <amodra@gmail.com>
3050
3051 * powerpc.cc (class Track_tls): New.
3052 (class Relocate, class Scan): Inherit Track_tls.
3053 (Target_powerpc::Scan::local, global): Track tls optimization
3054 and avoid creating plt entry for __tls_get_addr if all uses
3055 are optimized away.
3056 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
3057
d8f5a274
AM
30582012-12-12 Alan Modra <amodra@gmail.com>
3059
3060 * options.h (General_options): Add --toc-sort/--no-toc-sort.
3061 Replace no_toc_optimize with toc_optimize.
3062 * output.h (Output_section::input_sections): Provide non-const variant.
3063 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
3064 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
3065 accessors.
3066 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
3067 (class Sort_toc_sections): New.
3068 (Target_powerpc::do_finalize_sections): Sort toc sections.
3069 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
3070
4c8a1de1
RM
30712012-12-10 Roland McGrath <mcgrathr@google.com>
3072
3073 * testsuite/binary_unittest.cc (read_all): New function.
3074 (Sized_binary_test): Use it instead of ::read.
3075 * fileread.cc (do_read): Don't assume pread always reads the whole
3076 amount in a single call.
3077
edc27beb
AM
30782012-12-10 Alan Modra <amodra@gmail.com>
3079
3080 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
3081 Set EM_PPC64 or EM_PPC here.
3082 (Target_selector_powerpc::do_recognize): Delete.
3083
906b9150
AM
30842012-12-10 Alan Modra <amodra@gmail.com>
3085
3086 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
3087 stub_table_.
3088 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
3089
418c15ae
RM
30902012-12-07 Roland McGrath <mcgrathr@google.com>
3091
3092 * testsuite/binary_unittest.cc (Sized_binary_test):
3093 Use open_descriptor rather than ::open.
3094
decdd3bc
AM
30952012-12-07 Alan Modra <amodra@gmail.com>
3096
3097 * powerpc.cc (Stub_table::do_write): Delete redundant Address
3098 typedef and invalid_address constant.
3099 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
3100 instantiate constants.
3101
db399005
ILT
31022012-12-06 Roland McGrath <mcgrathr@google.com>
3103
3104 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
3105 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
3106 * aclocal.m4: Regenerate.
3107 * configure: Regenerate.
3108 * Makefile.in: Regenerate.
3109 * testsuite/Makefile.in: Regenerate.
3110
aba6bc71
AM
31112012-12-07 Alan Modra <amodra@gmail.com>
3112
3113 * options.h (General_options): Add no_toc_optimize.
3114 * powerpc.cc (ok_lo_toc_insn): New function.
3115 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
3116
9e69ed50
AM
31172012-12-06 Alan Modra <amodra@gmail.com>
3118
3119 * options.h (General_options): Add plt_align, plt_static_chain,
3120 plt_thread_safe. Update stub_group_size help text.
3121 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
3122 for new plt_thread_safe_ var.
3123 (use_plt_offset): Correct comments.
3124 (Target_powerpc::do_relax): Look for thread creation symbols to
3125 determine default plt_thread_safe value. Clear plt call stubs
3126 as well as branch stubs each iteration.
3127 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
3128 insn constants.
3129 (l, hi, ha, write_insn): Move earlier.
3130 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
3131 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
3132 plt stubs too.
3133 (Stub_table::update_size): Adjust.
3134 (Stub_table::prev_size, set_prev_size): Delete.
3135 (Stub_table::stub_align): Let --plt-align affect result.
3136 (Stub_table::plt_call_size): Calculate sizes for various stubs.
3137 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
3138 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
3139 (Stub_table::do_write): Support more stub variants.
3140
f43ba157
AM
31412012-12-04 Alan Modra <amodra@gmail.com>
3142
3143 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
3144 (Target_powerpc::do_define_standard_symbols): New function.
3145
34171bc5
AM
31462012-12-03 Alan Modra <amodra@gmail.com>
3147
3148 * output.h: Formatting, whitespace.
3149
dc9589e9 31502012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
3151
3152 * layout.h (Layout::get_executable_sections): Declare.
3153 * layout.cc (Layout::get_executable_sections): New function.
3154 * arm.cc (Target_arm::group_sections): Use it.
3155 (Arm_output_section::group_sections): Delete now redundant test.
3156 * output.cc (Output_reloc::Output_reloc): Add is_relative.
3157 param to handle relative relocs.
3158 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
3159 (Output_data_reloc::add_absolute): Adjust.
3160 (Output_data_reloc::add_relative): New function.
3161 (Output_data::reset_data_size): New function.
3162 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
3163 (Output_section::set_addralign): New function.
3164 (Output_section::checkpoint_set_addralign): New function.
3165 (Output_section::clear_section_offsets_need_adjustment): New function.
3166 (Output_section::input_sections): Make public.
3167 * powerpc.cc (class Output_data_brlt_powerpc): New.
3168 (class Stub_table, class Stub_control): New.
3169 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
3170 stub_table_, set_stub_table, stub_table): New vectors and accessor
3171 functions.
3172 (Target_powerpc::do_may_relax, do_relax, push_branch,
3173 new_stub_table, stub_tables, brlt_section, group_sections,
3174 add_branch_lookup_table, find_branch_lookup_table,
3175 write_branch_lookup_table, make_brlt_section): New functions.
3176 (Target_powerpc::struct Sort_sections, class Branch_info): New.
3177 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
3178 branch_info_): New vars.
3179 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
3180 make call stubs here.
3181 (Output_data_glink): Remove all call stub handling from this class.
3182 (Target_powerpc::Scan::local, global): Save interesting branch
3183 relocs and relocs for ifunc. Adjust calls to plt entry functions.
3184 (Target_powerpc::do_finalize_sections): Only make reg save/restore
3185 functions on final link.
3186 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
3187 Handle long branch destinations too.
3188 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
3189 do_plt_address_for_local): Adjust lookup of plt call stubs.
3190
627b30b7
AM
31912012-11-30 Alan Modra <amodra@gmail.com>
3192
3193 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
3194 relocs against protected symbols when building 32-bit shared libs.
3195
40b469d7
AM
31962012-11-30 Alan Modra <amodra@gmail.com>
3197
3198 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
3199 param. Call got_section() to make .got. Update all callers
3200 and their callers and so on.
3201
bb66a627
AM
32022012-11-30 Alan Modra <amodra@gmail.com>
3203
3204 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
3205 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
3206 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
3207 value if it already exists.
3208
d2cf1c6c
L
32092012-11-19 H.J. Lu <hongjiu.lu@intel.com>
3210
3211 PR gold/14858
3212 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
3213
edccdf7c
RM
32142012-11-14 Roland McGrath <mcgrathr@google.com>
3215
3216 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
3217 than bfc instruction for data sandboxing.
3218
6febeb74
AM
32192012-11-08 Alan Modra <amodra@gmail.com>
3220
3221 * po/POTFILES.in: Regenerate.
3222
0a6f1bf2
AM
32232012-11-05 Alan Modra <amodra@gmail.com>
3224
3225 * configure.ac: Apply 2012-09-10 change to config.in here.
3226 * configure: Regenerate.
3227
26a4e9cb
AM
32282012-11-05 Alan Modra <amodra@gmail.com>
3229
3230 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
3231 (struct Opd_ent): Use "Address" rather than "Offset".
3232 (Output_data_got_powerpc::got_base_offset): Return Valtype.
3233 (Target_powerpc::got_section): Make public.
3234 (Target_powerpc::scan_relocs): Move code setting symbols..
3235 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
3236 Create _SDA_BASE_ only when referenced.
3237
cc928013
RM
32382012-11-02 Roland McGrath <mcgrathr@google.com>
3239
3240 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
3241 from last change.
3242
50ed5eb1
RM
32432012-11-01 Roland McGrath <mcgrathr@google.com>
3244
62fe925a
RM
3245 * target.h (Sized_target::relocate_relocs): Use Elf_Off
3246 for offset_in_output_section parameter.
3247 (Sized_target::relocate_special_relocatable): Likewise.
3248 * arm.cc (Target_arm::relocate_relocs): Likewise.
3249 (Target_arm::relocate_special_relocatable): Likewise.
3250 * i386.cc (Target_i386::relocate_relocs): Likewise.
3251 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
3252 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
3253 * target-reloc.h (relocate_relocs): Likewise.
3254 * testsuite/testfile.cc (Target_test): Likewise.
3255 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
3256 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
3257
3258 * system.h: Move inclusion of <clocale> to after <libintl.h> in
3259 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
3260
3261 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
3262 parameter, which is unused in the [!F_SETFD] case.
3263
50ed5eb1
RM
3264 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
3265 SYMNDX to off_t before comparing it to this->data_size().
3266 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
3267 * incremental.cc (Output_section_incremental_inputs::do_write):
3268 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
3269
2cadc0bf
RM
3270 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
3271
3bfcb652
NC
32722012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
3273
3274 * gold.cc (Target_arm::do_adjust_elf_header): Add the
3275 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
3276 in EABI_VER5.
3277
c1a8d56e
CC
32782012-10-29 Cary Coutant <ccoutant@google.com>
3279
3280 * dwp.cc (usage): Add file and exit status parameters;
3281 add --help and --version options.
3282 (print_version): New function.
3283 (main): Add --help and --version options.
3284
b2490a7b
L
32852012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3286
3287 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
3288 final_layout_sequence.txt.
3289 * testsuite/Makefile.in: Regenerated.
3290
aa543512
L
32912012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3292
3293 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
3294 COMPILE generated by automake.
3295 (LINK1): Likewise.
3296 (CXXCOMPILE1): Likewise.
3297 (CXXLINK1): Likewise.
3298 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
3299 (LINK): Likewise.
3300 (CXXCOMPILE): Likewise.
3301 (CXXLINK): Likewise.
3302 * testsuite/Makefile.in: Regenerated.
3303
d361fafb
L
33042012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3305
3306 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
3307 on bad fwrite return.
3308
598c7410
L
33092012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3310
3311 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
3312 on val.
3313
35c813e2
CC
33142012-10-23 Cary Coutant <ccoutant@google.com>
3315
3316 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
3317 * testsuite/Makefile.in: Regenerate.
3318 * testsuite/dwp_test.h: New source file.
3319 * testsuite/dwp_test_1.cc: New source file.
3320 * testsuite/dwp_test_1.s: New source file.
3321 * testsuite/dwp_test_1.sh: New source file.
3322 * testsuite/dwp_test_1b.cc: New source file.
3323 * testsuite/dwp_test_1b.s: New source file.
3324 * testsuite/dwp_test_2.cc: New source file.
3325 * testsuite/dwp_test_2.s: New source file.
3326 * testsuite/dwp_test_2.sh: New source file.
3327 * testsuite/dwp_test_main.cc: New source file.
3328 * testsuite/dwp_test_main.s: New source file.
3329
77429909
CC
33302012-10-23 Cary Coutant <ccoutant@google.com>
3331
3332 * dwp.h: New header file.
3333 * dwp.cc: New source file.
3334 * gold.h: Move shared declarations to system.h.
3335 * system.h: New header file.
3336 * Makefile.am: Add dwp.
3337 * Makefile.in: Regenerate.
3338
ed5d6712
CC
33392012-10-23 Cary Coutant <ccoutant@google.com>
3340
3341 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
3342 Dwarf_info_reader::read_from_pointer.
3343 (Dwarf_pubnames_table::read_header): Likewise.
3344 (Dwarf_pubnames_table::next_name): Likewise.
3345 (Dwarf_die::read_attributes): Likewise.
3346 (Dwarf_die::skip_attributes): Likewise.
3347 (Dwarf_info_reader::read_from_pointer): New function template.
3348 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
3349 (Dwarf_pubnames_table): Likewise.
3350 (Dwarf_info_reader::read_from_pointer): New function template.
3351 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
3352 Dwarf_pubnames_table ctor.
3353
8787852d
CC
33542012-10-23 Cary Coutant <ccoutant@google.com>
3355
3356 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
3357 abbrev_shndx.
3358 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
3359 abbrev_shndx_.
3360 (Dwarf_info_reader::set_abbrev_shndx): New method.
3361 (Dwarf_info_reader::abbrev_shndx_): New data member.
3362
9fc236f3
CC
33632012-10-23 Cary Coutant <ccoutant@google.com>
3364
3365 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
3366 from object, not parameters.
3367 (Dwarf_info_reader::parse): Likewise.
3368 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
3369 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
3370 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
3371 methods.
3372
effe8365
CC
33732012-10-23 Cary Coutant <ccoutant@google.com>
3374
3375 * fileread.cc (Input_file::Input_file): New constructor.
3376 * fileread.h (class Input_file): Add new constructor.
3377
1698990d
AM
33782012-10-18 Alan Modra <amodra@gmail.com>
3379
3380 PR gold/14727
3381 * object.cc (Relobj::is_section_name_included): Also match
3382 .sdata personality section.
3383
168a4726
AM
33842012-10-18 Alan Modra <amodra@gmail.com>
3385
3386 * target-reloc.h (class Default_comdat_behavior): New, package up..
3387 (get_comdat_behaviour): ..this.
3388 (relocate_section): Add Relocate_comdat_behavior template arg,
3389 adjust code to suit.
3390 * arm.cc (Target_arm::relocate_section): Adjust to suit.
3391 (Target_arm::scan_reloc_section): Likewise.
3392 * i386.cc (Target_i386::relocate_section): Likewise.
3393 * sparc.cc (Target_sparc::relocate_section): Likewise.
3394 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
3395 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
3396 * powerpc.cc (class Relocate_comdat_behavior): New.
3397 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
3398 gold::relocate_section with new template arg.
3399
acc276d8
AM
34002012-10-18 Alan Modra <amodra@gmail.com>
3401
3402 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
3403 dynamic relocs for GOT_TPREL got entries, without symbol if
3404 resolving locally.
3405 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
3406 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
3407 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
3408
e10f9870
AM
34092012-10-17 Alan Modra <amodra@gmail.com>
3410
3411 PR gold/14726
3412 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
3413
ae034989
ST
34142012-10-16 Sriraman Tallam <tmsriram@google.com>
3415
3416 * layout.cc (Layout::include_section): Keep sections marked
3417 SHF_EXCLUDE when doing relocatable links.
3418
f3a0ed29
AM
34192012-10-16 Alan Modra <amodra@gmail.com>
3420
3421 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
3422 (Target_powerpc::do_finalize_sections): Call it.
3423 (Output_data_save_res): New class and supporting functions.
3424 (Target_powerpc::symval_for_branch): Only look up .opd entry for
3425 normal symbols defined in object files.
3426
c6de8ed4
AM
34272012-10-12 Alan Modra <amodra@gmail.com>
3428
3429 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
3430 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
3431 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
3432 section if scan_opd_relocs not yet called.
3433 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
3434
03e25981
AM
34352012-10-12 Alan Modra <amodra@gmail.com>
3436
3437 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3438 add_local_ifunc_entry): Revert last change.
3439 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
3440
c9824451
AM
34412012-10-05 Alan Modra <amodra@gmail.com>
3442
3443 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
3444 do_plt_address_for_global): New functions.
3445 (Output_data_got_powerpc::do_write): Don't segfault when linking
3446 statically.
3447 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3448 add_local_ifunc_entry): Return true on adding entry..
3449 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
3450 glink->add_entry call. Remove unused symtab param. Adjust calls.
3451 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
3452 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
3453 set up symbols here.
3454 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
3455 syms here. Do so even when no .iplt. Don't segfault when linking
3456 statically.
3457 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
3458 new variants without reloc param.
3459 (Glink_sym_ent::Glink_sym_ent): Likewise.
3460 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
3461 reloc when refs will resolve to plt call stub.
3462 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
3463 R_PPC_PLTREL24 to resolve locally.
3464 (Target_powerpc::Scan::global): Correct ifunc handling.
3465 (Target_powerpc::Relocate::relocate): Correct local sym glink
3466 lookup. Don't destroy "value" when we have a plt call stub,
3467 and when checking plt call validity.
3468 (Target_powerpc::do_dynsym_value): Simplify.
3469
19fec8c1
AM
34702012-10-05 Alan Modra <amodra@gmail.com>
3471
3472 * i386.cc (Output_data_plt_i386::address_for_global,
3473 address_for_local): Add plt offset to returned value. Adjust uses.
3474 * sparc.cc (Output_data_plt_sparc::address_for_global,
3475 address_for_local): Likewise.
3476 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
3477 address_for_local): Likewise.
3478 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
3479 address_for_local): Likewise.
3480 * target.h (Target::plt_address_for_global, plt_address_for_local):
3481 Update comment.
3482 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
3483 (Output_data_got::Got_entry::write): Nor here.
3484 * output.h: Comment fix.
3485
e867b647
WL
34862012-10-02 Jiong Wang <jiwang@tilera.com>
3487
3488 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
3489 global_offset_table_ value for larget got.
3490 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
3491
e5d5f5ed
AM
34922012-09-29 Alan Modra <amodra@gmail.com>
3493
3494 * powerpc.cc (Target_powerpc::iplt_): New output section.
3495 (Target_powerpc::iplt_section, make_iplt_section,
3496 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
3497 (Target_powerpc::make_plt_entry): Handle ifunc syms.
3498 Target_powerpc::plt_entry_count): Count iplt entries too.
3499 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
3500 reloc section in constructor. New params.
3501 (Target_powerpc::make_plt_section): Create reloc section here instead.
3502 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
3503 functions.
3504 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
3505 (Output_data_glink::add_entry, find_entry): New functions to
3506 deal with local syms.
3507 (Glink_sym_ent): Add support for local syms.
3508 (Output_data_glink::do_write): Handle ifunc plt entries.
3509 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3510 (Target_powerpc::Scan::local, global): Handle ifunc syms.
3511 (Target_powerpc::Relocate::relocate): Likewise.
3512 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
3513
ec4dbad3
AM
35142012-09-25 Alan Modra <amodra@gmail.com>
3515
3516 * object.h (Sized_relobj_file::adjust_local_symbol,
3517 do_adjust_local_symbol): New functions.
3518 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
3519 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
3520 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
3521 and irregular opd entry spacing.
3522 (Powerpc_relobj::do_read_relocs): Add opd size checks.
3523 (Global_symbol_visitor_opd): New functor.
3524 (Target_powerpc::do_finalize_sections): Omit global symbols defined
3525 on deleted opd entries.
3526
5c0b3823
WL
35272012-09-15 Jiong Wang <jiwang@tilera.com>
3528
3529 * tilegx.cc: New file.
3530 * Makefile.am (TARGETSOURCES): Add tilegx.cc
3531 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
3532 * configure.tgt: Add entries for tilegx*.
3533 * configure.ac: Likewise.
3534 * Makefile.in: Rebuild.
3535 * configure: Likewise.
3536 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
3537 tilegx.
3538
bfdfa4cd
AM
35392012-09-13 Alan Modra <amodra@gmail.com>
3540
3541 * target-reloc.h (scan_relocs): Call scan.local for relocs
3542 against symbols in discarded sections. Pass is_discarded
3543 param.
3544 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
3545 Add is_discarded param.
3546 * powerpc (Target_powerpc::Scan::local): Likewise. Use
3547 is_discarded to flag opd entry as discarded. Don't emit dyn
3548 relocs on such entries.
3549 (Target_powerpc::Scan::global): Similarly detect and handle
3550 such opd entries.
3551 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
3552 opd_ent_. Update all uses.
3553 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
3554 (Target_powerpc::relocate_section): Zero out discarded opd
3555 entry relocs.
3556
d77a0555
ILT
35572012-09-12 Ian Lance Taylor <iant@google.com>
3558
3559 PR gold/14570
3560 * output.cc: Rename Output_data_got template parameter from size
3561 to got_size for all functions. Compile all variants of
3562 Output_data_got.
3563 (Output_data_got::Got_entry::write): Correct use of size for
3564 symbol value. Use local_is_tls rather than casting to
3565 Sized_relobj_file.
3566 * object.h (class Object): Add local_is_tls and do_local_is_tls.
3567 (class Sized_relobj_file): Add do_local_is_tls.
3568 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
3569
815a1205
AM
35702012-09-11 Alan Modra <amodra@gmail.com>
3571
3572 PR gold/14566
3573 * layout.cc (Layout::set_segment_offsets): When using
3574 common-page-size alignment, ensure we are on a new max-page-size
3575 page.
3576 * output.cc (Output_segment::set_section_addresses): Use
3577 abi_pagesize, not common_pagesize for relro boundary.
3578 (Output_segment::set_offset): Likewise.
3579
bd73a62d
AM
35802012-09-11 Alan Modra <amodra@gmail.com>
3581
3582 * output.h (Output_data_got::add_global_tls, add_local_tls,
3583 add_local_tls_pair): New functions.
3584 (Output_data_got::add_local_pair_with_rel): Remove second
3585 reloc param. Expand comment.
3586 (Output_data_got::Got_entry): Rename use_plt_offset_ to
3587 use_plt_or_tls_offset_, similarly for constructor param.
3588 (Output_data_got::Got_entry::write): Add got_index param.
3589 * output.cc (Output_data_got::add_global_tls, add_local_tls,
3590 add_local_tls_pair): New functions.
3591 (Output_data_got::Got_entry::write): Handle tls symbols
3592 with use_plt_or_tls_offset_ set specially.
3593 (Output_data_got::add_local_pair_with_rel): Only one reloc.
3594 (Output_data_got::do_write): Replace iterator with index, pass
3595 index to entry write function.
3596 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
3597 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
3598 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
3599 call.
3600 * i386.cc (Target_i386::Scan::local): Likewise.
3601 * sparc.cc (Target_sparc::Scan::local): Likewise.
3602 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
3603 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
3604 do_tls_offset_for_global): New functions.
3605 (Target_powerpc::Scan::local): Correct TLS relocations and got
3606 entry values.
3607 (Target_powerpc::Scan::global): Don't emit unnecessary
3608 dynamic relocations on TLS GOT entries.
3609
00716ab1
AM
36102012-09-10 Matthias Klose <doko@ubuntu.com>
3611
3612 * config.in: Disable sanity check for kfreebsd.
3613
c891b3f9
SA
36142012-09-10 Sterling Augustine <saugustine@google.com>
3615
3616 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
3617 (Gdb_index::pubtypes_read): New parameter.
3618 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
3619 to calls.
3620 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
3621 pubtypes_object_.
3622
e81fea4d
AM
36232012-09-09 Alan Modra <amodra@gmail.com>
3624
3625 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
3626 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
3627 * gc.h (gc_process_relocs): Call target gc_add_reference.
3628 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
3629 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
3630 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
3631 unnecessary cast.
3632 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
3633 to cater for when we don't need code offset. Update use.
3634 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
3635 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
3636 set_opd_valid): New functions.
3637 (Target_powerpc::do_gc_add_reference): New function.
3638 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
3639 stashed refs.
3640 (Target_powerpc::do_gc_mark_symbol): New function.
3641
d2d60eef
CC
36422012-09-06 Cary Coutant <ccoutant@google.com>
3643
3644 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
3645 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
3646 (Dwarf_die::skip_attributes): Likewise.
3647 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
3648 * testsuite/gdb_index_test.cc (inline_func_1): New function.
3649 (main): Call it.
3650 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
3651
32ed4573
L
36522012-09-05 H.J. Lu <hongjiu.lu@intel.com>
3653
3654 * testsuite/script_test_3.t: Add .got.plt output section
3655 statement.
3656 * testsuite/script_test_4.t: Likewise.
3657
f4baf0d4
AM
36582012-09-05 Alan Modra <amodra@gmail.com>
3659
3660 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
3661 update all uses and lose "enum" when using type.
3662
864a1b56
AM
36632012-09-05 Alan Modra <amodra@gmail.com>
3664
3665 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
3666 * configure: Regenerate.
3667 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
3668 (plugin_final_layout.stdout): Likewise.
3669 (memory_test): Set page sizes to 0x1000.
3670 * testsuite/Makefile.in: Regenerate.
3671 * testsuite/discard_locals_test.sh: Add FIXME comment.
3672 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
3673 * testsuite/pr14265.t: Add .got output section statement.
3674 * testsuite/script_test_2.t: Likewise.
3675 * testsuite/script_test_3.t: Likewise.
3676 * testsuite/script_test_4.t: Likewise.
3677 * testsuite/script_test_5.t: Likewise.
3678 * testsuite/script_test_6.t: Likewise.
3679 * testsuite/script_test_7.t: Likewise.
3680 * testsuite/script_test_9.t: Likewise.
3681
3ea0a085
AM
36822012-09-05 Alan Modra <amodra@gmail.com>
3683
3684 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
3685 (Powerpc_relocate_functions::Status): New typedef.
3686 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3687 (Target_powerpc::Scan::local): Handle REL64.
3688 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
3689 for REL32 and REL64.
3690 (Target_powerpc::symval_for_branch): New function, extracted from..
3691 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
3692 checks. Report overflow errors.
3693
7404fe1b
AM
36942012-09-05 Alan Modra <amodra@gmail.com>
3695
3696 * object.h (Sized_relobj_file::emit_relocs): Delete.
3697 (Sized_relobj_file::emit_relocs_reltype): Delete.
3698 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
3699 relocate_relocs for --emit-relocs.
3700 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
3701 * output.h: Update comment.
3702 (Output_segment::first_section): New function.
3703 (Output_segment::first_section_load_address): Use first_section.
3704 * output.cc (Output_segment::first_section): New function extracted..
3705 (Output_segment::first_section_load_address): ..from here. Delete.
3706 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
3707 * target.h (Sized_target::relocate_for_relocatable): Likewise.
3708 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
3709 adjust call to target.h function.
3710 * i386.cc (Target_i386): Likewise.
3711 * sparc.cc (Target_sparc): Likewise.
3712 * x86_64.cc (Target_x86_64): Likewise.
3713 * powerpc.cc (Target_powerpc): Likewise.
3714 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
3715 first tls section has section symbol for optimised local dynamic
3716 output relocs.
3717 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
3718 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
3719 optimised tls code.
3720 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
3721 Rename to relocate_relocs. Update error message.
3722
957564c9
AS
37232012-09-04 Andreas Schwab <schwab@linux-m68k.org>
3724
3725 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
3726 --just-symbols.
3727
dd93cd0a
AM
37282012-08-31 Alan Modra <amodra@gmail.com>
3729
3730 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
3731 (Powerpc_relobj::toc_base_offset): New stub function.
3732 (Target_powerpc): Add tp_offset, dtp_offset. Rename
3733 got_mod_index_offset to tlsld_got_offset. Update all refs.
3734 (Target_powerpc::Relocate::enum skip_tls): New.
3735 (Target_powerpc::call_tls_get_addr_): New var.
3736 (Target_powerpc::is_branch_reloc): Move to file scope.
3737 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
3738 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
3739 New functions.
3740 (Target_powerpc::enum Got_type): Delete old values, add new ones.
3741 (powerpc_info): Correct common_pagesize for ppc64.
3742 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
3743 (Powerpc_relocate_functions): Add overflow check enums and functions.
3744 Add non-shift version of rela, rela_ua. Delete all rel public
3745 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
3746 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
3747 addr16_ha3, addr14 functions.
3748 (Output_data_got_powerpc::add_constant_pair): New function.
3749 (Output_data_got_powerpc::got_base_offset): Likewise.
3750 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
3751 (instruction constants): Sort, add some more.
3752 (Output_data_glink::do_write): Add and use Address typedef. Use
3753 object->toc_base_offset() stub for 64-bit.
3754 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
3755 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3756 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
3757 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
3758 Always treat .opd relocs as against locally defined symbol.
3759 Correct condition for RELATIVE relocs.
3760 (Target_powerpc::do_finalize_sections): Test for NULL sections.
3761 (Target_powerpc::Relocate::relocate): Use plt call stub as value
3762 for 32-bit syms with a plt entry. Correct ppc64 toc base
3763 calculations. Handle TLS relocs, and more. Add overflow
3764 checking and adjust for Powerpc_relocate_functions changes.
3765 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
3766 Reinstate --emit-relocs code with FIXME.
3767
a1373b60
AM
37682012-08-30 Alan Modra <amodra@gmail.com>
3769
3770 * layout.cc (Layout::set_segment_offsets): Set p_align to
3771 abi_pagesize, not common_pagesize.
3772 (Layout::relaxation_loop_body): Similarly use abi_pagesize
3773 to determine whether file header can go in segment.
3774
703d02da
AM
37752012-08-30 Alan Modra <amodra@gmail.com>
3776
3777 * output.h (Output_reloc::Output_reloc <output section>): Add
3778 is_relative param. Adjust calls.
3779 (Output_reloc::add_output_section_relative): New functions.
3780 * output.cc (Output_reloc::Output_reloc <output section>): Handle
3781 is_relative.
3782 (Output_reloc::symbol_value): Handle SECTION_CODE.
3783
16164a6b
ST
37842012-08-24 Sriraman Tallam <tmsriram@google.com>
3785
3786 * gold.cc (queue_middle_tasks): Call layout again when unique
3787 segments for sections is desired.
3788 * layout.cc (Layout::Layout): Initialize new members.
3789 (Layout::get_output_section_flags): New function.
3790 (Layout::choose_output_section): Call get_output_section_flags.
3791 (Layout::layout): Make output section for mapping to a unique segment.
3792 (Layout::insert_section_segment_map): New function.
3793 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 3794 output sections marked so.
16164a6b
ST
3795 (Layout::segment_precedes): Check for unique segments when sorting.
3796 * layout.h (Layout::Unique_segment_info): New struct.
3797 (Layout::Section_segment_map): New typedef.
3798 (Layout::insert_section_segment_map): New function.
3799 (Layout::get_output_section_flags): New function.
3800 (Layout::is_unique_segment_for_sections_specified): New function.
3801 (Layout::set_unique_segment_for_sections_specified): New function.
3802 (Layout::unique_segment_for_sections_specified_): New member.
3803 (Layout::section_segment_map_): New member.
3804 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
3805 Rename is_gc_pass_one to is_pass_one.
3806 Rename is_gc_pass_two to is_pass_two.
3807 Rename is_gc_or_icf to is_two_pass.
3808 Check for which pass based on whether symbols data is present.
3809 Make it two pass when unique segments for sections is desired.
3810 * output.cc (Output_section::Output_section): Initialize new
3811 members.
3812 * output.h (Output_section::is_unique_segment): New function.
3813 (Output_section::set_is_unique_segment): New function.
3814 (Output_section::is_unique_segment_): New member.
3815 (Output_section::extra_segment_flags): New function.
3816 (Output_section::set_extra_segment_flags): New function.
3817 (Output_section::extra_segment_flags_): New member.
3818 (Output_section::segment_alignment): New function.
3819 (Output_section::set_segment_alignment): New function.
3820 (Output_section::segment_alignment_): New member.
3821 (Output_segment::Output_segment): Initialize is_unique_segment_.
3822 (Output_segment::is_unique_segment): New function.
3823 (Output_segment::set_is_unique_segment): New function.
3824 (Output_segment::is_unique_segment_): New member.
3825 * plugin.cc (allow_unique_segment_for_sections): New function.
3826 (unique_segment_for_sections): New function.
3827 (Plugin::load): Add new functions to transfer vector.
3828 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
3829 * Makefile.in: Regenerate.
3830 * testsuite/plugin_final_layout.sh: Check if unique segment
3831 functionality works.
3832 * testsuite/plugin_section_order.c (onload): Check if new interfaces
3833 are available.
3834 (allow_unique_segment_for_sections): New global.
3835 (unique_segment_for_sections): New global.
3836 (claim_file_hook): Call allow_unique_segment_for_sections.
3837 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 3838
1e2bee4f
CC
38392012-08-22 Cary Coutant <ccoutant@google.com>
3840
3841 * layout.cc (Layout::include_section): Don't assert on GROUP
3842 sections with --emit-relocs.
3843
1d5dfe78
CC
38442012-08-21 Cary Coutant <ccoutant@google.com>
3845
3846 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
3847 if --export-dynamic-symbol names an undef symbol.
3848
c9269dff
AM
38492012-08-18 Alan Modra <amodra@gmail.com>
3850
3851 * powerpc.cc: Formatting and white space.
3852 (Powerpc_relobj): Rename got2_section_ to special_.
3853 Add opd_ent_shndx_ and opd_ent_off_ vectors.
3854 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
3855 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
3856 (Target_powerpc): Add Address typedef and invalid_address. Use
3857 throughout.
3858 (Target_powerpc::is_branch_reloc): New function.
3859 (Powerpc_relocate_functions): Add Address typedef, use throughout.
3860 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
3861 for dst_mask, value and addend.
3862 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
3863 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
3864 (Output_data_glink::do_write): Correct toc base. Don't try to use
3865 uint16_t for 24-bit offset. Use get_output_section_offset and
3866 check return.
3867 (Target_powerpc::Scan::local): Handle more relocs.
3868 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
3869 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
3870 Plug in toc restoring insn after plt calls. Translate branches
3871 to function descriptor symbols to corresponding entry point.
3872 (Target_powerpc::relocate_for_relocatable): Check return from
3873 get_output_section_offset.
3874 * symtab.h: Comment typo.
3875
b1759dce
ILT
38762012-08-14 Ian Lance Taylor <iant@google.com>
3877
3878 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
3879 unsupported_relocal_local to call unsupported_reloc_global.
3880
b9b2ae8b
NC
38812012-08-14 Nick Clifton <nickc@redhat.com>
3882
3883 PR ld/14265
3884 * script-sections.cc (Sections_element::output_section_name): Add
3885 keep return parameter.
3886 (Output_section_element::match_name): Add keep return parameter.
3887 Return the value of the keep_ member.
3888 * script-sections.h (class Output_section): Update
3889 output_section_name prototype.
3890 * layout.cc (Layout::keep_input_section): New public member
3891 function.
3892 (Layout::choose_output_section): Pass keep parameter to
3893 output_section_name.
3894 * layout.h (class Layout): Add keep_input_section.
3895 * object.cc (Sized_relobj_file::do_layout): Check for kept input
3896 sections.
3897 * testsuite/Makefile.am: Add a test.
3898 * testsuite/Makefile.in: Regenerate.
3899 * testsuite/pr14265.c: Source file for the test.
3900 * testsuite/pr14265.t: Linker script for the test.
3901 * testsuite/pr14265.sh: Shell script for the test.
3902
921b5322
AM
39032012-08-14 Alan Modra <amodra@gmail.com>
3904
3905 * target.h (Target::output_section_name): New function.
3906 (Target::do_output_section_name): New function.
3907 * layout.cc (Layout::choose_output_section): Call the above.
3908 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
3909
6ce78956
AM
39102012-08-14 Alan Modra <amodra@gmail.com>
3911
3912 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
3913 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
3914 for replace_constant call.
3915 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
3916 (Output_data_glink::do_print_to_mapfile): New function.
3917 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
3918 (Target_powerpc::Relocate::relocate): Likewise.
3919
d1a8cabd
AM
39202012-08-14 Alan Modra <amodra@gmail.com>
3921
3922 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
3923 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
3924 (Output_data_glink::add_entry,find_entry): Remove shndx param.
3925 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
3926 all references to shndx_. Handle special case for R_PPC_PLTREL24
3927 here.
3928 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
3929 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
3930 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
3931 here.
3932 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
3933 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
3934
d83ce4e3
AM
39352012-08-12 Alan Modra <amodra@gmail.com>
3936
3937 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
3938 (glink insn constants): Use uint32_t.
3939 (Output_data_glink::add_entry): Use insert, not [] operator.
3940
cf43a2fe
AM
39412012-08-11 Alan Modra <amodra@gmail.com>
3942
3943 * object.h (Sized_relobj_file::find_shdr): New function.
3944 (Sized_relobj_file::find_special_sections): New function.
3945 * object.cc (Sized_relobj_file::find_shdr): New function.
3946 (Sized_relobj_file::find_eh_frame): Use find_shdr.
3947 (Sized_relobj_file::find_special_sections): New function, split out..
3948 (Sized_relobj_file::do_read_symbols): ..from here.
3949 * output.h (Output_data_got::replace_constant): New function.
3950 (Output_data_got::num_entries): New function.
3951 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
3952 (Output_data_got::got_offset): Protected rather than private.
3953 (Output_data_got::replace_got_entry): New function.
3954 * output.cc (Output_data_got::replace_got_entry): New function.
3955 * powerpc.cc (class Powerpc_relobj): New.
3956 (class Powerpc_relocate_functions): Delete all psymval variants or
3957 convert to value,addend type. Delete pcrela, pcrela_unaligned.
3958 Implement _ha functions using corresponding _hi function.
3959 (Powerpc_relobj::find_special_sections): New function.
3960 (Target_powerpc::do_make_elf_object): New function.
3961 (class Output_data_got_powerpc): New.
3962 (class Output_data_glink): New.
3963 (class Powerpc_scan_relocatable_reloc): New.
3964 Many more changes througout file.
3965
3c892704
NC
39662012-08-09 Nick Clifton <nickc@redhat.com>
3967
3968 * po/vi.po: Updated Vietnamese translation.
3969
82435b3b
ILT
39702012-08-07 Ian Lance Taylor <iant@google.com>
3971
3972 * layout.cc (Layout::add_target_dynamic_tags): If
3973 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
3974 plt_rel.
3975
a6dc81d2
NC
39762012-07-30 Nick Clifton <nickc@redhat.com>
3977
3978 * po/gold.pot: Updated template.
3979 * po/es.po: Updated Spanish translation.
3980
f1415016
CC
39812012-07-18 Cary Coutant <ccoutant@google.com>
3982
3983 PR gold/14344
3984 * configure.ac: Add check for -gpubnames support.
3985 * configure: Regenerate.
3986 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
3987 support; force -gno-pubnames.
3988 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
3989 support.
3990 (gdb_index_test_4): New test.
3991 * testsuite/Makefile.in: Regenerate.
3992 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
3993 * testsuite/gdb_index_test_2.sh: Likewise.
3994 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
3995 * testsuite/gdb_index_test_4.sh: New script.
3996 * testsuite/gdb_index_test_comm.sh: New script with common code;
3997 don't look for space after colon.
3998
b7fd7c37
ST
39992012-07-16 Sriraman Tallam <tmsriram@google.com>
4000
4001 * gold.cc (queue_middle_tasks): Update function order only after
4002 deferred objects due to plugins are processed.
4003
1f3212db
ILT
40042012-07-11 Ian Lance Taylor <iant@google.com>
4005
4006 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
4007 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
4008 (Target_arm::scan_reloc_for_stub): Likewise.
4009 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
4010 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
4011 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
4012 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
4013 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
4014
81c82a68
ILT
40152012-07-10 Dodji Seketeli <dodji@redhat.com>
4016 Ian Lance Taylor <iant@google.com>
4017
4018 PR gold/14309
4019 * configure.ac: Test whether std::tr1::hash<off_t> works.
4020 * gold.h: Add a specialization for std::tr1::hash<off_t> if
4021 needed.
4022 * output.h (class Output_fill): Add virtual destructor.
4023 * configure, config.in: Rebuild.
4024
eabc84f4
RM
40252012-06-22 Roland McGrath <mcgrathr@google.com>
4026
4027 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
4028
370e30b6
RÁE
40292012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
4030
4031 * plugin.cc (Plugin::load): Handle position independent executables.
4032
fb1b895d
CC
40332012-06-06 Cary Coutant <ccoutant@google.com>
4034
4035 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
4036 add .debug_macro.
4037 (lines_only_debug_sections): Likewise.
4038 (gdb_fast_lookup_sections): New static array.
4039 (is_gdb_debug_section): Rename formal parameter.
4040 (is_lines_only_debug_section): Likewise.
4041 (is_gdb_fast_lookup_section): New function.
4042 (Layout::include_section): Check for ".zdebug_" prefix; pass
4043 section name suffix to is_gdb_debug_section, et al.; check for
4044 fast-lookup sections when building .gdb_index.
4045 * options.h (--strip-debug-gdb): Update GDB version number.
4046
7c0640fa
CC
40472012-06-06 Cary Coutant <ccoutant@google.com>
4048
4049 * configure.ac: Add check for fallocate.
4050 * configure: Regenerate.
4051 * config.in: Regenerate.
4052
4053 * options.h (class General_options): Add --mmap-output-file and
4054 --posix-fallocate options.
4055 * output.cc: (posix_fallocate): Remove; replace with...
4056 (gold_fallocate): New function.
4057 (Output_file::map_no_anonymous): Call gold_fallocate.
4058 (Output_file::map): Check --mmap-output-file option.
4059
2a49eb69
DK
40602012-06-05 Jing Yu <jingyu@google.com>
4061
4062 * gold.h (textdomain): Add do {} to empty while(0).
4063 (bindtextdomain): Likewise.
4064
fad072ac
CC
40652012-06-04 Cary Coutant <ccoutant@google.com>
4066
4067 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
4068 has_dynsym_index.
4069
8cc69fb6
ST
40702012-05-25 Sriraman Tallam <tmsriram@google.com>
4071
4072 * symtab.cc (Symbol_table::define_special_symbol):
4073 Initialize *poldsym to prevent uninitialized variable errors.
4074
1be75daa
CC
40752012-05-23 Cary Coutant <ccoutant@google.com>
4076
4077 * layout.cc (Layout::section_name_mapping): Add rules to handle
4078 exact match on .data.rel.ro.local or .data.rel.ro.
4079 (Layout::output_section_name): Check for exact matches.
4080
9b689de0
CC
40812012-05-23 Cary Coutant <ccoutant@google.com>
4082
4083 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
4084 more carefully.
4085
b24fdbf5
CC
40862012-05-22 Cary Coutant <ccoutant@google.com>
4087
4088 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
4089 object before exporting symbol.
4090
e550e1a2
L
40912012-05-21 H.J. Lu <hongjiu.lu@intel.com>
4092
4093 * testsuite/tls_test.cc: Include "config.h" first.
4094 * testsuite/tls_test_c.c: Likewise.
4095
df7b86aa
NC
40962012-05-17 Daniel Richard G. <skunk@iskunk.org>
4097 Nick Clifton <nickc@redhat.com>
4098
4099 PR 14072
4100 * configure.in: Add check that sysdep.h has been included before
4101 any system header files.
4102 * configure: Regenerate.
4103 * config.in: Regenerate.
4104
1007b503
CC
41052012-05-14 Cary Coutant <ccoutant@google.com>
4106
4107 * layout.cc (Layout::make_output_section): Mark .tdata section
4108 as RELRO.
4109 * testsuite/relro_test.cc: Add a TLS variable.
4110
fd885f3a
L
41112012-05-10 H.J. Lu <hongjiu.lu@intel.com>
4112
4113 PR gold/14091
4114 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
4115 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
4116 R_X86_64_64.
4117
80f5885c
CC
41182012-05-08 Cary Coutant <ccoutant@google.com>
4119
4120 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
4121 (lines_only_debug_sections): Likewise.
4122
2e702c99
RM
41232012-05-02 Roland McGrath <mcgrathr@google.com>
4124
4125 * nacl.cc: New file.
4126 * nacl.h: New file.
4127 * Makefile.am (CCFILES, HFILES): Add them.
4128 * Makefile.in: Regenerate.
4129 * i386.cc (Output_data_plt_i386_nacl): New class.
4130 (Output_data_plt_i386_nacl_exec): New class.
4131 (Output_data_plt_i386_nacl_dyn): New class.
4132 (Target_i386_nacl): New class.
4133 (Target_selector_i386_nacl): New class.
4134 (target_selector_i386): Use it instead of Target_selector_i386.
4135 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
4136 (Target_x86_64_nacl): New class.
4137 (Target_selector_x86_64_nacl): New class.
4138 (target_selector_x86_64, target_selector_x32): Use it instead of
4139 Target_selector_x86_64.
4140 * arm.cc (Output_data_plt_arm_nacl): New class.
4141 (Target_arm_nacl): New class.
4142 (Target_selector_arm_nacl): New class.
4143 (target_selector_arm, target_selector_armbe): Use it instead of
4144 Target_selector_arm.
4145
4146 * target-select.cc (select_target): Take new Input_file* and off_t
4147 arguments, pass them on to recognize method of selector.
4148 * object.cc (make_elf_sized_object): Update caller.
4149 * parameters.cc (parameters_force_valid_target): Likewise.
4150 * incremental.cc (make_sized_incremental_binary): Likewise.
4151 * target-select.h: Update decl.
4152 (Target_selector::recognize): Take new Input_file* argument,
4153 pass it on to do_recognize.
4154 (Target_selector::do_recognize): Take new Input_file* argument.
4155 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
4156 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
4157 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
4158 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
4159
4160 * target.h (Target::Target_info): New members isolate_execinstr
4161 and rosegment_gap.
4162 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
4163 * arm.cc (Target_arm::arm_info): Update initializer.
4164 * i386.cc (Target_i386::i386_info): Likewise.
4165 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
4166 * sparc.cc (Target_sparc::sparc_info): Likewise.
4167 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
4168 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
4169 * layout.cc (Layout::attach_allocated_section_to_segment):
4170 Take new const Target* argument. If target->isolate_execinstr(), act
4171 like --rosegment.
4172 (Layout::find_first_load_seg): Take new const Target* argument;
4173 if target->isolate_execinstr(), reject PF_X segments.
4174 (Layout::relaxation_loop_body): Update caller.
4175 (Layout::set_segment_offsets): If target->isolate_execinstr(),
4176 reset file offset to zero when we hit LOAD_SEG, and then do a second
4177 loop over the segments before LOAD_SEG to reassign offsets after
4178 addresses have been determined. Handle target->rosegment_gap().
4179 (Layout::attach_section_to_segment): Take new const Target* argument;
4180 pass it to attach_allocated_section_to_segment.
4181 (Layout::make_output_section): Update caller.
4182 (Layout::attach_sections_to_segments): Take new const Target* argument;
4183 pass it to attach_section_to_segment.
4184 * gold.cc (queue_middle_tasks): Update caller.
4185 * layout.h (Layout): Update method decls with new arguments.
4186
4187 * arm.cc (Target_arm::Target_arm): Take optional argument for the
4188 Target_info pointer to use.
4189 (Target_arm::do_make_data_plt): New virtual method.
4190 (Target_arm::make_data_plt): New method that calls it.
4191 (Target_arm::make_plt_entry): Use it.
4192 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
4193 for the section alignment.
4194 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
4195 method.
4196 (Output_data_plt_arm::first_plt_entry_offset): Call it.
4197 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
4198 method.
4199 (Output_data_plt_arm::get_plt_entry_size): Call it.
4200 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
4201 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
4202 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
4203 method.
4204 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
4205 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
4206 method instead of sizeof(plt_entry).
4207 (Output_data_plt_arm::add_entry): Likewise.
4208 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
4209 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
4210 than static method.
4211 (Target_arm::plt_entry_size): Likewise.
4212 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
4213 Move to ...
4214 (Output_data_plt_arm_standard): ... here, new class.
4215 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
4216 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
4217 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
4218
4219 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4220 Take additional argument for the PLT entry size.
4221 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
4222 Use get_plt_entry_size method rather than plt_entry_size variable.
4223 (Output_data_plt_x86_64::reserve_slot): Likewise.
4224 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
4225 (Output_data_plt_x86_64::add_entry): Likewise.
4226 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
4227 (Output_data_plt_x86_64::address_for_global): Likewise.
4228 (Output_data_plt_x86_64::address_for_local): Likewise.
4229 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4230 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
4231 Make method non-static.
4232 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
4233 method.
4234 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
4235 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
4236 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
4237 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
4238 virtual method.
4239 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
4240 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
4241 virtual method.
4242 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
4243 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
4244 virtual method.
4245 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
4246 (Output_data_plt_x86_64::plt_entry_size)
4247 (Output_data_plt_x86_64::first_plt_entry)
4248 (Output_data_plt_x86_64::plt_entry)
4249 (Output_data_plt_x86_64::tlsdesc_plt_entry)
4250 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
4251 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
4252 (Output_data_plt_x86_64_standard): ... here, new class.
4253 (Target_x86_64::Target_x86_64): Take optional argument for the
4254 Target_info pointer to use.
4255 (Target_x86_64::do_make_data_plt): New virtual method.
4256 (Target_x86_64::make_data_plt): New method to call it.
4257 (Target_x86_64::init_got_plt_for_update): Use that.
4258 Call this->plt_->add_eh_frame method here.
4259 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
4260 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
4261 rather than static method.
4262 (Target_x86_64::plt_entry_size): Likewise.
4263 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
4264 rather than plt_entry_size variable. Move guts of PLT filling to...
4265 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
4266 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
4267 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
4268
4269 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
4270 additional argument for the section alignment.
4271 Don't do add_eh_frame_for_plt here.
4272 (Output_data_plt_i386::first_plt_entry_offset): Make the method
4273 non-static. Use get_plt_entry_size method rather than plt_entry_size
4274 variable.
4275 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
4276 method.
4277 (Output_data_plt_i386::get_plt_entry_size): Call it.
4278 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
4279 (Output_data_plt_i386::add_eh_frame): New method to call it.
4280 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
4281 method.
4282 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
4283 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
4284 method.
4285 (Output_data_plt_i386::fill_plt_entry): New method to call it.
4286 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
4287 method instead of plt_entry_size.
4288 (Output_data_plt_i386::plt_entry_size)
4289 (Output_data_plt_i386::plt_eh_frame_fde_size)
4290 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
4291 (Output_data_plt_i386_standard): ... here, new class.
4292 (Output_data_plt_i386_exec): New class.
4293 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
4294 (Output_data_plt_i386_exec::first_plt_entry): ... here.
4295 (Output_data_plt_i386::exec_plt_entry): Move to ...
4296 (Output_data_plt_i386_exec::plt_entry): ... here.
4297 (Output_data_plt_i386_dyn): New class.
4298 (Output_data_plt_i386::first_plt_entry): Move to ...
4299 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
4300 (Output_data_plt_i386::dyn_plt_entry): Move to ...
4301 (Output_data_plt_i386_dyn::plt_entry): ... here.
4302 (Target_i386::Target_i386): Take optional argument for the Target_info
4303 pointer to use.
4304 (Target_i386::do_make_data_plt): New virtual method.
4305 (Target_i386::make_data_plt): New method to call it.
4306 (Target_i386::make_plt_section): Use that.
4307 Call this->plt_->add_eh_frame method here.
4308 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
4309 rather than plt_entry_size variable.
4310 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
4311 (Output_data_plt_i386::address_for_local): Likewise.
4312 (Output_data_plt_i386::do_write): Likewise.
4313 Move guts of PLT filling to...
4314 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
4315 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
4316 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
4317 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
4318
b9b9f2ee
CC
43192012-05-01 Cary Coutant <ccoutant@google.com>
4320
4321 * dwarf_reader.cc (Dwarf_die::read_attributes)
4322 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
4323 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
4324 * reduced_debug_output.cc
4325 (Output_reduced_debug_info_section::get_die_end): Remove
4326 DW_FORM_GNU_ref_index. Add default case.
4327
57923f48
MW
43282012-04-26 Mark Wielaard <mjw@redhat.com>
4329
4330 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
4331 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
4332 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
4333 DW_AT_high_pc as offset from DW_AT_low_pc.
4334
4335 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
4336 * testsuite/Makefile.in: Regenerate.
4337 * testsuite/gdb_index_test_3.c: New test source file.
4338 * testsuite/gdb_index_test_3.sh: New test source file.
4339
2c54b4f4
ILT
43402012-04-25 Ian Lance Taylor <iant@google.com>
4341
4342 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
4343 pointer.
4344 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
4345 as a class, not a struct.
4346 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
4347 (Target_arm::apply_cortex_a8_workaround): Likewise.
4348 * gc.h: Declare Reloc_types as a struct, not a class.
4349 * object.h: Declare Symbols_data as a struct.
4350 * reloc.h: Declare Read_relocs_data as a struct.
4351 * target.h: Declare Relocate_info as a struct.
4352
a5a5f7a3
DM
43532012-04-24 David S. Miller <davem@davemloft.net>
4354
4355 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
4356 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
4357 and R_SPARC_WPLT30.
4358
f038d496
CC
43592012-04-24 Cary Coutant <ccoutant@google.com>
4360
4361 * incremental-dump.cc (find_input_containing_global): Replace
4362 magic number with symbolic constant.
4363 (dump_incremental_inputs): Update version number.
4364 * incremental.cc (Output_section_incremental_inputs): Update version
4365 number; import symbolic constants from Incremental_inputs_reader.
4366 (Incremental_inputs::create_data_sections): Align relocations
4367 section correctly for 64-bit targets.
4368 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
4369 constants; add padding.
4370 (Output_section_incremental_inputs::write_header): Add assert for
4371 header_size.
4372 (Output_section_incremental_inputs::write_input_files): Add assert
4373 for input_entry_size.
4374 (Output_section_incremental_inputs::write_info_blocks): Add padding;
4375 add assert for object_info_size, input_section_entry_size,
4376 global_sym_entry_size.
4377 * incremental.h (Incremental_inputs_reader): Add symbolic constants
4378 for data structure sizes; use them.
4379 (Incremental_input_entry_reader): Import symbolic constants from
4380 Incremental_inputs_reader; use them.
4381
a4d85145
DM
43822012-04-23 David S. Miller <davem@davemloft.net>
4383
4384 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
4385 and elf_flags_set_.
4386 (Target_sparc::Target_sparc): Initialize new fields.
4387 (Target_sparc::do_make_elf_object): New function.
4388 (Target_sparc::do_adjust_elf_header): New function.
4389
1d509098
CC
43902012-04-23 Cary Coutant <ccoutant@google.com>
4391
4392 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
4393 CU range table of gdb index.
4394
7ebeff7f
DM
43952012-04-20 David S. Miller <davem@davemloft.net>
4396
4397 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
4398 instead of false.
4399
13cf9988
DM
44002012-04-16 David S. Miller <davem@davemloft.net>
4401
2a1079e8
DM
4402 * sparc.cc (Target_sparc::got_address): New function.
4403 (Sparc_relocate_functions::gdop_hix22): New function.
4404 (Sparc_relocate_functions::gdop_lox10): New function.
4405 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
4406 relocs.
4407 (Target_sparc::Scan::local): Likewise if the global symbol is not
4408 preemptible and is not IFUNC.
4409 (Target_sparc::Relocate::relocate): Perform GOTDATA code
4410 transformations for local and non-preemptible non-IFUNC global
4411 symbols.
4412
0bc964fc
DM
4413 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
4414 writing out 64-bit part of ranges.
4415
661d7a80
DM
4416 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
4417 -fpic and -fpie respectively.
4418 * Makefile.in: Regenerate.
4419
8c2bf391
DM
4420 * sparc.cc (class Target_sparc): Add rela_ifunc_.
4421 (Target_sparc::Target_sparc): Initialize new field.
4422 (Target_sparc::do_plt_section_for_global): New function.
4423 (Target_sparc::do_plt_section_for_local): New function.
4424 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
4425 (Target_sparc::make_plt_section): New function, broken out of
4426 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
4427 (Target_sparc::make_plt_entry): Call make_plt_section.
4428 (Target_sparc::make_local_ifunc_plt_entry): New function.
4429 (Target_sparc::rela_ifunc_section): New function.
4430 (Target_sparc::plt_section): Remove const.
4431 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
4432 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
4433 and ifunc_count_ fields.
4434 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
4435 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
4436 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
4437 (Output_data_plt_sparc::rela_ifunc): New function.
4438 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
4439 (Output_data_plt_sparc::has_ifunc_section): New function.
4440 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
4441 (Output_data_plt_sparc::address_for_global): New function.
4442 (Output_data_plt_sparc::address_for_local): New function.
4443 (Output_data_plt_sparc::plt_index_to_offset): New function.
4444 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
4445 and entry_count.
4446 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
4447 entry_count.
4448 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
4449 R_SPARC_JMP_IREL to switch.
4450 (Target_sparc::Scan::check_non_pic): Likewise.
4451 (Target_sparc::Scan::local): Handle IFUNC symbols.
4452 (Target_sparc::Scan::local): Likewise.
4453 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
4454 and plt_address_for_local.
4455 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
4456 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
4457
13cf9988
DM
4458 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
4459 (class Output_data_reloc): Adjust calls to Output_reloc_type.
4460 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
4461 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
4462 global relocs too.
4463 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
4464 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
4465 calls.
4466 * sparc.cc (Target_sparc::Scan::global): Likewise.
4467 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4468
31821be0
CC
44692012-04-16 Cary Coutant <ccoutant@google.com>
4470
4471 * archive.cc (Library_base::should_include_member): Check for
4472 --export-dynamic-symbol.
4473 * options.h (class General_options): Add --export-dynamic-symbol.
4474 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
4475 --export-dynamic-symbol.
4476 (Symbol_table::gc_mark_undef_symbols): Likewise.
4477 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
4478
2615994e
DM
44792012-04-12 David S. Miller <davem@davemloft.net>
4480
4481 * sparc.cc (Reloc::wdisp10): New relocation method.
4482 (Reloc::h34): Likewise.
4483 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
4484 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
4485 R_SPARC_WDISP10.
4486 (Target_sparc::Scan::local): Likewise.
4487 (Target_sparc::Scan::global): Likewise.
4488 (Target_sparc::Relocate::relocate): Likewise.
4489
6782735d
CC
44902012-04-09 Cary Coutant <ccoutant@google.com>
4491
4492 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
4493 low_pc == 0.
4494
8c7a0b00
ILT
44952012-04-06 Ian Lance Taylor <iant@google.com>
4496
4497 * timer.cc: #include <unistd.h>.
4498
58797674
RM
44992012-04-06 Roland McGrath <mcgrathr@google.com>
4500
4501 * configure.in (AC_CHECK_HEADERS): Add locale.h.
4502 * config.in: Regenerate.
4503 * configure: Regenerate.
4504
44350750
NC
45052012-04-05 Nick Clifton <nickc@redhat.com>
4506
4507 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
4508 (AM_LC_MESSAGES): Add.
4509 * aclocal.m4: Regenerate.
4510 * config.in: Regenerate.
4511 * configure: Regenerate.
4512
c1027032
CC
45132012-03-21 Cary Coutant <ccoutant@google.com>
4514
4515 * Makefile.am: Add gdb-index.cc, gdb-index.h.
4516 * Makefile.in: Regenerate.
4517 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
4518 (Sized_elf_reloc_mapper::symbol_section): New function.
4519 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
4520 (make_elf_reloc_mapper): New function.
4521 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
4522 (Dwarf_abbrev_table::do_read_abbrevs): New function.
4523 (Dwarf_abbrev_table::do_get_abbrev): New function.
4524 (Dwarf_ranges_table::read_ranges_table): New function.
4525 (Dwarf_ranges_table::read_range_list): New function.
4526 (Dwarf_pubnames_table::read_section): New function.
4527 (Dwarf_pubnames_table::read_header): New function.
4528 (Dwarf_pubnames_table::next_name): New function.
4529 (Dwarf_die::Dwarf_die): New function.
4530 (Dwarf_die::read_attributes): New function.
4531 (Dwarf_die::skip_attributes): New function.
4532 (Dwarf_die::set_name): New function.
4533 (Dwarf_die::set_linkage_name): New function.
4534 (Dwarf_die::attribute): New function.
4535 (Dwarf_die::string_attribute): New function.
4536 (Dwarf_die::int_attribute): New function.
4537 (Dwarf_die::uint_attribute): New function.
4538 (Dwarf_die::ref_attribute): New function.
4539 (Dwarf_die::child_offset): New function.
4540 (Dwarf_die::sibling_offset): New function.
4541 (Dwarf_info_reader::check_buffer): New function.
4542 (Dwarf_info_reader::parse): New function.
4543 (Dwarf_info_reader::do_parse): New function.
4544 (Dwarf_info_reader::do_read_string_table): New function.
4545 (Dwarf_info_reader::lookup_reloc): New function.
4546 (Dwarf_info_reader::get_string): New function.
4547 (Dwarf_info_reader::visit_compilation_unit): New function.
4548 (Dwarf_info_reader::visit_type_unit): New function.
4549 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
4550 Sized_elf_reloc_mapper.
4551 (Sized_dwarf_line_info::symbol_section): Remove function.
4552 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
4553 (Sized_dwarf_line_info::read_line_mappings): Remove object
4554 parameter, adjust callers.
4555 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
4556 * dwarf_reader.h: Include <sys/types.h>.
4557 (class Track_relocs): Remove forward declaration.
4558 (class Elf_reloc_mapper): New class.
4559 (class Sized_elf_reloc_mapper): New class.
4560 (class Dwarf_abbrev_table): New class.
4561 (class Dwarf_range_list): New class.
4562 (class Dwarf_ranges_table): New class.
4563 (class Dwarf_pubnames_table): New class.
4564 (class Dwarf_die): New class.
4565 (class Dwarf_info_reader): New class.
4566 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
4567 (Sized_dwarf_line_info::symbol_section): Remove member function.
4568 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
4569 base class.
4570 * gdb-index.cc: New source file.
4571 * gdb-index.h: New source file.
4572 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
4573 and .debug_types sections, call Layout::add_to_gdb_index.
4574 (Sized_relobj_incr::do_section_name): Implement.
4575 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
4576 return type; Implement.
4577 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
4578 return type.
4579 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
4580 parameter list and return type.
4581 (Sized_incr_dynobj::do_section_contents): Likewise.
4582 * layout.cc: Include gdb-index.h.
4583 (Layout::Layout): Initialize gdb_index_data_.
4584 (Layout::init_fixed_output_section): Check for .gdb_index section.
4585 (Layout::add_to_gdb_index): New function. Instantiate.
4586 * layout.h: Add forward declaration for class Gdb_index.
4587 (Layout::add_to_gdb_index): New member function.
4588 (Layout::gdb_index_data_): New data member.
4589 * main.cc: Include gdb-index.h.
4590 (main): Print statistics for gdb index.
4591 * object.cc (Object::section_contents): Move code into
4592 do_section_contents.
4593 (need_decompressed_section): Check for sections needed when building
4594 gdb index.
4595 (build_compressed_section_map): Likewise.
4596 (Sized_relobj_file::do_read_symbols): Need local symbols when building
4597 gdb index.
4598 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
4599 sections; call Layout::add_to_gdb_index.
4600 (Sized_relobj_file::do_decompressed_section_contents): Call
4601 do_section_contents directly.
4602 * object.h (Object::do_section_contents): Adjust parameter list and
4603 return type.
4604 (Object::do_decompressed_section_contents): Call do_section_contents
4605 directly.
4606 (Sized_relobj_file::do_section_contents): Adjust parameter list and
4607 return type.
4608 * options.h (class General_options): Add --gdb-index option.
4609 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
4610 list and return type.
4611 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
4612 * reloc.h (Track_relocs::checkpoint): New function.
4613 (Track_relocs::reset): New function.
4614
4615 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
4616 New test cases.
4617 * testsuite/Makefile.in: Regenerate.
4618 * testsuite/gdb_index_test.cc: New test source file.
4619 * testsuite/gdb_index_test_1.sh: New test source file.
4620 * testsuite/gdb_index_test_2.sh: New test source file.
4621
647f1574
DK
46222012-03-19 Doug Kwan <dougkwan@google.com>
4623
4624 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 4625 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
4626 __exidx_start and __exidx_end. Make symbol table parameter
4627 anonymous as it is not used.
4628 * gold.cc (queue_middle_tasks): Call target hook to define any
4629 target-specific symbols.
4630 * target.h (Target::define_standard_symbols): New method.
4631 (Target::do_define_standard_symbols): Same.
4632 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
4633 * testsuite/Makefile.in: Regenerate.
4634 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
4635 and __exidx_end.
4636 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
4637 relocations are generated for __exidx_start and __exidx_end.
4638
7c6109da
DK
46392012-03-16 Doug Kwan <dougkwan@google.com>
4640
4641 * testsuite/Makefile.am: Disable test initpri3b.
4642 * testsuite/Makefile.in: Regenerate.
4643
7b8957f8
DK
46442012-03-15 Doug Kwan <dougkwan@google.com>
4645
4646 * arm.cc (Target_arm::got_section): Make .got section read-only
4647 if -z now is given.
4648
14dc9ef7
ILT
46492012-03-15 Ian Lance Taylor <iant@google.com>
4650
4651 PR gold/13850
4652 * layout.cc (Layout::make_output_section): Correctly mark
4653 SHT_INIT_ARRAY, et. al., as relro.
4654
fa40b62a
DK
46552012-03-14 Doug Kwan <dougkwan@google.com>
4656
4657 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
4658 dynamic relocations for protected symbols in shared objects.
4659
fd325007
ILT
46602012-03-13 Ian Lance Taylor <iant@google.com>
4661
4662 * resolve.cc (Symbol_table::resolve): When merging common symbols,
4663 keep the larger alignment.
4664
e8dd54e1
CC
46652012-03-12 Cary Coutant <ccoutant@google.com>
4666
4667 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
4668 handling of DW_LNE_define_file.
4669
feb5f3b0
CC
46702012-03-12 Cary Coutant <ccoutant@google.com>
4671
4672 * reduced_debug_output.cc
4673 (Output_reduced_debug_info_section::get_die_end): Add new FORM
4674 codes to switch.
4675
a1fb4256
CC
46762012-02-29 Cary Coutant <ccoutant@google.com>
4677
4678 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
4679
5dd8762a
CC
46802012-02-29 Cary Coutant <ccoutant@google.com>
4681
4682 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4683 Call Object::decompressed_section_contents.
4684 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
4685 New dtor.
4686 (Sized_dwarf_line_info::buffer_start_): New data member.
4687 * merge.cc (Output_merge_data::do_add_input_section): Call
4688 Object::decompressed_section_contents.
4689 (Output_merge_string::do_add_input_section): Likewise.
4690 * object.cc (need_decompressed_section): New function.
4691 (build_compressed_section_map): Decompress sections needed later.
4692 (Sized_relobj_file::do_decompressed_section_contents): New function.
4693 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4694 * object.h (Object::decompressed_section_contents): New function.
4695 (Object::discard_decompressed_sections): New function.
4696 (Object::do_decompressed_section_contents): New function.
4697 (Object::do_discard_decompressed_sections): New function.
4698 (Compressed_section_info): New type.
4699 (Compressed_section_map): Include decompressed section contents.
4700 (Sized_relobj_file::do_decompressed_section_contents): New function.
4701 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4702
7b5de7ee
CC
47032012-02-16 Cary Coutant <ccoutant@google.com>
4704
4705 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
4706 * testsuite/Makefile.in: Regenerate.
4707
f9fa4a63
CC
47082012-02-14 Cary Coutant <ccoutant@google.com>
4709
4710 * options.cc (General_options::finalize): Disallow -pie and -static.
4711
2c175ebc
DK
47122012-02-03 Doug Kwan <dougkwan@google.com>
4713
4714 * arm.cc (Arm_relocate_functions::abs8,
4715 Arm_relocate_functions::abs16): Use
4716 Bits::has_signed_unsigned_overflow32.
4717 (Arm_relocate_functions::thm_abs8): Correct range of
4718 overflow check.
4719 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
4720 in assertions.
4721
90cff06f
DK
47222012-02-02 Doug Kwan <dougkwan@google.com>
4723
4724 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
4725 position independent outputs, not just shared objects.
4726
63887f3d
L
47272012-01-30 H.J. Lu <hongjiu.lu@intel.com>
4728
4729 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
4730 * configure: Regenerated.
4731
bef2b434
ILT
47322012-01-27 Ian Lance Taylor <iant@google.com>
4733
4734 * reloc.h (Bits): New class with static functions, copied from
4735 namespace utils in arm.cc.
4736 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
4737 instead.
4738
c335b55d
L
47392012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4740
4741 * incremental.cc (write_info_blocks): Correct relocation offset.
4742
41194d9f
L
47432012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4744
4745 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
4746 (Relocate::tls_gd_to_le): Likewise.
4747
1bae613c
L
47482012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4749
4750 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
4751
24482ca0
L
47522012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4753
4754 * configure.ac: Check if -mcmodel=medium works.
4755 * configure: Regenerated.
4756
c2c7840a
CC
47572012-01-24 Cary Coutant <ccoutant@google.com>
4758
4759 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
4760 definition and ...
4761 (read_unsigned_LEB_128_x): ... this new function.
4762 (read_signed_LEB_128): Replaced with inline definition and ...
4763 (read_signed_LEB_128_x): ... this new function.
4764 * int_encoding.h (read_unsigned_LEB_128_x): New function.
4765 (read_unsigned_LEB_128): Add inline definition.
4766 (read_signed_LEB_128_x): New function.
4767 (read_signed_LEB_128): Add inline definition.
4768 * testsuite/Makefile.am (leb128_unittest): New unit test.
4769 * testsuite/Makefile.in: Regenerate.
4770 * testsuite/leb128_unittest.cc: New unit test.
4771
833de760 47722012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
4773
4774 PR gold/13617
4775 * i386.cc (Target_i386::do_code_fill): When using a jmp
4776 instruction, pad with nop instructions.
4777 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4778
618d6666
L
47792012-01-22 H.J. Lu <hongjiu.lu@intel.com>
4780
4781 * x86_64.cc (gc_process_relocs): Add typename on types used in
4782 template.
4783 (scan_relocs): Likewise.
4784 (relocate_section): Likewise.
4785 (apply_relocation): Likewise.
4786
3660ff06
L
47872012-01-10 H.J. Lu <hongjiu.lu@intel.com>
4788
4789 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
4790 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
4791 under x32.
4792
fc51264f
L
47932012-01-09 H.J. Lu <hongjiu.lu@intel.com>
4794
4795 * x86_64.cc: Initial support for x32.
4796
dd74ae06
CC
47972012-01-03 Cary Coutant <ccoutant@google.com>
4798
4799 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
4800 Use abstract base class for GOT.
4801 * gold/output.h (class Output_data_got_base): New abstract base class.
4802 (class Output_data_got): Derive from new base class, adjust ctors.
4803 (Output_data_got::reserve_slot): Make virtual; rename to
4804 do_reserve_slot; Adjust callers.
4805 * gold/target.h (Sized_target::init_got_plt_for_update): Return
4806 pointer to abstract base class.
4807 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
4808
83896202
ILT
48092011-12-18 Ian Lance Taylor <iant@google.com>
4810
4811 * object.h (Relobj::local_symbol_value): New function.
4812 (Relobj::local_plt_offset): New function.
4813 (Relobj::local_has_got_offset): New function.
4814 (Relobj::local_got_offset): New function.
4815 (Relobj::set_local_got_offset): New function.
4816 (Relobj::do_local_symbol_value): New pure virtual function.
4817 (Relobj::do_local_plt_offset): Likewise.
4818 (Relobj::do_local_has_got_offset): Likewise.
4819 (Relobj::do_local_got_offset): Likewise.
4820 (Relobj::do_set_local_got_offset): Likewise.
4821 (Sized_relobj::do_local_has_got_offset): Rename from
4822 local_has_got_offset.
4823 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
4824 (Sized_relobj::do_set_local_got_offset): Rename from
4825 set_local_got_offset.
4826 (Sized_relobj_file::do_local_plt_offset): Rename from
4827 local_plt_offset.
4828 (Sized_relobj_file::do_local_symbol_value): New function.
4829 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
4830 local_plt_offset.
4831 * output.cc (Output_data_got::Got_entry::write): Change object to
4832 Relobj. Use local_symbol_value.
4833 (Output_data_got::add_global_with_rel): Change rel_dyn to
4834 Output_data_reloc_generic*. Use add_global_generic.
4835 (Output_data_got::add_global_with_rela): Remove. Change all
4836 callers to use add_global_with_rel.
4837 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
4838 Output_data_reloc_generic*. Use add_global_generic.
4839 (Output_data_got::add_global_pair_with_rela): Remove. Change all
4840 callers to use add_global_pair_with_rel.
4841 (Output_data_got::add_local): Change object to Relobj*.
4842 (Output_data_got::add_local_plt): Likewise.
4843 (Output_data_got::add_local_with_rel): Change object to Relobj*,
4844 change rel_dyn to Output_data_reloc_generic*. Use
4845 add_local_generic.
4846 (Output_data_got::add_local_with_rela): Remove. Change all
4847 callers to use all_local_with_rel.
4848 (Output_data_got::add_local_pair_with_rel): Change object to
4849 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
4850 add_output_section_generic.
4851 (Output_data_got::add_local_pair_with_rela): Remove. Change all
4852 callers to use add_local_pair_with_rel.
4853 (Output_data_got::reserve_local): Change object to Relobj*.
4854 * output.h: (class Output_data_reloc_generic): Add pure virtual
4855 declarations for add_global_generic, add_local_generic,
4856 add_output_section_generic.
4857 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
4858 functions for Output_data_reloc_generic. Update declarations for
4859 changes listed in output.cc.
4860 (class Output_data_got): Change template parameter to got_size.
4861 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
4862 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
4863 function.
4864 (Sized_relobj_incr::do_local_plt_offset): New function.
4865 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
4866 add_global_generic.
4867
76677ad0
CC
48682011-12-17 Cary Coutant <ccoutant@google.com>
4869
4870 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
4871 * resolve.cc (Symbol_table::resolve): Likewise.
4872 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
4873 arrays.
4874 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4875
8b8dd8d5
ILT
48762011-12-16 Ian Lance Taylor <iant@google.com>
4877
4878 * output.h (Output_data_reloc_generic::add): Only call
4879 add_dynamic_reloc if this is a dynamic reloc section.
4880
d55525b9
L
48812011-12-15 H.J. Lu <hongjiu.lu@intel.com>
4882
4883 PR gold/13505
4884 * target-reloc.h (apply_relocation): Replace <64, false> with
4885 <size, big_endian>.
4886
ff81c7c1
NC
48872011-11-25 Nick Clifton <nickc@redhat.com>
4888
4889 * po/it.po: New Italian translation.
4890
628f39be
SA
48912011-11-17 Sterling Augustine <saugustine@google.com>
4892
4893 * script.cc (script_include_directive): Implement.
4894 (read_script_file): New local variables name and search_path. Update
4895 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
4896 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
4897 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
4898
98ef3ea4
SA
48992011-11-11 Sterling Augustine <saugustine@google.com>
4900
4901 * yyscript.y (section_cmd): Add support for INCLUDE directive.
4902 (file_or_sections_cmd): Likewise.
4903
f4a8b6d7
DK
49042011-11-11 Doug Kwan <dougkwan@google.com>
4905
4906 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
4907 if --just-symbols is given.
4908
29ab395d
DK
49092011-11-10 Doug Kwan <dougkwan@google.com>
4910
4911 PR gold/13362
4912 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
4913 when processing data relocs.
4914 * reloc.h (Relocate_functions::rel_unaligned): New method.
4915 (Relocate_functions::pcrel_unaligned): Ditto.
4916 (Relocate_functions::rel32_unaligned): Ditto.
4917 (Relocate_functions::pcrel32_unaligned): Ditto.
4918
2c339f71
DK
49192011-11-09 Doug Kwan <dougkwan@google.com>
4920
4921 PR gold/13362
4922 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
4923 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
4924 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
4925 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4926 (Relocate_functions::rel_unaligned): New.
4927 (Relocate_functions::rel32_unaligned): New.
4928 * target-reloc.h (relocate_for_relocatable): Add code to handle
4929 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4930 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
4931 arm_unaligned_reloc_r): New targets.
4932 * testsuite/Makefile.in: Regenerate.
4933 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
4934 linking.
4935
3f3cddf1
ILT
49362011-11-02 Ian Lance Taylor <iant@google.com>
4937
4938 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
4939 NATIVE_LINKER.
4940 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
4941 * options.cc (General_options::finalize): Use library search path
4942 from configure script if specified. If not native and no sysroot,
4943 only search TOOLLIBDIR.
4944 * options.h (Search_directory::Search_directory): Change name to
4945 const std::string&.
4946 (General_options::add_to_library_path_with_sysroot): Change arg to
4947 const std::string&.
4948 * configure, Makefile.in, config.in: Rebuild.
4949
a8e2273b
ILT
49502011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4951
4952 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
4953 we are working around the ARM1176 Erratum.
4954 * options.h (General_options::fix_arm1176): Add option.
4955 * testsuite/Makefile.am: Add testcases, and keep current ones
4956 working.
4957 * testsuite/Makefile.in: Regenerate.
4958 * testsuite/arm_fix_1176.s: New file.
4959 * testsuite/arm_fix_1176.sh: Likewise.
4960
cd6eab1c
ILT
49612011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4962
4963 * arm.cc (Target_arm::Target_arm): Remove initialisation of
4964 may_use_blx_.
4965 (Target_arm::may_use_blx): Remove method.
4966 (Target_arm::set_may_use_blx): Likewise.
4967 (Target_arm::may_use_v4t_interworking): New method.
4968 (Target_arm::may_use_v5t_interworking): Likewise.
4969 (Target_arm::may_use_blx_): Remove member variable.
4970 (Arm_relocate_functions::arm_branch_common): Check for v5T
4971 interworking.
4972 (Arm_relocate_functions::thumb_branch_common): Likewise.
4973 (Reloc_stub::stub_type_for_reloc): Likewise.
4974 (Target_arm::do_finalize_sections): Correct interworking checks.
4975 * testsuite/Makefile.am: Add new tests.
4976 * testsuite/Makefile.in: Regenerate.
4977 * testsuite/arm_farcall_arm_arm.s: New test.
4978 * testsuite/arm_farcall_arm_arm.sh: Likewise.
4979 * testsuite/arm_farcall_arm_thumb.s: Likewise.
4980 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
4981 * testsuite/arm_farcall_thumb_arm.s: Likewise.
4982 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
4983 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
4984 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
4985
286adcf4
CC
49862011-10-31 Cary Coutant <ccoutant@google.com>
4987
4988 PR gold/13023
4989 * expression.cc (Expression::eval_with_dot): Add
4990 is_section_dot_assignment parameter.
4991 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
4992 absolute and assigning to dot within a section.
4993 * script-sections.cc
4994 (Output_section_element_assignment::set_section_addresses): Pass
4995 dot_section to set_if_absolute.
4996 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
4997 as is_section_dot_assignment flag to eval_with_dot.
4998 (Output_section_element_dot_assignment::set_section_addresses):
4999 Likewise.
5000 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
5001 parameter. Also set value if relative to dot_section; set the
5002 symbol's output_section.
5003 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
5004 parameter. Adjust all callers.
5005 (Expression::eval_maybe_dot): Likewise.
5006 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
5007 Adjust all callers.
5008 * testsuite/script_test_2.t: Test assignment of an absolute value
5009 to dot within an output section element.
5010
9634ed06
CC
50112011-10-31 Cary Coutant <ccoutant@google.com>
5012
5013 * options.h (class General_options): Add --[no-]gnu-unique options.
5014 * symtab.cc (Symbol_table::sized_write_globals): Convert
5015 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
5016
de4101c7
CC
50172011-10-31 Cary Coutant <ccoutant@google.com>
5018
5019 PR gold/13359
5020 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
5021 unnecessary assertion.
5022 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
5023
7257cc92
ST
50242011-10-31 Sriraman Tallam <tmsriram@google.com>
5025
5026 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5027 gc_mark_symbol.
5028 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5029 gc_mark_symbol.
5030 Change to just keep the section associated with symbol.
5031 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
5032 they are externally visible and --export-dynamic is turned on.
5033 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
5034
bfc34b3f
ILT
50352011-10-19 Ian Lance Taylor <iant@google.com>
5036
5037 PR gold/13163
5038 * script-sections.cc
5039 (Output_section_element_dot_assignment::needs_output_section): New
5040 function.
5041
ea0d8c47
ILT
50422011-10-19 Ian Lance Taylor <iant@google.com>
5043
5044 PR gold/13204
5045 * layout.cc (Layout::segment_precedes): Don't assert failure if a
5046 --section-start option was seen.
5047 * options.h (General_options::any_section_start): New function.
5048
abd242a9
DM
50492011-10-18 David S. Miller <davem@davemloft.net>
5050
5051 PR binutils/13301
5052 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
5053 member to track relocation locations that have moved during TLS
5054 reloc optimizations.
5055 (Target_sparc::Relocate::Relocate): Initialize to NULL.
5056 (Target_sparc::Relocate::relocate): Adjust view down by 4
5057 bytes if it matches reloc_adjust_addr_.
5058 (Target_sparc::Relocate::relocate_tls): Always move the
5059 __tls_get_addr call delay slot instruction forward 4 bytes when
5060 performing relaxation.
5061
bab9090f
CC
50622011-10-18 Cary Coutant <ccoutant@google.com>
5063
5064 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
5065 (Output_file::map_no_anonymous): Check for non-zero
5066 return code from posix_fallocate.
5067
f7c5b166
CC
50682011-10-17 Cary Coutant <ccoutant@google.com>
5069
5070 PR gold/13245
5071 * plugin.cc (is_visible_from_outside): Check for symbols
5072 referenced from dynamic objects.
5073 * resolve.cc (Symbol_table::resolve): Don't count references
5074 from dynamic objects as references from real ELF files.
5075 * testsuite/plugin_test_2.sh: Adjust expected result.
5076
b490c0bb
CC
50772011-10-17 Cary Coutant <ccoutant@google.com>
5078
5079 * gold.cc: Include timer.h.
5080 (queue_middle_tasks): Stamp time.
5081 (queue_final_tasks): Likewise.
5082 * main.cc (main): Store timer in parameters. Print timers
5083 for each pass.
5084 * parameters.cc (Parameters::Parameters): Initialize timer_.
5085 (Parameters::set_timer): New function.
5086 (set_parameters_timer): New function.
5087 * parameters.h (Parameters::set_timer): New function.
5088 (Parameters::timer): New function.
5089 (Parameters::timer_): New data member.
5090 (set_parameters_timer): New function.
5091 * timer.cc (Timer::stamp): New function.
5092 (Timer::get_pass_time): New function.
5093 * timer.h (Timer::stamp): New function.
5094 (Timer::get_pass_time): New function.
5095 (Timer::pass_times_): New data member.
5096
f475cf7b
CC
50972011-10-17 Cary Coutant <ccoutant@google.com>
5098
5099 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
5100 task for members of lib groups.
5101
cdd7e244
CC
51022011-10-17 Cary Coutant <ccoutant@google.com>
5103
5104 PR gold/13288
4f95c8b4 5105 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
5106 (File_read::make_view): Move bounds check (replace with assert)...
5107 (File_read::find_or_make_view): ... to here.
5108
dfb45471
CC
51092011-10-12 Cary Coutant <ccoutant@google.com>
5110
4f95c8b4 5111 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
5112 ::read returns less than requested size.
5113
53bbcc1b
CC
51142011-10-10 Cary Coutant <ccoutant@google.com>
5115
4f95c8b4 5116 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
5117 Initialize defined_count_.
5118 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
5119 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
5120 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
5121 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
5122 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 5123 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
5124 member.
5125 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 5126 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
5127 Return zeroes instead of internal error.
5128
397b129b
CC
51292011-10-10 Cary Coutant <ccoutant@google.com>
5130
5131 PR gold/13249
4f95c8b4 5132 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 5133 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 5134 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
5135 (Output_reloc::type_): Adjust size of bit field.
5136 (Output_reloc::use_plt_offset_): New bit field.
5137 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
5138 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
5139 flag. Adjust all callers.
4f95c8b4 5140 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
5141 creating RELATIVE relocations.
5142
d5698657
NC
51432011-10-10 Nick Clifton <nickc@redhat.com>
5144
5145 * po/es.po: Updated Spanish translation.
5146 * po/fi.po: Updated Finnish translation.
5147
6a59a5c2
DN
51482011-10-03 Diego Novillo <dnovillo@google.com>
5149
5150 * options.cc (parse_uint): Fix dereference of RETVAL.
5151
f0558624
ST
51522011-09-29 Sriraman Tallam <tmsriram@google.com>
5153
5154 * layout.h (section_order_map_): New member.
5155 (get_section_order_map): New member function.
5156 * output.cc (Output_section::add_input_section): Check for patterns
5157 only when --section-ordering-file is specified.
5158 * gold.cc (queue_middle_tasks): Delay updating order of sections till
5159 output_sections have been formed.
5160 * layout.cc (Layout_Layout): Initialize section_order_map_.
5161 * plugin.cc (update_section_order): Store order in order_map. Do not
5162 update the order.
5163 * testsuite/Makefile.am: Add test case for plugin_final_layout.
5164 * testsuite/Makefile.in: Regenerate.
5165 * testsuite/plugin_section_order.c: New file.
5166 * testsuite/plugin_final_layout.cc: New file.
5167 * testsuite/plugin_final_layout.sh: New file.
5168
a7dac153
CC
51692011-09-29 Cary Coutant <ccoutant@google.com>
5170
4f95c8b4 5171 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 5172 Check for NULL.
4f95c8b4 5173 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
5174 symbols during incremental update.
5175 (Symbol_table::add_from_dynobj): Likewise.
5176
eebd87a5
ILT
51772011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5178 Ian Lance Taylor <iant@google.com>
5179
5180 * symtab.cc (Symbol_table::define_special_symbol): Always
5181 canonicalize version string.
5182
403a3331
CC
51832011-09-26 Cary Coutant <ccoutant@google.com>
5184
4f95c8b4
CC
5185 * gold.cc (queue_initial_tasks): Move option checks ...
5186 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
5187 some options; make others fatal.
5188
235061c2
CC
51892011-09-26 Cary Coutant <ccoutant@google.com>
5190
5191 gcc PR lto/47247
5192 * plugin.cc (get_symbols_v2): New function.
5193 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
5194 (is_referenced_from_outside): New function.
5195 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
5196 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
5197 (get_symbols): Pass version parameter.
5198 (get_symbols_v2): New function.
5199 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
5200 parameter.
5201 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
5202 (onload): Add LDPT_GET_SYMBOLS_V2.
5203 (all_symbols_read_hook): Use get_symbols_v2; check for
5204 LDPR_PREVAILING_DEF_IRONLY_EXP.
5205 * testsuite/plugin_test_3.sh: Update expected results.
5206
dc87f620
ILT
52072011-09-23 Simon Baldwin <simonb@google.com>
5208
5209 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
5210 configuration options.
5211 * configure: Regenerate.
5212 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
5213 * Makefile.in: Regenerate.
5214 * testsuite/Makefile.in: Regenerate.
5215
a8279f82
ST
52162011-09-19 Sriraman Tallam <tmsriram@google.com>
5217
5218 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
5219
0c9350c8
CC
52202011-09-19 Cary Coutant <ccoutant@google.com>
5221
5222 * incremental.cc (can_incremental_update): Fix typo in comment.
5223 * incremental.h (can_incremental_update): Likewise.
5224
aa06ae28
CC
52252011-09-18 Cary Coutant <ccoutant@google.com>
5226
5227 * incremental.cc (can_incremental_update): New function.
5228 * incremental.h (can_incremental_update): New function.
5229 * layout.cc (Layout::init_fixed_output_section): Call it.
5230 (Layout::make_output_section): Don't allow patch space in .eh_frame.
5231 * object.cc (Sized_relobj_file::do_layout): Call
5232 can_incremental_update.
5233
ebb300b2
CC
52342011-09-13 Cary Coutant <ccoutant@google.com>
5235
5236 * configure.ac: Check for glibc support for gnu_indirect_function
5237 support with static linking, setting automake conditional
5238 IFUNC_STATIC.
5239 * Makefile.in: Regenerate.
5240 * configure: Regenerate.
5241
5242 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
5243 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
5244 for IFUNC_STATIC.
5245 * testsuite/Makefile.in: Regenerate.
5246
1206d0d5
CC
52472011-09-13 Cary Coutant <ccoutant@google.com>
5248
5249 * incremental.cc (Sized_relobj_incr::do_layout): Call
5250 report_comdat_group for kept comdat sections.
5251 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
5252 * testsuite/Makefile.in: Regenerate.
5253 * testsuite/incr_comdat_test_1.cc: New source file.
5254 * testsuite/incr_comdat_test_2_v1.cc: New source file.
5255 * testsuite/incr_comdat_test_2_v2.cc: New source file.
5256 * testsuite/incr_comdat_test_2_v3.cc: New source file.
5257
40b29874
ILT
52582011-09-13 Ian Lance Taylor <iant@google.com>
5259
5260 * object.cc (Sized_relobj_file::do_layout): Remove unused local
5261 variable external_symbols_offset.
5262
1b045aac
ILT
52632011-09-12 Ian Lance Taylor <iant@google.com>
5264
5265 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
5266 triggered if object has no symbols.
5267
24c6c55a
DM
52682011-09-09 David S. Miller <davem@davemloft.net>
5269
5270 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
5271 (Output_fill_debug_line::do_write): Likewise.
5272
66570254
CC
52732011-08-29 Cary Coutant <ccoutant@google.com>
5274
5275 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
5276 casts to match formatting specs.
5277 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
5278
8ea8cd50
CC
52792011-08-26 Cary Coutant <ccoutant@google.com>
5280
5281 * layout.cc (Free_list::allocate): Provide guarantee of minimum
5282 remaining hole size when allocating.
5283 (Layout::make_output_section): Set fill methods for debug sections.
5284 * layout.h (Free_list::Free_list_node): Move from private to
5285 public.
5286 (Free_list::set_min_hole_size): New function.
5287 (Free_list::begin, Free_list::end): New functions.
5288 (Free_list::min_hole_): New data member.
5289 * output.cc: Include dwarf.h.
5290 (Output_fill_debug_info::do_minimum_hole_size): New function.
5291 (Output_fill_debug_info::do_write): New function.
5292 (Output_fill_debug_line::do_minimum_hole_size): New function.
5293 (Output_fill_debug_line::do_write): New function.
5294 (Output_section::Output_section): Initialize new data member.
5295 (Output_section::set_final_data_size): Ensure patch space is larger
5296 than minimum hole size.
5297 (Output_section::do_write): Fill holes in debug sections.
5298 * output.h (Output_fill): New class.
5299 (Output_fill_debug_info): New class.
5300 (Output_fill_debug_line): New class.
5301 (Output_section::set_free_space_fill): New function.
5302 (Output_section::free_space_fill_): New data member.
5303 * testsuite/Makefile.am (incremental_test_3): Add
5304 --incremental-patch option.
5305 (incremental_test_4): Likewise.
5306 (incremental_test_5): Likewise.
5307 (incremental_test_6): Likewise.
5308 (incremental_copy_test): Likewise.
5309 (incremental_common_test_1): Likewise.
5310 * testsuite/Makefile.in: Regenerate.
5311
7cf80422
NC
53122011-08-26 Nick Clifton <nickc@redhat.com>
5313
5314 * po/es.po: Updated Spanish translation.
5315
c3f7b0e5
CC
53162011-08-01 Cary Coutant <ccoutant@google.com>
5317
5318 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
5319 * gold/testsuite/Makefile.in: Regenerate.
5320 * gold/testsuite/justsyms_exec.c: New source file.
5321 * gold/testsuite/justsyms_lib.c: New source file.
5322
9590bf25
CC
53232011-08-01 Cary Coutant <ccoutant@google.com>
5324
5325 * layout.cc (Layout::set_segment_offsets): Don't realign text
5326 segment if -Ttext was specified.
5327 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
5328 file type.
5329 * object.h (Sized_relobj_file::e_type): New function.
5330 (Sized_relobj_file::e_type_): New data member.
5331 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
5332 base address for ET_EXEC files.
5333 * target.cc (Target::do_make_elf_object_implementation): Allow
5334 ET_EXEC files with --just-symbols option.
5335
dcd8d12e
CC
53362011-07-28 Cary Coutant <ccoutant@google.com>
5337
5338 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
5339 Add thread_number parameter.
5340 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
5341 * workqueue-threads.cc
5342 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
5343 current thread if its thread number is greater than desired thread
5344 count.
5345 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
5346 Add thread_number parameter.
5347 (Workqueue::should_cancel_thread): Likewise.
5348 (Workqueue::find_runnable_or_wait): Pass thread_number to
5349 should_cancel_thread.
5350 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
5351 parameter.
5352
804eb480
ST
53532011-07-22 Sriraman Tallam <tmsriram@google.com>
5354
5355 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
5356 only after checking if it cannot be forced local.
5357 * symtab.h (is_externally_visible): Check if the symbol is not forced
5358 local.
5359
f1ddb600
ILT
53602011-07-15 Ian Lance Taylor <iant@google.com>
5361
5362 * options.h (class General_options): Add --print-output-format.
5363 Move -EL next to -EB, for better --help output.
5364 * target-select.cc: Include <cstdio>, "options.h", and
5365 "parameters.h".
5366 (Target_selector::do_target_bfd_name): New function.
5367 (print_output_format): New function.
5368 * target-select.h (class Target_selector): Update declarations.
5369 (Target_selector::target_bfd_name): New function.
5370 (print_output_format): Declare.
5371 * main.cc: Include "target-select.h".
5372 (main): Handle --print-output-format.
5373 * gold.cc: Include "target-select.h".
5374 (queue_initial_tasks): Handle --print-output-format when there are
5375 no input files.
5376 * parameters.cc (parameters_force_valid_target): Give a better
5377 error message if -EB/-EL does not match target.
5378 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
5379 function.
5380
7d172687
ILT
53812011-07-15 Ian Lance Taylor <iant@google.com>
5382
5383 * i386.cc (class Output_data_plt_i386): Add layout_ field.
5384 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
5385 (Output_data_plt_i386::do_write): Write address of .dynamic
5386 section to first entry in .got.plt section.
5387 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
5388 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5389 Initialize layout_.
5390 (Output_data_plt_x86_64::do_write): Write address of .dynamic
5391 section to first entry in .got.plt section.
5392 * layout.h (Layout::dynamic_section): New function.
5393
e9552f7e
ST
53942011-07-13 Sriraman Tallam <tmsriram@google.com>
5395
5396 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
5397 to claim_file call.
5398 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
5399 input_section_position_, and input_section_glob_.
5400 (read_layout_from_file): Call function section_ordering_specified.
5401 * layout.h (is_section_ordering_specified): New function.
5402 (section_ordering_specified): New function.
5403 (section_ordering_specified_): New boolean member.
5404 * main.cc(main): Call load_plugins after layout object is defined.
5405 * output.cc (Output_section::add_input_section): Use
5406 function section_ordering_specified to check if section ordering is
5407 needed.
5408 * output.cc (Output_section::add_relaxed_input_section): Use
5409 function section_ordering_specified to check if section ordering is
5410 needed.
5411 (Output_section::update_section_layout): New function.
5412 (Output_section::sort_attached_input_sections): Check if input section
5413 must be reordered.
5414 * output.h (Output_section::update_section_layout): New function.
5415 * plugin.cc (get_section_count): New function.
5416 (get_section_type): New function.
5417 (get_section_name): New function.
5418 (get_section_contents): New function.
5419 (update_section_order): New function.
58797674 5420 (allow_section_ordering): New function.
e9552f7e
ST
5421 (Plugin::load): Add the new interfaces to the transfer vector.
5422 (Plugin_manager::load_plugins): New parameter.
5423 (Plugin_manager::all_symbols_read): New parameter.
5424 (Plugin_manager::claim_file): New parameter. Save the elf object for
5425 unclaimed objects.
5426 (Plugin_manager::get_elf_object): New function.
5427 (Plugin_manager::get_view): Change to directly use the bool to check
5428 if get_view is called from claim_file_hook.
5429 * plugin.h (input_objects): New function
5430 (Plugin__manager::load_plugins): New parameter.
5431 (Plugin_manager::claim_file): New parameter.
5432 (Plugin_manager::get_elf_object): New function.
5433 (Plugin_manager::in_claim_file_handler): New function.
5434 (Plugin_manager::in_claim_file_handler_): New member.
5435 (layout): New function.
5436 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
5437 handler with an extra parameter. Make the elf object before calling
5438 claim_file handler.
5439 * testsuite/plugin_test.c (get_section_count): New function pointer.
5440 (get_section_type): New function pointer.
5441 (get_section_name): New function pointer.
5442 (get_section_contents): New function pointer.
5443 (update_section_order): New function pointer.
5444 (allow_section_ordering): New function pointer.
5445 (onload): Check if the new interfaces exist.
5446
9446efde
ILT
54472011-07-13 Ian Lance Taylor <iant@google.com>
5448
5449 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
5450 relro section.
5451 * x86_64.cc (Target_x86_64::got_section): Likewise.
5452 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
5453 (relro_now_test_SOURCES): New variable.
5454 (relro_now_test_DEPENDENCIES): New variable.
5455 (relro_now_test_LDFLAGS): New variable.
5456 (relro_now_test_LDADD): New variable.
5457 (relro_now_test.so): New target.
5458 * testsuite/Makefile.in: Rebuild.
5459
07aa62f2
ILT
54602011-07-12 Ian Lance Taylor <iant@google.com>
5461
5462 PR gold/12980
5463 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
5464 GLOB_DAT relocation rather than a RELATIVE relocation for a
5465 protected symbol when creating a shared library.
5466 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5467 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
5468 * testsuite/protected_main_1.cc (main): Test that protected
5469 function has same address.
5470
e2153196
ILT
54712011-07-11 Ian Lance Taylor <iant@google.com>
5472
5473 PR gold/12979
5474 * options.h (class General_options): Add -Bgroup.
5475 * options.cc (General_options::finalize): If -Bgroup is set,
5476 default to --unresolved-symbols=report-all.
5477 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
5478 * target-reloc.h (issue_undefined_symbol_error): Handle
5479 --unresolved-symbols=report-all.
5480
6daf5215
ILT
54812011-07-08 Ian Lance Taylor <iant@google.com>
5482
5483 PR gold/11985
5484 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
5485 if linker script discards key sections.
5486 (Layout::create_dynamic_symtab): Likewise.
5487 (Layout::assign_local_dynsym_offsets): Likewise.
5488 (Layout::sized_create_version_sections): Likewise.
5489 (Layout::create_interp): Likewise.
5490 (Layout::finish_dynamic_section): Likewise.
5491 (Layout::set_dynamic_symbol_size): Likewise.
5492
beabb2c6
ILT
54932011-07-08 Ian Lance Taylor <iant@google.com>
5494
5495 PR gold/12386
5496 * options.h (class General_options): Add --unresolved-symbols.
5497 * target-reloc.h (issue_undefined_symbol_error): Check
5498 --unresolved-symbols. Add comments.
5499
9c16daf1
ILT
55002011-07-08 Ian Lance Taylor <iant@google.com>
5501
5502 * testsuite/odr_violation2.cc (Ordering::operator()): Make
5503 expression more complex.
5504
191f1a2d
ILT
55052011-07-08 Ian Lance Taylor <iant@google.com>
5506
5507 PR gold/11317
5508 * target-reloc.h (issue_undefined_symbol_error): New inline
5509 function, broken out of relocate_section.
5510 (relocate_section): Call issue_undefined_symbol_error.
5511 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5512 there is no TLS segment if we are about to issue an undefined
5513 symbol error.
5514 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5515
62855347
ILT
55162011-07-08 Ian Lance Taylor <iant@google.com>
5517
5518 PR gold/12279
5519 * resolve.cc (Symbol_table::should_override): Add fromtype
5520 parameter. Change all callers. Give error when linking together
5521 TLS and non-TLS symbol.
5522 (Symbol_table::should_override_with_special): Add fromtype
5523 parameter. Change all callers.
5524 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5525 there is no TLS segment if we have reported some errors.
5526 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5527
67181c72
ILT
55282011-07-08 Ian Lance Taylor <iant@google.com>
5529
5530 PR gold/12372
5531 * target.h (Target::plt_address_for_global): New function.
5532 (Target::plt_address_for_local): New function.
5533 (Target::plt_section_for_global): Remove.
5534 (Target::plt_section_for_local): Remove.
5535 (Target::do_plt_address_for_global): New virtual function.
5536 (Target::do_plt_address_for_local): New virtual function.
5537 (Target::do_plt_section_for_global): Remove.
5538 (Target::do_plt_section_for_local): Remove.
5539 (Target::register_global_plt_entry): Add Symbol_table and Layout
5540 parameters.
5541 * output.cc (Output_data_got::Got_entry::write): Use
5542 plt_address_for_global and plt_address_for_local.
5543 * layout.cc (Layout::add_target_dynamic_tags): Use size and
5544 address of output section.
5545 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
5546 got_irelative_, and irelative_count_ fields. Update
5547 declarations.
5548 (Output_data_plt_i386::has_irelative_section): New function.
5549 (Output_data_plt_i386::entry_count): Add irelative_count_.
5550 (Output_data_plt_i386::set_final_data_size): Likewise.
5551 (class Target_i386): Add got_irelative_ and rel_irelative_
5552 fields. Update declarations.
5553 (Target_i386::Target_i386): Initialize new fields.
5554 (Target_i386::do_plt_address_for_global): New function replacing
5555 do_plt_section_for_global.
5556 (Target_i386::do_plt_address_for_local): New function replacing
5557 do_plt_section_for_local.
5558 (Target_i386::got_section): Create got_irelative_.
5559 (Target_i386::rel_irelative_section): New function.
5560 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
5561 fields. Don't define __rel_iplt_{start,end}.
5562 (Output_data_plt_i386::add_entry): Add symtab and layout
5563 parameters. Change all callers. Use different PLT and GOT for
5564 IFUNC symbols.
5565 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
5566 layout parameters. Change all callers. Use different PLT and
5567 GOT.
5568 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
5569 (Output_data_plt_i386::rel_irelative): New function.
5570 (Output_data_plt_i386::address_for_global): New function.
5571 (Output_data_plt_i386::address_for_local): New function.
5572 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
5573 IRELATIVE GOT when changing IFUNC GOT entries.
5574 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
5575 reloc.
5576 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
5577 if we didn't create an IRELATIVE GOT.
5578 (Target_i386::Relocate::relocate): Use plt_address_for_global and
5579 plt_address_for_local.
5580 (Target_i386::do_dynsym_value): Use plt_address_for_global.
5581 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
5582 got_irelative_, and irelative_count_ fields. Update
5583 declarations.
5584 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5585 Initialize new fields. Remove symtab parameter. Change all
5586 callers.
5587 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
5588 irelative_count_.
5589 (Output_data_plt_x86_64::has_irelative_section): New function.
5590 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
5591 (class Target_x86_64): Add got_irelative_ and rel_irelative_
5592 fields. Update declarations.
5593 (Target_x86_64::Target_x86_64): Initialize new fields.
5594 (Target_x86_64::do_plt_address_for_global): New function replacing
5595 do_plt_section_for_global.
5596 (Target_x86_64::do_plt_address_for_local): New function replacing
5597 do_plt_section_for_local.
5598 (Target_x86_64::got_section): Create got_irelative_.
5599 (Target_x86_64::rela_irelative_section): New function.
5600 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
5601 all callers. Don't create __rel_iplt_{start,end}.
5602 (Output_data_plt_x86_64::add_entry): Add symtab and layout
5603 parameters. Change all callers. Use different PLT and GOT for
5604 IFUNC symbols.
5605 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
5606 layout parameters. Change all callers. Use different PLT and
5607 GOT.
5608 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
5609 parameters. Change all callers. Use different PLT and GOT for
5610 IFUNC symbols.
5611 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
5612 (Output_data_plt_x86_64::rela_irelative): New function.
5613 (Output_data_plt_x86_64::address_for_global): New function.
5614 (Output_data_plt_x86_64::address_for_local): New function.
5615 (Output_data_plt_x86_64::set_final_data_size): Likewise.
5616 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
5617 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
5618 (Target_x86_64::register_global_plt_entry): Add symtab and layout
5619 parameters.
5620 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
5621 reloc.
5622 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
5623 symbols if we didn't create an IRELATIVE GOT.
5624 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
5625 plt_address_for_local.
5626 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
5627 * testsuite/ifuncvar1.c: New test file.
5628 * testsuite/ifuncvar2.c: New test file.
5629 * testsuite/ifuncvar3.c: New test file.
5630 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
5631 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
5632 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
5633 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
5634 * testsuite/Makefile.in: Rebuild.
5635
33c15b45
CC
56362011-07-07 Cary Coutant <ccoutant@google.com>
5637
5638 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
5639 (two_file_test_1_ndebug.o): Likewise.
5640 (two_file_test_1b_ndebug.o): Likewise.
5641 (two_file_test_2_ndebug.o): Likewise.
5642 (two_file_test_main_ndebug.o): Likewise.
5643 (incremental_test_2): Link with no-debug versions.
5644
f48b5fb7
CC
56452011-07-06 Cary Coutant <ccoutant@google.com>
5646
5647 * gold/incremental.cc
5648 (Output_section_incremental_inputs::write_info_blocks): Check for
5649 hidden and internal symbols.
5650
221597a5
CC
56512011-07-06 Cary Coutant <ccoutant@google.com>
5652
5653 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
5654 Check disposition for startup file.
5655 (Incremental_inputs::report_command_line): Ignore
5656 --incremental-startup-unchanged option.
5657 * options.cc (General_options::parse_incremental_startup_unchanged):
5658 New function.
5659 (General_options::General_options): Initialize new data member.
5660 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
5661 (General_options): Add --incremental-startup-unchanged option.
5662 (General_options::incremental_startup_disposition): New function.
5663 (General_options::incremental_startup_disposition_): New data member.
5664
e24719f6
CC
56652011-07-06 Cary Coutant <ccoutant@google.com>
5666
5667 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
5668 input file index to Script_info ctor.
5669 (Sized_incremental_binary::do_file_has_changed): Find the
5670 command-line argument for files named in scripts.
5671 * incremental.h (Script_info::Script_info): New ctor
5672 with input file index.
5673 (Script_info::input_file_index): New function.
5674 (Script_info::input_file_index_): New data member.
5675 (Incremental_binary::get_library): Add const.
5676 (Incremental_binary::get_script_info): Add const.
5677 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
5678 * testsuite/Makefile.am (incremental_test_5): New test case.
5679 (incremental_test_6): New test case.
5680 * testsuite/Makefile.in: Regenerate.
5681
8f7c81e8
CC
56822011-07-06 Cary Coutant <ccoutant@google.com>
5683
5684 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
5685 debug output when command lines differ.
5686
9fbd3822
CC
56872011-07-06 Cary Coutant <ccoutant@google.com>
5688
5689 * incremental.cc (Incremental_inputs::report_command_line): Ignore
5690 --incremental-patch option.
5691 * layout.cc (Free_list::allocate): Extend allocation beyond original
5692 end if enabled.
5693 (Layout::make_output_section): Mark sections that should get
5694 patch space.
5695 * options.cc (parse_percent): New function.
5696 * options.h (parse_percent): New function.
5697 (DEFINE_percent): New macro.
5698 (General_options): Add --incremental-patch option.
5699 * output.cc (Output_section::Output_section): Initialize new data
5700 members.
5701 (Output_section::add_input_section): Print section name when out
5702 of patch space.
5703 (Output_section::add_output_section_data): Likewise.
5704 (Output_section::set_final_data_size): Add patch space when
5705 doing --incremental-full.
5706 (Output_section::do_reset_address_and_file_offset): Remove patch
5707 space.
5708 (Output_segment::set_section_list_addresses): Print debug output
5709 only if --incremental-update.
5710 * output.h (Output_section::set_is_patch_space_allowed): New function.
5711 (Output_section::is_patch_space_allowed_): New data member.
5712 (Output_section::patch_space_): New data member.
5713 * parameters.cc (Parameters::incremental_full): New function.
5714 * parameters.h (Parameters::incremental_full): New function
5715 * testsuite/Makefile.am (incremental_test_2): Add test for
5716 --incremental-patch option.
5717 * testsuite/Makefile.in: Regenerate.
5718 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
5719 (t18): Remove function body.
5720
f6cccc2c
DK
57212011-07-05 Doug Kwan <dougkwan@google.com>
5722
5723 PR gold/12771
5724 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
5725 Arm_Address type for relocation result.
5726 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
5727 overflow check.
5728 (Arm_relocate_functions::abs32): Use unaligned access.
5729 (Arm_relocate_functions::rel32): Ditto.
5730 (Arm_relocate_functions::prel31): Ditto.
5731 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
5732 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
5733 static data relocations.
5734 * testsuite/Makefile.in: Regnerate.
5735 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
5736
28a13fec
ILT
57372011-07-05 Ian Lance Taylor <iant@google.com>
5738
5739 PR gold/12392
5740 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
5741 symbols if necessary.
5742 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5743
24d47b34
ILT
57442011-07-05 Ian Lance Taylor <iant@google.com>
5745
5746 PR gold/12952
5747 * resolve.cc (Symbol::override_base_with_special): Simply override
5748 version with special symbol version, ignoring previous version.
5749
41f9cbbe
ILT
57502011-07-05 Ian Lance Taylor <iant@google.com>
5751
5752 * object.cc (Sized_relobj_file::include_section_group): Add
5753 information to comment about signature location.
5754
886288f1
ILT
57552011-07-02 Ian Lance Taylor <iant@google.com>
5756
5757 PR gold/12957
5758 * options.h (class General_options): Add -f and -F.
5759 * options.cc (General_options::finalize): Fatal error if -f/-F
5760 are used without -shared.
5761 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
5762
ae3a6d4f
ILT
57632011-07-02 Ian Lance Taylor <iant@google.com>
5764
5765 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
5766
21131061
ILT
57672011-07-01 Ian Lance Taylor <iant@google.com>
5768
5769 PR gold/12525
5770 PR gold/12952
5771 * resolve.cc (Symbol::override_base_with_special): Don't override
5772 the version if the overriding symbol has a different name.
5773 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
5774 all callers. If we give an error about an undefined version,
5775 define the base version if necessary.
5776 * dynobj.h (class Versions): Update declaration.
5777 * testsuite/weak_alias_test_5.cc: New file.
5778 * testsuite/weak_alias_test.script: New file.
5779 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
5780 and versioned_alias have the right value, and call t2.
5781 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
5782 weak_alias_test_5.so.
5783 (weak_alias_test_LDADD): Likewise.
5784 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
5785 * testsuite/Makefile.in: Rebuild.
5786
611062c0
ILT
57872011-07-01 Ian Lance Taylor <iant@google.com>
5788
5789 PR gold/12525
5790 * options.h (class General_options): Support -z notext.
5791 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
5792 -Wl,-z,notext.
5793 (two_file_shared_nonpic.so): Likewise.
5794 (two_file_shared_mixed.so): Likewise.
5795 (two_file_shared_mixed_1.so): Likewise.
5796 (weak_undef_lib_nonpic.so): Likewise.
5797 (alt/weak_undef_lib_nonpic.so): Likewise.
5798 (tls_test_shared_nonpic.so): Likewise.
5799 * testsuite/Makefile.in: Rebuild.
5800
328c7c2f
ILT
58012011-07-01 Ian Lance Taylor <iant@google.com>
5802
5803 PR gold/12525
5804 * configure.ac: Test whether static linking works, setting
5805 the automake conditional HAVE_STATIC.
5806 * testsuite/Makefile.am: Disable tests using -static if
5807 HAVE_STATIC is not true.
5808 * configure, testsuite/Makefile.in: Rebuild.
5809
02d7cd44
ILT
58102011-07-01 Ian Lance Taylor <iant@google.com>
5811
5812 PR gold/12525
5813 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
5814 Assert if we see DW_EH_PE_indirect.
5815 * target.h (Target::ehframe_datarel_base): New function.
5816 (Target::do_ehframe_datarel_base): New target function.
5817 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
5818 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
5819 function.
5820
07a60597
ILT
58212011-07-01 Ian Lance Taylor <iant@google.com>
5822
5823 PR gold/12571
5824 * options.h (class General_options): Add
5825 --ld-generated-unwind-info.
5826 * ehframe.cc (Fde::write): Add address parameter. Change all
5827 callers. If associated with PLT, fill in address and size.
5828 (Cie::set_output_offset): Only add merge mapping if there is an
5829 object.
5830 (Cie::write): Add address parameter. Change all callers.
5831 (Eh_frame::add_ehframe_for_plt): New function.
5832 * ehframe.h (class Fde): Update declarations. Move shndx_ and
5833 input_offset_ fields into union u_, with new plt field.
5834 (Fde::Fde): Adjust for new union field.
5835 (Fde::Fde) [Output_data version]: New constructor.
5836 (Fde::add_mapping): Only add merge mapping if there is an object.
5837 (class Cie): Update declarations.
5838 (class Eh_frame): Declare add_ehframe_for_plt.
5839 * layout.cc (Layout::layout_eh_frame): Break out code into
5840 make_eh_frame_section, and call it.
5841 (Layout::make_eh_frame_section): New function.
5842 (Layout::add_eh_frame_for_plt): New function.
5843 * layout.h (class Layout): Update declarations.
5844 * merge.cc (Merge_map::add_mapping): Add assertion.
5845 * i386.cc: Include "dwarf.h".
5846 (class Output_data_plt_i386): Make first_plt_entry,
5847 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
5848 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5849 and plt_eh_frame_fde.
5850 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
5851 boundary. Call add_eh_frame_for_plt if appropriate.
5852 * x86_64.cc: Include "dwarf.h".
5853 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
5854 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
5855 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5856 and plt_eh_frame_fde.
5857 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
5858 appropriate.
5859
14788a3f
ILT
58602011-06-29 Ian Lance Taylor <iant@google.com>
5861
5862 PR gold/12629
5863 * object.cc (Sized_relobj_file::layout_section): Change shdr
5864 parameter to be const.
5865 (Sized_relobj_file::layout_eh_frame_section): New function, broken
5866 out of do_layout.
5867 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
5868 appropriate. Call layout_eh_frame_section.
5869 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
5870 sections.
5871 * object.h (class Sized_relobj_file): Update declarations.
5872
6c21fce1
ILT
58732011-06-29 Ian Lance Taylor <iant@google.com>
5874
37e41b03 5875 PR gold/12652
6c21fce1
ILT
5876 * script.cc (Token::integer_value): Accept trailing M/m/K/k
5877 modifier.
5878 (Lex::gather_token): Accept trailing M/m/K/k for integers.
5879
4d5e4e62
ILT
58802011-06-29 Ian Lance Taylor <iant@google.com>
5881
5882 PR gold/12675
5883 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
5884 SHT_X86_64_UNWIND.
5885 * layout.cc (Layout::layout_eh_frame): Likewise.
5886
886f533a
ILT
58872011-06-29 Ian Lance Taylor <iant@google.com>
5888
5889 PR gold/12695
5890 * layout.cc (Layout::symtab_section_shndx): New function.
5891 * layout.h (class Layout): Declare symtab_section_shndx.
5892 * output.cc (Output_section::write_header): Call it.
5893
f3ae1b28
ILT
58942011-06-29 Ian Lance Taylor <iant@google.com>
5895
5896 PR gold/12818
5897 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
5898 symbols which are not used in a relocation.
5899
aecf301f
ILT
59002011-06-28 Ian Lance Taylor <iant@google.com>
5901
5902 PR gold/12898
5903 * layout.cc (Layout::segment_precedes): Don't crash if a linker
5904 script create indistinguishable segments.
5905 (Layout::set_segment_offsets): Use stable_sort when sorting
5906 segments. Pass this to Compare_segments constructor.
5907 * layout.h (class Layout): Make segment_precedes non-static.
5908 (class Compare_segments): Change from struct to class. Add
5909 layout_ field. Add constructor.
5910 * script-sections.cc
5911 (Script_sections::attach_sections_using_phdrs_clause): Rename
5912 local orphan to is_orphan. Don't report failure to put empty
5913 section in segment. On attachment failure, report name of
5914 section, and attach to first PT_LOAD segment.
5915
03ef7571
ILT
59162011-06-28 Ian Lance Taylor <iant@google.com>
5917
5918 PR gold/12934
5919 * target-select.cc (Target_selector::Target_selector): Add
5920 emulation parameter. Change all callers.
5921 (select_target_by_bfd_name): Rename from select_target_by_name.
5922 Change all callers.
5923 (select_target_by_emulation): New function.
5924 (supported_emulation_names): New function.
5925 * target-select.h (class Target_selector): Add emulation_ field.
5926 Update declarations.
5927 (Target_selector::recognize_by_bfd_name): Rename from
5928 recognize_by_name. Change all callers.
5929 (Target_selector::supported_bfd_names): Rename from
5930 supported_names. Change all callers.
5931 (Target_selector::recognize_by_emulation): New function.
5932 (Target_selector::supported_emulations): New function.
5933 (Target_selector::emulation): New function.
5934 (Target_selector::do_recognize_by_bfd_name): Rename from
5935 do_recognize_by_name. Change all callers.
5936 (Target_selector::do_supported_bfd_names): Rename from
5937 do_supported_names. Change all callers.
5938 (Target_selector::do_recognize_by_emulation): New function.
5939 (Target_selector::do_supported_emulations): New function.
5940 (select_target_by_bfd_name): Change name in declaration.
5941 (select_target_by_emulation): Declare.
5942 (supported_emulation_names): Declare.
5943 * parameters.cc (parameters_force_valid_target): Try to find
5944 target based on emulation from -m option.
5945 * options.h (class General_options): Change doc string for -m.
5946 * options.cc (help): Print emulations.
5947 (General_options::parse_V): Likewise.
5948 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
5949 Add emulation parameter. Change all callers.
5950
200b2bb9
ILT
59512011-06-28 Ian Lance Taylor <iant@google.com>
5952
5953 * target.h (class Target): Add osabi_ field.
5954 (Target::osabi): New function.
5955 (Target::set_osabi): New function.
5956 (Target::Target): Initialize osabi_.
5957 (Target::do_adjust_elf_header): Make pure virtual.
5958 (Sized_target::do_adjust_elf_header): Declare.
5959 * target.cc (Sized_target::do_adjust_elf_header): New function.
5960 (class Sized_target): Instantiate all versions.
5961 * freebsd.h (class Target_freebsd): Remove.
5962 (Target_selector_freebsd::do_recognize): Call set_osabi on
5963 Target.
5964 (Target_selector_freebsd::do_recognize_by_name): Likewise.
5965 (Target_selector_freebsd::set_osabi): Remove.
5966 * i386.cc (class Target_i386): Inherit from Sized_target rather
5967 than Target_freebsd.
5968 * x86_64.cc (class Target_x86_64): Likewise.
5969
b3ce541e
ILT
59702011-06-28 Ian Lance Taylor <iant@google.com>
5971
5972 * target.h (Target::can_check_for_function_pointers): Rewrite.
5973 Make non-virtual.
5974 (Target::can_icf_inline_merge_sections): Likewise.
5975 (Target::section_may_have_icf_unsafe_poineters): Likewise.
5976 (Target::Target_info): Add can_icf_inline_merge_sections field.
5977 (Target::do_can_check_for_function_pointers): New virtual
5978 function.
5979 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
5980 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
5981 from can_check_for_function_pointers, move in file.
5982 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
5983 section_may_have_icf_unsafe_poineters, move in file.
5984 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
5985 * i386.cc (Target_i386::do_can_check_for_function_pointers):
5986 Rename from can_check_for_function_pointers, move in file.
5987 (Target_i386::can_icf_inline_merge_sections): Remove.
5988 (Target_i386::i386_info): Initialize
5989 can_icf_inline_merge_sections.
5990 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
5991 Initialize can_icf_inline_merge_sections.
5992 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
5993 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
5994 Rename from can_check_for_function_pointers, move in file.
5995 (Target_x86_64::can_icf_inline_merge_sections): Remove.
5996 (Target_x86_64::x86_64_info): Initialize
5997 can_icf_inline_merge_sections.
5998 * testsuite/testfile.cc (Target_test::test_target_info):
5999 Likewise.
6000 * icf.cc (get_section_contents): Correct formatting.
6001
6d1c4efb
ILT
60022011-06-27 Ian Lance Taylor <iant@google.com>
6003
6004 * symtab.cc (Symbol::versioned_name): New function.
6005 (Symbol_table::add_to_final_symtab): Use versioned_name when
6006 appropriate.
6007 (Symbol_table::sized_write_symbol): Likewise.
6008 * symtab.h (class Symbol): Declare versioned_name.
6009 * stringpool.h (class Stringpool_template): Add variant of add
6010 which takes a std::basic_string.
6011 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
6012 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
6013 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
6014 (ver_test_12.o): New target.
6015 * testsuite/Makefile.in: Rebuild.
6016
57eb9b50
DK
60172011-06-27 Doug Kwan <dougkwan@google.com>
6018
6019 * arm.cc (Arm_relocate_functions::thm_jump8,
6020 Arm_relocate_functions::thm_jump11): Use a wider signed
6021 type to compute offset.
6022 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
6023 arm_thm_jump8.
6024 * testsuite/Makefile.in: Regenerate.
6025 * testsuite/arm_branch_in_range.sh: Check test results of
6026 arm_thm_jump11 and arm_thm_jump8.
6027 * testsuite/arm_thm_jump11.s: New test source file.
6028 * testsuite/arm_thm_jump11.t: New linker script.
6029 * testsuite/arm_thm_jump8.s: New test source file.
6030 * testsuite/arm_thm_jump8.t: New linker script.
6031
487b39df
ILT
60322011-06-24 Ian Lance Taylor <iant@google.com>
6033
6034 * layout.cc: Include "object.h".
6035 (ctors_sections_in_init_array): New static variable.
6036 (Layout::is_ctors_in_init_array): New function.
6037 (Layout::layout): Add entry to ctors_sections_in_init_array if
6038 appropriate.
6039 * layout.h (class Layout): Declare is_ctors_in_init_array.
6040 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
6041 is_ctors_reverse_view is set.
6042 (Sized_relobj_file::write_sections): Add layout parameter. Change
6043 all callers. Set is_ctors_reverse_view field of View_size.
6044 (Sized_relobj_file::reverse_words): New function.
6045 * object.h (Sized_relobj_file::View_size): Add
6046 is_ctors_reverse_view field.
6047 (class Sized_relobj_file): Update declarations.
6048 * testsuite/initpri3.c: New test.
6049 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
6050 initpri3b.
6051 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
6052 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
6053 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
6054 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
6055 * testsuite/Makefile.in: Rebuild.
6056
472076e4
CC
60572011-06-24 Cary Coutant <ccoutant@google.com>
6058
6059 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
6060 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
6061 (debug_msg_cdebug.err): New targets.
6062 * testsuite/Makefile.in: Regenerate.
6063 * testsuite/debug_msg.sh: Check output of link with compressed debug.
6064 Fix checks for link with shared library.
6065
a60af0db
DK
60662011-06-24 Doug Kwan <dougkwan@google.com>
6067
6068 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
6069 skip empty text sections.
6070 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
6071
5393d741
ILT
60722011-06-22 Ian Lance Taylor <iant@google.com>
6073
6074 PR gold/12910
6075 * options.h (class General_options): Add --ctors-in-init-array.
6076 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
6077 friends as SHT_PROGBITS for merging sections.
6078 (Layout::layout): Remove special handling of .init_array and
6079 friends. Don't sort if doing relocatable link. Sort for .ctors
6080 and .dtors if ctors_in_init_array.
6081 (Layout::make_output_section): Force correct section types for
6082 .init_array and friends. Don't sort if doing relocatable link,
6083 Don't sort .ctors and .dtors if ctors_in_init_array.
6084 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
6085 (Layout::output_section_name): Add relobj parameter. Change all
6086 callers. Handle .ctors. and .dtors. in code rather than table.
6087 Handle .ctors and .dtors if ctors_in_init_array.
6088 (Layout::match_file_name): New function, moved from output.cc.
6089 * layout.h (class Layout): Update declarations.
6090 * output.cc: Include "layout.h".
6091 (Input_section_sort_entry::get_priority): New function.
6092 (Input_section_sort_entry::match_file_name): Just call
6093 Layout::match_file_name.
6094 (Output_section::Input_section_sort_init_fini_compare::operator()):
6095 Handle .ctors and .dtors. Sort by explicit priority rather than
6096 by name.
6097 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
6098 * testsuite/initpri2.c: New test.
6099 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
6100 (check_PROGRAMS): Add initpri2.
6101 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
6102 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
6103 * configure, testsuite/Makefile.in: Rebuild.
6104
e1f74f98
ILT
61052011-06-19 Ian Lance Taylor <iant@google.com>
6106
6107 PR gold/12880
6108 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
6109 .interp section to a PT_INTERP segment even if we have seen a
6110 --dynamic-linker option. Don't do it if we have seen a PHDRS
6111 clause in a linker script.
6112 (Layout::finalize): Don't create a .interp section if we've
6113 already create a PT_INTERP segment.
6114 (Layout::create_interp): Always call choose_output_section (revert
6115 patch of 2011-06-17). Don't create PT_INTERP segment.
6116 * script-sections.cc
6117 (Script_sections::create_note_and_tls_segments): Add a .interp
6118 section to a PT_INTERP segment even if we have seen a
6119 --dynamic-linker option.
6120
766f91bb
ILT
61212011-06-18 Ian Lance Taylor <iant@google.com>
6122
6123 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
6124 merely because a non-PT_LOAD segment has a dynamic reloc.
6125
0d212c3a
ILT
61262011-06-18 Ian Lance Taylor <iant@google.com>
6127
6128 * layout.cc (Layout::finish_dynamic_section): Don't create
6129 DT_FLAGS entry if not needed.
6130
911a5072
ILT
61312011-06-18 Ian Lance Taylor <iant@google.com>
6132
6133 PR gold/12745
6134 * layout.cc (Layout::layout_eh_frame): Correct handling of
6135 writable .eh_frame section.
6136
534b4e5f
ILT
61372011-06-17 Ian Lance Taylor <iant@google.com>
6138
6139 PR gold/12893
6140 * resolve.cc (Symbol_table::resolve): Don't give an error if a
6141 symbol is redefined with the exact same object and value.
6142
10b4f102
ILT
61432011-06-17 Ian Lance Taylor <iant@google.com>
6144
6145 PR gold/12880
6146 * layout.h (class Layout): Add interp_segment_ field.
6147 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
6148 (Layout::attach_allocated_section_to_segment): If making shared
6149 library, put .interp section in PT_INTERP segment.
6150 (Layout::finalize): Also call create_interp if -dynamic-linker
6151 option was used.
6152 (Layout::create_interp): Assert that there is no PT_INTERP
6153 segment. If not using a SECTIONS clause, use make_output_section.
6154 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
6155 * script-sections.cc
6156 (Script_sections::create_note_and_tls_segments): If making shared
6157 library, put .interp section in PT_INTERP segment.
6158
a29b0dad
ILT
61592011-06-17 Ian Lance Taylor <iant@google.com>
6160
e588ea8d
ILT
6161 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
6162 when making a shared library.
6163
61642011-06-17 Ian Lance Taylor <iant@google.com>
6165
6166 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
6167 parameter. Change all callers. Don't issue warning about PC32
6168 against locally defined symbol.
a29b0dad 6169
9d3b0698
ILT
61702011-06-16 Ian Lance Taylor <iant@google.com>
6171
6172 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
6173 occurs in same object.
6174
85b0f90c
AM
61752011-06-14 Alan Modra <amodra@gmail.com>
6176
6177 * po/POTFILES.in: Regenerate.
6178
a94907d9
ILT
61792011-06-09 Ian Lance Taylor <iant@google.com>
6180
6181 * script-sections.cc
6182 (Orphan_output_section::set_section_addresses): For a relocatable
6183 link set address to 0.
6184
4fb3a1c3
CC
61852011-06-09 Cary Coutant <ccoutant@google.com>
6186
6187 PR gold/12804
6188 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
6189 used with --compress-debug-sections.
6190 * gold/object.cc (Sized_relobj_file::do_layout): Report
6191 uncompressed size of compressed input sections.
6192
61220854
CC
61932011-06-08 Cary Coutant <ccoutant@google.com>
6194
6195 PR gold/12804
6196 * testsuite/two_file_test_2_v1.cc: Change initialization of
6197 v2 to keep it in .data.
6198
e6455dfb
CC
61992011-06-07 Cary Coutant <ccoutant@google.com>
6200
6201 * common.cc (Symbol_table::do_allocate_commons_list): Call
6202 gold_fallback.
6203 * errors.cc (Errors::fatal): Adjust call to gold_exit.
6204 (Errors::fallback): New function.
6205 (gold_fallback): New function.
6206 * errors.h (Errors::fallback): New function.
6207 * gold.cc (gold_exit): Change status parameter to enum; adjust
6208 all callers.
6209 (queue_initial_tasks): Call gold_fallback.
6210 * gold.h: Include cstdlib.
6211 (Exit_status): New enum type.
6212 (gold_exit): Change status parameter to enum.
6213 (gold_fallback): New function.
6214 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
6215 (Layout::create_symtab_sections): Likewise.
6216 (Layout::create_shdrs): Likewise.
6217 * main.cc (main): Adjust call to gold_exit.
6218 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
6219 (Output_data_got::add_got_entry_pair): Likewise.
6220 (Output_section::add_input_section): Likewise.
6221 (Output_section::add_output_section_data): Likewise.
6222 (Output_segment::set_section_list_addresses): Likewise.
6223 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
6224
fb0e076f
CC
62252011-06-07 Cary Coutant <ccoutant@google.com>
6226
6227 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
6228 for incremental links.
6229 * output.cc (Output_segment::set_section_list_addresses): Remove
6230 FIXME and test for TLS or BSS.
6231
a5ee4d5d
CC
62322011-06-07 Cary Coutant <ccoutant@google.com>
6233
6234 * testsuite/Makefile.am: Add incremental_copy_test,
6235 incremental_common_test_1.
6236 * testsuite/Makefile.in: Regenerate.
6237 * testsuite/common_test_1_v1.c: New source file.
6238 * testsuite/common_test_1_v2.c: New source file.
6239 * testsuite/copy_test_v1.cc: New source file.
6240
5146f448
CC
62412011-06-07 Cary Coutant <ccoutant@google.com>
6242
6243 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
6244 update, allocate common from bss section's free list.
6245 * incremental-dump.cc (dump_incremental_inputs): Print flag for
6246 linker-defined symbols.
6247 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
6248 Skip GOT and PLT entries that are no longer referenced.
6249 (Output_section_incremental_inputs::write_info_blocks): Mark
6250 linker-defined symbols.
6251 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
6252 * output.cc (Output_section::allocate): New function.
6253 * output.h (Output_section::allocate): New function.
6254 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
6255 linker-defined symbols.
6256 (Symbol::override_base_with_special): Copy is_predefined_ flag.
6257 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
6258 (Symbol::init_base_output_data): Likewise.
6259 (Symbol::init_base_output_segment): Likewise.
6260 (Symbol::init_base_constant): Likewise.
6261 (Sized_symbol::init_output_data): Likewise.
6262 (Sized_symbol::init_output_segment): Likewise.
6263 (Sized_symbol::init_constant): Likewise.
6264 (Symbol_table::do_define_in_output_data): Likewise.
6265 (Symbol_table::do_define_in_output_segment): Likewise.
6266 (Symbol_table::do_define_as_constant): Likewise.
6267 * symtab.h (Symbol::is_predefined): New function.
6268 (Symbol::init_base_output_data): Add is_predefined parameter.
6269 (Symbol::init_base_output_segment): Likewise.
6270 (Symbol::init_base_constant): Likewise.
6271 (Symbol::is_predefined_): New data member.
6272 (Sized_symbol::init_output_data): Add is_predefined parameter.
6273 (Sized_symbol::init_output_segment): Likewise.
6274 (Sized_symbol::init_constant): Likewise.
6275 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
6276
26d3c67d
CC
62772011-06-07 Cary Coutant <ccoutant@google.com>
6278
6279 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
6280 instead of emit_copy_reloc.
6281 (Copy_relocs::emit_copy_reloc): Refactor.
6282 (Copy_relocs::make_copy_reloc): New function.
6283 (Copy_relocs::add_copy_reloc): Remove.
6284 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
6285 section.
6286 (Copy_relocs::make_copy_reloc): New function.
6287 (Copy_relocs::add_copy_reloc): Remove.
6288 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
6289 unchanged input files.
6290 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
6291 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
6292 Reserve BSS space for COPY relocations.
6293 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6294 (Output_section_incremental_inputs::write_info_blocks): Record
6295 whether a symbol is copied from a shared object.
6296 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
6297 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
6298 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
6299 (Incremental_input_entry_reader::get_output_symbol_index): Add
6300 is_copy parameter.
6301 (Incremental_binary::emit_copy_relocs): New function.
6302 (Incremental_binary::do_emit_copy_relocs): New function.
6303 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6304 new data member.
6305 (Sized_incremental_binary::add_copy_reloc): New function.
6306 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6307 (Sized_incremental_binary::Copy_reloc): New struct.
6308 (Sized_incremental_binary::Copy_relocs): New typedef.
6309 (Sized_incremental_binary::copy_relocs_): New data member.
6310 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
6311 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
6312 * target.h (Sized_target::emit_copy_reloc): New function.
6313 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
6314
7cdb37d9
CC
63152011-06-02 Cary Coutant <ccoutant@google.com>
6316
6317 PR gold/12163
6318 * gold/archive.cc (Archive::Archive): Initialize new data member.
6319 (Archive::include_all_members): Return if archive has already been
6320 included.
6321 * gold/archive.h (Archive::include_all_members_): New data member.
6322
cc643b88
NC
63232011-06-02 Nick Clifton <nickc@redhat.com>
6324
6325 * dynobj.h: Fix spelling mistake in comment.
6326 * output.cc: Likewise.
6327
f62a3ca7 63282011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 6329 Asier Llano
f62a3ca7
DK
6330
6331 PR gold/12826
cc643b88 6332 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
6333 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
6334 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
6335 redundant arm_exidx_test.so.
6336 * testsuite/Makefile.in: Regenerate.
6337 (check_SCRIPTS): Add pr12826.sh
6338 (check_DATA): Add pr12826.stdout
6339 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
6340 * testsuite/pr12826.sh: New file.
6341 * testsuite/pr12826_1.s: Ditto.
6342 * testsuite/pr12826_1.s: Ditto.
6343
8dbe1edc
ILT
63442011-05-30 Ian Lance Taylor <iant@google.com>
6345
6346 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
6347 sections.
6348
c49875be
ILT
63492011-05-29 Ian Lance Taylor <iant@google.com>
6350
6351 PR gold/12804
6352 * testsuite/Makefile.am: Use different file name for two_file_test
6353 temporary file for each incremental test.
6354 * testsuite/Makefile.in: Rebuild.
6355
69d53f7a
ILT
63562011-05-29 Ian Lance Taylor <iant@google.com>
6357
6358 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
6359 binary input file is empty.
6360
41d0ab5f
ILT
63612011-05-27 Ian Lance Taylor <iant@google.com>
6362
6363 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
6364 (ver_test_9.so): Likewise.
6365 * testsuite/Makefile.in: Rebuild.
6366
89d8a36b
CC
63672011-05-26 Cary Coutant <ccoutant@google.com>
6368
6369 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
6370 * incremental.cc (Incremental_inputs::report_input_section): Fix
6371 comment, indentation.
6372 (Incremental_inputs::report_comdat_group): New function.
6373 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6374 of data for incremental input file entry.
6375 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
6376 group count, COMDAT group signatures.
6377 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
6378 an unchanged input file.
6379 * incremental.h (Incremental_object_entry::Incremental_object_entry):
6380 Initialize new data member.
6381 (Incremental_object_entry::add_comdat_group): New function.
6382 (Incremental_object_entry::get_comdat_group_count): New function.
6383 (Incremental_object_entry::get_comdat_signature_key): New function.
6384 (Incremental_object_entry::groups_): New data member.
6385 (Incremental_inputs::report_comdat_group): New function.
6386 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
6387 data for incremental input file entry.
6388 (Incremental_input_entry_reader::get_comdat_group_count): New function.
6389 (Incremental_input_entry_reader::get_input_section): Adjust size of
6390 data for incremental input file entry.
6391 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
6392 (Incremental_input_entry_reader::get_comdat_group_signature): New
6393 function.
6394 * object.cc (Sized_relobj::include_section_group): Report kept
6395 COMDAT groups for incremental links.
6396
1706a06f
ILT
63972011-05-24 David Meyer <pdox@google.com>
6398
6399 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
6400 with name parameter. Add found_name parameter.
6401 * fileread.cc (Input_file::find_file): Adjust code accordingly.
6402 * dirsearch.h (class Dirsearch): Update declaration.
6403
a10ae760
ILT
64042011-05-24 Ian Lance Taylor <iant@google.com>
6405
6406 * archive.cc (Library_base::should_include_member): Pull in object
6407 from archive if it defines the entry symbol.
6408 * parameters.cc (Parameters::entry): New function.
6409 * parameters.h (class Parameters): Declare entry.
6410 * output.h (class Output_file_header): Remove entry_ field.
6411 * output.cc (Output_file_header::Output_file_header): Remove entry
6412 parameter. Change all callers.
6413 (Output_file_header::entry): Use parameters->entry.
6414 * gold.cc (queue_middle_tasks): Likewise.
6415 * plugin.cc (Plugin_hook::run): Likewise.
6416
aa92d6ed
CC
64172011-05-24 Cary Coutant <ccoutant@google.com>
6418
6419 * gold.cc (queue_initial_tasks): Pass incremental base filename
6420 to Output_file::open_base_file; don't print error message.
6421 * incremental-dump.cc (main): Adjust call to
6422 Output_file::open_for_modification.
6423 * incremental-dump.cc (main): Likewise.
6424 * incremental.cc (Incremental_inputs::report_command_line):
6425 Ignore --incremental-base option when comparing command lines.
6426 Ignore parameter when given as separate argument.
6427 * options.h (class General_options): Add --incremental-base.
6428 * output.cc (Output_file::Output_file):
6429 (Output_file::open_base_file): Add base_name and writable parameters;
6430 read base file into new file; print error message here.
6431 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6432 callers.
6433 * output.h (Output_file::open_for_modification): Rename to...
6434 (Output_file::open_base_file): ...this; add base_name and
6435 writable parameters; adjust all callers.
6436 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6437 callers.
6438 * testsuite/Makefile.am (incremental_test_4): Test
6439 --incremental-base.
6440 * testsuite/Makefile.in: Regenerate.
6441
2eedd706
CC
64422011-05-24 Cary Coutant <ccoutant@google.com>
6443
6444 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
6445 incremental_test_4.
6446 * testsuite/Makefile.in: Regenerate.
6447 * testsuite/two_file_test_1_v1.cc: New test source file.
6448 * testsuite/two_file_test_1b_v1.cc: New test source file.
6449 * testsuite/two_file_test_2_v1.cc: New test source file.
6450
0f1c85a6
CC
64512011-05-24 Cary Coutant <ccoutant@google.com>
6452
6453 * dynobj.h (Dynobj::do_dynobj): New function.
6454 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
6455 flag and soname for shared objects.
6456 * incremental.cc (Incremental_inputs::report_object): Make
6457 either Incremental_object_entry or Incremental_dynobj_entry; add
6458 soname to string table.
6459 (Incremental_inputs::report_input_section): Add assertion.
6460 (Output_section_incremental_inputs::set_final_data_size): Adjust
6461 type of input file entry for shared libraries; adjust size of
6462 shared library info entry.
6463 (Output_section_incremental_inputs::write_input_files): Write
6464 as_needed flag for shared libraries.
6465 (Output_section_incremental_inputs::write_info_blocks): Adjust type
6466 of input file entry for shared libraries; write soname.
6467 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
6468 soname from incremental info.
6469 * incremental.h (enum Incremental_input_flags): Add
6470 INCREMENTAL_INPUT_AS_NEEDED.
6471 (Incremental_input_entry::Incremental_input_entry): Initialize new
6472 data member.
6473 (Incremental_input_entry::set_as_needed): New function.
6474 (Incremental_input_entry::as_needed): New function.
6475 (Incremental_input_entry::do_dynobj_entry): New function.
6476 (Incremental_input_entry::as_needed_): New data member.
6477 (Incremental_object_entry::Incremental_object_entry): Don't check
6478 for shared library.
6479 (Incremental_object_entry::do_type): Likewise.
6480 (class Incremental_dynobj_entry): New class.
6481 (Incremental_input_entry_reader::as_needed): New function.
6482 (Incremental_input_entry_reader::get_soname): New function.
6483 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
6484 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
6485 size of shared library info entry.
58797674 6486 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
6487 incremental link when adding DT_NEEDED entries.
6488 * object.h (Object::Object): Initialize new data member.
6489 (Object::dynobj): New function.
6490 (Object::set_as_needed): New function.
6491 (Object::as_needed): New function.
6492 (Object::do_dynobj): New function.
6493 (Object::as_needed_): New data member.
6494
6fa2a40b
CC
64952011-05-24 Cary Coutant <ccoutant@google.com>
6496
6497 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
6498 info; adjust display of GOT entries.
6499 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6500 vector of input objects; remove file_status_.
6501 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
6502 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
6503 got_plt reader; call target hooks to reserve GOT entries.
6504 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6505 of input file info header and GOT info entry.
6506 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
6507 relocation info.
6508 (Got_plt_view_info::got_descriptor): Remove.
6509 (Got_plt_view_info::sym_index): New data member.
6510 (Got_plt_view_info::input_index): New data member.
6511 (Local_got_offset_visitor::visit): Write input file index.
6512 (Global_got_offset_visitor::visit): Write 0 for input file index.
6513 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
6514 with sym_index and input_index.
6515 (Output_section_incremental_inputs::write_got_plt): Adjust size of
6516 incremental info GOT entry; replace got_descriptor with input_index.
6517 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
6518 map from input file index to object.
6519 (Sized_relobj_incr::do_layout): Replace direct data member reference
6520 with accessor function.
6521 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
6522 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
6523 Adjust size of input file info header.
6524 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
6525 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
6526 (Incremental_input_entry_reader::get_input_section): Adjust size of
6527 input file info header.
6528 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
6529 of incremental info GOT entry.
6530 (Incremental_got_plt_reader::get_got_desc): Remove.
6531 (Incremental_got_plt_reader::get_got_symndx): New function.
6532 (Incremental_got_plt_reader::get_got_input_index): New function.
6533 (Sized_incremental_binary::Sized_incremental_binary): Remove
6534 file_status_; add input_objects_.
6535 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
6536 (Sized_incremental_binary::set_file_is_unchanged): Remove.
6537 (Sized_incremental_binary::file_is_unchanged): Remove.
6538 (Sized_incremental_binary::set_input_object): New function.
6539 (Sized_incremental_binary::input_object): New function.
6540 (Sized_incremental_binary::file_status_): Remove.
6541 (Sized_incremental_binary::input_objects_): New data member.
6542 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
6543 references.
6544 (Sized_relobj_incr::invalid_address): Move to base class.
6545 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
6546 class.
6547 (Sized_relobj_incr::do_output_section_offset): Likewise.
6548 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
6549 (Sized_relobj_incr::section_offsets_): Likewise.
6550 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
6551 function.
6552 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
6553 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
6554 with accessor function.
6555 (Sized_relobj_file::do_layout): Likewise.
6556 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
6557 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
6558 (Sized_relobj_file::compute_final_local_value): Replace refs to
6559 section_offsets_ with accessor function.
6560 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
6561 * object.h (Relobj::Relobj): Initialize new data members.
6562 (Relobj::add_dyn_reloc): New function.
6563 (Relobj::first_dyn_reloc): New function.
6564 (Relobj::dyn_reloc_count): New function.
6565 (Relobj::first_dyn_reloc_): New data member.
6566 (Relobj::dyn_reloc_count_): New data member.
6567 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
6568 references.
6569 (Sized_relobj::Address): New typedef.
6570 (Sized_relobj::invalid_address): Move here from child class.
6571 (Sized_relobj::Sized_relobj): Initialize new data members.
6572 (Sized_relobj::sized_relobj): New function.
6573 (Sized_relobj::is_output_section_offset_invalid): Move here from
6574 child class.
6575 (Sized_relobj::get_output_section_offset): Likewise.
6576 (Sized_relobj::local_has_got_offset): Likewise.
6577 (Sized_relobj::local_got_offset): Likewise.
6578 (Sized_relobj::set_local_got_offset): Likewise.
6579 (Sized_relobj::do_for_all_local_got_entries): Likewise.
6580 (Sized_relobj::clear_got_offsets): New function.
6581 (Sized_relobj::section_offsets): Move here from child class.
6582 (Sized_relobj::do_output_section_offset): Likewise.
6583 (Sized_relobj::do_set_section_offset): Likewise.
6584 (Sized_relobj::Local_got_offsets): Likewise.
6585 (Sized_relobj::local_got_offsets_): Likewise.
6586 (Sized_relobj::section_offsets_): Likewise.
6587 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
6588 references.
6589 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
6590 class.
6591 (Sized_relobj_file::sized_relobj): New function
6592 (Sized_relobj_file::local_has_got_offset): Move to base class.
6593 (Sized_relobj_file::local_got_offset): Likewise.
6594 (Sized_relobj_file::set_local_got_offset): Likewise.
6595 (Sized_relobj_file::get_output_section_offset): Likewise.
6596 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
6597 (Sized_relobj_file::do_output_section_offset): Likewise.
6598 (Sized_relobj_file::do_set_section_offset): Likewise.
6599 (Sized_relobj_file::Local_got_offsets): Likewise.
6600 (Sized_relobj_file::local_got_offsets_): Likewise.
6601 (Sized_relobj_file::section_offsets_): Likewise.
6602 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
6603 (all constructors).
6604 (set_needs_dynsym_index): Convert relobj to derived class pointer.
6605 (Output_reloc::get_symbol_index): Likewise.
6606 (Output_reloc::local_section_offset): Likewise.
6607 (Output_reloc::get_address): Likewise.
6608 (Output_reloc::symbol_value): Likewise.
6609 (Output_data_got::reserve_slot): Move to class definition.
6610 (Output_data_got::reserve_local): New function.
6611 (Output_data_got::reserve_slot_for_global): Remove.
6612 (Output_data_got::reserve_global): New function.
6613 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
6614 (all constructors, two instantiations).
6615 (Output_reloc::get_relobj): New function (two instantiations).
6616 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
6617 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
6618 (Output_data_reloc::add_global): Adjust type of relobj.
6619 (Output_data_reloc::add_global_relative): Likewise.
6620 (Output_data_reloc::add_symbolless_global_addend): Likewise.
6621 (Output_data_reloc::add_local): Likewise.
6622 (Output_data_reloc::add_local_relative): Likewise.
6623 (Output_data_reloc::add_symbolless_local_addend): Likewise.
6624 (Output_data_reloc::add_local_section): Likewise.
6625 (Output_data_reloc::add_output_section): Likewise.
6626 (Output_data_reloc::add_absolute): Likewise.
6627 (Output_data_reloc::add_target_specific): Likewise.
6628 (Output_data_got::reserve_slot): Move definition here.
6629 (Output_data_got::reserve_local): New function.
6630 (Output_data_got::reserve_global): New function.
6631 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
6632 section_offsets_ with accessor function.
6633 (Sized_relobj_file::write_sections): Likewise.
6634 (Sized_relobj_file::do_relocate_sections): Likewise.
6635 * target.h (Sized_target::reserve_local_got_entry): New function.
6636 (Sized_target::reserve_global_got_entry): New function.
6637 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
6638 (Target_x86_64::reserve_global_got_entry): New function.
6639 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
6640
4829d394
CC
66412011-05-23 Cary Coutant <ccoutant@google.com>
6642
6643 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
6644 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
6645 bit when checking got_type.
6646 * incremental.cc (Sized_incremental_binary::setup_readers):
6647 Store symbol table and string table locations; initialize bit vector
6648 of file status flags.
6649 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
6650 unchanged files.
6651 (Sized_incremental_binary::do_process_got_plt): New function.
6652 (Sized_incremental_binary::get_symtab_view): Use stored locations.
6653 (Output_section_incremental_inputs::set_final_data_size): Record
6654 file index for each input file.
6655 (Output_section_incremental_inputs::write_got_plt): Store file index
6656 instead of input entry offset for each GOT entry.
6657 * incremental.h
6658 (Incremental_input_entry::Incremental_input_entry): Initialize new
6659 data member.
6660 (Incremental_input_entry::set_offset): Store file index.
6661 (Incremental_input_entry::get_file_index): New function.
6662 (Incremental_input_entry::file_index_): New data member.
6663 (Incremental_binary::process_got_plt): New function.
6664 (Incremental_binary::do_process_got_plt): New function.
6665 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6666 data members.
6667 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
6668 (Sized_incremental_binary::set_file_is_unchanged): New function.
6669 (Sized_incremental_binary::file_is_unchanged): New function.
6670 (Sized_incremental_binary::do_process_got_plt): New function.
6671 (Sized_incremental_binary::file_status_): New data member.
6672 (Sized_incremental_binary::main_symtab_loc_): New data member.
6673 (Sized_incremental_binary::main_strtab_loc_): New data member.
6674 * output.cc (Output_data_got::Got_entry::write): Add case
6675 RESERVED_CODE.
6676 (Output_data_got::add_global): Call add_got_entry.
6677 (Output_data_got::add_global_plt): Likewise.
6678 (Output_data_got::add_global_with_rel): Likewise.
6679 (Output_data_got::add_global_with_rela): Likewise.
6680 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
6681 (Output_data_got::add_global_pair_with_rela): Likewise.
6682 (Output_data_got::add_local): Call add_got_entry.
6683 (Output_data_got::add_local_plt): Likewise.
6684 (Output_data_got::add_local_with_rel): Likewise.
6685 (Output_data_got::add_local_with_rela): Likewise.
6686 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
6687 (Output_data_got::add_local_pair_with_rela): Likewise.
6688 (Output_data_got::reserve_slot): New function.
6689 (Output_data_got::reserve_slot_for_global): New function.
6690 (Output_data_got::add_got_entry): New function.
6691 (Output_data_got::add_got_entry_pair): New function.
6692 (Output_section::add_output_section_data): Edit FIXME.
6693 * output.h
6694 (Output_section_data_build::Output_section_data_build): New
6695 constructor with size parameter.
6696 (Output_data_space::Output_data_space): Likewise.
6697 (Output_data_got::Output_data_got): Initialize new data member; new
6698 constructor with size parameter.
6699 (Output_data_got::add_constant): Call add_got_entry.
6700 (Output_data_got::reserve_slot): New function.
6701 (Output_data_got::reserve_slot_for_global): New function.
6702 (class Output_data_got::Got_entry): Add RESERVED_CODE.
6703 (Output_data_got::add_got_entry): New function.
6704 (Output_data_got::add_got_entry_pair): New function.
6705 (Output_data_got::free_list_): New data member.
6706 * target.h (Sized_target::init_got_plt_for_update): New function.
6707 (Sized_target::register_global_plt_entry): New function.
6708 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
6709 Initialize new data member; call init; add constructor with PLT count.
6710 (Output_data_plt_x86_64::init): New function.
6711 (Output_data_plt_x86_64::add_relocation): New function.
6712 (Output_data_plt_x86_64::reserve_slot): New function.
6713 (Output_data_plt_x86_64::free_list_): New data member.
6714 (Target_x86_64::init_got_plt_for_update): New function.
6715 (Target_x86_64::register_global_plt_entry): New function.
6716 (Output_data_plt_x86_64::add_entry): Allocate from free list for
6717 incremental updates.
6718 (Output_data_plt_x86_64::add_relocation): New function.
6719 * testsuite/object_unittest.cc (Object_test): Set default options.
6720
ec69d6da
ILT
67212011-05-16 Ian Lance Taylor <iant@google.com>
6722
6723 * options.h (class General_options): Make -i a synonym for -r.
6724
732e31de
ILT
67252011-05-16 Ian Lance Taylor <iant@google.com>
6726
6727 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
6728
403676b5
CC
67292011-05-10 Cary Coutant <ccoutant@google.com>
6730
6731 * object.cc (Sized_relobj::do_count_local_symbols): Check for
6732 strip_all (-s).
6733
5b7b7d6e
ILT
67342011-05-06 Ian Lance Taylor <iant@google.com>
6735
6736 * layout.cc (Layout::layout): If the output section flags change,
6737 update the ordering.
6738
f0f9babf
CC
67392011-04-25 Cary Coutant <ccoutant@google.com>
6740
6741 * incremental-dump.cc (dump_incremental_inputs): Print local
6742 symbol info for each input file.
6743 * incremental.cc
6744 (Output_section_incremental_inputs::set_final_data_size): Add local
6745 symbol info to input file entries in incremental info.
6746 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6747 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
6748 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
6749 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
6750 implementation.
6751 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
6752 (Sized_incr_relobj::do_relocate): Write the local symbols.
6753 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
6754 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
6755 Adjust size of input file header.
6756 (Incremental_inputs_reader::get_local_symbol_offset): New function.
6757 (Incremental_inputs_reader::get_local_symbol_count): New function.
6758 (Incremental_inputs_reader::get_input_section): Adjust size of input
6759 file header.
6760 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
6761 (Sized_incr_relobj::This): New typedef.
6762 (Sized_incr_relobj::sym_size): New const data member.
6763 (Sized_incr_relobj::Local_symbol): New struct.
6764 (Sized_incr_relobj::do_output_local_symbol_count): New function.
6765 (Sized_incr_relobj::do_local_symbol_offset): New function.
6766 (Sized_incr_relobj::local_symbol_count_): New data member.
6767 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
6768 (Sized_incr_relobj::local_symbol_index_): New data member.
6769 (Sized_incr_relobj::local_symbol_offset_): New data member.
6770 (Sized_incr_relobj::local_dynsym_offset_): New data member.
6771 (Sized_incr_relobj::local_symbols_): New data member.
6772 * object.h (Relobj::output_local_symbol_count): New function.
6773 (Relobj::local_symbol_offset): New function.
6774 (Relobj::do_output_local_symbol_count): New function.
6775 (Relobj::do_local_symbol_offset): New function.
6776 (Sized_relobj::do_output_local_symbol_count): New function.
6777 (Sized_relobj::do_local_symbol_offset): New function.
6778
d0a9ace3
ILT
67792011-04-22 Vladimir Simonov <sv@sw.ru>
6780
6781 * descriptors.cc (set_close_on_exec): New function.
6782 (Descriptors::open): Use set_close_on_exec.
6783 * output.cc (S_ISLNK): Define if not defined.
6784
94a3fc8b
CC
67852011-04-22 Cary Coutant <ccoutant@google.com>
6786
6787 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6788 global symbol map.
6789 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6790 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
6791 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
6792 relocations.
6793 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
6794 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
6795 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
6796 * incremental.h
6797 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
6798 function.
6799 (Incremental_binary::apply_incremental_relocs): New function.
6800 (Incremental_binary::do_apply_incremental_relocs): New function.
6801 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6802 data member.
6803 (Sized_incremental_binary::add_global_symbol): New function.
6804 (Sized_incremental_binary::global_symbol): New function.
6805 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6806 (Sized_incremental_binary::symbol_map_): New data member.
6807 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
6808 * target.h (Sized_target::apply_relocation): New function.
6809 * target-reloc.h (apply_relocation): New function.
6810 * x86_64.cc (Target_x86_64::apply_relocation): New function.
6811
c87e4302
DK
68122011-04-22 Doug Kwan <dougkwan@google.com>
6813
6814 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
6815 flag of a SHT_ARM_EXIDX section.
2e702c99 6816 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
6817 * testsuite/Makefile.in: Regenerate.
6818 * testsuite/arm_exidx_test.s: New file.
6819 * testsuite/arm_exidx_test.sh: Same.
6820
e7782cf6
CC
68212011-04-20 Cary Coutant <ccoutant@google.com>
6822
6823 PR gold/12689
6824 * archive.h (Incremental_archive_entry::Archive_member):
6825 Initialize arg_serial_ (second constructor).
6826
308ecdc7
ILT
68272011-04-17 Ian Lance Taylor <iant@google.com>
6828
6829 * object.cc (Relocate_info::location): Simplify location string.
6830 * errors.cc (Errors::error_at_location): Don't print program
6831 name.
6832 (Errors::warning_at_location): Likewise.
6833 (Errors::undefined_symbol): Likewise.
6834 * testsuite/debug_msg.sh: Update accordingly.
6835
bec5b579
CC
68362011-04-14 Cary Coutant <ccoutant@google.com>
6837
6838 * gold/layout.cc (Layout::symtab_section_offset): New function.
6839 * gold/layout.h (Layout::symtab_section_offset): New function.
6840 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
6841
88597d34
ILT
68422011-04-12 Ian Lance Taylor <iant@google.com>
6843
6844 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
6845 with MREMAP_MAYMOVE.
6846 * output.h (class Output_file): Add map_is_allocated_ field.
6847 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
6848 not available, provide stubs. If mremap is not available, #define
6849 it to gold_mremap.
6850 (MREMAP_MAYMOVE): Define if not defined.
6851 (Output_file::Output_file): Initialize map_is_allocated_.
6852 (Output_file::resize): Check map_is_allocated_.
6853 (Output_file::map_anonymous): If mmap fails, use malloc.
6854 (Output_file::unmap): Don't do anything for an anonymous map.
6855 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
6856 is not available, provide stubs.
6857 (File_read::View::~View): Use free rather than delete[].
6858 (File_read::make_view): Use malloc rather than new[]. If mmap
6859 fails, use malloc.
6860 (File_read::find_or_make_view): Use malloc rather than new[].
6861 * gold.h: Remove HAVE_REMAP code.
6862 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
6863 exists. Rename mremap to gold_mremap. If mmap is not available
6864 don't do anything.
6865 * configure, config.in: Rebuild.
6866
11e361bc
ILT
68672011-04-11 Ian Lance Taylor <iant@google.com>
6868
6869 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
6870 initialize local variable v.
6871
cdc29364
CC
68722011-04-11 Cary Coutant <ccoutant@google.com>
6873
6874 * archive.cc (Archive::include_member): Adjust call to
6875 report_object.
6876 (Add_archive_symbols::run): Track argument serial numbers.
6877 (Lib_group::include_member): Likewise.
6878 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
6879 * archive.h (Incremental_archive_entry::Archive_member):
6880 Initialize arg_serial_.
6881 (Archive_member::arg_serial_): New data member.
6882 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
6883 (Sized_dynobj::do_add_symbols): Track symbols when doing an
6884 incremental link.
6885 (Sized_dynobj::do_for_all_local_got_entries): New function.
6886 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
6887 function.
6888 * fileread.cc (get_mtime): New function.
6889 * fileread.h (get_mtime): New function.
6890 * gold.cc (queue_initial_tasks): Check for incremental update.
6891 (process_incremental_input): New function.
6892 (queue_middle_tasks): Don't force valid target for incremental
6893 update.
6894 * incremental-dump.cc (find_input_containing_global): Adjust
6895 size of symbol info entry.
6896 (dump_incremental_inputs): Dump argument serial number and
6897 in_system_directory flag; bias shndx by 1; print symbol names
6898 when dumping per-file symbol lists; use new symbol info readers.
6899 * incremental.cc
6900 (Output_section_incremental_inputs:update_data_size): New function.
6901 (Sized_incremental_binary::setup_readers): Setup input readers
6902 for each input file; build maps for files added from libraries
6903 and scripts.
6904 (Sized_incremental_binary::check_input_args): New function.
6905 (Sized_incremental_binary::do_check_inputs): Build map of argument
6906 serial numbers to input arguments.
6907 (Sized_incremental_binary::do_file_has_changed): Rename
6908 do_file_is_unchanged to this; compare file modification times.
6909 (Sized_incremental_binary::do_init_layout): New function.
6910 (Sized_incremental_binary::do_reserve_layout): New function.
6911 (Sized_incremental_binary::do_get_input_reader): Remove.
6912 (Sized_incremental_binary::get_symtab_view): New function.
6913 (Incremental_checker::can_incrementally_link_output_file): Remove.
6914 (Incremental_inputs::report_command_line): Exclude --debug options.
6915 (Incremental_inputs::report_archive_begin): Add parameter; track
6916 argument serial numbers; don't put input file entry for archive
6917 before archive members.
6918 (Incremental_inputs::report_archive_end): Put input file entry
6919 for archive after archive members.
6920 (Incremental_inputs::report_object): Add parameter; track argument
6921 serial numbers and in_system_directory flag.
6922 (Incremental_inputs::report_script): Add parameter; track argument
6923 serial numbers.
6924 (Output_section_incremental_inputs::set_final_data_size): Adjust
6925 size of symbol info entry; check for forwarding symbols.
6926 (Output_section_incremental_inputs::write_input_files): Write
6927 in_system_directory flag and argument serial number.
6928 (Output_section_incremental_inputs::write_info_blocks): Map section
6929 indices between incremental info and original input file; store
6930 input section index for each symbol.
6931 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
6932 change operator() to visit().
6933 (class Global_got_offset_visitor): Likewise.
6934 (class Global_symbol_visitor_got_plt):
6935 (Output_section_incremental_inputs::write_got_plt): Use new visitor
6936 classes.
6937 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
6938 (Sized_incr_relobj::do_read_symbols): New function.
6939 (Sized_incr_relobj::do_layout): New function.
6940 (Sized_incr_relobj::do_layout_deferred_sections): New function.
6941 (Sized_incr_relobj::do_add_symbols): New function.
6942 (Sized_incr_relobj::do_should_include_member): New function.
6943 (Sized_incr_relobj::do_for_all_global_symbols): New function.
6944 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
6945 (Sized_incr_relobj::do_section_size): New function.
6946 (Sized_incr_relobj::do_section_name): New function.
6947 (Sized_incr_relobj::do_section_contents): New function.
6948 (Sized_incr_relobj::do_section_flags): New function.
6949 (Sized_incr_relobj::do_section_entsize): New function.
6950 (Sized_incr_relobj::do_section_address): New function.
6951 (Sized_incr_relobj::do_section_type): New function.
6952 (Sized_incr_relobj::do_section_link): New function.
6953 (Sized_incr_relobj::do_section_info): New function.
6954 (Sized_incr_relobj::do_section_addralign): New function.
6955 (Sized_incr_relobj::do_initialize_xindex): New function.
6956 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
6957 (Sized_incr_relobj::do_read_relocs): New function.
6958 (Sized_incr_relobj::do_gc_process_relocs): New function.
6959 (Sized_incr_relobj::do_scan_relocs): New function.
6960 (Sized_incr_relobj::do_count_local_symbols): New function.
6961 (Sized_incr_relobj::do_finalize_local_symbols): New function.
6962 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
6963 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
6964 (Sized_incr_relobj::do_relocate): New function.
6965 (Sized_incr_relobj::do_set_section_offset): New function.
6966 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
6967 (Sized_incr_dynobj::do_read_symbols): New function.
6968 (Sized_incr_dynobj::do_layout): New function.
6969 (Sized_incr_dynobj::do_add_symbols): New function.
6970 (Sized_incr_dynobj::do_should_include_member): New function.
6971 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
6972 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
6973 (Sized_incr_dynobj::do_section_size): New function.
6974 (Sized_incr_dynobj::do_section_name): New function.
6975 (Sized_incr_dynobj::do_section_contents): New function.
6976 (Sized_incr_dynobj::do_section_flags): New function.
6977 (Sized_incr_dynobj::do_section_entsize): New function.
6978 (Sized_incr_dynobj::do_section_address): New function.
6979 (Sized_incr_dynobj::do_section_type): New function.
6980 (Sized_incr_dynobj::do_section_link): New function.
6981 (Sized_incr_dynobj::do_section_info): New function.
6982 (Sized_incr_dynobj::do_section_addralign): New function.
6983 (Sized_incr_dynobj::do_initialize_xindex): New function.
6984 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
6985 (make_sized_incremental_object): New function.
6986 (Incremental_library::copy_unused_symbols): New function.
6987 (Incremental_library::do_for_all_unused_symbols): New function.
6988 * incremental.h (enum Incremental_input_flags): New type.
6989 (class Incremental_checker): Remove.
6990 (Incremental_input_entry::Incremental_input_entry): Add argument
6991 serial number.
6992 (Incremental_input_entry::arg_serial): New function.
6993 (Incremental_input_entry::set_is_in_system_directory): New function.
6994 (Incremental_input_entry::is_in_system_directory): New function.
6995 (Incremental_input_entry::arg_serial_): New data member.
6996 (Incremental_input_entry::is_in_system_directory_): New data member.
6997 (class Script_info): Move here from script.h.
6998 (Script_info::Script_info): Add filename parameter.
6999 (Script_info::filename): New function.
7000 (Script_info::filename_): New data member.
7001 (Incremental_script_entry::Incremental_script_entry): Add argument
7002 serial number.
7003 (Incremental_object_entry::Incremental_object_entry): Likewise.
7004 (Incremental_object_entry::add_input_section): Build list of input
7005 sections with map to original shndx.
7006 (Incremental_object_entry::get_input_section_index): New function.
7007 (Incremental_object_entry::shndx_): New data member.
7008 (Incremental_object_entry::name_key_): Rename; adjust all refs.
7009 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
7010 (Incremental_archive_entry::Incremental_archive_entry): Add argument
7011 serial number.
7012 (Incremental_inputs::report_archive_begin): Likewise.
7013 (Incremental_inputs::report_object): Likewise.
7014 (Incremental_inputs::report_script): Likewise.
7015 (class Incremental_global_symbol_reader): New class.
7016 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
7017 and store flags and input file type.
7018 (Incremental_input_entry_reader::arg_serial): New function.
7019 (Incremental_input_entry_reader::type): Extract type from flags.
7020 (Incremental_input_entry_reader::is_in_system_directory): New function.
7021 (Incremental_input_entry_reader::get_input_section_count): Call
7022 accessor function for type.
7023 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
7024 function for type; adjust size of global symbol entry.
7025 (Incremental_input_entry_reader::get_global_symbol_count): Call
7026 accessor function for type.
7027 (Incremental_input_entry_reader::get_object_count): Likewise.
7028 (Incremental_input_entry_reader::get_object_offset): Likewise.
7029 (Incremental_input_entry_reader::get_member_count): Likewise.
7030 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
7031 (Incremental_input_entry_reader::get_member_offset): Likewise.
7032 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
7033 (Incremental_input_entry_reader::Global_symbol_info): Remove.
7034 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
7035 (Incremental_input_entry_reader::get_global_symbol_reader): New
7036 function.
7037 (Incremental_input_entry_reader::get_output_symbol_index): New
7038 function.
7039 (Incremental_input_entry_reader::type_): Remove.
7040 (Incremental_input_entry_reader::flags_): New data member.
7041 (Incremental_inputs_reader::input_file_offset): New function.
7042 (Incremental_inputs_reader::input_file_index): New function.
7043 (Incremental_inputs_reader::input_file): Call input_file_offset.
7044 (Incremental_inputs_reader::input_file_at_offset): New function.
7045 (Incremental_relocs_reader::get_r_type): Reformat.
7046 (Incremental_relocs_reader::get_r_shndx): Reformat.
7047 (Incremental_relocs_reader::get_r_offset): Reformat.
7048 (Incremental_relocs_reader::data): New function.
7049 (Incremental_binary::Incremental_binary): Initialize new data members.
7050 (Incremental_binary::check_inputs): Add cmdline parameter.
7051 (Incremental_binary::file_is_unchanged): Remove.
7052 (Input_reader::arg_serial): New function.
7053 (Input_reader::get_unused_symbol_count): New function.
7054 (Input_reader::get_unused_symbol): New function.
7055 (Input_reader::do_arg_serial): New function.
7056 (Input_reader::do_get_unused_symbol_count): New function.
7057 (Input_reader::do_get_unused_symbol): New function.
7058 (Incremental_binary::input_file_count): New function.
7059 (Incremental_binary::get_input_reader): Change signature to use
7060 index instead of filename.
7061 (Incremental_binary::file_has_changed): New function.
7062 (Incremental_binary::get_input_argument): New function.
7063 (Incremental_binary::get_library): New function.
7064 (Incremental_binary::get_script_info): New function.
7065 (Incremental_binary::init_layout): New function.
7066 (Incremental_binary::reserve_layout): New function.
7067 (Incremental_binary::output_file): New function.
7068 (Incremental_binary::do_check_inputs): New function.
7069 (Incremental_binary::do_file_is_unchanged): Remove.
7070 (Incremental_binary::do_file_has_changed): New function.
7071 (Incremental_binary::do_init_layout): New function.
7072 (Incremental_binary::do_reserve_layout): New function.
7073 (Incremental_binary::do_input_file_count): New function.
7074 (Incremental_binary::do_get_input_reader): Change signature.
7075 (Incremental_binary::input_args_map_): New data member.
7076 (Incremental_binary::library_map_): New data member.
7077 (Incremental_binary::script_map_): New data member.
7078 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7079 new data members.
7080 (Sized_incremental_binary::output_section): New function.
7081 (Sized_incremental_binary::inputs_reader): Add const.
7082 (Sized_incremental_binary::symtab_reader): Add const.
7083 (Sized_incremental_binary::relocs_reader): Add const.
7084 (Sized_incremental_binary::got_plt_reader): Add const.
7085 (Sized_incremental_binary::get_symtab_view): New function.
7086 (Sized_incremental_binary::Inputs_reader): New typedef.
7087 (Sized_incremental_binary::Input_entry_reader): New typedef.
7088 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
7089 (Sized_incremental_binary::do_file_is_unchanged): Remove.
7090 (Sized_incremental_binary::do_file_has_changed): New function.
7091 (Sized_incremental_binary::do_init_layout): New function.
7092 (Sized_incremental_binary::do_reserve_layout): New function.
7093 (Sized_input_reader::Inputs_reader): Remove.
7094 (Sized_input_reader::Input_entry_reader): Remove.
7095 (Sized_input_reader::do_arg_serial): New function.
7096 (Sized_input_reader::do_get_unused_symbol_count): New function.
7097 (Sized_input_reader::do_get_unused_symbol): New function.
7098 (Sized_incremental_binary::do_input_file_count): New function.
7099 (Sized_incremental_binary::do_get_input_reader): Change signature;
7100 use index instead of filename.
7101 (Sized_incremental_binary::section_map_): New data member.
7102 (Sized_incremental_binary::input_entry_readers_): New data member.
7103 (class Sized_incr_relobj): New class.
7104 (class Sized_incr_dynobj): New class.
7105 (make_sized_incremental_object): New function.
7106 (class Incremental_library): New class.
7107 * layout.cc (Free_list::num_lists): New static data member.
7108 (Free_list::num_nodes): New static data member.
7109 (Free_list::num_removes): New static data member.
7110 (Free_list::num_remove_visits): New static data member.
7111 (Free_list::num_allocates): New static data member.
7112 (Free_list::num_allocate_visits): New static data member.
7113 (Free_list::init): New function.
7114 (Free_list::remove): New function.
7115 (Free_list::allocate): New function.
7116 (Free_list::dump): New function.
7117 (Free_list::print_stats): New function.
7118 (Layout_task_runner::run): Resize output file for incremental updates.
7119 (Layout::Layout): Initialize new data members.
7120 (Layout::set_incremental_base): New function.
7121 (Layout::init_fixed_output_section): New function.
7122 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
7123 incremental updates.
7124 (Layout::create_gold_note): Do not create gold note section for
7125 incremental updates.
7126 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
7127 for incremental updates.
7128 (Layout::set_section_offsets): For incremental updates, allocate space
7129 from free list.
7130 (Layout::create_symtab_sections): Layout with offsets relative to
7131 start of section; for incremental updates, allocate space from free
7132 list.
7133 (Layout::create_shdrs): For incremental updates, allocate space from
7134 free list.
7135 (Layout::finish_dynamic_section): For incremental updates, do not
7136 check --as-needed (fixed in subsequent patch).
7137 * layout.h (class Free_list): New class.
7138 (Layout::set_incremental_base): New function.
7139 (Layout::incremental_base): New function.
7140 (Layout::init_fixed_output_section): New function.
7141 (Layout::allocate): New function.
7142 (Layout::incremental_base_): New data member.
7143 (Layout::free_list_): New data member.
7144 * main.cc (main): Print Free_list statistics.
7145 * object.cc (Relobj::finalize_incremental_relocs): Add
7146 clear_counts parameter; clear counts only when clear_counts is set.
7147 (Sized_relobj::Sized_relobj): Initialize new base class.
7148 (Sized_relobj::do_layout): Don't report special sections.
7149 (Sized_relobj::do_for_all_local_got_entries): New function.
7150 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
7151 symtab_off to all symbol table offsets.
7152 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
7153 * object.h (class Got_offset_list): Move to top of file.
7154 (Object::Object): Allow case where input_file == NULL.
7155 (Object::~Object): Likewise.
7156 (Object::input_file): Assert that input_file != NULL.
7157 (Object::lock): Allow case where input_file == NULL.
7158 (Object::unlock): Likewise.
7159 (Object::is_locked): Likewise.
7160 (Object::token): Likewise.
7161 (Object::release): Likewise.
7162 (Object::is_incremental): New function.
7163 (Object::get_mtime): New function.
7164 (Object::for_all_local_got_entries): New function.
7165 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
7166 (Object::set_is_in_system_directory): New function.
7167 (Object::is_in_system_directory): New function.
7168 (Object::do_is_incremental): New function.
7169 (Object::do_get_mtime): New function.
7170 (Object::do_for_all_local_got_entries): New function.
7171 (Object::is_in_system_directory_): New data member.
7172 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
7173 (class Sized_relobj_base): New class.
7174 (class Sized_relobj): Derive from Sized_relobj_base.
7175 (class Sized_relobj::Symbols): Redeclare from base class.
7176 (class Sized_relobj::local_got_offset_list): Remove.
7177 (class Sized_relobj::Output_sections): Redeclare from base class.
7178 (class Sized_relobj::do_for_all_local_got_entries): New function.
7179 (class Sized_relobj::write_local_symbols): Add offset parameter.
7180 (class Sized_relobj::local_symbol_offset_): Update comment.
7181 (class Sized_relobj::local_dynsym_offset_): Update comment.
7182 * options.cc (Input_arguments::add_file): Remove const.
7183 * options.h (Input_file_argument::Input_file_argument):
7184 Initialize arg_serial_ (all constructors).
7185 (Input_file_argument::set_arg_serial): New function.
7186 (Input_file_argument::arg_serial): New function.
7187 (Input_file_argument::arg_serial_): New data member.
7188 (Input_arguments::Input_arguments): Initialize file_count_.
7189 (Input_arguments::add_file): Remove const.
7190 (Input_arguments::number_of_input_files): New function.
7191 (Input_arguments::file_count_): New data member.
7192 (Command_line::number_of_input_files): Call
7193 Input_arguments::number_of_input_files.
7194 * output.cc (Output_segment_headers::Output_segment_headers):
7195 Set current size.
7196 (Output_section::Input_section::current_data_size): New function.
7197 (Output_section::Output_section): Initialize new data members.
7198 (Output_section::add_input_section): Don't do merge sections for
7199 an incremental link; allocate space from free list for an
7200 incremental update.
7201 (Output_section::add_output_section_data): Allocate space from
7202 free list for an incremental update.
7203 (Output_section::update_data_size): New function.
7204 (Output_section::set_fixed_layout): New function.
7205 (Output_section::reserve): New function.
7206 (Output_segment::set_section_addresses): Remove const.
7207 (Output_segment::set_section_list_addresses): Remove const; allocate
7208 space from free list for an incremental update.
7209 (Output_segment::set_offset): Adjust size of RELRO segment for an
7210 incremental update.
7211 * output.h (Output_data::current_data_size): Move here from
7212 child classes.
7213 (Output_data::pre_finalize_data_size): New function.
7214 (Output_data::update_data_size): New function.
7215 (Output_section_headers::update_data_size): new function.
7216 (Output_section_data_build::current_data_size): Move to Output_data.
7217 (Output_data_strtab::update_data_size): New function.
7218 (Output_section::current_data_size): Move to Output_data.
7219 (Output_section::set_fixed_layout): New function.
7220 (Output_section::has_fixed_layout): New function.
7221 (Output_section::reserve): New function.
7222 (Output_section::update_data_size): New function.
7223 (Output_section::has_fixed_layout_): New data member.
7224 (Output_section::free_list_): New data member.
7225 (Output_segment::set_section_addresses): Remove const.
7226 (Output_segment::set_section_list_addresses): Remove const.
7227 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
7228 New function.
7229 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
7230 New function.
7231 * readsyms.cc (Read_symbols::do_read_symbols): Add library
7232 parameter when calling Add_symbols constructor; store argument
7233 serial number for members of a lib group.
7234 (Add_symbols::locks): Allow case where token == NULL.
7235 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
7236 (Read_member::~Read_member): New function.
7237 (Read_member::is_runnable): New function.
7238 (Read_member::locks): New function.
7239 (Read_member::run): New function.
7240 (Check_script::~Check_script): New function.
7241 (Check_script::is_runnable): New function.
7242 (Check_script::locks): New function.
7243 (Check_script::run): New function.
7244 (Check_library::~Check_library): New function.
7245 (Check_library::is_runnable): New function.
7246 (Check_library::locks): New function.
7247 (Check_library::run): New function.
7248 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
7249 (Add_symbols::library_): New data member.
7250 (class Read_member): New class.
7251 (class Check_script): New class.
7252 (class Check_library): New class.
7253 * reloc.cc (Read_relocs::is_runnable): Allow case where
7254 token == NULL.
7255 (Read_relocs::locks): Likewise.
7256 (Scan_relocs::locks): Likewise.
7257 (Relocate_task::locks): Likewise.
7258 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
7259 to clear counters.
7260 (Sized_relobj::incremental_relocs_scan): Fix comment.
7261 (Sized_relobj::do_relocate): Pass output file offset to
7262 write_local_symbols.
7263 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
7264 from class declaration.
7265 * script.cc (read_input_script): Allocate Script_info; pass
7266 argument serial number to report_script.
7267 * script.h (class Script_info): Move to incremental.h.
7268 * symtab.cc (Symbol_table::add_from_incrobj): New function.
7269 * symtab.h (Symbol_table::add_from_incrobj): New function.
7270 (Symbol_table::set_file_offset): New function.
7271
b961d0d7
CC
72722011-04-05 Cary Coutant <ccoutant@google.com>
7273
7274 * incremental-dump.cc (dump_incremental_inputs): Change signature
7275 to take a Sized_incremental_binary; change caller. Use readers
7276 in Sized_incremental_binary.
7277 * incremental.cc
7278 (Sized_incremental_binary::find_incremental_inputs_sections):
7279 Rename do_find_incremental_inputs_sections to this.
7280 (Sized_incremental_binary::setup_readers): New function.
7281 (Sized_incremental_binary::do_check_inputs): Check
7282 has_incremental_info_ flag; move setup code to setup_readers;
7283 use input readers.
7284 (Sized_incremental_binary::do_file_is_unchanged): New function.
7285 (Sized_incremental_binary::do_get_input_reader): New function.
7286 * incremental.h (class Incremental_binary): Move to end of file.
7287 (Incremental_binary::file_is_unchanged): New function.
7288 (Incremental_binary::do_file_is_unchanged): New function.
7289 (Incremental_binary::Input_reader): New class.
7290 (Incremental_binary::get_input_reader): New function.
7291 (class Sized_incremental_binary): Move to end of file.
7292 (Sized_incremental_binary::Sized_incremental_binary): Setup the
7293 input section reader classes.
7294 (Sized_incremental_binary::has_incremental_info): New function.
7295 (Sized_incremental_binary::inputs_reader): New function.
7296 (Sized_incremental_binary::symtab_reader): New function.
7297 (Sized_incremental_binary::relocs_reader): New function.
7298 (Sized_incremental_binary::got_plt_reader): New function.
7299 (Sized_incremental_binary::do_file_is_unchanged): New function.
7300 (Sized_incremental_binary::Sized_input_reader): New class.
7301 (Sized_incremental_binary::get_input_reader): New function.
7302 (Sized_incremental_binary::find_incremental_inputs_sections):
7303 Rename do_find_incremental_inputs_sections to this.
7304 (Sized_incremental_binary::setup_readers): New function.
7305 (Sized_incremental_binary::has_incremental_info_): New data member.
7306 (Sized_incremental_binary::inputs_reader_): New data member.
7307 (Sized_incremental_binary::symtab_reader_): New data member.
7308 (Sized_incremental_binary::relocs_reader_): New data member.
7309 (Sized_incremental_binary::got_plt_reader_): New data member.
7310 (Sized_incremental_binary::current_input_file_): New data member.
7311
a869183f
PP
73122011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
7313
7314 PR gold/12640
7315 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
7316 violation.
7317
73182011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
7319
7320 * archive.cc (Archive::include_member): Adjust call to report_object.
7321 (Add_archive_symbols::run): Add script_info to call to
7322 report_archive_begin.
7323 (Lib_group::include_member): Adjust call to report_object.
7324 (Add_lib_group_symbols::run): Adjust call to report_object.
7325 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
7326 blocks. Add object count for script input files.
7327 * incremental.cc (Incremental_inputs::report_archive_begin): Add
7328 script_info parameter; change all callers.
7329 (Incremental_inputs::report_object): Add script_info parameter;
7330 change all callers.
7331 (Incremental_inputs::report_script): Store backpointer to
7332 incremental info entry.
7333 (Output_section_incremental_inputs::set_final_data_size): Record
7334 additional information for scripts.
7335 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7336 * incremental.h (Incremental_script_entry::add_object): New function.
7337 (Incremental_script_entry::get_object_count): New function.
7338 (Incremental_script_entry::get_object): New function.
7339 (Incremental_script_entry::objects_): New data member; adjust
7340 constructor.
7341 (Incremental_inputs::report_archive_begin): Add script_info parameter.
7342 (Incremental_inputs::report_object): Add script_info parameter.
7343 (Incremental_inputs_reader::get_object_count): New function.
7344 (Incremental_inputs_reader::get_object_offset): New function.
7345 * options.cc (Input_arguments::add_file): Return reference to
7346 new input argument.
7347 * options.h (Input_argument::set_script_info): New function.
7348 (Input_argument::script_info): New function.
7349 (Input_argument::script_info_): New data member; adjust all
7350 constructors.
7351 (Input_file_group::add_file): Return reference to new input argument.
7352 (Input_file_lib::add_file): Likewise.
7353 (Input_arguments::add_file): Likewise.
7354 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
7355 * script.cc (Parser_closure::Parser_closure): Add script_info
7356 parameter; adjust all callers.
7357 (Parser_closure::script_info): New function.
7358 (Parser_closure::script_info_): New data member.
7359 (read_input_script): Report scripts earlier to incremental info.
7360 (script_add_file): Set script_info in Input_argument.
7361 (script_add_library): Likewise.
7362 * script.h (Script_options::Script_info): Rewrite class.
7363
a869183f 73642011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
7365
7366 * archive.cc (Library_base::should_include_member): Move
7367 method here from class Archive.
7368 (Archive::Archive): Initialize base class.
7369 (Archive::should_include_member): Move to base class.
7370 (Archive::do_for_all_unused_symbols): New function.
7371 (Add_archive_symbols::run): Remove redundant access to
7372 incremental_inputs.
7373 (Lib_group::Lib_group): Initialize base class.
7374 (Lib_group::do_filename): New function.
7375 (Lib_group::include_member): Pass pointer to Lib_group to
7376 report_object.
7377 (Lib_group::do_for_all_unused_symbols): New function.
7378 (Add_lib_group_symbols::run): Report archive information for
7379 incremental links.
7380 * archive.h (class Library_base): New base class.
7381 (class Archive): Derive from Library_base.
7382 (Archive::filename): Move to base class.
7383 (Archive::set_incremental_info): Likewise.
7384 (Archive::incremental_info): Likewise.
7385 (Archive::Should_include): Likewise.
7386 (Archive::should_include_member): Likewise.
7387 (Archive::Armap_entry): Remove.
7388 (Archive::Unused_symbol_iterator): Remove.
7389 (Archive::unused_symbols_begin): Remove.
7390 (Archive::unused_symbols_end): Remove.
7391 (Archive::do_filename): New function.
7392 (Archive::do_get_mtime): New function.
7393 (Archive::do_for_all_unused_symbols): New function.
7394 (Archive::task_): Move to base class.
7395 (Archive::incremental_info_): Likewise.
7396 (class Lib_group): Derive from Library_base.
7397 (Lib_group::do_filename): New function.
7398 (Lib_group::do_get_mtime): New function.
7399 (Lib_group::do_for_all_unused_symbols): New function.
7400 (Lib_group::task_): Move to base class.
7401 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
7402 function.
7403 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
7404 function.
7405 * incremental.cc (Incremental_inputs::report_archive_begin):
7406 Use Library_base; call library's get_mtime; add incremental inputs
7407 entry before members.
7408 (class Unused_symbol_visitor): New class.
7409 (Incremental_inputs::report_archive_end): Use Library_base; use
7410 visitor class to record unused symbols; don't add incremental inputs
7411 entry after members.
7412 (Incremental_inputs::report_object): Use Library_base.
7413 * incremental.h
7414 (Incremental_archive_entry::Incremental_archive_entry): Remove
7415 unused Archive parameter.
7416 (Incremental_inputs::report_archive_begin): Use Library_base.
7417 (Incremental_inputs::report_archive_end): Likewise.
7418 (Incremental_inputs::report_object): Likewise.
7419 * object.cc (Sized_relobj::do_for_all_global_symbols): New
7420 function.
7421 * object.h (Object::for_all_global_symbols): New function.
7422 (Object::do_for_all_global_symbols): New function.
7423 (Sized_relobj::do_for_all_global_symbols): New function.
7424 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
7425 function.
7426 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
7427 function.
7428
61ab3e40
ILT
74292011-03-27 Ian Lance Taylor <iant@google.com>
7430
7431 * archive.cc (Archive::interpret_header): Return -1 if something
7432 goes wrong. Change callers accordingly.
7433
30e1f9e6
CC
74342011-03-25 Cary Coutant <ccoutant@google.com>
7435
7436 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
7437 * testsuite/Makefile.in: Regenerate.
7438
9370ce59 74392011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
7440
7441 * plugin.cc (get_view): New.
7442 (Plugin::load): Pass get_view to the plugin.
7443 (Plugin_manager::get_view): New.
7444
9312bb0a
ILT
74452011-03-21 Ian Lance Taylor <iant@google.com>
7446
7447 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 7448 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 7449
7e12ba9e
ST
74502011-03-21 Sriraman Tallam <tmsriram@google.com>
7451
7452 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
7453 Change == to -eq.
7454 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
7455 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
7456 Change == to -eq.
7457 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
7458 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
7459
fd7a005d
ILT
74602011-03-14 Ian Lance Taylor <iant@google.com>
7461
7462 * script-sections.cc (Sort_output_sections::script_compare):
7463 Rename from is_before, change return type.
7464 (Sort_output_sections::operator()): Adjust accordingly.
7465
ed16fd1b
ILT
74662011-03-11 Jeffrey Yasskin <jyasskin@google.com>
7467
7468 PR gold/12572
7469 * testsuite/odr_violation2.cc: Add comment to make all error line
7470 numbers double digits.
7471 * testsuite/debug_msg.sh: Adjust expected errors.
7472
71ff8986
ILT
74732011-03-09 Jeffrey Yasskin <jyasskin@google.com>
7474
7475 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
7476 but mark earlier ones as non-canonical
7477 (offset_to_iterator): Update search target and example
7478 (do_addr2line): Return extra lines in a vector*
7479 (format_file_lineno): Extract from do_addr2line
7480 (one_addr2line): Add vector* out-param
7481 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
7482 when a lineno entry appeared last for its instruction
7483 (Dwarf_line_info): Add vector* out-param
7484 * object.cc (Relocate_info): Pass NULL for the vector* out-param
7485 * symtab.cc (Odr_violation_compare): Include the lineno in the
7486 comparison again.
7487 (linenos_from_loc): New. Combine the canonical line for an
7488 address with its other lines.
7489 (True_if_intersect): New. Helper functor to make
7490 std::set_intersection a query.
7491 (detect_odr_violations): Compare sets of lines instead of just
7492 one line for each function. This became less deterministic, but
7493 has fewer false positives.
7494 * symtab.h: Declarations.
7495 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
7496 mix an optimized and non-optimized object in the same binary
7497 (odr_violation2.so): Same.
7498 * testsuite/Makefile.in: Regenerate from Makefile.am.
7499 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
7500 * testsuite/debug_msg.sh: Update line numbers and add
7501 assertions.
7502 * testsuite/odr_violation1.cc: Use OdrDerived, in a
7503 non-optimized context.
7504 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
7505 isn't inlined, and use OdrDerived in an optimized context.
7506 * testsuite/odr_header1.h: Defines OdrDerived, where
7507 optimization will change the
7508 first-instruction-in-the-destructor's file and line number.
7509 * testsuite/odr_header2.h: Defines OdrBase.
7510
a19fefdc
ILT
75112011-03-09 Ian Lance Taylor <iant@google.com>
7512
7513 * fileread.cc (File_read::clear_views): Don't delete the whole
7514 file view.
7515
ecb351e9
ILT
75162011-03-08 Ian Lance Taylor <iant@google.com>
7517
7518 PR gold/12525
7519 * fileread.cc: #include <climits>.
7520 (GOLD_IOV_MAX): Define.
7521 (File_read::read_multiple): Limit number of entries by iov_max.
7522 * fileread.h (class File_read): Always set max_readv_entries to
7523 128.
7524
b821d13c
ILT
75252011-03-07 Ian Lance Taylor <iant@google.com>
7526
7527 PR gold/12525
7528 * options.h (class General_options): Add -dy and -dn.
7529
89243142
CC
75302011-03-02 Cary Coutant <ccoutant@google.com>
7531
7532 * testsuite/script_test_9.t: Add TLS segment.
7533
d0773f31
ILT
75342011-03-02 Simon Baldwin <simonb@google.com>
7535
7536 * configure.ac: Add check for gnu_indirect_function support in
7537 the toolchain building binutils.
7538 * configure: Rebuild.
7539
9370ce59 75402011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
7541
7542 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
7543 plugin only symbols.
7544 (Symbol_table::sized_finalize_symbol) Mark symbol only present
7545 in plugin files as not needed in the symbol table.
7546
4cf7a849
ST
75472011-02-11 Sriraman Tallam <tmsriram@google.com>
7548
7549 * output.cc (Output_section::add_input_section): Delay fill
7550 generation for section ordering.
7551
b578bd7d
ILT
75522011-02-09 Ian Lance Taylor <iant@google.com>
7553
7554 PR gold/12316
7555 * object.h (class Sized_relobj): Remove clear_local_symbols.
7556 * reloc.cc (Sized_relobj::do_relocate): Don't call
7557 clear_local_symbols.
7558
9370ce59 75592011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
7560
7561 * plugin.cc (is_visible_from_outside): Return true for symbols
7562 in the -u option.
7563
55382fb7
ILT
75642011-02-04 Jeffrey Yasskin <jyasskin@google.com>
7565
7566 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
7567 filename.
7568
4e271fff
ST
75692011-02-02 Sriraman Tallam <tmsriram@google.com>
7570
7571 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 7572 to std::string.
4e271fff 7573 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 7574 section_name to be std::string.
4e271fff
ST
7575 (is_function_ctor_or_dtor): Change type of parameter to std::string.
7576
d433c3ac
ILT
75772011-01-25 Ian Lance Taylor <iant@google.com>
7578
7579 * script.cc (script_add_extern): Rewrite to use
7580 add_symbol_reference.
7581
880473a6
DK
75822011-01-25 Doug Kwan <dougkwan@google.com>
7583
d433c3ac 7584 * icf.cc (get_section_contents): Always lock section's object.
880473a6 7585
f30f86fa
ILT
75862011-01-24 Ian Lance Taylor <iant@google.com>
7587
7588 * options.h (class General_options): Accept
7589 --no-detect-odr-violations.
7590
8e51a0b9
ILT
75912011-01-24 Ian Lance Taylor <iant@google.com>
7592
7593 * version.cc (version_string): Bump to 1.11.
7594
0f3b89d8
ILT
75952011-01-24 Ian Lance Taylor <iant@google.com>
7596
7597 * plugin.cc (class Plugin_rescan): Define new class.
7598 (Plugin_manager::claim_file): Set any_claimed_.
7599 (Plugin_manager::save_archive): New function.
7600 (Plugin_manager::save_input_group): New function.
7601 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
7602 necessary.
7603 (Plugin_manager::new_undefined_symbol): New function.
7604 (Plugin_manager::rescan): New function.
7605 (Plugin_manager::rescannable_defines): New function.
7606 (Plugin_manager::add_input_file): Set any_added_.
7607 * plugin.h (class Plugin_manager): define new fields rescannable_,
7608 undefined_symbols_, any_claimed_, and any_added_. Declare
7609 Plugin_rescan as friend. Declare new functions.
7610 (Plugin_manager::Rescannable): Define type.
7611 (Plugin_manager::Rescannable_list): Define type.
7612 (Plugin_manager::Undefined_symbol_list): Define type.
7613 (Plugin_manager::Plugin_manager): Initialize new fields.
7614 * archive.cc (Archive::defines_symbol): New function.
7615 (Add_archive_symbols::run): Pass archive to plugins if any.
7616 * archive.h (class Archive): Declare defines_symbol.
7617 * readsyms.cc (Input_group::~Input_group): New function.
7618 (Finish_group::run): Pass input_group to plugins if any.
7619 * readsyms.h (class Input_group): Declare destructor.
7620 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
7621 any.
7622
3bb951e5
ILT
76232011-01-10 Ian Lance Taylor <iant@google.com>
7624
7625 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
7626 section as relro.
7627 (Layout::set_segment_offsets): Reset increase_relro before calling
7628 set_section_addresses a second time.
7629
0aa45fac
CC
76302011-01-04 Cary Coutant <ccoutant@google.com>
7631
7632 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
7633 sections before NOBITS sections.
7634
0db46eb4
L
76352011-01-01 H.J. Lu <hongjiu.lu@intel.com>
7636
7637 * version.cc (print_version): Update copyright to 2011.
7638
829c9745
CC
76392010-12-23 Cary Coutant <ccoutant@google.com>
7640
7641 * output.h (Output_data_reloc::add_output_section): Pass OD instead
7642 of OS to this->add. Add OD parameter to second form of the function.
7643
7500420b
ILT
76442010-12-20 Ian Lance Taylor <iant@google.com>
7645
7646 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
7647 second of two consecutive entries with same offset.
7648
f8e9a930
RW
76492010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7650
7651 * testsuite/Makefile.am (ifuncmain2static_LDADD)
7652 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
7653 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
7654 to avoid unneeded links against $(LDADD).
7655 * testsuite/Makefile.in: Regenerate.
7656
2fbb4320
ILT
76572010-12-15 Ian Lance Taylor <iant@google.com>
7658
7659 PR gold/12324
7660 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
7661 for R_X86_64_32 and R_X86_64_PC32.
7662 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
7663 ver_matching_def_pic.o.
7664 (ver_matching_def_pic.o): New target.
7665
fedb228d
RW
76662010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7667
7668 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
7669 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
7670 Move definition before File_read::View member definitions.
7671 (File_read::View::~View): Initialize and hold lock before
7672 updating current_mapped_bytes.
7673
9b547ce6
RW
76742010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7675
7676 * dwarf_reader.cc: Remove outdated comment.
7677 * gold-threads.cc: Fix typo in error message.
7678 * archive.cc: Fix typos in comments.
7679 * archive.h: Likewise.
7680 * arm-reloc-property.cc: Likewise.
7681 * arm-reloc-property.h: Likewise.
7682 * arm-reloc.def: Likewise.
7683 * arm.cc: Likewise.
7684 * attributes.h: Likewise.
7685 * cref.cc: Likewise.
7686 * ehframe.cc: Likewise.
7687 * fileread.h: Likewise.
7688 * gold.h: Likewise.
7689 * i386.cc: Likewise.
7690 * icf.cc: Likewise.
7691 * incremental.h: Likewise.
7692 * int_encoding.cc: Likewise.
7693 * layout.h: Likewise.
7694 * main.cc: Likewise.
7695 * merge.h: Likewise.
7696 * object.cc: Likewise.
7697 * object.h: Likewise.
7698 * options.cc: Likewise.
7699 * readsyms.cc: Likewise.
7700 * reduced_debug_output.cc: Likewise.
7701 * reloc.cc: Likewise.
7702 * script-sections.cc: Likewise.
7703 * sparc.cc: Likewise.
7704 * symtab.h: Likewise.
7705 * target-reloc.h: Likewise.
7706 * target.cc: Likewise.
7707 * target.h: Likewise.
7708 * timer.cc: Likewise.
7709 * timer.h: Likewise.
7710 * x86_64.cc: Likewise.
7711
83e17bd5
CC
77122010-12-09 Cary Coutant <ccoutant@google.com>
7713
7714 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
7715 stack.
7716 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
7717 parameter; change all callers.
7718 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
7719 * options.h (warn_execstack): New option.
7720
017257f8
DK
77212010-12-07 Doug Kwan <dougkwan@google.com>
7722
7723 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
7724 like function call relocations.
7725
c20cbc06
ILT
77262010-12-07 Ian Lance Taylor <iant@google.com>
7727
7728 * archive.cc (Archive::get_elf_object_for_member): Permit
7729 punconfigured to be NULL.
7730 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
7731 (Archive::include_member): Pass NULL to get_elf_object_for_member
7732 if we searched for the archive and this is the first included
7733 object.
7734
4dbfafcc
ILT
77352010-12-01 Ian Lance Taylor <iant@google.com>
7736
7737 * dwarf_reader.h (class Sized_dwarf_line_info): Add
7738 track_relocs_type_ field.
7739 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7740 Set track_relocs_type_.
7741 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
7742 contents when using RELA relocs.
7743 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
7744 reloc_map_.
7745 * reloc.cc (Track_relocs::next_addend): New function.
7746 * reloc.h (class Track_relocs): Declare next_addend.
7747
e5e19edd
ILT
77482010-12-01 Ian Lance Taylor <iant@google.com>
7749
7750 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
7751 virtual destructor.
7752
9a5ce24c
ILT
77532010-12-01 Ian Lance Taylor <iant@google.com>
7754
7755 * README: Update compilers known to work and fail.
7756
c7791212
NC
77572010-11-23 Matthias Klose <doko@ubuntu.com>
7758
7759 * configure.in: For --enable-gold, handle value `default' instead of
7760 `both*'. Always install ld as ld.bfd, install as ld if gold is
7761 not the default.
7762 * configure: Regenerate.
7763
0ad220c9
DK
77642010-11-18 Doug Kwan <dougkwan@google.com>
7765
7766 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
7767 and right_alignment to be zero. Store result alignment only if it is
7768 greater than existing alignment.
7769
ab8056e0
CC
77702010-11-16 Cary Coutant <ccoutant@google.com>
7771
7772 PR gold/12220
7773 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7774 Check for ".zdebug_line".
7775
fd064a5b
CC
77762010-11-16 Doug Kwan <dougkwan@google.com>
7777 Cary Coutant <ccoutant@google.com>
7778
7779 * output.h (Output_segment::set_section_addresses): Pass increase_relro
7780 by reference; adjust all callers.
7781 * output.cc (Output_segment::set_section_addresses): Adjust references
7782 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
7783 list is empty.
7784 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
7785 end at page boundary.
7786
6fc6ea19
CC
77872010-11-16 Cary Coutant <ccoutant@google.com>
7788
7789 PR gold/12220
7790 * layout.cc (Layout::choose_output_section): Transform names of
7791 compressed sections even when using a script with a SECTIONS clause.
7792 (Layout::output_section_name): Remove code to transform
7793 compressed debug section names.
7794 * output.cc (Output_section::add_input_section): Use uncompressed
7795 section size when tracking input sections.
7796
95a2c8d6
RS
77972010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
7798
7799 * symtab.h (Symbol::NON_PIC_REF): Remove.
7800 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
7801 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
7802 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
7803 (Symbol::use_plt_offset): Take a flags argument and pass it
7804 directly to needs_dynamic_reloc. Restrict check for undefined
7805 weak symbols to function calls.
7806 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
7807 (Target_arm::Scan::global): Use it.
7808 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
7809 (Target_arm::Relocate::relocate): Likewise.
7810 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
7811 parameter with an r_type parameter. Use get_reference_flags
7812 to get the flags.
7813 (Target_arm::Relocate::relocate): Update accordingly.
7814 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
7815 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
7816 (Target_i386::Scan::global): Likewise.
7817 (Target_i386::Relocate::relocate): Likewise.
7818 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
7819 parameter with an r_type parameter. Use get_reference_flags
7820 to get the flags.
7821 (Target_i386::Relocate::relocate): Update accordingly.
7822 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
7823 (Target_powerpc::Scan::global): Use it.
7824 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
7825 (Target_powerpc::Relocate::relocate): Likewise.
7826 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
7827 (Target_sparc::Scan::global): Use it.
7828 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
7829 (Target_sparc::Relocate::relocate): Likewise.
7830 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
7831 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
7832 (Target_x86_64::Scan::global): Likewise.
7833 (Target_x86_64::Relocate::relocate): Likewise.
7834
f625ae50
DK
78352010-11-08 Doug Kwan <dougkwan@google.com>
7836 Cary Coutant <ccoutant@google.com>
7837
7838 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
7839 (Arm_exidx_merge_section::section_contents_): New data member.
7840 (Arm_input_section::Arm_input_section): Initialize original_contents_.
7841 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 7842 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
7843 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
7844 in parameters instead of calling Object::section_contents without
7845 locking.
7846 (Arm_output_section::group_section): New parameter TASK. Pass it
7847 to callees that need locking objects.
7848 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
7849 to lock EXIDX input sections. Fix a formatting issue. Call
7850 Arm_exidx_merged_section::build_contents to create merged section
7851 contents.
7852 (Arm_output_section::create_stub_group): New parameter TASK. Use it
7853 to lock object of stub table owner.
7854 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
7855 TEXT_SIZE to initialize data member TEXT_SIZE_.
7856 (Arm_exidx_input_section::addralign): Fix typo in comment.
7857 (Arm_exidx_input_section::text_size): New method.
7858 (Target_arm::do_relax): New parameter TASK. Pass it to callees
7859 that require locking objects. Lock objects before scanning for stubs
7860 and updating local symbols.
7861 (Arm_input_section<big_endian>::init): Copy contents of original
7862 input section.
2e702c99 7863 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
7864 original input section instead of calling Object::section_contents
7865 without locking.
7866 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
7867 size without calling Object::section_size().
7868 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
7869 for size. Allocate a buffer for merged EXIDX entries.
7870 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 7871 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
7872 building code to Arm_exidx_merged_section::build_contetns. Write
7873 out contetns in buffer instead of building it on the fly.
7874 (Arm_relobj::make_exidx_input_section): Also pass text section size
7875 to Arm_exidx_input_section constructor.
7876 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
7877 (Arm_dynobj::do_read_symbols): Fix memory leak.
7878 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
7879 * target.h: (class Task): Add forward declaration.
7880 (Target::relax): Add new parameter TASK and pass it to
7881 Target::do_relax().
7882 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
7883
5f9bcf58
CC
78842010-11-05 Cary Coutant <ccoutant@google.com>
7885
7886 PR gold/10708
7887 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
7888 object when reading from the file.
7889 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
7890 second layout pass.
7891 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
7892 when reading section contents.
7893 (get_section_contents): Likewise.
7894 (icf::find_identical_sections): Likewise.
7895 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
7896 object when reading from the file.
7897 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
7898 the object when doing deferred section layout.
7899
e597fa08
NC
79002010-11-03 Nick Clifton <nickc@redhat.com>
7901
7902 PR gold/12001
7903 * script.h (class Symbol_assignment: name): New member. Returns
7904 the name of the symbol.
7905 * scrfipt.cc (Script_options::is_pending_assignment): New member.
7906 Returns true if the given symbol name is on the list of
7907 assignments wating to be processed.
7908 * archive.cc (should_incldue_member): If the symbol is undefined,
7909 check to see if it is on the list of symbols pending assignment.
7910
3f9a3278
ILT
79112010-11-03 Ryan Mansfield <rmansfield@qnx.com>
7912
7913 * script-sections.cc (Script_sections::find_memory_region): Check
7914 for a NULL output section pointer.
7915
d06fb4d1
DK
79162010-10-29 Doug Kwan <dougkwan@google.com>
7917
7918 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
7919 Output_section::add_relaxed_input_section.
7920 * output.cc (Output_section::add_relaxed_input_section): Add new
7921 arguments LAYOUT and NAME. Set section order index.
7922 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7923 Copy section order index.
7924 * output.h (Output_section::add_relaxed_input_section): Add new
7925 arguments LAYOUT and NAME.
7926
90e24de5
ILT
79272010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7928
7929 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 7930 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
7931 * testsuite/Makefile.in: Regenerate.
7932
c9484ea5
DK
79332010-10-20 Doug Kwan <dougkwan@google.com>
7934
7935 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
7936 without SHF_LINK_ORDER flags.
7937 * layout.cc (Layout::choose_output_section): Do not filter
7938 SHF_LINK_ORDER flag in a relocatable link.
7939
5bc2f5be
CC
79402010-10-17 Cary Coutant <ccoutant@google.com>
7941
7942 * output.h (Output_segment::set_section_addresses): Change function
7943 signature. Update all callers.
7944 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
7945 sections.
7946 (Output_segment::set_section_addresses): Align after last TLS
7947 section. Add padding before last relro section instead of after.
7948
0c91cf04
DK
79492010-10-17 Doug Kwan <dougkwan@google.com>
7950
7951 * gold/arm.cc (Target_arm::got_section): Use correct order and set
7952 GOT output section to be writable.
7953
8c21d9d3
CC
79542010-10-14 Cary Coutant <ccoutant@google.com>
7955
7956 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
7957 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
7958 * gold.cc (queue_initial_tasks): Check parameters for incremental link
7959 mode.
7960 * incremental.cc (report_command_line): Ignore all forms of
7961 --incremental.
7962 * layout.cc (Layout::Layout): Check parameters for incremental link
7963 mode.
7964 * options.cc (General_options::parse_incremental): New function.
7965 (General_options::parse_no_incremental): New function.
7966 (General_options::parse_incremental_full): New function.
7967 (General_options::parse_incremental_update): New function.
7968 (General_options::incremental_mode_): New data member.
7969 (General_options::finalize): Check incremental_mode_.
7970 * options.h (General_options): Update help text for --incremental.
7971 Add --no-incremental, --incremental-full, --incremental-update.
7972 (General_options::Incremental_mode): New enum type.
7973 (General_options::incremental_mode): New function.
7974 (General_options::incremental_mode_): New data member.
7975 * parameters.cc (Parameters::incremental_mode_): New data member.
7976 (Parameters::set_options): Set incremental_mode_.
7977 (Parameters::set_incremental_full): New function.
7978 (Parameters::incremental): New function.
7979 (Parameters::incremental_update): New function.
7980 (set_parameters_incremental_full): New function.
7981 * parameters.h (Parameters::set_incremental_full): New function.
7982 (Parameters::incremental): New function.
7983 (Parameters::incremental_update): New function.
7984 (Parameters::incremental_mode_): New data member.
7985 (set_parameters_incremental_full): New function.
7986 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
7987 incremental link mode.
7988 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
7989 (Sized_relobj::do_relocate_sections): Likewise.
7990 * testsuite/Makefile.am (incremental_test): Use --incremental-full
7991 option.
7992 * testsuite/Makefile.in: Regenerate.
7993 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 7994
bb32aa18 79952010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
7996
7997 * script-sections.h (class Script_sections): Make
7998 Sections_elements typedef public.
7999 * script-sections.cc (class Sort_output_sections): Add elements_
8000 field. Add constructor which sets it; change all callers.
8001 (Sort_output_sections::is_before): New function.
8002 (Sort_output_sections::operator()): Call is_before.
8003 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
8004 conditional.
8005 * testsuite/script_test_10.sh: New test. Test script section
8006 order.
8007 * testsuite/script_test_10.t: Likewise.
8008 * testsuite/script_test_10.s: Likewise.
8009 * testsuite/Makefile.am: Wrap the cross linker tests and the
8010 common tests into NATIVE_OR_CROSS_LINKER.
8011 (check_SCRIPTS): Add script_test_10.sh.
8012 (check_DATA): Add script_test_10.stdout.
8013 (script_test_10.o, script_test_10): New targets.
8014 (script_test_10.stdout): New target.
8015 * configure, testsuite/Makefile.in: Regenerate.
8016
3cef7179
ILT
80172010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8018
8019 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
8020 error for the deprecated relocations.
8021 (Target_arm::Scan::global): Likewise.
8022 (Target_arm::Relocate::relocate): Likewise.
8023
7411e9a8
RS
80242010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
8025
8026 * fileread.cc (Input_file::find_file): Initialize *found_name
8027 and *namep when using the fallback search for case 4.
8028
6a9da32a
CC
80292010-10-11 Cary Coutant <ccoutant@google.com>
8030
8031 * options.h (class General_options): Redefine -z lazy as an alias for
8032 the negation of -z now.
8033
ac897c20
ILT
80342010-10-11 Ian Lance Taylor <iant@google.com>
8035
8036 * resolve.cc (symbol_to_bits): Report the value of the unsupported
8037 binding.
8038
ea5cae92
NC
80392010-10-06 Nick Clifton <nickc@redhat.com>
8040
8041 * script-sections.cc(class Memory_region): Remove
8042 current_lma_offset_ field. Rename current_vma_offset_ to
8043 current_offset_. Add last_section_ field.
8044 (Memory_region::get_current_vma_address): Rename to
8045 get_current_address.
8046 (Memory_region::get_current_lma_address): Delete.
8047 (Memory_region::increment_vma_offset): Rename to
8048 increment_offset.
8049 (Memory_region::increment_lma_offset): Delete.
8050 (Memory_region::attributes_compatible): New method. Returns
8051 true if the provided section is compatible with the region.
8052 (Memory_region::get_last_section): New method. Returns the last
8053 section to use the region.
8054 (Memory_region::set_last_section): New method. Stores the last
8055 section to use the region.
8056 (Script_sections::block_in_region): New method. Returns true if
8057 a block of memory is contained within a region.
8058 (Script_sections::find_memory_region): New method. Locates a
8059 memory region to be used to set a VMA or LMA address.
8060 (Output_section_definition::set_section_addresses): Add code to
8061 check for addresses set by memory regions.
8062 (Output_segment::set_section_addresses): Remove memory region
8063 walking code.
8064 (Script_sections::create_segment): Add a warning if a header
8065 segment is created outside of any region.
8066 * script-sections.h (class Script_sections): Add prototypes for
8067 find_memory_region and block_in_region methods.
8068 * testsuite/memory_test.s: Use .long instead of .word.
8069 * testsuite/memory_test.t: Add some more output sections.
8070 * testsuite/memory_test.sh: Update expected output.
8071
a9bfd952
DK
80722010-10-02 Doug Kwan <dougkwan@google.com>
8073
8074 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
8075 defintion to symtab.h
8076 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
8077 declaration to defintion.
8078
bacff3ab
NC
80792010-10-01 Nick Clifton <nickc@redhat.com>
8080
8081 * expression.cc (eval): Replace dummy argument with NULL.
8082 (eval_maybe_dot): Check for a NULL result section pointer.
8083 (Symbol_expression::value): Likewise.
8084 (Dot_expression::value): Likewise.
8085 (BINARY_EXPRESSION): Likewise.
8086 (Max_expression::value): Likewise.
8087 (Min_expression::value): Likewise.
8088 (Absolute_expression::value): Likewise.
8089 (Addr_expression::value_from_output_section): Likewise.
8090 (Loaddddr_expression::value_from_output_section): Likewise.
8091 (Segment_start_expression::value): Likewise.
8092 * script-sections.cc
8093 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
8094 argument with NULL.
8095 (Sections_elememt_dot_assignment::set_section_addresses):
8096 Likewise.
8097 (Output_data_expression::do_write_to_buffer): Likewise.
8098 (Output_section_definition::finalize_symbols): Likewise.
8099 (Output_section_definition::set_section_addresses): Likewise.
8100
f81bc8b5
DK
81012010-09-30 Doug Kwan <dougkwan@google.com>
8102
8103 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
8104
c95e9f27
ST
81052010-09-28 Sriraman Tallam <tmsriram@google.com>
8106
8107 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 8108 function.
c95e9f27
ST
8109 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
8110 virtual function.
8111 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
8112 virtual function.
8113 * icf.cc (get_section_contents): Inline merge sections only when
8114 target allows it.
8115
3cac54d2
RW
81162010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8117
8118 * configure: Regenerate.
8119
2904037a
ILT
81202010-09-17 Ian Lance Taylor <iant@google.com>
8121
8122 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
8123 * testsuite/Makefile.am (memory_test.o): New target.
8124 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
8125 memory_test.t.
8126 * testsuite/Makefile.in: Rebuild.
2904037a 8127
bca7fb63
DK
81282010-09-17 Doug Kwan <dougkwan@google.com>
8129
8130 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
8131 defintion if relocation uses GOT entries of the symbol.
8132 * testsuite/icf_safe_test.sh: Fix test.
8133 * testsuite/icf_safe_so_test.sh: Fix test.
8134
4ef28648
CC
81352010-09-16 Cary Coutant <ccoutant@google.com>
8136
8137 * script_sections.cc (class Memory_region): Remove "NULL" from
8138 vector initializations.
8139
793990de
CC
81402010-09-15 Cary Coutant <ccoutant@google.com>
8141
8142 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
8143 Resolve forwarding symbols.
8144
81e015e2
DK
81452010-09-15 Doug Kwan <dougkwan@google.com>
8146
8147 * gold/testsuite/script_test_3.t: Add ARM special sections.
8148 * gold/testsuite/script_test_4.t: Same.
8149 * gold/testsuite/script_test_5.t: Same.
8150 * gold/testsuite/script_test_6.t: Same.
8151 * gold/testsuite/script_test_7.t: Same.
8152 * gold/testsuite/script_test_7.t: Same.
8153 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
8154
36171d64
CC
81552010-09-14 Cary Coutant <ccoutant@google.com>
8156
8157 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
8158 (Target_x86_64::Relocate::relocate_tls): Replace check for
8159 saw_tls_block_reloc_ with test for executable section.
8160
d89051bd
CC
81612010-09-12 Cary Coutant <ccoutant@google.com>
8162
8163 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
8164 position-independent executables to shared libraries need dynamic
8165 relocations.
8166 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
8167 position-independent executables.
8168 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
8169 * testsuite/Makefile.in: Regenerate.
8170
fca41f0f
NC
81712010-09-10 Nick Clifton <nickc@redhat.com>
8172
8173 PR gold/11997
8174 * testsuite/memory_test.t: Discard any sections that are not
8175 needed.
8176
6695e4b3
L
81772010-09-09 H.J. Lu <hongjiu.lu@intel.com>
8178
8179 PR gold/11996
8180 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
8181 "This::" to work around a bug in gcc 4.2.
8182
8183 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
8184
0f72bf6f
RÁE
81852010-09-09 Rafael Espindola <espindola@google.com>
8186
8187 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
8188 sections with different PF_X flags in the same segment.
8189 (Layout::find_first_load_seg): Search all segments to find the first
8190 one.
8191 * options.h (rosegment): New.
8192
81932010-09-08 Rafael Espindola <espindola@google.com>
a6577478 8194
05a79166 8195 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 8196
aa98ff75
DK
81972010-09-08 Doug Kwan <dougkwan@google.com>
8198
8199 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
8200 (Arm_relobj::do_relocate_sections): Add new parameter for output
8201 file to match the parent.
8202 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
8203 of local symbols instead of input values. Update code to track
8204 changes in gold::relocate_section.
8205 * object.cc (Sized_relobj::compute_final_local_value): New methods.
8206 (Sized_relobj::compute_final_local_value_internal): New methods.
8207 (Sized_relobj::do_finalize_local_symbols): Move code from loop
8208 body into private version of Sized_relobj::compute_final_local_value.
8209 Call the inline method.
8210 * object.h (Symbol_value::Symbol_value): Define destructor. Free
8211 merged symbol value if there is one.
8212 (Symbol_value::has_output_value): New method defintiion.
8213 (Sized_relobj::Compute_final_local_value_status): New enum type.
8214 (Sized_relobj::compute_final_local_value): New methods.
8215 (Sized_relobj::compute_final_local_value_internal): New methods.
8216 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
8217 and arm_cortex_a8.sh.
8218 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
8219 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
8220 New tests.
8221 * Makefile.in: Regenerate.
8222 * testsuite/arm_bl_out_of_range.s: Update test.
8223 * testsuite/thumb_bl_out_of_range.s: Ditto.
8224 * testsuite/thumb_blx_out_of_range.s: Ditto.
8225 * testsuite/arm_branch_out_of_range.sh: New file.
8226 * testsuite/arm_cortex_a8.sh: Ditto.
8227 * testsuite/arm_cortex_a8_b.s: Ditto.
8228 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
8229 * testsuite/arm_cortex_a8_b_local.s: Ditto.
8230 * testsuite/arm_cortex_a8_bl.s: Ditto.
8231 * testsuite/arm_cortex_a8_blx.s: Ditto.
8232 * testsuite/arm_cortex_a8_local.s: Ditto.
8233 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
8234 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
8235
05a79166
L
82362010-09-08 Rafael Espindola <espindola@google.com>
8237
8238 * Makefile.am (memory_test.stdout): Run readelf with -W.
8239 * Makefile.in: Regenerate.
8240 * testsuite/memory_test.sh: Make the regexps accept both 32 and
8241 64 bit output.
8242
33dbc701
RÁE
82432010-09-08 Rafael Espindola <espindola@google.com>
8244
8245 * script-sections.cc (Script_sections::add_memory_region): Convert
8246 field precision to int.
8247 * script.cc (script_set_section_region, script_set_section_region):
8248 Convert field precision to int.
8249
731ca54a
RÁE
82502010-09-08 Rafael Espindola <espindola@google.com>
8251
8252 * arm.cc (do_finalize_sections): Create the __exidx_start and
8253 __exdix_end symbols even when the section is missing.
8254
7f8cd844
NC
82552010-09-08 Nick Clifton <nickc@redhat.com>
8256
8257 * README: Remove claim that MEMORY is not supported.
8258 * expression.cc (script_exp_function_origin)
8259 (script_exp_function_length): Move from here to ...
8260 * script.cc: ... here.
8261 (script_set_section_region, script_add_memory)
8262 (script_parse_memory_attr, script_include_directive): New
8263 functions.
8264 * script-sections.cc
8265 (class Memory_region): New class.
8266 (class Output_section_definition): Add set_memory_region,
8267 set_section_vma, set_section_lma and get_section_name methods.
8268 (class Script_Sections): Add add_memory_region,
8269 find_memory_region, find_memory_region_origin,
8270 find_memory_region_length and set_memory_region methods.
8271 Have set_section_addresses method walk the list of set memory
8272 regions.
8273 Extend the print methos to display memory regions.
8274 * script-sections.h: Add prototypes for new methods.
8275 Add enum for MEMORY region attributes.
8276 * yyscript.y: Add support for parsing MEMORY regions.
8277 * script-c.h: Add prototypes for new functions.
8278 * testsuite/Makefile.am: Add test of MEMORY region functionality.
8279 * testsuite/Makefile.in: Regenerate.
8280 * testsuite/memory_test.sh: New script.
8281 * testsuite/memory_test.s: New assembler source file.
8282 * testsuite/memory_test.t: New linker script.
8283
a4649286
DK
82842010-08-27 Doug Kwan <dougkwan@google.com>
8285
8286 * gold/resolve.cc (Symbol_table::should_override): Let a weak
8287 reference override an existing dynamic weak reference.
8288 * testsuite/Makefile.am: Add new test dyn_weak_ref.
8289 * testsuite/Makefile.in: Regenerate.
8290 * testsuite/dyn_weak_ref.sh: New file.
8291 * testsuite/dyn_weak_ref_1.c: Ditto.
8292 * testsuite/dyn_weak_ref_2.c: Ditto.
8293
b56648ad
ILT
82942010-08-27 Ian Lance Taylor <iant@google.com>
8295
8296 * incremental.h (class Incremental_input_entry): Add virtual
8297 destructor.
8298
809313cb
ILT
82992010-08-27 Ian Lance Taylor <iant@google.com>
8300
8301 * testsuite/start_lib_test_3.c: Mark t3 as used.
8302
11e32464
NC
83032010-08-27 Nick Clifton <nickc@redhat.com>
8304
8305 * options.cc (version_script): Fix small typo in previous
8306 whitespace tidyup.
8307
ca09d69a
NC
83082010-08-25 Nick Clifton <nickc@redhat.com>
8309
8310 * archive.cc: Formatting fixes: Remove whitespace between
8311 typename and following asterisk. Remove whitespace between
8312 function name and opening parenthesis.
8313 * archive.h: Likewise.
8314 * arm.cc: Likewise.
8315 * attributes.cc: Likewise.
8316 * attributes.h: Likewise.
8317 * common.cc: Likewise.
8318 * copy-relocs.cc: Likewise.
8319 * dirsearch.h: Likewise.
8320 * dynobj.cc: Likewise.
8321 * ehframe.cc: Likewise.
8322 * ehframe.h: Likewise.
8323 * expression.cc: Likewise.
8324 * fileread.cc: Likewise.
8325 * fileread.h: Likewise.
8326 * gc.h: Likewise.
8327 * gold-threads.cc: Likewise.
8328 * gold.cc: Likewise.
8329 * i386.cc: Likewise.
8330 * icf.h: Likewise.
8331 * incremental-dump.cc: Likewise.
8332 * incremental.cc: Likewise.
8333 * layout.cc: Likewise.
8334 * layout.h: Likewise.
8335 * main.cc: Likewise.
8336 * merge.cc: Likewise.
8337 * merge.h: Likewise.
8338 * object.cc: Likewise.
8339 * object.h: Likewise.
8340 * options.cc: Likewise.
8341 * options.h: Likewise.
8342 * output.cc: Likewise.
8343 * output.h: Likewise.
8344 * plugin.cc: Likewise.
8345 * plugin.h: Likewise.
8346 * powerpc.cc: Likewise.
8347 * reloc.cc: Likewise.
8348 * script-c.h: Likewise.
8349 * script-sections.cc: Likewise.
8350 * script.cc: Likewise.
8351 * stringpool.cc: Likewise.
8352 * symtab.cc: Likewise.
8353 * symtab.h: Likewise.
8354 * target.cc: Likewise.
8355 * timer.cc: Likewise.
8356 * timer.h: Likewise.
8357 * version.cc: Likewise.
8358 * x86_64.cc: Likewise.
8359
b8fa8750
NC
83602010-08-24 Nick Clifton <nickc@redhat.com>
8361
8362 PR 11899
8363 * layout.cc (segment_precedes): Sort segments by their physical
8364 addresses, if they have been set.
8365
9919d93b
CC
83662010-08-23 Cary Coutant <ccoutant@google.com>
8367
8368 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
8369 symbols data.
8370 (Lib_group::include_member): Unlock object after deleting its
8371 symbols data.
8372 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
8373 the bug fixed here.
8374
97b4be1c
CC
83752010-08-19 Neil Vachharajani <nvachhar@google.com>
8376 Cary Coutant <ccoutant@google.com>
8377
8378 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
8379 constructor, and set_blocker.
8380 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
8381 readsyms_blocker_.
8382 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
8383 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
8384 * testsuite/Makefile.am (start_lib_test): New test case.
8385 * testsuite/Makefile.in: Regenerate.
8386 * testsuite/start_lib_test_main.c: New file.
8387 * testsuite/start_lib_test_1.c: New file.
8388 * testsuite/start_lib_test_2.c: New file.
8389 * testsuite/start_lib_test_3.c: New file.
8390
dd0b1884
ILT
83912010-08-19 Ian Lance Taylor <iant@google.com>
8392
8393 * Makefile.in: Rebuild with automake 1.11.1.
8394 * aclocal.m4: Likewise.
8395 * testsuite/Makefile.in: Likewise.
8396
7223e9ca
ILT
83972010-08-19 Ian Lance Taylor <iant@google.com>
8398
8399 PR 10893
8400 * i386.cc (class Output_data_plt_i386): Update declarations.
8401 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
8402 local_ifuncs_ fields.
8403 (Target_i386::do_plt_section_for_global): New function.
8404 (Target_i386::do_plt_section_for_local): New function.
8405 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
8406 parameter; change all callers. Initialize global_ifuncs_ and
8407 local_ifuncs_. If doing a static link define __rel_iplt_start and
8408 __rel_iplt_end.
8409 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
8410 (Output_data_plt_i386::add_local_ifunc_entry): New function.
8411 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
8412 symbols.
8413 (Target_i386::make_plt_section): New function, broken out of
8414 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
8415 (Target_i386::make_plt_entry): Call make_plt_section.
8416 (Target_i386::make_local_ifunc_plt_entry): New function.
8417 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
8418 (Target_i386::Scan::local): Handle IFUNC symbols. Add
8419 R_386_IRELATIVE to switch.
8420 (Target_i386::Scan::global): Likewise.
8421 (Target_i386::Relocate::relocate): Likewise.
8422 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
8423 switch.
8424 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
8425 (Target_x86_64::do_plt_section_for_global): New function.
8426 (Target_x86_64::do_plt_section_for_local): New function.
8427 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
8428 parameter; change all callers. If doing a static link define
8429 __rela_iplt_start and __rela_iplt_end.
8430 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
8431 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
8432 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
8433 to point to .plt.
8434 (Target_x86_64::make_local_ifunc_plt_entry): New function.
8435 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
8436 switch.
8437 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
8438 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
8439 R_X86_64_IRELATIVE to switch.
8440 (Target_x86_64::Scan::global): Likewise.
8441 (Target_x86_64::Relocate::relocate): Likewise.
8442 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
8443 switch.
8444 * target.h (class Target): Add plt_section_for_global and
8445 plt_section_for_local functions. Add do_plt_section_for_global
8446 and do_plt_section_for_local virtual functions.
8447 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
8448 clarifying comments.
8449 (Symbol::use_plt_offset): Handle IFUNC symbol.
8450 * object.cc (Sized_relobj::Sized_relobj): Initialize
8451 local_plt_offsets_.
8452 (Sized_relobj::local_has_plt_offset): New function.
8453 (Sized_relobj::local_plt_offset): New function.
8454 (Sized_relobj::set_local_plt_offset): New function.
8455 (Sized_relobj::do_count): Handle IFUNC symbol.
8456 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
8457 a bit away from input_shndx_ field. Add set_is_func_symbol and
8458 is_ifunc_symbol functions.
8459 (class Sized_relobj): Update declarations. Remove Tls_got_entry
8460 and Local_tls_got_offsets. Define Local_plt_offsets. Add
8461 local_plt_offsets_ field.
8462 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
8463 * output.h (class Output_section_data): Add non-const
8464 output_section function.
8465 (class Output_data_got): Update declarations.
8466 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
8467 Add use_plt_offset parameter to global and local constructors.
8468 Change all callers. Change local_sym_index_ field to 31 bits.
8469 Change GSYM_CODE and CONSTANT_CODE accordingly.
8470 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
8471 doing a static link don't set sh_link field.
8472 (Output_data_got::Got_entry::write): Use PLT offset if
8473 appropriate.
8474 (Output_data_got::add_global_plt): New function.
8475 (Output_data_got::add_local_plt): New function.
8476 * target-reloc.h (relocate_section): Handle IFUNC symbol.
8477 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
8478 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
8479 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
8480 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
8481 IFUNC conditional.
8482 * testsuite/ifunc-sel.h: New file.
8483 * testsuite/ifuncmain1.c: New file.
8484 * testsuite/ifuncmain1vis.c: New file.
8485 * testsuite/ifuncmod1.c: New file.
8486 * testsuite/ifuncdep2.c: New file.
8487 * testsuite/ifuncmain2.c: New file.
8488 * testsuite/ifuncmain3.c: New file.
8489 * testsuite/ifuncmod3.c: New file.
8490 * testsuite/ifuncmain4.c: New file.
8491 * testsuite/ifuncmain5.c: New file.
8492 * testsuite/ifuncmod5.c: New file.
8493 * testsuite/ifuncmain6pie.c: New file.
8494 * testsuite/ifuncmod6.c: New file.
8495 * testsuite/ifuncmain7.c: New file.
8496 * configure, testsuite/Makefile.in: Rebuild.
8497
56f75c03
ILT
84982010-08-18 Ian Lance Taylor <iant@google.com>
8499
8500 * incremental.cc
8501 (Output_section_incremental_inputs::write_input_files): Add cast
8502 to avoid signed/unsigned comparison warning.
8503 (Output_section_incremental_inputs::write_info_blocks): Likewise.
8504
55455f89
CC
85052010-08-12 Cary Coutant <ccoutant@google.com>
8506
8507 * common.cc (Sort_commons::operator()): Remove unnecessary code.
8508
e2054bcb
ILT
85092010-08-13 Ian Lance Taylor <iant@google.com>
8510
8511 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
8512
74f67560
DK
85132010-08-12 Cary Coutant <ccoutant@google.com>
8514 Doug Kwan <dougkwan@google.com>
8515
8516 * resolve.cc (Symbol_table::should_override): When a weak dynamic
8517 defintion overrides non-weak undef, remember that the original undef
8518 is not weak.
8519 * symtab.cc (Symbol_table::sized_write_global): For undef without
8520 an original weak binding, set binding to global in output.
8521 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
8522 * testsuite/Makefile.in: Regenerate.
8523 * testsuite/strong_ref_weak_def.sh: New file.
8524 * testsuite/strong_ref_weak_def_1.c: Ditto.
8525 * testsuite/strong_ref_weak_def_2.c: Ditto.
8526
d1238d12
CC
85272010-08-12 Cary Coutant <ccoutant@google.com>
8528
8529 * testsuite/incremental_test.sh: Rewrite.
8530 * testsuite/incremental_test_1.c: Rewrite.
8531 * testsuite/incremental_test_2.c: Rewrite.
8532
0e70b911
CC
85332010-08-12 Cary Coutant <ccoutant@google.com>
8534
8535 * arm.cc (Target_arm::got_size): Add const.
8536 (Target_arm::got_entry_count): New function.
8537 (Target_arm::plt_entry_count): New function.
8538 (Target_arm::first_plt_entry_offset): New function.
8539 (Target_arm::plt_entry_size): New function.
8540 (Output_data_plt_arm::entry_count): New function.
8541 (Output_data_plt_arm::first_plt_entry_offset): New function.
8542 (Output_data_plt_arm::get_plt_entry_size): New function.
8543 * i386.cc (Target_i386::got_size): Add const.
8544 (Target_i386::got_entry_count): New function.
8545 (Target_i386::plt_entry_count): New function.
8546 (Target_i386::first_plt_entry_offset): New function.
8547 (Target_i386::plt_entry_size): New function.
8548 (Output_data_plt_i386::entry_count): New function.
8549 (Output_data_plt_i386::first_plt_entry_offset): New function.
8550 (Output_data_plt_i386::get_plt_entry_size): New function.
8551 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
8552 find_incremental_inputs_sections. Dump incremental_got_plt section.
8553 * incremental.cc: Include target.h.
8554 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
8555 parameter. Adjust all callers. Find incremental_got_plt section.
8556 (Incremental_inputs::create_data_sections): Create incremental_got_plt
8557 section.
8558 (Output_section_incremental_inputs::set_final_data_size): Calculate
8559 size of incremental_got_plt section.
8560 (Output_section_incremental_inputs::do_write): Write the
8561 incremental_got_plt section.
8562 (Got_plt_view_info): New struct.
8563 (Local_got_offset_visitor): New class.
8564 (Global_got_offset_visitor): New class.
8565 (Global_symbol_visitor_got_plt): New class.
8566 (Output_section_incremental_inputs::write_got_plt): New function.
8567 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
8568 Add parameter. Adjust all callers.
8569 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8570 (Incremental_inputs::got_plt_section): New function.
8571 (Incremental_inputs::got_plt_section_): New data member.
8572 (Incremental_got_plt_reader): New class.
8573 * layout.cc (Layout::create_incremental_info_sections): Add the
8574 incremental_got_plt section.
8575 * object.h (Got_offset_list::get_list): New function.
8576 (Got offset_list::for_all_got_offsets): New function.
8577 (Sized_relobj::local_got_offset_list): New function.
8578 * powerpc.cc (Target_powerpc::got_size): Add const.
8579 (Target_powerpc::got_entry_count): New function.
8580 (Target_powerpc::plt_entry_count): New function.
8581 (Target_powerpc::first_plt_entry_offset): New function.
8582 (Target_powerpc::plt_entry_size): New function.
8583 (Output_data_plt_powerpc::entry_count): New function.
8584 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
8585 (Output_data_plt_powerpc::get_plt_entry_size): New function.
8586 * sparc.cc (Target_sparc::got_size): Add const.
8587 (Target_sparc::got_entry_count): New function.
8588 (Target_sparc::plt_entry_count): New function.
8589 (Target_sparc::first_plt_entry_offset): New function.
8590 (Target_sparc::plt_entry_size): New function.
8591 (Output_data_plt_sparc::entry_count): New function.
8592 (Output_data_plt_sparc::first_plt_entry_offset): New function.
8593 (Output_data_plt_sparc::get_plt_entry_size): New function.
8594 * symtab.h (Symbol::got_offset_list): New function.
8595 (Symbol_table::for_all_symbols): New function.
8596 * target.h (Sized_target::got_entry_count): New function.
8597 (Sized_target::plt_entry_count): New function.
8598 (Sized_target::plt_entry_size): New function.
8599 * x86_64.cc (Target_x86_64::got_size): Add const.
8600 (Target_x86_64::got_entry_count): New function.
8601 (Target_x86_64::plt_entry_count): New function.
8602 (Target_x86_64::first_plt_entry_offset): New function.
8603 (Target_x86_64::plt_entry_size): New function.
8604 (Output_data_plt_x86_64::entry_count): New function.
8605 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
8606 (Output_data_plt_x86_64::get_plt_entry_size): New function.
8607
09ec0418
CC
86082010-08-12 Cary Coutant <ccoutant@google.com>
8609
8610 * archive.cc: Include incremental.h.
8611 (Archive::Archive): Initialize incremental_info_.
8612 (Archive::include_member): Record archive members in incremental info.
8613 (Add_archive_symbols::run): Record begin and end of an archive in
8614 incremental info.
8615 (Lib_group::include_member): Record objects in incremental info.
8616 * archive.h (Incremental_archive_entry): Forward declaration.
8617 (Archive::set_incremental_info): New member function.
8618 (Archive::incremental_info): New member function.
8619 (Archive::Unused_symbol_iterator): New class.
8620 (Archive::unused_symbols_begin): New member function.
8621 (Archive::unused_symbols_end): New member function.
8622 (Archive::incremental_info_): New data member.
8623 * incremental-dump.cc (find_input_containing_global): New function.
8624 (dump_incremental_inputs): Dump new incremental info sections.
8625 * incremental.cc: Include symtab.h.
8626 (Output_section_incremental_inputs): New class.
8627 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
8628 new incremental info sections.
8629 (Sized_incremental_binary::do_check_inputs): Likewise.
8630 (Incremental_inputs::report_archive): Remove.
8631 (Incremental_inputs::report_archive_begin): New function.
8632 (Incremental_inputs::report_archive_end): New function.
8633 (Incremental_inputs::report_object): New function.
8634 (Incremental_inputs::finalize_inputs): Remove.
8635 (Incremental_inputs::report_input_section): New function.
8636 (Incremental_inputs::report_script): Rewrite.
8637 (Incremental_inputs::finalize): Do nothing but finalize string table.
8638 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8639 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8640 (Incremental_inputs::create_data_sections): New function.
8641 (Incremental_inputs::relocs_entsize): New function.
8642 (Output_section_incremental_inputs::set_final_data_size): New function.
8643 (Output_section_incremental_inputs::do_write): New function.
8644 (Output_section_incremental_inputs::write_header): New function.
8645 (Output_section_incremental_inputs::write_input_files): New function.
8646 (Output_section_incremental_inputs::write_info_blocks): New function.
8647 (Output_section_incremental_inputs::write_symtab): New function.
8648 * incremental.h (Incremental_script_entry): Forward declaration.
8649 (Incremental_object_entry): Forward declaration.
8650 (Incremental_archive_entry): Forward declaration.
8651 (Incremental_inputs): Forward declaration.
8652 (Incremental_inputs_header_data): Remove.
8653 (Incremental_inputs_header): Remove.
8654 (Incremental_inputs_header_write): Remove.
8655 (Incremental_inputs_entry_data): Remove.
8656 (Incremental_inputs_entry): Remove.
8657 (Incremental_inputs_entry_write): Remove.
8658 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
8659 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
8660 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8661 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
8662 Likewise.
8663 (Incremental_input_entry): New class.
8664 (Incremental_script_entry): New class.
8665 (Incremental_object_entry): New class.
8666 (Incremental_archive_entry): New class.
8667 (Incremental_inputs::Incremental_inputs): Initialize new data members.
8668 (Incremental_inputs::report_inputs): Remove.
8669 (Incremental_inputs::report_archive): Remove.
8670 (Incremental_inputs::report_archive_begin): New function.
8671 (Incremental_inputs::report_archive_end): New function.
8672 (Incremental_inputs::report_object): Change prototype.
8673 (Incremental_inputs::report_input_section): New function.
8674 (Incremental_inputs::report_script): Change prototype.
8675 (Incremental_inputs::get_reloc_count): New function.
8676 (Incremental_inputs::set_reloc_count): New function.
8677 (Incremental_inputs::create_data_sections): New function.
8678 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8679 (Incremental_inputs::inputs_section): New function.
8680 (Incremental_inputs::symtab_section): New function.
8681 (Incremental_inputs::relocs_section): New function.
8682 (Incremental_inputs::get_stringpool): Add const.
8683 (Incremental_inputs::command_line): Add const.
8684 (Incremental_inputs::inputs): Remove.
8685 (Incremental_inputs::command_line_key): New function.
8686 (Incremental_inputs::input_file_count): New function.
8687 (Incremental_inputs::input_files): New function.
8688 (Incremental_inputs::relocs_entsize): New function.
8689 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8690 (Incremental_inputs::finalize_inputs): Remove.
8691 (Incremental_inputs::Input_info): Remove.
8692 (Incremental_inputs::lock_): Remove.
8693 (Incremental_inputs::inputs_): Change type.
8694 (Incremental_inputs::inputs_map_): Remove.
8695 (Incremental_inputs::current_object_entry_): New data member.
8696 (Incremental_inputs::inputs_section_): New data member.
8697 (Incremental_inputs::symtab_section_): New data member.
8698 (Incremental_inputs::relocs_section_): New data member.
8699 (Incremental_inputs::reloc_count_): New data member.
8700 (Incremental_inputs_reader): New class.
8701 (Incremental_symtab_reader): New class.
8702 (Incremental_relocs_reader): New class.
8703 * layout.cc (Layout::finalize): Move finalization of incremental info
8704 and creation of incremental info sections to follow finalization of
8705 symbol table. Set offsets for postprocessing sections.
8706 (Layout::create_incremental_info_sections): Call
8707 Incremental_inputs::create_data_sections. Add incremental symtab
8708 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
8709 sections to layout after input sections.
8710 * layout.h (struct Timespec): Forward declaration.
8711 (Layout::incremental_inputs): Add const.
8712 (Layout::create_incremental_info_sections): Add parameter.
8713 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
8714 * object.cc: Include incremental.h.
8715 (Relobj::finalize_incremental_relocs): New function.
8716 (Sized_relobj::do_layout): Record input sections in incremental info.
8717 * object.h (Object::output_section): New function.
8718 (Object::output_section_offset): Moved from Relobj.
8719 (Object::get_incremental_reloc_base): New function.
8720 (Object::get_incremental_reloc_count): New function.
8721 (Object::do_output_section): New function.
8722 (Object::do_output_section_offset): Moved from Relobj.
8723 (Object::do_get_incremental_reloc_base): New function.
8724 (Object::do_get_incremental_reloc_count): New function.
8725 (Object::Object): Initialize new data members.
8726 (Relobj::output_section): Renamed do_output_section and moved to
8727 protected.
8728 (Relobj::output_section_offset): Moved to Object.
8729 (Relobj::do_get_incremental_reloc_base): New function.
8730 (Relobj::do_get_incremental_reloc_count): New function.
8731 (Relobj::allocate_incremental_reloc_counts): New function.
8732 (Relobj::count_incremental_reloc): New function.
8733 (Relobj::finalize_incremental_relocs): New function.
8734 (Relobj::next_incremental_reloc_index): New function.
8735 (Relobj::reloc_counts_): New data member.
8736 (Relobj::reloc_bases_): New data member.
8737 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
8738 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
8739 (Sized_relobj::incremental_relocs_scan): New function.
8740 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8741 (Sized_relobj::incremental_relocs_write): New function.
8742 (Sized_relobj::incremental_relocs_write_reltype): New function.
8743 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
8744 incremental link.
8745 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
8746 archives and object files elsewhere.
8747 (Add_symbols::run): Report object files here.
8748 (Finish_group::run): Report end of archive at end of group.
8749 * reloc.cc: Include layout.h, incremental.h.
8750 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
8751 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
8752 (Sized_relobj::incremental_relocs_scan): New function.
8753 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8754 (Sized_relobj::do_relocate_sections): Write incremental relocations.
8755 (Sized_relobj::incremental_relocs_write): New function.
8756 (Sized_relobj::incremental_relocs_write_reltype): New function.
8757 * script.cc (read_input_script): Rewrite test for incremental link.
8758 Change call to Incremental_inputs::report_script.
8759 * symtab.h (Symbol_table::first_global_index): New function.
8760 (Symbol_table::output_count): New function.
8761
ce0d1972
DK
87622010-08-12 Doug Kwan <dougkwan@google.com>
8763
8764 * arm.cc (Target_arm::merge_object_attributes): Check command line
8765 options --no-wchar-size-warning and --no-enum-size-warning.
8766 * options.h (General_options): Add ld-compatible options
8767 --no-enum-size-warning and --no-wchar-size-warning.
8768
6e5710ce
ILT
87692010-08-04 Ian Lance Taylor <iant@google.com>
8770
8771 * x86_64.cc (Target_x86_64::Scan::local): Use
8772 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
8773 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
8774 (Target_x86_64::Scan::global): Likewise.
8775 (Target_x86_64::Relocate::relocate): Likewise.
8776 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
8777 Likewise.
8778
fef830db
CC
87792010-08-03 Cary Coutant <ccoutant@google.com>
8780
8781 * merge.cc (Output_merge_string::do_add_input_section): Count strings
8782 to reserve space in merged_strings vector. Keep total input size
8783 for stats.
8784 (Output_merge_string::do_print_merge_stats): Print total input size.
8785 * merge.h (Output_merge_string): Add input_size_ field.
8786 * stringpool.cc (Stringpool_template::string_length): Move
8787 implementations out of Stringpool_template class and place in
8788 stringpool.h.
8789 * stringpool.h (string_length): Move out of Stringpool_template.
8790
1e3811b0
ILT
87912010-08-03 Ian Lance Taylor <iant@google.com>
8792
8793 PR 11712
8794 * layout.cc (relaxation_loop_body): If address of load segment is
8795 set, adjust address to include headers if possible.
8796
7af0c620
ILT
87972010-08-03 Ian Lance Taylor <iant@google.com>
8798
8799 * version.cc (version_string): Bump to 1.10.
8800
22f0da72
ILT
88012010-08-03 Ian Lance Taylor <iant@google.com>
8802
8803 PR 11805
8804 * layout.h (enum Output_section_order): Define.
8805 (class Layout): Update declarations.
8806 * layout.cc (Layout::get_output_section): Add order parameter.
8807 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
8808 is_first_non_relro parameters. Change all callers.
8809 (Layout::choose_output_section): Likewise.
8810 (Layout::add_output_section_data): Likewise.
8811 (Layout::make_output_section): Likewise. Set order.
8812 (Layout::default_section_order): New function.
8813 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
8814 * output.cc (Output_section::Output_section): Initialize order_.
8815 Don't initialize deleted fields.
8816 (Output_segment::Output_segment): Don't initialize deleted
8817 fields.
8818 (Output_segment::add_output_section_to_load): New function
8819 replacing add_output_section. Change all callers to call this or
8820 add_output_section_to_nonload.
8821 (Output_segment::add_output_section_to_nonload): New function.
8822 (Output_segment::remove_output_section): Rewrite.
8823 (Output_segment::add_initial_output_data): Likewise.
8824 (Output_segment::has_any_data_sections): Likewise.
8825 (Output_segment::is_first_section_relro): Likewise.
8826 (Output_segment::maximum_alignment): Likewise.
8827 (Output_segment::has_dynamic_reloc): New function replacing
8828 dynamic_reloc_count. Change all callers.
8829 (Output_segment::has_dynamic_reloc_list): New function replacing
8830 dynamic_reloc_count_list. Change all callers.
8831 (Output_segment::set_section_addresses): Rewrite.
8832 (Output_segment::set_offset): Rewrite.
8833 (Output_segment::find_first_and_last_list): Remove.
8834 (Output_segment::set_tls_offsets): Rewrite.
8835 (Output_segment::first_section_load_address): Likewise.
8836 (Output_segment::output_section_count): Likewise.
8837 (Output_segment::section_with_lowest_load_address): Likewise.
8838 (Output_segment::write_section_headers): Likewise.
8839 (Output_segment::print_sections_to_map): Likewise.
8840 * output.h (class Output_data): Remove dynamic_reloc_count_
8841 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
8842 (Output_data::add_dynamic_reloc): Rewrite.
8843 (Output_data::has_dynamic_reloc): New function.
8844 (Output_data::dynamic_reloc_count): Remove.
8845 (class Output_section): Add order_ field. Remvoe is_relro_local_,
8846 is_last_relro_, is_first_non_relro_, is_interp_,
8847 is_dynamic_linker_section_ fields. Add order and set_order
8848 functions. Remove is_relro_local, set_is_relro_local,
8849 is_last_relro, set_is_last_relro, is_first_non_relro,
8850 set_is_first_non_relro functions, is_interp, set_is_interp,
8851 is_dynamic_linker_section, and set_is_dynamic_linker_section
8852 functions.
8853 (class Output_segment): Change Output_data_list from std::list to
8854 std:;vector. Add output_lists_ field. Remove output_data_ and
8855 output_bss_ fields. Update declarations.
8856
3ff2ccb0
ILT
88572010-08-02 Ian Lance Taylor <iant@google.com>
8858
8859 * arm.cc (Target_arm::gc_process_relocs): Use typename.
8860 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
8861 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
8862
88a4108b
ILT
88632010-08-02 Ian Lance Taylor <iant@google.com>
8864
8865 PR 11855
8866 * script.cc (Script_options::Script_options): Initialize
8867 symbol_definitions_ and symbol_references_.
8868 (Script_options::add_symbol_assignment): Update
8869 symbol_definitions_ and symbol_references_.
8870 (Script_options::add_symbol_reference): New function.
8871 (script_symbol): New function.
8872 * script.h (class Script_options): Add symbol_definitions_ and
8873 symbol_references_ fields.
8874 (Script_options::referenced_const_iterator): New type.
8875 (Script_options::referenced_begin): New function.
8876 (Script_options::referenced_end): New function.
8877 (Script_options::is_referenced): New function.
8878 (Script_options::any_unreferenced): New function.
8879 * script-c.h (script_symbol): Declare.
8880 * yyscript.y (exp): Call script_symbol.
8881 * symtab.cc: Include "script.h".
8882 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
8883 Change all callers. Check symbols referenced by scripts.
8884 (Symbol_table::add_undefined_symbols_from_command_line): Add
8885 layout parameter. Change all callers.
8886 (Symbol_table::do_add_undefined_symbols_from_command_line):
8887 Likewise. Break out loop body. Check symbols referenced by
8888 scripts.
8889 (Symbol_table::add_undefined_symbol_from_command_line): New
8890 function broken out of
8891 do_add_undefined_symbols_from_command_line.
8892 * symtab.h (class Symbol_table): Update declarations.
8893 * archive.cc: Include "layout.h".
8894 (Archive::should_include_member): Add layout parameter. Change
8895 all callers. Check for symbol mentioned in expression.
8896 * archive.h (class Archive): Update declaration.
8897 * object.cc (Sized_relobj::do_should_include_member): Add layout
8898 parameter.
8899 * object.h (Object::should_include_member): Add layout parameter.
8900 Change all callers.
8901 (Object::do_should_include_member): Add layout parameter.
8902 (class Sized_relobj): Update declaration.
8903 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
8904 parameter.
8905 * dynobj.h (class Sized_dynobj): Update declaration.
8906 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
8907 layout parameter.
8908 * plugin.h (class Sized_pluginobj): Update declaration.
8909
5f1ab67a
ILT
89102010-08-02 Ian Lance Taylor <iant@google.com>
8911
8912 PR 11866
8913 * output.cc (Output_segment::set_offset): Search for the first and
8914 last sections rather than assuming that the list is in order.
8915 (Output_segment::find_first_and_last_list): New function.
8916 * output.h (class Output_segment): Update declarations.
8917 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
8918 (relro_strip_test_SOURCES): New variable.
8919 (relro_strip_test_DEPENDENCIES): New variable.
8920 (relro_strip_test_LDFLAGS): New variable.
8921 (relro_strip_test_LDADD): New variable.
8922 (relro_strip_test.so): New target.
8923
a8df5856
ILT
89242010-08-02 Ian Lance Taylor <iant@google.com>
8925
8926 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
8927 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
8928 (Target_i386::got_tlsdesc_section): New function.
8929 (Target_i386::got_section): Create space for GOT entries for
8930 TLSDESC relocations.
8931 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
8932 R_386_TLS_GOTDESC.
8933 (Target_i386::Scan::global): Likewise.
8934 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
8935 using TLSDESC GOT.
8936 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
8937 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
8938 (Target_x86_64::got_tlsdesc_section): New function.
8939 (Target_x86_64::got_section): Create space for GOT entries for
8940 TLSDESC relocations.
8941 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
8942 R_386_TLS_GOTDESC.
8943 (Target_x86_64::Scan::global): Likewise.
8944 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
8945 using TLSDESC GOT.
8946
0c10a0a6
ILT
89472010-08-02 Ian Lance Taylor <iant@google.com>
8948
8949 * testsuite/final_layout.sh: Use dc to convert from hex to
8950 decimal.
8951
41cbeecc
ST
89522010-07-29 Sriraman Tallam <tmsriram@google.com>
8953
8954 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
8955 paramter to the call to gold::gc_process_relocs.
8956 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
8957 paramter to the call to gold::gc_process_relocs.
8958 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
8959 parameter to the call to gold::gc_process_relocs.
8960 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
8961 template parameter to the call to gold::gc_process_relocs.
8962 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
8963 paramter to the call to gold::gc_process_relocs.
8964 * gc.h (get_embedded_addend_size): New function.
8965 (gc_process_relocs): Save the size of the reloc for use by ICF.
8966 * icf.cc (get_section_contents): Get the addend from the text section
8967 for SHT_REL relocation sections.
8968 * icf.h (Icf::Reloc_addend_size_info): New typedef.
8969 (Icf::Reloc_info): Add new member reloc_addend_size_info.
8970 * int_encoding.h (read_from_pointer): New overloaded function.
8971 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
8972 * testsuite/icf_sht_rel_addend_test.sh: New file.
8973 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
8974 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
8975
6ea55b82
RW
89762010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8977
8978 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
8979 * Makefile.in: Regenerate.
8980 * testsuite/Makefile.in: Regenerate.
8981
9691462b
ILT
89822010-07-27 Jeffrey Yasskin <jyasskin@google.com>
8983
8984 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
8985 * gold/testsuite/debug_msg.cc: Likewise.
8986 * gold/testsuite/odr_violation1.cc
8987 * gold/testsuite/odr_violation2.cc
8988
76897331
CC
89892010-07-21 Cary Coutant <ccoutant@google.com>
8990
8991 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
8992 string, and length fields.
8993 (Output_merge_string::Merged_strings_list): New type.
8994 (Output_merge_string::Merged_strings_lists): New typedef.
8995 (Output_merge_string): Replace merged_strings_ with
8996 merged_strings_lists_.
8997 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
8998 Merged_strings_list per input object and section. Don't store pointer
8999 to the string. Don't store length with each merged string entry.
9000 (Output_merge_string::finalize_merged_data): Loop over list of merged
9001 strings lists. Recompute length of each merged string.
9002
78384e8f
CC
90032010-07-15 Cary Coutant <ccoutant@google.com>
9004
9005 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
9006 here.
9007
783659f9
ILT
90082010-07-14 Ian Lance Taylor <iant@google.com>
9009
9010 * descriptors.cc (Descriptors::open): Report correct name in error
9011 message.
9012
131687b4
DK
90132010-07-13 Doug Kwan <dougkwan@google.com>
9014
9015 * arm.cc (Arm_input_section::Arm_input_section): For a
9016 SHT_ARM_EXIDX section, always keeps the input sections.
9017 (Arm_input_section::set_exidx_section_link): New method.
9018 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
9019 has_errors_ to false.
9020 (Arm_exidx_input_section::has_errors,
9021 Arm_exidx_input_section::set_has_errors): New methods.
9022 (Arm_exidx_input_section::has_errors_): New data member.
9023 (Arm_relobj::get_exidx_shndx_list): New method.
9024 (Arm_output_section::append_text_sections_to_list): Do not skip
9025 section without SHF_EXECINSTR.
9026 (Arm_output_section::fix_exidx_coverage): Skip input sections with
9027 errors.
2e702c99 9028 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
9029 section header. Make error messages more verbose. Check for
9030 a non-executable section linked to an EXIDX section.
9031 (Arm_relobj::do_read_symbols): Remove error checking, which has been
9032 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
9033 check that there is no deferred EXIDX section if we exit early.
9034 Instead of not making an EXIDX section in case of an error, make one
9035 and set the has_errors flag of it.
9036 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
9037 in a relocatable link.
9038 (Target_arm::do_relax): Look for the EXIDX output section instead of
9039 assuming that it is called .ARM.exidx.
2e702c99 9040 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
9041 section list. Do not check for SHF_EXECINSTR section flags but
9042 skip any input section with errors.
9043 * output.cc (Output_section::Output_section): Initialize
9044 always_keeps_input_sections_ to false.
9045 (Output_section::add_input_section): Check for
9046 always_keeps_input_sections_.
9047 * output.h (Output_section::always_keeps_input_sections,
9048 Output_section::set_always_keeps_input_sections): New methods.
9049 (Output_section::always_keeps_input_sections): New data member.
9050
69517287
RÁE
90512010-07-13 Rafael Espindola <espindola@google.com>
9052
9053 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
9054 * fileread.h (Input_file): Add try_extra_search_path and find_file.
9055
82742395
ILT
90562010-07-13 Philip Herron <herron.philip@googlemail.com>
9057 Ian Lance Taylor <iant@google.com>
9058
9059 * output.h (Output_section_lookup_maps::add_merge_section):
9060 Correct check of whether value was inserted.
9061 (Output_section_lookup_maps::add_merge_input_section): Likewise.
9062 (Output_section_lookup_maps::add_relaxed_input_section):
9063 Likewise.
9064 * arm.cc (Target_arm::got_section): Remove used local os.
9065 * i386.cc (Target_i386::got_section): Likewise.
9066 * x86_64.cc (Target_x86_64::got_section): Likewise.
9067 * sparc.cc (Target_sparc::got_section): Likewise.
9068 (Target_sparc::relocate): Remove unused local have_got_offset.
9069 * powerpc.cc (Target_powerpc::relocate): Likewise.
9070
f2d707b5
ILT
90712010-07-13 Ian Lance Taylor <iant@google.com>
9072
241531d6
ILT
9073 * compressed_output.cc (zlib_decompress): Fix signature in
9074 !HAVE_ZLIB_H case.
9075
f2d707b5
ILT
9076 * archive.cc (Archive::include_member): Unlock an external member
9077 of a thin archive. Don't bother to delete an object we know is
9078 NULL.
9079
a2e47362
CC
90802010-07-12 Cary Coutant <ccoutant@google.com>
9081
9082 * compressed_output.cc (zlib_decompress): New function.
9083 (get_uncompressed_size): New function.
9084 (decompress_input_section): New function.
9085 * compressed_output.h (get_uncompressed_size): New function.
9086 (decompress_input_section): New function.
9087 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
9088 Handle compressed debug sections.
9089 * layout.cc (is_compressed_debug_section): New function.
9090 (Layout::output_section_name): Map compressed section names to
9091 canonical names.
9092 * layout.h (is_compressed_debug_section): New function.
9093 (is_debug_info_section): Recognize compressed debug sections.
9094 * merge.cc: Include compressed_output.h.
9095 (Output_merge_data::do_add_input_section): Handle compressed
9096 debug sections.
9097 (Output_merge_string::do_add_input_section): Handle compressed
9098 debug sections.
9099 * object.cc: Include compressed_output.h.
9100 (Sized_relobj::Sized_relobj): Initialize new data members.
9101 (build_compressed_section_map): New function.
9102 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
9103 * object.h (Object::section_is_compressed): New method.
9104 (Object::do_section_is_compressed): New method.
9105 (Sized_relobj::Compressed_section_map): New type.
9106 (Sized_relobj::do_section_is_compressed): New method.
9107 (Sized_relobj::compressed_sections_): New data member.
9108 * output.cc (Output_section::add_input_section): Handle compressed
9109 debug sections.
9110 * reloc.cc: Include compressed_output.h.
9111 (Sized_relobj::write_sections): Handle compressed debug sections.
9112
ce279a62
CC
91132010-07-08 Cary Coutant <ccoutant@google.com>
9114
9115 * resolve.cc (Symbol_table::resolve): Remember whether undef was
9116 weak when resolving to a dynamic def.
9117 (Symbol_table::should_override): Add adjust_dyndef flag; set it
9118 for weak undef/dynamic def cases. Adjust callers.
9119 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
9120 undef_binding_weak_.
9121 (Symbol_table::sized_write_globals): Adjust symbol binding.
9122 (Symbol_table::sized_write_symbol): Add binding parameter.
9123 * symtab.h (Symbol::set_undef_binding): New method.
9124 (Symbol::is_undef_binding_weak): New method.
9125 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
9126 (Symbol_table::should_override): Add new parameter.
9127 (Symbol_table::sized_write_symbol): Add new parameter.
9128
9129 * testsuite/weak_undef_file1.cc: Add new test case.
9130 * testsuite/weak_undef_file2.cc: Fix header comment.
9131 * testsuite/weak_undef_test.cc: Add new test case.
9132
b2286c10
DK
91332010-06-29 Doug Kwan <dougkwan@google.com>
9134
9135 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
9136 Initialize USE_SYMBOL_.
9137 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
9138 definition.
9139 (Arm_reloc_property::uses_symbol_): New data member declaration.
9140 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
9141 uses symbol value and symbol is undefined but not weakly undefined.
9142
4802450a
RÁE
91432010-06-28 Rafael Espindola <espindola@google.com>
9144
9145 * plugin.cc (Plugin::load): Use dlerror.
9146
e5ca47ba
ILT
91472010-06-26 Jeffrey Yaskin <jyasskin@google.com>
9148
9149 * symtab.cc (detect_odr_violations): When reporting an ODR
9150 violation, report an object where the symbol is defined.
9151
8a75a161
DK
91522010-06-25 Doug Kwan <dougkwan@google.com>
9153
9154 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
9155 (Target_arm::section_may_have_icf_unsafe_pointers): New method
9156 definition.
9157 (Target_arm::Scan::local_reloc_may_be_function_pointer,
9158 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
9159 target hook to detect function points.
9160 (Target_arm::Scan::possible_function_pointer_reloc): New method.
9161 * icf.h (Icf::check_section_for_function_pointers): Change type of
9162 parameter SECTION_NAME to const reference to std::string. Use
9163 target hook to determine if section may have unsafe pointers.
9164 * target.h (Target::section_may_have_icf_unsafe_pointers): New
9165 method definition.
9166
42218b9f
RÁE
91672010-06-21 Rafael Espindola <espindola@google.com>
9168
9169 * fileread.cc (Input_file::find_fie): New
9170 (Input_file::open): Use Input_file::find_fie.
9171 * fileread.h (Input_file::find_fie): New
9172 * plugin.cc (set_extra_library_path): New.
9173 (Plugin::load): Add set_extra_library_path to the transfer vector.
9174 (Plugin_manager::set_extra_library_path): New.
9175 (Plugin_manager::add_input_file): Use the extra search path if set.
9176 (set_extra_library_path(): New.
9177 * plugin.h (Plugin_manager): Add set_extra_library_path and
9178 extra_search_path_.
9179
a0506cca
CC
91802010-06-19 Cary Coutant <ccoutant@google.com>
9181
9182 * layout.cc (gdb_sections): Add .debug_types.
9183 (lines_only_debug_sections): Likewise.
9184
6508b958
RÁE
91852010-06-18 Rafael Espindola <espindola@google.com>
9186
9187 * plugin.cc (add_input_file,add_input_library)
9188 (Plugin_manager::add_input_file): Make filename arguments const.
9189 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
9190 const.
9191
3e235302
DK
91922010-06-16 Doug Kwan <dougkwan@google.com>
9193
9194 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
9195 .ARM.attributes section if we have not merged any input
9196 attributes sections.
9197
106e8a6c
DK
91982010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9199
9200 * arm.cc: Allow combining objects with no EABI version
9201 information.
9202
91ff43fe
RÁE
92032010-06-15 Rafael Espindola <espindola@google.com>
9204
9205 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
9206
68ed838c
ILT
92072010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9208
9209 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
9210 (struct iovec): Correct !HAVE_READV definition.
9211
f3a2388f
CC
92122010-06-10 Cary Coutant <ccoutant@google.com>
9213
9214 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
9215 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
9216 reloc sections.
9217 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
9218
9219 PR 11683
9220 * symtab.h (Symbol::is_placeholder): New member function.
9221 * target-reloc.h (relocate_section): Check for placeholder symbols.
9222
9223 * testsuite/Makefile.am (plugin_test_8): New test.
9224 (plugin_test_9): New test.
9225 * testsuite/Makefile.in: Regenerate.
9226
e1df38aa
NC
92272010-06-09 Nick Clifton <nickc@redhat.com>
9228
9229 * yyscript.y (input_list_element): Allow strings prefixed with
9230 the '-' character. Treat these as libraries.
9231 * script.cc (script_add_library): New function. Adds a library
9232 specified by "-l<name>" found in an input script.
9233 * script-c.h: Add prototype for script_add_library.
9234
25bbe950
DK
92352010-06-07 Doug Kwan <dougkwan@google.com>
9236
9237 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
9238 Restrict stub-group size to be within long conditional branch
9239 range when working around cortex-A8 erratum.
9240
0f32ea4c
ILT
92412010-06-07 Damien Diederen <dd@crosstwine.com>
9242
9243 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
9244 #ifdef typo.
9245
8fe2a369
ST
92462010-06-03 Sriraman Tallam <tmsriram@google.com>
9247
9248 PR gold/11658
9249 * output.cc
9250 (Output_section::Input_section_sort_entry::compare_section_ordering):
9251 Change to return non-zero correctly.
9252 (Output_section::Input_section_sort_section_order_index_compare
9253 ::operator()): Change to fix ambiguity in comparisons.
9254
6e9ba2ca
ST
92552010-06-01 Sriraman Tallam <tmsriram@google.com>
9256
9257 * gold.h (is_wildcard_string): New function.
9258 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
9259 (Layout::layout_eh_frame): Ditto.
9260 (Layout::find_section_order_index): New method.
9261 (Layout::read_layout_from_file): New method.
9262 * layout.h (Layout::find_section_order_index): New method.
9263 (Layout::read_layout_from_file): New method.
9264 (Layout::input_section_position_): New private member.
9265 (Layout::input_section_glob_): New private member.
9266 * main.cc (main): Call read_layout_from_file here.
9267 * options.h (--section-ordering-file): New option.
9268 * output.cc (Output_section::input_section_order_specified_): New
9269 member.
9270 (Output_section::Output_section): Initialize new member.
9271 (Output_section::add_input_section): Add new parameter.
9272 Keep input sections when --section-ordering-file is used.
9273 (Output_section::set_final_data_size): Sort input sections when
9274 section ordering file is specified.
9275 (Output_section::Input_section_sort_entry): Add new parameter.
9276 Check sorting type.
9277 (Output_section::Input_section_sort_entry::compare_section_ordering):
9278 New method.
9279 (Output_section::Input_section_sort_compare::operator()): Change to
9280 consider section_order_index.
9281 (Output_section::Input_section_sort_init_fini_compare::operator()):
9282 Change to consider section_order_index.
9283 (Output_section::Input_section_sort_section_order_index_compare
9284 ::operator()): New method.
9285 (Output_section::sort_attached_input_sections): Change to sort
9286 according to section order when specified.
e1df38aa
NC
9287 (Output_section::add_input_section<32, true>): Add new parameter.
9288 (Output_section::add_input_section<64, true>): Add new parameter.
9289 (Output_section::add_input_section<32, false>): Add new parameter.
9290 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
9291 * output.h (Output_section::add_input_section): Add new parameter.
9292 (Output_section::input_section_order_specified): New
9293 method.
9294 (Output_section::set_input_section_order_specified): New method.
9295 (Input_section::Input_section): Initialize section_order_index_.
9296 (Input_section::section_order_index): New method.
9297 (Input_section::set_section_order_index): New method.
9298 (Input_section::section_order_index_): New member.
9299 (Input_section::Input_section_sort_section_order_index_compare): New
9300 struct.
9301 (Output_section::input_section_order_specified_): New member.
9302 * script-sections.cc (is_wildcard_string): Delete and move modified
9303 method to gold.h.
9304 (Output_section_element_input::Output_section_element_input): Modify
9305 call to is_wildcard_string.
9306 (Output_section_element_input::Input_section_pattern
9307 ::Input_section_pattern): Ditto.
9308 (Output_section_element_input::Output_section_element_input): Ditto.
9309 * testsuite/Makefile.am (final_layout): New test case.
9310 * testsuite/Makefile.in: Regenerate.
9311 * testsuite/final_layout.cc: New file.
9312 * testsuite/final_layout.sh: New file.
9313
3537c84b
RÁE
93142010-06-01 Rafael Espindola <espindola@google.com>
9315
9316 * plugin.cc (Plugin::load): Pass the output name to the plugin.
9317
105b6afd
RÁE
93182010-06-01 Rafael Espindola <espindola@google.com>
9319
9320 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
9321 visibility of symbols.
9322
29e11421
DK
93232010-05-27 Doug Kwan <dougkwan@google.com>
9324
9325 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
9326 from start of output section instead of address for a local symbol
9327 in a merged or relaxed section when doing a relocatable link.
9328
5e0f337e
RÁE
93292010-05-26 Rafael Espindola <espindola@google.com>
9330
703d02da 9331 PR 11604
5e0f337e
RÁE
9332 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
9333 adding sections the garbage collector removed.
9334 * gold/testsuite/Makefile.am: Add test.
9335 * gold/testsuite/Makefile.in: Regenerate.
9336 * gold/testsuite/plugin_test_7.sh: New.
9337 * gold/testsuite/plugin_test_7_1.c: New.
9338 * gold/testsuite/plugin_test_7_2.c: New.
9339
f4187277
RÁE
93402010-05-26 Rafael Espindola <espindola@google.com>
9341
9342 * script-sections.cc (Output_section_definition::set_section_addresses):
9343 Check for --section-start.
9344
5c388529
DK
93452010-05-26 Doug Kwan <dougkwan@google.com>
9346
9347 * arm.cc (Arm_scan_relocatable_relocs): New class.
9348 (Target_arm::relocate_special_relocatable): New method.
9349 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
9350 (Arm_relocate_functions::thumb_branch_common): Same.
9351 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
9352 instead of Default_scan_relocatable_relocs.
9353 * target-reloc.h (relocate_for_relocatable): Let target handle
9354 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
9355 * target.h (Sized_target::relocate_special_relocatable): New method.
9356
bca1c3ae
ILT
93572010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9358
9359 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
9360
0439c796
DK
93612010-05-23 Doug Kwan <dougkwan@google.com>
9362
9363 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
9364 instead of a cast.
9365 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
9366 with a direct branch, not a conditional branch, to a stub.
9367 * merge.cc (Output_merge_base::record_input_section): New method
9368 defintion.
9369 (Output_merge_data::do_add_input_section): Record input section if
9370 keeps-input-sections flag is set.
9371 (Output_merge_string::do_add_input_section): Ditto.
9372 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
9373 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
9374 INPUT_SECTIONS_.
9375 (Output_merge_base::keeps_input_sections,
9376 Output_merge_base::set_keeps_input_sections,
9377 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
9378 method definitions.
9379 (Output_merge_base::Input_sections): New type declaration.
9380 (Output_merge_base::input_sections_begin,
9381 Output_merge_base::input_sections_end,
9382 Output_merge_base::do_set_keeps_input_sections): New method definitions.
9383 (Output_merge_base::bool keeps_input_sections_,
9384 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
9385 Output_merge_base::input_sections_): New data members.
9386 (Output_merge_data::do_set_keeps_input_sections): New method
9387 defintion.
9388 (Output_merge_string::do_set_keeps_input_sections): Ditto.
9389 * output.cc (Output_section::Input_section::relobj): Move method
9390 defintion from class declaration to here and handle merge sections.
9391 (Output_section::Input_section::shndx): Ditto.
9392 (Output_section::Output_section): Remove initializations of removed
9393 data members and initialize new data member LOOKUP_MAPS_.
9394 (Output_section::add_input_section): Set keeps-input-sections flag
9395 for a newly created merge output section as appropriate. Adjust code
9396 to use Output_section_lookup_maps class.
9397 (Output_section::add_relaxed_input_section): Adjst code for lookup
9398 maps code refactoring.
2e702c99 9399 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
9400 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
9401 class. If adding input section to a newly created merge output
9402 section fails, remove the new merge section.
9403 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 9404 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 9405 (Output_section::find_merge_section): Ditto.
0439c796 9406 (Output_section::build_lookup_maps): New method defintion.
2e702c99 9407 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
9408 Output_section_lookup_maps class.
9409 (Output_section::get_input_sections): Export merge sections. Adjust
9410 code to use Output_section_lookup_maps class.
9411 (Output_section:::add_script_input_section): Adjust code to use
9412 Output_section_lookup_maps class. Update lookup maps for merge
9413 sections also.
9414 (Output_section::discard_states): Use Output_section_lookup_maps.
9415 (Output_section::restore_states): Same.
9416 * output.h (Merge_section_properties): Move class defintion out of
9417 Output_section.
9418 (Output_section_lookup_maps): New class.
9419 (Output_section::Input_section::is_merge_section): New method
9420 defintion.
9421 (Output_section::Input_section::relobj): Move defintion out of class
9422 defintion. Declare method only.
9423 (Output_section::Input_section::shndx): Ditto.
9424 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 9425 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
9426 (Output_section::Merge_section_by_properties_map,
9427 Output_section::Output_section_data_by_input_section_map,
9428 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
9429 Remove types.
2e702c99 9430 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
9431 KEEPS_INPUT_SECTIONS.
9432 (Output_section::build_lookup_maps): New method declaration.
9433 (Output_section::merge_section_map_,
9434 Output_section::merge_section_by_properties_map_,
9435 Output_section::relaxed_input_section_map_,
9436 Output_section::is_relaxed_input_section_map_valid_): Remove data
9437 members.
9438 (Output_section::lookup_maps_): New data member.
9439
76295588
L
94402010-05-21 Doug Kwan <dougkwan@google.com>
9441
9442 PR gold/11619
9443 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
9444 avoid a compilation error.
9445
d103a984
RÁE
94462010-05-19 Rafael Espindola <espindola@google.com>
9447
9448 * script-sections.cc (Output_section_definition::allocate_to_segment):
9449 Update the phdrs_list even when the output section is NULL.
9450 * testsuite/Makefile.am: Add test.
9451 * testsuite/Makefile.in: Regenerate.
9452 * testsuite/script_test_9.cc: New.
9453 * testsuite/script_test_9.sh: New.
9454 * testsuite/script_test_9.t: New.
9455
6625d24e
DK
94562010-05-19 Doug Kwan <dougkwan@google.com>
9457
9458 * arm.cc (Arm_input_section::original_size): New method.
9459 (Arm_input_section::do_addralign): Add a cast.
9460 (Arm_input_section::do_output_offset): Remove static cast.
9461 (Arm_input_section::original_addralign,
9462 Arm_input_section::original_size_): Change type to uint32_t.
9463 (Arm_input_section::init): Add safe casts for section alignment
9464 and size.
9465 (Arm_input_section::set_final_data_size): Do not set address and
9466 offset of stub table.
9467 (Arm_output_section::fix_exidx_coverage): Change use of of
9468 Output_section::Simple_input_section to that of
9469 Output_section::Input_section.
9470 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
9471 except for the first pass.
9472 * output.cc (Output_section::get_input_sections): Change type of
9473 input_sections to std::list<Input_section>.
9474 (Output_section::add_script_input_section): Rename from
9475 Output_section::add_simple_input_section. Change type of SIS
9476 parameter from Simple_input_section to Input_section.
9477 * output.h (Output_section::Simple_input_section): Remove class.
9478 (Output_section::Input_section): Change class visibility to public.
9479 (Output_section::Input_section::addralign): Use stored alignments
9480 for special input sections if set.
9481 (Output_section::Input_section::set_addralign): New method.
9482 (Output_section::get_input_sections): Change parameter type from
9483 list of Simple_input_section to list of Input_section.
9484 (Output_section::add_script_input_section): Rename from
9485 Output_section::add_simple_input_section. Change first parameter's
9486 type from Simple_input_section to Input_section and remove the
9487 second and third parameters.
9488 * script-sections.cc (Input_section::Input_section_list): Change
9489 type to list of Output_section::Input_section/
9490 (Input_section_info::Input_section_info): Change parameter type of
9491 INPUT_SECTION to Output_section::Input_section.
9492 (Input_section_info::input_section): Change return type.
9493 (Input_section_info::input_section_): Change type to
9494 Output_section::Input_section.
9495 (Output_section_element_input::set_section_addresses): Adjust code
9496 to use Output_section::Input_section instead of
9497 Output_section::Simple_input_section. Adjust code for renaming
9498 of Output_section::add_simple_input_section.
9499 (Orphan_output_section::set_section_addresses): Ditto.
9500
e1e82ea4
RW
95012010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9502
9503 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
9504 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
9505
91e75c8a
RÁE
95062010-05-18 Rafael Espindola <espindola@google.com>
9507
9508 * options.cc (General_options::finalize): Handle -nostdlib.
9509 * options.h (nostdlib): New option.
9510 * script.cc (script_add_search_dir): Handle -nostdlib.
9511
da59ad79
DK
95122010-05-12 Doug Kwan <dougkwan@google.com>
9513
9514 * arm.cc (Target_arm::do_finalize_sections): Create an empty
9515 attributes section only if there no attributes section after merging.
9516 (Target_arm::merge_object_attributes): Move value of
e1df38aa 9517 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
9518 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
9519 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
9520 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
9521 and arm_attr_merge_7.stdout.
9522 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
9523 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
9524 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
9525 arm_attr_merge_7b.o): New rules.
9526 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
9527 arm_attr_merge_7
9528 * testsuite/Makefile.in: Regenerate.
9529 * testsuite/arm_attr_merge.sh: New file.
9530 * testsuite/arm_attr_merge_[67][ab].s: Same.
9531
3e01a7fd
NC
95322010-05-05 Nick Clifton <nickc@redhat.com>
9533
9534 * po/es.po: Updated Spanish translation.
9535
7ad2014a
L
95362010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9537
9538 * Makefile.am (install-exec-local): Properly install gold as
9539 default cross linker.
9540 * Makefile.in: Regenerated.
9541
4fda8867
NC
95422010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9543 Nick Clifton <nickc@redhat.com>
9544
9545 * configure.ac (install_as_default): Define and set to false
9546 unless --enable-gold or --enable-gold=both/gold has been
9547 specified.
9548 * configure: Regenerate.
9549
9550 * Makefile.am (install-exec-local): Install the executable as
9551 'ld.gold'. If install_as_default is true then also install it as
9552 'ld'.
9553 * Makefile.in: Regenerated.
9554
bd288ea2
ILT
95552010-04-24 Ian Lance Taylor <iant@google.com>
9556
9557 * layout.cc (Layout::layout_reloc): In relocatable link don't
9558 combine reloc sections for grouped sections.
9559
ef38fd8a
ST
95602010-04-23 Sriraman Tallam <tmsriram@google.com>
9561
9562 * gc.h (gc_process_relocs): Pass information on relocs pointing to
9563 sections that are not ordinary to icf.
9564 * icf.cc (get_section_contents): Handle relocation pointing to section
9565 with no object or shndx information.
9566 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
9567 * testsuite/Makefile.in: Regenerate.
9568 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
9569 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
9570
f6973bdc
ILT
95712010-04-22 Ian Lance Taylor <iant@google.com>
9572
9573 * expression.cc (Expression::Expression_eval_info): Add
9574 result_alignment_pointer field.
9575 (Expression::eval_with_dot): Add result_alignment_pointer
9576 parameter. Change all callers.
9577 (Expression::eval_maybe_dot): Likewise.
9578 (class Binary_expression): Add alignment_pointer parameter to
9579 left_value and right_value. Change all callers.
9580 (BINARY_EXPRESSION): Set result alignment.
9581 (class Trinary_expression): Add alignment_pointer parameter to
9582 arg2_value and arg3_value. Change all callers.
9583 (Trinary_cond::value): Set result alignment.
9584 (Max_expression::value, Min_expression::value): Likewise.
9585 (Align_expression::value): Likewise.
9586 * script-sections.cc (class Sections_element): Add dot_alignment
9587 parameter to set_section_addresses virtual function. Update
9588 instantiations.
9589 (class Output_section_element): Likewise.
9590 (Script_sections::create_segments): Add dot_alignment parameter.
9591 Change all callers.
9592 (Script_sections::create_segments_from_phdrs_clause): Likewise.
9593 (Script_sections::set_phdrs_clause_addresses): Likewise.
9594 * script-sections.h: Update declarations.
9595 * script.h: Update declarations.
9596 * output.h (Output_segment::set_minimum_p_align): Don't decrease
9597 min_p_align.
9598 * testsuite/script_test_3.t: Set large alignment.
9599 * testsuite/script_test_3.sh: Make sure that at least one LOAD
9600 segment has expected alignment.
9601
9c9c98a5
NC
96022010-04-22 Nick Clifton <nickc@redhat.com>
9603
9604 * po/gold.pot: Updated by the Translation project.
9605 * po/vi.po: Updated Vietnamese translation.
9606
2253bfba
L
96072010-04-22 H.J. Lu <hongjiu.lu@intel.com>
9608
9609 * testsuite/Makefile.am (check_PROGRAMS): Add
9610 icf_virtual_function_folding_test.
9611 * testsuite/Makefile.in: Regenerated.
9612
85fdf906
AH
96132010-04-15 Andrew Haley <aph@redhat.com>
9614
9615 * options.h (merge_exidx_entries): New option.
9616 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
9617 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
9618 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
9619 (Target_arm::merge_exidx_entries): New function.
9620 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
9621 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
9622 to Arm_exidx_fixup constructor.
9623 Add new arg, merge_exidx_entries.
9624 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
9625 Arm_output_section::fix_exidx_coverage.
9626
ce97fa81
ST
96272010-04-18 Sriraman Tallam <tmsriram@google.com>
9628
9629 * icf.cc (get_section_contents): Check for preemptible functions.
9630 Ignore addend when appropriate.
9631 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
9632 section folded.
9633 (add_from_relobj): Check for section folded.
9634 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
9635 * symtab.h (should_add_dynsym_entry): Add new parameter.
9636 * target-reloc.h (scan_relocs): Check for section folded.
9637 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
9638 Check reloc types for function pointers in shared objects.
9639 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
9640 case.
9641 (icf_preemptible_functions_test): New test case.
9642 (icf_string_merge_test): New test case.
9643 * testsuite.Makefile.in: Regenerate.
9644 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
9645 bar_glob. Refactor code.
9646 * testsuite/icf_preemptible_functions_test.cc: New file.
9647 * testsuite/icf_preemptible_functions_test.sh: New file.
9648 * testsuite/icf_string_merge_test.cc: New file.
9649 * testsuite/icf_string_merge_test.sh: New file.
9650 * testsuite/icf_virtual_function_folding_test.cc: New file.
9651 * testsuite/icf_virtual_function_folding_test.sh: New file.
9652
04ceb17c
DK
96532010-04-14 Doug Kwan <dougkwan@google.com>
9654
9655 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
9656 for local symbol recounting if we remove a section due to ICF.
9657 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
9658 there are no regular objects in input.
9659
153e7da4
DK
96602010-04-13 Doug Kwan <dougkwan@google.com>
9661
9662 * arm.cc (Arm_input_section::set_final_data_size): Compute
9663 accurate final data size instead of using current data size.
9664
4dbd9faf
DK
96652010-04-09 Doug Kwan <dougkwan@google.com>
9666
9667 * layout.cc (Layout::choose_output_section): Handle script section
9668 types.
9669 (Layout::make_output_section_for_script): Add section type parameter.
9670 Handle script section types.
9671 * layout.h (Layout::make_output_section_for_script): Add section
9672 type parameter.
9673 * output.cc (Output_section::Output_section): Initialize data member
9674 is_noload_.
9675 (Output_section::do_reset_address_and_file_offset): Do not set address
9676 to 0 if section is a NOLOAD section.
9677 * output.h (Output_section::is_noload): New method.
9678 (Output_section::set_is_noload): Ditto.
9679 (Output_section::is_noload_): New data member.
9680 * script-c.h (Script_section_type): New enum type.
9681 (struct Parser_output_section_header): Add new file section_type.
9682 * script-sections.cc (Sections_element::output_section_name): Add
9683 parameter for returning script section type.
9684 (Output_section_definition::output_section_name): Ditto.
9685 (Output_section_definition::section_type)P; New method.
9686 (Output_section_definiton::script_section_type_name): Ditto.
9687 (Output_section_definition::script_section_type_): New data member.
9688 (Output_section_definition::Output_section_definition): Initialize
9689 data member Output_section_definition::script_section_type_.
9690 (Output_section_definition::create_sections): Pass script section type
9691 to Layout::make_output_section_for_script.
9692 (Output_section_definition::output_section_name): Return script
9693 section type to caller.
9694 (Output_section_definition::set_section_address): Do not advance
9695 dot value and load address if section type is NOLOAD. Set address
9696 of NOLOAD sections regardless of section flags.
9697 (Output_section_definition::print): Print section type if it is
9698 not SCRIPT_SECTION_TYPE_NONE.
9699 (Output_section_definition::section_type): New method.
9700 (Output_section_definition::script_section_type_name): Ditto.
9701 (Script_sections::output_section_name): Add new parameter
9702 PSECTION_TYPE for returning script section type. Pass it to
9703 section elements. Handle discard sections.
9704 (Sort_output_sections::operator()): Handle NOLOAD sections.
9705 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 9706 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
9707 returning script section type.
9708 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
9709 INFO and NOLOAD.
9710 * yyscript.y (union): Add new field SECTION_TYPE.
9711 (COPY, DSECT, INFO, NOLOAD): New tokens.
9712 (opt_address_and_section_type): Change type to output_section_header.
9713 (section_type): New non-terminal
9714 (section_header): Handle section type.
2253bfba 9715 (opt_address_and_section_type): Return section type value.
4dbd9faf 9716
721ea635
L
97172010-04-09 H.J. Lu <hongjiu.lu@intel.com>
9718
9719 * testsuite/plugin_common_test_1.c (foo): Add prototype.
9720 * testsuite/plugin_common_test_2.c (foo): Likewise.
9721
6bf924b0
DK
97222010-04-08 Doug Kwan <dougkwan@google.com>
9723
9724 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
9725 Output_merge_data.
9726 * output.cc (Output_section::add_merge_input_section): Simplify
9727 code and return status of Output_merge_base::add_input_section.
e1df38aa 9728 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
9729 returns true.
9730
24af6f92
DK
97312010-04-07 Doug Kwan <dougkwan@google.com>
9732
9733 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
9734 if section is marked as containing instructions but has no mapping
9735 symbols.
9736 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
9737 correct section index.
9738 (Arm_relobj::find_linked_text_section): Ditto.
9739
00698fc5
CC
97402010-04-07 Cary Coutant <ccoutant@google.com>
9741
9742 * archive.cc (include_member): Destroy Read_symbols_data object before
9743 releasing file.
9744 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
9745 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
9746 (Read_symbols_data::~Read_symbols_data) New destructor.
9747 (Section_relocs::Section_relocs) New constructor.
9748 (Section_relocs::~Section_relocs) New destructor.
9749 (Read_relocs_data::Read_relocs_data) New constructor.
9750 (Read_relocs_data::~Read_relocs_data) New destructor.
9751 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
9752 pointers to NULL after deleting.
9753
7296d933
DK
97542010-04-07 Doug Kwan <dougkwan@google.com>
9755
9756 * arm.cc: Replace "endianity" with "endianness" in comments.
9757 (Arm_exidx_cantunwind): Ditto.
9758 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
9759 (Arm_relobj::merge_flags_and_attributes): New method.
9760 (Arm_relobj::merge_flags_and_attributes_): New data member.
9761 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
9762 (Arm_relobj::scan_sections_for_stubs): Ditto.
9763 (Arm_relobj::do_read_symbols): Check to see if we really want to
9764 merge processor-specific flags and attributes. Exit early if
9765 an object is empty except for section names and the undefined symbol.
9766 (Target_arm::do_finalize_sections): Move check for ELF format to
9767 Arm_relobj::do_read_symbols. Merge processor specific flags and
9768 attributes from a regular object only when we have determined that
9769 it is aapropriate. Do not create an .ARM.attributes section in
9770 output if there is no regular input object.
9771 (Target_arm::merge_processor_specific_flags): Check
9772 --warn-mismatch before printing any error.
9773 (Target_arm::merge_object_attributes): Ditto.
9774 * gold.cc (queue_middle_tasks): Handle the case in which there is
9775 no regular object in input.
9776 * options.cc (General_options::parse_EB): New method.
9777 (General_options::parse_EL): Same.
9778 (General_options::General_options): Initialize endianness_.
9779 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
9780 New options.
9781 (General_options::Endianness): New enum.
9782 (General_options::endianness): New method.
9783 (General_options::endianness_): New data member.
9784 * parameters.cc (Parameters::set_options): Check target endianness.
9785 (Parameters::set_target_once): Ditto.
9786 (Parameters::check_target_endianness): New method.
9787 (parameters_force_valid_target): If either -EL or -EB is specified,
9788 use it to define endianness of default target.
9789 * parameters.h (Parameters::check_target_endianness): New method
9790 declaration.
9791 * target.h (class Target): Change "endianity" to "endianness"
9792 in comments.
9793
efc8d4f2
RW
97942010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9795
9796 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
9797 * configure: Regenerate.
9798 * Makefile.in: Regenerate.
9799 * testsuite/Makefile.in: Regenerate.
9800
be234d88
CC
98012010-04-06 Cary Coutant <ccoutant@google.com>
9802
9803 gcc PR lto/42757
9804 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
9805 prevailing definitions of common symbols.
9806 * testsuite/plugin_test_6.sh: New test case.
9807 * testsuite/plugin_common_test_1.c: New test case.
9808 * testsuite/plugin_common_test_2.c: New test case.
9809 * testsuite/Makefile.am (plugin_test_6): New test case.
9810 * testsuite/Makefile.in: Regenerate.
9811
bd32c6bd
NC
98122010-04-06 Nick Clifton <nickc@redhat.com>
9813
9814 * po/vi.po: New Vietnamese translation.
9815
323c532f
DK
98162010-03-30 Doug Kwan <dougkwan@google.com>
9817
9818 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
9819
4fcd97eb
DK
98202010-03-25 Doug Kwan <dougkwan@google.com>
9821
9822 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
9823 to avoid a conversion warning on a 32-bit host.
9824
4ebf39db
ILT
98252010-03-24 Ian Lance Taylor <iant@google.com>
9826
9827 * testsuite/script_test_3.t: Add a TLS segment.
9828 * testsuite/Makefile.am (check_PROGRAMS): Add
9829 tls_phdrs_script_test.
9830 (tls_phdrs_script_test_SOURCES): Define.
9831 (tls_phdrs_script_test_DEPENDENCIES): Define.
9832 (tls_phdrs_script_test_LDFLAGS): Define.
9833 (tls_phdrs_script_test_LDADD): Define.
9834 * testsuite/Makefile.in: Rebuild.
9835
4a599bdd
CC
98362010-03-23 Cary Coutant <ccoutant@google.com>
9837
9838 * fileread.cc (find_or_make_view): Fix comment.
9839
6c93b22c
ILT
98402010-03-23 Ian Lance Taylor <iant@google.com>
9841
9842 * script-sections.cc (class Orphan_section_placement): Define
9843 PLACE_TLS and PLACE_TLS_BSS.
9844 (Orphan_section_placement::Orphan_section_placement): Initialize
9845 new places.
9846 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
9847 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
9848 (tls_script_test_SOURCES): Define.
9849 (tls_script_test_DEPENDENCIES): Define.
9850 (tls_script_test_LDFLAGS): Define.
9851 (tls_script_test_LDADD): Define.
9852 * testsuite/Makefile.in: Rebuild.
9853
a2c7281b
DK
98542010-03-22 Doug Kwan <dougkwan@google.com>
9855
9856 * arm.cc (Arm_relocate_functions::abs8,
9857 Arm_relocate_functions::abs16): Use correct check for overflow
9858 specified in the ARM ELF specs.
9859 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
9860 target of a BLX instruction specially.
9861 (Reloc_stub::stub_type_for_reloc): Ditto.
9862 (Relocate::relocate): Use symbolic names instead of numeric relocation
9863 codes to report error.
9864 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
9865 workaround.
9866 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
9867 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
9868 thumb2_blx_out_of_range.stdout
9869 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
9870 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
9871 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
9872 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
9873 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
9874 thumb2_blx_in_range, thumb2_blx_in_range.o,
9875 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
9876 thumb2_blx_out_of_range.o): New rules.
2e702c99 9877 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
9878 thumb2_blx_in_range and thumb2_blx_out_of_range.
9879 * testsuite/Makefile.in: Regenerate.
9880 * arm_branch_in_range.sh: Add tests for THUMB BLX.
9881 * testsuite/thumb_blx_in_range.s: New file.
9882 * testsuite/thumb_blx_out_of_range.s: New file.
9883
b0193076
RÁE
98842010-03-22 Rafael Espindola <espindola@google.com>
9885
9886 * archive.cc (Should_include): Move to archive.h.
9887 (should_include_member): Make it a member of Archive.
9888 (Lib_group): New.
9889 (Add_lib_group_symbols): New.
9890 * archive.h: Include options.h.
9891 (Archive_member): Moved from Archive.
9892 (Should_include): Moved from archive.cc.
9893 (Lib_group): New.
9894 (Add_lib_group_symbols): New.
9895 * dynobj.cc (do_should_include_member): New.
9896 * dynobj.h (do_should_include_member): New.
9897 * gold.cc (queue_initial_tasks): Update call to queue.
9898 * main.cc (main): Print lib group stats.
9899 * object.cc (do_should_include_member): New.
9900 * object.h: Include archive.h.
9901 (Object::should_include_member): New.
9902 (Object::do_should_include_member): New.
9903 (Sized_relobj::do_should_include_member): New.
9904 * options.cc (General_options::parse_start_lib): New.
9905 (General_options::parse_end_lib): New.
9906 (Input_arguments::add_file): Handle lib groups.
9907 (Input_arguments::start_group): Check we are not in a lib.
9908 (Input_arguments::start_lib): New.
9909 (Input_arguments::end_lib): New.
9910 * options.h (General_options): Add start_lib and end_lib.
9911 (Input_argument::lib_): New.
9912 (Input_argument::lib): New.
9913 (Input_argument::is_lib): New.
9914 (Input_file_lib): New.
9915 (Input_arguments::in_lib_): New.
9916 (Input_arguments::in_lib): New.
9917 (Input_arguments::start_lib): New.
9918 (Input_arguments::end_lib_): New.
9919 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
9920 in unused members as preempted.
9921 (Sized_pluginobj::do_should_include_member): New.
9922 * plugin.h (Sized_pluginobj::do_should_include_member): New.
9923 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
9924 return the blocker.
9925 (Read_symbols::do_whole_lib_group): New.
9926 (Read_symbols::do_lib_group): New.
9927 (Read_symbols::do_read_symbols): Handle lib groups.
9928 (Read_symbols::get_name): Handle lib groups.
9929 * readsyms.h (Read_symbols): Add an archive member pointer.
9930 (Read_symbols::do_whole_lib_group): New.
9931 (Read_symbols::do_lib_group): New.
9932 (Read_symbols::member_): New.
9933 * script.cc (read_input_script): Update call to queue_soon.
9934
d099120c
DK
99352010-03-19 Doug Kwan <dougkwan@google.com>
9936
9937 * arm.cc (Stub_table::Stub_table): Initialize new data members
9938 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9939 (Stub_table::add_reloc_stub): Assign stub offset and update
9940 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9941 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
9942 New data members.
2e702c99 9943 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
9944 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
9945 instead of going over all reloc stubs.
2e702c99 9946 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
9947 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9948 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 9949 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
9950 Stringpool_template::offset_.
9951 * stringpool.h (Stringpool_template::set_no_zero_null): Set
9952 Stringpool_template::offset_ to zero.
9953
1aa37384
DK
99542010-03-15 Doug Kwan <dougkwan@google.com>
9955
9956 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9957 offset_.
9958 (Stringpool_template::new_key_offset): New method.
9959 (Stringpool_template::add_string): Assign offsets when adding new
9960 strings.
9961 (Stringpool_template::set_string_offsets): Do not set string offsets
9962 when not optimizing.
9963 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
9964 member size_.
2e702c99
RM
9965 (Chunked_vector::clear): Clear size_.
9966 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
9967 (Chunked_vector::size): Return size_.
9968 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 9969 (Chunked_vector::size_): New data member.
1aa37384
DK
9970 (Stringpool_template::set_no_zero_null): Assert string set is empty.
9971 (Stringpool_template::new_key_offset): New method declaration.
9972 (Stringpool_template::offset_): New data member.
9973
b672b057
RÁE
99742010-03-15 Rafael Espindola <espindola@google.com>
9975
9976 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
9977 Add_symbols' constructor.
9978 * readsyms.h (Add_symbols): Remove the input_group member.
9979
b6848d3c
ILT
99802010-03-10 Ian Lance Taylor <iant@google.com>
9981
9982 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
9983 target to ask whether a reference to a symbol requires a stack
9984 split.
9985 * target.h (Target::is_call_to_non_split): New function.
9986 (Target::do_is_call_to_non_split): Declare virtual function.
9987 * target.cc: Include "symtab.h".
9988 (Target::do_is_call_to_non_split): New function.
9989 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
9990
a2a5469e
CC
99912010-03-10 Cary Coutant <ccoutant@google.com>
9992
9993 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
9994 (File_read::open[1]): Remove initial mapping of whole_file_view_.
9995 (File_read::open[2]): Add whole_file_view_ to list of views.
9996 (File_read::make_view): Remove test of whole_file_view_.
9997 (File_read::find_or_make_view): Create whole_file_view_ if
9998 necessary.
9999 (File_read::clear_views): Replace bool parameter with enum;
10000 adjust all callers. Don't delete views with permanent data;
10001 do delete cached views and views from archives if
10002 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
10003 if clearing the corresponding view.
10004 * fileread.h (File_read::Clear_views_mode): New enum.
10005 (File_read::View::is_permanent_view): New method.
10006 (File_read::clear_views): Replace bool parameter
10007 with enum; adjust all callers.
10008 * options.h (General_options): Change keep_files_mapped option;
10009 add map_whole_files.
10010 * readsyms.cc (Add_symbols::run): Delete sd_ object before
10011 releasing the file.
10012 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
10013 the file.
10014
8861f32b
DM
100152010-03-10 David S. Miller <davem@davemloft.net>
10016
10017 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
10018
d62d0f5f
ST
100192010-03-09 Sriraman Tallam <tmsriram@google.com>
10020
10021 * icf.cc (get_section_contents): Add '@' marker after processing the
10022 merge reloc.
10023
9177756d
DK
100242010-03-08 Doug Kwan <dougkwan@google.com>
10025
10026 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
10027 due to a conversion warning.
10028 (Arm_relobj::update_output_local_symbol_count): Check for local
10029 symbol with unset output index.
10030
9e9e071b
ILT
100312010-03-05 Ian Lance Taylor <iant@google.com>
10032
10033 * options.h (class General_options): Add --spare-dynamic-tags.
10034 * output.cc (Output_data_dynamic::set_final_data_size): Implement
10035 --spare-dynamic-tags.
10036
a81ee015
ILT
100372010-03-05 Ian Lance Taylor <iant@google.com>
10038
10039 * incremental.cc: Include "libiberty.h".
10040
44ec90b9
RO
100412010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
10042
10043 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
10044 function, is_info_ member.
10045 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
10046 (Versions::Versions): Update caller.
10047 (Versions::define_base_version): Likewise.
10048 (Versions::add_def): Likewise.
10049
0897ed3b
ST
100502010-03-03 Sriraman Tallam <tmsriram@google.com>
10051
10052 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
10053 (Scan::possible_function_pointer_reloc): New function.
10054 (Scan::local_reloc_may_be_function_pointer): Change to call
10055 possible_function_pointer_reloc.
10056 (Scan::global_reloc_may_be_function_pointer): Ditto.
10057 * icf.h (Icf::check_section_for_function_pointers): Change to reject
10058 relocations in ".data.rel.ro._ZTV" section.
10059 * testsuite/icf_safe_so_test.sh: Change to pass i386.
10060 * testsuite/icf_safe_so_test.cc: Ditto.
10061 * testsuite/icf_safe_test.cc: Ditto.
10062 * testsuite/icf_safe_test.sh: Ditto.
10063
d3bbad62
ILT
100642010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10065 Ian Lance Taylor <iant@google.com>
10066
10067 * target-reloc.h (relocate_section): Check the symbol table index
10068 for -1U before setting the local symbol index.
10069 (scan_relocatable_relocs): If copying the relocation, record that
10070 the local symbol is required.
10071 * object.h (Symbol_value::is_output_symtab_index_set): New
10072 function.
10073 (Symbol_value::may_be_discarded_from_output_symtab): New
10074 function.
10075 (Symbol_value::has_output_symtab_entry): New function.
10076 (Symbol_value::needs_output_symtab_entry): Remove.
10077 (Symbol_value::output_symtab_index): Make sure the symbol index is
10078 set.
10079 (Symbol_value::set_output_symtab_index): Make sure the symbol
10080 index is not set. Make sure the new index is valid.
10081 (Symbol_value::set_must_have_output_symtab_entry): New function.
10082 (Symbol_value::has_output_dynsym_entry): New function.
10083 (Symbol_value::set_output_dynsym_index): Make sure the new index
10084 is valid.
10085 (Sized_relobj::set_must_have_output_symtab_entry): New function.
10086 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
10087 local symbol if permitted.
10088 (Sized_relobj::do_finalize_local_symbols): Call
10089 is_output_symtab_index_set rather than needs_output_symtab_entry.
10090 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
10091 rather than needs_output_symtab_entry. Call
10092 has_output_dynsym_entry rather than needs_output_dynsym_entry.
10093 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
10094 is_output_symtab_index_set rather than needs_output_symtab_entry.
10095 * testsuite/discard_locals_relocatable_test.c: New file.
10096 * testsuite/discard_locals_test.sh: Test -r.
10097 * testsuite/Makefile.am (check_DATA): Add
10098 discard_locals_relocatable_test1.syms,
10099 discard_local_relocatable_test2.syms.
10100 (MOSTLYCLEANFILES): Likewise. Also add
10101 discard_locals_relocatable_test1.lout and
10102 discard_locals_relocatable_test2.out.
10103 (discard_locals_relocatable_test1.syms): New target.
10104 (discard_locals_relocatable_test.o): New target.
10105 (discard_locals_relocatable_test1.out): New target.
10106 (discard_locals_relocatable_test2.syms): New target.
10107 (discard_locals_relocatable_test2.out): New target.
10108 (various): Add missing ../ld-new dependencies.
10109 * testsuite/Makefile.in: Rebuild.
10110
7e8ccf26
NC
101112010-03-03 Nick Clifton <nickc@redhat.com>
10112
10113 * po/fi.po: New Finnish translation.
10114
2a0ff005
DK
101152010-03-01 Doug Kwan <dougkwan@google.com>
10116
10117 * layout.cc (Layout::Layout): Force section types of .init_array*,
10118 .preinit_array* and .fini_array* sections.
10119 * output.cc (Output_section::Input_section_sort_entry::has_priority):
10120 Fix check of return value of std::string::find.().
10121 (Output_section::Input_section_sort_compare::operator()): Remove
10122 comment about .init_array.
10123 (Output_section::Input_section_sort_init_fini_compare::operator()):
10124 New method.
10125 (Output_section::sort_attached_input_sections): Handle .init_array
10126 and .fini_array specially.
10127 * output.h (Output_section::Inut_section_sort_compare): Update
10128 comment.
10129 (Output_section::Input_section_sort_init_fini_compare): New struct.
10130
c3e4ae29
DK
101312010-02-26 Doug Kwan <dougkwan@google.com>
10132
10133 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
10134 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
10135 * testsuite/debug_msg.sh: Avoid matching source line number for
10136 use of global variable undef_int.
10137
2fd9ae7a
DK
101382010-02-26 Doug Kwan <dougkwan@google.com>
10139
10140 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
10141 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
10142 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
10143 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
10144 * options.cc (General_options::General_options): Initialize member
10145 fix_v4bx_.
10146 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
10147 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
10148 and rm_no_fix_v4bx.stdout
10149 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
10150 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
10151 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
10152 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
10153 and arm_no_fix_v4bx.
10154 * Makefile.in: Regenerate.
10155 * testsuite/arm_fix_v4bx.s: New file.
10156 * testsuite/arm_fix_v4bx.sh: Ditto.
10157
67ec7d0b
DK
101582010-02-24 Doug Kwan <dougkwan@google.com>
10159
10160 * arm.cc (Target_arm::got_section): Make the .got section the first
10161 non RELRO section in the data segment.
10162 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
10163 suffixes of section names.
10164
10165461
DK
101652010-02-24 Doug Kwan <dougkwan@google.com>
10166
10167 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
10168 flags and attributes merging if an input file is a binary file.
10169 * fileread.cc (Input_file::open): Record format of original file.
10170 * fileread.h (Input_file::Format): New enum type.
2e702c99 10171 (Input_file::Input_file): Initialize data member format_.
10165461
DK
10172 (Input_file::format): New method definition.
10173 (Input_file::format_):: New data member.
10174
4a54abbb
DK
101752010-02-24 Doug Kwan <dougkwan@google.com>
10176
10177 * arm.cc (Arm_output_data_got): New class.
10178 (ARM_TCB_SIZE): New constant
10179 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
10180 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
10181 If user uses a script with a SECTIONS clause, issue only a warning
10182 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 10183 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
10184 garbage collection.
10185 (Target_arm::got_mode_index_entry): Handle static linking.
10186 (Target_arm::Scan::local): Ditto.
10187 (Target_arm::Scan::global): Ditto.
10188 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
10189 all incorrectly implemented relocations.
e1df38aa 10190 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
10191 Arm_output_section::fix_exidx_coverage.
10192 * layout.cc (Layout::section_name_mapping): Remove trailing dots
10193 from ".ARM.exidx." and ".ARM.extab.".
10194
ca419a6f
ILT
101952010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10196
10197 * arm.cc (Target_arm::do_finalize_sections): Create attribute
10198 section if it does not already exist.
10199 * attributes.cc (Attributes_section_data::Attributes_section_data):
10200 Don't crash if size is zero.
10201
135b9c78
ILT
102022010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10203 Ian Lance Taylor <iant@google.com>
10204
10205 * gold.cc (queue_middle_tasks): If no input files were opened,
10206 exit.
10207 * workqueue.h (Task_function::Task_function): Assert that there is
10208 a blocker.
10209
bb0bfe4f
DK
102102010-02-22 Doug Kwan <dougkwan@google.com>
10211
10212 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
10213 * icf.cc (get_section_contents): Cast snprintf arguments to long long
10214 types to avoid warnings due to different uint64_t implementations
10215 on different hosts.
10216
2a2b6d42
DK
102172010-02-21 Doug Kwan <dougkwan@google.com>
10218
10219 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
10220 handling of the maximum backward branch offset.
2e702c99 10221 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
10222 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
10223 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 10224 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
10225 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
10226 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
10227 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
10228 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
10229 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
10230 thumb_bl_out_of_range thumb_bl_out_of_range.o,
10231 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
10232 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
10233 thumb2_bl_out_of_range.o): New rules.
10234 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
10235 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
10236 thumb2_bl_out_of_range
10237 * testsuite/Makefile.in: Regenerate.
10238 * testsuite/arm_bl_in_range.s: New file.
10239 * testsuite/arm_bl_out_of_range.s: Ditto.
10240 * testsuite/arm_branch_in_range.sh: Ditto.
10241 * testsuite/arm_branch_range.t: Ditto.
10242 * testsuite/thumb2_branch_range.t: Ditto.
10243 * testsuite/thumb_bl_in_range.s: Ditto.
10244 * testsuite/thumb_bl_out_of_range.s: Ditto.
10245 * testsuite/thumb_branch_range.t: Ditto.
10246
b487ad64
ST
102472010-02-20 Sriraman Tallam <tmsriram@google.com>
10248
10249 * gc.h (gc_process_relocs): Change vectors to point to the new list.
10250 Add reloc offset information.
10251 * icf.cc (get_section_contents): Change iterators to point to the new
10252 vectors. Add reloc offset information to the contents.
10253 * icf.h (Icf::Sections_reachable_info): New typedef.
10254 (Icf::Sections_reachable_list): New typedef.
10255 (Icf::Offset_info): New typedef.
10256 (Icf::Reloc_info): New struct typedef.
10257 (Icf::Reloc_info_list): New typedef.
10258 (Icf::symbol_reloc_list): Delete method.
10259 (Icf::addend_reloc_list): Delete method.
10260 (Icf::section_reloc_list): Delete method.
10261 (Icf::reloc_info_list): New method.
10262 (Icf::reloc_info_list_): New member.
10263
f96accdf
DK
102642010-02-19 Doug Kwan <dougkwan@google.com>
10265
10266 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
10267 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
10268 * arm.cc (Arm_relocation_functions): New forward declaration.
10269 (Target_arm::Target_arm): Initialize new data members
10270 got_mod_index_offset_ and tls_base_symbol_defined_.
10271 (Target_arm::Relocate::relocate_tls): New method.
10272 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
10273 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
10274 New methods.
2e702c99 10275 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
10276 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
10277 (Target_arm::got_mod_index_offset_,
10278 Target_arm::tls_base_symbol_defined_): New data members.
10279 (Target_arm::Scan::local, Target::Scan::global,
10280 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
10281 relocations.
10282
c8761b9a
DK
102832010-02-18 Doug Kwan <dougkwan@google.com>
10284
10285 * arm.cc (Arm_relobj::find_linked_text_section): New method.
10286 (Arm_relobj::make_exidx_input_section): Pass section index of linked
10287 text section as a parameter becuase some broken tools may not set
10288 the link in section header.
10289 (Target_arm::has_got_section): New method.
10290 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
10291 without any mapping symbol as data only. Remove warning.
10292 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
10293 link in its section header, try to discover the link by inspecting the
10294 REL31 relocation at the beginning of the section.
10295 (Target_arm::Scan::check_non_pic): Report name of offending relocation
10296 in error message.
10297 (Target_arm::Scan::global): Treat any reference to the symbol
10298 _GLOBAL_OFFSET_TABLE_ as a GOT access.
10299
21bb3914
ST
103002010-02-12 Sriraman Tallam <tmsriram@google.com>
10301
10302 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
10303 (Scan::global_reloc_may_be_function_pointer): New function.
10304 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10305 (Scan::global_reloc_may_be_function_pointer): New function.
10306 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10307 (Scan::global_reloc_may_be_function_pointer): New function.
10308 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
10309 (Scan::global_reloc_may_be_function_pointer): New function.
10310 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
10311 (Scan::global_reloc_may_be_function_pointer): New function.
10312 (Scan::possible_function_pointer_reloc): New function.
10313 (Target_x86_64::can_check_for_function_pointers): New function.
10314 * gc.h (gc_process_relocs): Scan relocation types to determine if
10315 function pointers were taken for targets that support it.
10316 * icf.cc (Icf::find_identical_sections): Include functions for
10317 folding in safe ICF whose pointer is not taken.
10318 * icf.h (Secn_fptr_taken_set): New typedef.
10319 (fptr_section_id_): New member.
10320 (section_has_function_pointers): New function.
10321 (set_section_has_function_pointers): New function.
10322 (check_section_for_function_pointers): New function.
10323 * options.h: Fix comment for safe ICF option.
10324 * target.h (can_check_for_function_pointers): New function.
10325 * testsuite/Makefile.am: Add icf_safe_so_test test case.
10326 Modify icf_safe_test for X86-64.
10327 * testsuite/Makefile.in: Regenerate.
10328 * testsuite/icf_safe_so_test.cc: New file.
10329 * testsuite/icf_safe_so_test.sh: New file.
10330 * testsuite/icf_safe_test.cc (kept_func_3): New function.
10331 (main): Change to take pointer to function kept_func_3.
10332 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
10333 folding is done correctly for X86-64.
10334
0da6fa6c
DM
103352010-02-12 David S. Miller <davem@davemloft.net>
10336
10337 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
10338 is_symbolless parameter.
10339 (Output_reloc<SHT_REL>::is_symbolless): New.
10340 (Output_reloc<SHT_REL>::is_symbolless_): New.
10341 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
10342 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
10343 (Output_reloc<SHT_RELA>::is_symbolless): New.
10344 (Output_data_reloc::add_global): Handle is_symbolless.
10345 (Output_data_reloc::add_global_relative): Likewise.
10346 (Output_data_reloc::add_local): Likewise.
10347 (Output_data_reloc::add_local_relative): Likewise.
10348 (Output_data_reloc::add_symbolless_global_addend): New.
10349 (Output_data_reloc::add_symbolless_local_addend): New.
10350 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
10351 is_symbolless.
10352 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
10353 instead of ->is_relative_
10354 (Output_reloc::write): Likewise.
10355 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
10356 (Output_reloc::write_rel): Simplify.
10357
10358 * sparc.cc (Target_sparc::Scan::local): Use
10359 ->add_symbolless_local_addend as needed.
10360 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
10361 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
10362 based upon relocation offset.
10363
e4782e83
DK
103642010-02-11 Doug Kwan <dougkwan@google.com>
10365
10366 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
10367 (Target_arm::Scan::global): Ditto. Also remove a comment before the
10368 beginning of function.
10369 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
10370 and MOVT_ABS relocations. Those are non issued in scanning. Fix
10371 parameter is_32bit in calls to should_apply_static_reloc.
10372 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
10373 (check_DATA): Add arm_abs_global.stdout.
10374 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
10375 arm_abs_global.stdout): New rules.
10376 (MOSTLLYCLEANFILES): Add arm_abs_global
10377 * Makefile.in: Regenerate.
10378 * testsuite/arm_abs_global.s: New file.
10379 * testsuite/arm_abs_global.sh: Ditto.
10380 * testsuite/arm_abs_lib.s: Ditto.
10381
93ceb764
ILT
103822010-02-11 Ian Lance Taylor <iant@google.com>
10383
10384 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
10385 Read_relocs task.
10386 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
10387 Allocate_commons_task first.
10388 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
10389 task, rather than symtab_lock_.
10390 (Gc_process_relocs::~Gc_process_relocs): New function.
10391 (Gc_process_relocs::is_runnable): Check this_blocker_.
10392 (Gc_process_relocs::locks): Use next_blocker_ rather than
10393 blocker_.
10394 (Scan_relocs::~Scan_relocs): New function.
10395 (Scan_relocs::is_runnable): Check this_blocker_ rather than
10396 symtab_lock_.
10397 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
10398 next_blocker_.
10399 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
10400 fields. Add this_blocker_ and next_blocker_ fields. Adjust
10401 constructor accordingly.
10402 (class Gc_process_relocs): Likewise.
10403 (class Scan_relocs): Likewise.
10404 * common.h (class Allocate_commons_task): Remove symtab_lock_
10405 field, and corresponding constructor parameter.
10406 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
10407 symtab_lock_.
10408 (Allocate_commons_task::locks): Likewise.
10409
114dfbe1
ILT
104102010-02-11 Ian Lance Taylor <iant@google.com>
10411
10412 * gold-threads.h (class Once): Define.
10413 (class Initialize_lock): Rewrite as child of Once.
10414 * gold-threads.cc (class Once_initialize): Define.
10415 (once_pointer_control): New static variable.
10416 (once_pointer, once_arg): New static variables.
10417 (c_run_once): New static function.
10418 (Once::Once, Once::run_once, Once::internal_run): New functions.
10419 (class Initialize_lock_once): Remove.
10420 (initialize_lock_control): Remove.
10421 (initialize_lock_pointer): Remove.
10422 (initialize_lock_once): Remove.
10423 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
10424 (Initialize_lock::initialize): Rewrite.
10425 (Initialize_lock::do_run_once): New function.
10426 * archive.cc (Archive::interpret_header): Only clear name if it is
10427 not already empty.
10428 * fileread.cc: Include "gold-threads.h"
10429 (file_counts_lock): New static variable.
10430 (file_counts_initialize_lock): Likewise.
10431 (File_read::release): Only increment counts when using --stats.
10432 Use a lock around the increment.
10433 * parameters.cc (class Set_parameters_target_once): Define.
10434 (set_parameters_target_once): New static variable.
10435 (Parameters::Parameters): Move here from parameters.h.
10436 (Parameters::set_target): Rewrite.
10437 (Parameters::set_target_once): New function.
10438 (Parameters::clear_target): Move here and rewrite.
10439 * parameters.h (class Parameters): Update declarations. Add
10440 set_parameters_target_once_ field.
10441 (Parameters::Parameters): Move to parameters.cc.
10442 (Parameters::clear_target): Likewise.
10443 * readsyms.cc (Read_symbols::do_group): Create a Start_group
10444 task.
10445 (Start_group::~Start_group): New function.
10446 (Start_group::is_runnable): New function.
10447 (Start_group::locks, Start_group::run): New functions.
10448 (Finish_group::run): Change saw_undefined to size_t.
10449 * readsyms.h (class Start_group): Define.
10450 (class Finish_group): Change saw_undefined_ field to size_t.
10451 (Finish_group::Finish_group): Remove saw_undefined and
10452 this_blocker parameters. Change all callers.
10453 (Finish_group::set_saw_undefined): New function.
10454 (Finish_group::set_blocker): New function.
10455 * symtab.h (class Symbol_table): Change saw_undefined to return
10456 size_t. Change saw_undefined_ field to size_t.
10457 * target-select.cc (Set_target_once::do_run_once): New function.
10458 (Target_selector::Target_selector): Initialize set_target_once_
10459 field. Don't initialize lock_ and initialize_lock_ fields.
10460 (Target_selector::instantiate_target): Rewrite.
10461 (Target_selector::set_target): New function.
10462 * target-select.h (class Set_target_once): Define.
10463 (class Target_selector): Update declarations. Make
10464 Set_target_once a friend. Remove lock_ and initialize_lock_
10465 fields. Add set_target_once_ field.
10466
fa17a3f4
ILT
104672010-02-10 Ian Lance Taylor <iant@google.com>
10468
10469 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
10470 queueing any tasks.
10471 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
10472 (queue_middle_tasks): Add all blockers before queueing any tasks.
10473 (queue_final_tasks): Likewise.
10474 * token.h (Task_token::add_blockers): New function.
10475 * object.h (Input_objects::number_of_relobjs): New function.
10476
c7177d31
ILT
104772010-02-10 Ian Lance Taylor <iant@google.com>
10478
5de0e392
ILT
10479 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
10480 shared, not if not position independent.
10481 * x86_64.cc (Relocate::relocate_tls): Likewise.
10482 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
10483 (tls_pie_pic_test): New target.
10484 * testsuite/Makefile.in: Rebuild.
10485
c7177d31
ILT
10486 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
10487 (tls_test_main_pie.o, tls_test_pie.o): New targets.
10488 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
10489 * testsuite/Makefile.in: Rebuild.
10490
684b268a
DM
104912010-02-09 David S. Miller <davem@davemloft.net>
10492
10493 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
10494 R_SPARC_RELATIVE using ->add_local_relative().
10495 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
10496
612a8d3d
DM
10497 * output.h (Output_data_dynamic::add_section_size): New method
10498 that takes two Output_data objects.
10499 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
10500 entry param. Handle it in initializers.
10501 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
10502 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
10503 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
10504 arg.
10505 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
10506 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
10507 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
10508 for dynrel_includes_plt.
10509 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10510 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10511 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
10512 before .rela.plt
10513 (Target_sparc::do_finalize_sections): Update to pass true for
10514 dynrel_includes_plt.
10515 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
10516 output before .rela.plt
10517 (Target_powerpc::do_finalize_sections): Update to pass true for
10518 dynrel_includes_plt when 32-bit.
10519
cb1be87e
DK
105202010-02-08 Doug Kwan <dougkwan@google.com>
10521
10522 * arm.cc (Arm_relobj::simple_input_section_output_address): New
10523 method.
10524 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
10525 Arm_relobj::scan_section_for_cortex_a8_stubs,
10526 Arm_relobj::do_relocation_section): Instead of calling
10527 Output_section::output_address, use faster
10528 Arm_relobj::simple_input_section_output_address.
10529
705b5121
DM
105302010-02-08 David S. Miller <davem@davemloft.net>
10531
10532 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
10533 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
10534 relocation helper function.
10535
024c4466
DM
10536 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
10537 just like R_SPARC_GOT{10,13,22}.
10538 (Target_sparc::Scan::local): Likewise.
10539 (Target_sparc::Relocate:relocate): Likewise.
10540
9109c078
ILT
105412010-02-06 Ian Lance Taylor <iant@google.com>
10542
10543 * configure.ac: Rewrite targetobjs duplicate removal code to use
10544 only shell constructs.
10545 * configure: Rebuild.
10546
cf846138
DK
105472010-02-05 Doug Kwan <dougkwan@google.com>
10548
10549 PR 11247
10550 * arm.cc (Arm_relobj::section_is_scannable): New method.
10551 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
10552 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
10553
6cfaf60b
DK
105542010-02-04 Doug Kwan <dougkwan@google.com>
10555
10556 PR 11247
10557 * arm-reloc-property.cc (cstdio): Include.
10558 * configure.ac (targetobjs): Remove duplicates.
10559 * configure: Regenerate.
10560 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
10561 big and little endian version for a given address size.
10562
5c57f1be
DK
105632010-02-03 Doug Kwan <dougkwan@google.com>
10564
10565 * arm-reloc-property.cc
10566 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10567 definition.
10568 * arm-reloc-property.h
10569 (Arm_reloc_property_table::get_implemented_static_reloc_property):
10570 New method definition.
10571 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10572 declaration.
10573 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
10574 overflow to N.
10575 (GOT_PREL): Change implemented to Y.
10576 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
10577 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
10578 (Arm_relocate_functions::movw_abs_nc): Remove method.
10579 (Arm_relocate_functions::movt_abs): Ditto.
10580 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
10581 (Arm_relocate_functions::thm_movt_abs): Ditto.
10582 (Arm_relocate_functions::movw_rel_nc): Ditto.
10583 (Arm_relocate_functions::movw_rel): Ditto.
10584 (Arm_relocate_functions::movt_rel): Ditto.
10585 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
10586 (Arm_relocate_functions:thm_movw_rel): Ditto.
10587 (Arm_relocate_functions:thm_movt_rel): Ditto.
10588 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
10589 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
10590 New method definitions.
10591 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
10592 (Arm_relocation_functions::arm_grp_ldr): Ditto.
10593 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
10594 (Arm_relocation_functions::arm_grp_ldc): Ditto.
10595 (Target_arm::Relocate::relocate): Check for non-static or
10596 unimplemented relocation code and exit early. Change calls to
10597 Target_arm::reloc_uses_thumb_bit and
10598 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
10599 instead. Refactor code to handle similar relocations to increase
10600 code sharing. Remove check for unsupported relocation code in switch
10601 statement.
10602 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
10603 relocation property table to find out size. Change error message to
10604 print out the name of a relocation code instead of the numeric value.
10605 (Target_arm::scan_reloc_for_stub): Use relocation property table
10606 instead of calling Target_arm::reloc_uses_thumb_bit().
10607
218c5831
DK
106082010-02-02 Doug Kwan <dougkwan@google.com>
10609
10610 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
10611 types of relaxed input section.
10612
0d31c79d
DK
106132010-02-02 Doug Kwan <dougkwan@google.com>
10614
10615 * Makefile.am (HFILES): Add arm-reloc-property.h.
10616 (DEFFILES): New.
2e702c99
RM
10617 (TARGETSOURCES): Add arm-reloc-property.cc
10618 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
10619 (libgold_a_SOURCES): $(DEFFILES)
10620 * Makefile.in: Regenerate.
10621 * arm-reloc-property.cc: New file.
10622 * arm-reloc-property.h: New file.
10623 * arm-reloc.def: New file.
10624 * arm.cc: Update comments.
10625 (arm-reloc-property.h): New included header.
10626 (arm_reloc_property_table): New global variable.
10627 (Target_arm::do_select_as_default_target): New method definition.
10628 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
10629 arm-reloc-property to targ_extra_obj.
10630 * parameters.cc (set_parameters_target): Call
10631 Target::select_as_default_target().
10632 * target.h (Target::select_as_default_target): New method definition.
10633 (Target::do_select_as_default_target): Same.
10634
546c7457
DK
106352010-02-01 Doug Kwan <dougkwan@google.com>
10636
10637 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
10638 first_output_text_section_.
10639 (Arm_exidx_fixup::first_output_text_section): New method definition.
10640 (Arm_exidx_fixup::first_output_text_section_): New data member.
10641 (Arm_exidx_fixup::process_exidx_section): Record the first text
10642 output section seen.
10643 (Arm_output_section::fix_exidx_coverage): Set correct linked section
10644 and entsize in output section header.
10645
11b861d5
DK
106462010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10647
10648 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
10649 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
10650 (Arm_relocate_functions::thm_alu11): New Method.
10651 (Arm_relocate_functions::thm_pc8): New Method.
10652 (Arm_relocate_functions::thm_pc12): New Method.
10653 (Target_arm::Scan::local): Handle the relocations.
10654 (Target_arm::Scan::global): Likewise.
10655 (Target_arm::Relocate::relocate): Likewise.
10656 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10657
c9a2c125
DK
106582010-01-29 Doug Kwan <dougkwan@google.com>
10659
10660 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
10661 of relocation types as ld.
10662
1521477a
DK
106632010-01-29 Doug Kwan <dougkwan@google.com>
10664
10665 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
10666 to public.
10667 (Arm_relocate_functions::thumb_branch_common): Ditto.
10668 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
10669 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
10670 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
10671 Arm_relocate_functions::jump24): Remove.
10672 (Target_arm::Relocate::relocate): Adjust code to call
10673 Arm_relocation_functions::arm_branch_common and
10674 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 10675 wrappers. Merge switch-cases together to reduce source code size.
1521477a 10676
e7eca48c
DK
106772010-01-29 Doug Kwan <dougkwan@google.com>
10678
10679 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
10680 output_local_symbol_count_needs_update_.
10681 (Arm_relobj::output_local_symbol_count_needs_update,
10682 Arm_relobj::set_output_local_symbol_count_needs_update,
10683 Arm_relobj::update_output_local_symbol_count): New methods.
10684 (Arm_relobj::output_local_symbol_count_needs_update_): New data
10685 member.
10686 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
10687 of pointed function as in a R_ARM_PREL31 relocation.
10688 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
10689 for output local symbol count updating.
10690 (Target_arm::do_relax): Update output local symbol counts in objects
10691 if necessary.
10692 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
10693
02961d7e
ILT
106942010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10695
10696 * arm.cc: Added support for the ARM relocations:
10697 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
10698 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
10699 (Arm_relocate_functions::movw_rel_nc): Renamed (was
10700 movw_prel_nc).
10701 (Arm_relocate_functions::movw_rel): New method.
10702 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
10703 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
10704 thm_movw_prel_nc).
10705 (Arm_relocate_functions::thm_movw_rel): New method.
10706 (Arm_relocate_functions::thm_movt_rel): Renamed (was
10707 thm_movt_prel).
10708 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
10709 relocations.
10710 (Target_arm::Scan::global): Likewise.
10711 (Target_arm::Relocate::relocate): Likewise.
10712 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10713 Likewise.
10714
b10d2873
ILT
107152010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10716
10717 * arm.cc: Added support for ARM group relocations.
10718 (Target_arm::reloc_needs_sym_origin): New method.
10719 (Arm_relocate_functions::calc_grp_kn): New method.
10720 (Arm_relocate_functions::calc_grp_residual): New method.
10721 (Arm_relocate_functions::calc_grp_gn): New method.
10722 (Arm_relocate_functions::arm_grp_alu): New Method.
10723 (Arm_relocate_functions::arm_grp_ldr): New Method.
10724 (Arm_relocate_functions::arm_grp_ldrs): New Method.
10725 (Arm_relocate_functions::arm_grp_ldc): New Method.
10726 (Target_arm::Scan::local): Handle the ARM group relocations.
10727 (Target_arm::Scan::global): Likewise.
10728 (Target_arm::Relocate::relocate): Likewise.
10729 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10730 Likewise.
10731
2b328d4e
DK
107322010-01-26 Doug Kwan <dougkwan@google.com>
10733
10734 * arm.cc (set): Include.
10735 (class Arm_exidx_fixup): Change type of last_input_section_ to const
10736 pointer type.
2e702c99 10737 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
10738 (Arm_output_section::append_text_sections_to_list): New method.
10739 (Arm_output_section::fix_exidx_coverage): Ditto.
10740 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 10741 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
10742 Relobj::set_section_offset() instead of
10743 Sized_relobj::invalidate_section_offset().
2e702c99 10744 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
10745 parameter for section headers. Ignore relocation sections for
10746 unallocated sections and EXIDX sections.
10747 (Target_arm::fix_exidx_coverage): New method.
10748 (Target_arm::output_section_address_less_than): New type.
10749 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
10750 linked text section instead of the EXIDX section.
10751 (Arm_output_section::create_stub_group): Add an assertion to check
10752 that this is not an EXIDX output section.
10753 (Arm_output_section::append_text_sections_to_list): New method.
10754 (Arm_output_section::fix_exidx_coverage): Ditto.
10755 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 10756 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
10757 (Target_arm::do_relax): Fix EXIDX output section coverage in the
10758 first pass.
10759 (Target_arm::fix_exidx_coverage): New method.
10760 * object.h (Relobj::set_output_section): New method.
10761 (Sized_relobj::invalidate_section_offset): Remove method.
10762 (Sized_relobj::do_invalidate_section_offset): Remove method.
10763 (Sized_relobj::do_set_section_offset): Handle offset value -1.
10764
c7f3c371
DK
107652010-01-25 Doug Kwan <dougkwan@google.com>
10766
10767 * arm.cc (Arm_exidx_merged_section::do_output_offset):
10768 Fix warning due to signed and unsigned comparison on a 32-bit host.
10769
8923b24c
DK
107702010-01-22 Doug Kwan <dougkwan@google.com>
10771
10772 * arm.cc (Target_arm::do_relax): Record an output section for section
10773 offset adjustment it contains any stub table that has changed.
10774 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
10775 offsets in an output section if necessary.
10776 * output.cc (Output_section::Output_section): Initialize
10777 section_offsets_need_adjustments_.
10778 (Output_section::add_input_section_for_script): Renamed to
10779 Output_section::add_simple_input_section.
10780 (Output_section::save_states): Add a comment.
10781 (Output_section::discard_states): New method defintion.
10782 (Output_section::adjust_section_offsets): Same.
10783 * output.h (Output_section::add_input_section_for_script): Renamed to
10784 Output_section::add_simple_input_section.
10785 (Output_section::discard_states): New method declaration.
10786 (Output_section::adjust_section_offsets): Same.
10787 (Output_section::section_offsets_need_adjustment,
10788 Output_section::set_section_offsets_need_adjustment): New method
10789 definitions.
10790 (Output_section::section_offsets_need_adjustment_): New data member.
10791 * script-sections.cc
10792 (Output_section_element_input::set_section_address): Adjust code for
10793 renaming of Output_section::add_input_section_for_script.
10794 (Orphan_output_section::set_section_address): Same.
10795
9b2fd367
DK
107962010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10797
10798 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
10799 Fix_v4bx enum values .
10800 * gold/options.h (General_options): New option definitions.
10801 (General_options::fix_v4bx): New method.
10802 (General_options::Fix_v4bx): New enum.
10803 * gold/options.cc (General_options::parse_fix_v4bx): New method.
10804 (General_options::parse_fix_v4bx_interworking): New method.
10805
80d0d023
DK
108062010-01-22 Doug Kwan <dougkwan@google.com>
10807
10808 * arm.cc (Arm_exidx_fixup): New class.
10809
af2cdeae
DK
108102010-01-21 Doug Kwan <dougkwan@google.com>
10811
10812 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
10813 classes.
10814 (Arm_exidx_section_offset_map): New type.
10815
993d07c1
DK
108162010-01-21 Doug Kwan <dougkwan@google.com>
10817
10818 * arm.cc (Arm_exidx_input_section): New class.
10819 (Arm_relobj::exidx_input_section_by_link,
10820 Arm_relobj::exidx_input_section_by_shndx,
10821 Arm_relobj::make_exidx_input_section): New methods.
10822 (read_arm_attributes_section): Remove.
10823 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
10824 information about them.
10825 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
10826 to here.
10827
5ac169d4
DK
108282010-01-20 Doug Kwan <dougkwan@google.com>
10829
10830 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
10831 Input_section_specifier to Section_id.
10832 (Target_arm::new_arm_input_section: Adjust code for change of key
10833 type.
10834 (Target_arm::find_arm_input_section): Ditto.
10835 * gc.h (object.h): Include for Section_id nand Section_id_hash.
10836 (Section_id): Remove.
10837 (Garbage_collection::Section_id_hash): Remove.
10838 * icf.h (object.h): Include for Section_id nand Section_id_hash.
10839 (Section_id): Remove.
10840 (Icf::Section_id_hash): Remove.
10841 * object.h (Section_id, Const_section_id, Section_id_hash,
10842 Const_section_id_hash): New type definitions.
10843 * output.cc (Output_section::add_relaxed_input_section): Change to
10844 use Const_section_id instead of Input_section_specifier as key type.
10845 (Output_section::add_merge_input_section): Ditto.
10846 (Output_section::build_relaxation_map): Change to use Section_id
10847 instead of Input_section_specifier as key type.
2e702c99 10848 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
10849 Ditto.
10850 (Output_section::convert_input_sections_to_relaxed_sections): Change
10851 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 10852 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
10853 (Output_section::find_relaxed_input_section): Ditto.
10854 * output.h (Input_section_specifier): Remove class.
10855 (Output_section::Output_section_data_by_input_section_map): Change
10856 key type to Const_section_id.
10857 (Output_section::Output_relaxed_input_section_by_input_section_map):
10858 Ditto.
10859 (Output_section::Relaxation_map): Change key type to Section_id.
10860
a2162063
ILT
108612010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10862
10863 * gold/arm.cc: Added support for R_ARM_V4BX relocation
10864 (class Arm_v4bx_stub): New class.
10865 (DEF_STUBS): Updated definition to support v4_veneer_bx.
10866 (Stub_factory::make_arm_v4bx_stub): New method.
10867 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
10868 (Stub_table::empty): Handle v4bx stubs.
10869 (Stub_table::add_arm_v4bx_stub): New method.
10870 (Stub_table::find_arm_v4bx_stub): New method.
10871 (Arm_relocate_functions::v4bx): New method.
10872 (Target_arm::fix_v4bx): New method.
10873 (Target_arm::Target_arm): Handle R_ARM_V4BX.
10874 (Stub_table::relocate_stubs): Likewise.
10875 (Stub_table::do_write): Likewise.
10876 (Stub_table::update_data_size_and_addralign): Likewise.
10877 (Stub_table::finalize_stubs): Likewise.
10878 (Target_arm::Scan::local): Likewise.
10879 (Target_arm::Scan::global): Likewise.
10880 (Target_arm::do_finalize_sections): Likewise.
10881 (Target_arm::Relocate::relocate): Likewise.
10882 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10883 Likewise.
10884 (Target_arm::scan_reloc_for_stub): Likewise.
10885 (Target_arm::scan_reloc_section_for_stubs): Likewise.
10886
5696ab0b
ILT
108872010-01-19 Ian Lance Taylor <iant@google.com>
10888
10889 * output.cc (Output_section_headers::do_sized_write): Write large
10890 segment count to sh_info field.
10891 (Output_file_header::do_sized_write): For large segment count,
10892 write PN_XNUM to e_phnum field.
10893
800d0f56
ILT
108942010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10895
10896 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
10897 (Arm_relocate_functions::thm_jump8): New function.
10898 (Arm_relocate_functions::thm_jump11): New function.
10899 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
10900 R_ARM_THM_JUMP11.
10901 (Target_arm::Scan::global): Likewise.
10902 (Target_arm::Relocate::relocate): Likewise.
10903 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10904 Likewise.
10905
41263c05
DK
109062010-01-14 Doug Kwan <dougkwan@google.com>
10907
10908 * arm.cc (map, utility): Include headers.
10909 (Target_arm::apply_cortex_a8_workaround): New method.
10910 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
10911 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
10912 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
10913 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
10914 the --[no-]fix-cortex-a8 command line options.
10915 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
10916 (Target_arm::relocate_stub): Use addend in instruction template.
10917 * options.h (DEFINE_bool): Set the user-set flag.
10918 (General_options): Add --[no-]-fix-cortex options.
10919 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 10920 : Update fast look-up map after conversion.
41263c05 10921
459e9b03
ST
109222010-01-14 Sriraman Tallam <tmsriram@google.com>
10923
10924 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
10925 in the first pass of do_layout.
10926
b521dfe4
DK
109272010-01-13 Doug Kwan <dougkwan@google.com>
10928
10929 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10930 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
10931 apparent compiler problem of not folding static constant integral
10932 data members of elfcpp::Elf_sizes<32>.
10933
44272192
DK
109342010-01-13 Doug Kwan <dougkwan@google.com>
10935
10936 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10937 Arm_relobj::section_needs_cortex_a8_stub_scanning,
10938 Arm_relobj::scan_section_for_cortex_a8_erratum,
10939 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
10940 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
10941 sections to scan for relocation stubs into a new method
10942 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
10943 relocation and Cortex-A8 stub scanning.
10944 (Target_arm::do_relax): Force stubs to be after stubbed sections
10945 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 10946 the beginning of a new relaxation pass. Update a comment.
44272192
DK
10947 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
10948
44b71ece
ILT
109492010-01-12 Ian Lance Taylor <iant@google.com>
10950
10951 * target-reloc.h (visibility_error): New inline function.
10952 (relocate_section): Call visibility_error.
10953 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
10954 (MOSTLYCLEANFILES): Likewise.
10955 (protected_4_pic.o, protected_3.err): New targets.
10956 * testsuite/protected_4.cc: New file.
10957
a120bc7f
DK
109582010-01-12 Doug Kwan <dougkwan@google.com>
10959
10960 * arm.cc (Cortex_a8_reloc): New class.
10961 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
10962 and cortex_a8_relocs_info_.
10963 (Target_arm::fix_cortex_a8): New method definition.
10964 (Target_arm::Cortex_a8_relocs_info): New type.
10965 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
10966 New data member declarations.
10967 (Target_arm::scan_reloc_for_stub): Record information about
10968 relocations for THUMB branches that might be exempted from the
10969 Cortex-A8 workaround.
10970 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
10971 at the beginning of a relaxation pass.
10972
20138696
DK
109732010-01-12 Doug Kwan <dougkwan@google.com>
10974
10975 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
10976 (Arm_relobj::Mapping_symbol_position,
10977 Arm_reloj::Mapping_symbol_position_less,
10978 Arm_relobj::Mapping_symbols_info): New types.
10979 (Target_arm::is_mapping_symbol_name): New method definition.
10980 (Arm_relobj::do_count_local_symbols): Save information about mapping
10981 symbols.
10982
089d69dc
DK
109832010-01-11 Doug Kwan <dougkwan@google.com>
10984
10985 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
10986 Arm_relocate_functions::thumb32_branch_upper,
10987 Arm_relocate_functions::thumb32_branch_lower,
10988 Arm_relocate_functions::thumb32_cond_branch_offset,
10989 Arm_relocate_functions::thumb32_cond_branch_upper,
10990 Arm_relocate_functions::thumb32_cond_branch_lower,
10991 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
10992 branch offset encoding.
10993 (Arm_relocate_functions::thumb_branch_common): Use new branch
10994 offset encoding methods to avoid code duplication.
10995 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
10996 (Stub_addend_reader::operator()): Use new branch encoding method
10997 to avoid code duplication.
10998
99e5bff2
DK
109992010-01-11 Doug Kwan <dougkwan@google.com>
11000
11001 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
11002 (Target_arm::do_finalize_sections): Define special EXIDX section
11003 symbols only if referenced.
11004 * gc.h (Garbage_collection::add_reference): New method.
11005 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
11006 code duplication.
11007
98e090bd
ILT
110082010-01-11 Ian Lance Taylor <iant@google.com>
11009
d0a91bd8
ILT
11010 * script.cc (Version_script_info::build_expression_list_lookup):
11011 Change complaing about duplicate wildcard match from error to
11012 warning.
11013
98e090bd
ILT
11014 * script.cc (class Lazy_demangler): Recreate--revert part of patch
11015 of 2009-12-30.
11016 (Version_script_info::Version_script_info): Initialize globs_,
11017 default_version_, default_is_global_, and exact_. Don't
11018 initialize globals_ or locals_.
11019 (Version_script_info::build_lookup_tables): Build local symbols
11020 first.
11021 (Version_script_info::unquote): New function.
11022 (Version_script_info::add_exact_match): New function.
11023 (Version_script_info::build_expression_list_lookup): Remove lookup
11024 parameter. Add is_global parameter. Change all callers. Handle
11025 wildcard pattern specially. Unquote pattern. Call
11026 add_exact_match.
11027 (Version_script_info::get_name_to_match): New function.
11028 (Version_script_info::get_symbol_version): New function.
11029 (Version_script_info::get_symbol_version_helper): Remove.
11030 (Version_script_info::check_unmatched_names): Call unquote.
11031 * script.h (class Version_script_info): Change get_symbol_version
11032 to be non-inline and add is_global parameter; change all callers.
11033 Rewrite symbol_is_local. Update declarations. Define struct
11034 Version_tree_match, Exact, Globs. Don't define struct Lookup.
11035 Remove globals_ and locals_ members. Add exact_, globs_,
11036 default_version_, is_global_.
11037 (Version_script_info::Glob): Remove pattern, add expression and
11038 is_global. Update constructor. Change all callers.
11039 * dynobj.cc (Versions::finalize): Mark the version symbol as the
11040 default version.
11041 (Versions::symbol_section_contents): If a symbol is undefined, or
11042 defined in a dynamic object, set the version index to
11043 VER_NDX_LOCAL.
11044 * symtab.cc (Symbol_table::add_from_relobj): Don't call
11045 symbol_is_local.
11046 (Symbol_table::add_from_pluginobj): Likewise.
11047 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
11048
d56962d3
DK
110492010-01-11 Doug Kwan <dougkwan@google.com>
11050
11051 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
11052 (incremental_dump_LDADD): Add linking option for libintl.
11053 * Makefile.in: Regenerate.
11054
94e6ee91
L
110552010-01-11 H.J. Lu <hongjiu.lu@intel.com>
11056
11057 PR gold/11144
11058 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
11059 instead of -Ds.
11060 * testsuite/Makefile.in: Regenerated.
11061
e96c574b
DK
110622010-01-10 Doug Kwan <dougkwan@google.com>
11063
11064 * options.h (DEFINE_var): Use parentheses around argument varname__
11065 in macro body to avoid any unintended subsequent substitutions.
11066
7198066b
ILT
110672010-01-10 Ian Lance Taylor <iant@google.com>
11068
ba4d53bf
ILT
11069 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
11070 candidates before doing symbol resolution.
11071
7198066b
ILT
11072 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
11073 ODR candidates if only one is weak.
11074
a2beed37
ILT
110752010-01-08 Ian Lance Taylor <iant@google.com>
11076
11077 * script.cc (Version_script_info::build_expression_list_lookup):
11078 Don't warn about ambiguous version, just record the ambiguity.
11079 (Version_script_info::get_symbol_version_helper): Give error if
11080 version is ambiguous.
11081
2fb7225c
DK
110822010-01-08 Doug Kwan <dougkwan@google.com>
11083
11084 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
11085 prev_data_size_ and prev_addralign_. Remove initializer for
11086 deleted data member has_been_changed_.
11087 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
11088 to determine if the table is empty.
11089 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
11090 Remove.
11091 (Stub_table::add_reloc_stub): Define method in class definition
11092 instead of just declaring it there.
11093 (Stub_table::add_cortex_a8_stub): New method definition.
11094 (Stub_table::update_data_size_and_addralign): Ditto.
11095 (Stub_table::finalize_stubs): Ditto.
11096 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
11097 (Stub_table::do_addralign_): Return address alignment in the
11098 (Stub_table::do_reset_address_and_file_offset): Define method in
11099 class definition instead of declaring it there. Set current data
11100 size to be the data size of the previous pass.
11101 (Stub_table::set_final_data_size): Use current data size as the
11102 final data size.
11103 (Stub_table::relocate_stub): Change parameter type of stub from
11104 Reloc_stub pointer to Stub pointer.
11105 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
11106 (Stub_table::Cortex_a8_stub_list): New typedef.
11107 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
11108 Stub_table::prev_addralign_): New data member.
11109 (Arm_relobj::Arm_relobj): Initialize data member
11110 section_has_cortex_a8_workaround_.
11111 (Arm_relobj::section_has_cortex_a8_workaround,
11112 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
11113 definitions.
11114 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
11115 declarations.
11116 (Target_arm::relocate_stub): Change parameter type of stub from
11117 Reloc_stub pointer to Stub pointer.
11118 (Insn_template::size, Insn_template::alignment): Handle
11119 THUMB16_SPECIAL_TYPE.
11120 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
11121 Stub_table::update_data_size_and_addralign,
11122 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
11123 definitions.
11124 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
11125 (Stub_table::do_write): Ditto.
11126 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 11127
880cd20d
ILT
111282010-01-08 Ian Lance Taylor <iant@google.com>
11129
11130 PR 11108
11131 * symtab.h (class Symbol): Remove fields is_target_special_ and
11132 has_plt_offset_. Add field is_defined_in_discarded_section_.
11133 (Symbol::is_defined_in_discarded_section): New function.
11134 (Symbol::set_is_defined_in_discarded_section): New function.
11135 (Symbol::has_plt_offset): Rewrite.
11136 (Symbol::set_plt_offset): Verify that new offset is not -1U.
11137 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
11138 Don't initialize is_target_special_ or has_plt_offset_.
11139 Initialize is_defined_in_discarded_section_.
11140 (Symbol_table::add_from_relobj): If appropriate, set
11141 is_defined_in_discarded_section.
11142 * resolve.cc (Symbol::override_base_with_special): Don't test
11143 is_target_special_. Change has_plt_offset_ to has_plt_offset().
11144 * target-reloc.h (relocate_section): Do special handling for
11145 symbols defined in discarded sections for global symbols as well
11146 as local symbols.
11147
2703e3eb
ILT
111482010-01-08 Ian Lance Taylor <iant@google.com>
11149
11150 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
11151 the SHT_SYMTAB case.
11152
339d40a3
ILT
111532010-01-08 Ian Lance Taylor <iant@google.com>
11154
11155 * object.cc (Sized_relobj::do_layout): Don't get confused if
11156 layout_eh_frame returns NULL.
11157
abecea76
ILT
111582010-01-08 Ian Lance Taylor <iant@google.com>
11159
11160 PR 11084
11161 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
11162 dynamic symbol table, use the normal symbol table.
11163 (Sized_dynobj::do_read_symbols): Remove assertion about type of
11164 symbol table.
11165
6b7dd3f3
ILT
111662010-01-08 Ian Lance Taylor <iant@google.com>
11167
11168 PR 11072
11169 * layout.cc (Layout::include_section): Remove .gnu_debuglink
11170 sections.
11171
36c50e63
L
111722010-01-08 H.J. Lu <hongjiu.lu@intel.com>
11173
11174 * version.cc (print_version): Change to "Copyright 2010".
11175
e291e7b9
ILT
111762010-01-08 Ian Lance Taylor <iant@google.com>
11177
11178 PR 10287
11179 PR 11063
11180 * i386.cc (class Target_i386): Change return type of plt_section
11181 to be non-const.
11182 (class Output_data_plt_i386): Add tls_desc_rel_ field.
11183 (Output_data_plt_i386::Output_data_plt_i386): Initialize
11184 tls_desc_rel_ field.
11185 (Output_data_plt_i386::rel_tls_desc): New function.
11186 (Target_i386::rel_tls_desc_section): New function.
11187 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
11188 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
11189 R_386_TLS_DESC reloc in rel_tls_desc_section.
11190 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
11191 Define struct Tlsdesc_info.
11192 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
11193 (Target_x86_64::do_reloc_symbol_index): New function.
11194 (Target_x86_64::add_tlsdesc_info): New function.
11195 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
11196 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
11197 tlsdesc_rel_ field.
11198 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
11199 all callers.
11200 (Output_data_plt_x86_64::rela_tlsdesc): New function.
11201 (Target_x86_64::rela_tlsdesc_section): New function.
11202 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
11203 handling.
11204 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
11205 (Target_x86_64::do_reloc_addend): New function.
11206 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
11207 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
11208 declarations. Define TARGET_CODE. Add arg field to u1_ union.
11209 (Output_reloc::type): New function.
11210 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
11211 (Output_reloc::is_target_specific): New function.
11212 (Output_reloc::target_arg): New function.
11213 (class Output_reloc) [SHT_RELA]: Add four new constructors for
11214 absolute relocs and target specific relocs.
11215 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
11216 add_target_specific.
11217 (class Output_data_reloc) [SHT_RELA]: Likewise.
11218 * output.cc (Output_reloc::Output_reloc): Add four new versions
11219 for absolute relocs and target specific relocs.
11220 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
11221 (Output_reloc::get_symbol_index): Likewise.
11222 (Output_reloc::local_section_offset): Check that local_sym_index_
11223 is not TARGET_CODE or 0.
11224 (Output_reloc::symbol_value): Likewise.
11225 (Output_reloc::write) [SHT_RELA]: Call target for target specific
11226 reloc.
11227 * target.h (class Target): Add reloc_symbol_index and reloc_addend
11228 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
11229 functions.
11230 * layout.cc (add_target_dynamic_tags): Use output section for
11231 DT_PLTRELSZ and DT_JMPREL.
11232
3a44184e
ILT
112332010-01-07 Ian Lance Taylor <iant@google.com>
11234
11235 PR 11061
11236 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
11237 function.
11238 (class Output_data_reloc_generic): Define.
11239 (class Output_data_reloc_base): Change base class to
11240 Output_data_reloc_generic. Change add() method to call
11241 bump_relative_reloc_count for a relative reloc. Remove
11242 sort_relocs_ field.
11243 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
11244 to sort_relocs().
11245 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
11246 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
11247 appropriate.
11248 * layout.h (class Layout): Update declaration.
11249
ea715a34
ILT
112502010-01-07 Ian Lance Taylor <iant@google.com>
11251
11252 * output.h (class Output_data): Add const version of
11253 output_section and do_output_section.
11254 (class Output_section_data): Add const version of
11255 do_output_section.
11256 (class Output_section): Likewise.
11257 * layout.cc (Layout::add_target_dynamic_tags): New function.
11258 * layout.h (class Layout): Update declarations.
11259 * arm.cc (Target_arm::do_finalize_sections): Use
11260 add_target_dynamic_tags.
11261 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11262 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11263 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11264 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11265
659948a4
ILT
112662010-01-07 Ian Lance Taylor <iant@google.com>
11267
11268 PR 11042
11269 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
11270 object as needed.
11271
9d3b86f6
ILT
112722010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
11273 Ian Lance Taylor <iant@google.com>
11274
11275 PR 11019
11276 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
11277 Xindex::read_symtab_xindex.
11278
bb0d3eb0
DK
112792010-01-07 Doug Kwan <dougkwan@google.com>
11280
11281 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
11282 (Insn_template::thumb16_bcond_insn): New method declaration.
11283 (Insn_template): Fix spelling.
11284 (Stub::thumb16_special): New method declaration.
11285 (Stub::do_write): Define virtual method which was previously pure
11286 virtual.
11287 (Stub::do_thumb16_special): New method declaration.
11288 (Stub::do_fixed_endian_write): New template member.
11289 (Reloc_stub::do_write): Remove.
11290 (Reloc_stub::do_fixed_endian_write): Remove.
11291 (Cortex_a8_stub): New class definition.
11292 (Stub_factory::make_cortex_a8_stub): New method definition.
11293 (Stub_factory::Stub_factory): Add missing static storage class
11294 qualifier for elf32_arm_stub_a8_veneer_blx.
11295
ffeef7df
ILT
112962010-01-07 Ian Lance Taylor <iant@google.com>
11297
dc3f80fe
ILT
11298 PR 10980
11299 * options.h (class General_options): Add --warn-unresolved-symbols
11300 and --error-unresolved-symbols.
11301 * errors.cc (Errors::undefined_symbol): Implement
11302 --warn-unresolved-symbols.
11303
ffeef7df
ILT
11304 * options.h (class General_options): Add -z text and -z textoff.
11305 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
11306
f1ec9ded
ST
113072010-01-06 Sriraman Tallam <tmsriram@google.com>
11308
11309 * gc.h (Garbage_collection::Cident_section_map): New typedef.
11310 (Garbage_collection::cident_sections): New function.
11311 (Garbage_collection::add_cident_section): New function.
11312 (Garbage_collection::cident_sections_): New member.
11313 (gc_process_relocs): Add references to sections whose names are C
11314 identifiers.
11315 * gold.h (cident_section_start_prefix): New constant.
11316 (cident_section_stop_prefix): New constant.
11317 (is_cident): New function.
11318 * layout.cc (Layout::define_section_symbols): Replace string constants
11319 with the newly defined constants.
11320 * object.cc (Sized_relobj::do_layout): Track sections whose names are
11321 C identifiers.
11322 * testsuite/Makefile.am: Add gc_orphan_section_test.
11323 * testsuite/Makefile.in: Regenerate.
11324 * testsuite/gc_orphan_section_test.cc: New file.
11325 * testsuite/gc_orphan_section_test.sh: New file.
11326
6eda8c29
ILT
113272010-01-06 Ian Lance Taylor <iant@google.com>
11328
b9674e17
ILT
11329 PR 10980
11330 * options.h (class General_options): Add --warn-shared-textrel.
11331 * layout.cc (Layout::finish_dynamic_section): Implement
11332 --warn-shared-textrel.
11333
6eda8c29
ILT
11334 PR 10980
11335 * options.h (class General_options): Add --warn-multiple-gp.
11336
32dcd44e
ILT
113372010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11338
11339 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
11340 $(THREADSLIB) and $(LIBDL).
11341 * Makefile.in: Rebuild.
11342
a192ba05
ILT
113432010-01-06 Ian Lance Taylor <iant@google.com>
11344
11345 PR 10980
11346 * options.cc (General_options::parse_section_start): New function.
11347 (General_options::section_start): New function.
11348 (General_options::General_options): Initialize all members.
11349 * options.h: Include <map>
11350 (class General_options): Add --section-start. Add section_starts_
11351 member.
11352 * layout.cc (Layout::attach_allocated_section_to_segment): If
11353 --section-start was used, set the address of the segment. Remove
11354 local sort_sections.
11355 (Layout::relaxation_loop_body): If the address of the load segment
11356 has been set by --section-start, don't use it.
11357 * output.h (Output_segment::update_flags_for_output_section): New
11358 function.
11359 * output.cc (Output_segment::add_output_section): Call
11360 update_flags_for_output_section.
11361
dde3f402
ILT
113622010-01-05 Ian Lance Taylor <iant@google.com>
11363
62dfdd4d
ILT
11364 PR 10980
11365 * options.h (class General_options): Add --undefined-version.
11366 * script.cc (struct Version_expression): Add was_matched_by_symbol
11367 field.
11368 (Version_script_info::matched_symbol): New function.
11369 (Version_script_info::get_symbol_version_helper): Call
11370 matched_symbol.
11371 (Version_script_info::check_unmatched_names): New function.
11372 * script.h (class Version_script_info): Update declarations.
11373 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
11374
9c4ae156
ILT
11375 * options.h (class General_options): Use DEFINE_bool_alias for
11376 allow_multiple_definition.
11377 * resolve.cc (Symbol_table::should_override): Don't test
11378 allow_multiple_definition.
11379
dde3f402
ILT
11380 PR 10980
11381 * options.h (class General_options): Add --cref.
11382 * main.cc (main): Print cref table if --cref. Don't close mapfile
11383 until after printing cref table.
11384 * cref.cc: Include "symtab.h".
11385 (class Cref_inputs): Define Cref_table_compare and Cref_table.
11386 (Cref_table_compare::operator()): New function.
11387 (Cref_inputs::gather_cref): New function.
11388 (filecol): New static const.
11389 (Cref_inputs::print_cref): New function.
11390 (Cref::print_cref): New function.
11391 * cref.h: Include <cstdio>.
11392 (class Cref): Update declarations.
11393 * mapfile.h (Mapfile::file): New function.
11394 * object.h (class Object): Define Symbols. Declare virtual
11395 do_get_global_symbols.
11396 (Object::get_global_symbols): New function.
11397 * object.cc (Input_objects::add_object): Pass object to cref_ if
11398 --cref.
11399 (Input_objects::archive_start): Likewise.
11400 (Input_objects::archive_stop): Likewise.
11401 (Input_objects::print_cref): New function.
11402 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
11403 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
11404 --cref.
11405 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
11406 function.
11407 * plugin.h (class Sized_pluginobj): Update declarations.
11408
8781f709
ILT
114092010-01-05 Ian Lance Taylor <iant@google.com>
11410
11411 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
11412 to is_default_version. Rename insdef to insdefault.
11413 (Symbol_table::add_from_relobj): Rename def to is_default_version
11414 and local to is_forced_local.
11415 (Symbol_table::add_from_pluginobj): Likewise.
11416 (Symbol_table::add_from_dynobj): Likewise.
11417 (Symbol_table::define_special_symbol): Rename insdef to
11418 insdefault.
11419
fe35d28d
ILT
114202010-01-04 Ian Lance Taylor <iant@google.com>
11421
30bc8c46
ILT
11422 PR 10980
11423 * options.h (class General_options): Add
11424 --allow-multiple-definition and -z muldefs.
11425 * resolve.cc (Symbol_table::should_override): Don't warn about a
11426 multiple symbol definition if --allow-multiple-definition or -z
11427 muldefs.
11428
7eaea549
ILT
11429 PR 10980
11430 * options.h (class General_options): Add --add-needed and
11431 --copy-dt-needed-entries. Tweak --as-needed help entry.
11432 * object.cc (Input_objects::check_dynamic_dependencies): Give an
11433 error if --copy-dt-needed-entries aka --add-needed is used and
11434 would cause a change in behaviour.
11435
fe35d28d
ILT
11436 PR 10980
11437 * options.h (class General_options): Add -G as a short version of
11438 --shared. Add no-op options -assert, -g, and -i.
11439
55a2bb35
ST
114402010-01-04 Sriraman Tallam <tmsriram@google.com>
11441
11442 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
11443 check for .text or .gnu.linkonce.t sections.
11444 * icf.cc (Icf::find_identical_sections): Ditto.
11445 Change the detection for mangled function name within the section
11446 name.
11447 * icf.h (is_section_foldable_candidate): New function.
11448
719328e1
ILT
114492009-12-30 Ian Lance Taylor <iant@google.com>
11450
11451 PR 10980
11452 * options.h (class General_options): Permit two dashes with
11453 --retain-symbols-file.
11454
d7bb5745
ILT
114552009-12-30 Ian Lance Taylor <iant@google.com>
11456
403a15dd
ILT
11457 PR 10979
11458 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
11459 don't put the file header and segment headers in the text
11460 segment.
11461
eda294df
ILT
11462 PR 10979
11463 * common.cc (Sort_commons::operator()): Stabilize sort when both
11464 entries are NULL.
11465 (Symbol_table::do_allocate_commons_list): When allocating common
11466 symbols, skip a symbol which is no longer common.
11467 * symtab.h (Symbol::is_common): Test whether the symbol comes from
11468 an object before checking its type.
11469 * testsuite/common_test_2.c: New file.
11470 * testsuite/common_test_3.c: New file.
11471 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
11472 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
11473 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
11474 (common_test_2_pic.o, common_test_2.so): New targets.
11475 (common_test_3_pic.o, common_test_3.so): New targets.
11476 * testsuite/Makefile.in: Rebuild.
11477
d7bb5745
ILT
11478 PR 10979
11479 * script.cc (read_input_script): If we see a new SECTIONS clause,
11480 and we have added an input section, give an error.
11481 * layout.h (class Layout): Add have_added_input_section function.
11482 Add have_added_input_section_ field.
11483 * layout.cc (Layout::Layout): Initialize
11484 have_added_input_section_.
11485 (Layout::layout): Set have_added_input_section_.
11486 (Layout::layout_eh_frame): Likewise.
11487
fc59c572
ILT
114882009-12-30 Ian Lance Taylor <iant@google.com>
11489
11490 PR 10931
11491 * options.h (class General_options): Add --sort-common option.
11492 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
11493 * common.cc (Sort_common): Add sort_order parameter to
11494 constructor. Add sort_order_ field.
11495 (Sort_commons::operator): Check sort_order_.
11496 (Symbol_table::allocate_commons): Determine the sort order.
11497 (Symbol_table::do_allocate_commons): Add sort_order parameter.
11498 Change all callers.
11499 (Symbol_table::do_allocate_commons_list): Likewise.
11500
1c74fab0
ILT
115012009-12-30 Ian Lance Taylor <iant@google.com>
11502
11503 PR 10916
11504 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
11505 symbols from this object, don't change the visibility of an
11506 undefined symbol.
11507 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
11508
6affe781
ILT
115092009-12-30 Ian Lance Taylor <iant@google.com>
11510
11511 PR 10861
11512 * script.h (class Version_script_info): Define Language enum.
11513 Update declarations. Define Glob, Exact, and Lookup types. Add
11514 new fields globals_, locals_, and is_finalized_.
11515 * script.cc: Various formatting fixes.
11516 (class Parser_closure): Change language_stack_ from a vector of
11517 std::string to one of Version_script_info::Language. Adjust all
11518 uses accordingly.
11519 (class Lazy_demangler): Remove.
11520 (struct Version_expression): Change language from std::string to
11521 Version_script_info::Language.
11522 (Version_script_info::Version_script_info): New function.
11523 (Version_script_info::~Version_script_info): Don't call clear.
11524 (Version_script_info::finalize): New function.
11525 (Version_script_info::build_lookup_tables): New function.
11526 (Version_script_info::build_expression_list_lookup): New
11527 function.
11528 (Version_script_info::get_symbol_version_helper): Rewrite to use
11529 lookup tables.
11530 (Version_script_info::print_expression_list): Adjust to use
11531 Version_script_info::Language.
11532 (script_push_lex_into_version_mode): Check that the version script
11533 has not been finalized.
11534 (version_script_push_lang): Change language string to
11535 Version_script_info::Language.
11536 * options.cc (Command_line::version_script): New function.
11537 * options.h (class General_options): Add finalize_dynamic_list
11538 function. Change version_script from declaration to definition.
11539 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
11540 * testsuite/version_script.map: Remove duplicate def of foo.
11541 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
11542 version_script.map.
11543 * testsuite/Makefile.in: Rebuild.
11544
818bf354
ILT
115452009-12-30 Ian Lance Taylor <iant@google.com>
11546
11547 PR 10843
11548 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
11549 if the input symbol index is 0, make the output symbol index 0.
11550
ebcc8304
ILT
115512009-12-30 Ian Lance Taylor <iant@google.com>
11552
11553 PR 10670
11554 * options.h (class General_options): Add -x/--discard-all.
11555 * object.cc (Sized_relobj::do_count_local_symbols): Handle
11556 --discard-all. If the local symbol needs a dynamic entry, check
11557 that before handling --discard-locals.
11558
176fe33f
ILT
115592009-12-30 Ian Lance Taylor <iant@google.com>
11560
bb321bb1
ILT
11561 PR 10450
11562 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
11563 flags to PF_R.
11564 (Output_segment::add_output_section): Don't change the flags if
11565 the type is PT_TLS.
11566
176fe33f
ILT
11567 PR 10450
11568 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
11569 GNU hash table if they need a dynamic value. Otherwise, don't add
11570 them if they are defined in a dynamic object or are forced local.
11571
e8cd95c7
ILT
115722009-12-29 Ian Lance Taylor <iant@google.com>
11573
1b81fb71
ILT
11574 PR 10450
11575 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
11576 .gnu.hash table for a 32-bit target.
11577
8d6d383d
ILT
11578 PR 10450
11579 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
11580 regular and a dynamic object only needs a dynamic symbol table
11581 entry if it is externally visible.
11582
e785ec03
ILT
11583 PR 10450
11584 * i386.cc (class Target_i386): Initialize global_offset_table_ in
11585 constructor. Add global_offset_table_ field.
11586 (Target_i386::got_section): Set global_offset_table_.
11587 (Target_i386::do_finalize_sections): Set global_offset_table_
11588 size.
11589 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
11590 in constructor. Add global_offset_table_ field.
11591 (Target_x86_64::got_section): Set global_offset_table_.
11592 (Target_x86_64::do_finalize_sections): Set global_offset_table_
11593 size.
11594
1a2dff53
ILT
11595 * layout.cc (Layout::Layout): Initialize increase_relro_.
11596 (Layout::get_output_section): Add is_relro, is_last_relro, and
11597 is_first_non_relro parameters. Change all callers.
11598 (Layout::choose_output_section): Likewise.
11599 (Layout::add_output_section_data): Likewise.
11600 (Layout::make_output_section): Likewise.
11601 (Layout::set_segment_offsets): Clear increase_relro when using a
11602 linker script.
11603 * layout.h (class Layout): Add increase_relro method. Add
11604 increase_relro_ field. Update declarations.
11605 * output.cc (Output_section::Output_section): Initialize
11606 is_last_relro_ and is_first_non_relro_.
11607 (Output_segment::add_output_section): Group relro sections is
11608 do_sort is true. Handle is_last_relro and is_first_non_relro.
11609 (Output_segment::maximum_alignment): Remove relro handling.
11610 (Output_segment::set_section_addresses): Add increase_relro
11611 parameter. Change all callers. Add initial alignment to align
11612 relro sections on separate page. Remove old relro handling.
11613 (Output_segment::set_section_list_addresses): Remove in_relro
11614 parameter. Change all callers.
11615 (Output_segment::set_offset): Add increase parameter. Change all
11616 callers. Remove old relro handling.
11617 * output.h (class Output_section): Add new methods: is_last_relro,
11618 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
11619 Add is_last_relro_ and is_first_non_relro_ fields.
11620 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
11621 Create separate .got.plt section. Call increase_relro.
11622 * x86_64.cc (Target_x86_64::got_section): Likewise.
11623 * testsuite/relro_script_test.t: Add .got.plt.
11624
f0ba79e2
ILT
11625 PR 10450
11626 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
11627 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
11628 (Layout::finalize): Call set_dynamic_symbol_size.
11629 (Layout::set_dynamic_symbol_size): New function.
11630 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
11631 set_dynamic_symbol_size.
11632
e8cd95c7
ILT
11633 PR 10450
11634 * output.h (class Output_section): Add is_entsize_zero_ field.
11635 * output.cc (Output_section::Output_section): Initialize
11636 is_entsize_zero_.
11637 (Output_section::set_entsize): If two different entsizes are
11638 requested, force it to zero.
11639 (Output_section::add_input_section): Set flags for .debug_str
11640 before updating section flags. Set entsize.
11641 (Output_section::update_flags_for_input_section): Set SHF_MERGE
11642 and SHF_STRING if all input sections have those flags.
11643
3e1b9a8a
RÁE
116442009-12-29 Rafael Espindola <espindola@google.com>
11645
11646 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
11647 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
11648 reporting.
3e1b9a8a 11649
3dcad376
ST
116502009-12-29 Sriraman Tallam <tmsriram@google.com>
11651
11652 * options.cc (General_options::parse_version): Allow -v to exit
11653 without an error if there is nothing to link.
11654
084e2665
ILT
116552009-12-29 Ian Lance Taylor <iant@google.com>
11656
11657 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
11658 using a version of gcc before 4.1.
11659 * configure: Rebuild.
11660
250acde3
CD
116612009-12-28 Chris Demetriou <cgd@google.com>
11662
11663 * attributes.cc (Output_attributes_section_data::do_write): Use
11664 std::vector::front rather than std::vector::data.
11665
99fff23b
ILT
116662009-12-28 Ian Lance Taylor <iant@google.com>
11667
11668 * symtab.h (class Symbol_table): Add enum Defined.
11669 * resolve.cc (Symbol_table::should_override): Add defined
11670 parameter. Change all callers. Test whether object is NULL
11671 before calling a method on it.
11672 (Symbol_table::report_resolve_problem): Add defined parameter.
11673 Change all callers.
11674 (Symbol_table::should_override_with_special): Likewise.
11675 * symtab.cc (Symbol_table::define_in_output_data): Add defined
11676 parameter. Change all callers.
11677 (Symbol_table::do_define_in_output_data): Likewise.
11678 (Symbol_table::define_in_output_segment): Likewise.
11679 (Symbol_table::do_define_in_output_segment): Likewise.
11680 (Symbol_table::define_as_constant): Likewise.
11681 (Symbol_table::do_define_as_constant): Likewise.
11682 * script.h (class Symbol_assignment): Add is_defsym parameter to
11683 constructor; change all callers.
11684 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
11685 parameter. Change all callers. Add is_defsym_ field.
11686 (class Parser_closure): Add parsing_defsym parameter to
11687 constructor; change all callers. Add parsing_defsym accessor
11688 function. Add parsing_defsym_ field.
11689
556bd683
ILT
116902009-12-28 Ian Lance Taylor <iant@google.com>
11691
11692 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 11693 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 11694
1782c879
ILT
116952009-12-23 Ian Lance Taylor <iant@google.com>
11696
11697 * i386.cc (Target_i386::do_calls_non_split): Recognize
11698 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
11699 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
11700 -fsplit-stack prologue when using %r11.
1782c879 11701
329ca2b1
ST
117022009-12-21 Sriraman Tallam <tmsriram@google.com>
11703
11704 * options.cc (General_options::parse_version): Make -v continue and do
11705 the link like GNU ld does.
11706
d675ff46
RÁE
117072009-12-17 Rafael Avila de Espindola <espindola@google.com>
11708
11709 * Makefile.am (CCFILES): Add timer.cc.
11710 (HFILES): Add timer.h.
11711 * configure.ac: Check for sysconf and times.
11712 * main.cc: include timer.h.
11713 (main): Use Timer instead of get_run_time.
11714 * timer.cc: New.
11715 * timer.h: New.
11716 * workqueue.cc: include timer.h.
11717 (Workqueue::find_and_run_task):
11718 Report user, sys and wall time.
11719 * Makefile.in: Regenerate.
11720 * config.in: Regenerate.
11721 * configure: Regenerate.
11722
d6344fb5
DK
117232009-12-16 Doug Kwan <dougkwan@google.com>
11724
11725 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
11726 sections.
11727 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
11728 relaxed input sections.
11729 * output.cc (Output_section::find_relaxed_input_section): Change
11730 return type to Output_relaxed_input_section pointer. Adjust code
11731 for new type of relaxed_input_section_map_.
11732 * output.h (Output_section::find_relaxed_input_section): Change
11733 return type to Output_relaxed_input_section pointer.
11734 (Output_section::Output_relaxed_input_section_by_input_section_map):
11735 New type.
11736 (Output_section::relaxed_input_section_map_): Change type to
11737 Output_section::Output_relaxed_input_section_by_input_section_map.
11738 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
11739 input section.
11740
0e0d5469
ILT
117412009-12-15 Ian Lance Taylor <iant@google.com>
11742
11743 * layout.cc (Layout::create_shstrtab): Only write out after input
11744 sections if we are compressing debug sections.
11745
0649a889
ILT
117462009-12-15 Ian Lance Taylor <iant@google.com>
11747
11748 * archive.cc (Archive::add_symbols): Only look up a symbol without
11749 a version if there is, in fact, a version.
11750
2ea97941
ILT
117512009-12-14 Ian Lance Taylor <iant@google.com>
11752
11753 Revert -Wshadow changes, all changes from:
11754 2009-12-11 Doug Kwan <dougkwan@google.com>
11755 2009-12-11 Nick Clifton <nickc@redhat.com>
11756 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
11757
b0eec2cc
DK
117582009-12-11 Doug Kwan <dougkwan@google.com>
11759
11760 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
11761 due to -Wshadow.
11762 * attributes.cc (Object_attribute::size): Ditto.
11763 (Attributes_section_data::size): Ditto.
11764 (Attributes_section_data::Attributes_section_data): Ditto.
11765 (Output_attributes_section_data::do_write): Ditto.
11766 * attributes.h (Object_attribute::set_type): Ditto.
11767 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
11768
91d6fa6a
NC
117692009-12-11 Nick Clifton <nickc@redhat.com>
11770
11771 * archive.cc: Fix shadowed variable warnings.
11772 * arm.cc: Likewise.
11773 * compressed_output.cc: Likewise.
11774 * compressed_output.h: Likewise.
11775 * configure: Likewise.
11776 * dwarf_reader.cc: Likewise.
11777 * dynobj.cc: Likewise.
11778 * dynobj.h: Likewise.
11779 * ehframe.cc: Likewise.
11780 * ehframe.h: Likewise.
11781 * errors.cc: Likewise.
11782 * expression.cc: Likewise.
11783 * fileread.cc: Likewise.
11784 * fileread.h: Likewise.
11785 * freebsd.h: Likewise.
11786 * i386.cc: Likewise.
11787 * icf.cc: Likewise.
11788 * incremental.h: Likewise.
11789 * layout.cc: Likewise.
11790 * layout.h: Likewise.
11791 * mapfile.cc: Likewise.
11792 * merge.cc: Likewise.
11793 * merge.h: Likewise.
11794 * object.cc: Likewise.
11795 * object.h: Likewise.
11796 * options.h: Likewise.
11797 * output.cc: Likewise.
11798 * output.h: Likewise.
11799 * parameters.cc: Likewise.
11800 * plugin.cc: Likewise.
11801 * powerpc.cc: Likewise.
11802 * reduced_debug_output.cc: Likewise.
11803 * reduced_debug_output.h: Likewise.
11804 * reloc.cc: Likewise.
11805 * reloc.h: Likewise.
11806 * resolve.cc: Likewise.
11807 * script-sections.cc: Likewise.
11808 * script.cc: Likewise.
11809 * script.h: Likewise.
11810 * sparc.cc: Likewise.
11811 * symtab.cc: Likewise.
11812 * symtab.h: Likewise.
11813 * target-select.cc: Likewise.
11814 * target-select.h: Likewise.
11815 * token.h: Likewise.
11816 * workqueue.cc: Likewise.
11817 * workqueue.h: Likewise.
11818 * x86_64.cc: Likewise.
11819
a0351a69
DK
118202009-12-10 Doug Kwan <dougkwan@google.com>
11821
11822 * arm.cc (attributes.h): New include.
11823 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
11824 (Arm_relobj::~Arm_relobj): Delete object pointed by
11825 attributes_section_data_.
11826 (Arm_relobj::attributes_section_data): New method definition.
11827 (Arm_relobj::attributes_section_data_): New data member declaration.
11828 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
11829 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
11830 attributes_section_data_.
11831 (Arm_dynobj::attributes_section_data): New method definition.
11832 (Arm_dynobj::attributes_section_data_): New data member declaration.
11833 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
11834 initialization value of may_use_blx_ to false.
2e702c99 11835 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
11836 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
11837 object attributes to compute results instead of hard-coding.
11838 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
11839 Target_arm::get_secondary_compatible_arch,
11840 Target_arm::set_secondary_compatible_arch
11841 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11842 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
11843 New method declarations.
11844 (Target_arm::get_aeabi_object_attribute): New method definition.
11845 (Target_arm::attributes_section_data_): New data member declaration.
11846 (read_arm_attributes_section): New template definition.
11847 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
11848 (Arm_dynobj::do_read_symbols): Ditto.
11849 (Target_arm::do_finalize_sections): Merge attributes sections from
11850 input. Check for BLX use after attributes section merging.
11851 Fix __exidx_start and __exidx_end visibility. Create an
11852 .ARM.attributes section if necessary.
11853 (Target_arm::get_secondary_compatible_arch,
11854 Target_arm::set_secondary_compatible_arch,
11855 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11856 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 11857 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
11858 New method definitions.
11859
b59befec
ILT
118602009-12-09 Ian Lance Taylor <iant@google.com>
11861
11862 * plugin.cc (Plugin::load): Don't cast from void* to a function
11863 pointer.
11864
1276bc89
ILT
118652009-12-09 Ian Lance Taylor <iant@google.com>
11866
11867 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
11868 information fields.
11869
2f2de248
L
118702009-12-09 H.J. Lu <hongjiu.lu@intel.com>
11871
11872 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
11873 Replace two_file_shared_1.so with two_file_shared_2.so.
11874 * testsuite/Makefile.in: Regenerated.
11875
4f787271
DK
118762009-12-08 Doug Kwan <dougkwan@google.com>
11877
11878 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
11879 (HFILES): Add attributes.h and int_encoding.h.
11880 * Makefile.in: Regenerate.
11881 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
11882 function definitions to int_encoding.cc
11883 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
11884 prototypes to int_encoding.h
11885 * reduced_debug_output.cc (int_encoding.h): New include.
11886 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
11887 function definitions to int_encoding.cc
11888 (insert_into_vector, read_from_pointer): Move template definitions to
11889 int_encoding.h
11890 * attributes.cc: New file.
11891 * attributes.h: New file.
11892 * int_encoding.cc: New file.
11893 * int_encoding.h: New file.
11894
20b52f1a
RÁE
118952009-12-07 Rafael Avila de Espindola <espindola@google.com>
11896
11897 PR gold/11055
11898 * incremental-dump.cc (dump_incremental_inputs): New.
11899 (main): Use dump_incremental_inputs.
11900
53d7974c
L
119012009-12-07 H.J. Lu <hongjiu.lu@intel.com>
11902
11903 PR gold/10893
11904 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
11905 checking elfcpp::STT_FUNC.
11906 (Target_i386::Relocate::relocate): Likewise.
11907 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
11908
11909 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
11910 symbols from shared libraries into normal FUNC symbols.
11911
11912 * symtab.h (Symbol): Add is_func and use it.
11913
05a352e6
DK
119142009-12-05 Doug Kwan <dougkwan@google.com>
11915
11916 * arm.cc (Target_arm::arm_info): Initialize new fields
11917 attributes_section and attributes_vendor.
11918 * i386.cc (Target_i386::i386_info): Same.
11919 * object.cc (Sized_relobj::do_layout): Skip attribute section.
11920 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
11921 fields attributes_section and attributes_vendor.
53d7974c 11922 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
11923 * target.h (Target::attributes_section, Target::attributes_vendor,
11924 Target::is_attributes_section, Target::attribute_arg_type,
11925 Target::attributes_order): New method definitions.
11926 (Target::Target_info::attributes_section,
11927 Target::Target_info::attributes_vendor): New fields.
11928 (Target::do_attribute_arg_type, Target::do_attributes_order): New
11929 virtual method definitions.
11930 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
11931 attributes_section and attributes_vendor.
11932 * testsuite/testfile.cc (Target_test::test_target_info): Same.
11933
f4e5969c
DK
119342009-12-05 Doug Kwan <dougkwan@google.com>
11935
11936 * arm.cc: Update comments about interworking and stub generation.
11937 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
11938 considered as non-PIC.
11939 (Arm_relocate_functions::base_abs): Fix formatting.
11940 (Arm_relocate_functions::got_prel): Fix comment. Change interface
11941 of function to use GOT entry address instead of offset.
11942 (Target_arm::Scan::global): Issue an error if a symbol would need a
11943 PLT does not get one because it is untyped. Remove code to create
11944 dynamic symbols for relative branches.
11945 (Target_arm::Relocate::relocate: Use 0 instead of false since function
11946 takes unsigned integer instead of boolean.
11947
1abce4a6
L
119482009-12-05 H.J. Lu <hongjiu.lu@intel.com>
11949
11950 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
11951 (two_file_test_LDADD): Likewise.
11952 (common_test_1_LDADD): Likewise.
11953 (exception_test_LDADD) Likewise.
11954 (weak_test_LDADD): Likewise.
11955 (many_sections_test_LDADD): Likewise.
11956 (initpri1_LDADD): Likewise.
11957 (script_test_1_LDADD): Likewise.
11958 (script_test_2_LDADD): Likewise.
11959 (justsyms_LDADD): Likewise.
11960 (binary_test_LDADD): Likewise.
11961 (large_LDADD): Likewise.
11962 * testsuite/Makefile.in: Regenerated.
11963
adcf2816 119642009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 11965
adcf2816
L
11966 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
11967 (Symbol_table::override_with_special): Likewise.
11968 (Symbol_table::add_from_object): Likewise.
11969
28e67f5d
RÁE
119702009-12-04 Rafael Avila de Espindola <espindola@google.com>
11971
11972 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11973 Don't set the data_offset twice.
11974
ae10a101
RÁE
119752009-12-04 Rafael Avila de Espindola <espindola@google.com>
11976
11977 * testsuite/Makefile.in: Regenerate.
11978
f59f41f3
DK
119792009-12-03 Doug Kwan <dougkwan@google.com>
11980
11981 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
11982 (Target_arm::do_finalize_sections): Add parameter for symbol table
11983 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
11984 * i386.cc (Target_i386::do_finalize_sections): Add an additional
11985 parameter for symbol table pointer.
11986 * layout.cc (Layout::finalize): Call Target::finalize_sections with
11987 an additional parameter for a pointer to symbol table.
11988 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
11989 parameter for a symbol table pointer.
11990 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
11991 * target.h (Target::finalize_sections, Target::do_finalize_sections):
11992 Ditto.
11993 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
11994 parameter for a symbol table pointer.
11995
ca55d848
RÁE
119962009-12-03 Rafael Avila de Espindola <espindola@google.com>
11997
11998 * incremental.cc (Incremental_inputs_header)
11999 (Incremental_inputs_header_write, Incremental_inputs_entry)
12000 (Incremental_inputs_entry_write): Move ...
12001 * incremental.h (Incremental_inputs_header)
12002 (Incremental_inputs_header_write, Incremental_inputs_entry)
12003 (Incremental_inputs_entry_write): here.
12004
3aec4f9c
RÁE
120052009-12-02 Rafael Avila de Espindola <espindola@google.com>
12006
12007 * incremental.cc (make_sized_incremental_binary): Set the target.
12008 Error if it is incompatible.
12009 * output.h (Output_file): Add filename method.
12010
9c0ae74d
RÁE
120112009-12-02 Rafael Avila de Espindola <espindola@google.com>
12012
12013 * incremental.cc (Incremental_inputs_entry): Remove unused argument
12014 from the get_* methods.
12015
a45500ae
RÁE
120162009-12-02 Rafael Avila de Espindola <espindola@google.com>
12017
12018 * incremental-dump.cc (main): Check that the offeset of a script is 0.
12019 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12020 Write 0 for the data_offset of scripts.
12021
325e6408
RÁE
120222009-12-02 Rafael Avila de Espindola <espindola@google.com>
12023
12024 * testsuite/Makefile.am: Add the incremental_test.sh test.
12025 * testsuite/incremental_test.sh: New.
12026 * testsuite/incremental_test_1.c: New.
12027 * testsuite/incremental_test_2.c: New.
12028
954c3e2e
RÁE
120292009-12-01 Rafael Avila de Espindola <espindola@google.com>
12030
703d02da 12031 * incremental-dump.cc (main): Fix typos.
954c3e2e 12032
f8086623
RÁE
120332009-11-27 Rafael Avila de Espindola <espindola@google.com>
12034
12035 PR gold/11025
12036 * incremental-dump.cc (main): Use llu to print 64 bit values.
12037
3b0dd6ac
L
120382009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
12039 H.J. Lu <hongjiu.lu@intel.com>
12040
12041 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
12042 $(LIBDL).
12043 (incremental_dump_LDADD): Likewise.
12044 * Makefile.in: Regenerated.
12045
a6d1ef57 120462009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 12047
a6d1ef57
DK
12048 Revert:
12049
12050 2009-11-25 Doug Kwan <dougkwan@google.com>
12051
12052 * arm.cc (Target_arm::Target_arm): Move method definition
12053 outside of class definition. Add code to handle
12054 --target1-rel, --target1-abs and --target2= options.
12055 (Target_arm::get_reloc_reloc_type): Change method to be
12056 non-static and const.
12057 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
12058 New data member declaration.
12059 (Target_arm::Scan::local, Target_arm::Scan::global,
12060 Target_arm::Relocate::relocate,
12061 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12062 Adjust call to Target_arm::get_real_reloc_type.
12063 (Target_arm::get_real_reloc_type): Use command line options
12064 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12065 * options.h (--target1-rel, --target1-abs, --target2): New
12066 ARM-only options.
12067
50aeb7d4
DK
120682009-11-25 Doug Kwan <dougkwan@google.com>
12069
12070 * arm.cc (Target_arm::Target_arm): Move method definition outside of
12071 class definition. Add code to handle --target1-rel, --target1-abs
12072 and --target2= options.
12073 (Target_arm::get_reloc_reloc_type): Change method to be non-static
12074 and const.
12075 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
12076 member declaration.
12077 (Target_arm::Scan::local, Target_arm::Scan::global,
12078 Target_arm::Relocate::relocate,
12079 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
12080 call to Target_arm::get_real_reloc_type.
12081 (Target_arm::get_real_reloc_type): Use command line options to
12082 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12083 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
12084 options.
12085
51938283
DK
120862009-11-25 Doug Kwan <dougkwan@google.com>
12087
12088 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
12089 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
12090 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
12091 formatting.
12092 (Arm_relocate_functions::thm_call): Replace body with a call to
12093 Arm_relocate_functions::thumb_branch_common.
12094 (Arm_relocate_functions::thm_jump24,
12095 Arm_relocate_functions::thm_xpc22): New method definitions.
12096 (Arm_relocate_functions::thumb_branch_common): New method definition.
12097 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
12098 operator.
12099 (Target_arm::Relocate::relocate): Adjust call to thm_call.
12100 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
12101
e2b8f3c4
RÁE
121022009-11-24 Rafael Avila de Espindola <espindola@google.com>
12103
12104 * Makefile.am: Build incremental-dump
12105 * Makefile.in: Regenerate.
12106 * incremental-dump.cc: New.
12107 * incremental.cc (Incremental_inputs_header_data,
12108 Incremental_inputs_entry_data): Move to incremental.h
12109 * incremental.h: (Incremental_inputs_header_data,
12110 Incremental_inputs_entry_data): Move from incremental.cc
12111
bcba9aec
RÁE
121122009-11-24 Rafael Avila de Espindola <espindola@google.com>
12113
12114 * incremental.cc (Incremental_inputs_header,
12115 Incremental_inputs_header_write, Incremental_inputs_entry,
12116 Incremental_inputs_entry_write): Add a typedef with the data type.
12117
7c3afe08
RÁE
121182009-11-24 Rafael Avila de Espindola <espindola@google.com>
12119
12120 * incremental.cc (Incremental_inputs_header,
12121 Incremental_inputs_header_write, Incremental_inputs_entry,
12122 Incremental_inputs_entry_write): Update comment about which
12123 type has the filed descriptions.
12124
d204b6e9
DK
121252009-11-15 Doug Kwan <dougkwan@google.com>
12126
12127 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
12128 (Arm_relocate_functions::arm_branch_common): Change method defintion
12129 in class definition to a method declaration and update list of formal
12130 parameters.
12131 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
12132 Arm_relocation_functions::jump24): Adjust call to
12133 Arm_relocate_functions::arm_branch_common. Update list of formal
12134 parameters.
12135 (Arm_relocate_functions::xpc25): New method definition.
12136 (Arm_relocate_functions::arm_branch_common): Move method defintion
12137 out from class definition. Use stubs for mode-switching and extending
12138 branch ranges.
12139 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
12140 specially. Change code to enable use of stubs in ARM branches.
12141
43d12afe
DK
121422009-11-10 Doug Kwan <dougkwan@google.com>
12143
12144 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
12145 in method declaration.
12146 (Target_arm::relocate_stub): New method declaration.
12147 (Target_arm::default_target): Change to return a pointer instead of
12148 a const reference.
12149 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
12150 Target_arm::default_target.
12151 (Arm_Relobj::do_relocate_sections): Remove options paramater in
12152 method definition.
12153 (Target_arm::relocate_section): Adjust view.
12154 (Target_arm::relocate_stub): New method definition.
12155
ac33a407
DK
121562009-11-10 Doug Kwan <dougkwan@google.com>
12157
12158 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
12159 a format warning.
12160 * incremental.cc (open_incremental_binary): Initialized local
12161 variables to avoid warnings.
12162 * object.cc (make_elf_object): Ditto.
12163 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
12164 a format warning.
e1df38aa 12165
88ee28e9
L
12166009-11-09 H.J. Lu <hongjiu.lu@intel.com>
12167
12168 PR gold/10930
12169 * testsuite/plugin_test.c: Include "config.h".
12170
2daedcd6
DK
121712009-11-09 Doug Kwan <dougkwan@google.com>
12172
12173 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
12174 (arm_symbol_value): Remove.
12175 (Arm_relocate_functions::arm_branch_common,
12176 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
12177 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
12178 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
12179 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
12180 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
12181 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
12182 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
12183 Arm_relocate_functions::thm_mobw_abs_nc,
12184 Arm_relocate_functions::thm_mov_abs,
12185 Arm_relocate_functions::movw_prel_nc,
12186 Arm_relocate_functions::thm_movt_abs,
12187 Arm_relocate_functions::movt_prel,
12188 Arm_relocate_functions::thm_movw_prel_nc,
12189 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
12190 (Target_arm::Relocate::relocate): Only decompose address into two
12191 parts if relocation type uses the thumb-bit and pass the actual
12192 bit instead of a flag indicating that the thumb-bit is used. Adjust
12193 calls to methods in Arm_relocate_functions for this change.
12194
1276bc89 121952009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
12196
12197 PR 10925
12198 * reloc.cc: Instantiate
12199 Sized_relobj::initialize_input_to_output_maps and
12200 Sized_relobj:free_input_to_output_maps.
12201
e53ad1b5
ILT
122022009-11-06 Ian Lance Taylor <iant@google.com>
12203
12204 PR 10876
12205 * defstd.cc (in_segment): Set only_if_ref true for "end".
12206
eb44217c
DK
122072009-11-06 Doug Kwan <dougkwan@google.com>
12208
12209 * arm.cc (class Reloc_stub): Correct a comment.
12210 (Target_arm::Target_arm): Initialize arm_input_section_map_.
12211 (Target_arm::scan_section_for_stubs): New method declaration.
12212 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
12213 Change methods from private to protected.
12214 (Target_arm::do_may_relax): New method definition.
12215 (Target_arm::do_relax, Target_arm::group_sections,
12216 Target_arm::scan_reloc_for_stub,
12217 Target_arm::scan_reloc_section_for_stubs): New method declarations.
12218 (Target_arm::arm_input_section_map_): New data member declaration.
12219 (Target_arm::scan_reloc_for_stub,
12220 Target_arm::scan_reloc_section_for_stubs,
12221 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
12222 Target_arm::do_relax): New method definitions.
12223
5d329b7d
ILT
122242009-11-06 Mikolaj Zalewski <mikolaj@google.com>
12225
12226 * configure.ac: Check for (struct stat)::st_mtim
12227 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
12228 * config.in: Regenerate.
12229 * configure: Regenerate.
12230
96a0d71b
ILT
122312009-11-05 Ian Lance Taylor <iant@google.com>
12232
12233 PR 10910
12234 * output.cc (Output_segment::add_output_section): Add missing
12235 return statement.
12236
594c8e5e
ILT
122372009-11-04 Ian Lance Taylor <iant@google.com>
12238
12239 PR 10880
12240 * object.h (class Object): Add is_needed and set_is_needed
12241 methods. Add is_needed_ field. Make bool fields into bitfields.
12242 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
12243 defined in a dynamic object and referenced by a regular object,
12244 set is_needed for the dynamic object.
12245 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
12246 if the file is marked with as_needed and it is not needed.
12247
22b127cc
ILT
122482009-11-04 Ian Lance Taylor <iant@google.com>
12249
12250 PR 10887
12251 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
12252 tags if data is discarded by linker script.
12253 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12254 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12255 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12256 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12257
f5c870d2
ILT
122582009-11-04 Ian Lance Taylor <iant@google.com>
12259
12260 * layout.cc (Layout::get_output_section): Add is_interp and
12261 is_dynamic_linker_section parameters. Change all callers.
12262 (Layout::choose_output_section): Likewise.
12263 (Layout::make_output_section): Likewise.
12264 (Layout::add_output_section_data): Add is_dynamic_linker_section
12265 parameter. Change all callers.
12266 * layout.h (class Layout): Update declarations.
12267 * output.h (class Output_section): Add is_interp, set_is_interp,
12268 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
12269 Add is_interp_, is_dynamic_linker_section_ fields. Change
12270 generate_code_fills_at_write_ to a bitfield.
12271 * output.cc (Output_section::Output_sections): Initialize new
12272 fields.
12273 (Output_segment::add_output_section): Add do_sort parameter.
12274 Change all callers.
12275
1ae4d23b
ILT
122762009-11-03 Ian Lance Taylor <iant@google.com>
12277
12278 PR 10860
12279 * options.h (class General_options): Add --warn-common.
12280 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
12281 merging two common symbols.
12282 (Symbol_table::should_override): Handle --warn-common when merging
12283 a common symbol with a defined symbol. Use report_resolve_problem
12284 for multiple definitions.
12285 (Symbol_table::report_resolve_problem): New function.
12286 * symtab.h (class Symbol_table): Declare report_resolve_problem.
12287
55da9579
DK
122882009-11-03 Doug Kwan <dougkwan@google.com>
12289
12290 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
12291 stub_factory_.
12292 (Target_arm::stub_factory): New method definition.
12293 (Target_arm::new_arm_input_section,
12294 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
12295 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 12296 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
12297 New type definitions.
12298 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
12299 member declarations.
12300 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
12301 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
12302 New method definitions.
12303
37a9ac43
ILT
123042009-11-03 Ian Lance Taylor <iant@google.com>
12305
12306 * options.h (class General_options): Add --warn_constructors.
12307
b3d6a3d4
ILT
123082009-11-03 Ian Lance Taylor <iant@google.com>
12309
12310 PR 10893
12311 * defstd.cc (in_section): Add entries for __rel_iplt_start,
12312 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
12313
934b01dd
ILT
123142009-11-03 Ian Lance Taylor <iant@google.com>
12315
12316 PR 10895
12317 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
12318 --msgid-bugs-address.
12319 (install-pdf): New target.
12320 (install-data_yes): Look up one directory to find mkinstalldirs.
12321
03c1939b
L
123222009-11-03 H.J. Lu <hongjiu.lu@intel.com>
12323
12324 * po/Make-in (.po.gmo): Don't generate .gmo files in source
12325 tree.
12326
ebd95253
DK
123272009-10-30 Doug Kwan <dougkwan@google.com>
12328
12329 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
12330
e9bbb538
DK
123312009-10-30 Doug Kwan <dougkwan@google.com>
12332
12333 * arm.cc (Stub_addend_reader): New struct template definition
12334 and partial specializations.
12335 (Stub_addend_reader::operator()): New method definition for a
12336 partially specialized template.
12337
d5b40221
DK
123382009-10-30 Doug Kwan <dougkwan@google.com>
12339
12340 * arm.cc (Arm_relobj::processor_specific_flags): New method
12341 definition.
12342 (Arm_relobj::do_read_symbols): New method declaration.
12343 (Arm_relobj::processor_specific_flags_): New data member declaration.
12344 (Arm_dynobj): New class definition.
12345 (Target_arm::do_finalize_sections): Add input_objects parameter.
12346 (Target_arm::do_adjust_elf_header): New method declaration.
12347 (Target_arm::are_eabi_versions_compatible,
12348 (Target_arm::merge_processor_specific_flags): New method declaration.
12349 (Target_arm::do_make_elf_object): New overloaded method definitions
12350 and declaration.
12351 (Arm_relobj::do_read_symbols): New method definition.
12352 (Arm_dynobj::do_read_symbols): Ditto.
12353 (Target_arm::do_finalize_sections): Add input_objects parameters.
12354 Merge processor-specific flags from all input objects.
12355 (Target_arm::are_eabi_versions_compatible,
12356 Target_arm::merge_processor_specific_flags,
12357 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
12358 New method definitions.
12359 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
12360 Input_objects pointer type parameter.
12361 * layout.cc (Layout::finalize): Pass input objects to target's.
12362 finalize_sections function.
12363 * output.cc (Output_file_header::do_sized_write): Set ELF file
12364 header's processor-specific flags.
12365 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
12366 Input_objects pointer type parameter.
12367 * sparc.cc (Target_sparc::do_finalize_sections): Same.
12368 * target.h (Input_objects): New forward class declaration.
12369 (Target::processor_specific_flags,
12370 Target::are_processor_specific_flags_sect): New method definitions.
12371 (Target::finalize_sections): Add input_objects parameter.
12372 (Target::Target): Initialize processor_specific_flags_ and
12373 are_processor_specific_flags_set_.
12374 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
12375 parameter.
12376 (Target::set_processor_specific_flags): New method definition.
12377 (Target::processor_specific_flags_,
12378 Target::are_processor_specific_flags_set_): New data member
12379 declarations.
12380 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
12381 Input_objects pointer type parameter.
12382
ebabffbd
DK
123832009-10-30 Doug Kwan <dougkwan@google.com>
12384
12385 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
12386
ad0f2072
ILT
123872009-10-28 Ian Lance Taylor <iant@google.com>
12388
12389 * object.h (class Relobj): Drop options parameter from
12390 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
12391 do_scan_relocs, do_relocate. Change all callers.
12392 (class Sized_relobj): Drop options parameters from
12393 do_gc_process_relocs, do_scan_relocs, do_relocate,
12394 do_relocate_sections, relocate_sections, emit_relocs_scan,
12395 emit_relocs_scan_reltype. Change all callers.
12396 (struct Relocate_info): Remove options field and all references to
12397 it.
12398 * reloc.h (class Read_relocs): Remove options constructor
12399 parameter and options_ field. Change all callers.
12400 (class Gc_process_relocs, class Scan_relocs): Likewise.
12401 (class Relocate_task): Likewise.
12402 * target-reloc.h (scan_relocs): Remove options parameter. Change
12403 all callers.
12404 (scan_relocatable_relocs): Likewise.
12405 * target.h (class Sized_target): Remove options parameter from
12406 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
12407 all callers.
12408 * gc.h (gc_process_relocs): Remove options parameter. Change all
12409 callers.
12410 * arm.cc: Update functions to remove options parameters.
12411 * i386.cc: Likewise.
12412 * powerpc.cc: Likewise.
12413 * sparc.cc: Likewise.
12414 * x86_64.cc: Likewise.
12415 * testsuite/testfile.cc: Likewise.
12416
8ffa3667
DK
124172009-10-28 Doug Kwan <dougkwan@google.com>
12418
12419 * arm.cc (Arm_relobj): New class definition.
e1df38aa 12420 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
12421 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
12422 New method definitions.
12423
40f36857
CC
124242009-10-28 Cary Coutant <ccoutant@google.com>
12425
12426 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
12427 (Plugin::cleanup_done_): New member.
12428 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
12429 (Plugin_manager::cleanup_done_): Remove.
12430 (Plugin_manager::add_input_file): Edit error message.
12431 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
12432 (Plugin_manager::cleanup): Remove use of cleanup_done_.
12433
2c849493
ILT
124342009-10-27 Mikolaj Zalewski <mikolajz@google.com>
12435
12436 * fileread.cc: (File_read::View::~View): Use the new
12437 data_ownership_ filed.
12438 (File_read::~File_read): Dispose the new whole_file_view_.
12439 (File_read::open): Mmap the whole file if needed.
12440 (File_read::open): Use whole_file_view_ instead of contents_.
12441 (File_read::find_view): Use whole_file_view_ if applicable.
12442 (File_read::do_read): Use whole_file_view_ instead of contents_.
12443 (File_read::make_view): Use whole_file_view_ instead of contents_,
12444 update File_read::View::View call.
12445 (File_read::find_or_make_view): Update File_read::View::View
12446 call.
12447 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
12448 remove contents_
12449 (File_read::View::Data_ownership): New enum.
12450 (File_read::View::View): Replace bool mapped_ with Data_ownership
12451 argument.
12452 (File_read::View::mapped_): Remove (replaced by data_ownership_).
12453 (File_read::View::data_ownership_): New field.
12454 (File_read::contents_): Remove (replaced by whole_file_view_).
12455 (File_read::whole_file_view_): New field.
12456 * options.h (class General_options): Add --keep-files-mapped.
12457
24998053
CC
124582009-10-27 Cary Coutant <ccoutant@google.com>
12459
12460 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
12461 * testsuite/Makefile.am (plugin_test_5): New test case.
12462 * testsuite/Makefile.in: Regenerate.
12463
72adc4fa
DK
124642009-10-25 Doug Kwan <dougkwan@google.com>
12465
12466 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
12467 from private to protected to allow access by child class.
12468 (Sized_relobj::do_relocate_sections): New method declaration.
12469 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 12470 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
12471 Sized_relobj::relocate_sections. Instantiate template explicitly
12472 for different target sizes and endianity.
12473
07f508a2
DK
124742009-10-24 Doug Kwan <dougkwan@google.com>
12475
12476 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
12477 (Arm_input_section::as_arm_input_section): New method.
12478 (Arm_output_section): New class definition.
12479 (Arm_output_section::create_stub_group,
12480 Arm_output_section::group_sections): New method definitions.
12481
10ad9fe5
DK
124822009-10-22 Doug Kwan <dougkwan@google.com>
12483
12484 * arm.cc (Arm_input_section): New class definition.
12485 (Arm_input_section::init, Arm_input_section:do_write,
12486 Arm_input_section::set_final_data_size,
12487 Arm_input_section::do_reset_address_and_file_offset): New method
12488 definitions.
12489
56ee5e00
DK
124902009-10-21 Doug Kwan <dougkwan@google.com>
12491
12492 * arm.cc (Stub_table, Arm_input_section): New forward class
12493 declarations.
12494 (Stub_table): New class defintion.
12495 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
12496 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
12497 New method definition.
12498
b569affa
DK
124992009-10-21 Doug Kwan <dougkwan@google.com>
12500
12501 * arm.cc: Update copyright comments.
12502 (Target_arm): New forward class template declaration.
12503 (Arm_address): New type.
12504 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
12505 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
12506 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
12507 constants.
12508 (Insn_template): Same.
12509 (DEF_STUBS): New macro.
12510 (Stub_type): New enum type.
12511 (Stub_template): New class definition.
12512 (Stub): Same.
12513 (Reloc_stub): Same.
12514 (Stub_factory): Same.
12515 (Target_arm::Target_arm): Initialize may_use_blx_ and
12516 should_force_pic_veneer_.
12517 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
12518 Target_arm::should_force_pic_veneer,
12519 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
12520 Target_arm::using_thumb_only, Target_arm:;default_target): New
12521 method defintions.
12522 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
12523 New data member declarations.
12524 (Insn_template::size, Insn_template::alignment): New method defintions.
12525 (Stub_template::Stub_template): New method definition.
12526 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
12527 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
12528 (Stub_factory::Stub_factory): New method definition.
12529 * gold.h (string_hash): New template.
12530 * output.h (Input_section_specifier::hash_value): Use
12531 gold::string_hash.
12532 (Input_section_specifier::string_hash): Remove.
12533 * stringpool.cc (Stringpool_template::string_hash): Use
12534 gold::string_hash.
12535
6c172549
DK
125362009-10-20 Doug Kwan <dougkwan@google.com>
12537
12538 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
12539 symbols of relaxed input sections.
12540 * output.h (Output_section::find_relaxed_input_section): Make
12541 method public.
12542
c5617f2f
DK
125432009-10-16 Doug Kwan <dougkwan@google.com>
12544
12545 * dynobj.cc (Versions::Versions): Initialize version_script_.
12546 Only insert base version symbol definition for a shared object
12547 if version script defines any version versions.
12548 (Versions::define_base_version): New method definition.
12549 (Versions::add_def): Check that base version is not needed.
12550 (Versions::add_need): Define base version lazily.
12551 * dynobj.h (Versions::define_base_version): New method declaration.
12552 (Versions::needs_base_version_): New data member declaration.
12553 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
12554 (check_DATA): Add no_version_test.stdout.
12555 (libno_version_test.so, no_version_test.o no_version_test.stdout):
12556 New make rules.
12557 * testsuite/Makefile.in: Regenerate.
12558 * testsuite/no_version_test.c: New file.
12559 * testsuite/no_version_test.sh: Ditto.
12560
3c12dcdb
DK
125612009-10-16 Doug Kwan <dougkwan@google.com>
12562
12563 * expression.cc (class Segment_start_expression): New class definition.
12564 (Segment_start_expression::value): New method definition.
12565 (script_exp_function_segment_start): Return a new
12566 Segment_start_expression.
12567 * gold/script-c.h (script_saw_segment_start_expression): New function
12568 prototype.
12569 * script-sections.cc (Script_sections::Script_sections): Initialize
12570 SAW_SEGMENT_START_EXPRESSION_ to false.
12571 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
12572 and -Tbbs options to specify section addresses if given in
12573 command line and no SEGMENT_START expression is seen in a script.
12574 * script-sections.h (Script_sections::saw_segment_start_expression,
12575 Script_sections::set_saw_segment_start_expression): New method
12576 definition.
12577 (Script_sections::saw_segment_start_expression_): New data member
12578 declaration.
12579 * script.cc (script_saw_segment_start_expression): New function.
12580 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
12581 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
12582 script_test_7.sh and script_test_8.sh.
12583 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
12584 script_test_8.stdout.
12585 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
12586 (script_test_6, script_test_6.stdout, script_test_7,
12587 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
12588 * Makefile.in: Regenerate.
12589 * testsuite/script_test_6.sh: New file.
12590 * testsuite/script_test_6.t: Same.
12591 * testsuite/script_test_7.sh: Same.
12592 * testsuite/script_test_7.t: Same.
12593 * testsuite/script_test_8.sh: Same.
12594
64b1ae37
DK
125952009-10-16 Doug Kwan <dougkwan@google.com>
12596
12597 * output.cc (Output_segment::set_section_list_address): Cast
12598 expressions to unsigned long long type to avoid format warnings.
12599
661be1e2
ILT
126002009-10-15 Ian Lance Taylor <iant@google.com>
12601
12edd763 12602 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 12603 dot assignment to script_sections_.
12edd763
ILT
12604 * script-sections.cc (Script_sections::add_dot_assignment):
12605 Initialize if necessary.
12606
68b6574b
ILT
12607 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
12608 program headers with no load segment if there is a linker script.
12609
661be1e2
ILT
12610 * layout.cc (Layout::set_segment_offsets): Align the file offset
12611 to the segment aligment for -N or -n with no load segment.
12612 * output.cc (Output_segment::add_output_section): Don't crash if
12613 the first section is a TLS section.
12614 (Output_segment::set_section_list_addresses): Print an error
12615 message if the address moves backward in a linker script.
12616 * script-sections.cc
12617 (Output_section_element_input::set_section_addresses): Don't
12618 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
12619 (Orphan_output_section::set_section_addresses): Likewise.
12620
f15f61a7
DK
126212009-10-15 Doug Kwan <dougkwan@google.com>
12622
12623 * layout.cc (Layout::finish_dynamic_section): Generate tags
12624 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
12625 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
12626 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
12627
82bb573a
ILT
126282009-10-14 Ian Lance Taylor <iant@google.com>
12629
12630 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
12631 fields.
12632 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
12633 data_shdr fields of relinfo.
12634 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
12635 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
12636 R_386_TLS_LDO_32, adjust based on section flags.
12637 (Target_i386::Relocate::fix_up_ldo): Remove.
12638
374ad285
ILT
126392009-10-13 Ian Lance Taylor <iant@google.com>
12640
12641 Add support for -pie.
12642 * options.h (class General_options): Add -pie and
12643 --pic-executable.
12644 (General_options::output_is_position_independent): Test -pie.
12645 (General_options::output_is_executable): Return true if not shared
12646 and not relocatable.
12647 (General_options::output_is_pie): Remove.
12648 * options.cc (General_options::finalize): Reject incompatible uses
12649 of -pie.
12650 * gold.cc (queue_middle_tasks): A -pie link is not static.
12651 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
12652 * symtab.cc (Symbol::final_value_is_known): Return false if
12653 output_is_position_independent.
12654 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
12655 output_is_position_independent.
12656 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
12657 output_is_position_independent.
12658 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
12659 output_is_position_independent.
12660 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
12661 two_file_pie_test.
12662 (basic_pie_test.o, basic_pie_test): New targets.
12663 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
12664 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
12665 (two_file_pie_test): New target.
12666 * testsuite/Makefile.in: Rebuild.
12667 * README: Remove note saying that -pie is not supported.
12668
c6585162
ILT
126692009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
12670
12671 * options.h (class General_options): Add -init and -fini.
12672 * layout.cc (Layout::finish_dynamic_section): Emit
12673 given init and fini functions.
12674
032ce4e9
ST
126752009-10-13 Sriraman Tallam <tmsriram@google.com>
12676
12677 * gc.h (gc_process_relocs): Check if icf is enabled using new
12678 function.
12679 * gold.cc (queue_initial_tasks): Likewise.
12680 (queue_middle_tasks): Likewise.
12681 * object.cc (do_layout): Likewise.
12682 * symtab.cc (is_section_folded): Likewise.
12683 * main.cc (main): Likewise.
12684 * reloc.cc (Read_relocs::run): Likewise.
12685 (Sized_relobj::do_scan_relocs): Likewise.
12686 * icf.cc (is_function_ctor_or_dtor): New function.
12687 (Icf::find_identical_sections): Check if function is ctor or dtor when
12688 safe icf is chosen.
12689 * options.h (General_options::icf): Change option to be an enum.
12690 (Icf_status): New enum.
12691 (icf_enabled): New method.
12692 (icf_safe_folding): New method.
12693 (set_icf_status): New method.
12694 (icf_status_): New variable.
12695 * (options.cc) (General_options::finalize): Set icf_status_.
12696 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
12697 icf_test and icf_keep_unique_test to use the --icf enum flag.
12698 * testsuite/icf_safe_test.sh: New file.
e1df38aa 12699 * testsuite/icf_safe_test.cc: New file.
032ce4e9 12700
f345227a
ST
127012009-10-12 Sriraman Tallam <tmsriram@google.com>
12702
12703 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
12704 includes to gc.h and icf.h.
12705 * arm.cc: Include gc.h.
12706 * gold.cc: Likewise.
12707 * i386.cc: Likewise.
12708 * powerpc.cc: Likewise.
12709 * sparc.cc: Likewise.
12710 * x86_64.cc: Likewise.
12711 * gc.h: Include icf.h.
12712
1c7814ed
ILT
127132009-10-11 Ian Lance Taylor <iant@google.com>
12714
12715 * plugin.cc: Include "gold.h" before other header files.
12716
ae3b5189
CD
127172009-10-10 Chris Demetriou <cgd@google.com>
12718
12719 * options.h (Input_file_argument::Input_file_type): New enum.
12720 (Input_file_argument::is_lib_): Replace with...
12721 (Input_file_argument::type_): New member.
12722 (Input_file_argument::Input_file_argument): Take Input_file_type
12723 'type' rather than boolean 'is_lib' as second argument.
12724 (Input_file_argument::is_lib): Use type_.
12725 (Input_file_argument::is_searched_file): New function.
12726 (Input_file_argument::may_need_search): Handle is_searched_file.
12727 * options.cc (General_options::parse_library): Support -l:filename.
12728 (General_options::parse_just_symbols): Update for Input_file_argument
12729 changes.
12730 (Command_line::process): Likewise.
12731 * archive.cc (Archive::get_file_and_offset): Likewise.
12732 * plugin.cc (Plugin_manager::release_input_file): Likewise.
12733 * script.cc (read_script_file, script_add_file): Likewise.
12734 * fileread.cc (Input_file::Input_file): Likewise.
12735 (Input_file::will_search_for): Handle is_searched_file.
12736 (Input_file::open): Likewise.
12737 * readsyms.cc (Read_symbols::get_name): Likewise.
12738 * testsuite/Makefile.am (searched_file_test): New test.
12739 * testsuite/Makefile.in: Regenerate.
12740 * testsuite/searched_file_test.cc: New file.
12741 * testsuite/searched_file_test_lib.cc: New file.
12742
f3048a1d
ILT
127432009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12744 Ian Lance Taylor <iant@google.com>
12745
12746 * descriptor.cc: Include <cstdio> and "binary-io.h".
12747 (Descriptors::open): Open the files in binary mode always.
12748 * script.cc (Lex::get_token): Treat \r as whitespace.
12749
d4780e57
ILT
127502009-10-09 Ian Lance Taylor <iant@google.com>
12751
12752 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
12753
d9a893b8
ILT
127542009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12755 Ian Lance Taylor <iant@google.com>
12756
12757 * configure.ac: Check for readv function also.
12758 * fileread.cc (readv): Define if not HAVE_READV.
12759 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
12760 does not exist.
12761 * config.in: Regenerate.
12762 * configure: Regenerate.
12763
c0a62865
DK
127642009-10-09 Doug Kwan <dougkwan@google.com>
12765
12766 * layout.cc (Layout::make_output_section): Call target hook to make
12767 ordinary output section.
12768 (Layout::finalize): Adjust parameter list of call the
12769 Target::may_relax().
12770 * layout.h (class Layout::section_list): New method.
12771 * merge.h (Output_merge_base::entsize): Change visibility to public.
12772 (Output_merge_base::is_string, Output_merge_base::do_is_string):
12773 New methods.
12774 (Output_merge_string::do_is_string): New method.
12775 * object.cc (Sized_relobj::do_setup): renamed from
12776 Sized_relobj::set_up.
12777 * object.h (Sized_relobj::adjust_shndx,
12778 Sized_relobj::initializ_input_to_output_maps,
12779 Sized_relobj::free_input_to_output_maps): Change visibilities to
12780 protected.
12781 (Sized_relobj::setup): Virtualize.
12782 (Sized_relobj::do_setup): New method declaration.
12783 (Sized_relobj::invalidate_section_offset,
12784 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
12785 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
12786 * options.cc (parse_int): New function.
12787 * options.h (parse_int): New declaration.
12788 (DEFINE_int): New macro.
12789 (stub_group_size): New option.
12790 * output.cc (Output_section::Output_section): Initialize memebers
12791 merge_section_map_, merge_section_by_properties_map_,
12792 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
12793 (Output_section::add_input_section): Handled deferred code-fill
12794 generation and remove an old comment.
12795 (Output_section::add_relaxed_input_section): New method definition.
12796 (Output_section::add_merge_input_section): Use merge section by
12797 properties map to speed to search. Update merge section maps
12798 as appropriate.
12799 (Output_section::build_relaxation_map): New method definition.
12800 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
12801 Same.
12802 (Output_section::relax_input_section): Renamed to
12803 Output_section::convert_input_sections_to_relaxed_sections and change
12804 interface to take a vector of pointers to relaxed sections.
12805 (Output_section::find_merge_section,
12806 Output_section::find_relaxed_input_section): New method definitions.
12807 (Output_section::is_input_address_mapped,
12808 Output_section::output_offset, Output_section::output_address):
12809 Use output section data maps to speed up searching.
12810 (Output_section::find_starting_output_address): Add comments.
12811 (Output_section::do_write,
12812 Output_section::write_to_postprocessing_buffer): Do code-fill
12813 generation as appropriate.
12814 (Output_section::get_input_sections): Invalidate relaxed input section
12815 map.
12816 (Output_section::restore_states): Adjust type of checkpoint .
12817 Invalidate relaxed input section map.
12818 * output.h (Output_merge_base): New class declaration.
12819 (Input_section_specifier): New class defintion.
12820 (class Output_relaxed_input_section) Change base class to
12821 Output_section_data_build.
12822 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
12823 base class initializer.
12824 (Output_section::add_relaxed_input_section): New method declaration.
12825 (Output_section::Input_section): Change visibility to protected.
2e702c99 12826 (Output_section::Input_section::relobj,
c0a62865
DK
12827 Output_section::Input_section::shndx): Handle relaxed input sections.
12828 Output_section::input_sections) Change visibility to protected. Also
12829 define overload to return a non-const pointer.
12830 (Output_section::Merge_section_properties): New class defintion.
12831 (Output_section::Merge_section_by_properties_map,
12832 Output_section::Output_section_data_by_input_section_map,
12833 Output_section::Relaxation_map): New types.
12834 (Output_section::relax_input_section): Rename method to
12835 Output_section::convert_input_sections_to_relaxed_sections and change
12836 interface to take a vector of relaxed section pointers.
12837 (Output_section::find_merge_section,
12838 Output_section::find_relaxed_input_section,
12839 Output_section::build_relaxation_map,
12840 Output_section::convert_input_sections_in_list_to_relaxed_sections):
12841 New method declarations.
12842 (Output_section::merge_section_map_
12843 Output_section::merge_section_by_properties_map_,
12844 Output_section::relaxed_input_section_map_,
12845 Output_section::is_relaxed_input_section_map_valid_,
12846 Output_section::generate_code_fills_at_write_): New data members.
12847 * script-sections.cc
12848 (Output_section_element_input::set_section_addresses): Call
12849 current_data_size and addralign methods of relaxed input sections.
12850 (Orphan_output_section::set_section_addresses): Call current_data_size
12851 and addralign methods of relaxed input sections.
12852 * symtab.cc (Symbol_table::compute_final_value): Extract template
12853 from the body of Symbol_table::sized_finalize_symbol.
12854 (Symbol_table::sized_finalized_symbol): Call
12855 Symbol_table::compute_final_value.
12856 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
12857 (Symbol_table::compute_final_value): New templated method declaration.
12858 * target.cc (Target::do_make_output_section): New method defintion.
12859 * target.h (Target::make_output_section): New method declaration.
12860 (Target::relax): Add more parameters for input objects, symbol table
12861 and layout. Adjust call to do_relax.
12862 (Target::do_make_output_section): New method declaration.
12863 (Target::do_relax): Add parameters for input objects, symbol table
12864 and layout.
12865
d446d6c4
ILT
128662009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12867
12868 * pread.c: Include stdio.h.
12869
bc06c745
ILT
128702009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12871
12872 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
12873 defined.
12874
75aea3d0
ILT
128752009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12876
12877 * dwarf_reader.cc (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 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
12883 Change read_shndx type to unsigned int.
12884 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12885 int.
12886 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12887 * layout.cc (Layout::create_symtab_sections): Cast the result of
12888 local_symcount * symsize to off_t in the gold_assert.
12889
be8fcb75
ILT
128902009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12891
12892 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
12893 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
12894 R_ARM_BASE_ABS.
12895 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
12896 (Arm_relocate_functions::thm_abs5): New function.
12897 (Arm_relocate_functions::abs12): New function.
12898 (Arm_relocate_functions::abs16): New function.
12899 (Arm_relocate_functions::base_abs): New function.
12900 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
12901 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
12902 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
12903 R_ARM_BASE_ABS.
12904 (Scan::global): Likewise.
12905 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
12906 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
12907 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
12908 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
12909 R_ARM_BASE_ABS.
12910
c2a122b6
ILT
129112009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12912
12913 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
12914 (Arm_relocate_functions::movt_prel): New function.
12915 (Arm_relocate_functions::thm_movw_prel_nc): New function.
12916 (Arm_relocate_functions::thm_movt_prel): New function.
12917 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
12918 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
12919 (Scan::global, Relocate::relocate): Likewise.
12920 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12921
c4aa1e2d
ILT
129222009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12923
12924 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
12925 Incremental_checker.
12926 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
12927 unsigned int.
12928 (class Incremental_inputs_header): New class.
12929 (Incremental_inputs_header_writer): Edit comment.
12930 (Incremental_inputs_entry): New class.
12931 (Incremental_inputs_entry_writer): Edit comment.
12932 (Sized_incremental_binary::do_find_incremental_inputs_section):
12933 Add *strtab_shndx parameter, fill it.
12934 (Sized_incremental_binary::do_check_inputs): New method.
12935 (Incremental_checker::can_incrementally_link_output_file): Use
12936 Sized_incremental_binary::check_inputs.
12937 (Incremental_inputs::report_command_line): Save command line in
12938 command_line_.
12939 * incremental.h:
12940 (Incremental_binary::find_incremental_inputs_section): New
12941 method.
12942 (Incremental_binary::do_find_incremental_inputs_section): Add
12943 strtab_shndx parameter.
12944 (Incremental_binary::do_check_inputs): New pure virtual method.
12945 (Sized_incremental_binary::do_check_inputs): Declare.
12946 (Incremental_checker::Incremental_checker): Add incremental_inputs
12947 parameter, use it to initialize incremental_inputs_.
12948 (Incremental_checker::incremental_inputs_): New field.
12949 (Incremental_checker::command_line): New method.
12950 (Incremental_checker::inputs): New method.
12951 (Incremental_checker::command_line_): New field.
12952
c549a694
ILT
129532009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12954
12955 * incremental.cc: Include <cstdarg> and "target-select.h".
12956 (vexplain_no_incremental): New function.
12957 (explain_no_incremental): New function.
12958 (Incremental_binary::error): New method.
12959 (Sized_incremental_binary::do_find_incremental_inputs_section): New
12960 method.
12961 (make_sized_incremental_binary): New function.
12962 (open_incremental_binary): New function.
12963 (can_incrementally_link_file): Add checks if output is ELF and has
12964 inputs section.
12965 * incremental.h: Include "elfcpp_file.h" and "output.h".
12966 (Incremental_binary): New class.
12967 (Sized_incremental_binary): New class.
12968 (open_incremental_binary): Declare.
12969 * object.cc (is_elf_object): Use
12970 elfcpp::Elf_recognizer::is_elf_file.
12971 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
12972 * output.h (Output_file::filesize): New method.
12973
fd3c5f0b
ILT
129742009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12975
12976 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
12977 New function.
12978 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
12979 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
12980 function.
12981 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
12982 function.
12983 (Arm_relocate_functions::movw_abs_nc): New function.
12984 (Arm_relocate_functions::movt_abs): New function.
12985 (Arm_relocate_functions::thm_movw_abs_nc): New function.
12986 (Arm_relocate_functions::thm_movt_abs): New function.
12987 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
12988 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
12989 (Scan::global): Likewise.
12990 (Relocate::relocate): Likewise.
12991 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12992
7f5309a5
ILT
129932009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12994
12995 * arm.cc (Arm_relocate_functions::got_prel) New function.
12996 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
12997 (Relocate::relocate): Likewise.
12998 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12999
364c7fa5
ILT
130002009-10-06 Ian Lance Taylor <iant@google.com>
13001
13002 * options.h (class General_options): Define
13003 split_stack_adjust_size parameter.
13004 * object.h (class Object): Add uses_split_stack_ and
13005 has_no_split_stack_ fields. Add uses_split_stack and
13006 has_no_split_stack accessor functions. Declare
13007 handle_split_stack_section.
13008 (class Reloc_symbol_changes): Define.
13009 (class Sized_relobj): Define Function_offsets. Declare
13010 split_stack_adjust, split_stack_adjust_reltype, and
13011 find_functions.
13012 * object.cc (Object::handle_split_stack_section): New function.
13013 (Sized_relobj::do_layout): Call handle_split_stack_section.
13014 * dynobj.cc (Sized_dynobj::do_layout): Call
13015 handle_split_stack_section.
13016 * reloc.cc (Sized_relobj::relocate_sections): Call
13017 split_stack_adjust for executable sections in split_stack
13018 objects. Pass reloc_map to relocate_section.
13019 (Sized_relobj::split_stack_adjust): New function.
13020 (Sized_relobj::split_stack_adjust_reltype): New function.
13021 (Sized_relobj::find_functions): New function.
13022 * target-reloc.h: Include "object.h".
13023 (relocate_section): Add reloc_symbol_changes parameter. Change
13024 all callers.
13025 * target.h (class Target): Add calls_non_split method. Declare
13026 do_calls_non_split virtual method. Declare match_view and
13027 set_view_to_nop.
13028 * target.cc: Include "elfcpp.h".
13029 (Target::do_calls_non_split): New function.
13030 (Target::match_view): New function.
13031 (Target::set_view_to_nop): New function.
13032 * gold.cc (queue_middle_tasks): Give an error if mixing
13033 split-stack and non-split-stack objects with -r.
13034 * i386.cc (Target_i386::relocate_section): Add
13035 reloc_symbol_changes parameter.
13036 (Target_i386::do_calls_non_split): New function.
13037 * x86_64.cc (Target_x86_64::relocate_section): Add
13038 reloc_symbol_changes parameter.
13039 (Target_x86_64::do_calls_non_split): New function.
13040 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
13041 parameter.
13042 * powerpc.cc (Target_powerpc::relocate_section): Add
13043 reloc_symbol_changes parameter.
13044 * sparc.cc (Target_sparc::relocate_section): Add
13045 reloc_symbol_changes parameter.
13046 * configure.ac: Call AM_CONDITIONAL for the default target.
13047 * configure: Rebuild.
13048 * testsuite/Makefile.am (TEST_AS): New variable.
13049 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
13050 (check_DATA): Add split_i386 and split_x86_64 files.
13051 (SPLIT_DEFSYMS): Define.
13052 (split_i386_[1234n].o): New targets.
13053 (split_i386_[124]): New targets.
13054 (split_i386_[1234r].stdout): New targets.
13055 (split_x86_64_[1234n].o): New targets.
13056 (split_x86_64_[124]): New targets.
13057 (split_x86_64_[1234r].stdout): New targets.
13058 (MOSTLYCLEANFILES): Add new executables.
13059 * testsuite/split_i386.sh: New file.
13060 * testsuite/split_x86_64.sh: New file.
13061 * testsuite/split_i386_1.s: New file.
13062 * testsuite/split_i386_2.s: New file.
13063 * testsuite/split_i386_3.s: New file.
13064 * testsuite/split_i386_4.s: New file.
13065 * testsuite/split_i386_n.s: New file.
13066 * testsuite/split_x86_64_1.s: New file.
13067 * testsuite/split_x86_64_2.s: New file.
13068 * testsuite/split_x86_64_3.s: New file.
13069 * testsuite/split_x86_64_4.s: New file.
13070 * testsuite/split_x86_64_n.s: New file.
13071 * testsuite/testfile.cc (Target_test): Update relocation_section
13072 function.
13073 * testsuite/Makefile.in: Rebuild.
13074
e8a9fcda
ILT
130752009-10-06 Ian Lance Taylor <iant@google.com>
13076
13077 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
13078 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
13079 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
13080 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
13081 the address on ldo_addrs_.
13082 (Target_i386::Relocate::fix_up_ldo): New function.
13083
e99daf92
ILT
130842009-10-06 Rafael Espindola <espindola@google.com>
13085
13086 * plugin.cc (add_input_library): New.
13087 (Plugin::load): Add add_input_library to tv.
13088 (Plugin_manager::add_input_file): Add the is_lib argument.
13089 (add_input_file): Update call to Plugin_manager::add_input_file.
13090 (add_input_library): New.
13091 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
13092
966d4097
DK
130932009-09-30 Doug Kwan <dougkwan@google.com>
13094
13095 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
13096 symbol and call Symbol::may_need_copy_reloc to determine if
13097 a copy reloc is needed.
13098 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
13099 nocopyreloc is given in command line.
13100 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
13101 given in command line.
13102 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
13103 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
13104 of the removed Target_i386::may_need_copy_reloc.
13105 * options.h (copyreloc): New option with default value false.
13106 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13107 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
13108 instead of the removed Target_powerpc::may_need_copy_reloc.
13109 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13110 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
13111 instead of the removed Target_sparc::may_need_copy_reloc.
13112 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
13113 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
13114 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
13115 instead of the removed Target_x86_64::may_need_copy_reloc.
13116
029ba973
ILT
131172009-09-30 Ian Lance Taylor <iant@google.com>
13118
13119 * object.h (class Object): Remove target_ field, and target,
13120 sized_target, and set_target methods.
13121 (Object::sized_target): Remove.
13122 (class Sized_relobj): Update declarations. Remove sized_target.
13123 * object.cc (Sized_relobj::setup): Remove target parameter.
13124 Change all callers.
13125 (Input_objects::add_object): Don't do anything with the target.
13126 (make_elf_sized_object): Add punconfigured parameter. Change all
13127 callers. Set or test parameter target.
13128 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
13129 Change all callers.
13130 * parameters.cc (Parameters::set_target): Change parameter type to
13131 be non-const.
13132 (Parameters::default_target): Remove.
13133 (set_parameters_target): Change parameter type to be non-const.
13134 (parameters_force_valid_target): New function.
13135 (parameters_clear_target): New function.
13136 * parameters.h (class Parameters): Update declarations. Remove
13137 default_target method. Add sized_target and clear_target
13138 methods. Change target_ to be non-const.
13139 (set_parameters_target): Update declaration.
13140 (parameters_force_valid_target): Declare.
13141 (parameters_clear_target): Declare.
13142 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
13143 as NULL if we aren't searching.
13144 (Add_symbols::run): Don't check for compatible target.
13145 * fileread.cc (Input_file::open_binary): Call
13146 parameters_force_valid_target.
13147 * gold.cc (queue_middle_tasks): Likewise.
13148 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
13149 set_target on object.
13150 * dynobj.h (class Sized_dynobj): Update declarations.
13151 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
13152 make_elf_object returns NULL.
13153 (Archive::include_member): Don't check whether object target is
13154 compatible.
13155 * output.cc (Output_section::add_input_section): Get target from
13156 parameters.
13157 (Output_section::relax_input_section): Likewise.
13158 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
13159 parameters.
13160 (Sized_relobj::do_scan_relocs): Likewise.
13161 (Sized_relobj::relocate_sections): Likewise.
13162 * resolve.cc (Symbol_table::resolve): Likewise.
13163 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
13164 parameter. Change all callers.
13165 (Symbol_table::add_from_object): Get target from parameters.
13166 (Symbol_table::add_from_relobj): Don't check object target.
13167 (Symbol_table::add_from_dynobj): Likewise.
13168 (Symbol_table::define_special_symbol): Get target from
13169 parameters.
13170 * symtab.h (class Symbol_table): Update declaration.
13171 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
13172 parameter. Change all callers. Clear parameter target.
13173 (Binary_test): Test target here.
13174 * testsuite/object_unittest.cc (gold_testsuite): Remove
13175 target_test_pointer parameter. Change all callers.
13176 (Object_test): Test target here.
13177
a6a22b83
ILT
131782009-09-26 Ian Lance Taylor <iant@google.com>
13179
13180 * testsuite/initpri1.c: Don't try to use constructor priorities if
13181 compiling with gcc before 4.3.
13182
6a8f49fe
ILT
131832009-09-22 Mikolaj Zalewski <mikolajz@google.com>
13184
13185 * testsuite/retain_symbols_file_test.sh (check_present): Change
13186 output file name to retain_symbols_file_test.stdout.
13187 (check_absent): Likewise.
13188
8c604651
CS
131892009-09-18 Craig Silverstein <csilvers@google.com>
13190
13191 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
13192 * options.cc: Include <cerrno> and <fstream>.
13193 (General_options::finalize): Parse -retain-symbols-file tag.
13194 * options.h: New flag.
13195 (General_options): New method should_retain_symbol, new
13196 variable symbols_to_retain.
13197 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
13198 should_retain_symbol map.
13199 * testsuite/Makefile.am (retain_symbols_file_test): New test.
13200 * testsuite/Makefile.in: Regenerate.
13201 * testsuite/retain_symbols_file_test.sh: New file.
13202
ca58b19f
NC
132032009-09-18 Nick Clifton <nickc@redhat.com>
13204
13205 * po/es.po: Updated Spanish translation.
13206
20e6d0d6
DK
132072009-09-17 Doug Kwan <dougkwan@google.com>
13208
13209 * debug.h (DEBUG_RELAXATION): New constant.
13210 (DEBUG_ALL): Add DEBUG_RELAXATION.
13211 (debug_string_to_enum): Add relaxation debug option.
13212 * layout.cc
13213 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
13214 Layout::Relaxation_debug_check::read_sections,
13215 Layout::Relaxation_debug_check::read_sections): New method definitions.
13216 (Layout::Layout): Initialize data members
13217 record_output_section_data_from_scrips_,
13218 script_output_section_data_list_ and relaxation_debug_check_.
13219 (Layout::save_segments, Layout::restore_segments,
13220 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13221 Layout::relaxation_loop_body): New method definitions.
13222 (Layout::finalize): Support relaxation. Move section layout code to
13223 Layout::relaxation_loop_body.
13224 (Layout::set_asection_address_from_script): Move code for orphan
13225 section placement out.
13226 (Layout::place_orphan_sections_in_script): New method definition.
13227 * layout.h (Output_segment_headers, Output_file_header):
13228 New forward class declarations.
13229 (Layout::~Layout): Define.
13230 (Layout::new_output_section_data_from_script): New method definition.
13231 (Layout::place_orphan_sections_in_script): New method declaration.
13232 (Layout::Segment_states): New type declaration.
13233 (Layout::save_segments, Layout::restore_segments,
13234 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13235 Layout::relaxation_loop_body): New method declarations.
13236 (Layout::Output_section_data_list): New type declaration.
13237 (Layout::Relaxation_debug_check): New class definition.
13238 (Layout::record_output_section_data_from_script_,
13239 Layout::script_output_section_data_list_, Layout::segment_states_,
13240 Layout::relaxation_debug_check_): New data members.
13241 * output.cc: (Output_section_headers::do_size): New method definition.
13242 (Output_section_headers::Output_section_headers): Move size
13243 computation to Output_section_headers::do_size.
13244 (Output_segment_headers::do_size): New method definition.
e1df38aa 13245 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
13246 Output_file_header::do_size and call it.
13247 (Output_file_header::do_size): New method definition.
13248 (Output_data_group::Output_data_group): Adjust call to
13249 Output_section_data.
13250 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
13251 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 13252 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
13253 RELAXED_INPUT_SECTION_CODE.
13254 (Output_section::Output_section): Initialize data member checkpoint_.
13255 (Output_section::~Output_section): Delete checkpoint object pointed
13256 by checkpoint_.
13257 (Output_section::add_input_section): Always add an Input_section if
13258 relaxing.
13259 (Output_section::add_merge_input_section): Add assert.
13260 (Output_section::relax_input_section): New method definition.
13261 (Output_section::set_final_data_size): Set load address to zero for
13262 an unallocated section.
13263 (Output_section::do_address_and_file_offset_have_reset_values):
13264 New method definition.
13265 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
13266 Handle relaxed input section.
13267 (Output_section::sort_attached_input_sections): Checkpoint input
13268 section list lazily.
13269 (Output_section::get_input_sections): Change type of input_sections to
13270 list of Simple_input_section pointers. Checkpoint input section list
13271 lazily. Also handle relaxed input sections.
13272 (Output_section::add_input_section_for_script): Take a reference to
13273 a Simple_input_section object instead of Relobj pointer and section
13274 index as parameter. Handle relaxed input sections.
13275 (Output_section::save_states, Output_section::restore_states): New
13276 method definitions.
13277 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
13278 (Output_data::is_data_size_fixed): New method definition.
13279 (Output_data::reset_addresss_and_file_offset): Do not reset data size
13280 if it is fixed.
13281 (Output_data::address_and_file_offset_have_reset_values): New method
13282 definition.
13283 (Output_data::do_address_and_file_offset_have_reset_values): New method
13284 definition.
13285 (Output_data::set_data_size): Check that data size is not fixed.
13286 (Output_data::fix_data_size): New method definition.
13287 (Output_data::is_data_size_fixed_): New data member.
13288 (Output_section_headers::set_final_data_size): New method definition.
13289 (Output_section_headers::do_size): New method declaration.
13290 (Output_segment_headers::set_final_data_size): New method definition.
13291 (Output_segment_headers::do_size): New method declaration.
13292 (Output_file_header::set_final_data_size)::New method definition.
13293 (Output_file_header::do_size)::New method declaration.
13294 (Output_section_data::Output_section_data): Add new parameter
13295 is_data_size_fixed and use it to fix data size.
13296 (Output_data_const::Output_data_const): Adjust call to base class
13297 constructor and fix data size.
13298 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
13299 base class constructor and fix data size.
13300 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
13301 base class constructor and fix data size.
13302 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
13303 class constructor and fix data size.
13304 (Output_data_group::set_final_data_size): New method definition.
13305 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
13306 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
13307 class constructor and fix data size.
13308 (Output_relaxed_input_section): New class definition.
13309 (Output_section::Simple_input_section): New class definition.
13310 (Output_section::get_input_sections): Adjust parameter list.
13311 (Output_section::add_input_section_for_script): Same.
13312 (Output_section::save_states, Output_section::restore_states,
13313 Output_section::do_address_and_file_offset_have_reset_values,
13314 (Output_section::Input_section::Input_section): Handle
13315 RELAXED_INPUT_SECTION_CODE. Add new overload for
13316 Output_relaxed_input_section.
13317 (Output_section::Input_section::is_input_section,
13318 Output_section::Input_section::set_output_section): Handle relaxed
13319 input section.
13320 (Output_section::Input_section::is_relaxed_input_section,
13321 Output_section::Input_section::output_section_data,
13322 Output_section::Input_section::relaxed_input_section): New method
13323 definitions.
13324 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
13325 value.
13326 (Output_section::Input_section::u1_): Update comments.
13327 (Output_section::Input_section::u2_): Add new union member poris.
13328 (Output_section::Checkpoint_output_section): New classs definition.
13329 (Output_section::relax_input_section): New method declaration.
13330 (Output_section::checkpoint_): New data member.
13331 (Output_segment): Update comments.
13332 (Output_segment::Output_segment): Un-privatize copy constructor.
13333 (Output_segment::operator=): Un-privatize.
13334 * script-sections.cc (Output_section_element::Input_section_list):
13335 Change element type to Output_section::Simple_input_section.
13336 (Output_section_element_dot_assignment::set_section_addresses):
13337 Register output section data for relaxation clean up.
13338 (Output_data_exression::Output_data_expression): Adjust call to base
13339 constructor to fix data size.
13340 (Output_section_element_data::set_section_addresses): Register
13341 Output_data_expression object for relaxation clean up.
13342 (struct Input_section_info): Replace Relobj pointer and section index
13343 pair with Output_section::Simple_input_section and Convert struct to a
13344 class.
13345 (Input_section_sorter::operator()): Adjust access to
e1df38aa 13346 Input_section_info data member to use accessors.
20e6d0d6
DK
13347 (Output_section_element_input::set_section_addresses): Use layout
13348 parameter. Adjust code to use Output_section::Simple_input_section
13349 and Input_secction_info classes. Register filler for relaxation
13350 clean up.
13351 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
13352 and section index pair with Output_section::Simple_input_section
13353 class. Adjust code accordingly.
13354 (Phdrs_element::release_segment): New method definition.
13355 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
13356 segment list.
13357 (Script_sections::release_segments): New method definition.
13358 * gold/script-sections.h (Script_sections::release_segments): New
13359 method declaration.
13360 * gold/target.h (Target::may_relax, Target::relax,
13361 Target::do_may_relax, Target::do_relax): New method definitions.
13362
5e445df6
ILT
133632009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13364
13365 * arm.cc (has_signed_unsigned_overflow): New function.
13366 (Arm_relocate_functions::abs8): New function.
13367 (Target_arm::Scan::local): Handle R_ARM_ABS8.
13368 (Target_arm::Scan::global): Likewise.
13369 (Target_arm::relocate::relocate): Likewise.
13370 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
13371 Likewise.
13372
8c604651 133732009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
13374
13375 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
13376 * testsuite/Makefile.in: Regenerate.
13377
1e9cc1c2
NC
133782009-09-11 Nick Clifton <nickc@redhat.com>
13379
13380 * po/gold.pot: Updated by the Translation project.
13381
6a89f575
CC
133822009-09-08 Cary Coutant <ccoutant@google.com>
13383
13384 * output.cc (Output_file::open): Add execute permission to empty file.
13385 * testsuite/Makefile.am (permission_test): New test.
13386 * testsuite/Makefile.in: Regenerate.
13387
fdcac5af
ILT
133882009-09-02 Ian Lance Taylor <iant@google.com>
13389
13390 * output.cc (Output_file::resize): Call map_no_anonymous rather
13391 than map.
13392
44453f85
ILT
133932009-09-01 Mikolaj Zalewski <mikolajz@google.com>
13394
13395 * gold.cc: Include "incremental.h".
13396 (queue_initial_tasks): Call Incremental_checker methods.
13397 * incremental.cc: Include "output.h".
13398 (Incremental_checker::can_incrementally_link_output_file): New
13399 method.
13400 * incremental.h (Incremental_checker): New class.
13401
13402 * output.cc (Output_file::open_for_modification): New method.
13403 (Output_file::map_anonymous): Changed return type to bool. Record
13404 map in base_ field.
13405 (Output_file::map_no_anonymous): New method, broken out of map.
13406 (Output_file::map): Use map_no_anonymous and map_anonymous.
13407 * output.h (class Output_file): Update declarations.
13408
293c1386
CC
134092009-08-24 Cary Coutant <ccoutant@google.com>
13410
13411 * options.h (Command_line::Pre_options): New class.
13412 (Command_line::pre_options): New member.
13413 * options.cc (gold::options::ready_to_register): New variable.
13414 (One_option::register_option): Do nothing if not registering options.
13415 Assert if same short option registered twice.
13416 (General_options::General_options): Turn off option registration when
13417 done constructing.
13418 (Command_line::Pre_options::Pre_options): New constructor.
13419
f773f3d2
CC
134202009-08-24 Cary Coutant <ccoutant@google.com>
13421
06a73cfe
CC
13422 * options.h (General_options::no_keep_memory): Remove incorrect
13423 short option.
f773f3d2 13424
a15af8e2
RW
134252009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13426
13427 * Makefile.am (am__skiplex, am__skipyacc): New.
13428 * Makefile.in: Regenerate.
13429
c462b41b
RW
134302009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13431
14ec8efd
RW
13432 * Makefile.am (AM_CPPFLAGS): Renamed from ...
13433 (INCLUDES): ... this.
13434 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
13435 (AM_CPPFLAGS): Renamed from ...
13436 (INCLUDE): ... this.
13437 * Makefile.in, testsuite/Makefile.in: Regenerate.
13438
81ecdfbb
RW
13439 * Makefile.in: Regenerate.
13440 * aclocal.m4: Likewise.
13441 * config.in: Likewise.
13442 * configure: Likewise.
13443 * testsuite/Makefile.in: Likewise.
13444
c462b41b
RW
13445 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13446 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13447 * Makefile.in: Regenerate.
13448 * testsuite/Makefile.in: Regenerate.
13449
2da73f13
CC
134502009-08-19 Cary Coutant <ccoutant@google.com>
13451
13452 * resolve.cc (Symbol_table::resolve): Don't complain about defined
13453 symbols in shared libraries overridden by hidden or internal symbols
13454 in the main program.
13455
2db70501
CD
134562009-08-19 Chris Demetriou <cgd@google.com>
13457
13458 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
13459 checking source file names in error messages.
13460
f733487b
DK
134612009-08-18 Doug Kwan <dougkwan@google.com>
13462
13463 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
13464 an elcpp::Ehdr as parameter. Adjust call to set_target.
13465 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
13466 an elfcpp::Ehdr as parameter.
13467 * object.cc (Object::set_target): Remove the version that looks up
13468 a target and sets it.
13469 (Sized_relobj::setup): Take a Target object instead of
13470 an elfcpp::Ehdr as parameter. Adjust call to set_target.
13471 (make_elf_sized_object): Find target and ask target to
13472 make an ELF object.
13473 * object.h: (Object::set_target): Remove the version that looks up
13474 a target and sets it.
13475 (Sized_relobj::setup): Take a Target object instead of
13476 an elfcpp:Ehdr as parameter.
13477 * target.cc: Include dynobj.h.
13478 (Target::do_make_elf_object_implementation): New.
2e702c99 13479 (Target::do_make_elf_object): New.
f733487b
DK
13480 * target.h (Target::make_elf_object): New template declaration.
13481 (Target::do_make_elf_object): New method declarations.
13482 (Target::do_make_elf_object_implementation): New template declaration.
13483
cc70f101
ILT
134842009-08-14 Ian Lance Taylor <iant@google.com>
13485
13486 * gold.h (FUNCTION_NAME): Define.
13487 (gold_unreachable): Use FUNCTION_NAME.
13488
ef5e0cb1
ST
134892009-08-12 Sriraman Tallam <tmsriram@google.com>
13490
13491 * icf.cc (Icf::find_identical_sections): Issue a warning when a
13492 symbol in the --keep-unique list is not found.
13493
48c187ce
ST
134942009-08-12 Sriraman Tallam <tmsriram@google.com>
13495
13496 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
13497 been maked as --keep-unique.
13498 (Icf::unfold_section): New function.
13499 * icf.h (Icf::unfold_section): New function.
13500 * options.h (General_options::keep_unique): New option.
13501 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
13502 * testsuite/Makefile.in: Regenerate.
13503 * testsuite/icf_keep_unique_test.sh: New file.
13504 * testsuite/icf_keep_unique_test.cc: New file.
13505
645afe0c
CC
135062009-08-12 Cary Coutant <ccoutant@google.com>
13507
13508 PR 10471
13509 * resolve.cc (Symbol_table::resolve): Check for references from
13510 dynamic objects to hidden and internal symbols.
13511 * testsuite/Makefile.am (hidden_test.sh): New test.
13512 * testsuite/Makefile.in: Regenerate.
13513 * testsuite/hidden_test.sh: New script.
13514 * testsuite/hidden_test_1.c: New test source.
13515 * testsuite/hidden_test_main.c: New test source.
13516
11af873f
DK
135172009-08-11 Doug Kwan <dougkwan@google.com>
13518
13519 * arm.cc: Update comments.
13520 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
13521 segment to locate the .ARM.exidx section if present.
13522
b9f7d72d
DK
135232009-08-09 Doug Kwan <dougkwan@google.com>
13524
13525 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
13526 patch.
13527
ddd3c53c
ST
135282009-08-07 Sriraman Tallam <tmsriram@google.com>
13529 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
13530 compiler warnings.
13531
27721062
ST
135322009-08-06 Sriraman Tallam <tmsriram@google.com>
13533
13534 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
13535 valid tls_segment only for non-debug-section relocations.
13536 * testsuite/Makefile.am: Add gc_tls_test.
13537 * testsuite/Makefile.in: Regenerate.
13538 * testsuite/gc_tls_test.cc: New file.
13539 * testsuite/gc_tls_test.sh: New file.
13540
ef15dade 135412009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 13542
ef15dade
ST
13543 * icf.cc: New file.
13544 * icf.h: New file.
13545 * Makefile.am (CCFILES): Add icf.cc.
13546 (HFILES): Add icf.h
13547 * Makefile.in: Regenerate.
13548 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
13549 * gc.h (gc_process_relocs): Populate lists used by icf to contain
13550 section, symbol and addend information for the relocs.
13551 * gold.cc (queue_middle_tasks): Call identical code folding.
13552 * gold.h: Add defines for multimap.
13553 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
13554 to the call of finalize_local_symbols.
13555 * main.cc (main): Create object of class Icf.
13556 * object.cc (Sized_relobj::do_layout): Allow this function to be
13557 called twice during icf.
13558 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
13559 to sections marked as identical by icf.
13560 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
13561 when available.
13562 (Sized_relobj::do_section_entsize): New function.
13563 * object.h (Object::section_entsize): New function.
13564 (Object::do_section_entsize): New pure virtual function.
13565 (Relobj::finalize_local_symbols): Add new parameter.
13566 (Relobj::do_section_entsize): New function.
13567 * options.h (General_options::icf): New option.
13568 (General_options::icf_iterations): New option.
13569 (General_options::print_icf_sections): New option.
13570 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
13571 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
13572 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
13573 icf.
13574 * symtab.cc (Symbol_table::is_section_folded): New function.
13575 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
13576 to sections marked as identical by icf.
13577 * symtab.h (Symbol_table::set_icf): New function.
13578 (Symbol_table::icf): New function.
13579 (Symbol_table::is_section_folded): New function.
13580 (Symbol_table::icf_): New data member.
13581 * target-reloc.h (relocate_section): Ignore sections folded by icf.
13582 * testsuite/Makefile.am: Add commands to build icf_test.
13583 * testsuite/Makefile.in: Regenerate.
13584 * testsuite/icf_test.sh: New file.
13585 * testsuite/icf_test.cc: New file.
13586
c3b65ac4
CD
135872009-07-24 Chris Demetriou <cgd@google.com>
13588
13589 * layout.cc (is_compressible_debug_section): Fix incorrect
13590 comment about compressed section names.
13591
1caf2c51
ILT
135922009-07-20 Ian Lance Taylor <ian@airs.com>
13593
13594 PR 10419
13595 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
13596
1ef4d87f
ILT
135972009-07-16 Ian Lance Taylor <iant@google.com>
13598
13599 PR 10400
13600 * layout.h: #include <map>.
13601 (class Kept_section): Change from struct to class. Add accessors
13602 and setters. Add section size to Comdat_group mapping. Change
13603 Comdat_group to std::map. Add is_comdat_ field. Add
13604 linkonce_size field in union.
13605 (class Layout): Update declaration of find_or_add_kept_section.
13606 Don't declare find_kept_object.
13607 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
13608 parameter. Add object, shndx, is_comdat, and is_group_name
13609 parameters. Change all callers. Adjust for new Kept_section.
13610 (Layout::find_kept_object): Remove.
13611 * object.cc (Sized_relobj::include_section_group): Update use of
13612 Kept_section. Rename secnum to shndx. Only record
13613 Kept_comdat_section if sections are the same size.
13614 (Sized_relobj::include_linkonce_section): Update use of
13615 Kept_section. Only record Kept_comdat_section if sections are the
13616 same size. Set size of linkonce section.
13617 (Sized_relobj::map_to_kept_section): Update call to
13618 get_kept_comdat_section.
13619 * object.h (class Sized_relobj): Rename fields in
13620 Kept_comdat_section to drop trailing underscores; change object
13621 field to Relobj*. Change Kept_comdat_section_table to store
13622 struct rather than pointer.
13623 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
13624 Add kept_object and kept_shndx parameters. Change all callers.
13625 (Sized_relobj::get_kept_comdat_section): Change return type to
13626 bool. Add kept_object and kept_shndx parameters. Change all
13627 callers.
13628 * plugin.cc (Pluginobj::include_comdat_group): Update call to
13629 Layout::find_or_add_kept_section.
13630
37c3b7b0
ILT
136312009-07-09 Ian Lance Taylor <iant@google.com>
13632
13633 * merge.cc (Object_merge_map::initialize_input_to_output_map):
13634 Reserve space in the hash table.
13635
98fa85cb
ILT
136362009-07-06 Mikolaj Zalewski <mikolajz@google.com>
13637
13638 * fileread.cc (File_read::get_mtime): New method.
13639 * fileread.h (Timespec): New structure.
13640 (File_read::get_mtime): New method.
13641 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
13642 Renamed from timestamp_nsec.
13643 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
13644 Elf_Xword.
e1df38aa 13645 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 13646 timestamp_nsec.
e1df38aa 13647 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
13648 (Incremental_inputs::report_obejct): Save mtime; style fix.
13649 (Incremental_inputs::report_script): Save mtime; style fix.
13650 (Incremental_inputs::finalize_inputs): Style fix.
13651 (Incremental_inputs::finalize): Style fix.
13652 (Incremental_inputs::create_input_section_data): Store inputs
13653 mtime.
13654 * incremental.h (Incremental_inputs::report_script): Add mtime
13655 argument.
13656 (Incremental_inputs::Input_info::Input_info): Intialize only one
13657 union member.
13658 (Incremental_inputs::Input_info::archive): Move to nameless
13659 union.
13660 (Incremental_inputs::Input_info::obejct): Move to nameless union.
13661 (Incremental_inputs::Input_info::script): Move to nameless union.
13662 (Incremental_inputs::mtime): New field.
13663 * script.cc (read_input_script): Pass file mtime to
13664 Incremental_input.
13665 * script.h (Script_info::inputs): Style fix.
13666
c9d70757
ILT
136672009-07-01 Ian Lance Taylor <ian@airs.com>
13668
13669 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
13670 instead of 32.
13671
9c547ec3
ILT
136722009-06-24 Ian Lance Taylor <iant@google.com>
13673
13674 PR 10156
13675 * layout.cc (Layout::choose_output_section): If we find an
13676 existing section, update the flags.
13677 (Layout::create_notes): New function, broken out of
13678 Layout::finalize.
13679 (Layout::finalize): Don't create note sections.
13680 (Layout::create_note): Don't crash if linker script discards
13681 section.
13682 (Layout::create_gold_note): Likewise.
13683 (Layout::create_build_id): Likewise. Don't set
13684 after_input_sections on the section.
13685 (Layout::create_executable_stack_info): Remove target parameter.
13686 Change caller.
13687 * layout.h (class Layout): Declare create_notes. Update
13688 declaration of create_executable_stack_info.
13689 * gold.cc (queue_middle_tasks): Call create_notes.
13690 * output.cc (Output_section::update_flags_for_input_section): Move
13691 here from output.h. If SHF_ALLOC flag is newly set, mark address
13692 invalid.
13693 * output.h (Output_data::mark_address_invalid): New function.
13694 (class Output_section): Only declare, not define,
13695 update_flags_for_input_section. Remove set_flags.
13696
55458500
ILT
136972009-06-24 Ian Lance Taylor <iant@google.com>
13698
13699 * script-sections.cc (Output_section_definition::
13700 set_section_addresses): Rename shadowing local load_address to
13701 laddr.
13702
1307d6cd
ILT
137032009-06-24 Ian Lance Taylor <iant@google.com>
13704
13705 PR 10244
13706 * reloc.cc (relocate_sections): Skip empty relocation sections.
13707
ec3f783e
ILT
137082009-06-23 Ian Lance Taylor <iant@google.com>
13709
13710 PR 10156
13711 * layout.cc (Layout::create_note): Use choose_output_section
13712 rather than make_output_section.
13713
459c9f1c
ILT
137142009-06-23 Ian Lance Taylor <iant@google.com>
13715
13716 PR 10237
13717 * options.cc (General_options::parse_V): Set printed_version_.
13718 (General_options::General_options): Initialize printed_version_.
13719 * options.h (class General_options): Add printed_version_ field.
13720 * gold.cc (queue_initial_tasks): If there are no input files,
13721 don't give a fatal error if we printed the version information.
13722 (queue_middle_tasks): If using -r with a shared object, give a
13723 fatal error rather than an ordinary error.
13724
1518dc8f
ILT
137252009-06-23 Ian Lance Taylor <iant@google.com>
13726
13727 PR 10219
13728 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
13729 (Layout::make_output_section): Set have_stabstr_section_ if we see
13730 a .stab*str section.
13731 (Layout::finalize): Call link_stabs_sections.
13732 (Layout::link_stabs_sections): New file.
13733 * layout.h (class Layout): Add have_stabstr_section_ field.
13734 Declare link_stabs_sections.
13735
3d857b98
DK
137362009-06-23 Doug Kwan <dougkwan@google.com>
13737
13738 * Makefile.am (libgold_a_LIBADD): New.
13739 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 13740 * Makefile.in: Regenerate.
3d857b98
DK
13741 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
13742 * configure: Regenerate.
13743 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
13744 * fileread.cc: Include sys/state.h
13745 * gold.h: Declare memmem and strndup if found missing.
13746 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
13747
0639a6f6
ILT
137482009-06-23 Ian Lance Taylor <iant@google.com>
13749
13750 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
13751 * configure: Rebuild.
13752
8d63875c
ILT
137532009-06-23 Ian Lance Taylor <iant@google.com>
13754
13755 PR 10147
13756 * object.cc (Object::section_contents): Don't try to get a view if
13757 the section has length zero.
13758 (Object::handle_gnu_warning_section): If the section is empty, use
13759 the name of the section as the warning.
13760
f7c8a183
ILT
137612009-06-23 Ian Lance Taylor <iant@google.com>
13762
13763 PR 10133
13764 * stringpool.h (class Stringpool_template): Add optimize_ field.
13765 (Stringpool_template::set_optimize): New function.
13766 * stringpool.cc (Stringpool_template::Stringpool_template):
13767 Initialize optimize_ field.
13768 (Stringpool_template::set_string_offsets): Test local optimize
13769 fild rather than parameter.
13770 * layout.cc (Layout::Layout): Call set_optimize on the section
13771 name stringpool.
13772
e6a307ba
ILT
137732009-06-22 Ian Lance Taylor <iant@google.com>
13774
13775 PR 10030
13776 * yyscript.y: Parse TARGET.
13777 * script.cc (script_set_target): New function.
13778 * script-c.h (script_set_target): Declare.
13779 * options.cc (General_options::string_to_object_format): Rename
13780 from string_to_object_format in anonymous namespace. Change
13781 callers.
13782 * options.h (class General_options): Declare
13783 string_to_object_format.
13784
3ee173de
ILT
137852009-06-22 Ian Lance Taylor <iant@google.com>
13786
13787 * script-sections.cc (Script_sections::create_segments): Don't put
13788 program headers in a PT_LOAD segment if -n or -N.
13789
137902009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
13791
13792 PR 10141
13793 * options.h (class General_options): Add -z lazy and -z now. Sort
13794 -z options into alphabetical order.
13795 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
13796
cd6739a1 137972009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
13798
13799 * layout.cc (Layout::make_output_section): Call
13800 Target::new_output_section.
13801 (Layout::attach_allocated_section_to_segment): Put large section
13802 sections in a separate load segment with the large segment flag
13803 set.
13804 (Layout::segment_precedes): Sort large data segments after other
13805 load segments.
13806 (align_file_offset): New static function.
13807 (Layout::set_segment_offsets): Use align_file_offset.
13808 * output.h (class Output_section): Add is_small_section_ and
13809 is_large_section_ fields.
13810 (Output_section::is_small_section): New function.
13811 (Output_section::set_is_small_section): New function.
13812 (Output_section::is_large_section): New function.
13813 (Output_section::set_is_large_section): New function.
13814 (Output_section::is_large_data_section): New function.
13815 (class Output_segment): Add is_large_data_segment_ field.
13816 (Output_segment::is_large_data_segment): New function.
13817 (Output_segment::set_is_large_data_segment): New function.
13818 * output.cc (Output_section::Output_section): Initialize new
13819 fields.
13820 (Output_segment::Output_segment): Likewise.
13821 (Output_segment::add_output_section): Add assertion that large
13822 data sections always go in large data segments. Force small data
13823 sections to the end of the list of data sections. Force small BSS
13824 sections to the start of the list of BSS sections. For large BSS
13825 sections to the end of the list of BSS sections.
13826 * symtab.h (class Symbol): Declare is_common_shndx.
13827 (Symbol::is_defined): Check Symbol::is_common_shndx.
13828 (Symbol::is_common): Likewise.
13829 (class Symbol_table): Define enum Commons_section_type. Update
13830 declarations. Add small_commons_ and large_commons_ fields.
13831 * symtab.cc (Symbol::is_common_shndx): New function.
13832 (Symbol_table::Symbol_table): Initialize new fields.
13833 (Symbol_table::add_from_object): Put small and large common
13834 symbols in the right list.
13835 (Symbol_table::sized_finalized_symbol): Check
13836 Symbol::is_common_shndx.
13837 (Symbol_table::sized_write_globals): Likewise.
13838 * common.cc (Symbol_table::do_allocate_commons): Allocate new
13839 common symbol lists. Don't call do_allocate_commons_list if the
13840 list is empty.
13841 (Symbol_table::do_allocate_commons_list): Remove is_tls
13842 parameter. Add comons_section_type parameter. Change all
13843 callers. Handle small and large common symbols.
13844 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
13845 Symbol::is_common_shndx.
13846 * resolve.cc (symbol_to_bits): Likewise.
13847 * target.h (Target::small_common_shndx): New function.
13848 (Target::small_common_section_flags): New function.
13849 (Target::large_common_shndx): New function.
13850 (Target::large_common_section_flags): New function.
13851 (Target::new_output_section): New function.
13852 (Target::Target_info): Add small_common_shndx, large_common_shndx,
13853 small_common_section_flags, and large_common_section_flags
13854 fields.
13855 (Target::do_new_output_section): New virtual function.
13856 * arm.cc (Target_arm::arm_info): Initialize new fields.
13857 * i386.cc (Target_i386::i386_info): Likewise.
13858 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
13859 Likewise.
13860 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
13861 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13862 (Target_x86_64::do_new_output_section): New function.
13863 * configure.ac: Define conditional MCMODEL_MEDIUM.
13864 * testsuite/Makefile.am (check_PROGRAMS): Add large.
13865 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
13866 (large_LDFLAGS): Define.
13867 * testsuite/large.c: New file.
13868 * testsuite/testfile.cc (Target_test::test_target_info):
13869 Initialize new fields.
13870 * configure, testsuite/Makefile.in: Rebuild.
13871
bb04269c
DK
138722009-06-05 Doug Kwan <dougkwan@google.com>
13873
13874 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 13875 * Makefile.in: Regenerate.
bb04269c
DK
13876 * i386.cc (class Target_i386): Define new virtual method to
13877 override do_is_local_label_name in parent.
13878 * object.cc (Sized_relobj::do_count_local_symbols): Discard
13879 local symbols if --discard-locals or -X is given.
13880 * options.h (class General_options): Declare new options
13881 '--discard-locals' and '-X' for discarding locals.
13882 * target.h (class Target): Define new methods is_local_label_name.
13883 Declare new virtual method do_is_local_label_name.
13884 * target.cc: New file.
13885 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
13886 (check_SCRIPTS): Add discard_locals_test.sh.
13887 (check_DATA): Add discard_local_tests.syms.
13888 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
13889 (discard_local_tests.syms, discard_locals_test.o): New make rules.
13890 * testsuite/Makefile.in: Regenerate.
13891 * testsuite/discard_locals_test.c: New file.
13892 * testsuite/discard_locals_test.sh: Same.
13893
805bb01c
DK
138942009-06-05 Doug Kwan <dougkwan@google.com>
13895
13896 * object.cc (Sized_relobj::Sized_relobj): Initialize
13897 discarded_eh_frame_shndx_ to -1U.
13898 (Sized_relobj::do_layout): Record index of a discard .eh_frame
13899 section.
13900 (Sized_relobj::do_count_local_symbols): Skip local symbols in
13901 a discarded .eh_frame section.
13902 (Sized_relobj::do_finalize_local_symbols): Ditto.
13903 * object.h (class Sized_relobj): Declare new member
13904 discarded_eh_frame_shndx_.
13905 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
13906 (local_labels_test.o, local_labels_test): New rules.
13907 * testsuite/Makefile.in: Regenerate.
13908
1dcd334d
DK
139092009-06-04 Doug Kwan <dougkwan@google.com>
13910
13911 * layout.cc (Layout::section_name_mapping): Add mapping for
13912 special ARM sections.
13913
96d49306
DK
139142009-06-03 Doug Kwan <dougkwan@google.com>
13915
13916 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
13917 (utils::has_overflow): Same.
13918
dff16297
ILT
139192009-06-03 Ian Lance Taylor <iant@google.com>
13920
13921 * layout.cc (Layout::section_name_mapping): New array, replacing
13922 Layout::linkonce_mapping.
13923 (Layout::section_name_mapping_count): New variable, replacing
13924 Layout::linkonce_mapping_count.
13925 (Layout::linkonce_output_name): Remove.
13926 (Layout::output_section_name): Rewrite.
13927 * layout.h (class Layout): Rename Linkonce_mapping to
13928 Section_name_mapping, linkonce_mapping to section_name_mapping,
13929 linkonce_mapping_count to section_name_mapping_count. Don't
13930 declare linkonce_output_name.
13931
c121c671
DK
139322009-06-03 Doug Kwan <dougkwan@google.com>
13933
13934 * gold/arm.cc (namespace utils): New.
13935 (Target_arm::reloc_is_non_pic): Define new method.
13936 (class Arm_relocate_functions): New.
13937 (Target_arm::Relocate::relocate): Handle relocation types used by
13938 Android.
13939
07800fab
ILT
139402009-06-03 Ian Lance Taylor <iant@google.com>
13941
13942 * arm.cc (Target_arm::scan::global): Use || instead of |.
13943
c121c671
DK
139442009-06-02 Doug Kwan <dougkwan@google.com>
13945
13946 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
13947 issued_non_pic_error_.
13948 (class Target_arm::Scan): Declare new method check_non_pic.
13949 Define new method symbol_needs_plt_entry.
13950 Declare new data member issued_non_pic_error_.
13951 (class Target_arm::Relocate): Declare new method
13952 should_apply_static_reloc.
13953 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
13954 (Target_arm::Scan::check_non_pic): Define new method.
13955 (Target_arm::Scan::local): Handle a small subset of reloc types used
13956 by Android.
13957 (Target_arm::Scan::local): Same.
13958 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
13959
b19b0c6d
ILT
139602009-05-31 Mikolaj Zalewski <mikolajz@google.com>
13961
13962 * incremental.cc (Incremental_inputs::report_command_line): Filter
13963 out --incremental-* options.
13964
94cdfcff
DK
139652009-05-29 Doug Kwan <dougkwan@google.com>
13966
13967 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
13968 template class.
13969 (class Target_arm): Update comment.
13970 (Target_arm::Target_arm): Initialize new data members GOT_,
13971 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
13972 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
13973 and Target_arm::rel_dyn_section.
13974 Declare new_enum Target_arm::Got_type.
13975 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
13976 and DYNBSS_.
13977 Update commments for member do_dynsym_value.
13978 (Target_arm::got_size, Target_arm::plt_section,
13979 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
13980 new methods inside class defintion.
13981 (Target_arm::got_section): Define new method.
13982 (Target_arm::rel_dyn_section): Same.
13983 (Output_data_plt_arm): New template class.
13984 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
13985 (Output_data_plt_arm:do_adjust_output_section): Define new method.
13986 (Output_data_plt_arm::add_entry): Same.
13987 (Output_data_plt_arm::first_plt_entry): Define new
13988 static data member for PLT instruction template.
13989 (Output_data_plt_arm::plt_entry): Same.
13990 (Output_data_plt_arm::do_write): Define new method.
13991 (Target_arm::make_plt_entry): Same.
13992 (Target_arm::do_finalize_sections): Same.
13993 (Target_arm::do_dynsym_value): Same.
13994
4a657b0d
DK
139952009-05-28 Doug Kwan <dougkwan@google.com>
13996
13997 * Makefile.am (TARGETSOURCES): Add arm.cc.
13998 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
13999 * Makefile.in: Regenerate.
14000 * arm.cc: New file.
14001 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
14002
e7ae8c36
DK
140032009-05-26 Doug Kwan <dougkwan@google.com>
14004
14005 * options.cc (General_options::parse_exclude_libs). Fix a comment.
14006 (General_options::check_excluded_libs): Strip off directories in
14007 archive name before matching like GNU ld does.
14008 * testsuite/Makefile.am (MOSTLYCLEANFILES,
14009 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
14010 (exclude_libs_test_LDFLAGS): Add linker option
14011 -Wl,--exclude-libs,libexclude_libs_test_3
14012 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
14013 an explicit archive without using -l.
14014 (alt/libexclude_libs_test_3.a): New make rule.
14015 * testsuite/Makefile.in: Regenerate.
14016 * testsuite/exclude_libs_test.c : Declare lib3_default().
14017 (main): Call it.
14018 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
14019 * exclude_libs_test_3.c: New file.
14020
f12e7348
NC
140212009-05-26 Nick Clifton <nickc@redhat.com>
14022
14023 * po/id.po: New Indonesian translation.
14024 * po/gold.pot: Updated template file.
14025
4daadc0d
ST
140262009-05-22 Sriraman Tallam <tmsriram@google.com>
14027
e1df38aa 14028 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
14029 gc_comdat_test files. Add -Wl,--gc-sections to build
14030 gc_comdat_test.
14031 * testsuite/Makefile.in: Regenerate.
14032 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
14033
531813ad
ST
140342009-05-21 Sriraman Tallam <tmsriram@google.com>
14035
14036 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
14037 kept comdat section was garbage collected.
14038 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
14039 * testsuite/Makefile.in: Regenerate.
14040 * testsuite/gc_comdat_test.sh: New file.
14041 * testsuite/gc_comdat_test_1.cc: New file.
14042 * testsuite/gc_comdat_test_2.cc: New file.
14043
65514900
CC
140442009-05-19 Doug Kwan <dougkwan@google.com>
14045
14046 * archive.cc (Archive::Archive): Move constructor from archive.h
14047 to here. Initialize no_export_.
14048 (Archive::get_elf_object_for_member): Set no_export flag of object.
14049 * archive.h (Archive::Archive): Move constructor body to
14050 archive.cc.
14051 (Archive::no_export): New method.
14052 (Archive::no_export_): New field.
14053 * object.h (Object::Object): Initialize no_export_ to false.
14054 (Object::no_export, Object::set_no_export): New methods.
14055 (Object::no_export_): New field.
14056 * options.cc (General_options::parse_exclude_libs): New method.
14057 (General_options::check_excluded_libs) Same.
14058 * options.h (exclude_libs): New option.
14059 (General_options::check_excluded_libs): New method declaration.
14060 (General_options::excluded_libs_): New field.
14061 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
14062 default or protected visibility if an object has no-export flag set.
14063 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
14064 (check_SCRIPTS): Add exclude_libs_test.sh.
14065 (check_DATA): Add exclude_libs_test.syms.
14066 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
14067 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
14068 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
14069 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
14070 (exclude_libs_test.syms, libexclude_libs_test_1.a,
14071 libexclude_libs_test_2.a): New rules.
14072 * testsuite/Makefile.in: Regenerate.
14073 * testsuite/exclude_libs_test.c: New file.
14074 * testsuite/exclude_libs_test.sh: Ditto.
14075 * testsuite/exclude_libs_test_1.c: Ditto.
14076 * testsuite/exclude_libs_test_2.c: Ditto.
14077
1b77ea50
ILT
140782009-05-15 Ian Lance Taylor <iant@google.com>
14079
14080 * configure.ac: Check for declarations for cases where libiberty.h
14081 checks HAVE_DECL_xxx.
14082 * configure, config.in: Rebuild.
14083
072fe7ce
ILT
140842009-05-15 Mikolaj Zalewski <mikolajz@google.com>
14085
14086 * gold.h (Incremental_argument_list): Remove (invalid) forward
14087 declaration.
14088 * incremental.cc (Incremental_inputs::report_achive): New method.
14089 (Incremental_inputs::report_object): New method.
14090 (Incremental_inputs::report_script): New method.
14091 (Incremental_inputs::finalize_inputs): New method.
14092 (Incremental_inputs::finalize): Call finalize_inputs().
14093 (Incremental_inputs::sized_create_incremental_inputs_section_data):
14094 Create inputs entries.
14095 * incremental.h (Incremental_input_type): New enum.
14096 (Incremental_inputs::Incremental_input): Initialize new fields.
14097 (Incremental_inputs::report_inputs): New method.
14098 (Incremental_inputs::report_achive): New method.
14099 (Incremental_inputs::report_object): New method.
14100 (Incremental_inputs::report_script): New method.
14101 (Incremental_inputs::finalize_inputs): New method.
14102 (Incremental_inputs::Input_info): New struct.
14103 (Incremental_inputs::Input_info_map): New typedef.
14104 (Incremental_inputs::lock_): New field.
14105 (Incremental_inputs::Inputs_): New field.
14106 (Incremental_inputs::Inputs_map): New field.
14107 * main.cc (main): Call Incremental_input::report_inputs.
14108 * options.h (Input_argument_list): Typedef moved from
14109 Input_arguments.
14110 (Input_file_group::Files): Remove, use ::Input_argument_list.
14111 (Input_file_group::Input_argument_list): Remove, use
14112 ::Input_argument_list.
14113 * plugin.cc (Plugin_manager::add_input_file): Add error in
14114 incremental build.
14115 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
14116 functions.
14117 * script.cc (read_input_script): Call
14118 Incremental_input::report_script.
14119 * script.h (Script_info): New class.
14120
b0481b0b
ILT
141212009-04-27 Ian Lance Taylor <iant@google.com>
14122
14123 * x86_64.cc (do_adjust_output_section): Set entsize to
14124 plt_entry_size.
14125
b22a5a41 141262009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
14127
14128 * output.cc (Output_file::close): After short writes, continue
14129 writing from the correct offset in the buffer being written.
14130
40fde488
CD
141312009-04-23 Chris Demetriou <cgd@google.com>
14132
14133 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
14134 * configure: Regenerate.
14135 * config.in: Regenerate.
14136 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
14137 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
14138
3ce2c28e
ILT
141392009-04-21 Mikolaj Zalewski <mikolajz@google.com>
14140
14141 * incremental.cc (Incremental_inputs_header_data): Renamed from
14142 Incremental_input_header_data.
14143 (Incremental_inputs_header_data::data_size): New field.
14144 (Incremental_inputs_header_data::put_input_file_count): Renamed
14145 from input_file_count.
14146 (Incremental_inputs_header_data::put_command_line_offset): Renamed
14147 from command_line_offset.
14148 (Incremental_inputs_header_data::put_reserved): Renamed from
14149 put_reserved.
14150 (Incremental_inputs_entry_data): Renamed from
14151 Incremental_input_entry_data.
14152 (Incremental_inputs_entry_data::data_size): New field.
14153 (Incremental_inputs::report_command_line): New method.
14154 (Incremental_inputs::finalize): New method.
14155 (Incremental_inputs::create_incremental_inputs_data): New method.
14156 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
14157 * incremental.h: New file.
14158 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 14159 (Layout::finalize): Create incremental inputs section in
3ce2c28e 14160 incremental builds.
703d02da 14161 (Layout::create_incremental_info_sections): New method.
3ce2c28e 14162 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
14163 (Layout::create_incremental_info_sections): New method.
14164 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
14165 * main.cc (main): Notify Incremental_input of the command line.
14166
e55bde5e
ILT
141672009-04-01 Ian Lance Taylor <iant@google.com>
14168 Mikolaj Zalewski <mikolajz@google.com>
14169
14170 * gold.h (reserve_unordered_map): Define, three versions, one for
14171 each version of Unordered_map.
14172 * layout.cc (Layout::Layout): Remove options parameter. Add
14173 number_of_input_files parameter. Don't initialize options_.
14174 Initialize number_of_input_files_ and resized_signatures_. Move
14175 sections_are_attached_.
14176 (Layout::layout_group): Reserve space for group_signatures_.
14177 (Layout::find_or_add_kept_section): Change name parameter to be a
14178 reference. Resize signatures_ map when it gets large enough.
14179 (Layout::layout_eh_frame): Use parameters->options() instead of
14180 this->options_.
14181 (Layout::make_output_section): Likewise.
14182 (Layout::attach_allocated_section_to_segment): Likewise.
14183 (Layout::finalize, Layout::create_executable_stack): Likewise.
14184 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
14185 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
14186 * layout.h (class Layout): Update declarations. Remove options_
14187 field. Add number_of_input_files_ and resized_signatures_
14188 fields. Move sections_are_attached_ field.
14189 * main.cc (main): Pass number of input files to Layout
14190 constructor. Don't pass options.
14191
154b857c
ILT
141922009-03-30 Ian Lance Taylor <iant@google.com>
14193
14194 * ffsll.c (ffsll): Correct implementation.
14195
2f35ab9b
ILT
141962009-03-27 Ian Lance Taylor <iant@google.com>
14197
fd03461a
ILT
14198 * ffsll.c: New file.
14199 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
14200 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
14201 * ftruncate.c (ftruncate): Declare before definition.
14202 * mremap.c (mremap): Likewise.
14203 * pread.c (pread): Likewise.
14204 * configure, Makefile.in, config.in: Rebuild.
14205
2f35ab9b
ILT
14206 * mremap.c: New file.
14207 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
14208 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
14209 (mremap): Declare if HAVE_MREMAP is not defined.
14210 * configure, Makefile.in, config.in: Rebuild.
14211
33aea2fd
CC
142122009-03-27 Cary Coutant <ccoutant@google.com>
14213
14214 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
14215 position independent.
14216 * sparc.cc (Target_sparc::check_non_pic): Likewise.
14217 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
14218
6d479619
CC
142192009-03-24 Cary Coutant <ccoutant@google.com>
14220
14221 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
14222 an executable.
14223 (needs_dynamic_reloc): Likewise.
14224
afc06bb8
ILT
142252009-03-24 Ian Lance Taylor <iant@google.com>
14226
14227 * yyscript.y (file_cmd): Recognize EXTERN.
14228 (extern_name_list, extern_name_list_body): New nonterminals.
14229 * script.cc (script_add_extern): Define.
14230 * script-c.h (script_add_extern): Declare.
14231
f6060a4d
ILT
142322009-03-24 Rafael Avila de Espindola <espindola@google.com>
14233
14234 * object.cc (is_elf_object): Define.
14235 * object.h (is_elf_object): Declare.
14236 * archive.cc (Archive::get_elf_object_for_member): Call
14237 is_elf_object.
33aea2fd 14238 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 14239
26736d8e
ILT
142402009-03-24 Elliott Hughes <enh@google.com>
14241
14242 * output.cc (Output_file::map_anonymous): Define.
14243 (Output_file::map): Use map_anonymous. If the regular mmap fails,
14244 try an anonymous one. Report the size if the mmap fails.
14245 * output.h (class Output_file): Declare map_anonymous.
14246
22fd9730
ILT
142472009-03-24 Ian Lance Taylor <iant@google.com>
14248
14249 * target-select.cc (instantiate_target): Don't acquire the lock if
14250 the instantiated_target_ field has already been set.
14251
cb010894
ILT
142522009-03-23 Ian Lance Taylor <iant@google.com>
14253
7f055c20
ILT
14254 * gold-threads.h (class Initialize_lock): Define.
14255 * gold-threads.cc (class Initialize_lock_once): Define.
14256 (initialize_lock_control): New static variable.
14257 (initialize_lock_pointer): New static variable.
14258 (initialize_lock_once): New static function.
14259 (Initialize_lock::Initialize_lock): Define.
14260 (Initialize_lock::initialize): Define.
14261 * target-select.h: Include "gold-threads.h".
14262 (class Target_selector): Add lock_ and initialize_lock_ fields.
14263 Don't define instantiate_target, just declare it.
14264 * target-select.cc (Target_selector::Target_selector): Initialize
14265 new fields.
14266 (Target_selector::instantiate_target): Define.
14267 * descriptors.h: Include "gold-threads.h".
14268 (class Descriptors): Add initialize_lock_ field.
14269 * descriptors.cc (Descriptors::Descriptors): Initialize new
14270 field.
14271 (Descriptors::open): Use initialize_lock_ field
14272 * errors.h (class Errors): Add initialize_lock_ field.
14273 * errors.cc (Errors::Errors): Initialize new field.
14274 (Errors::initialize_lock): Use initialize_lock_ field.
14275 * powerpc.cc (class Target_selector_powerpc): Remove
14276 instantiated_target_ field. In do_recognize call
14277 instantiate_target rather than do_instantiate_target. In
14278 do_instantiate_target just allocate a new target.
14279 * sparc.cc (class Target_selector_sparc): Likewise.
14280
36959681
ILT
14281 * freebsd.h: New file.
14282 * i386.cc: Include "freebsd.h".
14283 (Target_i386): Derive from Target_freebsd rather than
14284 Sized_target.
14285 (Target_selector_i386): Derive from Target_selector_freebsd rather
14286 than Target_selector.
14287 * x86_64.cc: Include "freebsd.h".
14288 (Target_x86_64): Derive from Target_freebsd rather than
14289 Sized_target.
14290 (Target_selector_x86_64): Derive from Target_selector_freebsd
14291 rather than Target_selector.
14292 * target.h (class Target): Add adjust_elf_header and
14293 do_adjust_elf_header.
14294 * output.cc (Output_file_header:: do_sized_write): Call target
14295 adjust_elf_header routine.
14296 * configure.tgt: Set targ_osabi.
14297 * configure.ac: Define GOLD_DEFAULT_OSABI.
14298 * parameters.cc (Parameters::default_target): Pass
14299 GOLD_DEFAULT_OSABI to select_target.
14300 * target-select.h (class Target_selector): Make instantiate_target
14301 protected rather than private.
14302 * Makefile.am (HFILES): Add freebsd.h.
14303 * configure, Makefile.in, config.in: Rebuild.
14304
cb010894
ILT
14305 * merge.cc (do_add_input_section): Correct pend value. Change
14306 message about last entry not being null terminated from error to
14307 warning.
14308
0e879927
ILT
143092009-03-20 Mikolaj Zalewski <mikolajz@google.com>
14310
14311 * incremental.cc: New file.
14312 * Makefile.am (CCFILES): Add incremental.cc.
14313 * Makefile.in: Rebuild.
14314
41105937
PP
143152009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
14316
14317 * layout.cc (Layout::output_section_name): Preserve names
14318 of '.note.' sections.
e1df38aa 14319
60439920
ILT
143202009-03-19 Ian Lance Taylor <iant@google.com>
14321
14322 * descriptors.cc (Descriptors::open): Check that the options are
14323 valid before using them.
14324
0d371ad3
ILT
143252009-03-18 Ian Lance Taylor <iant@google.com>
14326
14327 * script-sections.h: Include <list>.
14328 (class Script_sections): Change Sections_elements from std::vector
14329 to std::list. Typedef public Elements_iterator. Add
14330 orphan_section_placement_, data_segment_align_start_, and
14331 saw_data_segment_align_ fields. Remove data_segment_align_index_
14332 field.
14333 * script-sections.cc (class Orphan_section_placement): New class.
14334 (class Sections_element): Add virtual functions is_relro and
14335 orphan_section_init. Remove virtual function place_orphan_here.
14336 (class Output_section_definition): Add is_relro and
14337 orphan_section_init. Remove place_orphan_here.
14338 (class Orphan_output_section): Likewise.
14339 (Script_sections::Script_sections): Update for field changes.
14340 (Script_sections::data_segment_align): Set saw_data_segment_align_
14341 and data_segment_align_start_, not data_segment_align_index.
14342 (Script_sections::data_segment_relro_end): Check
14343 saw_data_segment_align_. Use data_segment_align_start_ rather
14344 than data_segment_align_index_.
14345 (Script_sections::place_orphan): Rewrite to use
14346 Orphan_section_placement.
14347
9201d894
ILT
143482009-03-17 Ian Lance Taylor <iant@google.com>
14349
9c5b8369
ILT
14350 * archive.cc (Archive::add_symbols): Check for a version attached
14351 to the symbol name in the archive map.
14352 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
14353 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
14354 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
14355 (ver_test_11.a): New target.
14356 * testsuite/Makefile.in: Rebuild.
14357
9201d894
ILT
14358 * configure.ac: Check for chsize and posix_fallocate. Replace
14359 ftruncate.
14360 * ftruncate.c: New file, from gnulib.
14361 * output.cc (posix_fallocate): Define dummy version if not
14362 HAVE_POSIX_FALLOCATE.
14363 (Output_file::map): Call posix_fallocate rather than lseek and
14364 write.
14365 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
14366 * configure, Makefile.in, config.in: Rebuild.
14367
ef4ab7a8 143682009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 14369
ef4ab7a8
PP
14370 * layout.h (Layout::create_note): Add section_name parameter.
14371 * layout.cc (Layout::create_note): Likewise.
14372 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 14373
8c500701
ILT
143742009-03-17 Ian Lance Taylor <iant@google.com>
14375
e85b18e1
ILT
14376 * descriptors.cc: Include "options.h".
14377 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
14378 (Descriptors::open): Always use O_CLOEXEC when opening a new
14379 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
14380 then set FD_CLOEXEC.
14381
9efe6174
ILT
14382 * sparc.cc (class Target_sparc): Add has_got_section.
14383 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
14384 make sure we have a GOT section.
14385
14386 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
14387 (Target_sparc::Scan::local): Likewise.
14388 (Target_sparc::Scan::global): Likewise.
14389 (Target_sparc::Relocate::relocate): Likewise.
14390 (Target_sparc::Relocate::relocate_tls): Likewise.
14391
8c500701
ILT
14392 * symtab.cc (Symbol_table::define_default_version): New function,
14393 broken out of add_from_object.
14394 (Symbol_table::add_from_object): Call define_default_version.
14395 (Symbol_table::define_special_symbol): Add resolve_oldsym
14396 parameter. Change all callers. If the version for a symbol comes
14397 from a version script, resolve it with the symbol with the same
14398 name with no version. Also add the symbol without a version if
14399 appropriate.
14400 (do_define_in_output_data): If resolving with oldsym, don't delete
14401 sym.
14402 (do_define_in_output_segment): Likewise.
14403 (do_define_as_constant): Likewise.
14404 * symtab.h (class Symbol_table): Update declarations.
14405
f1ed28fb
ILT
144062009-03-13 Ian Lance Taylor <iant@google.com>
14407
15f8229b
ILT
14408 * readsyms.cc (Read_symbols::incompatible_warning): New function.
14409 (Read_symbols::requeue): New function.
14410 (Read_symbols::do_read_symbols): If make_elf_object fails because
14411 the target type is not configured, and the file was searched for,
14412 issue a warning and retry with the next directory.
14413 (Add_symbols::run): If the file has an incompatible format, and
14414 it was searched for, requeue the Read_symbols task. On error,
14415 release the object.
14416 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
14417 dirindex parameter to constructor. Change all callers. Declare
14418 incompatible_warning and requeue.
14419 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
14420 input_argument_ and input_group_ fields. Add them to
14421 constructor. Change all callers.
14422 (class Read_script): Add dirindex_ field. Add it to constructor.
14423 Change all callers.
14424 * archive.cc (Archive::setup): Remove input_objects parameter.
14425 Change all callers.
14426 (Archive::get_file_and_offset): Likewise.
14427 (Archive::read_all_symbols): Likewise.
14428 (Archive::read_symbols): Likewise.
14429 (Archive::get_elf_object_for_member): Remove input_objects
14430 parameter. Add punconfigured parameter. Change all callers.
14431 (Archive::add_symbols): Change return type to bool. Check return
14432 value of include_member.
14433 (Archive::include_all_members): Likewise.
14434 (Archive::include_member): Change return type to bool. Return
14435 false if first included object has incompatible target. Set
14436 included_member_ field.
14437 (Add_archive_symbols::run): If add_symbols returns false, requeue
14438 Read_symbols task.
14439 * archive.h (class Archive): Add included_member_ field.
14440 Initialize it in constructor. Add input_file and searched_for
14441 methods. Update declarations.
14442 (class Add_archive_symbols): Add dirpath_, dirindex_, and
14443 input_argument_ fields. Add them to constructor. Change all
14444 callers.
14445 * script.cc: Include "target-select.h".
14446 (class Parser_closure): Add skip_on_incompatible_target_ and
14447 found_incompatible_target_ fields. Add
14448 skip_on_incompatible_target parameter to constructor. Change all
14449 callers. Add methods skip_on_incompatible_target,
14450 clear_skip_on_incompatible_target, found_incompatible_target, and
14451 set_found_incompatible_target.
14452 (read_input_script): Add dirindex parameter. Change all callers.
14453 If parser finds an incompatible target, requeue Read_symbols
14454 task.
14455 (script_set_symbol): Clear skip_on_incompatible_target in
14456 closure.
14457 (script_add_assertion, script_parse_option): Likewise.
14458 (script_start_sections, script_add_phdr): Likewise.
14459 (script_check_output_format): New function.
14460 * script.h (read_input_script): Update declaration.
14461 * script-c.h (script_check_output_format): Declare.
14462 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
14463 (ignore_cmd): Remove OUTPUT_FORMAT.
14464 * fileread.cc (Input_file::Input_file): Add explicit this.
14465 (Input_file::will_search_for): New function.
14466 (Input_file::open): Add pindex parameter. Change all callers.
14467 * fileread.h (class Input_file): Add input_file_argument method.
14468 Declare will_search_for. Update declarations.
14469 * object.cc (make_elf_object): Add punconfigured parameter.
14470 Change all callers.
14471 * object.h (class Object): Make input_file public. Add
14472 searched_for method.
14473 (make_elf_object): Update declaration.
14474 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
14475 restart search.
14476 * dirsearch.h (class Dirsearch): Update declaration.
14477 * options.h (class General_options): Add --warn-search-mismatch.
14478 * parameters.cc (Parameters::is_compatible_target): New function.
14479 * parameters.h (class Parameters): Declare is_compatible_target.
14480 * workqueue.cc (Workqueue::add_blocker): New function.
14481 * workqueue.h (class Workqueue): Declare add_blocker.
14482
f1ed28fb
ILT
14483 * fileread.cc (Input_file::open): Remove options parameter.
14484 Change all callers.
14485 (Input_file::open_binary): Likewise.
14486 * script.cc (read_input_script): Likewise.
14487 * readsyms.h (class Read_symbols): Remove options_ field. Remove
14488 options parameter from constructor. Change all callers.
14489 (class Read_script): Likewise.
14490 * fileread.h (class Input_file): Update declarations.
14491 * script.h (read_input_script): Update declaration.
14492
34dd024a
NC
144932009-03-10 Nick Clifton <nickc@redhat.com>
14494
14495 * po/es.po: New Spanish translation.
14496
6d71b17c
CC
144972009-03-06 Cary Coutant <ccoutant@google.com>
14498
14499 * options.cc (parse_short_option): Keep dash_z from registering itself.
14500
031cdbed
ILT
145012009-03-03 Ian Lance Taylor <iant@google.com>
14502
14503 PR 9918
14504 * target-reloc.h (relocate_section): Pass output_section to
14505 relocate.
14506 * i386.cc (Target_i386::should_apply_static_reloc): Add
14507 output_section parameter. Change all callers.
14508 (Target_i386::Relocate::relocate): Add output_section parameter.
14509 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14510 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
14511 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
14512 * testsuite/two_file_shared.sh: New script.
14513 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
14514 (check_DATA): Add two_file_shared.dbg.
14515 (two_file_shared.dbg): New target.
14516 * testsuite/Makefile.in: Rebuild.
14517
15d5fa16
ILT
145182009-03-01 Ian Lance Taylor <iant@google.com>
14519
14520 * configure.ac: Check for byteswap.h.
14521 * configure: Rebuild.
14522 * config.in: Rebuild.
14523
8a4c0b0d
ILT
145242009-03-01 Mikolaj Zalewski <mikolajz@google.com>
14525
14526 * layout.cc (Layout::find_or_add_kept_section): New function.
14527 (Layout::add_comdat): Removed.
14528 * layout.h (struct Kept_section): Move out of class Layout.
14529 Remove trailing underscores from field names. Add group_sections
14530 field. Rename group_ field to is_group. Change all uses.
14531 (class Layout): Declare find_or_add_kept_section, not add_comdat.
14532 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
14533 comdat_groups_ field.
14534 (Sized_relobj::include_section_group): Use
14535 find_or_add_kept_section and Kept_section::group_sections.
14536 (Sized_relobj::include_linkonce_section): Likewise.
14537 * object.cc (class Sized_relobj): Don't define Comdat_group or
14538 Comdat_group_table. Remove find_comdat_group and
14539 add_comdat_group. Remove comdat_groups_ field.
14540 * plugin.cc (include_comdat_group): Use
14541 Layout::find_or_add_kept_section.
14542
b4ecf66b
ILT
145432009-02-28 Ian Lance Taylor <iant@google.com>
14544
14359ca0
ILT
14545 * README: --gc-sections and map files are now supported. Document
14546 some build requirements.
14547
b4ecf66b
ILT
14548 PR 6992
14549 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
14550 relocatable link set the value of the section symbol to zero.
14551 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
14552 relocatable link don't include the section address in the local
14553 symbol value.
14554
0602e05a
ILT
145552009-02-27 Ian Lance Taylor <iant@google.com>
14556
fd9d194f
ILT
14557 PR 6811
14558 * options.h (class Search_directory): Add is_system_directory.
14559 (class General_options): Declare is_in_system_directory.
14560 * options.cc (get_relative_sysroot): Make static.
14561 (get_default_sysroot): Make static.
14562 (General_optoins::is_in_system_directory): New function.
14563 * fileread.cc (Input_file::is_in_system_directory): New function.
14564 * fileread.h (class Input_file): Declare is_in_system_directory.
14565 * object.h (class Object): Add is_in_system_directory.
14566 (class Input_objects): Remove system_library_directory_ field.
14567 * object.cc (Input_objects::add_object): Don't set
14568 system_library_directory_.
14569 (input_objects::found_in_system_library_directory): Remove.
14570 * symtab.cc (Symbol_table::write_globals): Remove input_objects
14571 parameter. Change all callers.
14572 (Symbol_table::sized_write_globals): Likewise.
14573 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
14574 Call Object::is_in_system_directory.
14575 * symtab.h (class Symbol_table): Update declarations.
14576
61edd21f
ILT
14577 PR 5990
14578 * descriptors.h (Open_descriptor): Add is_on_stack field.
14579 * descriptors.cc (Descriptors::open): If the descriptor is on the
14580 top of the stack, remove it. Initialize is_on_stack field.
14581 (Descriptors::release): Only add pod to stack if it is not on the
14582 stack already.
14583 (Descriptors::close_some_descriptor): Clear stack_next and
14584 is_on_stack fields.
14585
e29e076a
ILT
14586 PR 7091
14587 * output.cc (Output_section::find_starting_output_address): Rename
14588 from starting_output_address; add PADDR parameter; change return
14589 type.
14590 * output.h (class Output_section): Declare
14591 find_starting_output_address instead of starting_output_address.
14592 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
14593 section symbol for which we can't find a merge section.
14594
0602e05a
ILT
14595 PR 9836
14596 * symtab.cc (Symbol_table::add_from_object): If the visibility is
14597 hidden or internal, force the symbol to be local.
14598 * resolve.cc (Symbol::override_visibility): Define.
14599 (Symbol::override_base): Use override_visibility.
14600 (Symbol_table::resolve): Likewise.
14601 (Symbol::override_base_with_special): Likewise.
14602 (Symbol_table::override_with_special): If the visibility is hidden
14603 or internal, force the symbol to be local.
14604 * symtab.h (class Symbol): Add set_visibility and
14605 override_visibility.
14606 * testsuite/ver_test_1.sh: New file.
14607 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
14608 (check_DATA): Add ver_test_1.syms.
14609 (ver_test_1.syms): New target.
14610 * testsuite/Makefile.in: Rebuild.
14611
401a9a73
CC
146122009-02-25 Cary Coutant <ccoutant@google.com>
14613
14614 * layout.cc (Layout::choose_output_section): Don't rename sections
14615 when using a linker script that has a SECTIONS clause.
14616 * Makefile.in: Regenerate.
14617
14618 * testsuite/Makefile.am (script_test_5.sh): New test case.
14619 * testsuite/Makefile.in: Regenerate.
14620 * testsuite/script_test_5.cc: New file.
14621 * testsuite/script_test_5.sh: New file.
14622 * testsuite/script_test_5.t: New file.
14623
f488e4b0
CC
146242009-02-13 Rafael Avila de Espindola <espindola@google.com>
14625
14626 * archive.cc (Archive::include_member): Update calls to add_symbols.
14627 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
14628 the Layout argument.
14629 * dynobj.h (do_add_symbols): Add the Layout argument.
14630 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
14631 Layout argument.
14632 * object.h (Object::add_symbols): Add the Layout argument.
14633 (Object::do_add_symbols): Add the Layout argument.
14634 (Sized_relobj::do_add_symbols): Add the Layout argument.
14635 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
14636 Unify the two versions.
14637 (Add_plugin_symbols): Remove.
14638 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
14639 (Sized_pluginobj::do_add_symbols): Unify the two versions.
14640 (Add_plugin_symbols): Remove.
14641 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
14642 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
14643 (Add_symbols::run): Make it work with Pulginobj.
14644
89dd1680
ILT
146452009-02-06 Ian Lance Taylor <iant@google.com>
14646
14647 * object.cc (Sized_relobj::do_layout): Make info message start
14648 with lower case letter.
14649
266d0a74
ILT
146502009-02-06 Mikolaj Zalewski <mikolajz@google.com>
14651
602b464e
ILT
14652 * binary.cc: Fix file comment.
14653
266d0a74
ILT
14654 * options.h (enum Incremental_disposition): Define.
14655 (class General_options): Add new options: --incremental,
14656 --incremental_changed, --incremental_unchanged,
14657 --incremental_unknown. Add incremental_disposition_ and
14658 implicit_incremental_ fields.
14659 (General_options::incremental_disposition): New function.
14660 (class Position_dependent_options): Add incremental_disposition
14661 option.
14662 (Position_dependent_options::copy_from_options): Set incremental
14663 dispositions.
14664 * options.cc (General_options::parse_incremental_changed): New
14665 function.
2e702c99
RM
14666 (General_options::parse_incremental_unchanged): New function.
14667 (General_options::parse_incremental_unknown): New function.
14668 (General_options::General_options): Initialize new fields
266d0a74 14669 incremental_disposition_ and implicit_incremental_.
2e702c99 14670 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
14671 without --incremental.
14672
f073bbf7
CD
146732009-02-06 Chris Demetriou <cgd@google.com>
14674
14675 * gold.h (gold_undefined_symbol): Change to take only a Symbol
14676 pointer and to report location as the file name associated with
14677 the symbol.
14678 (gold_undefined_symbol_at_location): New function to replace the
14679 old gold_undefined_symbol functionality.
14680 * target-reloc.h (relocate_section): Update to use
14681 gold_undefined_symbol_at_location.
14682 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14683 Call gold_undefined_symbol function rather than gold_error.
14684 * errors.h (Errors::undefined_symbol): Take location as a
14685 string, rather than calculating it from a relocation.
14686 * errors.cc (Errors::fatal): Print "fatal error:" before the
14687 formatted message.
14688 (Errors::error, Errors::error_at_location): Print "error: "
14689 before the formatted message.
14690 (Errors::undefined_symbol): Take location as a string, rather
14691 than calculating it from a relocation.
14692 (gold_undefined_symbol_at_location): New function akin to
14693 old gold_undefined_symbol, calculates location from relocation.
14694 (gold_undefined_symbol): Change to take only a Symbol pointer
14695 and to report location as the file name associated with the symbol.
14696 * testsuite/debug_msg.sh: Update for changed error messages.
14697 * testsuite/undef_symbol.sh: Likewise.
14698
8e94a90c
ILT
146992009-02-04 Duncan Sands <baldrick@free.fr>
14700
14701 PR 9812
14702 * reduced_debug_output.h
14703 (Output_reduced_debug_abbrev_section::failed): Use format for
14704 gold_warning.
14705 (Output_reduced_debug_info_section::faild): Likewise.
14706
88a0e15b
ILT
147072009-01-31 Mikolaj Zalewski <mikolajz@google.com>
14708
14709 * script.cc (Lazy_demangler): New class.
2e702c99 14710 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
14711 symbol only once.
14712
5efc7cd2
CC
147132009-01-29 Cary Coutant <ccoutant@google.com>
14714
14715 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
14716 to __tls_get_addr.
14717 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14718
e0ebcf42
ILT
147192009-01-28 Ian Lance Taylor <iant@google.com>
14720
5efc7cd2 14721 * version.cc (version_string): Bump to 1.9.
75fe7426 14722
e0ebcf42
ILT
14723 * gold.h: Include <cstring> and <stdint.h>.
14724 * version.cc: Include <cstdio>.
14725 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
14726 warning.
14727 * reduced_debug_output.cc (insert_into_vector): Rename from
14728 Insert_into_vector; change all callers. Use Swap_unaligned to
14729 avoid aliasing issue; remove union since it is unnecessary.
14730
8e2813be 147312009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
14732
14733 * Makefile.am (CCFILES): Add gc.cc.
14734 (HFILES): Add gc.h.
14735 * Makefile.in: Regenerate.
14736 * gold.cc (Gc_runner): New class.
14737 (queue_initial_tasks): Call garbage collection related tasks
14738 when corresponding options are invoked.
14739 (queue_middle_gc_tasks): New function.
14740 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
14741 processed early before laying out sections during garbage collection.
14742 * gold.h (queue_middle_gc_tasks): New function.
14743 (is_prefix_of): Move from "layout.cc".
14744 * i386.cc (Target_i386::gc_process_relocs): New function.
14745 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
14746 * main.cc (main): Create object of class "Garbage_collection".
14747 * object.cc (Relobj::copy_symbols_data): New function.
14748 (Relobj::is_section_name_included): New function.
e1df38aa
NC
14749 (Sized_relobj::do_layout): Allow this function to be called twice
14750 during garbage collection and defer layout of section during the
6d03d481
ST
14751 first call.
14752 * object.h (Relobj::get_symbols_data): New function.
14753 (Relobj::is_section_name_included): New function.
14754 (Relobj::copy_symbols_data): New function.
14755 (Relobj::set_symbols_data): New function.
14756 (Relobj::get_relocs_data): New function.
14757 (Relobj::set_relocs_data): New function.
14758 (Relobj::is_output_section_offset_invalid): New pure virtual function.
14759 (Relobj::gc_process_relocs): New function.
14760 (Relobj::do_gc_process_relocs): New pure virtual function.
14761 (Relobj::sd_): New data member.
14762 (Sized_relobj::is_output_section_offset_invalid): New function.
14763 (Sized_relobj::do_gc_process_relocs): New function.
14764 * options.h (General_options::gc_sections): Modify to not be a no-op.
14765 (General_options::print_gc_sections): New option.
14766 * plugin.cc (Plugin_finish::run): Remove function call to
14767 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
14768 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
14769 * reloc.cc (Read_relocs::run): Add task to process relocs and
14770 determine unreferenced sections when doing garbage collection.
14771 (Gc_process_relocs): New class.
14772 (Sized_relobj::do_gc_process_relocs): New function.
14773 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
14774 sections that are garbage collected.
14775 * reloc.h (Gc_process_relocs): New class.
14776 * sparc.cc (Target_sparc::gc_process_relocs): New function.
14777 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
14778 symbols whose corresponding sections are garbage collected.
14779 (Symbol_table::Symbol_table): Add new parameter for the garbage
14780 collection object.
14781 (Symbol_table::gc_mark_undef_symbols): New function.
14782 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14783 (Symbol_table::gc_mark_dyn_syms): New function.
14784 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
14785 as garbage.
14786 (Symbol_table::add_from_object): Likewise.
14787 (Symbol_table::add_from_relobj): When building shared objects, do not
14788 treat externally visible symbols as garbage.
14789 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
14790 table information for static and relocatable links.
14791 * symtab.h (Symbol_table::set_gc): New function.
14792 (Symbol_table::gc): New function.
14793 (Symbol_table::gc_mark_undef_symbols): New function.
14794 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14795 (Symbol_table::gc_mark_dyn_syms): New function.
14796 (Symbol_table::gc_): New data member.
e1df38aa 14797 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
14798 function.
14799 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
14800 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
14801
3b293544
CF
148022009-01-20 Chris Faylor <me.sourceware@sourceware.org>
14803
14804 * options.h (General_options::gc_sections): Define as a no-op for now.
14805 (General_options::no_keep_memory): Ditto.
14806 (General_options::Bshareable): Define.
14807 * options.cc (General_options::finalize): Honor -Bshareable.
14808
83d22aa8
AS
148092009-01-20 Andreas Schwab <schwab@suse.de>
14810
14811 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
14812 read the value in the contents, since we don't use it. Use the
14813 template endianness when writing.
14814 (Relocate::relocate): Use it for R_PPC_REL16_HA.
14815
cd536b21
AS
148162009-01-19 Andreas Schwab <schwab@suse.de>
14817
14818 * configure.tgt (powerpc64-*): Fix targ_obj.
14819
99e9a495
ILT
148202009-01-15 Ian Lance Taylor <iant@google.com>
14821
14822 * object.cc (Sized_relobj::write_local_symbols): Don't write out
14823 local symbols when stripping all symbols.
14824
bbbfea06
CC
148252009-01-14 Cary Coutant <ccoutant@google.com>
14826
99e9a495 14827 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 14828
0f7c0701
CC
148292009-01-14 Cary Coutant <ccoutant@google.com>
14830
14831 * archive.cc (Archive::get_elf_object_for_member): Remove call
14832 to File_read::claim_for_plugin.
14833 * descriptors.cc (Descriptors::open): Remove reference to
14834 is_claimed.
14835 (Descriptors::claim_for_plugin): Remove.
14836 * descriptors.h (Descriptors::claim_for_plugin): Remove.
14837 (Descriptors::is_claimed): Remove.
14838 (claim_descriptor_for_plugin): Remove.
14839 * fileread.cc (File_read::claim_for_plugin): Remove.
14840 * fileread.h (File_read::claim_for_plugin): Remove.
14841 (File_read::descriptor): Reopen descriptor if necessary.
14842 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
14843 (Plugin_manager::all_symbols_read): Add task parameter. Change
14844 all callers.
14845 (Plugin_manager::get_input_file): New function.
14846 (Plugin_manager::release_input_file): New function.
14847 (Pluginobj::Pluginobj): Add filesize parameter and initialize
14848 corresponding data member.
14849 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
14850 and pass to base constructor. Change all callers.
14851 (get_input_file, release_input_file): New functions.
14852 (make_sized_plugin_object): Add filesize parameter. Change all callers.
14853 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
14854 (Plugin_manager::all_symbols_read): Add task parameter.
14855 (Plugin_manager::get_input_file): New function.
14856 (Plugin_manager::release_input_file): New function.
14857 (Plugin_manager::task_): New data member.
14858 (Pluginobj::Pluginobj): Add filesize parameter.
14859 (Pluginobj::filename): New function.
14860 (Pluginobj::descriptor): New function.
14861 (Pluginobj::filesize): New function.
14862 (Pluginobj::filesize_): New data member.
14863 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
14864 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
14865 File_read::claim_for_plugin; use Object::unlock to unlock the file.
14866
14867 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
14868 with archive libraries.
14869 * testsuite/Makefile.in: Regenerate.
14870 * testsuite/plugin_test.c (struct sym_info): New type.
14871 (get_input_file, release_input_file): New static variables.
14872 (onload): Capture new transfer vector entries.
14873 (claim_file_hook): Stop reading at end of file according to filesize.
14874 Factor out parsing of readelf output into separate function.
14875 (all_symbols_read_hook): Exercise get_input_file and release_input_file
14876 APIs and get the source file name from the symbol table. Convert
14877 source file name to corresponding object file name. Print info
14878 message when adding new input files.
14879 (parse_readelf_line): New function.
14880 * testsuite/plugin_test_1.sh: Add checks for new info messages.
14881 * testsuite/plugin_test_2.sh: Likewise.
14882 * testsuite/plugin_test_3.sh: Likewise.
14883 * testsuite/plugin_test_4.sh: New test case.
14884
62a6d109
ILT
148852009-01-07 Ian Lance Taylor <iant@google.com>
14886
14887 * version.cc (version_string): Bump to 1.8.
14888
483620e8
CC
148892008-12-23 Cary Coutant <ccoutant@google.com>
14890
14891 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
14892 * plugin.cc (Plugin_manager::finish): Rename as
14893 layout_deferred_objects. Move cleanup to separate function.
14894 (Plugin_manager::cleanup): New function.
14895 (Plugin_finish::run): Call layout_deferred_objects and cleanup
14896 separately.
14897 * plugin.h (Plugin_manager::finish): Rename as
14898 layout_deferred_objects.
14899 (Plugin_manager::cleanup): New function.
14900 (Plugin_manager::cleanup_done): New field.
14901
d66a9eb3
CC
149022008-12-23 Cary Coutant <ccoutant@google.com>
14903
14904 * plugin.cc (is_visible_from_outside): New function.
14905 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
14906 so we don't return "IR only" status for exported symbols or -r links.
14907
14908 * testsuite/Makefile.am (plugin_test_3): New test case.
14909 * testsuite/Makefile.in: Regenerate.
14910 * testsuite/plugin_test_3.sh: New file.
14911
5995b570
CC
149122008-12-22 Cary Coutant <ccoutant@google.com>
14913
14914 * object.cc (Sized_relobj::layout_section): New function.
14915 (Sized_relobj::do_layout): Defer layout of input sections until after
14916 plugin has provided replacement files.
14917 (Sized_relobj::do_layout_deferred_sections): New function.
14918 * object.h (Relobj::set_section_offset): Remove virtual keyword.
14919 (Relobj::layout_deferred_sections): New function.
14920 (Relobj::do_layout_deferred_sections): New function.
14921 (Sized_relobj::do_layout_deferred_sections): New function.
14922 (Sized_relobj::layout_section): New function.
14923 (Sized_relobj::Deferred_layout): New structure.
14924 (Sized_relobj::deferred_layout_): New field.
14925 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
14926 Change all callers. Layout deferred sections.
14927 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
14928 references.
14929 (Plugin_hook::run): Move code from do_plugin_hook inline.
14930 (Plugin_hook::do_plugin_hook): Remove.
14931 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
14932 (Plugin_manager::finish): Renamed, was cleanup.
14933 (Plugin_manager::should_defer_layout): New function.
14934 (Plugin_manager::add_deferred_layout_object): New function.
14935 (Plugin_manager::Deferred_layout_list): New type.
14936 (Plugin_manager::deferred_layout_objects_): New field.
14937 (Plugin_hook::do_plugin_hook): Remove.
14938
ee769c88
ILT
149392008-12-17 Ian Lance Taylor <iant@google.com>
14940
14941 * options.h (class General_options): Add --no case for
14942 --export-dynamic.
14943
abc8dcba
CC
149442008-12-16 Cary Coutant <ccoutant@google.com>
14945
14946 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
14947 vector.
14948 (Plugin_manager::claim_file): Create plugin object even if
14949 plugin did not call the add_symbols callback.
14950 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
14951 asking for more symbols than were added.
14952 * testsuite/Makefile.am (plugin_test_1): Add test case with
14953 no global symbols.
14954 (empty.syms): New target.
14955 * testsuite/Makefile.in: Regenerate.
14956 * testsuite/plugin_test.c (claim_file_hook): Add new debug
14957 message. Don't call add_symbols if no globals.
14958 (all_symbols_read_hook): Don't provide replacement for empty
14959 claimed file.
14960
b0074644
ILT
149612008-12-12 Ian Lance Taylor <iant@google.com>
14962
68943102
ILT
14963 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
14964 r_type == 0 for a local symbol with r_sym == 0.
14965 (scan_relocatable_relocs): Pass r_sym to
14966 local_non_section_strategy.
14967 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
14968 r_sym parameter.
14969
b0074644
ILT
14970 * configure.ac: Update test for TLS descriptors: they are
14971 supported as of glibc 2.9.
14972 * configure: Rebuild.
14973
c2508178
ILT
149742008-12-11 Ian Lance Taylor <iant@google.com>
14975
14976 PR 7091
14977 * target-reloc.h (Default_scan_relocatable_relocs): For each
14978 function, map r_type == 0 to RELOC_DISCARD.
14979
2756a258
CC
149802008-12-10 Cary Coutant <ccoutant@google.com>
14981
14982 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
14983 object to override a kept COMDAT group from a plugin object.
14984
bb6f53d3
ILT
149852008-12-09 Ian Lance Taylor <iant@google.com>
14986
fbc558e1
ILT
14987 PR 7088
14988 * yyscript.y (file_cmd): Handle INPUT.
14989
bb6f53d3
ILT
14990 * testsuite/initpri1.c: Change all declarations to be full
14991 prototypes by adding void, to avoid compiler warnings.
14992
4674ecfc
CC
149932008-12-05 Rafael Avila de Espindola <espindola@google.com>
14994
14995 * options.cc (General_options::parse_plugin_opt): New.
14996 (General_options::add_plugin): The argument now is just the filename.
14997 (General_options::add_plugin_option): New.
14998 * options.h (plugin_opt): New.
14999 (add_plugin): Change argument name.
15000 (add_plugin_option): New.
15001 * plugin.cc (Plugin::load): Don't parse the plugin option.
15002 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
15003 (Plugin::add_option): New.
15004 (Plugin::args_): Change type.
15005 (Plugin::filename_): New.
15006 (Plugin_manager::add_plugin_option): New.
15007 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
15008 * testsuite/Makefile.in: Regenerate.
15009
fd06b4aa
CC
150102008-12-05 Cary Coutant <ccoutant@google.com>
15011
15012 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
15013 Handle --strip-lto-sections option.
15014 * options.h (strip_lto_sections): New option.
15015
6c52134c
CC
150162008-12-01 Cary Coutant <ccoutant@google.com>
15017
15018 * plugin.cc (ld_plugin_message): Change format parameter to const.
15019 Fix mismatch between new[] and delete.
15020
a45248e0
CC
150212008-11-14 Cary Coutant <ccoutant@google.com>
15022
15023 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
15024 instead of -1U.
15025
c82fbeee
CS
150262008-11-05 Craig Silverstein <csilvers@google.com>
15027
15028 * options.cc (General_options::parse_dynamic_list): New function.
15029 * options.h (General_options): New flags dynamic_list,
15030 dynamic_list_data, dynamic_list_cpp_new, and
15031 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
15032 (General_options::in_dynamic_list): New function.
15033 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
15034 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
15035 (Lex::can_continue_name): Likewise.
15036 (yylex): Likewise.
15037 (read_script_file): New parameter script_options.
15038 (read_dynamic_list): New function.
15039 (Script_options::define_dynamic_list): New function.
15040 (dynamic_list_keyword_parsecodes): New variable.
15041 (dynamic_list_keywords): New variable.
15042 * script.h (Script_options::define_dynamic_list): New function
15043 prototype.
15044 (read_dynamic_list): New function prototype.
15045 * symtab.cc (strprefix): New macro.
15046 (Symbol::should_add_dynsym_entry): Support dynamic_list,
15047 dynamic_list_data, dynamic_list_cpp_new, and
15048 dynamic_list_cpp_typeinfo.
15049 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
15050 (dynamic_list_expr): New rule.
15051 (dynamic_list_nodes): Likewise.
15052 (dynamic_list_node): Likewise.
15053 * testsuite/Makefile.am (dynamic_list): New test.
15054 * testsuite/Makefile.in: Regenerated.
15055 * testsuite/dynamic_list.t: New file.
15056 * testsuite/dynamic_list.sh: New file.
15057
e0bb29a5
CS
150582008-11-05 Craig Silverstein <csilvers@google.com>
15059
15060 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
15061 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
15062 (t11_last): Likewise.
15063 * testsuite/ver_test_6.c (main): Likewise.
15064
4e1e25e0
CC
150652008-10-07 Cary Coutant <ccoutant@google.com>
15066
15067 * options.c (General_options::finalize): Add check for -static and
15068 -shared.
15069 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
15070 is not empty.
15071
92f03fcb
CC
150722008-10-02 Cary Coutant <ccoutant@google.com>
15073
15074 * plugin.cc (make_sized_plugin_object): Fix conditional
15075 compilation to work when not all targets are enabled.
15076
fbd8a257
CC
150772008-09-29 Cary Coutant <ccoutant@google.com>
15078
15079 * archive.cc (Archive::get_file_and_offset): Use filename instead
15080 of name to get library path.
15081 (Archive::include_member): Unlock external member of a thin archive.
15082
15083 * testsuite/Makefile.am (TEST_AR): New variable.
15084 (thin_archive_test_1): New test.
15085 (thin_archive_test_2): New test.
81636b3f
CC
15086 * testsuite/Makefile.in: Regenerate.
15087 * testsuite/thin_archive_main.cc: New file.
15088 * testsuite/thin_archive_test_1.cc: New file.
15089 * testsuite/thin_archive_test_2.cc: New file.
15090 * testsuite/thin_archive_test_3.cc: New file.
15091 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 15092
eff45813
CC
150932008-09-29 Cary Coutant <ccoutant@google.com>
15094
15095 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
15096 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
15097 instead of -1U.
15098 (Sized_relobj::do_finalize_local_symbols): Likewise.
15099 (Sized_relobj::map_to_kept_section): Likewise.
15100 * object.h (Sized_relobj::invalid_address): New constant.
15101 (Sized_relobj::do_output_section_offset): Check for invalid_address
15102 and return -1ULL.
15103 * output.cc (Output_reloc::local_section_offset): Use constant
15104 invalid_address instead of -1U.
15105 (Output_reloc::get_address): Likewise.
15106 (Output_section::output_address): Change -1U to -1ULL.
15107 * output.h (Output_reloc::invalid_address): New constant.
15108 * reloc.cc (Sized_relobj::write_sections): Use constant
15109 invalid_address instead of -1U.
15110 (Sized_relobj::relocate_sections): Likewise.
15111 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
15112 values for merge sections.
15113 * target-reloc.h (relocate_for_relocatable): Use constant
15114 invalid_address instead of -1U.
15115
89fc3421
CC
151162008-09-19 Cary Coutant <ccoutant@google.com>
15117
15118 Add plugin functionality for link-time optimization (LTO).
15119 * configure.ac (plugins): Add --enable-plugins option.
15120 * configure: Regenerate.
15121 * config.in: Regenerate.
15122 * Makefile.am (LIBDL): New variable.
15123 (CCFILES): Add plugin.cc.
15124 (HFILES): Add plugin.h.
15125 (ldadd_var): Add LIBDL.
15126 * Makefile.in: Regenerate.
15127
15128 * archive.cc: Include "plugin.h".
15129 (Archive::setup): Don't preread archive symbols when using a plugin.
15130 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
15131 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
15132 files.
15133 (Archive::include_member): Add symbols from plugin objects.
15134 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
15135 * descriptors.cc (Descriptors::open): Check for file descriptors
15136 abandoned by plugins.
15137 (Descriptors::claim_for_plugin): New function.
15138 * descriptors.h (Descriptors::claim_for_plugin): New function.
15139 (Open_descriptor::is_claimed): New field.
15140 (claim_descriptor_for_plugin): New function.
15141 * fileread.cc (File_read::claim_for_plugin): New function.
15142 * fileread.h (File_read::claim_for_plugin): New function.
15143 (File_read::descriptor): New function.
15144 * gold.cc: Include "plugin.h".
15145 (queue_initial_tasks): Add task to call plugin hooks for generating
15146 new object files.
15147 * main.cc: Include "plugin.h".
15148 (main): Load plugin libraries.
15149 * object.h (Pluginobj): Declare.
15150 (Object::pluginobj): New function.
15151 (Object::do_pluginobj): New function.
15152 (Object::set_target): New function.
15153 * options.cc: Include "plugin.h".
15154 (General_options::parse_plugin): New function.
15155 (General_options::General_options): Initialize plugins_ field.
15156 (General_options::add_plugin): New function.
15157 * options.h (Plugin_manager): Declare.
15158 (General_options): Add --plugin option.
15159 (General_options::has_plugins): New function.
15160 (General_options::plugins): New function.
15161 (General_options::add_plugin): New function.
15162 (General_options::plugins_): New field.
15163 * plugin.cc: New file.
15164 * plugin.h: New file.
15165 * readsyms.cc: Include "plugin.h".
15166 (Read_symbols::do_read_symbols): Check for archive before checking
15167 for ELF file. Call plugin hooks to claim files.
15168 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
15169 from a real object file; force override when processing replacement
15170 files.
15171 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
15172 (Symbol::init_base_object): Likewise.
15173 (Symbol::init_base_output_data): Likewise.
15174 (Symbol::init_base_output_segment): Likewise.
15175 (Symbol::init_base_constant): Likewise.
15176 (Symbol::init_base_undefined): Likewise.
15177 (Symbol::output_section): Assert that object is not a plugin.
15178 (Symbol_table::add_from_pluginobj): New function.
15179 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
15180 undefined.
15181 (Symbol_table::sized_write_globals): Likewise.
15182 (Symbol_table::add_from_pluginobj): Instantiate template.
15183 * symtab.h (Sized_pluginobj): Declare.
15184 (Symbol::in_real_elf): New function.
15185 (Symbol::set_in_real_elf): New function.
15186 (Symbol::in_real_elf_): New field.
15187 (Symbol_table::add_from_pluginobj): New function.
15188
15189 * testsuite/Makefile.am (AM_CFLAGS): New variable.
15190 (LIBDL): New variable.
15191 (LDADD): Add LIBDL.
15192 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
15193 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
15194 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
15195 (MOSTLYCLEANFILES): Likewise.
15196 * testsuite/Makefile.in: Regenerate.
15197 * testsuite/plugin_test.c: New file.
15198 * testsuite/plugin_test_1.sh: New file.
15199 * testsuite/plugin_test_2.sh: New file.
15200
de31bda5
ILT
152012008-09-16 Ian Lance Taylor <iant@google.com>
15202
9c2d0ef9
ILT
15203 * target-reloc.h (relocate_section): Check whether a symbol is
15204 defined by the ABI before reporting an undefined symbol error.
15205 * target.h (Target::is_defined_by_abi): Make parameter const.
15206 (Target::do_is_defined_by_abi): Likewise.
15207 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
15208 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
15209 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
15210 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
15211 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
15212 * testsuite/Makefile.in: Rebuild.
15213
de31bda5
ILT
15214 * fileread.cc (make_view): Add casts to avoid warning.
15215
9fa33bee
AO
152162008-09-16 Alexandre Oliva <aoliva@redhat.com>
15217
15218 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
15219 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15220
183fd0e3
AO
152212008-09-16 Alexandre Oliva <aoliva@redhat.com>
15222
15223 * options.h (General_options::output_is_executable): New.
15224 (General_options::output_is_pie): New.
15225 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
15226 for shared libraries.
15227 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15228
7be8330a
CD
152292008-09-11 Chris Demetriou <cgd@google.com>
15230
15231 * options.h (origin): New -z option.
15232 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
15233 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
15234 in DT_FLAGS_1.
15235
a9caad02
CC
152362008-09-05 Cary Coutant <ccoutant@google.com>
15237
15238 * fileread.cc (File_read::make_view): Add check for attempt to map
15239 beyond end of file.
15240
ae6dce4d
CC
152412008-09-05 Cary Coutant <ccoutant@google.com>
15242
15243 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
15244 explicit instantiations.
15245
d7ab2a47
KVH
152462008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
15247
15248 PR gold/6858
15249 * options.cc (General_options::finalize): Allow undefined symbols
15250 in shlibs if linking -shared.
15251
15252 PR gold/6859
15253 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
15254 symbols as not needing a dynsym entry.
15255
1e52a9c1
CS
152562008-08-20 Craig Silverstein <csilvers@google.com>
15257
15258 * fileread.cc (File_read::open): Do not lock the file unless it
15259 was successfully opened.
15260
d85c80a3
CC
152612008-08-14 Cary Coutant <ccoutant@google.com>
15262
15263 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
15264 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
15265 * testsuite/tls_test.cc (struct int128): 128-bit struct
15266 for testing TLS relocs with non-zero addend.
15267 (v12): New TLS variable.
15268 (t12): New test.
15269 (t_last): Add check for v12.
15270 * testsuite/tls_test.h (t12): New function.
15271 * testsuite/tls_test_main.cc (thread_routine): Call new test.
15272
2d924fd9
ILT
152732008-08-13 Ian Lance Taylor <iant@google.com>
15274
15275 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
15276 set tls_segment_ or relro_segment_.
15277 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
15278 when appropriate.
15279 * output.h (Output_section::clear_is_relro): New function.
15280 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
15281 sections specially even when output_data_ is empty.
15282 (Output_segment::maximum_alignment): When first section is relro,
15283 only force alignment for PT_LOAD segments.
15284 * script.cc (script_data_segment_align): New function.
15285 (script_data_segment_relro_end): New function.
15286 * script-c.h (script_data_segment_align): Declare.
15287 (script_data_segment_relro_end): Declare.
15288 * script-sections.h (class Script_sections): Declare
15289 data_segment_align and data_segment_relro_end. Add fields
15290 segment_align_index_ and saw_relro_end_.
15291 * script-sections.cc (class Sections_element): Add set_is_relro
15292 virtual function. Add new bool* parameter to place_orphan_here.
15293 Add get_output_section virtual function.
15294 (class Output_section_definition): Add set_is_relro. Add new
15295 bool* parameter to place_orphan_here. Add get_output_section.
15296 Add is_relro_ field.
15297 (Output_section_definition::Output_section_definition): Initialize
15298 evaluated_address_, evaluated_load_address, evaluated_addralign_,
15299 and is_relro_ fields.
15300 (Output_section_definition::place_orphan_here): Add is_relro
15301 parameter.
15302 (Output_section_definition::set_section_addresses): Set relro for
15303 output section.
15304 (Output_section_definition::alternate_constraint): Likewise.
15305 (class Orphan_output_section): Add new bool* parameter to
15306 place_orphan_here. Add get_output_section.
15307 (Orphan_output_section::place_orphan_here): Add is_relro
15308 parameter.
15309 (Script_sections::Script_sections): Initialize
15310 data_segment_align_index_ and saw_relro_end_.
15311 (Script_sections::data_segment_align): New function.
15312 (Script_sections::data_segment_relro_end): New function.
15313 (Script_sections::place_orphan): Set or clear is_relro.
15314 (Script_sections::set_section_addresses): Force alignment of first
15315 TLS section.
15316 * yyscript.y (exp): Call script_data_segment_align and
15317 script_data_segment_relro_end.
15318 * testsuite/relro_script_test.t: New file.
15319 * testsuite/relro_test.cc (using_script): Declare.
15320 (t1, t2): Test using_script.
15321 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
15322 (relro_script_test_SOURCES): Define.
15323 (relro_script_test_DEPENDENCIES): Define.
15324 (relro_script_test_LDFLAGS): Define.
15325 (relro_script_test_LDADD): Define.
15326 (relro_script_test.so): New target.
15327 * testsuite/Makefile.in: Rebuild.
15328
f827c9a9
CC
153292008-08-06 Cary Coutant <ccoutant@google.com>
15330
15331 * archive.cc (Archive::total_archives, Archive::total_members)
15332 (Archive::total_members_loaded): New variables.
15333 (Archive::setup): Add parameter. Add option to preread
15334 archive symbols.
15335 (Archive::read_armap): Add counter.
15336 (Archive::get_file_and_offset): New function.
15337 (Archive::get_elf_object_for_member): New function.
15338 (Archive::read_all_symbols): New function.
15339 (Archive::read_symbols): New function.
15340 (Archive::add_symbols): Add counters.
15341 (Archive::include_all_members): Use armap to find members if it's
15342 already built.
15343 (Archive::include_member): Skip reading symbols if already read.
15344 Factored code into Archive::get_file_and_offset and
15345 Archive::get_elf_object_for_member. Changed call to
15346 Mapfile::report_include_archive_member.
15347 (Archive::print_stats): New function.
15348 * archive.h: Declare Object and Read_symbols_data classes.
15349 (Archive::Archive): Add initializers for new members.
15350 (Archive::setup): Add parameter.
15351 (Archive::print_stats): New function.
15352 (Archive::total_archives, Archive::total_members)
15353 (Archive::total_members_loaded): New variables.
15354 (Archive::get_file_and_offset): New function.
15355 (Archive::get_elf_object_for_member): New function.
15356 (Archive::read_all_symbols): New function.
15357 (Archive::read_symbols): New function.
15358 (Archive::Archive_member): New class.
15359 (Archive::members_): New member.
15360 (Archive::num_members_): New member.
15361 * main.cc: Include archive.h.
15362 (main): Call Archive::print_stats.
15363 * mapfile.cc (Mapfile::report_include_archive_member): Delete
15364 archive parameter; member_name is now the fully-decorated name.
15365 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
15366 * options.h: (General_options): Add --preread-archive-symbols option.
15367 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
15368 Archive::setup.
15369
de4c45bd
ILT
153702008-08-04 Ian Lance Taylor <iant@google.com>
15371
15372 * symtab.h (Symbol::use_plt_offset): New function.
15373 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
15374 * powerpc.cc (Relocate::relocate): Likewise.
15375 * sparc.cc (Relocate::relocate): Likewise.
15376 * x86_64.cc (Relocate::relocate): Likewise.
15377 * testsuite/weak_plt.sh: New test.
15378 * testsuite/weak_plt_main.cc: New test.
15379 * testsuite/weak_plt_shared.cc: New test.
15380 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
15381 (check_PROGRAMS): Add weak_plt.
15382 (check_DATA): Add weak_plt_shared.so.
15383 (weak_plt_main_pic.o, weak_plt): New targets.
15384 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
15385 * testsuite/Makefile.in: Rebuild.
15386
15387 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
15388 gcctestdir/ld.
15389 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
15390 * testsuite/Makefile.in: Rebuild.
15391
323ee3f4
AM
153922008-08-04 Alan Modra <amodra@bigpond.net.au>
15393
15394 * Makefile.am (POTFILES.in): Set LC_ALL=C.
15395 * Makefile.in: Regenerate.
15396 * po/POTFILES.in: Regenerate.
15397
7c07ecec
ILT
153982008-07-29 Ian Lance Taylor <iant@google.com>
15399
15400 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
15401 symbols before other symbols.
15402 * testsuite/script_test_2.cc (test_addr): Declare.
15403 (test_addr_alias): Declare.
15404 (main): Check that test_addr and test_addr_alias have the right
cd536b21 15405 values.
7c07ecec
ILT
15406 * testsuite/script_test_2.t: Define test_addr_alias and
15407 test_addr.
15408
5778530e
ILT
154092008-07-24 Ian Lance Taylor <iant@google.com>
15410
2a00e4fb
ILT
15411 PR 5990
15412 * descriptors.cc: New file.
15413 * descriptors.h: New file.
15414 * gold-threads.h (class Hold_optional_lock): New class.
15415 * fileread.cc: Include "descriptors.h".
15416 (File_read::~File_read): Release descriptor rather than closing
15417 it.
15418 (File_read::open) [file]: Call open_descriptor rather than open.
15419 Set is_descriptor_opened_.
15420 (File_read::open) [memory]: Assert that descriptor is not open.
15421 (File_read::reopen_descriptor): New function.
15422 (File_read::release): Release descriptor.
15423 (File_read::do_read): Make non-const. Reopen descriptor.
15424 (File_read::read): Make non-const.
15425 (File_read::make_view): Reopen descriptor.
15426 (File_read::do_readv): Likewise.
15427 * fileread.h (class File_read): Add is_descriptor_opened_ field.
15428 Update declarations.
15429 * layout.cc: Include "descriptors.h".
15430 (Layout::create_build_id): Use open_descriptor rather than open.
15431 * output.cc: Include "descriptors.h".
15432 (Output_file::open): Use open_descriptor rather than open.
15433 * archive.cc (Archive::const_iterator): Change Archive to be
15434 non-const.
15435 (Archive::begin, Archive::end): Make non-const.
15436 (Archive::count_members): Likewise.
15437 * archive.h (class Archive): Update declarations.
15438 * object.h (Object::read): Make non-const.
15439 * Makefile.am (CCFILES): Add descriptors.cc.
15440 (HFILES): Add descriptors.h.
15441 * Makefile.in: Rebuild.
15442
801647d1
ILT
15443 PR 6716
15444 * gold.h: Always include <clocale>. Add Solaris workarounds
15445 following code in binutils/sysdep.h.
15446
5edd166e
ILT
15447 PR 6048
15448 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
15449 this->eh_frame_hdr_ is NULL before using it.
15450
c89ad728
ILT
15451 * dynobj.cc (Versions::Versions): Update comment.
15452
aa86f06b
ILT
15453 * dynobj.cc (Versions::Versions): If there is an soname, use it as
15454 the base version name.
15455
5778530e
ILT
15456 * stringpool.cc (Stringpool_template::add_with_length): Set key to
15457 array size plus one.
15458 (Stringpool_template::set_string_offsets): Subtract one from key
15459 before using it as an array index.
15460 (Stringpool_template::get_offset_with_length): Likewise.
15461 (Stringpool_template::write_to_buffer): Likewise.
15462 * stringpool.h (Stringpool_template::get_offset_from_key):
15463 Likewise.
15464
057ead22
ILT
154652008-07-23 Ian Lance Taylor <iant@google.com>
15466
7f649c59
ILT
15467 PR 6658
15468 * object.h (Merged_symbol_value::value): Do our best to handle a
15469 negative addend.
15470
057ead22
ILT
15471 PR 6647
15472 * script.cc (Version_script_info::get_versions): Don't add empty
15473 version tag to return value.
15474 (Version_script_info::get_symbol_version_helper): Change return
15475 type to bool. Add pversion parameter. Change all callers.
15476 (script_register_vers_node): Don't require a non-NULL tag.
15477 * script.h (class Version_script_info): Update declarations.
15478 (Version_script_info::get_symbol_version): Change return type to
15479 bool. Add version parameter. Change all callers.
15480 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
15481 handling. Handle an empty version from a version script.
15482 (Symbol_table::define_special_symbol): Likewise.
15483 * testsuite/ver_test_10.script: New file.
15484 * testsuite/ver_test_10.sh: New file.
15485 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
15486 (check_DATA): Add ver_test_10.syms.
15487 (ver_test_10.syms, ver_test_10.so): New target.
15488 * testsuite/Makefile.in: Rebuild.
15489
58e54ac2
CD
154902008-07-23 Simon Baldwin <simonb@google.com>
15491
15492 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
15493 to zero for undefined symbols from dynamic libraries.
15494
95d14cd3
ILT
154952008-07-23 Ian Lance Taylor <iant@google.com>
15496
15497 * symtab.cc (Symbol_table::resolve): Remove version parameter.
15498 Change all callers.
15499 * symtab.h (class Symbol_table): Update declaration.
15500 * testsuite/ver_test_9.cc: New file.
15501 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
15502 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
15503 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
15504 (ver_test_9.so, ver_test_9.o): New targets.
15505 * testsuite/Makefile.in: Rebuild.
15506
92de84a6
ILT
155072008-07-22 Ian Lance Taylor <iant@google.com>
15508
34810851
ILT
15509 * options.h (class General_options): Define --check-sections.
15510 * layout.cc (Layout::set_segment_offsets): Handle
15511 --check-sections.
15512
af6156ef
ILT
15513 * options.h (class General_options): Define -n/--nmagic and
15514 -N/--omagic.
15515 * options.cc (General_options::finalize): For -n/--nmagic or
15516 -N/--omagic, set -static.
15517 * layout.cc (Layout::attach_allocated_section_to_segment): If
15518 -N/--omagic, don't put read-only and read-write sections in
15519 different segments.
15520 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
15521 finding a read-only segment.
15522 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
15523 don't set the minimum segment alignment to the common page size,
15524 and don't set the file offset to the address modulo the page size.
15525 * script-sections.cc (Script_sections::create_segments): If
15526 -n/--omagic, don't put read-only and read-write sections in
15527 different segments.
15528
92de84a6
ILT
15529 * cref.cc: New file.
15530 * cref.h: New file.
15531 * options.h (class General_options): Add --print-symbol-counts.
15532 * main.cc (main): Issue defined symbol report if requested.
15533 * archive.cc (Archive::interpret_header): Make into a const member
15534 function.
15535 (Archive::add_symbols): Call Input_objects::archive_start and
15536 archive_stop.
15537 (Archive::const_iterator): Define new class.
15538 (Archive::begin, Archive::end): New functions.
15539 (Archive::include_all_members): Rewrite to use iterator.
15540 (Archive::count_members): New function.
15541 * archive.h (class Archive): Update declarations.
15542 (Archive::filename): New function.
15543 * object.cc: Include "cref.h".
15544 (Sized_relobj::Sized_relobj): Initialize defined_count_.
15545 (Sized_relobj::do_get_global_symbol_counts): New function.
15546 (Input_objects::add_object): Add object to cross-referencer.
15547 (Input_objects::archive_start): New function.
15548 (Input_objects::archive_stop): New function.
15549 (Input_objects::print_symbol_counts): New function.
15550 * object.h: Declare Cref and Archive.
15551 (Object::get_global_symbol_counts): New function.
15552 (Object::do_get_global_symbol_counts): New pure virtual function.
15553 (class Sized_relobj): Add defined_count_ field. Update
15554 declarations.
15555 (class Input_objects): Add cref_ field. Update constructor.
15556 Update declarations.
15557 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
15558 defined_count_.
15559 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
15560 symbol counts.
15561 (Sized_dynobj::do_get_global_symbol_counts): New function.
15562 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
15563 defined_count_. Update declarations. Define Symbols typedef.
15564 * symtab.cc (Symbol_table::add_from_relobj): Add defined
15565 parameter. Change all callers.
15566 (Symbol_table::add_from_dynobj): Add sympointers and defined
15567 parameters. Change all callers.
15568 * symtab.h (class Symbol_table): Update declarations.
15569 * Makefile.am (CCFILES): Add cref.cc.
15570 (HFILES): Add cref.h.
15571 * Makefile.in: Rebuild.
15572
3f7c5e1d
CD
155732008-07-22 Simon Baldwin <simonb@google.com>
15574
15575 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
15576 to zero when writing undefined symbols.
15577
e0b64032
ILT
155782008-07-22 Ian Lance Taylor <iant@google.com>
15579
15580 * output.cc (Output_section::add_input_section): Don't try to
15581 merge empty merge sections.
15582
096b02cf
CS
155832008-07-21 Craig Silverstein <csilvers@google.com>
15584
15585 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15586 Include symbol version in error message.
cd536b21 15587
1d1f116d
CD
155882008-07-20 Chris Demetriou <cgd@google.com>
15589
cd536b21 15590 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
15591 (RANDOM_SEED_CFLAGS): New substituted variable.
15592 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
15593 * configure: Rebuild.
15594 * Makefile.in: Likewise.
15595 * testsuite/Makefile.in: Likewise.
15596
a18f591e
ILT
155972008-07-18 Ian Lance Taylor <iant@google.com>
15598
15599 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
15600 where we see NAME/NULL and NAME/VERSION as separate symbols.
15601 * testsuite/ver_test_main.cc (main): Call t4.
15602 (t4, t4_2a): Define.
15603 * testsuite/ver_test_2.cc (t4_2): Define.
15604 * testsuite/ver_test_2.script: Put t4_2a in VER2.
15605 * testsuite/ver_test_4.cc (t4_2a): Define.
15606 * testsuite/ver_test_4.script: Put t4_2a in VER2.
15607 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
15608
c6e3f6ed
ILT
156092008-07-17 Ian Lance Taylor <iant@google.com>
15610
15611 * dynobj.cc (Versions::add_def): If we give an error about a
15612 missing version, go ahead and create the version anyhow.
15613
ef9beddf
ILT
156142008-07-10 Ian Lance Taylor <iant@google.com>
15615
15616 Handle output sections with more than 0x7fffffff bytes.
15617 * object.h (class Relobj): Change map_to_output_ to
15618 output_sections_, and just keep a section pointer. Change all
15619 uses. Move comdat group support to Sized_relobj.
15620 (Relobj::is_section_specially_mapped): Remove.
15621 (Relobj::output_section): Remove poff parameter. Change all
15622 callers.
15623 (Relobj::output_section_offset): New function.
15624 (Relobj::set_section_offset): Rewrite.
15625 (Relobj::map_to_output): Remove.
15626 (Relobj::output_sections): New function.
15627 (Relobj::do_output_section_offset): New pure virtual function.
15628 (Relobj::do_set_section_offset): Likewise.
15629 (class Sized_relobj): Add section_offsets_ field. Add comdat
15630 group support from Relobj. Update declarations.
15631 (Sized_relobj::get_output_section_offset): New function.
15632 (Sized_relobj::do_output_section_offset): New function.
15633 (Sized_relobj::do_set_section_offset): New function.
15634 * object.cc (Relobj::output_section_address): Remove.
15635 (Sized_relobj::Sized_relobj): Initialize new fields.
15636 (Sized_relobj::include_section_group): Cast find_kept_object to
15637 Sized_relobj.
15638 (Sized_relobj::include_linkonce_section): Likewise.
15639 (Sized_relobj::do_layout): Use separate arrays for output section
15640 and output offset.
15641 (Sized_relobj::do_count_local_symbols): Change map_to_output to
15642 output_sections.
15643 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
15644 output_sections and section_offsets.
15645 (Sized_relobj::write_local_symbols): Likewise.
15646 (map_to_kept_section): Compute output address directly.
15647 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
15648 output_sections and section_offsets.
15649 (Sized_relobj::write_sections): Likewise.
15650 (Sized_relobj::relocate_sections): Likewise.
15651 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
15652 * output.h (class Output_reloc): Update declarations. Change
15653 u2_.relobj to Sized_relobj*.
15654 (class Output_data_reloc): Change add functions to use
15655 Sized_relobj*.
15656 * output.cc (Output_reloc::Output_reloc): Change relobj to
15657 Sized_relobj*.
15658 (Output_reloc::local_section_offset): Change return type to
15659 Elf_Addr. Use get_output_section_offset.
15660 (Output_reloc::get_address): Likewise.
15661 (Output_section::is_input_address_mapped): Don't call
15662 is_section_specially_mapped.
15663 (Output_section::output_offset): Likewise.
15664 (Output_section::output_address): Likewise.
15665 (Output_section::starting_output_address): Likewise.
15666 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
15667 parameter to Sized_relobj*.
15668 (Copy_relocs::need_copy_reloc): Likewise.
15669 (Copy_relocs::save): Likewise.
15670 * copy-relocs.h (class Copy_relocs): Update declarations.
15671 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
15672 Sized_relobj*. Change relobj_ field to Sized_relobj*.
15673 * target-reloc.h (relocate_for_relocatable): Change
15674 offset_in_output_section type to Elf_Addr. Change code that uses
15675 it as well.
15676 * layout.cc (Layout::layout): Always set *off.
15677 * mapfile.cc (Mapfile::print_input_section): Use
15678 output_section_offset.
15679 * i386.cc (Target_i386::copy_reloc): Change object parameter to
15680 Sized_relobj*.
15681 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
15682 * sparc.cc (Target_sparc::copy_reloc): Likewise.
15683 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
15684
5cb66f97
ILT
156852008-07-03 Ian Lance Taylor <iant@google.com>
15686
15687 * layout.cc (Layout::include_section): Do not discard unrecognized
15688 SHT_STRTAB sections.
15689
afe47622
CS
156902008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
15691
15692 * script.cc (Lex::can_continue_name): Make '?' allowable in
15693 version-script names.
15694 * testsuite/version_script.map: Change glob pattern to use '?'
15695
5adf9721
ILT
156962008-06-30 Manish Singh <yosh@gimp.org>
15697
15698 PR 6585
15699 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
15700 Correct typo.
15701
e6fde208
ILT
157022008-06-30 Ian Lance Taylor <iant@google.com>
15703
15704 PR 6660
15705 PR 6682
15706 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
15707 versions]: Don't try to read the value in the contents, since we
15708 don't use it. Use the template endianness when writing.
15709
3f2e6a2d
CC
157102008-06-25 Cary Coutant <ccoutant@google.com>
15711
15712 * fileread.cc (File_read::make_view): Assert on zero-length view.
15713 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
15714 symbol table when there are no symbols to read.
15715
c43d3a48
CS
157162008-06-23 Craig Silverstein <csilvers@google.com>
15717
15718 * version.cc (version_string): Bump to 1.7
15719
5f494ea0
CS
157202008-06-18 Craig Silverstein <csilvers@google.com>
15721
15722 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
15723 constant 0xFFFF to type Valtype.
15724 (Powerpc_relocate_functions::rel16_ha): Likewise.
15725
c42e122e
ILT
157262008-06-17 Ian Lance Taylor <iant@google.com>
15727
f34787f8
ILT
15728 * output.h (Output_section::Input_section): Initialize p2align_ to
15729 zero for Output_section_data constructors.
15730 (Output_section::Input_section::addralign): If not an input
15731 section, return the alignment of the Output_section_data.
15732 * testsuite/copy_test.cc: New file.
15733 * testsuite/copy_test_1.cc: New file.
15734 * testsuite/copy_test_2.cc: New file.
15735 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
15736 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
15737 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
15738 (copy_test_1_pic.o, copy_test_1.so): New targets.
15739 (copy_test_2_pic.o, copy_test_2.so): New targets.
15740 * testsuite/Makefile.in: Rebuild.
15741
c42e122e
ILT
15742 * script-sections.cc (Script_sections::place_orphan): Initialize
15743 local variable exact.
15744
ce3ac18a
DE
157452008-06-13 David Edelsohn <edelsohn@gnu.org>
15746
15747 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
15748
42cacb20
DE
157492008-06-12 David Edelsohn <edelsohn@gnu.org>
15750 David S. Miller <davem@davemloft.net>
15751
15752 * powerpc.cc: New file.
15753 * Makefile.am (TARGETSOURCES): Add powerpc.cc
15754 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
15755 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
15756 * Makefile.in: Rebuild.
15757
7b308235
ILT
157582008-06-09 Ian Lance Taylor <iant@google.com>
15759
15760 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
15761 <exception>.
15762 (throwing, orig_terminate): New static variables.
15763 (terminate_handler): New static function.
15764 (t2): Set terminate handler.
15765
f0b886e3
ILT
157662008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
15767
15768 PR 6584
cd536b21 15769 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
15770 alignment.
15771
3e90f135
CC
157722008-05-30 Cary Coutant <ccoutant@google.com>
15773
15774 * archive.cc (Archive::include_all_members) Correct to step
15775 over symbol table and extended name table in thin archives.
15776
e09ad04a
ILT
157772008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
15778
15779 PR 6407
15780 * target-reloc.h (relocate_for_relocatable): Fix new_offset
15781 calculation.
15782
62b01cb5
ILT
157832008-05-28 Caleb Howe <cshowe@google.com>
15784
15785 * reduced_debug_output.cc: New file.
15786 * reduced_debug_output.h: New file.
92de84a6 15787 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
15788 * options.cc (General_options::finalize): Add strip_debug_non_line
15789 to the strip heirarchy.
15790 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
15791 fields.
15792 * layout.cc: Include "reduced_debug_output.h".
15793 (Layout::Layout): Initialize new fields.
15794 (line_only_debug_sections): New static array.
15795 (is_lines_only_debug_sections): New static inline function.
15796 (Layout::include_section): Handle --strip-debug-non-line.
15797 (Layout::make_output_section): If --strip-debug-non-line, build
15798 new output sections for .debug_abbrev and .debug_info.
15799 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
15800 gold. Warn about possible overflow.
15801 (read_signed_LEB_128): Likewise.
15802 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
15803 (read_signed_LEB_128): Declare.
15804 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
15805 (HFILES): Add reduced_debug_output.h.
15806 * Makefile.in: Rebuild.
15807
7d9e3d98
ILT
158082008-05-21 Ian Lance Taylor <iant@google.com>
15809
15810 * mapfile.cc: New file.
15811 * mapfile.h: New file.
15812 * options.h (class General_options): Add -M/--print-map and -Map.
15813 * options.cc (General_options::finalize): Make -M equivalent to
15814 -Map -.
15815 * main.cc: Include <cstdio> and "mapfile.h".
15816 (main): Open mapfile if requested.
15817 * gold.cc (class Middle_runner): Add mapfile_ field. Update
15818 constructor. Change caller.
15819 (queue_initial_tasks): Add mapfile parameter. Change caller.
15820 (queue_middle_tasks): Likewise.
15821 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
15822 declarations.
15823 * archive.cc: Include "mapfile.h".
15824 (Archive::add_symbols): Add mapfile parameter. Change all
15825 callers. Pass mapfile, symbol, and reason to include_member.
15826 (Archive::include_all_members): Add mapfile parameter. Change all
15827 callers.
15828 (Archive::include_member): Add mapfile, sym, and why parameters.
15829 Change all callers. Report inclusion to map file.
15830 * archive.h: Include "fileread.h".
15831 (class Archive): Update declarations.
15832 (Archive::file): New const method.
15833 (class Add_archive_symbols): Add mapfile_ field. Update
15834 constructor. Change all callers.
15835 * readsyms.h (class Read_symbols): Likewise.
15836 (class Finish_group): Likewise.
15837 (class Read_script): Likewise.
15838 * common.cc: Include "mapfile.h".
15839 (Symbol_table::allocate_commons): Add mapfile parameter. Change
15840 all callers.
15841 (Symbol_table::do_allocate_commons): Likewise.
15842 (Symbol_table::do_allocate_commons_list): Likewise. Report common
15843 symbol allocation to mapfile.
15844 * common.h (class Allocate_commons_task): Add mapfile_ field.
15845 Update constructor. Change all callers.
15846 * symtab.h (class Symbol_table): Update declarations.
15847 * layout.cc: Include "mapfile.h".
15848 (Layout_task_runner::run): Print information to mapfile.
15849 (Layout::create_gold_note): Change Output_data_fixed_space to
15850 Output_data_zero_fill.
15851 (Layout::create_build_id): Likewise.
15852 (Layout::print_to_mapfile): New function.
15853 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
15854 constructor. Change caller.
15855 (class Layout): Declare print_to_mapfile.
15856 * output.cc (Output_section::Input_section::print_to_mapfile): New
15857 function.
15858 (Output_section::add_input_section): If producing a map, always
15859 add to input_sections_ list.
15860 (Output_section::do_print_to_mapfile): New function.
15861 (Output_segment::print_sections_to_mapfile): New function.
15862 (Output_segment::print_section_list_to_mapfile): New function.
15863 * output.h: Include "mapfile.h".
15864 (Output_data::print_to_mapfile): New function.
15865 (Output_data::do_print_to_mapfile): New virtual function.
15866 (Output_segment_headers::do_print_to_mapfile): New function.
15867 (Output_file_header::do_print_to_mapfile): New function.
15868 (Output_data_const::do_print_to_mapfile): New function.
15869 (class Output_data_const_buffer): Add map_name_ field. Update
15870 constructor. Change all callers. Add do_print_to_mapfile
15871 function.
15872 (class Output_data_fixed_space): Likewise.
15873 (class Output_data_space): Likewise.
15874 (class Output_data_zero_fill): New class.
15875 (Output_data_strtab::do_print_to_mapfile): New function.
15876 (Output_data_reloc_base::do_print_to_mapfile): New function.
15877 (Output_relocatable_relocs::do_print_to_mapfile): New function.
15878 (Output_data_group::do_print_to_mapfile): New function.
15879 (Output_data_got::do_print_to_mapfile): New function.
15880 (Output_data_dynamic::do_print_to_mapfile): New function.
15881 (Output_symtab_xindex::do_print_to_mapfile): New function.
15882 (class Output_section): Declare do_print_to_mapflie. Declare
15883 print_to_mapfile in Input_section.
15884 (class Output_segment): Declare new functions.
15885 * object.h (Sized_relobj::symbol_count): New function.
15886 * script-sections.cc
15887 (Output_section_element_dot_assignment::set_section_addresses):
15888 Change Output_data_fixed_space to Output_data_zero_fill.
15889 (Output_data_expression::do_print_to_mapfile): New function.
15890 * script.cc (read_input_script): Add mapfile parameter. Change
15891 all callers.
15892 * script.h (read_input_script): Update declaration.
15893 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
15894 (Eh_frame::do_print_to_mapfile): New function.
15895 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
15896 (Output_merge_string::do_print_to_mapfile): New function.
15897 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
15898 function.
15899 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
15900 function.
15901 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
15902 function.
15903 * Makefile.am (CCFILES): Add mapfile.cc.
15904 (HFILES): Add mapfile.h.
15905 * Makefile.in: Rebuild.
15906
9f1d377b
ILT
159072008-05-19 Ian Lance Taylor <iant@google.com>
15908
15909 * options.h (class General_options): Add -z relro.
15910 * layout.cc (Layout::Layout): Initialize relro_segment_.
15911 (Layout::add_output_section_data): Return the output section.
15912 (Layout::make_output_section): Rcognize relro sections and mark
15913 them appropriately.
15914 (Layout::attach_allocated_section_to_segment): Put relro sections
15915 in a PT_GNU_RELRO segment.
15916 (Layout::create_initial_dynamic_sections): Mark the .dynamic
15917 section as relro.
15918 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
15919 PT_TLS segments.
15920 (Layout::linkonce_mapping): Map d.rel.ro.local to
15921 .data.rel.ro.local.
15922 (Layout::output_section_name): Us .data.rel.ro.local for any
15923 section which begins with that.
15924 * layout.h (class Layout): Update add_output_section_data
15925 declaration. Add relro_segment_ field.
15926 * output.cc (Output_section::Output_section): Initialize is_relro_
15927 and is_relro_local_ fields.
15928 (Output_segment::add_output_section): Group relro sections.
15929 (Output_segment::is_first_section_relro): New function.
15930 (Output_segment::maximum_alignment): If there is a relro section,
15931 align the segment to the common page size.
15932 (Output_segment::set_section_addresses): Track whether we are
15933 looking at relro sections. If the last section is a relro
15934 section, align to the common page size.
15935 (Output_segment::set_section_list_addresses): Add in_relro
15936 parameter. Change all callers. Align to the page size when
15937 moving from relro to non-relro section.
15938 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
15939 segment.
15940 * output.h (class Output_section): Add is_relro_ and
15941 is_relro_local_ fields.
15942 (Output_section::is_relro): New function.
15943 (Output_section::set_is_relro): New function.
15944 (Output_section::is_relro_local): New function.
15945 (Output_section::set_is_relro_local): New function.
15946 (class Output_segment): Update declarations.
15947 * i386.cc (Target_i386::got_section): Mark .got section as relro.
15948 * sparc.cc (Target_sparc::got_section): Likewise.
15949 * x86_64.cc (Target_x86_64::got_section): Likewise.
15950 * testsuite/relro_test_main.cc: New file.
15951 * testsuite/relro_test.cc: New file.
15952 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
15953 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
15954 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
15955 (relro_test.so, relro_test_pic.o): New targets.
15956 * testsuite/Makefile.in: Rebuild.
15957
a984ee1d
ILT
159582008-05-16 Ian Lance Taylor <iant@google.com>
15959
01676dcd
ILT
15960 * output.cc (Output_segment::add_output_section): Remove front
15961 parameter.
15962 * output.h (class Output_segment): Remove
15963 add_initial_output_section and overloaded add_output_section.
15964 Update declaration of remaining add_output_section.
15965 * layout.cc (Layout::create_interp): Call add_output_section
15966 rather than add_initial_output_section.
15967 (Layout::finish_dynamic_section): Likewise.
15968
497897f9
ILT
15969 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
15970 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
15971 know the dynamic type.
15972 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
15973 field. Initialize it in constructor.
15974 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
15975 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
15976 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
15977 reloc.
15978
a984ee1d
ILT
15979 * output.cc (Output_reloc::get_address): Change return type to
15980 Elf_Addr.
15981 * output.h (class Output_reloc): Update get_address declaration.
15982 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
15983 for section addresses.
15984
55ba0940
ILT
159852008-05-09 Ian Lance Taylor <iant@google.com>
15986
15987 PR 6493
15988 * gold.cc (gold_nomem): Use return value of write.
15989
75517b77
ILT
159902008-05-08 Ian Lance Taylor <iant@google.com>
15991
15992 * symtab.c (Symbol::init_base_output_data): Add version
15993 parameter. Change all callers.
15994 (Symbol::init_base_output_segment): Likewise.
15995 (Symbol::init_base_constant): Likewise.
15996 (Symbol::init_base_undefined): Likewise.
15997 (Sized_symbol::init_output_data): Likewise.
15998 (Sized_symbol::init_output_segment): Likewise.
15999 (Sized_symbol::init_constant): Likewise.
16000 (Sized_symbol::init_undefined): Likewise.
16001 (Symbol_table::do_define_in_output_data): If the new symbol has a
16002 version, mark it as the default.
16003 (Symbol_table::do_define_in_output_segment): Likewise.
16004 (Symbol_table::do_define_as_constant): Likewise.
16005 * symtab.h (class Symbol): Update declarations.
16006 (class Sized_symbol): Likewise.
16007 * resolve.cc (Symbol::override_version): New function.
c42e122e 16008 (Symbol::override_base): Call override_version.
75517b77
ILT
16009 (Symbol::override_base_with_special): Likewise.
16010 * testsuite/ver_script_8.script: New file.
16011 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
16012 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
16013 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
16014 (ver_test_8_1.so, ver_test_8_2.so): New targets.
16015
f1f70eae
ILT
160162008-05-06 Ian Lance Taylor <iant@google.com>
16017
f3e9c5c5
ILT
16018 PR 6049
16019 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
16020 functions.
16021 (class General_options): Remove existing --undefined, and add
16022 --no-undefined instead. Add new --undefined as synonym for -u.
16023 * archive.cc (Archive::add_symbols): Check whether symbol was
16024 named with -u.
16025 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
16026 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
16027 all uses. Add IS_UNDEFINED. Update declarations to split
16028 different versions of init_base. Declare init_base_undefined.
16029 (Symbol::is_defined): Handle IS_UNDEFINED.
16030 (Symbol::is_undefined): Likewise.
16031 (Symbol::is_weak_undefined): Call is_undefined.
16032 (Symbol::is_absolute): Handle IS_CONSTANT.
16033 (class Sized_symbol): Update declarations to split different
16034 versions of init. Declare init_undefined.
16035 (class Symbol_table): Declare new functions.
16036 * symtab.cc (Symbol::init_base_object): Rename from init_base.
16037 Change all callers.
16038 (Symbol::init_base_output_data): Likewise.
16039 (Symbol::init_base_output_segment): Likewise.
16040 (Symbol::init_base_constant): Likewise.
16041 (Symbol::init_base_undefined): New function.
16042 (Sized_symbol::init_object): Rename from init. Change all
16043 callers.
16044 (Sized_symbol::init_output_data): Likewise.
16045 (Sized_symbol::init_output_segment): Likewise.
16046 (Sized_symbol::init_constant): Likewise.
16047 (Sized_symbol::init_undefined): New function.
16048 (Symbol_table::add_undefined_symbols_from_command_line): New
16049 function.
16050 (Symbol_table::do_add_undefined_symbols_from_command_line): New
16051 function.
16052 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
16053 (Symbol::output_section): Likewise.
16054 (Symbol::set_output_section): Likewise.
16055 (Symbol_table::sized_finalize_symbol): Likewise.
16056 (Symbol_table::sized_write_globals): Likewise.
16057 * resolve.cc (Symbol_table::should_override): Likewise.
16058 (Symbol::override_base_with_special): Likewise.
16059
8bdcdf2c
ILT
16060 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
16061 symbol, change it to have default visibility.
16062 * testsuite/protected_1.cc: New file.
16063 * testsuite/protected_2.cc: New file.
16064 * testsuite/protected_3.cc: New file.
16065 * testsuite/protected_main_1.cc: New file.
16066 * testsuite/protected_main_2.cc: New file.
16067 * testsuite/protected_main_3.cc: New file.
16068 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
16069 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
16070 (protected_1_LDFLAGS, protected_1_LDADD): Define.
16071 (protected_1.so): New target.
16072 (protected_1_pic.o, protected_2_pic.o): New targets.
16073 (protected_3_pic.o): New target.
16074 (check_PROGRAMS): Add protected_2.
16075 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
16076 (protected_2_LDFLAGS, protected_2_LDADD): Define.
16077 * testsuite/Makefile.in: Rebuild.
16078
2b706932
ILT
16079 * options.h (DEFINE_var): Add set_user_set_##varname__.
16080 (DEFINE_bool_alias): New macro.
16081 (class General_options): Define -Bstatic using DEFINE_bool_alias
16082 rather than DEFINE_special. Add --undefined as an alias for -z
16083 defs.
16084 * options.cc (General_options::parse_Bstatic): Remove.
16085
d82a5bcc
ILT
16086 * options.h (class General_options): Add --fatal-warnings.
16087 * main.cc (main): Implement --fatal-warnings.
16088 * errors.h (Errors::warning_count): New function.
16089
f1f70eae
ILT
16090 * options.h (class General_options): Add -Bsymbolic-functions.
16091 * symtab.h (Symbol::is_preemptible): Check for
16092 -Bsymbolic-functions.
16093
8825ac63
ILT
160942008-05-05 Ian Lance Taylor <iant@google.com>
16095
d98bc257
ILT
16096 * options.h (DEFINE_bool): For DASH_Z, create the negative option
16097 as noVARNAME rather than no-VARNAME.
16098 (class General_options): Add option -z combreloc.
16099 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
16100 get_address.
16101 (Output_reloc::sort_before) [SHT_REL]: New function.
16102 (Output_reloc::sort_before) [SHT_RELA]: New function.
16103 (class Output_data_reloc_base): Add sort_relocs_ field. Define
16104 Sort_relocs_comparison.
16105 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
16106 parameter. Change all callers.
16107 (Output_data_reloc::Output_data_reloc) [both versions]: Add
16108 sort_relocs parameter. Change all callers.
16109 * output.cc (Output_reloc::get_address): New function, broken out
16110 of write_rel.
16111 (Output_reloc::write_rel): Call it.
16112 (Output_reloc::compare): New function.
16113 (Output_data_reloc_base::do_write): Optionally sort relocs.
16114
60b2b4e7
ILT
16115 * configure.ac: If targ_extra_obj is set, link it in.
16116 * configure.tgt: Initialize all variables.
16117 (x86_64*): Set targ_extra_obj and targ_extra_size.
16118 * configure: Rebuild.
16119
8825ac63
ILT
16120 * object.cc (Sized_relobj::include_section_group): Adjust section
16121 indexes read from group data. Build vector to pass to
16122 layout_group.
16123 * layout.cc (Layout::layout_group): Add flags and shndxes
16124 parameters. Remove contents parameter. Change caller. Update
16125 explicit instantiations.
16126 * layout.h (class Layout): Update layout_group declaration.
16127 * output.cc (Output_data_group::Output_data_group): Add flags and
16128 input_shndxes parameters. Remove contents parameter. Change
16129 caller.
16130 (Output_data_group::do_write): Change input_sections_ to
16131 input_shndxes_.
16132 * output.h (class Output_data_group): Update constructor
16133 declaration. Rename input_sections_ to input_shndxes_.
16134 * testsuite/many_sections_test.cc: Add template.
16135
e94cf127
CC
161362008-04-30 Cary Coutant <ccoutant@google.com>
16137
4418b2d5
CC
16138 * target-reloc.h (relocate_section): Fix dead-pointer bug.
16139
e94cf127
CC
16140 * layout.cc (Layout::include_section): Refactored check for debug
16141 info section.
16142 (Layout::add_comdat): Add new parameters. Change type
16143 of signature parameter. Add object and shndx to signatures table.
16144 (Layout::find_kept_object): New function.
16145 * layout.h: Include <cstring>.
16146 (Layout::is_debug_info_section): New function.
16147 (Layout::add_comdat): Add new parameters.
16148 (Layout::find_kept_object): New function.
16149 (Layout::Kept_section): New struct.
16150 (Layout::Signatures): Change type of map range.
16151 * object.cc (Relobj::output_section_address): New function.
16152 (Sized_relobj::include_section_group): Add new parameters. Change
16153 calls to Layout::add_comdat. Change to build table of kept comdat
16154 groups and table mapping discarded sections to kept sections.
16155 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
16156 (Sized_relobj::do_layout): Change calls to include_section_group and
16157 include_linkonce_section.
16158 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
16159 value to zero when section is discarded.
16160 (Sized_relobj::map_to_kept_section): New function.
16161 * object.h (Relobj::output_section_address): New function.
16162 (Relobj::Comdat_group): New type.
16163 (Relobj::find_comdat_group): New function.
16164 (Relobj::Comdat_group_table): New type.
16165 (Relobj::Kept_comdat_section): New type.
16166 (Relobj::Kept_comdat_section_table): New type.
16167 (Relobj::add_comdat_group): New function.
16168 (Relobj::set_kept_comdat_section): New function.
16169 (Relobj::get_kept_comdat_section): New function.
16170 (Relobj::comdat_groups_): New field.
16171 (Relobj::kept_comdat_sections_): New field.
16172 (Symbol_value::input_value): Update comment.
16173 (Sized_relobj::map_to_kept_section) New function.
16174 (Sized_relobj::include_linkonce_section): Add new parameter.
16175 * target-reloc.h (Comdat_behavior): New type.
16176 (get_comdat_behavior): New function.
16177 (relocate_section): Add code to map a discarded section to the
16178 corresponding kept section when applying a relocation.
16179
e4e5049b
CS
161802008-04-30 Craig Silverstein <csilvers@google.com>
16181
16182 * dwarf_reader.cc (next_generation_count): New static var.
16183 (Addr2line_cache_entry): New struct.
16184 (addr2line_cache): New static var.
16185 (Dwarf_line_info::one_addr2line): Added caching.
16186 (Dwarf_line_info::clear_addr2line_cache): New function.
16187 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
16188 cache-size parameter.
16189 (Dwarf_line_info::one_addr2line_cache): New function.
16190 * symtab.cc (Symbol_table::detect_odr_violations): Pass
16191 new cache-size argument to one_addr2line(), and clear cache.
16192
d09e9154
CC
161932008-04-28 Cary Coutant <ccoutant@google.com>
16194
16195 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
16196 R_386_PC8 relocations.
16197
7ef73768
ILT
161982008-04-23 Ian Lance Taylor <iant@google.com>
16199
55438702
ILT
16200 * object.cc (Sized_relobj::include_section_group): Check for
16201 invalid section group.
16202
c165fb93
ILT
16203 * object.cc (make_elf_object): Correct test for 64-bit ELF file
16204 header size.
16205
7ef73768
ILT
16206 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
16207 than read for file header.
16208 * archive.cc (Archive::include_member): Likewise.
16209
6194aaab
L
162102008-04-23 Paolo Bonzini <bonzini@gnu.org>
16211
16212 * aclocal.m4: Regenerate.
16213 * configure: Regenerate.
16214
d491d34e
ILT
162152008-04-19 Ian Lance Taylor <iant@google.com>
16216
5ea2bac6
ILT
16217 * version.cc (version_string): Bump to 1.6.
16218
7bc3e21a
ILT
16219 * testsuite/Makefile.am (many_sections_r_test): New target.
16220 (many_sections_r_test_SOURCES): Remove.
16221 (many_sections_r_test_DEPENDENCIES): Remove.
16222 (many_sections_r_test_LDFLAGS): Remove.
16223 (many_sections_r_test_LDADD): Remove.
16224
7fcd3aa9
ILT
16225 * object.cc (Sized_relobj::do_add_symbols): Always pass
16226 local_symbol_count_ to add_from_relobj.
16227
4c94d6ae
ILT
16228 * testsuite/Makefile.am (many_sections_check.h): Only check one in
16229 every thousand variables.
16230 * testsuite/Makefile.in: Rebuild.
16231
d491d34e
ILT
16232 * object.cc (Xindex::initialize_symtab_xindex): New function.
16233 (Xindex::read_symtab_xindex): New function.
16234 (Xindex::sym_xindex_to_shndx): New function.
16235 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
16236 available.
16237 (Sized_relobj::do_initialize_xindex): New function.
16238 (Sized_relobj::do_read_symbols): Adjust section links.
16239 (Sized_relobj::symbol_section_and_value): Add is_ordinary
16240 parameter. Change all callers.
16241 (Sized_relobj::include_section_group): Adjust section links and
16242 symbol section indexes.
16243 (Sized_relobj::do_layout): Adjust section links.
16244 (Sized_relobj::do_count_local_symbols): Adjust section links and
16245 symbol section indexes.
16246 (Sized_relobj::do_finalize_local_symbols): Distinguish between
16247 ordinary and special symbols.
16248 (Sized_relobj::write_local_symbols): Add symtab_xindex and
16249 dynsym_xindex parameters. Change all callers. Adjust section
16250 links. Use SHN_XINDEX when needed.
16251 (Sized_relobj::get_symbol_location_info): Adjust section links.
16252 Don't get fooled by special symbols.
16253 * object.h (class Xindex): Define.
16254 (class Object): Add xindex_ parameter. Declare virtual functoin
16255 do_initialize_xindex.
16256 (Object::adjust_sym_shndx): New function.
16257 (Object::set_xindex): New protected function.
16258 (class Symbol_value): Add is_ordinary_shndx_ field.
16259 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
16260 (Symbol_value::value): Assert ordinary section.
16261 (Symbol_value::initialize_input_to_output_map): Likewise.
16262 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
16263 Change all callers.
16264 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
16265 all callers.
16266 (class Sized_relobj): Update declarations.
16267 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
16268 parameter. Change all callers.
16269 (Sized_relobj::adjust_shndx): New function.
16270 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
16271 field.
16272 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
16273 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
16274 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
16275 (Sized_dynobj::read_dynsym_section): Adjust section links.
16276 (Sized_dynobj::read_dynamic): Likewise.
16277 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
16278 section links.
16279 (Sized_dynobj::do_initialize_xindex): New function.
16280 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
16281 do_initialize_xindex.
16282 (Sized_dynobj::adjust_shndx): New function.
16283 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
16284 dynsym_xindex_ fields.
16285 (Layout::finalize): Add a call to set_section_indexes before
16286 creating the symtab sections.
16287 (Layout::set_section_indexes): Don't do anything if the section
16288 already has a section index.
16289 (Layout::create_symtab_sections): Add shnum parameter. Change
16290 caller. Create .symtab_shndx section if needed.
16291 (Layout::create_shdrs): Add shstrtab_section parameter. Change
16292 caller.
16293 (Layout::allocated_output_section_count): New function.
16294 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
16295 needed.
16296 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
16297 fields. Update declarations.
16298 (Layout::symtab_xindex): New function.
16299 (Layout::dynsym_xindex): New function.
16300 (class Write_symbols_task): Add layout_ field.
16301 (Write_symbols_task::Write_symbols_task): Add layout parameter.
16302 Change caller.
16303 * output.cc (Output_section_headers::Output_section_headers): Add
16304 shstrtab_section parameter. Change all callers.
16305 (Output_section_headers::do_sized_write): Store overflow values
16306 for section count and section string table section index in
16307 section header zero.
16308 (Output_file_header::do_sized_write): Check for overflow of
16309 section count and section string table section index.
16310 (Output_symtab_xindex::do_write): New function.
16311 (Output_symtab_xindex::endian_do_write): New function.
16312 * output.h (class Output_section_headers): Add shstrtab_section_.
16313 Update declarations.
16314 (class Output_symtab_xindex): Define.
16315 (Output_section::has_out_shndx): New function.
16316 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
16317 field.
16318 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
16319 Change all callers.
16320 (Sized_symbol::init): Likewise.
16321 (Symbol::output_section): Check for ordinary symbol.
16322 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
16323 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
16324 callers.
16325 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
16326 Change all callers. Simplify handling of symbols from sections
16327 not included in the link.
16328 (Symbol_table::add_from_dynobj): Handle ordinary symbol
16329 distinction.
16330 (Weak_alias_sorter::operator()): Assert that symbols are
16331 ordinary.
16332 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
16333 distinction.
16334 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
16335 parameters. Change all callers.
16336 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
16337 symbol distinction. Use SHN_XINDEX when needed.
16338 (Symbol_table::write_section_symbol): Add symtab_xindex
16339 parameter. Change all callers.
16340 (Symbol_table::sized_write_section_symbol): Likewise. Use
16341 SHN_XINDEX when needed.
16342 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
16343 declarations.
16344 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
16345 (Symbol::is_defined): Check is_ordinary.
16346 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
16347 (Symbol::is_absolute, Symbol::is_common): Likewise.
16348 (class Sized_symbol): Update declarations.
16349 (class Symbol_table): Update declarations.
16350 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
16351 parameters. Change all callers.
16352 (Sized_symbol::override): Likewise.
16353 (Symbol_table::override): Likewise.
16354 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
16355 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
16356 is_ordinary, and orig_st_shndx parameters. Change all callers.
16357 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
16358 to be in an ordinary section.
16359 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
16360 object and is_ordinary parameters. Change all callers.
16361 (Sized_dwarf_line_info::read_relocs): Add object parameter.
16362 Change all callers. Don't add undefined or non-ordinary symbols
16363 to reloc_map_.
16364 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
16365 Change all callers.
16366 * dwarf_reader.h (class Sized_dwarf_line_info): Update
16367 declarations.
16368 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
16369 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
16370 (Sized_relobj::relocate_sections): Likewise.
16371 * target-reloc.h (scan_relocs): Adjust section symbol index.
16372 (scan_relocatable_relocs): Likewise.
16373 * i386.cc (Scan::local): Check for ordinary symbols.
16374 * sparc.cc (Scan::local): Likewise.
16375 * x86_64.cc (Scan::local): Likewise.
16376 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
16377 to symbol_section_and_value.
16378 * testsuite/many_sections_test.cc: New file.
16379 * testsuite/Makefile.am (BUILT_SOURCES): Define.
16380 (check_PROGRAMS): Add many_sections_test.
16381 (many_sections_test_SOURCES): Define.
16382 (many_sections_test_DEPENDENCIES): Define.
16383 (many_sections_test_LDFLAGS): Define.
16384 (BUILT_SOURCES): Add many_sections_define.h.
16385 (many_sections_define.h): New target.
16386 (BUILT_SOURCES): Add many_sections_check.h.
16387 (many_sections_check.h): New target.
16388 (check_PROGRAMS): Add many_sections_r_test.
16389 (many_sections_r_test_SOURCES): Define.
16390 (many_sections_r_test_DEPENDENCIES): Define.
16391 (many_sections_r_test_LDFLAGS): Define.
16392 (many_sections_r_test_LDADD): Define.
16393 (many_sections_r_test.o): New target.
16394 * testsuite/Makefile.in: Rebuild.
16395
c5818ff1
CC
163962008-04-17 Cary Coutant <ccoutant@google.com>
16397
16398 * errors.cc (Errors::info): New function.
16399 (gold_info): New function.
16400 * errors.h (Errors::info): New function.
16401 * gold.h (gold_info): New function.
16402 * object.cc (Input_objects::add_object): Print trace output.
16403 * options.cc (options::parse_set): New function.
16404 (General_options::parse_wrap): Deleted.
16405 (General_options::General_options): Deleted initializer.
16406 * options.h (options::String_set): New typedef.
16407 (options::parse_set): New function.
16408 (DEFINE_set): New macro.
16409 (General_options::wrap): Changed to use DEFINE_set. Changed
16410 callers of any_wrap_symbols and is_wrap_symbol.
16411 (General_options::trace, General_options::trace_symbol):
16412 New options.
16413 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
16414 (General_options::wrap_symbols_): Deleted.
16415 * symtab.cc (Symbol_table::add_from_object): Print trace output.
16416
b5be4a7c
DM
164172008-04-17 David S. Miller <davem@davemloft.net>
16418
16419 * options.cc (General_options::parse_V): New function.
16420 * options.h: Add entries for -V and -Qy.
16421
155a0dd7
ILT
164222008-04-17 Ian Lance Taylor <iant@google.com>
16423
16424 * common.cc (Symbol_table::allocate_commons): Remove options
16425 parameter. Change caller.
16426 (Symbol_table::do_allocate_commons): Remove options parameter.
16427 Change caller. Just call do_allocate_commons_list twice.
16428 (Symbol_table::do_allocate_commons_list): New function, broken out
16429 of do_allocate_commons.
16430 * common.h (class Allocate_commons_task): Remove options_ field.
16431 Update constructor.
16432 * symtab.cc (Symbol_table::Symbol_table): Initialize
16433 tls_commons_.
16434 (Symbol_table::add_from_object): Put TLS common symbols on
16435 tls_commons_ list.
16436 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
16437 which are IN_OUTPUT_DATA.
16438 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
16439 allocate_commons and do_allocate_commons declarations. Declare
16440 do_allocate_commons_list.
16441 * gold.cc (queue_middle_tasks): Update creation of
16442 Allocate_commons_task to not pass options.
16443 * testsuite/Makefile.am (INCLUDES): Add -I.. .
16444 (TLS_TEST_C_FLAGS): New variable.
16445 (tls_test_c_pic.o): New target.
16446 (tls_test_shared.so): Link in tls_test_c_pic.o.
16447 (tls_test_c_pic_ie.o): New target.
16448 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
16449 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
16450 (tls_test_c.o): New target.
16451 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
16452 (tls_pic_test_LDADD): Likewise.
16453 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
16454 (tls_shared_gd_to_ie_test_LDADD): Likewise.
16455 (tls_test_c_gnu2.o): New target.
16456 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
16457 tls_test_c_gnu2.o.
16458 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
16459 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
16460 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
16461 * testsuite/tls_test.cc: Include "config.h".
16462 (t_last): Call t11_last.
16463 * testsuite/tls_test.h (t11, t11_last): Declare.
16464 * testsuite/tls_test_c.c: New file.
16465 * testsuite/tls_test_main.cc (thread_routine): Call t11.
16466 * configure.ac: Check for OpenMP support.
16467 * configure, config.in, Makefile.in: Rebuild.
16468 * testsuite/Makefile.in: Rebuild.
16469
edfbb029
CC
164702008-04-16 Cary Coutant <ccoutant@google.com>
16471
16472 * i386.cc (Target_i386::define_tls_base_symbol): New function.
16473 (Target_i386::tls_base_symbol_defined_): New field.
16474 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16475 (Target_i386::Scan::global): Likewise.
16476 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
16477 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
16478 (Target_x86_64::tls_base_symbol_defined_): New field.
16479 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16480 (Target_x86_64::Scan::global): Likewise.
16481
f3c69fca
CC
164822008-04-16 Cary Coutant <ccoutant@google.com>
16483
16484 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
16485 (Symbol::needs_plt_entry): Allow weak undefined symbols.
16486 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
16487 building shared libraries.
16488 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
16489 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
16490 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
16491 * testsuite/Makefile.in: Rebuild.
16492 * testsuite/weak_undef.h: New file.
16493 * testsuite/weak_undef_file1.cc: Add extra test cases.
16494 * testsuite/weak_undef_file2.cc: Likewise.
16495 * testsuite/weak_undef_test.cc: Likewise.
16496
7c414435
DM
164972008-04-16 David S. Miller <davem@davemloft.net>
16498
32b769e1
DM
16499 * sparc.cc (Target_sparc::Scan): Change from struct to class.
16500 Add issued_non_pic_error_ field. Declare check_non_pic.
16501 (Target_sparc::Scan::check_non_pic): New function.
16502 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
16503 (Target_sparc::Scan::global): Likewise.
16504
11936fb1
DM
16505 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
16506 * configure: Rebuild.
16507
7c414435
DM
16508 * options.h (DEFINE_enable): New macro.
16509 (new_dtags): New enable option.
16510 (initfirst, interpose, loadfltr, nodefaultlib,
16511 nodelete, nodlopen, nodump): New -z options.
16512 * layout.cc (Layout:finish_dynamic_section): If new
16513 dtags enabled, emit DT_RUNPATH. Also, emit a
16514 DT_FLAGS_1 containing any specified -z flags.
16515
85c7bf8b
ILT
165162008-04-16 Ian Lance Taylor <iant@google.com>
16517
12c0daef
ILT
16518 * copy-relocs.cc: New file.
16519 * copy-relocs.h: New file.
16520 * reloc.cc: Remove Copy_relocs code.
16521 * reloc.h: Likewise.
16522 * reloc-types.h (struct Reloc_types) [both versions]: Add
16523 get_reloc_addend_noerror.
16524 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
16525 variants of add_global which take an addend which must be zero.
16526 * i386.cc: Include "copy-relocs.h".
16527 (class Target_i386): Change type of copy_relocs_ to variable,
16528 update initializer.
16529 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
16530 Change all callers.
16531 (Target_i386::do_finalize_sections): Change handling of
16532 copy_relocs_.
16533 * sparc.cc: Include "copy-relocs.h".
16534 (class Target_sparc): Change type of copy_relocs_ to variable,
16535 update initializer.
16536 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
16537 Change all callers.
16538 (Target_sparc::do_finalize_sections): Change handling of
16539 copy_relocs_.
16540 * x86_64.cc: Include "copy-relocs.h".
16541 (class Target_x86_64): Change type of copy_relocs_ to variable,
16542 update initializer.
16543 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
16544 class. Change all callers.
16545 (Target_x86_64::do_finalize_sections): Change handling of
16546 copy_relocs_.
16547 * Makefile.am (CCFILES): Add copy-relocs.cc.
16548 (HFILES): Add copy-relocs.h.
16549
4f4995b6
ILT
16550 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
16551
85c7bf8b
ILT
16552 * testsuite/script_test_4.sh: Permit leading zeroes.
16553
4f2a9edd
ILT
165542008-04-15 Ian Lance Taylor <iant@google.com>
16555
e6188289
ILT
16556 * script-sections.cc (Script_sections::create_segments): Use
16557 header_size_adjustment even when there is enough room for the
16558 headers.
16559 * testsuite/script_test_4.sh: New file.
16560 * testsuite/script_test_4.t: New file.
16561 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
16562 (check_DATA): Add script_test_4.stdout.
16563 (MOSTLYCLEANFILES): Likewise.
16564 (script_test_4): New target.
16565 (script_test_4.stdout): New target.
16566 * testsuite/Makefile.in: Rebuild.
16567
4f2a9edd
ILT
16568 * sparc.cc: Add definitions for Output_data_plt_sparc class
16569 constants.
16570
f5314dd5
DM
165712008-04-14 David S. Miller <davem@davemloft.net>
16572
16573 * sparc.cc: New file.
16574 * Makefile.am (TARGETSOURCES): Add sparc.cc
16575 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
16576 * configure.tgt: Document targ_extra_size and
16577 targ_extra_big_endian. Add entries for sparc-* and
16578 sparc64-*.
16579 * configure.ac: Handle targ_extra_size and
16580 targ_extra_big_endian.
16581 * Makefile.in: Rebuild.
16582 * configure: Likewise.
16583 * po/POTFILES.in: Likewise.
16584 * po/gold.pot: Likewise.
16585
154e0e9a
ILT
165862008-04-14 Ian Lance Taylor <iant@google.com>
16587
16588 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
16589 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
16590 in the name/type/flags to section mapping. Don't call
16591 allocate_output_section.
16592 (Layout::choose_output_section): Change parameter from adjust_name
16593 to is_input_section. Don't permit input sections after sections
16594 are attached to segments. Don't call allocate_output_section.
16595 (Layout::layout_eh_frame): Call update_flags_for_input_section,
16596 not write_enable_output_section.
16597 (Layout::make_output_section): Don't push to
16598 unattached_section_list_ nor call attach_to_segment. Call
16599 attach_section_to_segment if sections are attached.
16600 (Layout::attach_sections_to_segments): New function.
16601 (Layout::attach_section_to_segment): New function.
16602 (Layout::attach_allocated_section_to_segment): Rename from
16603 attach_to_segment. Remove flags parameter.
16604 (Layout::allocate_output_section): Remove function.
16605 (Layout::write_enable_output_section): Remove function.
16606 * layout.h (class Layout): Update for above changes. Add new
16607 field sections_are_attached_.
16608 * output.h (Output_section::update_flags_for_input_section): New
16609 function.
16610 * output.cc (Output_section::add_input_section): Call
16611 update_flags_for_input_section.
16612 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
16613
009a67a2
CC
166142008-04-11 Cary Coutant <ccoutant@google.com>
16615
16616 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
16617 thought unnecessary.
16618 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
16619
759b1a24
ILT
166202008-04-11 Ian Lance Taylor <iant@google.com>
16621
16622 * output.h (class Output_section_data): Remove inline definition
16623 of set_addralign.
16624 * output.cc (Output_section_data::set_addralign): New function.
16625
c2b45e22
CC
166262008-04-11 Cary Coutant <ccoutant@google.com>
16627
16628 Add support for TLS descriptors for i386 and x86_64.
16629 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
16630 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
16631 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
16632 GOT_TYPE_TLS_DESC.
16633 (Target_i386::got_mod_index_entry): Remove unnecessary code.
16634 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
16635 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
16636 relocations.
16637 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
16638 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
16639 Fix problem with initial-exec relocations.
16640 (Target_i386::Relocate::relocate_tls): Likewise.
16641 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
16642 relaxation.
16643 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
16644 support for section-plus-offset dynamic table entries.
16645 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
16646 (Output_data_dynamic::Dynamic_entry): Add support for
16647 section-plus-offset dynamic table entries.
16648 (Output_data_dynamic::Classification): Likewise.
16649 (Output_data_dynamic::classification_): Renamed offset_.
16650 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
16651 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
16652 (Target_x86_64::make_plt_section): New function.
16653 (Target_x86_64::reserve_tlsdesc_entries): New function.
16654 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
16655 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
16656 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
16657 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
16658 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
16659 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
16660 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
16661 add extra PLT entry for TLS descriptors.
16662 (Output_data_plt_x86_64::got_): New field.
16663 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
16664 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
16665 fields.
16666 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
16667 descriptors.
16668 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
16669 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
16670 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
16671 R_386_TLS_DESC_CALL relocations.
16672 (Target_x86_64::Scan::global): Likewise.
16673 (Target_x86_64::do_finalize_sections): Add dynamic table entries
16674 for TLS descriptors.
16675 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
16676 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
16677 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
16678 GD-to-IE relaxation.
16679 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
16680 and TLS_DESCRIPTORS.
16681 * Makefile.in: Rebuild.
16682 * configure: Rebuild.
16683 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
16684 (tls_test_shared2.so): New target.
16685 (tls_shared_gd_to_ie_test_SOURCES): New variable.
16686 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
16687 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
16688 (tls_shared_gd_to_ie_test_LDADD): New variable.
16689 (tls_shared_gnu2_gd_to_ie_test): New target.
16690 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
16691 New targets.
16692 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
16693 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
16694 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
16695 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
16696 (tls_shared_gnu2_test): New target.
16697 (tls_test_gnu2_shared.so): New target.
16698 (tls_shared_gnu2_test_SOURCES): New variable.
16699 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
16700 (tls_shared_gnu2_test_LDFLAGS): New variable.
16701 (tls_shared_gnu2_test_LDADD): New variable.
16702 * testsuite/Makefile.in: Rebuild.
16703 * testsuite/Makefile.
16704
83bfb6b7
ILT
167052008-04-11 Ian Lance Taylor <iant@google.com>
16706
16707 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
16708 justsyms.t.
16709 * testsuite/Makefile.in: Rebuild.
16710
16711 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
16712 long.
16713 * testsuite/script_test_2.cc (main): Adjust test.
16714
706e1f5e
ILT
167152008-04-11 David S. Miller <davem@davemloft.net>
16716 Ian Lance Taylor <iant@google.com>
16717
16718 * options.h (General_options): Add entries for '-Y' and
16719 '-relax'.
16720 * options.cc (General_options:finalize): If -Y was used, add those
16721 entries to the library path instead of the default "/lib" and
16722 "/usr/lib".
16723
7c98e6bb
DM
167242008-04-11 David S. Miller <davem@davemloft.net>
16725
16726 * testsuite/justsyms.t: Start at 0x100.
16727 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
16728 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
16729 long.
16730 * testsuite/script_test_2.cc: Adjust string and section length
16731 checks.
7c98e6bb 16732
99a37bfd
ILT
167332008-04-09 Ian Lance Taylor <iant@google.com>
16734
2cefc357
ILT
16735 PR gold/5996
16736 * script-sections.cc (Sections_element::allocate_to_segment): Add
16737 orphan parameter.
16738 (Output_section_definition::allocate_to_segment): Likewise.
16739 (Orphan_output_section::allocate_to_segment): Likewise.
16740 (Script_sections::attach_sections_using_phdrs_clause): Don't
16741 propagate non-PT_LOAD segments to orphan sections.
16742 * testsuite/Makefile.am (script_test_3.stdout): Generate using
16743 readelf rather than objdump.
16744 * testsuite/script_test_3.sh: Adjust accordingly. Test that
16745 .interp section and PT_INTERP segment are the same size.
16746 * testsuite/Makefile.in: Rebuild.
16747
99a37bfd
ILT
16748 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
16749 aliases for symbols defined in the same object.
16750 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
16751 (weak_alias_test_SOURCES): New variable.
16752 (weak_alias_test_DEPENDENCIES): New variable.
16753 (weak_alias_test_LDFLAGS): New variable.
16754 (weak_alias_test_LDADD): New variable.
16755 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
16756 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
16757 (weak_alias_test_3.o): New target.
16758 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
16759 * testsuite/weak_alias_test_main.cc: New file.
16760 * testsuite/weak_alias_test_1.cc: New file.
16761 * testsuite/weak_alias_test_2.cc: New file.
16762 * testsuite/weak_alias_test_3.cc: New file.
16763
780e49c5
ILT
167642008-04-08 Ian Lance Taylor <iant@google.com>
16765
cdb0b8f5
ILT
16766 * options.h (class General_options): Add --noinhibit-exec option.
16767 * main.cc (main): Check --noinhibit-exec.
16768
0864d551
ILT
16769 * options.h (class General_options): Define --wrap as a special
16770 option. Add wrap_symbols_ field.
16771 (General_options::any_wrap_symbols): New function.
16772 (General_options::is_wrap_symbol): New function.
16773 * options.cc (General_options::parse_wrap): New function.
16774 (General_options::General_options): Initialize wrap_symbols_.
16775 * symtab.cc (Symbol_table::wrap_symbol): New function.
16776 (Symbol_table::add_from_object): Handle --wrap.
16777 * symtab.h (class Symbol_table): Declare wrap_symbol.
16778 * target.h (Target::wrap_char): New function.
16779 (Target::Target_info): Add wrap_char field.
16780 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
16781 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
16782 * testsuite/testfile.cc (Target_test::test_target_info):
16783 Likewise.
16784
789aa6de
ILT
16785 * errors.cc (Errors::undefined_symbol): Mention symbol version if
16786 there is one.
16787
2c38906f
ILT
16788 * layout.h (class Layout): Add added_eh_frame_data_ field.
16789 * layout.cc (Layout::Layout): Initialize new field.
16790 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
16791 output section until we find a section we merged successfully.
16792 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
16793 that the size be non-zero.
16794
780e49c5
ILT
16795 * merge.cc (Object_merge_map::get_output_offset): Remove inline
16796 qualifier.
16797
7fcd0256
ILT
167982008-04-08 Craig Silverstein <csilvers@google.com>
16799
16800 * configure.ac: Export new conditional variable HAVE_ZLIB.
16801 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
16802 on HAVE_ZLIB.
16803 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
16804 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16805
6835af53
ILT
168062008-04-07 Ian Lance Taylor <iant@google.com>
16807
e24f324c
ILT
16808 * version.cc (version_string): Set to "1.5".
16809
a036edd8
ILT
16810 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
16811 Add issued_non_pic_error_ field. Declare check_non_pic.
16812 (Target_x86_64::Scan::check_non_pic): New function.
16813 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
16814 (Target_x86_64::Scan::global): Likewise.
16815
624f8810
ILT
16816 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
16817 addend parameter. Change caller. Handle merge sections.
16818 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
16819 Address to Addend. Don't add in the result of
16820 local_section_offset, pass down the addend and use the returned
16821 value.
16822 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
16823 Update declarations of local_section_offset and symbol_value.
16824 * testsuite/two_file_test_1.cc (t18): New function.
16825 * testsuite/two_file_test_2.cc (f18): New function.
16826 * testsuite/two_file_test_main.cc (main): Call t18.
16827 * testsuite/two_file_test.h (t18, f18): Declare.
16828
6835af53
ILT
16829 * configure.ac: Don't test for objdump, c++filt, or readelf.
16830 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
16831 conditionals.
16832 (TEST_READELF): New variable.
16833 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
16834 (check_PROGRAMS): Add two_file_strip_test.
16835 (two_file_strip_test): New target.
16836 (check_PROGRAMS): Add two_file_same_shared_strip_test.
16837 (two_file_same_shared_strip_test_SOURCES): New variable.
16838 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
16839 (two_file_same_shared_strip_test_LDFLAGS): New variable.
16840 (two_file_same_shared_strip_test_LDADD): New variable.
16841 (two_file_shared_strip.so): New target.
16842 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
16843 (ver_test_5.syms, ver_test_7.syms): Likewise.
16844 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
16845 (strip_test_3.stdout): Use TEST_OBJDUMP.
16846 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16847
86925eef
CC
168482008-04-04 Cary Coutant <ccoutant@google.com>
16849
16850 * symtab.h (Symbol::is_weak_undefined): New function.
16851 (Symbol::is_strong_undefined): New function.
16852 (Symbol::is_absolute): New function.
16853 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
16854 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
16855 absolute symbols.
16856 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
16857 (weak_undef_test): New target.
16858 * testsuite/Makefile.in: Rebuild.
16859 * testsuite/weak_undef_file1.cc: New file.
16860 * testsuite/weak_undef_file2.cc: New file.
16861 * testsuite/weak_undef_test.cc: New file.
16862
126f3ece
ILT
168632008-04-03 Craig Silverstein <csilvers@google.com>
16864
16865 * compressed_output.h (class Output_compressed_section): Use
16866 unsigned buffer.
16867 * compressed_output.cc (zlib_compress): Use unsigned buffers,
16868 add zlib header.
16869 (zlib_compressed_suffix): Removed.
16870 (Output_compressed_section::set_final_data_size): Use unsigned
16871 buffers.
16872 * testsuite/Makefile.am (flagstest_compress_debug_sections):
16873 Fix linker invocation.
16874 (flagstest_o_specialfile_and_compress_debug_sections):
16875 Likewise.
16876 * testsuite/Makefile.in: Regenerated.
16877
deae2a14
DM
168782008-04-02 David S. Miller <davem@davemloft.net>
16879
16880 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
16881 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
16882
70752818
ILT
168832008-04-02 Craig Silverstein <csilvers@google.com>
16884
16885 * TODO: New file.
16886
39d0cb0e
ILT
168872008-04-02 Ian Lance Taylor <iant@google.com>
16888
16889 * fileread.cc (File_read::find_view): Add byteshift and vshifted
16890 parameters. Update for new key type to views_. Change all
16891 callers.
16892 (File_read::read): Adjust for byteshift in returned view.
16893 (File_read::add_view): New function, broken out of
16894 find_and_make_view.
16895 (File_read::make_view): New function, broken out of
16896 find_and_make_view.
16897 (File_read::find_or_make_view): Add offset and aligned
16898 parameters. Rewrite accordingly. Change all callers.
16899 (File_read::get_view): Add offset and aligned parameters. Adjust
16900 for byteshift in return value.
16901 (File_read::get_lasting_view): Likewise.
16902 * fileread.h (class File_read): Update declarations.
16903 (class File_read::View): Add byteshift_ field. Add byteshift to
16904 constructor. Add byteshift method.
16905 * archive.h (Archive::clear_uncached_views): New function.
16906 (Archive::get_view): Add aligned parameter. Change all callers.
16907 * object.h (Object::get_view): Add aligned parameter. Change all
16908 callers.
16909 (Object::get_lasting_view): Likewise.
16910
16911 * fileread.cc (File_read::release): Don't call clear_views if
16912 there are multiple objects.
16913 * fileread.h (File_read::clear_uncached_views): New function.
16914 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
16915 on the archive.
16916
a1207466
CC
169172008-03-31 Cary Coutant <ccoutant@google.com>
16918
16919 Add thin archive support.
16920 * archive.cc (Archive::armagt): New const.
16921 (Archive::setup): Remove task parameter and calls to unlock.
16922 (Archive::unlock_nested_archives): New function.
16923 (Archive::read_header): Add nested_off parameter. Change
16924 all callers.
16925 (Archive::interpret_header): Likewise.
16926 (Archive::include_all_members): Change to handle thin
16927 archives.
16928 (Archive::include_member): Likewise.
16929 * archive.h (Archive::Archive): Add new parameters and
16930 initializers.
16931 (Archive::armagt): New const.
16932 (Archive::setup): Remove task parameter.
16933 (Archive::unlock_nested_archives): New function.
16934 (Archive::read_header): Add nested_off parameter.
16935 (Archive::interpret_header): Likewise.
16936 (Archive::Nested_archive_table): New typedef.
16937 (Archive::is_thin_archive_): New field.
16938 (Archive::nested_archives_): New field.
16939 (Archive::options_): New field.
16940 (Archive::dirpath_): New field.
16941 (Archive::task_): New field.
16942 * readsyms.cc (Read_symbols::do_read_symbols): Add check
16943 for thin archives. Pass additional parameters to
16944 Archive::Archive. Unlock the archive file after calling
16945 Archive::setup.
cd536b21 16946
479f6503
ILT
169472008-03-29 Ian Lance Taylor <iant@google.com>
16948
686c8caf
ILT
16949 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
16950 version symbol to be local.
16951 * testsuite/ver_test_4.sh: New file.
16952 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
16953 (check_DATA): Add ver_test_4.syms.
16954 (ver_test_4.syms): New target.
16955 * testsuite/Makefile.in: Rebuild.
16956
ab794b6b
ILT
16957 * output.cc
16958 (Output_section::Input_section_sort_entry::has_priority): New
16959 function.
16960 (Output_section::Input_section_sort_entry::match_file_name): New
16961 function.
16962 (Output_section::Input_section_sort_entry::match_section_name):
16963 Remove.
16964 (Output_section::Input_section_sort_entry::match_section_name_prefix):
16965 Remove.
16966 (Output_section::Input_section_sort_entry::match_section_file):
16967 Remove.
16968 (Output_section::Input_section_sort_compare::operator()): Rewrite
16969 using new Input_section_sort_entry functions. Sort crtbegin and
16970 crtend first. Sort sections with no priority before sections with
16971 a priority.
16972 * testsuite/initpri1.c (d3): Check j != 4.
16973 (cd5): New constructor/destructor function.
16974 (main): Check j != 2.
16975
479f6503
ILT
16976 * symtab.cc (Symbol_table::add_from_object): If we don't use the
16977 new symbol when resolving, don't call set_is_default.
16978 * testsuite/ver_test_7.cc: New file.
16979 * testsuite/ver_test_7.sh: New file.
16980 * testsuite/Makefile.am (ver_test_7.so): New target.
16981 (ver_test_7.o): New target.
16982 (check_SCRIPTS): Add ver_test_7.sh.
16983 (check_DATA): Add ver_test_7.syms.
16984 (ver_test_7.syms): New target.
16985
2fd32231
ILT
169862008-03-28 Ian Lance Taylor <iant@google.com>
16987
16988 * layout.cc (Layout::layout): If we see an input section with a
16989 name that needs sorting, set the must_sort flag for the output
16990 section.
16991 (Layout::make_output_section): If the name of the output section
16992 indicates that it might require sorting, set the may_sort flag.
16993 * output.h (Output_section::may_sort_attached_input_sections): New
16994 function.
16995 (Output_section::set_may_sort_attached_input_sections): New
16996 function.
16997 (Output_section::must_sort_attached_input_sections): New
16998 function.
16999 (Output_section::set_must_sort_attached_input_sections): New
17000 function.
17001 (class Output_section): Declare Input_section_sort_entry. Define
17002 Input_section_sort_compare. Declare
17003 sort_attached_input_sections. Add new fields:
17004 may_sort_attached_input_sections_,
17005 must_sort_attached_input_sections_,
17006 attached_input_sections_are_sorted_.
17007 * output.cc (Output_section::Output_section): Initialize new
17008 fields.
17009 (Output_section::add_input_section): Add an entry to
17010 input_sections_ if may_sort or must_sort are true.
17011 (Output_section::set_final_data_size): Call
17012 sort_attached_input_sections if necessary.
17013 (Output_section::Input_section_sort_entry): Define new class.
17014 (Output_section::Input_section_sort_compare::operator()): New
17015 function.
17016 (Output_section::sort_attached_input_sections): New function.
17017 * configure.ac: Check whether the compiler supports constructor
17018 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
17019 * testsuite/initpri1.c: New file.
17020 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
17021 CONSTRUCTOR_PRIORITY.
17022 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
17023 (initpri1_LDFLAGS): New variable.
17024 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17025
18e6b24e
ILT
170262008-03-27 Ian Lance Taylor <iant@google.com>
17027
49bdd526
ILT
17028 * common.cc (Sort_commons::operator): Correct sorting algorithm.
17029 * testsuite/common_test_1.c: New file.
17030 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
17031 (common_test_1_SOURCES): New variable.
17032 (common_test_1_DEPENDENCIES): New variable.
17033 (common_test_1_LDFLAGS): New variable.
17034
18e6b24e
ILT
17035 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
17036 and commons_ correctly when NAME/VERSION does not override
17037 NAME/NULL.
17038 * testsuite/ver_test_6.c: New file.
17039 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
17040 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
17041 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
17042
04bf7072
ILT
170432008-03-26 Ian Lance Taylor <iant@google.com>
17044
5871526f
ILT
17045 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
17046 of an undefined symbol from a version script.
17047 * testsuite/Makefile.am (ver_test_5.so): New target.
17048 (ver_test_5.o): New target.
17049 (check_SCRIPTS): Add ver_test_5.sh.
17050 (check_DATA): Add ver_test_5.syms.
17051 (ver_test_5.syms): New target.
17052 * testsuite/ver_test_5.cc: New file.
17053 * testsuite/ver_test_5.script: New file.
17054 * testsuite/ver_test_5.sh: New file.
17055 * Makefile.in, testsuite/Makefile.in: Rebuild.
17056
04bf7072
ILT
17057 PR gold/5986
17058 Fix problems building gold with gcc 4.3.0.
17059 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
17060 (gold_error_at_location, gold_warning_at_location): Use it.
17061 * configure.ac: Check whether we can compile and use a template
17062 function with a printf attribute.
17063 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
17064 when jumping over bytes.
17065 * object.cc: Instantiate Object::read_section_data.
17066 * debug.h: Include <cstring>
17067 * dwarf_reader.cc: Include <algorithm>
17068 * main.cc: Include <cstring>.
17069 * options.cc: Include <cstring>.
17070 * output.cc: Include <cstring>.
17071 * script.cc: Include <cstring>.
17072 * script.h: Include <string>.
17073 * symtab.cc: Include <cstring> and <algorithm>.
17074 * target-select.cc: Include <cstring>.
17075 * version.cc: Include <string>.
17076 * testsuite/testmain.cc: Include <cstdlib>.
17077 * configure, config.in: Rebuild.
17078
874c5b28
ILT
170792008-03-25 Ian Lance Taylor <iant@google.com>
17080
819d6c3a
ILT
17081 * options.cc: Include "../bfd/bfdver.h".
17082 (options::help): Print bug reporting address.
17083
f4b2c6f5
ILT
17084 * version.cc (print_version): Adjust output for current value of
17085 BFD_VERSION_STRING.
17086
17087 * NEWS: New file.
17088
e96caa79
ILT
17089 * options.cc (options::help): Print list of supported targets.
17090 * target-select.h: Include <vector>.
17091 (class Target_selector): Make machine_, size_, and is_big_endian_
17092 fields const. Add bfd_name_ and instantiated_target_ fields.
17093 (Target_selector::Target_selector): Add bfd_name parameter.
17094 (Target_selector::recognize): Make non-virtual, call
17095 do_recognize.
17096 (Target_selector::recognize_by_name): Make non-virtual, call
17097 do_recognize_by_name.
17098 (Target_selector::supported_names): New function.
17099 (Target_selector::bfd_name): New function.
17100 (Target_selector::do_instantiate_target): New pure virtual
17101 function.
17102 (Target_selector::do_recognize): New virtual function.
17103 (Target_selector::do_recognize_by_name): New virtual function.
17104 (Target_selector::instantiate_target): New private function.
17105 (supported_target_names): Declare.
17106 * target-select.cc (Target_selector::Target_selector): Update for
17107 new parameter and fields.
17108 (select_target_by_name): Check that the name matches before
17109 calling recognize_by_name.
17110 (supported_target_names): New function.
17111 * i386.cc (class Target_selector_i386): Update Target_selector
17112 constructor call. Remove recognize and recognize_by_name. Add
17113 do_instantiate_target.
17114 * x86_64.cc (class Target_selector_x86_64): Likewise.
17115 * testsuite/testfile.cc (class Target_selector_test): Update for
17116 changes to Target_selector.
17117
874c5b28
ILT
17118 * README: Rewrite, with some notes on unsupported features.
17119
0a65a3a7
CC
171202008-03-24 Cary Coutant <ccoutant@google.com>
17121
17122 * i386.cc (Target_i386::Got_type): New enum declaration.
17123 (Target_i386::Scan::local): Updated callers of Output_data_got
17124 member functions.
17125 (Target_i386::Scan::global): Likewise.
17126 (Target_i386::Relocate::relocate): Likewise.
17127 (Target_i386::Relocate::relocate_tls): Likewise.
17128 * object.h (Got_offset_list): New class.
17129 (Sized_relobj::local_has_got_offset): Added got_type parameter.
17130 (Sized_relobj::local_got_offset): Likewise.
17131 (Sized_relobj::set_local_got_offset): Likewise.
17132 (Sized_relobj::local_has_tls_got_offset): Removed.
17133 (Sized_relobj::local_tls_got_offset): Removed.
17134 (Sized_relobj::set_local_tls_got_offset): Removed.
17135 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
17136 * output.cc (Output_data_got::add_global): Added got_type parameter.
17137 (Output_data_got::add_global_with_rel): Likewise.
17138 (Output_data_got::add_global_with_rela): Likewise.
17139 (Output_data_got::add_global_pair_with_rel): New function.
17140 (Output_data_got::add_global_pair_with_rela): New function.
17141 (Output_data_got::add_local): Added got_type parameter.
17142 (Output_data_got::add_local_with_rel): Likewise.
17143 (Output_data_got::add_local_with_rela): Likewise.
17144 (Output_data_got::add_local_pair_with_rel): New function.
17145 (Output_data_got::add_local_pair_with_rela): New function.
17146 (Output_data_got::add_global_tls): Removed.
17147 (Output_data_got::add_global_tls_with_rel): Removed.
17148 (Output_data_got::add_global_tls_with_rela): Removed.
17149 (Output_data_got::add_local_tls): Removed.
17150 (Output_data_got::add_local_tls_with_rel): Removed.
17151 (Output_data_got::add_local_tls_with_rela): Removed.
17152 * output.h (Output_data_got::add_global): Added got_type parameter.
17153 (Output_data_got::add_global_with_rel): Likewise.
17154 (Output_data_got::add_global_with_rela): Likewise.
17155 (Output_data_got::add_global_pair_with_rel): New function.
17156 (Output_data_got::add_global_pair_with_rela): New function.
17157 (Output_data_got::add_local): Added got_type parameter.
17158 (Output_data_got::add_local_with_rel): Likewise.
17159 (Output_data_got::add_local_with_rela): Likewise.
17160 (Output_data_got::add_local_pair_with_rel): New function.
17161 (Output_data_got::add_local_pair_with_rela): New function.
17162 (Output_data_got::add_global_tls): Removed.
17163 (Output_data_got::add_global_tls_with_rel): Removed.
17164 (Output_data_got::add_global_tls_with_rela): Removed.
17165 (Output_data_got::add_local_tls): Removed.
17166 (Output_data_got::add_local_tls_with_rel): Removed.
17167 (Output_data_got::add_local_tls_with_rela): Removed.
17168 * resolve.cc (Symbol::override_base_with_special): Removed
17169 reference to has_got_offset_ field.
17170 * symtab.cc (Symbol::init_fields): Replaced initialization
17171 of got_offset_ with got_offsets_. Removed initialization
17172 of has_got_offset_
53fcba31 17173 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
17174 (Symbol::got_offset): Likewise.
17175 (Symbol::set_got_offset): Likewise.
17176 (Symbol::has_tls_got_offset): Removed.
17177 (Symbol::tls_got_offset): Removed.
17178 (Symbol::set_tls_got_offset): Removed.
17179 (Symbol::got_offset_): Removed.
17180 (Symbol::tls_mod_got_offset_): Removed.
17181 (Symbol::tls_pair_got_offset_): Removed.
17182 (Symbol::got_offsets_): New field.
17183 (Symbol::has_got_offset): Removed.
17184 (Symbol::has_tls_mod_got_offset): Removed.
17185 (Symbol::has_tls_pair_got_offset): Removed.
17186 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
17187 (Target_x86_64::Scan::local): Updated callers of Output_data_got
17188 member functions.
17189 (Target_x86_64::Scan::global): Likewise.
17190 (Target_x86_64::Relocate::relocate): Likewise.
17191 (Target_x86_64::Relocate::relocate_tls): Likewise.
17192
bd52eafb
BE
171932008-03-25 Ben Elliston <bje@au.ibm.com>
17194
17195 * yyscript.y: Fix spelling error in comment.
17196
8b105e34
ILT
171972008-03-24 Ian Lance Taylor <iant@google.com>
17198
8ed814a9
ILT
17199 * options.h (class General_options): Define build_id option.
17200 * layout.h (class Layout): Declare write_build_id, create_note,
17201 create_build_id. Add build_id_note_ member.
17202 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
17203 "libiberty.h", "md5.h", "sha1.h".
17204 (Layout::Layout): Initialize eh_frame_data_,
17205 eh_frame_hdr_section_, and build_id_note_.
17206 (Layout::finalize): Call create_build_id.
17207 (Layout::create_note): New function, broken out of
17208 Layout::create_gold_note.
17209 (Layout::create_gold_note): Call create_note.
17210 (Layout::create_build_id): New function.
17211 (Layout::write_build_id): New function.
17212 (Close_task_runner::run): Call write_build_id.
17213
8b105e34
ILT
17214 * x86_64.cc: Correct license to GPLv3.
17215
086a1841
ILT
172162008-03-23 Ian Lance Taylor <iant@google.com>
17217
17218 * options.cc: Include "demangle.h".
17219 (parse_optional_string): New function.
17220 (parse_long_option): Handle takes_optional_argument.
17221 (parse_short_option): Update dash_z initializer. Handle
17222 takes_optional_argument.
17223 (General_options::General_options): Initialize do_demangle_.
17224 (General_options::finalize): Set do_demangle_. Handle demangling
17225 style.
17226 * options.h (parse_optional_string): Declare.
17227 (struct One_option): Add optional_arg field. Update constructor.
17228 Update call constructor calls. Add takes_optional_argument
17229 function.
17230 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
17231 (DEFINE_optional_string): Define.
17232 (General_options::demangle): Change from DEFINE_bool to
17233 DEFINE_optional_string.
17234 (General_options::no_demangle): New function.
17235 (General_options::do_demangle): New function.
17236 (General_options::set_do_demangle): New function.
17237 (General_options::execstack_status_): Move definition to end of
17238 class definition.
17239 (General_options::static_): Likewise.
17240 (General_options::do_demangle_): New field.
17241 * object.cc (big_endian>::get_symbol_location_info): Call
17242 Options::do_demangle, not Options::demangle.
17243 * symtab.cc (demangle): Likewise.
17244
cbb93e63
ILT
172452008-03-22 Ian Lance Taylor <iant@google.com>
17246
17247 * gold.h: Include <cstddef> and <sys/types.h>
17248 * options.h: Include <cstring>.
17249
ec531623
ILT
172502008-03-21 Ian Lance Taylor <iant@google.com>
17251
17252 * Added source code to GNU binutils.
752937aa 17253\f
b90efa5b 17254Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
17255
17256Copying and distribution of this file, with or without modification,
17257are permitted in any medium without royalty provided the copyright
17258notice and this notice are preserved.
17259
17260Local Variables:
17261mode: change-log
17262left-margin: 8
17263fill-column: 74
17264version-control: never
17265End:
This page took 1.112907 seconds and 4 git commands to generate.