Fix gold to group sections correctly via linker script.
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
374082df
CC
12015-06-03 Cary Coutant <ccoutant@gmail.com>
2
3 PR gold/15370
4 * script-sections.cc
5 (Output_section_element_input::set_section_addresses): When there
6 are several patterns with no sort spec, put all sections in the same
7 bin.
8 * testsuite/Makefile.am (script_test_12): New testcase.
9 (script_test_12i): New testcase.
10 * testsuite/Makefile.in: Regenerate.
11 * testsuite/script_test_12.t: New test linker script.
12 * testsuite/script_test_12i.t: New test linker script.
13 * testsuite/script_test_12a.c: New test source file.
14 * testsuite/script_test_12b.c: New test source file.
15
775ed62e
CC
162015-06-02 Cary Coutant <ccoutant@gmail.com>
17
18 * nacl.h (Sniff_file): Switch parameters to get_view to get an
19 aligned view.
20
9c7fe3c5
CC
212015-06-03 Cary Coutant <ccoutant@gmail.com>
22
23 PR gold/17819
24 * gold.cc (queue_final_tasks): When --build-id=tree, queue a
25 separate task to schedule the build id computation.
26 * layout.cc (Hash_task::Hash_task): Remove build_id_blocker,
27 add Output_file and offset.
28 (Hash_task::run): Get and release the input views.
29 (Hash_task::is_runnable): Always return NULL (always runnable).
30 (Layout::queue_build_id_tasks): Remove.
31 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
32 parameters; use them instead of class members.
33 (Build_id_task_runner::run): New function.
34 (Close_task_runner::run): Pass array_of_hashes and size_of_hashes
35 to write_build_id.
36 * layout.h (Layout::queue_build_id_tasks): Remove.
37 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
38 parameters.
39 (Layout::array_of_hashes_): Remove.
40 (Layout::size_of_array_of_hashes_): Remove.
41 (Layout::input_view_): Remove.
42 (Build_id_task_runner): New class.
43 (Close_task_runner::Close_task_runner): Add array_of_hashes and
44 size_of_hashes parameters.
45 (Close_task_runner::array_of_hashes_): New data member.
46 (Close_task_runner::size_of_hashes_): New data member.
47 * testsuite/Makefile.am
48 (flagstest_compress_debug_sections_and_build_id_tree): New test.
49 * testsuite/Makefile.in: Regenerate.
50
400f8944
RÁE
512015-06-01 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
52
53 * merge.cc (get_input_merge_map): Update for data structure change.
54 (get_or_make_input_merge_map): Update for data structure change.
55 * merge.h (Object_merge_map): Use a std::vector<std::pair>> instead of
56 a std::map. Remove first_shnum_, first_map_, second_shnum_, second_map_.
57
bbec1a5d
AM
582015-05-16 Alan Modra <amodra@gmail.com>
59
60 * reloc.cc (Sized_relobj_file::find_functions): Use function_location.
61 * powerpc.cc (Target_powerpc::do_calls_non_split): New function.
62 (addi_12_1, addis_2_12, addis_12_1, cmpld_7_12_0): New constants.
63 (lis_0): Rename from lis_0_0.
64
efc6fa12
CC
652015-04-29 Cary Coutant <cary@google.com>
66 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
67
68 * gc.h (Garbage_collection::is_section_garbage): Change Object*
69 to Relobj*.
70 (Garbage_collection::add_reference): Likewise.
71 (Garbage_collection::gc_process_relocs): Likewise. Don't push
72 object/shndx pair onto *secvec for dynamic objects. Don't follow
73 relocations pointing to dynamic objects for GC.
74 * icf.cc (Icf::find_identical_sections): Change Object* to Relobj*.
75 (Icf::unfold_section): Likewise.
76 (Icf::is_section_folded): Likewise.
77 (Icf::get_folded_section): Likewise.
78 * icf.h: (Icf::get_folded_section): Likewise.
79 (Icf::unfold_section): Likewise.
80 (Icf::is_section_folded): Likewise.
81 (Icf::section_has_function_pointers): Likewise.
82 (Icf::set_section_has_function_pointers): Likewise.
83 * object.h (Section_id): Likewise.
84 (Const_section_id): Likewise.
85 * output.cc (Output_section::update_section_layout): Likewise.
86 * output.h: (Output_section_lookup_maps::find_relaxed_input_section):
87 Likewise.
88 * plugin.cc (update_section_order): Likewise.
89 (unique_segment_for_sections): Likewise.
90 * powerpc.cc (Powerpc_relobj::add_reference): Likewise.
91 (Target_powerpc::do_gc_add_reference): Likewise.
92 (Target_powerpc::gc_process_relocs): Likewise.
93 (Target_powerpc::do_gc_add_reference): Likewise.
94 * symtab.cc (Symbol_table::is_section_folded): Likewise.
95 (Symbol_table::gc_mark_symbol): Likewise.
96 * symtab.h: (Symbol_table::is_section_folded): Likewise.
97 * target.h: (Sized_target::gc_add_reference): Likewise.
98 (Sized_target::do_gc_add_reference): Likewise.
99
f9d3ecaa
NC
1002015-04-29 Nick Clifton <nickc@redhat.com>
101
102 * po/fi.po: Updated Finnish translation.
103
faa2211d
AM
1042015-04-28 Alan Modra <amodra@gmail.com>
105
106 * powerpc.cc (Target_powerpc::do_dynsym_value): Use Address rather
107 than unsigned int for find_global_entry result temp. Compare
108 against invalid_address.
109 (Target_powerpc::do_plt_address_for_global): Likewise.
110 (Target_powerpc::Relocate::relocate): Likewise. Don't assert
111 on plt call stub existence for debug info. Do assert for plt
112 and global entry stub existence if an alloc section.
113
6ec65f28
AM
1142015-04-28 Alan Modra <amodra@gmail.com>
115
116 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
117 on missing global entry stub due to bogus debug info.
118
7a2a1c79
HS
1192015-04-27 Han Shen <shenhan@google.com>
120
121 * options.h (--fix-cortex-a53-843419): Rename option.
122 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
123 option.
124 (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
125
cfbf0e3c
RÁE
1262015-04-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
127
128 PR gold/18327
129 * output.cc (Output_section::is_input_address_mapped): Assume a missing
130 entry is mapped.
131 * testsuite/Makefile.am: Add the eh_test test.
132 * testsuite/Makefile.in: Regenerate.
133 * testsuite/eh_test_a.cc: New test.
134 * testsuite/eh_test_b.cc: New test.
135
6ec65f28
AM
1362015-04-23 Sriraman Tallam <tmsriram@google.com>
137
a100d66f
ST
138 * options.h (--weak-unresolved-symbols): New option.
139 * symtab.cc (Symbol_table::sized_write_globals): Change symbol
140 binding to weak with new option.
141 * symtab.h (is_weak_undefined): Check for new option.
142 (is_strong_undefined): Check for new option.
143 * testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
144 * testsuite/Makefile.in: Regenerate.
145 * testsuite/weak_unresolved_symbols_test.cc: New file.
146
4b889c30
IC
1472015-04-20 Ian Coolidge <icoolidge@google.com>
148
149 * symtab.cc (Symbol::should_add_dynsym_entry): Return true for
150 GNU_UNIQUE.
151
4277535c
RÁE
1522015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
153
154 * gc.cc (Garbage_collection::do_transitive_closure): Use back and
155 push_back.
156 * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
157 * object.cc (Sized_relobj_file::do_layout): Use push_back.
158 * powerpc.cc (process_gc_mark): Use push_back.
159 (Target_powerpc::do_gc_mark_symbol): Use push_back.
160 * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
161
7a2a1c79 1622015-04-16 Han Shen <shenhan@google.com>
5019d64a 163
6ec65f28
AM
164 * aarch64.cc (AArch64_insn_utilities): New utility class.
165 (AArch64_relobj::Mapping_symbol_position): New struct.
166 (AArch64_relobj::Mapping_symbol_info): New typedef.
167 (AArch64_relobj::do_count_local_symbols): New function overriding
168 parent's implementation.
169 (AArch64_relobj::mapping_symbol_info_): New member
170 (AArch64_relobj::scan_erratum_843419): New method.
171 (Target_aarch64::scan_erratum_843419_span): New method.
172 (Target_aarch64::is_erratum_843419_sequence): New method.
173 * options.h (fix_cortex_a53): New option.
5019d64a 174
a6a17750
CC
1752015-04-09 Cary Coutant <ccoutant@google.com>
176
177 * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
178 in a PIE link.
179 * testsuite/Makefile.am (tls_pie_test.sh): New test.
180 * testsuite/Makefile.in: Regenerate.
181 * testsuite/tls_pie_test.sh: New.
182
437ddf0c
CC
1832015-04-09 Cary Coutant <ccoutant@google.com>
184
185 * debug.h (DEBUG_LOCATION): New.
186 (DEBUG_ALL): Include DEBUG_LOCATION.
187 (debug_string_to_enum): Add DEBUG_LOCATION.
188 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
189 output to print correct context.
190 (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
191 up to 4 more locations at the beginning of the function.
192 * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
193 result before sorting list of line numbers.
194 * testsuite/debug_msg.sh: Allow range of line numbers for
195 canonical results on optimized code.
196
24491327
HS
1972015-04-07 HC Yen <hc.yen@mediatek.com>
198
199 Add AArch32 support for gold linker.
200 gold/
201 * arm.cc: Add V8 arch combine table.
202
7fa5525f
RÁE
2032015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
204
205 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
206
5368dcf2
RÁE
2072015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
208
209 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
210 to find by using the return value of insert.
211
9dbb4b02
RÁE
2122015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
213
214 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
215 constructor call.
216
1fa29f10
IT
2172015-04-06 Ilya Tocar <ilya.tocar@intel.com>
218
219 PR gold/17641
220 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
221 (Target_x86_64::Scan::local): Don't create GOT entry, when we
222 can convert mov to lea.
223 (Target_x86_64::Scan::global): Ditto.
224 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
225 %reg to lea foo(%rip), %reg if possible.
226 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
227 * testsuite/x86_64_mov_to_lea1.s: New.
228 * testsuite/x86_64_mov_to_lea2.s: Ditto.
229 * testsuite/x86_64_mov_to_lea3.s: Ditto.
230 * testsuite/x86_64_mov_to_lea4.s: Ditto.
231 * testsuite/x86_64_mov_to_lea.sh: Ditto.
232
39f3de7c
L
2332015-04-02 H.J. Lu <hongjiu.lu@intel.com>
234
235 * configure: Regenerated.
236
c4fc4724
IT
2372015-04-01 Ilya Tocar <ilya.tocar@intel.com>
238
239 PR gold/17640
240 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
241 (Target_i386::Scan::local): Don't create GOT entry, when we
242 can convert GOT to GOTOFF.
243 (Target_i386::Scan::global): Ditto.
244 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
245 lea foo@GOTOFF(%reg), %reg if possible.
246 * testsuite/Makefile.am (i386_mov_to_lea): New test.
247 * testsuite/i386_mov_to_lea1.s: New.
248 * testsuite/i386_mov_to_lea2.s: Ditto.
249 * testsuite/i386_mov_to_lea3.s: Ditto.
250 * testsuite/i386_mov_to_lea4.s: Ditto.
251 * testsuite/i386_mov_to_lea5.s: Ditto.
252 * testsuite/i386_mov_to_lea.sh: Ditto.
253
918357b9
L
2542015-04-01 H.J. Lu <hongjiu.lu@intel.com>
255
256 * Makefile.am (ZLIB): New.
257 (ZLIBINC): Likewise.
258 (AM_CFLAGS): Add $(ZLIBINC).
259 (AM_CXXFLAGS): Likewise.
260 (ldadd_varldadd_var): Add $(ZLIB).
261 (incremental_dump_LDADD): Likewise.
262 (dwp_LDADD): Likewise.
263 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
264 <zlib.h>.
265 (zlib_compress): Don't check HAVE_ZLIB_H.
266 (zlib_decompress): Likewise.
267 * options.h (compress_debug_sections): Likewise.
268 * configure.ac (AM_CONDITIONAL): Removed.
269 * testsuite/Makefile.am (ZLIB): New.
270 (LDADD): Add $(ZLIB).
271 Don't check HAVE_ZLIB.
272 * Makefile.in: Regenerated.
273 * config.in: Likewise.
274 * configure: Likewise.
275 * testsuite/Makefile.in: Likewise.
276
6b0ad2eb
JY
2772015-03-30 Jing Yu <jingyu@google.com>
278
279 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
280 TLSLD_ADD_DTPREL_LO12_NC.
281 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
282 _TLS_MODULE_BASE_ point to the start of tls segment.
283 (Target_aarch64::optimize_tls_reloc): Add cases for
284 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
285 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
286 (Target_aarch64::Scan::local): Likewise.
287 (Target_aarch64::Scan::global): Likewise.
288 (Target_aarch64::Relocate::relocate): Likewise.
289 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
290 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
291 relocations.
292
0916f9e7
RÁE
2932015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
294
295 * merge.cc (Object_merge_map::add_mapping): call
296 Object_merge_map::Input_merge_map::add_mapping.
297 (Object_merge_map::Input_merge_map::add_mapping): New.
298 (Output_merge_data::do_add_input_section): Call
299 get_or_make_input_merge_map before a loop.
300 (Output_merge_string<Char_type>::finalize_merged_data): Call
301 get_or_make_input_merge_map before a loop.
302 * merge.h (Object_merge_map): Make Input_merge_map public.
303 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
304 (Relobj::get_or_create_merge_map): New.
305 * object.h (Relobj::get_or_create_merge_map): New.
306
282c9750
AM
3072015-03-24 Alan Modra <amodra@gmail.com>
308
309 PR 18147
310 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
311 relocation errors for branches to strong undefined symbols.
312
67f95b96
RÁE
3132015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
314
315 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
316 (Object_merge_map::is_merge_section_for): Remove.
317 (Object_merge_map::find_merge_section): New.
318 * merge.h (Object_merge_map::is_merge_section_for): Remove.
319 (Object_merge_map::find_merge_section): New.
320 (Object_merge_map::get_input_merge_map): Add a const version.
321 * object.cc (Relobj::is_merge_section_for): Remove.
322 (Relobj::find_merge_section): New.
323 * object.h (Relobj::is_merge_section_for): Remove.
324 (Relobj::find_merge_section): New.
325 * output.cc
326 (Output_section::Input_section::is_merge_section_for): Remove.
327 (Output_section::add_merge_input_section): Don't call
328 add_merge_input_section.
329 (Output_section::find_merge_section): Return const. Use
330 object->find_merge_section.
331 (Output_section::build_lookup_maps): Don't build a map for
332 merge sections.
333 (Output_section::is_input_address_mapped): Return false if
334 section is not found.
335 (Output_section::find_starting_output_address): Use
336 find_merge_section instead of is_merge_section_for.
337 (Output_section::add_script_input_section): Don't build a map for
338 merge sections.
339 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
340 (Output_section_lookup_maps::find_merge_section): Remove.
341 (Output_section_lookup_maps::add_merge_input_section) Remove.
342 (Output_section::find_merge_section): Return const.
343
152f7024
CC
3442015-03-22 Cary Coutant <cary@google.com>
345
346 PR gold/18106
347 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
348 non-SIB form of lea, with nop after the call.
349
bccffdfd
CC
3502015-03-21 Cary Coutant <cary@google.com>
351
352 PR gold/14217
353 * output.cc (Output_segment::is_first_section_relro): Don't ignore
354 .tdata section.
355 (Output_segment::set_section_addresses): Don't align size of relro
356 segment for .tbss.
357
1c582fe7
CC
3582015-03-21 Cary Coutant <cary@google.com>
359
360 PR gold/18010
361 * stringpool.cc (Stringpool_template): Don't optimize if section
362 alignment is greater than sizeof(char).
363
410da591
CC
3642015-03-21 Cary Coutant <cary@google.com>
365
366 PR gold/18048
367 * script-c.h (script_include_directive): Add first_token parameter.
368 * script.cc (script_include_directive): Add first_token parameter, and
369 pass it to read_script_file.
370 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
371 (PARSING_MEMORY_DEF): New tokens.
372 (top): Add new productions for INCLUDE files.
373 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
374 Pass PARSING_LINKER_SCRIPT to script_include_directive.
375 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
376 (section_cmd): Pass PARSING_SECTION_CMDS.
377 (file_or_sections_cmd): Remove.
378 (memory_def): Pass PARSING_MEMORY_DEF.
379 * testsuite/Makefile.am (memory_test_2): New test.
380 * testsuite/Makefile.in: Regenerate.
381 * testsuite/memory_test_inc.t: New script file.
382 * testsuite/memory_test_inc_1.t.src: New script file.
383 * testsuite/memory_test_inc_2.t.src: New script file.
384 * testsuite/memory_test_inc_3.t.src: New script file.
385
0d5bbdb0
CC
3862015-03-21 Cary Coutant <cary@google.com>
387
388 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
389 (Sized_relobj_dwo::setup): Build compressed section map.
390 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
391 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
392 section map.
393 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
394 compressed_sections_ field.
395 (build_compressed_section_map): Take Object instead of
396 Sized_relobj_file parameter; add decompress_if_needed parameter.
397 (Sized_relobj_file::do_find_special_sections): Store compressed
398 section map in parent Object.
399 (Sized_relobj_file::do_decompressed_section_contents): Move
400 implementation to Object::decompressed_section_contents.
401 (Sized_relobj_file::do_discard_decompressed_sections): Move
402 implementation to Object::discard_decompressed_sections.
403 * object.h (build_compressed_section_map): Declare.
404 (Object::Object): Add compressed_sections_ field.
405 (Object::section_is_compressed): Move implementation here.
406 (Object::decompressed_section_contents): De-virtualize.
407 (Object::discard_decompressed_sections): De-virtualize.
408 (Object::do_section_is_compressed): Delete.
409 (Object::do_decompressed_section_contents): Delete.
410 (Object::set_compressed_sections): New method.
411 (Object::compressed_sections): New method.
412 (Object::compressed_sections_): New data member.
413 (Compressed_section_info, Compressed_section_map): Move to top of file.
414 (Sized_relobj_file::do_section_is_compressed): Delete.
415 (Sized_relobj_file::do_decompressed_section_contents): Delete.
416 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
417 (Sized_relobj_file::compressed_sections_): Move to Object class.
418
bd9e0d46
CC
4192015-03-21 Cary Coutant <ccoutant@google.com>
420
421 PR gold/18152
422 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
423 deferred objects.
424
943c8b43
CC
4252015-03-11 Cary Coutant <ccoutant@google.com>
426
427 * options.cc (General_options::finalize): Don't allow -z relro
428 with incremental linking.
429 * testsuite/Makefile.am (incremental_test): Add -z norelro.
430 (incremental_test_2): Likewise.
431 (incremental_test_3): Likewise.
432 (incremental_test_4): Likewise.
433 (incremental_test_5): Likewise.
434 (incremental_test_6): Likewise.
435 (incremental_copy_test): Likewise.
436 (incremental_common_test_1): Likewise.
437 (incremental_comdat_test_1): Likewise.
438 * testsuite/Makefile.in: Regenerate.
439
e1663197
CC
4402015-03-09 Cary Coutant <ccoutant@google.com>
441
442 PR gold/14675
443 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
444 return enum indicating whether .eh_frame section is empty, optimizable,
445 unrecognized, or an end marker. Adjust explicit instantiations.
446 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
447 (Eh_frame::add_ehframe_input_section): Change return type.
448 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
449 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
450 to the .eh_frame output section until we see the end marker.
451 (Layout::finalize_eh_frame_section): New.
452 * layout.h: (Layout::finalize_eh_frame_section): New.
453
beb8418f
L
4542015-03-05 H.J. Lu <hongjiu.lu@intel.com>
455
456 * output.cc (Relobj::initialize_input_to_output_map<size>):
457 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
458
48c73428
CC
4592015-03-04 Cary Coutant <ccoutant@google.com>
460
461 * parameters.cc (Parameters::set_target_once): Call
462 Target::select_as_default_target just once from here...
463 (set_parameters_target): ...instead of from here.
464
4652015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
dbe40a88
RÁE
466
467 * ehframe.cc (Cie::set_output_offset): Pass in and use a
468 Output_section_data instead of a Merge_map.
469 (Eh_frame::Eh_frame): Don't initialize merge_map_.
470 (Eh_frame::read_cie): Use add_merge_mapping instead of
471 Merge_map::add_mapping.
472 (Eh_frame::read_fde): Ditto.
473 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
474 (Eh_frame::do_output_offset): Use merge_output_offset istead of
475 merge_map_->get_output_offset.
476 (Eh_frame::do_is_merge_section_for): Delete.
477 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
478 instead of a Merge_map.
479 (Cie::set_output_offset): Pass in a Output_section_data instead of a
480 Merge_map.
481 (Eh_frame::do_is_merge_section_for): Delete.
482 (Eh_frame::merge_map_): Delete.
483 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
484 and use a Output_section_data instead of a Merge_map.
485 (Object_merge_map::add_mapping): Ditto.
486 (Object_merge_map::get_output_offset): Remove the merge_map argument.
487 (Object_merge_map::is_merge_section_for): Pass in and use a
488 Output_section_data instead of a Merge_map.
489 (Merge_map): Delete.
490 (Output_merge_base::do_output_offset): Use merge_output_offset instead
491 of merge_map_.get_output_offset.
492 (Output_merge_base::do_is_merge_section_for): Delete.
493 (Output_merge_data::do_add_input_section): Use
494 object->add_merge_mapping instead of add_mapping.
495 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
496 * merge.h (Merge_map): Delete forward declaration.
497 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
498 instead of a Merge_map.
499 (Object_merge_map::get_output_offset): Remove the merge_map argument.
500 (Object_merge_map::is_merge_section_for): Pass in and use a
501 Output_section_data instead of a Merge_map.
502 (Input_merge_map::Object_merge_map::merge_map): Replace with
503 output_data.
504 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
505 Output_section_data instead of a Merge_map.
506 (Merge_map): Delete.
507 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
508 (Output_merge_base::do_is_merge_section_for): Delete.
509 (Output_merge_base::add_mapping): Delete.
510 (Output_merge_base::merge_map_): Delete.
511 * object.cc (Relobj::initialize_input_to_output_map): New.
512 (Relobj::initialize_input_to_output_map): New.
513 (Relobj::merge_output_offset): New.
514 (Relobj::is_merge_section_for): New.
515 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
516 bits.
517 * object.h (Relobj::merge_map): Delete.
518 (initialize_input_to_output_map): New.
519 (set_merge_map): Delete.
520 (add_merge_mapping): New.
521 (merge_output_offset): New.
522 (is_merge_section_for): New.
523 * output.cc (Output_section::Input_section::is_merge_section_for):
524 Use object->is_merge_section_for.
525 * output.h (Output_section_data::is_merge_section_for): Delete.
526 (Output_section_data::do_is_merge_section_for): Delete.
527 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
528 Use object->initialize_input_to_output_map.
529 (Merged_symbol_value<size>::value_from_output_section): Use
530 object->merge_output_offset.
531
48c73428 5322015-03-02 Peter Collingbourne <pcc@google.com>
2c7b626c
CC
533 Cary Coutant <ccoutant@google.com>
534
535 * output.cc (Output_section::add_merge_input_section): Do not
536 attempt to merge sections with an entsize of 0.
537
48c73428 5382015-03-02 Khem Raj <raj.khem@gmail.com>
5b07cd84
CC
539
540 * attributes.h (class Output_attributes_section_data ): Add
541 do_print_to_mapfile function.
542
ec86f434
AM
5432015-02-24 Alan Modra <amodra@gmail.com>
544
545 PR 18010
546 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
547 complain if value is not a multiple of four.
548 (Target_powerpc::Relocate::relocate): Correct handling of
549 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
550
be66981e
L
5512015-02-21 H.J. Lu <hongjiu.lu@intel.com>
552
553 * configure.ac (default_size): Set to 32 for x32.
554 * configure: Regenerated.
555
e3ee8ed4
AM
5562015-02-18 Alan Modra <amodra@gmail.com>
557
558 PR 17954
559 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
560 visibility.
561
3a935c6c
RÁE
5622015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
563
564 * gc.h (Garbage_collection::add_reference): Don't use find.
565
e0a1e121
RÁE
5662015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
567
568 * object.cc (write_local_symbols): avoid std::vector copy.
569
45a4fb1a
RÁE
5702015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
571
572 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
573
2d9afefe
MW
5742015-02-09 Mark Wielaard <mjw@redhat.com>
575
576 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
577 DW_LANG_Fortran03 and DW_LANG_Fortran08.
578
e9c1bdad
CC
5792015-02-16 Cary Coutant <ccoutant@google.com>
580
581 PR gold/13577
582 PR gold/16992
583 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
584 DF_SYMBOLIC if --dynamic-list option is used.
585 * options.cc (General_options::finalize): --dynamic-list is not
586 mutually exclusive with -Bsymbolic.
587 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
588 listed in --dynamic-list.
589 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
590 -Bsymbolic-functions.
591 * testsuite/Makefile.in: Regenerate.
592
0ed4b0bf
CC
5932015-02-16 Cary Coutant <ccoutant@google.com>
594
595 PR gold/17971
596 * incremental.cc: Remove redundant include of "output.h".
597
1a920511
JY
5982015-02-12 Jing Yu <jingyu@google.com>
599
600 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
601 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
602 New relocation.
603 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
604 TLSLE_MOVW_* relocations.
605 (Target_aarch64::Scan::global): Likewise.
606 (Target_aarch64::Relocate::relocate): Likewise.
607 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
608 for new TLSLE_MOVW_* relocations.
609
07f107f3
WN
6102015-02-11 Will Newton <will.newton@linaro.org>
611
612 PR gold/13321
613 * arm.cc (Target_arm::make_plt_section): Create an ARM
614 state mapping symbol at the start of the PLT.
615
e051a5b5
L
6162015-02-09 H.J. Lu <hongjiu.lu@intel.com>
617
618 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
619 Replace two_file_shared_2.so with two_file_shared_1.so.
620 * testsuite/Makefile.in: Regenerated.
621
dddcc5b9
AM
6222015-02-09 Alan Modra <amodra@gmail.com>
623
624 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
625 plugin_test_thin.a and defsym_test.
626 * testsuite/Makefile.in: Regenerate.
627
b39b8b9d
RÁE
6282015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
629
630 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
631 body.
632
b66d1c52
CC
6332015-02-04 Peter Collingbourne <pcc@google.com>
634
635 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
636 forwarding symbols when computing symbol resolution info for plugins.
637 * plugin.h (Plugin_manager::symtab): New method.
638 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
639
23081de0
CC
6402015-02-03 Cary Coutant <ccoutant@google.com>
641 Peter Collingbourne <pcc@google.com>
642
643 PR gold/15660
644 * archive.cc (Thin_archive_object_unlocker): New class.
645 (Archive::include_member): Unlock external members of thin archives.
646 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
647 (plugin_test_2): Likewise.
648 (plugin_test_3): Likewise.
649 (plugin_test_4): Likewise.
650 (plugin_test_5): Likewise.
651 (plugin_test_6): Likewise.
652 (plugin_test_7): Likewise.
653 (plugin_test_8): Likewise.
654 (plugin_test_9): Likewise.
655 (plugin_test_10): Likewise.
656 (plugin_test_11): New test case.
657 * testsuite/Makefile.in: Regenerate.
658 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
659 file to decide whether to claim file.
660 (all_symbols_read_hook): Likewise.
661 * testsuite/plugin_test_1.sh: Adjust expected output.
662 * testsuite/plugin_test_2.sh: Likewise.
663 * testsuite/plugin_test_3.sh: Likewise.
664 * testsuite/plugin_test_6.sh: Likewise.
665 * testsuite/plugin_test_tls.sh: Likewise.
666 * testsuite/plugin_test_11.sh: New testcase.
667
6682015-02-03 Cary Coutant <ccoutant@google.com>
669
670 * descriptors.cc (Descriptors::open): Set artificially-low limit for
671 file descriptors when debugging enabled. Add debug output.
672 (Descriptors::release): Add debug output.
673 (Descriptors::close_some_descriptor): Likewise.
674 (Descriptors::close_all): Likewise.
675 * fileread.cc (File_read::lock): Likewise.
676 (File_read::unlock): Likewise.
677
24dd5808
CC
6782015-02-02 Cary Coutant <ccoutant@google.com>
679
680 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
681 executable output file.
682
fa89cc82
HS
6832015-01-22 Han Shen <shenhan@google.com>
684
685 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
686 (Target_arm::do_plt_address_for_global): New method.
687 (Target_arm::do_plt_address_for_local): New method.
688 (Target_arm::rel_irelative_section): New method.
689 (Target_arm::make_data_plt): Add more parameters for plt ctor.
690 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
691 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
692 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
693 (Target_arm::Scan::check_non_pic): Add ifunc support.
694 (Target_arm::Scan::local): Add ifunc support.
695 (Target_arm::Scan::global): Add ifunc support.
696 (Target_arm::make_plt_section): New method.
697 (Target_arm::make_plt_entry): Change to call to make_plt_section.
698 (Target_arm::make_local_ifunc_plt_entry): New method.
699 (Target_arm::got_irelative_): New member.
700 (Target_arm::rel_irelative_): New member.
701 (Target_arm::got_section): Add creation for got_irelative_.
702 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
703 (Target_arm::Relocate::relocate): Properly set local ifunc address.
704 (Target_arm::do_dynsym_value): Properly set global ifunc address.
705 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
706 (Output_data_plt_arm::IRelative_data): New type.
707 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
708 (Output_data_plt_arm::add_entry): Add more parameters.
709 (Output_data_plt_arm::add_relocation): New method.
710 (Output_data_plt_arm::add_local_ifunc_entry): New method.
711 (Output_data_plt_arm::rel_irelative): New method.
712 (Output_data_plt_arm::entry_count): Modified.
713 (Output_data_plt_arm::address_for_global): New method.
714 (Output_data_plt_arm::address_for_local): New method.
23081de0 715gold/
fa89cc82
HS
716 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
717 (Output_data_plt_arm::insert_irelative_data): New method.
718 (Output_data_plt_arm::irelative_rel_): New member.
719 (Output_data_plt_arm::got_): New member.
720 (Output_data_plt_arm::got_irelative_): New member.
721 (Output_data_plt_arm::irelative_count_): New member.
722 (Output_data_plt_arm::IRelative_data_vec): New typedef.
723 (Output_data_plt_arm::irelative_data_vec_): New member.
724 (Output_data_plt_arm::do_write): Write out irelative entries.
725 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
726 more parameters to ctor.
727 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
728 more parameters to ctor.
729 * output.h (Output_data_reloc::add_local_relative): New method.
730 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
731
0f81d3f0
AM
7322015-01-29 Alan Modra <amodra@gmail.com>
733
734 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
735 and GOT_TLSGD to LE optimization.
736
65d92137
CC
7372015-01-28 Cary Coutant <ccoutant@google.com>
738
739 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
740 for undef TLS symbols.
741 (Target_x86_64::Relocate::relocate_tls): Likewise.
742 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
743
5485698a
CC
7442015-01-25 Cary Coutant <ccoutant@google.com>
745
746 * output.cc (Output_segment::set_section_addresses): Fix calculation
747 of size of relro segment.
748
b01a4b04
AM
7492015-01-22 Alan Modra <amodra@gmail.com>
750
751 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
752 condition for need of ifunc plt entry.
753 (Target_powerpc::Scan::global <got relocs>): Likewise.
754
3d0064a9
CC
7552015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
756
757 * mips.cc (reloc_high): Add r_sym.
758 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
759 reloc_high constructor.
760 (Mips_relocate_functions::relgot16_local): Likewise.
761 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
762 r_type to decide whether LO16 matches HI16.
763 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
764 rello16 and relgot16_local.
765
a5cd8f05
CC
7662015-01-09 Cary Coutant <ccoutant@google.com>
767
768 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
769 unless alignment is larger than page size.
770
4fc1b9d4
L
7712015-01-06 H.J. Lu <hongjiu.lu@intel.com>
772 Cary Coutant <ccoutant@google.com>
773
774 PR gold/17729
775 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
776 (DEFAULT_TARGET_X32): Set for x32.
777 * x86_64.cc (cmp_insn_32): New.
778 (lea_r10_insn_32): Likewise.
779 (lea_r11_insn_32): Likewise.
780 (cmp_insn_64): Likewise.
781 (lea_r10_insn_64): Likewise.
782 (lea_r11_insn_64): Likewise.
783 (Target_x86_64<size>::do_calls_non_split): Handle x32.
784 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
785 (check_DATA): Add split_x32 files.
786 (split_x32_[1234n].o): New targets.
787 (split_x32_[124]): New targets.
788 (split_x32_[1234r].stdout): New targets.
789 * testsuite/split_x32.sh: New file.
790 * testsuite/split_x32_1.s: Likewise.
791 * testsuite/split_x32_2.s: Likewise.
792 * testsuite/split_x32_3.s: Likewise.
793 * testsuite/split_x32_4.s: Likewise.
794 * testsuite/split_x32_n.s: Likewise.
795 * configure: Regenerated.
796 * testsuite/Makefile.in: Likewise.
797
e749cab8
L
7982015-01-06 H.J. Lu <hongjiu.lu@intel.com>
799
800 PR gold/17809
801 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
802 x32.
803
af759df0
AM
8042015-01-02 Alan Modra <amodra@gmail.com>
805
806 * version.cc (print_version): Just print current year.
807 * dwp.cc (print_version): Likewise.
808
b90efa5b
AM
8092015-01-01 Alan Modra <amodra@gmail.com>
810
811 Update year range in copyright notice of all files.
812
f12d1e8a
AM
8132014-12-25 Alan Modra <amodra@gmail.com>
814
815 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
816 new enums.
817 (Target_arm::merge_object_attributes, ): Likewise.
818
5c294fee
TG
8192014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
820
821 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
822 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
823 AEABI_VFP_args_vfp to check that.
824 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
825 value and replace hardcoded values by enum values.
826
e30880c2
CC
8272014-12-22 Cary Coutant <ccoutant@google.com>
828
829 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
830
bd040da1
L
8312014-12-20 H.J. Lu <hongjiu.lu@intel.com>
832
833 PR gold/14608
834 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
835 to "return i * i * 3;".
836
e02a4046
CC
8372014-12-16 Cary Coutant <ccoutant@google.com>
838
839 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
840 (Mapfile::print_output_data): Use current_data_size() to avoid
841 assert for sections requiring postprocessing; if address is not valid,
842 print 0.
843 (Mapfile::print_output_section): Use current_data_size(); print note
844 that addresses and sizes are before compression.
845
add6016b
L
8462014-12-14 H.J. Lu <hongjiu.lu@intel.com>
847
848 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
849 Cast current_group_size to unsigned long when reporting error.
850
0bf32ea9
JY
8512014-12-10 Jing Yu <jingyu@google.com>
852
853 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
854 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
855 Update error message.
856 (Target_aarch64::do_relax): Use absolute value of option
857 stub_group_size. Replace local variable with class member
858 stub_group_size_.
859
cbcb23fa
AM
8602014-12-04 Alan Modra <amodra@gmail.com>
861
862 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
863 addend of PLTREL24 reloc when not generating a plt stub. Make
864 max_branch_offset an "Address".
fbad6518 865 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
866 (Target_powerpc::Relocate::relocate): Likewise.
867
1611bc4a
AM
8682014-12-04 Alan Modra <amodra@gmail.com>
869
870 PR 17670
871 * symtab.cc (Symbol::set_undefined): Remove assertion.
872 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
873 on symbols defined in discarded sections, instead return false.
874 Rearrange params, update all callers.
875 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
876 branches to syms in discarded sections.
877 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
878 undefined and flag as discarded.
879 (Target_powerpc::Relocate::relocate): Localize variable.
880
4759c34e
L
8812014-12-03 H.J. Lu <hongjiu.lu@intel.com>
882
883 PR gold/17675
884 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
885 * testsuite/Makefile.in: Regenerated.
886
1f98a074
AM
8872014-12-03 Alan Modra <amodra@gmail.com>
888
889 PR 17566
890 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
891 when adding dynamic relocations against section symbols.
892
fb257835
DI
8932014-12-01 Dimitry Ivanov <dimitry@google.com>
894
895 * layout.cc (Layout::finish_dynamic_section): When '-z global'
896 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
897 * options.h (General_options): New -z option (global).
898
d8e60314
CC
8992014-12-01 Cary Coutant <ccoutant@google.com>
900
901 PR gold/17578
902 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
903 is given.
904 (Layout::create_executable_stack_info): Warn when -z noexecstack is
905 given but some inputs require executable stack.
906
982bbd97
CC
9072014-11-26 Cary Coutant <ccoutant@google.com>
908
909 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
910 .debug_str_offsets; strip .debug_gnu_pubnames and
911 .debug_gnu_pubtypes.
912 (lines_only_debug_sections): Strip all four new sections.
913
bb779192
HS
9142014-11-26 Jing Yu <jingyu@google.com>
915
916 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
917 register to be x0 when to relax TLSDESC_LD64_LO12.
918
a3e60ddb
AM
9192014-11-26 Alan Modra <amodra@gmail.com>
920
921 * powerpc.cc (struct Stub_table_owner): New.
922 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
923 unsigned int vector. Update all references.
924 (powerpc_relobj::set_stub_table): Take an unsigned int param
925 rather than a Stub_table. Update callers.
926 (Powerpc_relobj::clear_stub_table): New function.
927 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
928 stub_group_size_ vars.
929 (Target_powerpc::new_stub_table): Delete.
930 (max_branch_delta): New function, extracted from..
931 (Target_powerpc::Relocate::relocate): ..here..
932 (Target_powerpc::Branch_info::make_stub): ..and here. Return
933 status on whether stub created successfully.
934 (Stub_control::Stub_control): Add "no_size_errors" param. Move
935 default sizing to..
936 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
937 reduce on relax failure.
938 (Target_powerpc::group_sections): Add "no_size_errors" param.
939 Use stub_group_size_. Set up group info in a temp vector,
940 before building Stub_table vector. Account for input sections
941 possibly already converted to relaxed sections.
942 (Stub_table::init): Delete. Merge into..
943 (Stub_table::Stub_table): ..here.
944 (Stub_table::can_reach_stub): New function.
945 (Stub_table::add_plt_call_entry): Add "from" parameter and
946 return true iff stub could be reached.
947 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
948 param too.
949 (Stub_table::clear_stubs): Add "all" param.
950
a20605cf
AM
9512014-11-26 Alan Modra <amodra@gmail.com>
952
953 * powerpc.cc (Stub_control::set_output_and_owner): New function.
954 (Target_powerpc::group_sections): Use it.
955
43b64deb
CC
9562014-11-25 Cary Coutant <ccoutant@google.com>
957
958 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
959 (Binary_to_elf::write_symbol): Add st_size parameter.
960 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
961
c924eb67
CC
9622014-11-25 Cary Coutant <ccoutant@google.com>
963
964 PR gold/17639
965 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
966 (Sized_relobj_file::do_layout): Handle deferred sections properly
967 during GC pass 1. Don't add reloc sections to deferred list twice.
968 * object.h (Sized_relobj_file::is_deferred_layout): New function.
969 (Sized_relobj_file::is_deferred_layout_): New data member.
970
9d585188
L
9712014-11-21 H.J. Lu <hongjiu.lu@intel.com>
972
973 PR gold/17619
974 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
975 Check PC-relative offset overflow in PLT entry.
976
3ffaac20
AM
9772014-11-21 Alan Modra <amodra@gmail.com>
978
979 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
980 for undefined weaks.
981
0cfb0717
AM
9822014-11-20 Alan Modra <amodra@gmail.com>
983
984 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
985 from --stub-group-size parameter divided by 1024.
986 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
987 template parameter. Update all uses.
988 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
989 has_stub_value. Set for long branches. Don't report overflow for
990 branch to undefined weak symbols. Print info message on
991 overflowing branch to stub.
992
f9dffbf0
AM
9932014-11-20 Alan Modra <amodra@gmail.com>
994
995 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
996
e88ba8d5
L
9972014-11-13 H.J. Lu <hongjiu.lu@intel.com>
998
999 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
1000 entry for R_X86_64_GOTPLT64.
1001 (Target_x86_64<size>::Relocate::relocate): Update comments for
1002 R_X86_64_GOTPLT64.
1003
d37ffe25
ED
10042014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
1005
1006 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
1007 * plugin.h: add lock definition
1008
9726c3c1
HS
10092014-10-29 Han Shen <shenhan@google.com>
1010 Jing Yu <jingyu@google.com>
1011
1012 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
1013 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1014 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
1015 Symbol::TLS_REF.
1016 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
1017 method.
1018 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
1019 (Target_aarch64::tls_ld_to_le): New method.
1020 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
1021 for 64bit targets.
1022 (Output_data_plt_aarch64::irelative_rel_): New data member.
1023 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
1024 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
1025 (Output_data_plt_aarch64::add_relocation): New method.
1026 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
1027 offset. Add got_irelative size to got size.
1028 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
1029 type string with the new typename.
1030 (AArch64_relocate_functions::update_adr): Replace parameter x with
1031 immed.
1032 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
1033 (AArch64_relocate_functions::reloc_common): New method.
1034 (AArch64_relocate_funcsions::rela_general): Extract common part out
1035 into reloc_common method.
1036 (AArch64_relocate_functions::rela_general): Likewise.
1037 (AArch64_relocate_functions::pcrela_general): Likewise.
1038 (AArch64_relocate_functions::adr): New method.
1039 (AArch64_relocate_functions::adrp): Calculate immed before calling
1040 update_adr.
1041 (AArch64_relocate_functions::adrp): Likewise.
1042 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
1043 comparing x to 0. Calculate immed from ~x when x < 0.
1044 (Target_aarch64::optimize_tls_reloc): Add new cases for
1045 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1046 TLSLD_MOVW_DTPREL_G0_NC.
1047 (Target_aarch64::possible_function_pointer_reloc): Implement this
1048 method.
1049 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
1050 comment.
1051 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
1052 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1053 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1054 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
1055 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1056 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1057 (Target_aarch64::make_plt_entry): Call add_entry with two more
1058 parameters.
1059 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1060 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
1061 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1062 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1063 (Target_aarch64::Relocate::relocate_tls): Add cases for
1064 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1065 TLSLD_MOVW_DTPREL_G0_NC.
1066 * testsuite/icf_safe_so_test.cc: Correct test comment.
1067 * testsuite/icf_safe_test.sh: Add AArch64 arch.
1068
80272b8c
AM
10692014-10-22 Alan Modra <amodra@gmail.com>
1070
1071 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
1072 thread_starter.
1073
998a69f4
AS
10742014-10-18 Andreas Schwab <schwab@linux-m68k.org>
1075
1076 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
1077
aed56ec5
CC
10782014-10-17 Cary Coutant <ccoutant@google.com>
1079
1080 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1081 Add "typename" keyword.
1082
bb779192 10832014-10-15 Han Shen <shenhan@google.com>
83a01957
HS
1084 Jing Yu <jingyu@google.com>
1085
1086 Patch for gold aarch64 backend to support relaxation.
1087 * aarch64-reloc.def: Change format.
1088 * aarch64.cc (class Reloc_stub): New class.
1089 (class Stub_table): New class.
1090 (class AArch64_relobj): New class.
1091 (class AArch64_input_section): New class.
1092 (class AArch64_output_section): New class.
1093 (Target_aarch64::new_stub_table): New method.
1094 (Target_aarch64::new_aarch64_input_section): New method.
1095 (Target_aarch64::find_aarch64_input_section): New method.
1096 (Target_aarch64::scan_section_for_stubs): New method.
1097 (Target_aarch64::scan_reloc_section_for_stubs): New method.
1098 (Target_aarch64::relocate_stub): New method.
1099 (Target_aarch64::current_target): New method.
1100 (Target_aarch64::do_make_elf_object): New method.
1101 (Target_aarch64::do_may_relax): New method.
1102 (Target_aarch64::do_relax): New method.
1103 (Target_aarch64::group_sections): New method.
1104 (Target_aarch64::scan_reloc_for_stub): New method.
1105 (Target_aarch64::do_make_output_section): New method.
1106 (Target_aarch64::stub_tables_): New data member.
1107 (Target_aarch64::aarch64_input_section_map_): New data member.
1108 (AArch64_relocate_functions::maybe_apply_stub): New method.
1109
db4c9594
CC
11102014-09-30 Cary Coutant <ccoutant@google.com>
1111
1112 PR gold/17432
1113 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
1114
cd6da036
KC
11152014-09-30 Kito Cheng <kito@0xlab.org>
1116
1117 PR gold/13597
1118 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
1119 hash table before sysv-style hash table.
1120
5f772412
ST
11212014-09-29 Sriraman Tallam <tmsriram@google.com>
1122
1123 * options.h (--pic-executable): Add negative to alias to -no-pie.
1124
5efeedf6
CC
11252014-09-26 Cary Coutant <ccoutant@google.com>
1126
1127 PR gold/16773
1128 * object.cc (Sized_relobj_file): Compute value of section symbols
1129 for TLS sections the same as TLS symbols.
1130
1707f183
CC
11312014-09-25 Cary Coutant <ccoutant@google.com>
1132
1133 PR gold/17432
1134 * resolve.cc (Symbol_table::resolve): Override common placeholder
1135 symbols, but adjust sizes.
1136 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
1137 symbols to common lists.
1138
00cac886
AM
11392014-09-24 Alan Modra <amodra@gmail.com>
1140
1141 * po/POTFILES.in: Regenerate.
1142
635aa30e
CC
11432014-09-23 Taiju Tsuiki <tzik@google.com>
1144 Cary Coutant <ccoutant@google.com>
1145
71b9b91b 1146 PR gold/14860
635aa30e
CC
1147 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
1148 on input_sections_blocker.
1149 * layout.cc (Write_sections_task::locks): Unblock
1150 input_sections_blocker_.
1151 * layout.h (Write_sections_task::Write_sections_task): Add
1152 input_sections_blocker.
1153 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
1154 to DEPENDENCIES.
1155 * testsuite/Makefile.in: Regenerate.
1156
c0c71592
RÁE
11572014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1158
1159 * testsuite/Makefile.am (plugin_test_10): New test.
1160 * testsuite/Makefile.in: Regenerate
1161 * testsuite/plugin_common_test_2.c (c1): Align to 8.
1162 * testsuite/plugin_test_10.sh: New file.
1163
6168c2a1
RÁE
11642014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1165
1166 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
1167 * resolve.cc (Symbol_table::resolve): Don't override common symbols
1168 during the replacement phase.
1169
3a531937
JY
11702014-09-17 Han Shen <shenhan@google.com>
1171 Jing Yu <jingyu@google.com>
1172
1173 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
1174 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
1175 * aarch64.cc (Target_aarch64): Add data members
1176 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
1177 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
1178 constructor.
1179 (Target_aarch64::do_reloc_symbol_index): New method.
1180 (Target_aarch64::do_reloc_addend): New method.
1181 (Target_aarch64::add_tlsdesc_info): New method.
1182 (Target_aarch64::do_dynsym_value): New method.
1183 (Target_aarch64::do_make_data_plt): Add new parameters: got,
1184 got_irelative. Pass them to Output_data_plt_aarch64_standard.
1185 (Target_aarch64::make_data_plt): Add new parameters: got,
1186 got_irelative. Pass them to do_make_data_plt.
1187 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
1188 (Target_aarch64::Relocate:tls_gd_to_le): New method.
1189 (Target_aarch64::Relocate:tls_ie_to_le): New method.
1190 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
1191 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
1192 (Target_aarch64::got_tlsdesc_section): New method.
1193 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1194 (Target_aarch64::define_tls_base_symbol): New method.
1195 (Target_aarch64::reserve_tlsdesc_entries): New method.
1196 (Target_aarch64::got_mod_index_entry): New method.
1197 (Target_aarch64::rela_tlsdesc_section): New method.
1198 (Target_aarch64::rela_irelative_section): New method.
1199 (Target_aarch64::Tlsdesc_info): New struct.
1200 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
1201 relocations and tlsdesc relocations.
1202 (Target_aarch64::optimize_tls_reloc): Implement method.
1203 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
1204 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
1205 in constructor.
1206 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
1207 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
1208 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
1209 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
1210 (Output_data_plt_aarch64::rela_tlsdesc): New method.
1211 (Output_data_plt_aarch64::rela_irelative): New method.
1212 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
1213 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
1214 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
1215 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
1216 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
1217 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
1218 (Output_data_plt_aarch64_standard): New member variables:
1219 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
1220 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
1221 New parameter: got, got_irelative.
1222 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
1223 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
1224 (Output_data_plt_aarch64::do_write): Replace got_address with
1225 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
1226 (AArch64_relocate_functions::update_movnz): New method.
1227 (AArch64_relocate_functions): Correct format.
1228 (AArch64_relocate_functions::movnz): New method.
1229 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
1230 before the switch. Add new cases to switch.
00cac886 1231 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
1232 tlsgd tlsdesc cases.
1233 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
1234 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
1235 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
1236 Call reloc_name_in_error_message to print unsupported reloc.
1237 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
1238 make_data_plt.
1239 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
1240 relocs. Fill in some more dynamic tags.
1241 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
1242 Skip call tls_get_addr when tlsgd is relaxed.
1243 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
1244 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
1245 tlsdesc->ie relaxation.
1246
62661c93
SS
12472014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1248
1249 * mips.cc (Target_mips_nacl): New class.
1250 (Target_selector_mips_nacl): New class.
1251 (target_selector_mips32): Rename from target_selector_mips32be and use
1252 Target_selector_mips_nacl instead of Target_selector_mips.
1253 (target_selector_mips32el): Rename from target_selector_mips32 and use
1254 Target_selector_mips_nacl instead of Target_selector_mips.
1255 (target_selector_mips64): Rename from target_selector_mips64be and use
1256 Target_selector_mips_nacl instead of Target_selector_mips.
1257 (target_selector_mips64el): Rename from target_selector_mips64 and use
1258 Target_selector_mips_nacl instead of Target_selector_mips.
1259 (Target_mips::mips_info): Add const attribute.
1260
54674d38
CC
12612014-09-02 Cary Coutant <ccoutant@google.com>
1262
1263 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
1264 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
1265 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
1266 (Sized_incr_dynobj::do_section_name): Likewise.
1267 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
1268 (Sized_incr_dynobj::do_section_name): Likewise.
1269 * object.h (Object::section_name): Likewise.
1270 (Object::do_section_name): Likewise.
1271 (Sized_relobj_file::do_section_name): Likewise.
1272 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
1273 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
1274
9860cbcf
CC
12752014-09-02 Cary Coutant <ccoutant@google.com>
1276
1277 PR gold/17005
1278 * ehframe.cc (Fde::write): Add output_offset parameter.
1279 (Cie::write): Likewise.
1280 (Eh_frame::set_final_data_size): Account for offset within output
1281 section.
1282 (Eh_frame::do_sized_write): Likewise.
1283 * ehframe.h (Fde::write): Add output_offset parameter.
1284 (Cie::write): Likewise.
1285 * output.cc (Output_section::Input_section_sort_entry): Remove
1286 section_has_name_; add output_section_name parameter. Use
1287 output section name for non-input sections.
1288 (Output_section::Input_section_sort_entry::section_has_name): Remove.
1289 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
1290 (Output_section::Input_section_sort_compare): Remove logic for
1291 sections without names.
1292 (Output_section::Input_section_sort_init_fini_compare): Likewise.
1293 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
1294 Likewise.
1295 (Output_section::Input_section_sort_section_name_compare): Likewise.
1296
8e33481e
HS
12972014-08-29 Han Shen <shenhan@google.com>
1298 Jing Yu <jingyu@google.com>
1299
1300 * aarch64-reloc-property.cc
1301 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
1302 reference reloc property in the table.
1303 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
1304 3 other entries.
1305 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
1306 2 new overloaded methods.
1307 (Output_data_got_aarch64::do_write): Add code to write out
1308 static relocs.
1309 (class Output_data_got_aarch64::Static_reloc): New class to wrap
1310 static relocs.
1311 (Output_data_got_aarch64::static_relocs): New vector to
1312 hold static relocs.
1313 (Target_aarch64::TCB_SIZE): New const static memeber.
1314 (Target_aarch64::tcb_size): New method.
1315 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
1316 (Target_aarch64::Relocate::relocate_tls): New method.
1317 (Target_aarch64::Scan::local): Add code handling new reloc types.
1318 (Target_aarch64::Scan::global): Add code handling new reloc types.
1319
81233653
ST
13202014-08-13 Sriraman Tallam <tmsriram@google.com>
1321
1322 * options.h (-no-pie): Add option.
1323
9363c7c3
JY
13242014-08-08 Jing Yu <jingyu@google.com>
1325 Han Shen <shenhan@google.com>
1326
1327 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
1328 (DEFFILES): add aarch64-reloc.def.
1329 (TARGETSOURCES): Add aarch64-reloc-property.cc.
1330 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
1331 * Makefile.in: Regenerate.
1332 * aarch64-reloc-property.cc: New file.
1333 * aarch64-reloc-property.h: New file.
1334 * aarch64-reloc.def: New file.
1335 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
1336 with tab to make the format consistent.
1337 (Output_data_got_aarch64::symbol_table_): New method.
1338 (Target_aarch64::do_plt_address_for_global): New method.
1339 (Target_aarch64::do_plt_address_for_local): New method.
1340 (Target_aarch64::do_select_as_default_target): New method.
1341 (Target_aarch64::do_make_data_plt): New method.
1342 (Target_aarch64::make_data_plt): New method.
1343 (Output_data_plt_aarch64::has_irelative_section): New method.
1344 (Output_data_plt_aarch64::address_for_global): New method.
1345 (Output_data_plt_aarch64::address_for_local): New method.
1346 (Output_data_plt_aarch64::irelative_rel_): New parameter.
1347 (Output_data_plt_aarch64::add_entry): Implement contents.
1348 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
1349 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
1350 the got_pov entry to plt0.
1351 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
1352 Implement contents.
1353 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
1354 (AArch64_howto): New struct.
1355 (aarch64_howto[]): New static const array.
1356 (AArch64_relocate_functions): New class.
1357 (Target_aarch64::Scan::get_reference_flags): Remove method.
1358 (Target_aarch64::Scan::local): Implement to support a few relocations.
1359 (Target_aarch64::Scan::global): Implement to support a few relocations.
1360 (Target_aarch64::make_plt_section): Implement contents.
1361 (Target_aarch64::make_plt_entry): Implement contents.
1362 (Target_aarch64::do_finalize_sections): Implement contents.
1363 (Target_aarch64::Relocate::relocate): Implement a few relocations.
1364 (Target_aarch64::relocate_section): Implement contents.
1365
ad9fe6c1
AM
13662014-08-06 Alan Modra <amodra@gmail.com>
1367
1368 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
1369
7cd4e5b7
AM
13702014-08-06 Alan Modra <amodra@gmail.com>
1371
1372 PR 13227
1373 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
1374
5ad9b0a7
ST
13752014-07-21 Sriraman Tallam <tmsriram@google.com>
1376
1377 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 1378 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 1379
e051745c
CC
13802014-07-08 Cary Coutant <ccoutant@google.com>
1381
1382 * expression.cc (struct Expression::Expression_eval_info): Add
1383 new fields type_pointer, vis_pointer, and nonvis_pointer.
1384 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
1385 nonvis_pointer parameters. Adjust all calls.
1386 (Symbol_expression::value): Update type, visibility, and nonvis bits
1387 in caller.
1388 * script.cc (Symbol_assignment::sized_finalize): Update type,
1389 visibility, and remaining st_other bits for new symbol.
1390 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
1391 vis_pointer, and nonvis_pointer parameters.
1392 * symtab.h (Symbol::set_type): New method.
1393
1394 * testsuite/Makefile.am (defsym_test): New test.
1395 * testsuite/Makefile.in: Regenerate.
1396 * testsuite/defsym_test.c: New file.
1397 * testsuite/defsym_test.sh: New file.
1398
f35c4853
CC
13992014-07-08 Cary Coutant <ccoutant@google.com>
1400
1401 PR gold/15639
1402 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
1403 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
1404 (Sized_dynobj::base_read_symbols): ...new method.
1405 * object.h (Sized_relobj_file::base_read_symbols): New method.
1406 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
1407 (Sized_relobj_file::base_read_symbols): ...new method.
1408 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
1409 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
1410 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
1411
2900af2d
AM
14122014-07-04 Alan Modra <amodra@gmail.com>
1413
1414 * po/POTFILES.in: Regenerate.
1415
053a4d68
JY
14162014-07-02 Jing Yu <jingyu@google.com>
1417
1418 * aarch64.cc: New file
1419 * Makefile.am (TARGETSOURCES): Add aarch64.cc
1420 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
1421 * Makefile.in: Regenerate.
1422 * configure.tgt: Add entries for aarch64*.
1423 * configure.ac: Likewise.
1424 * configure: Likewise.
1425
7b549045
AM
14262014-06-27 Alan Modra <amodra@gmail.com>
1427
1428 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
1429
cb818dbf
CC
14302014-06-24 Cary Coutant <ccoutant@google.com>
1431
1432 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
1433 sections.
1434 (Dwo_file::sized_read_unit_index): Likewise.
1435
9810d34d
SS
14362014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1437
1438 * mips.cc: New file.
1439 * Makefile.am (TARGETSOURCES): Add mips.cc
1440 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
1441 * configure.tgt: Add entries for mips*.
1442 * configure.ac: Likewise.
1443 * Makefile.in: Regenerate.
1444 * configure: Likewise.
1445
9baa787b
CC
14462014-06-09 Cary Coutant <ccoutant@google.com>
1447
1448 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
1449 unit_length is within section bounds.
1450
8f89af0a
CC
14512014-06-09 Cary Coutant <ccoutant@google.com>
1452
1453 PR gold/16980
1454 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
1455 map.
1456
a47622ac
AM
14572014-06-07 Alan Modra <amodra@gmail.com>
1458
1459 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
1460
4320c691
CC
14612014-06-06 Cary Coutant <ccoutant@google.com>
1462
1463 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
1464 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
1465 (Dwarf_pubnames_table::read_header): Likewise.
1466 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
1467 .debug_gnu_pubtypes.
1468
270c9937
JB
14692014-06-05 Joel Brobecker <brobecker@adacore.com>
1470
1471 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
1472 * Makefile.in, configure: Regenerate.
1473
397998fc
AM
14742014-06-03 Alan Modra <amodra@gmail.com>
1475
1476 * powerpc.cc (addis_12_2): Define.
1477 (Stub_table::do_write): Support fusion on ELFv2 stubs.
1478
61f5c66f
AM
14792014-06-03 Alan Modra <amodra@gmail.com>
1480
1481 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
1482 st_other output.
1483
f6971787
AM
14842014-06-02 Alan Modra <amodra@gmail.com>
1485
1486 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
1487 Only ignore relocs on ELFv1.
1488 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
1489
f6fb8322
CC
14902014-05-30 Cary Coutant <ccoutant@google.com>
1491
1492 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
1493 * testsuite/Makefile.in: Regenerate.
1494 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
1495
c23dd342
L
14962014-05-27 H.J. Lu <hongjiu.lu@intel.com>
1497
1498 PR gold/16945
1499 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
1500 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
1501
5fe7ffdc
AM
15022014-05-15 Alan Modra <amodra@gmail.com>
1503
1504 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
1505 Compare FDE contents with DW_CFA_nop rather than 0.
1506
a82bef93
ST
15072014-05-13 Sriraman Tallam <tmsriram@google.com>
1508
1509 * symtab.h (may_need_copy_reloc): Remove check for position independent
1510 code.
1511 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
1512 position independence before pc absolute may_need_copy_reloc call.
1513 Add check for executable output befor pc relative may_need_copy_reloc
1514 call.
1515 * i386.cc: Ditto.
1516 * arm.cc: Ditto.
1517 * sparc.cc: Ditto.
1518 * tilegx.cc: Ditto.
1519 * powerpc.cc: Add check for no position independence before
1520 may_need_copy_reloc calls.
1521 * testsuite/pie_copyrelocs_test.cc: New file.
1522 * testsuite/pie_copyrelocs_shared_test.cc: New file.
1523 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 1524 * Makefile.in: Regenerate.
a82bef93 1525
53c66605
ML
15262014-05-08 Martin Liška <mliska@suse.cz>
1527
1528 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
1529
57b2284c
CC
15302014-05-06 Cary Coutant <ccoutant@google.com>
1531
1532 PR gold/16900
1533 * i386.cc (Output_data_got_plt_i386): New class.
1534 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
1535 parameter. Change all callers.
1536 (Output_data_plt_i386::layout_): Remove.
1537 (Output_data_plt_i386::got_plt_): Change type.
1538 (Target_i386::got_plt_): Change type. Change all references.
1539 (Target_i386::got_section): Create instance of new class.
1540 (Output_data_got_plt_i386::do_write): New function.
1541 * x86_64.cc (Output_data_got_plt_x86_64): New class.
1542 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
1543 parameter. Change all callers.
1544 (Output_data_plt_x86_64::layout_): Remove.
1545 (Output_data_plt_x86_64::got_plt_): Change type.
1546 (Target_x86_64::got_plt_): Change type. Change all references.
1547 (Target_x86_64::got_section): Create instance of new class.
1548 (Output_data_got_plt_x86_64::do_write): New function.
1549 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
1550 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
1551 class.
1552
6b97515d 15532014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 1554
6b97515d
CC
1555 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
1556 if we have pubnames/pubtypes.
1557
d1bddd3c
CC
15582014-05-02 Cary Coutant <ccoutant@google.com>
1559
5fe7ffdc
AM
1560 * defstd.cc (in_segment): Define __ehdr_start here...
1561 * layout.cc (Layout::finalize): ...Instead of here. Set the
1562 output segment when known.
1563 * resolve.cc (Symbol::override_base_with_special): Remember
1564 the original binding.
1565 * symtab.cc (Symbol::set_output_segment): New function.
1566 (Symbol::set_undefined): New function.
1567 * symtab.h (Symbol::is_weak_undefined): Check original undef
1568 binding.
1569 (Symbol::is_strong_undefined): New function.
1570 (Symbol::set_output_segment): New function.
1571 (Symbol::set_undefined): New function.
1572 * target-reloc.h (is_strong_undefined): Remove.
1573 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
1574 Check for hidden undefs.
1575 (relocate_section): Call Symbol::is_strong_undefined.
1576
1577 * testsuite/Makefile.am (ehdr_start_test_1)
1578 (ehdr_start_test_2, ehdr_start_test_3)
1579 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
1580 * testsuite/Makefile.in: Regenerate.
1581 * testsuite/ehdr_start_def.cc: New source file.
1582 * testsuite/ehdr_start_test.cc: New source file.
1583 * testsuite/ehdr_start_test.t: New linker script.
1584 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 1585
7849f6d8
CC
15862014-04-23 Cary Coutant <ccoutant@google.com>
1587
bf2cc635 1588 PR gold/16870
7849f6d8
CC
1589 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
1590
99fd8cff
CC
15912014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1592
1593 * layout.cc (Layout::include_section): Allow a target to decide
1594 whether to include a section.
1595 * target.h (Target::should_include_section): New function.
1596 (Target::do_should_include_section): New function.
1597
91f43acd
CC
15982014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1599
1600 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
1601 inline into ...
1602 (Copy_relocs::emit): ... here.
1603 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
1604 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
1605 (Copy_reloc_entry::entries_): Change from private to protected.
1606
c4eb27e1
ST
16072014-04-02 Sriraman Tallam <tmsriram@google.com>
1608
1609 * icf.cc (get_section_contents): Replace copies of reloc
1610 vectors with const references.
1611
ae447ddd
CC
16122014-04-02 Cary Coutant <ccoutant@google.com>
1613
1614 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
1615 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
1616 * configure: Regenerate.
1617 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
1618 -fno-use-linker-plugin.
1619 (LINK1, CXXLINK1): Add it to the link command.
1620 * testsuite/Makefile.in: Regenerate.
1621
fa47fa92
AM
16222014-03-12 Alan Modra <amodra@gmail.com>
1623
1624 * Makefile.in: Regenerate.
1625
9b12c500
CC
16262014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1627
1628 * symtab.h (Symbol::set_nonvis): New function.
1629
beacaa96
CC
16302014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1631
1632 * symtab.cc (Sized_symbol<32>::init_output_data):
1633 Instantiate the template.
1634 (Sized_symbol<64>::init_output_data): Likewise.
1635
800d9823
CC
16362014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1637
1638 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
1639 adjust dynamic symbol value.
1640 * target.h (Target::adjust_dyn_symbol): New function.
1641 (Target::do_adjust_dyn_symbol): New function.
1642
918fc1f8 16432014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 1644
918fc1f8
CC
1645 * output.cc (Output_data_dynamic::Dynamic_entry::write):
1646 Get the value of DYNAMIC_CUSTOM dynamic entry.
1647 * output.h (Output_data_dynamic::add_custom): New function.
1648 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
1649 dynamic entry.
1650 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
1651 * target.h (Target::dynamic_tag_custom_value): New function.
1652 (Target::do_dynamic_tag_custom_value): New function.
1653
98ff9231
CC
16542014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1655
1656 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
1657 dynsym indexes.
1658 * target.h (Target::has_custom_set_dynsym_indexes): New function.
1659 (Target::do_has_custom_set_dynsym_indexes): New function.
1660 (Target::set_dynsym_indexes): New function.
1661 (Target::do_set_dynsym_indexes): New function.
1662
b80eed39
AM
16632014-03-07 Alan Modra <amodra@gmail.com>
1664
1665 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
1666 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
1667 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
1668 (Powerpc_relocate_functions::has_overflow_bitfield,
1669 overflowed): Use the above.
1670 (Target_powerpc::Relocate::relocate): Correct overflow checking
1671 for a number of relocations. Modify overflow test for 16-bit
1672 fields in instructions to signed/unsigned according to whether
1673 the field takes a signed or unsigned value.
1674
4b95cf5c
AM
16752014-03-05 Alan Modra <amodra@gmail.com>
1676
1677 Update copyright years.
1678
45965137
AM
16792014-03-05 Alan Modra <amodra@gmail.com>
1680
1681 * powerpc.cc (Target_powerpc::Scan::local, global): Support
1682 R_PPC64_ADDR64_LOCAL.
1683 (Target_powerpc::Relocate::relocate): Likewise.
1684
2c80b753
AM
16852014-03-03 Alan Modra <amodra@gmail.com>
1686
1687 * dwp.cc (print_version): Update copyright year to current.
1688
c1c69e83
AM
16892014-02-10 Alan Modra <amodra@gmail.com>
1690
1691 * po/gold.pot: Regenerate.
1692
dd0c4e70
CC
16932014-02-06 Cary Coutant <ccoutant@google.com>
1694
1695 Fix problem where -u is ignored when a weak undef is seen.
1696
1697 * archive.cc (Library_base::should_include_member): Reorder
1698 code to check for -u option if a weak undef has already been seen.
1699 * testsuite/Makefile.am (weak_undef_test_2): New test case.
1700 * testsuite/Makefile.in: Regenerate.
1701 * testsuite/weak_undef_file3.cc: New file.
1702 * testsuite/weak_undef_file4.cc: New file.
1703 * testsuite/weak_undef_test_2.cc: New file.
1704
1a221d3d
CC
17052014-02-05 Cary Coutant <ccoutant@google.com>
1706
1707 Fix issues with gold undefined symbol diagnostics.
1708
1709 PR binutils/15435
1710 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
1711 check to here.
1712 * target-reloc.h (is_strong_undefined): New function.
1713 (relocate_section): Move undef vtable symbol check from here.
1714 Check for is_strong_undefined.
1715
e889f0a4 17162014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 1717
e889f0a4
CC
1718 Fix problems with the --dynamic-list option.
1719
1720 PR gold/13577
1721 * options.cc (General_options::parse_dynamic_list):
1722 Set have_dynamic_list_.
1723 (General_options::General_options): Initialize have_dynamic_list_.
1724 (General_options::finalize): Turn off -Bsymbolic and
1725 -Bsymbolic-functions if --dynamic-list provided.
1726 * options.h (General_options::have_dynamic_list): New function.
1727 (General_options::have_dynamic_list_): New data member.
1728 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
1729 correctly.
5fe7ffdc 1730
e889f0a4
CC
1731 PR gold/16530
1732 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
1733 in --dynamic-list, mark it.
5fe7ffdc 1734
e889f0a4
CC
1735 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
1736 (dynamic_list_2): New test case.
1737 * testsuite/Makefile.in: Regenerate.
1738 * testsuite/dynamic_list_2.cc: New file.
1739 * testsuite/dynamic_list_2.t: New file.
1740 * testsuite/dynamic_list_lib1.cc: New file.
1741 * testsuite/dynamic_list_lib2.cc: New file.
1742 * testsuite/gc_dynamic_list_test.c: New file.
1743 * testsuite/gc_dynamic_list_test.sh: New file.
1744 * testsuite/gc_dynamic_list_test.t: New file.
1745
ec673e64
CC
17462014-01-28 Cary Coutant <ccoutant@google.com>
1747
1748 Add .gdb_index version 7 support.
1749
1750 * gold/dwarf_reader.cc: include <utility> (for make_pair).
1751 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
1752 debug sections.
1753 (Dwarf_ranges_table::read_ranges_table): Likewise.
1754 (Dwarf_pubnames_table::read_section): Check for GNU-style
1755 sections, and for compressed debug sections.
1756 (Dwarf_pubnames_table::read_header): Compute end address of table.
1757 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
1758 for end of list by offset, not by offset == 0.
1759 (Dwarf_info_reader::do_read_string_table): Check for compressed
1760 debug sections.
1761 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1762 Initialize new data members.
1763 (Dwarf_pubnames_table::next_name): return flag_byte.
1764 (Dwarf_pubnames_table::end_of_table_): New data member.
1765 (Dwarf_pubnames_table::is_gnu_style_): New data member.
1766 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
1767 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
1768 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
1769 read skeleton type unit DIEs.
1770 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
1771 (Gdb_index::do_write): Write flag_byte.
1772 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
1773 (Gdb_index::Cu_vector): Store flags along with cu indexes.
1774 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
1775 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
1776
221fd5d5
L
17772014-01-08 H.J. Lu <hongjiu.lu@intel.com>
1778
1779 * version.cc (print_version): Update copyright year to 2014.
1780
6c09fb0b
ILT
17812013-12-19 Dimitry Andric <dimitry@andric.com>
1782
1783 * stringpool.cc (Stringpool_template::reserve): Add
1784 HAVE_UNORDERED_MAP case.
1785 * stringpool.cc (Stringpool_template::print_stats): Likewise.
1786
8356f2d0
CC
17872013-12-18 Cary Coutant <ccoutant@google.com>
1788
1789 * configure.ac: Check for <unordered_set> and <unordered_map>.
1790 * config.in: Regenerate.
1791 * configure: Regenerate.
1792 * system.h: Use <unordered_set> and <unordered_map> if available.
1793
f2c7d7ee
RM
17942013-12-10 Roland McGrath <mcgrathr@google.com>
1795
1796 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
1797 with $(INSTALL_PROGRAM_ENV).
1798 * Makefile.in: Regenerate.
1799
6632e8cc
CC
18002013-11-22 Cary Coutant <ccoutant@google.com>
1801
1802 * configure.ac: Add check for which library is needed for
1803 dlopen.
1804 * configure: Regenerate.
1805
0c075858
CC
18062013-11-22 Cary Coutant <ccoutant@google.com>
1807
1808 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
1809 assembler.
1810 * testsuite/Makefile.in: Regenerate.
1811
f49fe902
L
18122013-11-17 H.J. Lu <hongjiu.lu@intel.com>
1813
1814 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
1815 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
1816 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
1817 (Target_x86_64<size>::Scan::local): Likewise.
1818 (Target_x86_64<size>::Scan::global): Likewise.
1819 (Target_x86_64<size>::Relocate::relocate): Likewise.
1820 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
1821 Likewise.
1822 (Target_x86_64<size>::Scan::check_non_pic(): Handle
1823 R_X86_64_PC32_BND.
1824
1825 * testsuite/Makefile.am (check_PROGRAMS): Add
1826 exception_x86_64_bnd_test.
1827 (exception_x86_64_bnd_test_SOURCES): New macro.
1828 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
1829 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
1830 (exception_x86_64_bnd_test_LDADD): Likewise.
1831 (exception_x86_64_bnd_1.o): New rule.
1832 (exception_x86_64_bnd_2.o): Likewise.
1833 * testsuite/Makefile.in: Regenerated.
1834
9055360d
AM
18352013-11-15 Alan Modra <amodra@gmail.com>
1836
1837 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
1838 accessor.
1839 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
1840 Only call ppc64_local_entry_offset for 64-bit. Restrict
1841 symval_for_branch lookup to ELFv1.
1842 (Stub_table::add_plt_call_entry): Use unsigned int off.
1843 (Output_data_glink::Address, invalid_address): New.
1844 (Output_data_glink::add_eh_frame): Move out of line. Add
1845 support for ELFv2.
1846 (Output_data_glink::add_global_entry, find_global_entry,
1847 global_entry_address): New functions.
1848 (Output_data_glink::global_entry_stubs_, end_branch_table_,
1849 ge_size): New variables.
1850 (Output_data_glink::set_final_data_size): Add global entry
1851 stub sizing.
1852 (Output_data_glink::do_write): Write global entry stubs.
1853 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
1854 parameter. Return true for ELFv2. Adjust callers.
1855 (Target_powerpc::Scan::local, global): Restrict opd lookup to
1856 ELFv1. Similarly for ifunc and dynamic relocation processing
1857 specific to ELFv1. Recognize that symbols are defined on
1858 their plt entries for ELFv2.
1859 (Target_powerpc::symval_for_branch): Assert if called for
1860 ELFv2 or ppc32.
1861 (Target_powerpc::Relocate::relocate): Use global entry plt
1862 stub for symbol value if such exists on ELFv2.
1863 (Target_powerpc::Relocate::relocate): Don't call
1864 symval_for_branch when ELFv2. Do adjust for local entry
1865 offset when ELFv2.
1866 (Target_powerpc::do_dynsym_value): Set symbols to global entry
1867 plt stub for ELFv2.
1868 (Target_powerpc::do_plt_address_for_global): Similarly.
1869
cafdd569
CC
18702013-11-14 Cary Coutant <ccoutant@google.com>
1871
1872 Revert patch -- this did not fix the problem, and there is
1873 no race there.
1874
1875 2013-11-14 Cary Coutant <ccoutant@google.com>
1876
1877 PR gold/14860
1878 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1879 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1880 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1881 updating fde_offsets_.
1882 (Eh_frame_hdr::lock_): New data member.
1883
94e49e16
CC
18842013-11-14 Cary Coutant <ccoutant@google.com>
1885
1886 * dwp.cc (Dwo_file_entry): New type.
1887 (File_list): Use Dwo_file_entry.
1888 (Dwo_file::verify): New function.
1889 (Dwo_file::verify_dwo_list): New function.
1890 (Dwo_file::sized_verify_dwo_list): New function.
1891 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
1892 list.
1893 (Dwp_options): New enum type.
1894 (dwp_options): Add --verify-only.
1895 (usage): Likewise.
1896 (main): Likewise.
1897 * dwp.h (gold_info): Add declaration.
1898
7cdd7d57
CC
18992013-11-14 Cary Coutant <ccoutant@google.com>
1900
1901 PR gold/14860
1902 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1903 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1904 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1905 updating fde_offsets_.
1906 (Eh_frame_hdr::lock_): New data member.
1907
1d946cb3
CC
19082013-11-06 Cary Coutant <ccoutant@google.com>
1909
1910 PR gold/15758
1911 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
1912 before reloc sections.
1913
4f65b40e
AM
19142013-11-04 Alan Modra <amodra@gmail.com>
1915
1916 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
1917 (Symbol::needs_dynamic_reloc): Test new flag.
1918 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
1919 (Target_powerpc::Scan::get_reference_flags): Add target param.
1920 Return FUNC_DESC_ABI for 64-bit ELFv1.
1921 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
1922 call.
1923 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
1924 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
1925
908794a9
CC
19262013-10-31 Cary Coutant <ccoutant@google.com>
1927
1928 Restore support for dwp v2 DWARF package file format.
1929
1930 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1931 tu_length parameter. Adjust all callers.
1932 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1933 * dwp.cc: Include dwarf.h.
1934 (Section_bounds): New struct type.
1935 (Unit_set): New struct type.
1936 (Dwo_file::Dwo_file): Initialize new data member.
1937 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1938 Combine and rename to...
1939 (Dwo_file::read_unit_index): ...this.
1940 (Dwo_file::sized_read_compunit_index)
1941 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1942 (Dwo_file::sized_read_unit_index): ...this.
1943 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1944 parameters; add section_id parameter.
1945 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1946 (Dwo_file::add_unit_set): ...this.
1947 (Dwo_file::shndx_map_): Remove.
1948 (Dwo_file::sect_offsets_): New data member.
1949 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1950 (Dwp_output_file::add_section): Rename to...
1951 (Dwp_output_file::add_contribution): ...this.
1952 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1953 (Dwp_output_file::add_tu_set): Likewise.
1954 (Dwp_output_file::Contribution): New type.
1955 (Dwp_output_file::Section::contributions): New data member.
1956 (Dwp_output_file::Cu_or_tu_set): Remove.
1957 (Dwp_output_file::Section::Section): New ctor.
1958 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1959 (Dwp_output_file::Dwp_index::Section_table): New type.
1960 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1961 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1962 parameter.
1963 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1964 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1965 (Dwp_output_file::Dwp_index::section_table): New member function.
1966 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1967 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1968 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1969 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1970 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1971 (Dwp_output_file::Dwp_index::section_table_): New data member.
1972 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1973 (Dwp_output_file::add_output_section): New member function.
1974 (Dwp_output_file::write_new_section): New member function.
1975 (Dwp_output_file::write_contributions): New member function.
1976 (Dwp_output_file::section_id_map_): New data member.
1977 (class Dwo_id_info_reader): Remove.
1978 (class Unit_reader): New class.
1979 (get_dwarf_section_name): New function.
1980 (Dwo_file::read_executable): Adjust initializations of class data.
1981 (Dwo_file::read): Add support for v2 package file format.
1982 (Dwo_file::read_unit_index): Likewise.
1983 (Dwo_file::sized_read_unit_index): Likewise.
1984 (Dwo_file::copy_section): Likewise.
1985 (Dwo_file::add_unit_set): Likewise.
1986 (Dwp_output_file::add_output_section): Likewise.
1987 (Dwp_output_file::add_contribution): Likewise.
1988 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1989 for empty slot.
1990 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1991 file format.
1992 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1993 slot.
1994 (Dwp_output_file::initialize): Remove unused function.
1995 (Dwp_output_file::finalize): Add support for v2 package file format.
1996 (Dwp_output_file::write_index): Likewise.
1997 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1998 function prototype.
1999
2500c017
CC
20002013-10-31 Cary Coutant <ccoutant@google.com>
2001
2002 * configure.ac: Fix check for -fmerge-constants.
2003 * configure.ac: Regenerate.
2004
dd0845d7
RM
20052013-10-30 Roland McGrath <mcgrathr@google.com>
2006
2007 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
2008 Correct 9-byte nop sequence to match what the assembler generates.
2009
b4f7960d
AM
20102013-10-30 Alan Modra <amodra@gmail.com>
2011
2012 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
2013 ppc64_local_entry_offset, ppc64_local_entry_offset,
2014 do_read_symbols): New functions.
2015 (Powerpc_relobj::e_flags_, st_other_): New vars.
2016 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
2017 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
2018 (Powerpc_relobj::e_flags_): New var.
2019 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
2020 and adjust for ELFv2.
2021 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
2022 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
2023 (Powerpc_dynobj::do_find_special_sections): Likewise.
2024 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
2025 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
2026 to ELFv2 local entry.
2027 (Target_powerpc::do_relax): No thread safe barriers needed for
2028 ELFv2.
2029 (Output_data_plt_powerpc::initial_plt_entry_size_,
2030 plt_entry_size): Delete. Replace all uses with
2031 first_plt_entry_offset() and plt_entry_size().
2032 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
2033 reserved_size parm. Update callers.
2034 (Output_data_plt_powerpc::entry_count): Update.
2035 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
2036 and use Target_powerpc::first_plt_entry_offset().
2037 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
2038 rename to plt_entry_size.
2039 (Output_data_plt_powerpc::add_ifunc_entry,
2040 add_local_ifunc_entry): Adjust reloc for ELFv2.
2041 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
2042 (glink_eh_frame_fde_64v2): New.
2043 (Stub_table::plt_call_size): Support ELFv2 sizing.
2044 (Output_data_glink::add_eh_frame): Use the new FDE.
2045 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
2046 (Stub_table::do_write): Write ELFv2 stubs and glink.
2047 (Target_powerpc::Relocate::relocate): Replaces nop after call
2048 with ld 2,24(1) and adjust local offset destination for ELFv2.
2049
f9c6b907
AM
20502013-10-30 Alan Modra <amodra@gmail.com>
2051
2052 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
2053 (Target_powerpc::Scan::global, local): Likewise.
2054 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
2055 on all ppc64 @h and @ha relocs.
2056
e84fe78f
AM
20572013-10-14 Alan Modra <amodra@gmail.com>
2058
2059 * output.h (Output_data_got::add_constant): Tidy.
2060 (Output_data_got::add_constant_pair): New function.
2061 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
2062 methods used so as to first call reserve_ent().
2063
679e4abf
RM
20642013-10-11 Roland McGrath <mcgrathr@google.com>
2065
44dcb735
RM
2066 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
2067 add_got_entry and add_got_entry_pair.
2068
13323c49
RM
2069 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
2070 (HAVE_PUBNAMES): Likewise.
2071 * configure: Regenerate.
2072
1496b446
RM
2073 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
2074 * testsuite/Makefile.in: Regenerate.
2075
cc84c10b
RM
2076 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
2077 Remove const from declaration.
2078 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
2079 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
2080 * output.h (Output_file_header): Remove const from member target_
2081 and corresponding constructor argument.
2082 * output.cc (Output_file_header::Output_file_header): Update prototype.
2083 (Output_file_header::do_sized_write): Use this->target_ in place
2084 of parameters()->target().
2085
52f66a2c
RM
2086 * testsuite/undef_symbol.cc (Foo::get_a): New method.
2087
2b64b551
RM
2088 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
2089 * configure: Regenerate.
2090 * Makefile.in: Regenerate.
2091 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
2092 * testsuite/merge_string_literals_2.c: Likewise.
2093 * testsuite/Makefile.am
2094 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
2095 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
2096 literal -fmerge-constants.
2097 * testsuite/Makefile.in: Regenerate.
2098
43819297
RM
2099 * i386.cc (Target_i386): Remove unused member dynbss_.
2100 * arm.cc (Target_arm): Likewise.
2101 * powerpc.cc (Target_powerpc): Likewise.
2102 * sparc.cc (Target_sparc): Likewise.
2103 * tilegx.cc (Target_tilegx): Likewise.
2104 * x86_64.cc (Target_x86_64): Likewise.
2105 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
2106 type_signature_, type_offset_.
2107 * plugin.h (Plugin_hook): Remove unused member layout_.
2108 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
2109 mapfile_.
2110 (Read_member): Remove unused members input_objects_, symtab_,
2111 mapfile_, layout_.
2112 (Check_library): Remove unused member symtab_.
2113 * archive.h (Lib_group): Remove unused member lib_.
2114 * archive.cc (Lib_group::Lib_group): Update initializer.
2115 * incremental.h (Incremental_binary): Remove unused member target_.
2116 (Incremental_script_entry): Removed unused member script_.
2117 * layout.h (Write_symbols_task): Remove unused member input_objects_.
2118 * icf.h (Icf): Remove unused member num_tracked_relocs.
2119
39d9ead7
RM
2120 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
2121 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
2122 its only use.
2123 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
2124
679e4abf
RM
2125 * archive.h: Use struct rather than class for forward declaration
2126 of Read_symbols_data.
2127
54de2ea6
CC
21282013-10-07 Cary Coutant <ccoutant@google.com>
2129
2130 PR gold/16010
2131 * testsuite/Makefile.am (icf_test): Fix dependencies.
2132 (icf_safe_test): Likewise.
2133 (icf_safe_so_test): Likewise.
2134 (large_symbol_alignment): Add empty _LDADD rule.
2135 * testsuite/Makefile.in: Regenerate.
2136
b14016f0
L
21372013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
2138
2139 PR gold/15927
2140 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
2141 relocation for R_X86_64_32 on x32.
2142
eb426534
RM
21432013-08-27 Roland McGrath <mcgrathr@google.com>
2144
2145 * output.cc (Output_segment::set_section_addresses): Take new
2146 Target* argument. If target->isolate_execinstr() and the segment
2147 is executable and starts at a target->abi_pagesize() boundary,
2148 pad its end out to a target->abi_pagesize() boundary with code fill.
2149 * output.h (Output_segment::set_section_addresses): Update decl.
2150 * layout.h (Layout::check_output_data_for_reset_values): Take new
2151 argument RELAX_OUTPUTS.
2152 (Layout): New member relax_output_list_.
2153 (Layout::add_relax_output): New method.
2154 * layout.cc (Layout::Layout): Update constructor.
2155 (Layout::reset_relax_output): New method.
2156 (Layout::clean_up_after_relaxation): Call it.
2157 (Layout::prepare_for_relaxation): Update caller.
2158 (Layout::set_segment_offsets): Update callers of set_section_addresses.
2159 Call reset_relax_output before re-processing segments for
2160 isolate_execinstr case.
2161 (Layout::write_data): Handle relax_output_list_.
2162 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
2163 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
2164
9aff4b7a
NC
21652013-08-23 Yuri Chornoivan <yurchor@ukr.net>
2166
2167 PR binutils/15834
2168 * object.h: Fix typos.
2169
93f8221c
RM
21702013-08-16 Roland McGrath <mcgrathr@google.com>
2171
2172 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
2173 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
2174
e44c3715
CC
21752013-08-07 Cary Coutant <ccoutant@google.com>
2176
2177 Revert support for v2 DWP files:
2178
2179 2013-03-01 Cary Coutant <ccoutant@google.com>
2180
2181 Add dwp support for v2 DWARF package file format.
2182 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2183 tu_length parameter. Adjust all callers.
2184 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2185 * dwp.cc: Include dwarf.h.
2186 (Section_bounds): New struct type.
2187 (Unit_set): New struct type.
2188 (Dwo_file::Dwo_file): Initialize new data member.
2189 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2190 Combine and rename to...
2191 (Dwo_file::read_unit_index): ...this.
2192 (Dwo_file::sized_read_compunit_index)
2193 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2194 (Dwo_file::sized_read_unit_index): ...this.
2195 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2196 parameters; add section_id parameter.
2197 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2198 (Dwo_file::add_unit_set): ...this.
2199 (Dwo_file::shndx_map_): Remove.
2200 (Dwo_file::sect_offsets_): New data member.
2201 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2202 (Dwp_output_file::add_section): Rename to...
2203 (Dwp_output_file::add_contribution): ...this.
2204 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2205 (Dwp_output_file::add_tu_set): Likewise.
2206 (Dwp_output_file::Contribution): New type.
2207 (Dwp_output_file::Section::contributions): New data member.
2208 (Dwp_output_file::Cu_or_tu_set): Remove.
2209 (Dwp_output_file::Section::Section): New ctor.
2210 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2211 (Dwp_output_file::Dwp_index::Section_table): New type.
2212 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2213 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2214 parameter.
2215 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2216 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2217 (Dwp_output_file::Dwp_index::section_table): New member function.
2218 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2219 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2220 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2221 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2222 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2223 (Dwp_output_file::Dwp_index::section_table_): New data member.
2224 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2225 (Dwp_output_file::add_output_section): New member function.
2226 (Dwp_output_file::write_new_section): New member function.
2227 (Dwp_output_file::write_contributions): New member function.
2228 (Dwp_output_file::section_id_map_): New data member.
2229 (class Dwo_id_info_reader): Remove.
2230 (class Unit_reader): New class.
2231 (get_dwarf_section_name): New function.
2232 (Dwo_file::read_executable): Adjust initializations of class data.
2233 (Dwo_file::read): Add support for v2 package file format.
2234 (Dwo_file::read_unit_index): Likewise.
2235 (Dwo_file::sized_read_unit_index): Likewise.
2236 (Dwo_file::copy_section): Likewise.
2237 (Dwo_file::add_unit_set): Likewise.
2238 (Dwp_output_file::add_output_section): Likewise.
2239 (Dwp_output_file::add_contribution): Likewise.
2240 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2241 for empty slot.
2242 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2243 file format.
2244 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2245 slot.
2246 (Dwp_output_file::initialize): Remove unused function.
2247 (Dwp_output_file::finalize): Add support for v2 package file format.
2248 (Dwp_output_file::write_index): Likewise.
2249 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2250 function prototype.
2251
c6905c28
CC
22522013-07-31 Cary Coutant <ccoutant@google.com>
2253
2254 * object.cc (Sized_relobj::do_output_section_address): New function.
2255 (Sized_relobj): Instantiate explicitly.
2256 * object.h (Object::output_section_address): New function.
2257 (Object::do_output_section_address): New function.
2258 (Sized_relobj::do_output_section_address): New function.
2259 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
2260
22612013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 2262 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
2263
2264 * parameters.cc (Parameters::entry): Return target-specific entry
2265 symbol name.
2266 * target.h (Target::entry_symbol_name): New function.
2267 (Target_info::entry_symbol_name): New data member.
2268
2269 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
2270 * i386.cc (Target_i386::i386_info): Likewise.
2271 (Target_i386_nacl::i386_nacl_info): Likewise.
2272 * sparc.cc (Target_sparc::sparc_info): Likewise.
2273 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
2274 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
2275 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
2276 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2277
234d4ab8
SA
22782013-07-22 Sterling Augustine <saugustine@google.com>
2279
2280 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
2281 Convert parameter shndx to local variable. Add parameters symtab
2282 and symtab_size. Scan over section names. Find relocation
2283 section corresponding to current section. Create and initialize
2284 reloc_mapper_ and reloc_type_.
2285 (Dwarf_pubnames_table::read_header): Add assertion. Change
2286 unit_length to off_t. Initialize member unit_length_. Fill in field
2287 cu_offset_.
2288 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2289 Initialize new fields unit_length_ and cu_offset_.
2290 (Dwarf_pubnames_table::read_section): Update prototype.
2291 (Dwarf_pubnames_table::cu_offset): New member function.
2292 (Dwarf_pubnames_table::subsection_size): Likewise.
2293 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
2294 New fields.
2295 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
2296 member functions public.
2297 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
2298 Update comment. Rework logic. Move repeated parts to...
2299 (Gdb_index_info_reader::read_pubtable): ...here. New function.
2300 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
2301 pubtypes_table_, and stmt_list_offset.
2302 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2303 Gdb_index::find_pubtype_offset,
2304 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
2305 (Gdb_index::pubnames_read): Update prototype and rework logic.
2306 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
2307 Forward declare.
2308 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2309 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
2310 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
2311 Gdb_index::map_pubtable_to_dies):
2312 Declare functions.
2313 (Gdb_index::pubnames_read): Update declaration.
2314 (Gdb_index::Pubname_offset_map): New type.
2315 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
2316 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
2317 Gdb_index::stmt_list_offset): Declare.
2318 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
2319 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
2320 Gdb_index::pubtypes_offset_): Remove.
2321
a3ed37d8
RM
23222013-07-19 Roland McGrath <mcgrathr@google.com>
2323
2324 * options.h (General_options): Add -Trodata-segment option.
2325 * parameters.cc (Parameters::check_rodata_segment): New function.
2326 (Parameters::set_target_once): Call it.
2327 * parameters.h (Parameters): Declare it (private member function).
2328 * layout.cc (load_seg_unusable_for_headers): New function, broken
2329 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
2330 then validate rodata segment rather than text segment.
2331 (relaxation_loop_body): Call that.
2332 (is_text_segment): New function. Don't admit a non-executable
2333 segment if TARGET->isolate_execinstr().
2334 (set_segment_offsets): Call it. Honor -Trodata-segment option.
2335
eb5b4ded
CC
23362013-07-15 Shawn Landden <shawnlandden@gmail.com>
2337
2338 PR gold/15070
2339 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
2340 * nacl.h (Sniff_file::View::View): Request aligned view.
2341
4d5effb9
CC
23422013-07-11 Cary Coutant <ccoutant@google.com>
2343
2344 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
2345 correct BRLT entry size.
2346
ba8ca3e7
AM
23472013-07-03 Alan Modra <amodra@gmail.com>
2348
2349 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
2350 comment.
2351
267257d2
CC
23522013-07-01 Cary Coutant <ccoutant@google.com>
2353
2354 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
2355 reloc_type_.
2356 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
2357 (Dwarf_ranges_table::lookup_reloc): New function.
2358 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
2359 reloc_type_.
2360 (Dwarf_ranges_table::lookup_reloc): New function.
2361 (Dwarf_ranges_table::reloc_type_): New data member.
2362
06f30c9d
CC
23632013-06-27 Jing Yu <jingyu@google.com>
2364
2365 PR gold/15662
2366 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
2367 function.
2368 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
2369 (Target_powerpc::do_relax): Call the above.
2370
a2d7bf59
AM
23712013-06-27 Cary Coutant <ccoutant@google.com>
2372
2373 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
2374 on garbage collected .opd section.
2375
23762013-06-27 Alan Modra <amodra@gmail.com>
2377
2378 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
2379 is non-zero.
2380 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
2381 (Target_powerpc::do_function_location): Likewise for loc->shndx.
2382
32364e50
CC
23832013-06-14 Cary Coutant <ccoutant@google.com>
2384
2385 * resolve.cc (Symbol::override_base): Don't override st_type
2386 from plugin placeholder symbols.
2387 (Symbol_table::resolve): Likewise.
2388 (Symbol_table::should_override): Don't complain about TLS mismatch
2389 if the TO symbol is a plugin placeholder.
2390 * testsuite/Makefile.am (plugin_test_tls): New test.
2391 * testsuite/Makefile.in: Regenerate.
2392 * testsuite/plugin_test_tls.sh: New test script.
2393 * testsuite/two_file_test_2_tls.cc: New test source.
2394 * testsuite/two_file_test_tls.cc: New test source.
2395
7fb47cc9
CC
23962013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
2397
2398 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
2399 the maximum segment alignment is larger than the page size.
2400 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
2401 correctly aligns the symbols with large alignemnt.
2402 * testsuite/Makefile.in: Regenerate.
2403 * testsuite/large_symbol_alignment.cc: New file.
2404
6934001a
CC
24052013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
2406 Sriraman Tallam <tmsriram@google.com>
2407
2408 * options.h (sort_section): New option.
2409 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
2410 Rename from Input_section_sort_section_name_special_ordering_compare.
2411 (Input_section_sort_section_name_compare): New struct.
2412 * output.cc (Output_section::Input_section_sort_section_name_compare::
2413 operator()): New function.
2414 (Output_section::sort_attached_input_sections): Use new sort function
2415 for .text if --sort-section=name is specified.
2416 * layout.cc (Layout::make_output_section):
2417 Add sorting by name when --sort-section=name is specified.
2418 * testsuite/Makefile.am (text_section_grouping): Test option
2419 --sort-section=name.
2420 * testsuite/Makefile.in: Regenerate.
2421 * testsuite/section_sorting_name.cc: New file.
2422 * testsuite/section_sorting_name.sh: New file.
2423
93acabad
CC
24242013-05-21 Cary Coutant <ccoutant@google.com>
2425
2426 * symtab.h (Symbol::is_cxx_vtable): New function.
2427 * target-reloc.h (relocate_section): Check for vtable symbol.
2428 * testsuite/Makefile.am (missing_key_func.sh): New test case.
2429 * testsuite/Makefile.in: Regenerate.
2430 * testsuite/missing_key_func.cc: New test source.
2431 * testsuite/missing_key_func.sh: New test script.
2432
60e8b3fc
CC
24332013-05-21 Cary Coutant <ccoutant@google.com>
2434
2b64b551
RM
2435 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
2436 type of enclosing symbol.
2437 (Relocate_info::location): Check symbol type when describing symbol.
2438 * object.h (Symbol_location_info): Remove unused line_number;
2439 add enclosing_symbol_type.
2440 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 2441
9df9de2c
CC
24422013-05-13 Cary Coutant <ccoutant@google.com>
2443
2b64b551
RM
2444 * configure.ac: Export DEFAULT_TARGET.
2445 * configure: Regenerate.
2446 * Makefile.in: Regenerate.
2447 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
2448 * testsuite/Makefile.in: Regenerate.
2449 * testsuite/debug_msg.sh: Delete duplicate tests.
2450 Don't check undef_int error message match for powerpc where the
2451 source file and line number aren't available.
9df9de2c 2452
bbc5ae17
RM
24532013-05-10 Roland McGrath <mcgrathr@google.com>
2454
2455 * options.h (General_options): Add --rosegment-gap option.
2456 * options.cc (finalize): --rosegment-gap implies --rosegment.
2457 * layout.cc (set_segment_offsets): Let user option override
2458 target->rosegment_gap().
2459
0c6e6c39
RM
24602013-05-10 Roland McGrath <mcgrathr@google.com>
2461
2462 * options.h (General_options): Remove leading space from help
2463 messages for -nostdlib and --rosegment.
2464
cde7cb01
MR
24652013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
2466
2467 PR ld/15365
2468 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
2469
f31ae5b8
AM
24702013-05-03 Alan Modra <amodra@gmail.com>
2471
2472 * merge.cc (Output_merge_string::do_add_input_section): Correct
2473 scan for number of strings. Rename vars to avoid shadowing.
2474 Include missing terminator in input_size_.
2475
d3a7cd45
L
24762013-05-01 H.J. Lu <hongjiu.lu@intel.com>
2477
2478 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
2479 Restore empty string handling.
2480
6ad3daba
CC
24812013-05-01 Cary Coutant <ccoutant@google.com>
2482
2483 * stringpool.cc (Stringpool_template::new_key_offset): Fix
2484 uninitialized warning.
2485
e31908b6
CC
24862013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
2487
2488 * output.cc (Output_section::add_merge_input_section): Allow
2489 to merge sections if the alignment is more than character size.
2490 * merge.h (Output_merge_string::Output_merge_string): Remove
2491 assert.
2492 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
2493 only not-null strings. Check the alignment of strings.
2494 * stringpool.h
2495 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
2496 alignment as the argument.
2497 (Stringpool_template<Stringpool_char>::addralign_): New class member.
2498 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
2499 Align non-zero length strings according to the addralign_.
2500 (Stringpool_template<Stringpool_char>::set_string_offsets):
2501 Updating offsets according to the given alignment.
2502 * testsuite/Makefile.am (text_section_grouping): Test if string
2503 literals are getting merged.
2504 * testsuite/Makefile.in: Regenerate.
2505 * testsuite/merge_string_literals_1.c: New file.
2506 * testsuite/merge_string_literals_2.c: Ditto.
2507 * testsuite/merge_string_literals.sh: Ditto.
2508
0e804863
ILT
25092013-04-26 Ian Lance Taylor <iant@google.com>
2510
2511 * target-reloc.h (relocate_section): If the reloc offset is out of
2512 range, pass VIEW as NULL to relocate.relocate.
2513 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
2514 * i386.cc (Target_i386::Relocate::relocate): Likewise.
2515 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
2516 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
2517 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
2518 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
2519
e7c5ea40
CC
25202013-04-26 Geoff Pike <gpike@chromium.org>
2521
2522 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
2523 * layout.cc (Hash_task): New class.
2524 (Layout::queue_build_id_tasks): New function.
2525 (Layout::write_build_id): Handle single-thread portion of build ID
2526 computation. (In some cases, all of it is single-threaded.) Replace
2527 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
2528 functionality in fewer lines of code.
2529 * layout.h (Layout::queue_build_id_tasks): New function declaration.
2530 * options.h (General_options): make "--build-id" default to tree
2531 rather than sha1. Add two new options related to --build-id=tree:
2532 --build-id-chunk-size-for-treehash and
2533 --build-id-min-file-size-for-treehash.
2534 * Makefile.am: add testing of --build-id=tree and related new options
2535 (these tests will be invoked by "make check").
2536 * Makefile.in: Regenerate.
2537
49926cd0
AM
25382013-04-25 Alan Modra <amodra@gmail.com>
2539
2540 * configure.tgt: Add powerpcle and powerpc64le.
2541
a4034750
AM
25422013-04-22 Alan Modra <amodra@gmail.com>
2543
2544 PR gold/15355
2545 * layout.cc (Layout::segment_precedes): Allow more than one
2546 segment with the same type and flags.
2547
e79c84aa
CC
25482013-04-15 Cary Coutant <ccoutant@google.com>
2549
2550 * layout.cc (Layout::set_relocatable_section_offsets): Don't
2551 allocate space in file for BSS sections.
2552
2199fbe7
CC
25532013-04-15 Cary Coutant <ccoutant@google.com>
2554
2555 * script-sections.cc (Orphan_output_section): Reset address
2556 to zero after each orphaned section for relocatable links.
2557
502e8a84
CC
25582013-04-15 Cary Coutant <ccoutant@google.com>
2559
a4034750
AM
2560 * symtab.cc (Symbol_table::sized_write_globals): Subtract
2561 section starting address for relocatable link.
2562 * testsuite/Makefile.am (script_test_11): New test.
2563 * testsuite/Makefile.in: Regenerate.
2564 * testsuite/script_test_11.c: New source file.
2565 * testsuite/script_test_11.t: New linker script.
502e8a84 2566
0cfdc767
AM
25672013-04-13 Alan Modra <amodra@gmail.com>
2568
2569 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
2570 owner when sections are not adjacent and exceed group size.
2571 (Target_powerpc::group_sections): Handle corner case.
2572 (Target_powerpc::Branch_info::make_stub): Handle case where
2573 stub table doesn't exist due to branches in non-exec sections.
2574 (Target_powerpc::Relocate::relocate): Likewise.
2575
6830ee24
AM
25762013-04-11 Alan Modra <amodra@gmail.com>
2577
2578 PR gold/15354
2579 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
2580 .branch_lt to match bfd ld. Adjust comments throughout file.
2581
54a3d865
ILT
25822013-04-04 Ian Lance Taylor <iant@google.com>
2583
2584 GCC PR c++/56840
2585 * object.cc (do_layout_deferred_sections): Handle .eh_frame
2586 sections before checking whether they are included in the link.
2587
9993ba11
ST
25882013-03-29 Sriraman Tallam <tmsriram@google.com>
2589
2590 * archive.cc (Archive::get_elf_object_for_member): Create the elf
2591 object before calling the plugin claim_file handler. Pass the elf
2592 object of the archive to the plugin. Delete the elf object if the
2593 plugin claims the file.
2594
ebacd51e
AM
25952013-03-21 Alan Modra <amodra@gmail.com>
2596
2597 * layout.cc (Layout::set_segment_offsets): Accept writable .text
2598 segment when omagic.
2599
117be58f
AM
26002013-03-21 Alan Modra <amodra@gmail.com>
2601
2602 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
2603 comparison warning.
2604 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
2605 uninitialized" warning.
2606
32e2b61d
AM
26072013-03-20 Alan Modra <amodra@gmail.com>
2608
2609 * symtab.h (Symbol::clear_version): New function.
2610 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
2611 is_needed by weak references. Clear version for symbols defined
2612 in as-needed objects that are not needed.
2613
b3ccdeb5
AM
26142013-03-15 Alan Modra <amodra@gmail.com>
2615
2616 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
2617 static and public. Add report_err param. Return false for data refs.
2618 (Target_powerpc::rela_dyn_section): New overloaded function.
2619 (Target_powerpc::plt_, iplt_): Elucidate.
2620 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
2621 (Output_data_plt_powerpc::do_write): Don't write .iplt.
2622 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
2623 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
2624 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
2625 push_branch and make_plt_entry for ifunc syms when
2626 reloc_needs_plt_for_ifunc.
2627 (Target_powerpc::Relocate::relocate): Don't use plt entry value
2628 for ifunc unless reloc_needs_plt_for_ifunc.
2629
ad3d8a2f
AM
26302013-03-15 Alan Modra <amodra@gmail.com>
2631
2632 * gc.h (gc_process_relocs): Don't look through function descriptors.
2633 * icf.cc (get_section_contents): Do so here instead.
2634
4d9aa155
AM
26352013-03-13 Alan Modra <amodra@gmail.com>
2636
2637 * powerpc.cc (is_branch_reloc): Forward declare.
2638 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
2639 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
2640 false for 64-bit, true for 32-bit non-branch relocs.
2641 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
2642 * testsuite/Makefile.am (icf_test): Use linker map file instead of
2643 nm output.
2644 (icf_safe_test): Generate linker map file as well as nm output.
2645 (icf_safe_so_test): Likewise.
2646 * testsuite/Makefile.in: Regenerate.
2647 * testsuite/icf_test.sh: Parse linker map file to determine
2648 section folding.
2649 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
2650 * testsuite/icf_safe_so_test.sh: Likewise.
2651 (X86_32_or_ARM_specific_safe_fold): Merge into..
2652 (arch_specific_safe_fold): ..this.
2653 (X86_64_specific_safe_fold): Delete unused function.
2654
57420c20
AM
26552013-03-12 Alan Modra <amodra@gmail.com>
2656
2657 * gc.h (gc_process_relocs): Look through function descriptors
2658 to determine shndx, symvalue and addend used by ICF. Tidy
2659 variable duplication.
2660
dc3714f3
AM
26612013-03-11 Alan Modra <amodra@gmail.com>
2662
2663 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
2664 * layout.cc (Layout_task_runner::run): ..to here.
2665 * symtab.h (struct Symbol_location): Extract from..
2666 (class Symbol_table): ..here.
2667 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
2668 * target.h (class Target): Add function_location and
2669 do_function_location functions.
2670 (class Sized_target): Add do_function_location.
2671 * object.h (class Sized_relobj_file): Move find_shdr..
2672 (class Object): ..to here.
2673 * object.cc: Likewise. Update to suit. Instantiate.
2674 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
2675 * powerpc.cc (class Powerpc_dynobj): New.
2676 (Target_powerpc::do_function_location): New function.
2677 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
2678 (Powerpc_dynobj::do_read_symbols): New function.
2679 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
2680
956b03bb
ILT
26812013-03-08 Ian Lance Taylor <iant@google.com>
2682
2683 * options.cc (General_options::string_to_object_format): Accept
2684 "default".
2685
4bead2d5
AM
26862013-03-08 Alan Modra <amodra@gmail.com>
2687
2688 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
2689 pointer to Post_fde.
2690 (struct Post_fde): Move definition to here..
2691 * ehframe.cc (struct Post_fde): ..from here.
2692 (Cie::write): Don't alloc Post_fde.
2693 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
2694
02e60bf7
AM
26952013-03-07 Alan Modra <amodra@gmail.com>
2696
2697 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
2698 relocation referencing .LC0.
2699 * testsuite/discard_locals_test.sh: Remove FIXMEs.
2700
8343f03a
AM
27012013-03-07 Alan Modra <amodra@gmail.com>
2702
2703 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
2704 always_inline. Add assembly for powerpc to avoid GOT.
2705
3366d57c
AM
27062013-03-07 Alan Modra <amodra@gmail.com>
2707
2708 * testsuite/script_test_10.sh: Don't test .bss section
2709 header number.
2710
6c77229c
AM
27112013-03-06 Alan Modra <amodra@gmail.com>
2712
2713 * powerpc.cc (class Powerpc_relobj): Move some member functions.
2714 (Target_powerpc::symval_for_branch): Add symtab param. Update
2715 all callers. Handle folded sections.
2716 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
2717 to Powerpc_relobj.
2718 (Global_symbol_visitor_opd::operator()): Likewise.
2719
a39e4af6
AM
27202013-03-04 Alan Modra <amodra@gmail.com>
2721
2722 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
2723 * testsuite/Makefile.in: Regenerate.
2724
d5834edb
CC
27252013-03-01 Cary Coutant <ccoutant@google.com>
2726
2727 Add dwp support for v2 DWARF package file format.
2728 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2729 tu_length parameter. Adjust all callers.
2730 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2731 * dwp.cc: Include dwarf.h.
2732 (Section_bounds): New struct type.
2733 (Unit_set): New struct type.
2734 (Dwo_file::Dwo_file): Initialize new data member.
2735 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2736 Combine and rename to...
2737 (Dwo_file::read_unit_index): ...this.
2738 (Dwo_file::sized_read_compunit_index)
2739 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2740 (Dwo_file::sized_read_unit_index): ...this.
2741 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2742 parameters; add section_id parameter.
2743 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2744 (Dwo_file::add_unit_set): ...this.
2745 (Dwo_file::shndx_map_): Remove.
2746 (Dwo_file::sect_offsets_): New data member.
2747 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2748 (Dwp_output_file::add_section): Rename to...
2749 (Dwp_output_file::add_contribution): ...this.
2750 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2751 (Dwp_output_file::add_tu_set): Likewise.
2752 (Dwp_output_file::Contribution): New type.
2753 (Dwp_output_file::Section::contributions): New data member.
2754 (Dwp_output_file::Cu_or_tu_set): Remove.
2755 (Dwp_output_file::Section::Section): New ctor.
2756 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2757 (Dwp_output_file::Dwp_index::Section_table): New type.
2758 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2759 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2760 parameter.
2761 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2762 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2763 (Dwp_output_file::Dwp_index::section_table): New member function.
2764 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2765 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2766 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2767 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2768 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2769 (Dwp_output_file::Dwp_index::section_table_): New data member.
2770 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2771 (Dwp_output_file::add_output_section): New member function.
2772 (Dwp_output_file::write_new_section): New member function.
2773 (Dwp_output_file::write_contributions): New member function.
2774 (Dwp_output_file::section_id_map_): New data member.
2775 (class Dwo_id_info_reader): Remove.
2776 (class Unit_reader): New class.
2777 (get_dwarf_section_name): New function.
2778 (Dwo_file::read_executable): Adjust initializations of class data.
2779 (Dwo_file::read): Add support for v2 package file format.
2780 (Dwo_file::read_unit_index): Likewise.
2781 (Dwo_file::sized_read_unit_index): Likewise.
2782 (Dwo_file::copy_section): Likewise.
2783 (Dwo_file::add_unit_set): Likewise.
2784 (Dwp_output_file::add_output_section): Likewise.
2785 (Dwp_output_file::add_contribution): Likewise.
2786 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2787 for empty slot.
2788 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2789 file format.
2790 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2791 slot.
2792 (Dwp_output_file::initialize): Remove unused function.
2793 (Dwp_output_file::finalize): Add support for v2 package file format.
2794 (Dwp_output_file::write_index): Likewise.
2795 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2796 function prototype.
2797
a68a081d
CC
27982013-03-01 Cary Coutant <ccoutant@google.com>
2799
2800 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
2801 function into class definition in header file.
2802 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
2803 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
2804 New function.
2805 (Dwarf_info_reader::check_buffer): Move here from .cc file.
2806
9d5781f8
AM
28072013-02-28 Alan Modra <amodra@gmail.com>
2808
2809 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
2810 * target.cc (Target::do_plt_fde_location): New function.
2811 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
2812 accessor function, and constructor param.
2813 (struct Post_fde, Post_fdes): Declare.
2814 (Cie::write): Add post_fdes param.
2815 * ehframe.cc (Fde::write): Use plt_fde_location.
2816 (struct Post_fde): Define.
2817 (Cie::write): Stash FDEs added post merge mapping.
2818 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
2819 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
2820 (Eh_frame::do_sized_write): Arrange to write post map FDES after
2821 other FDEs.
2822 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
2823 (Target_powerpc::has_glink): New function.
2824 (Target_powerpc::do_relax): Add eh_frame info for stubs.
2825 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
2826 glink_eh_frame_fde_32, default_fde): New data.
2827 (Stub_table::eh_frame_added_): New var.
2828 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
2829 Make const.
2830 (Stub_table::add_eh_frame): New function.
2831 (Output_data_glink::add_eh_frame): New function.
2832 (Target_powerpc::make_glink_section): Call add_eh_frame.
2833
214383dd
ILT
28342013-02-15 Ian Lance Taylor <iant@google.com>
2835
2836 * options.h (DEFINE_uint64_alias): Define.
2837 (class General_options): Add -Ttext-segment as an alias for
2838 -Ttext.
2839
91c2b899
AM
28402013-02-15 Alan Modra <amodra@gmail.com>
2841
2842 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
2843 (Stub_table::do_write): ..here, two places.
2844 (Stub_table::plt_call_size): Use it here too.
2845
20e2a8aa
ILT
28462013-02-11 Ian Lance Taylor <iant@google.com>
2847
2848 * descriptors.cc (Descriptors::close_all): New function.
2849 * descriptors.h (class Descriptors): Declare close_all.
2850 (close_all_descriptors): New inline function.
2851 * plugin.cc: Include "descriptors.h".
2852 (Plugin_manager::cleanup): Call close_all_descriptors.
2853
8952bc69
AM
28542013-02-06 Alan Modra <amodra@gmail.com>
2855
2856 * README: Update coding style link.
2857
29bd8b6b
CC
28582013-01-28 Cary Coutant <ccoutant@google.com>
2859
a4034750
AM
2860 * dwp.cc (File_list): New typedef.
2861 (Dwo_name_info_reader): New class.
2862 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
2863 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
2864 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
2865 (Dwo_file::read_executable): New function.
2866 (Dwo_file::read): Move common setup code to ...
2867 (Dwo_file::make_object): ... here.
2868 (dwp_options): Add --exec/-e.
2869 (usage): Likewise.
2870 (main): Likewise.
29bd8b6b 2871
c6ac678d
ST
28722013-01-24 Sriraman Tallam <tmsriram@google.com>
2873
2874 * layout.cc (Layout::layout): Check for option text_reorder.
2875 (Layout::make_output_section): Ditto.
2876 * options.h (text_reorder): New option.
2877 * output.cc (Input_section_sort_compare): Remove special ordering
2878 of section names.
2879 (Output_section::
2880 Input_section_sort_section_name_special_ordering_compare::
2881 operator()): New function.
2882 (Output_section::sort_attached_input_sections): Use new sort function
2883 for .text.
2884 * output.h (Input_section_sort_section_name_special_ordering_compare):
2885 New struct.
2886 * testsuite/Makefile.am (text_section_grouping): Test option
2887 --no-text-reorder
2888 * testsuite/Makefile.in: Regenerate.
2889 * testsuite/text_section_grouping.sh: Check order of functions without
2890 default text reordering.
2891
50701cc1
MF
28922013-01-18 Mike Frysinger <vapier@gentoo.org>
2893
2894 * options.h (General_options): Change default to true for new_dtags.
2895
b1b00fcc
MF
28962013-01-18 Mike Frysinger <vapier@gentoo.org>
2897
2898 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
2899 when enable_new_dtags is false. Only add DT_RUNPATH when
2900 enable_new_dtags is true.
2901
ec5b8187
AM
29022013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
2903
2904 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
2905 used in declaration and definition consistent.
2906 (Target_powerpc::symval_for_branch): Ditto.
2907
a880d4c4
ST
29082013-01-16 Sriraman Tallam <tmsriram@google.com>
2909
2910 * testsuite/plugin_final_layout.cc: Fix comment.
2911
7c381248
ST
29122013-01-16 Sriraman Tallam <tmsriram@google.com>
2913
2914 * layout.cc (Layout::layout): Do not do default sorting for
2915 text sections when section ordering is specified.
2916 (make_output_section): Ditto.
2917 * testsuite/plugin_final_layout.cc: Name the function sections
2918 to catch reordering issues.
2919
e2458743
AM
29202013-01-15 Alan Modra <amodra@gmail.com>
2921
2922 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
2923 plt-thread-safe.
2924
431ed302
AM
29252013-01-15 Alan Modra <amodra@gmail.com>
2926
2927 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
2928 * testsuite/Makefile.in: Regenerate.
2929
0ec6429b
AM
29302013-01-14 Alan Modra <amodra@gmail.com>
2931
2932 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
2933 * testsuite/Makefile.in: Regenerate.
2934
0bf402d5
ILT
29352013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
2936
36af3926 2937 PR bfd/14430
0bf402d5
ILT
2938 Fix mingw gold build with plugins enabled
2939 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
2940 * configure.ac: Export DLOPEN_LIBS and add headers check.
2941 * plugin.cc: Handle non-dlfcn case.
2942 * Makefile.in: Regenerate.
2943 * config.in: Regenerate.
2944 * configure: Regenerate.
2945 * testsuite/Makefile.in: Regenerate.
2946
9e9143bc
ST
29472013-01-09 Sriraman Tallam <tmsriram@google.com>
2948
2949 * output.h (sort_attached_input_sections): Change to be public.
2950 * script-sections.cc
2951 (Output_section_definition::set_section_addresses): Sort
2952 attached input sections according to section order before linker
2953 script assigns section addresses.
2954 (Orphan_output_section::set_section_addresses): Sort
2955 attached input sections according to section order before linker
2956 script assigns section addresses.
2957 * Makefile.am (final_layout.sh): Use a simple linker script to
2958 check if section ordering still works.
2959 * Makefile.in: Regenerate.
2960
679af368
ILT
29612013-01-09 Ben Cheng <bccheng@google.com>
2962
2963 * arm.cc (Target_arm::attributes_accept_div): New function.
2964 (Target_arm::attributes_forbid_div): New function.
2965 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
2966 attribute using the same new functions as what bfd/elf32_arm.c
2967 does.
2968
3136a00e
CC
29692013-01-07 Cary Coutant <ccoutant@google.com>
2970
2971 PR gold/14993
2972 * output.cc (Output_section::add_input_section): For incremental
2973 updates, don't track input sections that are allocated from patch
2974 space.
2975
f2a6224b
L
29762013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2977 Ian Lance Taylor <iant@google.com>
2978
2979 PR gold/14897
2980 * configure.ac (--enable-ld): Removed.
2981 (install_as_default): Set to yes only for --enable-gold=default
2982 or --disable-ld.
2983 * configure: Regenerated.
2984
4f46f626
L
29852013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2986
2987 * options.h (General_options): Add -fuse-ld= for GCC linker
2988 option compatibility.
2989
26e4ef59
CC
29902013-01-04 Cary Coutant <ccoutant@google.com>
2991
2992 * configure.ac: Fix typo restoring CXXFLAGS.
2993 * configure: Regenerate.
2994
3d587466
CC
29952013-01-04 Cary Coutant <ccoutant@google.com>
2996
4f46f626
L
2997 * testsuite/Makefile.am (CXXLINK_S): New macro.
2998 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
2999 * testsuite/Makefile.in: Regenerate.
3d587466 3000
44db6695
L
30012013-01-02 H.J. Lu <hongjiu.lu@intel.com>
3002
3003 * version.cc (print_version): Update copyright year to 2013.
3004
edcac0c1
ILT
30052012-12-20 Ian Lance Taylor <iant@google.com>
3006
3007 * layout.cc (Layout::special_ordering_of_input_section): New
3008 function.
3009 (Layout::layout): If input section requires special ordering, must
3010 sort input sections.
3011 (Layout::make_output_section): May sort .text input sections.
3012 (Layout::is_section_name_prefix_grouped): Remove.
3013 * layout.h (class Layout): Declare
3014 special_ordering_of_input_section. Don't declare
3015 is_section_name_prefix_grouped.
3016 * output.cc (Output_section::add_input_section): Revert last
3017 change.
3018 (Output_section::Input_section_sort::match_file_name): Don't crash
3019 if called on output section data.
3020 (Output_section::Input_section_sort_compare): Sort based on
3021 special ordering.
3022 (Output_section::Input_section_sort_section_order_index_compare):
3023 Revert last patch.
3024 (Output_section::sort_attached_input_sections): Likewise.
3025
28f2a4ac
ST
30262012-12-18 Sriraman Tallam <tmsriram@google.com>
3027
edcac0c1 3028 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
3029 * layout.h (Layout::is_section_name_prefix_grouped): New function.
3030 * output.cc (Output_section::add_input_section): Check if section
3031 name contains special prefix. Keep input sections to sort such
3032 sections.
3033 (Output_section::Input_section_sort_section_order_index_compare
3034 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
3035 (Output_section::sort_attached_input_sections): Add condition to
3036 Input_section_entry constructor call.
28f2a4ac
ST
3037 * testsuite/Makefile.am (text_section_grouping): New test.
3038 * testsuite/Makefile.in: Regenerate.
3039 * testsuite/text_section_grouping.cc: New file.
3040 * testsuite/text_section_grouping.sh: New file.
3041
5bf135a7
NC
30422012-12-17 Nick Clifton <nickc@redhat.com>
3043
3044 * Makefile.am: Add copyright notice.
3045 * NEWS: Likewise.
3046 * README: Likewise.
3047 * configure.ac: Likewise.
3048 * ftruncate.c: Likewise.
3049 * Makefile.in: Regenerate.
3050
59965708
CC
30512012-12-14 Cary Coutant <ccoutant@google.com>
3052
a4034750
AM
3053 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
3054 --no-as-needed flag.
3055 (exception_separate_shared_12_test): Likewise.
3056 (incremental_copy_test): Likewise.
3057 * testsuite/Makefile.in: Regenerate.
59965708 3058
2a77e2ab
CC
30592012-12-14 Cary Coutant <ccoutant@google.com>
3060
3061 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
3062 (Dwp_output_file::Dwp_index::enter_set): Add assert.
3063
e3deeb9c
AM
30642012-12-12 Alan Modra <amodra@gmail.com>
3065
3066 * powerpc.cc (class Track_tls): New.
3067 (class Relocate, class Scan): Inherit Track_tls.
3068 (Target_powerpc::Scan::local, global): Track tls optimization
3069 and avoid creating plt entry for __tls_get_addr if all uses
3070 are optimized away.
3071 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
3072
d8f5a274
AM
30732012-12-12 Alan Modra <amodra@gmail.com>
3074
3075 * options.h (General_options): Add --toc-sort/--no-toc-sort.
3076 Replace no_toc_optimize with toc_optimize.
3077 * output.h (Output_section::input_sections): Provide non-const variant.
3078 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
3079 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
3080 accessors.
3081 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
3082 (class Sort_toc_sections): New.
3083 (Target_powerpc::do_finalize_sections): Sort toc sections.
3084 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
3085
4c8a1de1
RM
30862012-12-10 Roland McGrath <mcgrathr@google.com>
3087
3088 * testsuite/binary_unittest.cc (read_all): New function.
3089 (Sized_binary_test): Use it instead of ::read.
3090 * fileread.cc (do_read): Don't assume pread always reads the whole
3091 amount in a single call.
3092
edc27beb
AM
30932012-12-10 Alan Modra <amodra@gmail.com>
3094
3095 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
3096 Set EM_PPC64 or EM_PPC here.
3097 (Target_selector_powerpc::do_recognize): Delete.
3098
906b9150
AM
30992012-12-10 Alan Modra <amodra@gmail.com>
3100
3101 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
3102 stub_table_.
3103 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
3104
418c15ae
RM
31052012-12-07 Roland McGrath <mcgrathr@google.com>
3106
3107 * testsuite/binary_unittest.cc (Sized_binary_test):
3108 Use open_descriptor rather than ::open.
3109
decdd3bc
AM
31102012-12-07 Alan Modra <amodra@gmail.com>
3111
3112 * powerpc.cc (Stub_table::do_write): Delete redundant Address
3113 typedef and invalid_address constant.
3114 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
3115 instantiate constants.
3116
db399005
ILT
31172012-12-06 Roland McGrath <mcgrathr@google.com>
3118
3119 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
3120 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
3121 * aclocal.m4: Regenerate.
3122 * configure: Regenerate.
3123 * Makefile.in: Regenerate.
3124 * testsuite/Makefile.in: Regenerate.
3125
aba6bc71
AM
31262012-12-07 Alan Modra <amodra@gmail.com>
3127
3128 * options.h (General_options): Add no_toc_optimize.
3129 * powerpc.cc (ok_lo_toc_insn): New function.
3130 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
3131
9e69ed50
AM
31322012-12-06 Alan Modra <amodra@gmail.com>
3133
3134 * options.h (General_options): Add plt_align, plt_static_chain,
3135 plt_thread_safe. Update stub_group_size help text.
3136 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
3137 for new plt_thread_safe_ var.
3138 (use_plt_offset): Correct comments.
3139 (Target_powerpc::do_relax): Look for thread creation symbols to
3140 determine default plt_thread_safe value. Clear plt call stubs
3141 as well as branch stubs each iteration.
3142 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
3143 insn constants.
3144 (l, hi, ha, write_insn): Move earlier.
3145 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
3146 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
3147 plt stubs too.
3148 (Stub_table::update_size): Adjust.
3149 (Stub_table::prev_size, set_prev_size): Delete.
3150 (Stub_table::stub_align): Let --plt-align affect result.
3151 (Stub_table::plt_call_size): Calculate sizes for various stubs.
3152 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
3153 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
3154 (Stub_table::do_write): Support more stub variants.
3155
f43ba157
AM
31562012-12-04 Alan Modra <amodra@gmail.com>
3157
3158 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
3159 (Target_powerpc::do_define_standard_symbols): New function.
3160
34171bc5
AM
31612012-12-03 Alan Modra <amodra@gmail.com>
3162
3163 * output.h: Formatting, whitespace.
3164
dc9589e9 31652012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
3166
3167 * layout.h (Layout::get_executable_sections): Declare.
3168 * layout.cc (Layout::get_executable_sections): New function.
3169 * arm.cc (Target_arm::group_sections): Use it.
3170 (Arm_output_section::group_sections): Delete now redundant test.
3171 * output.cc (Output_reloc::Output_reloc): Add is_relative.
3172 param to handle relative relocs.
3173 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
3174 (Output_data_reloc::add_absolute): Adjust.
3175 (Output_data_reloc::add_relative): New function.
3176 (Output_data::reset_data_size): New function.
3177 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
3178 (Output_section::set_addralign): New function.
3179 (Output_section::checkpoint_set_addralign): New function.
3180 (Output_section::clear_section_offsets_need_adjustment): New function.
3181 (Output_section::input_sections): Make public.
3182 * powerpc.cc (class Output_data_brlt_powerpc): New.
3183 (class Stub_table, class Stub_control): New.
3184 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
3185 stub_table_, set_stub_table, stub_table): New vectors and accessor
3186 functions.
3187 (Target_powerpc::do_may_relax, do_relax, push_branch,
3188 new_stub_table, stub_tables, brlt_section, group_sections,
3189 add_branch_lookup_table, find_branch_lookup_table,
3190 write_branch_lookup_table, make_brlt_section): New functions.
3191 (Target_powerpc::struct Sort_sections, class Branch_info): New.
3192 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
3193 branch_info_): New vars.
3194 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
3195 make call stubs here.
3196 (Output_data_glink): Remove all call stub handling from this class.
3197 (Target_powerpc::Scan::local, global): Save interesting branch
3198 relocs and relocs for ifunc. Adjust calls to plt entry functions.
3199 (Target_powerpc::do_finalize_sections): Only make reg save/restore
3200 functions on final link.
3201 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
3202 Handle long branch destinations too.
3203 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
3204 do_plt_address_for_local): Adjust lookup of plt call stubs.
3205
627b30b7
AM
32062012-11-30 Alan Modra <amodra@gmail.com>
3207
3208 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
3209 relocs against protected symbols when building 32-bit shared libs.
3210
40b469d7
AM
32112012-11-30 Alan Modra <amodra@gmail.com>
3212
3213 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
3214 param. Call got_section() to make .got. Update all callers
3215 and their callers and so on.
3216
bb66a627
AM
32172012-11-30 Alan Modra <amodra@gmail.com>
3218
3219 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
3220 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
3221 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
3222 value if it already exists.
3223
d2cf1c6c
L
32242012-11-19 H.J. Lu <hongjiu.lu@intel.com>
3225
3226 PR gold/14858
3227 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
3228
edccdf7c
RM
32292012-11-14 Roland McGrath <mcgrathr@google.com>
3230
3231 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
3232 than bfc instruction for data sandboxing.
3233
6febeb74
AM
32342012-11-08 Alan Modra <amodra@gmail.com>
3235
3236 * po/POTFILES.in: Regenerate.
3237
0a6f1bf2
AM
32382012-11-05 Alan Modra <amodra@gmail.com>
3239
3240 * configure.ac: Apply 2012-09-10 change to config.in here.
3241 * configure: Regenerate.
3242
26a4e9cb
AM
32432012-11-05 Alan Modra <amodra@gmail.com>
3244
3245 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
3246 (struct Opd_ent): Use "Address" rather than "Offset".
3247 (Output_data_got_powerpc::got_base_offset): Return Valtype.
3248 (Target_powerpc::got_section): Make public.
3249 (Target_powerpc::scan_relocs): Move code setting symbols..
3250 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
3251 Create _SDA_BASE_ only when referenced.
3252
cc928013
RM
32532012-11-02 Roland McGrath <mcgrathr@google.com>
3254
3255 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
3256 from last change.
3257
50ed5eb1
RM
32582012-11-01 Roland McGrath <mcgrathr@google.com>
3259
62fe925a
RM
3260 * target.h (Sized_target::relocate_relocs): Use Elf_Off
3261 for offset_in_output_section parameter.
3262 (Sized_target::relocate_special_relocatable): Likewise.
3263 * arm.cc (Target_arm::relocate_relocs): Likewise.
3264 (Target_arm::relocate_special_relocatable): Likewise.
3265 * i386.cc (Target_i386::relocate_relocs): Likewise.
3266 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
3267 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
3268 * target-reloc.h (relocate_relocs): Likewise.
3269 * testsuite/testfile.cc (Target_test): Likewise.
3270 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
3271 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
3272
3273 * system.h: Move inclusion of <clocale> to after <libintl.h> in
3274 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
3275
3276 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
3277 parameter, which is unused in the [!F_SETFD] case.
3278
50ed5eb1
RM
3279 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
3280 SYMNDX to off_t before comparing it to this->data_size().
3281 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
3282 * incremental.cc (Output_section_incremental_inputs::do_write):
3283 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
3284
2cadc0bf
RM
3285 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
3286
3bfcb652
NC
32872012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
3288
3289 * gold.cc (Target_arm::do_adjust_elf_header): Add the
3290 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
3291 in EABI_VER5.
3292
c1a8d56e
CC
32932012-10-29 Cary Coutant <ccoutant@google.com>
3294
3295 * dwp.cc (usage): Add file and exit status parameters;
3296 add --help and --version options.
3297 (print_version): New function.
3298 (main): Add --help and --version options.
3299
b2490a7b
L
33002012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3301
3302 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
3303 final_layout_sequence.txt.
3304 * testsuite/Makefile.in: Regenerated.
3305
aa543512
L
33062012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3307
3308 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
3309 COMPILE generated by automake.
3310 (LINK1): Likewise.
3311 (CXXCOMPILE1): Likewise.
3312 (CXXLINK1): Likewise.
3313 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
3314 (LINK): Likewise.
3315 (CXXCOMPILE): Likewise.
3316 (CXXLINK): Likewise.
3317 * testsuite/Makefile.in: Regenerated.
3318
d361fafb
L
33192012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3320
3321 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
3322 on bad fwrite return.
3323
598c7410
L
33242012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3325
3326 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
3327 on val.
3328
35c813e2
CC
33292012-10-23 Cary Coutant <ccoutant@google.com>
3330
3331 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
3332 * testsuite/Makefile.in: Regenerate.
3333 * testsuite/dwp_test.h: New source file.
3334 * testsuite/dwp_test_1.cc: New source file.
3335 * testsuite/dwp_test_1.s: New source file.
3336 * testsuite/dwp_test_1.sh: New source file.
3337 * testsuite/dwp_test_1b.cc: New source file.
3338 * testsuite/dwp_test_1b.s: New source file.
3339 * testsuite/dwp_test_2.cc: New source file.
3340 * testsuite/dwp_test_2.s: New source file.
3341 * testsuite/dwp_test_2.sh: New source file.
3342 * testsuite/dwp_test_main.cc: New source file.
3343 * testsuite/dwp_test_main.s: New source file.
3344
77429909
CC
33452012-10-23 Cary Coutant <ccoutant@google.com>
3346
3347 * dwp.h: New header file.
3348 * dwp.cc: New source file.
3349 * gold.h: Move shared declarations to system.h.
3350 * system.h: New header file.
3351 * Makefile.am: Add dwp.
3352 * Makefile.in: Regenerate.
3353
ed5d6712
CC
33542012-10-23 Cary Coutant <ccoutant@google.com>
3355
3356 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
3357 Dwarf_info_reader::read_from_pointer.
3358 (Dwarf_pubnames_table::read_header): Likewise.
3359 (Dwarf_pubnames_table::next_name): Likewise.
3360 (Dwarf_die::read_attributes): Likewise.
3361 (Dwarf_die::skip_attributes): Likewise.
3362 (Dwarf_info_reader::read_from_pointer): New function template.
3363 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
3364 (Dwarf_pubnames_table): Likewise.
3365 (Dwarf_info_reader::read_from_pointer): New function template.
3366 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
3367 Dwarf_pubnames_table ctor.
3368
8787852d
CC
33692012-10-23 Cary Coutant <ccoutant@google.com>
3370
3371 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
3372 abbrev_shndx.
3373 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
3374 abbrev_shndx_.
3375 (Dwarf_info_reader::set_abbrev_shndx): New method.
3376 (Dwarf_info_reader::abbrev_shndx_): New data member.
3377
9fc236f3
CC
33782012-10-23 Cary Coutant <ccoutant@google.com>
3379
3380 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
3381 from object, not parameters.
3382 (Dwarf_info_reader::parse): Likewise.
3383 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
3384 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
3385 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
3386 methods.
3387
effe8365
CC
33882012-10-23 Cary Coutant <ccoutant@google.com>
3389
3390 * fileread.cc (Input_file::Input_file): New constructor.
3391 * fileread.h (class Input_file): Add new constructor.
3392
1698990d
AM
33932012-10-18 Alan Modra <amodra@gmail.com>
3394
3395 PR gold/14727
3396 * object.cc (Relobj::is_section_name_included): Also match
3397 .sdata personality section.
3398
168a4726
AM
33992012-10-18 Alan Modra <amodra@gmail.com>
3400
3401 * target-reloc.h (class Default_comdat_behavior): New, package up..
3402 (get_comdat_behaviour): ..this.
3403 (relocate_section): Add Relocate_comdat_behavior template arg,
3404 adjust code to suit.
3405 * arm.cc (Target_arm::relocate_section): Adjust to suit.
3406 (Target_arm::scan_reloc_section): Likewise.
3407 * i386.cc (Target_i386::relocate_section): Likewise.
3408 * sparc.cc (Target_sparc::relocate_section): Likewise.
3409 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
3410 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
3411 * powerpc.cc (class Relocate_comdat_behavior): New.
3412 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
3413 gold::relocate_section with new template arg.
3414
acc276d8
AM
34152012-10-18 Alan Modra <amodra@gmail.com>
3416
3417 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
3418 dynamic relocs for GOT_TPREL got entries, without symbol if
3419 resolving locally.
3420 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
3421 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
3422 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
3423
e10f9870
AM
34242012-10-17 Alan Modra <amodra@gmail.com>
3425
3426 PR gold/14726
3427 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
3428
ae034989
ST
34292012-10-16 Sriraman Tallam <tmsriram@google.com>
3430
3431 * layout.cc (Layout::include_section): Keep sections marked
3432 SHF_EXCLUDE when doing relocatable links.
3433
f3a0ed29
AM
34342012-10-16 Alan Modra <amodra@gmail.com>
3435
3436 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
3437 (Target_powerpc::do_finalize_sections): Call it.
3438 (Output_data_save_res): New class and supporting functions.
3439 (Target_powerpc::symval_for_branch): Only look up .opd entry for
3440 normal symbols defined in object files.
3441
c6de8ed4
AM
34422012-10-12 Alan Modra <amodra@gmail.com>
3443
3444 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
3445 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
3446 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
3447 section if scan_opd_relocs not yet called.
3448 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
3449
03e25981
AM
34502012-10-12 Alan Modra <amodra@gmail.com>
3451
3452 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3453 add_local_ifunc_entry): Revert last change.
3454 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
3455
c9824451
AM
34562012-10-05 Alan Modra <amodra@gmail.com>
3457
3458 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
3459 do_plt_address_for_global): New functions.
3460 (Output_data_got_powerpc::do_write): Don't segfault when linking
3461 statically.
3462 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3463 add_local_ifunc_entry): Return true on adding entry..
3464 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
3465 glink->add_entry call. Remove unused symtab param. Adjust calls.
3466 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
3467 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
3468 set up symbols here.
3469 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
3470 syms here. Do so even when no .iplt. Don't segfault when linking
3471 statically.
3472 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
3473 new variants without reloc param.
3474 (Glink_sym_ent::Glink_sym_ent): Likewise.
3475 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
3476 reloc when refs will resolve to plt call stub.
3477 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
3478 R_PPC_PLTREL24 to resolve locally.
3479 (Target_powerpc::Scan::global): Correct ifunc handling.
3480 (Target_powerpc::Relocate::relocate): Correct local sym glink
3481 lookup. Don't destroy "value" when we have a plt call stub,
3482 and when checking plt call validity.
3483 (Target_powerpc::do_dynsym_value): Simplify.
3484
19fec8c1
AM
34852012-10-05 Alan Modra <amodra@gmail.com>
3486
3487 * i386.cc (Output_data_plt_i386::address_for_global,
3488 address_for_local): Add plt offset to returned value. Adjust uses.
3489 * sparc.cc (Output_data_plt_sparc::address_for_global,
3490 address_for_local): Likewise.
3491 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
3492 address_for_local): Likewise.
3493 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
3494 address_for_local): Likewise.
3495 * target.h (Target::plt_address_for_global, plt_address_for_local):
3496 Update comment.
3497 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
3498 (Output_data_got::Got_entry::write): Nor here.
3499 * output.h: Comment fix.
3500
e867b647
WL
35012012-10-02 Jiong Wang <jiwang@tilera.com>
3502
3503 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
3504 global_offset_table_ value for larget got.
3505 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
3506
e5d5f5ed
AM
35072012-09-29 Alan Modra <amodra@gmail.com>
3508
3509 * powerpc.cc (Target_powerpc::iplt_): New output section.
3510 (Target_powerpc::iplt_section, make_iplt_section,
3511 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
3512 (Target_powerpc::make_plt_entry): Handle ifunc syms.
3513 Target_powerpc::plt_entry_count): Count iplt entries too.
3514 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
3515 reloc section in constructor. New params.
3516 (Target_powerpc::make_plt_section): Create reloc section here instead.
3517 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
3518 functions.
3519 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
3520 (Output_data_glink::add_entry, find_entry): New functions to
3521 deal with local syms.
3522 (Glink_sym_ent): Add support for local syms.
3523 (Output_data_glink::do_write): Handle ifunc plt entries.
3524 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3525 (Target_powerpc::Scan::local, global): Handle ifunc syms.
3526 (Target_powerpc::Relocate::relocate): Likewise.
3527 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
3528
ec4dbad3
AM
35292012-09-25 Alan Modra <amodra@gmail.com>
3530
3531 * object.h (Sized_relobj_file::adjust_local_symbol,
3532 do_adjust_local_symbol): New functions.
3533 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
3534 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
3535 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
3536 and irregular opd entry spacing.
3537 (Powerpc_relobj::do_read_relocs): Add opd size checks.
3538 (Global_symbol_visitor_opd): New functor.
3539 (Target_powerpc::do_finalize_sections): Omit global symbols defined
3540 on deleted opd entries.
3541
5c0b3823
WL
35422012-09-15 Jiong Wang <jiwang@tilera.com>
3543
3544 * tilegx.cc: New file.
3545 * Makefile.am (TARGETSOURCES): Add tilegx.cc
3546 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
3547 * configure.tgt: Add entries for tilegx*.
3548 * configure.ac: Likewise.
3549 * Makefile.in: Rebuild.
3550 * configure: Likewise.
3551 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
3552 tilegx.
3553
bfdfa4cd
AM
35542012-09-13 Alan Modra <amodra@gmail.com>
3555
3556 * target-reloc.h (scan_relocs): Call scan.local for relocs
3557 against symbols in discarded sections. Pass is_discarded
3558 param.
3559 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
3560 Add is_discarded param.
3561 * powerpc (Target_powerpc::Scan::local): Likewise. Use
3562 is_discarded to flag opd entry as discarded. Don't emit dyn
3563 relocs on such entries.
3564 (Target_powerpc::Scan::global): Similarly detect and handle
3565 such opd entries.
3566 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
3567 opd_ent_. Update all uses.
3568 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
3569 (Target_powerpc::relocate_section): Zero out discarded opd
3570 entry relocs.
3571
d77a0555
ILT
35722012-09-12 Ian Lance Taylor <iant@google.com>
3573
3574 PR gold/14570
3575 * output.cc: Rename Output_data_got template parameter from size
3576 to got_size for all functions. Compile all variants of
3577 Output_data_got.
3578 (Output_data_got::Got_entry::write): Correct use of size for
3579 symbol value. Use local_is_tls rather than casting to
3580 Sized_relobj_file.
3581 * object.h (class Object): Add local_is_tls and do_local_is_tls.
3582 (class Sized_relobj_file): Add do_local_is_tls.
3583 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
3584
815a1205
AM
35852012-09-11 Alan Modra <amodra@gmail.com>
3586
3587 PR gold/14566
3588 * layout.cc (Layout::set_segment_offsets): When using
3589 common-page-size alignment, ensure we are on a new max-page-size
3590 page.
3591 * output.cc (Output_segment::set_section_addresses): Use
3592 abi_pagesize, not common_pagesize for relro boundary.
3593 (Output_segment::set_offset): Likewise.
3594
bd73a62d
AM
35952012-09-11 Alan Modra <amodra@gmail.com>
3596
3597 * output.h (Output_data_got::add_global_tls, add_local_tls,
3598 add_local_tls_pair): New functions.
3599 (Output_data_got::add_local_pair_with_rel): Remove second
3600 reloc param. Expand comment.
3601 (Output_data_got::Got_entry): Rename use_plt_offset_ to
3602 use_plt_or_tls_offset_, similarly for constructor param.
3603 (Output_data_got::Got_entry::write): Add got_index param.
3604 * output.cc (Output_data_got::add_global_tls, add_local_tls,
3605 add_local_tls_pair): New functions.
3606 (Output_data_got::Got_entry::write): Handle tls symbols
3607 with use_plt_or_tls_offset_ set specially.
3608 (Output_data_got::add_local_pair_with_rel): Only one reloc.
3609 (Output_data_got::do_write): Replace iterator with index, pass
3610 index to entry write function.
3611 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
3612 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
3613 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
3614 call.
3615 * i386.cc (Target_i386::Scan::local): Likewise.
3616 * sparc.cc (Target_sparc::Scan::local): Likewise.
3617 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
3618 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
3619 do_tls_offset_for_global): New functions.
3620 (Target_powerpc::Scan::local): Correct TLS relocations and got
3621 entry values.
3622 (Target_powerpc::Scan::global): Don't emit unnecessary
3623 dynamic relocations on TLS GOT entries.
3624
00716ab1
AM
36252012-09-10 Matthias Klose <doko@ubuntu.com>
3626
3627 * config.in: Disable sanity check for kfreebsd.
3628
c891b3f9
SA
36292012-09-10 Sterling Augustine <saugustine@google.com>
3630
3631 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
3632 (Gdb_index::pubtypes_read): New parameter.
3633 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
3634 to calls.
3635 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
3636 pubtypes_object_.
3637
e81fea4d
AM
36382012-09-09 Alan Modra <amodra@gmail.com>
3639
3640 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
3641 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
3642 * gc.h (gc_process_relocs): Call target gc_add_reference.
3643 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
3644 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
3645 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
3646 unnecessary cast.
3647 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
3648 to cater for when we don't need code offset. Update use.
3649 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
3650 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
3651 set_opd_valid): New functions.
3652 (Target_powerpc::do_gc_add_reference): New function.
3653 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
3654 stashed refs.
3655 (Target_powerpc::do_gc_mark_symbol): New function.
3656
d2d60eef
CC
36572012-09-06 Cary Coutant <ccoutant@google.com>
3658
3659 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
3660 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
3661 (Dwarf_die::skip_attributes): Likewise.
3662 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
3663 * testsuite/gdb_index_test.cc (inline_func_1): New function.
3664 (main): Call it.
3665 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
3666
32ed4573
L
36672012-09-05 H.J. Lu <hongjiu.lu@intel.com>
3668
3669 * testsuite/script_test_3.t: Add .got.plt output section
3670 statement.
3671 * testsuite/script_test_4.t: Likewise.
3672
f4baf0d4
AM
36732012-09-05 Alan Modra <amodra@gmail.com>
3674
3675 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
3676 update all uses and lose "enum" when using type.
3677
864a1b56
AM
36782012-09-05 Alan Modra <amodra@gmail.com>
3679
3680 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
3681 * configure: Regenerate.
3682 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
3683 (plugin_final_layout.stdout): Likewise.
3684 (memory_test): Set page sizes to 0x1000.
3685 * testsuite/Makefile.in: Regenerate.
3686 * testsuite/discard_locals_test.sh: Add FIXME comment.
3687 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
3688 * testsuite/pr14265.t: Add .got output section statement.
3689 * testsuite/script_test_2.t: Likewise.
3690 * testsuite/script_test_3.t: Likewise.
3691 * testsuite/script_test_4.t: Likewise.
3692 * testsuite/script_test_5.t: Likewise.
3693 * testsuite/script_test_6.t: Likewise.
3694 * testsuite/script_test_7.t: Likewise.
3695 * testsuite/script_test_9.t: Likewise.
3696
3ea0a085
AM
36972012-09-05 Alan Modra <amodra@gmail.com>
3698
3699 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
3700 (Powerpc_relocate_functions::Status): New typedef.
3701 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3702 (Target_powerpc::Scan::local): Handle REL64.
3703 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
3704 for REL32 and REL64.
3705 (Target_powerpc::symval_for_branch): New function, extracted from..
3706 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
3707 checks. Report overflow errors.
3708
7404fe1b
AM
37092012-09-05 Alan Modra <amodra@gmail.com>
3710
3711 * object.h (Sized_relobj_file::emit_relocs): Delete.
3712 (Sized_relobj_file::emit_relocs_reltype): Delete.
3713 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
3714 relocate_relocs for --emit-relocs.
3715 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
3716 * output.h: Update comment.
3717 (Output_segment::first_section): New function.
3718 (Output_segment::first_section_load_address): Use first_section.
3719 * output.cc (Output_segment::first_section): New function extracted..
3720 (Output_segment::first_section_load_address): ..from here. Delete.
3721 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
3722 * target.h (Sized_target::relocate_for_relocatable): Likewise.
3723 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
3724 adjust call to target.h function.
3725 * i386.cc (Target_i386): Likewise.
3726 * sparc.cc (Target_sparc): Likewise.
3727 * x86_64.cc (Target_x86_64): Likewise.
3728 * powerpc.cc (Target_powerpc): Likewise.
3729 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
3730 first tls section has section symbol for optimised local dynamic
3731 output relocs.
3732 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
3733 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
3734 optimised tls code.
3735 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
3736 Rename to relocate_relocs. Update error message.
3737
957564c9
AS
37382012-09-04 Andreas Schwab <schwab@linux-m68k.org>
3739
3740 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
3741 --just-symbols.
3742
dd93cd0a
AM
37432012-08-31 Alan Modra <amodra@gmail.com>
3744
3745 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
3746 (Powerpc_relobj::toc_base_offset): New stub function.
3747 (Target_powerpc): Add tp_offset, dtp_offset. Rename
3748 got_mod_index_offset to tlsld_got_offset. Update all refs.
3749 (Target_powerpc::Relocate::enum skip_tls): New.
3750 (Target_powerpc::call_tls_get_addr_): New var.
3751 (Target_powerpc::is_branch_reloc): Move to file scope.
3752 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
3753 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
3754 New functions.
3755 (Target_powerpc::enum Got_type): Delete old values, add new ones.
3756 (powerpc_info): Correct common_pagesize for ppc64.
3757 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
3758 (Powerpc_relocate_functions): Add overflow check enums and functions.
3759 Add non-shift version of rela, rela_ua. Delete all rel public
3760 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
3761 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
3762 addr16_ha3, addr14 functions.
3763 (Output_data_got_powerpc::add_constant_pair): New function.
3764 (Output_data_got_powerpc::got_base_offset): Likewise.
3765 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
3766 (instruction constants): Sort, add some more.
3767 (Output_data_glink::do_write): Add and use Address typedef. Use
3768 object->toc_base_offset() stub for 64-bit.
3769 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
3770 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3771 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
3772 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
3773 Always treat .opd relocs as against locally defined symbol.
3774 Correct condition for RELATIVE relocs.
3775 (Target_powerpc::do_finalize_sections): Test for NULL sections.
3776 (Target_powerpc::Relocate::relocate): Use plt call stub as value
3777 for 32-bit syms with a plt entry. Correct ppc64 toc base
3778 calculations. Handle TLS relocs, and more. Add overflow
3779 checking and adjust for Powerpc_relocate_functions changes.
3780 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
3781 Reinstate --emit-relocs code with FIXME.
3782
a1373b60
AM
37832012-08-30 Alan Modra <amodra@gmail.com>
3784
3785 * layout.cc (Layout::set_segment_offsets): Set p_align to
3786 abi_pagesize, not common_pagesize.
3787 (Layout::relaxation_loop_body): Similarly use abi_pagesize
3788 to determine whether file header can go in segment.
3789
703d02da
AM
37902012-08-30 Alan Modra <amodra@gmail.com>
3791
3792 * output.h (Output_reloc::Output_reloc <output section>): Add
3793 is_relative param. Adjust calls.
3794 (Output_reloc::add_output_section_relative): New functions.
3795 * output.cc (Output_reloc::Output_reloc <output section>): Handle
3796 is_relative.
3797 (Output_reloc::symbol_value): Handle SECTION_CODE.
3798
16164a6b
ST
37992012-08-24 Sriraman Tallam <tmsriram@google.com>
3800
3801 * gold.cc (queue_middle_tasks): Call layout again when unique
3802 segments for sections is desired.
3803 * layout.cc (Layout::Layout): Initialize new members.
3804 (Layout::get_output_section_flags): New function.
3805 (Layout::choose_output_section): Call get_output_section_flags.
3806 (Layout::layout): Make output section for mapping to a unique segment.
3807 (Layout::insert_section_segment_map): New function.
3808 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 3809 output sections marked so.
16164a6b
ST
3810 (Layout::segment_precedes): Check for unique segments when sorting.
3811 * layout.h (Layout::Unique_segment_info): New struct.
3812 (Layout::Section_segment_map): New typedef.
3813 (Layout::insert_section_segment_map): New function.
3814 (Layout::get_output_section_flags): New function.
3815 (Layout::is_unique_segment_for_sections_specified): New function.
3816 (Layout::set_unique_segment_for_sections_specified): New function.
3817 (Layout::unique_segment_for_sections_specified_): New member.
3818 (Layout::section_segment_map_): New member.
3819 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
3820 Rename is_gc_pass_one to is_pass_one.
3821 Rename is_gc_pass_two to is_pass_two.
3822 Rename is_gc_or_icf to is_two_pass.
3823 Check for which pass based on whether symbols data is present.
3824 Make it two pass when unique segments for sections is desired.
3825 * output.cc (Output_section::Output_section): Initialize new
3826 members.
3827 * output.h (Output_section::is_unique_segment): New function.
3828 (Output_section::set_is_unique_segment): New function.
3829 (Output_section::is_unique_segment_): New member.
3830 (Output_section::extra_segment_flags): New function.
3831 (Output_section::set_extra_segment_flags): New function.
3832 (Output_section::extra_segment_flags_): New member.
3833 (Output_section::segment_alignment): New function.
3834 (Output_section::set_segment_alignment): New function.
3835 (Output_section::segment_alignment_): New member.
3836 (Output_segment::Output_segment): Initialize is_unique_segment_.
3837 (Output_segment::is_unique_segment): New function.
3838 (Output_segment::set_is_unique_segment): New function.
3839 (Output_segment::is_unique_segment_): New member.
3840 * plugin.cc (allow_unique_segment_for_sections): New function.
3841 (unique_segment_for_sections): New function.
3842 (Plugin::load): Add new functions to transfer vector.
3843 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
3844 * Makefile.in: Regenerate.
3845 * testsuite/plugin_final_layout.sh: Check if unique segment
3846 functionality works.
3847 * testsuite/plugin_section_order.c (onload): Check if new interfaces
3848 are available.
3849 (allow_unique_segment_for_sections): New global.
3850 (unique_segment_for_sections): New global.
3851 (claim_file_hook): Call allow_unique_segment_for_sections.
3852 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 3853
1e2bee4f
CC
38542012-08-22 Cary Coutant <ccoutant@google.com>
3855
3856 * layout.cc (Layout::include_section): Don't assert on GROUP
3857 sections with --emit-relocs.
3858
1d5dfe78
CC
38592012-08-21 Cary Coutant <ccoutant@google.com>
3860
3861 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
3862 if --export-dynamic-symbol names an undef symbol.
3863
c9269dff
AM
38642012-08-18 Alan Modra <amodra@gmail.com>
3865
3866 * powerpc.cc: Formatting and white space.
3867 (Powerpc_relobj): Rename got2_section_ to special_.
3868 Add opd_ent_shndx_ and opd_ent_off_ vectors.
3869 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
3870 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
3871 (Target_powerpc): Add Address typedef and invalid_address. Use
3872 throughout.
3873 (Target_powerpc::is_branch_reloc): New function.
3874 (Powerpc_relocate_functions): Add Address typedef, use throughout.
3875 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
3876 for dst_mask, value and addend.
3877 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
3878 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
3879 (Output_data_glink::do_write): Correct toc base. Don't try to use
3880 uint16_t for 24-bit offset. Use get_output_section_offset and
3881 check return.
3882 (Target_powerpc::Scan::local): Handle more relocs.
3883 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
3884 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
3885 Plug in toc restoring insn after plt calls. Translate branches
3886 to function descriptor symbols to corresponding entry point.
3887 (Target_powerpc::relocate_for_relocatable): Check return from
3888 get_output_section_offset.
3889 * symtab.h: Comment typo.
3890
b1759dce
ILT
38912012-08-14 Ian Lance Taylor <iant@google.com>
3892
3893 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
3894 unsupported_relocal_local to call unsupported_reloc_global.
3895
b9b2ae8b
NC
38962012-08-14 Nick Clifton <nickc@redhat.com>
3897
3898 PR ld/14265
3899 * script-sections.cc (Sections_element::output_section_name): Add
3900 keep return parameter.
3901 (Output_section_element::match_name): Add keep return parameter.
3902 Return the value of the keep_ member.
3903 * script-sections.h (class Output_section): Update
3904 output_section_name prototype.
3905 * layout.cc (Layout::keep_input_section): New public member
3906 function.
3907 (Layout::choose_output_section): Pass keep parameter to
3908 output_section_name.
3909 * layout.h (class Layout): Add keep_input_section.
3910 * object.cc (Sized_relobj_file::do_layout): Check for kept input
3911 sections.
3912 * testsuite/Makefile.am: Add a test.
3913 * testsuite/Makefile.in: Regenerate.
3914 * testsuite/pr14265.c: Source file for the test.
3915 * testsuite/pr14265.t: Linker script for the test.
3916 * testsuite/pr14265.sh: Shell script for the test.
3917
921b5322
AM
39182012-08-14 Alan Modra <amodra@gmail.com>
3919
3920 * target.h (Target::output_section_name): New function.
3921 (Target::do_output_section_name): New function.
3922 * layout.cc (Layout::choose_output_section): Call the above.
3923 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
3924
6ce78956
AM
39252012-08-14 Alan Modra <amodra@gmail.com>
3926
3927 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
3928 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
3929 for replace_constant call.
3930 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
3931 (Output_data_glink::do_print_to_mapfile): New function.
3932 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
3933 (Target_powerpc::Relocate::relocate): Likewise.
3934
d1a8cabd
AM
39352012-08-14 Alan Modra <amodra@gmail.com>
3936
3937 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
3938 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
3939 (Output_data_glink::add_entry,find_entry): Remove shndx param.
3940 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
3941 all references to shndx_. Handle special case for R_PPC_PLTREL24
3942 here.
3943 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
3944 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
3945 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
3946 here.
3947 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
3948 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
3949
d83ce4e3
AM
39502012-08-12 Alan Modra <amodra@gmail.com>
3951
3952 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
3953 (glink insn constants): Use uint32_t.
3954 (Output_data_glink::add_entry): Use insert, not [] operator.
3955
cf43a2fe
AM
39562012-08-11 Alan Modra <amodra@gmail.com>
3957
3958 * object.h (Sized_relobj_file::find_shdr): New function.
3959 (Sized_relobj_file::find_special_sections): New function.
3960 * object.cc (Sized_relobj_file::find_shdr): New function.
3961 (Sized_relobj_file::find_eh_frame): Use find_shdr.
3962 (Sized_relobj_file::find_special_sections): New function, split out..
3963 (Sized_relobj_file::do_read_symbols): ..from here.
3964 * output.h (Output_data_got::replace_constant): New function.
3965 (Output_data_got::num_entries): New function.
3966 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
3967 (Output_data_got::got_offset): Protected rather than private.
3968 (Output_data_got::replace_got_entry): New function.
3969 * output.cc (Output_data_got::replace_got_entry): New function.
3970 * powerpc.cc (class Powerpc_relobj): New.
3971 (class Powerpc_relocate_functions): Delete all psymval variants or
3972 convert to value,addend type. Delete pcrela, pcrela_unaligned.
3973 Implement _ha functions using corresponding _hi function.
3974 (Powerpc_relobj::find_special_sections): New function.
3975 (Target_powerpc::do_make_elf_object): New function.
3976 (class Output_data_got_powerpc): New.
3977 (class Output_data_glink): New.
3978 (class Powerpc_scan_relocatable_reloc): New.
3979 Many more changes througout file.
3980
3c892704
NC
39812012-08-09 Nick Clifton <nickc@redhat.com>
3982
3983 * po/vi.po: Updated Vietnamese translation.
3984
82435b3b
ILT
39852012-08-07 Ian Lance Taylor <iant@google.com>
3986
3987 * layout.cc (Layout::add_target_dynamic_tags): If
3988 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
3989 plt_rel.
3990
a6dc81d2
NC
39912012-07-30 Nick Clifton <nickc@redhat.com>
3992
3993 * po/gold.pot: Updated template.
3994 * po/es.po: Updated Spanish translation.
3995
f1415016
CC
39962012-07-18 Cary Coutant <ccoutant@google.com>
3997
3998 PR gold/14344
3999 * configure.ac: Add check for -gpubnames support.
4000 * configure: Regenerate.
4001 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
4002 support; force -gno-pubnames.
4003 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
4004 support.
4005 (gdb_index_test_4): New test.
4006 * testsuite/Makefile.in: Regenerate.
4007 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
4008 * testsuite/gdb_index_test_2.sh: Likewise.
4009 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
4010 * testsuite/gdb_index_test_4.sh: New script.
4011 * testsuite/gdb_index_test_comm.sh: New script with common code;
4012 don't look for space after colon.
4013
b7fd7c37
ST
40142012-07-16 Sriraman Tallam <tmsriram@google.com>
4015
4016 * gold.cc (queue_middle_tasks): Update function order only after
4017 deferred objects due to plugins are processed.
4018
1f3212db
ILT
40192012-07-11 Ian Lance Taylor <iant@google.com>
4020
4021 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
4022 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
4023 (Target_arm::scan_reloc_for_stub): Likewise.
4024 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
4025 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
4026 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
4027 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
4028 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
4029
81c82a68
ILT
40302012-07-10 Dodji Seketeli <dodji@redhat.com>
4031 Ian Lance Taylor <iant@google.com>
4032
4033 PR gold/14309
4034 * configure.ac: Test whether std::tr1::hash<off_t> works.
4035 * gold.h: Add a specialization for std::tr1::hash<off_t> if
4036 needed.
4037 * output.h (class Output_fill): Add virtual destructor.
4038 * configure, config.in: Rebuild.
4039
eabc84f4
RM
40402012-06-22 Roland McGrath <mcgrathr@google.com>
4041
4042 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
4043
370e30b6
RÁE
40442012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
4045
4046 * plugin.cc (Plugin::load): Handle position independent executables.
4047
fb1b895d
CC
40482012-06-06 Cary Coutant <ccoutant@google.com>
4049
4050 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
4051 add .debug_macro.
4052 (lines_only_debug_sections): Likewise.
4053 (gdb_fast_lookup_sections): New static array.
4054 (is_gdb_debug_section): Rename formal parameter.
4055 (is_lines_only_debug_section): Likewise.
4056 (is_gdb_fast_lookup_section): New function.
4057 (Layout::include_section): Check for ".zdebug_" prefix; pass
4058 section name suffix to is_gdb_debug_section, et al.; check for
4059 fast-lookup sections when building .gdb_index.
4060 * options.h (--strip-debug-gdb): Update GDB version number.
4061
7c0640fa
CC
40622012-06-06 Cary Coutant <ccoutant@google.com>
4063
4064 * configure.ac: Add check for fallocate.
4065 * configure: Regenerate.
4066 * config.in: Regenerate.
4067
4068 * options.h (class General_options): Add --mmap-output-file and
4069 --posix-fallocate options.
4070 * output.cc: (posix_fallocate): Remove; replace with...
4071 (gold_fallocate): New function.
4072 (Output_file::map_no_anonymous): Call gold_fallocate.
4073 (Output_file::map): Check --mmap-output-file option.
4074
2a49eb69
DK
40752012-06-05 Jing Yu <jingyu@google.com>
4076
4077 * gold.h (textdomain): Add do {} to empty while(0).
4078 (bindtextdomain): Likewise.
4079
fad072ac
CC
40802012-06-04 Cary Coutant <ccoutant@google.com>
4081
4082 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
4083 has_dynsym_index.
4084
8cc69fb6
ST
40852012-05-25 Sriraman Tallam <tmsriram@google.com>
4086
4087 * symtab.cc (Symbol_table::define_special_symbol):
4088 Initialize *poldsym to prevent uninitialized variable errors.
4089
1be75daa
CC
40902012-05-23 Cary Coutant <ccoutant@google.com>
4091
4092 * layout.cc (Layout::section_name_mapping): Add rules to handle
4093 exact match on .data.rel.ro.local or .data.rel.ro.
4094 (Layout::output_section_name): Check for exact matches.
4095
9b689de0
CC
40962012-05-23 Cary Coutant <ccoutant@google.com>
4097
4098 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
4099 more carefully.
4100
b24fdbf5
CC
41012012-05-22 Cary Coutant <ccoutant@google.com>
4102
4103 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
4104 object before exporting symbol.
4105
e550e1a2
L
41062012-05-21 H.J. Lu <hongjiu.lu@intel.com>
4107
4108 * testsuite/tls_test.cc: Include "config.h" first.
4109 * testsuite/tls_test_c.c: Likewise.
4110
df7b86aa
NC
41112012-05-17 Daniel Richard G. <skunk@iskunk.org>
4112 Nick Clifton <nickc@redhat.com>
4113
4114 PR 14072
4115 * configure.in: Add check that sysdep.h has been included before
4116 any system header files.
4117 * configure: Regenerate.
4118 * config.in: Regenerate.
4119
1007b503
CC
41202012-05-14 Cary Coutant <ccoutant@google.com>
4121
4122 * layout.cc (Layout::make_output_section): Mark .tdata section
4123 as RELRO.
4124 * testsuite/relro_test.cc: Add a TLS variable.
4125
fd885f3a
L
41262012-05-10 H.J. Lu <hongjiu.lu@intel.com>
4127
4128 PR gold/14091
4129 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
4130 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
4131 R_X86_64_64.
4132
80f5885c
CC
41332012-05-08 Cary Coutant <ccoutant@google.com>
4134
4135 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
4136 (lines_only_debug_sections): Likewise.
4137
2e702c99
RM
41382012-05-02 Roland McGrath <mcgrathr@google.com>
4139
4140 * nacl.cc: New file.
4141 * nacl.h: New file.
4142 * Makefile.am (CCFILES, HFILES): Add them.
4143 * Makefile.in: Regenerate.
4144 * i386.cc (Output_data_plt_i386_nacl): New class.
4145 (Output_data_plt_i386_nacl_exec): New class.
4146 (Output_data_plt_i386_nacl_dyn): New class.
4147 (Target_i386_nacl): New class.
4148 (Target_selector_i386_nacl): New class.
4149 (target_selector_i386): Use it instead of Target_selector_i386.
4150 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
4151 (Target_x86_64_nacl): New class.
4152 (Target_selector_x86_64_nacl): New class.
4153 (target_selector_x86_64, target_selector_x32): Use it instead of
4154 Target_selector_x86_64.
4155 * arm.cc (Output_data_plt_arm_nacl): New class.
4156 (Target_arm_nacl): New class.
4157 (Target_selector_arm_nacl): New class.
4158 (target_selector_arm, target_selector_armbe): Use it instead of
4159 Target_selector_arm.
4160
4161 * target-select.cc (select_target): Take new Input_file* and off_t
4162 arguments, pass them on to recognize method of selector.
4163 * object.cc (make_elf_sized_object): Update caller.
4164 * parameters.cc (parameters_force_valid_target): Likewise.
4165 * incremental.cc (make_sized_incremental_binary): Likewise.
4166 * target-select.h: Update decl.
4167 (Target_selector::recognize): Take new Input_file* argument,
4168 pass it on to do_recognize.
4169 (Target_selector::do_recognize): Take new Input_file* argument.
4170 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
4171 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
4172 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
4173 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
4174
4175 * target.h (Target::Target_info): New members isolate_execinstr
4176 and rosegment_gap.
4177 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
4178 * arm.cc (Target_arm::arm_info): Update initializer.
4179 * i386.cc (Target_i386::i386_info): Likewise.
4180 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
4181 * sparc.cc (Target_sparc::sparc_info): Likewise.
4182 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
4183 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
4184 * layout.cc (Layout::attach_allocated_section_to_segment):
4185 Take new const Target* argument. If target->isolate_execinstr(), act
4186 like --rosegment.
4187 (Layout::find_first_load_seg): Take new const Target* argument;
4188 if target->isolate_execinstr(), reject PF_X segments.
4189 (Layout::relaxation_loop_body): Update caller.
4190 (Layout::set_segment_offsets): If target->isolate_execinstr(),
4191 reset file offset to zero when we hit LOAD_SEG, and then do a second
4192 loop over the segments before LOAD_SEG to reassign offsets after
4193 addresses have been determined. Handle target->rosegment_gap().
4194 (Layout::attach_section_to_segment): Take new const Target* argument;
4195 pass it to attach_allocated_section_to_segment.
4196 (Layout::make_output_section): Update caller.
4197 (Layout::attach_sections_to_segments): Take new const Target* argument;
4198 pass it to attach_section_to_segment.
4199 * gold.cc (queue_middle_tasks): Update caller.
4200 * layout.h (Layout): Update method decls with new arguments.
4201
4202 * arm.cc (Target_arm::Target_arm): Take optional argument for the
4203 Target_info pointer to use.
4204 (Target_arm::do_make_data_plt): New virtual method.
4205 (Target_arm::make_data_plt): New method that calls it.
4206 (Target_arm::make_plt_entry): Use it.
4207 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
4208 for the section alignment.
4209 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
4210 method.
4211 (Output_data_plt_arm::first_plt_entry_offset): Call it.
4212 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
4213 method.
4214 (Output_data_plt_arm::get_plt_entry_size): Call it.
4215 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
4216 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
4217 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
4218 method.
4219 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
4220 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
4221 method instead of sizeof(plt_entry).
4222 (Output_data_plt_arm::add_entry): Likewise.
4223 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
4224 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
4225 than static method.
4226 (Target_arm::plt_entry_size): Likewise.
4227 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
4228 Move to ...
4229 (Output_data_plt_arm_standard): ... here, new class.
4230 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
4231 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
4232 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
4233
4234 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4235 Take additional argument for the PLT entry size.
4236 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
4237 Use get_plt_entry_size method rather than plt_entry_size variable.
4238 (Output_data_plt_x86_64::reserve_slot): Likewise.
4239 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
4240 (Output_data_plt_x86_64::add_entry): Likewise.
4241 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
4242 (Output_data_plt_x86_64::address_for_global): Likewise.
4243 (Output_data_plt_x86_64::address_for_local): Likewise.
4244 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4245 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
4246 Make method non-static.
4247 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
4248 method.
4249 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
4250 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
4251 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
4252 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
4253 virtual method.
4254 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
4255 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
4256 virtual method.
4257 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
4258 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
4259 virtual method.
4260 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
4261 (Output_data_plt_x86_64::plt_entry_size)
4262 (Output_data_plt_x86_64::first_plt_entry)
4263 (Output_data_plt_x86_64::plt_entry)
4264 (Output_data_plt_x86_64::tlsdesc_plt_entry)
4265 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
4266 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
4267 (Output_data_plt_x86_64_standard): ... here, new class.
4268 (Target_x86_64::Target_x86_64): Take optional argument for the
4269 Target_info pointer to use.
4270 (Target_x86_64::do_make_data_plt): New virtual method.
4271 (Target_x86_64::make_data_plt): New method to call it.
4272 (Target_x86_64::init_got_plt_for_update): Use that.
4273 Call this->plt_->add_eh_frame method here.
4274 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
4275 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
4276 rather than static method.
4277 (Target_x86_64::plt_entry_size): Likewise.
4278 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
4279 rather than plt_entry_size variable. Move guts of PLT filling to...
4280 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
4281 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
4282 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
4283
4284 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
4285 additional argument for the section alignment.
4286 Don't do add_eh_frame_for_plt here.
4287 (Output_data_plt_i386::first_plt_entry_offset): Make the method
4288 non-static. Use get_plt_entry_size method rather than plt_entry_size
4289 variable.
4290 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
4291 method.
4292 (Output_data_plt_i386::get_plt_entry_size): Call it.
4293 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
4294 (Output_data_plt_i386::add_eh_frame): New method to call it.
4295 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
4296 method.
4297 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
4298 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
4299 method.
4300 (Output_data_plt_i386::fill_plt_entry): New method to call it.
4301 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
4302 method instead of plt_entry_size.
4303 (Output_data_plt_i386::plt_entry_size)
4304 (Output_data_plt_i386::plt_eh_frame_fde_size)
4305 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
4306 (Output_data_plt_i386_standard): ... here, new class.
4307 (Output_data_plt_i386_exec): New class.
4308 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
4309 (Output_data_plt_i386_exec::first_plt_entry): ... here.
4310 (Output_data_plt_i386::exec_plt_entry): Move to ...
4311 (Output_data_plt_i386_exec::plt_entry): ... here.
4312 (Output_data_plt_i386_dyn): New class.
4313 (Output_data_plt_i386::first_plt_entry): Move to ...
4314 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
4315 (Output_data_plt_i386::dyn_plt_entry): Move to ...
4316 (Output_data_plt_i386_dyn::plt_entry): ... here.
4317 (Target_i386::Target_i386): Take optional argument for the Target_info
4318 pointer to use.
4319 (Target_i386::do_make_data_plt): New virtual method.
4320 (Target_i386::make_data_plt): New method to call it.
4321 (Target_i386::make_plt_section): Use that.
4322 Call this->plt_->add_eh_frame method here.
4323 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
4324 rather than plt_entry_size variable.
4325 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
4326 (Output_data_plt_i386::address_for_local): Likewise.
4327 (Output_data_plt_i386::do_write): Likewise.
4328 Move guts of PLT filling to...
4329 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
4330 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
4331 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
4332 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
4333
b9b9f2ee
CC
43342012-05-01 Cary Coutant <ccoutant@google.com>
4335
4336 * dwarf_reader.cc (Dwarf_die::read_attributes)
4337 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
4338 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
4339 * reduced_debug_output.cc
4340 (Output_reduced_debug_info_section::get_die_end): Remove
4341 DW_FORM_GNU_ref_index. Add default case.
4342
57923f48
MW
43432012-04-26 Mark Wielaard <mjw@redhat.com>
4344
4345 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
4346 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
4347 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
4348 DW_AT_high_pc as offset from DW_AT_low_pc.
4349
4350 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
4351 * testsuite/Makefile.in: Regenerate.
4352 * testsuite/gdb_index_test_3.c: New test source file.
4353 * testsuite/gdb_index_test_3.sh: New test source file.
4354
2c54b4f4
ILT
43552012-04-25 Ian Lance Taylor <iant@google.com>
4356
4357 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
4358 pointer.
4359 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
4360 as a class, not a struct.
4361 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
4362 (Target_arm::apply_cortex_a8_workaround): Likewise.
4363 * gc.h: Declare Reloc_types as a struct, not a class.
4364 * object.h: Declare Symbols_data as a struct.
4365 * reloc.h: Declare Read_relocs_data as a struct.
4366 * target.h: Declare Relocate_info as a struct.
4367
a5a5f7a3
DM
43682012-04-24 David S. Miller <davem@davemloft.net>
4369
4370 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
4371 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
4372 and R_SPARC_WPLT30.
4373
f038d496
CC
43742012-04-24 Cary Coutant <ccoutant@google.com>
4375
4376 * incremental-dump.cc (find_input_containing_global): Replace
4377 magic number with symbolic constant.
4378 (dump_incremental_inputs): Update version number.
4379 * incremental.cc (Output_section_incremental_inputs): Update version
4380 number; import symbolic constants from Incremental_inputs_reader.
4381 (Incremental_inputs::create_data_sections): Align relocations
4382 section correctly for 64-bit targets.
4383 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
4384 constants; add padding.
4385 (Output_section_incremental_inputs::write_header): Add assert for
4386 header_size.
4387 (Output_section_incremental_inputs::write_input_files): Add assert
4388 for input_entry_size.
4389 (Output_section_incremental_inputs::write_info_blocks): Add padding;
4390 add assert for object_info_size, input_section_entry_size,
4391 global_sym_entry_size.
4392 * incremental.h (Incremental_inputs_reader): Add symbolic constants
4393 for data structure sizes; use them.
4394 (Incremental_input_entry_reader): Import symbolic constants from
4395 Incremental_inputs_reader; use them.
4396
a4d85145
DM
43972012-04-23 David S. Miller <davem@davemloft.net>
4398
4399 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
4400 and elf_flags_set_.
4401 (Target_sparc::Target_sparc): Initialize new fields.
4402 (Target_sparc::do_make_elf_object): New function.
4403 (Target_sparc::do_adjust_elf_header): New function.
4404
1d509098
CC
44052012-04-23 Cary Coutant <ccoutant@google.com>
4406
4407 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
4408 CU range table of gdb index.
4409
7ebeff7f
DM
44102012-04-20 David S. Miller <davem@davemloft.net>
4411
4412 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
4413 instead of false.
4414
13cf9988
DM
44152012-04-16 David S. Miller <davem@davemloft.net>
4416
2a1079e8
DM
4417 * sparc.cc (Target_sparc::got_address): New function.
4418 (Sparc_relocate_functions::gdop_hix22): New function.
4419 (Sparc_relocate_functions::gdop_lox10): New function.
4420 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
4421 relocs.
4422 (Target_sparc::Scan::local): Likewise if the global symbol is not
4423 preemptible and is not IFUNC.
4424 (Target_sparc::Relocate::relocate): Perform GOTDATA code
4425 transformations for local and non-preemptible non-IFUNC global
4426 symbols.
4427
0bc964fc
DM
4428 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
4429 writing out 64-bit part of ranges.
4430
661d7a80
DM
4431 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
4432 -fpic and -fpie respectively.
4433 * Makefile.in: Regenerate.
4434
8c2bf391
DM
4435 * sparc.cc (class Target_sparc): Add rela_ifunc_.
4436 (Target_sparc::Target_sparc): Initialize new field.
4437 (Target_sparc::do_plt_section_for_global): New function.
4438 (Target_sparc::do_plt_section_for_local): New function.
4439 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
4440 (Target_sparc::make_plt_section): New function, broken out of
4441 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
4442 (Target_sparc::make_plt_entry): Call make_plt_section.
4443 (Target_sparc::make_local_ifunc_plt_entry): New function.
4444 (Target_sparc::rela_ifunc_section): New function.
4445 (Target_sparc::plt_section): Remove const.
4446 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
4447 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
4448 and ifunc_count_ fields.
4449 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
4450 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
4451 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
4452 (Output_data_plt_sparc::rela_ifunc): New function.
4453 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
4454 (Output_data_plt_sparc::has_ifunc_section): New function.
4455 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
4456 (Output_data_plt_sparc::address_for_global): New function.
4457 (Output_data_plt_sparc::address_for_local): New function.
4458 (Output_data_plt_sparc::plt_index_to_offset): New function.
4459 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
4460 and entry_count.
4461 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
4462 entry_count.
4463 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
4464 R_SPARC_JMP_IREL to switch.
4465 (Target_sparc::Scan::check_non_pic): Likewise.
4466 (Target_sparc::Scan::local): Handle IFUNC symbols.
4467 (Target_sparc::Scan::local): Likewise.
4468 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
4469 and plt_address_for_local.
4470 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
4471 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
4472
13cf9988
DM
4473 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
4474 (class Output_data_reloc): Adjust calls to Output_reloc_type.
4475 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
4476 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
4477 global relocs too.
4478 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
4479 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
4480 calls.
4481 * sparc.cc (Target_sparc::Scan::global): Likewise.
4482 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4483
31821be0
CC
44842012-04-16 Cary Coutant <ccoutant@google.com>
4485
4486 * archive.cc (Library_base::should_include_member): Check for
4487 --export-dynamic-symbol.
4488 * options.h (class General_options): Add --export-dynamic-symbol.
4489 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
4490 --export-dynamic-symbol.
4491 (Symbol_table::gc_mark_undef_symbols): Likewise.
4492 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
4493
2615994e
DM
44942012-04-12 David S. Miller <davem@davemloft.net>
4495
4496 * sparc.cc (Reloc::wdisp10): New relocation method.
4497 (Reloc::h34): Likewise.
4498 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
4499 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
4500 R_SPARC_WDISP10.
4501 (Target_sparc::Scan::local): Likewise.
4502 (Target_sparc::Scan::global): Likewise.
4503 (Target_sparc::Relocate::relocate): Likewise.
4504
6782735d
CC
45052012-04-09 Cary Coutant <ccoutant@google.com>
4506
4507 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
4508 low_pc == 0.
4509
8c7a0b00
ILT
45102012-04-06 Ian Lance Taylor <iant@google.com>
4511
4512 * timer.cc: #include <unistd.h>.
4513
58797674
RM
45142012-04-06 Roland McGrath <mcgrathr@google.com>
4515
4516 * configure.in (AC_CHECK_HEADERS): Add locale.h.
4517 * config.in: Regenerate.
4518 * configure: Regenerate.
4519
44350750
NC
45202012-04-05 Nick Clifton <nickc@redhat.com>
4521
4522 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
4523 (AM_LC_MESSAGES): Add.
4524 * aclocal.m4: Regenerate.
4525 * config.in: Regenerate.
4526 * configure: Regenerate.
4527
c1027032
CC
45282012-03-21 Cary Coutant <ccoutant@google.com>
4529
4530 * Makefile.am: Add gdb-index.cc, gdb-index.h.
4531 * Makefile.in: Regenerate.
4532 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
4533 (Sized_elf_reloc_mapper::symbol_section): New function.
4534 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
4535 (make_elf_reloc_mapper): New function.
4536 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
4537 (Dwarf_abbrev_table::do_read_abbrevs): New function.
4538 (Dwarf_abbrev_table::do_get_abbrev): New function.
4539 (Dwarf_ranges_table::read_ranges_table): New function.
4540 (Dwarf_ranges_table::read_range_list): New function.
4541 (Dwarf_pubnames_table::read_section): New function.
4542 (Dwarf_pubnames_table::read_header): New function.
4543 (Dwarf_pubnames_table::next_name): New function.
4544 (Dwarf_die::Dwarf_die): New function.
4545 (Dwarf_die::read_attributes): New function.
4546 (Dwarf_die::skip_attributes): New function.
4547 (Dwarf_die::set_name): New function.
4548 (Dwarf_die::set_linkage_name): New function.
4549 (Dwarf_die::attribute): New function.
4550 (Dwarf_die::string_attribute): New function.
4551 (Dwarf_die::int_attribute): New function.
4552 (Dwarf_die::uint_attribute): New function.
4553 (Dwarf_die::ref_attribute): New function.
4554 (Dwarf_die::child_offset): New function.
4555 (Dwarf_die::sibling_offset): New function.
4556 (Dwarf_info_reader::check_buffer): New function.
4557 (Dwarf_info_reader::parse): New function.
4558 (Dwarf_info_reader::do_parse): New function.
4559 (Dwarf_info_reader::do_read_string_table): New function.
4560 (Dwarf_info_reader::lookup_reloc): New function.
4561 (Dwarf_info_reader::get_string): New function.
4562 (Dwarf_info_reader::visit_compilation_unit): New function.
4563 (Dwarf_info_reader::visit_type_unit): New function.
4564 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
4565 Sized_elf_reloc_mapper.
4566 (Sized_dwarf_line_info::symbol_section): Remove function.
4567 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
4568 (Sized_dwarf_line_info::read_line_mappings): Remove object
4569 parameter, adjust callers.
4570 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
4571 * dwarf_reader.h: Include <sys/types.h>.
4572 (class Track_relocs): Remove forward declaration.
4573 (class Elf_reloc_mapper): New class.
4574 (class Sized_elf_reloc_mapper): New class.
4575 (class Dwarf_abbrev_table): New class.
4576 (class Dwarf_range_list): New class.
4577 (class Dwarf_ranges_table): New class.
4578 (class Dwarf_pubnames_table): New class.
4579 (class Dwarf_die): New class.
4580 (class Dwarf_info_reader): New class.
4581 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
4582 (Sized_dwarf_line_info::symbol_section): Remove member function.
4583 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
4584 base class.
4585 * gdb-index.cc: New source file.
4586 * gdb-index.h: New source file.
4587 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
4588 and .debug_types sections, call Layout::add_to_gdb_index.
4589 (Sized_relobj_incr::do_section_name): Implement.
4590 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
4591 return type; Implement.
4592 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
4593 return type.
4594 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
4595 parameter list and return type.
4596 (Sized_incr_dynobj::do_section_contents): Likewise.
4597 * layout.cc: Include gdb-index.h.
4598 (Layout::Layout): Initialize gdb_index_data_.
4599 (Layout::init_fixed_output_section): Check for .gdb_index section.
4600 (Layout::add_to_gdb_index): New function. Instantiate.
4601 * layout.h: Add forward declaration for class Gdb_index.
4602 (Layout::add_to_gdb_index): New member function.
4603 (Layout::gdb_index_data_): New data member.
4604 * main.cc: Include gdb-index.h.
4605 (main): Print statistics for gdb index.
4606 * object.cc (Object::section_contents): Move code into
4607 do_section_contents.
4608 (need_decompressed_section): Check for sections needed when building
4609 gdb index.
4610 (build_compressed_section_map): Likewise.
4611 (Sized_relobj_file::do_read_symbols): Need local symbols when building
4612 gdb index.
4613 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
4614 sections; call Layout::add_to_gdb_index.
4615 (Sized_relobj_file::do_decompressed_section_contents): Call
4616 do_section_contents directly.
4617 * object.h (Object::do_section_contents): Adjust parameter list and
4618 return type.
4619 (Object::do_decompressed_section_contents): Call do_section_contents
4620 directly.
4621 (Sized_relobj_file::do_section_contents): Adjust parameter list and
4622 return type.
4623 * options.h (class General_options): Add --gdb-index option.
4624 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
4625 list and return type.
4626 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
4627 * reloc.h (Track_relocs::checkpoint): New function.
4628 (Track_relocs::reset): New function.
4629
4630 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
4631 New test cases.
4632 * testsuite/Makefile.in: Regenerate.
4633 * testsuite/gdb_index_test.cc: New test source file.
4634 * testsuite/gdb_index_test_1.sh: New test source file.
4635 * testsuite/gdb_index_test_2.sh: New test source file.
4636
647f1574
DK
46372012-03-19 Doug Kwan <dougkwan@google.com>
4638
4639 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 4640 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
4641 __exidx_start and __exidx_end. Make symbol table parameter
4642 anonymous as it is not used.
4643 * gold.cc (queue_middle_tasks): Call target hook to define any
4644 target-specific symbols.
4645 * target.h (Target::define_standard_symbols): New method.
4646 (Target::do_define_standard_symbols): Same.
4647 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
4648 * testsuite/Makefile.in: Regenerate.
4649 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
4650 and __exidx_end.
4651 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
4652 relocations are generated for __exidx_start and __exidx_end.
4653
7c6109da
DK
46542012-03-16 Doug Kwan <dougkwan@google.com>
4655
4656 * testsuite/Makefile.am: Disable test initpri3b.
4657 * testsuite/Makefile.in: Regenerate.
4658
7b8957f8
DK
46592012-03-15 Doug Kwan <dougkwan@google.com>
4660
4661 * arm.cc (Target_arm::got_section): Make .got section read-only
4662 if -z now is given.
4663
14dc9ef7
ILT
46642012-03-15 Ian Lance Taylor <iant@google.com>
4665
4666 PR gold/13850
4667 * layout.cc (Layout::make_output_section): Correctly mark
4668 SHT_INIT_ARRAY, et. al., as relro.
4669
fa40b62a
DK
46702012-03-14 Doug Kwan <dougkwan@google.com>
4671
4672 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
4673 dynamic relocations for protected symbols in shared objects.
4674
fd325007
ILT
46752012-03-13 Ian Lance Taylor <iant@google.com>
4676
4677 * resolve.cc (Symbol_table::resolve): When merging common symbols,
4678 keep the larger alignment.
4679
e8dd54e1
CC
46802012-03-12 Cary Coutant <ccoutant@google.com>
4681
4682 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
4683 handling of DW_LNE_define_file.
4684
feb5f3b0
CC
46852012-03-12 Cary Coutant <ccoutant@google.com>
4686
4687 * reduced_debug_output.cc
4688 (Output_reduced_debug_info_section::get_die_end): Add new FORM
4689 codes to switch.
4690
a1fb4256
CC
46912012-02-29 Cary Coutant <ccoutant@google.com>
4692
4693 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
4694
5dd8762a
CC
46952012-02-29 Cary Coutant <ccoutant@google.com>
4696
4697 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4698 Call Object::decompressed_section_contents.
4699 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
4700 New dtor.
4701 (Sized_dwarf_line_info::buffer_start_): New data member.
4702 * merge.cc (Output_merge_data::do_add_input_section): Call
4703 Object::decompressed_section_contents.
4704 (Output_merge_string::do_add_input_section): Likewise.
4705 * object.cc (need_decompressed_section): New function.
4706 (build_compressed_section_map): Decompress sections needed later.
4707 (Sized_relobj_file::do_decompressed_section_contents): New function.
4708 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4709 * object.h (Object::decompressed_section_contents): New function.
4710 (Object::discard_decompressed_sections): New function.
4711 (Object::do_decompressed_section_contents): New function.
4712 (Object::do_discard_decompressed_sections): New function.
4713 (Compressed_section_info): New type.
4714 (Compressed_section_map): Include decompressed section contents.
4715 (Sized_relobj_file::do_decompressed_section_contents): New function.
4716 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4717
7b5de7ee
CC
47182012-02-16 Cary Coutant <ccoutant@google.com>
4719
4720 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
4721 * testsuite/Makefile.in: Regenerate.
4722
f9fa4a63
CC
47232012-02-14 Cary Coutant <ccoutant@google.com>
4724
4725 * options.cc (General_options::finalize): Disallow -pie and -static.
4726
2c175ebc
DK
47272012-02-03 Doug Kwan <dougkwan@google.com>
4728
4729 * arm.cc (Arm_relocate_functions::abs8,
4730 Arm_relocate_functions::abs16): Use
4731 Bits::has_signed_unsigned_overflow32.
4732 (Arm_relocate_functions::thm_abs8): Correct range of
4733 overflow check.
4734 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
4735 in assertions.
4736
90cff06f
DK
47372012-02-02 Doug Kwan <dougkwan@google.com>
4738
4739 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
4740 position independent outputs, not just shared objects.
4741
63887f3d
L
47422012-01-30 H.J. Lu <hongjiu.lu@intel.com>
4743
4744 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
4745 * configure: Regenerated.
4746
bef2b434
ILT
47472012-01-27 Ian Lance Taylor <iant@google.com>
4748
4749 * reloc.h (Bits): New class with static functions, copied from
4750 namespace utils in arm.cc.
4751 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
4752 instead.
4753
c335b55d
L
47542012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4755
4756 * incremental.cc (write_info_blocks): Correct relocation offset.
4757
41194d9f
L
47582012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4759
4760 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
4761 (Relocate::tls_gd_to_le): Likewise.
4762
1bae613c
L
47632012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4764
4765 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
4766
24482ca0
L
47672012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4768
4769 * configure.ac: Check if -mcmodel=medium works.
4770 * configure: Regenerated.
4771
c2c7840a
CC
47722012-01-24 Cary Coutant <ccoutant@google.com>
4773
4774 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
4775 definition and ...
4776 (read_unsigned_LEB_128_x): ... this new function.
4777 (read_signed_LEB_128): Replaced with inline definition and ...
4778 (read_signed_LEB_128_x): ... this new function.
4779 * int_encoding.h (read_unsigned_LEB_128_x): New function.
4780 (read_unsigned_LEB_128): Add inline definition.
4781 (read_signed_LEB_128_x): New function.
4782 (read_signed_LEB_128): Add inline definition.
4783 * testsuite/Makefile.am (leb128_unittest): New unit test.
4784 * testsuite/Makefile.in: Regenerate.
4785 * testsuite/leb128_unittest.cc: New unit test.
4786
833de760 47872012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
4788
4789 PR gold/13617
4790 * i386.cc (Target_i386::do_code_fill): When using a jmp
4791 instruction, pad with nop instructions.
4792 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4793
618d6666
L
47942012-01-22 H.J. Lu <hongjiu.lu@intel.com>
4795
4796 * x86_64.cc (gc_process_relocs): Add typename on types used in
4797 template.
4798 (scan_relocs): Likewise.
4799 (relocate_section): Likewise.
4800 (apply_relocation): Likewise.
4801
3660ff06
L
48022012-01-10 H.J. Lu <hongjiu.lu@intel.com>
4803
4804 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
4805 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
4806 under x32.
4807
fc51264f
L
48082012-01-09 H.J. Lu <hongjiu.lu@intel.com>
4809
4810 * x86_64.cc: Initial support for x32.
4811
dd74ae06
CC
48122012-01-03 Cary Coutant <ccoutant@google.com>
4813
4814 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
4815 Use abstract base class for GOT.
4816 * gold/output.h (class Output_data_got_base): New abstract base class.
4817 (class Output_data_got): Derive from new base class, adjust ctors.
4818 (Output_data_got::reserve_slot): Make virtual; rename to
4819 do_reserve_slot; Adjust callers.
4820 * gold/target.h (Sized_target::init_got_plt_for_update): Return
4821 pointer to abstract base class.
4822 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
4823
83896202
ILT
48242011-12-18 Ian Lance Taylor <iant@google.com>
4825
4826 * object.h (Relobj::local_symbol_value): New function.
4827 (Relobj::local_plt_offset): New function.
4828 (Relobj::local_has_got_offset): New function.
4829 (Relobj::local_got_offset): New function.
4830 (Relobj::set_local_got_offset): New function.
4831 (Relobj::do_local_symbol_value): New pure virtual function.
4832 (Relobj::do_local_plt_offset): Likewise.
4833 (Relobj::do_local_has_got_offset): Likewise.
4834 (Relobj::do_local_got_offset): Likewise.
4835 (Relobj::do_set_local_got_offset): Likewise.
4836 (Sized_relobj::do_local_has_got_offset): Rename from
4837 local_has_got_offset.
4838 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
4839 (Sized_relobj::do_set_local_got_offset): Rename from
4840 set_local_got_offset.
4841 (Sized_relobj_file::do_local_plt_offset): Rename from
4842 local_plt_offset.
4843 (Sized_relobj_file::do_local_symbol_value): New function.
4844 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
4845 local_plt_offset.
4846 * output.cc (Output_data_got::Got_entry::write): Change object to
4847 Relobj. Use local_symbol_value.
4848 (Output_data_got::add_global_with_rel): Change rel_dyn to
4849 Output_data_reloc_generic*. Use add_global_generic.
4850 (Output_data_got::add_global_with_rela): Remove. Change all
4851 callers to use add_global_with_rel.
4852 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
4853 Output_data_reloc_generic*. Use add_global_generic.
4854 (Output_data_got::add_global_pair_with_rela): Remove. Change all
4855 callers to use add_global_pair_with_rel.
4856 (Output_data_got::add_local): Change object to Relobj*.
4857 (Output_data_got::add_local_plt): Likewise.
4858 (Output_data_got::add_local_with_rel): Change object to Relobj*,
4859 change rel_dyn to Output_data_reloc_generic*. Use
4860 add_local_generic.
4861 (Output_data_got::add_local_with_rela): Remove. Change all
4862 callers to use all_local_with_rel.
4863 (Output_data_got::add_local_pair_with_rel): Change object to
4864 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
4865 add_output_section_generic.
4866 (Output_data_got::add_local_pair_with_rela): Remove. Change all
4867 callers to use add_local_pair_with_rel.
4868 (Output_data_got::reserve_local): Change object to Relobj*.
4869 * output.h: (class Output_data_reloc_generic): Add pure virtual
4870 declarations for add_global_generic, add_local_generic,
4871 add_output_section_generic.
4872 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
4873 functions for Output_data_reloc_generic. Update declarations for
4874 changes listed in output.cc.
4875 (class Output_data_got): Change template parameter to got_size.
4876 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
4877 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
4878 function.
4879 (Sized_relobj_incr::do_local_plt_offset): New function.
4880 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
4881 add_global_generic.
4882
76677ad0
CC
48832011-12-17 Cary Coutant <ccoutant@google.com>
4884
4885 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
4886 * resolve.cc (Symbol_table::resolve): Likewise.
4887 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
4888 arrays.
4889 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4890
8b8dd8d5
ILT
48912011-12-16 Ian Lance Taylor <iant@google.com>
4892
4893 * output.h (Output_data_reloc_generic::add): Only call
4894 add_dynamic_reloc if this is a dynamic reloc section.
4895
d55525b9
L
48962011-12-15 H.J. Lu <hongjiu.lu@intel.com>
4897
4898 PR gold/13505
4899 * target-reloc.h (apply_relocation): Replace <64, false> with
4900 <size, big_endian>.
4901
ff81c7c1
NC
49022011-11-25 Nick Clifton <nickc@redhat.com>
4903
4904 * po/it.po: New Italian translation.
4905
628f39be
SA
49062011-11-17 Sterling Augustine <saugustine@google.com>
4907
4908 * script.cc (script_include_directive): Implement.
4909 (read_script_file): New local variables name and search_path. Update
4910 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
4911 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
4912 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
4913
98ef3ea4
SA
49142011-11-11 Sterling Augustine <saugustine@google.com>
4915
4916 * yyscript.y (section_cmd): Add support for INCLUDE directive.
4917 (file_or_sections_cmd): Likewise.
4918
f4a8b6d7
DK
49192011-11-11 Doug Kwan <dougkwan@google.com>
4920
4921 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
4922 if --just-symbols is given.
4923
29ab395d
DK
49242011-11-10 Doug Kwan <dougkwan@google.com>
4925
4926 PR gold/13362
4927 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
4928 when processing data relocs.
4929 * reloc.h (Relocate_functions::rel_unaligned): New method.
4930 (Relocate_functions::pcrel_unaligned): Ditto.
4931 (Relocate_functions::rel32_unaligned): Ditto.
4932 (Relocate_functions::pcrel32_unaligned): Ditto.
4933
2c339f71
DK
49342011-11-09 Doug Kwan <dougkwan@google.com>
4935
4936 PR gold/13362
4937 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
4938 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
4939 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
4940 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4941 (Relocate_functions::rel_unaligned): New.
4942 (Relocate_functions::rel32_unaligned): New.
4943 * target-reloc.h (relocate_for_relocatable): Add code to handle
4944 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4945 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
4946 arm_unaligned_reloc_r): New targets.
4947 * testsuite/Makefile.in: Regenerate.
4948 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
4949 linking.
4950
3f3cddf1
ILT
49512011-11-02 Ian Lance Taylor <iant@google.com>
4952
4953 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
4954 NATIVE_LINKER.
4955 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
4956 * options.cc (General_options::finalize): Use library search path
4957 from configure script if specified. If not native and no sysroot,
4958 only search TOOLLIBDIR.
4959 * options.h (Search_directory::Search_directory): Change name to
4960 const std::string&.
4961 (General_options::add_to_library_path_with_sysroot): Change arg to
4962 const std::string&.
4963 * configure, Makefile.in, config.in: Rebuild.
4964
a8e2273b
ILT
49652011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4966
4967 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
4968 we are working around the ARM1176 Erratum.
4969 * options.h (General_options::fix_arm1176): Add option.
4970 * testsuite/Makefile.am: Add testcases, and keep current ones
4971 working.
4972 * testsuite/Makefile.in: Regenerate.
4973 * testsuite/arm_fix_1176.s: New file.
4974 * testsuite/arm_fix_1176.sh: Likewise.
4975
cd6eab1c
ILT
49762011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4977
4978 * arm.cc (Target_arm::Target_arm): Remove initialisation of
4979 may_use_blx_.
4980 (Target_arm::may_use_blx): Remove method.
4981 (Target_arm::set_may_use_blx): Likewise.
4982 (Target_arm::may_use_v4t_interworking): New method.
4983 (Target_arm::may_use_v5t_interworking): Likewise.
4984 (Target_arm::may_use_blx_): Remove member variable.
4985 (Arm_relocate_functions::arm_branch_common): Check for v5T
4986 interworking.
4987 (Arm_relocate_functions::thumb_branch_common): Likewise.
4988 (Reloc_stub::stub_type_for_reloc): Likewise.
4989 (Target_arm::do_finalize_sections): Correct interworking checks.
4990 * testsuite/Makefile.am: Add new tests.
4991 * testsuite/Makefile.in: Regenerate.
4992 * testsuite/arm_farcall_arm_arm.s: New test.
4993 * testsuite/arm_farcall_arm_arm.sh: Likewise.
4994 * testsuite/arm_farcall_arm_thumb.s: Likewise.
4995 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
4996 * testsuite/arm_farcall_thumb_arm.s: Likewise.
4997 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
4998 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
4999 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
5000
286adcf4
CC
50012011-10-31 Cary Coutant <ccoutant@google.com>
5002
5003 PR gold/13023
5004 * expression.cc (Expression::eval_with_dot): Add
5005 is_section_dot_assignment parameter.
5006 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
5007 absolute and assigning to dot within a section.
5008 * script-sections.cc
5009 (Output_section_element_assignment::set_section_addresses): Pass
5010 dot_section to set_if_absolute.
5011 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
5012 as is_section_dot_assignment flag to eval_with_dot.
5013 (Output_section_element_dot_assignment::set_section_addresses):
5014 Likewise.
5015 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
5016 parameter. Also set value if relative to dot_section; set the
5017 symbol's output_section.
5018 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
5019 parameter. Adjust all callers.
5020 (Expression::eval_maybe_dot): Likewise.
5021 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
5022 Adjust all callers.
5023 * testsuite/script_test_2.t: Test assignment of an absolute value
5024 to dot within an output section element.
5025
9634ed06
CC
50262011-10-31 Cary Coutant <ccoutant@google.com>
5027
5028 * options.h (class General_options): Add --[no-]gnu-unique options.
5029 * symtab.cc (Symbol_table::sized_write_globals): Convert
5030 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
5031
de4101c7
CC
50322011-10-31 Cary Coutant <ccoutant@google.com>
5033
5034 PR gold/13359
5035 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
5036 unnecessary assertion.
5037 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
5038
7257cc92
ST
50392011-10-31 Sriraman Tallam <tmsriram@google.com>
5040
5041 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5042 gc_mark_symbol.
5043 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5044 gc_mark_symbol.
5045 Change to just keep the section associated with symbol.
5046 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
5047 they are externally visible and --export-dynamic is turned on.
5048 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
5049
bfc34b3f
ILT
50502011-10-19 Ian Lance Taylor <iant@google.com>
5051
5052 PR gold/13163
5053 * script-sections.cc
5054 (Output_section_element_dot_assignment::needs_output_section): New
5055 function.
5056
ea0d8c47
ILT
50572011-10-19 Ian Lance Taylor <iant@google.com>
5058
5059 PR gold/13204
5060 * layout.cc (Layout::segment_precedes): Don't assert failure if a
5061 --section-start option was seen.
5062 * options.h (General_options::any_section_start): New function.
5063
abd242a9
DM
50642011-10-18 David S. Miller <davem@davemloft.net>
5065
5066 PR binutils/13301
5067 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
5068 member to track relocation locations that have moved during TLS
5069 reloc optimizations.
5070 (Target_sparc::Relocate::Relocate): Initialize to NULL.
5071 (Target_sparc::Relocate::relocate): Adjust view down by 4
5072 bytes if it matches reloc_adjust_addr_.
5073 (Target_sparc::Relocate::relocate_tls): Always move the
5074 __tls_get_addr call delay slot instruction forward 4 bytes when
5075 performing relaxation.
5076
bab9090f
CC
50772011-10-18 Cary Coutant <ccoutant@google.com>
5078
5079 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
5080 (Output_file::map_no_anonymous): Check for non-zero
5081 return code from posix_fallocate.
5082
f7c5b166
CC
50832011-10-17 Cary Coutant <ccoutant@google.com>
5084
5085 PR gold/13245
5086 * plugin.cc (is_visible_from_outside): Check for symbols
5087 referenced from dynamic objects.
5088 * resolve.cc (Symbol_table::resolve): Don't count references
5089 from dynamic objects as references from real ELF files.
5090 * testsuite/plugin_test_2.sh: Adjust expected result.
5091
b490c0bb
CC
50922011-10-17 Cary Coutant <ccoutant@google.com>
5093
5094 * gold.cc: Include timer.h.
5095 (queue_middle_tasks): Stamp time.
5096 (queue_final_tasks): Likewise.
5097 * main.cc (main): Store timer in parameters. Print timers
5098 for each pass.
5099 * parameters.cc (Parameters::Parameters): Initialize timer_.
5100 (Parameters::set_timer): New function.
5101 (set_parameters_timer): New function.
5102 * parameters.h (Parameters::set_timer): New function.
5103 (Parameters::timer): New function.
5104 (Parameters::timer_): New data member.
5105 (set_parameters_timer): New function.
5106 * timer.cc (Timer::stamp): New function.
5107 (Timer::get_pass_time): New function.
5108 * timer.h (Timer::stamp): New function.
5109 (Timer::get_pass_time): New function.
5110 (Timer::pass_times_): New data member.
5111
f475cf7b
CC
51122011-10-17 Cary Coutant <ccoutant@google.com>
5113
5114 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
5115 task for members of lib groups.
5116
cdd7e244
CC
51172011-10-17 Cary Coutant <ccoutant@google.com>
5118
5119 PR gold/13288
4f95c8b4 5120 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
5121 (File_read::make_view): Move bounds check (replace with assert)...
5122 (File_read::find_or_make_view): ... to here.
5123
dfb45471
CC
51242011-10-12 Cary Coutant <ccoutant@google.com>
5125
4f95c8b4 5126 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
5127 ::read returns less than requested size.
5128
53bbcc1b
CC
51292011-10-10 Cary Coutant <ccoutant@google.com>
5130
4f95c8b4 5131 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
5132 Initialize defined_count_.
5133 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
5134 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
5135 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
5136 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
5137 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 5138 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
5139 member.
5140 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 5141 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
5142 Return zeroes instead of internal error.
5143
397b129b
CC
51442011-10-10 Cary Coutant <ccoutant@google.com>
5145
5146 PR gold/13249
4f95c8b4 5147 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 5148 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 5149 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
5150 (Output_reloc::type_): Adjust size of bit field.
5151 (Output_reloc::use_plt_offset_): New bit field.
5152 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
5153 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
5154 flag. Adjust all callers.
4f95c8b4 5155 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
5156 creating RELATIVE relocations.
5157
d5698657
NC
51582011-10-10 Nick Clifton <nickc@redhat.com>
5159
5160 * po/es.po: Updated Spanish translation.
5161 * po/fi.po: Updated Finnish translation.
5162
6a59a5c2
DN
51632011-10-03 Diego Novillo <dnovillo@google.com>
5164
5165 * options.cc (parse_uint): Fix dereference of RETVAL.
5166
f0558624
ST
51672011-09-29 Sriraman Tallam <tmsriram@google.com>
5168
5169 * layout.h (section_order_map_): New member.
5170 (get_section_order_map): New member function.
5171 * output.cc (Output_section::add_input_section): Check for patterns
5172 only when --section-ordering-file is specified.
5173 * gold.cc (queue_middle_tasks): Delay updating order of sections till
5174 output_sections have been formed.
5175 * layout.cc (Layout_Layout): Initialize section_order_map_.
5176 * plugin.cc (update_section_order): Store order in order_map. Do not
5177 update the order.
5178 * testsuite/Makefile.am: Add test case for plugin_final_layout.
5179 * testsuite/Makefile.in: Regenerate.
5180 * testsuite/plugin_section_order.c: New file.
5181 * testsuite/plugin_final_layout.cc: New file.
5182 * testsuite/plugin_final_layout.sh: New file.
5183
a7dac153
CC
51842011-09-29 Cary Coutant <ccoutant@google.com>
5185
4f95c8b4 5186 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 5187 Check for NULL.
4f95c8b4 5188 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
5189 symbols during incremental update.
5190 (Symbol_table::add_from_dynobj): Likewise.
5191
eebd87a5
ILT
51922011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5193 Ian Lance Taylor <iant@google.com>
5194
5195 * symtab.cc (Symbol_table::define_special_symbol): Always
5196 canonicalize version string.
5197
403a3331
CC
51982011-09-26 Cary Coutant <ccoutant@google.com>
5199
4f95c8b4
CC
5200 * gold.cc (queue_initial_tasks): Move option checks ...
5201 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
5202 some options; make others fatal.
5203
235061c2
CC
52042011-09-26 Cary Coutant <ccoutant@google.com>
5205
5206 gcc PR lto/47247
5207 * plugin.cc (get_symbols_v2): New function.
5208 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
5209 (is_referenced_from_outside): New function.
5210 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
5211 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
5212 (get_symbols): Pass version parameter.
5213 (get_symbols_v2): New function.
5214 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
5215 parameter.
5216 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
5217 (onload): Add LDPT_GET_SYMBOLS_V2.
5218 (all_symbols_read_hook): Use get_symbols_v2; check for
5219 LDPR_PREVAILING_DEF_IRONLY_EXP.
5220 * testsuite/plugin_test_3.sh: Update expected results.
5221
dc87f620
ILT
52222011-09-23 Simon Baldwin <simonb@google.com>
5223
5224 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
5225 configuration options.
5226 * configure: Regenerate.
5227 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
5228 * Makefile.in: Regenerate.
5229 * testsuite/Makefile.in: Regenerate.
5230
a8279f82
ST
52312011-09-19 Sriraman Tallam <tmsriram@google.com>
5232
5233 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
5234
0c9350c8
CC
52352011-09-19 Cary Coutant <ccoutant@google.com>
5236
5237 * incremental.cc (can_incremental_update): Fix typo in comment.
5238 * incremental.h (can_incremental_update): Likewise.
5239
aa06ae28
CC
52402011-09-18 Cary Coutant <ccoutant@google.com>
5241
5242 * incremental.cc (can_incremental_update): New function.
5243 * incremental.h (can_incremental_update): New function.
5244 * layout.cc (Layout::init_fixed_output_section): Call it.
5245 (Layout::make_output_section): Don't allow patch space in .eh_frame.
5246 * object.cc (Sized_relobj_file::do_layout): Call
5247 can_incremental_update.
5248
ebb300b2
CC
52492011-09-13 Cary Coutant <ccoutant@google.com>
5250
5251 * configure.ac: Check for glibc support for gnu_indirect_function
5252 support with static linking, setting automake conditional
5253 IFUNC_STATIC.
5254 * Makefile.in: Regenerate.
5255 * configure: Regenerate.
5256
5257 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
5258 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
5259 for IFUNC_STATIC.
5260 * testsuite/Makefile.in: Regenerate.
5261
1206d0d5
CC
52622011-09-13 Cary Coutant <ccoutant@google.com>
5263
5264 * incremental.cc (Sized_relobj_incr::do_layout): Call
5265 report_comdat_group for kept comdat sections.
5266 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
5267 * testsuite/Makefile.in: Regenerate.
5268 * testsuite/incr_comdat_test_1.cc: New source file.
5269 * testsuite/incr_comdat_test_2_v1.cc: New source file.
5270 * testsuite/incr_comdat_test_2_v2.cc: New source file.
5271 * testsuite/incr_comdat_test_2_v3.cc: New source file.
5272
40b29874
ILT
52732011-09-13 Ian Lance Taylor <iant@google.com>
5274
5275 * object.cc (Sized_relobj_file::do_layout): Remove unused local
5276 variable external_symbols_offset.
5277
1b045aac
ILT
52782011-09-12 Ian Lance Taylor <iant@google.com>
5279
5280 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
5281 triggered if object has no symbols.
5282
24c6c55a
DM
52832011-09-09 David S. Miller <davem@davemloft.net>
5284
5285 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
5286 (Output_fill_debug_line::do_write): Likewise.
5287
66570254
CC
52882011-08-29 Cary Coutant <ccoutant@google.com>
5289
5290 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
5291 casts to match formatting specs.
5292 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
5293
8ea8cd50
CC
52942011-08-26 Cary Coutant <ccoutant@google.com>
5295
5296 * layout.cc (Free_list::allocate): Provide guarantee of minimum
5297 remaining hole size when allocating.
5298 (Layout::make_output_section): Set fill methods for debug sections.
5299 * layout.h (Free_list::Free_list_node): Move from private to
5300 public.
5301 (Free_list::set_min_hole_size): New function.
5302 (Free_list::begin, Free_list::end): New functions.
5303 (Free_list::min_hole_): New data member.
5304 * output.cc: Include dwarf.h.
5305 (Output_fill_debug_info::do_minimum_hole_size): New function.
5306 (Output_fill_debug_info::do_write): New function.
5307 (Output_fill_debug_line::do_minimum_hole_size): New function.
5308 (Output_fill_debug_line::do_write): New function.
5309 (Output_section::Output_section): Initialize new data member.
5310 (Output_section::set_final_data_size): Ensure patch space is larger
5311 than minimum hole size.
5312 (Output_section::do_write): Fill holes in debug sections.
5313 * output.h (Output_fill): New class.
5314 (Output_fill_debug_info): New class.
5315 (Output_fill_debug_line): New class.
5316 (Output_section::set_free_space_fill): New function.
5317 (Output_section::free_space_fill_): New data member.
5318 * testsuite/Makefile.am (incremental_test_3): Add
5319 --incremental-patch option.
5320 (incremental_test_4): Likewise.
5321 (incremental_test_5): Likewise.
5322 (incremental_test_6): Likewise.
5323 (incremental_copy_test): Likewise.
5324 (incremental_common_test_1): Likewise.
5325 * testsuite/Makefile.in: Regenerate.
5326
7cf80422
NC
53272011-08-26 Nick Clifton <nickc@redhat.com>
5328
5329 * po/es.po: Updated Spanish translation.
5330
c3f7b0e5
CC
53312011-08-01 Cary Coutant <ccoutant@google.com>
5332
5333 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
5334 * gold/testsuite/Makefile.in: Regenerate.
5335 * gold/testsuite/justsyms_exec.c: New source file.
5336 * gold/testsuite/justsyms_lib.c: New source file.
5337
9590bf25
CC
53382011-08-01 Cary Coutant <ccoutant@google.com>
5339
5340 * layout.cc (Layout::set_segment_offsets): Don't realign text
5341 segment if -Ttext was specified.
5342 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
5343 file type.
5344 * object.h (Sized_relobj_file::e_type): New function.
5345 (Sized_relobj_file::e_type_): New data member.
5346 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
5347 base address for ET_EXEC files.
5348 * target.cc (Target::do_make_elf_object_implementation): Allow
5349 ET_EXEC files with --just-symbols option.
5350
dcd8d12e
CC
53512011-07-28 Cary Coutant <ccoutant@google.com>
5352
5353 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
5354 Add thread_number parameter.
5355 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
5356 * workqueue-threads.cc
5357 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
5358 current thread if its thread number is greater than desired thread
5359 count.
5360 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
5361 Add thread_number parameter.
5362 (Workqueue::should_cancel_thread): Likewise.
5363 (Workqueue::find_runnable_or_wait): Pass thread_number to
5364 should_cancel_thread.
5365 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
5366 parameter.
5367
804eb480
ST
53682011-07-22 Sriraman Tallam <tmsriram@google.com>
5369
5370 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
5371 only after checking if it cannot be forced local.
5372 * symtab.h (is_externally_visible): Check if the symbol is not forced
5373 local.
5374
f1ddb600
ILT
53752011-07-15 Ian Lance Taylor <iant@google.com>
5376
5377 * options.h (class General_options): Add --print-output-format.
5378 Move -EL next to -EB, for better --help output.
5379 * target-select.cc: Include <cstdio>, "options.h", and
5380 "parameters.h".
5381 (Target_selector::do_target_bfd_name): New function.
5382 (print_output_format): New function.
5383 * target-select.h (class Target_selector): Update declarations.
5384 (Target_selector::target_bfd_name): New function.
5385 (print_output_format): Declare.
5386 * main.cc: Include "target-select.h".
5387 (main): Handle --print-output-format.
5388 * gold.cc: Include "target-select.h".
5389 (queue_initial_tasks): Handle --print-output-format when there are
5390 no input files.
5391 * parameters.cc (parameters_force_valid_target): Give a better
5392 error message if -EB/-EL does not match target.
5393 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
5394 function.
5395
7d172687
ILT
53962011-07-15 Ian Lance Taylor <iant@google.com>
5397
5398 * i386.cc (class Output_data_plt_i386): Add layout_ field.
5399 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
5400 (Output_data_plt_i386::do_write): Write address of .dynamic
5401 section to first entry in .got.plt section.
5402 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
5403 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5404 Initialize layout_.
5405 (Output_data_plt_x86_64::do_write): Write address of .dynamic
5406 section to first entry in .got.plt section.
5407 * layout.h (Layout::dynamic_section): New function.
5408
e9552f7e
ST
54092011-07-13 Sriraman Tallam <tmsriram@google.com>
5410
5411 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
5412 to claim_file call.
5413 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
5414 input_section_position_, and input_section_glob_.
5415 (read_layout_from_file): Call function section_ordering_specified.
5416 * layout.h (is_section_ordering_specified): New function.
5417 (section_ordering_specified): New function.
5418 (section_ordering_specified_): New boolean member.
5419 * main.cc(main): Call load_plugins after layout object is defined.
5420 * output.cc (Output_section::add_input_section): Use
5421 function section_ordering_specified to check if section ordering is
5422 needed.
5423 * output.cc (Output_section::add_relaxed_input_section): Use
5424 function section_ordering_specified to check if section ordering is
5425 needed.
5426 (Output_section::update_section_layout): New function.
5427 (Output_section::sort_attached_input_sections): Check if input section
5428 must be reordered.
5429 * output.h (Output_section::update_section_layout): New function.
5430 * plugin.cc (get_section_count): New function.
5431 (get_section_type): New function.
5432 (get_section_name): New function.
5433 (get_section_contents): New function.
5434 (update_section_order): New function.
58797674 5435 (allow_section_ordering): New function.
e9552f7e
ST
5436 (Plugin::load): Add the new interfaces to the transfer vector.
5437 (Plugin_manager::load_plugins): New parameter.
5438 (Plugin_manager::all_symbols_read): New parameter.
5439 (Plugin_manager::claim_file): New parameter. Save the elf object for
5440 unclaimed objects.
5441 (Plugin_manager::get_elf_object): New function.
5442 (Plugin_manager::get_view): Change to directly use the bool to check
5443 if get_view is called from claim_file_hook.
5444 * plugin.h (input_objects): New function
5445 (Plugin__manager::load_plugins): New parameter.
5446 (Plugin_manager::claim_file): New parameter.
5447 (Plugin_manager::get_elf_object): New function.
5448 (Plugin_manager::in_claim_file_handler): New function.
5449 (Plugin_manager::in_claim_file_handler_): New member.
5450 (layout): New function.
5451 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
5452 handler with an extra parameter. Make the elf object before calling
5453 claim_file handler.
5454 * testsuite/plugin_test.c (get_section_count): New function pointer.
5455 (get_section_type): New function pointer.
5456 (get_section_name): New function pointer.
5457 (get_section_contents): New function pointer.
5458 (update_section_order): New function pointer.
5459 (allow_section_ordering): New function pointer.
5460 (onload): Check if the new interfaces exist.
5461
9446efde
ILT
54622011-07-13 Ian Lance Taylor <iant@google.com>
5463
5464 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
5465 relro section.
5466 * x86_64.cc (Target_x86_64::got_section): Likewise.
5467 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
5468 (relro_now_test_SOURCES): New variable.
5469 (relro_now_test_DEPENDENCIES): New variable.
5470 (relro_now_test_LDFLAGS): New variable.
5471 (relro_now_test_LDADD): New variable.
5472 (relro_now_test.so): New target.
5473 * testsuite/Makefile.in: Rebuild.
5474
07aa62f2
ILT
54752011-07-12 Ian Lance Taylor <iant@google.com>
5476
5477 PR gold/12980
5478 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
5479 GLOB_DAT relocation rather than a RELATIVE relocation for a
5480 protected symbol when creating a shared library.
5481 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5482 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
5483 * testsuite/protected_main_1.cc (main): Test that protected
5484 function has same address.
5485
e2153196
ILT
54862011-07-11 Ian Lance Taylor <iant@google.com>
5487
5488 PR gold/12979
5489 * options.h (class General_options): Add -Bgroup.
5490 * options.cc (General_options::finalize): If -Bgroup is set,
5491 default to --unresolved-symbols=report-all.
5492 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
5493 * target-reloc.h (issue_undefined_symbol_error): Handle
5494 --unresolved-symbols=report-all.
5495
6daf5215
ILT
54962011-07-08 Ian Lance Taylor <iant@google.com>
5497
5498 PR gold/11985
5499 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
5500 if linker script discards key sections.
5501 (Layout::create_dynamic_symtab): Likewise.
5502 (Layout::assign_local_dynsym_offsets): Likewise.
5503 (Layout::sized_create_version_sections): Likewise.
5504 (Layout::create_interp): Likewise.
5505 (Layout::finish_dynamic_section): Likewise.
5506 (Layout::set_dynamic_symbol_size): Likewise.
5507
beabb2c6
ILT
55082011-07-08 Ian Lance Taylor <iant@google.com>
5509
5510 PR gold/12386
5511 * options.h (class General_options): Add --unresolved-symbols.
5512 * target-reloc.h (issue_undefined_symbol_error): Check
5513 --unresolved-symbols. Add comments.
5514
9c16daf1
ILT
55152011-07-08 Ian Lance Taylor <iant@google.com>
5516
5517 * testsuite/odr_violation2.cc (Ordering::operator()): Make
5518 expression more complex.
5519
191f1a2d
ILT
55202011-07-08 Ian Lance Taylor <iant@google.com>
5521
5522 PR gold/11317
5523 * target-reloc.h (issue_undefined_symbol_error): New inline
5524 function, broken out of relocate_section.
5525 (relocate_section): Call issue_undefined_symbol_error.
5526 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5527 there is no TLS segment if we are about to issue an undefined
5528 symbol error.
5529 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5530
62855347
ILT
55312011-07-08 Ian Lance Taylor <iant@google.com>
5532
5533 PR gold/12279
5534 * resolve.cc (Symbol_table::should_override): Add fromtype
5535 parameter. Change all callers. Give error when linking together
5536 TLS and non-TLS symbol.
5537 (Symbol_table::should_override_with_special): Add fromtype
5538 parameter. Change all callers.
5539 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5540 there is no TLS segment if we have reported some errors.
5541 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5542
67181c72
ILT
55432011-07-08 Ian Lance Taylor <iant@google.com>
5544
5545 PR gold/12372
5546 * target.h (Target::plt_address_for_global): New function.
5547 (Target::plt_address_for_local): New function.
5548 (Target::plt_section_for_global): Remove.
5549 (Target::plt_section_for_local): Remove.
5550 (Target::do_plt_address_for_global): New virtual function.
5551 (Target::do_plt_address_for_local): New virtual function.
5552 (Target::do_plt_section_for_global): Remove.
5553 (Target::do_plt_section_for_local): Remove.
5554 (Target::register_global_plt_entry): Add Symbol_table and Layout
5555 parameters.
5556 * output.cc (Output_data_got::Got_entry::write): Use
5557 plt_address_for_global and plt_address_for_local.
5558 * layout.cc (Layout::add_target_dynamic_tags): Use size and
5559 address of output section.
5560 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
5561 got_irelative_, and irelative_count_ fields. Update
5562 declarations.
5563 (Output_data_plt_i386::has_irelative_section): New function.
5564 (Output_data_plt_i386::entry_count): Add irelative_count_.
5565 (Output_data_plt_i386::set_final_data_size): Likewise.
5566 (class Target_i386): Add got_irelative_ and rel_irelative_
5567 fields. Update declarations.
5568 (Target_i386::Target_i386): Initialize new fields.
5569 (Target_i386::do_plt_address_for_global): New function replacing
5570 do_plt_section_for_global.
5571 (Target_i386::do_plt_address_for_local): New function replacing
5572 do_plt_section_for_local.
5573 (Target_i386::got_section): Create got_irelative_.
5574 (Target_i386::rel_irelative_section): New function.
5575 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
5576 fields. Don't define __rel_iplt_{start,end}.
5577 (Output_data_plt_i386::add_entry): Add symtab and layout
5578 parameters. Change all callers. Use different PLT and GOT for
5579 IFUNC symbols.
5580 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
5581 layout parameters. Change all callers. Use different PLT and
5582 GOT.
5583 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
5584 (Output_data_plt_i386::rel_irelative): New function.
5585 (Output_data_plt_i386::address_for_global): New function.
5586 (Output_data_plt_i386::address_for_local): New function.
5587 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
5588 IRELATIVE GOT when changing IFUNC GOT entries.
5589 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
5590 reloc.
5591 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
5592 if we didn't create an IRELATIVE GOT.
5593 (Target_i386::Relocate::relocate): Use plt_address_for_global and
5594 plt_address_for_local.
5595 (Target_i386::do_dynsym_value): Use plt_address_for_global.
5596 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
5597 got_irelative_, and irelative_count_ fields. Update
5598 declarations.
5599 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5600 Initialize new fields. Remove symtab parameter. Change all
5601 callers.
5602 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
5603 irelative_count_.
5604 (Output_data_plt_x86_64::has_irelative_section): New function.
5605 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
5606 (class Target_x86_64): Add got_irelative_ and rel_irelative_
5607 fields. Update declarations.
5608 (Target_x86_64::Target_x86_64): Initialize new fields.
5609 (Target_x86_64::do_plt_address_for_global): New function replacing
5610 do_plt_section_for_global.
5611 (Target_x86_64::do_plt_address_for_local): New function replacing
5612 do_plt_section_for_local.
5613 (Target_x86_64::got_section): Create got_irelative_.
5614 (Target_x86_64::rela_irelative_section): New function.
5615 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
5616 all callers. Don't create __rel_iplt_{start,end}.
5617 (Output_data_plt_x86_64::add_entry): Add symtab and layout
5618 parameters. Change all callers. Use different PLT and GOT for
5619 IFUNC symbols.
5620 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
5621 layout parameters. Change all callers. Use different PLT and
5622 GOT.
5623 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
5624 parameters. Change all callers. Use different PLT and GOT for
5625 IFUNC symbols.
5626 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
5627 (Output_data_plt_x86_64::rela_irelative): New function.
5628 (Output_data_plt_x86_64::address_for_global): New function.
5629 (Output_data_plt_x86_64::address_for_local): New function.
5630 (Output_data_plt_x86_64::set_final_data_size): Likewise.
5631 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
5632 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
5633 (Target_x86_64::register_global_plt_entry): Add symtab and layout
5634 parameters.
5635 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
5636 reloc.
5637 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
5638 symbols if we didn't create an IRELATIVE GOT.
5639 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
5640 plt_address_for_local.
5641 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
5642 * testsuite/ifuncvar1.c: New test file.
5643 * testsuite/ifuncvar2.c: New test file.
5644 * testsuite/ifuncvar3.c: New test file.
5645 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
5646 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
5647 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
5648 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
5649 * testsuite/Makefile.in: Rebuild.
5650
33c15b45
CC
56512011-07-07 Cary Coutant <ccoutant@google.com>
5652
5653 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
5654 (two_file_test_1_ndebug.o): Likewise.
5655 (two_file_test_1b_ndebug.o): Likewise.
5656 (two_file_test_2_ndebug.o): Likewise.
5657 (two_file_test_main_ndebug.o): Likewise.
5658 (incremental_test_2): Link with no-debug versions.
5659
f48b5fb7
CC
56602011-07-06 Cary Coutant <ccoutant@google.com>
5661
5662 * gold/incremental.cc
5663 (Output_section_incremental_inputs::write_info_blocks): Check for
5664 hidden and internal symbols.
5665
221597a5
CC
56662011-07-06 Cary Coutant <ccoutant@google.com>
5667
5668 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
5669 Check disposition for startup file.
5670 (Incremental_inputs::report_command_line): Ignore
5671 --incremental-startup-unchanged option.
5672 * options.cc (General_options::parse_incremental_startup_unchanged):
5673 New function.
5674 (General_options::General_options): Initialize new data member.
5675 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
5676 (General_options): Add --incremental-startup-unchanged option.
5677 (General_options::incremental_startup_disposition): New function.
5678 (General_options::incremental_startup_disposition_): New data member.
5679
e24719f6
CC
56802011-07-06 Cary Coutant <ccoutant@google.com>
5681
5682 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
5683 input file index to Script_info ctor.
5684 (Sized_incremental_binary::do_file_has_changed): Find the
5685 command-line argument for files named in scripts.
5686 * incremental.h (Script_info::Script_info): New ctor
5687 with input file index.
5688 (Script_info::input_file_index): New function.
5689 (Script_info::input_file_index_): New data member.
5690 (Incremental_binary::get_library): Add const.
5691 (Incremental_binary::get_script_info): Add const.
5692 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
5693 * testsuite/Makefile.am (incremental_test_5): New test case.
5694 (incremental_test_6): New test case.
5695 * testsuite/Makefile.in: Regenerate.
5696
8f7c81e8
CC
56972011-07-06 Cary Coutant <ccoutant@google.com>
5698
5699 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
5700 debug output when command lines differ.
5701
9fbd3822
CC
57022011-07-06 Cary Coutant <ccoutant@google.com>
5703
5704 * incremental.cc (Incremental_inputs::report_command_line): Ignore
5705 --incremental-patch option.
5706 * layout.cc (Free_list::allocate): Extend allocation beyond original
5707 end if enabled.
5708 (Layout::make_output_section): Mark sections that should get
5709 patch space.
5710 * options.cc (parse_percent): New function.
5711 * options.h (parse_percent): New function.
5712 (DEFINE_percent): New macro.
5713 (General_options): Add --incremental-patch option.
5714 * output.cc (Output_section::Output_section): Initialize new data
5715 members.
5716 (Output_section::add_input_section): Print section name when out
5717 of patch space.
5718 (Output_section::add_output_section_data): Likewise.
5719 (Output_section::set_final_data_size): Add patch space when
5720 doing --incremental-full.
5721 (Output_section::do_reset_address_and_file_offset): Remove patch
5722 space.
5723 (Output_segment::set_section_list_addresses): Print debug output
5724 only if --incremental-update.
5725 * output.h (Output_section::set_is_patch_space_allowed): New function.
5726 (Output_section::is_patch_space_allowed_): New data member.
5727 (Output_section::patch_space_): New data member.
5728 * parameters.cc (Parameters::incremental_full): New function.
5729 * parameters.h (Parameters::incremental_full): New function
5730 * testsuite/Makefile.am (incremental_test_2): Add test for
5731 --incremental-patch option.
5732 * testsuite/Makefile.in: Regenerate.
5733 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
5734 (t18): Remove function body.
5735
f6cccc2c
DK
57362011-07-05 Doug Kwan <dougkwan@google.com>
5737
5738 PR gold/12771
5739 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
5740 Arm_Address type for relocation result.
5741 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
5742 overflow check.
5743 (Arm_relocate_functions::abs32): Use unaligned access.
5744 (Arm_relocate_functions::rel32): Ditto.
5745 (Arm_relocate_functions::prel31): Ditto.
5746 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
5747 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
5748 static data relocations.
5749 * testsuite/Makefile.in: Regnerate.
5750 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
5751
28a13fec
ILT
57522011-07-05 Ian Lance Taylor <iant@google.com>
5753
5754 PR gold/12392
5755 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
5756 symbols if necessary.
5757 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5758
24d47b34
ILT
57592011-07-05 Ian Lance Taylor <iant@google.com>
5760
5761 PR gold/12952
5762 * resolve.cc (Symbol::override_base_with_special): Simply override
5763 version with special symbol version, ignoring previous version.
5764
41f9cbbe
ILT
57652011-07-05 Ian Lance Taylor <iant@google.com>
5766
5767 * object.cc (Sized_relobj_file::include_section_group): Add
5768 information to comment about signature location.
5769
886288f1
ILT
57702011-07-02 Ian Lance Taylor <iant@google.com>
5771
5772 PR gold/12957
5773 * options.h (class General_options): Add -f and -F.
5774 * options.cc (General_options::finalize): Fatal error if -f/-F
5775 are used without -shared.
5776 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
5777
ae3a6d4f
ILT
57782011-07-02 Ian Lance Taylor <iant@google.com>
5779
5780 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
5781
21131061
ILT
57822011-07-01 Ian Lance Taylor <iant@google.com>
5783
5784 PR gold/12525
5785 PR gold/12952
5786 * resolve.cc (Symbol::override_base_with_special): Don't override
5787 the version if the overriding symbol has a different name.
5788 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
5789 all callers. If we give an error about an undefined version,
5790 define the base version if necessary.
5791 * dynobj.h (class Versions): Update declaration.
5792 * testsuite/weak_alias_test_5.cc: New file.
5793 * testsuite/weak_alias_test.script: New file.
5794 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
5795 and versioned_alias have the right value, and call t2.
5796 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
5797 weak_alias_test_5.so.
5798 (weak_alias_test_LDADD): Likewise.
5799 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
5800 * testsuite/Makefile.in: Rebuild.
5801
611062c0
ILT
58022011-07-01 Ian Lance Taylor <iant@google.com>
5803
5804 PR gold/12525
5805 * options.h (class General_options): Support -z notext.
5806 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
5807 -Wl,-z,notext.
5808 (two_file_shared_nonpic.so): Likewise.
5809 (two_file_shared_mixed.so): Likewise.
5810 (two_file_shared_mixed_1.so): Likewise.
5811 (weak_undef_lib_nonpic.so): Likewise.
5812 (alt/weak_undef_lib_nonpic.so): Likewise.
5813 (tls_test_shared_nonpic.so): Likewise.
5814 * testsuite/Makefile.in: Rebuild.
5815
328c7c2f
ILT
58162011-07-01 Ian Lance Taylor <iant@google.com>
5817
5818 PR gold/12525
5819 * configure.ac: Test whether static linking works, setting
5820 the automake conditional HAVE_STATIC.
5821 * testsuite/Makefile.am: Disable tests using -static if
5822 HAVE_STATIC is not true.
5823 * configure, testsuite/Makefile.in: Rebuild.
5824
02d7cd44
ILT
58252011-07-01 Ian Lance Taylor <iant@google.com>
5826
5827 PR gold/12525
5828 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
5829 Assert if we see DW_EH_PE_indirect.
5830 * target.h (Target::ehframe_datarel_base): New function.
5831 (Target::do_ehframe_datarel_base): New target function.
5832 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
5833 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
5834 function.
5835
07a60597
ILT
58362011-07-01 Ian Lance Taylor <iant@google.com>
5837
5838 PR gold/12571
5839 * options.h (class General_options): Add
5840 --ld-generated-unwind-info.
5841 * ehframe.cc (Fde::write): Add address parameter. Change all
5842 callers. If associated with PLT, fill in address and size.
5843 (Cie::set_output_offset): Only add merge mapping if there is an
5844 object.
5845 (Cie::write): Add address parameter. Change all callers.
5846 (Eh_frame::add_ehframe_for_plt): New function.
5847 * ehframe.h (class Fde): Update declarations. Move shndx_ and
5848 input_offset_ fields into union u_, with new plt field.
5849 (Fde::Fde): Adjust for new union field.
5850 (Fde::Fde) [Output_data version]: New constructor.
5851 (Fde::add_mapping): Only add merge mapping if there is an object.
5852 (class Cie): Update declarations.
5853 (class Eh_frame): Declare add_ehframe_for_plt.
5854 * layout.cc (Layout::layout_eh_frame): Break out code into
5855 make_eh_frame_section, and call it.
5856 (Layout::make_eh_frame_section): New function.
5857 (Layout::add_eh_frame_for_plt): New function.
5858 * layout.h (class Layout): Update declarations.
5859 * merge.cc (Merge_map::add_mapping): Add assertion.
5860 * i386.cc: Include "dwarf.h".
5861 (class Output_data_plt_i386): Make first_plt_entry,
5862 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
5863 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5864 and plt_eh_frame_fde.
5865 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
5866 boundary. Call add_eh_frame_for_plt if appropriate.
5867 * x86_64.cc: Include "dwarf.h".
5868 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
5869 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
5870 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5871 and plt_eh_frame_fde.
5872 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
5873 appropriate.
5874
14788a3f
ILT
58752011-06-29 Ian Lance Taylor <iant@google.com>
5876
5877 PR gold/12629
5878 * object.cc (Sized_relobj_file::layout_section): Change shdr
5879 parameter to be const.
5880 (Sized_relobj_file::layout_eh_frame_section): New function, broken
5881 out of do_layout.
5882 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
5883 appropriate. Call layout_eh_frame_section.
5884 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
5885 sections.
5886 * object.h (class Sized_relobj_file): Update declarations.
5887
6c21fce1
ILT
58882011-06-29 Ian Lance Taylor <iant@google.com>
5889
37e41b03 5890 PR gold/12652
6c21fce1
ILT
5891 * script.cc (Token::integer_value): Accept trailing M/m/K/k
5892 modifier.
5893 (Lex::gather_token): Accept trailing M/m/K/k for integers.
5894
4d5e4e62
ILT
58952011-06-29 Ian Lance Taylor <iant@google.com>
5896
5897 PR gold/12675
5898 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
5899 SHT_X86_64_UNWIND.
5900 * layout.cc (Layout::layout_eh_frame): Likewise.
5901
886f533a
ILT
59022011-06-29 Ian Lance Taylor <iant@google.com>
5903
5904 PR gold/12695
5905 * layout.cc (Layout::symtab_section_shndx): New function.
5906 * layout.h (class Layout): Declare symtab_section_shndx.
5907 * output.cc (Output_section::write_header): Call it.
5908
f3ae1b28
ILT
59092011-06-29 Ian Lance Taylor <iant@google.com>
5910
5911 PR gold/12818
5912 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
5913 symbols which are not used in a relocation.
5914
aecf301f
ILT
59152011-06-28 Ian Lance Taylor <iant@google.com>
5916
5917 PR gold/12898
5918 * layout.cc (Layout::segment_precedes): Don't crash if a linker
5919 script create indistinguishable segments.
5920 (Layout::set_segment_offsets): Use stable_sort when sorting
5921 segments. Pass this to Compare_segments constructor.
5922 * layout.h (class Layout): Make segment_precedes non-static.
5923 (class Compare_segments): Change from struct to class. Add
5924 layout_ field. Add constructor.
5925 * script-sections.cc
5926 (Script_sections::attach_sections_using_phdrs_clause): Rename
5927 local orphan to is_orphan. Don't report failure to put empty
5928 section in segment. On attachment failure, report name of
5929 section, and attach to first PT_LOAD segment.
5930
03ef7571
ILT
59312011-06-28 Ian Lance Taylor <iant@google.com>
5932
5933 PR gold/12934
5934 * target-select.cc (Target_selector::Target_selector): Add
5935 emulation parameter. Change all callers.
5936 (select_target_by_bfd_name): Rename from select_target_by_name.
5937 Change all callers.
5938 (select_target_by_emulation): New function.
5939 (supported_emulation_names): New function.
5940 * target-select.h (class Target_selector): Add emulation_ field.
5941 Update declarations.
5942 (Target_selector::recognize_by_bfd_name): Rename from
5943 recognize_by_name. Change all callers.
5944 (Target_selector::supported_bfd_names): Rename from
5945 supported_names. Change all callers.
5946 (Target_selector::recognize_by_emulation): New function.
5947 (Target_selector::supported_emulations): New function.
5948 (Target_selector::emulation): New function.
5949 (Target_selector::do_recognize_by_bfd_name): Rename from
5950 do_recognize_by_name. Change all callers.
5951 (Target_selector::do_supported_bfd_names): Rename from
5952 do_supported_names. Change all callers.
5953 (Target_selector::do_recognize_by_emulation): New function.
5954 (Target_selector::do_supported_emulations): New function.
5955 (select_target_by_bfd_name): Change name in declaration.
5956 (select_target_by_emulation): Declare.
5957 (supported_emulation_names): Declare.
5958 * parameters.cc (parameters_force_valid_target): Try to find
5959 target based on emulation from -m option.
5960 * options.h (class General_options): Change doc string for -m.
5961 * options.cc (help): Print emulations.
5962 (General_options::parse_V): Likewise.
5963 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
5964 Add emulation parameter. Change all callers.
5965
200b2bb9
ILT
59662011-06-28 Ian Lance Taylor <iant@google.com>
5967
5968 * target.h (class Target): Add osabi_ field.
5969 (Target::osabi): New function.
5970 (Target::set_osabi): New function.
5971 (Target::Target): Initialize osabi_.
5972 (Target::do_adjust_elf_header): Make pure virtual.
5973 (Sized_target::do_adjust_elf_header): Declare.
5974 * target.cc (Sized_target::do_adjust_elf_header): New function.
5975 (class Sized_target): Instantiate all versions.
5976 * freebsd.h (class Target_freebsd): Remove.
5977 (Target_selector_freebsd::do_recognize): Call set_osabi on
5978 Target.
5979 (Target_selector_freebsd::do_recognize_by_name): Likewise.
5980 (Target_selector_freebsd::set_osabi): Remove.
5981 * i386.cc (class Target_i386): Inherit from Sized_target rather
5982 than Target_freebsd.
5983 * x86_64.cc (class Target_x86_64): Likewise.
5984
b3ce541e
ILT
59852011-06-28 Ian Lance Taylor <iant@google.com>
5986
5987 * target.h (Target::can_check_for_function_pointers): Rewrite.
5988 Make non-virtual.
5989 (Target::can_icf_inline_merge_sections): Likewise.
5990 (Target::section_may_have_icf_unsafe_poineters): Likewise.
5991 (Target::Target_info): Add can_icf_inline_merge_sections field.
5992 (Target::do_can_check_for_function_pointers): New virtual
5993 function.
5994 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
5995 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
5996 from can_check_for_function_pointers, move in file.
5997 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
5998 section_may_have_icf_unsafe_poineters, move in file.
5999 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
6000 * i386.cc (Target_i386::do_can_check_for_function_pointers):
6001 Rename from can_check_for_function_pointers, move in file.
6002 (Target_i386::can_icf_inline_merge_sections): Remove.
6003 (Target_i386::i386_info): Initialize
6004 can_icf_inline_merge_sections.
6005 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
6006 Initialize can_icf_inline_merge_sections.
6007 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
6008 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
6009 Rename from can_check_for_function_pointers, move in file.
6010 (Target_x86_64::can_icf_inline_merge_sections): Remove.
6011 (Target_x86_64::x86_64_info): Initialize
6012 can_icf_inline_merge_sections.
6013 * testsuite/testfile.cc (Target_test::test_target_info):
6014 Likewise.
6015 * icf.cc (get_section_contents): Correct formatting.
6016
6d1c4efb
ILT
60172011-06-27 Ian Lance Taylor <iant@google.com>
6018
6019 * symtab.cc (Symbol::versioned_name): New function.
6020 (Symbol_table::add_to_final_symtab): Use versioned_name when
6021 appropriate.
6022 (Symbol_table::sized_write_symbol): Likewise.
6023 * symtab.h (class Symbol): Declare versioned_name.
6024 * stringpool.h (class Stringpool_template): Add variant of add
6025 which takes a std::basic_string.
6026 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
6027 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
6028 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
6029 (ver_test_12.o): New target.
6030 * testsuite/Makefile.in: Rebuild.
6031
57eb9b50
DK
60322011-06-27 Doug Kwan <dougkwan@google.com>
6033
6034 * arm.cc (Arm_relocate_functions::thm_jump8,
6035 Arm_relocate_functions::thm_jump11): Use a wider signed
6036 type to compute offset.
6037 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
6038 arm_thm_jump8.
6039 * testsuite/Makefile.in: Regenerate.
6040 * testsuite/arm_branch_in_range.sh: Check test results of
6041 arm_thm_jump11 and arm_thm_jump8.
6042 * testsuite/arm_thm_jump11.s: New test source file.
6043 * testsuite/arm_thm_jump11.t: New linker script.
6044 * testsuite/arm_thm_jump8.s: New test source file.
6045 * testsuite/arm_thm_jump8.t: New linker script.
6046
487b39df
ILT
60472011-06-24 Ian Lance Taylor <iant@google.com>
6048
6049 * layout.cc: Include "object.h".
6050 (ctors_sections_in_init_array): New static variable.
6051 (Layout::is_ctors_in_init_array): New function.
6052 (Layout::layout): Add entry to ctors_sections_in_init_array if
6053 appropriate.
6054 * layout.h (class Layout): Declare is_ctors_in_init_array.
6055 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
6056 is_ctors_reverse_view is set.
6057 (Sized_relobj_file::write_sections): Add layout parameter. Change
6058 all callers. Set is_ctors_reverse_view field of View_size.
6059 (Sized_relobj_file::reverse_words): New function.
6060 * object.h (Sized_relobj_file::View_size): Add
6061 is_ctors_reverse_view field.
6062 (class Sized_relobj_file): Update declarations.
6063 * testsuite/initpri3.c: New test.
6064 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
6065 initpri3b.
6066 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
6067 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
6068 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
6069 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
6070 * testsuite/Makefile.in: Rebuild.
6071
472076e4
CC
60722011-06-24 Cary Coutant <ccoutant@google.com>
6073
6074 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
6075 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
6076 (debug_msg_cdebug.err): New targets.
6077 * testsuite/Makefile.in: Regenerate.
6078 * testsuite/debug_msg.sh: Check output of link with compressed debug.
6079 Fix checks for link with shared library.
6080
a60af0db
DK
60812011-06-24 Doug Kwan <dougkwan@google.com>
6082
6083 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
6084 skip empty text sections.
6085 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
6086
5393d741
ILT
60872011-06-22 Ian Lance Taylor <iant@google.com>
6088
6089 PR gold/12910
6090 * options.h (class General_options): Add --ctors-in-init-array.
6091 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
6092 friends as SHT_PROGBITS for merging sections.
6093 (Layout::layout): Remove special handling of .init_array and
6094 friends. Don't sort if doing relocatable link. Sort for .ctors
6095 and .dtors if ctors_in_init_array.
6096 (Layout::make_output_section): Force correct section types for
6097 .init_array and friends. Don't sort if doing relocatable link,
6098 Don't sort .ctors and .dtors if ctors_in_init_array.
6099 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
6100 (Layout::output_section_name): Add relobj parameter. Change all
6101 callers. Handle .ctors. and .dtors. in code rather than table.
6102 Handle .ctors and .dtors if ctors_in_init_array.
6103 (Layout::match_file_name): New function, moved from output.cc.
6104 * layout.h (class Layout): Update declarations.
6105 * output.cc: Include "layout.h".
6106 (Input_section_sort_entry::get_priority): New function.
6107 (Input_section_sort_entry::match_file_name): Just call
6108 Layout::match_file_name.
6109 (Output_section::Input_section_sort_init_fini_compare::operator()):
6110 Handle .ctors and .dtors. Sort by explicit priority rather than
6111 by name.
6112 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
6113 * testsuite/initpri2.c: New test.
6114 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
6115 (check_PROGRAMS): Add initpri2.
6116 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
6117 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
6118 * configure, testsuite/Makefile.in: Rebuild.
6119
e1f74f98
ILT
61202011-06-19 Ian Lance Taylor <iant@google.com>
6121
6122 PR gold/12880
6123 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
6124 .interp section to a PT_INTERP segment even if we have seen a
6125 --dynamic-linker option. Don't do it if we have seen a PHDRS
6126 clause in a linker script.
6127 (Layout::finalize): Don't create a .interp section if we've
6128 already create a PT_INTERP segment.
6129 (Layout::create_interp): Always call choose_output_section (revert
6130 patch of 2011-06-17). Don't create PT_INTERP segment.
6131 * script-sections.cc
6132 (Script_sections::create_note_and_tls_segments): Add a .interp
6133 section to a PT_INTERP segment even if we have seen a
6134 --dynamic-linker option.
6135
766f91bb
ILT
61362011-06-18 Ian Lance Taylor <iant@google.com>
6137
6138 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
6139 merely because a non-PT_LOAD segment has a dynamic reloc.
6140
0d212c3a
ILT
61412011-06-18 Ian Lance Taylor <iant@google.com>
6142
6143 * layout.cc (Layout::finish_dynamic_section): Don't create
6144 DT_FLAGS entry if not needed.
6145
911a5072
ILT
61462011-06-18 Ian Lance Taylor <iant@google.com>
6147
6148 PR gold/12745
6149 * layout.cc (Layout::layout_eh_frame): Correct handling of
6150 writable .eh_frame section.
6151
534b4e5f
ILT
61522011-06-17 Ian Lance Taylor <iant@google.com>
6153
6154 PR gold/12893
6155 * resolve.cc (Symbol_table::resolve): Don't give an error if a
6156 symbol is redefined with the exact same object and value.
6157
10b4f102
ILT
61582011-06-17 Ian Lance Taylor <iant@google.com>
6159
6160 PR gold/12880
6161 * layout.h (class Layout): Add interp_segment_ field.
6162 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
6163 (Layout::attach_allocated_section_to_segment): If making shared
6164 library, put .interp section in PT_INTERP segment.
6165 (Layout::finalize): Also call create_interp if -dynamic-linker
6166 option was used.
6167 (Layout::create_interp): Assert that there is no PT_INTERP
6168 segment. If not using a SECTIONS clause, use make_output_section.
6169 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
6170 * script-sections.cc
6171 (Script_sections::create_note_and_tls_segments): If making shared
6172 library, put .interp section in PT_INTERP segment.
6173
a29b0dad
ILT
61742011-06-17 Ian Lance Taylor <iant@google.com>
6175
e588ea8d
ILT
6176 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
6177 when making a shared library.
6178
61792011-06-17 Ian Lance Taylor <iant@google.com>
6180
6181 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
6182 parameter. Change all callers. Don't issue warning about PC32
6183 against locally defined symbol.
a29b0dad 6184
9d3b0698
ILT
61852011-06-16 Ian Lance Taylor <iant@google.com>
6186
6187 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
6188 occurs in same object.
6189
85b0f90c
AM
61902011-06-14 Alan Modra <amodra@gmail.com>
6191
6192 * po/POTFILES.in: Regenerate.
6193
a94907d9
ILT
61942011-06-09 Ian Lance Taylor <iant@google.com>
6195
6196 * script-sections.cc
6197 (Orphan_output_section::set_section_addresses): For a relocatable
6198 link set address to 0.
6199
4fb3a1c3
CC
62002011-06-09 Cary Coutant <ccoutant@google.com>
6201
6202 PR gold/12804
6203 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
6204 used with --compress-debug-sections.
6205 * gold/object.cc (Sized_relobj_file::do_layout): Report
6206 uncompressed size of compressed input sections.
6207
61220854
CC
62082011-06-08 Cary Coutant <ccoutant@google.com>
6209
6210 PR gold/12804
6211 * testsuite/two_file_test_2_v1.cc: Change initialization of
6212 v2 to keep it in .data.
6213
e6455dfb
CC
62142011-06-07 Cary Coutant <ccoutant@google.com>
6215
6216 * common.cc (Symbol_table::do_allocate_commons_list): Call
6217 gold_fallback.
6218 * errors.cc (Errors::fatal): Adjust call to gold_exit.
6219 (Errors::fallback): New function.
6220 (gold_fallback): New function.
6221 * errors.h (Errors::fallback): New function.
6222 * gold.cc (gold_exit): Change status parameter to enum; adjust
6223 all callers.
6224 (queue_initial_tasks): Call gold_fallback.
6225 * gold.h: Include cstdlib.
6226 (Exit_status): New enum type.
6227 (gold_exit): Change status parameter to enum.
6228 (gold_fallback): New function.
6229 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
6230 (Layout::create_symtab_sections): Likewise.
6231 (Layout::create_shdrs): Likewise.
6232 * main.cc (main): Adjust call to gold_exit.
6233 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
6234 (Output_data_got::add_got_entry_pair): Likewise.
6235 (Output_section::add_input_section): Likewise.
6236 (Output_section::add_output_section_data): Likewise.
6237 (Output_segment::set_section_list_addresses): Likewise.
6238 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
6239
fb0e076f
CC
62402011-06-07 Cary Coutant <ccoutant@google.com>
6241
6242 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
6243 for incremental links.
6244 * output.cc (Output_segment::set_section_list_addresses): Remove
6245 FIXME and test for TLS or BSS.
6246
a5ee4d5d
CC
62472011-06-07 Cary Coutant <ccoutant@google.com>
6248
6249 * testsuite/Makefile.am: Add incremental_copy_test,
6250 incremental_common_test_1.
6251 * testsuite/Makefile.in: Regenerate.
6252 * testsuite/common_test_1_v1.c: New source file.
6253 * testsuite/common_test_1_v2.c: New source file.
6254 * testsuite/copy_test_v1.cc: New source file.
6255
5146f448
CC
62562011-06-07 Cary Coutant <ccoutant@google.com>
6257
6258 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
6259 update, allocate common from bss section's free list.
6260 * incremental-dump.cc (dump_incremental_inputs): Print flag for
6261 linker-defined symbols.
6262 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
6263 Skip GOT and PLT entries that are no longer referenced.
6264 (Output_section_incremental_inputs::write_info_blocks): Mark
6265 linker-defined symbols.
6266 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
6267 * output.cc (Output_section::allocate): New function.
6268 * output.h (Output_section::allocate): New function.
6269 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
6270 linker-defined symbols.
6271 (Symbol::override_base_with_special): Copy is_predefined_ flag.
6272 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
6273 (Symbol::init_base_output_data): Likewise.
6274 (Symbol::init_base_output_segment): Likewise.
6275 (Symbol::init_base_constant): Likewise.
6276 (Sized_symbol::init_output_data): Likewise.
6277 (Sized_symbol::init_output_segment): Likewise.
6278 (Sized_symbol::init_constant): Likewise.
6279 (Symbol_table::do_define_in_output_data): Likewise.
6280 (Symbol_table::do_define_in_output_segment): Likewise.
6281 (Symbol_table::do_define_as_constant): Likewise.
6282 * symtab.h (Symbol::is_predefined): New function.
6283 (Symbol::init_base_output_data): Add is_predefined parameter.
6284 (Symbol::init_base_output_segment): Likewise.
6285 (Symbol::init_base_constant): Likewise.
6286 (Symbol::is_predefined_): New data member.
6287 (Sized_symbol::init_output_data): Add is_predefined parameter.
6288 (Sized_symbol::init_output_segment): Likewise.
6289 (Sized_symbol::init_constant): Likewise.
6290 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
6291
26d3c67d
CC
62922011-06-07 Cary Coutant <ccoutant@google.com>
6293
6294 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
6295 instead of emit_copy_reloc.
6296 (Copy_relocs::emit_copy_reloc): Refactor.
6297 (Copy_relocs::make_copy_reloc): New function.
6298 (Copy_relocs::add_copy_reloc): Remove.
6299 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
6300 section.
6301 (Copy_relocs::make_copy_reloc): New function.
6302 (Copy_relocs::add_copy_reloc): Remove.
6303 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
6304 unchanged input files.
6305 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
6306 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
6307 Reserve BSS space for COPY relocations.
6308 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6309 (Output_section_incremental_inputs::write_info_blocks): Record
6310 whether a symbol is copied from a shared object.
6311 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
6312 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
6313 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
6314 (Incremental_input_entry_reader::get_output_symbol_index): Add
6315 is_copy parameter.
6316 (Incremental_binary::emit_copy_relocs): New function.
6317 (Incremental_binary::do_emit_copy_relocs): New function.
6318 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6319 new data member.
6320 (Sized_incremental_binary::add_copy_reloc): New function.
6321 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6322 (Sized_incremental_binary::Copy_reloc): New struct.
6323 (Sized_incremental_binary::Copy_relocs): New typedef.
6324 (Sized_incremental_binary::copy_relocs_): New data member.
6325 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
6326 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
6327 * target.h (Sized_target::emit_copy_reloc): New function.
6328 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
6329
7cdb37d9
CC
63302011-06-02 Cary Coutant <ccoutant@google.com>
6331
6332 PR gold/12163
6333 * gold/archive.cc (Archive::Archive): Initialize new data member.
6334 (Archive::include_all_members): Return if archive has already been
6335 included.
6336 * gold/archive.h (Archive::include_all_members_): New data member.
6337
cc643b88
NC
63382011-06-02 Nick Clifton <nickc@redhat.com>
6339
6340 * dynobj.h: Fix spelling mistake in comment.
6341 * output.cc: Likewise.
6342
f62a3ca7 63432011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 6344 Asier Llano
f62a3ca7
DK
6345
6346 PR gold/12826
cc643b88 6347 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
6348 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
6349 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
6350 redundant arm_exidx_test.so.
6351 * testsuite/Makefile.in: Regenerate.
6352 (check_SCRIPTS): Add pr12826.sh
6353 (check_DATA): Add pr12826.stdout
6354 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
6355 * testsuite/pr12826.sh: New file.
6356 * testsuite/pr12826_1.s: Ditto.
6357 * testsuite/pr12826_1.s: Ditto.
6358
8dbe1edc
ILT
63592011-05-30 Ian Lance Taylor <iant@google.com>
6360
6361 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
6362 sections.
6363
c49875be
ILT
63642011-05-29 Ian Lance Taylor <iant@google.com>
6365
6366 PR gold/12804
6367 * testsuite/Makefile.am: Use different file name for two_file_test
6368 temporary file for each incremental test.
6369 * testsuite/Makefile.in: Rebuild.
6370
69d53f7a
ILT
63712011-05-29 Ian Lance Taylor <iant@google.com>
6372
6373 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
6374 binary input file is empty.
6375
41d0ab5f
ILT
63762011-05-27 Ian Lance Taylor <iant@google.com>
6377
6378 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
6379 (ver_test_9.so): Likewise.
6380 * testsuite/Makefile.in: Rebuild.
6381
89d8a36b
CC
63822011-05-26 Cary Coutant <ccoutant@google.com>
6383
6384 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
6385 * incremental.cc (Incremental_inputs::report_input_section): Fix
6386 comment, indentation.
6387 (Incremental_inputs::report_comdat_group): New function.
6388 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6389 of data for incremental input file entry.
6390 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
6391 group count, COMDAT group signatures.
6392 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
6393 an unchanged input file.
6394 * incremental.h (Incremental_object_entry::Incremental_object_entry):
6395 Initialize new data member.
6396 (Incremental_object_entry::add_comdat_group): New function.
6397 (Incremental_object_entry::get_comdat_group_count): New function.
6398 (Incremental_object_entry::get_comdat_signature_key): New function.
6399 (Incremental_object_entry::groups_): New data member.
6400 (Incremental_inputs::report_comdat_group): New function.
6401 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
6402 data for incremental input file entry.
6403 (Incremental_input_entry_reader::get_comdat_group_count): New function.
6404 (Incremental_input_entry_reader::get_input_section): Adjust size of
6405 data for incremental input file entry.
6406 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
6407 (Incremental_input_entry_reader::get_comdat_group_signature): New
6408 function.
6409 * object.cc (Sized_relobj::include_section_group): Report kept
6410 COMDAT groups for incremental links.
6411
1706a06f
ILT
64122011-05-24 David Meyer <pdox@google.com>
6413
6414 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
6415 with name parameter. Add found_name parameter.
6416 * fileread.cc (Input_file::find_file): Adjust code accordingly.
6417 * dirsearch.h (class Dirsearch): Update declaration.
6418
a10ae760
ILT
64192011-05-24 Ian Lance Taylor <iant@google.com>
6420
6421 * archive.cc (Library_base::should_include_member): Pull in object
6422 from archive if it defines the entry symbol.
6423 * parameters.cc (Parameters::entry): New function.
6424 * parameters.h (class Parameters): Declare entry.
6425 * output.h (class Output_file_header): Remove entry_ field.
6426 * output.cc (Output_file_header::Output_file_header): Remove entry
6427 parameter. Change all callers.
6428 (Output_file_header::entry): Use parameters->entry.
6429 * gold.cc (queue_middle_tasks): Likewise.
6430 * plugin.cc (Plugin_hook::run): Likewise.
6431
aa92d6ed
CC
64322011-05-24 Cary Coutant <ccoutant@google.com>
6433
6434 * gold.cc (queue_initial_tasks): Pass incremental base filename
6435 to Output_file::open_base_file; don't print error message.
6436 * incremental-dump.cc (main): Adjust call to
6437 Output_file::open_for_modification.
6438 * incremental-dump.cc (main): Likewise.
6439 * incremental.cc (Incremental_inputs::report_command_line):
6440 Ignore --incremental-base option when comparing command lines.
6441 Ignore parameter when given as separate argument.
6442 * options.h (class General_options): Add --incremental-base.
6443 * output.cc (Output_file::Output_file):
6444 (Output_file::open_base_file): Add base_name and writable parameters;
6445 read base file into new file; print error message here.
6446 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6447 callers.
6448 * output.h (Output_file::open_for_modification): Rename to...
6449 (Output_file::open_base_file): ...this; add base_name and
6450 writable parameters; adjust all callers.
6451 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6452 callers.
6453 * testsuite/Makefile.am (incremental_test_4): Test
6454 --incremental-base.
6455 * testsuite/Makefile.in: Regenerate.
6456
2eedd706
CC
64572011-05-24 Cary Coutant <ccoutant@google.com>
6458
6459 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
6460 incremental_test_4.
6461 * testsuite/Makefile.in: Regenerate.
6462 * testsuite/two_file_test_1_v1.cc: New test source file.
6463 * testsuite/two_file_test_1b_v1.cc: New test source file.
6464 * testsuite/two_file_test_2_v1.cc: New test source file.
6465
0f1c85a6
CC
64662011-05-24 Cary Coutant <ccoutant@google.com>
6467
6468 * dynobj.h (Dynobj::do_dynobj): New function.
6469 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
6470 flag and soname for shared objects.
6471 * incremental.cc (Incremental_inputs::report_object): Make
6472 either Incremental_object_entry or Incremental_dynobj_entry; add
6473 soname to string table.
6474 (Incremental_inputs::report_input_section): Add assertion.
6475 (Output_section_incremental_inputs::set_final_data_size): Adjust
6476 type of input file entry for shared libraries; adjust size of
6477 shared library info entry.
6478 (Output_section_incremental_inputs::write_input_files): Write
6479 as_needed flag for shared libraries.
6480 (Output_section_incremental_inputs::write_info_blocks): Adjust type
6481 of input file entry for shared libraries; write soname.
6482 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
6483 soname from incremental info.
6484 * incremental.h (enum Incremental_input_flags): Add
6485 INCREMENTAL_INPUT_AS_NEEDED.
6486 (Incremental_input_entry::Incremental_input_entry): Initialize new
6487 data member.
6488 (Incremental_input_entry::set_as_needed): New function.
6489 (Incremental_input_entry::as_needed): New function.
6490 (Incremental_input_entry::do_dynobj_entry): New function.
6491 (Incremental_input_entry::as_needed_): New data member.
6492 (Incremental_object_entry::Incremental_object_entry): Don't check
6493 for shared library.
6494 (Incremental_object_entry::do_type): Likewise.
6495 (class Incremental_dynobj_entry): New class.
6496 (Incremental_input_entry_reader::as_needed): New function.
6497 (Incremental_input_entry_reader::get_soname): New function.
6498 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
6499 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
6500 size of shared library info entry.
58797674 6501 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
6502 incremental link when adding DT_NEEDED entries.
6503 * object.h (Object::Object): Initialize new data member.
6504 (Object::dynobj): New function.
6505 (Object::set_as_needed): New function.
6506 (Object::as_needed): New function.
6507 (Object::do_dynobj): New function.
6508 (Object::as_needed_): New data member.
6509
6fa2a40b
CC
65102011-05-24 Cary Coutant <ccoutant@google.com>
6511
6512 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
6513 info; adjust display of GOT entries.
6514 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6515 vector of input objects; remove file_status_.
6516 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
6517 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
6518 got_plt reader; call target hooks to reserve GOT entries.
6519 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6520 of input file info header and GOT info entry.
6521 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
6522 relocation info.
6523 (Got_plt_view_info::got_descriptor): Remove.
6524 (Got_plt_view_info::sym_index): New data member.
6525 (Got_plt_view_info::input_index): New data member.
6526 (Local_got_offset_visitor::visit): Write input file index.
6527 (Global_got_offset_visitor::visit): Write 0 for input file index.
6528 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
6529 with sym_index and input_index.
6530 (Output_section_incremental_inputs::write_got_plt): Adjust size of
6531 incremental info GOT entry; replace got_descriptor with input_index.
6532 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
6533 map from input file index to object.
6534 (Sized_relobj_incr::do_layout): Replace direct data member reference
6535 with accessor function.
6536 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
6537 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
6538 Adjust size of input file info header.
6539 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
6540 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
6541 (Incremental_input_entry_reader::get_input_section): Adjust size of
6542 input file info header.
6543 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
6544 of incremental info GOT entry.
6545 (Incremental_got_plt_reader::get_got_desc): Remove.
6546 (Incremental_got_plt_reader::get_got_symndx): New function.
6547 (Incremental_got_plt_reader::get_got_input_index): New function.
6548 (Sized_incremental_binary::Sized_incremental_binary): Remove
6549 file_status_; add input_objects_.
6550 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
6551 (Sized_incremental_binary::set_file_is_unchanged): Remove.
6552 (Sized_incremental_binary::file_is_unchanged): Remove.
6553 (Sized_incremental_binary::set_input_object): New function.
6554 (Sized_incremental_binary::input_object): New function.
6555 (Sized_incremental_binary::file_status_): Remove.
6556 (Sized_incremental_binary::input_objects_): New data member.
6557 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
6558 references.
6559 (Sized_relobj_incr::invalid_address): Move to base class.
6560 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
6561 class.
6562 (Sized_relobj_incr::do_output_section_offset): Likewise.
6563 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
6564 (Sized_relobj_incr::section_offsets_): Likewise.
6565 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
6566 function.
6567 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
6568 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
6569 with accessor function.
6570 (Sized_relobj_file::do_layout): Likewise.
6571 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
6572 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
6573 (Sized_relobj_file::compute_final_local_value): Replace refs to
6574 section_offsets_ with accessor function.
6575 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
6576 * object.h (Relobj::Relobj): Initialize new data members.
6577 (Relobj::add_dyn_reloc): New function.
6578 (Relobj::first_dyn_reloc): New function.
6579 (Relobj::dyn_reloc_count): New function.
6580 (Relobj::first_dyn_reloc_): New data member.
6581 (Relobj::dyn_reloc_count_): New data member.
6582 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
6583 references.
6584 (Sized_relobj::Address): New typedef.
6585 (Sized_relobj::invalid_address): Move here from child class.
6586 (Sized_relobj::Sized_relobj): Initialize new data members.
6587 (Sized_relobj::sized_relobj): New function.
6588 (Sized_relobj::is_output_section_offset_invalid): Move here from
6589 child class.
6590 (Sized_relobj::get_output_section_offset): Likewise.
6591 (Sized_relobj::local_has_got_offset): Likewise.
6592 (Sized_relobj::local_got_offset): Likewise.
6593 (Sized_relobj::set_local_got_offset): Likewise.
6594 (Sized_relobj::do_for_all_local_got_entries): Likewise.
6595 (Sized_relobj::clear_got_offsets): New function.
6596 (Sized_relobj::section_offsets): Move here from child class.
6597 (Sized_relobj::do_output_section_offset): Likewise.
6598 (Sized_relobj::do_set_section_offset): Likewise.
6599 (Sized_relobj::Local_got_offsets): Likewise.
6600 (Sized_relobj::local_got_offsets_): Likewise.
6601 (Sized_relobj::section_offsets_): Likewise.
6602 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
6603 references.
6604 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
6605 class.
6606 (Sized_relobj_file::sized_relobj): New function
6607 (Sized_relobj_file::local_has_got_offset): Move to base class.
6608 (Sized_relobj_file::local_got_offset): Likewise.
6609 (Sized_relobj_file::set_local_got_offset): Likewise.
6610 (Sized_relobj_file::get_output_section_offset): Likewise.
6611 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
6612 (Sized_relobj_file::do_output_section_offset): Likewise.
6613 (Sized_relobj_file::do_set_section_offset): Likewise.
6614 (Sized_relobj_file::Local_got_offsets): Likewise.
6615 (Sized_relobj_file::local_got_offsets_): Likewise.
6616 (Sized_relobj_file::section_offsets_): Likewise.
6617 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
6618 (all constructors).
6619 (set_needs_dynsym_index): Convert relobj to derived class pointer.
6620 (Output_reloc::get_symbol_index): Likewise.
6621 (Output_reloc::local_section_offset): Likewise.
6622 (Output_reloc::get_address): Likewise.
6623 (Output_reloc::symbol_value): Likewise.
6624 (Output_data_got::reserve_slot): Move to class definition.
6625 (Output_data_got::reserve_local): New function.
6626 (Output_data_got::reserve_slot_for_global): Remove.
6627 (Output_data_got::reserve_global): New function.
6628 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
6629 (all constructors, two instantiations).
6630 (Output_reloc::get_relobj): New function (two instantiations).
6631 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
6632 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
6633 (Output_data_reloc::add_global): Adjust type of relobj.
6634 (Output_data_reloc::add_global_relative): Likewise.
6635 (Output_data_reloc::add_symbolless_global_addend): Likewise.
6636 (Output_data_reloc::add_local): Likewise.
6637 (Output_data_reloc::add_local_relative): Likewise.
6638 (Output_data_reloc::add_symbolless_local_addend): Likewise.
6639 (Output_data_reloc::add_local_section): Likewise.
6640 (Output_data_reloc::add_output_section): Likewise.
6641 (Output_data_reloc::add_absolute): Likewise.
6642 (Output_data_reloc::add_target_specific): Likewise.
6643 (Output_data_got::reserve_slot): Move definition here.
6644 (Output_data_got::reserve_local): New function.
6645 (Output_data_got::reserve_global): New function.
6646 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
6647 section_offsets_ with accessor function.
6648 (Sized_relobj_file::write_sections): Likewise.
6649 (Sized_relobj_file::do_relocate_sections): Likewise.
6650 * target.h (Sized_target::reserve_local_got_entry): New function.
6651 (Sized_target::reserve_global_got_entry): New function.
6652 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
6653 (Target_x86_64::reserve_global_got_entry): New function.
6654 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
6655
4829d394
CC
66562011-05-23 Cary Coutant <ccoutant@google.com>
6657
6658 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
6659 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
6660 bit when checking got_type.
6661 * incremental.cc (Sized_incremental_binary::setup_readers):
6662 Store symbol table and string table locations; initialize bit vector
6663 of file status flags.
6664 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
6665 unchanged files.
6666 (Sized_incremental_binary::do_process_got_plt): New function.
6667 (Sized_incremental_binary::get_symtab_view): Use stored locations.
6668 (Output_section_incremental_inputs::set_final_data_size): Record
6669 file index for each input file.
6670 (Output_section_incremental_inputs::write_got_plt): Store file index
6671 instead of input entry offset for each GOT entry.
6672 * incremental.h
6673 (Incremental_input_entry::Incremental_input_entry): Initialize new
6674 data member.
6675 (Incremental_input_entry::set_offset): Store file index.
6676 (Incremental_input_entry::get_file_index): New function.
6677 (Incremental_input_entry::file_index_): New data member.
6678 (Incremental_binary::process_got_plt): New function.
6679 (Incremental_binary::do_process_got_plt): New function.
6680 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6681 data members.
6682 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
6683 (Sized_incremental_binary::set_file_is_unchanged): New function.
6684 (Sized_incremental_binary::file_is_unchanged): New function.
6685 (Sized_incremental_binary::do_process_got_plt): New function.
6686 (Sized_incremental_binary::file_status_): New data member.
6687 (Sized_incremental_binary::main_symtab_loc_): New data member.
6688 (Sized_incremental_binary::main_strtab_loc_): New data member.
6689 * output.cc (Output_data_got::Got_entry::write): Add case
6690 RESERVED_CODE.
6691 (Output_data_got::add_global): Call add_got_entry.
6692 (Output_data_got::add_global_plt): Likewise.
6693 (Output_data_got::add_global_with_rel): Likewise.
6694 (Output_data_got::add_global_with_rela): Likewise.
6695 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
6696 (Output_data_got::add_global_pair_with_rela): Likewise.
6697 (Output_data_got::add_local): Call add_got_entry.
6698 (Output_data_got::add_local_plt): Likewise.
6699 (Output_data_got::add_local_with_rel): Likewise.
6700 (Output_data_got::add_local_with_rela): Likewise.
6701 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
6702 (Output_data_got::add_local_pair_with_rela): Likewise.
6703 (Output_data_got::reserve_slot): New function.
6704 (Output_data_got::reserve_slot_for_global): New function.
6705 (Output_data_got::add_got_entry): New function.
6706 (Output_data_got::add_got_entry_pair): New function.
6707 (Output_section::add_output_section_data): Edit FIXME.
6708 * output.h
6709 (Output_section_data_build::Output_section_data_build): New
6710 constructor with size parameter.
6711 (Output_data_space::Output_data_space): Likewise.
6712 (Output_data_got::Output_data_got): Initialize new data member; new
6713 constructor with size parameter.
6714 (Output_data_got::add_constant): Call add_got_entry.
6715 (Output_data_got::reserve_slot): New function.
6716 (Output_data_got::reserve_slot_for_global): New function.
6717 (class Output_data_got::Got_entry): Add RESERVED_CODE.
6718 (Output_data_got::add_got_entry): New function.
6719 (Output_data_got::add_got_entry_pair): New function.
6720 (Output_data_got::free_list_): New data member.
6721 * target.h (Sized_target::init_got_plt_for_update): New function.
6722 (Sized_target::register_global_plt_entry): New function.
6723 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
6724 Initialize new data member; call init; add constructor with PLT count.
6725 (Output_data_plt_x86_64::init): New function.
6726 (Output_data_plt_x86_64::add_relocation): New function.
6727 (Output_data_plt_x86_64::reserve_slot): New function.
6728 (Output_data_plt_x86_64::free_list_): New data member.
6729 (Target_x86_64::init_got_plt_for_update): New function.
6730 (Target_x86_64::register_global_plt_entry): New function.
6731 (Output_data_plt_x86_64::add_entry): Allocate from free list for
6732 incremental updates.
6733 (Output_data_plt_x86_64::add_relocation): New function.
6734 * testsuite/object_unittest.cc (Object_test): Set default options.
6735
ec69d6da
ILT
67362011-05-16 Ian Lance Taylor <iant@google.com>
6737
6738 * options.h (class General_options): Make -i a synonym for -r.
6739
732e31de
ILT
67402011-05-16 Ian Lance Taylor <iant@google.com>
6741
6742 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
6743
403676b5
CC
67442011-05-10 Cary Coutant <ccoutant@google.com>
6745
6746 * object.cc (Sized_relobj::do_count_local_symbols): Check for
6747 strip_all (-s).
6748
5b7b7d6e
ILT
67492011-05-06 Ian Lance Taylor <iant@google.com>
6750
6751 * layout.cc (Layout::layout): If the output section flags change,
6752 update the ordering.
6753
f0f9babf
CC
67542011-04-25 Cary Coutant <ccoutant@google.com>
6755
6756 * incremental-dump.cc (dump_incremental_inputs): Print local
6757 symbol info for each input file.
6758 * incremental.cc
6759 (Output_section_incremental_inputs::set_final_data_size): Add local
6760 symbol info to input file entries in incremental info.
6761 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6762 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
6763 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
6764 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
6765 implementation.
6766 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
6767 (Sized_incr_relobj::do_relocate): Write the local symbols.
6768 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
6769 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
6770 Adjust size of input file header.
6771 (Incremental_inputs_reader::get_local_symbol_offset): New function.
6772 (Incremental_inputs_reader::get_local_symbol_count): New function.
6773 (Incremental_inputs_reader::get_input_section): Adjust size of input
6774 file header.
6775 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
6776 (Sized_incr_relobj::This): New typedef.
6777 (Sized_incr_relobj::sym_size): New const data member.
6778 (Sized_incr_relobj::Local_symbol): New struct.
6779 (Sized_incr_relobj::do_output_local_symbol_count): New function.
6780 (Sized_incr_relobj::do_local_symbol_offset): New function.
6781 (Sized_incr_relobj::local_symbol_count_): New data member.
6782 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
6783 (Sized_incr_relobj::local_symbol_index_): New data member.
6784 (Sized_incr_relobj::local_symbol_offset_): New data member.
6785 (Sized_incr_relobj::local_dynsym_offset_): New data member.
6786 (Sized_incr_relobj::local_symbols_): New data member.
6787 * object.h (Relobj::output_local_symbol_count): New function.
6788 (Relobj::local_symbol_offset): New function.
6789 (Relobj::do_output_local_symbol_count): New function.
6790 (Relobj::do_local_symbol_offset): New function.
6791 (Sized_relobj::do_output_local_symbol_count): New function.
6792 (Sized_relobj::do_local_symbol_offset): New function.
6793
d0a9ace3
ILT
67942011-04-22 Vladimir Simonov <sv@sw.ru>
6795
6796 * descriptors.cc (set_close_on_exec): New function.
6797 (Descriptors::open): Use set_close_on_exec.
6798 * output.cc (S_ISLNK): Define if not defined.
6799
94a3fc8b
CC
68002011-04-22 Cary Coutant <ccoutant@google.com>
6801
6802 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6803 global symbol map.
6804 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6805 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
6806 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
6807 relocations.
6808 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
6809 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
6810 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
6811 * incremental.h
6812 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
6813 function.
6814 (Incremental_binary::apply_incremental_relocs): New function.
6815 (Incremental_binary::do_apply_incremental_relocs): New function.
6816 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6817 data member.
6818 (Sized_incremental_binary::add_global_symbol): New function.
6819 (Sized_incremental_binary::global_symbol): New function.
6820 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6821 (Sized_incremental_binary::symbol_map_): New data member.
6822 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
6823 * target.h (Sized_target::apply_relocation): New function.
6824 * target-reloc.h (apply_relocation): New function.
6825 * x86_64.cc (Target_x86_64::apply_relocation): New function.
6826
c87e4302
DK
68272011-04-22 Doug Kwan <dougkwan@google.com>
6828
6829 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
6830 flag of a SHT_ARM_EXIDX section.
2e702c99 6831 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
6832 * testsuite/Makefile.in: Regenerate.
6833 * testsuite/arm_exidx_test.s: New file.
6834 * testsuite/arm_exidx_test.sh: Same.
6835
e7782cf6
CC
68362011-04-20 Cary Coutant <ccoutant@google.com>
6837
6838 PR gold/12689
6839 * archive.h (Incremental_archive_entry::Archive_member):
6840 Initialize arg_serial_ (second constructor).
6841
308ecdc7
ILT
68422011-04-17 Ian Lance Taylor <iant@google.com>
6843
6844 * object.cc (Relocate_info::location): Simplify location string.
6845 * errors.cc (Errors::error_at_location): Don't print program
6846 name.
6847 (Errors::warning_at_location): Likewise.
6848 (Errors::undefined_symbol): Likewise.
6849 * testsuite/debug_msg.sh: Update accordingly.
6850
bec5b579
CC
68512011-04-14 Cary Coutant <ccoutant@google.com>
6852
6853 * gold/layout.cc (Layout::symtab_section_offset): New function.
6854 * gold/layout.h (Layout::symtab_section_offset): New function.
6855 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
6856
88597d34
ILT
68572011-04-12 Ian Lance Taylor <iant@google.com>
6858
6859 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
6860 with MREMAP_MAYMOVE.
6861 * output.h (class Output_file): Add map_is_allocated_ field.
6862 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
6863 not available, provide stubs. If mremap is not available, #define
6864 it to gold_mremap.
6865 (MREMAP_MAYMOVE): Define if not defined.
6866 (Output_file::Output_file): Initialize map_is_allocated_.
6867 (Output_file::resize): Check map_is_allocated_.
6868 (Output_file::map_anonymous): If mmap fails, use malloc.
6869 (Output_file::unmap): Don't do anything for an anonymous map.
6870 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
6871 is not available, provide stubs.
6872 (File_read::View::~View): Use free rather than delete[].
6873 (File_read::make_view): Use malloc rather than new[]. If mmap
6874 fails, use malloc.
6875 (File_read::find_or_make_view): Use malloc rather than new[].
6876 * gold.h: Remove HAVE_REMAP code.
6877 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
6878 exists. Rename mremap to gold_mremap. If mmap is not available
6879 don't do anything.
6880 * configure, config.in: Rebuild.
6881
11e361bc
ILT
68822011-04-11 Ian Lance Taylor <iant@google.com>
6883
6884 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
6885 initialize local variable v.
6886
cdc29364
CC
68872011-04-11 Cary Coutant <ccoutant@google.com>
6888
6889 * archive.cc (Archive::include_member): Adjust call to
6890 report_object.
6891 (Add_archive_symbols::run): Track argument serial numbers.
6892 (Lib_group::include_member): Likewise.
6893 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
6894 * archive.h (Incremental_archive_entry::Archive_member):
6895 Initialize arg_serial_.
6896 (Archive_member::arg_serial_): New data member.
6897 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
6898 (Sized_dynobj::do_add_symbols): Track symbols when doing an
6899 incremental link.
6900 (Sized_dynobj::do_for_all_local_got_entries): New function.
6901 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
6902 function.
6903 * fileread.cc (get_mtime): New function.
6904 * fileread.h (get_mtime): New function.
6905 * gold.cc (queue_initial_tasks): Check for incremental update.
6906 (process_incremental_input): New function.
6907 (queue_middle_tasks): Don't force valid target for incremental
6908 update.
6909 * incremental-dump.cc (find_input_containing_global): Adjust
6910 size of symbol info entry.
6911 (dump_incremental_inputs): Dump argument serial number and
6912 in_system_directory flag; bias shndx by 1; print symbol names
6913 when dumping per-file symbol lists; use new symbol info readers.
6914 * incremental.cc
6915 (Output_section_incremental_inputs:update_data_size): New function.
6916 (Sized_incremental_binary::setup_readers): Setup input readers
6917 for each input file; build maps for files added from libraries
6918 and scripts.
6919 (Sized_incremental_binary::check_input_args): New function.
6920 (Sized_incremental_binary::do_check_inputs): Build map of argument
6921 serial numbers to input arguments.
6922 (Sized_incremental_binary::do_file_has_changed): Rename
6923 do_file_is_unchanged to this; compare file modification times.
6924 (Sized_incremental_binary::do_init_layout): New function.
6925 (Sized_incremental_binary::do_reserve_layout): New function.
6926 (Sized_incremental_binary::do_get_input_reader): Remove.
6927 (Sized_incremental_binary::get_symtab_view): New function.
6928 (Incremental_checker::can_incrementally_link_output_file): Remove.
6929 (Incremental_inputs::report_command_line): Exclude --debug options.
6930 (Incremental_inputs::report_archive_begin): Add parameter; track
6931 argument serial numbers; don't put input file entry for archive
6932 before archive members.
6933 (Incremental_inputs::report_archive_end): Put input file entry
6934 for archive after archive members.
6935 (Incremental_inputs::report_object): Add parameter; track argument
6936 serial numbers and in_system_directory flag.
6937 (Incremental_inputs::report_script): Add parameter; track argument
6938 serial numbers.
6939 (Output_section_incremental_inputs::set_final_data_size): Adjust
6940 size of symbol info entry; check for forwarding symbols.
6941 (Output_section_incremental_inputs::write_input_files): Write
6942 in_system_directory flag and argument serial number.
6943 (Output_section_incremental_inputs::write_info_blocks): Map section
6944 indices between incremental info and original input file; store
6945 input section index for each symbol.
6946 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
6947 change operator() to visit().
6948 (class Global_got_offset_visitor): Likewise.
6949 (class Global_symbol_visitor_got_plt):
6950 (Output_section_incremental_inputs::write_got_plt): Use new visitor
6951 classes.
6952 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
6953 (Sized_incr_relobj::do_read_symbols): New function.
6954 (Sized_incr_relobj::do_layout): New function.
6955 (Sized_incr_relobj::do_layout_deferred_sections): New function.
6956 (Sized_incr_relobj::do_add_symbols): New function.
6957 (Sized_incr_relobj::do_should_include_member): New function.
6958 (Sized_incr_relobj::do_for_all_global_symbols): New function.
6959 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
6960 (Sized_incr_relobj::do_section_size): New function.
6961 (Sized_incr_relobj::do_section_name): New function.
6962 (Sized_incr_relobj::do_section_contents): New function.
6963 (Sized_incr_relobj::do_section_flags): New function.
6964 (Sized_incr_relobj::do_section_entsize): New function.
6965 (Sized_incr_relobj::do_section_address): New function.
6966 (Sized_incr_relobj::do_section_type): New function.
6967 (Sized_incr_relobj::do_section_link): New function.
6968 (Sized_incr_relobj::do_section_info): New function.
6969 (Sized_incr_relobj::do_section_addralign): New function.
6970 (Sized_incr_relobj::do_initialize_xindex): New function.
6971 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
6972 (Sized_incr_relobj::do_read_relocs): New function.
6973 (Sized_incr_relobj::do_gc_process_relocs): New function.
6974 (Sized_incr_relobj::do_scan_relocs): New function.
6975 (Sized_incr_relobj::do_count_local_symbols): New function.
6976 (Sized_incr_relobj::do_finalize_local_symbols): New function.
6977 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
6978 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
6979 (Sized_incr_relobj::do_relocate): New function.
6980 (Sized_incr_relobj::do_set_section_offset): New function.
6981 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
6982 (Sized_incr_dynobj::do_read_symbols): New function.
6983 (Sized_incr_dynobj::do_layout): New function.
6984 (Sized_incr_dynobj::do_add_symbols): New function.
6985 (Sized_incr_dynobj::do_should_include_member): New function.
6986 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
6987 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
6988 (Sized_incr_dynobj::do_section_size): New function.
6989 (Sized_incr_dynobj::do_section_name): New function.
6990 (Sized_incr_dynobj::do_section_contents): New function.
6991 (Sized_incr_dynobj::do_section_flags): New function.
6992 (Sized_incr_dynobj::do_section_entsize): New function.
6993 (Sized_incr_dynobj::do_section_address): New function.
6994 (Sized_incr_dynobj::do_section_type): New function.
6995 (Sized_incr_dynobj::do_section_link): New function.
6996 (Sized_incr_dynobj::do_section_info): New function.
6997 (Sized_incr_dynobj::do_section_addralign): New function.
6998 (Sized_incr_dynobj::do_initialize_xindex): New function.
6999 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
7000 (make_sized_incremental_object): New function.
7001 (Incremental_library::copy_unused_symbols): New function.
7002 (Incremental_library::do_for_all_unused_symbols): New function.
7003 * incremental.h (enum Incremental_input_flags): New type.
7004 (class Incremental_checker): Remove.
7005 (Incremental_input_entry::Incremental_input_entry): Add argument
7006 serial number.
7007 (Incremental_input_entry::arg_serial): New function.
7008 (Incremental_input_entry::set_is_in_system_directory): New function.
7009 (Incremental_input_entry::is_in_system_directory): New function.
7010 (Incremental_input_entry::arg_serial_): New data member.
7011 (Incremental_input_entry::is_in_system_directory_): New data member.
7012 (class Script_info): Move here from script.h.
7013 (Script_info::Script_info): Add filename parameter.
7014 (Script_info::filename): New function.
7015 (Script_info::filename_): New data member.
7016 (Incremental_script_entry::Incremental_script_entry): Add argument
7017 serial number.
7018 (Incremental_object_entry::Incremental_object_entry): Likewise.
7019 (Incremental_object_entry::add_input_section): Build list of input
7020 sections with map to original shndx.
7021 (Incremental_object_entry::get_input_section_index): New function.
7022 (Incremental_object_entry::shndx_): New data member.
7023 (Incremental_object_entry::name_key_): Rename; adjust all refs.
7024 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
7025 (Incremental_archive_entry::Incremental_archive_entry): Add argument
7026 serial number.
7027 (Incremental_inputs::report_archive_begin): Likewise.
7028 (Incremental_inputs::report_object): Likewise.
7029 (Incremental_inputs::report_script): Likewise.
7030 (class Incremental_global_symbol_reader): New class.
7031 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
7032 and store flags and input file type.
7033 (Incremental_input_entry_reader::arg_serial): New function.
7034 (Incremental_input_entry_reader::type): Extract type from flags.
7035 (Incremental_input_entry_reader::is_in_system_directory): New function.
7036 (Incremental_input_entry_reader::get_input_section_count): Call
7037 accessor function for type.
7038 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
7039 function for type; adjust size of global symbol entry.
7040 (Incremental_input_entry_reader::get_global_symbol_count): Call
7041 accessor function for type.
7042 (Incremental_input_entry_reader::get_object_count): Likewise.
7043 (Incremental_input_entry_reader::get_object_offset): Likewise.
7044 (Incremental_input_entry_reader::get_member_count): Likewise.
7045 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
7046 (Incremental_input_entry_reader::get_member_offset): Likewise.
7047 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
7048 (Incremental_input_entry_reader::Global_symbol_info): Remove.
7049 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
7050 (Incremental_input_entry_reader::get_global_symbol_reader): New
7051 function.
7052 (Incremental_input_entry_reader::get_output_symbol_index): New
7053 function.
7054 (Incremental_input_entry_reader::type_): Remove.
7055 (Incremental_input_entry_reader::flags_): New data member.
7056 (Incremental_inputs_reader::input_file_offset): New function.
7057 (Incremental_inputs_reader::input_file_index): New function.
7058 (Incremental_inputs_reader::input_file): Call input_file_offset.
7059 (Incremental_inputs_reader::input_file_at_offset): New function.
7060 (Incremental_relocs_reader::get_r_type): Reformat.
7061 (Incremental_relocs_reader::get_r_shndx): Reformat.
7062 (Incremental_relocs_reader::get_r_offset): Reformat.
7063 (Incremental_relocs_reader::data): New function.
7064 (Incremental_binary::Incremental_binary): Initialize new data members.
7065 (Incremental_binary::check_inputs): Add cmdline parameter.
7066 (Incremental_binary::file_is_unchanged): Remove.
7067 (Input_reader::arg_serial): New function.
7068 (Input_reader::get_unused_symbol_count): New function.
7069 (Input_reader::get_unused_symbol): New function.
7070 (Input_reader::do_arg_serial): New function.
7071 (Input_reader::do_get_unused_symbol_count): New function.
7072 (Input_reader::do_get_unused_symbol): New function.
7073 (Incremental_binary::input_file_count): New function.
7074 (Incremental_binary::get_input_reader): Change signature to use
7075 index instead of filename.
7076 (Incremental_binary::file_has_changed): New function.
7077 (Incremental_binary::get_input_argument): New function.
7078 (Incremental_binary::get_library): New function.
7079 (Incremental_binary::get_script_info): New function.
7080 (Incremental_binary::init_layout): New function.
7081 (Incremental_binary::reserve_layout): New function.
7082 (Incremental_binary::output_file): New function.
7083 (Incremental_binary::do_check_inputs): New function.
7084 (Incremental_binary::do_file_is_unchanged): Remove.
7085 (Incremental_binary::do_file_has_changed): New function.
7086 (Incremental_binary::do_init_layout): New function.
7087 (Incremental_binary::do_reserve_layout): New function.
7088 (Incremental_binary::do_input_file_count): New function.
7089 (Incremental_binary::do_get_input_reader): Change signature.
7090 (Incremental_binary::input_args_map_): New data member.
7091 (Incremental_binary::library_map_): New data member.
7092 (Incremental_binary::script_map_): New data member.
7093 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7094 new data members.
7095 (Sized_incremental_binary::output_section): New function.
7096 (Sized_incremental_binary::inputs_reader): Add const.
7097 (Sized_incremental_binary::symtab_reader): Add const.
7098 (Sized_incremental_binary::relocs_reader): Add const.
7099 (Sized_incremental_binary::got_plt_reader): Add const.
7100 (Sized_incremental_binary::get_symtab_view): New function.
7101 (Sized_incremental_binary::Inputs_reader): New typedef.
7102 (Sized_incremental_binary::Input_entry_reader): New typedef.
7103 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
7104 (Sized_incremental_binary::do_file_is_unchanged): Remove.
7105 (Sized_incremental_binary::do_file_has_changed): New function.
7106 (Sized_incremental_binary::do_init_layout): New function.
7107 (Sized_incremental_binary::do_reserve_layout): New function.
7108 (Sized_input_reader::Inputs_reader): Remove.
7109 (Sized_input_reader::Input_entry_reader): Remove.
7110 (Sized_input_reader::do_arg_serial): New function.
7111 (Sized_input_reader::do_get_unused_symbol_count): New function.
7112 (Sized_input_reader::do_get_unused_symbol): New function.
7113 (Sized_incremental_binary::do_input_file_count): New function.
7114 (Sized_incremental_binary::do_get_input_reader): Change signature;
7115 use index instead of filename.
7116 (Sized_incremental_binary::section_map_): New data member.
7117 (Sized_incremental_binary::input_entry_readers_): New data member.
7118 (class Sized_incr_relobj): New class.
7119 (class Sized_incr_dynobj): New class.
7120 (make_sized_incremental_object): New function.
7121 (class Incremental_library): New class.
7122 * layout.cc (Free_list::num_lists): New static data member.
7123 (Free_list::num_nodes): New static data member.
7124 (Free_list::num_removes): New static data member.
7125 (Free_list::num_remove_visits): New static data member.
7126 (Free_list::num_allocates): New static data member.
7127 (Free_list::num_allocate_visits): New static data member.
7128 (Free_list::init): New function.
7129 (Free_list::remove): New function.
7130 (Free_list::allocate): New function.
7131 (Free_list::dump): New function.
7132 (Free_list::print_stats): New function.
7133 (Layout_task_runner::run): Resize output file for incremental updates.
7134 (Layout::Layout): Initialize new data members.
7135 (Layout::set_incremental_base): New function.
7136 (Layout::init_fixed_output_section): New function.
7137 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
7138 incremental updates.
7139 (Layout::create_gold_note): Do not create gold note section for
7140 incremental updates.
7141 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
7142 for incremental updates.
7143 (Layout::set_section_offsets): For incremental updates, allocate space
7144 from free list.
7145 (Layout::create_symtab_sections): Layout with offsets relative to
7146 start of section; for incremental updates, allocate space from free
7147 list.
7148 (Layout::create_shdrs): For incremental updates, allocate space from
7149 free list.
7150 (Layout::finish_dynamic_section): For incremental updates, do not
7151 check --as-needed (fixed in subsequent patch).
7152 * layout.h (class Free_list): New class.
7153 (Layout::set_incremental_base): New function.
7154 (Layout::incremental_base): New function.
7155 (Layout::init_fixed_output_section): New function.
7156 (Layout::allocate): New function.
7157 (Layout::incremental_base_): New data member.
7158 (Layout::free_list_): New data member.
7159 * main.cc (main): Print Free_list statistics.
7160 * object.cc (Relobj::finalize_incremental_relocs): Add
7161 clear_counts parameter; clear counts only when clear_counts is set.
7162 (Sized_relobj::Sized_relobj): Initialize new base class.
7163 (Sized_relobj::do_layout): Don't report special sections.
7164 (Sized_relobj::do_for_all_local_got_entries): New function.
7165 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
7166 symtab_off to all symbol table offsets.
7167 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
7168 * object.h (class Got_offset_list): Move to top of file.
7169 (Object::Object): Allow case where input_file == NULL.
7170 (Object::~Object): Likewise.
7171 (Object::input_file): Assert that input_file != NULL.
7172 (Object::lock): Allow case where input_file == NULL.
7173 (Object::unlock): Likewise.
7174 (Object::is_locked): Likewise.
7175 (Object::token): Likewise.
7176 (Object::release): Likewise.
7177 (Object::is_incremental): New function.
7178 (Object::get_mtime): New function.
7179 (Object::for_all_local_got_entries): New function.
7180 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
7181 (Object::set_is_in_system_directory): New function.
7182 (Object::is_in_system_directory): New function.
7183 (Object::do_is_incremental): New function.
7184 (Object::do_get_mtime): New function.
7185 (Object::do_for_all_local_got_entries): New function.
7186 (Object::is_in_system_directory_): New data member.
7187 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
7188 (class Sized_relobj_base): New class.
7189 (class Sized_relobj): Derive from Sized_relobj_base.
7190 (class Sized_relobj::Symbols): Redeclare from base class.
7191 (class Sized_relobj::local_got_offset_list): Remove.
7192 (class Sized_relobj::Output_sections): Redeclare from base class.
7193 (class Sized_relobj::do_for_all_local_got_entries): New function.
7194 (class Sized_relobj::write_local_symbols): Add offset parameter.
7195 (class Sized_relobj::local_symbol_offset_): Update comment.
7196 (class Sized_relobj::local_dynsym_offset_): Update comment.
7197 * options.cc (Input_arguments::add_file): Remove const.
7198 * options.h (Input_file_argument::Input_file_argument):
7199 Initialize arg_serial_ (all constructors).
7200 (Input_file_argument::set_arg_serial): New function.
7201 (Input_file_argument::arg_serial): New function.
7202 (Input_file_argument::arg_serial_): New data member.
7203 (Input_arguments::Input_arguments): Initialize file_count_.
7204 (Input_arguments::add_file): Remove const.
7205 (Input_arguments::number_of_input_files): New function.
7206 (Input_arguments::file_count_): New data member.
7207 (Command_line::number_of_input_files): Call
7208 Input_arguments::number_of_input_files.
7209 * output.cc (Output_segment_headers::Output_segment_headers):
7210 Set current size.
7211 (Output_section::Input_section::current_data_size): New function.
7212 (Output_section::Output_section): Initialize new data members.
7213 (Output_section::add_input_section): Don't do merge sections for
7214 an incremental link; allocate space from free list for an
7215 incremental update.
7216 (Output_section::add_output_section_data): Allocate space from
7217 free list for an incremental update.
7218 (Output_section::update_data_size): New function.
7219 (Output_section::set_fixed_layout): New function.
7220 (Output_section::reserve): New function.
7221 (Output_segment::set_section_addresses): Remove const.
7222 (Output_segment::set_section_list_addresses): Remove const; allocate
7223 space from free list for an incremental update.
7224 (Output_segment::set_offset): Adjust size of RELRO segment for an
7225 incremental update.
7226 * output.h (Output_data::current_data_size): Move here from
7227 child classes.
7228 (Output_data::pre_finalize_data_size): New function.
7229 (Output_data::update_data_size): New function.
7230 (Output_section_headers::update_data_size): new function.
7231 (Output_section_data_build::current_data_size): Move to Output_data.
7232 (Output_data_strtab::update_data_size): New function.
7233 (Output_section::current_data_size): Move to Output_data.
7234 (Output_section::set_fixed_layout): New function.
7235 (Output_section::has_fixed_layout): New function.
7236 (Output_section::reserve): New function.
7237 (Output_section::update_data_size): New function.
7238 (Output_section::has_fixed_layout_): New data member.
7239 (Output_section::free_list_): New data member.
7240 (Output_segment::set_section_addresses): Remove const.
7241 (Output_segment::set_section_list_addresses): Remove const.
7242 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
7243 New function.
7244 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
7245 New function.
7246 * readsyms.cc (Read_symbols::do_read_symbols): Add library
7247 parameter when calling Add_symbols constructor; store argument
7248 serial number for members of a lib group.
7249 (Add_symbols::locks): Allow case where token == NULL.
7250 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
7251 (Read_member::~Read_member): New function.
7252 (Read_member::is_runnable): New function.
7253 (Read_member::locks): New function.
7254 (Read_member::run): New function.
7255 (Check_script::~Check_script): New function.
7256 (Check_script::is_runnable): New function.
7257 (Check_script::locks): New function.
7258 (Check_script::run): New function.
7259 (Check_library::~Check_library): New function.
7260 (Check_library::is_runnable): New function.
7261 (Check_library::locks): New function.
7262 (Check_library::run): New function.
7263 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
7264 (Add_symbols::library_): New data member.
7265 (class Read_member): New class.
7266 (class Check_script): New class.
7267 (class Check_library): New class.
7268 * reloc.cc (Read_relocs::is_runnable): Allow case where
7269 token == NULL.
7270 (Read_relocs::locks): Likewise.
7271 (Scan_relocs::locks): Likewise.
7272 (Relocate_task::locks): Likewise.
7273 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
7274 to clear counters.
7275 (Sized_relobj::incremental_relocs_scan): Fix comment.
7276 (Sized_relobj::do_relocate): Pass output file offset to
7277 write_local_symbols.
7278 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
7279 from class declaration.
7280 * script.cc (read_input_script): Allocate Script_info; pass
7281 argument serial number to report_script.
7282 * script.h (class Script_info): Move to incremental.h.
7283 * symtab.cc (Symbol_table::add_from_incrobj): New function.
7284 * symtab.h (Symbol_table::add_from_incrobj): New function.
7285 (Symbol_table::set_file_offset): New function.
7286
b961d0d7
CC
72872011-04-05 Cary Coutant <ccoutant@google.com>
7288
7289 * incremental-dump.cc (dump_incremental_inputs): Change signature
7290 to take a Sized_incremental_binary; change caller. Use readers
7291 in Sized_incremental_binary.
7292 * incremental.cc
7293 (Sized_incremental_binary::find_incremental_inputs_sections):
7294 Rename do_find_incremental_inputs_sections to this.
7295 (Sized_incremental_binary::setup_readers): New function.
7296 (Sized_incremental_binary::do_check_inputs): Check
7297 has_incremental_info_ flag; move setup code to setup_readers;
7298 use input readers.
7299 (Sized_incremental_binary::do_file_is_unchanged): New function.
7300 (Sized_incremental_binary::do_get_input_reader): New function.
7301 * incremental.h (class Incremental_binary): Move to end of file.
7302 (Incremental_binary::file_is_unchanged): New function.
7303 (Incremental_binary::do_file_is_unchanged): New function.
7304 (Incremental_binary::Input_reader): New class.
7305 (Incremental_binary::get_input_reader): New function.
7306 (class Sized_incremental_binary): Move to end of file.
7307 (Sized_incremental_binary::Sized_incremental_binary): Setup the
7308 input section reader classes.
7309 (Sized_incremental_binary::has_incremental_info): New function.
7310 (Sized_incremental_binary::inputs_reader): New function.
7311 (Sized_incremental_binary::symtab_reader): New function.
7312 (Sized_incremental_binary::relocs_reader): New function.
7313 (Sized_incremental_binary::got_plt_reader): New function.
7314 (Sized_incremental_binary::do_file_is_unchanged): New function.
7315 (Sized_incremental_binary::Sized_input_reader): New class.
7316 (Sized_incremental_binary::get_input_reader): New function.
7317 (Sized_incremental_binary::find_incremental_inputs_sections):
7318 Rename do_find_incremental_inputs_sections to this.
7319 (Sized_incremental_binary::setup_readers): New function.
7320 (Sized_incremental_binary::has_incremental_info_): New data member.
7321 (Sized_incremental_binary::inputs_reader_): New data member.
7322 (Sized_incremental_binary::symtab_reader_): New data member.
7323 (Sized_incremental_binary::relocs_reader_): New data member.
7324 (Sized_incremental_binary::got_plt_reader_): New data member.
7325 (Sized_incremental_binary::current_input_file_): New data member.
7326
a869183f
PP
73272011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
7328
7329 PR gold/12640
7330 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
7331 violation.
7332
73332011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
7334
7335 * archive.cc (Archive::include_member): Adjust call to report_object.
7336 (Add_archive_symbols::run): Add script_info to call to
7337 report_archive_begin.
7338 (Lib_group::include_member): Adjust call to report_object.
7339 (Add_lib_group_symbols::run): Adjust call to report_object.
7340 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
7341 blocks. Add object count for script input files.
7342 * incremental.cc (Incremental_inputs::report_archive_begin): Add
7343 script_info parameter; change all callers.
7344 (Incremental_inputs::report_object): Add script_info parameter;
7345 change all callers.
7346 (Incremental_inputs::report_script): Store backpointer to
7347 incremental info entry.
7348 (Output_section_incremental_inputs::set_final_data_size): Record
7349 additional information for scripts.
7350 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7351 * incremental.h (Incremental_script_entry::add_object): New function.
7352 (Incremental_script_entry::get_object_count): New function.
7353 (Incremental_script_entry::get_object): New function.
7354 (Incremental_script_entry::objects_): New data member; adjust
7355 constructor.
7356 (Incremental_inputs::report_archive_begin): Add script_info parameter.
7357 (Incremental_inputs::report_object): Add script_info parameter.
7358 (Incremental_inputs_reader::get_object_count): New function.
7359 (Incremental_inputs_reader::get_object_offset): New function.
7360 * options.cc (Input_arguments::add_file): Return reference to
7361 new input argument.
7362 * options.h (Input_argument::set_script_info): New function.
7363 (Input_argument::script_info): New function.
7364 (Input_argument::script_info_): New data member; adjust all
7365 constructors.
7366 (Input_file_group::add_file): Return reference to new input argument.
7367 (Input_file_lib::add_file): Likewise.
7368 (Input_arguments::add_file): Likewise.
7369 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
7370 * script.cc (Parser_closure::Parser_closure): Add script_info
7371 parameter; adjust all callers.
7372 (Parser_closure::script_info): New function.
7373 (Parser_closure::script_info_): New data member.
7374 (read_input_script): Report scripts earlier to incremental info.
7375 (script_add_file): Set script_info in Input_argument.
7376 (script_add_library): Likewise.
7377 * script.h (Script_options::Script_info): Rewrite class.
7378
a869183f 73792011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
7380
7381 * archive.cc (Library_base::should_include_member): Move
7382 method here from class Archive.
7383 (Archive::Archive): Initialize base class.
7384 (Archive::should_include_member): Move to base class.
7385 (Archive::do_for_all_unused_symbols): New function.
7386 (Add_archive_symbols::run): Remove redundant access to
7387 incremental_inputs.
7388 (Lib_group::Lib_group): Initialize base class.
7389 (Lib_group::do_filename): New function.
7390 (Lib_group::include_member): Pass pointer to Lib_group to
7391 report_object.
7392 (Lib_group::do_for_all_unused_symbols): New function.
7393 (Add_lib_group_symbols::run): Report archive information for
7394 incremental links.
7395 * archive.h (class Library_base): New base class.
7396 (class Archive): Derive from Library_base.
7397 (Archive::filename): Move to base class.
7398 (Archive::set_incremental_info): Likewise.
7399 (Archive::incremental_info): Likewise.
7400 (Archive::Should_include): Likewise.
7401 (Archive::should_include_member): Likewise.
7402 (Archive::Armap_entry): Remove.
7403 (Archive::Unused_symbol_iterator): Remove.
7404 (Archive::unused_symbols_begin): Remove.
7405 (Archive::unused_symbols_end): Remove.
7406 (Archive::do_filename): New function.
7407 (Archive::do_get_mtime): New function.
7408 (Archive::do_for_all_unused_symbols): New function.
7409 (Archive::task_): Move to base class.
7410 (Archive::incremental_info_): Likewise.
7411 (class Lib_group): Derive from Library_base.
7412 (Lib_group::do_filename): New function.
7413 (Lib_group::do_get_mtime): New function.
7414 (Lib_group::do_for_all_unused_symbols): New function.
7415 (Lib_group::task_): Move to base class.
7416 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
7417 function.
7418 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
7419 function.
7420 * incremental.cc (Incremental_inputs::report_archive_begin):
7421 Use Library_base; call library's get_mtime; add incremental inputs
7422 entry before members.
7423 (class Unused_symbol_visitor): New class.
7424 (Incremental_inputs::report_archive_end): Use Library_base; use
7425 visitor class to record unused symbols; don't add incremental inputs
7426 entry after members.
7427 (Incremental_inputs::report_object): Use Library_base.
7428 * incremental.h
7429 (Incremental_archive_entry::Incremental_archive_entry): Remove
7430 unused Archive parameter.
7431 (Incremental_inputs::report_archive_begin): Use Library_base.
7432 (Incremental_inputs::report_archive_end): Likewise.
7433 (Incremental_inputs::report_object): Likewise.
7434 * object.cc (Sized_relobj::do_for_all_global_symbols): New
7435 function.
7436 * object.h (Object::for_all_global_symbols): New function.
7437 (Object::do_for_all_global_symbols): New function.
7438 (Sized_relobj::do_for_all_global_symbols): New function.
7439 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
7440 function.
7441 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
7442 function.
7443
61ab3e40
ILT
74442011-03-27 Ian Lance Taylor <iant@google.com>
7445
7446 * archive.cc (Archive::interpret_header): Return -1 if something
7447 goes wrong. Change callers accordingly.
7448
30e1f9e6
CC
74492011-03-25 Cary Coutant <ccoutant@google.com>
7450
7451 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
7452 * testsuite/Makefile.in: Regenerate.
7453
9370ce59 74542011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
7455
7456 * plugin.cc (get_view): New.
7457 (Plugin::load): Pass get_view to the plugin.
7458 (Plugin_manager::get_view): New.
7459
9312bb0a
ILT
74602011-03-21 Ian Lance Taylor <iant@google.com>
7461
7462 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 7463 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 7464
7e12ba9e
ST
74652011-03-21 Sriraman Tallam <tmsriram@google.com>
7466
7467 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
7468 Change == to -eq.
7469 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
7470 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
7471 Change == to -eq.
7472 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
7473 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
7474
fd7a005d
ILT
74752011-03-14 Ian Lance Taylor <iant@google.com>
7476
7477 * script-sections.cc (Sort_output_sections::script_compare):
7478 Rename from is_before, change return type.
7479 (Sort_output_sections::operator()): Adjust accordingly.
7480
ed16fd1b
ILT
74812011-03-11 Jeffrey Yasskin <jyasskin@google.com>
7482
7483 PR gold/12572
7484 * testsuite/odr_violation2.cc: Add comment to make all error line
7485 numbers double digits.
7486 * testsuite/debug_msg.sh: Adjust expected errors.
7487
71ff8986
ILT
74882011-03-09 Jeffrey Yasskin <jyasskin@google.com>
7489
7490 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
7491 but mark earlier ones as non-canonical
7492 (offset_to_iterator): Update search target and example
7493 (do_addr2line): Return extra lines in a vector*
7494 (format_file_lineno): Extract from do_addr2line
7495 (one_addr2line): Add vector* out-param
7496 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
7497 when a lineno entry appeared last for its instruction
7498 (Dwarf_line_info): Add vector* out-param
7499 * object.cc (Relocate_info): Pass NULL for the vector* out-param
7500 * symtab.cc (Odr_violation_compare): Include the lineno in the
7501 comparison again.
7502 (linenos_from_loc): New. Combine the canonical line for an
7503 address with its other lines.
7504 (True_if_intersect): New. Helper functor to make
7505 std::set_intersection a query.
7506 (detect_odr_violations): Compare sets of lines instead of just
7507 one line for each function. This became less deterministic, but
7508 has fewer false positives.
7509 * symtab.h: Declarations.
7510 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
7511 mix an optimized and non-optimized object in the same binary
7512 (odr_violation2.so): Same.
7513 * testsuite/Makefile.in: Regenerate from Makefile.am.
7514 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
7515 * testsuite/debug_msg.sh: Update line numbers and add
7516 assertions.
7517 * testsuite/odr_violation1.cc: Use OdrDerived, in a
7518 non-optimized context.
7519 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
7520 isn't inlined, and use OdrDerived in an optimized context.
7521 * testsuite/odr_header1.h: Defines OdrDerived, where
7522 optimization will change the
7523 first-instruction-in-the-destructor's file and line number.
7524 * testsuite/odr_header2.h: Defines OdrBase.
7525
a19fefdc
ILT
75262011-03-09 Ian Lance Taylor <iant@google.com>
7527
7528 * fileread.cc (File_read::clear_views): Don't delete the whole
7529 file view.
7530
ecb351e9
ILT
75312011-03-08 Ian Lance Taylor <iant@google.com>
7532
7533 PR gold/12525
7534 * fileread.cc: #include <climits>.
7535 (GOLD_IOV_MAX): Define.
7536 (File_read::read_multiple): Limit number of entries by iov_max.
7537 * fileread.h (class File_read): Always set max_readv_entries to
7538 128.
7539
b821d13c
ILT
75402011-03-07 Ian Lance Taylor <iant@google.com>
7541
7542 PR gold/12525
7543 * options.h (class General_options): Add -dy and -dn.
7544
89243142
CC
75452011-03-02 Cary Coutant <ccoutant@google.com>
7546
7547 * testsuite/script_test_9.t: Add TLS segment.
7548
d0773f31
ILT
75492011-03-02 Simon Baldwin <simonb@google.com>
7550
7551 * configure.ac: Add check for gnu_indirect_function support in
7552 the toolchain building binutils.
7553 * configure: Rebuild.
7554
9370ce59 75552011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
7556
7557 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
7558 plugin only symbols.
7559 (Symbol_table::sized_finalize_symbol) Mark symbol only present
7560 in plugin files as not needed in the symbol table.
7561
4cf7a849
ST
75622011-02-11 Sriraman Tallam <tmsriram@google.com>
7563
7564 * output.cc (Output_section::add_input_section): Delay fill
7565 generation for section ordering.
7566
b578bd7d
ILT
75672011-02-09 Ian Lance Taylor <iant@google.com>
7568
7569 PR gold/12316
7570 * object.h (class Sized_relobj): Remove clear_local_symbols.
7571 * reloc.cc (Sized_relobj::do_relocate): Don't call
7572 clear_local_symbols.
7573
9370ce59 75742011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
7575
7576 * plugin.cc (is_visible_from_outside): Return true for symbols
7577 in the -u option.
7578
55382fb7
ILT
75792011-02-04 Jeffrey Yasskin <jyasskin@google.com>
7580
7581 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
7582 filename.
7583
4e271fff
ST
75842011-02-02 Sriraman Tallam <tmsriram@google.com>
7585
7586 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 7587 to std::string.
4e271fff 7588 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 7589 section_name to be std::string.
4e271fff
ST
7590 (is_function_ctor_or_dtor): Change type of parameter to std::string.
7591
d433c3ac
ILT
75922011-01-25 Ian Lance Taylor <iant@google.com>
7593
7594 * script.cc (script_add_extern): Rewrite to use
7595 add_symbol_reference.
7596
880473a6
DK
75972011-01-25 Doug Kwan <dougkwan@google.com>
7598
d433c3ac 7599 * icf.cc (get_section_contents): Always lock section's object.
880473a6 7600
f30f86fa
ILT
76012011-01-24 Ian Lance Taylor <iant@google.com>
7602
7603 * options.h (class General_options): Accept
7604 --no-detect-odr-violations.
7605
8e51a0b9
ILT
76062011-01-24 Ian Lance Taylor <iant@google.com>
7607
7608 * version.cc (version_string): Bump to 1.11.
7609
0f3b89d8
ILT
76102011-01-24 Ian Lance Taylor <iant@google.com>
7611
7612 * plugin.cc (class Plugin_rescan): Define new class.
7613 (Plugin_manager::claim_file): Set any_claimed_.
7614 (Plugin_manager::save_archive): New function.
7615 (Plugin_manager::save_input_group): New function.
7616 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
7617 necessary.
7618 (Plugin_manager::new_undefined_symbol): New function.
7619 (Plugin_manager::rescan): New function.
7620 (Plugin_manager::rescannable_defines): New function.
7621 (Plugin_manager::add_input_file): Set any_added_.
7622 * plugin.h (class Plugin_manager): define new fields rescannable_,
7623 undefined_symbols_, any_claimed_, and any_added_. Declare
7624 Plugin_rescan as friend. Declare new functions.
7625 (Plugin_manager::Rescannable): Define type.
7626 (Plugin_manager::Rescannable_list): Define type.
7627 (Plugin_manager::Undefined_symbol_list): Define type.
7628 (Plugin_manager::Plugin_manager): Initialize new fields.
7629 * archive.cc (Archive::defines_symbol): New function.
7630 (Add_archive_symbols::run): Pass archive to plugins if any.
7631 * archive.h (class Archive): Declare defines_symbol.
7632 * readsyms.cc (Input_group::~Input_group): New function.
7633 (Finish_group::run): Pass input_group to plugins if any.
7634 * readsyms.h (class Input_group): Declare destructor.
7635 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
7636 any.
7637
3bb951e5
ILT
76382011-01-10 Ian Lance Taylor <iant@google.com>
7639
7640 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
7641 section as relro.
7642 (Layout::set_segment_offsets): Reset increase_relro before calling
7643 set_section_addresses a second time.
7644
0aa45fac
CC
76452011-01-04 Cary Coutant <ccoutant@google.com>
7646
7647 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
7648 sections before NOBITS sections.
7649
0db46eb4
L
76502011-01-01 H.J. Lu <hongjiu.lu@intel.com>
7651
7652 * version.cc (print_version): Update copyright to 2011.
7653
829c9745
CC
76542010-12-23 Cary Coutant <ccoutant@google.com>
7655
7656 * output.h (Output_data_reloc::add_output_section): Pass OD instead
7657 of OS to this->add. Add OD parameter to second form of the function.
7658
7500420b
ILT
76592010-12-20 Ian Lance Taylor <iant@google.com>
7660
7661 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
7662 second of two consecutive entries with same offset.
7663
f8e9a930
RW
76642010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7665
7666 * testsuite/Makefile.am (ifuncmain2static_LDADD)
7667 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
7668 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
7669 to avoid unneeded links against $(LDADD).
7670 * testsuite/Makefile.in: Regenerate.
7671
2fbb4320
ILT
76722010-12-15 Ian Lance Taylor <iant@google.com>
7673
7674 PR gold/12324
7675 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
7676 for R_X86_64_32 and R_X86_64_PC32.
7677 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
7678 ver_matching_def_pic.o.
7679 (ver_matching_def_pic.o): New target.
7680
fedb228d
RW
76812010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7682
7683 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
7684 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
7685 Move definition before File_read::View member definitions.
7686 (File_read::View::~View): Initialize and hold lock before
7687 updating current_mapped_bytes.
7688
9b547ce6
RW
76892010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7690
7691 * dwarf_reader.cc: Remove outdated comment.
7692 * gold-threads.cc: Fix typo in error message.
7693 * archive.cc: Fix typos in comments.
7694 * archive.h: Likewise.
7695 * arm-reloc-property.cc: Likewise.
7696 * arm-reloc-property.h: Likewise.
7697 * arm-reloc.def: Likewise.
7698 * arm.cc: Likewise.
7699 * attributes.h: Likewise.
7700 * cref.cc: Likewise.
7701 * ehframe.cc: Likewise.
7702 * fileread.h: Likewise.
7703 * gold.h: Likewise.
7704 * i386.cc: Likewise.
7705 * icf.cc: Likewise.
7706 * incremental.h: Likewise.
7707 * int_encoding.cc: Likewise.
7708 * layout.h: Likewise.
7709 * main.cc: Likewise.
7710 * merge.h: Likewise.
7711 * object.cc: Likewise.
7712 * object.h: Likewise.
7713 * options.cc: Likewise.
7714 * readsyms.cc: Likewise.
7715 * reduced_debug_output.cc: Likewise.
7716 * reloc.cc: Likewise.
7717 * script-sections.cc: Likewise.
7718 * sparc.cc: Likewise.
7719 * symtab.h: Likewise.
7720 * target-reloc.h: Likewise.
7721 * target.cc: Likewise.
7722 * target.h: Likewise.
7723 * timer.cc: Likewise.
7724 * timer.h: Likewise.
7725 * x86_64.cc: Likewise.
7726
83e17bd5
CC
77272010-12-09 Cary Coutant <ccoutant@google.com>
7728
7729 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
7730 stack.
7731 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
7732 parameter; change all callers.
7733 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
7734 * options.h (warn_execstack): New option.
7735
017257f8
DK
77362010-12-07 Doug Kwan <dougkwan@google.com>
7737
7738 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
7739 like function call relocations.
7740
c20cbc06
ILT
77412010-12-07 Ian Lance Taylor <iant@google.com>
7742
7743 * archive.cc (Archive::get_elf_object_for_member): Permit
7744 punconfigured to be NULL.
7745 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
7746 (Archive::include_member): Pass NULL to get_elf_object_for_member
7747 if we searched for the archive and this is the first included
7748 object.
7749
4dbfafcc
ILT
77502010-12-01 Ian Lance Taylor <iant@google.com>
7751
7752 * dwarf_reader.h (class Sized_dwarf_line_info): Add
7753 track_relocs_type_ field.
7754 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7755 Set track_relocs_type_.
7756 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
7757 contents when using RELA relocs.
7758 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
7759 reloc_map_.
7760 * reloc.cc (Track_relocs::next_addend): New function.
7761 * reloc.h (class Track_relocs): Declare next_addend.
7762
e5e19edd
ILT
77632010-12-01 Ian Lance Taylor <iant@google.com>
7764
7765 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
7766 virtual destructor.
7767
9a5ce24c
ILT
77682010-12-01 Ian Lance Taylor <iant@google.com>
7769
7770 * README: Update compilers known to work and fail.
7771
c7791212
NC
77722010-11-23 Matthias Klose <doko@ubuntu.com>
7773
7774 * configure.in: For --enable-gold, handle value `default' instead of
7775 `both*'. Always install ld as ld.bfd, install as ld if gold is
7776 not the default.
7777 * configure: Regenerate.
7778
0ad220c9
DK
77792010-11-18 Doug Kwan <dougkwan@google.com>
7780
7781 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
7782 and right_alignment to be zero. Store result alignment only if it is
7783 greater than existing alignment.
7784
ab8056e0
CC
77852010-11-16 Cary Coutant <ccoutant@google.com>
7786
7787 PR gold/12220
7788 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7789 Check for ".zdebug_line".
7790
fd064a5b
CC
77912010-11-16 Doug Kwan <dougkwan@google.com>
7792 Cary Coutant <ccoutant@google.com>
7793
7794 * output.h (Output_segment::set_section_addresses): Pass increase_relro
7795 by reference; adjust all callers.
7796 * output.cc (Output_segment::set_section_addresses): Adjust references
7797 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
7798 list is empty.
7799 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
7800 end at page boundary.
7801
6fc6ea19
CC
78022010-11-16 Cary Coutant <ccoutant@google.com>
7803
7804 PR gold/12220
7805 * layout.cc (Layout::choose_output_section): Transform names of
7806 compressed sections even when using a script with a SECTIONS clause.
7807 (Layout::output_section_name): Remove code to transform
7808 compressed debug section names.
7809 * output.cc (Output_section::add_input_section): Use uncompressed
7810 section size when tracking input sections.
7811
95a2c8d6
RS
78122010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
7813
7814 * symtab.h (Symbol::NON_PIC_REF): Remove.
7815 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
7816 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
7817 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
7818 (Symbol::use_plt_offset): Take a flags argument and pass it
7819 directly to needs_dynamic_reloc. Restrict check for undefined
7820 weak symbols to function calls.
7821 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
7822 (Target_arm::Scan::global): Use it.
7823 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
7824 (Target_arm::Relocate::relocate): Likewise.
7825 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
7826 parameter with an r_type parameter. Use get_reference_flags
7827 to get the flags.
7828 (Target_arm::Relocate::relocate): Update accordingly.
7829 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
7830 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
7831 (Target_i386::Scan::global): Likewise.
7832 (Target_i386::Relocate::relocate): Likewise.
7833 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
7834 parameter with an r_type parameter. Use get_reference_flags
7835 to get the flags.
7836 (Target_i386::Relocate::relocate): Update accordingly.
7837 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
7838 (Target_powerpc::Scan::global): Use it.
7839 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
7840 (Target_powerpc::Relocate::relocate): Likewise.
7841 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
7842 (Target_sparc::Scan::global): Use it.
7843 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
7844 (Target_sparc::Relocate::relocate): Likewise.
7845 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
7846 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
7847 (Target_x86_64::Scan::global): Likewise.
7848 (Target_x86_64::Relocate::relocate): Likewise.
7849
f625ae50
DK
78502010-11-08 Doug Kwan <dougkwan@google.com>
7851 Cary Coutant <ccoutant@google.com>
7852
7853 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
7854 (Arm_exidx_merge_section::section_contents_): New data member.
7855 (Arm_input_section::Arm_input_section): Initialize original_contents_.
7856 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 7857 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
7858 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
7859 in parameters instead of calling Object::section_contents without
7860 locking.
7861 (Arm_output_section::group_section): New parameter TASK. Pass it
7862 to callees that need locking objects.
7863 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
7864 to lock EXIDX input sections. Fix a formatting issue. Call
7865 Arm_exidx_merged_section::build_contents to create merged section
7866 contents.
7867 (Arm_output_section::create_stub_group): New parameter TASK. Use it
7868 to lock object of stub table owner.
7869 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
7870 TEXT_SIZE to initialize data member TEXT_SIZE_.
7871 (Arm_exidx_input_section::addralign): Fix typo in comment.
7872 (Arm_exidx_input_section::text_size): New method.
7873 (Target_arm::do_relax): New parameter TASK. Pass it to callees
7874 that require locking objects. Lock objects before scanning for stubs
7875 and updating local symbols.
7876 (Arm_input_section<big_endian>::init): Copy contents of original
7877 input section.
2e702c99 7878 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
7879 original input section instead of calling Object::section_contents
7880 without locking.
7881 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
7882 size without calling Object::section_size().
7883 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
7884 for size. Allocate a buffer for merged EXIDX entries.
7885 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 7886 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
7887 building code to Arm_exidx_merged_section::build_contetns. Write
7888 out contetns in buffer instead of building it on the fly.
7889 (Arm_relobj::make_exidx_input_section): Also pass text section size
7890 to Arm_exidx_input_section constructor.
7891 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
7892 (Arm_dynobj::do_read_symbols): Fix memory leak.
7893 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
7894 * target.h: (class Task): Add forward declaration.
7895 (Target::relax): Add new parameter TASK and pass it to
7896 Target::do_relax().
7897 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
7898
5f9bcf58
CC
78992010-11-05 Cary Coutant <ccoutant@google.com>
7900
7901 PR gold/10708
7902 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
7903 object when reading from the file.
7904 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
7905 second layout pass.
7906 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
7907 when reading section contents.
7908 (get_section_contents): Likewise.
7909 (icf::find_identical_sections): Likewise.
7910 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
7911 object when reading from the file.
7912 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
7913 the object when doing deferred section layout.
7914
e597fa08
NC
79152010-11-03 Nick Clifton <nickc@redhat.com>
7916
7917 PR gold/12001
7918 * script.h (class Symbol_assignment: name): New member. Returns
7919 the name of the symbol.
7920 * scrfipt.cc (Script_options::is_pending_assignment): New member.
7921 Returns true if the given symbol name is on the list of
7922 assignments wating to be processed.
7923 * archive.cc (should_incldue_member): If the symbol is undefined,
7924 check to see if it is on the list of symbols pending assignment.
7925
3f9a3278
ILT
79262010-11-03 Ryan Mansfield <rmansfield@qnx.com>
7927
7928 * script-sections.cc (Script_sections::find_memory_region): Check
7929 for a NULL output section pointer.
7930
d06fb4d1
DK
79312010-10-29 Doug Kwan <dougkwan@google.com>
7932
7933 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
7934 Output_section::add_relaxed_input_section.
7935 * output.cc (Output_section::add_relaxed_input_section): Add new
7936 arguments LAYOUT and NAME. Set section order index.
7937 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7938 Copy section order index.
7939 * output.h (Output_section::add_relaxed_input_section): Add new
7940 arguments LAYOUT and NAME.
7941
90e24de5
ILT
79422010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7943
7944 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 7945 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
7946 * testsuite/Makefile.in: Regenerate.
7947
c9484ea5
DK
79482010-10-20 Doug Kwan <dougkwan@google.com>
7949
7950 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
7951 without SHF_LINK_ORDER flags.
7952 * layout.cc (Layout::choose_output_section): Do not filter
7953 SHF_LINK_ORDER flag in a relocatable link.
7954
5bc2f5be
CC
79552010-10-17 Cary Coutant <ccoutant@google.com>
7956
7957 * output.h (Output_segment::set_section_addresses): Change function
7958 signature. Update all callers.
7959 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
7960 sections.
7961 (Output_segment::set_section_addresses): Align after last TLS
7962 section. Add padding before last relro section instead of after.
7963
0c91cf04
DK
79642010-10-17 Doug Kwan <dougkwan@google.com>
7965
7966 * gold/arm.cc (Target_arm::got_section): Use correct order and set
7967 GOT output section to be writable.
7968
8c21d9d3
CC
79692010-10-14 Cary Coutant <ccoutant@google.com>
7970
7971 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
7972 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
7973 * gold.cc (queue_initial_tasks): Check parameters for incremental link
7974 mode.
7975 * incremental.cc (report_command_line): Ignore all forms of
7976 --incremental.
7977 * layout.cc (Layout::Layout): Check parameters for incremental link
7978 mode.
7979 * options.cc (General_options::parse_incremental): New function.
7980 (General_options::parse_no_incremental): New function.
7981 (General_options::parse_incremental_full): New function.
7982 (General_options::parse_incremental_update): New function.
7983 (General_options::incremental_mode_): New data member.
7984 (General_options::finalize): Check incremental_mode_.
7985 * options.h (General_options): Update help text for --incremental.
7986 Add --no-incremental, --incremental-full, --incremental-update.
7987 (General_options::Incremental_mode): New enum type.
7988 (General_options::incremental_mode): New function.
7989 (General_options::incremental_mode_): New data member.
7990 * parameters.cc (Parameters::incremental_mode_): New data member.
7991 (Parameters::set_options): Set incremental_mode_.
7992 (Parameters::set_incremental_full): New function.
7993 (Parameters::incremental): New function.
7994 (Parameters::incremental_update): New function.
7995 (set_parameters_incremental_full): New function.
7996 * parameters.h (Parameters::set_incremental_full): New function.
7997 (Parameters::incremental): New function.
7998 (Parameters::incremental_update): New function.
7999 (Parameters::incremental_mode_): New data member.
8000 (set_parameters_incremental_full): New function.
8001 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
8002 incremental link mode.
8003 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
8004 (Sized_relobj::do_relocate_sections): Likewise.
8005 * testsuite/Makefile.am (incremental_test): Use --incremental-full
8006 option.
8007 * testsuite/Makefile.in: Regenerate.
8008 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 8009
bb32aa18 80102010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
8011
8012 * script-sections.h (class Script_sections): Make
8013 Sections_elements typedef public.
8014 * script-sections.cc (class Sort_output_sections): Add elements_
8015 field. Add constructor which sets it; change all callers.
8016 (Sort_output_sections::is_before): New function.
8017 (Sort_output_sections::operator()): Call is_before.
8018 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
8019 conditional.
8020 * testsuite/script_test_10.sh: New test. Test script section
8021 order.
8022 * testsuite/script_test_10.t: Likewise.
8023 * testsuite/script_test_10.s: Likewise.
8024 * testsuite/Makefile.am: Wrap the cross linker tests and the
8025 common tests into NATIVE_OR_CROSS_LINKER.
8026 (check_SCRIPTS): Add script_test_10.sh.
8027 (check_DATA): Add script_test_10.stdout.
8028 (script_test_10.o, script_test_10): New targets.
8029 (script_test_10.stdout): New target.
8030 * configure, testsuite/Makefile.in: Regenerate.
8031
3cef7179
ILT
80322010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8033
8034 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
8035 error for the deprecated relocations.
8036 (Target_arm::Scan::global): Likewise.
8037 (Target_arm::Relocate::relocate): Likewise.
8038
7411e9a8
RS
80392010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
8040
8041 * fileread.cc (Input_file::find_file): Initialize *found_name
8042 and *namep when using the fallback search for case 4.
8043
6a9da32a
CC
80442010-10-11 Cary Coutant <ccoutant@google.com>
8045
8046 * options.h (class General_options): Redefine -z lazy as an alias for
8047 the negation of -z now.
8048
ac897c20
ILT
80492010-10-11 Ian Lance Taylor <iant@google.com>
8050
8051 * resolve.cc (symbol_to_bits): Report the value of the unsupported
8052 binding.
8053
ea5cae92
NC
80542010-10-06 Nick Clifton <nickc@redhat.com>
8055
8056 * script-sections.cc(class Memory_region): Remove
8057 current_lma_offset_ field. Rename current_vma_offset_ to
8058 current_offset_. Add last_section_ field.
8059 (Memory_region::get_current_vma_address): Rename to
8060 get_current_address.
8061 (Memory_region::get_current_lma_address): Delete.
8062 (Memory_region::increment_vma_offset): Rename to
8063 increment_offset.
8064 (Memory_region::increment_lma_offset): Delete.
8065 (Memory_region::attributes_compatible): New method. Returns
8066 true if the provided section is compatible with the region.
8067 (Memory_region::get_last_section): New method. Returns the last
8068 section to use the region.
8069 (Memory_region::set_last_section): New method. Stores the last
8070 section to use the region.
8071 (Script_sections::block_in_region): New method. Returns true if
8072 a block of memory is contained within a region.
8073 (Script_sections::find_memory_region): New method. Locates a
8074 memory region to be used to set a VMA or LMA address.
8075 (Output_section_definition::set_section_addresses): Add code to
8076 check for addresses set by memory regions.
8077 (Output_segment::set_section_addresses): Remove memory region
8078 walking code.
8079 (Script_sections::create_segment): Add a warning if a header
8080 segment is created outside of any region.
8081 * script-sections.h (class Script_sections): Add prototypes for
8082 find_memory_region and block_in_region methods.
8083 * testsuite/memory_test.s: Use .long instead of .word.
8084 * testsuite/memory_test.t: Add some more output sections.
8085 * testsuite/memory_test.sh: Update expected output.
8086
a9bfd952
DK
80872010-10-02 Doug Kwan <dougkwan@google.com>
8088
8089 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
8090 defintion to symtab.h
8091 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
8092 declaration to defintion.
8093
bacff3ab
NC
80942010-10-01 Nick Clifton <nickc@redhat.com>
8095
8096 * expression.cc (eval): Replace dummy argument with NULL.
8097 (eval_maybe_dot): Check for a NULL result section pointer.
8098 (Symbol_expression::value): Likewise.
8099 (Dot_expression::value): Likewise.
8100 (BINARY_EXPRESSION): Likewise.
8101 (Max_expression::value): Likewise.
8102 (Min_expression::value): Likewise.
8103 (Absolute_expression::value): Likewise.
8104 (Addr_expression::value_from_output_section): Likewise.
8105 (Loaddddr_expression::value_from_output_section): Likewise.
8106 (Segment_start_expression::value): Likewise.
8107 * script-sections.cc
8108 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
8109 argument with NULL.
8110 (Sections_elememt_dot_assignment::set_section_addresses):
8111 Likewise.
8112 (Output_data_expression::do_write_to_buffer): Likewise.
8113 (Output_section_definition::finalize_symbols): Likewise.
8114 (Output_section_definition::set_section_addresses): Likewise.
8115
f81bc8b5
DK
81162010-09-30 Doug Kwan <dougkwan@google.com>
8117
8118 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
8119
c95e9f27
ST
81202010-09-28 Sriraman Tallam <tmsriram@google.com>
8121
8122 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 8123 function.
c95e9f27
ST
8124 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
8125 virtual function.
8126 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
8127 virtual function.
8128 * icf.cc (get_section_contents): Inline merge sections only when
8129 target allows it.
8130
3cac54d2
RW
81312010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8132
8133 * configure: Regenerate.
8134
2904037a
ILT
81352010-09-17 Ian Lance Taylor <iant@google.com>
8136
8137 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
8138 * testsuite/Makefile.am (memory_test.o): New target.
8139 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
8140 memory_test.t.
8141 * testsuite/Makefile.in: Rebuild.
2904037a 8142
bca7fb63
DK
81432010-09-17 Doug Kwan <dougkwan@google.com>
8144
8145 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
8146 defintion if relocation uses GOT entries of the symbol.
8147 * testsuite/icf_safe_test.sh: Fix test.
8148 * testsuite/icf_safe_so_test.sh: Fix test.
8149
4ef28648
CC
81502010-09-16 Cary Coutant <ccoutant@google.com>
8151
8152 * script_sections.cc (class Memory_region): Remove "NULL" from
8153 vector initializations.
8154
793990de
CC
81552010-09-15 Cary Coutant <ccoutant@google.com>
8156
8157 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
8158 Resolve forwarding symbols.
8159
81e015e2
DK
81602010-09-15 Doug Kwan <dougkwan@google.com>
8161
8162 * gold/testsuite/script_test_3.t: Add ARM special sections.
8163 * gold/testsuite/script_test_4.t: Same.
8164 * gold/testsuite/script_test_5.t: Same.
8165 * gold/testsuite/script_test_6.t: Same.
8166 * gold/testsuite/script_test_7.t: Same.
8167 * gold/testsuite/script_test_7.t: Same.
8168 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
8169
36171d64
CC
81702010-09-14 Cary Coutant <ccoutant@google.com>
8171
8172 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
8173 (Target_x86_64::Relocate::relocate_tls): Replace check for
8174 saw_tls_block_reloc_ with test for executable section.
8175
d89051bd
CC
81762010-09-12 Cary Coutant <ccoutant@google.com>
8177
8178 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
8179 position-independent executables to shared libraries need dynamic
8180 relocations.
8181 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
8182 position-independent executables.
8183 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
8184 * testsuite/Makefile.in: Regenerate.
8185
fca41f0f
NC
81862010-09-10 Nick Clifton <nickc@redhat.com>
8187
8188 PR gold/11997
8189 * testsuite/memory_test.t: Discard any sections that are not
8190 needed.
8191
6695e4b3
L
81922010-09-09 H.J. Lu <hongjiu.lu@intel.com>
8193
8194 PR gold/11996
8195 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
8196 "This::" to work around a bug in gcc 4.2.
8197
8198 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
8199
0f72bf6f
RÁE
82002010-09-09 Rafael Espindola <espindola@google.com>
8201
8202 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
8203 sections with different PF_X flags in the same segment.
8204 (Layout::find_first_load_seg): Search all segments to find the first
8205 one.
8206 * options.h (rosegment): New.
8207
82082010-09-08 Rafael Espindola <espindola@google.com>
a6577478 8209
05a79166 8210 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 8211
aa98ff75
DK
82122010-09-08 Doug Kwan <dougkwan@google.com>
8213
8214 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
8215 (Arm_relobj::do_relocate_sections): Add new parameter for output
8216 file to match the parent.
8217 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
8218 of local symbols instead of input values. Update code to track
8219 changes in gold::relocate_section.
8220 * object.cc (Sized_relobj::compute_final_local_value): New methods.
8221 (Sized_relobj::compute_final_local_value_internal): New methods.
8222 (Sized_relobj::do_finalize_local_symbols): Move code from loop
8223 body into private version of Sized_relobj::compute_final_local_value.
8224 Call the inline method.
8225 * object.h (Symbol_value::Symbol_value): Define destructor. Free
8226 merged symbol value if there is one.
8227 (Symbol_value::has_output_value): New method defintiion.
8228 (Sized_relobj::Compute_final_local_value_status): New enum type.
8229 (Sized_relobj::compute_final_local_value): New methods.
8230 (Sized_relobj::compute_final_local_value_internal): New methods.
8231 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
8232 and arm_cortex_a8.sh.
8233 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
8234 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
8235 New tests.
8236 * Makefile.in: Regenerate.
8237 * testsuite/arm_bl_out_of_range.s: Update test.
8238 * testsuite/thumb_bl_out_of_range.s: Ditto.
8239 * testsuite/thumb_blx_out_of_range.s: Ditto.
8240 * testsuite/arm_branch_out_of_range.sh: New file.
8241 * testsuite/arm_cortex_a8.sh: Ditto.
8242 * testsuite/arm_cortex_a8_b.s: Ditto.
8243 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
8244 * testsuite/arm_cortex_a8_b_local.s: Ditto.
8245 * testsuite/arm_cortex_a8_bl.s: Ditto.
8246 * testsuite/arm_cortex_a8_blx.s: Ditto.
8247 * testsuite/arm_cortex_a8_local.s: Ditto.
8248 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
8249 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
8250
05a79166
L
82512010-09-08 Rafael Espindola <espindola@google.com>
8252
8253 * Makefile.am (memory_test.stdout): Run readelf with -W.
8254 * Makefile.in: Regenerate.
8255 * testsuite/memory_test.sh: Make the regexps accept both 32 and
8256 64 bit output.
8257
33dbc701
RÁE
82582010-09-08 Rafael Espindola <espindola@google.com>
8259
8260 * script-sections.cc (Script_sections::add_memory_region): Convert
8261 field precision to int.
8262 * script.cc (script_set_section_region, script_set_section_region):
8263 Convert field precision to int.
8264
731ca54a
RÁE
82652010-09-08 Rafael Espindola <espindola@google.com>
8266
8267 * arm.cc (do_finalize_sections): Create the __exidx_start and
8268 __exdix_end symbols even when the section is missing.
8269
7f8cd844
NC
82702010-09-08 Nick Clifton <nickc@redhat.com>
8271
8272 * README: Remove claim that MEMORY is not supported.
8273 * expression.cc (script_exp_function_origin)
8274 (script_exp_function_length): Move from here to ...
8275 * script.cc: ... here.
8276 (script_set_section_region, script_add_memory)
8277 (script_parse_memory_attr, script_include_directive): New
8278 functions.
8279 * script-sections.cc
8280 (class Memory_region): New class.
8281 (class Output_section_definition): Add set_memory_region,
8282 set_section_vma, set_section_lma and get_section_name methods.
8283 (class Script_Sections): Add add_memory_region,
8284 find_memory_region, find_memory_region_origin,
8285 find_memory_region_length and set_memory_region methods.
8286 Have set_section_addresses method walk the list of set memory
8287 regions.
8288 Extend the print methos to display memory regions.
8289 * script-sections.h: Add prototypes for new methods.
8290 Add enum for MEMORY region attributes.
8291 * yyscript.y: Add support for parsing MEMORY regions.
8292 * script-c.h: Add prototypes for new functions.
8293 * testsuite/Makefile.am: Add test of MEMORY region functionality.
8294 * testsuite/Makefile.in: Regenerate.
8295 * testsuite/memory_test.sh: New script.
8296 * testsuite/memory_test.s: New assembler source file.
8297 * testsuite/memory_test.t: New linker script.
8298
a4649286
DK
82992010-08-27 Doug Kwan <dougkwan@google.com>
8300
8301 * gold/resolve.cc (Symbol_table::should_override): Let a weak
8302 reference override an existing dynamic weak reference.
8303 * testsuite/Makefile.am: Add new test dyn_weak_ref.
8304 * testsuite/Makefile.in: Regenerate.
8305 * testsuite/dyn_weak_ref.sh: New file.
8306 * testsuite/dyn_weak_ref_1.c: Ditto.
8307 * testsuite/dyn_weak_ref_2.c: Ditto.
8308
b56648ad
ILT
83092010-08-27 Ian Lance Taylor <iant@google.com>
8310
8311 * incremental.h (class Incremental_input_entry): Add virtual
8312 destructor.
8313
809313cb
ILT
83142010-08-27 Ian Lance Taylor <iant@google.com>
8315
8316 * testsuite/start_lib_test_3.c: Mark t3 as used.
8317
11e32464
NC
83182010-08-27 Nick Clifton <nickc@redhat.com>
8319
8320 * options.cc (version_script): Fix small typo in previous
8321 whitespace tidyup.
8322
ca09d69a
NC
83232010-08-25 Nick Clifton <nickc@redhat.com>
8324
8325 * archive.cc: Formatting fixes: Remove whitespace between
8326 typename and following asterisk. Remove whitespace between
8327 function name and opening parenthesis.
8328 * archive.h: Likewise.
8329 * arm.cc: Likewise.
8330 * attributes.cc: Likewise.
8331 * attributes.h: Likewise.
8332 * common.cc: Likewise.
8333 * copy-relocs.cc: Likewise.
8334 * dirsearch.h: Likewise.
8335 * dynobj.cc: Likewise.
8336 * ehframe.cc: Likewise.
8337 * ehframe.h: Likewise.
8338 * expression.cc: Likewise.
8339 * fileread.cc: Likewise.
8340 * fileread.h: Likewise.
8341 * gc.h: Likewise.
8342 * gold-threads.cc: Likewise.
8343 * gold.cc: Likewise.
8344 * i386.cc: Likewise.
8345 * icf.h: Likewise.
8346 * incremental-dump.cc: Likewise.
8347 * incremental.cc: Likewise.
8348 * layout.cc: Likewise.
8349 * layout.h: Likewise.
8350 * main.cc: Likewise.
8351 * merge.cc: Likewise.
8352 * merge.h: Likewise.
8353 * object.cc: Likewise.
8354 * object.h: Likewise.
8355 * options.cc: Likewise.
8356 * options.h: Likewise.
8357 * output.cc: Likewise.
8358 * output.h: Likewise.
8359 * plugin.cc: Likewise.
8360 * plugin.h: Likewise.
8361 * powerpc.cc: Likewise.
8362 * reloc.cc: Likewise.
8363 * script-c.h: Likewise.
8364 * script-sections.cc: Likewise.
8365 * script.cc: Likewise.
8366 * stringpool.cc: Likewise.
8367 * symtab.cc: Likewise.
8368 * symtab.h: Likewise.
8369 * target.cc: Likewise.
8370 * timer.cc: Likewise.
8371 * timer.h: Likewise.
8372 * version.cc: Likewise.
8373 * x86_64.cc: Likewise.
8374
b8fa8750
NC
83752010-08-24 Nick Clifton <nickc@redhat.com>
8376
8377 PR 11899
8378 * layout.cc (segment_precedes): Sort segments by their physical
8379 addresses, if they have been set.
8380
9919d93b
CC
83812010-08-23 Cary Coutant <ccoutant@google.com>
8382
8383 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
8384 symbols data.
8385 (Lib_group::include_member): Unlock object after deleting its
8386 symbols data.
8387 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
8388 the bug fixed here.
8389
97b4be1c
CC
83902010-08-19 Neil Vachharajani <nvachhar@google.com>
8391 Cary Coutant <ccoutant@google.com>
8392
8393 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
8394 constructor, and set_blocker.
8395 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
8396 readsyms_blocker_.
8397 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
8398 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
8399 * testsuite/Makefile.am (start_lib_test): New test case.
8400 * testsuite/Makefile.in: Regenerate.
8401 * testsuite/start_lib_test_main.c: New file.
8402 * testsuite/start_lib_test_1.c: New file.
8403 * testsuite/start_lib_test_2.c: New file.
8404 * testsuite/start_lib_test_3.c: New file.
8405
dd0b1884
ILT
84062010-08-19 Ian Lance Taylor <iant@google.com>
8407
8408 * Makefile.in: Rebuild with automake 1.11.1.
8409 * aclocal.m4: Likewise.
8410 * testsuite/Makefile.in: Likewise.
8411
7223e9ca
ILT
84122010-08-19 Ian Lance Taylor <iant@google.com>
8413
8414 PR 10893
8415 * i386.cc (class Output_data_plt_i386): Update declarations.
8416 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
8417 local_ifuncs_ fields.
8418 (Target_i386::do_plt_section_for_global): New function.
8419 (Target_i386::do_plt_section_for_local): New function.
8420 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
8421 parameter; change all callers. Initialize global_ifuncs_ and
8422 local_ifuncs_. If doing a static link define __rel_iplt_start and
8423 __rel_iplt_end.
8424 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
8425 (Output_data_plt_i386::add_local_ifunc_entry): New function.
8426 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
8427 symbols.
8428 (Target_i386::make_plt_section): New function, broken out of
8429 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
8430 (Target_i386::make_plt_entry): Call make_plt_section.
8431 (Target_i386::make_local_ifunc_plt_entry): New function.
8432 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
8433 (Target_i386::Scan::local): Handle IFUNC symbols. Add
8434 R_386_IRELATIVE to switch.
8435 (Target_i386::Scan::global): Likewise.
8436 (Target_i386::Relocate::relocate): Likewise.
8437 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
8438 switch.
8439 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
8440 (Target_x86_64::do_plt_section_for_global): New function.
8441 (Target_x86_64::do_plt_section_for_local): New function.
8442 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
8443 parameter; change all callers. If doing a static link define
8444 __rela_iplt_start and __rela_iplt_end.
8445 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
8446 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
8447 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
8448 to point to .plt.
8449 (Target_x86_64::make_local_ifunc_plt_entry): New function.
8450 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
8451 switch.
8452 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
8453 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
8454 R_X86_64_IRELATIVE to switch.
8455 (Target_x86_64::Scan::global): Likewise.
8456 (Target_x86_64::Relocate::relocate): Likewise.
8457 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
8458 switch.
8459 * target.h (class Target): Add plt_section_for_global and
8460 plt_section_for_local functions. Add do_plt_section_for_global
8461 and do_plt_section_for_local virtual functions.
8462 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
8463 clarifying comments.
8464 (Symbol::use_plt_offset): Handle IFUNC symbol.
8465 * object.cc (Sized_relobj::Sized_relobj): Initialize
8466 local_plt_offsets_.
8467 (Sized_relobj::local_has_plt_offset): New function.
8468 (Sized_relobj::local_plt_offset): New function.
8469 (Sized_relobj::set_local_plt_offset): New function.
8470 (Sized_relobj::do_count): Handle IFUNC symbol.
8471 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
8472 a bit away from input_shndx_ field. Add set_is_func_symbol and
8473 is_ifunc_symbol functions.
8474 (class Sized_relobj): Update declarations. Remove Tls_got_entry
8475 and Local_tls_got_offsets. Define Local_plt_offsets. Add
8476 local_plt_offsets_ field.
8477 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
8478 * output.h (class Output_section_data): Add non-const
8479 output_section function.
8480 (class Output_data_got): Update declarations.
8481 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
8482 Add use_plt_offset parameter to global and local constructors.
8483 Change all callers. Change local_sym_index_ field to 31 bits.
8484 Change GSYM_CODE and CONSTANT_CODE accordingly.
8485 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
8486 doing a static link don't set sh_link field.
8487 (Output_data_got::Got_entry::write): Use PLT offset if
8488 appropriate.
8489 (Output_data_got::add_global_plt): New function.
8490 (Output_data_got::add_local_plt): New function.
8491 * target-reloc.h (relocate_section): Handle IFUNC symbol.
8492 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
8493 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
8494 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
8495 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
8496 IFUNC conditional.
8497 * testsuite/ifunc-sel.h: New file.
8498 * testsuite/ifuncmain1.c: New file.
8499 * testsuite/ifuncmain1vis.c: New file.
8500 * testsuite/ifuncmod1.c: New file.
8501 * testsuite/ifuncdep2.c: New file.
8502 * testsuite/ifuncmain2.c: New file.
8503 * testsuite/ifuncmain3.c: New file.
8504 * testsuite/ifuncmod3.c: New file.
8505 * testsuite/ifuncmain4.c: New file.
8506 * testsuite/ifuncmain5.c: New file.
8507 * testsuite/ifuncmod5.c: New file.
8508 * testsuite/ifuncmain6pie.c: New file.
8509 * testsuite/ifuncmod6.c: New file.
8510 * testsuite/ifuncmain7.c: New file.
8511 * configure, testsuite/Makefile.in: Rebuild.
8512
56f75c03
ILT
85132010-08-18 Ian Lance Taylor <iant@google.com>
8514
8515 * incremental.cc
8516 (Output_section_incremental_inputs::write_input_files): Add cast
8517 to avoid signed/unsigned comparison warning.
8518 (Output_section_incremental_inputs::write_info_blocks): Likewise.
8519
55455f89
CC
85202010-08-12 Cary Coutant <ccoutant@google.com>
8521
8522 * common.cc (Sort_commons::operator()): Remove unnecessary code.
8523
e2054bcb
ILT
85242010-08-13 Ian Lance Taylor <iant@google.com>
8525
8526 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
8527
74f67560
DK
85282010-08-12 Cary Coutant <ccoutant@google.com>
8529 Doug Kwan <dougkwan@google.com>
8530
8531 * resolve.cc (Symbol_table::should_override): When a weak dynamic
8532 defintion overrides non-weak undef, remember that the original undef
8533 is not weak.
8534 * symtab.cc (Symbol_table::sized_write_global): For undef without
8535 an original weak binding, set binding to global in output.
8536 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
8537 * testsuite/Makefile.in: Regenerate.
8538 * testsuite/strong_ref_weak_def.sh: New file.
8539 * testsuite/strong_ref_weak_def_1.c: Ditto.
8540 * testsuite/strong_ref_weak_def_2.c: Ditto.
8541
d1238d12
CC
85422010-08-12 Cary Coutant <ccoutant@google.com>
8543
8544 * testsuite/incremental_test.sh: Rewrite.
8545 * testsuite/incremental_test_1.c: Rewrite.
8546 * testsuite/incremental_test_2.c: Rewrite.
8547
0e70b911
CC
85482010-08-12 Cary Coutant <ccoutant@google.com>
8549
8550 * arm.cc (Target_arm::got_size): Add const.
8551 (Target_arm::got_entry_count): New function.
8552 (Target_arm::plt_entry_count): New function.
8553 (Target_arm::first_plt_entry_offset): New function.
8554 (Target_arm::plt_entry_size): New function.
8555 (Output_data_plt_arm::entry_count): New function.
8556 (Output_data_plt_arm::first_plt_entry_offset): New function.
8557 (Output_data_plt_arm::get_plt_entry_size): New function.
8558 * i386.cc (Target_i386::got_size): Add const.
8559 (Target_i386::got_entry_count): New function.
8560 (Target_i386::plt_entry_count): New function.
8561 (Target_i386::first_plt_entry_offset): New function.
8562 (Target_i386::plt_entry_size): New function.
8563 (Output_data_plt_i386::entry_count): New function.
8564 (Output_data_plt_i386::first_plt_entry_offset): New function.
8565 (Output_data_plt_i386::get_plt_entry_size): New function.
8566 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
8567 find_incremental_inputs_sections. Dump incremental_got_plt section.
8568 * incremental.cc: Include target.h.
8569 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
8570 parameter. Adjust all callers. Find incremental_got_plt section.
8571 (Incremental_inputs::create_data_sections): Create incremental_got_plt
8572 section.
8573 (Output_section_incremental_inputs::set_final_data_size): Calculate
8574 size of incremental_got_plt section.
8575 (Output_section_incremental_inputs::do_write): Write the
8576 incremental_got_plt section.
8577 (Got_plt_view_info): New struct.
8578 (Local_got_offset_visitor): New class.
8579 (Global_got_offset_visitor): New class.
8580 (Global_symbol_visitor_got_plt): New class.
8581 (Output_section_incremental_inputs::write_got_plt): New function.
8582 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
8583 Add parameter. Adjust all callers.
8584 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8585 (Incremental_inputs::got_plt_section): New function.
8586 (Incremental_inputs::got_plt_section_): New data member.
8587 (Incremental_got_plt_reader): New class.
8588 * layout.cc (Layout::create_incremental_info_sections): Add the
8589 incremental_got_plt section.
8590 * object.h (Got_offset_list::get_list): New function.
8591 (Got offset_list::for_all_got_offsets): New function.
8592 (Sized_relobj::local_got_offset_list): New function.
8593 * powerpc.cc (Target_powerpc::got_size): Add const.
8594 (Target_powerpc::got_entry_count): New function.
8595 (Target_powerpc::plt_entry_count): New function.
8596 (Target_powerpc::first_plt_entry_offset): New function.
8597 (Target_powerpc::plt_entry_size): New function.
8598 (Output_data_plt_powerpc::entry_count): New function.
8599 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
8600 (Output_data_plt_powerpc::get_plt_entry_size): New function.
8601 * sparc.cc (Target_sparc::got_size): Add const.
8602 (Target_sparc::got_entry_count): New function.
8603 (Target_sparc::plt_entry_count): New function.
8604 (Target_sparc::first_plt_entry_offset): New function.
8605 (Target_sparc::plt_entry_size): New function.
8606 (Output_data_plt_sparc::entry_count): New function.
8607 (Output_data_plt_sparc::first_plt_entry_offset): New function.
8608 (Output_data_plt_sparc::get_plt_entry_size): New function.
8609 * symtab.h (Symbol::got_offset_list): New function.
8610 (Symbol_table::for_all_symbols): New function.
8611 * target.h (Sized_target::got_entry_count): New function.
8612 (Sized_target::plt_entry_count): New function.
8613 (Sized_target::plt_entry_size): New function.
8614 * x86_64.cc (Target_x86_64::got_size): Add const.
8615 (Target_x86_64::got_entry_count): New function.
8616 (Target_x86_64::plt_entry_count): New function.
8617 (Target_x86_64::first_plt_entry_offset): New function.
8618 (Target_x86_64::plt_entry_size): New function.
8619 (Output_data_plt_x86_64::entry_count): New function.
8620 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
8621 (Output_data_plt_x86_64::get_plt_entry_size): New function.
8622
09ec0418
CC
86232010-08-12 Cary Coutant <ccoutant@google.com>
8624
8625 * archive.cc: Include incremental.h.
8626 (Archive::Archive): Initialize incremental_info_.
8627 (Archive::include_member): Record archive members in incremental info.
8628 (Add_archive_symbols::run): Record begin and end of an archive in
8629 incremental info.
8630 (Lib_group::include_member): Record objects in incremental info.
8631 * archive.h (Incremental_archive_entry): Forward declaration.
8632 (Archive::set_incremental_info): New member function.
8633 (Archive::incremental_info): New member function.
8634 (Archive::Unused_symbol_iterator): New class.
8635 (Archive::unused_symbols_begin): New member function.
8636 (Archive::unused_symbols_end): New member function.
8637 (Archive::incremental_info_): New data member.
8638 * incremental-dump.cc (find_input_containing_global): New function.
8639 (dump_incremental_inputs): Dump new incremental info sections.
8640 * incremental.cc: Include symtab.h.
8641 (Output_section_incremental_inputs): New class.
8642 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
8643 new incremental info sections.
8644 (Sized_incremental_binary::do_check_inputs): Likewise.
8645 (Incremental_inputs::report_archive): Remove.
8646 (Incremental_inputs::report_archive_begin): New function.
8647 (Incremental_inputs::report_archive_end): New function.
8648 (Incremental_inputs::report_object): New function.
8649 (Incremental_inputs::finalize_inputs): Remove.
8650 (Incremental_inputs::report_input_section): New function.
8651 (Incremental_inputs::report_script): Rewrite.
8652 (Incremental_inputs::finalize): Do nothing but finalize string table.
8653 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8654 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8655 (Incremental_inputs::create_data_sections): New function.
8656 (Incremental_inputs::relocs_entsize): New function.
8657 (Output_section_incremental_inputs::set_final_data_size): New function.
8658 (Output_section_incremental_inputs::do_write): New function.
8659 (Output_section_incremental_inputs::write_header): New function.
8660 (Output_section_incremental_inputs::write_input_files): New function.
8661 (Output_section_incremental_inputs::write_info_blocks): New function.
8662 (Output_section_incremental_inputs::write_symtab): New function.
8663 * incremental.h (Incremental_script_entry): Forward declaration.
8664 (Incremental_object_entry): Forward declaration.
8665 (Incremental_archive_entry): Forward declaration.
8666 (Incremental_inputs): Forward declaration.
8667 (Incremental_inputs_header_data): Remove.
8668 (Incremental_inputs_header): Remove.
8669 (Incremental_inputs_header_write): Remove.
8670 (Incremental_inputs_entry_data): Remove.
8671 (Incremental_inputs_entry): Remove.
8672 (Incremental_inputs_entry_write): Remove.
8673 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
8674 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
8675 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8676 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
8677 Likewise.
8678 (Incremental_input_entry): New class.
8679 (Incremental_script_entry): New class.
8680 (Incremental_object_entry): New class.
8681 (Incremental_archive_entry): New class.
8682 (Incremental_inputs::Incremental_inputs): Initialize new data members.
8683 (Incremental_inputs::report_inputs): Remove.
8684 (Incremental_inputs::report_archive): Remove.
8685 (Incremental_inputs::report_archive_begin): New function.
8686 (Incremental_inputs::report_archive_end): New function.
8687 (Incremental_inputs::report_object): Change prototype.
8688 (Incremental_inputs::report_input_section): New function.
8689 (Incremental_inputs::report_script): Change prototype.
8690 (Incremental_inputs::get_reloc_count): New function.
8691 (Incremental_inputs::set_reloc_count): New function.
8692 (Incremental_inputs::create_data_sections): New function.
8693 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8694 (Incremental_inputs::inputs_section): New function.
8695 (Incremental_inputs::symtab_section): New function.
8696 (Incremental_inputs::relocs_section): New function.
8697 (Incremental_inputs::get_stringpool): Add const.
8698 (Incremental_inputs::command_line): Add const.
8699 (Incremental_inputs::inputs): Remove.
8700 (Incremental_inputs::command_line_key): New function.
8701 (Incremental_inputs::input_file_count): New function.
8702 (Incremental_inputs::input_files): New function.
8703 (Incremental_inputs::relocs_entsize): New function.
8704 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8705 (Incremental_inputs::finalize_inputs): Remove.
8706 (Incremental_inputs::Input_info): Remove.
8707 (Incremental_inputs::lock_): Remove.
8708 (Incremental_inputs::inputs_): Change type.
8709 (Incremental_inputs::inputs_map_): Remove.
8710 (Incremental_inputs::current_object_entry_): New data member.
8711 (Incremental_inputs::inputs_section_): New data member.
8712 (Incremental_inputs::symtab_section_): New data member.
8713 (Incremental_inputs::relocs_section_): New data member.
8714 (Incremental_inputs::reloc_count_): New data member.
8715 (Incremental_inputs_reader): New class.
8716 (Incremental_symtab_reader): New class.
8717 (Incremental_relocs_reader): New class.
8718 * layout.cc (Layout::finalize): Move finalization of incremental info
8719 and creation of incremental info sections to follow finalization of
8720 symbol table. Set offsets for postprocessing sections.
8721 (Layout::create_incremental_info_sections): Call
8722 Incremental_inputs::create_data_sections. Add incremental symtab
8723 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
8724 sections to layout after input sections.
8725 * layout.h (struct Timespec): Forward declaration.
8726 (Layout::incremental_inputs): Add const.
8727 (Layout::create_incremental_info_sections): Add parameter.
8728 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
8729 * object.cc: Include incremental.h.
8730 (Relobj::finalize_incremental_relocs): New function.
8731 (Sized_relobj::do_layout): Record input sections in incremental info.
8732 * object.h (Object::output_section): New function.
8733 (Object::output_section_offset): Moved from Relobj.
8734 (Object::get_incremental_reloc_base): New function.
8735 (Object::get_incremental_reloc_count): New function.
8736 (Object::do_output_section): New function.
8737 (Object::do_output_section_offset): Moved from Relobj.
8738 (Object::do_get_incremental_reloc_base): New function.
8739 (Object::do_get_incremental_reloc_count): New function.
8740 (Object::Object): Initialize new data members.
8741 (Relobj::output_section): Renamed do_output_section and moved to
8742 protected.
8743 (Relobj::output_section_offset): Moved to Object.
8744 (Relobj::do_get_incremental_reloc_base): New function.
8745 (Relobj::do_get_incremental_reloc_count): New function.
8746 (Relobj::allocate_incremental_reloc_counts): New function.
8747 (Relobj::count_incremental_reloc): New function.
8748 (Relobj::finalize_incremental_relocs): New function.
8749 (Relobj::next_incremental_reloc_index): New function.
8750 (Relobj::reloc_counts_): New data member.
8751 (Relobj::reloc_bases_): New data member.
8752 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
8753 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
8754 (Sized_relobj::incremental_relocs_scan): New function.
8755 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8756 (Sized_relobj::incremental_relocs_write): New function.
8757 (Sized_relobj::incremental_relocs_write_reltype): New function.
8758 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
8759 incremental link.
8760 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
8761 archives and object files elsewhere.
8762 (Add_symbols::run): Report object files here.
8763 (Finish_group::run): Report end of archive at end of group.
8764 * reloc.cc: Include layout.h, incremental.h.
8765 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
8766 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
8767 (Sized_relobj::incremental_relocs_scan): New function.
8768 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8769 (Sized_relobj::do_relocate_sections): Write incremental relocations.
8770 (Sized_relobj::incremental_relocs_write): New function.
8771 (Sized_relobj::incremental_relocs_write_reltype): New function.
8772 * script.cc (read_input_script): Rewrite test for incremental link.
8773 Change call to Incremental_inputs::report_script.
8774 * symtab.h (Symbol_table::first_global_index): New function.
8775 (Symbol_table::output_count): New function.
8776
ce0d1972
DK
87772010-08-12 Doug Kwan <dougkwan@google.com>
8778
8779 * arm.cc (Target_arm::merge_object_attributes): Check command line
8780 options --no-wchar-size-warning and --no-enum-size-warning.
8781 * options.h (General_options): Add ld-compatible options
8782 --no-enum-size-warning and --no-wchar-size-warning.
8783
6e5710ce
ILT
87842010-08-04 Ian Lance Taylor <iant@google.com>
8785
8786 * x86_64.cc (Target_x86_64::Scan::local): Use
8787 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
8788 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
8789 (Target_x86_64::Scan::global): Likewise.
8790 (Target_x86_64::Relocate::relocate): Likewise.
8791 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
8792 Likewise.
8793
fef830db
CC
87942010-08-03 Cary Coutant <ccoutant@google.com>
8795
8796 * merge.cc (Output_merge_string::do_add_input_section): Count strings
8797 to reserve space in merged_strings vector. Keep total input size
8798 for stats.
8799 (Output_merge_string::do_print_merge_stats): Print total input size.
8800 * merge.h (Output_merge_string): Add input_size_ field.
8801 * stringpool.cc (Stringpool_template::string_length): Move
8802 implementations out of Stringpool_template class and place in
8803 stringpool.h.
8804 * stringpool.h (string_length): Move out of Stringpool_template.
8805
1e3811b0
ILT
88062010-08-03 Ian Lance Taylor <iant@google.com>
8807
8808 PR 11712
8809 * layout.cc (relaxation_loop_body): If address of load segment is
8810 set, adjust address to include headers if possible.
8811
7af0c620
ILT
88122010-08-03 Ian Lance Taylor <iant@google.com>
8813
8814 * version.cc (version_string): Bump to 1.10.
8815
22f0da72
ILT
88162010-08-03 Ian Lance Taylor <iant@google.com>
8817
8818 PR 11805
8819 * layout.h (enum Output_section_order): Define.
8820 (class Layout): Update declarations.
8821 * layout.cc (Layout::get_output_section): Add order parameter.
8822 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
8823 is_first_non_relro parameters. Change all callers.
8824 (Layout::choose_output_section): Likewise.
8825 (Layout::add_output_section_data): Likewise.
8826 (Layout::make_output_section): Likewise. Set order.
8827 (Layout::default_section_order): New function.
8828 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
8829 * output.cc (Output_section::Output_section): Initialize order_.
8830 Don't initialize deleted fields.
8831 (Output_segment::Output_segment): Don't initialize deleted
8832 fields.
8833 (Output_segment::add_output_section_to_load): New function
8834 replacing add_output_section. Change all callers to call this or
8835 add_output_section_to_nonload.
8836 (Output_segment::add_output_section_to_nonload): New function.
8837 (Output_segment::remove_output_section): Rewrite.
8838 (Output_segment::add_initial_output_data): Likewise.
8839 (Output_segment::has_any_data_sections): Likewise.
8840 (Output_segment::is_first_section_relro): Likewise.
8841 (Output_segment::maximum_alignment): Likewise.
8842 (Output_segment::has_dynamic_reloc): New function replacing
8843 dynamic_reloc_count. Change all callers.
8844 (Output_segment::has_dynamic_reloc_list): New function replacing
8845 dynamic_reloc_count_list. Change all callers.
8846 (Output_segment::set_section_addresses): Rewrite.
8847 (Output_segment::set_offset): Rewrite.
8848 (Output_segment::find_first_and_last_list): Remove.
8849 (Output_segment::set_tls_offsets): Rewrite.
8850 (Output_segment::first_section_load_address): Likewise.
8851 (Output_segment::output_section_count): Likewise.
8852 (Output_segment::section_with_lowest_load_address): Likewise.
8853 (Output_segment::write_section_headers): Likewise.
8854 (Output_segment::print_sections_to_map): Likewise.
8855 * output.h (class Output_data): Remove dynamic_reloc_count_
8856 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
8857 (Output_data::add_dynamic_reloc): Rewrite.
8858 (Output_data::has_dynamic_reloc): New function.
8859 (Output_data::dynamic_reloc_count): Remove.
8860 (class Output_section): Add order_ field. Remvoe is_relro_local_,
8861 is_last_relro_, is_first_non_relro_, is_interp_,
8862 is_dynamic_linker_section_ fields. Add order and set_order
8863 functions. Remove is_relro_local, set_is_relro_local,
8864 is_last_relro, set_is_last_relro, is_first_non_relro,
8865 set_is_first_non_relro functions, is_interp, set_is_interp,
8866 is_dynamic_linker_section, and set_is_dynamic_linker_section
8867 functions.
8868 (class Output_segment): Change Output_data_list from std::list to
8869 std:;vector. Add output_lists_ field. Remove output_data_ and
8870 output_bss_ fields. Update declarations.
8871
3ff2ccb0
ILT
88722010-08-02 Ian Lance Taylor <iant@google.com>
8873
8874 * arm.cc (Target_arm::gc_process_relocs): Use typename.
8875 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
8876 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
8877
88a4108b
ILT
88782010-08-02 Ian Lance Taylor <iant@google.com>
8879
8880 PR 11855
8881 * script.cc (Script_options::Script_options): Initialize
8882 symbol_definitions_ and symbol_references_.
8883 (Script_options::add_symbol_assignment): Update
8884 symbol_definitions_ and symbol_references_.
8885 (Script_options::add_symbol_reference): New function.
8886 (script_symbol): New function.
8887 * script.h (class Script_options): Add symbol_definitions_ and
8888 symbol_references_ fields.
8889 (Script_options::referenced_const_iterator): New type.
8890 (Script_options::referenced_begin): New function.
8891 (Script_options::referenced_end): New function.
8892 (Script_options::is_referenced): New function.
8893 (Script_options::any_unreferenced): New function.
8894 * script-c.h (script_symbol): Declare.
8895 * yyscript.y (exp): Call script_symbol.
8896 * symtab.cc: Include "script.h".
8897 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
8898 Change all callers. Check symbols referenced by scripts.
8899 (Symbol_table::add_undefined_symbols_from_command_line): Add
8900 layout parameter. Change all callers.
8901 (Symbol_table::do_add_undefined_symbols_from_command_line):
8902 Likewise. Break out loop body. Check symbols referenced by
8903 scripts.
8904 (Symbol_table::add_undefined_symbol_from_command_line): New
8905 function broken out of
8906 do_add_undefined_symbols_from_command_line.
8907 * symtab.h (class Symbol_table): Update declarations.
8908 * archive.cc: Include "layout.h".
8909 (Archive::should_include_member): Add layout parameter. Change
8910 all callers. Check for symbol mentioned in expression.
8911 * archive.h (class Archive): Update declaration.
8912 * object.cc (Sized_relobj::do_should_include_member): Add layout
8913 parameter.
8914 * object.h (Object::should_include_member): Add layout parameter.
8915 Change all callers.
8916 (Object::do_should_include_member): Add layout parameter.
8917 (class Sized_relobj): Update declaration.
8918 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
8919 parameter.
8920 * dynobj.h (class Sized_dynobj): Update declaration.
8921 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
8922 layout parameter.
8923 * plugin.h (class Sized_pluginobj): Update declaration.
8924
5f1ab67a
ILT
89252010-08-02 Ian Lance Taylor <iant@google.com>
8926
8927 PR 11866
8928 * output.cc (Output_segment::set_offset): Search for the first and
8929 last sections rather than assuming that the list is in order.
8930 (Output_segment::find_first_and_last_list): New function.
8931 * output.h (class Output_segment): Update declarations.
8932 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
8933 (relro_strip_test_SOURCES): New variable.
8934 (relro_strip_test_DEPENDENCIES): New variable.
8935 (relro_strip_test_LDFLAGS): New variable.
8936 (relro_strip_test_LDADD): New variable.
8937 (relro_strip_test.so): New target.
8938
a8df5856
ILT
89392010-08-02 Ian Lance Taylor <iant@google.com>
8940
8941 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
8942 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
8943 (Target_i386::got_tlsdesc_section): New function.
8944 (Target_i386::got_section): Create space for GOT entries for
8945 TLSDESC relocations.
8946 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
8947 R_386_TLS_GOTDESC.
8948 (Target_i386::Scan::global): Likewise.
8949 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
8950 using TLSDESC GOT.
8951 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
8952 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
8953 (Target_x86_64::got_tlsdesc_section): New function.
8954 (Target_x86_64::got_section): Create space for GOT entries for
8955 TLSDESC relocations.
8956 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
8957 R_386_TLS_GOTDESC.
8958 (Target_x86_64::Scan::global): Likewise.
8959 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
8960 using TLSDESC GOT.
8961
0c10a0a6
ILT
89622010-08-02 Ian Lance Taylor <iant@google.com>
8963
8964 * testsuite/final_layout.sh: Use dc to convert from hex to
8965 decimal.
8966
41cbeecc
ST
89672010-07-29 Sriraman Tallam <tmsriram@google.com>
8968
8969 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
8970 paramter to the call to gold::gc_process_relocs.
8971 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
8972 paramter to the call to gold::gc_process_relocs.
8973 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
8974 parameter to the call to gold::gc_process_relocs.
8975 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
8976 template parameter to the call to gold::gc_process_relocs.
8977 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
8978 paramter to the call to gold::gc_process_relocs.
8979 * gc.h (get_embedded_addend_size): New function.
8980 (gc_process_relocs): Save the size of the reloc for use by ICF.
8981 * icf.cc (get_section_contents): Get the addend from the text section
8982 for SHT_REL relocation sections.
8983 * icf.h (Icf::Reloc_addend_size_info): New typedef.
8984 (Icf::Reloc_info): Add new member reloc_addend_size_info.
8985 * int_encoding.h (read_from_pointer): New overloaded function.
8986 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
8987 * testsuite/icf_sht_rel_addend_test.sh: New file.
8988 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
8989 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
8990
6ea55b82
RW
89912010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8992
8993 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
8994 * Makefile.in: Regenerate.
8995 * testsuite/Makefile.in: Regenerate.
8996
9691462b
ILT
89972010-07-27 Jeffrey Yasskin <jyasskin@google.com>
8998
8999 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
9000 * gold/testsuite/debug_msg.cc: Likewise.
9001 * gold/testsuite/odr_violation1.cc
9002 * gold/testsuite/odr_violation2.cc
9003
76897331
CC
90042010-07-21 Cary Coutant <ccoutant@google.com>
9005
9006 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
9007 string, and length fields.
9008 (Output_merge_string::Merged_strings_list): New type.
9009 (Output_merge_string::Merged_strings_lists): New typedef.
9010 (Output_merge_string): Replace merged_strings_ with
9011 merged_strings_lists_.
9012 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
9013 Merged_strings_list per input object and section. Don't store pointer
9014 to the string. Don't store length with each merged string entry.
9015 (Output_merge_string::finalize_merged_data): Loop over list of merged
9016 strings lists. Recompute length of each merged string.
9017
78384e8f
CC
90182010-07-15 Cary Coutant <ccoutant@google.com>
9019
9020 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
9021 here.
9022
783659f9
ILT
90232010-07-14 Ian Lance Taylor <iant@google.com>
9024
9025 * descriptors.cc (Descriptors::open): Report correct name in error
9026 message.
9027
131687b4
DK
90282010-07-13 Doug Kwan <dougkwan@google.com>
9029
9030 * arm.cc (Arm_input_section::Arm_input_section): For a
9031 SHT_ARM_EXIDX section, always keeps the input sections.
9032 (Arm_input_section::set_exidx_section_link): New method.
9033 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
9034 has_errors_ to false.
9035 (Arm_exidx_input_section::has_errors,
9036 Arm_exidx_input_section::set_has_errors): New methods.
9037 (Arm_exidx_input_section::has_errors_): New data member.
9038 (Arm_relobj::get_exidx_shndx_list): New method.
9039 (Arm_output_section::append_text_sections_to_list): Do not skip
9040 section without SHF_EXECINSTR.
9041 (Arm_output_section::fix_exidx_coverage): Skip input sections with
9042 errors.
2e702c99 9043 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
9044 section header. Make error messages more verbose. Check for
9045 a non-executable section linked to an EXIDX section.
9046 (Arm_relobj::do_read_symbols): Remove error checking, which has been
9047 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
9048 check that there is no deferred EXIDX section if we exit early.
9049 Instead of not making an EXIDX section in case of an error, make one
9050 and set the has_errors flag of it.
9051 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
9052 in a relocatable link.
9053 (Target_arm::do_relax): Look for the EXIDX output section instead of
9054 assuming that it is called .ARM.exidx.
2e702c99 9055 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
9056 section list. Do not check for SHF_EXECINSTR section flags but
9057 skip any input section with errors.
9058 * output.cc (Output_section::Output_section): Initialize
9059 always_keeps_input_sections_ to false.
9060 (Output_section::add_input_section): Check for
9061 always_keeps_input_sections_.
9062 * output.h (Output_section::always_keeps_input_sections,
9063 Output_section::set_always_keeps_input_sections): New methods.
9064 (Output_section::always_keeps_input_sections): New data member.
9065
69517287
RÁE
90662010-07-13 Rafael Espindola <espindola@google.com>
9067
9068 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
9069 * fileread.h (Input_file): Add try_extra_search_path and find_file.
9070
82742395
ILT
90712010-07-13 Philip Herron <herron.philip@googlemail.com>
9072 Ian Lance Taylor <iant@google.com>
9073
9074 * output.h (Output_section_lookup_maps::add_merge_section):
9075 Correct check of whether value was inserted.
9076 (Output_section_lookup_maps::add_merge_input_section): Likewise.
9077 (Output_section_lookup_maps::add_relaxed_input_section):
9078 Likewise.
9079 * arm.cc (Target_arm::got_section): Remove used local os.
9080 * i386.cc (Target_i386::got_section): Likewise.
9081 * x86_64.cc (Target_x86_64::got_section): Likewise.
9082 * sparc.cc (Target_sparc::got_section): Likewise.
9083 (Target_sparc::relocate): Remove unused local have_got_offset.
9084 * powerpc.cc (Target_powerpc::relocate): Likewise.
9085
f2d707b5
ILT
90862010-07-13 Ian Lance Taylor <iant@google.com>
9087
241531d6
ILT
9088 * compressed_output.cc (zlib_decompress): Fix signature in
9089 !HAVE_ZLIB_H case.
9090
f2d707b5
ILT
9091 * archive.cc (Archive::include_member): Unlock an external member
9092 of a thin archive. Don't bother to delete an object we know is
9093 NULL.
9094
a2e47362
CC
90952010-07-12 Cary Coutant <ccoutant@google.com>
9096
9097 * compressed_output.cc (zlib_decompress): New function.
9098 (get_uncompressed_size): New function.
9099 (decompress_input_section): New function.
9100 * compressed_output.h (get_uncompressed_size): New function.
9101 (decompress_input_section): New function.
9102 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
9103 Handle compressed debug sections.
9104 * layout.cc (is_compressed_debug_section): New function.
9105 (Layout::output_section_name): Map compressed section names to
9106 canonical names.
9107 * layout.h (is_compressed_debug_section): New function.
9108 (is_debug_info_section): Recognize compressed debug sections.
9109 * merge.cc: Include compressed_output.h.
9110 (Output_merge_data::do_add_input_section): Handle compressed
9111 debug sections.
9112 (Output_merge_string::do_add_input_section): Handle compressed
9113 debug sections.
9114 * object.cc: Include compressed_output.h.
9115 (Sized_relobj::Sized_relobj): Initialize new data members.
9116 (build_compressed_section_map): New function.
9117 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
9118 * object.h (Object::section_is_compressed): New method.
9119 (Object::do_section_is_compressed): New method.
9120 (Sized_relobj::Compressed_section_map): New type.
9121 (Sized_relobj::do_section_is_compressed): New method.
9122 (Sized_relobj::compressed_sections_): New data member.
9123 * output.cc (Output_section::add_input_section): Handle compressed
9124 debug sections.
9125 * reloc.cc: Include compressed_output.h.
9126 (Sized_relobj::write_sections): Handle compressed debug sections.
9127
ce279a62
CC
91282010-07-08 Cary Coutant <ccoutant@google.com>
9129
9130 * resolve.cc (Symbol_table::resolve): Remember whether undef was
9131 weak when resolving to a dynamic def.
9132 (Symbol_table::should_override): Add adjust_dyndef flag; set it
9133 for weak undef/dynamic def cases. Adjust callers.
9134 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
9135 undef_binding_weak_.
9136 (Symbol_table::sized_write_globals): Adjust symbol binding.
9137 (Symbol_table::sized_write_symbol): Add binding parameter.
9138 * symtab.h (Symbol::set_undef_binding): New method.
9139 (Symbol::is_undef_binding_weak): New method.
9140 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
9141 (Symbol_table::should_override): Add new parameter.
9142 (Symbol_table::sized_write_symbol): Add new parameter.
9143
9144 * testsuite/weak_undef_file1.cc: Add new test case.
9145 * testsuite/weak_undef_file2.cc: Fix header comment.
9146 * testsuite/weak_undef_test.cc: Add new test case.
9147
b2286c10
DK
91482010-06-29 Doug Kwan <dougkwan@google.com>
9149
9150 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
9151 Initialize USE_SYMBOL_.
9152 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
9153 definition.
9154 (Arm_reloc_property::uses_symbol_): New data member declaration.
9155 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
9156 uses symbol value and symbol is undefined but not weakly undefined.
9157
4802450a
RÁE
91582010-06-28 Rafael Espindola <espindola@google.com>
9159
9160 * plugin.cc (Plugin::load): Use dlerror.
9161
e5ca47ba
ILT
91622010-06-26 Jeffrey Yaskin <jyasskin@google.com>
9163
9164 * symtab.cc (detect_odr_violations): When reporting an ODR
9165 violation, report an object where the symbol is defined.
9166
8a75a161
DK
91672010-06-25 Doug Kwan <dougkwan@google.com>
9168
9169 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
9170 (Target_arm::section_may_have_icf_unsafe_pointers): New method
9171 definition.
9172 (Target_arm::Scan::local_reloc_may_be_function_pointer,
9173 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
9174 target hook to detect function points.
9175 (Target_arm::Scan::possible_function_pointer_reloc): New method.
9176 * icf.h (Icf::check_section_for_function_pointers): Change type of
9177 parameter SECTION_NAME to const reference to std::string. Use
9178 target hook to determine if section may have unsafe pointers.
9179 * target.h (Target::section_may_have_icf_unsafe_pointers): New
9180 method definition.
9181
42218b9f
RÁE
91822010-06-21 Rafael Espindola <espindola@google.com>
9183
9184 * fileread.cc (Input_file::find_fie): New
9185 (Input_file::open): Use Input_file::find_fie.
9186 * fileread.h (Input_file::find_fie): New
9187 * plugin.cc (set_extra_library_path): New.
9188 (Plugin::load): Add set_extra_library_path to the transfer vector.
9189 (Plugin_manager::set_extra_library_path): New.
9190 (Plugin_manager::add_input_file): Use the extra search path if set.
9191 (set_extra_library_path(): New.
9192 * plugin.h (Plugin_manager): Add set_extra_library_path and
9193 extra_search_path_.
9194
a0506cca
CC
91952010-06-19 Cary Coutant <ccoutant@google.com>
9196
9197 * layout.cc (gdb_sections): Add .debug_types.
9198 (lines_only_debug_sections): Likewise.
9199
6508b958
RÁE
92002010-06-18 Rafael Espindola <espindola@google.com>
9201
9202 * plugin.cc (add_input_file,add_input_library)
9203 (Plugin_manager::add_input_file): Make filename arguments const.
9204 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
9205 const.
9206
3e235302
DK
92072010-06-16 Doug Kwan <dougkwan@google.com>
9208
9209 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
9210 .ARM.attributes section if we have not merged any input
9211 attributes sections.
9212
106e8a6c
DK
92132010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9214
9215 * arm.cc: Allow combining objects with no EABI version
9216 information.
9217
91ff43fe
RÁE
92182010-06-15 Rafael Espindola <espindola@google.com>
9219
9220 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
9221
68ed838c
ILT
92222010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9223
9224 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
9225 (struct iovec): Correct !HAVE_READV definition.
9226
f3a2388f
CC
92272010-06-10 Cary Coutant <ccoutant@google.com>
9228
9229 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
9230 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
9231 reloc sections.
9232 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
9233
9234 PR 11683
9235 * symtab.h (Symbol::is_placeholder): New member function.
9236 * target-reloc.h (relocate_section): Check for placeholder symbols.
9237
9238 * testsuite/Makefile.am (plugin_test_8): New test.
9239 (plugin_test_9): New test.
9240 * testsuite/Makefile.in: Regenerate.
9241
e1df38aa
NC
92422010-06-09 Nick Clifton <nickc@redhat.com>
9243
9244 * yyscript.y (input_list_element): Allow strings prefixed with
9245 the '-' character. Treat these as libraries.
9246 * script.cc (script_add_library): New function. Adds a library
9247 specified by "-l<name>" found in an input script.
9248 * script-c.h: Add prototype for script_add_library.
9249
25bbe950
DK
92502010-06-07 Doug Kwan <dougkwan@google.com>
9251
9252 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
9253 Restrict stub-group size to be within long conditional branch
9254 range when working around cortex-A8 erratum.
9255
0f32ea4c
ILT
92562010-06-07 Damien Diederen <dd@crosstwine.com>
9257
9258 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
9259 #ifdef typo.
9260
8fe2a369
ST
92612010-06-03 Sriraman Tallam <tmsriram@google.com>
9262
9263 PR gold/11658
9264 * output.cc
9265 (Output_section::Input_section_sort_entry::compare_section_ordering):
9266 Change to return non-zero correctly.
9267 (Output_section::Input_section_sort_section_order_index_compare
9268 ::operator()): Change to fix ambiguity in comparisons.
9269
6e9ba2ca
ST
92702010-06-01 Sriraman Tallam <tmsriram@google.com>
9271
9272 * gold.h (is_wildcard_string): New function.
9273 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
9274 (Layout::layout_eh_frame): Ditto.
9275 (Layout::find_section_order_index): New method.
9276 (Layout::read_layout_from_file): New method.
9277 * layout.h (Layout::find_section_order_index): New method.
9278 (Layout::read_layout_from_file): New method.
9279 (Layout::input_section_position_): New private member.
9280 (Layout::input_section_glob_): New private member.
9281 * main.cc (main): Call read_layout_from_file here.
9282 * options.h (--section-ordering-file): New option.
9283 * output.cc (Output_section::input_section_order_specified_): New
9284 member.
9285 (Output_section::Output_section): Initialize new member.
9286 (Output_section::add_input_section): Add new parameter.
9287 Keep input sections when --section-ordering-file is used.
9288 (Output_section::set_final_data_size): Sort input sections when
9289 section ordering file is specified.
9290 (Output_section::Input_section_sort_entry): Add new parameter.
9291 Check sorting type.
9292 (Output_section::Input_section_sort_entry::compare_section_ordering):
9293 New method.
9294 (Output_section::Input_section_sort_compare::operator()): Change to
9295 consider section_order_index.
9296 (Output_section::Input_section_sort_init_fini_compare::operator()):
9297 Change to consider section_order_index.
9298 (Output_section::Input_section_sort_section_order_index_compare
9299 ::operator()): New method.
9300 (Output_section::sort_attached_input_sections): Change to sort
9301 according to section order when specified.
e1df38aa
NC
9302 (Output_section::add_input_section<32, true>): Add new parameter.
9303 (Output_section::add_input_section<64, true>): Add new parameter.
9304 (Output_section::add_input_section<32, false>): Add new parameter.
9305 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
9306 * output.h (Output_section::add_input_section): Add new parameter.
9307 (Output_section::input_section_order_specified): New
9308 method.
9309 (Output_section::set_input_section_order_specified): New method.
9310 (Input_section::Input_section): Initialize section_order_index_.
9311 (Input_section::section_order_index): New method.
9312 (Input_section::set_section_order_index): New method.
9313 (Input_section::section_order_index_): New member.
9314 (Input_section::Input_section_sort_section_order_index_compare): New
9315 struct.
9316 (Output_section::input_section_order_specified_): New member.
9317 * script-sections.cc (is_wildcard_string): Delete and move modified
9318 method to gold.h.
9319 (Output_section_element_input::Output_section_element_input): Modify
9320 call to is_wildcard_string.
9321 (Output_section_element_input::Input_section_pattern
9322 ::Input_section_pattern): Ditto.
9323 (Output_section_element_input::Output_section_element_input): Ditto.
9324 * testsuite/Makefile.am (final_layout): New test case.
9325 * testsuite/Makefile.in: Regenerate.
9326 * testsuite/final_layout.cc: New file.
9327 * testsuite/final_layout.sh: New file.
9328
3537c84b
RÁE
93292010-06-01 Rafael Espindola <espindola@google.com>
9330
9331 * plugin.cc (Plugin::load): Pass the output name to the plugin.
9332
105b6afd
RÁE
93332010-06-01 Rafael Espindola <espindola@google.com>
9334
9335 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
9336 visibility of symbols.
9337
29e11421
DK
93382010-05-27 Doug Kwan <dougkwan@google.com>
9339
9340 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
9341 from start of output section instead of address for a local symbol
9342 in a merged or relaxed section when doing a relocatable link.
9343
5e0f337e
RÁE
93442010-05-26 Rafael Espindola <espindola@google.com>
9345
703d02da 9346 PR 11604
5e0f337e
RÁE
9347 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
9348 adding sections the garbage collector removed.
9349 * gold/testsuite/Makefile.am: Add test.
9350 * gold/testsuite/Makefile.in: Regenerate.
9351 * gold/testsuite/plugin_test_7.sh: New.
9352 * gold/testsuite/plugin_test_7_1.c: New.
9353 * gold/testsuite/plugin_test_7_2.c: New.
9354
f4187277
RÁE
93552010-05-26 Rafael Espindola <espindola@google.com>
9356
9357 * script-sections.cc (Output_section_definition::set_section_addresses):
9358 Check for --section-start.
9359
5c388529
DK
93602010-05-26 Doug Kwan <dougkwan@google.com>
9361
9362 * arm.cc (Arm_scan_relocatable_relocs): New class.
9363 (Target_arm::relocate_special_relocatable): New method.
9364 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
9365 (Arm_relocate_functions::thumb_branch_common): Same.
9366 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
9367 instead of Default_scan_relocatable_relocs.
9368 * target-reloc.h (relocate_for_relocatable): Let target handle
9369 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
9370 * target.h (Sized_target::relocate_special_relocatable): New method.
9371
bca1c3ae
ILT
93722010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9373
9374 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
9375
0439c796
DK
93762010-05-23 Doug Kwan <dougkwan@google.com>
9377
9378 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
9379 instead of a cast.
9380 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
9381 with a direct branch, not a conditional branch, to a stub.
9382 * merge.cc (Output_merge_base::record_input_section): New method
9383 defintion.
9384 (Output_merge_data::do_add_input_section): Record input section if
9385 keeps-input-sections flag is set.
9386 (Output_merge_string::do_add_input_section): Ditto.
9387 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
9388 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
9389 INPUT_SECTIONS_.
9390 (Output_merge_base::keeps_input_sections,
9391 Output_merge_base::set_keeps_input_sections,
9392 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
9393 method definitions.
9394 (Output_merge_base::Input_sections): New type declaration.
9395 (Output_merge_base::input_sections_begin,
9396 Output_merge_base::input_sections_end,
9397 Output_merge_base::do_set_keeps_input_sections): New method definitions.
9398 (Output_merge_base::bool keeps_input_sections_,
9399 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
9400 Output_merge_base::input_sections_): New data members.
9401 (Output_merge_data::do_set_keeps_input_sections): New method
9402 defintion.
9403 (Output_merge_string::do_set_keeps_input_sections): Ditto.
9404 * output.cc (Output_section::Input_section::relobj): Move method
9405 defintion from class declaration to here and handle merge sections.
9406 (Output_section::Input_section::shndx): Ditto.
9407 (Output_section::Output_section): Remove initializations of removed
9408 data members and initialize new data member LOOKUP_MAPS_.
9409 (Output_section::add_input_section): Set keeps-input-sections flag
9410 for a newly created merge output section as appropriate. Adjust code
9411 to use Output_section_lookup_maps class.
9412 (Output_section::add_relaxed_input_section): Adjst code for lookup
9413 maps code refactoring.
2e702c99 9414 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
9415 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
9416 class. If adding input section to a newly created merge output
9417 section fails, remove the new merge section.
9418 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 9419 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 9420 (Output_section::find_merge_section): Ditto.
0439c796 9421 (Output_section::build_lookup_maps): New method defintion.
2e702c99 9422 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
9423 Output_section_lookup_maps class.
9424 (Output_section::get_input_sections): Export merge sections. Adjust
9425 code to use Output_section_lookup_maps class.
9426 (Output_section:::add_script_input_section): Adjust code to use
9427 Output_section_lookup_maps class. Update lookup maps for merge
9428 sections also.
9429 (Output_section::discard_states): Use Output_section_lookup_maps.
9430 (Output_section::restore_states): Same.
9431 * output.h (Merge_section_properties): Move class defintion out of
9432 Output_section.
9433 (Output_section_lookup_maps): New class.
9434 (Output_section::Input_section::is_merge_section): New method
9435 defintion.
9436 (Output_section::Input_section::relobj): Move defintion out of class
9437 defintion. Declare method only.
9438 (Output_section::Input_section::shndx): Ditto.
9439 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 9440 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
9441 (Output_section::Merge_section_by_properties_map,
9442 Output_section::Output_section_data_by_input_section_map,
9443 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
9444 Remove types.
2e702c99 9445 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
9446 KEEPS_INPUT_SECTIONS.
9447 (Output_section::build_lookup_maps): New method declaration.
9448 (Output_section::merge_section_map_,
9449 Output_section::merge_section_by_properties_map_,
9450 Output_section::relaxed_input_section_map_,
9451 Output_section::is_relaxed_input_section_map_valid_): Remove data
9452 members.
9453 (Output_section::lookup_maps_): New data member.
9454
76295588
L
94552010-05-21 Doug Kwan <dougkwan@google.com>
9456
9457 PR gold/11619
9458 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
9459 avoid a compilation error.
9460
d103a984
RÁE
94612010-05-19 Rafael Espindola <espindola@google.com>
9462
9463 * script-sections.cc (Output_section_definition::allocate_to_segment):
9464 Update the phdrs_list even when the output section is NULL.
9465 * testsuite/Makefile.am: Add test.
9466 * testsuite/Makefile.in: Regenerate.
9467 * testsuite/script_test_9.cc: New.
9468 * testsuite/script_test_9.sh: New.
9469 * testsuite/script_test_9.t: New.
9470
6625d24e
DK
94712010-05-19 Doug Kwan <dougkwan@google.com>
9472
9473 * arm.cc (Arm_input_section::original_size): New method.
9474 (Arm_input_section::do_addralign): Add a cast.
9475 (Arm_input_section::do_output_offset): Remove static cast.
9476 (Arm_input_section::original_addralign,
9477 Arm_input_section::original_size_): Change type to uint32_t.
9478 (Arm_input_section::init): Add safe casts for section alignment
9479 and size.
9480 (Arm_input_section::set_final_data_size): Do not set address and
9481 offset of stub table.
9482 (Arm_output_section::fix_exidx_coverage): Change use of of
9483 Output_section::Simple_input_section to that of
9484 Output_section::Input_section.
9485 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
9486 except for the first pass.
9487 * output.cc (Output_section::get_input_sections): Change type of
9488 input_sections to std::list<Input_section>.
9489 (Output_section::add_script_input_section): Rename from
9490 Output_section::add_simple_input_section. Change type of SIS
9491 parameter from Simple_input_section to Input_section.
9492 * output.h (Output_section::Simple_input_section): Remove class.
9493 (Output_section::Input_section): Change class visibility to public.
9494 (Output_section::Input_section::addralign): Use stored alignments
9495 for special input sections if set.
9496 (Output_section::Input_section::set_addralign): New method.
9497 (Output_section::get_input_sections): Change parameter type from
9498 list of Simple_input_section to list of Input_section.
9499 (Output_section::add_script_input_section): Rename from
9500 Output_section::add_simple_input_section. Change first parameter's
9501 type from Simple_input_section to Input_section and remove the
9502 second and third parameters.
9503 * script-sections.cc (Input_section::Input_section_list): Change
9504 type to list of Output_section::Input_section/
9505 (Input_section_info::Input_section_info): Change parameter type of
9506 INPUT_SECTION to Output_section::Input_section.
9507 (Input_section_info::input_section): Change return type.
9508 (Input_section_info::input_section_): Change type to
9509 Output_section::Input_section.
9510 (Output_section_element_input::set_section_addresses): Adjust code
9511 to use Output_section::Input_section instead of
9512 Output_section::Simple_input_section. Adjust code for renaming
9513 of Output_section::add_simple_input_section.
9514 (Orphan_output_section::set_section_addresses): Ditto.
9515
e1e82ea4
RW
95162010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9517
9518 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
9519 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
9520
91e75c8a
RÁE
95212010-05-18 Rafael Espindola <espindola@google.com>
9522
9523 * options.cc (General_options::finalize): Handle -nostdlib.
9524 * options.h (nostdlib): New option.
9525 * script.cc (script_add_search_dir): Handle -nostdlib.
9526
da59ad79
DK
95272010-05-12 Doug Kwan <dougkwan@google.com>
9528
9529 * arm.cc (Target_arm::do_finalize_sections): Create an empty
9530 attributes section only if there no attributes section after merging.
9531 (Target_arm::merge_object_attributes): Move value of
e1df38aa 9532 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
9533 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
9534 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
9535 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
9536 and arm_attr_merge_7.stdout.
9537 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
9538 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
9539 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
9540 arm_attr_merge_7b.o): New rules.
9541 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
9542 arm_attr_merge_7
9543 * testsuite/Makefile.in: Regenerate.
9544 * testsuite/arm_attr_merge.sh: New file.
9545 * testsuite/arm_attr_merge_[67][ab].s: Same.
9546
3e01a7fd
NC
95472010-05-05 Nick Clifton <nickc@redhat.com>
9548
9549 * po/es.po: Updated Spanish translation.
9550
7ad2014a
L
95512010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9552
9553 * Makefile.am (install-exec-local): Properly install gold as
9554 default cross linker.
9555 * Makefile.in: Regenerated.
9556
4fda8867
NC
95572010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9558 Nick Clifton <nickc@redhat.com>
9559
9560 * configure.ac (install_as_default): Define and set to false
9561 unless --enable-gold or --enable-gold=both/gold has been
9562 specified.
9563 * configure: Regenerate.
9564
9565 * Makefile.am (install-exec-local): Install the executable as
9566 'ld.gold'. If install_as_default is true then also install it as
9567 'ld'.
9568 * Makefile.in: Regenerated.
9569
bd288ea2
ILT
95702010-04-24 Ian Lance Taylor <iant@google.com>
9571
9572 * layout.cc (Layout::layout_reloc): In relocatable link don't
9573 combine reloc sections for grouped sections.
9574
ef38fd8a
ST
95752010-04-23 Sriraman Tallam <tmsriram@google.com>
9576
9577 * gc.h (gc_process_relocs): Pass information on relocs pointing to
9578 sections that are not ordinary to icf.
9579 * icf.cc (get_section_contents): Handle relocation pointing to section
9580 with no object or shndx information.
9581 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
9582 * testsuite/Makefile.in: Regenerate.
9583 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
9584 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
9585
f6973bdc
ILT
95862010-04-22 Ian Lance Taylor <iant@google.com>
9587
9588 * expression.cc (Expression::Expression_eval_info): Add
9589 result_alignment_pointer field.
9590 (Expression::eval_with_dot): Add result_alignment_pointer
9591 parameter. Change all callers.
9592 (Expression::eval_maybe_dot): Likewise.
9593 (class Binary_expression): Add alignment_pointer parameter to
9594 left_value and right_value. Change all callers.
9595 (BINARY_EXPRESSION): Set result alignment.
9596 (class Trinary_expression): Add alignment_pointer parameter to
9597 arg2_value and arg3_value. Change all callers.
9598 (Trinary_cond::value): Set result alignment.
9599 (Max_expression::value, Min_expression::value): Likewise.
9600 (Align_expression::value): Likewise.
9601 * script-sections.cc (class Sections_element): Add dot_alignment
9602 parameter to set_section_addresses virtual function. Update
9603 instantiations.
9604 (class Output_section_element): Likewise.
9605 (Script_sections::create_segments): Add dot_alignment parameter.
9606 Change all callers.
9607 (Script_sections::create_segments_from_phdrs_clause): Likewise.
9608 (Script_sections::set_phdrs_clause_addresses): Likewise.
9609 * script-sections.h: Update declarations.
9610 * script.h: Update declarations.
9611 * output.h (Output_segment::set_minimum_p_align): Don't decrease
9612 min_p_align.
9613 * testsuite/script_test_3.t: Set large alignment.
9614 * testsuite/script_test_3.sh: Make sure that at least one LOAD
9615 segment has expected alignment.
9616
9c9c98a5
NC
96172010-04-22 Nick Clifton <nickc@redhat.com>
9618
9619 * po/gold.pot: Updated by the Translation project.
9620 * po/vi.po: Updated Vietnamese translation.
9621
2253bfba
L
96222010-04-22 H.J. Lu <hongjiu.lu@intel.com>
9623
9624 * testsuite/Makefile.am (check_PROGRAMS): Add
9625 icf_virtual_function_folding_test.
9626 * testsuite/Makefile.in: Regenerated.
9627
85fdf906
AH
96282010-04-15 Andrew Haley <aph@redhat.com>
9629
9630 * options.h (merge_exidx_entries): New option.
9631 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
9632 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
9633 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
9634 (Target_arm::merge_exidx_entries): New function.
9635 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
9636 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
9637 to Arm_exidx_fixup constructor.
9638 Add new arg, merge_exidx_entries.
9639 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
9640 Arm_output_section::fix_exidx_coverage.
9641
ce97fa81
ST
96422010-04-18 Sriraman Tallam <tmsriram@google.com>
9643
9644 * icf.cc (get_section_contents): Check for preemptible functions.
9645 Ignore addend when appropriate.
9646 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
9647 section folded.
9648 (add_from_relobj): Check for section folded.
9649 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
9650 * symtab.h (should_add_dynsym_entry): Add new parameter.
9651 * target-reloc.h (scan_relocs): Check for section folded.
9652 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
9653 Check reloc types for function pointers in shared objects.
9654 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
9655 case.
9656 (icf_preemptible_functions_test): New test case.
9657 (icf_string_merge_test): New test case.
9658 * testsuite.Makefile.in: Regenerate.
9659 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
9660 bar_glob. Refactor code.
9661 * testsuite/icf_preemptible_functions_test.cc: New file.
9662 * testsuite/icf_preemptible_functions_test.sh: New file.
9663 * testsuite/icf_string_merge_test.cc: New file.
9664 * testsuite/icf_string_merge_test.sh: New file.
9665 * testsuite/icf_virtual_function_folding_test.cc: New file.
9666 * testsuite/icf_virtual_function_folding_test.sh: New file.
9667
04ceb17c
DK
96682010-04-14 Doug Kwan <dougkwan@google.com>
9669
9670 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
9671 for local symbol recounting if we remove a section due to ICF.
9672 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
9673 there are no regular objects in input.
9674
153e7da4
DK
96752010-04-13 Doug Kwan <dougkwan@google.com>
9676
9677 * arm.cc (Arm_input_section::set_final_data_size): Compute
9678 accurate final data size instead of using current data size.
9679
4dbd9faf
DK
96802010-04-09 Doug Kwan <dougkwan@google.com>
9681
9682 * layout.cc (Layout::choose_output_section): Handle script section
9683 types.
9684 (Layout::make_output_section_for_script): Add section type parameter.
9685 Handle script section types.
9686 * layout.h (Layout::make_output_section_for_script): Add section
9687 type parameter.
9688 * output.cc (Output_section::Output_section): Initialize data member
9689 is_noload_.
9690 (Output_section::do_reset_address_and_file_offset): Do not set address
9691 to 0 if section is a NOLOAD section.
9692 * output.h (Output_section::is_noload): New method.
9693 (Output_section::set_is_noload): Ditto.
9694 (Output_section::is_noload_): New data member.
9695 * script-c.h (Script_section_type): New enum type.
9696 (struct Parser_output_section_header): Add new file section_type.
9697 * script-sections.cc (Sections_element::output_section_name): Add
9698 parameter for returning script section type.
9699 (Output_section_definition::output_section_name): Ditto.
9700 (Output_section_definition::section_type)P; New method.
9701 (Output_section_definiton::script_section_type_name): Ditto.
9702 (Output_section_definition::script_section_type_): New data member.
9703 (Output_section_definition::Output_section_definition): Initialize
9704 data member Output_section_definition::script_section_type_.
9705 (Output_section_definition::create_sections): Pass script section type
9706 to Layout::make_output_section_for_script.
9707 (Output_section_definition::output_section_name): Return script
9708 section type to caller.
9709 (Output_section_definition::set_section_address): Do not advance
9710 dot value and load address if section type is NOLOAD. Set address
9711 of NOLOAD sections regardless of section flags.
9712 (Output_section_definition::print): Print section type if it is
9713 not SCRIPT_SECTION_TYPE_NONE.
9714 (Output_section_definition::section_type): New method.
9715 (Output_section_definition::script_section_type_name): Ditto.
9716 (Script_sections::output_section_name): Add new parameter
9717 PSECTION_TYPE for returning script section type. Pass it to
9718 section elements. Handle discard sections.
9719 (Sort_output_sections::operator()): Handle NOLOAD sections.
9720 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 9721 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
9722 returning script section type.
9723 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
9724 INFO and NOLOAD.
9725 * yyscript.y (union): Add new field SECTION_TYPE.
9726 (COPY, DSECT, INFO, NOLOAD): New tokens.
9727 (opt_address_and_section_type): Change type to output_section_header.
9728 (section_type): New non-terminal
9729 (section_header): Handle section type.
2253bfba 9730 (opt_address_and_section_type): Return section type value.
4dbd9faf 9731
721ea635
L
97322010-04-09 H.J. Lu <hongjiu.lu@intel.com>
9733
9734 * testsuite/plugin_common_test_1.c (foo): Add prototype.
9735 * testsuite/plugin_common_test_2.c (foo): Likewise.
9736
6bf924b0
DK
97372010-04-08 Doug Kwan <dougkwan@google.com>
9738
9739 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
9740 Output_merge_data.
9741 * output.cc (Output_section::add_merge_input_section): Simplify
9742 code and return status of Output_merge_base::add_input_section.
e1df38aa 9743 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
9744 returns true.
9745
24af6f92
DK
97462010-04-07 Doug Kwan <dougkwan@google.com>
9747
9748 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
9749 if section is marked as containing instructions but has no mapping
9750 symbols.
9751 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
9752 correct section index.
9753 (Arm_relobj::find_linked_text_section): Ditto.
9754
00698fc5
CC
97552010-04-07 Cary Coutant <ccoutant@google.com>
9756
9757 * archive.cc (include_member): Destroy Read_symbols_data object before
9758 releasing file.
9759 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
9760 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
9761 (Read_symbols_data::~Read_symbols_data) New destructor.
9762 (Section_relocs::Section_relocs) New constructor.
9763 (Section_relocs::~Section_relocs) New destructor.
9764 (Read_relocs_data::Read_relocs_data) New constructor.
9765 (Read_relocs_data::~Read_relocs_data) New destructor.
9766 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
9767 pointers to NULL after deleting.
9768
7296d933
DK
97692010-04-07 Doug Kwan <dougkwan@google.com>
9770
9771 * arm.cc: Replace "endianity" with "endianness" in comments.
9772 (Arm_exidx_cantunwind): Ditto.
9773 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
9774 (Arm_relobj::merge_flags_and_attributes): New method.
9775 (Arm_relobj::merge_flags_and_attributes_): New data member.
9776 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
9777 (Arm_relobj::scan_sections_for_stubs): Ditto.
9778 (Arm_relobj::do_read_symbols): Check to see if we really want to
9779 merge processor-specific flags and attributes. Exit early if
9780 an object is empty except for section names and the undefined symbol.
9781 (Target_arm::do_finalize_sections): Move check for ELF format to
9782 Arm_relobj::do_read_symbols. Merge processor specific flags and
9783 attributes from a regular object only when we have determined that
9784 it is aapropriate. Do not create an .ARM.attributes section in
9785 output if there is no regular input object.
9786 (Target_arm::merge_processor_specific_flags): Check
9787 --warn-mismatch before printing any error.
9788 (Target_arm::merge_object_attributes): Ditto.
9789 * gold.cc (queue_middle_tasks): Handle the case in which there is
9790 no regular object in input.
9791 * options.cc (General_options::parse_EB): New method.
9792 (General_options::parse_EL): Same.
9793 (General_options::General_options): Initialize endianness_.
9794 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
9795 New options.
9796 (General_options::Endianness): New enum.
9797 (General_options::endianness): New method.
9798 (General_options::endianness_): New data member.
9799 * parameters.cc (Parameters::set_options): Check target endianness.
9800 (Parameters::set_target_once): Ditto.
9801 (Parameters::check_target_endianness): New method.
9802 (parameters_force_valid_target): If either -EL or -EB is specified,
9803 use it to define endianness of default target.
9804 * parameters.h (Parameters::check_target_endianness): New method
9805 declaration.
9806 * target.h (class Target): Change "endianity" to "endianness"
9807 in comments.
9808
efc8d4f2
RW
98092010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9810
9811 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
9812 * configure: Regenerate.
9813 * Makefile.in: Regenerate.
9814 * testsuite/Makefile.in: Regenerate.
9815
be234d88
CC
98162010-04-06 Cary Coutant <ccoutant@google.com>
9817
9818 gcc PR lto/42757
9819 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
9820 prevailing definitions of common symbols.
9821 * testsuite/plugin_test_6.sh: New test case.
9822 * testsuite/plugin_common_test_1.c: New test case.
9823 * testsuite/plugin_common_test_2.c: New test case.
9824 * testsuite/Makefile.am (plugin_test_6): New test case.
9825 * testsuite/Makefile.in: Regenerate.
9826
bd32c6bd
NC
98272010-04-06 Nick Clifton <nickc@redhat.com>
9828
9829 * po/vi.po: New Vietnamese translation.
9830
323c532f
DK
98312010-03-30 Doug Kwan <dougkwan@google.com>
9832
9833 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
9834
4fcd97eb
DK
98352010-03-25 Doug Kwan <dougkwan@google.com>
9836
9837 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
9838 to avoid a conversion warning on a 32-bit host.
9839
4ebf39db
ILT
98402010-03-24 Ian Lance Taylor <iant@google.com>
9841
9842 * testsuite/script_test_3.t: Add a TLS segment.
9843 * testsuite/Makefile.am (check_PROGRAMS): Add
9844 tls_phdrs_script_test.
9845 (tls_phdrs_script_test_SOURCES): Define.
9846 (tls_phdrs_script_test_DEPENDENCIES): Define.
9847 (tls_phdrs_script_test_LDFLAGS): Define.
9848 (tls_phdrs_script_test_LDADD): Define.
9849 * testsuite/Makefile.in: Rebuild.
9850
4a599bdd
CC
98512010-03-23 Cary Coutant <ccoutant@google.com>
9852
9853 * fileread.cc (find_or_make_view): Fix comment.
9854
6c93b22c
ILT
98552010-03-23 Ian Lance Taylor <iant@google.com>
9856
9857 * script-sections.cc (class Orphan_section_placement): Define
9858 PLACE_TLS and PLACE_TLS_BSS.
9859 (Orphan_section_placement::Orphan_section_placement): Initialize
9860 new places.
9861 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
9862 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
9863 (tls_script_test_SOURCES): Define.
9864 (tls_script_test_DEPENDENCIES): Define.
9865 (tls_script_test_LDFLAGS): Define.
9866 (tls_script_test_LDADD): Define.
9867 * testsuite/Makefile.in: Rebuild.
9868
a2c7281b
DK
98692010-03-22 Doug Kwan <dougkwan@google.com>
9870
9871 * arm.cc (Arm_relocate_functions::abs8,
9872 Arm_relocate_functions::abs16): Use correct check for overflow
9873 specified in the ARM ELF specs.
9874 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
9875 target of a BLX instruction specially.
9876 (Reloc_stub::stub_type_for_reloc): Ditto.
9877 (Relocate::relocate): Use symbolic names instead of numeric relocation
9878 codes to report error.
9879 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
9880 workaround.
9881 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
9882 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
9883 thumb2_blx_out_of_range.stdout
9884 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
9885 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
9886 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
9887 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
9888 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
9889 thumb2_blx_in_range, thumb2_blx_in_range.o,
9890 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
9891 thumb2_blx_out_of_range.o): New rules.
2e702c99 9892 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
9893 thumb2_blx_in_range and thumb2_blx_out_of_range.
9894 * testsuite/Makefile.in: Regenerate.
9895 * arm_branch_in_range.sh: Add tests for THUMB BLX.
9896 * testsuite/thumb_blx_in_range.s: New file.
9897 * testsuite/thumb_blx_out_of_range.s: New file.
9898
b0193076
RÁE
98992010-03-22 Rafael Espindola <espindola@google.com>
9900
9901 * archive.cc (Should_include): Move to archive.h.
9902 (should_include_member): Make it a member of Archive.
9903 (Lib_group): New.
9904 (Add_lib_group_symbols): New.
9905 * archive.h: Include options.h.
9906 (Archive_member): Moved from Archive.
9907 (Should_include): Moved from archive.cc.
9908 (Lib_group): New.
9909 (Add_lib_group_symbols): New.
9910 * dynobj.cc (do_should_include_member): New.
9911 * dynobj.h (do_should_include_member): New.
9912 * gold.cc (queue_initial_tasks): Update call to queue.
9913 * main.cc (main): Print lib group stats.
9914 * object.cc (do_should_include_member): New.
9915 * object.h: Include archive.h.
9916 (Object::should_include_member): New.
9917 (Object::do_should_include_member): New.
9918 (Sized_relobj::do_should_include_member): New.
9919 * options.cc (General_options::parse_start_lib): New.
9920 (General_options::parse_end_lib): New.
9921 (Input_arguments::add_file): Handle lib groups.
9922 (Input_arguments::start_group): Check we are not in a lib.
9923 (Input_arguments::start_lib): New.
9924 (Input_arguments::end_lib): New.
9925 * options.h (General_options): Add start_lib and end_lib.
9926 (Input_argument::lib_): New.
9927 (Input_argument::lib): New.
9928 (Input_argument::is_lib): New.
9929 (Input_file_lib): New.
9930 (Input_arguments::in_lib_): New.
9931 (Input_arguments::in_lib): New.
9932 (Input_arguments::start_lib): New.
9933 (Input_arguments::end_lib_): New.
9934 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
9935 in unused members as preempted.
9936 (Sized_pluginobj::do_should_include_member): New.
9937 * plugin.h (Sized_pluginobj::do_should_include_member): New.
9938 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
9939 return the blocker.
9940 (Read_symbols::do_whole_lib_group): New.
9941 (Read_symbols::do_lib_group): New.
9942 (Read_symbols::do_read_symbols): Handle lib groups.
9943 (Read_symbols::get_name): Handle lib groups.
9944 * readsyms.h (Read_symbols): Add an archive member pointer.
9945 (Read_symbols::do_whole_lib_group): New.
9946 (Read_symbols::do_lib_group): New.
9947 (Read_symbols::member_): New.
9948 * script.cc (read_input_script): Update call to queue_soon.
9949
d099120c
DK
99502010-03-19 Doug Kwan <dougkwan@google.com>
9951
9952 * arm.cc (Stub_table::Stub_table): Initialize new data members
9953 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9954 (Stub_table::add_reloc_stub): Assign stub offset and update
9955 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9956 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
9957 New data members.
2e702c99 9958 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
9959 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
9960 instead of going over all reloc stubs.
2e702c99 9961 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
9962 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9963 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 9964 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
9965 Stringpool_template::offset_.
9966 * stringpool.h (Stringpool_template::set_no_zero_null): Set
9967 Stringpool_template::offset_ to zero.
9968
1aa37384
DK
99692010-03-15 Doug Kwan <dougkwan@google.com>
9970
9971 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9972 offset_.
9973 (Stringpool_template::new_key_offset): New method.
9974 (Stringpool_template::add_string): Assign offsets when adding new
9975 strings.
9976 (Stringpool_template::set_string_offsets): Do not set string offsets
9977 when not optimizing.
9978 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
9979 member size_.
2e702c99
RM
9980 (Chunked_vector::clear): Clear size_.
9981 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
9982 (Chunked_vector::size): Return size_.
9983 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 9984 (Chunked_vector::size_): New data member.
1aa37384
DK
9985 (Stringpool_template::set_no_zero_null): Assert string set is empty.
9986 (Stringpool_template::new_key_offset): New method declaration.
9987 (Stringpool_template::offset_): New data member.
9988
b672b057
RÁE
99892010-03-15 Rafael Espindola <espindola@google.com>
9990
9991 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
9992 Add_symbols' constructor.
9993 * readsyms.h (Add_symbols): Remove the input_group member.
9994
b6848d3c
ILT
99952010-03-10 Ian Lance Taylor <iant@google.com>
9996
9997 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
9998 target to ask whether a reference to a symbol requires a stack
9999 split.
10000 * target.h (Target::is_call_to_non_split): New function.
10001 (Target::do_is_call_to_non_split): Declare virtual function.
10002 * target.cc: Include "symtab.h".
10003 (Target::do_is_call_to_non_split): New function.
10004 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
10005
a2a5469e
CC
100062010-03-10 Cary Coutant <ccoutant@google.com>
10007
10008 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
10009 (File_read::open[1]): Remove initial mapping of whole_file_view_.
10010 (File_read::open[2]): Add whole_file_view_ to list of views.
10011 (File_read::make_view): Remove test of whole_file_view_.
10012 (File_read::find_or_make_view): Create whole_file_view_ if
10013 necessary.
10014 (File_read::clear_views): Replace bool parameter with enum;
10015 adjust all callers. Don't delete views with permanent data;
10016 do delete cached views and views from archives if
10017 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
10018 if clearing the corresponding view.
10019 * fileread.h (File_read::Clear_views_mode): New enum.
10020 (File_read::View::is_permanent_view): New method.
10021 (File_read::clear_views): Replace bool parameter
10022 with enum; adjust all callers.
10023 * options.h (General_options): Change keep_files_mapped option;
10024 add map_whole_files.
10025 * readsyms.cc (Add_symbols::run): Delete sd_ object before
10026 releasing the file.
10027 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
10028 the file.
10029
8861f32b
DM
100302010-03-10 David S. Miller <davem@davemloft.net>
10031
10032 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
10033
d62d0f5f
ST
100342010-03-09 Sriraman Tallam <tmsriram@google.com>
10035
10036 * icf.cc (get_section_contents): Add '@' marker after processing the
10037 merge reloc.
10038
9177756d
DK
100392010-03-08 Doug Kwan <dougkwan@google.com>
10040
10041 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
10042 due to a conversion warning.
10043 (Arm_relobj::update_output_local_symbol_count): Check for local
10044 symbol with unset output index.
10045
9e9e071b
ILT
100462010-03-05 Ian Lance Taylor <iant@google.com>
10047
10048 * options.h (class General_options): Add --spare-dynamic-tags.
10049 * output.cc (Output_data_dynamic::set_final_data_size): Implement
10050 --spare-dynamic-tags.
10051
a81ee015
ILT
100522010-03-05 Ian Lance Taylor <iant@google.com>
10053
10054 * incremental.cc: Include "libiberty.h".
10055
44ec90b9
RO
100562010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
10057
10058 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
10059 function, is_info_ member.
10060 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
10061 (Versions::Versions): Update caller.
10062 (Versions::define_base_version): Likewise.
10063 (Versions::add_def): Likewise.
10064
0897ed3b
ST
100652010-03-03 Sriraman Tallam <tmsriram@google.com>
10066
10067 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
10068 (Scan::possible_function_pointer_reloc): New function.
10069 (Scan::local_reloc_may_be_function_pointer): Change to call
10070 possible_function_pointer_reloc.
10071 (Scan::global_reloc_may_be_function_pointer): Ditto.
10072 * icf.h (Icf::check_section_for_function_pointers): Change to reject
10073 relocations in ".data.rel.ro._ZTV" section.
10074 * testsuite/icf_safe_so_test.sh: Change to pass i386.
10075 * testsuite/icf_safe_so_test.cc: Ditto.
10076 * testsuite/icf_safe_test.cc: Ditto.
10077 * testsuite/icf_safe_test.sh: Ditto.
10078
d3bbad62
ILT
100792010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10080 Ian Lance Taylor <iant@google.com>
10081
10082 * target-reloc.h (relocate_section): Check the symbol table index
10083 for -1U before setting the local symbol index.
10084 (scan_relocatable_relocs): If copying the relocation, record that
10085 the local symbol is required.
10086 * object.h (Symbol_value::is_output_symtab_index_set): New
10087 function.
10088 (Symbol_value::may_be_discarded_from_output_symtab): New
10089 function.
10090 (Symbol_value::has_output_symtab_entry): New function.
10091 (Symbol_value::needs_output_symtab_entry): Remove.
10092 (Symbol_value::output_symtab_index): Make sure the symbol index is
10093 set.
10094 (Symbol_value::set_output_symtab_index): Make sure the symbol
10095 index is not set. Make sure the new index is valid.
10096 (Symbol_value::set_must_have_output_symtab_entry): New function.
10097 (Symbol_value::has_output_dynsym_entry): New function.
10098 (Symbol_value::set_output_dynsym_index): Make sure the new index
10099 is valid.
10100 (Sized_relobj::set_must_have_output_symtab_entry): New function.
10101 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
10102 local symbol if permitted.
10103 (Sized_relobj::do_finalize_local_symbols): Call
10104 is_output_symtab_index_set rather than needs_output_symtab_entry.
10105 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
10106 rather than needs_output_symtab_entry. Call
10107 has_output_dynsym_entry rather than needs_output_dynsym_entry.
10108 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
10109 is_output_symtab_index_set rather than needs_output_symtab_entry.
10110 * testsuite/discard_locals_relocatable_test.c: New file.
10111 * testsuite/discard_locals_test.sh: Test -r.
10112 * testsuite/Makefile.am (check_DATA): Add
10113 discard_locals_relocatable_test1.syms,
10114 discard_local_relocatable_test2.syms.
10115 (MOSTLYCLEANFILES): Likewise. Also add
10116 discard_locals_relocatable_test1.lout and
10117 discard_locals_relocatable_test2.out.
10118 (discard_locals_relocatable_test1.syms): New target.
10119 (discard_locals_relocatable_test.o): New target.
10120 (discard_locals_relocatable_test1.out): New target.
10121 (discard_locals_relocatable_test2.syms): New target.
10122 (discard_locals_relocatable_test2.out): New target.
10123 (various): Add missing ../ld-new dependencies.
10124 * testsuite/Makefile.in: Rebuild.
10125
7e8ccf26
NC
101262010-03-03 Nick Clifton <nickc@redhat.com>
10127
10128 * po/fi.po: New Finnish translation.
10129
2a0ff005
DK
101302010-03-01 Doug Kwan <dougkwan@google.com>
10131
10132 * layout.cc (Layout::Layout): Force section types of .init_array*,
10133 .preinit_array* and .fini_array* sections.
10134 * output.cc (Output_section::Input_section_sort_entry::has_priority):
10135 Fix check of return value of std::string::find.().
10136 (Output_section::Input_section_sort_compare::operator()): Remove
10137 comment about .init_array.
10138 (Output_section::Input_section_sort_init_fini_compare::operator()):
10139 New method.
10140 (Output_section::sort_attached_input_sections): Handle .init_array
10141 and .fini_array specially.
10142 * output.h (Output_section::Inut_section_sort_compare): Update
10143 comment.
10144 (Output_section::Input_section_sort_init_fini_compare): New struct.
10145
c3e4ae29
DK
101462010-02-26 Doug Kwan <dougkwan@google.com>
10147
10148 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
10149 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
10150 * testsuite/debug_msg.sh: Avoid matching source line number for
10151 use of global variable undef_int.
10152
2fd9ae7a
DK
101532010-02-26 Doug Kwan <dougkwan@google.com>
10154
10155 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
10156 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
10157 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
10158 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
10159 * options.cc (General_options::General_options): Initialize member
10160 fix_v4bx_.
10161 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
10162 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
10163 and rm_no_fix_v4bx.stdout
10164 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
10165 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
10166 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
10167 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
10168 and arm_no_fix_v4bx.
10169 * Makefile.in: Regenerate.
10170 * testsuite/arm_fix_v4bx.s: New file.
10171 * testsuite/arm_fix_v4bx.sh: Ditto.
10172
67ec7d0b
DK
101732010-02-24 Doug Kwan <dougkwan@google.com>
10174
10175 * arm.cc (Target_arm::got_section): Make the .got section the first
10176 non RELRO section in the data segment.
10177 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
10178 suffixes of section names.
10179
10165461
DK
101802010-02-24 Doug Kwan <dougkwan@google.com>
10181
10182 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
10183 flags and attributes merging if an input file is a binary file.
10184 * fileread.cc (Input_file::open): Record format of original file.
10185 * fileread.h (Input_file::Format): New enum type.
2e702c99 10186 (Input_file::Input_file): Initialize data member format_.
10165461
DK
10187 (Input_file::format): New method definition.
10188 (Input_file::format_):: New data member.
10189
4a54abbb
DK
101902010-02-24 Doug Kwan <dougkwan@google.com>
10191
10192 * arm.cc (Arm_output_data_got): New class.
10193 (ARM_TCB_SIZE): New constant
10194 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
10195 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
10196 If user uses a script with a SECTIONS clause, issue only a warning
10197 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 10198 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
10199 garbage collection.
10200 (Target_arm::got_mode_index_entry): Handle static linking.
10201 (Target_arm::Scan::local): Ditto.
10202 (Target_arm::Scan::global): Ditto.
10203 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
10204 all incorrectly implemented relocations.
e1df38aa 10205 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
10206 Arm_output_section::fix_exidx_coverage.
10207 * layout.cc (Layout::section_name_mapping): Remove trailing dots
10208 from ".ARM.exidx." and ".ARM.extab.".
10209
ca419a6f
ILT
102102010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10211
10212 * arm.cc (Target_arm::do_finalize_sections): Create attribute
10213 section if it does not already exist.
10214 * attributes.cc (Attributes_section_data::Attributes_section_data):
10215 Don't crash if size is zero.
10216
135b9c78
ILT
102172010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10218 Ian Lance Taylor <iant@google.com>
10219
10220 * gold.cc (queue_middle_tasks): If no input files were opened,
10221 exit.
10222 * workqueue.h (Task_function::Task_function): Assert that there is
10223 a blocker.
10224
bb0bfe4f
DK
102252010-02-22 Doug Kwan <dougkwan@google.com>
10226
10227 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
10228 * icf.cc (get_section_contents): Cast snprintf arguments to long long
10229 types to avoid warnings due to different uint64_t implementations
10230 on different hosts.
10231
2a2b6d42
DK
102322010-02-21 Doug Kwan <dougkwan@google.com>
10233
10234 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
10235 handling of the maximum backward branch offset.
2e702c99 10236 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
10237 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
10238 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 10239 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
10240 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
10241 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
10242 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
10243 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
10244 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
10245 thumb_bl_out_of_range thumb_bl_out_of_range.o,
10246 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
10247 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
10248 thumb2_bl_out_of_range.o): New rules.
10249 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
10250 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
10251 thumb2_bl_out_of_range
10252 * testsuite/Makefile.in: Regenerate.
10253 * testsuite/arm_bl_in_range.s: New file.
10254 * testsuite/arm_bl_out_of_range.s: Ditto.
10255 * testsuite/arm_branch_in_range.sh: Ditto.
10256 * testsuite/arm_branch_range.t: Ditto.
10257 * testsuite/thumb2_branch_range.t: Ditto.
10258 * testsuite/thumb_bl_in_range.s: Ditto.
10259 * testsuite/thumb_bl_out_of_range.s: Ditto.
10260 * testsuite/thumb_branch_range.t: Ditto.
10261
b487ad64
ST
102622010-02-20 Sriraman Tallam <tmsriram@google.com>
10263
10264 * gc.h (gc_process_relocs): Change vectors to point to the new list.
10265 Add reloc offset information.
10266 * icf.cc (get_section_contents): Change iterators to point to the new
10267 vectors. Add reloc offset information to the contents.
10268 * icf.h (Icf::Sections_reachable_info): New typedef.
10269 (Icf::Sections_reachable_list): New typedef.
10270 (Icf::Offset_info): New typedef.
10271 (Icf::Reloc_info): New struct typedef.
10272 (Icf::Reloc_info_list): New typedef.
10273 (Icf::symbol_reloc_list): Delete method.
10274 (Icf::addend_reloc_list): Delete method.
10275 (Icf::section_reloc_list): Delete method.
10276 (Icf::reloc_info_list): New method.
10277 (Icf::reloc_info_list_): New member.
10278
f96accdf
DK
102792010-02-19 Doug Kwan <dougkwan@google.com>
10280
10281 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
10282 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
10283 * arm.cc (Arm_relocation_functions): New forward declaration.
10284 (Target_arm::Target_arm): Initialize new data members
10285 got_mod_index_offset_ and tls_base_symbol_defined_.
10286 (Target_arm::Relocate::relocate_tls): New method.
10287 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
10288 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
10289 New methods.
2e702c99 10290 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
10291 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
10292 (Target_arm::got_mod_index_offset_,
10293 Target_arm::tls_base_symbol_defined_): New data members.
10294 (Target_arm::Scan::local, Target::Scan::global,
10295 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
10296 relocations.
10297
c8761b9a
DK
102982010-02-18 Doug Kwan <dougkwan@google.com>
10299
10300 * arm.cc (Arm_relobj::find_linked_text_section): New method.
10301 (Arm_relobj::make_exidx_input_section): Pass section index of linked
10302 text section as a parameter becuase some broken tools may not set
10303 the link in section header.
10304 (Target_arm::has_got_section): New method.
10305 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
10306 without any mapping symbol as data only. Remove warning.
10307 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
10308 link in its section header, try to discover the link by inspecting the
10309 REL31 relocation at the beginning of the section.
10310 (Target_arm::Scan::check_non_pic): Report name of offending relocation
10311 in error message.
10312 (Target_arm::Scan::global): Treat any reference to the symbol
10313 _GLOBAL_OFFSET_TABLE_ as a GOT access.
10314
21bb3914
ST
103152010-02-12 Sriraman Tallam <tmsriram@google.com>
10316
10317 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
10318 (Scan::global_reloc_may_be_function_pointer): New function.
10319 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10320 (Scan::global_reloc_may_be_function_pointer): New function.
10321 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10322 (Scan::global_reloc_may_be_function_pointer): New function.
10323 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
10324 (Scan::global_reloc_may_be_function_pointer): New function.
10325 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
10326 (Scan::global_reloc_may_be_function_pointer): New function.
10327 (Scan::possible_function_pointer_reloc): New function.
10328 (Target_x86_64::can_check_for_function_pointers): New function.
10329 * gc.h (gc_process_relocs): Scan relocation types to determine if
10330 function pointers were taken for targets that support it.
10331 * icf.cc (Icf::find_identical_sections): Include functions for
10332 folding in safe ICF whose pointer is not taken.
10333 * icf.h (Secn_fptr_taken_set): New typedef.
10334 (fptr_section_id_): New member.
10335 (section_has_function_pointers): New function.
10336 (set_section_has_function_pointers): New function.
10337 (check_section_for_function_pointers): New function.
10338 * options.h: Fix comment for safe ICF option.
10339 * target.h (can_check_for_function_pointers): New function.
10340 * testsuite/Makefile.am: Add icf_safe_so_test test case.
10341 Modify icf_safe_test for X86-64.
10342 * testsuite/Makefile.in: Regenerate.
10343 * testsuite/icf_safe_so_test.cc: New file.
10344 * testsuite/icf_safe_so_test.sh: New file.
10345 * testsuite/icf_safe_test.cc (kept_func_3): New function.
10346 (main): Change to take pointer to function kept_func_3.
10347 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
10348 folding is done correctly for X86-64.
10349
0da6fa6c
DM
103502010-02-12 David S. Miller <davem@davemloft.net>
10351
10352 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
10353 is_symbolless parameter.
10354 (Output_reloc<SHT_REL>::is_symbolless): New.
10355 (Output_reloc<SHT_REL>::is_symbolless_): New.
10356 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
10357 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
10358 (Output_reloc<SHT_RELA>::is_symbolless): New.
10359 (Output_data_reloc::add_global): Handle is_symbolless.
10360 (Output_data_reloc::add_global_relative): Likewise.
10361 (Output_data_reloc::add_local): Likewise.
10362 (Output_data_reloc::add_local_relative): Likewise.
10363 (Output_data_reloc::add_symbolless_global_addend): New.
10364 (Output_data_reloc::add_symbolless_local_addend): New.
10365 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
10366 is_symbolless.
10367 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
10368 instead of ->is_relative_
10369 (Output_reloc::write): Likewise.
10370 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
10371 (Output_reloc::write_rel): Simplify.
10372
10373 * sparc.cc (Target_sparc::Scan::local): Use
10374 ->add_symbolless_local_addend as needed.
10375 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
10376 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
10377 based upon relocation offset.
10378
e4782e83
DK
103792010-02-11 Doug Kwan <dougkwan@google.com>
10380
10381 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
10382 (Target_arm::Scan::global): Ditto. Also remove a comment before the
10383 beginning of function.
10384 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
10385 and MOVT_ABS relocations. Those are non issued in scanning. Fix
10386 parameter is_32bit in calls to should_apply_static_reloc.
10387 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
10388 (check_DATA): Add arm_abs_global.stdout.
10389 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
10390 arm_abs_global.stdout): New rules.
10391 (MOSTLLYCLEANFILES): Add arm_abs_global
10392 * Makefile.in: Regenerate.
10393 * testsuite/arm_abs_global.s: New file.
10394 * testsuite/arm_abs_global.sh: Ditto.
10395 * testsuite/arm_abs_lib.s: Ditto.
10396
93ceb764
ILT
103972010-02-11 Ian Lance Taylor <iant@google.com>
10398
10399 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
10400 Read_relocs task.
10401 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
10402 Allocate_commons_task first.
10403 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
10404 task, rather than symtab_lock_.
10405 (Gc_process_relocs::~Gc_process_relocs): New function.
10406 (Gc_process_relocs::is_runnable): Check this_blocker_.
10407 (Gc_process_relocs::locks): Use next_blocker_ rather than
10408 blocker_.
10409 (Scan_relocs::~Scan_relocs): New function.
10410 (Scan_relocs::is_runnable): Check this_blocker_ rather than
10411 symtab_lock_.
10412 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
10413 next_blocker_.
10414 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
10415 fields. Add this_blocker_ and next_blocker_ fields. Adjust
10416 constructor accordingly.
10417 (class Gc_process_relocs): Likewise.
10418 (class Scan_relocs): Likewise.
10419 * common.h (class Allocate_commons_task): Remove symtab_lock_
10420 field, and corresponding constructor parameter.
10421 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
10422 symtab_lock_.
10423 (Allocate_commons_task::locks): Likewise.
10424
114dfbe1
ILT
104252010-02-11 Ian Lance Taylor <iant@google.com>
10426
10427 * gold-threads.h (class Once): Define.
10428 (class Initialize_lock): Rewrite as child of Once.
10429 * gold-threads.cc (class Once_initialize): Define.
10430 (once_pointer_control): New static variable.
10431 (once_pointer, once_arg): New static variables.
10432 (c_run_once): New static function.
10433 (Once::Once, Once::run_once, Once::internal_run): New functions.
10434 (class Initialize_lock_once): Remove.
10435 (initialize_lock_control): Remove.
10436 (initialize_lock_pointer): Remove.
10437 (initialize_lock_once): Remove.
10438 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
10439 (Initialize_lock::initialize): Rewrite.
10440 (Initialize_lock::do_run_once): New function.
10441 * archive.cc (Archive::interpret_header): Only clear name if it is
10442 not already empty.
10443 * fileread.cc: Include "gold-threads.h"
10444 (file_counts_lock): New static variable.
10445 (file_counts_initialize_lock): Likewise.
10446 (File_read::release): Only increment counts when using --stats.
10447 Use a lock around the increment.
10448 * parameters.cc (class Set_parameters_target_once): Define.
10449 (set_parameters_target_once): New static variable.
10450 (Parameters::Parameters): Move here from parameters.h.
10451 (Parameters::set_target): Rewrite.
10452 (Parameters::set_target_once): New function.
10453 (Parameters::clear_target): Move here and rewrite.
10454 * parameters.h (class Parameters): Update declarations. Add
10455 set_parameters_target_once_ field.
10456 (Parameters::Parameters): Move to parameters.cc.
10457 (Parameters::clear_target): Likewise.
10458 * readsyms.cc (Read_symbols::do_group): Create a Start_group
10459 task.
10460 (Start_group::~Start_group): New function.
10461 (Start_group::is_runnable): New function.
10462 (Start_group::locks, Start_group::run): New functions.
10463 (Finish_group::run): Change saw_undefined to size_t.
10464 * readsyms.h (class Start_group): Define.
10465 (class Finish_group): Change saw_undefined_ field to size_t.
10466 (Finish_group::Finish_group): Remove saw_undefined and
10467 this_blocker parameters. Change all callers.
10468 (Finish_group::set_saw_undefined): New function.
10469 (Finish_group::set_blocker): New function.
10470 * symtab.h (class Symbol_table): Change saw_undefined to return
10471 size_t. Change saw_undefined_ field to size_t.
10472 * target-select.cc (Set_target_once::do_run_once): New function.
10473 (Target_selector::Target_selector): Initialize set_target_once_
10474 field. Don't initialize lock_ and initialize_lock_ fields.
10475 (Target_selector::instantiate_target): Rewrite.
10476 (Target_selector::set_target): New function.
10477 * target-select.h (class Set_target_once): Define.
10478 (class Target_selector): Update declarations. Make
10479 Set_target_once a friend. Remove lock_ and initialize_lock_
10480 fields. Add set_target_once_ field.
10481
fa17a3f4
ILT
104822010-02-10 Ian Lance Taylor <iant@google.com>
10483
10484 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
10485 queueing any tasks.
10486 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
10487 (queue_middle_tasks): Add all blockers before queueing any tasks.
10488 (queue_final_tasks): Likewise.
10489 * token.h (Task_token::add_blockers): New function.
10490 * object.h (Input_objects::number_of_relobjs): New function.
10491
c7177d31
ILT
104922010-02-10 Ian Lance Taylor <iant@google.com>
10493
5de0e392
ILT
10494 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
10495 shared, not if not position independent.
10496 * x86_64.cc (Relocate::relocate_tls): Likewise.
10497 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
10498 (tls_pie_pic_test): New target.
10499 * testsuite/Makefile.in: Rebuild.
10500
c7177d31
ILT
10501 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
10502 (tls_test_main_pie.o, tls_test_pie.o): New targets.
10503 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
10504 * testsuite/Makefile.in: Rebuild.
10505
684b268a
DM
105062010-02-09 David S. Miller <davem@davemloft.net>
10507
10508 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
10509 R_SPARC_RELATIVE using ->add_local_relative().
10510 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
10511
612a8d3d
DM
10512 * output.h (Output_data_dynamic::add_section_size): New method
10513 that takes two Output_data objects.
10514 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
10515 entry param. Handle it in initializers.
10516 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
10517 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
10518 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
10519 arg.
10520 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
10521 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
10522 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
10523 for dynrel_includes_plt.
10524 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10525 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10526 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
10527 before .rela.plt
10528 (Target_sparc::do_finalize_sections): Update to pass true for
10529 dynrel_includes_plt.
10530 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
10531 output before .rela.plt
10532 (Target_powerpc::do_finalize_sections): Update to pass true for
10533 dynrel_includes_plt when 32-bit.
10534
cb1be87e
DK
105352010-02-08 Doug Kwan <dougkwan@google.com>
10536
10537 * arm.cc (Arm_relobj::simple_input_section_output_address): New
10538 method.
10539 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
10540 Arm_relobj::scan_section_for_cortex_a8_stubs,
10541 Arm_relobj::do_relocation_section): Instead of calling
10542 Output_section::output_address, use faster
10543 Arm_relobj::simple_input_section_output_address.
10544
705b5121
DM
105452010-02-08 David S. Miller <davem@davemloft.net>
10546
10547 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
10548 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
10549 relocation helper function.
10550
024c4466
DM
10551 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
10552 just like R_SPARC_GOT{10,13,22}.
10553 (Target_sparc::Scan::local): Likewise.
10554 (Target_sparc::Relocate:relocate): Likewise.
10555
9109c078
ILT
105562010-02-06 Ian Lance Taylor <iant@google.com>
10557
10558 * configure.ac: Rewrite targetobjs duplicate removal code to use
10559 only shell constructs.
10560 * configure: Rebuild.
10561
cf846138
DK
105622010-02-05 Doug Kwan <dougkwan@google.com>
10563
10564 PR 11247
10565 * arm.cc (Arm_relobj::section_is_scannable): New method.
10566 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
10567 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
10568
6cfaf60b
DK
105692010-02-04 Doug Kwan <dougkwan@google.com>
10570
10571 PR 11247
10572 * arm-reloc-property.cc (cstdio): Include.
10573 * configure.ac (targetobjs): Remove duplicates.
10574 * configure: Regenerate.
10575 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
10576 big and little endian version for a given address size.
10577
5c57f1be
DK
105782010-02-03 Doug Kwan <dougkwan@google.com>
10579
10580 * arm-reloc-property.cc
10581 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10582 definition.
10583 * arm-reloc-property.h
10584 (Arm_reloc_property_table::get_implemented_static_reloc_property):
10585 New method definition.
10586 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10587 declaration.
10588 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
10589 overflow to N.
10590 (GOT_PREL): Change implemented to Y.
10591 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
10592 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
10593 (Arm_relocate_functions::movw_abs_nc): Remove method.
10594 (Arm_relocate_functions::movt_abs): Ditto.
10595 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
10596 (Arm_relocate_functions::thm_movt_abs): Ditto.
10597 (Arm_relocate_functions::movw_rel_nc): Ditto.
10598 (Arm_relocate_functions::movw_rel): Ditto.
10599 (Arm_relocate_functions::movt_rel): Ditto.
10600 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
10601 (Arm_relocate_functions:thm_movw_rel): Ditto.
10602 (Arm_relocate_functions:thm_movt_rel): Ditto.
10603 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
10604 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
10605 New method definitions.
10606 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
10607 (Arm_relocation_functions::arm_grp_ldr): Ditto.
10608 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
10609 (Arm_relocation_functions::arm_grp_ldc): Ditto.
10610 (Target_arm::Relocate::relocate): Check for non-static or
10611 unimplemented relocation code and exit early. Change calls to
10612 Target_arm::reloc_uses_thumb_bit and
10613 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
10614 instead. Refactor code to handle similar relocations to increase
10615 code sharing. Remove check for unsupported relocation code in switch
10616 statement.
10617 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
10618 relocation property table to find out size. Change error message to
10619 print out the name of a relocation code instead of the numeric value.
10620 (Target_arm::scan_reloc_for_stub): Use relocation property table
10621 instead of calling Target_arm::reloc_uses_thumb_bit().
10622
218c5831
DK
106232010-02-02 Doug Kwan <dougkwan@google.com>
10624
10625 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
10626 types of relaxed input section.
10627
0d31c79d
DK
106282010-02-02 Doug Kwan <dougkwan@google.com>
10629
10630 * Makefile.am (HFILES): Add arm-reloc-property.h.
10631 (DEFFILES): New.
2e702c99
RM
10632 (TARGETSOURCES): Add arm-reloc-property.cc
10633 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
10634 (libgold_a_SOURCES): $(DEFFILES)
10635 * Makefile.in: Regenerate.
10636 * arm-reloc-property.cc: New file.
10637 * arm-reloc-property.h: New file.
10638 * arm-reloc.def: New file.
10639 * arm.cc: Update comments.
10640 (arm-reloc-property.h): New included header.
10641 (arm_reloc_property_table): New global variable.
10642 (Target_arm::do_select_as_default_target): New method definition.
10643 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
10644 arm-reloc-property to targ_extra_obj.
10645 * parameters.cc (set_parameters_target): Call
10646 Target::select_as_default_target().
10647 * target.h (Target::select_as_default_target): New method definition.
10648 (Target::do_select_as_default_target): Same.
10649
546c7457
DK
106502010-02-01 Doug Kwan <dougkwan@google.com>
10651
10652 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
10653 first_output_text_section_.
10654 (Arm_exidx_fixup::first_output_text_section): New method definition.
10655 (Arm_exidx_fixup::first_output_text_section_): New data member.
10656 (Arm_exidx_fixup::process_exidx_section): Record the first text
10657 output section seen.
10658 (Arm_output_section::fix_exidx_coverage): Set correct linked section
10659 and entsize in output section header.
10660
11b861d5
DK
106612010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10662
10663 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
10664 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
10665 (Arm_relocate_functions::thm_alu11): New Method.
10666 (Arm_relocate_functions::thm_pc8): New Method.
10667 (Arm_relocate_functions::thm_pc12): New Method.
10668 (Target_arm::Scan::local): Handle the relocations.
10669 (Target_arm::Scan::global): Likewise.
10670 (Target_arm::Relocate::relocate): Likewise.
10671 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10672
c9a2c125
DK
106732010-01-29 Doug Kwan <dougkwan@google.com>
10674
10675 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
10676 of relocation types as ld.
10677
1521477a
DK
106782010-01-29 Doug Kwan <dougkwan@google.com>
10679
10680 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
10681 to public.
10682 (Arm_relocate_functions::thumb_branch_common): Ditto.
10683 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
10684 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
10685 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
10686 Arm_relocate_functions::jump24): Remove.
10687 (Target_arm::Relocate::relocate): Adjust code to call
10688 Arm_relocation_functions::arm_branch_common and
10689 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 10690 wrappers. Merge switch-cases together to reduce source code size.
1521477a 10691
e7eca48c
DK
106922010-01-29 Doug Kwan <dougkwan@google.com>
10693
10694 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
10695 output_local_symbol_count_needs_update_.
10696 (Arm_relobj::output_local_symbol_count_needs_update,
10697 Arm_relobj::set_output_local_symbol_count_needs_update,
10698 Arm_relobj::update_output_local_symbol_count): New methods.
10699 (Arm_relobj::output_local_symbol_count_needs_update_): New data
10700 member.
10701 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
10702 of pointed function as in a R_ARM_PREL31 relocation.
10703 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
10704 for output local symbol count updating.
10705 (Target_arm::do_relax): Update output local symbol counts in objects
10706 if necessary.
10707 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
10708
02961d7e
ILT
107092010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10710
10711 * arm.cc: Added support for the ARM relocations:
10712 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
10713 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
10714 (Arm_relocate_functions::movw_rel_nc): Renamed (was
10715 movw_prel_nc).
10716 (Arm_relocate_functions::movw_rel): New method.
10717 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
10718 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
10719 thm_movw_prel_nc).
10720 (Arm_relocate_functions::thm_movw_rel): New method.
10721 (Arm_relocate_functions::thm_movt_rel): Renamed (was
10722 thm_movt_prel).
10723 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
10724 relocations.
10725 (Target_arm::Scan::global): Likewise.
10726 (Target_arm::Relocate::relocate): Likewise.
10727 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10728 Likewise.
10729
b10d2873
ILT
107302010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10731
10732 * arm.cc: Added support for ARM group relocations.
10733 (Target_arm::reloc_needs_sym_origin): New method.
10734 (Arm_relocate_functions::calc_grp_kn): New method.
10735 (Arm_relocate_functions::calc_grp_residual): New method.
10736 (Arm_relocate_functions::calc_grp_gn): New method.
10737 (Arm_relocate_functions::arm_grp_alu): New Method.
10738 (Arm_relocate_functions::arm_grp_ldr): New Method.
10739 (Arm_relocate_functions::arm_grp_ldrs): New Method.
10740 (Arm_relocate_functions::arm_grp_ldc): New Method.
10741 (Target_arm::Scan::local): Handle the ARM group relocations.
10742 (Target_arm::Scan::global): Likewise.
10743 (Target_arm::Relocate::relocate): Likewise.
10744 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10745 Likewise.
10746
2b328d4e
DK
107472010-01-26 Doug Kwan <dougkwan@google.com>
10748
10749 * arm.cc (set): Include.
10750 (class Arm_exidx_fixup): Change type of last_input_section_ to const
10751 pointer type.
2e702c99 10752 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
10753 (Arm_output_section::append_text_sections_to_list): New method.
10754 (Arm_output_section::fix_exidx_coverage): Ditto.
10755 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 10756 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
10757 Relobj::set_section_offset() instead of
10758 Sized_relobj::invalidate_section_offset().
2e702c99 10759 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
10760 parameter for section headers. Ignore relocation sections for
10761 unallocated sections and EXIDX sections.
10762 (Target_arm::fix_exidx_coverage): New method.
10763 (Target_arm::output_section_address_less_than): New type.
10764 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
10765 linked text section instead of the EXIDX section.
10766 (Arm_output_section::create_stub_group): Add an assertion to check
10767 that this is not an EXIDX output section.
10768 (Arm_output_section::append_text_sections_to_list): New method.
10769 (Arm_output_section::fix_exidx_coverage): Ditto.
10770 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 10771 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
10772 (Target_arm::do_relax): Fix EXIDX output section coverage in the
10773 first pass.
10774 (Target_arm::fix_exidx_coverage): New method.
10775 * object.h (Relobj::set_output_section): New method.
10776 (Sized_relobj::invalidate_section_offset): Remove method.
10777 (Sized_relobj::do_invalidate_section_offset): Remove method.
10778 (Sized_relobj::do_set_section_offset): Handle offset value -1.
10779
c7f3c371
DK
107802010-01-25 Doug Kwan <dougkwan@google.com>
10781
10782 * arm.cc (Arm_exidx_merged_section::do_output_offset):
10783 Fix warning due to signed and unsigned comparison on a 32-bit host.
10784
8923b24c
DK
107852010-01-22 Doug Kwan <dougkwan@google.com>
10786
10787 * arm.cc (Target_arm::do_relax): Record an output section for section
10788 offset adjustment it contains any stub table that has changed.
10789 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
10790 offsets in an output section if necessary.
10791 * output.cc (Output_section::Output_section): Initialize
10792 section_offsets_need_adjustments_.
10793 (Output_section::add_input_section_for_script): Renamed to
10794 Output_section::add_simple_input_section.
10795 (Output_section::save_states): Add a comment.
10796 (Output_section::discard_states): New method defintion.
10797 (Output_section::adjust_section_offsets): Same.
10798 * output.h (Output_section::add_input_section_for_script): Renamed to
10799 Output_section::add_simple_input_section.
10800 (Output_section::discard_states): New method declaration.
10801 (Output_section::adjust_section_offsets): Same.
10802 (Output_section::section_offsets_need_adjustment,
10803 Output_section::set_section_offsets_need_adjustment): New method
10804 definitions.
10805 (Output_section::section_offsets_need_adjustment_): New data member.
10806 * script-sections.cc
10807 (Output_section_element_input::set_section_address): Adjust code for
10808 renaming of Output_section::add_input_section_for_script.
10809 (Orphan_output_section::set_section_address): Same.
10810
9b2fd367
DK
108112010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10812
10813 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
10814 Fix_v4bx enum values .
10815 * gold/options.h (General_options): New option definitions.
10816 (General_options::fix_v4bx): New method.
10817 (General_options::Fix_v4bx): New enum.
10818 * gold/options.cc (General_options::parse_fix_v4bx): New method.
10819 (General_options::parse_fix_v4bx_interworking): New method.
10820
80d0d023
DK
108212010-01-22 Doug Kwan <dougkwan@google.com>
10822
10823 * arm.cc (Arm_exidx_fixup): New class.
10824
af2cdeae
DK
108252010-01-21 Doug Kwan <dougkwan@google.com>
10826
10827 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
10828 classes.
10829 (Arm_exidx_section_offset_map): New type.
10830
993d07c1
DK
108312010-01-21 Doug Kwan <dougkwan@google.com>
10832
10833 * arm.cc (Arm_exidx_input_section): New class.
10834 (Arm_relobj::exidx_input_section_by_link,
10835 Arm_relobj::exidx_input_section_by_shndx,
10836 Arm_relobj::make_exidx_input_section): New methods.
10837 (read_arm_attributes_section): Remove.
10838 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
10839 information about them.
10840 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
10841 to here.
10842
5ac169d4
DK
108432010-01-20 Doug Kwan <dougkwan@google.com>
10844
10845 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
10846 Input_section_specifier to Section_id.
10847 (Target_arm::new_arm_input_section: Adjust code for change of key
10848 type.
10849 (Target_arm::find_arm_input_section): Ditto.
10850 * gc.h (object.h): Include for Section_id nand Section_id_hash.
10851 (Section_id): Remove.
10852 (Garbage_collection::Section_id_hash): Remove.
10853 * icf.h (object.h): Include for Section_id nand Section_id_hash.
10854 (Section_id): Remove.
10855 (Icf::Section_id_hash): Remove.
10856 * object.h (Section_id, Const_section_id, Section_id_hash,
10857 Const_section_id_hash): New type definitions.
10858 * output.cc (Output_section::add_relaxed_input_section): Change to
10859 use Const_section_id instead of Input_section_specifier as key type.
10860 (Output_section::add_merge_input_section): Ditto.
10861 (Output_section::build_relaxation_map): Change to use Section_id
10862 instead of Input_section_specifier as key type.
2e702c99 10863 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
10864 Ditto.
10865 (Output_section::convert_input_sections_to_relaxed_sections): Change
10866 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 10867 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
10868 (Output_section::find_relaxed_input_section): Ditto.
10869 * output.h (Input_section_specifier): Remove class.
10870 (Output_section::Output_section_data_by_input_section_map): Change
10871 key type to Const_section_id.
10872 (Output_section::Output_relaxed_input_section_by_input_section_map):
10873 Ditto.
10874 (Output_section::Relaxation_map): Change key type to Section_id.
10875
a2162063
ILT
108762010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10877
10878 * gold/arm.cc: Added support for R_ARM_V4BX relocation
10879 (class Arm_v4bx_stub): New class.
10880 (DEF_STUBS): Updated definition to support v4_veneer_bx.
10881 (Stub_factory::make_arm_v4bx_stub): New method.
10882 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
10883 (Stub_table::empty): Handle v4bx stubs.
10884 (Stub_table::add_arm_v4bx_stub): New method.
10885 (Stub_table::find_arm_v4bx_stub): New method.
10886 (Arm_relocate_functions::v4bx): New method.
10887 (Target_arm::fix_v4bx): New method.
10888 (Target_arm::Target_arm): Handle R_ARM_V4BX.
10889 (Stub_table::relocate_stubs): Likewise.
10890 (Stub_table::do_write): Likewise.
10891 (Stub_table::update_data_size_and_addralign): Likewise.
10892 (Stub_table::finalize_stubs): Likewise.
10893 (Target_arm::Scan::local): Likewise.
10894 (Target_arm::Scan::global): Likewise.
10895 (Target_arm::do_finalize_sections): Likewise.
10896 (Target_arm::Relocate::relocate): Likewise.
10897 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10898 Likewise.
10899 (Target_arm::scan_reloc_for_stub): Likewise.
10900 (Target_arm::scan_reloc_section_for_stubs): Likewise.
10901
5696ab0b
ILT
109022010-01-19 Ian Lance Taylor <iant@google.com>
10903
10904 * output.cc (Output_section_headers::do_sized_write): Write large
10905 segment count to sh_info field.
10906 (Output_file_header::do_sized_write): For large segment count,
10907 write PN_XNUM to e_phnum field.
10908
800d0f56
ILT
109092010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10910
10911 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
10912 (Arm_relocate_functions::thm_jump8): New function.
10913 (Arm_relocate_functions::thm_jump11): New function.
10914 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
10915 R_ARM_THM_JUMP11.
10916 (Target_arm::Scan::global): Likewise.
10917 (Target_arm::Relocate::relocate): Likewise.
10918 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10919 Likewise.
10920
41263c05
DK
109212010-01-14 Doug Kwan <dougkwan@google.com>
10922
10923 * arm.cc (map, utility): Include headers.
10924 (Target_arm::apply_cortex_a8_workaround): New method.
10925 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
10926 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
10927 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
10928 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
10929 the --[no-]fix-cortex-a8 command line options.
10930 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
10931 (Target_arm::relocate_stub): Use addend in instruction template.
10932 * options.h (DEFINE_bool): Set the user-set flag.
10933 (General_options): Add --[no-]-fix-cortex options.
10934 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 10935 : Update fast look-up map after conversion.
41263c05 10936
459e9b03
ST
109372010-01-14 Sriraman Tallam <tmsriram@google.com>
10938
10939 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
10940 in the first pass of do_layout.
10941
b521dfe4
DK
109422010-01-13 Doug Kwan <dougkwan@google.com>
10943
10944 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10945 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
10946 apparent compiler problem of not folding static constant integral
10947 data members of elfcpp::Elf_sizes<32>.
10948
44272192
DK
109492010-01-13 Doug Kwan <dougkwan@google.com>
10950
10951 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10952 Arm_relobj::section_needs_cortex_a8_stub_scanning,
10953 Arm_relobj::scan_section_for_cortex_a8_erratum,
10954 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
10955 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
10956 sections to scan for relocation stubs into a new method
10957 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
10958 relocation and Cortex-A8 stub scanning.
10959 (Target_arm::do_relax): Force stubs to be after stubbed sections
10960 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 10961 the beginning of a new relaxation pass. Update a comment.
44272192
DK
10962 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
10963
44b71ece
ILT
109642010-01-12 Ian Lance Taylor <iant@google.com>
10965
10966 * target-reloc.h (visibility_error): New inline function.
10967 (relocate_section): Call visibility_error.
10968 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
10969 (MOSTLYCLEANFILES): Likewise.
10970 (protected_4_pic.o, protected_3.err): New targets.
10971 * testsuite/protected_4.cc: New file.
10972
a120bc7f
DK
109732010-01-12 Doug Kwan <dougkwan@google.com>
10974
10975 * arm.cc (Cortex_a8_reloc): New class.
10976 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
10977 and cortex_a8_relocs_info_.
10978 (Target_arm::fix_cortex_a8): New method definition.
10979 (Target_arm::Cortex_a8_relocs_info): New type.
10980 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
10981 New data member declarations.
10982 (Target_arm::scan_reloc_for_stub): Record information about
10983 relocations for THUMB branches that might be exempted from the
10984 Cortex-A8 workaround.
10985 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
10986 at the beginning of a relaxation pass.
10987
20138696
DK
109882010-01-12 Doug Kwan <dougkwan@google.com>
10989
10990 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
10991 (Arm_relobj::Mapping_symbol_position,
10992 Arm_reloj::Mapping_symbol_position_less,
10993 Arm_relobj::Mapping_symbols_info): New types.
10994 (Target_arm::is_mapping_symbol_name): New method definition.
10995 (Arm_relobj::do_count_local_symbols): Save information about mapping
10996 symbols.
10997
089d69dc
DK
109982010-01-11 Doug Kwan <dougkwan@google.com>
10999
11000 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
11001 Arm_relocate_functions::thumb32_branch_upper,
11002 Arm_relocate_functions::thumb32_branch_lower,
11003 Arm_relocate_functions::thumb32_cond_branch_offset,
11004 Arm_relocate_functions::thumb32_cond_branch_upper,
11005 Arm_relocate_functions::thumb32_cond_branch_lower,
11006 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
11007 branch offset encoding.
11008 (Arm_relocate_functions::thumb_branch_common): Use new branch
11009 offset encoding methods to avoid code duplication.
11010 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
11011 (Stub_addend_reader::operator()): Use new branch encoding method
11012 to avoid code duplication.
11013
99e5bff2
DK
110142010-01-11 Doug Kwan <dougkwan@google.com>
11015
11016 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
11017 (Target_arm::do_finalize_sections): Define special EXIDX section
11018 symbols only if referenced.
11019 * gc.h (Garbage_collection::add_reference): New method.
11020 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
11021 code duplication.
11022
98e090bd
ILT
110232010-01-11 Ian Lance Taylor <iant@google.com>
11024
d0a91bd8
ILT
11025 * script.cc (Version_script_info::build_expression_list_lookup):
11026 Change complaing about duplicate wildcard match from error to
11027 warning.
11028
98e090bd
ILT
11029 * script.cc (class Lazy_demangler): Recreate--revert part of patch
11030 of 2009-12-30.
11031 (Version_script_info::Version_script_info): Initialize globs_,
11032 default_version_, default_is_global_, and exact_. Don't
11033 initialize globals_ or locals_.
11034 (Version_script_info::build_lookup_tables): Build local symbols
11035 first.
11036 (Version_script_info::unquote): New function.
11037 (Version_script_info::add_exact_match): New function.
11038 (Version_script_info::build_expression_list_lookup): Remove lookup
11039 parameter. Add is_global parameter. Change all callers. Handle
11040 wildcard pattern specially. Unquote pattern. Call
11041 add_exact_match.
11042 (Version_script_info::get_name_to_match): New function.
11043 (Version_script_info::get_symbol_version): New function.
11044 (Version_script_info::get_symbol_version_helper): Remove.
11045 (Version_script_info::check_unmatched_names): Call unquote.
11046 * script.h (class Version_script_info): Change get_symbol_version
11047 to be non-inline and add is_global parameter; change all callers.
11048 Rewrite symbol_is_local. Update declarations. Define struct
11049 Version_tree_match, Exact, Globs. Don't define struct Lookup.
11050 Remove globals_ and locals_ members. Add exact_, globs_,
11051 default_version_, is_global_.
11052 (Version_script_info::Glob): Remove pattern, add expression and
11053 is_global. Update constructor. Change all callers.
11054 * dynobj.cc (Versions::finalize): Mark the version symbol as the
11055 default version.
11056 (Versions::symbol_section_contents): If a symbol is undefined, or
11057 defined in a dynamic object, set the version index to
11058 VER_NDX_LOCAL.
11059 * symtab.cc (Symbol_table::add_from_relobj): Don't call
11060 symbol_is_local.
11061 (Symbol_table::add_from_pluginobj): Likewise.
11062 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
11063
d56962d3
DK
110642010-01-11 Doug Kwan <dougkwan@google.com>
11065
11066 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
11067 (incremental_dump_LDADD): Add linking option for libintl.
11068 * Makefile.in: Regenerate.
11069
94e6ee91
L
110702010-01-11 H.J. Lu <hongjiu.lu@intel.com>
11071
11072 PR gold/11144
11073 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
11074 instead of -Ds.
11075 * testsuite/Makefile.in: Regenerated.
11076
e96c574b
DK
110772010-01-10 Doug Kwan <dougkwan@google.com>
11078
11079 * options.h (DEFINE_var): Use parentheses around argument varname__
11080 in macro body to avoid any unintended subsequent substitutions.
11081
7198066b
ILT
110822010-01-10 Ian Lance Taylor <iant@google.com>
11083
ba4d53bf
ILT
11084 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
11085 candidates before doing symbol resolution.
11086
7198066b
ILT
11087 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
11088 ODR candidates if only one is weak.
11089
a2beed37
ILT
110902010-01-08 Ian Lance Taylor <iant@google.com>
11091
11092 * script.cc (Version_script_info::build_expression_list_lookup):
11093 Don't warn about ambiguous version, just record the ambiguity.
11094 (Version_script_info::get_symbol_version_helper): Give error if
11095 version is ambiguous.
11096
2fb7225c
DK
110972010-01-08 Doug Kwan <dougkwan@google.com>
11098
11099 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
11100 prev_data_size_ and prev_addralign_. Remove initializer for
11101 deleted data member has_been_changed_.
11102 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
11103 to determine if the table is empty.
11104 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
11105 Remove.
11106 (Stub_table::add_reloc_stub): Define method in class definition
11107 instead of just declaring it there.
11108 (Stub_table::add_cortex_a8_stub): New method definition.
11109 (Stub_table::update_data_size_and_addralign): Ditto.
11110 (Stub_table::finalize_stubs): Ditto.
11111 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
11112 (Stub_table::do_addralign_): Return address alignment in the
11113 (Stub_table::do_reset_address_and_file_offset): Define method in
11114 class definition instead of declaring it there. Set current data
11115 size to be the data size of the previous pass.
11116 (Stub_table::set_final_data_size): Use current data size as the
11117 final data size.
11118 (Stub_table::relocate_stub): Change parameter type of stub from
11119 Reloc_stub pointer to Stub pointer.
11120 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
11121 (Stub_table::Cortex_a8_stub_list): New typedef.
11122 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
11123 Stub_table::prev_addralign_): New data member.
11124 (Arm_relobj::Arm_relobj): Initialize data member
11125 section_has_cortex_a8_workaround_.
11126 (Arm_relobj::section_has_cortex_a8_workaround,
11127 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
11128 definitions.
11129 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
11130 declarations.
11131 (Target_arm::relocate_stub): Change parameter type of stub from
11132 Reloc_stub pointer to Stub pointer.
11133 (Insn_template::size, Insn_template::alignment): Handle
11134 THUMB16_SPECIAL_TYPE.
11135 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
11136 Stub_table::update_data_size_and_addralign,
11137 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
11138 definitions.
11139 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
11140 (Stub_table::do_write): Ditto.
11141 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 11142
880cd20d
ILT
111432010-01-08 Ian Lance Taylor <iant@google.com>
11144
11145 PR 11108
11146 * symtab.h (class Symbol): Remove fields is_target_special_ and
11147 has_plt_offset_. Add field is_defined_in_discarded_section_.
11148 (Symbol::is_defined_in_discarded_section): New function.
11149 (Symbol::set_is_defined_in_discarded_section): New function.
11150 (Symbol::has_plt_offset): Rewrite.
11151 (Symbol::set_plt_offset): Verify that new offset is not -1U.
11152 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
11153 Don't initialize is_target_special_ or has_plt_offset_.
11154 Initialize is_defined_in_discarded_section_.
11155 (Symbol_table::add_from_relobj): If appropriate, set
11156 is_defined_in_discarded_section.
11157 * resolve.cc (Symbol::override_base_with_special): Don't test
11158 is_target_special_. Change has_plt_offset_ to has_plt_offset().
11159 * target-reloc.h (relocate_section): Do special handling for
11160 symbols defined in discarded sections for global symbols as well
11161 as local symbols.
11162
2703e3eb
ILT
111632010-01-08 Ian Lance Taylor <iant@google.com>
11164
11165 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
11166 the SHT_SYMTAB case.
11167
339d40a3
ILT
111682010-01-08 Ian Lance Taylor <iant@google.com>
11169
11170 * object.cc (Sized_relobj::do_layout): Don't get confused if
11171 layout_eh_frame returns NULL.
11172
abecea76
ILT
111732010-01-08 Ian Lance Taylor <iant@google.com>
11174
11175 PR 11084
11176 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
11177 dynamic symbol table, use the normal symbol table.
11178 (Sized_dynobj::do_read_symbols): Remove assertion about type of
11179 symbol table.
11180
6b7dd3f3
ILT
111812010-01-08 Ian Lance Taylor <iant@google.com>
11182
11183 PR 11072
11184 * layout.cc (Layout::include_section): Remove .gnu_debuglink
11185 sections.
11186
36c50e63
L
111872010-01-08 H.J. Lu <hongjiu.lu@intel.com>
11188
11189 * version.cc (print_version): Change to "Copyright 2010".
11190
e291e7b9
ILT
111912010-01-08 Ian Lance Taylor <iant@google.com>
11192
11193 PR 10287
11194 PR 11063
11195 * i386.cc (class Target_i386): Change return type of plt_section
11196 to be non-const.
11197 (class Output_data_plt_i386): Add tls_desc_rel_ field.
11198 (Output_data_plt_i386::Output_data_plt_i386): Initialize
11199 tls_desc_rel_ field.
11200 (Output_data_plt_i386::rel_tls_desc): New function.
11201 (Target_i386::rel_tls_desc_section): New function.
11202 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
11203 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
11204 R_386_TLS_DESC reloc in rel_tls_desc_section.
11205 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
11206 Define struct Tlsdesc_info.
11207 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
11208 (Target_x86_64::do_reloc_symbol_index): New function.
11209 (Target_x86_64::add_tlsdesc_info): New function.
11210 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
11211 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
11212 tlsdesc_rel_ field.
11213 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
11214 all callers.
11215 (Output_data_plt_x86_64::rela_tlsdesc): New function.
11216 (Target_x86_64::rela_tlsdesc_section): New function.
11217 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
11218 handling.
11219 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
11220 (Target_x86_64::do_reloc_addend): New function.
11221 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
11222 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
11223 declarations. Define TARGET_CODE. Add arg field to u1_ union.
11224 (Output_reloc::type): New function.
11225 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
11226 (Output_reloc::is_target_specific): New function.
11227 (Output_reloc::target_arg): New function.
11228 (class Output_reloc) [SHT_RELA]: Add four new constructors for
11229 absolute relocs and target specific relocs.
11230 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
11231 add_target_specific.
11232 (class Output_data_reloc) [SHT_RELA]: Likewise.
11233 * output.cc (Output_reloc::Output_reloc): Add four new versions
11234 for absolute relocs and target specific relocs.
11235 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
11236 (Output_reloc::get_symbol_index): Likewise.
11237 (Output_reloc::local_section_offset): Check that local_sym_index_
11238 is not TARGET_CODE or 0.
11239 (Output_reloc::symbol_value): Likewise.
11240 (Output_reloc::write) [SHT_RELA]: Call target for target specific
11241 reloc.
11242 * target.h (class Target): Add reloc_symbol_index and reloc_addend
11243 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
11244 functions.
11245 * layout.cc (add_target_dynamic_tags): Use output section for
11246 DT_PLTRELSZ and DT_JMPREL.
11247
3a44184e
ILT
112482010-01-07 Ian Lance Taylor <iant@google.com>
11249
11250 PR 11061
11251 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
11252 function.
11253 (class Output_data_reloc_generic): Define.
11254 (class Output_data_reloc_base): Change base class to
11255 Output_data_reloc_generic. Change add() method to call
11256 bump_relative_reloc_count for a relative reloc. Remove
11257 sort_relocs_ field.
11258 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
11259 to sort_relocs().
11260 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
11261 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
11262 appropriate.
11263 * layout.h (class Layout): Update declaration.
11264
ea715a34
ILT
112652010-01-07 Ian Lance Taylor <iant@google.com>
11266
11267 * output.h (class Output_data): Add const version of
11268 output_section and do_output_section.
11269 (class Output_section_data): Add const version of
11270 do_output_section.
11271 (class Output_section): Likewise.
11272 * layout.cc (Layout::add_target_dynamic_tags): New function.
11273 * layout.h (class Layout): Update declarations.
11274 * arm.cc (Target_arm::do_finalize_sections): Use
11275 add_target_dynamic_tags.
11276 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11277 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11278 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11279 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11280
659948a4
ILT
112812010-01-07 Ian Lance Taylor <iant@google.com>
11282
11283 PR 11042
11284 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
11285 object as needed.
11286
9d3b86f6
ILT
112872010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
11288 Ian Lance Taylor <iant@google.com>
11289
11290 PR 11019
11291 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
11292 Xindex::read_symtab_xindex.
11293
bb0d3eb0
DK
112942010-01-07 Doug Kwan <dougkwan@google.com>
11295
11296 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
11297 (Insn_template::thumb16_bcond_insn): New method declaration.
11298 (Insn_template): Fix spelling.
11299 (Stub::thumb16_special): New method declaration.
11300 (Stub::do_write): Define virtual method which was previously pure
11301 virtual.
11302 (Stub::do_thumb16_special): New method declaration.
11303 (Stub::do_fixed_endian_write): New template member.
11304 (Reloc_stub::do_write): Remove.
11305 (Reloc_stub::do_fixed_endian_write): Remove.
11306 (Cortex_a8_stub): New class definition.
11307 (Stub_factory::make_cortex_a8_stub): New method definition.
11308 (Stub_factory::Stub_factory): Add missing static storage class
11309 qualifier for elf32_arm_stub_a8_veneer_blx.
11310
ffeef7df
ILT
113112010-01-07 Ian Lance Taylor <iant@google.com>
11312
dc3f80fe
ILT
11313 PR 10980
11314 * options.h (class General_options): Add --warn-unresolved-symbols
11315 and --error-unresolved-symbols.
11316 * errors.cc (Errors::undefined_symbol): Implement
11317 --warn-unresolved-symbols.
11318
ffeef7df
ILT
11319 * options.h (class General_options): Add -z text and -z textoff.
11320 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
11321
f1ec9ded
ST
113222010-01-06 Sriraman Tallam <tmsriram@google.com>
11323
11324 * gc.h (Garbage_collection::Cident_section_map): New typedef.
11325 (Garbage_collection::cident_sections): New function.
11326 (Garbage_collection::add_cident_section): New function.
11327 (Garbage_collection::cident_sections_): New member.
11328 (gc_process_relocs): Add references to sections whose names are C
11329 identifiers.
11330 * gold.h (cident_section_start_prefix): New constant.
11331 (cident_section_stop_prefix): New constant.
11332 (is_cident): New function.
11333 * layout.cc (Layout::define_section_symbols): Replace string constants
11334 with the newly defined constants.
11335 * object.cc (Sized_relobj::do_layout): Track sections whose names are
11336 C identifiers.
11337 * testsuite/Makefile.am: Add gc_orphan_section_test.
11338 * testsuite/Makefile.in: Regenerate.
11339 * testsuite/gc_orphan_section_test.cc: New file.
11340 * testsuite/gc_orphan_section_test.sh: New file.
11341
6eda8c29
ILT
113422010-01-06 Ian Lance Taylor <iant@google.com>
11343
b9674e17
ILT
11344 PR 10980
11345 * options.h (class General_options): Add --warn-shared-textrel.
11346 * layout.cc (Layout::finish_dynamic_section): Implement
11347 --warn-shared-textrel.
11348
6eda8c29
ILT
11349 PR 10980
11350 * options.h (class General_options): Add --warn-multiple-gp.
11351
32dcd44e
ILT
113522010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11353
11354 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
11355 $(THREADSLIB) and $(LIBDL).
11356 * Makefile.in: Rebuild.
11357
a192ba05
ILT
113582010-01-06 Ian Lance Taylor <iant@google.com>
11359
11360 PR 10980
11361 * options.cc (General_options::parse_section_start): New function.
11362 (General_options::section_start): New function.
11363 (General_options::General_options): Initialize all members.
11364 * options.h: Include <map>
11365 (class General_options): Add --section-start. Add section_starts_
11366 member.
11367 * layout.cc (Layout::attach_allocated_section_to_segment): If
11368 --section-start was used, set the address of the segment. Remove
11369 local sort_sections.
11370 (Layout::relaxation_loop_body): If the address of the load segment
11371 has been set by --section-start, don't use it.
11372 * output.h (Output_segment::update_flags_for_output_section): New
11373 function.
11374 * output.cc (Output_segment::add_output_section): Call
11375 update_flags_for_output_section.
11376
dde3f402
ILT
113772010-01-05 Ian Lance Taylor <iant@google.com>
11378
62dfdd4d
ILT
11379 PR 10980
11380 * options.h (class General_options): Add --undefined-version.
11381 * script.cc (struct Version_expression): Add was_matched_by_symbol
11382 field.
11383 (Version_script_info::matched_symbol): New function.
11384 (Version_script_info::get_symbol_version_helper): Call
11385 matched_symbol.
11386 (Version_script_info::check_unmatched_names): New function.
11387 * script.h (class Version_script_info): Update declarations.
11388 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
11389
9c4ae156
ILT
11390 * options.h (class General_options): Use DEFINE_bool_alias for
11391 allow_multiple_definition.
11392 * resolve.cc (Symbol_table::should_override): Don't test
11393 allow_multiple_definition.
11394
dde3f402
ILT
11395 PR 10980
11396 * options.h (class General_options): Add --cref.
11397 * main.cc (main): Print cref table if --cref. Don't close mapfile
11398 until after printing cref table.
11399 * cref.cc: Include "symtab.h".
11400 (class Cref_inputs): Define Cref_table_compare and Cref_table.
11401 (Cref_table_compare::operator()): New function.
11402 (Cref_inputs::gather_cref): New function.
11403 (filecol): New static const.
11404 (Cref_inputs::print_cref): New function.
11405 (Cref::print_cref): New function.
11406 * cref.h: Include <cstdio>.
11407 (class Cref): Update declarations.
11408 * mapfile.h (Mapfile::file): New function.
11409 * object.h (class Object): Define Symbols. Declare virtual
11410 do_get_global_symbols.
11411 (Object::get_global_symbols): New function.
11412 * object.cc (Input_objects::add_object): Pass object to cref_ if
11413 --cref.
11414 (Input_objects::archive_start): Likewise.
11415 (Input_objects::archive_stop): Likewise.
11416 (Input_objects::print_cref): New function.
11417 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
11418 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
11419 --cref.
11420 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
11421 function.
11422 * plugin.h (class Sized_pluginobj): Update declarations.
11423
8781f709
ILT
114242010-01-05 Ian Lance Taylor <iant@google.com>
11425
11426 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
11427 to is_default_version. Rename insdef to insdefault.
11428 (Symbol_table::add_from_relobj): Rename def to is_default_version
11429 and local to is_forced_local.
11430 (Symbol_table::add_from_pluginobj): Likewise.
11431 (Symbol_table::add_from_dynobj): Likewise.
11432 (Symbol_table::define_special_symbol): Rename insdef to
11433 insdefault.
11434
fe35d28d
ILT
114352010-01-04 Ian Lance Taylor <iant@google.com>
11436
30bc8c46
ILT
11437 PR 10980
11438 * options.h (class General_options): Add
11439 --allow-multiple-definition and -z muldefs.
11440 * resolve.cc (Symbol_table::should_override): Don't warn about a
11441 multiple symbol definition if --allow-multiple-definition or -z
11442 muldefs.
11443
7eaea549
ILT
11444 PR 10980
11445 * options.h (class General_options): Add --add-needed and
11446 --copy-dt-needed-entries. Tweak --as-needed help entry.
11447 * object.cc (Input_objects::check_dynamic_dependencies): Give an
11448 error if --copy-dt-needed-entries aka --add-needed is used and
11449 would cause a change in behaviour.
11450
fe35d28d
ILT
11451 PR 10980
11452 * options.h (class General_options): Add -G as a short version of
11453 --shared. Add no-op options -assert, -g, and -i.
11454
55a2bb35
ST
114552010-01-04 Sriraman Tallam <tmsriram@google.com>
11456
11457 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
11458 check for .text or .gnu.linkonce.t sections.
11459 * icf.cc (Icf::find_identical_sections): Ditto.
11460 Change the detection for mangled function name within the section
11461 name.
11462 * icf.h (is_section_foldable_candidate): New function.
11463
719328e1
ILT
114642009-12-30 Ian Lance Taylor <iant@google.com>
11465
11466 PR 10980
11467 * options.h (class General_options): Permit two dashes with
11468 --retain-symbols-file.
11469
d7bb5745
ILT
114702009-12-30 Ian Lance Taylor <iant@google.com>
11471
403a15dd
ILT
11472 PR 10979
11473 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
11474 don't put the file header and segment headers in the text
11475 segment.
11476
eda294df
ILT
11477 PR 10979
11478 * common.cc (Sort_commons::operator()): Stabilize sort when both
11479 entries are NULL.
11480 (Symbol_table::do_allocate_commons_list): When allocating common
11481 symbols, skip a symbol which is no longer common.
11482 * symtab.h (Symbol::is_common): Test whether the symbol comes from
11483 an object before checking its type.
11484 * testsuite/common_test_2.c: New file.
11485 * testsuite/common_test_3.c: New file.
11486 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
11487 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
11488 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
11489 (common_test_2_pic.o, common_test_2.so): New targets.
11490 (common_test_3_pic.o, common_test_3.so): New targets.
11491 * testsuite/Makefile.in: Rebuild.
11492
d7bb5745
ILT
11493 PR 10979
11494 * script.cc (read_input_script): If we see a new SECTIONS clause,
11495 and we have added an input section, give an error.
11496 * layout.h (class Layout): Add have_added_input_section function.
11497 Add have_added_input_section_ field.
11498 * layout.cc (Layout::Layout): Initialize
11499 have_added_input_section_.
11500 (Layout::layout): Set have_added_input_section_.
11501 (Layout::layout_eh_frame): Likewise.
11502
fc59c572
ILT
115032009-12-30 Ian Lance Taylor <iant@google.com>
11504
11505 PR 10931
11506 * options.h (class General_options): Add --sort-common option.
11507 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
11508 * common.cc (Sort_common): Add sort_order parameter to
11509 constructor. Add sort_order_ field.
11510 (Sort_commons::operator): Check sort_order_.
11511 (Symbol_table::allocate_commons): Determine the sort order.
11512 (Symbol_table::do_allocate_commons): Add sort_order parameter.
11513 Change all callers.
11514 (Symbol_table::do_allocate_commons_list): Likewise.
11515
1c74fab0
ILT
115162009-12-30 Ian Lance Taylor <iant@google.com>
11517
11518 PR 10916
11519 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
11520 symbols from this object, don't change the visibility of an
11521 undefined symbol.
11522 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
11523
6affe781
ILT
115242009-12-30 Ian Lance Taylor <iant@google.com>
11525
11526 PR 10861
11527 * script.h (class Version_script_info): Define Language enum.
11528 Update declarations. Define Glob, Exact, and Lookup types. Add
11529 new fields globals_, locals_, and is_finalized_.
11530 * script.cc: Various formatting fixes.
11531 (class Parser_closure): Change language_stack_ from a vector of
11532 std::string to one of Version_script_info::Language. Adjust all
11533 uses accordingly.
11534 (class Lazy_demangler): Remove.
11535 (struct Version_expression): Change language from std::string to
11536 Version_script_info::Language.
11537 (Version_script_info::Version_script_info): New function.
11538 (Version_script_info::~Version_script_info): Don't call clear.
11539 (Version_script_info::finalize): New function.
11540 (Version_script_info::build_lookup_tables): New function.
11541 (Version_script_info::build_expression_list_lookup): New
11542 function.
11543 (Version_script_info::get_symbol_version_helper): Rewrite to use
11544 lookup tables.
11545 (Version_script_info::print_expression_list): Adjust to use
11546 Version_script_info::Language.
11547 (script_push_lex_into_version_mode): Check that the version script
11548 has not been finalized.
11549 (version_script_push_lang): Change language string to
11550 Version_script_info::Language.
11551 * options.cc (Command_line::version_script): New function.
11552 * options.h (class General_options): Add finalize_dynamic_list
11553 function. Change version_script from declaration to definition.
11554 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
11555 * testsuite/version_script.map: Remove duplicate def of foo.
11556 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
11557 version_script.map.
11558 * testsuite/Makefile.in: Rebuild.
11559
818bf354
ILT
115602009-12-30 Ian Lance Taylor <iant@google.com>
11561
11562 PR 10843
11563 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
11564 if the input symbol index is 0, make the output symbol index 0.
11565
ebcc8304
ILT
115662009-12-30 Ian Lance Taylor <iant@google.com>
11567
11568 PR 10670
11569 * options.h (class General_options): Add -x/--discard-all.
11570 * object.cc (Sized_relobj::do_count_local_symbols): Handle
11571 --discard-all. If the local symbol needs a dynamic entry, check
11572 that before handling --discard-locals.
11573
176fe33f
ILT
115742009-12-30 Ian Lance Taylor <iant@google.com>
11575
bb321bb1
ILT
11576 PR 10450
11577 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
11578 flags to PF_R.
11579 (Output_segment::add_output_section): Don't change the flags if
11580 the type is PT_TLS.
11581
176fe33f
ILT
11582 PR 10450
11583 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
11584 GNU hash table if they need a dynamic value. Otherwise, don't add
11585 them if they are defined in a dynamic object or are forced local.
11586
e8cd95c7
ILT
115872009-12-29 Ian Lance Taylor <iant@google.com>
11588
1b81fb71
ILT
11589 PR 10450
11590 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
11591 .gnu.hash table for a 32-bit target.
11592
8d6d383d
ILT
11593 PR 10450
11594 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
11595 regular and a dynamic object only needs a dynamic symbol table
11596 entry if it is externally visible.
11597
e785ec03
ILT
11598 PR 10450
11599 * i386.cc (class Target_i386): Initialize global_offset_table_ in
11600 constructor. Add global_offset_table_ field.
11601 (Target_i386::got_section): Set global_offset_table_.
11602 (Target_i386::do_finalize_sections): Set global_offset_table_
11603 size.
11604 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
11605 in constructor. Add global_offset_table_ field.
11606 (Target_x86_64::got_section): Set global_offset_table_.
11607 (Target_x86_64::do_finalize_sections): Set global_offset_table_
11608 size.
11609
1a2dff53
ILT
11610 * layout.cc (Layout::Layout): Initialize increase_relro_.
11611 (Layout::get_output_section): Add is_relro, is_last_relro, and
11612 is_first_non_relro parameters. Change all callers.
11613 (Layout::choose_output_section): Likewise.
11614 (Layout::add_output_section_data): Likewise.
11615 (Layout::make_output_section): Likewise.
11616 (Layout::set_segment_offsets): Clear increase_relro when using a
11617 linker script.
11618 * layout.h (class Layout): Add increase_relro method. Add
11619 increase_relro_ field. Update declarations.
11620 * output.cc (Output_section::Output_section): Initialize
11621 is_last_relro_ and is_first_non_relro_.
11622 (Output_segment::add_output_section): Group relro sections is
11623 do_sort is true. Handle is_last_relro and is_first_non_relro.
11624 (Output_segment::maximum_alignment): Remove relro handling.
11625 (Output_segment::set_section_addresses): Add increase_relro
11626 parameter. Change all callers. Add initial alignment to align
11627 relro sections on separate page. Remove old relro handling.
11628 (Output_segment::set_section_list_addresses): Remove in_relro
11629 parameter. Change all callers.
11630 (Output_segment::set_offset): Add increase parameter. Change all
11631 callers. Remove old relro handling.
11632 * output.h (class Output_section): Add new methods: is_last_relro,
11633 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
11634 Add is_last_relro_ and is_first_non_relro_ fields.
11635 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
11636 Create separate .got.plt section. Call increase_relro.
11637 * x86_64.cc (Target_x86_64::got_section): Likewise.
11638 * testsuite/relro_script_test.t: Add .got.plt.
11639
f0ba79e2
ILT
11640 PR 10450
11641 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
11642 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
11643 (Layout::finalize): Call set_dynamic_symbol_size.
11644 (Layout::set_dynamic_symbol_size): New function.
11645 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
11646 set_dynamic_symbol_size.
11647
e8cd95c7
ILT
11648 PR 10450
11649 * output.h (class Output_section): Add is_entsize_zero_ field.
11650 * output.cc (Output_section::Output_section): Initialize
11651 is_entsize_zero_.
11652 (Output_section::set_entsize): If two different entsizes are
11653 requested, force it to zero.
11654 (Output_section::add_input_section): Set flags for .debug_str
11655 before updating section flags. Set entsize.
11656 (Output_section::update_flags_for_input_section): Set SHF_MERGE
11657 and SHF_STRING if all input sections have those flags.
11658
3e1b9a8a
RÁE
116592009-12-29 Rafael Espindola <espindola@google.com>
11660
11661 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
11662 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
11663 reporting.
3e1b9a8a 11664
3dcad376
ST
116652009-12-29 Sriraman Tallam <tmsriram@google.com>
11666
11667 * options.cc (General_options::parse_version): Allow -v to exit
11668 without an error if there is nothing to link.
11669
084e2665
ILT
116702009-12-29 Ian Lance Taylor <iant@google.com>
11671
11672 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
11673 using a version of gcc before 4.1.
11674 * configure: Rebuild.
11675
250acde3
CD
116762009-12-28 Chris Demetriou <cgd@google.com>
11677
11678 * attributes.cc (Output_attributes_section_data::do_write): Use
11679 std::vector::front rather than std::vector::data.
11680
99fff23b
ILT
116812009-12-28 Ian Lance Taylor <iant@google.com>
11682
11683 * symtab.h (class Symbol_table): Add enum Defined.
11684 * resolve.cc (Symbol_table::should_override): Add defined
11685 parameter. Change all callers. Test whether object is NULL
11686 before calling a method on it.
11687 (Symbol_table::report_resolve_problem): Add defined parameter.
11688 Change all callers.
11689 (Symbol_table::should_override_with_special): Likewise.
11690 * symtab.cc (Symbol_table::define_in_output_data): Add defined
11691 parameter. Change all callers.
11692 (Symbol_table::do_define_in_output_data): Likewise.
11693 (Symbol_table::define_in_output_segment): Likewise.
11694 (Symbol_table::do_define_in_output_segment): Likewise.
11695 (Symbol_table::define_as_constant): Likewise.
11696 (Symbol_table::do_define_as_constant): Likewise.
11697 * script.h (class Symbol_assignment): Add is_defsym parameter to
11698 constructor; change all callers.
11699 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
11700 parameter. Change all callers. Add is_defsym_ field.
11701 (class Parser_closure): Add parsing_defsym parameter to
11702 constructor; change all callers. Add parsing_defsym accessor
11703 function. Add parsing_defsym_ field.
11704
556bd683
ILT
117052009-12-28 Ian Lance Taylor <iant@google.com>
11706
11707 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 11708 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 11709
1782c879
ILT
117102009-12-23 Ian Lance Taylor <iant@google.com>
11711
11712 * i386.cc (Target_i386::do_calls_non_split): Recognize
11713 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
11714 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
11715 -fsplit-stack prologue when using %r11.
1782c879 11716
329ca2b1
ST
117172009-12-21 Sriraman Tallam <tmsriram@google.com>
11718
11719 * options.cc (General_options::parse_version): Make -v continue and do
11720 the link like GNU ld does.
11721
d675ff46
RÁE
117222009-12-17 Rafael Avila de Espindola <espindola@google.com>
11723
11724 * Makefile.am (CCFILES): Add timer.cc.
11725 (HFILES): Add timer.h.
11726 * configure.ac: Check for sysconf and times.
11727 * main.cc: include timer.h.
11728 (main): Use Timer instead of get_run_time.
11729 * timer.cc: New.
11730 * timer.h: New.
11731 * workqueue.cc: include timer.h.
11732 (Workqueue::find_and_run_task):
11733 Report user, sys and wall time.
11734 * Makefile.in: Regenerate.
11735 * config.in: Regenerate.
11736 * configure: Regenerate.
11737
d6344fb5
DK
117382009-12-16 Doug Kwan <dougkwan@google.com>
11739
11740 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
11741 sections.
11742 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
11743 relaxed input sections.
11744 * output.cc (Output_section::find_relaxed_input_section): Change
11745 return type to Output_relaxed_input_section pointer. Adjust code
11746 for new type of relaxed_input_section_map_.
11747 * output.h (Output_section::find_relaxed_input_section): Change
11748 return type to Output_relaxed_input_section pointer.
11749 (Output_section::Output_relaxed_input_section_by_input_section_map):
11750 New type.
11751 (Output_section::relaxed_input_section_map_): Change type to
11752 Output_section::Output_relaxed_input_section_by_input_section_map.
11753 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
11754 input section.
11755
0e0d5469
ILT
117562009-12-15 Ian Lance Taylor <iant@google.com>
11757
11758 * layout.cc (Layout::create_shstrtab): Only write out after input
11759 sections if we are compressing debug sections.
11760
0649a889
ILT
117612009-12-15 Ian Lance Taylor <iant@google.com>
11762
11763 * archive.cc (Archive::add_symbols): Only look up a symbol without
11764 a version if there is, in fact, a version.
11765
2ea97941
ILT
117662009-12-14 Ian Lance Taylor <iant@google.com>
11767
11768 Revert -Wshadow changes, all changes from:
11769 2009-12-11 Doug Kwan <dougkwan@google.com>
11770 2009-12-11 Nick Clifton <nickc@redhat.com>
11771 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
11772
b0eec2cc
DK
117732009-12-11 Doug Kwan <dougkwan@google.com>
11774
11775 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
11776 due to -Wshadow.
11777 * attributes.cc (Object_attribute::size): Ditto.
11778 (Attributes_section_data::size): Ditto.
11779 (Attributes_section_data::Attributes_section_data): Ditto.
11780 (Output_attributes_section_data::do_write): Ditto.
11781 * attributes.h (Object_attribute::set_type): Ditto.
11782 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
11783
91d6fa6a
NC
117842009-12-11 Nick Clifton <nickc@redhat.com>
11785
11786 * archive.cc: Fix shadowed variable warnings.
11787 * arm.cc: Likewise.
11788 * compressed_output.cc: Likewise.
11789 * compressed_output.h: Likewise.
11790 * configure: Likewise.
11791 * dwarf_reader.cc: Likewise.
11792 * dynobj.cc: Likewise.
11793 * dynobj.h: Likewise.
11794 * ehframe.cc: Likewise.
11795 * ehframe.h: Likewise.
11796 * errors.cc: Likewise.
11797 * expression.cc: Likewise.
11798 * fileread.cc: Likewise.
11799 * fileread.h: Likewise.
11800 * freebsd.h: Likewise.
11801 * i386.cc: Likewise.
11802 * icf.cc: Likewise.
11803 * incremental.h: Likewise.
11804 * layout.cc: Likewise.
11805 * layout.h: Likewise.
11806 * mapfile.cc: Likewise.
11807 * merge.cc: Likewise.
11808 * merge.h: Likewise.
11809 * object.cc: Likewise.
11810 * object.h: Likewise.
11811 * options.h: Likewise.
11812 * output.cc: Likewise.
11813 * output.h: Likewise.
11814 * parameters.cc: Likewise.
11815 * plugin.cc: Likewise.
11816 * powerpc.cc: Likewise.
11817 * reduced_debug_output.cc: Likewise.
11818 * reduced_debug_output.h: Likewise.
11819 * reloc.cc: Likewise.
11820 * reloc.h: Likewise.
11821 * resolve.cc: Likewise.
11822 * script-sections.cc: Likewise.
11823 * script.cc: Likewise.
11824 * script.h: Likewise.
11825 * sparc.cc: Likewise.
11826 * symtab.cc: Likewise.
11827 * symtab.h: Likewise.
11828 * target-select.cc: Likewise.
11829 * target-select.h: Likewise.
11830 * token.h: Likewise.
11831 * workqueue.cc: Likewise.
11832 * workqueue.h: Likewise.
11833 * x86_64.cc: Likewise.
11834
a0351a69
DK
118352009-12-10 Doug Kwan <dougkwan@google.com>
11836
11837 * arm.cc (attributes.h): New include.
11838 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
11839 (Arm_relobj::~Arm_relobj): Delete object pointed by
11840 attributes_section_data_.
11841 (Arm_relobj::attributes_section_data): New method definition.
11842 (Arm_relobj::attributes_section_data_): New data member declaration.
11843 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
11844 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
11845 attributes_section_data_.
11846 (Arm_dynobj::attributes_section_data): New method definition.
11847 (Arm_dynobj::attributes_section_data_): New data member declaration.
11848 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
11849 initialization value of may_use_blx_ to false.
2e702c99 11850 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
11851 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
11852 object attributes to compute results instead of hard-coding.
11853 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
11854 Target_arm::get_secondary_compatible_arch,
11855 Target_arm::set_secondary_compatible_arch
11856 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11857 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
11858 New method declarations.
11859 (Target_arm::get_aeabi_object_attribute): New method definition.
11860 (Target_arm::attributes_section_data_): New data member declaration.
11861 (read_arm_attributes_section): New template definition.
11862 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
11863 (Arm_dynobj::do_read_symbols): Ditto.
11864 (Target_arm::do_finalize_sections): Merge attributes sections from
11865 input. Check for BLX use after attributes section merging.
11866 Fix __exidx_start and __exidx_end visibility. Create an
11867 .ARM.attributes section if necessary.
11868 (Target_arm::get_secondary_compatible_arch,
11869 Target_arm::set_secondary_compatible_arch,
11870 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11871 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 11872 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
11873 New method definitions.
11874
b59befec
ILT
118752009-12-09 Ian Lance Taylor <iant@google.com>
11876
11877 * plugin.cc (Plugin::load): Don't cast from void* to a function
11878 pointer.
11879
1276bc89
ILT
118802009-12-09 Ian Lance Taylor <iant@google.com>
11881
11882 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
11883 information fields.
11884
2f2de248
L
118852009-12-09 H.J. Lu <hongjiu.lu@intel.com>
11886
11887 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
11888 Replace two_file_shared_1.so with two_file_shared_2.so.
11889 * testsuite/Makefile.in: Regenerated.
11890
4f787271
DK
118912009-12-08 Doug Kwan <dougkwan@google.com>
11892
11893 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
11894 (HFILES): Add attributes.h and int_encoding.h.
11895 * Makefile.in: Regenerate.
11896 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
11897 function definitions to int_encoding.cc
11898 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
11899 prototypes to int_encoding.h
11900 * reduced_debug_output.cc (int_encoding.h): New include.
11901 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
11902 function definitions to int_encoding.cc
11903 (insert_into_vector, read_from_pointer): Move template definitions to
11904 int_encoding.h
11905 * attributes.cc: New file.
11906 * attributes.h: New file.
11907 * int_encoding.cc: New file.
11908 * int_encoding.h: New file.
11909
20b52f1a
RÁE
119102009-12-07 Rafael Avila de Espindola <espindola@google.com>
11911
11912 PR gold/11055
11913 * incremental-dump.cc (dump_incremental_inputs): New.
11914 (main): Use dump_incremental_inputs.
11915
53d7974c
L
119162009-12-07 H.J. Lu <hongjiu.lu@intel.com>
11917
11918 PR gold/10893
11919 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
11920 checking elfcpp::STT_FUNC.
11921 (Target_i386::Relocate::relocate): Likewise.
11922 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
11923
11924 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
11925 symbols from shared libraries into normal FUNC symbols.
11926
11927 * symtab.h (Symbol): Add is_func and use it.
11928
05a352e6
DK
119292009-12-05 Doug Kwan <dougkwan@google.com>
11930
11931 * arm.cc (Target_arm::arm_info): Initialize new fields
11932 attributes_section and attributes_vendor.
11933 * i386.cc (Target_i386::i386_info): Same.
11934 * object.cc (Sized_relobj::do_layout): Skip attribute section.
11935 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
11936 fields attributes_section and attributes_vendor.
53d7974c 11937 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
11938 * target.h (Target::attributes_section, Target::attributes_vendor,
11939 Target::is_attributes_section, Target::attribute_arg_type,
11940 Target::attributes_order): New method definitions.
11941 (Target::Target_info::attributes_section,
11942 Target::Target_info::attributes_vendor): New fields.
11943 (Target::do_attribute_arg_type, Target::do_attributes_order): New
11944 virtual method definitions.
11945 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
11946 attributes_section and attributes_vendor.
11947 * testsuite/testfile.cc (Target_test::test_target_info): Same.
11948
f4e5969c
DK
119492009-12-05 Doug Kwan <dougkwan@google.com>
11950
11951 * arm.cc: Update comments about interworking and stub generation.
11952 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
11953 considered as non-PIC.
11954 (Arm_relocate_functions::base_abs): Fix formatting.
11955 (Arm_relocate_functions::got_prel): Fix comment. Change interface
11956 of function to use GOT entry address instead of offset.
11957 (Target_arm::Scan::global): Issue an error if a symbol would need a
11958 PLT does not get one because it is untyped. Remove code to create
11959 dynamic symbols for relative branches.
11960 (Target_arm::Relocate::relocate: Use 0 instead of false since function
11961 takes unsigned integer instead of boolean.
11962
1abce4a6
L
119632009-12-05 H.J. Lu <hongjiu.lu@intel.com>
11964
11965 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
11966 (two_file_test_LDADD): Likewise.
11967 (common_test_1_LDADD): Likewise.
11968 (exception_test_LDADD) Likewise.
11969 (weak_test_LDADD): Likewise.
11970 (many_sections_test_LDADD): Likewise.
11971 (initpri1_LDADD): Likewise.
11972 (script_test_1_LDADD): Likewise.
11973 (script_test_2_LDADD): Likewise.
11974 (justsyms_LDADD): Likewise.
11975 (binary_test_LDADD): Likewise.
11976 (large_LDADD): Likewise.
11977 * testsuite/Makefile.in: Regenerated.
11978
adcf2816 119792009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 11980
adcf2816
L
11981 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
11982 (Symbol_table::override_with_special): Likewise.
11983 (Symbol_table::add_from_object): Likewise.
11984
28e67f5d
RÁE
119852009-12-04 Rafael Avila de Espindola <espindola@google.com>
11986
11987 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11988 Don't set the data_offset twice.
11989
ae10a101
RÁE
119902009-12-04 Rafael Avila de Espindola <espindola@google.com>
11991
11992 * testsuite/Makefile.in: Regenerate.
11993
f59f41f3
DK
119942009-12-03 Doug Kwan <dougkwan@google.com>
11995
11996 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
11997 (Target_arm::do_finalize_sections): Add parameter for symbol table
11998 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
11999 * i386.cc (Target_i386::do_finalize_sections): Add an additional
12000 parameter for symbol table pointer.
12001 * layout.cc (Layout::finalize): Call Target::finalize_sections with
12002 an additional parameter for a pointer to symbol table.
12003 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
12004 parameter for a symbol table pointer.
12005 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
12006 * target.h (Target::finalize_sections, Target::do_finalize_sections):
12007 Ditto.
12008 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
12009 parameter for a symbol table pointer.
12010
ca55d848
RÁE
120112009-12-03 Rafael Avila de Espindola <espindola@google.com>
12012
12013 * incremental.cc (Incremental_inputs_header)
12014 (Incremental_inputs_header_write, Incremental_inputs_entry)
12015 (Incremental_inputs_entry_write): Move ...
12016 * incremental.h (Incremental_inputs_header)
12017 (Incremental_inputs_header_write, Incremental_inputs_entry)
12018 (Incremental_inputs_entry_write): here.
12019
3aec4f9c
RÁE
120202009-12-02 Rafael Avila de Espindola <espindola@google.com>
12021
12022 * incremental.cc (make_sized_incremental_binary): Set the target.
12023 Error if it is incompatible.
12024 * output.h (Output_file): Add filename method.
12025
9c0ae74d
RÁE
120262009-12-02 Rafael Avila de Espindola <espindola@google.com>
12027
12028 * incremental.cc (Incremental_inputs_entry): Remove unused argument
12029 from the get_* methods.
12030
a45500ae
RÁE
120312009-12-02 Rafael Avila de Espindola <espindola@google.com>
12032
12033 * incremental-dump.cc (main): Check that the offeset of a script is 0.
12034 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12035 Write 0 for the data_offset of scripts.
12036
325e6408
RÁE
120372009-12-02 Rafael Avila de Espindola <espindola@google.com>
12038
12039 * testsuite/Makefile.am: Add the incremental_test.sh test.
12040 * testsuite/incremental_test.sh: New.
12041 * testsuite/incremental_test_1.c: New.
12042 * testsuite/incremental_test_2.c: New.
12043
954c3e2e
RÁE
120442009-12-01 Rafael Avila de Espindola <espindola@google.com>
12045
703d02da 12046 * incremental-dump.cc (main): Fix typos.
954c3e2e 12047
f8086623
RÁE
120482009-11-27 Rafael Avila de Espindola <espindola@google.com>
12049
12050 PR gold/11025
12051 * incremental-dump.cc (main): Use llu to print 64 bit values.
12052
3b0dd6ac
L
120532009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
12054 H.J. Lu <hongjiu.lu@intel.com>
12055
12056 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
12057 $(LIBDL).
12058 (incremental_dump_LDADD): Likewise.
12059 * Makefile.in: Regenerated.
12060
a6d1ef57 120612009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 12062
a6d1ef57
DK
12063 Revert:
12064
12065 2009-11-25 Doug Kwan <dougkwan@google.com>
12066
12067 * arm.cc (Target_arm::Target_arm): Move method definition
12068 outside of class definition. Add code to handle
12069 --target1-rel, --target1-abs and --target2= options.
12070 (Target_arm::get_reloc_reloc_type): Change method to be
12071 non-static and const.
12072 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
12073 New data member declaration.
12074 (Target_arm::Scan::local, Target_arm::Scan::global,
12075 Target_arm::Relocate::relocate,
12076 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12077 Adjust call to Target_arm::get_real_reloc_type.
12078 (Target_arm::get_real_reloc_type): Use command line options
12079 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12080 * options.h (--target1-rel, --target1-abs, --target2): New
12081 ARM-only options.
12082
50aeb7d4
DK
120832009-11-25 Doug Kwan <dougkwan@google.com>
12084
12085 * arm.cc (Target_arm::Target_arm): Move method definition outside of
12086 class definition. Add code to handle --target1-rel, --target1-abs
12087 and --target2= options.
12088 (Target_arm::get_reloc_reloc_type): Change method to be non-static
12089 and const.
12090 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
12091 member declaration.
12092 (Target_arm::Scan::local, Target_arm::Scan::global,
12093 Target_arm::Relocate::relocate,
12094 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
12095 call to Target_arm::get_real_reloc_type.
12096 (Target_arm::get_real_reloc_type): Use command line options to
12097 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12098 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
12099 options.
12100
51938283
DK
121012009-11-25 Doug Kwan <dougkwan@google.com>
12102
12103 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
12104 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
12105 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
12106 formatting.
12107 (Arm_relocate_functions::thm_call): Replace body with a call to
12108 Arm_relocate_functions::thumb_branch_common.
12109 (Arm_relocate_functions::thm_jump24,
12110 Arm_relocate_functions::thm_xpc22): New method definitions.
12111 (Arm_relocate_functions::thumb_branch_common): New method definition.
12112 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
12113 operator.
12114 (Target_arm::Relocate::relocate): Adjust call to thm_call.
12115 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
12116
e2b8f3c4
RÁE
121172009-11-24 Rafael Avila de Espindola <espindola@google.com>
12118
12119 * Makefile.am: Build incremental-dump
12120 * Makefile.in: Regenerate.
12121 * incremental-dump.cc: New.
12122 * incremental.cc (Incremental_inputs_header_data,
12123 Incremental_inputs_entry_data): Move to incremental.h
12124 * incremental.h: (Incremental_inputs_header_data,
12125 Incremental_inputs_entry_data): Move from incremental.cc
12126
bcba9aec
RÁE
121272009-11-24 Rafael Avila de Espindola <espindola@google.com>
12128
12129 * incremental.cc (Incremental_inputs_header,
12130 Incremental_inputs_header_write, Incremental_inputs_entry,
12131 Incremental_inputs_entry_write): Add a typedef with the data type.
12132
7c3afe08
RÁE
121332009-11-24 Rafael Avila de Espindola <espindola@google.com>
12134
12135 * incremental.cc (Incremental_inputs_header,
12136 Incremental_inputs_header_write, Incremental_inputs_entry,
12137 Incremental_inputs_entry_write): Update comment about which
12138 type has the filed descriptions.
12139
d204b6e9
DK
121402009-11-15 Doug Kwan <dougkwan@google.com>
12141
12142 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
12143 (Arm_relocate_functions::arm_branch_common): Change method defintion
12144 in class definition to a method declaration and update list of formal
12145 parameters.
12146 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
12147 Arm_relocation_functions::jump24): Adjust call to
12148 Arm_relocate_functions::arm_branch_common. Update list of formal
12149 parameters.
12150 (Arm_relocate_functions::xpc25): New method definition.
12151 (Arm_relocate_functions::arm_branch_common): Move method defintion
12152 out from class definition. Use stubs for mode-switching and extending
12153 branch ranges.
12154 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
12155 specially. Change code to enable use of stubs in ARM branches.
12156
43d12afe
DK
121572009-11-10 Doug Kwan <dougkwan@google.com>
12158
12159 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
12160 in method declaration.
12161 (Target_arm::relocate_stub): New method declaration.
12162 (Target_arm::default_target): Change to return a pointer instead of
12163 a const reference.
12164 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
12165 Target_arm::default_target.
12166 (Arm_Relobj::do_relocate_sections): Remove options paramater in
12167 method definition.
12168 (Target_arm::relocate_section): Adjust view.
12169 (Target_arm::relocate_stub): New method definition.
12170
ac33a407
DK
121712009-11-10 Doug Kwan <dougkwan@google.com>
12172
12173 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
12174 a format warning.
12175 * incremental.cc (open_incremental_binary): Initialized local
12176 variables to avoid warnings.
12177 * object.cc (make_elf_object): Ditto.
12178 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
12179 a format warning.
e1df38aa 12180
88ee28e9
L
12181009-11-09 H.J. Lu <hongjiu.lu@intel.com>
12182
12183 PR gold/10930
12184 * testsuite/plugin_test.c: Include "config.h".
12185
2daedcd6
DK
121862009-11-09 Doug Kwan <dougkwan@google.com>
12187
12188 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
12189 (arm_symbol_value): Remove.
12190 (Arm_relocate_functions::arm_branch_common,
12191 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
12192 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
12193 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
12194 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
12195 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
12196 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
12197 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
12198 Arm_relocate_functions::thm_mobw_abs_nc,
12199 Arm_relocate_functions::thm_mov_abs,
12200 Arm_relocate_functions::movw_prel_nc,
12201 Arm_relocate_functions::thm_movt_abs,
12202 Arm_relocate_functions::movt_prel,
12203 Arm_relocate_functions::thm_movw_prel_nc,
12204 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
12205 (Target_arm::Relocate::relocate): Only decompose address into two
12206 parts if relocation type uses the thumb-bit and pass the actual
12207 bit instead of a flag indicating that the thumb-bit is used. Adjust
12208 calls to methods in Arm_relocate_functions for this change.
12209
1276bc89 122102009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
12211
12212 PR 10925
12213 * reloc.cc: Instantiate
12214 Sized_relobj::initialize_input_to_output_maps and
12215 Sized_relobj:free_input_to_output_maps.
12216
e53ad1b5
ILT
122172009-11-06 Ian Lance Taylor <iant@google.com>
12218
12219 PR 10876
12220 * defstd.cc (in_segment): Set only_if_ref true for "end".
12221
eb44217c
DK
122222009-11-06 Doug Kwan <dougkwan@google.com>
12223
12224 * arm.cc (class Reloc_stub): Correct a comment.
12225 (Target_arm::Target_arm): Initialize arm_input_section_map_.
12226 (Target_arm::scan_section_for_stubs): New method declaration.
12227 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
12228 Change methods from private to protected.
12229 (Target_arm::do_may_relax): New method definition.
12230 (Target_arm::do_relax, Target_arm::group_sections,
12231 Target_arm::scan_reloc_for_stub,
12232 Target_arm::scan_reloc_section_for_stubs): New method declarations.
12233 (Target_arm::arm_input_section_map_): New data member declaration.
12234 (Target_arm::scan_reloc_for_stub,
12235 Target_arm::scan_reloc_section_for_stubs,
12236 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
12237 Target_arm::do_relax): New method definitions.
12238
5d329b7d
ILT
122392009-11-06 Mikolaj Zalewski <mikolaj@google.com>
12240
12241 * configure.ac: Check for (struct stat)::st_mtim
12242 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
12243 * config.in: Regenerate.
12244 * configure: Regenerate.
12245
96a0d71b
ILT
122462009-11-05 Ian Lance Taylor <iant@google.com>
12247
12248 PR 10910
12249 * output.cc (Output_segment::add_output_section): Add missing
12250 return statement.
12251
594c8e5e
ILT
122522009-11-04 Ian Lance Taylor <iant@google.com>
12253
12254 PR 10880
12255 * object.h (class Object): Add is_needed and set_is_needed
12256 methods. Add is_needed_ field. Make bool fields into bitfields.
12257 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
12258 defined in a dynamic object and referenced by a regular object,
12259 set is_needed for the dynamic object.
12260 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
12261 if the file is marked with as_needed and it is not needed.
12262
22b127cc
ILT
122632009-11-04 Ian Lance Taylor <iant@google.com>
12264
12265 PR 10887
12266 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
12267 tags if data is discarded by linker script.
12268 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12269 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12270 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12271 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12272
f5c870d2
ILT
122732009-11-04 Ian Lance Taylor <iant@google.com>
12274
12275 * layout.cc (Layout::get_output_section): Add is_interp and
12276 is_dynamic_linker_section parameters. Change all callers.
12277 (Layout::choose_output_section): Likewise.
12278 (Layout::make_output_section): Likewise.
12279 (Layout::add_output_section_data): Add is_dynamic_linker_section
12280 parameter. Change all callers.
12281 * layout.h (class Layout): Update declarations.
12282 * output.h (class Output_section): Add is_interp, set_is_interp,
12283 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
12284 Add is_interp_, is_dynamic_linker_section_ fields. Change
12285 generate_code_fills_at_write_ to a bitfield.
12286 * output.cc (Output_section::Output_sections): Initialize new
12287 fields.
12288 (Output_segment::add_output_section): Add do_sort parameter.
12289 Change all callers.
12290
1ae4d23b
ILT
122912009-11-03 Ian Lance Taylor <iant@google.com>
12292
12293 PR 10860
12294 * options.h (class General_options): Add --warn-common.
12295 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
12296 merging two common symbols.
12297 (Symbol_table::should_override): Handle --warn-common when merging
12298 a common symbol with a defined symbol. Use report_resolve_problem
12299 for multiple definitions.
12300 (Symbol_table::report_resolve_problem): New function.
12301 * symtab.h (class Symbol_table): Declare report_resolve_problem.
12302
55da9579
DK
123032009-11-03 Doug Kwan <dougkwan@google.com>
12304
12305 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
12306 stub_factory_.
12307 (Target_arm::stub_factory): New method definition.
12308 (Target_arm::new_arm_input_section,
12309 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
12310 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 12311 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
12312 New type definitions.
12313 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
12314 member declarations.
12315 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
12316 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
12317 New method definitions.
12318
37a9ac43
ILT
123192009-11-03 Ian Lance Taylor <iant@google.com>
12320
12321 * options.h (class General_options): Add --warn_constructors.
12322
b3d6a3d4
ILT
123232009-11-03 Ian Lance Taylor <iant@google.com>
12324
12325 PR 10893
12326 * defstd.cc (in_section): Add entries for __rel_iplt_start,
12327 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
12328
934b01dd
ILT
123292009-11-03 Ian Lance Taylor <iant@google.com>
12330
12331 PR 10895
12332 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
12333 --msgid-bugs-address.
12334 (install-pdf): New target.
12335 (install-data_yes): Look up one directory to find mkinstalldirs.
12336
03c1939b
L
123372009-11-03 H.J. Lu <hongjiu.lu@intel.com>
12338
12339 * po/Make-in (.po.gmo): Don't generate .gmo files in source
12340 tree.
12341
ebd95253
DK
123422009-10-30 Doug Kwan <dougkwan@google.com>
12343
12344 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
12345
e9bbb538
DK
123462009-10-30 Doug Kwan <dougkwan@google.com>
12347
12348 * arm.cc (Stub_addend_reader): New struct template definition
12349 and partial specializations.
12350 (Stub_addend_reader::operator()): New method definition for a
12351 partially specialized template.
12352
d5b40221
DK
123532009-10-30 Doug Kwan <dougkwan@google.com>
12354
12355 * arm.cc (Arm_relobj::processor_specific_flags): New method
12356 definition.
12357 (Arm_relobj::do_read_symbols): New method declaration.
12358 (Arm_relobj::processor_specific_flags_): New data member declaration.
12359 (Arm_dynobj): New class definition.
12360 (Target_arm::do_finalize_sections): Add input_objects parameter.
12361 (Target_arm::do_adjust_elf_header): New method declaration.
12362 (Target_arm::are_eabi_versions_compatible,
12363 (Target_arm::merge_processor_specific_flags): New method declaration.
12364 (Target_arm::do_make_elf_object): New overloaded method definitions
12365 and declaration.
12366 (Arm_relobj::do_read_symbols): New method definition.
12367 (Arm_dynobj::do_read_symbols): Ditto.
12368 (Target_arm::do_finalize_sections): Add input_objects parameters.
12369 Merge processor-specific flags from all input objects.
12370 (Target_arm::are_eabi_versions_compatible,
12371 Target_arm::merge_processor_specific_flags,
12372 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
12373 New method definitions.
12374 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
12375 Input_objects pointer type parameter.
12376 * layout.cc (Layout::finalize): Pass input objects to target's.
12377 finalize_sections function.
12378 * output.cc (Output_file_header::do_sized_write): Set ELF file
12379 header's processor-specific flags.
12380 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
12381 Input_objects pointer type parameter.
12382 * sparc.cc (Target_sparc::do_finalize_sections): Same.
12383 * target.h (Input_objects): New forward class declaration.
12384 (Target::processor_specific_flags,
12385 Target::are_processor_specific_flags_sect): New method definitions.
12386 (Target::finalize_sections): Add input_objects parameter.
12387 (Target::Target): Initialize processor_specific_flags_ and
12388 are_processor_specific_flags_set_.
12389 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
12390 parameter.
12391 (Target::set_processor_specific_flags): New method definition.
12392 (Target::processor_specific_flags_,
12393 Target::are_processor_specific_flags_set_): New data member
12394 declarations.
12395 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
12396 Input_objects pointer type parameter.
12397
ebabffbd
DK
123982009-10-30 Doug Kwan <dougkwan@google.com>
12399
12400 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
12401
ad0f2072
ILT
124022009-10-28 Ian Lance Taylor <iant@google.com>
12403
12404 * object.h (class Relobj): Drop options parameter from
12405 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
12406 do_scan_relocs, do_relocate. Change all callers.
12407 (class Sized_relobj): Drop options parameters from
12408 do_gc_process_relocs, do_scan_relocs, do_relocate,
12409 do_relocate_sections, relocate_sections, emit_relocs_scan,
12410 emit_relocs_scan_reltype. Change all callers.
12411 (struct Relocate_info): Remove options field and all references to
12412 it.
12413 * reloc.h (class Read_relocs): Remove options constructor
12414 parameter and options_ field. Change all callers.
12415 (class Gc_process_relocs, class Scan_relocs): Likewise.
12416 (class Relocate_task): Likewise.
12417 * target-reloc.h (scan_relocs): Remove options parameter. Change
12418 all callers.
12419 (scan_relocatable_relocs): Likewise.
12420 * target.h (class Sized_target): Remove options parameter from
12421 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
12422 all callers.
12423 * gc.h (gc_process_relocs): Remove options parameter. Change all
12424 callers.
12425 * arm.cc: Update functions to remove options parameters.
12426 * i386.cc: Likewise.
12427 * powerpc.cc: Likewise.
12428 * sparc.cc: Likewise.
12429 * x86_64.cc: Likewise.
12430 * testsuite/testfile.cc: Likewise.
12431
8ffa3667
DK
124322009-10-28 Doug Kwan <dougkwan@google.com>
12433
12434 * arm.cc (Arm_relobj): New class definition.
e1df38aa 12435 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
12436 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
12437 New method definitions.
12438
40f36857
CC
124392009-10-28 Cary Coutant <ccoutant@google.com>
12440
12441 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
12442 (Plugin::cleanup_done_): New member.
12443 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
12444 (Plugin_manager::cleanup_done_): Remove.
12445 (Plugin_manager::add_input_file): Edit error message.
12446 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
12447 (Plugin_manager::cleanup): Remove use of cleanup_done_.
12448
2c849493
ILT
124492009-10-27 Mikolaj Zalewski <mikolajz@google.com>
12450
12451 * fileread.cc: (File_read::View::~View): Use the new
12452 data_ownership_ filed.
12453 (File_read::~File_read): Dispose the new whole_file_view_.
12454 (File_read::open): Mmap the whole file if needed.
12455 (File_read::open): Use whole_file_view_ instead of contents_.
12456 (File_read::find_view): Use whole_file_view_ if applicable.
12457 (File_read::do_read): Use whole_file_view_ instead of contents_.
12458 (File_read::make_view): Use whole_file_view_ instead of contents_,
12459 update File_read::View::View call.
12460 (File_read::find_or_make_view): Update File_read::View::View
12461 call.
12462 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
12463 remove contents_
12464 (File_read::View::Data_ownership): New enum.
12465 (File_read::View::View): Replace bool mapped_ with Data_ownership
12466 argument.
12467 (File_read::View::mapped_): Remove (replaced by data_ownership_).
12468 (File_read::View::data_ownership_): New field.
12469 (File_read::contents_): Remove (replaced by whole_file_view_).
12470 (File_read::whole_file_view_): New field.
12471 * options.h (class General_options): Add --keep-files-mapped.
12472
24998053
CC
124732009-10-27 Cary Coutant <ccoutant@google.com>
12474
12475 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
12476 * testsuite/Makefile.am (plugin_test_5): New test case.
12477 * testsuite/Makefile.in: Regenerate.
12478
72adc4fa
DK
124792009-10-25 Doug Kwan <dougkwan@google.com>
12480
12481 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
12482 from private to protected to allow access by child class.
12483 (Sized_relobj::do_relocate_sections): New method declaration.
12484 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 12485 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
12486 Sized_relobj::relocate_sections. Instantiate template explicitly
12487 for different target sizes and endianity.
12488
07f508a2
DK
124892009-10-24 Doug Kwan <dougkwan@google.com>
12490
12491 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
12492 (Arm_input_section::as_arm_input_section): New method.
12493 (Arm_output_section): New class definition.
12494 (Arm_output_section::create_stub_group,
12495 Arm_output_section::group_sections): New method definitions.
12496
10ad9fe5
DK
124972009-10-22 Doug Kwan <dougkwan@google.com>
12498
12499 * arm.cc (Arm_input_section): New class definition.
12500 (Arm_input_section::init, Arm_input_section:do_write,
12501 Arm_input_section::set_final_data_size,
12502 Arm_input_section::do_reset_address_and_file_offset): New method
12503 definitions.
12504
56ee5e00
DK
125052009-10-21 Doug Kwan <dougkwan@google.com>
12506
12507 * arm.cc (Stub_table, Arm_input_section): New forward class
12508 declarations.
12509 (Stub_table): New class defintion.
12510 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
12511 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
12512 New method definition.
12513
b569affa
DK
125142009-10-21 Doug Kwan <dougkwan@google.com>
12515
12516 * arm.cc: Update copyright comments.
12517 (Target_arm): New forward class template declaration.
12518 (Arm_address): New type.
12519 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
12520 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
12521 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
12522 constants.
12523 (Insn_template): Same.
12524 (DEF_STUBS): New macro.
12525 (Stub_type): New enum type.
12526 (Stub_template): New class definition.
12527 (Stub): Same.
12528 (Reloc_stub): Same.
12529 (Stub_factory): Same.
12530 (Target_arm::Target_arm): Initialize may_use_blx_ and
12531 should_force_pic_veneer_.
12532 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
12533 Target_arm::should_force_pic_veneer,
12534 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
12535 Target_arm::using_thumb_only, Target_arm:;default_target): New
12536 method defintions.
12537 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
12538 New data member declarations.
12539 (Insn_template::size, Insn_template::alignment): New method defintions.
12540 (Stub_template::Stub_template): New method definition.
12541 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
12542 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
12543 (Stub_factory::Stub_factory): New method definition.
12544 * gold.h (string_hash): New template.
12545 * output.h (Input_section_specifier::hash_value): Use
12546 gold::string_hash.
12547 (Input_section_specifier::string_hash): Remove.
12548 * stringpool.cc (Stringpool_template::string_hash): Use
12549 gold::string_hash.
12550
6c172549
DK
125512009-10-20 Doug Kwan <dougkwan@google.com>
12552
12553 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
12554 symbols of relaxed input sections.
12555 * output.h (Output_section::find_relaxed_input_section): Make
12556 method public.
12557
c5617f2f
DK
125582009-10-16 Doug Kwan <dougkwan@google.com>
12559
12560 * dynobj.cc (Versions::Versions): Initialize version_script_.
12561 Only insert base version symbol definition for a shared object
12562 if version script defines any version versions.
12563 (Versions::define_base_version): New method definition.
12564 (Versions::add_def): Check that base version is not needed.
12565 (Versions::add_need): Define base version lazily.
12566 * dynobj.h (Versions::define_base_version): New method declaration.
12567 (Versions::needs_base_version_): New data member declaration.
12568 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
12569 (check_DATA): Add no_version_test.stdout.
12570 (libno_version_test.so, no_version_test.o no_version_test.stdout):
12571 New make rules.
12572 * testsuite/Makefile.in: Regenerate.
12573 * testsuite/no_version_test.c: New file.
12574 * testsuite/no_version_test.sh: Ditto.
12575
3c12dcdb
DK
125762009-10-16 Doug Kwan <dougkwan@google.com>
12577
12578 * expression.cc (class Segment_start_expression): New class definition.
12579 (Segment_start_expression::value): New method definition.
12580 (script_exp_function_segment_start): Return a new
12581 Segment_start_expression.
12582 * gold/script-c.h (script_saw_segment_start_expression): New function
12583 prototype.
12584 * script-sections.cc (Script_sections::Script_sections): Initialize
12585 SAW_SEGMENT_START_EXPRESSION_ to false.
12586 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
12587 and -Tbbs options to specify section addresses if given in
12588 command line and no SEGMENT_START expression is seen in a script.
12589 * script-sections.h (Script_sections::saw_segment_start_expression,
12590 Script_sections::set_saw_segment_start_expression): New method
12591 definition.
12592 (Script_sections::saw_segment_start_expression_): New data member
12593 declaration.
12594 * script.cc (script_saw_segment_start_expression): New function.
12595 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
12596 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
12597 script_test_7.sh and script_test_8.sh.
12598 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
12599 script_test_8.stdout.
12600 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
12601 (script_test_6, script_test_6.stdout, script_test_7,
12602 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
12603 * Makefile.in: Regenerate.
12604 * testsuite/script_test_6.sh: New file.
12605 * testsuite/script_test_6.t: Same.
12606 * testsuite/script_test_7.sh: Same.
12607 * testsuite/script_test_7.t: Same.
12608 * testsuite/script_test_8.sh: Same.
12609
64b1ae37
DK
126102009-10-16 Doug Kwan <dougkwan@google.com>
12611
12612 * output.cc (Output_segment::set_section_list_address): Cast
12613 expressions to unsigned long long type to avoid format warnings.
12614
661be1e2
ILT
126152009-10-15 Ian Lance Taylor <iant@google.com>
12616
12edd763 12617 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 12618 dot assignment to script_sections_.
12edd763
ILT
12619 * script-sections.cc (Script_sections::add_dot_assignment):
12620 Initialize if necessary.
12621
68b6574b
ILT
12622 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
12623 program headers with no load segment if there is a linker script.
12624
661be1e2
ILT
12625 * layout.cc (Layout::set_segment_offsets): Align the file offset
12626 to the segment aligment for -N or -n with no load segment.
12627 * output.cc (Output_segment::add_output_section): Don't crash if
12628 the first section is a TLS section.
12629 (Output_segment::set_section_list_addresses): Print an error
12630 message if the address moves backward in a linker script.
12631 * script-sections.cc
12632 (Output_section_element_input::set_section_addresses): Don't
12633 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
12634 (Orphan_output_section::set_section_addresses): Likewise.
12635
f15f61a7
DK
126362009-10-15 Doug Kwan <dougkwan@google.com>
12637
12638 * layout.cc (Layout::finish_dynamic_section): Generate tags
12639 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
12640 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
12641 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
12642
82bb573a
ILT
126432009-10-14 Ian Lance Taylor <iant@google.com>
12644
12645 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
12646 fields.
12647 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
12648 data_shdr fields of relinfo.
12649 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
12650 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
12651 R_386_TLS_LDO_32, adjust based on section flags.
12652 (Target_i386::Relocate::fix_up_ldo): Remove.
12653
374ad285
ILT
126542009-10-13 Ian Lance Taylor <iant@google.com>
12655
12656 Add support for -pie.
12657 * options.h (class General_options): Add -pie and
12658 --pic-executable.
12659 (General_options::output_is_position_independent): Test -pie.
12660 (General_options::output_is_executable): Return true if not shared
12661 and not relocatable.
12662 (General_options::output_is_pie): Remove.
12663 * options.cc (General_options::finalize): Reject incompatible uses
12664 of -pie.
12665 * gold.cc (queue_middle_tasks): A -pie link is not static.
12666 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
12667 * symtab.cc (Symbol::final_value_is_known): Return false if
12668 output_is_position_independent.
12669 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
12670 output_is_position_independent.
12671 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
12672 output_is_position_independent.
12673 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
12674 output_is_position_independent.
12675 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
12676 two_file_pie_test.
12677 (basic_pie_test.o, basic_pie_test): New targets.
12678 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
12679 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
12680 (two_file_pie_test): New target.
12681 * testsuite/Makefile.in: Rebuild.
12682 * README: Remove note saying that -pie is not supported.
12683
c6585162
ILT
126842009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
12685
12686 * options.h (class General_options): Add -init and -fini.
12687 * layout.cc (Layout::finish_dynamic_section): Emit
12688 given init and fini functions.
12689
032ce4e9
ST
126902009-10-13 Sriraman Tallam <tmsriram@google.com>
12691
12692 * gc.h (gc_process_relocs): Check if icf is enabled using new
12693 function.
12694 * gold.cc (queue_initial_tasks): Likewise.
12695 (queue_middle_tasks): Likewise.
12696 * object.cc (do_layout): Likewise.
12697 * symtab.cc (is_section_folded): Likewise.
12698 * main.cc (main): Likewise.
12699 * reloc.cc (Read_relocs::run): Likewise.
12700 (Sized_relobj::do_scan_relocs): Likewise.
12701 * icf.cc (is_function_ctor_or_dtor): New function.
12702 (Icf::find_identical_sections): Check if function is ctor or dtor when
12703 safe icf is chosen.
12704 * options.h (General_options::icf): Change option to be an enum.
12705 (Icf_status): New enum.
12706 (icf_enabled): New method.
12707 (icf_safe_folding): New method.
12708 (set_icf_status): New method.
12709 (icf_status_): New variable.
12710 * (options.cc) (General_options::finalize): Set icf_status_.
12711 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
12712 icf_test and icf_keep_unique_test to use the --icf enum flag.
12713 * testsuite/icf_safe_test.sh: New file.
e1df38aa 12714 * testsuite/icf_safe_test.cc: New file.
032ce4e9 12715
f345227a
ST
127162009-10-12 Sriraman Tallam <tmsriram@google.com>
12717
12718 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
12719 includes to gc.h and icf.h.
12720 * arm.cc: Include gc.h.
12721 * gold.cc: Likewise.
12722 * i386.cc: Likewise.
12723 * powerpc.cc: Likewise.
12724 * sparc.cc: Likewise.
12725 * x86_64.cc: Likewise.
12726 * gc.h: Include icf.h.
12727
1c7814ed
ILT
127282009-10-11 Ian Lance Taylor <iant@google.com>
12729
12730 * plugin.cc: Include "gold.h" before other header files.
12731
ae3b5189
CD
127322009-10-10 Chris Demetriou <cgd@google.com>
12733
12734 * options.h (Input_file_argument::Input_file_type): New enum.
12735 (Input_file_argument::is_lib_): Replace with...
12736 (Input_file_argument::type_): New member.
12737 (Input_file_argument::Input_file_argument): Take Input_file_type
12738 'type' rather than boolean 'is_lib' as second argument.
12739 (Input_file_argument::is_lib): Use type_.
12740 (Input_file_argument::is_searched_file): New function.
12741 (Input_file_argument::may_need_search): Handle is_searched_file.
12742 * options.cc (General_options::parse_library): Support -l:filename.
12743 (General_options::parse_just_symbols): Update for Input_file_argument
12744 changes.
12745 (Command_line::process): Likewise.
12746 * archive.cc (Archive::get_file_and_offset): Likewise.
12747 * plugin.cc (Plugin_manager::release_input_file): Likewise.
12748 * script.cc (read_script_file, script_add_file): Likewise.
12749 * fileread.cc (Input_file::Input_file): Likewise.
12750 (Input_file::will_search_for): Handle is_searched_file.
12751 (Input_file::open): Likewise.
12752 * readsyms.cc (Read_symbols::get_name): Likewise.
12753 * testsuite/Makefile.am (searched_file_test): New test.
12754 * testsuite/Makefile.in: Regenerate.
12755 * testsuite/searched_file_test.cc: New file.
12756 * testsuite/searched_file_test_lib.cc: New file.
12757
f3048a1d
ILT
127582009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12759 Ian Lance Taylor <iant@google.com>
12760
12761 * descriptor.cc: Include <cstdio> and "binary-io.h".
12762 (Descriptors::open): Open the files in binary mode always.
12763 * script.cc (Lex::get_token): Treat \r as whitespace.
12764
d4780e57
ILT
127652009-10-09 Ian Lance Taylor <iant@google.com>
12766
12767 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
12768
d9a893b8
ILT
127692009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12770 Ian Lance Taylor <iant@google.com>
12771
12772 * configure.ac: Check for readv function also.
12773 * fileread.cc (readv): Define if not HAVE_READV.
12774 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
12775 does not exist.
12776 * config.in: Regenerate.
12777 * configure: Regenerate.
12778
c0a62865
DK
127792009-10-09 Doug Kwan <dougkwan@google.com>
12780
12781 * layout.cc (Layout::make_output_section): Call target hook to make
12782 ordinary output section.
12783 (Layout::finalize): Adjust parameter list of call the
12784 Target::may_relax().
12785 * layout.h (class Layout::section_list): New method.
12786 * merge.h (Output_merge_base::entsize): Change visibility to public.
12787 (Output_merge_base::is_string, Output_merge_base::do_is_string):
12788 New methods.
12789 (Output_merge_string::do_is_string): New method.
12790 * object.cc (Sized_relobj::do_setup): renamed from
12791 Sized_relobj::set_up.
12792 * object.h (Sized_relobj::adjust_shndx,
12793 Sized_relobj::initializ_input_to_output_maps,
12794 Sized_relobj::free_input_to_output_maps): Change visibilities to
12795 protected.
12796 (Sized_relobj::setup): Virtualize.
12797 (Sized_relobj::do_setup): New method declaration.
12798 (Sized_relobj::invalidate_section_offset,
12799 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
12800 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
12801 * options.cc (parse_int): New function.
12802 * options.h (parse_int): New declaration.
12803 (DEFINE_int): New macro.
12804 (stub_group_size): New option.
12805 * output.cc (Output_section::Output_section): Initialize memebers
12806 merge_section_map_, merge_section_by_properties_map_,
12807 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
12808 (Output_section::add_input_section): Handled deferred code-fill
12809 generation and remove an old comment.
12810 (Output_section::add_relaxed_input_section): New method definition.
12811 (Output_section::add_merge_input_section): Use merge section by
12812 properties map to speed to search. Update merge section maps
12813 as appropriate.
12814 (Output_section::build_relaxation_map): New method definition.
12815 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
12816 Same.
12817 (Output_section::relax_input_section): Renamed to
12818 Output_section::convert_input_sections_to_relaxed_sections and change
12819 interface to take a vector of pointers to relaxed sections.
12820 (Output_section::find_merge_section,
12821 Output_section::find_relaxed_input_section): New method definitions.
12822 (Output_section::is_input_address_mapped,
12823 Output_section::output_offset, Output_section::output_address):
12824 Use output section data maps to speed up searching.
12825 (Output_section::find_starting_output_address): Add comments.
12826 (Output_section::do_write,
12827 Output_section::write_to_postprocessing_buffer): Do code-fill
12828 generation as appropriate.
12829 (Output_section::get_input_sections): Invalidate relaxed input section
12830 map.
12831 (Output_section::restore_states): Adjust type of checkpoint .
12832 Invalidate relaxed input section map.
12833 * output.h (Output_merge_base): New class declaration.
12834 (Input_section_specifier): New class defintion.
12835 (class Output_relaxed_input_section) Change base class to
12836 Output_section_data_build.
12837 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
12838 base class initializer.
12839 (Output_section::add_relaxed_input_section): New method declaration.
12840 (Output_section::Input_section): Change visibility to protected.
2e702c99 12841 (Output_section::Input_section::relobj,
c0a62865
DK
12842 Output_section::Input_section::shndx): Handle relaxed input sections.
12843 Output_section::input_sections) Change visibility to protected. Also
12844 define overload to return a non-const pointer.
12845 (Output_section::Merge_section_properties): New class defintion.
12846 (Output_section::Merge_section_by_properties_map,
12847 Output_section::Output_section_data_by_input_section_map,
12848 Output_section::Relaxation_map): New types.
12849 (Output_section::relax_input_section): Rename method to
12850 Output_section::convert_input_sections_to_relaxed_sections and change
12851 interface to take a vector of relaxed section pointers.
12852 (Output_section::find_merge_section,
12853 Output_section::find_relaxed_input_section,
12854 Output_section::build_relaxation_map,
12855 Output_section::convert_input_sections_in_list_to_relaxed_sections):
12856 New method declarations.
12857 (Output_section::merge_section_map_
12858 Output_section::merge_section_by_properties_map_,
12859 Output_section::relaxed_input_section_map_,
12860 Output_section::is_relaxed_input_section_map_valid_,
12861 Output_section::generate_code_fills_at_write_): New data members.
12862 * script-sections.cc
12863 (Output_section_element_input::set_section_addresses): Call
12864 current_data_size and addralign methods of relaxed input sections.
12865 (Orphan_output_section::set_section_addresses): Call current_data_size
12866 and addralign methods of relaxed input sections.
12867 * symtab.cc (Symbol_table::compute_final_value): Extract template
12868 from the body of Symbol_table::sized_finalize_symbol.
12869 (Symbol_table::sized_finalized_symbol): Call
12870 Symbol_table::compute_final_value.
12871 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
12872 (Symbol_table::compute_final_value): New templated method declaration.
12873 * target.cc (Target::do_make_output_section): New method defintion.
12874 * target.h (Target::make_output_section): New method declaration.
12875 (Target::relax): Add more parameters for input objects, symbol table
12876 and layout. Adjust call to do_relax.
12877 (Target::do_make_output_section): New method declaration.
12878 (Target::do_relax): Add parameters for input objects, symbol table
12879 and layout.
12880
d446d6c4
ILT
128812009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12882
12883 * pread.c: Include stdio.h.
12884
bc06c745
ILT
128852009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12886
12887 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
12888 defined.
12889
75aea3d0
ILT
128902009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12891
12892 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
12893 Change read_shndx type to unsigned int.
12894 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12895 int.
12896 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12897 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
12898 Change read_shndx type to unsigned int.
12899 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12900 int.
12901 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12902 * layout.cc (Layout::create_symtab_sections): Cast the result of
12903 local_symcount * symsize to off_t in the gold_assert.
12904
be8fcb75
ILT
129052009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12906
12907 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
12908 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
12909 R_ARM_BASE_ABS.
12910 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
12911 (Arm_relocate_functions::thm_abs5): New function.
12912 (Arm_relocate_functions::abs12): New function.
12913 (Arm_relocate_functions::abs16): New function.
12914 (Arm_relocate_functions::base_abs): New function.
12915 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
12916 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
12917 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
12918 R_ARM_BASE_ABS.
12919 (Scan::global): Likewise.
12920 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
12921 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
12922 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
12923 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
12924 R_ARM_BASE_ABS.
12925
c2a122b6
ILT
129262009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12927
12928 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
12929 (Arm_relocate_functions::movt_prel): New function.
12930 (Arm_relocate_functions::thm_movw_prel_nc): New function.
12931 (Arm_relocate_functions::thm_movt_prel): New function.
12932 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
12933 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
12934 (Scan::global, Relocate::relocate): Likewise.
12935 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12936
c4aa1e2d
ILT
129372009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12938
12939 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
12940 Incremental_checker.
12941 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
12942 unsigned int.
12943 (class Incremental_inputs_header): New class.
12944 (Incremental_inputs_header_writer): Edit comment.
12945 (Incremental_inputs_entry): New class.
12946 (Incremental_inputs_entry_writer): Edit comment.
12947 (Sized_incremental_binary::do_find_incremental_inputs_section):
12948 Add *strtab_shndx parameter, fill it.
12949 (Sized_incremental_binary::do_check_inputs): New method.
12950 (Incremental_checker::can_incrementally_link_output_file): Use
12951 Sized_incremental_binary::check_inputs.
12952 (Incremental_inputs::report_command_line): Save command line in
12953 command_line_.
12954 * incremental.h:
12955 (Incremental_binary::find_incremental_inputs_section): New
12956 method.
12957 (Incremental_binary::do_find_incremental_inputs_section): Add
12958 strtab_shndx parameter.
12959 (Incremental_binary::do_check_inputs): New pure virtual method.
12960 (Sized_incremental_binary::do_check_inputs): Declare.
12961 (Incremental_checker::Incremental_checker): Add incremental_inputs
12962 parameter, use it to initialize incremental_inputs_.
12963 (Incremental_checker::incremental_inputs_): New field.
12964 (Incremental_checker::command_line): New method.
12965 (Incremental_checker::inputs): New method.
12966 (Incremental_checker::command_line_): New field.
12967
c549a694
ILT
129682009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12969
12970 * incremental.cc: Include <cstdarg> and "target-select.h".
12971 (vexplain_no_incremental): New function.
12972 (explain_no_incremental): New function.
12973 (Incremental_binary::error): New method.
12974 (Sized_incremental_binary::do_find_incremental_inputs_section): New
12975 method.
12976 (make_sized_incremental_binary): New function.
12977 (open_incremental_binary): New function.
12978 (can_incrementally_link_file): Add checks if output is ELF and has
12979 inputs section.
12980 * incremental.h: Include "elfcpp_file.h" and "output.h".
12981 (Incremental_binary): New class.
12982 (Sized_incremental_binary): New class.
12983 (open_incremental_binary): Declare.
12984 * object.cc (is_elf_object): Use
12985 elfcpp::Elf_recognizer::is_elf_file.
12986 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
12987 * output.h (Output_file::filesize): New method.
12988
fd3c5f0b
ILT
129892009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12990
12991 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
12992 New function.
12993 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
12994 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
12995 function.
12996 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
12997 function.
12998 (Arm_relocate_functions::movw_abs_nc): New function.
12999 (Arm_relocate_functions::movt_abs): New function.
13000 (Arm_relocate_functions::thm_movw_abs_nc): New function.
13001 (Arm_relocate_functions::thm_movt_abs): New function.
13002 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
13003 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
13004 (Scan::global): Likewise.
13005 (Relocate::relocate): Likewise.
13006 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13007
7f5309a5
ILT
130082009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13009
13010 * arm.cc (Arm_relocate_functions::got_prel) New function.
13011 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
13012 (Relocate::relocate): Likewise.
13013 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13014
364c7fa5
ILT
130152009-10-06 Ian Lance Taylor <iant@google.com>
13016
13017 * options.h (class General_options): Define
13018 split_stack_adjust_size parameter.
13019 * object.h (class Object): Add uses_split_stack_ and
13020 has_no_split_stack_ fields. Add uses_split_stack and
13021 has_no_split_stack accessor functions. Declare
13022 handle_split_stack_section.
13023 (class Reloc_symbol_changes): Define.
13024 (class Sized_relobj): Define Function_offsets. Declare
13025 split_stack_adjust, split_stack_adjust_reltype, and
13026 find_functions.
13027 * object.cc (Object::handle_split_stack_section): New function.
13028 (Sized_relobj::do_layout): Call handle_split_stack_section.
13029 * dynobj.cc (Sized_dynobj::do_layout): Call
13030 handle_split_stack_section.
13031 * reloc.cc (Sized_relobj::relocate_sections): Call
13032 split_stack_adjust for executable sections in split_stack
13033 objects. Pass reloc_map to relocate_section.
13034 (Sized_relobj::split_stack_adjust): New function.
13035 (Sized_relobj::split_stack_adjust_reltype): New function.
13036 (Sized_relobj::find_functions): New function.
13037 * target-reloc.h: Include "object.h".
13038 (relocate_section): Add reloc_symbol_changes parameter. Change
13039 all callers.
13040 * target.h (class Target): Add calls_non_split method. Declare
13041 do_calls_non_split virtual method. Declare match_view and
13042 set_view_to_nop.
13043 * target.cc: Include "elfcpp.h".
13044 (Target::do_calls_non_split): New function.
13045 (Target::match_view): New function.
13046 (Target::set_view_to_nop): New function.
13047 * gold.cc (queue_middle_tasks): Give an error if mixing
13048 split-stack and non-split-stack objects with -r.
13049 * i386.cc (Target_i386::relocate_section): Add
13050 reloc_symbol_changes parameter.
13051 (Target_i386::do_calls_non_split): New function.
13052 * x86_64.cc (Target_x86_64::relocate_section): Add
13053 reloc_symbol_changes parameter.
13054 (Target_x86_64::do_calls_non_split): New function.
13055 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
13056 parameter.
13057 * powerpc.cc (Target_powerpc::relocate_section): Add
13058 reloc_symbol_changes parameter.
13059 * sparc.cc (Target_sparc::relocate_section): Add
13060 reloc_symbol_changes parameter.
13061 * configure.ac: Call AM_CONDITIONAL for the default target.
13062 * configure: Rebuild.
13063 * testsuite/Makefile.am (TEST_AS): New variable.
13064 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
13065 (check_DATA): Add split_i386 and split_x86_64 files.
13066 (SPLIT_DEFSYMS): Define.
13067 (split_i386_[1234n].o): New targets.
13068 (split_i386_[124]): New targets.
13069 (split_i386_[1234r].stdout): New targets.
13070 (split_x86_64_[1234n].o): New targets.
13071 (split_x86_64_[124]): New targets.
13072 (split_x86_64_[1234r].stdout): New targets.
13073 (MOSTLYCLEANFILES): Add new executables.
13074 * testsuite/split_i386.sh: New file.
13075 * testsuite/split_x86_64.sh: New file.
13076 * testsuite/split_i386_1.s: New file.
13077 * testsuite/split_i386_2.s: New file.
13078 * testsuite/split_i386_3.s: New file.
13079 * testsuite/split_i386_4.s: New file.
13080 * testsuite/split_i386_n.s: New file.
13081 * testsuite/split_x86_64_1.s: New file.
13082 * testsuite/split_x86_64_2.s: New file.
13083 * testsuite/split_x86_64_3.s: New file.
13084 * testsuite/split_x86_64_4.s: New file.
13085 * testsuite/split_x86_64_n.s: New file.
13086 * testsuite/testfile.cc (Target_test): Update relocation_section
13087 function.
13088 * testsuite/Makefile.in: Rebuild.
13089
e8a9fcda
ILT
130902009-10-06 Ian Lance Taylor <iant@google.com>
13091
13092 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
13093 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
13094 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
13095 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
13096 the address on ldo_addrs_.
13097 (Target_i386::Relocate::fix_up_ldo): New function.
13098
e99daf92
ILT
130992009-10-06 Rafael Espindola <espindola@google.com>
13100
13101 * plugin.cc (add_input_library): New.
13102 (Plugin::load): Add add_input_library to tv.
13103 (Plugin_manager::add_input_file): Add the is_lib argument.
13104 (add_input_file): Update call to Plugin_manager::add_input_file.
13105 (add_input_library): New.
13106 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
13107
966d4097
DK
131082009-09-30 Doug Kwan <dougkwan@google.com>
13109
13110 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
13111 symbol and call Symbol::may_need_copy_reloc to determine if
13112 a copy reloc is needed.
13113 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
13114 nocopyreloc is given in command line.
13115 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
13116 given in command line.
13117 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
13118 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
13119 of the removed Target_i386::may_need_copy_reloc.
13120 * options.h (copyreloc): New option with default value false.
13121 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13122 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
13123 instead of the removed Target_powerpc::may_need_copy_reloc.
13124 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13125 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
13126 instead of the removed Target_sparc::may_need_copy_reloc.
13127 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
13128 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
13129 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
13130 instead of the removed Target_x86_64::may_need_copy_reloc.
13131
029ba973
ILT
131322009-09-30 Ian Lance Taylor <iant@google.com>
13133
13134 * object.h (class Object): Remove target_ field, and target,
13135 sized_target, and set_target methods.
13136 (Object::sized_target): Remove.
13137 (class Sized_relobj): Update declarations. Remove sized_target.
13138 * object.cc (Sized_relobj::setup): Remove target parameter.
13139 Change all callers.
13140 (Input_objects::add_object): Don't do anything with the target.
13141 (make_elf_sized_object): Add punconfigured parameter. Change all
13142 callers. Set or test parameter target.
13143 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
13144 Change all callers.
13145 * parameters.cc (Parameters::set_target): Change parameter type to
13146 be non-const.
13147 (Parameters::default_target): Remove.
13148 (set_parameters_target): Change parameter type to be non-const.
13149 (parameters_force_valid_target): New function.
13150 (parameters_clear_target): New function.
13151 * parameters.h (class Parameters): Update declarations. Remove
13152 default_target method. Add sized_target and clear_target
13153 methods. Change target_ to be non-const.
13154 (set_parameters_target): Update declaration.
13155 (parameters_force_valid_target): Declare.
13156 (parameters_clear_target): Declare.
13157 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
13158 as NULL if we aren't searching.
13159 (Add_symbols::run): Don't check for compatible target.
13160 * fileread.cc (Input_file::open_binary): Call
13161 parameters_force_valid_target.
13162 * gold.cc (queue_middle_tasks): Likewise.
13163 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
13164 set_target on object.
13165 * dynobj.h (class Sized_dynobj): Update declarations.
13166 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
13167 make_elf_object returns NULL.
13168 (Archive::include_member): Don't check whether object target is
13169 compatible.
13170 * output.cc (Output_section::add_input_section): Get target from
13171 parameters.
13172 (Output_section::relax_input_section): Likewise.
13173 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
13174 parameters.
13175 (Sized_relobj::do_scan_relocs): Likewise.
13176 (Sized_relobj::relocate_sections): Likewise.
13177 * resolve.cc (Symbol_table::resolve): Likewise.
13178 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
13179 parameter. Change all callers.
13180 (Symbol_table::add_from_object): Get target from parameters.
13181 (Symbol_table::add_from_relobj): Don't check object target.
13182 (Symbol_table::add_from_dynobj): Likewise.
13183 (Symbol_table::define_special_symbol): Get target from
13184 parameters.
13185 * symtab.h (class Symbol_table): Update declaration.
13186 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
13187 parameter. Change all callers. Clear parameter target.
13188 (Binary_test): Test target here.
13189 * testsuite/object_unittest.cc (gold_testsuite): Remove
13190 target_test_pointer parameter. Change all callers.
13191 (Object_test): Test target here.
13192
a6a22b83
ILT
131932009-09-26 Ian Lance Taylor <iant@google.com>
13194
13195 * testsuite/initpri1.c: Don't try to use constructor priorities if
13196 compiling with gcc before 4.3.
13197
6a8f49fe
ILT
131982009-09-22 Mikolaj Zalewski <mikolajz@google.com>
13199
13200 * testsuite/retain_symbols_file_test.sh (check_present): Change
13201 output file name to retain_symbols_file_test.stdout.
13202 (check_absent): Likewise.
13203
8c604651
CS
132042009-09-18 Craig Silverstein <csilvers@google.com>
13205
13206 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
13207 * options.cc: Include <cerrno> and <fstream>.
13208 (General_options::finalize): Parse -retain-symbols-file tag.
13209 * options.h: New flag.
13210 (General_options): New method should_retain_symbol, new
13211 variable symbols_to_retain.
13212 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
13213 should_retain_symbol map.
13214 * testsuite/Makefile.am (retain_symbols_file_test): New test.
13215 * testsuite/Makefile.in: Regenerate.
13216 * testsuite/retain_symbols_file_test.sh: New file.
13217
ca58b19f
NC
132182009-09-18 Nick Clifton <nickc@redhat.com>
13219
13220 * po/es.po: Updated Spanish translation.
13221
20e6d0d6
DK
132222009-09-17 Doug Kwan <dougkwan@google.com>
13223
13224 * debug.h (DEBUG_RELAXATION): New constant.
13225 (DEBUG_ALL): Add DEBUG_RELAXATION.
13226 (debug_string_to_enum): Add relaxation debug option.
13227 * layout.cc
13228 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
13229 Layout::Relaxation_debug_check::read_sections,
13230 Layout::Relaxation_debug_check::read_sections): New method definitions.
13231 (Layout::Layout): Initialize data members
13232 record_output_section_data_from_scrips_,
13233 script_output_section_data_list_ and relaxation_debug_check_.
13234 (Layout::save_segments, Layout::restore_segments,
13235 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13236 Layout::relaxation_loop_body): New method definitions.
13237 (Layout::finalize): Support relaxation. Move section layout code to
13238 Layout::relaxation_loop_body.
13239 (Layout::set_asection_address_from_script): Move code for orphan
13240 section placement out.
13241 (Layout::place_orphan_sections_in_script): New method definition.
13242 * layout.h (Output_segment_headers, Output_file_header):
13243 New forward class declarations.
13244 (Layout::~Layout): Define.
13245 (Layout::new_output_section_data_from_script): New method definition.
13246 (Layout::place_orphan_sections_in_script): New method declaration.
13247 (Layout::Segment_states): New type declaration.
13248 (Layout::save_segments, Layout::restore_segments,
13249 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13250 Layout::relaxation_loop_body): New method declarations.
13251 (Layout::Output_section_data_list): New type declaration.
13252 (Layout::Relaxation_debug_check): New class definition.
13253 (Layout::record_output_section_data_from_script_,
13254 Layout::script_output_section_data_list_, Layout::segment_states_,
13255 Layout::relaxation_debug_check_): New data members.
13256 * output.cc: (Output_section_headers::do_size): New method definition.
13257 (Output_section_headers::Output_section_headers): Move size
13258 computation to Output_section_headers::do_size.
13259 (Output_segment_headers::do_size): New method definition.
e1df38aa 13260 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
13261 Output_file_header::do_size and call it.
13262 (Output_file_header::do_size): New method definition.
13263 (Output_data_group::Output_data_group): Adjust call to
13264 Output_section_data.
13265 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
13266 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 13267 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
13268 RELAXED_INPUT_SECTION_CODE.
13269 (Output_section::Output_section): Initialize data member checkpoint_.
13270 (Output_section::~Output_section): Delete checkpoint object pointed
13271 by checkpoint_.
13272 (Output_section::add_input_section): Always add an Input_section if
13273 relaxing.
13274 (Output_section::add_merge_input_section): Add assert.
13275 (Output_section::relax_input_section): New method definition.
13276 (Output_section::set_final_data_size): Set load address to zero for
13277 an unallocated section.
13278 (Output_section::do_address_and_file_offset_have_reset_values):
13279 New method definition.
13280 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
13281 Handle relaxed input section.
13282 (Output_section::sort_attached_input_sections): Checkpoint input
13283 section list lazily.
13284 (Output_section::get_input_sections): Change type of input_sections to
13285 list of Simple_input_section pointers. Checkpoint input section list
13286 lazily. Also handle relaxed input sections.
13287 (Output_section::add_input_section_for_script): Take a reference to
13288 a Simple_input_section object instead of Relobj pointer and section
13289 index as parameter. Handle relaxed input sections.
13290 (Output_section::save_states, Output_section::restore_states): New
13291 method definitions.
13292 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
13293 (Output_data::is_data_size_fixed): New method definition.
13294 (Output_data::reset_addresss_and_file_offset): Do not reset data size
13295 if it is fixed.
13296 (Output_data::address_and_file_offset_have_reset_values): New method
13297 definition.
13298 (Output_data::do_address_and_file_offset_have_reset_values): New method
13299 definition.
13300 (Output_data::set_data_size): Check that data size is not fixed.
13301 (Output_data::fix_data_size): New method definition.
13302 (Output_data::is_data_size_fixed_): New data member.
13303 (Output_section_headers::set_final_data_size): New method definition.
13304 (Output_section_headers::do_size): New method declaration.
13305 (Output_segment_headers::set_final_data_size): New method definition.
13306 (Output_segment_headers::do_size): New method declaration.
13307 (Output_file_header::set_final_data_size)::New method definition.
13308 (Output_file_header::do_size)::New method declaration.
13309 (Output_section_data::Output_section_data): Add new parameter
13310 is_data_size_fixed and use it to fix data size.
13311 (Output_data_const::Output_data_const): Adjust call to base class
13312 constructor and fix data size.
13313 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
13314 base class constructor and fix data size.
13315 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
13316 base class constructor and fix data size.
13317 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
13318 class constructor and fix data size.
13319 (Output_data_group::set_final_data_size): New method definition.
13320 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
13321 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
13322 class constructor and fix data size.
13323 (Output_relaxed_input_section): New class definition.
13324 (Output_section::Simple_input_section): New class definition.
13325 (Output_section::get_input_sections): Adjust parameter list.
13326 (Output_section::add_input_section_for_script): Same.
13327 (Output_section::save_states, Output_section::restore_states,
13328 Output_section::do_address_and_file_offset_have_reset_values,
13329 (Output_section::Input_section::Input_section): Handle
13330 RELAXED_INPUT_SECTION_CODE. Add new overload for
13331 Output_relaxed_input_section.
13332 (Output_section::Input_section::is_input_section,
13333 Output_section::Input_section::set_output_section): Handle relaxed
13334 input section.
13335 (Output_section::Input_section::is_relaxed_input_section,
13336 Output_section::Input_section::output_section_data,
13337 Output_section::Input_section::relaxed_input_section): New method
13338 definitions.
13339 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
13340 value.
13341 (Output_section::Input_section::u1_): Update comments.
13342 (Output_section::Input_section::u2_): Add new union member poris.
13343 (Output_section::Checkpoint_output_section): New classs definition.
13344 (Output_section::relax_input_section): New method declaration.
13345 (Output_section::checkpoint_): New data member.
13346 (Output_segment): Update comments.
13347 (Output_segment::Output_segment): Un-privatize copy constructor.
13348 (Output_segment::operator=): Un-privatize.
13349 * script-sections.cc (Output_section_element::Input_section_list):
13350 Change element type to Output_section::Simple_input_section.
13351 (Output_section_element_dot_assignment::set_section_addresses):
13352 Register output section data for relaxation clean up.
13353 (Output_data_exression::Output_data_expression): Adjust call to base
13354 constructor to fix data size.
13355 (Output_section_element_data::set_section_addresses): Register
13356 Output_data_expression object for relaxation clean up.
13357 (struct Input_section_info): Replace Relobj pointer and section index
13358 pair with Output_section::Simple_input_section and Convert struct to a
13359 class.
13360 (Input_section_sorter::operator()): Adjust access to
e1df38aa 13361 Input_section_info data member to use accessors.
20e6d0d6
DK
13362 (Output_section_element_input::set_section_addresses): Use layout
13363 parameter. Adjust code to use Output_section::Simple_input_section
13364 and Input_secction_info classes. Register filler for relaxation
13365 clean up.
13366 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
13367 and section index pair with Output_section::Simple_input_section
13368 class. Adjust code accordingly.
13369 (Phdrs_element::release_segment): New method definition.
13370 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
13371 segment list.
13372 (Script_sections::release_segments): New method definition.
13373 * gold/script-sections.h (Script_sections::release_segments): New
13374 method declaration.
13375 * gold/target.h (Target::may_relax, Target::relax,
13376 Target::do_may_relax, Target::do_relax): New method definitions.
13377
5e445df6
ILT
133782009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13379
13380 * arm.cc (has_signed_unsigned_overflow): New function.
13381 (Arm_relocate_functions::abs8): New function.
13382 (Target_arm::Scan::local): Handle R_ARM_ABS8.
13383 (Target_arm::Scan::global): Likewise.
13384 (Target_arm::relocate::relocate): Likewise.
13385 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
13386 Likewise.
13387
8c604651 133882009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
13389
13390 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
13391 * testsuite/Makefile.in: Regenerate.
13392
1e9cc1c2
NC
133932009-09-11 Nick Clifton <nickc@redhat.com>
13394
13395 * po/gold.pot: Updated by the Translation project.
13396
6a89f575
CC
133972009-09-08 Cary Coutant <ccoutant@google.com>
13398
13399 * output.cc (Output_file::open): Add execute permission to empty file.
13400 * testsuite/Makefile.am (permission_test): New test.
13401 * testsuite/Makefile.in: Regenerate.
13402
fdcac5af
ILT
134032009-09-02 Ian Lance Taylor <iant@google.com>
13404
13405 * output.cc (Output_file::resize): Call map_no_anonymous rather
13406 than map.
13407
44453f85
ILT
134082009-09-01 Mikolaj Zalewski <mikolajz@google.com>
13409
13410 * gold.cc: Include "incremental.h".
13411 (queue_initial_tasks): Call Incremental_checker methods.
13412 * incremental.cc: Include "output.h".
13413 (Incremental_checker::can_incrementally_link_output_file): New
13414 method.
13415 * incremental.h (Incremental_checker): New class.
13416
13417 * output.cc (Output_file::open_for_modification): New method.
13418 (Output_file::map_anonymous): Changed return type to bool. Record
13419 map in base_ field.
13420 (Output_file::map_no_anonymous): New method, broken out of map.
13421 (Output_file::map): Use map_no_anonymous and map_anonymous.
13422 * output.h (class Output_file): Update declarations.
13423
293c1386
CC
134242009-08-24 Cary Coutant <ccoutant@google.com>
13425
13426 * options.h (Command_line::Pre_options): New class.
13427 (Command_line::pre_options): New member.
13428 * options.cc (gold::options::ready_to_register): New variable.
13429 (One_option::register_option): Do nothing if not registering options.
13430 Assert if same short option registered twice.
13431 (General_options::General_options): Turn off option registration when
13432 done constructing.
13433 (Command_line::Pre_options::Pre_options): New constructor.
13434
f773f3d2
CC
134352009-08-24 Cary Coutant <ccoutant@google.com>
13436
06a73cfe
CC
13437 * options.h (General_options::no_keep_memory): Remove incorrect
13438 short option.
f773f3d2 13439
a15af8e2
RW
134402009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13441
13442 * Makefile.am (am__skiplex, am__skipyacc): New.
13443 * Makefile.in: Regenerate.
13444
c462b41b
RW
134452009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13446
14ec8efd
RW
13447 * Makefile.am (AM_CPPFLAGS): Renamed from ...
13448 (INCLUDES): ... this.
13449 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
13450 (AM_CPPFLAGS): Renamed from ...
13451 (INCLUDE): ... this.
13452 * Makefile.in, testsuite/Makefile.in: Regenerate.
13453
81ecdfbb
RW
13454 * Makefile.in: Regenerate.
13455 * aclocal.m4: Likewise.
13456 * config.in: Likewise.
13457 * configure: Likewise.
13458 * testsuite/Makefile.in: Likewise.
13459
c462b41b
RW
13460 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13461 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13462 * Makefile.in: Regenerate.
13463 * testsuite/Makefile.in: Regenerate.
13464
2da73f13
CC
134652009-08-19 Cary Coutant <ccoutant@google.com>
13466
13467 * resolve.cc (Symbol_table::resolve): Don't complain about defined
13468 symbols in shared libraries overridden by hidden or internal symbols
13469 in the main program.
13470
2db70501
CD
134712009-08-19 Chris Demetriou <cgd@google.com>
13472
13473 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
13474 checking source file names in error messages.
13475
f733487b
DK
134762009-08-18 Doug Kwan <dougkwan@google.com>
13477
13478 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
13479 an elcpp::Ehdr as parameter. Adjust call to set_target.
13480 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
13481 an elfcpp::Ehdr as parameter.
13482 * object.cc (Object::set_target): Remove the version that looks up
13483 a target and sets it.
13484 (Sized_relobj::setup): Take a Target object instead of
13485 an elfcpp::Ehdr as parameter. Adjust call to set_target.
13486 (make_elf_sized_object): Find target and ask target to
13487 make an ELF object.
13488 * object.h: (Object::set_target): Remove the version that looks up
13489 a target and sets it.
13490 (Sized_relobj::setup): Take a Target object instead of
13491 an elfcpp:Ehdr as parameter.
13492 * target.cc: Include dynobj.h.
13493 (Target::do_make_elf_object_implementation): New.
2e702c99 13494 (Target::do_make_elf_object): New.
f733487b
DK
13495 * target.h (Target::make_elf_object): New template declaration.
13496 (Target::do_make_elf_object): New method declarations.
13497 (Target::do_make_elf_object_implementation): New template declaration.
13498
cc70f101
ILT
134992009-08-14 Ian Lance Taylor <iant@google.com>
13500
13501 * gold.h (FUNCTION_NAME): Define.
13502 (gold_unreachable): Use FUNCTION_NAME.
13503
ef5e0cb1
ST
135042009-08-12 Sriraman Tallam <tmsriram@google.com>
13505
13506 * icf.cc (Icf::find_identical_sections): Issue a warning when a
13507 symbol in the --keep-unique list is not found.
13508
48c187ce
ST
135092009-08-12 Sriraman Tallam <tmsriram@google.com>
13510
13511 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
13512 been maked as --keep-unique.
13513 (Icf::unfold_section): New function.
13514 * icf.h (Icf::unfold_section): New function.
13515 * options.h (General_options::keep_unique): New option.
13516 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
13517 * testsuite/Makefile.in: Regenerate.
13518 * testsuite/icf_keep_unique_test.sh: New file.
13519 * testsuite/icf_keep_unique_test.cc: New file.
13520
645afe0c
CC
135212009-08-12 Cary Coutant <ccoutant@google.com>
13522
13523 PR 10471
13524 * resolve.cc (Symbol_table::resolve): Check for references from
13525 dynamic objects to hidden and internal symbols.
13526 * testsuite/Makefile.am (hidden_test.sh): New test.
13527 * testsuite/Makefile.in: Regenerate.
13528 * testsuite/hidden_test.sh: New script.
13529 * testsuite/hidden_test_1.c: New test source.
13530 * testsuite/hidden_test_main.c: New test source.
13531
11af873f
DK
135322009-08-11 Doug Kwan <dougkwan@google.com>
13533
13534 * arm.cc: Update comments.
13535 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
13536 segment to locate the .ARM.exidx section if present.
13537
b9f7d72d
DK
135382009-08-09 Doug Kwan <dougkwan@google.com>
13539
13540 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
13541 patch.
13542
ddd3c53c
ST
135432009-08-07 Sriraman Tallam <tmsriram@google.com>
13544 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
13545 compiler warnings.
13546
27721062
ST
135472009-08-06 Sriraman Tallam <tmsriram@google.com>
13548
13549 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
13550 valid tls_segment only for non-debug-section relocations.
13551 * testsuite/Makefile.am: Add gc_tls_test.
13552 * testsuite/Makefile.in: Regenerate.
13553 * testsuite/gc_tls_test.cc: New file.
13554 * testsuite/gc_tls_test.sh: New file.
13555
ef15dade 135562009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 13557
ef15dade
ST
13558 * icf.cc: New file.
13559 * icf.h: New file.
13560 * Makefile.am (CCFILES): Add icf.cc.
13561 (HFILES): Add icf.h
13562 * Makefile.in: Regenerate.
13563 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
13564 * gc.h (gc_process_relocs): Populate lists used by icf to contain
13565 section, symbol and addend information for the relocs.
13566 * gold.cc (queue_middle_tasks): Call identical code folding.
13567 * gold.h: Add defines for multimap.
13568 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
13569 to the call of finalize_local_symbols.
13570 * main.cc (main): Create object of class Icf.
13571 * object.cc (Sized_relobj::do_layout): Allow this function to be
13572 called twice during icf.
13573 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
13574 to sections marked as identical by icf.
13575 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
13576 when available.
13577 (Sized_relobj::do_section_entsize): New function.
13578 * object.h (Object::section_entsize): New function.
13579 (Object::do_section_entsize): New pure virtual function.
13580 (Relobj::finalize_local_symbols): Add new parameter.
13581 (Relobj::do_section_entsize): New function.
13582 * options.h (General_options::icf): New option.
13583 (General_options::icf_iterations): New option.
13584 (General_options::print_icf_sections): New option.
13585 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
13586 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
13587 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
13588 icf.
13589 * symtab.cc (Symbol_table::is_section_folded): New function.
13590 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
13591 to sections marked as identical by icf.
13592 * symtab.h (Symbol_table::set_icf): New function.
13593 (Symbol_table::icf): New function.
13594 (Symbol_table::is_section_folded): New function.
13595 (Symbol_table::icf_): New data member.
13596 * target-reloc.h (relocate_section): Ignore sections folded by icf.
13597 * testsuite/Makefile.am: Add commands to build icf_test.
13598 * testsuite/Makefile.in: Regenerate.
13599 * testsuite/icf_test.sh: New file.
13600 * testsuite/icf_test.cc: New file.
13601
c3b65ac4
CD
136022009-07-24 Chris Demetriou <cgd@google.com>
13603
13604 * layout.cc (is_compressible_debug_section): Fix incorrect
13605 comment about compressed section names.
13606
1caf2c51
ILT
136072009-07-20 Ian Lance Taylor <ian@airs.com>
13608
13609 PR 10419
13610 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
13611
1ef4d87f
ILT
136122009-07-16 Ian Lance Taylor <iant@google.com>
13613
13614 PR 10400
13615 * layout.h: #include <map>.
13616 (class Kept_section): Change from struct to class. Add accessors
13617 and setters. Add section size to Comdat_group mapping. Change
13618 Comdat_group to std::map. Add is_comdat_ field. Add
13619 linkonce_size field in union.
13620 (class Layout): Update declaration of find_or_add_kept_section.
13621 Don't declare find_kept_object.
13622 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
13623 parameter. Add object, shndx, is_comdat, and is_group_name
13624 parameters. Change all callers. Adjust for new Kept_section.
13625 (Layout::find_kept_object): Remove.
13626 * object.cc (Sized_relobj::include_section_group): Update use of
13627 Kept_section. Rename secnum to shndx. Only record
13628 Kept_comdat_section if sections are the same size.
13629 (Sized_relobj::include_linkonce_section): Update use of
13630 Kept_section. Only record Kept_comdat_section if sections are the
13631 same size. Set size of linkonce section.
13632 (Sized_relobj::map_to_kept_section): Update call to
13633 get_kept_comdat_section.
13634 * object.h (class Sized_relobj): Rename fields in
13635 Kept_comdat_section to drop trailing underscores; change object
13636 field to Relobj*. Change Kept_comdat_section_table to store
13637 struct rather than pointer.
13638 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
13639 Add kept_object and kept_shndx parameters. Change all callers.
13640 (Sized_relobj::get_kept_comdat_section): Change return type to
13641 bool. Add kept_object and kept_shndx parameters. Change all
13642 callers.
13643 * plugin.cc (Pluginobj::include_comdat_group): Update call to
13644 Layout::find_or_add_kept_section.
13645
37c3b7b0
ILT
136462009-07-09 Ian Lance Taylor <iant@google.com>
13647
13648 * merge.cc (Object_merge_map::initialize_input_to_output_map):
13649 Reserve space in the hash table.
13650
98fa85cb
ILT
136512009-07-06 Mikolaj Zalewski <mikolajz@google.com>
13652
13653 * fileread.cc (File_read::get_mtime): New method.
13654 * fileread.h (Timespec): New structure.
13655 (File_read::get_mtime): New method.
13656 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
13657 Renamed from timestamp_nsec.
13658 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
13659 Elf_Xword.
e1df38aa 13660 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 13661 timestamp_nsec.
e1df38aa 13662 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
13663 (Incremental_inputs::report_obejct): Save mtime; style fix.
13664 (Incremental_inputs::report_script): Save mtime; style fix.
13665 (Incremental_inputs::finalize_inputs): Style fix.
13666 (Incremental_inputs::finalize): Style fix.
13667 (Incremental_inputs::create_input_section_data): Store inputs
13668 mtime.
13669 * incremental.h (Incremental_inputs::report_script): Add mtime
13670 argument.
13671 (Incremental_inputs::Input_info::Input_info): Intialize only one
13672 union member.
13673 (Incremental_inputs::Input_info::archive): Move to nameless
13674 union.
13675 (Incremental_inputs::Input_info::obejct): Move to nameless union.
13676 (Incremental_inputs::Input_info::script): Move to nameless union.
13677 (Incremental_inputs::mtime): New field.
13678 * script.cc (read_input_script): Pass file mtime to
13679 Incremental_input.
13680 * script.h (Script_info::inputs): Style fix.
13681
c9d70757
ILT
136822009-07-01 Ian Lance Taylor <ian@airs.com>
13683
13684 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
13685 instead of 32.
13686
9c547ec3
ILT
136872009-06-24 Ian Lance Taylor <iant@google.com>
13688
13689 PR 10156
13690 * layout.cc (Layout::choose_output_section): If we find an
13691 existing section, update the flags.
13692 (Layout::create_notes): New function, broken out of
13693 Layout::finalize.
13694 (Layout::finalize): Don't create note sections.
13695 (Layout::create_note): Don't crash if linker script discards
13696 section.
13697 (Layout::create_gold_note): Likewise.
13698 (Layout::create_build_id): Likewise. Don't set
13699 after_input_sections on the section.
13700 (Layout::create_executable_stack_info): Remove target parameter.
13701 Change caller.
13702 * layout.h (class Layout): Declare create_notes. Update
13703 declaration of create_executable_stack_info.
13704 * gold.cc (queue_middle_tasks): Call create_notes.
13705 * output.cc (Output_section::update_flags_for_input_section): Move
13706 here from output.h. If SHF_ALLOC flag is newly set, mark address
13707 invalid.
13708 * output.h (Output_data::mark_address_invalid): New function.
13709 (class Output_section): Only declare, not define,
13710 update_flags_for_input_section. Remove set_flags.
13711
55458500
ILT
137122009-06-24 Ian Lance Taylor <iant@google.com>
13713
13714 * script-sections.cc (Output_section_definition::
13715 set_section_addresses): Rename shadowing local load_address to
13716 laddr.
13717
1307d6cd
ILT
137182009-06-24 Ian Lance Taylor <iant@google.com>
13719
13720 PR 10244
13721 * reloc.cc (relocate_sections): Skip empty relocation sections.
13722
ec3f783e
ILT
137232009-06-23 Ian Lance Taylor <iant@google.com>
13724
13725 PR 10156
13726 * layout.cc (Layout::create_note): Use choose_output_section
13727 rather than make_output_section.
13728
459c9f1c
ILT
137292009-06-23 Ian Lance Taylor <iant@google.com>
13730
13731 PR 10237
13732 * options.cc (General_options::parse_V): Set printed_version_.
13733 (General_options::General_options): Initialize printed_version_.
13734 * options.h (class General_options): Add printed_version_ field.
13735 * gold.cc (queue_initial_tasks): If there are no input files,
13736 don't give a fatal error if we printed the version information.
13737 (queue_middle_tasks): If using -r with a shared object, give a
13738 fatal error rather than an ordinary error.
13739
1518dc8f
ILT
137402009-06-23 Ian Lance Taylor <iant@google.com>
13741
13742 PR 10219
13743 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
13744 (Layout::make_output_section): Set have_stabstr_section_ if we see
13745 a .stab*str section.
13746 (Layout::finalize): Call link_stabs_sections.
13747 (Layout::link_stabs_sections): New file.
13748 * layout.h (class Layout): Add have_stabstr_section_ field.
13749 Declare link_stabs_sections.
13750
3d857b98
DK
137512009-06-23 Doug Kwan <dougkwan@google.com>
13752
13753 * Makefile.am (libgold_a_LIBADD): New.
13754 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 13755 * Makefile.in: Regenerate.
3d857b98
DK
13756 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
13757 * configure: Regenerate.
13758 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
13759 * fileread.cc: Include sys/state.h
13760 * gold.h: Declare memmem and strndup if found missing.
13761 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
13762
0639a6f6
ILT
137632009-06-23 Ian Lance Taylor <iant@google.com>
13764
13765 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
13766 * configure: Rebuild.
13767
8d63875c
ILT
137682009-06-23 Ian Lance Taylor <iant@google.com>
13769
13770 PR 10147
13771 * object.cc (Object::section_contents): Don't try to get a view if
13772 the section has length zero.
13773 (Object::handle_gnu_warning_section): If the section is empty, use
13774 the name of the section as the warning.
13775
f7c8a183
ILT
137762009-06-23 Ian Lance Taylor <iant@google.com>
13777
13778 PR 10133
13779 * stringpool.h (class Stringpool_template): Add optimize_ field.
13780 (Stringpool_template::set_optimize): New function.
13781 * stringpool.cc (Stringpool_template::Stringpool_template):
13782 Initialize optimize_ field.
13783 (Stringpool_template::set_string_offsets): Test local optimize
13784 fild rather than parameter.
13785 * layout.cc (Layout::Layout): Call set_optimize on the section
13786 name stringpool.
13787
e6a307ba
ILT
137882009-06-22 Ian Lance Taylor <iant@google.com>
13789
13790 PR 10030
13791 * yyscript.y: Parse TARGET.
13792 * script.cc (script_set_target): New function.
13793 * script-c.h (script_set_target): Declare.
13794 * options.cc (General_options::string_to_object_format): Rename
13795 from string_to_object_format in anonymous namespace. Change
13796 callers.
13797 * options.h (class General_options): Declare
13798 string_to_object_format.
13799
3ee173de
ILT
138002009-06-22 Ian Lance Taylor <iant@google.com>
13801
13802 * script-sections.cc (Script_sections::create_segments): Don't put
13803 program headers in a PT_LOAD segment if -n or -N.
13804
138052009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
13806
13807 PR 10141
13808 * options.h (class General_options): Add -z lazy and -z now. Sort
13809 -z options into alphabetical order.
13810 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
13811
cd6739a1 138122009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
13813
13814 * layout.cc (Layout::make_output_section): Call
13815 Target::new_output_section.
13816 (Layout::attach_allocated_section_to_segment): Put large section
13817 sections in a separate load segment with the large segment flag
13818 set.
13819 (Layout::segment_precedes): Sort large data segments after other
13820 load segments.
13821 (align_file_offset): New static function.
13822 (Layout::set_segment_offsets): Use align_file_offset.
13823 * output.h (class Output_section): Add is_small_section_ and
13824 is_large_section_ fields.
13825 (Output_section::is_small_section): New function.
13826 (Output_section::set_is_small_section): New function.
13827 (Output_section::is_large_section): New function.
13828 (Output_section::set_is_large_section): New function.
13829 (Output_section::is_large_data_section): New function.
13830 (class Output_segment): Add is_large_data_segment_ field.
13831 (Output_segment::is_large_data_segment): New function.
13832 (Output_segment::set_is_large_data_segment): New function.
13833 * output.cc (Output_section::Output_section): Initialize new
13834 fields.
13835 (Output_segment::Output_segment): Likewise.
13836 (Output_segment::add_output_section): Add assertion that large
13837 data sections always go in large data segments. Force small data
13838 sections to the end of the list of data sections. Force small BSS
13839 sections to the start of the list of BSS sections. For large BSS
13840 sections to the end of the list of BSS sections.
13841 * symtab.h (class Symbol): Declare is_common_shndx.
13842 (Symbol::is_defined): Check Symbol::is_common_shndx.
13843 (Symbol::is_common): Likewise.
13844 (class Symbol_table): Define enum Commons_section_type. Update
13845 declarations. Add small_commons_ and large_commons_ fields.
13846 * symtab.cc (Symbol::is_common_shndx): New function.
13847 (Symbol_table::Symbol_table): Initialize new fields.
13848 (Symbol_table::add_from_object): Put small and large common
13849 symbols in the right list.
13850 (Symbol_table::sized_finalized_symbol): Check
13851 Symbol::is_common_shndx.
13852 (Symbol_table::sized_write_globals): Likewise.
13853 * common.cc (Symbol_table::do_allocate_commons): Allocate new
13854 common symbol lists. Don't call do_allocate_commons_list if the
13855 list is empty.
13856 (Symbol_table::do_allocate_commons_list): Remove is_tls
13857 parameter. Add comons_section_type parameter. Change all
13858 callers. Handle small and large common symbols.
13859 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
13860 Symbol::is_common_shndx.
13861 * resolve.cc (symbol_to_bits): Likewise.
13862 * target.h (Target::small_common_shndx): New function.
13863 (Target::small_common_section_flags): New function.
13864 (Target::large_common_shndx): New function.
13865 (Target::large_common_section_flags): New function.
13866 (Target::new_output_section): New function.
13867 (Target::Target_info): Add small_common_shndx, large_common_shndx,
13868 small_common_section_flags, and large_common_section_flags
13869 fields.
13870 (Target::do_new_output_section): New virtual function.
13871 * arm.cc (Target_arm::arm_info): Initialize new fields.
13872 * i386.cc (Target_i386::i386_info): Likewise.
13873 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
13874 Likewise.
13875 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
13876 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13877 (Target_x86_64::do_new_output_section): New function.
13878 * configure.ac: Define conditional MCMODEL_MEDIUM.
13879 * testsuite/Makefile.am (check_PROGRAMS): Add large.
13880 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
13881 (large_LDFLAGS): Define.
13882 * testsuite/large.c: New file.
13883 * testsuite/testfile.cc (Target_test::test_target_info):
13884 Initialize new fields.
13885 * configure, testsuite/Makefile.in: Rebuild.
13886
bb04269c
DK
138872009-06-05 Doug Kwan <dougkwan@google.com>
13888
13889 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 13890 * Makefile.in: Regenerate.
bb04269c
DK
13891 * i386.cc (class Target_i386): Define new virtual method to
13892 override do_is_local_label_name in parent.
13893 * object.cc (Sized_relobj::do_count_local_symbols): Discard
13894 local symbols if --discard-locals or -X is given.
13895 * options.h (class General_options): Declare new options
13896 '--discard-locals' and '-X' for discarding locals.
13897 * target.h (class Target): Define new methods is_local_label_name.
13898 Declare new virtual method do_is_local_label_name.
13899 * target.cc: New file.
13900 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
13901 (check_SCRIPTS): Add discard_locals_test.sh.
13902 (check_DATA): Add discard_local_tests.syms.
13903 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
13904 (discard_local_tests.syms, discard_locals_test.o): New make rules.
13905 * testsuite/Makefile.in: Regenerate.
13906 * testsuite/discard_locals_test.c: New file.
13907 * testsuite/discard_locals_test.sh: Same.
13908
805bb01c
DK
139092009-06-05 Doug Kwan <dougkwan@google.com>
13910
13911 * object.cc (Sized_relobj::Sized_relobj): Initialize
13912 discarded_eh_frame_shndx_ to -1U.
13913 (Sized_relobj::do_layout): Record index of a discard .eh_frame
13914 section.
13915 (Sized_relobj::do_count_local_symbols): Skip local symbols in
13916 a discarded .eh_frame section.
13917 (Sized_relobj::do_finalize_local_symbols): Ditto.
13918 * object.h (class Sized_relobj): Declare new member
13919 discarded_eh_frame_shndx_.
13920 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
13921 (local_labels_test.o, local_labels_test): New rules.
13922 * testsuite/Makefile.in: Regenerate.
13923
1dcd334d
DK
139242009-06-04 Doug Kwan <dougkwan@google.com>
13925
13926 * layout.cc (Layout::section_name_mapping): Add mapping for
13927 special ARM sections.
13928
96d49306
DK
139292009-06-03 Doug Kwan <dougkwan@google.com>
13930
13931 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
13932 (utils::has_overflow): Same.
13933
dff16297
ILT
139342009-06-03 Ian Lance Taylor <iant@google.com>
13935
13936 * layout.cc (Layout::section_name_mapping): New array, replacing
13937 Layout::linkonce_mapping.
13938 (Layout::section_name_mapping_count): New variable, replacing
13939 Layout::linkonce_mapping_count.
13940 (Layout::linkonce_output_name): Remove.
13941 (Layout::output_section_name): Rewrite.
13942 * layout.h (class Layout): Rename Linkonce_mapping to
13943 Section_name_mapping, linkonce_mapping to section_name_mapping,
13944 linkonce_mapping_count to section_name_mapping_count. Don't
13945 declare linkonce_output_name.
13946
c121c671
DK
139472009-06-03 Doug Kwan <dougkwan@google.com>
13948
13949 * gold/arm.cc (namespace utils): New.
13950 (Target_arm::reloc_is_non_pic): Define new method.
13951 (class Arm_relocate_functions): New.
13952 (Target_arm::Relocate::relocate): Handle relocation types used by
13953 Android.
13954
07800fab
ILT
139552009-06-03 Ian Lance Taylor <iant@google.com>
13956
13957 * arm.cc (Target_arm::scan::global): Use || instead of |.
13958
c121c671
DK
139592009-06-02 Doug Kwan <dougkwan@google.com>
13960
13961 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
13962 issued_non_pic_error_.
13963 (class Target_arm::Scan): Declare new method check_non_pic.
13964 Define new method symbol_needs_plt_entry.
13965 Declare new data member issued_non_pic_error_.
13966 (class Target_arm::Relocate): Declare new method
13967 should_apply_static_reloc.
13968 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
13969 (Target_arm::Scan::check_non_pic): Define new method.
13970 (Target_arm::Scan::local): Handle a small subset of reloc types used
13971 by Android.
13972 (Target_arm::Scan::local): Same.
13973 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
13974
b19b0c6d
ILT
139752009-05-31 Mikolaj Zalewski <mikolajz@google.com>
13976
13977 * incremental.cc (Incremental_inputs::report_command_line): Filter
13978 out --incremental-* options.
13979
94cdfcff
DK
139802009-05-29 Doug Kwan <dougkwan@google.com>
13981
13982 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
13983 template class.
13984 (class Target_arm): Update comment.
13985 (Target_arm::Target_arm): Initialize new data members GOT_,
13986 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
13987 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
13988 and Target_arm::rel_dyn_section.
13989 Declare new_enum Target_arm::Got_type.
13990 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
13991 and DYNBSS_.
13992 Update commments for member do_dynsym_value.
13993 (Target_arm::got_size, Target_arm::plt_section,
13994 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
13995 new methods inside class defintion.
13996 (Target_arm::got_section): Define new method.
13997 (Target_arm::rel_dyn_section): Same.
13998 (Output_data_plt_arm): New template class.
13999 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
14000 (Output_data_plt_arm:do_adjust_output_section): Define new method.
14001 (Output_data_plt_arm::add_entry): Same.
14002 (Output_data_plt_arm::first_plt_entry): Define new
14003 static data member for PLT instruction template.
14004 (Output_data_plt_arm::plt_entry): Same.
14005 (Output_data_plt_arm::do_write): Define new method.
14006 (Target_arm::make_plt_entry): Same.
14007 (Target_arm::do_finalize_sections): Same.
14008 (Target_arm::do_dynsym_value): Same.
14009
4a657b0d
DK
140102009-05-28 Doug Kwan <dougkwan@google.com>
14011
14012 * Makefile.am (TARGETSOURCES): Add arm.cc.
14013 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
14014 * Makefile.in: Regenerate.
14015 * arm.cc: New file.
14016 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
14017
e7ae8c36
DK
140182009-05-26 Doug Kwan <dougkwan@google.com>
14019
14020 * options.cc (General_options::parse_exclude_libs). Fix a comment.
14021 (General_options::check_excluded_libs): Strip off directories in
14022 archive name before matching like GNU ld does.
14023 * testsuite/Makefile.am (MOSTLYCLEANFILES,
14024 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
14025 (exclude_libs_test_LDFLAGS): Add linker option
14026 -Wl,--exclude-libs,libexclude_libs_test_3
14027 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
14028 an explicit archive without using -l.
14029 (alt/libexclude_libs_test_3.a): New make rule.
14030 * testsuite/Makefile.in: Regenerate.
14031 * testsuite/exclude_libs_test.c : Declare lib3_default().
14032 (main): Call it.
14033 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
14034 * exclude_libs_test_3.c: New file.
14035
f12e7348
NC
140362009-05-26 Nick Clifton <nickc@redhat.com>
14037
14038 * po/id.po: New Indonesian translation.
14039 * po/gold.pot: Updated template file.
14040
4daadc0d
ST
140412009-05-22 Sriraman Tallam <tmsriram@google.com>
14042
e1df38aa 14043 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
14044 gc_comdat_test files. Add -Wl,--gc-sections to build
14045 gc_comdat_test.
14046 * testsuite/Makefile.in: Regenerate.
14047 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
14048
531813ad
ST
140492009-05-21 Sriraman Tallam <tmsriram@google.com>
14050
14051 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
14052 kept comdat section was garbage collected.
14053 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
14054 * testsuite/Makefile.in: Regenerate.
14055 * testsuite/gc_comdat_test.sh: New file.
14056 * testsuite/gc_comdat_test_1.cc: New file.
14057 * testsuite/gc_comdat_test_2.cc: New file.
14058
65514900
CC
140592009-05-19 Doug Kwan <dougkwan@google.com>
14060
14061 * archive.cc (Archive::Archive): Move constructor from archive.h
14062 to here. Initialize no_export_.
14063 (Archive::get_elf_object_for_member): Set no_export flag of object.
14064 * archive.h (Archive::Archive): Move constructor body to
14065 archive.cc.
14066 (Archive::no_export): New method.
14067 (Archive::no_export_): New field.
14068 * object.h (Object::Object): Initialize no_export_ to false.
14069 (Object::no_export, Object::set_no_export): New methods.
14070 (Object::no_export_): New field.
14071 * options.cc (General_options::parse_exclude_libs): New method.
14072 (General_options::check_excluded_libs) Same.
14073 * options.h (exclude_libs): New option.
14074 (General_options::check_excluded_libs): New method declaration.
14075 (General_options::excluded_libs_): New field.
14076 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
14077 default or protected visibility if an object has no-export flag set.
14078 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
14079 (check_SCRIPTS): Add exclude_libs_test.sh.
14080 (check_DATA): Add exclude_libs_test.syms.
14081 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
14082 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
14083 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
14084 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
14085 (exclude_libs_test.syms, libexclude_libs_test_1.a,
14086 libexclude_libs_test_2.a): New rules.
14087 * testsuite/Makefile.in: Regenerate.
14088 * testsuite/exclude_libs_test.c: New file.
14089 * testsuite/exclude_libs_test.sh: Ditto.
14090 * testsuite/exclude_libs_test_1.c: Ditto.
14091 * testsuite/exclude_libs_test_2.c: Ditto.
14092
1b77ea50
ILT
140932009-05-15 Ian Lance Taylor <iant@google.com>
14094
14095 * configure.ac: Check for declarations for cases where libiberty.h
14096 checks HAVE_DECL_xxx.
14097 * configure, config.in: Rebuild.
14098
072fe7ce
ILT
140992009-05-15 Mikolaj Zalewski <mikolajz@google.com>
14100
14101 * gold.h (Incremental_argument_list): Remove (invalid) forward
14102 declaration.
14103 * incremental.cc (Incremental_inputs::report_achive): New method.
14104 (Incremental_inputs::report_object): New method.
14105 (Incremental_inputs::report_script): New method.
14106 (Incremental_inputs::finalize_inputs): New method.
14107 (Incremental_inputs::finalize): Call finalize_inputs().
14108 (Incremental_inputs::sized_create_incremental_inputs_section_data):
14109 Create inputs entries.
14110 * incremental.h (Incremental_input_type): New enum.
14111 (Incremental_inputs::Incremental_input): Initialize new fields.
14112 (Incremental_inputs::report_inputs): New method.
14113 (Incremental_inputs::report_achive): New method.
14114 (Incremental_inputs::report_object): New method.
14115 (Incremental_inputs::report_script): New method.
14116 (Incremental_inputs::finalize_inputs): New method.
14117 (Incremental_inputs::Input_info): New struct.
14118 (Incremental_inputs::Input_info_map): New typedef.
14119 (Incremental_inputs::lock_): New field.
14120 (Incremental_inputs::Inputs_): New field.
14121 (Incremental_inputs::Inputs_map): New field.
14122 * main.cc (main): Call Incremental_input::report_inputs.
14123 * options.h (Input_argument_list): Typedef moved from
14124 Input_arguments.
14125 (Input_file_group::Files): Remove, use ::Input_argument_list.
14126 (Input_file_group::Input_argument_list): Remove, use
14127 ::Input_argument_list.
14128 * plugin.cc (Plugin_manager::add_input_file): Add error in
14129 incremental build.
14130 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
14131 functions.
14132 * script.cc (read_input_script): Call
14133 Incremental_input::report_script.
14134 * script.h (Script_info): New class.
14135
b0481b0b
ILT
141362009-04-27 Ian Lance Taylor <iant@google.com>
14137
14138 * x86_64.cc (do_adjust_output_section): Set entsize to
14139 plt_entry_size.
14140
b22a5a41 141412009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
14142
14143 * output.cc (Output_file::close): After short writes, continue
14144 writing from the correct offset in the buffer being written.
14145
40fde488
CD
141462009-04-23 Chris Demetriou <cgd@google.com>
14147
14148 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
14149 * configure: Regenerate.
14150 * config.in: Regenerate.
14151 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
14152 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
14153
3ce2c28e
ILT
141542009-04-21 Mikolaj Zalewski <mikolajz@google.com>
14155
14156 * incremental.cc (Incremental_inputs_header_data): Renamed from
14157 Incremental_input_header_data.
14158 (Incremental_inputs_header_data::data_size): New field.
14159 (Incremental_inputs_header_data::put_input_file_count): Renamed
14160 from input_file_count.
14161 (Incremental_inputs_header_data::put_command_line_offset): Renamed
14162 from command_line_offset.
14163 (Incremental_inputs_header_data::put_reserved): Renamed from
14164 put_reserved.
14165 (Incremental_inputs_entry_data): Renamed from
14166 Incremental_input_entry_data.
14167 (Incremental_inputs_entry_data::data_size): New field.
14168 (Incremental_inputs::report_command_line): New method.
14169 (Incremental_inputs::finalize): New method.
14170 (Incremental_inputs::create_incremental_inputs_data): New method.
14171 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
14172 * incremental.h: New file.
14173 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 14174 (Layout::finalize): Create incremental inputs section in
3ce2c28e 14175 incremental builds.
703d02da 14176 (Layout::create_incremental_info_sections): New method.
3ce2c28e 14177 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
14178 (Layout::create_incremental_info_sections): New method.
14179 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
14180 * main.cc (main): Notify Incremental_input of the command line.
14181
e55bde5e
ILT
141822009-04-01 Ian Lance Taylor <iant@google.com>
14183 Mikolaj Zalewski <mikolajz@google.com>
14184
14185 * gold.h (reserve_unordered_map): Define, three versions, one for
14186 each version of Unordered_map.
14187 * layout.cc (Layout::Layout): Remove options parameter. Add
14188 number_of_input_files parameter. Don't initialize options_.
14189 Initialize number_of_input_files_ and resized_signatures_. Move
14190 sections_are_attached_.
14191 (Layout::layout_group): Reserve space for group_signatures_.
14192 (Layout::find_or_add_kept_section): Change name parameter to be a
14193 reference. Resize signatures_ map when it gets large enough.
14194 (Layout::layout_eh_frame): Use parameters->options() instead of
14195 this->options_.
14196 (Layout::make_output_section): Likewise.
14197 (Layout::attach_allocated_section_to_segment): Likewise.
14198 (Layout::finalize, Layout::create_executable_stack): Likewise.
14199 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
14200 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
14201 * layout.h (class Layout): Update declarations. Remove options_
14202 field. Add number_of_input_files_ and resized_signatures_
14203 fields. Move sections_are_attached_ field.
14204 * main.cc (main): Pass number of input files to Layout
14205 constructor. Don't pass options.
14206
154b857c
ILT
142072009-03-30 Ian Lance Taylor <iant@google.com>
14208
14209 * ffsll.c (ffsll): Correct implementation.
14210
2f35ab9b
ILT
142112009-03-27 Ian Lance Taylor <iant@google.com>
14212
fd03461a
ILT
14213 * ffsll.c: New file.
14214 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
14215 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
14216 * ftruncate.c (ftruncate): Declare before definition.
14217 * mremap.c (mremap): Likewise.
14218 * pread.c (pread): Likewise.
14219 * configure, Makefile.in, config.in: Rebuild.
14220
2f35ab9b
ILT
14221 * mremap.c: New file.
14222 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
14223 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
14224 (mremap): Declare if HAVE_MREMAP is not defined.
14225 * configure, Makefile.in, config.in: Rebuild.
14226
33aea2fd
CC
142272009-03-27 Cary Coutant <ccoutant@google.com>
14228
14229 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
14230 position independent.
14231 * sparc.cc (Target_sparc::check_non_pic): Likewise.
14232 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
14233
6d479619
CC
142342009-03-24 Cary Coutant <ccoutant@google.com>
14235
14236 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
14237 an executable.
14238 (needs_dynamic_reloc): Likewise.
14239
afc06bb8
ILT
142402009-03-24 Ian Lance Taylor <iant@google.com>
14241
14242 * yyscript.y (file_cmd): Recognize EXTERN.
14243 (extern_name_list, extern_name_list_body): New nonterminals.
14244 * script.cc (script_add_extern): Define.
14245 * script-c.h (script_add_extern): Declare.
14246
f6060a4d
ILT
142472009-03-24 Rafael Avila de Espindola <espindola@google.com>
14248
14249 * object.cc (is_elf_object): Define.
14250 * object.h (is_elf_object): Declare.
14251 * archive.cc (Archive::get_elf_object_for_member): Call
14252 is_elf_object.
33aea2fd 14253 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 14254
26736d8e
ILT
142552009-03-24 Elliott Hughes <enh@google.com>
14256
14257 * output.cc (Output_file::map_anonymous): Define.
14258 (Output_file::map): Use map_anonymous. If the regular mmap fails,
14259 try an anonymous one. Report the size if the mmap fails.
14260 * output.h (class Output_file): Declare map_anonymous.
14261
22fd9730
ILT
142622009-03-24 Ian Lance Taylor <iant@google.com>
14263
14264 * target-select.cc (instantiate_target): Don't acquire the lock if
14265 the instantiated_target_ field has already been set.
14266
cb010894
ILT
142672009-03-23 Ian Lance Taylor <iant@google.com>
14268
7f055c20
ILT
14269 * gold-threads.h (class Initialize_lock): Define.
14270 * gold-threads.cc (class Initialize_lock_once): Define.
14271 (initialize_lock_control): New static variable.
14272 (initialize_lock_pointer): New static variable.
14273 (initialize_lock_once): New static function.
14274 (Initialize_lock::Initialize_lock): Define.
14275 (Initialize_lock::initialize): Define.
14276 * target-select.h: Include "gold-threads.h".
14277 (class Target_selector): Add lock_ and initialize_lock_ fields.
14278 Don't define instantiate_target, just declare it.
14279 * target-select.cc (Target_selector::Target_selector): Initialize
14280 new fields.
14281 (Target_selector::instantiate_target): Define.
14282 * descriptors.h: Include "gold-threads.h".
14283 (class Descriptors): Add initialize_lock_ field.
14284 * descriptors.cc (Descriptors::Descriptors): Initialize new
14285 field.
14286 (Descriptors::open): Use initialize_lock_ field
14287 * errors.h (class Errors): Add initialize_lock_ field.
14288 * errors.cc (Errors::Errors): Initialize new field.
14289 (Errors::initialize_lock): Use initialize_lock_ field.
14290 * powerpc.cc (class Target_selector_powerpc): Remove
14291 instantiated_target_ field. In do_recognize call
14292 instantiate_target rather than do_instantiate_target. In
14293 do_instantiate_target just allocate a new target.
14294 * sparc.cc (class Target_selector_sparc): Likewise.
14295
36959681
ILT
14296 * freebsd.h: New file.
14297 * i386.cc: Include "freebsd.h".
14298 (Target_i386): Derive from Target_freebsd rather than
14299 Sized_target.
14300 (Target_selector_i386): Derive from Target_selector_freebsd rather
14301 than Target_selector.
14302 * x86_64.cc: Include "freebsd.h".
14303 (Target_x86_64): Derive from Target_freebsd rather than
14304 Sized_target.
14305 (Target_selector_x86_64): Derive from Target_selector_freebsd
14306 rather than Target_selector.
14307 * target.h (class Target): Add adjust_elf_header and
14308 do_adjust_elf_header.
14309 * output.cc (Output_file_header:: do_sized_write): Call target
14310 adjust_elf_header routine.
14311 * configure.tgt: Set targ_osabi.
14312 * configure.ac: Define GOLD_DEFAULT_OSABI.
14313 * parameters.cc (Parameters::default_target): Pass
14314 GOLD_DEFAULT_OSABI to select_target.
14315 * target-select.h (class Target_selector): Make instantiate_target
14316 protected rather than private.
14317 * Makefile.am (HFILES): Add freebsd.h.
14318 * configure, Makefile.in, config.in: Rebuild.
14319
cb010894
ILT
14320 * merge.cc (do_add_input_section): Correct pend value. Change
14321 message about last entry not being null terminated from error to
14322 warning.
14323
0e879927
ILT
143242009-03-20 Mikolaj Zalewski <mikolajz@google.com>
14325
14326 * incremental.cc: New file.
14327 * Makefile.am (CCFILES): Add incremental.cc.
14328 * Makefile.in: Rebuild.
14329
41105937
PP
143302009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
14331
14332 * layout.cc (Layout::output_section_name): Preserve names
14333 of '.note.' sections.
e1df38aa 14334
60439920
ILT
143352009-03-19 Ian Lance Taylor <iant@google.com>
14336
14337 * descriptors.cc (Descriptors::open): Check that the options are
14338 valid before using them.
14339
0d371ad3
ILT
143402009-03-18 Ian Lance Taylor <iant@google.com>
14341
14342 * script-sections.h: Include <list>.
14343 (class Script_sections): Change Sections_elements from std::vector
14344 to std::list. Typedef public Elements_iterator. Add
14345 orphan_section_placement_, data_segment_align_start_, and
14346 saw_data_segment_align_ fields. Remove data_segment_align_index_
14347 field.
14348 * script-sections.cc (class Orphan_section_placement): New class.
14349 (class Sections_element): Add virtual functions is_relro and
14350 orphan_section_init. Remove virtual function place_orphan_here.
14351 (class Output_section_definition): Add is_relro and
14352 orphan_section_init. Remove place_orphan_here.
14353 (class Orphan_output_section): Likewise.
14354 (Script_sections::Script_sections): Update for field changes.
14355 (Script_sections::data_segment_align): Set saw_data_segment_align_
14356 and data_segment_align_start_, not data_segment_align_index.
14357 (Script_sections::data_segment_relro_end): Check
14358 saw_data_segment_align_. Use data_segment_align_start_ rather
14359 than data_segment_align_index_.
14360 (Script_sections::place_orphan): Rewrite to use
14361 Orphan_section_placement.
14362
9201d894
ILT
143632009-03-17 Ian Lance Taylor <iant@google.com>
14364
9c5b8369
ILT
14365 * archive.cc (Archive::add_symbols): Check for a version attached
14366 to the symbol name in the archive map.
14367 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
14368 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
14369 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
14370 (ver_test_11.a): New target.
14371 * testsuite/Makefile.in: Rebuild.
14372
9201d894
ILT
14373 * configure.ac: Check for chsize and posix_fallocate. Replace
14374 ftruncate.
14375 * ftruncate.c: New file, from gnulib.
14376 * output.cc (posix_fallocate): Define dummy version if not
14377 HAVE_POSIX_FALLOCATE.
14378 (Output_file::map): Call posix_fallocate rather than lseek and
14379 write.
14380 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
14381 * configure, Makefile.in, config.in: Rebuild.
14382
ef4ab7a8 143832009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 14384
ef4ab7a8
PP
14385 * layout.h (Layout::create_note): Add section_name parameter.
14386 * layout.cc (Layout::create_note): Likewise.
14387 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 14388
8c500701
ILT
143892009-03-17 Ian Lance Taylor <iant@google.com>
14390
e85b18e1
ILT
14391 * descriptors.cc: Include "options.h".
14392 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
14393 (Descriptors::open): Always use O_CLOEXEC when opening a new
14394 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
14395 then set FD_CLOEXEC.
14396
9efe6174
ILT
14397 * sparc.cc (class Target_sparc): Add has_got_section.
14398 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
14399 make sure we have a GOT section.
14400
14401 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
14402 (Target_sparc::Scan::local): Likewise.
14403 (Target_sparc::Scan::global): Likewise.
14404 (Target_sparc::Relocate::relocate): Likewise.
14405 (Target_sparc::Relocate::relocate_tls): Likewise.
14406
8c500701
ILT
14407 * symtab.cc (Symbol_table::define_default_version): New function,
14408 broken out of add_from_object.
14409 (Symbol_table::add_from_object): Call define_default_version.
14410 (Symbol_table::define_special_symbol): Add resolve_oldsym
14411 parameter. Change all callers. If the version for a symbol comes
14412 from a version script, resolve it with the symbol with the same
14413 name with no version. Also add the symbol without a version if
14414 appropriate.
14415 (do_define_in_output_data): If resolving with oldsym, don't delete
14416 sym.
14417 (do_define_in_output_segment): Likewise.
14418 (do_define_as_constant): Likewise.
14419 * symtab.h (class Symbol_table): Update declarations.
14420
f1ed28fb
ILT
144212009-03-13 Ian Lance Taylor <iant@google.com>
14422
15f8229b
ILT
14423 * readsyms.cc (Read_symbols::incompatible_warning): New function.
14424 (Read_symbols::requeue): New function.
14425 (Read_symbols::do_read_symbols): If make_elf_object fails because
14426 the target type is not configured, and the file was searched for,
14427 issue a warning and retry with the next directory.
14428 (Add_symbols::run): If the file has an incompatible format, and
14429 it was searched for, requeue the Read_symbols task. On error,
14430 release the object.
14431 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
14432 dirindex parameter to constructor. Change all callers. Declare
14433 incompatible_warning and requeue.
14434 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
14435 input_argument_ and input_group_ fields. Add them to
14436 constructor. Change all callers.
14437 (class Read_script): Add dirindex_ field. Add it to constructor.
14438 Change all callers.
14439 * archive.cc (Archive::setup): Remove input_objects parameter.
14440 Change all callers.
14441 (Archive::get_file_and_offset): Likewise.
14442 (Archive::read_all_symbols): Likewise.
14443 (Archive::read_symbols): Likewise.
14444 (Archive::get_elf_object_for_member): Remove input_objects
14445 parameter. Add punconfigured parameter. Change all callers.
14446 (Archive::add_symbols): Change return type to bool. Check return
14447 value of include_member.
14448 (Archive::include_all_members): Likewise.
14449 (Archive::include_member): Change return type to bool. Return
14450 false if first included object has incompatible target. Set
14451 included_member_ field.
14452 (Add_archive_symbols::run): If add_symbols returns false, requeue
14453 Read_symbols task.
14454 * archive.h (class Archive): Add included_member_ field.
14455 Initialize it in constructor. Add input_file and searched_for
14456 methods. Update declarations.
14457 (class Add_archive_symbols): Add dirpath_, dirindex_, and
14458 input_argument_ fields. Add them to constructor. Change all
14459 callers.
14460 * script.cc: Include "target-select.h".
14461 (class Parser_closure): Add skip_on_incompatible_target_ and
14462 found_incompatible_target_ fields. Add
14463 skip_on_incompatible_target parameter to constructor. Change all
14464 callers. Add methods skip_on_incompatible_target,
14465 clear_skip_on_incompatible_target, found_incompatible_target, and
14466 set_found_incompatible_target.
14467 (read_input_script): Add dirindex parameter. Change all callers.
14468 If parser finds an incompatible target, requeue Read_symbols
14469 task.
14470 (script_set_symbol): Clear skip_on_incompatible_target in
14471 closure.
14472 (script_add_assertion, script_parse_option): Likewise.
14473 (script_start_sections, script_add_phdr): Likewise.
14474 (script_check_output_format): New function.
14475 * script.h (read_input_script): Update declaration.
14476 * script-c.h (script_check_output_format): Declare.
14477 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
14478 (ignore_cmd): Remove OUTPUT_FORMAT.
14479 * fileread.cc (Input_file::Input_file): Add explicit this.
14480 (Input_file::will_search_for): New function.
14481 (Input_file::open): Add pindex parameter. Change all callers.
14482 * fileread.h (class Input_file): Add input_file_argument method.
14483 Declare will_search_for. Update declarations.
14484 * object.cc (make_elf_object): Add punconfigured parameter.
14485 Change all callers.
14486 * object.h (class Object): Make input_file public. Add
14487 searched_for method.
14488 (make_elf_object): Update declaration.
14489 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
14490 restart search.
14491 * dirsearch.h (class Dirsearch): Update declaration.
14492 * options.h (class General_options): Add --warn-search-mismatch.
14493 * parameters.cc (Parameters::is_compatible_target): New function.
14494 * parameters.h (class Parameters): Declare is_compatible_target.
14495 * workqueue.cc (Workqueue::add_blocker): New function.
14496 * workqueue.h (class Workqueue): Declare add_blocker.
14497
f1ed28fb
ILT
14498 * fileread.cc (Input_file::open): Remove options parameter.
14499 Change all callers.
14500 (Input_file::open_binary): Likewise.
14501 * script.cc (read_input_script): Likewise.
14502 * readsyms.h (class Read_symbols): Remove options_ field. Remove
14503 options parameter from constructor. Change all callers.
14504 (class Read_script): Likewise.
14505 * fileread.h (class Input_file): Update declarations.
14506 * script.h (read_input_script): Update declaration.
14507
34dd024a
NC
145082009-03-10 Nick Clifton <nickc@redhat.com>
14509
14510 * po/es.po: New Spanish translation.
14511
6d71b17c
CC
145122009-03-06 Cary Coutant <ccoutant@google.com>
14513
14514 * options.cc (parse_short_option): Keep dash_z from registering itself.
14515
031cdbed
ILT
145162009-03-03 Ian Lance Taylor <iant@google.com>
14517
14518 PR 9918
14519 * target-reloc.h (relocate_section): Pass output_section to
14520 relocate.
14521 * i386.cc (Target_i386::should_apply_static_reloc): Add
14522 output_section parameter. Change all callers.
14523 (Target_i386::Relocate::relocate): Add output_section parameter.
14524 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14525 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
14526 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
14527 * testsuite/two_file_shared.sh: New script.
14528 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
14529 (check_DATA): Add two_file_shared.dbg.
14530 (two_file_shared.dbg): New target.
14531 * testsuite/Makefile.in: Rebuild.
14532
15d5fa16
ILT
145332009-03-01 Ian Lance Taylor <iant@google.com>
14534
14535 * configure.ac: Check for byteswap.h.
14536 * configure: Rebuild.
14537 * config.in: Rebuild.
14538
8a4c0b0d
ILT
145392009-03-01 Mikolaj Zalewski <mikolajz@google.com>
14540
14541 * layout.cc (Layout::find_or_add_kept_section): New function.
14542 (Layout::add_comdat): Removed.
14543 * layout.h (struct Kept_section): Move out of class Layout.
14544 Remove trailing underscores from field names. Add group_sections
14545 field. Rename group_ field to is_group. Change all uses.
14546 (class Layout): Declare find_or_add_kept_section, not add_comdat.
14547 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
14548 comdat_groups_ field.
14549 (Sized_relobj::include_section_group): Use
14550 find_or_add_kept_section and Kept_section::group_sections.
14551 (Sized_relobj::include_linkonce_section): Likewise.
14552 * object.cc (class Sized_relobj): Don't define Comdat_group or
14553 Comdat_group_table. Remove find_comdat_group and
14554 add_comdat_group. Remove comdat_groups_ field.
14555 * plugin.cc (include_comdat_group): Use
14556 Layout::find_or_add_kept_section.
14557
b4ecf66b
ILT
145582009-02-28 Ian Lance Taylor <iant@google.com>
14559
14359ca0
ILT
14560 * README: --gc-sections and map files are now supported. Document
14561 some build requirements.
14562
b4ecf66b
ILT
14563 PR 6992
14564 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
14565 relocatable link set the value of the section symbol to zero.
14566 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
14567 relocatable link don't include the section address in the local
14568 symbol value.
14569
0602e05a
ILT
145702009-02-27 Ian Lance Taylor <iant@google.com>
14571
fd9d194f
ILT
14572 PR 6811
14573 * options.h (class Search_directory): Add is_system_directory.
14574 (class General_options): Declare is_in_system_directory.
14575 * options.cc (get_relative_sysroot): Make static.
14576 (get_default_sysroot): Make static.
14577 (General_optoins::is_in_system_directory): New function.
14578 * fileread.cc (Input_file::is_in_system_directory): New function.
14579 * fileread.h (class Input_file): Declare is_in_system_directory.
14580 * object.h (class Object): Add is_in_system_directory.
14581 (class Input_objects): Remove system_library_directory_ field.
14582 * object.cc (Input_objects::add_object): Don't set
14583 system_library_directory_.
14584 (input_objects::found_in_system_library_directory): Remove.
14585 * symtab.cc (Symbol_table::write_globals): Remove input_objects
14586 parameter. Change all callers.
14587 (Symbol_table::sized_write_globals): Likewise.
14588 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
14589 Call Object::is_in_system_directory.
14590 * symtab.h (class Symbol_table): Update declarations.
14591
61edd21f
ILT
14592 PR 5990
14593 * descriptors.h (Open_descriptor): Add is_on_stack field.
14594 * descriptors.cc (Descriptors::open): If the descriptor is on the
14595 top of the stack, remove it. Initialize is_on_stack field.
14596 (Descriptors::release): Only add pod to stack if it is not on the
14597 stack already.
14598 (Descriptors::close_some_descriptor): Clear stack_next and
14599 is_on_stack fields.
14600
e29e076a
ILT
14601 PR 7091
14602 * output.cc (Output_section::find_starting_output_address): Rename
14603 from starting_output_address; add PADDR parameter; change return
14604 type.
14605 * output.h (class Output_section): Declare
14606 find_starting_output_address instead of starting_output_address.
14607 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
14608 section symbol for which we can't find a merge section.
14609
0602e05a
ILT
14610 PR 9836
14611 * symtab.cc (Symbol_table::add_from_object): If the visibility is
14612 hidden or internal, force the symbol to be local.
14613 * resolve.cc (Symbol::override_visibility): Define.
14614 (Symbol::override_base): Use override_visibility.
14615 (Symbol_table::resolve): Likewise.
14616 (Symbol::override_base_with_special): Likewise.
14617 (Symbol_table::override_with_special): If the visibility is hidden
14618 or internal, force the symbol to be local.
14619 * symtab.h (class Symbol): Add set_visibility and
14620 override_visibility.
14621 * testsuite/ver_test_1.sh: New file.
14622 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
14623 (check_DATA): Add ver_test_1.syms.
14624 (ver_test_1.syms): New target.
14625 * testsuite/Makefile.in: Rebuild.
14626
401a9a73
CC
146272009-02-25 Cary Coutant <ccoutant@google.com>
14628
14629 * layout.cc (Layout::choose_output_section): Don't rename sections
14630 when using a linker script that has a SECTIONS clause.
14631 * Makefile.in: Regenerate.
14632
14633 * testsuite/Makefile.am (script_test_5.sh): New test case.
14634 * testsuite/Makefile.in: Regenerate.
14635 * testsuite/script_test_5.cc: New file.
14636 * testsuite/script_test_5.sh: New file.
14637 * testsuite/script_test_5.t: New file.
14638
f488e4b0
CC
146392009-02-13 Rafael Avila de Espindola <espindola@google.com>
14640
14641 * archive.cc (Archive::include_member): Update calls to add_symbols.
14642 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
14643 the Layout argument.
14644 * dynobj.h (do_add_symbols): Add the Layout argument.
14645 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
14646 Layout argument.
14647 * object.h (Object::add_symbols): Add the Layout argument.
14648 (Object::do_add_symbols): Add the Layout argument.
14649 (Sized_relobj::do_add_symbols): Add the Layout argument.
14650 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
14651 Unify the two versions.
14652 (Add_plugin_symbols): Remove.
14653 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
14654 (Sized_pluginobj::do_add_symbols): Unify the two versions.
14655 (Add_plugin_symbols): Remove.
14656 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
14657 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
14658 (Add_symbols::run): Make it work with Pulginobj.
14659
89dd1680
ILT
146602009-02-06 Ian Lance Taylor <iant@google.com>
14661
14662 * object.cc (Sized_relobj::do_layout): Make info message start
14663 with lower case letter.
14664
266d0a74
ILT
146652009-02-06 Mikolaj Zalewski <mikolajz@google.com>
14666
602b464e
ILT
14667 * binary.cc: Fix file comment.
14668
266d0a74
ILT
14669 * options.h (enum Incremental_disposition): Define.
14670 (class General_options): Add new options: --incremental,
14671 --incremental_changed, --incremental_unchanged,
14672 --incremental_unknown. Add incremental_disposition_ and
14673 implicit_incremental_ fields.
14674 (General_options::incremental_disposition): New function.
14675 (class Position_dependent_options): Add incremental_disposition
14676 option.
14677 (Position_dependent_options::copy_from_options): Set incremental
14678 dispositions.
14679 * options.cc (General_options::parse_incremental_changed): New
14680 function.
2e702c99
RM
14681 (General_options::parse_incremental_unchanged): New function.
14682 (General_options::parse_incremental_unknown): New function.
14683 (General_options::General_options): Initialize new fields
266d0a74 14684 incremental_disposition_ and implicit_incremental_.
2e702c99 14685 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
14686 without --incremental.
14687
f073bbf7
CD
146882009-02-06 Chris Demetriou <cgd@google.com>
14689
14690 * gold.h (gold_undefined_symbol): Change to take only a Symbol
14691 pointer and to report location as the file name associated with
14692 the symbol.
14693 (gold_undefined_symbol_at_location): New function to replace the
14694 old gold_undefined_symbol functionality.
14695 * target-reloc.h (relocate_section): Update to use
14696 gold_undefined_symbol_at_location.
14697 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14698 Call gold_undefined_symbol function rather than gold_error.
14699 * errors.h (Errors::undefined_symbol): Take location as a
14700 string, rather than calculating it from a relocation.
14701 * errors.cc (Errors::fatal): Print "fatal error:" before the
14702 formatted message.
14703 (Errors::error, Errors::error_at_location): Print "error: "
14704 before the formatted message.
14705 (Errors::undefined_symbol): Take location as a string, rather
14706 than calculating it from a relocation.
14707 (gold_undefined_symbol_at_location): New function akin to
14708 old gold_undefined_symbol, calculates location from relocation.
14709 (gold_undefined_symbol): Change to take only a Symbol pointer
14710 and to report location as the file name associated with the symbol.
14711 * testsuite/debug_msg.sh: Update for changed error messages.
14712 * testsuite/undef_symbol.sh: Likewise.
14713
8e94a90c
ILT
147142009-02-04 Duncan Sands <baldrick@free.fr>
14715
14716 PR 9812
14717 * reduced_debug_output.h
14718 (Output_reduced_debug_abbrev_section::failed): Use format for
14719 gold_warning.
14720 (Output_reduced_debug_info_section::faild): Likewise.
14721
88a0e15b
ILT
147222009-01-31 Mikolaj Zalewski <mikolajz@google.com>
14723
14724 * script.cc (Lazy_demangler): New class.
2e702c99 14725 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
14726 symbol only once.
14727
5efc7cd2
CC
147282009-01-29 Cary Coutant <ccoutant@google.com>
14729
14730 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
14731 to __tls_get_addr.
14732 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14733
e0ebcf42
ILT
147342009-01-28 Ian Lance Taylor <iant@google.com>
14735
5efc7cd2 14736 * version.cc (version_string): Bump to 1.9.
75fe7426 14737
e0ebcf42
ILT
14738 * gold.h: Include <cstring> and <stdint.h>.
14739 * version.cc: Include <cstdio>.
14740 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
14741 warning.
14742 * reduced_debug_output.cc (insert_into_vector): Rename from
14743 Insert_into_vector; change all callers. Use Swap_unaligned to
14744 avoid aliasing issue; remove union since it is unnecessary.
14745
8e2813be 147462009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
14747
14748 * Makefile.am (CCFILES): Add gc.cc.
14749 (HFILES): Add gc.h.
14750 * Makefile.in: Regenerate.
14751 * gold.cc (Gc_runner): New class.
14752 (queue_initial_tasks): Call garbage collection related tasks
14753 when corresponding options are invoked.
14754 (queue_middle_gc_tasks): New function.
14755 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
14756 processed early before laying out sections during garbage collection.
14757 * gold.h (queue_middle_gc_tasks): New function.
14758 (is_prefix_of): Move from "layout.cc".
14759 * i386.cc (Target_i386::gc_process_relocs): New function.
14760 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
14761 * main.cc (main): Create object of class "Garbage_collection".
14762 * object.cc (Relobj::copy_symbols_data): New function.
14763 (Relobj::is_section_name_included): New function.
e1df38aa
NC
14764 (Sized_relobj::do_layout): Allow this function to be called twice
14765 during garbage collection and defer layout of section during the
6d03d481
ST
14766 first call.
14767 * object.h (Relobj::get_symbols_data): New function.
14768 (Relobj::is_section_name_included): New function.
14769 (Relobj::copy_symbols_data): New function.
14770 (Relobj::set_symbols_data): New function.
14771 (Relobj::get_relocs_data): New function.
14772 (Relobj::set_relocs_data): New function.
14773 (Relobj::is_output_section_offset_invalid): New pure virtual function.
14774 (Relobj::gc_process_relocs): New function.
14775 (Relobj::do_gc_process_relocs): New pure virtual function.
14776 (Relobj::sd_): New data member.
14777 (Sized_relobj::is_output_section_offset_invalid): New function.
14778 (Sized_relobj::do_gc_process_relocs): New function.
14779 * options.h (General_options::gc_sections): Modify to not be a no-op.
14780 (General_options::print_gc_sections): New option.
14781 * plugin.cc (Plugin_finish::run): Remove function call to
14782 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
14783 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
14784 * reloc.cc (Read_relocs::run): Add task to process relocs and
14785 determine unreferenced sections when doing garbage collection.
14786 (Gc_process_relocs): New class.
14787 (Sized_relobj::do_gc_process_relocs): New function.
14788 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
14789 sections that are garbage collected.
14790 * reloc.h (Gc_process_relocs): New class.
14791 * sparc.cc (Target_sparc::gc_process_relocs): New function.
14792 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
14793 symbols whose corresponding sections are garbage collected.
14794 (Symbol_table::Symbol_table): Add new parameter for the garbage
14795 collection object.
14796 (Symbol_table::gc_mark_undef_symbols): New function.
14797 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14798 (Symbol_table::gc_mark_dyn_syms): New function.
14799 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
14800 as garbage.
14801 (Symbol_table::add_from_object): Likewise.
14802 (Symbol_table::add_from_relobj): When building shared objects, do not
14803 treat externally visible symbols as garbage.
14804 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
14805 table information for static and relocatable links.
14806 * symtab.h (Symbol_table::set_gc): New function.
14807 (Symbol_table::gc): New function.
14808 (Symbol_table::gc_mark_undef_symbols): New function.
14809 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14810 (Symbol_table::gc_mark_dyn_syms): New function.
14811 (Symbol_table::gc_): New data member.
e1df38aa 14812 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
14813 function.
14814 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
14815 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
14816
3b293544
CF
148172009-01-20 Chris Faylor <me.sourceware@sourceware.org>
14818
14819 * options.h (General_options::gc_sections): Define as a no-op for now.
14820 (General_options::no_keep_memory): Ditto.
14821 (General_options::Bshareable): Define.
14822 * options.cc (General_options::finalize): Honor -Bshareable.
14823
83d22aa8
AS
148242009-01-20 Andreas Schwab <schwab@suse.de>
14825
14826 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
14827 read the value in the contents, since we don't use it. Use the
14828 template endianness when writing.
14829 (Relocate::relocate): Use it for R_PPC_REL16_HA.
14830
cd536b21
AS
148312009-01-19 Andreas Schwab <schwab@suse.de>
14832
14833 * configure.tgt (powerpc64-*): Fix targ_obj.
14834
99e9a495
ILT
148352009-01-15 Ian Lance Taylor <iant@google.com>
14836
14837 * object.cc (Sized_relobj::write_local_symbols): Don't write out
14838 local symbols when stripping all symbols.
14839
bbbfea06
CC
148402009-01-14 Cary Coutant <ccoutant@google.com>
14841
99e9a495 14842 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 14843
0f7c0701
CC
148442009-01-14 Cary Coutant <ccoutant@google.com>
14845
14846 * archive.cc (Archive::get_elf_object_for_member): Remove call
14847 to File_read::claim_for_plugin.
14848 * descriptors.cc (Descriptors::open): Remove reference to
14849 is_claimed.
14850 (Descriptors::claim_for_plugin): Remove.
14851 * descriptors.h (Descriptors::claim_for_plugin): Remove.
14852 (Descriptors::is_claimed): Remove.
14853 (claim_descriptor_for_plugin): Remove.
14854 * fileread.cc (File_read::claim_for_plugin): Remove.
14855 * fileread.h (File_read::claim_for_plugin): Remove.
14856 (File_read::descriptor): Reopen descriptor if necessary.
14857 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
14858 (Plugin_manager::all_symbols_read): Add task parameter. Change
14859 all callers.
14860 (Plugin_manager::get_input_file): New function.
14861 (Plugin_manager::release_input_file): New function.
14862 (Pluginobj::Pluginobj): Add filesize parameter and initialize
14863 corresponding data member.
14864 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
14865 and pass to base constructor. Change all callers.
14866 (get_input_file, release_input_file): New functions.
14867 (make_sized_plugin_object): Add filesize parameter. Change all callers.
14868 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
14869 (Plugin_manager::all_symbols_read): Add task parameter.
14870 (Plugin_manager::get_input_file): New function.
14871 (Plugin_manager::release_input_file): New function.
14872 (Plugin_manager::task_): New data member.
14873 (Pluginobj::Pluginobj): Add filesize parameter.
14874 (Pluginobj::filename): New function.
14875 (Pluginobj::descriptor): New function.
14876 (Pluginobj::filesize): New function.
14877 (Pluginobj::filesize_): New data member.
14878 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
14879 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
14880 File_read::claim_for_plugin; use Object::unlock to unlock the file.
14881
14882 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
14883 with archive libraries.
14884 * testsuite/Makefile.in: Regenerate.
14885 * testsuite/plugin_test.c (struct sym_info): New type.
14886 (get_input_file, release_input_file): New static variables.
14887 (onload): Capture new transfer vector entries.
14888 (claim_file_hook): Stop reading at end of file according to filesize.
14889 Factor out parsing of readelf output into separate function.
14890 (all_symbols_read_hook): Exercise get_input_file and release_input_file
14891 APIs and get the source file name from the symbol table. Convert
14892 source file name to corresponding object file name. Print info
14893 message when adding new input files.
14894 (parse_readelf_line): New function.
14895 * testsuite/plugin_test_1.sh: Add checks for new info messages.
14896 * testsuite/plugin_test_2.sh: Likewise.
14897 * testsuite/plugin_test_3.sh: Likewise.
14898 * testsuite/plugin_test_4.sh: New test case.
14899
62a6d109
ILT
149002009-01-07 Ian Lance Taylor <iant@google.com>
14901
14902 * version.cc (version_string): Bump to 1.8.
14903
483620e8
CC
149042008-12-23 Cary Coutant <ccoutant@google.com>
14905
14906 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
14907 * plugin.cc (Plugin_manager::finish): Rename as
14908 layout_deferred_objects. Move cleanup to separate function.
14909 (Plugin_manager::cleanup): New function.
14910 (Plugin_finish::run): Call layout_deferred_objects and cleanup
14911 separately.
14912 * plugin.h (Plugin_manager::finish): Rename as
14913 layout_deferred_objects.
14914 (Plugin_manager::cleanup): New function.
14915 (Plugin_manager::cleanup_done): New field.
14916
d66a9eb3
CC
149172008-12-23 Cary Coutant <ccoutant@google.com>
14918
14919 * plugin.cc (is_visible_from_outside): New function.
14920 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
14921 so we don't return "IR only" status for exported symbols or -r links.
14922
14923 * testsuite/Makefile.am (plugin_test_3): New test case.
14924 * testsuite/Makefile.in: Regenerate.
14925 * testsuite/plugin_test_3.sh: New file.
14926
5995b570
CC
149272008-12-22 Cary Coutant <ccoutant@google.com>
14928
14929 * object.cc (Sized_relobj::layout_section): New function.
14930 (Sized_relobj::do_layout): Defer layout of input sections until after
14931 plugin has provided replacement files.
14932 (Sized_relobj::do_layout_deferred_sections): New function.
14933 * object.h (Relobj::set_section_offset): Remove virtual keyword.
14934 (Relobj::layout_deferred_sections): New function.
14935 (Relobj::do_layout_deferred_sections): New function.
14936 (Sized_relobj::do_layout_deferred_sections): New function.
14937 (Sized_relobj::layout_section): New function.
14938 (Sized_relobj::Deferred_layout): New structure.
14939 (Sized_relobj::deferred_layout_): New field.
14940 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
14941 Change all callers. Layout deferred sections.
14942 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
14943 references.
14944 (Plugin_hook::run): Move code from do_plugin_hook inline.
14945 (Plugin_hook::do_plugin_hook): Remove.
14946 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
14947 (Plugin_manager::finish): Renamed, was cleanup.
14948 (Plugin_manager::should_defer_layout): New function.
14949 (Plugin_manager::add_deferred_layout_object): New function.
14950 (Plugin_manager::Deferred_layout_list): New type.
14951 (Plugin_manager::deferred_layout_objects_): New field.
14952 (Plugin_hook::do_plugin_hook): Remove.
14953
ee769c88
ILT
149542008-12-17 Ian Lance Taylor <iant@google.com>
14955
14956 * options.h (class General_options): Add --no case for
14957 --export-dynamic.
14958
abc8dcba
CC
149592008-12-16 Cary Coutant <ccoutant@google.com>
14960
14961 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
14962 vector.
14963 (Plugin_manager::claim_file): Create plugin object even if
14964 plugin did not call the add_symbols callback.
14965 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
14966 asking for more symbols than were added.
14967 * testsuite/Makefile.am (plugin_test_1): Add test case with
14968 no global symbols.
14969 (empty.syms): New target.
14970 * testsuite/Makefile.in: Regenerate.
14971 * testsuite/plugin_test.c (claim_file_hook): Add new debug
14972 message. Don't call add_symbols if no globals.
14973 (all_symbols_read_hook): Don't provide replacement for empty
14974 claimed file.
14975
b0074644
ILT
149762008-12-12 Ian Lance Taylor <iant@google.com>
14977
68943102
ILT
14978 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
14979 r_type == 0 for a local symbol with r_sym == 0.
14980 (scan_relocatable_relocs): Pass r_sym to
14981 local_non_section_strategy.
14982 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
14983 r_sym parameter.
14984
b0074644
ILT
14985 * configure.ac: Update test for TLS descriptors: they are
14986 supported as of glibc 2.9.
14987 * configure: Rebuild.
14988
c2508178
ILT
149892008-12-11 Ian Lance Taylor <iant@google.com>
14990
14991 PR 7091
14992 * target-reloc.h (Default_scan_relocatable_relocs): For each
14993 function, map r_type == 0 to RELOC_DISCARD.
14994
2756a258
CC
149952008-12-10 Cary Coutant <ccoutant@google.com>
14996
14997 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
14998 object to override a kept COMDAT group from a plugin object.
14999
bb6f53d3
ILT
150002008-12-09 Ian Lance Taylor <iant@google.com>
15001
fbc558e1
ILT
15002 PR 7088
15003 * yyscript.y (file_cmd): Handle INPUT.
15004
bb6f53d3
ILT
15005 * testsuite/initpri1.c: Change all declarations to be full
15006 prototypes by adding void, to avoid compiler warnings.
15007
4674ecfc
CC
150082008-12-05 Rafael Avila de Espindola <espindola@google.com>
15009
15010 * options.cc (General_options::parse_plugin_opt): New.
15011 (General_options::add_plugin): The argument now is just the filename.
15012 (General_options::add_plugin_option): New.
15013 * options.h (plugin_opt): New.
15014 (add_plugin): Change argument name.
15015 (add_plugin_option): New.
15016 * plugin.cc (Plugin::load): Don't parse the plugin option.
15017 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
15018 (Plugin::add_option): New.
15019 (Plugin::args_): Change type.
15020 (Plugin::filename_): New.
15021 (Plugin_manager::add_plugin_option): New.
15022 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
15023 * testsuite/Makefile.in: Regenerate.
15024
fd06b4aa
CC
150252008-12-05 Cary Coutant <ccoutant@google.com>
15026
15027 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
15028 Handle --strip-lto-sections option.
15029 * options.h (strip_lto_sections): New option.
15030
6c52134c
CC
150312008-12-01 Cary Coutant <ccoutant@google.com>
15032
15033 * plugin.cc (ld_plugin_message): Change format parameter to const.
15034 Fix mismatch between new[] and delete.
15035
a45248e0
CC
150362008-11-14 Cary Coutant <ccoutant@google.com>
15037
15038 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
15039 instead of -1U.
15040
c82fbeee
CS
150412008-11-05 Craig Silverstein <csilvers@google.com>
15042
15043 * options.cc (General_options::parse_dynamic_list): New function.
15044 * options.h (General_options): New flags dynamic_list,
15045 dynamic_list_data, dynamic_list_cpp_new, and
15046 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
15047 (General_options::in_dynamic_list): New function.
15048 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
15049 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
15050 (Lex::can_continue_name): Likewise.
15051 (yylex): Likewise.
15052 (read_script_file): New parameter script_options.
15053 (read_dynamic_list): New function.
15054 (Script_options::define_dynamic_list): New function.
15055 (dynamic_list_keyword_parsecodes): New variable.
15056 (dynamic_list_keywords): New variable.
15057 * script.h (Script_options::define_dynamic_list): New function
15058 prototype.
15059 (read_dynamic_list): New function prototype.
15060 * symtab.cc (strprefix): New macro.
15061 (Symbol::should_add_dynsym_entry): Support dynamic_list,
15062 dynamic_list_data, dynamic_list_cpp_new, and
15063 dynamic_list_cpp_typeinfo.
15064 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
15065 (dynamic_list_expr): New rule.
15066 (dynamic_list_nodes): Likewise.
15067 (dynamic_list_node): Likewise.
15068 * testsuite/Makefile.am (dynamic_list): New test.
15069 * testsuite/Makefile.in: Regenerated.
15070 * testsuite/dynamic_list.t: New file.
15071 * testsuite/dynamic_list.sh: New file.
15072
e0bb29a5
CS
150732008-11-05 Craig Silverstein <csilvers@google.com>
15074
15075 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
15076 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
15077 (t11_last): Likewise.
15078 * testsuite/ver_test_6.c (main): Likewise.
15079
4e1e25e0
CC
150802008-10-07 Cary Coutant <ccoutant@google.com>
15081
15082 * options.c (General_options::finalize): Add check for -static and
15083 -shared.
15084 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
15085 is not empty.
15086
92f03fcb
CC
150872008-10-02 Cary Coutant <ccoutant@google.com>
15088
15089 * plugin.cc (make_sized_plugin_object): Fix conditional
15090 compilation to work when not all targets are enabled.
15091
fbd8a257
CC
150922008-09-29 Cary Coutant <ccoutant@google.com>
15093
15094 * archive.cc (Archive::get_file_and_offset): Use filename instead
15095 of name to get library path.
15096 (Archive::include_member): Unlock external member of a thin archive.
15097
15098 * testsuite/Makefile.am (TEST_AR): New variable.
15099 (thin_archive_test_1): New test.
15100 (thin_archive_test_2): New test.
81636b3f
CC
15101 * testsuite/Makefile.in: Regenerate.
15102 * testsuite/thin_archive_main.cc: New file.
15103 * testsuite/thin_archive_test_1.cc: New file.
15104 * testsuite/thin_archive_test_2.cc: New file.
15105 * testsuite/thin_archive_test_3.cc: New file.
15106 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 15107
eff45813
CC
151082008-09-29 Cary Coutant <ccoutant@google.com>
15109
15110 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
15111 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
15112 instead of -1U.
15113 (Sized_relobj::do_finalize_local_symbols): Likewise.
15114 (Sized_relobj::map_to_kept_section): Likewise.
15115 * object.h (Sized_relobj::invalid_address): New constant.
15116 (Sized_relobj::do_output_section_offset): Check for invalid_address
15117 and return -1ULL.
15118 * output.cc (Output_reloc::local_section_offset): Use constant
15119 invalid_address instead of -1U.
15120 (Output_reloc::get_address): Likewise.
15121 (Output_section::output_address): Change -1U to -1ULL.
15122 * output.h (Output_reloc::invalid_address): New constant.
15123 * reloc.cc (Sized_relobj::write_sections): Use constant
15124 invalid_address instead of -1U.
15125 (Sized_relobj::relocate_sections): Likewise.
15126 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
15127 values for merge sections.
15128 * target-reloc.h (relocate_for_relocatable): Use constant
15129 invalid_address instead of -1U.
15130
89fc3421
CC
151312008-09-19 Cary Coutant <ccoutant@google.com>
15132
15133 Add plugin functionality for link-time optimization (LTO).
15134 * configure.ac (plugins): Add --enable-plugins option.
15135 * configure: Regenerate.
15136 * config.in: Regenerate.
15137 * Makefile.am (LIBDL): New variable.
15138 (CCFILES): Add plugin.cc.
15139 (HFILES): Add plugin.h.
15140 (ldadd_var): Add LIBDL.
15141 * Makefile.in: Regenerate.
15142
15143 * archive.cc: Include "plugin.h".
15144 (Archive::setup): Don't preread archive symbols when using a plugin.
15145 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
15146 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
15147 files.
15148 (Archive::include_member): Add symbols from plugin objects.
15149 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
15150 * descriptors.cc (Descriptors::open): Check for file descriptors
15151 abandoned by plugins.
15152 (Descriptors::claim_for_plugin): New function.
15153 * descriptors.h (Descriptors::claim_for_plugin): New function.
15154 (Open_descriptor::is_claimed): New field.
15155 (claim_descriptor_for_plugin): New function.
15156 * fileread.cc (File_read::claim_for_plugin): New function.
15157 * fileread.h (File_read::claim_for_plugin): New function.
15158 (File_read::descriptor): New function.
15159 * gold.cc: Include "plugin.h".
15160 (queue_initial_tasks): Add task to call plugin hooks for generating
15161 new object files.
15162 * main.cc: Include "plugin.h".
15163 (main): Load plugin libraries.
15164 * object.h (Pluginobj): Declare.
15165 (Object::pluginobj): New function.
15166 (Object::do_pluginobj): New function.
15167 (Object::set_target): New function.
15168 * options.cc: Include "plugin.h".
15169 (General_options::parse_plugin): New function.
15170 (General_options::General_options): Initialize plugins_ field.
15171 (General_options::add_plugin): New function.
15172 * options.h (Plugin_manager): Declare.
15173 (General_options): Add --plugin option.
15174 (General_options::has_plugins): New function.
15175 (General_options::plugins): New function.
15176 (General_options::add_plugin): New function.
15177 (General_options::plugins_): New field.
15178 * plugin.cc: New file.
15179 * plugin.h: New file.
15180 * readsyms.cc: Include "plugin.h".
15181 (Read_symbols::do_read_symbols): Check for archive before checking
15182 for ELF file. Call plugin hooks to claim files.
15183 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
15184 from a real object file; force override when processing replacement
15185 files.
15186 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
15187 (Symbol::init_base_object): Likewise.
15188 (Symbol::init_base_output_data): Likewise.
15189 (Symbol::init_base_output_segment): Likewise.
15190 (Symbol::init_base_constant): Likewise.
15191 (Symbol::init_base_undefined): Likewise.
15192 (Symbol::output_section): Assert that object is not a plugin.
15193 (Symbol_table::add_from_pluginobj): New function.
15194 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
15195 undefined.
15196 (Symbol_table::sized_write_globals): Likewise.
15197 (Symbol_table::add_from_pluginobj): Instantiate template.
15198 * symtab.h (Sized_pluginobj): Declare.
15199 (Symbol::in_real_elf): New function.
15200 (Symbol::set_in_real_elf): New function.
15201 (Symbol::in_real_elf_): New field.
15202 (Symbol_table::add_from_pluginobj): New function.
15203
15204 * testsuite/Makefile.am (AM_CFLAGS): New variable.
15205 (LIBDL): New variable.
15206 (LDADD): Add LIBDL.
15207 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
15208 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
15209 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
15210 (MOSTLYCLEANFILES): Likewise.
15211 * testsuite/Makefile.in: Regenerate.
15212 * testsuite/plugin_test.c: New file.
15213 * testsuite/plugin_test_1.sh: New file.
15214 * testsuite/plugin_test_2.sh: New file.
15215
de31bda5
ILT
152162008-09-16 Ian Lance Taylor <iant@google.com>
15217
9c2d0ef9
ILT
15218 * target-reloc.h (relocate_section): Check whether a symbol is
15219 defined by the ABI before reporting an undefined symbol error.
15220 * target.h (Target::is_defined_by_abi): Make parameter const.
15221 (Target::do_is_defined_by_abi): Likewise.
15222 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
15223 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
15224 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
15225 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
15226 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
15227 * testsuite/Makefile.in: Rebuild.
15228
de31bda5
ILT
15229 * fileread.cc (make_view): Add casts to avoid warning.
15230
9fa33bee
AO
152312008-09-16 Alexandre Oliva <aoliva@redhat.com>
15232
15233 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
15234 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15235
183fd0e3
AO
152362008-09-16 Alexandre Oliva <aoliva@redhat.com>
15237
15238 * options.h (General_options::output_is_executable): New.
15239 (General_options::output_is_pie): New.
15240 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
15241 for shared libraries.
15242 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15243
7be8330a
CD
152442008-09-11 Chris Demetriou <cgd@google.com>
15245
15246 * options.h (origin): New -z option.
15247 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
15248 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
15249 in DT_FLAGS_1.
15250
a9caad02
CC
152512008-09-05 Cary Coutant <ccoutant@google.com>
15252
15253 * fileread.cc (File_read::make_view): Add check for attempt to map
15254 beyond end of file.
15255
ae6dce4d
CC
152562008-09-05 Cary Coutant <ccoutant@google.com>
15257
15258 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
15259 explicit instantiations.
15260
d7ab2a47
KVH
152612008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
15262
15263 PR gold/6858
15264 * options.cc (General_options::finalize): Allow undefined symbols
15265 in shlibs if linking -shared.
15266
15267 PR gold/6859
15268 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
15269 symbols as not needing a dynsym entry.
15270
1e52a9c1
CS
152712008-08-20 Craig Silverstein <csilvers@google.com>
15272
15273 * fileread.cc (File_read::open): Do not lock the file unless it
15274 was successfully opened.
15275
d85c80a3
CC
152762008-08-14 Cary Coutant <ccoutant@google.com>
15277
15278 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
15279 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
15280 * testsuite/tls_test.cc (struct int128): 128-bit struct
15281 for testing TLS relocs with non-zero addend.
15282 (v12): New TLS variable.
15283 (t12): New test.
15284 (t_last): Add check for v12.
15285 * testsuite/tls_test.h (t12): New function.
15286 * testsuite/tls_test_main.cc (thread_routine): Call new test.
15287
2d924fd9
ILT
152882008-08-13 Ian Lance Taylor <iant@google.com>
15289
15290 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
15291 set tls_segment_ or relro_segment_.
15292 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
15293 when appropriate.
15294 * output.h (Output_section::clear_is_relro): New function.
15295 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
15296 sections specially even when output_data_ is empty.
15297 (Output_segment::maximum_alignment): When first section is relro,
15298 only force alignment for PT_LOAD segments.
15299 * script.cc (script_data_segment_align): New function.
15300 (script_data_segment_relro_end): New function.
15301 * script-c.h (script_data_segment_align): Declare.
15302 (script_data_segment_relro_end): Declare.
15303 * script-sections.h (class Script_sections): Declare
15304 data_segment_align and data_segment_relro_end. Add fields
15305 segment_align_index_ and saw_relro_end_.
15306 * script-sections.cc (class Sections_element): Add set_is_relro
15307 virtual function. Add new bool* parameter to place_orphan_here.
15308 Add get_output_section virtual function.
15309 (class Output_section_definition): Add set_is_relro. Add new
15310 bool* parameter to place_orphan_here. Add get_output_section.
15311 Add is_relro_ field.
15312 (Output_section_definition::Output_section_definition): Initialize
15313 evaluated_address_, evaluated_load_address, evaluated_addralign_,
15314 and is_relro_ fields.
15315 (Output_section_definition::place_orphan_here): Add is_relro
15316 parameter.
15317 (Output_section_definition::set_section_addresses): Set relro for
15318 output section.
15319 (Output_section_definition::alternate_constraint): Likewise.
15320 (class Orphan_output_section): Add new bool* parameter to
15321 place_orphan_here. Add get_output_section.
15322 (Orphan_output_section::place_orphan_here): Add is_relro
15323 parameter.
15324 (Script_sections::Script_sections): Initialize
15325 data_segment_align_index_ and saw_relro_end_.
15326 (Script_sections::data_segment_align): New function.
15327 (Script_sections::data_segment_relro_end): New function.
15328 (Script_sections::place_orphan): Set or clear is_relro.
15329 (Script_sections::set_section_addresses): Force alignment of first
15330 TLS section.
15331 * yyscript.y (exp): Call script_data_segment_align and
15332 script_data_segment_relro_end.
15333 * testsuite/relro_script_test.t: New file.
15334 * testsuite/relro_test.cc (using_script): Declare.
15335 (t1, t2): Test using_script.
15336 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
15337 (relro_script_test_SOURCES): Define.
15338 (relro_script_test_DEPENDENCIES): Define.
15339 (relro_script_test_LDFLAGS): Define.
15340 (relro_script_test_LDADD): Define.
15341 (relro_script_test.so): New target.
15342 * testsuite/Makefile.in: Rebuild.
15343
f827c9a9
CC
153442008-08-06 Cary Coutant <ccoutant@google.com>
15345
15346 * archive.cc (Archive::total_archives, Archive::total_members)
15347 (Archive::total_members_loaded): New variables.
15348 (Archive::setup): Add parameter. Add option to preread
15349 archive symbols.
15350 (Archive::read_armap): Add counter.
15351 (Archive::get_file_and_offset): New function.
15352 (Archive::get_elf_object_for_member): New function.
15353 (Archive::read_all_symbols): New function.
15354 (Archive::read_symbols): New function.
15355 (Archive::add_symbols): Add counters.
15356 (Archive::include_all_members): Use armap to find members if it's
15357 already built.
15358 (Archive::include_member): Skip reading symbols if already read.
15359 Factored code into Archive::get_file_and_offset and
15360 Archive::get_elf_object_for_member. Changed call to
15361 Mapfile::report_include_archive_member.
15362 (Archive::print_stats): New function.
15363 * archive.h: Declare Object and Read_symbols_data classes.
15364 (Archive::Archive): Add initializers for new members.
15365 (Archive::setup): Add parameter.
15366 (Archive::print_stats): New function.
15367 (Archive::total_archives, Archive::total_members)
15368 (Archive::total_members_loaded): New variables.
15369 (Archive::get_file_and_offset): New function.
15370 (Archive::get_elf_object_for_member): New function.
15371 (Archive::read_all_symbols): New function.
15372 (Archive::read_symbols): New function.
15373 (Archive::Archive_member): New class.
15374 (Archive::members_): New member.
15375 (Archive::num_members_): New member.
15376 * main.cc: Include archive.h.
15377 (main): Call Archive::print_stats.
15378 * mapfile.cc (Mapfile::report_include_archive_member): Delete
15379 archive parameter; member_name is now the fully-decorated name.
15380 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
15381 * options.h: (General_options): Add --preread-archive-symbols option.
15382 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
15383 Archive::setup.
15384
de4c45bd
ILT
153852008-08-04 Ian Lance Taylor <iant@google.com>
15386
15387 * symtab.h (Symbol::use_plt_offset): New function.
15388 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
15389 * powerpc.cc (Relocate::relocate): Likewise.
15390 * sparc.cc (Relocate::relocate): Likewise.
15391 * x86_64.cc (Relocate::relocate): Likewise.
15392 * testsuite/weak_plt.sh: New test.
15393 * testsuite/weak_plt_main.cc: New test.
15394 * testsuite/weak_plt_shared.cc: New test.
15395 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
15396 (check_PROGRAMS): Add weak_plt.
15397 (check_DATA): Add weak_plt_shared.so.
15398 (weak_plt_main_pic.o, weak_plt): New targets.
15399 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
15400 * testsuite/Makefile.in: Rebuild.
15401
15402 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
15403 gcctestdir/ld.
15404 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
15405 * testsuite/Makefile.in: Rebuild.
15406
323ee3f4
AM
154072008-08-04 Alan Modra <amodra@bigpond.net.au>
15408
15409 * Makefile.am (POTFILES.in): Set LC_ALL=C.
15410 * Makefile.in: Regenerate.
15411 * po/POTFILES.in: Regenerate.
15412
7c07ecec
ILT
154132008-07-29 Ian Lance Taylor <iant@google.com>
15414
15415 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
15416 symbols before other symbols.
15417 * testsuite/script_test_2.cc (test_addr): Declare.
15418 (test_addr_alias): Declare.
15419 (main): Check that test_addr and test_addr_alias have the right
cd536b21 15420 values.
7c07ecec
ILT
15421 * testsuite/script_test_2.t: Define test_addr_alias and
15422 test_addr.
15423
5778530e
ILT
154242008-07-24 Ian Lance Taylor <iant@google.com>
15425
2a00e4fb
ILT
15426 PR 5990
15427 * descriptors.cc: New file.
15428 * descriptors.h: New file.
15429 * gold-threads.h (class Hold_optional_lock): New class.
15430 * fileread.cc: Include "descriptors.h".
15431 (File_read::~File_read): Release descriptor rather than closing
15432 it.
15433 (File_read::open) [file]: Call open_descriptor rather than open.
15434 Set is_descriptor_opened_.
15435 (File_read::open) [memory]: Assert that descriptor is not open.
15436 (File_read::reopen_descriptor): New function.
15437 (File_read::release): Release descriptor.
15438 (File_read::do_read): Make non-const. Reopen descriptor.
15439 (File_read::read): Make non-const.
15440 (File_read::make_view): Reopen descriptor.
15441 (File_read::do_readv): Likewise.
15442 * fileread.h (class File_read): Add is_descriptor_opened_ field.
15443 Update declarations.
15444 * layout.cc: Include "descriptors.h".
15445 (Layout::create_build_id): Use open_descriptor rather than open.
15446 * output.cc: Include "descriptors.h".
15447 (Output_file::open): Use open_descriptor rather than open.
15448 * archive.cc (Archive::const_iterator): Change Archive to be
15449 non-const.
15450 (Archive::begin, Archive::end): Make non-const.
15451 (Archive::count_members): Likewise.
15452 * archive.h (class Archive): Update declarations.
15453 * object.h (Object::read): Make non-const.
15454 * Makefile.am (CCFILES): Add descriptors.cc.
15455 (HFILES): Add descriptors.h.
15456 * Makefile.in: Rebuild.
15457
801647d1
ILT
15458 PR 6716
15459 * gold.h: Always include <clocale>. Add Solaris workarounds
15460 following code in binutils/sysdep.h.
15461
5edd166e
ILT
15462 PR 6048
15463 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
15464 this->eh_frame_hdr_ is NULL before using it.
15465
c89ad728
ILT
15466 * dynobj.cc (Versions::Versions): Update comment.
15467
aa86f06b
ILT
15468 * dynobj.cc (Versions::Versions): If there is an soname, use it as
15469 the base version name.
15470
5778530e
ILT
15471 * stringpool.cc (Stringpool_template::add_with_length): Set key to
15472 array size plus one.
15473 (Stringpool_template::set_string_offsets): Subtract one from key
15474 before using it as an array index.
15475 (Stringpool_template::get_offset_with_length): Likewise.
15476 (Stringpool_template::write_to_buffer): Likewise.
15477 * stringpool.h (Stringpool_template::get_offset_from_key):
15478 Likewise.
15479
057ead22
ILT
154802008-07-23 Ian Lance Taylor <iant@google.com>
15481
7f649c59
ILT
15482 PR 6658
15483 * object.h (Merged_symbol_value::value): Do our best to handle a
15484 negative addend.
15485
057ead22
ILT
15486 PR 6647
15487 * script.cc (Version_script_info::get_versions): Don't add empty
15488 version tag to return value.
15489 (Version_script_info::get_symbol_version_helper): Change return
15490 type to bool. Add pversion parameter. Change all callers.
15491 (script_register_vers_node): Don't require a non-NULL tag.
15492 * script.h (class Version_script_info): Update declarations.
15493 (Version_script_info::get_symbol_version): Change return type to
15494 bool. Add version parameter. Change all callers.
15495 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
15496 handling. Handle an empty version from a version script.
15497 (Symbol_table::define_special_symbol): Likewise.
15498 * testsuite/ver_test_10.script: New file.
15499 * testsuite/ver_test_10.sh: New file.
15500 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
15501 (check_DATA): Add ver_test_10.syms.
15502 (ver_test_10.syms, ver_test_10.so): New target.
15503 * testsuite/Makefile.in: Rebuild.
15504
58e54ac2
CD
155052008-07-23 Simon Baldwin <simonb@google.com>
15506
15507 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
15508 to zero for undefined symbols from dynamic libraries.
15509
95d14cd3
ILT
155102008-07-23 Ian Lance Taylor <iant@google.com>
15511
15512 * symtab.cc (Symbol_table::resolve): Remove version parameter.
15513 Change all callers.
15514 * symtab.h (class Symbol_table): Update declaration.
15515 * testsuite/ver_test_9.cc: New file.
15516 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
15517 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
15518 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
15519 (ver_test_9.so, ver_test_9.o): New targets.
15520 * testsuite/Makefile.in: Rebuild.
15521
92de84a6
ILT
155222008-07-22 Ian Lance Taylor <iant@google.com>
15523
34810851
ILT
15524 * options.h (class General_options): Define --check-sections.
15525 * layout.cc (Layout::set_segment_offsets): Handle
15526 --check-sections.
15527
af6156ef
ILT
15528 * options.h (class General_options): Define -n/--nmagic and
15529 -N/--omagic.
15530 * options.cc (General_options::finalize): For -n/--nmagic or
15531 -N/--omagic, set -static.
15532 * layout.cc (Layout::attach_allocated_section_to_segment): If
15533 -N/--omagic, don't put read-only and read-write sections in
15534 different segments.
15535 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
15536 finding a read-only segment.
15537 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
15538 don't set the minimum segment alignment to the common page size,
15539 and don't set the file offset to the address modulo the page size.
15540 * script-sections.cc (Script_sections::create_segments): If
15541 -n/--omagic, don't put read-only and read-write sections in
15542 different segments.
15543
92de84a6
ILT
15544 * cref.cc: New file.
15545 * cref.h: New file.
15546 * options.h (class General_options): Add --print-symbol-counts.
15547 * main.cc (main): Issue defined symbol report if requested.
15548 * archive.cc (Archive::interpret_header): Make into a const member
15549 function.
15550 (Archive::add_symbols): Call Input_objects::archive_start and
15551 archive_stop.
15552 (Archive::const_iterator): Define new class.
15553 (Archive::begin, Archive::end): New functions.
15554 (Archive::include_all_members): Rewrite to use iterator.
15555 (Archive::count_members): New function.
15556 * archive.h (class Archive): Update declarations.
15557 (Archive::filename): New function.
15558 * object.cc: Include "cref.h".
15559 (Sized_relobj::Sized_relobj): Initialize defined_count_.
15560 (Sized_relobj::do_get_global_symbol_counts): New function.
15561 (Input_objects::add_object): Add object to cross-referencer.
15562 (Input_objects::archive_start): New function.
15563 (Input_objects::archive_stop): New function.
15564 (Input_objects::print_symbol_counts): New function.
15565 * object.h: Declare Cref and Archive.
15566 (Object::get_global_symbol_counts): New function.
15567 (Object::do_get_global_symbol_counts): New pure virtual function.
15568 (class Sized_relobj): Add defined_count_ field. Update
15569 declarations.
15570 (class Input_objects): Add cref_ field. Update constructor.
15571 Update declarations.
15572 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
15573 defined_count_.
15574 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
15575 symbol counts.
15576 (Sized_dynobj::do_get_global_symbol_counts): New function.
15577 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
15578 defined_count_. Update declarations. Define Symbols typedef.
15579 * symtab.cc (Symbol_table::add_from_relobj): Add defined
15580 parameter. Change all callers.
15581 (Symbol_table::add_from_dynobj): Add sympointers and defined
15582 parameters. Change all callers.
15583 * symtab.h (class Symbol_table): Update declarations.
15584 * Makefile.am (CCFILES): Add cref.cc.
15585 (HFILES): Add cref.h.
15586 * Makefile.in: Rebuild.
15587
3f7c5e1d
CD
155882008-07-22 Simon Baldwin <simonb@google.com>
15589
15590 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
15591 to zero when writing undefined symbols.
15592
e0b64032
ILT
155932008-07-22 Ian Lance Taylor <iant@google.com>
15594
15595 * output.cc (Output_section::add_input_section): Don't try to
15596 merge empty merge sections.
15597
096b02cf
CS
155982008-07-21 Craig Silverstein <csilvers@google.com>
15599
15600 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15601 Include symbol version in error message.
cd536b21 15602
1d1f116d
CD
156032008-07-20 Chris Demetriou <cgd@google.com>
15604
cd536b21 15605 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
15606 (RANDOM_SEED_CFLAGS): New substituted variable.
15607 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
15608 * configure: Rebuild.
15609 * Makefile.in: Likewise.
15610 * testsuite/Makefile.in: Likewise.
15611
a18f591e
ILT
156122008-07-18 Ian Lance Taylor <iant@google.com>
15613
15614 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
15615 where we see NAME/NULL and NAME/VERSION as separate symbols.
15616 * testsuite/ver_test_main.cc (main): Call t4.
15617 (t4, t4_2a): Define.
15618 * testsuite/ver_test_2.cc (t4_2): Define.
15619 * testsuite/ver_test_2.script: Put t4_2a in VER2.
15620 * testsuite/ver_test_4.cc (t4_2a): Define.
15621 * testsuite/ver_test_4.script: Put t4_2a in VER2.
15622 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
15623
c6e3f6ed
ILT
156242008-07-17 Ian Lance Taylor <iant@google.com>
15625
15626 * dynobj.cc (Versions::add_def): If we give an error about a
15627 missing version, go ahead and create the version anyhow.
15628
ef9beddf
ILT
156292008-07-10 Ian Lance Taylor <iant@google.com>
15630
15631 Handle output sections with more than 0x7fffffff bytes.
15632 * object.h (class Relobj): Change map_to_output_ to
15633 output_sections_, and just keep a section pointer. Change all
15634 uses. Move comdat group support to Sized_relobj.
15635 (Relobj::is_section_specially_mapped): Remove.
15636 (Relobj::output_section): Remove poff parameter. Change all
15637 callers.
15638 (Relobj::output_section_offset): New function.
15639 (Relobj::set_section_offset): Rewrite.
15640 (Relobj::map_to_output): Remove.
15641 (Relobj::output_sections): New function.
15642 (Relobj::do_output_section_offset): New pure virtual function.
15643 (Relobj::do_set_section_offset): Likewise.
15644 (class Sized_relobj): Add section_offsets_ field. Add comdat
15645 group support from Relobj. Update declarations.
15646 (Sized_relobj::get_output_section_offset): New function.
15647 (Sized_relobj::do_output_section_offset): New function.
15648 (Sized_relobj::do_set_section_offset): New function.
15649 * object.cc (Relobj::output_section_address): Remove.
15650 (Sized_relobj::Sized_relobj): Initialize new fields.
15651 (Sized_relobj::include_section_group): Cast find_kept_object to
15652 Sized_relobj.
15653 (Sized_relobj::include_linkonce_section): Likewise.
15654 (Sized_relobj::do_layout): Use separate arrays for output section
15655 and output offset.
15656 (Sized_relobj::do_count_local_symbols): Change map_to_output to
15657 output_sections.
15658 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
15659 output_sections and section_offsets.
15660 (Sized_relobj::write_local_symbols): Likewise.
15661 (map_to_kept_section): Compute output address directly.
15662 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
15663 output_sections and section_offsets.
15664 (Sized_relobj::write_sections): Likewise.
15665 (Sized_relobj::relocate_sections): Likewise.
15666 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
15667 * output.h (class Output_reloc): Update declarations. Change
15668 u2_.relobj to Sized_relobj*.
15669 (class Output_data_reloc): Change add functions to use
15670 Sized_relobj*.
15671 * output.cc (Output_reloc::Output_reloc): Change relobj to
15672 Sized_relobj*.
15673 (Output_reloc::local_section_offset): Change return type to
15674 Elf_Addr. Use get_output_section_offset.
15675 (Output_reloc::get_address): Likewise.
15676 (Output_section::is_input_address_mapped): Don't call
15677 is_section_specially_mapped.
15678 (Output_section::output_offset): Likewise.
15679 (Output_section::output_address): Likewise.
15680 (Output_section::starting_output_address): Likewise.
15681 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
15682 parameter to Sized_relobj*.
15683 (Copy_relocs::need_copy_reloc): Likewise.
15684 (Copy_relocs::save): Likewise.
15685 * copy-relocs.h (class Copy_relocs): Update declarations.
15686 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
15687 Sized_relobj*. Change relobj_ field to Sized_relobj*.
15688 * target-reloc.h (relocate_for_relocatable): Change
15689 offset_in_output_section type to Elf_Addr. Change code that uses
15690 it as well.
15691 * layout.cc (Layout::layout): Always set *off.
15692 * mapfile.cc (Mapfile::print_input_section): Use
15693 output_section_offset.
15694 * i386.cc (Target_i386::copy_reloc): Change object parameter to
15695 Sized_relobj*.
15696 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
15697 * sparc.cc (Target_sparc::copy_reloc): Likewise.
15698 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
15699
5cb66f97
ILT
157002008-07-03 Ian Lance Taylor <iant@google.com>
15701
15702 * layout.cc (Layout::include_section): Do not discard unrecognized
15703 SHT_STRTAB sections.
15704
afe47622
CS
157052008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
15706
15707 * script.cc (Lex::can_continue_name): Make '?' allowable in
15708 version-script names.
15709 * testsuite/version_script.map: Change glob pattern to use '?'
15710
5adf9721
ILT
157112008-06-30 Manish Singh <yosh@gimp.org>
15712
15713 PR 6585
15714 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
15715 Correct typo.
15716
e6fde208
ILT
157172008-06-30 Ian Lance Taylor <iant@google.com>
15718
15719 PR 6660
15720 PR 6682
15721 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
15722 versions]: Don't try to read the value in the contents, since we
15723 don't use it. Use the template endianness when writing.
15724
3f2e6a2d
CC
157252008-06-25 Cary Coutant <ccoutant@google.com>
15726
15727 * fileread.cc (File_read::make_view): Assert on zero-length view.
15728 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
15729 symbol table when there are no symbols to read.
15730
c43d3a48
CS
157312008-06-23 Craig Silverstein <csilvers@google.com>
15732
15733 * version.cc (version_string): Bump to 1.7
15734
5f494ea0
CS
157352008-06-18 Craig Silverstein <csilvers@google.com>
15736
15737 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
15738 constant 0xFFFF to type Valtype.
15739 (Powerpc_relocate_functions::rel16_ha): Likewise.
15740
c42e122e
ILT
157412008-06-17 Ian Lance Taylor <iant@google.com>
15742
f34787f8
ILT
15743 * output.h (Output_section::Input_section): Initialize p2align_ to
15744 zero for Output_section_data constructors.
15745 (Output_section::Input_section::addralign): If not an input
15746 section, return the alignment of the Output_section_data.
15747 * testsuite/copy_test.cc: New file.
15748 * testsuite/copy_test_1.cc: New file.
15749 * testsuite/copy_test_2.cc: New file.
15750 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
15751 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
15752 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
15753 (copy_test_1_pic.o, copy_test_1.so): New targets.
15754 (copy_test_2_pic.o, copy_test_2.so): New targets.
15755 * testsuite/Makefile.in: Rebuild.
15756
c42e122e
ILT
15757 * script-sections.cc (Script_sections::place_orphan): Initialize
15758 local variable exact.
15759
ce3ac18a
DE
157602008-06-13 David Edelsohn <edelsohn@gnu.org>
15761
15762 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
15763
42cacb20
DE
157642008-06-12 David Edelsohn <edelsohn@gnu.org>
15765 David S. Miller <davem@davemloft.net>
15766
15767 * powerpc.cc: New file.
15768 * Makefile.am (TARGETSOURCES): Add powerpc.cc
15769 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
15770 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
15771 * Makefile.in: Rebuild.
15772
7b308235
ILT
157732008-06-09 Ian Lance Taylor <iant@google.com>
15774
15775 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
15776 <exception>.
15777 (throwing, orig_terminate): New static variables.
15778 (terminate_handler): New static function.
15779 (t2): Set terminate handler.
15780
f0b886e3
ILT
157812008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
15782
15783 PR 6584
cd536b21 15784 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
15785 alignment.
15786
3e90f135
CC
157872008-05-30 Cary Coutant <ccoutant@google.com>
15788
15789 * archive.cc (Archive::include_all_members) Correct to step
15790 over symbol table and extended name table in thin archives.
15791
e09ad04a
ILT
157922008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
15793
15794 PR 6407
15795 * target-reloc.h (relocate_for_relocatable): Fix new_offset
15796 calculation.
15797
62b01cb5
ILT
157982008-05-28 Caleb Howe <cshowe@google.com>
15799
15800 * reduced_debug_output.cc: New file.
15801 * reduced_debug_output.h: New file.
92de84a6 15802 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
15803 * options.cc (General_options::finalize): Add strip_debug_non_line
15804 to the strip heirarchy.
15805 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
15806 fields.
15807 * layout.cc: Include "reduced_debug_output.h".
15808 (Layout::Layout): Initialize new fields.
15809 (line_only_debug_sections): New static array.
15810 (is_lines_only_debug_sections): New static inline function.
15811 (Layout::include_section): Handle --strip-debug-non-line.
15812 (Layout::make_output_section): If --strip-debug-non-line, build
15813 new output sections for .debug_abbrev and .debug_info.
15814 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
15815 gold. Warn about possible overflow.
15816 (read_signed_LEB_128): Likewise.
15817 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
15818 (read_signed_LEB_128): Declare.
15819 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
15820 (HFILES): Add reduced_debug_output.h.
15821 * Makefile.in: Rebuild.
15822
7d9e3d98
ILT
158232008-05-21 Ian Lance Taylor <iant@google.com>
15824
15825 * mapfile.cc: New file.
15826 * mapfile.h: New file.
15827 * options.h (class General_options): Add -M/--print-map and -Map.
15828 * options.cc (General_options::finalize): Make -M equivalent to
15829 -Map -.
15830 * main.cc: Include <cstdio> and "mapfile.h".
15831 (main): Open mapfile if requested.
15832 * gold.cc (class Middle_runner): Add mapfile_ field. Update
15833 constructor. Change caller.
15834 (queue_initial_tasks): Add mapfile parameter. Change caller.
15835 (queue_middle_tasks): Likewise.
15836 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
15837 declarations.
15838 * archive.cc: Include "mapfile.h".
15839 (Archive::add_symbols): Add mapfile parameter. Change all
15840 callers. Pass mapfile, symbol, and reason to include_member.
15841 (Archive::include_all_members): Add mapfile parameter. Change all
15842 callers.
15843 (Archive::include_member): Add mapfile, sym, and why parameters.
15844 Change all callers. Report inclusion to map file.
15845 * archive.h: Include "fileread.h".
15846 (class Archive): Update declarations.
15847 (Archive::file): New const method.
15848 (class Add_archive_symbols): Add mapfile_ field. Update
15849 constructor. Change all callers.
15850 * readsyms.h (class Read_symbols): Likewise.
15851 (class Finish_group): Likewise.
15852 (class Read_script): Likewise.
15853 * common.cc: Include "mapfile.h".
15854 (Symbol_table::allocate_commons): Add mapfile parameter. Change
15855 all callers.
15856 (Symbol_table::do_allocate_commons): Likewise.
15857 (Symbol_table::do_allocate_commons_list): Likewise. Report common
15858 symbol allocation to mapfile.
15859 * common.h (class Allocate_commons_task): Add mapfile_ field.
15860 Update constructor. Change all callers.
15861 * symtab.h (class Symbol_table): Update declarations.
15862 * layout.cc: Include "mapfile.h".
15863 (Layout_task_runner::run): Print information to mapfile.
15864 (Layout::create_gold_note): Change Output_data_fixed_space to
15865 Output_data_zero_fill.
15866 (Layout::create_build_id): Likewise.
15867 (Layout::print_to_mapfile): New function.
15868 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
15869 constructor. Change caller.
15870 (class Layout): Declare print_to_mapfile.
15871 * output.cc (Output_section::Input_section::print_to_mapfile): New
15872 function.
15873 (Output_section::add_input_section): If producing a map, always
15874 add to input_sections_ list.
15875 (Output_section::do_print_to_mapfile): New function.
15876 (Output_segment::print_sections_to_mapfile): New function.
15877 (Output_segment::print_section_list_to_mapfile): New function.
15878 * output.h: Include "mapfile.h".
15879 (Output_data::print_to_mapfile): New function.
15880 (Output_data::do_print_to_mapfile): New virtual function.
15881 (Output_segment_headers::do_print_to_mapfile): New function.
15882 (Output_file_header::do_print_to_mapfile): New function.
15883 (Output_data_const::do_print_to_mapfile): New function.
15884 (class Output_data_const_buffer): Add map_name_ field. Update
15885 constructor. Change all callers. Add do_print_to_mapfile
15886 function.
15887 (class Output_data_fixed_space): Likewise.
15888 (class Output_data_space): Likewise.
15889 (class Output_data_zero_fill): New class.
15890 (Output_data_strtab::do_print_to_mapfile): New function.
15891 (Output_data_reloc_base::do_print_to_mapfile): New function.
15892 (Output_relocatable_relocs::do_print_to_mapfile): New function.
15893 (Output_data_group::do_print_to_mapfile): New function.
15894 (Output_data_got::do_print_to_mapfile): New function.
15895 (Output_data_dynamic::do_print_to_mapfile): New function.
15896 (Output_symtab_xindex::do_print_to_mapfile): New function.
15897 (class Output_section): Declare do_print_to_mapflie. Declare
15898 print_to_mapfile in Input_section.
15899 (class Output_segment): Declare new functions.
15900 * object.h (Sized_relobj::symbol_count): New function.
15901 * script-sections.cc
15902 (Output_section_element_dot_assignment::set_section_addresses):
15903 Change Output_data_fixed_space to Output_data_zero_fill.
15904 (Output_data_expression::do_print_to_mapfile): New function.
15905 * script.cc (read_input_script): Add mapfile parameter. Change
15906 all callers.
15907 * script.h (read_input_script): Update declaration.
15908 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
15909 (Eh_frame::do_print_to_mapfile): New function.
15910 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
15911 (Output_merge_string::do_print_to_mapfile): New function.
15912 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
15913 function.
15914 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
15915 function.
15916 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
15917 function.
15918 * Makefile.am (CCFILES): Add mapfile.cc.
15919 (HFILES): Add mapfile.h.
15920 * Makefile.in: Rebuild.
15921
9f1d377b
ILT
159222008-05-19 Ian Lance Taylor <iant@google.com>
15923
15924 * options.h (class General_options): Add -z relro.
15925 * layout.cc (Layout::Layout): Initialize relro_segment_.
15926 (Layout::add_output_section_data): Return the output section.
15927 (Layout::make_output_section): Rcognize relro sections and mark
15928 them appropriately.
15929 (Layout::attach_allocated_section_to_segment): Put relro sections
15930 in a PT_GNU_RELRO segment.
15931 (Layout::create_initial_dynamic_sections): Mark the .dynamic
15932 section as relro.
15933 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
15934 PT_TLS segments.
15935 (Layout::linkonce_mapping): Map d.rel.ro.local to
15936 .data.rel.ro.local.
15937 (Layout::output_section_name): Us .data.rel.ro.local for any
15938 section which begins with that.
15939 * layout.h (class Layout): Update add_output_section_data
15940 declaration. Add relro_segment_ field.
15941 * output.cc (Output_section::Output_section): Initialize is_relro_
15942 and is_relro_local_ fields.
15943 (Output_segment::add_output_section): Group relro sections.
15944 (Output_segment::is_first_section_relro): New function.
15945 (Output_segment::maximum_alignment): If there is a relro section,
15946 align the segment to the common page size.
15947 (Output_segment::set_section_addresses): Track whether we are
15948 looking at relro sections. If the last section is a relro
15949 section, align to the common page size.
15950 (Output_segment::set_section_list_addresses): Add in_relro
15951 parameter. Change all callers. Align to the page size when
15952 moving from relro to non-relro section.
15953 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
15954 segment.
15955 * output.h (class Output_section): Add is_relro_ and
15956 is_relro_local_ fields.
15957 (Output_section::is_relro): New function.
15958 (Output_section::set_is_relro): New function.
15959 (Output_section::is_relro_local): New function.
15960 (Output_section::set_is_relro_local): New function.
15961 (class Output_segment): Update declarations.
15962 * i386.cc (Target_i386::got_section): Mark .got section as relro.
15963 * sparc.cc (Target_sparc::got_section): Likewise.
15964 * x86_64.cc (Target_x86_64::got_section): Likewise.
15965 * testsuite/relro_test_main.cc: New file.
15966 * testsuite/relro_test.cc: New file.
15967 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
15968 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
15969 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
15970 (relro_test.so, relro_test_pic.o): New targets.
15971 * testsuite/Makefile.in: Rebuild.
15972
a984ee1d
ILT
159732008-05-16 Ian Lance Taylor <iant@google.com>
15974
01676dcd
ILT
15975 * output.cc (Output_segment::add_output_section): Remove front
15976 parameter.
15977 * output.h (class Output_segment): Remove
15978 add_initial_output_section and overloaded add_output_section.
15979 Update declaration of remaining add_output_section.
15980 * layout.cc (Layout::create_interp): Call add_output_section
15981 rather than add_initial_output_section.
15982 (Layout::finish_dynamic_section): Likewise.
15983
497897f9
ILT
15984 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
15985 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
15986 know the dynamic type.
15987 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
15988 field. Initialize it in constructor.
15989 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
15990 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
15991 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
15992 reloc.
15993
a984ee1d
ILT
15994 * output.cc (Output_reloc::get_address): Change return type to
15995 Elf_Addr.
15996 * output.h (class Output_reloc): Update get_address declaration.
15997 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
15998 for section addresses.
15999
55ba0940
ILT
160002008-05-09 Ian Lance Taylor <iant@google.com>
16001
16002 PR 6493
16003 * gold.cc (gold_nomem): Use return value of write.
16004
75517b77
ILT
160052008-05-08 Ian Lance Taylor <iant@google.com>
16006
16007 * symtab.c (Symbol::init_base_output_data): Add version
16008 parameter. Change all callers.
16009 (Symbol::init_base_output_segment): Likewise.
16010 (Symbol::init_base_constant): Likewise.
16011 (Symbol::init_base_undefined): Likewise.
16012 (Sized_symbol::init_output_data): Likewise.
16013 (Sized_symbol::init_output_segment): Likewise.
16014 (Sized_symbol::init_constant): Likewise.
16015 (Sized_symbol::init_undefined): Likewise.
16016 (Symbol_table::do_define_in_output_data): If the new symbol has a
16017 version, mark it as the default.
16018 (Symbol_table::do_define_in_output_segment): Likewise.
16019 (Symbol_table::do_define_as_constant): Likewise.
16020 * symtab.h (class Symbol): Update declarations.
16021 (class Sized_symbol): Likewise.
16022 * resolve.cc (Symbol::override_version): New function.
c42e122e 16023 (Symbol::override_base): Call override_version.
75517b77
ILT
16024 (Symbol::override_base_with_special): Likewise.
16025 * testsuite/ver_script_8.script: New file.
16026 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
16027 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
16028 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
16029 (ver_test_8_1.so, ver_test_8_2.so): New targets.
16030
f1f70eae
ILT
160312008-05-06 Ian Lance Taylor <iant@google.com>
16032
f3e9c5c5
ILT
16033 PR 6049
16034 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
16035 functions.
16036 (class General_options): Remove existing --undefined, and add
16037 --no-undefined instead. Add new --undefined as synonym for -u.
16038 * archive.cc (Archive::add_symbols): Check whether symbol was
16039 named with -u.
16040 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
16041 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
16042 all uses. Add IS_UNDEFINED. Update declarations to split
16043 different versions of init_base. Declare init_base_undefined.
16044 (Symbol::is_defined): Handle IS_UNDEFINED.
16045 (Symbol::is_undefined): Likewise.
16046 (Symbol::is_weak_undefined): Call is_undefined.
16047 (Symbol::is_absolute): Handle IS_CONSTANT.
16048 (class Sized_symbol): Update declarations to split different
16049 versions of init. Declare init_undefined.
16050 (class Symbol_table): Declare new functions.
16051 * symtab.cc (Symbol::init_base_object): Rename from init_base.
16052 Change all callers.
16053 (Symbol::init_base_output_data): Likewise.
16054 (Symbol::init_base_output_segment): Likewise.
16055 (Symbol::init_base_constant): Likewise.
16056 (Symbol::init_base_undefined): New function.
16057 (Sized_symbol::init_object): Rename from init. Change all
16058 callers.
16059 (Sized_symbol::init_output_data): Likewise.
16060 (Sized_symbol::init_output_segment): Likewise.
16061 (Sized_symbol::init_constant): Likewise.
16062 (Sized_symbol::init_undefined): New function.
16063 (Symbol_table::add_undefined_symbols_from_command_line): New
16064 function.
16065 (Symbol_table::do_add_undefined_symbols_from_command_line): New
16066 function.
16067 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
16068 (Symbol::output_section): Likewise.
16069 (Symbol::set_output_section): Likewise.
16070 (Symbol_table::sized_finalize_symbol): Likewise.
16071 (Symbol_table::sized_write_globals): Likewise.
16072 * resolve.cc (Symbol_table::should_override): Likewise.
16073 (Symbol::override_base_with_special): Likewise.
16074
8bdcdf2c
ILT
16075 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
16076 symbol, change it to have default visibility.
16077 * testsuite/protected_1.cc: New file.
16078 * testsuite/protected_2.cc: New file.
16079 * testsuite/protected_3.cc: New file.
16080 * testsuite/protected_main_1.cc: New file.
16081 * testsuite/protected_main_2.cc: New file.
16082 * testsuite/protected_main_3.cc: New file.
16083 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
16084 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
16085 (protected_1_LDFLAGS, protected_1_LDADD): Define.
16086 (protected_1.so): New target.
16087 (protected_1_pic.o, protected_2_pic.o): New targets.
16088 (protected_3_pic.o): New target.
16089 (check_PROGRAMS): Add protected_2.
16090 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
16091 (protected_2_LDFLAGS, protected_2_LDADD): Define.
16092 * testsuite/Makefile.in: Rebuild.
16093
2b706932
ILT
16094 * options.h (DEFINE_var): Add set_user_set_##varname__.
16095 (DEFINE_bool_alias): New macro.
16096 (class General_options): Define -Bstatic using DEFINE_bool_alias
16097 rather than DEFINE_special. Add --undefined as an alias for -z
16098 defs.
16099 * options.cc (General_options::parse_Bstatic): Remove.
16100
d82a5bcc
ILT
16101 * options.h (class General_options): Add --fatal-warnings.
16102 * main.cc (main): Implement --fatal-warnings.
16103 * errors.h (Errors::warning_count): New function.
16104
f1f70eae
ILT
16105 * options.h (class General_options): Add -Bsymbolic-functions.
16106 * symtab.h (Symbol::is_preemptible): Check for
16107 -Bsymbolic-functions.
16108
8825ac63
ILT
161092008-05-05 Ian Lance Taylor <iant@google.com>
16110
d98bc257
ILT
16111 * options.h (DEFINE_bool): For DASH_Z, create the negative option
16112 as noVARNAME rather than no-VARNAME.
16113 (class General_options): Add option -z combreloc.
16114 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
16115 get_address.
16116 (Output_reloc::sort_before) [SHT_REL]: New function.
16117 (Output_reloc::sort_before) [SHT_RELA]: New function.
16118 (class Output_data_reloc_base): Add sort_relocs_ field. Define
16119 Sort_relocs_comparison.
16120 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
16121 parameter. Change all callers.
16122 (Output_data_reloc::Output_data_reloc) [both versions]: Add
16123 sort_relocs parameter. Change all callers.
16124 * output.cc (Output_reloc::get_address): New function, broken out
16125 of write_rel.
16126 (Output_reloc::write_rel): Call it.
16127 (Output_reloc::compare): New function.
16128 (Output_data_reloc_base::do_write): Optionally sort relocs.
16129
60b2b4e7
ILT
16130 * configure.ac: If targ_extra_obj is set, link it in.
16131 * configure.tgt: Initialize all variables.
16132 (x86_64*): Set targ_extra_obj and targ_extra_size.
16133 * configure: Rebuild.
16134
8825ac63
ILT
16135 * object.cc (Sized_relobj::include_section_group): Adjust section
16136 indexes read from group data. Build vector to pass to
16137 layout_group.
16138 * layout.cc (Layout::layout_group): Add flags and shndxes
16139 parameters. Remove contents parameter. Change caller. Update
16140 explicit instantiations.
16141 * layout.h (class Layout): Update layout_group declaration.
16142 * output.cc (Output_data_group::Output_data_group): Add flags and
16143 input_shndxes parameters. Remove contents parameter. Change
16144 caller.
16145 (Output_data_group::do_write): Change input_sections_ to
16146 input_shndxes_.
16147 * output.h (class Output_data_group): Update constructor
16148 declaration. Rename input_sections_ to input_shndxes_.
16149 * testsuite/many_sections_test.cc: Add template.
16150
e94cf127
CC
161512008-04-30 Cary Coutant <ccoutant@google.com>
16152
4418b2d5
CC
16153 * target-reloc.h (relocate_section): Fix dead-pointer bug.
16154
e94cf127
CC
16155 * layout.cc (Layout::include_section): Refactored check for debug
16156 info section.
16157 (Layout::add_comdat): Add new parameters. Change type
16158 of signature parameter. Add object and shndx to signatures table.
16159 (Layout::find_kept_object): New function.
16160 * layout.h: Include <cstring>.
16161 (Layout::is_debug_info_section): New function.
16162 (Layout::add_comdat): Add new parameters.
16163 (Layout::find_kept_object): New function.
16164 (Layout::Kept_section): New struct.
16165 (Layout::Signatures): Change type of map range.
16166 * object.cc (Relobj::output_section_address): New function.
16167 (Sized_relobj::include_section_group): Add new parameters. Change
16168 calls to Layout::add_comdat. Change to build table of kept comdat
16169 groups and table mapping discarded sections to kept sections.
16170 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
16171 (Sized_relobj::do_layout): Change calls to include_section_group and
16172 include_linkonce_section.
16173 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
16174 value to zero when section is discarded.
16175 (Sized_relobj::map_to_kept_section): New function.
16176 * object.h (Relobj::output_section_address): New function.
16177 (Relobj::Comdat_group): New type.
16178 (Relobj::find_comdat_group): New function.
16179 (Relobj::Comdat_group_table): New type.
16180 (Relobj::Kept_comdat_section): New type.
16181 (Relobj::Kept_comdat_section_table): New type.
16182 (Relobj::add_comdat_group): New function.
16183 (Relobj::set_kept_comdat_section): New function.
16184 (Relobj::get_kept_comdat_section): New function.
16185 (Relobj::comdat_groups_): New field.
16186 (Relobj::kept_comdat_sections_): New field.
16187 (Symbol_value::input_value): Update comment.
16188 (Sized_relobj::map_to_kept_section) New function.
16189 (Sized_relobj::include_linkonce_section): Add new parameter.
16190 * target-reloc.h (Comdat_behavior): New type.
16191 (get_comdat_behavior): New function.
16192 (relocate_section): Add code to map a discarded section to the
16193 corresponding kept section when applying a relocation.
16194
e4e5049b
CS
161952008-04-30 Craig Silverstein <csilvers@google.com>
16196
16197 * dwarf_reader.cc (next_generation_count): New static var.
16198 (Addr2line_cache_entry): New struct.
16199 (addr2line_cache): New static var.
16200 (Dwarf_line_info::one_addr2line): Added caching.
16201 (Dwarf_line_info::clear_addr2line_cache): New function.
16202 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
16203 cache-size parameter.
16204 (Dwarf_line_info::one_addr2line_cache): New function.
16205 * symtab.cc (Symbol_table::detect_odr_violations): Pass
16206 new cache-size argument to one_addr2line(), and clear cache.
16207
d09e9154
CC
162082008-04-28 Cary Coutant <ccoutant@google.com>
16209
16210 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
16211 R_386_PC8 relocations.
16212
7ef73768
ILT
162132008-04-23 Ian Lance Taylor <iant@google.com>
16214
55438702
ILT
16215 * object.cc (Sized_relobj::include_section_group): Check for
16216 invalid section group.
16217
c165fb93
ILT
16218 * object.cc (make_elf_object): Correct test for 64-bit ELF file
16219 header size.
16220
7ef73768
ILT
16221 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
16222 than read for file header.
16223 * archive.cc (Archive::include_member): Likewise.
16224
6194aaab
L
162252008-04-23 Paolo Bonzini <bonzini@gnu.org>
16226
16227 * aclocal.m4: Regenerate.
16228 * configure: Regenerate.
16229
d491d34e
ILT
162302008-04-19 Ian Lance Taylor <iant@google.com>
16231
5ea2bac6
ILT
16232 * version.cc (version_string): Bump to 1.6.
16233
7bc3e21a
ILT
16234 * testsuite/Makefile.am (many_sections_r_test): New target.
16235 (many_sections_r_test_SOURCES): Remove.
16236 (many_sections_r_test_DEPENDENCIES): Remove.
16237 (many_sections_r_test_LDFLAGS): Remove.
16238 (many_sections_r_test_LDADD): Remove.
16239
7fcd3aa9
ILT
16240 * object.cc (Sized_relobj::do_add_symbols): Always pass
16241 local_symbol_count_ to add_from_relobj.
16242
4c94d6ae
ILT
16243 * testsuite/Makefile.am (many_sections_check.h): Only check one in
16244 every thousand variables.
16245 * testsuite/Makefile.in: Rebuild.
16246
d491d34e
ILT
16247 * object.cc (Xindex::initialize_symtab_xindex): New function.
16248 (Xindex::read_symtab_xindex): New function.
16249 (Xindex::sym_xindex_to_shndx): New function.
16250 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
16251 available.
16252 (Sized_relobj::do_initialize_xindex): New function.
16253 (Sized_relobj::do_read_symbols): Adjust section links.
16254 (Sized_relobj::symbol_section_and_value): Add is_ordinary
16255 parameter. Change all callers.
16256 (Sized_relobj::include_section_group): Adjust section links and
16257 symbol section indexes.
16258 (Sized_relobj::do_layout): Adjust section links.
16259 (Sized_relobj::do_count_local_symbols): Adjust section links and
16260 symbol section indexes.
16261 (Sized_relobj::do_finalize_local_symbols): Distinguish between
16262 ordinary and special symbols.
16263 (Sized_relobj::write_local_symbols): Add symtab_xindex and
16264 dynsym_xindex parameters. Change all callers. Adjust section
16265 links. Use SHN_XINDEX when needed.
16266 (Sized_relobj::get_symbol_location_info): Adjust section links.
16267 Don't get fooled by special symbols.
16268 * object.h (class Xindex): Define.
16269 (class Object): Add xindex_ parameter. Declare virtual functoin
16270 do_initialize_xindex.
16271 (Object::adjust_sym_shndx): New function.
16272 (Object::set_xindex): New protected function.
16273 (class Symbol_value): Add is_ordinary_shndx_ field.
16274 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
16275 (Symbol_value::value): Assert ordinary section.
16276 (Symbol_value::initialize_input_to_output_map): Likewise.
16277 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
16278 Change all callers.
16279 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
16280 all callers.
16281 (class Sized_relobj): Update declarations.
16282 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
16283 parameter. Change all callers.
16284 (Sized_relobj::adjust_shndx): New function.
16285 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
16286 field.
16287 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
16288 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
16289 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
16290 (Sized_dynobj::read_dynsym_section): Adjust section links.
16291 (Sized_dynobj::read_dynamic): Likewise.
16292 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
16293 section links.
16294 (Sized_dynobj::do_initialize_xindex): New function.
16295 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
16296 do_initialize_xindex.
16297 (Sized_dynobj::adjust_shndx): New function.
16298 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
16299 dynsym_xindex_ fields.
16300 (Layout::finalize): Add a call to set_section_indexes before
16301 creating the symtab sections.
16302 (Layout::set_section_indexes): Don't do anything if the section
16303 already has a section index.
16304 (Layout::create_symtab_sections): Add shnum parameter. Change
16305 caller. Create .symtab_shndx section if needed.
16306 (Layout::create_shdrs): Add shstrtab_section parameter. Change
16307 caller.
16308 (Layout::allocated_output_section_count): New function.
16309 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
16310 needed.
16311 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
16312 fields. Update declarations.
16313 (Layout::symtab_xindex): New function.
16314 (Layout::dynsym_xindex): New function.
16315 (class Write_symbols_task): Add layout_ field.
16316 (Write_symbols_task::Write_symbols_task): Add layout parameter.
16317 Change caller.
16318 * output.cc (Output_section_headers::Output_section_headers): Add
16319 shstrtab_section parameter. Change all callers.
16320 (Output_section_headers::do_sized_write): Store overflow values
16321 for section count and section string table section index in
16322 section header zero.
16323 (Output_file_header::do_sized_write): Check for overflow of
16324 section count and section string table section index.
16325 (Output_symtab_xindex::do_write): New function.
16326 (Output_symtab_xindex::endian_do_write): New function.
16327 * output.h (class Output_section_headers): Add shstrtab_section_.
16328 Update declarations.
16329 (class Output_symtab_xindex): Define.
16330 (Output_section::has_out_shndx): New function.
16331 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
16332 field.
16333 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
16334 Change all callers.
16335 (Sized_symbol::init): Likewise.
16336 (Symbol::output_section): Check for ordinary symbol.
16337 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
16338 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
16339 callers.
16340 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
16341 Change all callers. Simplify handling of symbols from sections
16342 not included in the link.
16343 (Symbol_table::add_from_dynobj): Handle ordinary symbol
16344 distinction.
16345 (Weak_alias_sorter::operator()): Assert that symbols are
16346 ordinary.
16347 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
16348 distinction.
16349 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
16350 parameters. Change all callers.
16351 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
16352 symbol distinction. Use SHN_XINDEX when needed.
16353 (Symbol_table::write_section_symbol): Add symtab_xindex
16354 parameter. Change all callers.
16355 (Symbol_table::sized_write_section_symbol): Likewise. Use
16356 SHN_XINDEX when needed.
16357 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
16358 declarations.
16359 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
16360 (Symbol::is_defined): Check is_ordinary.
16361 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
16362 (Symbol::is_absolute, Symbol::is_common): Likewise.
16363 (class Sized_symbol): Update declarations.
16364 (class Symbol_table): Update declarations.
16365 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
16366 parameters. Change all callers.
16367 (Sized_symbol::override): Likewise.
16368 (Symbol_table::override): Likewise.
16369 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
16370 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
16371 is_ordinary, and orig_st_shndx parameters. Change all callers.
16372 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
16373 to be in an ordinary section.
16374 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
16375 object and is_ordinary parameters. Change all callers.
16376 (Sized_dwarf_line_info::read_relocs): Add object parameter.
16377 Change all callers. Don't add undefined or non-ordinary symbols
16378 to reloc_map_.
16379 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
16380 Change all callers.
16381 * dwarf_reader.h (class Sized_dwarf_line_info): Update
16382 declarations.
16383 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
16384 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
16385 (Sized_relobj::relocate_sections): Likewise.
16386 * target-reloc.h (scan_relocs): Adjust section symbol index.
16387 (scan_relocatable_relocs): Likewise.
16388 * i386.cc (Scan::local): Check for ordinary symbols.
16389 * sparc.cc (Scan::local): Likewise.
16390 * x86_64.cc (Scan::local): Likewise.
16391 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
16392 to symbol_section_and_value.
16393 * testsuite/many_sections_test.cc: New file.
16394 * testsuite/Makefile.am (BUILT_SOURCES): Define.
16395 (check_PROGRAMS): Add many_sections_test.
16396 (many_sections_test_SOURCES): Define.
16397 (many_sections_test_DEPENDENCIES): Define.
16398 (many_sections_test_LDFLAGS): Define.
16399 (BUILT_SOURCES): Add many_sections_define.h.
16400 (many_sections_define.h): New target.
16401 (BUILT_SOURCES): Add many_sections_check.h.
16402 (many_sections_check.h): New target.
16403 (check_PROGRAMS): Add many_sections_r_test.
16404 (many_sections_r_test_SOURCES): Define.
16405 (many_sections_r_test_DEPENDENCIES): Define.
16406 (many_sections_r_test_LDFLAGS): Define.
16407 (many_sections_r_test_LDADD): Define.
16408 (many_sections_r_test.o): New target.
16409 * testsuite/Makefile.in: Rebuild.
16410
c5818ff1
CC
164112008-04-17 Cary Coutant <ccoutant@google.com>
16412
16413 * errors.cc (Errors::info): New function.
16414 (gold_info): New function.
16415 * errors.h (Errors::info): New function.
16416 * gold.h (gold_info): New function.
16417 * object.cc (Input_objects::add_object): Print trace output.
16418 * options.cc (options::parse_set): New function.
16419 (General_options::parse_wrap): Deleted.
16420 (General_options::General_options): Deleted initializer.
16421 * options.h (options::String_set): New typedef.
16422 (options::parse_set): New function.
16423 (DEFINE_set): New macro.
16424 (General_options::wrap): Changed to use DEFINE_set. Changed
16425 callers of any_wrap_symbols and is_wrap_symbol.
16426 (General_options::trace, General_options::trace_symbol):
16427 New options.
16428 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
16429 (General_options::wrap_symbols_): Deleted.
16430 * symtab.cc (Symbol_table::add_from_object): Print trace output.
16431
b5be4a7c
DM
164322008-04-17 David S. Miller <davem@davemloft.net>
16433
16434 * options.cc (General_options::parse_V): New function.
16435 * options.h: Add entries for -V and -Qy.
16436
155a0dd7
ILT
164372008-04-17 Ian Lance Taylor <iant@google.com>
16438
16439 * common.cc (Symbol_table::allocate_commons): Remove options
16440 parameter. Change caller.
16441 (Symbol_table::do_allocate_commons): Remove options parameter.
16442 Change caller. Just call do_allocate_commons_list twice.
16443 (Symbol_table::do_allocate_commons_list): New function, broken out
16444 of do_allocate_commons.
16445 * common.h (class Allocate_commons_task): Remove options_ field.
16446 Update constructor.
16447 * symtab.cc (Symbol_table::Symbol_table): Initialize
16448 tls_commons_.
16449 (Symbol_table::add_from_object): Put TLS common symbols on
16450 tls_commons_ list.
16451 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
16452 which are IN_OUTPUT_DATA.
16453 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
16454 allocate_commons and do_allocate_commons declarations. Declare
16455 do_allocate_commons_list.
16456 * gold.cc (queue_middle_tasks): Update creation of
16457 Allocate_commons_task to not pass options.
16458 * testsuite/Makefile.am (INCLUDES): Add -I.. .
16459 (TLS_TEST_C_FLAGS): New variable.
16460 (tls_test_c_pic.o): New target.
16461 (tls_test_shared.so): Link in tls_test_c_pic.o.
16462 (tls_test_c_pic_ie.o): New target.
16463 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
16464 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
16465 (tls_test_c.o): New target.
16466 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
16467 (tls_pic_test_LDADD): Likewise.
16468 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
16469 (tls_shared_gd_to_ie_test_LDADD): Likewise.
16470 (tls_test_c_gnu2.o): New target.
16471 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
16472 tls_test_c_gnu2.o.
16473 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
16474 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
16475 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
16476 * testsuite/tls_test.cc: Include "config.h".
16477 (t_last): Call t11_last.
16478 * testsuite/tls_test.h (t11, t11_last): Declare.
16479 * testsuite/tls_test_c.c: New file.
16480 * testsuite/tls_test_main.cc (thread_routine): Call t11.
16481 * configure.ac: Check for OpenMP support.
16482 * configure, config.in, Makefile.in: Rebuild.
16483 * testsuite/Makefile.in: Rebuild.
16484
edfbb029
CC
164852008-04-16 Cary Coutant <ccoutant@google.com>
16486
16487 * i386.cc (Target_i386::define_tls_base_symbol): New function.
16488 (Target_i386::tls_base_symbol_defined_): New field.
16489 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16490 (Target_i386::Scan::global): Likewise.
16491 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
16492 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
16493 (Target_x86_64::tls_base_symbol_defined_): New field.
16494 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16495 (Target_x86_64::Scan::global): Likewise.
16496
f3c69fca
CC
164972008-04-16 Cary Coutant <ccoutant@google.com>
16498
16499 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
16500 (Symbol::needs_plt_entry): Allow weak undefined symbols.
16501 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
16502 building shared libraries.
16503 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
16504 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
16505 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
16506 * testsuite/Makefile.in: Rebuild.
16507 * testsuite/weak_undef.h: New file.
16508 * testsuite/weak_undef_file1.cc: Add extra test cases.
16509 * testsuite/weak_undef_file2.cc: Likewise.
16510 * testsuite/weak_undef_test.cc: Likewise.
16511
7c414435
DM
165122008-04-16 David S. Miller <davem@davemloft.net>
16513
32b769e1
DM
16514 * sparc.cc (Target_sparc::Scan): Change from struct to class.
16515 Add issued_non_pic_error_ field. Declare check_non_pic.
16516 (Target_sparc::Scan::check_non_pic): New function.
16517 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
16518 (Target_sparc::Scan::global): Likewise.
16519
11936fb1
DM
16520 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
16521 * configure: Rebuild.
16522
7c414435
DM
16523 * options.h (DEFINE_enable): New macro.
16524 (new_dtags): New enable option.
16525 (initfirst, interpose, loadfltr, nodefaultlib,
16526 nodelete, nodlopen, nodump): New -z options.
16527 * layout.cc (Layout:finish_dynamic_section): If new
16528 dtags enabled, emit DT_RUNPATH. Also, emit a
16529 DT_FLAGS_1 containing any specified -z flags.
16530
85c7bf8b
ILT
165312008-04-16 Ian Lance Taylor <iant@google.com>
16532
12c0daef
ILT
16533 * copy-relocs.cc: New file.
16534 * copy-relocs.h: New file.
16535 * reloc.cc: Remove Copy_relocs code.
16536 * reloc.h: Likewise.
16537 * reloc-types.h (struct Reloc_types) [both versions]: Add
16538 get_reloc_addend_noerror.
16539 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
16540 variants of add_global which take an addend which must be zero.
16541 * i386.cc: Include "copy-relocs.h".
16542 (class Target_i386): Change type of copy_relocs_ to variable,
16543 update initializer.
16544 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
16545 Change all callers.
16546 (Target_i386::do_finalize_sections): Change handling of
16547 copy_relocs_.
16548 * sparc.cc: Include "copy-relocs.h".
16549 (class Target_sparc): Change type of copy_relocs_ to variable,
16550 update initializer.
16551 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
16552 Change all callers.
16553 (Target_sparc::do_finalize_sections): Change handling of
16554 copy_relocs_.
16555 * x86_64.cc: Include "copy-relocs.h".
16556 (class Target_x86_64): Change type of copy_relocs_ to variable,
16557 update initializer.
16558 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
16559 class. Change all callers.
16560 (Target_x86_64::do_finalize_sections): Change handling of
16561 copy_relocs_.
16562 * Makefile.am (CCFILES): Add copy-relocs.cc.
16563 (HFILES): Add copy-relocs.h.
16564
4f4995b6
ILT
16565 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
16566
85c7bf8b
ILT
16567 * testsuite/script_test_4.sh: Permit leading zeroes.
16568
4f2a9edd
ILT
165692008-04-15 Ian Lance Taylor <iant@google.com>
16570
e6188289
ILT
16571 * script-sections.cc (Script_sections::create_segments): Use
16572 header_size_adjustment even when there is enough room for the
16573 headers.
16574 * testsuite/script_test_4.sh: New file.
16575 * testsuite/script_test_4.t: New file.
16576 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
16577 (check_DATA): Add script_test_4.stdout.
16578 (MOSTLYCLEANFILES): Likewise.
16579 (script_test_4): New target.
16580 (script_test_4.stdout): New target.
16581 * testsuite/Makefile.in: Rebuild.
16582
4f2a9edd
ILT
16583 * sparc.cc: Add definitions for Output_data_plt_sparc class
16584 constants.
16585
f5314dd5
DM
165862008-04-14 David S. Miller <davem@davemloft.net>
16587
16588 * sparc.cc: New file.
16589 * Makefile.am (TARGETSOURCES): Add sparc.cc
16590 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
16591 * configure.tgt: Document targ_extra_size and
16592 targ_extra_big_endian. Add entries for sparc-* and
16593 sparc64-*.
16594 * configure.ac: Handle targ_extra_size and
16595 targ_extra_big_endian.
16596 * Makefile.in: Rebuild.
16597 * configure: Likewise.
16598 * po/POTFILES.in: Likewise.
16599 * po/gold.pot: Likewise.
16600
154e0e9a
ILT
166012008-04-14 Ian Lance Taylor <iant@google.com>
16602
16603 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
16604 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
16605 in the name/type/flags to section mapping. Don't call
16606 allocate_output_section.
16607 (Layout::choose_output_section): Change parameter from adjust_name
16608 to is_input_section. Don't permit input sections after sections
16609 are attached to segments. Don't call allocate_output_section.
16610 (Layout::layout_eh_frame): Call update_flags_for_input_section,
16611 not write_enable_output_section.
16612 (Layout::make_output_section): Don't push to
16613 unattached_section_list_ nor call attach_to_segment. Call
16614 attach_section_to_segment if sections are attached.
16615 (Layout::attach_sections_to_segments): New function.
16616 (Layout::attach_section_to_segment): New function.
16617 (Layout::attach_allocated_section_to_segment): Rename from
16618 attach_to_segment. Remove flags parameter.
16619 (Layout::allocate_output_section): Remove function.
16620 (Layout::write_enable_output_section): Remove function.
16621 * layout.h (class Layout): Update for above changes. Add new
16622 field sections_are_attached_.
16623 * output.h (Output_section::update_flags_for_input_section): New
16624 function.
16625 * output.cc (Output_section::add_input_section): Call
16626 update_flags_for_input_section.
16627 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
16628
009a67a2
CC
166292008-04-11 Cary Coutant <ccoutant@google.com>
16630
16631 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
16632 thought unnecessary.
16633 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
16634
759b1a24
ILT
166352008-04-11 Ian Lance Taylor <iant@google.com>
16636
16637 * output.h (class Output_section_data): Remove inline definition
16638 of set_addralign.
16639 * output.cc (Output_section_data::set_addralign): New function.
16640
c2b45e22
CC
166412008-04-11 Cary Coutant <ccoutant@google.com>
16642
16643 Add support for TLS descriptors for i386 and x86_64.
16644 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
16645 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
16646 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
16647 GOT_TYPE_TLS_DESC.
16648 (Target_i386::got_mod_index_entry): Remove unnecessary code.
16649 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
16650 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
16651 relocations.
16652 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
16653 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
16654 Fix problem with initial-exec relocations.
16655 (Target_i386::Relocate::relocate_tls): Likewise.
16656 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
16657 relaxation.
16658 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
16659 support for section-plus-offset dynamic table entries.
16660 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
16661 (Output_data_dynamic::Dynamic_entry): Add support for
16662 section-plus-offset dynamic table entries.
16663 (Output_data_dynamic::Classification): Likewise.
16664 (Output_data_dynamic::classification_): Renamed offset_.
16665 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
16666 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
16667 (Target_x86_64::make_plt_section): New function.
16668 (Target_x86_64::reserve_tlsdesc_entries): New function.
16669 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
16670 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
16671 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
16672 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
16673 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
16674 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
16675 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
16676 add extra PLT entry for TLS descriptors.
16677 (Output_data_plt_x86_64::got_): New field.
16678 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
16679 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
16680 fields.
16681 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
16682 descriptors.
16683 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
16684 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
16685 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
16686 R_386_TLS_DESC_CALL relocations.
16687 (Target_x86_64::Scan::global): Likewise.
16688 (Target_x86_64::do_finalize_sections): Add dynamic table entries
16689 for TLS descriptors.
16690 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
16691 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
16692 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
16693 GD-to-IE relaxation.
16694 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
16695 and TLS_DESCRIPTORS.
16696 * Makefile.in: Rebuild.
16697 * configure: Rebuild.
16698 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
16699 (tls_test_shared2.so): New target.
16700 (tls_shared_gd_to_ie_test_SOURCES): New variable.
16701 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
16702 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
16703 (tls_shared_gd_to_ie_test_LDADD): New variable.
16704 (tls_shared_gnu2_gd_to_ie_test): New target.
16705 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
16706 New targets.
16707 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
16708 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
16709 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
16710 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
16711 (tls_shared_gnu2_test): New target.
16712 (tls_test_gnu2_shared.so): New target.
16713 (tls_shared_gnu2_test_SOURCES): New variable.
16714 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
16715 (tls_shared_gnu2_test_LDFLAGS): New variable.
16716 (tls_shared_gnu2_test_LDADD): New variable.
16717 * testsuite/Makefile.in: Rebuild.
16718 * testsuite/Makefile.
16719
83bfb6b7
ILT
167202008-04-11 Ian Lance Taylor <iant@google.com>
16721
16722 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
16723 justsyms.t.
16724 * testsuite/Makefile.in: Rebuild.
16725
16726 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
16727 long.
16728 * testsuite/script_test_2.cc (main): Adjust test.
16729
706e1f5e
ILT
167302008-04-11 David S. Miller <davem@davemloft.net>
16731 Ian Lance Taylor <iant@google.com>
16732
16733 * options.h (General_options): Add entries for '-Y' and
16734 '-relax'.
16735 * options.cc (General_options:finalize): If -Y was used, add those
16736 entries to the library path instead of the default "/lib" and
16737 "/usr/lib".
16738
7c98e6bb
DM
167392008-04-11 David S. Miller <davem@davemloft.net>
16740
16741 * testsuite/justsyms.t: Start at 0x100.
16742 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
16743 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
16744 long.
16745 * testsuite/script_test_2.cc: Adjust string and section length
16746 checks.
7c98e6bb 16747
99a37bfd
ILT
167482008-04-09 Ian Lance Taylor <iant@google.com>
16749
2cefc357
ILT
16750 PR gold/5996
16751 * script-sections.cc (Sections_element::allocate_to_segment): Add
16752 orphan parameter.
16753 (Output_section_definition::allocate_to_segment): Likewise.
16754 (Orphan_output_section::allocate_to_segment): Likewise.
16755 (Script_sections::attach_sections_using_phdrs_clause): Don't
16756 propagate non-PT_LOAD segments to orphan sections.
16757 * testsuite/Makefile.am (script_test_3.stdout): Generate using
16758 readelf rather than objdump.
16759 * testsuite/script_test_3.sh: Adjust accordingly. Test that
16760 .interp section and PT_INTERP segment are the same size.
16761 * testsuite/Makefile.in: Rebuild.
16762
99a37bfd
ILT
16763 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
16764 aliases for symbols defined in the same object.
16765 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
16766 (weak_alias_test_SOURCES): New variable.
16767 (weak_alias_test_DEPENDENCIES): New variable.
16768 (weak_alias_test_LDFLAGS): New variable.
16769 (weak_alias_test_LDADD): New variable.
16770 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
16771 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
16772 (weak_alias_test_3.o): New target.
16773 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
16774 * testsuite/weak_alias_test_main.cc: New file.
16775 * testsuite/weak_alias_test_1.cc: New file.
16776 * testsuite/weak_alias_test_2.cc: New file.
16777 * testsuite/weak_alias_test_3.cc: New file.
16778
780e49c5
ILT
167792008-04-08 Ian Lance Taylor <iant@google.com>
16780
cdb0b8f5
ILT
16781 * options.h (class General_options): Add --noinhibit-exec option.
16782 * main.cc (main): Check --noinhibit-exec.
16783
0864d551
ILT
16784 * options.h (class General_options): Define --wrap as a special
16785 option. Add wrap_symbols_ field.
16786 (General_options::any_wrap_symbols): New function.
16787 (General_options::is_wrap_symbol): New function.
16788 * options.cc (General_options::parse_wrap): New function.
16789 (General_options::General_options): Initialize wrap_symbols_.
16790 * symtab.cc (Symbol_table::wrap_symbol): New function.
16791 (Symbol_table::add_from_object): Handle --wrap.
16792 * symtab.h (class Symbol_table): Declare wrap_symbol.
16793 * target.h (Target::wrap_char): New function.
16794 (Target::Target_info): Add wrap_char field.
16795 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
16796 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
16797 * testsuite/testfile.cc (Target_test::test_target_info):
16798 Likewise.
16799
789aa6de
ILT
16800 * errors.cc (Errors::undefined_symbol): Mention symbol version if
16801 there is one.
16802
2c38906f
ILT
16803 * layout.h (class Layout): Add added_eh_frame_data_ field.
16804 * layout.cc (Layout::Layout): Initialize new field.
16805 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
16806 output section until we find a section we merged successfully.
16807 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
16808 that the size be non-zero.
16809
780e49c5
ILT
16810 * merge.cc (Object_merge_map::get_output_offset): Remove inline
16811 qualifier.
16812
7fcd0256
ILT
168132008-04-08 Craig Silverstein <csilvers@google.com>
16814
16815 * configure.ac: Export new conditional variable HAVE_ZLIB.
16816 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
16817 on HAVE_ZLIB.
16818 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
16819 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16820
6835af53
ILT
168212008-04-07 Ian Lance Taylor <iant@google.com>
16822
e24f324c
ILT
16823 * version.cc (version_string): Set to "1.5".
16824
a036edd8
ILT
16825 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
16826 Add issued_non_pic_error_ field. Declare check_non_pic.
16827 (Target_x86_64::Scan::check_non_pic): New function.
16828 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
16829 (Target_x86_64::Scan::global): Likewise.
16830
624f8810
ILT
16831 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
16832 addend parameter. Change caller. Handle merge sections.
16833 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
16834 Address to Addend. Don't add in the result of
16835 local_section_offset, pass down the addend and use the returned
16836 value.
16837 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
16838 Update declarations of local_section_offset and symbol_value.
16839 * testsuite/two_file_test_1.cc (t18): New function.
16840 * testsuite/two_file_test_2.cc (f18): New function.
16841 * testsuite/two_file_test_main.cc (main): Call t18.
16842 * testsuite/two_file_test.h (t18, f18): Declare.
16843
6835af53
ILT
16844 * configure.ac: Don't test for objdump, c++filt, or readelf.
16845 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
16846 conditionals.
16847 (TEST_READELF): New variable.
16848 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
16849 (check_PROGRAMS): Add two_file_strip_test.
16850 (two_file_strip_test): New target.
16851 (check_PROGRAMS): Add two_file_same_shared_strip_test.
16852 (two_file_same_shared_strip_test_SOURCES): New variable.
16853 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
16854 (two_file_same_shared_strip_test_LDFLAGS): New variable.
16855 (two_file_same_shared_strip_test_LDADD): New variable.
16856 (two_file_shared_strip.so): New target.
16857 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
16858 (ver_test_5.syms, ver_test_7.syms): Likewise.
16859 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
16860 (strip_test_3.stdout): Use TEST_OBJDUMP.
16861 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16862
86925eef
CC
168632008-04-04 Cary Coutant <ccoutant@google.com>
16864
16865 * symtab.h (Symbol::is_weak_undefined): New function.
16866 (Symbol::is_strong_undefined): New function.
16867 (Symbol::is_absolute): New function.
16868 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
16869 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
16870 absolute symbols.
16871 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
16872 (weak_undef_test): New target.
16873 * testsuite/Makefile.in: Rebuild.
16874 * testsuite/weak_undef_file1.cc: New file.
16875 * testsuite/weak_undef_file2.cc: New file.
16876 * testsuite/weak_undef_test.cc: New file.
16877
126f3ece
ILT
168782008-04-03 Craig Silverstein <csilvers@google.com>
16879
16880 * compressed_output.h (class Output_compressed_section): Use
16881 unsigned buffer.
16882 * compressed_output.cc (zlib_compress): Use unsigned buffers,
16883 add zlib header.
16884 (zlib_compressed_suffix): Removed.
16885 (Output_compressed_section::set_final_data_size): Use unsigned
16886 buffers.
16887 * testsuite/Makefile.am (flagstest_compress_debug_sections):
16888 Fix linker invocation.
16889 (flagstest_o_specialfile_and_compress_debug_sections):
16890 Likewise.
16891 * testsuite/Makefile.in: Regenerated.
16892
deae2a14
DM
168932008-04-02 David S. Miller <davem@davemloft.net>
16894
16895 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
16896 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
16897
70752818
ILT
168982008-04-02 Craig Silverstein <csilvers@google.com>
16899
16900 * TODO: New file.
16901
39d0cb0e
ILT
169022008-04-02 Ian Lance Taylor <iant@google.com>
16903
16904 * fileread.cc (File_read::find_view): Add byteshift and vshifted
16905 parameters. Update for new key type to views_. Change all
16906 callers.
16907 (File_read::read): Adjust for byteshift in returned view.
16908 (File_read::add_view): New function, broken out of
16909 find_and_make_view.
16910 (File_read::make_view): New function, broken out of
16911 find_and_make_view.
16912 (File_read::find_or_make_view): Add offset and aligned
16913 parameters. Rewrite accordingly. Change all callers.
16914 (File_read::get_view): Add offset and aligned parameters. Adjust
16915 for byteshift in return value.
16916 (File_read::get_lasting_view): Likewise.
16917 * fileread.h (class File_read): Update declarations.
16918 (class File_read::View): Add byteshift_ field. Add byteshift to
16919 constructor. Add byteshift method.
16920 * archive.h (Archive::clear_uncached_views): New function.
16921 (Archive::get_view): Add aligned parameter. Change all callers.
16922 * object.h (Object::get_view): Add aligned parameter. Change all
16923 callers.
16924 (Object::get_lasting_view): Likewise.
16925
16926 * fileread.cc (File_read::release): Don't call clear_views if
16927 there are multiple objects.
16928 * fileread.h (File_read::clear_uncached_views): New function.
16929 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
16930 on the archive.
16931
a1207466
CC
169322008-03-31 Cary Coutant <ccoutant@google.com>
16933
16934 Add thin archive support.
16935 * archive.cc (Archive::armagt): New const.
16936 (Archive::setup): Remove task parameter and calls to unlock.
16937 (Archive::unlock_nested_archives): New function.
16938 (Archive::read_header): Add nested_off parameter. Change
16939 all callers.
16940 (Archive::interpret_header): Likewise.
16941 (Archive::include_all_members): Change to handle thin
16942 archives.
16943 (Archive::include_member): Likewise.
16944 * archive.h (Archive::Archive): Add new parameters and
16945 initializers.
16946 (Archive::armagt): New const.
16947 (Archive::setup): Remove task parameter.
16948 (Archive::unlock_nested_archives): New function.
16949 (Archive::read_header): Add nested_off parameter.
16950 (Archive::interpret_header): Likewise.
16951 (Archive::Nested_archive_table): New typedef.
16952 (Archive::is_thin_archive_): New field.
16953 (Archive::nested_archives_): New field.
16954 (Archive::options_): New field.
16955 (Archive::dirpath_): New field.
16956 (Archive::task_): New field.
16957 * readsyms.cc (Read_symbols::do_read_symbols): Add check
16958 for thin archives. Pass additional parameters to
16959 Archive::Archive. Unlock the archive file after calling
16960 Archive::setup.
cd536b21 16961
479f6503
ILT
169622008-03-29 Ian Lance Taylor <iant@google.com>
16963
686c8caf
ILT
16964 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
16965 version symbol to be local.
16966 * testsuite/ver_test_4.sh: New file.
16967 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
16968 (check_DATA): Add ver_test_4.syms.
16969 (ver_test_4.syms): New target.
16970 * testsuite/Makefile.in: Rebuild.
16971
ab794b6b
ILT
16972 * output.cc
16973 (Output_section::Input_section_sort_entry::has_priority): New
16974 function.
16975 (Output_section::Input_section_sort_entry::match_file_name): New
16976 function.
16977 (Output_section::Input_section_sort_entry::match_section_name):
16978 Remove.
16979 (Output_section::Input_section_sort_entry::match_section_name_prefix):
16980 Remove.
16981 (Output_section::Input_section_sort_entry::match_section_file):
16982 Remove.
16983 (Output_section::Input_section_sort_compare::operator()): Rewrite
16984 using new Input_section_sort_entry functions. Sort crtbegin and
16985 crtend first. Sort sections with no priority before sections with
16986 a priority.
16987 * testsuite/initpri1.c (d3): Check j != 4.
16988 (cd5): New constructor/destructor function.
16989 (main): Check j != 2.
16990
479f6503
ILT
16991 * symtab.cc (Symbol_table::add_from_object): If we don't use the
16992 new symbol when resolving, don't call set_is_default.
16993 * testsuite/ver_test_7.cc: New file.
16994 * testsuite/ver_test_7.sh: New file.
16995 * testsuite/Makefile.am (ver_test_7.so): New target.
16996 (ver_test_7.o): New target.
16997 (check_SCRIPTS): Add ver_test_7.sh.
16998 (check_DATA): Add ver_test_7.syms.
16999 (ver_test_7.syms): New target.
17000
2fd32231
ILT
170012008-03-28 Ian Lance Taylor <iant@google.com>
17002
17003 * layout.cc (Layout::layout): If we see an input section with a
17004 name that needs sorting, set the must_sort flag for the output
17005 section.
17006 (Layout::make_output_section): If the name of the output section
17007 indicates that it might require sorting, set the may_sort flag.
17008 * output.h (Output_section::may_sort_attached_input_sections): New
17009 function.
17010 (Output_section::set_may_sort_attached_input_sections): New
17011 function.
17012 (Output_section::must_sort_attached_input_sections): New
17013 function.
17014 (Output_section::set_must_sort_attached_input_sections): New
17015 function.
17016 (class Output_section): Declare Input_section_sort_entry. Define
17017 Input_section_sort_compare. Declare
17018 sort_attached_input_sections. Add new fields:
17019 may_sort_attached_input_sections_,
17020 must_sort_attached_input_sections_,
17021 attached_input_sections_are_sorted_.
17022 * output.cc (Output_section::Output_section): Initialize new
17023 fields.
17024 (Output_section::add_input_section): Add an entry to
17025 input_sections_ if may_sort or must_sort are true.
17026 (Output_section::set_final_data_size): Call
17027 sort_attached_input_sections if necessary.
17028 (Output_section::Input_section_sort_entry): Define new class.
17029 (Output_section::Input_section_sort_compare::operator()): New
17030 function.
17031 (Output_section::sort_attached_input_sections): New function.
17032 * configure.ac: Check whether the compiler supports constructor
17033 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
17034 * testsuite/initpri1.c: New file.
17035 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
17036 CONSTRUCTOR_PRIORITY.
17037 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
17038 (initpri1_LDFLAGS): New variable.
17039 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17040
18e6b24e
ILT
170412008-03-27 Ian Lance Taylor <iant@google.com>
17042
49bdd526
ILT
17043 * common.cc (Sort_commons::operator): Correct sorting algorithm.
17044 * testsuite/common_test_1.c: New file.
17045 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
17046 (common_test_1_SOURCES): New variable.
17047 (common_test_1_DEPENDENCIES): New variable.
17048 (common_test_1_LDFLAGS): New variable.
17049
18e6b24e
ILT
17050 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
17051 and commons_ correctly when NAME/VERSION does not override
17052 NAME/NULL.
17053 * testsuite/ver_test_6.c: New file.
17054 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
17055 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
17056 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
17057
04bf7072
ILT
170582008-03-26 Ian Lance Taylor <iant@google.com>
17059
5871526f
ILT
17060 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
17061 of an undefined symbol from a version script.
17062 * testsuite/Makefile.am (ver_test_5.so): New target.
17063 (ver_test_5.o): New target.
17064 (check_SCRIPTS): Add ver_test_5.sh.
17065 (check_DATA): Add ver_test_5.syms.
17066 (ver_test_5.syms): New target.
17067 * testsuite/ver_test_5.cc: New file.
17068 * testsuite/ver_test_5.script: New file.
17069 * testsuite/ver_test_5.sh: New file.
17070 * Makefile.in, testsuite/Makefile.in: Rebuild.
17071
04bf7072
ILT
17072 PR gold/5986
17073 Fix problems building gold with gcc 4.3.0.
17074 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
17075 (gold_error_at_location, gold_warning_at_location): Use it.
17076 * configure.ac: Check whether we can compile and use a template
17077 function with a printf attribute.
17078 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
17079 when jumping over bytes.
17080 * object.cc: Instantiate Object::read_section_data.
17081 * debug.h: Include <cstring>
17082 * dwarf_reader.cc: Include <algorithm>
17083 * main.cc: Include <cstring>.
17084 * options.cc: Include <cstring>.
17085 * output.cc: Include <cstring>.
17086 * script.cc: Include <cstring>.
17087 * script.h: Include <string>.
17088 * symtab.cc: Include <cstring> and <algorithm>.
17089 * target-select.cc: Include <cstring>.
17090 * version.cc: Include <string>.
17091 * testsuite/testmain.cc: Include <cstdlib>.
17092 * configure, config.in: Rebuild.
17093
874c5b28
ILT
170942008-03-25 Ian Lance Taylor <iant@google.com>
17095
819d6c3a
ILT
17096 * options.cc: Include "../bfd/bfdver.h".
17097 (options::help): Print bug reporting address.
17098
f4b2c6f5
ILT
17099 * version.cc (print_version): Adjust output for current value of
17100 BFD_VERSION_STRING.
17101
17102 * NEWS: New file.
17103
e96caa79
ILT
17104 * options.cc (options::help): Print list of supported targets.
17105 * target-select.h: Include <vector>.
17106 (class Target_selector): Make machine_, size_, and is_big_endian_
17107 fields const. Add bfd_name_ and instantiated_target_ fields.
17108 (Target_selector::Target_selector): Add bfd_name parameter.
17109 (Target_selector::recognize): Make non-virtual, call
17110 do_recognize.
17111 (Target_selector::recognize_by_name): Make non-virtual, call
17112 do_recognize_by_name.
17113 (Target_selector::supported_names): New function.
17114 (Target_selector::bfd_name): New function.
17115 (Target_selector::do_instantiate_target): New pure virtual
17116 function.
17117 (Target_selector::do_recognize): New virtual function.
17118 (Target_selector::do_recognize_by_name): New virtual function.
17119 (Target_selector::instantiate_target): New private function.
17120 (supported_target_names): Declare.
17121 * target-select.cc (Target_selector::Target_selector): Update for
17122 new parameter and fields.
17123 (select_target_by_name): Check that the name matches before
17124 calling recognize_by_name.
17125 (supported_target_names): New function.
17126 * i386.cc (class Target_selector_i386): Update Target_selector
17127 constructor call. Remove recognize and recognize_by_name. Add
17128 do_instantiate_target.
17129 * x86_64.cc (class Target_selector_x86_64): Likewise.
17130 * testsuite/testfile.cc (class Target_selector_test): Update for
17131 changes to Target_selector.
17132
874c5b28
ILT
17133 * README: Rewrite, with some notes on unsupported features.
17134
0a65a3a7
CC
171352008-03-24 Cary Coutant <ccoutant@google.com>
17136
17137 * i386.cc (Target_i386::Got_type): New enum declaration.
17138 (Target_i386::Scan::local): Updated callers of Output_data_got
17139 member functions.
17140 (Target_i386::Scan::global): Likewise.
17141 (Target_i386::Relocate::relocate): Likewise.
17142 (Target_i386::Relocate::relocate_tls): Likewise.
17143 * object.h (Got_offset_list): New class.
17144 (Sized_relobj::local_has_got_offset): Added got_type parameter.
17145 (Sized_relobj::local_got_offset): Likewise.
17146 (Sized_relobj::set_local_got_offset): Likewise.
17147 (Sized_relobj::local_has_tls_got_offset): Removed.
17148 (Sized_relobj::local_tls_got_offset): Removed.
17149 (Sized_relobj::set_local_tls_got_offset): Removed.
17150 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
17151 * output.cc (Output_data_got::add_global): Added got_type parameter.
17152 (Output_data_got::add_global_with_rel): Likewise.
17153 (Output_data_got::add_global_with_rela): Likewise.
17154 (Output_data_got::add_global_pair_with_rel): New function.
17155 (Output_data_got::add_global_pair_with_rela): New function.
17156 (Output_data_got::add_local): Added got_type parameter.
17157 (Output_data_got::add_local_with_rel): Likewise.
17158 (Output_data_got::add_local_with_rela): Likewise.
17159 (Output_data_got::add_local_pair_with_rel): New function.
17160 (Output_data_got::add_local_pair_with_rela): New function.
17161 (Output_data_got::add_global_tls): Removed.
17162 (Output_data_got::add_global_tls_with_rel): Removed.
17163 (Output_data_got::add_global_tls_with_rela): Removed.
17164 (Output_data_got::add_local_tls): Removed.
17165 (Output_data_got::add_local_tls_with_rel): Removed.
17166 (Output_data_got::add_local_tls_with_rela): Removed.
17167 * output.h (Output_data_got::add_global): Added got_type parameter.
17168 (Output_data_got::add_global_with_rel): Likewise.
17169 (Output_data_got::add_global_with_rela): Likewise.
17170 (Output_data_got::add_global_pair_with_rel): New function.
17171 (Output_data_got::add_global_pair_with_rela): New function.
17172 (Output_data_got::add_local): Added got_type parameter.
17173 (Output_data_got::add_local_with_rel): Likewise.
17174 (Output_data_got::add_local_with_rela): Likewise.
17175 (Output_data_got::add_local_pair_with_rel): New function.
17176 (Output_data_got::add_local_pair_with_rela): New function.
17177 (Output_data_got::add_global_tls): Removed.
17178 (Output_data_got::add_global_tls_with_rel): Removed.
17179 (Output_data_got::add_global_tls_with_rela): Removed.
17180 (Output_data_got::add_local_tls): Removed.
17181 (Output_data_got::add_local_tls_with_rel): Removed.
17182 (Output_data_got::add_local_tls_with_rela): Removed.
17183 * resolve.cc (Symbol::override_base_with_special): Removed
17184 reference to has_got_offset_ field.
17185 * symtab.cc (Symbol::init_fields): Replaced initialization
17186 of got_offset_ with got_offsets_. Removed initialization
17187 of has_got_offset_
53fcba31 17188 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
17189 (Symbol::got_offset): Likewise.
17190 (Symbol::set_got_offset): Likewise.
17191 (Symbol::has_tls_got_offset): Removed.
17192 (Symbol::tls_got_offset): Removed.
17193 (Symbol::set_tls_got_offset): Removed.
17194 (Symbol::got_offset_): Removed.
17195 (Symbol::tls_mod_got_offset_): Removed.
17196 (Symbol::tls_pair_got_offset_): Removed.
17197 (Symbol::got_offsets_): New field.
17198 (Symbol::has_got_offset): Removed.
17199 (Symbol::has_tls_mod_got_offset): Removed.
17200 (Symbol::has_tls_pair_got_offset): Removed.
17201 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
17202 (Target_x86_64::Scan::local): Updated callers of Output_data_got
17203 member functions.
17204 (Target_x86_64::Scan::global): Likewise.
17205 (Target_x86_64::Relocate::relocate): Likewise.
17206 (Target_x86_64::Relocate::relocate_tls): Likewise.
17207
bd52eafb
BE
172082008-03-25 Ben Elliston <bje@au.ibm.com>
17209
17210 * yyscript.y: Fix spelling error in comment.
17211
8b105e34
ILT
172122008-03-24 Ian Lance Taylor <iant@google.com>
17213
8ed814a9
ILT
17214 * options.h (class General_options): Define build_id option.
17215 * layout.h (class Layout): Declare write_build_id, create_note,
17216 create_build_id. Add build_id_note_ member.
17217 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
17218 "libiberty.h", "md5.h", "sha1.h".
17219 (Layout::Layout): Initialize eh_frame_data_,
17220 eh_frame_hdr_section_, and build_id_note_.
17221 (Layout::finalize): Call create_build_id.
17222 (Layout::create_note): New function, broken out of
17223 Layout::create_gold_note.
17224 (Layout::create_gold_note): Call create_note.
17225 (Layout::create_build_id): New function.
17226 (Layout::write_build_id): New function.
17227 (Close_task_runner::run): Call write_build_id.
17228
8b105e34
ILT
17229 * x86_64.cc: Correct license to GPLv3.
17230
086a1841
ILT
172312008-03-23 Ian Lance Taylor <iant@google.com>
17232
17233 * options.cc: Include "demangle.h".
17234 (parse_optional_string): New function.
17235 (parse_long_option): Handle takes_optional_argument.
17236 (parse_short_option): Update dash_z initializer. Handle
17237 takes_optional_argument.
17238 (General_options::General_options): Initialize do_demangle_.
17239 (General_options::finalize): Set do_demangle_. Handle demangling
17240 style.
17241 * options.h (parse_optional_string): Declare.
17242 (struct One_option): Add optional_arg field. Update constructor.
17243 Update call constructor calls. Add takes_optional_argument
17244 function.
17245 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
17246 (DEFINE_optional_string): Define.
17247 (General_options::demangle): Change from DEFINE_bool to
17248 DEFINE_optional_string.
17249 (General_options::no_demangle): New function.
17250 (General_options::do_demangle): New function.
17251 (General_options::set_do_demangle): New function.
17252 (General_options::execstack_status_): Move definition to end of
17253 class definition.
17254 (General_options::static_): Likewise.
17255 (General_options::do_demangle_): New field.
17256 * object.cc (big_endian>::get_symbol_location_info): Call
17257 Options::do_demangle, not Options::demangle.
17258 * symtab.cc (demangle): Likewise.
17259
cbb93e63
ILT
172602008-03-22 Ian Lance Taylor <iant@google.com>
17261
17262 * gold.h: Include <cstddef> and <sys/types.h>
17263 * options.h: Include <cstring>.
17264
ec531623
ILT
172652008-03-21 Ian Lance Taylor <iant@google.com>
17266
17267 * Added source code to GNU binutils.
752937aa 17268\f
b90efa5b 17269Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
17270
17271Copying and distribution of this file, with or without modification,
17272are permitted in any medium without royalty provided the copyright
17273notice and this notice are preserved.
17274
17275Local Variables:
17276mode: change-log
17277left-margin: 8
17278fill-column: 74
17279version-control: never
17280End:
This page took 1.105054 seconds and 4 git commands to generate.